Abstract
Traditional Earley parsers operate in two phases: first recognizing the input, then constructing the forest of parse trees. Practically speaking, this quirk makes it awkward to use in a compiler-compiler, because semantic actions attached to rules are only executed after the fact. We address this problem by identifying safe Earley sets, points during the recognition phase at which partial parse trees can be constructed; this means that semantic actions may be executed on the fly. A secondary benefit is that Earley sets can be deleted during recognition, resulting in a substantial savings of both space and time.
Similar content being viewed by others
References
Aho A.V., Sethi R., Ullman J.D.: Compilers: Principles, Techniques, and Tools. Addison-Wesley, Massachusetts (1986)
Aho A.V., Ullman J.D.: The Theory of Parsing, Translation, and Compiling, vol. 1: parsing. Prentice-Hall, Englewood Cliffs (1972)
Aycock J., Horspool R.N.: Practical Earley parsing. Comput. J. 10(6), 620–630 (2002)
Aycock, J.D.: Practical Earley parsing and the SPARK toolkit. PhD thesis, University of Victoria (2001)
Earley, J.: An efficient context-free parsing algorithm. PhD thesis, Carnegie-Mellon University, August (1968)
Earley J.: An efficient context-free parsing algorithm. Commun. ACM 13(2), 94–102 (1970)
Glanville, R.S., Graham, S.L.: A new method for compiler code generation. In: 5th Annual ACM Symposium on Principles of Programming Languages, pp. 231–240 (1978)
Grune D., Jacobs C.J.H.: Parsing Techniques: A Practical Guide. Ellis Horwood, Chichester (1990)
van den Brand, M., Sellink, A., Verhoef, C.: Current parsing technologies in software renovation considered harmful. In: International Workshop on Program Comprehension, pp. 108–117 (1998)
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Aycock, J., Borsotti, A. Early action in an Earley parser. Acta Informatica 46, 549–559 (2009). https://doi.org/10.1007/s00236-009-0107-6
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00236-009-0107-6