Question: 1 Problem Specification In this assignment, you complete an incomplete syntax analyzer designed for verifying the syntax of a given code written in mini -

1 Problem Specification In this assignment, you complete an incomplete syntax analyzer designed for verifying the syntax of a given code written in mini-Java, a simplified version of Java programming language. The lexical analyzer of mini-Java is completely implemented in Python. You can find the implementation in lexer.py file. You do not need to add any code to this file. The goal of this assignment is to complete the implementation of a top-down recursive- decent parser for mini-Java. The incomplete implementation of parser is available in parser.py file. 2 EBNF Grammar for mini-Java The parser of mini-Java is implemented based on the following EBNF Grammar. As mentioned in class, in a EBNFgrammar, variables (not-terminals) are enclosed by angle-brackets<>, optional part of a rules right-hand-side isenclosed in brackets [], and repetitive part of a rules right-hand-side is enclosed in curly braces {}. Each repetitive part may be repeated zero time, once, twice, three times, etc. (1)->[package ID;]{import ID{.ID}[.*]; }(2)->[public]class ID[extends ID][implements ID{,ID}]LB RB (3)->{[public|protected|private][static]ID({,ID}; |)}(4)-> LB {} RB (5)->(ID|boolean|byte|char|short|int|long|float|double){LBR RBR}| void (6)-> LP [ID{,ID }]RP (7)-> ID[=]{,ID[=]}; |||||(7)->[(break | continue | return []|| ID{.ID}LP[{,}]RP)]; (8)-> ID{.ID}(=|+=|=|/=|=)|{(+|)}(9)->{(|/)}(10)-> NC|CC|SC|BC|NL| ID{.ID}[LP[{,}]RP]| LP RP (11)-> for LP [[]ID=]; ;[ID=|ID++|ID] RP

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!