1,223 views
0 votes
0 votes
Rewrite the following SDT:

A->A {a} B | AB {b} | 0

B->B {c} A | BA {d} | 1

so that the underlying grammar becomes non-left-recursive. Here a, b, c and d are actions, and 0 and 1 are terminals

 

is my solution correct?

A→ 0A’

A’→ {a} BA’ | B {b} A’ | ε

B→ 1B’

B’→ {c} AB’ | A {d} B’ | ε

Please log in or register to answer this question.

Related questions

1 votes
1 votes
1 answer
1
0 votes
0 votes
0 answers
3
admin asked Sep 6, 2019
501 views
We mentioned in Section $5.4.2$ that it is possible to deduce, from the LR state on the parsing stack, what grammar symbol is represented by the state. How would we disco...
0 votes
0 votes
2 answers
4
Subhadeeppathak asked Nov 28, 2022
419 views
Attributes are said to be of two type, synthesised and inherited. What actually is an attribute? Why an attribute exist, how to define it?