Partial evaluation of general parsers

Applications of partial evaluation have so far mainly focused on generation of compilers from interpreters for programming languages. We partially evaluate a simple general LR(k) parsing algorithm. To obtain good results, we rewrite the algorithm using a number of binding-time improvements. The final LR(1) parser has been specialized using Similix, a partial evaluator for a higher order subset of Scheme [3]. The obtained specialized parsers are efficient and compact. Partial evaluation is responsible for the (equivalent of) the sets-of-items construction, and the construction of parsing tables. This paper is an extended abstract of [14].

[1]  Jesper Jørgensen,et al.  Generating a compiler for a lazy language by partial evaluation , 1992, POPL '92.

[2]  Peter Sestoft,et al.  An experiment in partial evaluation: the generation of a compiler generator , 1985, SIGP.

[3]  Anders Bondorf,et al.  Automatic Autoprojection of Recursive Equations with Global Variables and Abstract Data Types , 1991, Sci. Comput. Program..

[4]  Peter D. Mosses,et al.  Denotational semantics , 1995, LICS 1995.

[5]  Dines Bjørner,et al.  Partial Evaluation and Mixed Computation , 1987 .

[6]  Jesper Jørgensen,et al.  Generating a Pattern Matching Compiler by Partial Evaluation , 1990, Functional Programming.

[7]  Anders Bondorf,et al.  Automatic Autoprojection of Higher Order Recursive Equations , 1990, Sci. Comput. Program..

[8]  Donald E. Knuth,et al.  On the Translation of Languages from Left to Right , 1965, Inf. Control..

[9]  Christian Queinnec,et al.  Partial Evaluation applied to Symbolic Pattern Matching with Intelligent Backtrack , 1992, WSA.

[10]  Peter Sestoft,et al.  Partial evaluation and automatic program generation , 1993, Prentice Hall international series in computer science.

[11]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.

[12]  Olivier Danvy,et al.  From Interpreting to Compiling Binding Times , 1990, ESOP.

[13]  David A. Schmidt,et al.  Denotationaisemantics: a methodology for language development , 1986 .