|
Ninja
|
An Env which contains a mapping of variables to values as well as a pointer to a parent scope. More...
#include <eval_env.h>

Public Member Functions | |
| void | AddBinding (const std::string &key, const std::string &val) |
| void | AddRule (std::unique_ptr< const Rule > rule) |
| BindingEnv () | |
| BindingEnv (BindingEnv *parent) | |
| const std::map< std::string, std::unique_ptr< const Rule > > & | GetRules () const |
| const Rule * | LookupRule (const std::string &rule_name) |
| const Rule * | LookupRuleCurrentScope (const std::string &rule_name) |
| virtual std::string | LookupVariable (const std::string &var) |
| std::string | LookupWithFallback (const std::string &var, const EvalString *eval, Env *env) |
| This is tricky. More... | |
| virtual | ~BindingEnv () |
Private Attributes | |
| std::map< std::string, std::string > | bindings_ |
| BindingEnv * | parent_ |
| std::map< std::string, std::unique_ptr< const Rule > > | rules_ |
An Env which contains a mapping of variables to values as well as a pointer to a parent scope.
Definition at line 93 of file eval_env.h.
|
inline |
Definition at line 94 of file eval_env.h.
|
inlineexplicit |
Definition at line 95 of file eval_env.h.
|
inlinevirtual |
Definition at line 97 of file eval_env.h.
| void BindingEnv::AddBinding | ( | const std::string & | key, |
| const std::string & | val | ||
| ) |
Definition at line 30 of file eval_env.cc.
Referenced by ManifestParser::Parse(), ManifestParser::ParseEdge(), and DyndepLoader::UpdateEdge().
| void BindingEnv::AddRule | ( | std::unique_ptr< const Rule > | rule | ) |
Definition at line 34 of file eval_env.cc.
Referenced by ManifestParser::ParseRule().
| const map< string, std::unique_ptr< const Rule > > & BindingEnv::GetRules | ( | ) | const |
Definition at line 91 of file eval_env.cc.
| const Rule * BindingEnv::LookupRule | ( | const std::string & | rule_name | ) |
Definition at line 46 of file eval_env.cc.
Referenced by Cleaner::CleanRule(), Cleaner::CleanRules(), and ManifestParser::ParseEdge().
| const Rule * BindingEnv::LookupRuleCurrentScope | ( | const std::string & | rule_name | ) |
Definition at line 39 of file eval_env.cc.
Referenced by ManifestParser::ParseRule().
|
virtual |
| string BindingEnv::LookupWithFallback | ( | const std::string & | var, |
| const EvalString * | eval, | ||
| Env * | env | ||
| ) |
This is tricky.
Edges want lookup scope to go in this order: 1) value set on edge itself (edge_->env_) 2) value set on rule, with expansion in the edge's scope 3) value set on enclosing scope of edge (edge_->env_->parent_) This function takes as parameters the necessary info to do (2).
Definition at line 95 of file eval_env.cc.
References EvalString::Evaluate().
|
private |
Definition at line 116 of file eval_env.h.
|
private |
Definition at line 118 of file eval_env.h.
|
private |
Definition at line 117 of file eval_env.h.