aboutsummaryrefslogtreecommitdiff
path: root/eval.h
diff options
context:
space:
mode:
authorShinichiro Hamaji <shinichiro.hamaji@gmail.com>2015-06-23 16:51:07 +0900
committerShinichiro Hamaji <shinichiro.hamaji@gmail.com>2015-06-23 20:27:40 +0900
commitffc52c3c5bed9d696d0296c1674d2e75460bef40 (patch)
tree7364bea9749e3de9fcf308b9c4b825e7425b881a /eval.h
parent9042b995db7f0b9499e0c3087269505e5e817a58 (diff)
downloadkati-ffc52c3c5bed9d696d0296c1674d2e75460bef40.tar.gz
[C++] Let target specific variable have its own scope
Diffstat (limited to 'eval.h')
-rw-r--r--eval.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/eval.h b/eval.h
index a9be28f..70d5466 100644
--- a/eval.h
+++ b/eval.h
@@ -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_;