Question
Use functional F# style for writing your programs. Make sure that you do not use mutable variables & loops. Any imperative style programming is prohibited
- Use functional F# style for writing your programs.
- Make sure that you do not use mutable variables & loops.
- Any imperative style programming is prohibited unless specified in the problem description.
In this project you write a recursive descent parser for a specific grammar.
- Find your grammar definition in grammars.md file which corresponds to your ID.
MY GRAMMAR:
X c | TbU | Xefc T Uc | e | fX U e
Sentences:
- fecbeefcbeefcefc
- fcefcefcbe
- ecbeefc
- fecbebe
- fecbebeefcefcefc
- Make appropriate changes to your grammar to convert it to the LL(1) form if necessary
- No left recursion
- Pairwise disjoint productions
- Write a recursive descent parser for your grammar. Your parser should output for every test sentence:
- A test sentence itself
- A list the grammar rules required to parse a correct sentence.
- See a parsing example in rd-parser.ipynb script.
- Use provided sentences to test correctness of your parser.
MY GRAMMAR:
X c | TbU | Xefc T Uc | e | fX U e
Sentences:
- fecbeefcbeefcefc
- fcefcefcbe
- ecbeefc
- fecbebe
- fecbebeefcefcefc
You recursive-descent parser must output list of grammar rules required to parse a valid sentence of produced by your grammar. Several sentences are provided to you. If case of the error in parser input, i.e. invalid sentence, your parser need to output error and terminate execution.
Solution
Place your LL grammar in the following cell:
place your LL grammar here
Place your recursive descent parser in the following cell:
In [ ]:
Place your recursive recursive descent parser tests in the following cell:
In [ ]:
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