Engineering
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

answer
Answers: 3

Other questions on the subject: Engineering

image
Engineering, 04.07.2019 18:10, michellerosas
Ajournal bearing has a journal diameter of 3.250 in with a unilateral tolerance of 20.003 in. the bushing bore has a diameter of 3.256 in and a unilateral tolerance of 0.004 in. the bushing is 2.8 in long and supports a 700-lbf load. the journal speed is 900 rev/min. find the minimum oil film thickness and the maximum film pressure for both sae 20 and sae 20w-30 lubricants, for the tightest assembly if the operating film temperature is 160°f. a computer code is appropriate for solving this problem.
Answers: 3
image
Engineering, 04.07.2019 18:10, siri5645
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
image
Engineering, 04.07.2019 18:10, dval1146
You are making beer. the first step is filling the glass carboy with the liquid wort. the internal diameter of the carboy is 15 in., and you wish to fill it up to a depth of 2 ft. if your wort is drawn from the kettle using a siphon process that flows at 3 gpm, how long will it take to fill?
Answers: 1
image
Engineering, 04.07.2019 18:20, ashleyjaslin
Derive the correction factor formula for conical nozzle i=-(1+ cosa) and calculate the nozzle angle correction factor for a nozzle whose divergence hal-fangle is 13 (hint: assume that all the mass flow originates at the apex of the cone.
Answers: 3
Do you know the correct answer?
This project consists of the development of an interpreter for a simplified Monkey language. The int...

Questions in other subjects: