The essence of LR parsing

Michael Sperber, Peter J. Thiemann · 1995

Partial evaluation can turn a general parser into a parser generator.The generated parsers surpass those produced by traditional parser generators in speed and compactness.We use an inherently functional approach to implement general LR(k) parsers and specialize them using the partial evaluator Similix.The functional implementation of LR parsing allows for concise implementation of the algorithms themselves and requires only straightforward changes to achieve good specialization results.In contrast, a traditional, stack-based implementation of a general LR parser requires significant structural changes to make it amenable to satisfactory specialization.

Read the paper · More papers on PaperTik