15 #ifndef NINJA_EVAL_ENV_H_ 16 #define NINJA_EVAL_ENV_H_ 54 typedef std::vector<std::pair<std::string, TokenType> >
TokenList;
75 typedef std::map<std::string, EvalString>
Bindings;
91 const std::map<std::string, const Rule*>&
GetRules()
const;
93 void AddBinding(
const std::string& key,
const std::string& val);
105 std::map<std::string, const Rule*>
rules_;
109 #endif // NINJA_EVAL_ENV_H_
std::string Evaluate(Env *env) const
virtual std::string LookupVariable(const std::string &var)=0
BindingEnv(BindingEnv *parent)
const std::map< std::string, const Rule * > & GetRules() const
const Rule * LookupRuleCurrentScope(const std::string &rule_name)
const EvalString * GetBinding(const std::string &key) const
Rule(const std::string &name)
std::vector< std::pair< std::string, TokenType > > TokenList
StringPiece represents a slice of a string whose memory is managed externally.
const std::string & name() const
An Env which contains a mapping of variables to values as well as a pointer to a parent scope...
static bool IsReservedBinding(const std::string &var)
void AddSpecial(StringPiece text)
void AddRule(const Rule *rule)
void AddBinding(const std::string &key, const EvalString &val)
An invokable build command and associated metadata (description, etc.).
std::string LookupWithFallback(const std::string &var, const EvalString *eval, Env *env)
This is tricky.
std::map< std::string, EvalString > Bindings
const Rule * LookupRule(const std::string &rule_name)
std::map< std::string, std::string > bindings_
std::string Serialize() const
Construct a human-readable representation of the parsed state, for use in tests.
void AddText(StringPiece text)
void AddBinding(const std::string &key, const std::string &val)
std::string Unparse() const
virtual std::string LookupVariable(const std::string &var)
std::map< std::string, const Rule * > rules_
A tokenized string that contains variable references.
An interface for a scope for variable (e.g. "$foo") lookups.