From 4f9022f24c4591391637121c7274d9855b37bd93 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 10 May 2012 11:09:13 +0200 Subject: Add support for options file inclusion New include-path prefixes, c++: and cli:, are now recognized (e.g., include ;). Without a prefix, the include declarations is considered to be c++-include unless the path ends with the .cli extension. The cli-included files are loaded and parsed. Currently, only inclusion relative to the current file is supported. Duplicate inclusions are detected and ignored based on the absolute filesystem path. If a file cli-includes another file, then the runtime code is assumed to come from the included file and is not generated. --- cli/parser.hxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'cli/parser.hxx') diff --git a/cli/parser.hxx b/cli/parser.hxx index 4e6c18f..c93b9a0 100644 --- a/cli/parser.hxx +++ b/cli/parser.hxx @@ -6,6 +6,7 @@ #ifndef CLI_PARSER_HXX #define CLI_PARSER_HXX +#include #include #include // std::auto_ptr #include @@ -61,8 +62,12 @@ private: lexer* lexer_; - semantics::cli_unit* unit_; + semantics::cli_unit* root_; + semantics::cli_unit* cur_; semantics::scope* scope_; + + typedef std::map include_map; + include_map include_map_; }; #endif // CLI_PARSER_HXX -- cgit v1.1