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

Another question on Engineering

question
Engineering, 04.07.2019 18:10
At 12 noon, the count in a bacteria culture was 400; at 4: 00 pm the count was 1200 let p(t) denote the bacteria cou population growth law. find: (a) an expression for the bacteria count at any time t (b) the bacteria count at 10 am. (c) the time required for the bacteria count to reach 1800.
Answers: 1
question
Engineering, 04.07.2019 18:20
Inspection for bearing condition will include: (clo4) a)-color b)-smell c)-size d)-none of the above
Answers: 1
question
Engineering, 04.07.2019 18:20
The characteristic roots of a dynamic system are: 1.7920 1.8160 i, -1.7920 1.8160 i, -0.4160 what is the order of this system? what are the settling time and damping ratio of the system?
Answers: 3
question
Engineering, 04.07.2019 19:10
The sum of the normal stresses does not change as the stress state rotates through an angle. a)-trune 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
question
Mathematics, 14.07.2019 11:00
question
Mathematics, 14.07.2019 11:00
question
History, 14.07.2019 11:00
question
Mathematics, 14.07.2019 11:00