Expression Evaluator and Generator
To me, this assignment was a little bit of fun. We were tasked with reading an input file and evaluating what was found in the file, much the same way a compiler does for source code(albeit extremely basic). This evaluation was elementary in that we created a global variable, if you will, named Environment, that stored the name:value pairs found in the file. Once we had the program understand what was in the data input file, we simply output our choice of varying arithmetic expressions and solve. This marked the beginning of a later two-part project which involved developing a small compiler based around the Scribbler robot.
So for example, if the data file contained:
x=3
y=5
And one of the five expressions hard coded into the program was:
(x * x) + y
We would have it output the full expression and that expression's value:
(x * x) + y = 14
All required tasks to be performed required by the specification were implemented successfully.
See the wiki for a detailed write-up on this whole assignment, and/or click the below picture to go to the repository listing, likewise for this assignment.

Code critiques and criticisms are always welcome.
x=3
y=5
And one of the five expressions hard coded into the program was:
(x * x) + y
We would have it output the full expression and that expression's value:
(x * x) + y = 14
All required tasks to be performed required by the specification were implemented successfully.
See the wiki for a detailed write-up on this whole assignment, and/or click the below picture to go to the repository listing, likewise for this assignment.

Code critiques and criticisms are always welcome.
Categories:
91.204 - CS IV
,
University
0 TrackBacks
Listed below are links to blogs that reference this entry: Expression Evaluator and Generator.
TrackBack URL for this entry: http://www.lozzisolutions.com/cgi-bin/movable-type/mt-tb.cgi/91

Leave a comment