Acta Informatica

, Volume 37, Issue 9, pp 633–651

Even faster generalized LR parsing

  • John Aycock
  • Nigel Horspool
  • Jan Janoušek
  • Bořivoj Melichar
Original articles

DOI: 10.1007/PL00013319

Cite this article as:
Aycock, J., Horspool, N., Janoušek, J. et al. Acta Informatica (2001) 37: 633. doi:10.1007/PL00013319

Abstract.

We prove a property of generalized LR (GLR) parsing – if the grammar is without right and hidden left recursions, then the number of consecutive reductions between the shifts of two adjacent symbols cannot be greater than a constant. Further, we show that this property can be used for constructing an optimized version of our GLR parser. Compared with a standard GLR parser, our optimized parser reads one symbol on every transition and performs significantly fewer stack operations. Our timings show that, especially for highly ambiguous grammars, our parser is significantly faster than a standard GLR parser.

Copyright information

© Springer-Verlag Berlin Heidelberg 2001

Authors and Affiliations

  • John Aycock
    • 1
  • Nigel Horspool
    • 1
  • Jan Janoušek
    • 2
  • Bořivoj Melichar
    • 2
  1. 1.Department of Computer Science, University of Victoria, Victoria, B.C., Canada V8W 3P6 (e-mail: {aycock,nigelh}@csc.uvic.ca) CA
  2. 2.Department of Computer Science and Engineering, Czech Technical University, Karlovo nám. 13, 121 35, Prague, Czech Republic (e-mail: {janousej,melichar}@cs.felk.cvut.cz) CZ