1
0
mirror of https://github.com/aportelli/LatAnalyze.git synced 2025-06-19 15:57:05 +01:00

Math interpreter: significant improvement of runtime context handling

This commit is contained in:
2014-09-26 18:41:30 +01:00
parent 0fdd76b19d
commit bbeaec9ed3
6 changed files with 288 additions and 100 deletions

View File

@ -33,21 +33,21 @@ int main(int argc, char* argv[])
}
cout << "-- Program:" << endl << interpreter << endl;
cout << "-- Variable table:" << endl;
for (auto &v: context.vTable)
for (auto &v: context.getVariableTable())
{
cout << "'" << v.first << "': " << v.second << endl;
}
cout << endl;
cout << "-- Function table:" << endl;
for (auto &f: context.fTable)
for (auto &f: context.getFunctionTable())
{
cout << "'" << f.first << "': " << f.second << endl;
}
cout << endl;
interpreter(context);
if (!context.dStack.empty())
if (!context.stack().empty())
{
cout << "-- Result: " << context.dStack.top() << endl;
cout << "-- Result: " << context.stack().top() << endl;
}
return EXIT_SUCCESS;