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, 03.07.2019 14:10
Explain the difference laminar and turbulent flow. explain it with the shear stress and the velocity profiles.
Answers: 1
question
Engineering, 04.07.2019 18:10
Afour cylinder four-stroke in-line engine has a stroke of 160mm, connecting rod length of 150mm, a reciprocating mass of 3kg and its firing order is 1-3-4-2. the spacing between cylinders is 100mm. i. show that the engine is in balance with regard to the primary inertia forces and primary 3. a and secondary inertia couples. li determine the out of balance secondary inertia force ii. propose ways of balancing this out of balance force and discuss the challenges that will arise
Answers: 3
question
Engineering, 04.07.2019 18:10
Different types of steels contain different elements that alter the characteristics of the steel. for each of the following elements, explain what the element does when alloyed with steel.
Answers: 2
question
Engineering, 04.07.2019 18:10
The higher the astm grain-size number, the coarser the grain is. a)-true b)-false
Answers: 3
You know the right answer?
This project consists of the development of an interpreter for a simplified Monkey language. The int...
Questions
question
Mathematics, 02.06.2020 08:58
question
Mathematics, 02.06.2020 08:58
Questions on the website: 13722359