Abstract
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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Aho, A.V., Sethi, R., Ullman, J.D.: Compilers – Principles, Techniques and Tools. Addison-Wesley Publishing Company, Reading (1986)
Appel, A.W., Mattson, J.S., Tardit, D.R.: A lexical analyzer generator for Standard ML (1994), http://cm.bell-labs.com/cm/cs/what/smlnj/doc/ML-Lex/manual.html
Hutton, G.: Higher-order functions for parsing. Journal of Functional Programming 2(3), 323–343 (1992)
Hutton, G., Meijer, E.: Monadic parsing in Haskell. Journal of Functional Programming 8(4), 437–444 (1998)
Marlow, S.: Happy user guide (1997), http://www.dcs.gla.ac.uk/fp/software/happy/doc/happy.html
Nikhil, R.S., Arvind, B., Hicks, J.E., Aditya, S., Augustsson, L., Maessen, J.W., Zhou, Y.: pH language reference manual, version 1.0. Technical Report CSG-Memo-369, Massachussets Institute of Technology, Laboratory for Computer Science (1995)
Swierstra, S.D., Duponcheel, L.: Deterministic, error-correcting combinatory parsers. In: Launchbury, J., Sheard, T., Meijer, E. (eds.) AFP 1996. LNCS, vol. 1129, pp. 184–207. Springer, Heidelberg (1996)
Tarditi, D.R., Appel, A.W.: ML-Yacc user’s manual (1994), http://cm.bell-labs.com/cm/cs/what/smlnj/doc/ML-Yacc/manual.html
Waite, W.W., Goos, G.: Compiler Construction, 2nd edn. Springer, Heidelberg (1985)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1999 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Chakravarty, M.M.T. (1999). Lazy Lexing is Fast. In: Middeldorp, A., Sato, T. (eds) Functional and Logic Programming. FLOPS 1999. Lecture Notes in Computer Science, vol 1722. Springer, Berlin, Heidelberg. https://doi.org/10.1007/10705424_5
Download citation
DOI: https://doi.org/10.1007/10705424_5
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-66677-6
Online ISBN: 978-3-540-47950-5
eBook Packages: Springer Book Archive