Sale!

CS 132 Homework 1: Parsing

$35.00 $21.00

Category: You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (7 votes)

Write in Java a recursive descent parser for the grammar below. The grammar is
LL(1). Your main file should be called Parse.java, and if P contains a program
to be parsed, then:
java Parse < P should print either Program parsed successfully or Parse error depending on whether the input program parses correctly. Consider the grammar S ::= { L } | System.out.println ( E ) ; | if ( E ) S else S | while ( E ) S L ::= S L | ϵ E ::= true | false | ! E where {S, L, E} is the set of nonterminal symbols, S is the start symbol, { {, }, System.out.println, (, ), ;, if, else, while, true, false, ! } is the set of terminal symbols, and ϵ denotes the empty string. 1