Open EDKarlsson opened 2 years ago
Thank you for this report! I agree that this appears to be a typo rather than an intentional epsilon rule to build an empty Stmt.
I've just added the grammar https://github.com/PacktPublishing/Build-Your-Own-Programming-Language/blob/master/ch13/j0gram.y to https://mingodad.github.io/parsertl-playground/playground/ an online editor/tester for yacc/lex
grammars, select Build your own prog. lang. parser
from Examples
then click Parse
to see a parser tree for the source in Input source
.
I hope it'll help anyone working with yacc/lex grammars.
Any feedback is welcome !
There is a
|
afterReturnStmt
and a|
before theIfThenStmt
. It doesn't result in an issues when generating the parser but wanted to point it out nonetheless.https://github.com/PacktPublishing/Build-Your-Own-Programming-Language/blob/b631ce673b16089b4f4c74856d5f7128ccde8a00/ch4/j0gram.y#L41-L42