From 4974b4763bd60eb875f93a71dbe2fe82ecfed9fc Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 5 Sep 2009 16:29:23 +0200 Subject: Add semantic graph and traversal mechanism The parser now builds the semantic graph. --- cli/parser.hxx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'cli/parser.hxx') 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 +#include // std::auto_ptr #include +#include +#include + class token; class lexer; @@ -17,7 +21,7 @@ class parser public: struct invalid_input {}; - void + std::auto_ptr 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 -- cgit v1.1