37 #ifndef RERANKER_INTERPRETER_H_ 
   38 #define RERANKER_INTERPRETER_H_ 
   43 #include <unordered_map> 
   44 #include <unordered_set> 
   53 class EnvironmentImpl;
 
  180   void Eval(
const string &filename) {
 
  181     filename_ = filename;
 
  182     ifstream file(filename_.c_str());
 
  217   bool Get(
const string &varname, T *value)
 const {
 
  218     return env_->
Get(varname, value);
 
  233   void WrongTokenError(
size_t pos,
 
  234                        const string &expected,
 
  238   void WrongTokenTypeError(
size_t pos,
 
  241                            const string &token) 
const;
 
  243   void WrongTokenTypeError(
size_t pos,
 
  244                            const string &expected_type,
 
  245                            const string &found_type,
 
  246                            const string &token) 
const;
 
A simple class for tokenizing a stream of tokens for the formally specified language used to construc...
 
void Eval(const string &filename)
Evaluates the statements in the specified text file. 
 
virtual void PrintFactories(ostream &os) const 
Prints out a human-readable string with the names of all abstract base types and their concrete imple...
 
void PrintFactories(ostream &os) const 
 
virtual ~Interpreter()
Destroys this interpreter. 
 
virtual void Print(ostream &os) const 
Prints a human-readable string of all the variables in this environment, their types and...
 
bool Get(const string &varname, T *value) const 
Retrieves the value of the variable with the specified name and puts into into the object pointed to ...
 
Provides a set of named variables and their types, as well as the values for those variables...
 
Interpreter(int debug=0)
Constructs a new instance with the specified debug level. 
 
Provides an environment for variables and their values, either primitive or Factory-constructible obj...
 
Provides an interpreter for assigning primitives and Factory-constructible objects to named variables...
 
void Eval(istream &is)
Evaluates the statements in the specified stream. 
 
TokenType
The set of types of tokens read by this stream tokenizer. 
 
void PrintEnv(ostream &os) const 
 
void EvalString(const string &input)
Evaluates the statements in the specified string. 
 
EnvironmentImpl * env()
Returns a pointer to the environment of this interpreter. 
 
bool Get(const string &varname, T *value) const 
Retrieves the value of the specified variable.