Previous: https://www.chegg.com/homework-help/questions-and-answers/1-eliminate-
ID: 3670509 • Letter: P
Question
Previous: https://www.chegg.com/homework-help/questions-and-answers/1-eliminate-left-recursion-following-grammar-2-eliminate-common-prefixes-grammar-resulting-q10685789
4. Using the grammar in the previous questions, give 5 examples of strings that are syntactically correct with respect to the language and 3 that are not.
5. Trace the construction of one of the syntactically correct strings from question 4 using the grammar rules (you may use either the grammar given in question1, the grammar from the answer to question 1, or the grammar from the answer to question 2).
Explanation / Answer
I am assuming that ::= as just =.
S=S'
S'=S S1
S1=LHS if RHS
=LHS
RHS=RHS',
RHS'=RHS''
RHS''=RHS LHS
=LHS
LHS=p
=q
=r
is the left recursion free grammar of the given one.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.