jzimmerman / langcc

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

How exactly does langcc beat Knuth? #35

Closed nsajko closed 2 years ago

nsajko commented 2 years ago

There seems to be no Web forum or mailing list, so I guess I should ask questions here?

It's well-known that any language parseable with a pushdown automaton is a deterministic context-free language. However, langcc seems to be able to generate parsers for some wider class of languages, so I'm interested in which of the results from your paper improve on the recognizing power of LR(k)/PDA?

If I wanted to make a strictly LR(1) parser generator based on your paper, which of your features/results should I ignore?

jzimmerman commented 2 years ago

There is a Discussions tab on GitHub.

For a canonical LR(1) parser, you'll have to ignore virtually all of the innovations of the paper, notably, (i) the improved optimization procedure for LR automata (which produces coarser automata than canonical LR(1)); (ii) the CPS grammar transformation; (iii) recursive-descent actions; and (iv) per-symbol attributes.

nsajko commented 2 years ago

Thanks!