Programming Project -
Description: The programming project will be the construction of a functional calculator.
Calculator Requirements:
• For each computation, accept the expression from an input file (*.inp).
• All output must be written to a file of the same name (*.out). Upon completion of each computational statement, echo the statement to the file and print out the name of each statement variable and its numerical value.
• Detect and report expression errors in an accurate and understandable fashion.
• The calculator must be written in C #
Calculator Components: Your calculator must have the following components:
• Grammar - Provides a blueprint for expression parsing
• Lexical Analyzer - To identify tokens
• Parser - Creates tree to interpret each line of computation
• Symbol Table -- To track variables and their values as they change with each computation
Approach:
• Use the Gold Parse Builder (GPB) to design your lexical analyzer and parser. To get you started, I am providing a sample file that allows it to process input for a simple C-like language (Tiny-DFA.GRM). If you use the GPB, use its Test capability to make sure the input is being tokenized correctly.
• You will need to process the XML output from GPB, which encodes the tables you will need for lexical analysis and parsing. I will provide the code that will allow you to import the XML into a program data structure (tree) and search it.
• To help you, I will upload a set of project resources to D2L.
• You must upload your materials to D2L in a zipped file per the below schedule.
Download file from this link:
https://www.dropbox.com/s/a05p7nk91sclw1e/calculator-project.rar?dl=0.