Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Grammar:
- S ::= a d | A d
- A ::= A a | ε
- Input: ad$
- Parser:
- spawn(L_S, Call { label: L_S, pos: 0 }, 0)
- L_S(0)
- spawn(L_S_1, Call { label: L_S, pos: 0 }, 0)
- spawn(L_S_2_0, Call { label: L_S, pos: 0 }, 0)
- L_S_1(0)
- ret(Call { label: (L_S), pos: 0 }, 2)
- L_S_2_0(0)
- call(Call { label: (L_A), pos: 0 }, L_S_2_1, Call { label: (L_S), pos: 0 })
- L_A(0)
- spawn(L_A_1_0, Call { label: (L_A), pos: 0 }, 0)
- spawn(L_A_2, Call { label: (L_A), pos: 0 }, 0)
- L_A_1_0(0)
- call(Call { label: (L_A), pos: 0 }, L_A_1_1, Call { label: (L_A), pos: 0 })
- L_A(0)
- spawn(L_A_1_0, Call { label: (L_A), pos: 0 }, 0)
- spawn(L_A_2, Call { label: (L_A), pos: 0 }, 0)
- L_A_2(0)
- ret(Call { label: (L_A), pos: 0 }, 0)
- spawn(L_S_2_1, Call { label: (L_S), pos: 0 }, 0)
- spawn(L_A_1_1, Call { label: (L_A), pos: 0 }, 0)
- L_S_2_1(0)
- L_A_1_1(0)
- ret(Call { label: (L_A), pos: 0 }, 1)
- spawn(L_S_2_1, Call { label: (L_S), pos: 0 }, 1)
- spawn(L_A_1_1, Call { label: (L_A), pos: 0 }, 1)
- L_S_2_1(1)
- ret(Call { label: (L_S), pos: 0 }, 2)
- L_A_1_1(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement