Directly-Executable Earley Parsing

  • John Aycock
  • Nigel Horspool
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2027)

Abstract

Deterministic parsing techniques are typically used in favor of general parsing algorithms for efficiency reasons. However, general algorithms such as Earley’s method are more powerful and also easier for developers to use, because no seemingly arbitrary restrictions are placed on the grammar. We describe how to narrow the performance gap between general and deterministic parsers, constructing a directly-executable Earley parser that can reach speeds comparable to deterministic methods even on grammars for commonly-used programming languages.

References

  1. 1.
    A. V. Aho, R. Sethi, and J. D. Ullman. Compilers: Principles, Techniques, and Tools. Addison-Wesley, 1986.Google Scholar
  2. 2.
    M. A. Alonso, D. Cabrero, and M. Vilares. Construction of Efficient Generalized LR Parsers. Proceedings of the Second International Workshop on Implementing Automata, 1997, pp. 131–140.Google Scholar
  3. 3.
    D. T. Barnard and J. R. Cordy. SL Parses the LR Languages. Computer Languages 13, 2 (1988), pp. 65–74.CrossRefGoogle Scholar
  4. 4.
    J. R. Bell. Threaded Code. CACM 16, 6 (June 1973), pp. 370–372.Google Scholar
  5. 5.
    A. Bhamidipaty and T. A. Proebsting. Very Fast YACC-Compatible Parsers (For Very Little Effort). Software: Practice and Experience 28, 2 (February 1998), pp. 181–190.CrossRefGoogle Scholar
  6. 6.
    S. Billot and B. Lang. The Structure of Shared Forests in Ambiguous Parsing. Proceedings of the 27th Annual Meeting of the Association for Computational Linguistics, 1989, pp. 143–151.Google Scholar
  7. 7.
    M. van den Brand, A. Sellink, and C. Verhoef. Current Parsing Techniques in Software Renovation Considered Harmful. International Workshop on Program Comprehension, 1998, pp. 108–117.Google Scholar
  8. 8.
    M. Bouckaert, A. Pirotte, and M. Snelling. Efficient Parsing Algorithms for General Context-free Parsers. Information Sciences 8, 1975, pp. 1–26.Google Scholar
  9. 9.
    J. Earley. An Efficient Context-Free Parsing Algorithm, Ph.D. thesis, Carnegie-Mellon University, 1968.Google Scholar
  10. 10.
    J. Earley. An Efficient Context-Free Parsing Algorithm. CACM 13, 2 (February 1970), pp. 94–102.Google Scholar
  11. 11.
    M. A. Ertl and D. Gregg. Hardware Support for Efficient Interpreters: Fast Indirect Branches (Draft). May, 2000.Google Scholar
  12. 12.
    J. Gosling, B. Joy, and G. Steele. The Java Language Specification. Addison-Wesley, 1996.Google Scholar
  13. 13.
    D. Grune and C. J. H. Jacobs. Parsing Techniques: A Practical Guide. Ellis Horwood, 1990.Google Scholar
  14. 14.
    R. N. Horspool and M. Whitney. Even Faster LR Parsing. Software: Practice and Experience 20, 6 (June 1990), pp. 515–535.CrossRefGoogle Scholar
  15. 15.
    S. C. Johnson. Yacc: Yet Another Compiler-Compiler. Unix Programmer’s Manual (7th edition), volume 2B, 1978.Google Scholar
  16. 16.
    P. Klint. Interpretation Techniques. Software: Practice and Experience 11, 1981, pp. 963–973.Google Scholar
  17. 17.
    D. E. Knuth. The Art of Computer Programming Volume 3: Sorting and Searching (2nd edition), Addison-Wesley, 1998.Google Scholar
  18. 18.
    B. Lang. Deterministic Techniques for Efficient Non-Deterministic Parsers. In Automata, Languages, and Programming (LNCS #14), J. Loeckx, ed., Springer-Verlag, 1974.Google Scholar
  19. 19.
    R. Leermakers. A recursive ascent Earley parser. Information Processing Letters 41, 1992, pp. 87–91.Google Scholar
  20. 20.
    R. Leermakers. Recursive ascent parsing: from Earley to Marcus. Theoretical Computer Science 104, 1992, pp. 299–312.Google Scholar
  21. 21.
    R. Leermakers. The Functional Treatment of Parsing. Kluwer Academic, 1993.Google Scholar
  22. 22.
    P. McLean and R. N. Horspool. A Faster Earley Parser. Proceedings of the International Conference on Compiler Construction, CC’ 96, 1996, pp. 281–293.Google Scholar
  23. 23.
    T. J. Pennello. Very Fast LR Parsing. Proceedings of the SIGPLAN’ 86 Symposium on Compiler Construction, SIGPLAN 21, 7 (1986), pp. 145–151.CrossRefGoogle Scholar
  24. 24.
    P. Pfahler. Optimizing Directly Executable LR Parsers. Compiler Compilers, Third International Workshop, CC’ 90, 1990, pp. 179–192.Google Scholar
  25. 25.
    F. W. Schroer. The ACCENT Compiler Compiler, Introduction and Reference. GMD Report 101, German National Research Center for Information Technology, June 2000.Google Scholar
  26. 26.
    M. Vilares Ferro and B. A. Dion. Efficient Incremental Parsing for Context-Free Languages. Proceedings of the 5th IEEE International Conference on Computer Languages, 1994, pp. 241–252.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2001

Authors and Affiliations

  • John Aycock
    • 1
  • Nigel Horspool
    • 1
  1. 1.Department of Computer ScienceUniversity of VictoriaVictoriaCanada

Personalised recommendations