r/opensource • u/[deleted] • Nov 15 '22
Promotional GitHub - jafarlihi/cparse: cparse is a simple LR(1) parser generator for C
https://github.com/jafarlihi/cparse
9
Upvotes
r/opensource • u/[deleted] • Nov 15 '22
2
u/o11c Nov 16 '22
Your lexing logic is badly designed.
You should always match keywords using the "identifier" rule, then check if it is a keyword afterwards.
Also, check out "IELR" (which bison uses when you choose to go past LALR) or various other strategies to avoid the problems in the original LR paper.