diff options
author | John Wiegley <johnw@newartisans.com> | 2007-05-14 11:08:50 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 03:38:49 -0400 |
commit | 766a16131aaa89a576ae63dcf12ab6ad467d6655 (patch) | |
tree | 2040e179524025c1d52d3f1d322425ffa2decd2e /src/builder.h | |
parent | 9044bf168ab0d8d6df03034898b1e5a4cb1559e8 (diff) | |
download | fork-ledger-766a16131aaa89a576ae63dcf12ab6ad467d6655.tar.gz fork-ledger-766a16131aaa89a576ae63dcf12ab6ad467d6655.tar.bz2 fork-ledger-766a16131aaa89a576ae63dcf12ab6ad467d6655.zip |
Begin work on splitting parsing into parse and compile phases.
Diffstat (limited to 'src/builder.h')
-rw-r--r-- | src/builder.h | 16 |
1 files changed, 9 insertions, 7 deletions
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<string>& name = none) = 0; virtual node_t * endNode(const nameid_t name_id) = 0; |