aboutsummaryrefslogtreecommitdiff
path: root/build/parser
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-04-13 10:29:25 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-04-13 10:29:25 +0200
commit534f9d8db025d58c9ce23f3b81a37e8c34386a27 (patch)
treee7d0c7871a7caf3b3e41c8d00548212f1ca7aa83 /build/parser
parentb4ceb7b6aecb7492b28d7a0f6c53fa657a2cd2e5 (diff)
Add initial import support
Diffstat (limited to 'build/parser')
-rw-r--r--build/parser17
1 files changed, 12 insertions, 5 deletions
diff --git a/build/parser b/build/parser
index 1597432..53ce2d0 100644
--- a/build/parser
+++ b/build/parser
@@ -54,6 +54,12 @@ namespace build
include (token&, token_type&);
void
+ import (token&, token_type&);
+
+ void
+ export_ (token&, token_type&);
+
+ void
using_ (token&, token_type&);
void
@@ -80,11 +86,13 @@ namespace build
// Utilities.
//
private:
- void
- process_default_target (token&);
+ // Switch to new root scope and return the previous one.
+ //
+ scope*
+ switch_root (scope*);
void
- create_inner_roots (const path&);
+ process_default_target (token&);
// Lexer.
//
@@ -112,10 +120,9 @@ namespace build
lexer* lexer_;
scope* scope_; // Current base scope (out_base).
scope* root_; // Current root scope (out_root).
- target* default_target_;
-
const path* out_root_;
const path* src_root_;
+ target* default_target_;
token peek_ {token_type::eos, false, 0, 0};
bool peeked_ {false};