Question
Implement the Recursive Descent Parser (RDP) for the Grammar --> {(+ | -) } --> {(* | /) } --> id | int_constant | (
Implement the Recursive Descent Parser (RDP) for the Grammar
Specification:
1- Use the procedures in the slides to implement the RDP
2- Create a class called Lexer that takes an input expression as a string and outputs its token
stream
3- Make sure that your Lexer catches any unidentified characters that do not belong to the
grammar
4- The RDP should then proceed to parse the input expression
5- Your code should be in C# and should compile on Visual Studio 2017
6- ...
7- If you are creating a Console application, your code should compile on https://dotnetfiddle.net/
8- Attach a ReadME.txt file to your implementation to describe exactly how to compile your code
9- Submit your code and executables via Moodle in a zip file format
10- Failure to submit by the deadline will result in a zero grade11- If your code does not compile, you will lose 40% of the grade, and you will be given 3 more days
to submit a working version. Failure to submit a working code or the second time will result in a
zero grade
12- Follow the general styling guidelines for your code (comments and meaningful variable names)
13- Point distribution: 50 points for Lexer, 40 points for RDP, and 10 points for styling.
14- Your main output window should look something like this:
Enter your expression: num1 + num2 / (3 + total) ----------------------------------- Calling Lexer: num1: IDENT +: ADD_OP num2: IDENT /: DIV_OP (: LEFT_PAREN 3: INT_LIT +: ADD_OP total: IDENT ): RIGHT_PAREN
---------------------------------- Calling the Recursive Descent Parser: NextToken: IDENT Enter
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started