Fill This Form To Receive Instant Help
Homework answers / question archive / Write a Java program that implements a lexical analyzer, lex, a recursive-descent parser, parse, an error handling program, error, and a code generator, codegen, for the following EBNF description of a simple assignment statement using an arithmetic expression language
Write a Java program that implements a lexical analyzer, lex, a recursive-descent parser,
parse, an error handling program, error, and a code generator, codegen, for the
following EBNF description of a simple assignment statement using an arithmetic expression
language. You must implement a symbol table to successfully complete this project.
Feel free to use the parser I have provided.
-> BEGIN
END
-> {}+
-> COMPUTE = | WRITE
-> { (+ | -) }*
-> { (* | /) }*
-> | integer-value | ( ) | |
-> A{" A"-"Z","0"-"9"}*
-> SQUARE ( ) | SQRT ( ) | ABS ( )
Be sure to provide an output that proves your program works properly. A sample program would be:
"BEGIN COMPUTE A1 = 34 * ABS ( 5 ) COMPUTE A2 = A1 + 12 WRITE A2 END EOF"
Useful video:
https://www.youtube.com/watch?v=-C_S7Lb4kRk
Please download the answer file using this link
https://drive.google.com/file/d/12GWNBhl1wtDlDji6Cw-cJQQ-0vYtFAfk/view?usp=sharing