CSCE 4430 UNT Designing Interpreter for MicroR Programming Language Task
Design and implement an interpreter for MicroR in any programming language of your choice. This will consist of the following steps. (a) In Assignment #3, you have produced a syntax tree in Cambridge Polish prefix form. This will be input to the interpreter here. (b) You will implement semantics of MicroR in the style of the Core semantics presented in class. i. Construct a set of interpretation routines for each general root symbol in the syntax trees. For example, you need a routine to interpret the if statement, one for arithmetic operators, etc. Each interpretation routine will perform the actions specified in the semantics. For example, an if statement will evaluate the condition and then either the then or else part depending on whether the condition is true. ii. Some type checking will be required, for example to distinguish list types from integers. In the case of any errors, your interpreter need only print an appropriate error message and halt. (c) Your store will need to allow variables to be mapped to either integers or lists of integers and keep track of the type of the variables as well. Only integers may be input or output. (d) Your output will be the output file produced by the interpreter (i.e., a list of integers) and should be the same as that produced by running R. Suggestion: Develop this incrementally over the following steps. • Make your interpreter work first for assignment statements involving expressions without function calls. • Next handle if-then-else and while statements. • Then handle expressions calling functions without parameters, including recursion. • Lastly implement the function calls which involve parameter passing.
0
CSCE 4430 ASSIGNMENT #6
Due Wednesday, December 1, 2021 1
1. Design and implement an interpreter for MicroR in any programming language of your choice.
This will consist of the following steps.
(a) In Assignment #3, you have produced a syntax tree in Cambridge Polish prefix form.
This will be input to the interpreter here.
(b) You will implement semantics of MicroR in the style of the Core semantics presented in
class.
i. Construct a set of interpretation routines for each general root symbol in the syntax
trees. For example, you need a routine to interpret the if statement, one for arith-
metic operators, etc. Each interpretation routine will perform the actions specified
in the semantics. For example, an if statement will evaluate the condition and then
either the then or else part depending on whether the condition is true.
ii. Some type checking will be required, for example to distinguish list types from
integers. In the case of any errors, your interpreter need only print an appropriate
error message and halt.
(c) Your store will need to allow variables to be mapped to either integers or lists of integers
and keep track of the type of the variables as well. Only integers may be input or output.
(a) Your output will be the output file produced by the interpreter (i.e., a list of integers)
and should be the same as that produced by running R.
Suggestion: Develop this incrementally over the following steps.
Make your interpreter work first for assignment statements involving expressions without
function calls.
Next handle if-then-else and while statements.
• Then handle expressions calling functions without parameters, including recursion.
• Lastly implement the function calls which involve parameter passing.
Top-quality papers guaranteed
100% original papers
We sell only unique pieces of writing completed according to your demands.
Confidential service
We use security encryption to keep your personal data protected.
Money-back guarantee
We can give your money back if something goes wrong with your order.
Enjoy the free features we offer to everyone
-
Title page
Get a free title page formatted according to the specifics of your particular style.
-
Custom formatting
Request us to use APA, MLA, Harvard, Chicago, or any other style for your essay.
-
Bibliography page
Don’t pay extra for a list of references that perfectly fits your academic needs.
-
24/7 support assistance
Ask us a question anytime you need to—we don’t charge extra for supporting you!
Calculate how much your essay costs
What we are popular for
- English 101
- History
- Business Studies
- Management
- Literature
- Composition
- Psychology
- Philosophy
- Marketing
- Economics