15 #ifndef NINJA_EVAL_ENV_H_ 16 #define NINJA_EVAL_ENV_H_ 30 virtual string LookupVariable(
const string& var) = 0;
36 string Evaluate(
Env* env)
const;
38 void Clear() { parsed_.clear(); }
39 bool empty()
const {
return parsed_.empty(); }
46 string Serialize()
const;
56 explicit Rule(
const string& name) : name_(name) {}
58 const string&
name()
const {
return name_; }
60 void AddBinding(
const string& key,
const EvalString& val);
62 static bool IsReservedBinding(
const string& var);
64 const EvalString* GetBinding(
const string& key)
const;
82 virtual string LookupVariable(
const string& var);
84 void AddRule(
const Rule* rule);
85 const Rule* LookupRule(
const string& rule_name);
86 const Rule* LookupRuleCurrentScope(
const string& rule_name);
87 const map<string, const Rule*>& GetRules()
const;
89 void AddBinding(
const string& key,
const string& val);
96 string LookupWithFallback(
const string& var,
const EvalString* eval,
105 #endif // NINJA_EVAL_ENV_H_ BindingEnv(BindingEnv *parent)
vector< pair< string, TokenType > > TokenList
map< string, const Rule * > rules_
map< string, string > bindings_
StringPiece represents a slice of a string whose memory is managed externally.
An Env which contains a mapping of variables to values as well as a pointer to a parent scope...
An invokable build command and associated metadata (description, etc.).
map< string, EvalString > Bindings
const string & name() const
A tokenized string that contains variable references.
An interface for a scope for variable (e.g. "$foo") lookups.