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, 05.07.2019 10:10
What is the correct way to measure the overall length of a boat? measure from the tip of the bow to the highest point on the gunwale. measure from the tip of the bow in a straight line to the stern of the boat. measure from the tip of the bow in a straight line to the back seat. measure from port to starboard at the boat's widest point.
Answers: 1
question
Engineering, 05.07.2019 19:10
Tech a says never use a water hose to clean up dust after a repair. tech b says never use a floor scrubber to clean up dust after repairs. who is correct?
Answers: 1
question
Engineering, 06.07.2019 02:30
A75mm diameter shaft is supported in a journal bearing 75mm long with a diametral clearance of 0. 1mm. it supports a radial load of 1000 n and is lubricated with sae 50 oil at 70°c. find the friction torque and the power loss when the crankshaft rotates at 2900 rev/min.
Answers: 1
question
Engineering, 06.07.2019 03:10
An electrical kettle is made out of stainless steel,weighs two pounds (when empty) with a heating element that consumes 2 kw of electricity. assuming that the water and the kettle are at the same uniform temperature at any moment of time, calculate the shortest possible time to bring 2 quarts of water from room temperature to the onset of boiling.
Answers: 1
You know the right answer?
This project consists of the development of an interpreter for a simplified Monkey language. The int...
Questions
question
Mathematics, 27.12.2019 15:31
question
Spanish, 27.12.2019 15:31
question
Mathematics, 27.12.2019 15:31
question
Mathematics, 27.12.2019 15:31
question
Mathematics, 27.12.2019 15:31
Questions on the website: 13722362