Lazy Lexing is Fast

This paper introduces a set of combinators for building lexical analysers in a lazy functional language. During lexical analysis, the combinators generate a deterministic, table-driven analyser on the fly. Consequently, the presented method combines the efficiency of off-line scanner generators with the flexibility of the combinator approach. The method makes essential use of the lazy semantics of the implementation language Haskell. Finally, the paper discusses benchmarks of a scanner for the programming language C.

[1]  Graham Hutton,et al.  Monadic parsing in Haskell , 1998, Journal of Functional Programming.

[2]  S. Doaitse Swierstra,et al.  Deterministic, Error-Correcting Combinator Parsers , 1996, Advanced Functional Programming.

[3]  Graham Hutton,et al.  Higher-order functions for parsing , 1992, Journal of Functional Programming.

[4]  Marc A. de Kruijf Compiler Construction , 1996, Lecture Notes in Computer Science.

[5]  Lennart Augustsson,et al.  PH Language Reference Manual, Version 1.0---preliminary , 1995 .

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