jzimmerman / langcc

langcc: A Next-Generation Compiler Compiler
https://langcc.io
Apache License 2.0
1.73k stars 58 forks source link

LALR instead of SLR for initializing LR(0) partitions. #41

Closed modulovalue closed 1 year ago

modulovalue commented 1 year ago

Currently, langcc appears to use SLR followsets for initializing the partitions in the LR(0) NFA.

It looks to me like LALR followsets could be used instead.

Of course, calculating LALR followsets is more tricky than the standard followsets, but LPG is a LALR(k) parser generator written in C++ and maybe adopting its approach wouldn't be too difficult.

I think it would be really interesting to see how big of an effect this could have on the size of the final tables.

modulovalue commented 1 year ago

Because langcc appears to be abandoned, I'm going to close this issue.