From 766a16131aaa89a576ae63dcf12ab6ad467d6655 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 14 May 2007 11:08:50 +0000 Subject: Begin work on splitting parsing into parse and compile phases. --- src/builder.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/builder.h') diff --git a/src/builder.h b/src/builder.h index b5577ac1..d6d30a6b 100644 --- a/src/builder.h +++ b/src/builder.h @@ -16,15 +16,17 @@ namespace ledger { */ class builder_t { - virtual void pushAttribute(const string& name, - const string& value) = 0; - virtual void pushAttribute(const nameid_t name_id, - const string& value) = 0; +public: + struct position_t + { + typedef uint_least32_t file_pos_t; + typedef uint_least32_t file_line_t; - virtual void beginNode(const string& name) = 0; - virtual void beginNode(const nameid_t name_id) = 0; + path pathname; + file_pos_t offset; + file_line_t linenum; - virtual void appendText(const string& text) = 0; + position_t() : offset(0), linenum(0) {} virtual node_t * endNode(const optional& name = none) = 0; virtual node_t * endNode(const nameid_t name_id) = 0; -- cgit v1.2.3