Skip to main content
Log in

Early action in an Earley parser

  • Original Article
  • Published:
Acta Informatica Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Aho A.V., Sethi R., Ullman J.D.: Compilers: Principles, Techniques, and Tools. Addison-Wesley, Massachusetts (1986)

    Google Scholar 

  2. Aho A.V., Ullman J.D.: The Theory of Parsing, Translation, and Compiling, vol. 1: parsing. Prentice-Hall, Englewood Cliffs (1972)

    Google Scholar 

  3. Aycock J., Horspool R.N.: Practical Earley parsing. Comput. J. 10(6), 620–630 (2002)

    Article  Google Scholar 

  4. Aycock, J.D.: Practical Earley parsing and the SPARK toolkit. PhD thesis, University of Victoria (2001)

  5. Earley, J.: An efficient context-free parsing algorithm. PhD thesis, Carnegie-Mellon University, August (1968)

  6. Earley J.: An efficient context-free parsing algorithm. Commun. ACM 13(2), 94–102 (1970)

    Article  MATH  Google Scholar 

  7. 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)

  8. Grune D., Jacobs C.J.H.: Parsing Techniques: A Practical Guide. Ellis Horwood, Chichester (1990)

    Google Scholar 

  9. 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)

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to John Aycock.

Rights and permissions

Reprints 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

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00236-009-0107-6

Keywords

Navigation