Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The solution of 4.6.2 that uneliminated left-recursion 4.4.1 #173

Open
OneirdyniaYi opened this issue Mar 14, 2020 · 0 comments
Open

The solution of 4.6.2 that uneliminated left-recursion 4.4.1 #173

OneirdyniaYi opened this issue Mar 14, 2020 · 0 comments

Comments

@OneirdyniaYi
Copy link

The augmented grammar is
1)S'->S
2)S->SS+
3)S->SS*
4)S->a
and the closure collection is
i0:
S'->.S
S->.SS+
S->.SS*
S->.a
i1:
S'->S.
S->S.S+
S->S.S*
S->.a
S->.SS+ THIS 'S' IS THE SECOND 'S' FOLLOWING '.' OF S->S.S+ PRODUCTION
S->.SS* DITTO
i2:
S->a.
i3:
S->SS.+
S->SS.*
S->.a
S->S.S+ THIS 'S' IS S->.SS+ PRODUCTION FROM i1
S->S.S* DITTO
S->.SS+ THIS 'S' IS THE SECOND 'S' FOLLOWING '.' OF S->S.S+ PRODUCTION
S->.SS* DITTO
i4:
S->SS+.
i5:
S->SS*.
FIRST(S) = {a}
FOLLOW(S) = {a,+,*,$}
Sum up,the Fig is
| a | + | * | $ | S |
0 | s2 | | | | 1 |
1 | s2 | | | acc| 3 |
2 | r4 | r4 | r4 | r4 | |
3 | s2 | s4 | s5 | | 3 |
4 | r2 | r2 | r2 | r2 | |
5 | r3 | r3 | r3 | r3 | |

@OneirdyniaYi OneirdyniaYi changed the title The solution of uneliminated left-recursion 4.4.1 The solution of 4.6.2 that uneliminated left-recursion 4.4.1 Mar 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant