41 using namespace infact;
44 main(
int argc,
char **argv) {
45 cout <<
"Here is a list of abstract types and the concrete implementations\n"
46 <<
"you can construct:" << endl;
49 cout <<
"Debug level: " << debug << endl;
56 cout <<
"\nHello! Please type assignment statements.\n" << endl;
59 interpreter.
Eval(argv[1]);
61 interpreter.
Eval(cin);
64 cout <<
"\nNow doing some hard-coded testing, looking to see if you\n"
65 <<
"set a variable named \"f\" to have a boolean value." << endl;
68 bool success = interpreter.
Get(
"f", &value_for_f);
70 cout <<
"Success! f=" << (value_for_f ?
"true" :
"false") << endl;
72 cout <<
":( ... no boolean value for variable f" << endl;
75 cout <<
"\n\nEnvironment: " << endl;
78 cout <<
"\nHave a nice day!\n" << endl;
void PrintFactories(ostream &os) const
Provides an interpreter for assigning primitives and Factory-constructible objects to named variables...
void Eval(const string &filename)
Evaluates the statements in the specified text file.
bool Get(const string &varname, T *value) const
Retrieves the value of the specified variable.
void PrintEnv(ostream &os) const
int main(int argc, char **argv)
Provides an interpreter for assigning primitives and Factory-constructible objects to named variables...