Faster Generalized LR Parsing

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


Tomita devised a method of generalized LR (GLR) parsing to parse ambiguous grammars efficiently. A GLR parser uses linear-time LR parsing techniques as long as possible, falling back on more expensive general techniques when necessary.

Much research has addressed speeding up LR parsers. However, we argue that this previous work is not transferable to GLR parsers. Instead, we speed up LR parsers by building larger pushdown automata, trading space for time. A variant of the GLR algorithm then incorporates our faster LR parsers.

Our timings show that our new method for GLR parsing can parse highly ambiguous grammars significantly faster than a standard GLR parser.


  1. 1.
    Aho, A.V., Sethi, R., Ullman, J.D.: Compilers: Principles, Techniques, and Tools. Addison-Wesley, Reading (1986)Google Scholar
  2. 2.
    Aycock, J.: Faster Tomita Parsing. MSc thesis, University of Victoria (1998)Google Scholar
  3. 3.
    Bhamidipaty, A., Proebsting, T.A.: Very Fast YACC-Compatible Parsers (For Very Little Effort). Technical Report TR 95-09, Department of Computer Science, University of Arizona (1995)Google Scholar
  4. 4.
    Eades, P., Lin, X., Smyth, W.F.: A fast and effective heuristic for the feedback arc set problem. Information Processing Letters 47, 319–323 (1993)zbMATHCrossRefMathSciNetGoogle Scholar
  5. 5.
    Garey, M.R., Johnson, D.S.: Computers and Intractability: A Guide to the Theory of NP-Completeness. W. H. Freeman, New York (1979)zbMATHGoogle Scholar
  6. 6.
    Grune, D., Jacobs, C.J.H.: Parsing Techniques: A Practical Guide. Ellis Horwood (1990)Google Scholar
  7. 7.
    Horspool, R.N.: Recursive Ascent-Descent Parsing. Journal of Computer Languages 18(1), 1–16 (1993)CrossRefGoogle Scholar
  8. 8.
    Horspool, R.N., Whitney, M.: Even Faster LR Parsing. Software, Practice and Experience 20(6), 515–535 (1990)CrossRefGoogle Scholar
  9. 9.
    Karp, R.M.: Reducibility Among Combinatorial Problems. In: Miller, R.E., Thatcher, J.W. (eds.) Complexity of Computer Calculations, pp. 85–103. Plenum Press (1972)Google Scholar
  10. 10.
    Kipps, J.R.: GLR Parsingin Time O(n3). Tomita [24], 43–59Google Scholar
  11. 11.
    Knuth, D.E.: On the Translation of Languages from Left to Right. Information and Control 8, 607–639 (1965)CrossRefMathSciNetGoogle Scholar
  12. 12.
    Knuth, D.E.: The Art of Computer Programming. Sorting and Searching, vol. 3. Addison-Wesley, Reading (1973)Google Scholar
  13. 13.
    Kruseman Aretz, F.E.J.: On a Recursive Ascent Parser. Information Processing Letters 29, 201–206 (1988)zbMATHCrossRefGoogle Scholar
  14. 14.
    Leermakers, R.: Recursive ascent parsing: from Earley to Marcus. Theoretical Computer Science 104, 299–312 (1992)zbMATHCrossRefMathSciNetGoogle Scholar
  15. 15.
    Lewis, H.R., Papadimitriou, C.H.: Elements of the Theory of Computation. Prentice-Hall, Englewood Cliffs (1981)zbMATHGoogle Scholar
  16. 16.
    Pennello, T.J.: Very Fast LR Parsing. In: Proceedings SIGPLAN 1986 Symposium on Compiler Construction. ACM SIGPLAN Notices, vol. 21(7), pp. 145–151 (1986)Google Scholar
  17. 17.
    Pfahler, P.: Optimizing Directly Executable LR Parsers. In: Hammer, D. (ed.) CC 1990. LNCS, vol. 477, pp. 179–192. Springer, Heidelberg (1991)Google Scholar
  18. 18.
    Roberts, G.H.: Recursive Ascent: An LR Analogto Recursive Descent. ACM SIGPLAN Notices 23(8), 23–29 (1988)CrossRefGoogle Scholar
  19. 19.
    Roberts, G.H.: Another Note on Recursive Ascent. Information Processing Letters 32, 263–266 (1989)CrossRefGoogle Scholar
  20. 20.
    Speckenmeyer, E.: On Feedback Problems in Digraphs. Graph-Theoretic Concepts in Computer Science, 218–231. Springer (1989)Google Scholar
  21. 21.
    Tomita, M.: An Efficient Context-Free Parsing Algorithm for Natural Languages and Its Applications. PhD thesis, Carnegie-Mellon University (1985)Google Scholar
  22. 22.
    Tomita, M.: Efficient Parsing for Natural Language. Kluwer Academic, Dordrecht (1986)Google Scholar
  23. 23.
    Tomita, M.: An Efficient Augmented-Context-Free Parsing Algorithm. Computational Linguistics 13(1-2), 31–46 (1987)Google Scholar
  24. 24.
    Tomita, M. (ed.): Generalized LR Parsing. Kluwer Academic, Dordrecht (1991)zbMATHGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1999

Authors and Affiliations

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

Personalised recommendations