Advertisement

Acta Informatica

, 46:549 | Cite as

Early action in an Earley parser

  • John Aycock
  • Angelo Borsotti
Original Article
  • 92 Downloads

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.

Keywords

Causal Link Early Action Parse Tree Semantic Action Grammar Rule 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

References

  1. 1.
    Aho A.V., Sethi R., Ullman J.D.: Compilers: Principles, Techniques, and Tools. Addison-Wesley, Massachusetts (1986)Google Scholar
  2. 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. 3.
    Aycock J., Horspool R.N.: Practical Earley parsing. Comput. J. 10(6), 620–630 (2002)CrossRefGoogle Scholar
  4. 4.
    Aycock, J.D.: Practical Earley parsing and the SPARK toolkit. PhD thesis, University of Victoria (2001)Google Scholar
  5. 5.
    Earley, J.: An efficient context-free parsing algorithm. PhD thesis, Carnegie-Mellon University, August (1968)Google Scholar
  6. 6.
    Earley J.: An efficient context-free parsing algorithm. Commun. ACM 13(2), 94–102 (1970)zbMATHCrossRefGoogle Scholar
  7. 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)Google Scholar
  8. 8.
    Grune D., Jacobs C.J.H.: Parsing Techniques: A Practical Guide. Ellis Horwood, Chichester (1990)Google Scholar
  9. 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)Google Scholar

Copyright information

© Springer-Verlag 2009

Authors and Affiliations

  1. 1.Department of Computer ScienceUniversity of CalgaryCalgaryCanada
  2. 2.MilanItaly

Personalised recommendations