diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2009-09-05 16:29:23 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2009-09-05 16:29:23 +0200 |
commit | 4974b4763bd60eb875f93a71dbe2fe82ecfed9fc (patch) | |
tree | 9353fb3fec3fa5f77f1faaf6da8185e3d006e7ba /cli/parser.hxx | |
parent | e2299f6d95ba3264072d6ddc49f153ad73fd9d24 (diff) | |
download | cli-4974b4763bd60eb875f93a71dbe2fe82ecfed9fc.tar.gz cli-4974b4763bd60eb875f93a71dbe2fe82ecfed9fc.tar.xz cli-4974b4763bd60eb875f93a71dbe2fe82ecfed9fc.zip |
Add semantic graph and traversal mechanism
The parser now builds the semantic graph.
Diffstat (limited to 'cli/parser.hxx')
-rw-r--r-- | cli/parser.hxx | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/cli/parser.hxx b/cli/parser.hxx index f09816f..458efbc 100644 --- a/cli/parser.hxx +++ b/cli/parser.hxx @@ -7,8 +7,12 @@ #define CLI_PARSER_HXX #include <string> +#include <memory> // std::auto_ptr #include <istream> +#include <semantics/elements.hxx> +#include <semantics/unit.hxx> + class token; class lexer; @@ -17,7 +21,7 @@ class parser public: struct invalid_input {}; - void + std::auto_ptr<semantics::cli_unit> parse (std::istream& is, std::string const& id); private: @@ -42,10 +46,10 @@ private: option_def (token&); bool - qualified_name (token&); + qualified_name (token&, std::string& name); bool - fundamental_type (token&); + fundamental_type (token&, std::string& name); private: void @@ -53,8 +57,12 @@ private: private: bool valid_; - lexer* lexer_; std::string const* id_; + + lexer* lexer_; + + semantics::cli_unit* unit_; + semantics::scope* scope_; }; #endif // CLI_PARSER_HXX |