Question: Give me answer in java language. Please watch the assignment instruction video before working on this assignment. Given the grammar for a hypothetical imperative programming

Give me answer in java language. Please watch the assignment instruction video before working on this assignment.
Given the grammar for a hypothetical imperative programming language, write a program that analyzes the syntax of input programs for the language. Your program should read an input test program from a file and then determine whether or not it contains any syntax errors. The program does not have to show where the syntax error occurred or what kind of error it was. You can use any programming language you prefer to write the program.
In your program:
Implement a lexical analyzer as a subprogram of your program. Each time the lexical analyzer is called, it should return the next lexeme and its token code.
Implement a parser based on the following EBNF rules. Create a subprogram for each nonterminal symbol which should parse only sentences that can be generated by the nonterminal.
Upload the following:
All your source code.
Screen dumps of the execution of your program. The file below contains 6 input program examples which you need to use to test your parser. Run your parser using every input program. In each screen dump, show the input test file (containing one input program example) and the output generated by your parser. If you do not upload the screen dumps, your assignment will be considered incomplete and marks will be deducted.
An input program without syntax errors:Some input programs with syntax errors:The keyword begin is missingThe last statement should not end with a semicolon
The semicolon at the end of the first statement is missingThe keyword if is misspelledThe keyword then is missing

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!