Question: Code must be executed in PYTHON3. Code must be executed on the command line by typing python3 parser.py sample.tiny. Will rate if correct. Thank you.

Code must be executed in PYTHON3. Code must be executed on theCode must be executed in PYTHON3. Code must be executed on the command line by typing "python3 parser.py sample.tiny". Will rate if correct. Thank you.

Hi, to whoever commented that more information is needed, this is all the information that's given and all that's required..

In this project you are asked to write an interpreter which uses the top-down recursive-descent method to parse and evaluate a very simple programming language. The tiny language's grammar is given below. ::= empty | ::=id = ; print ; ::= { + - } .:= { * /} := id | intnum|() The interpreter (parser.py) should be written in Python. It takes one input file (sample.tiny) which contains the program to be executed. The input file name sample.tiny is given from the command line. The interpreter parser.py reads the program file sample.tiny, checks the syntax and outputs the result if the program is legitimate; otherwise, the interpreter prints "Syntax Errors". Below are some test examples in sample.tiny: print 2 + 3 * 4; s = 2 + 3; t = 9 2 ; prints print ( s + t ) * ( s - t) ; * t ; In this project you are asked to write an interpreter which uses the top-down recursive-descent method to parse and evaluate a very simple programming language. The tiny language's grammar is given below. ::= empty | ::=id = ; print ; ::= { + - } .:= { * /} := id | intnum|() The interpreter (parser.py) should be written in Python. It takes one input file (sample.tiny) which contains the program to be executed. The input file name sample.tiny is given from the command line. The interpreter parser.py reads the program file sample.tiny, checks the syntax and outputs the result if the program is legitimate; otherwise, the interpreter prints "Syntax Errors". Below are some test examples in sample.tiny: print 2 + 3 * 4; s = 2 + 3; t = 9 2 ; prints print ( s + t ) * ( s - t) ; * t

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!