Question: term> 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

 term> In this project you are asked to write an interpreter

term> 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= ; expr> ::= {+ - } := {* / } = id intrum () 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 + * 41 S = 2 + 3; t = 9 - 2; print si ti print ( s tt) * ( S-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!