11 using namespace reranker;
14 main(
int argc,
char **argv) {
15 cout <<
"Here is a list of abstract types and the concrete implementations\n"
16 <<
"you can construct:" << endl;
23 cout <<
"\nHello! Please type assignment statements.\n" << endl;
26 interpreter.
Eval(argv[1]);
28 interpreter.
Eval(cin);
31 cout <<
"\nNow doing some hard-coded testing, looking to see if you\n"
32 <<
"set a variable named \"f\" to have a boolean value." << endl;
35 bool success = interpreter.
Get(
"f", &value_for_f);
37 cout <<
"Success! f=" << (value_for_f ?
"true" :
"false") << endl;
39 cout <<
":( ... no boolean value for variable f" << endl;
42 cout <<
"\n\nEnvironment: " << endl;
45 cout <<
"\nHave a nice day!\n" << endl;
void Eval(const string &filename)
Evaluates the statements in the specified text file.
void PrintFactories(ostream &os) const
int main(int argc, char **argv)
Provides an interpreter for assigning primitives and Factory-constructible objects to named variables...
Provides an interpreter for assigning primitives and Factory-constructible objects to named variables...
void PrintEnv(ostream &os) const
bool Get(const string &varname, T *value) const
Retrieves the value of the specified variable.