Generating LR(1) parsers of small size

  • Fortes Gálvez JoséEmail author
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 641)


Classic LR(1) parsing methods have the problem of producing too large parsing tables for programming language grammars. An alternative is to build an automaton that combines the lookahead symbol with reading the parsing stack from its top, to determine the next parsing action. The building procedure for such a parser and its use for parsing are presented through an example grammar. Results from an experimental implementation of the parser generator show important reductions in automaton size in comparison with standard LR methods. Some discussion is presented, suggesting that the theoretical drawbacks of the method are of relatively little practical importance.


Precedence Method Building Procedure Context Grammar Parser Generator Left Context 
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.


  1. 1.
    A. V. Aho and J. D. Ullman. The Theory of Parsing, Translation and Compiling. Prentice-Hall, 1973.Google Scholar
  2. 2.
    G. V. Cormack. An LR substring parser for noncorrecting syntax error recovery. ACM SIGPLAN Notices, 24(7):161–169, 7 1989.Google Scholar
  3. 3.
    F. DeRemer. Practical Translators for LR(k) Languages. PhD thesis, M.I.T., Cambridge, Massachusetts, U.S.A., 1969.Google Scholar
  4. 4.
    R. W. Floyd. Bounded context syntactic analysis. Comm. ACM, 7(2):62–67, 1964.Google Scholar
  5. 5.
    J. Fortes Gálvez. A discriminating reverse automaton for LR(1) parsing. Research Report 91-23, Laboratoire I3S, Bât. 4, 250 Avenue Albert Einstein, F-06560 Valbonne, France, October 1991. A revised version has been submitted for publication in Information Processing Letters.Google Scholar
  6. 6.
    R. M. Graham. Bounded context translation. In AFIPS Spring Joint Computer Conference, pages 184–205, 1964.Google Scholar
  7. 7.
    S. L. Graham and S. P. Rhodes. Practical syntactic error recovery. Comm. ACM, 18(11):639–650, 1975.Google Scholar
  8. 8.
    J. D. Ichbiah and S. P. Morse. A technique for generating almost optimal Floyd-Evans productions for precedence grammars. Comm. ACM, 13(8):501–508, 1970.Google Scholar
  9. 9.
    S. C. Johnson. Yacc—yet another compiler compiler. Computing Science Technical Report 32, AT&T Bell Laboratories, Murray Hill, New Jersey, U.S.A., 1975.Google Scholar
  10. 10.
    D. E. Knuth. On the translation of languages from left to right. Information and Control, 8(6):607–639, 1965.Google Scholar
  11. 11.
    W. M. McKeeman, J. J. Horning, and D. B. Wortman. A Compiler Generator. Prentice-Hall, 1970.Google Scholar
  12. 12.
    C. Pair. Trees, pushdown stores and compilation. RFTI-Chiffres, 7(3):199–216, 1964.Google Scholar
  13. 13.
    H. Richter. Noncorrecting syntax error recovery. ACM Transactions on Programming Languages and Systems, 7(3):478–489, 7 1985.Google Scholar
  14. 14.
    S. Sippu and E. Soisalon-Soininen. Parsing Theory. Springer-Verlag, 1990.Google Scholar
  15. 15.
    N. Wirth and H. Weber. EULER: A generalization of ALGOL and its formal definition. Parts I and II. Comm. ACM, 9(1):13–23 and 89–99, 1966.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1992

Authors and Affiliations

  1. 1.Laboratoire I3SCNRS - Université de Nice-Sophia AntipolisValbonneFrance

Personalised recommendations