diff options
author | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | 2015-06-23 16:51:07 +0900 |
---|---|---|
committer | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | 2015-06-23 20:27:40 +0900 |
commit | ffc52c3c5bed9d696d0296c1674d2e75460bef40 (patch) | |
tree | 7364bea9749e3de9fcf308b9c4b825e7425b881a /eval.h | |
parent | 9042b995db7f0b9499e0c3087269505e5e817a58 (diff) | |
download | kati-ffc52c3c5bed9d696d0296c1674d2e75460bef40.tar.gz |
[C++] Let target specific variable have its own scope
Diffstat (limited to 'eval.h')
-rw-r--r-- | eval.h | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -55,18 +55,22 @@ class Evaluator { // For target specific variables. Var* LookupVarInCurrentScope(StringPiece name); - EvalResult* GetEvalResult(); - const Loc& loc() const { return loc_; } + const vector<shared_ptr<Rule>>& rules() const { return rules_; } + const unordered_map<StringPiece, Vars*>& rule_vars() const { + return rule_vars_; + } Vars* mutable_vars() { return vars_; } void Error(const string& msg); void set_is_bootstrap(bool b) { is_bootstrap_ = b; } + void set_current_scope(Vars* v) { current_scope_ = v; } + private: - void DoAssign(StringPiece lhs, Value* rhs, StringPiece orig_rhs, AssignOp op); + Var* EvalRHS(StringPiece lhs, Value* rhs, StringPiece orig_rhs, AssignOp op); void DoInclude(const char* fname, bool should_exist); const Vars* in_vars_; |