subject
Engineering, 05.05.2020 06:53 armstrongstang420

This project consists of the development of an interpreter for a simplified Monkey language. The interpreter can be implemented in any programming language, such as C, C++, Java, Python, and so on.

Interpreter Project
The interpreter has mainly three parts, a lexer, a parser, and an evaluator. The interpreter will process a Monkey program. The parsing algorithm should detect any syntactical or semantic error. The first such error discovered should cause an appropriate error message to be printed, and then the interpreter should terminate. Run-time errors should also be detected with appropriate error messages being printed.

1. Write the grammar specification of the simplified Monkey language based on the below source code. Hint: the language supports variable declarations, functions, and additions.
2. Implement a lexical analyzer.
3. Implement a parser.
4. Implement an evaluator.

Your interpreter executes the following program.
let a = 5;
let b = 10;
let add = fn(x, y) {
x+y:
add(a, b);

Result => 15

ansver
Answers: 3

Other questions on the subject: Engineering

image
Engineering, 03.07.2019 19:30, 10040813
When using the ohmmeter function of a digital multimeter, the leads are placed in what position relative to the component being tested? a. parallel b. control c. series d. line
Answers: 3
image
Engineering, 04.07.2019 18:10, mm016281
What difference(s) did you notice using a pneumatic circuit over hydraulic circuit. explain why the pneumatic piston stumbles when it hits an obstacle.
Answers: 2
image
Engineering, 04.07.2019 18:10, ijohnh14
Shafts are machine elements that are used to a) carry axial loads b) direct shear loads c) transmit power d) rotate at constant speed e) none of the above circular and square shafts subjected to the same torque under the same circum behave a) the same way b) almost the same way
Answers: 2
image
Engineering, 04.07.2019 18:10, colin774
The higher the astm grain size number, the finer the gran is. a)-true b)-false
Answers: 2
You know the right answer?
This project consists of the development of an interpreter for a simplified Monkey language. The int...

Questions in other subjects:

Konu
Chemistry, 03.09.2021 23:00
Konu
Mathematics, 03.09.2021 23:00
Konu
Mathematics, 03.09.2021 23:10