A Bounded Graph-Connect Construction for LR-regular Parsers

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


Parser generation tools currently used for computer language analysis rely on user wisdom in order to resolve grammar conflicts. Here practical LR(0)-based parser generation is introduced, with automatic conflict resolution by potentially-unbounded lookahead exploration. The underlying LR(0)-automaton item dependence graph is used for lookahead DFA construction. A bounded graph-connect technique overcomes the difficulties of previous approaches with empty rules, and compact coding allows to precisely resume right-hand contexts. Resulting parsers are deterministic and linear, and accept a large class of LR-regular grammars including LALR(k). Their construction is formally introduced, shown to be decidable, and illustrated by a detailed example.


  1. 1.
    J. Aycock and R. N. Horspool. Faster generalized LR parsing. In S. Jähnichen, editor, Compiler Construction. 8th International Conference, CC’99, Lecture Notes in Computer Science #1575, pages 32–46. Springer, 1999.Google Scholar
  2. 2.
    T. P. Baker. Extending look-ahead for LR parsers. J. Comput. Syst. Sci., 22(2):243–259, 1981.zbMATHCrossRefGoogle Scholar
  3. 3.
    M. E. Bermudez and K. M. Schimpf. Practical arbitrary lookahead LR parsing. Journal of Computer and System Sciences, 41:230–250, 1990.zbMATHCrossRefMathSciNetGoogle Scholar
  4. 4.
    P. Boullier. Contribution-a la construction automatique d’analyseurs lexicographiques et syntaxiques. PhD thesis, Université d’Orléans, France, 1984. In French.Google Scholar
  5. 5.
    K. Čulik II and R. Cohen. LR-regular grammars — an extension of LR(k) grammars. J. Comput. Syst. Sci., 7:66–96, 1973.zbMATHGoogle Scholar
  6. 6.
    J. Earley. An efficient context-free parsing algorithm. Communications of the ACM, 13(2):94–102, Feb. 1970.zbMATHCrossRefGoogle Scholar
  7. 7.
    J. Farré and J. Fortes Gálvez. A basis for looping extensions to discriminating-reverse parsing. In S. Yu, editor, Fifth International Conference on Implementation and Application of Automata, CIAA 2000. To appear in LNCS. Springer.Google Scholar
  8. 8.
    J. Gosling, B. Joy, and G. Steele. The Java™ Language Specification. Addison-Wesley, 1996.Google Scholar
  9. 9.
    D. Grune and C. J. H. Jacobs. A programmer-friendly LL(1) parser generator. Software—Practice and Experience, 18(1):29–38, Jan. 1988.CrossRefGoogle Scholar
  10. 10.
    S. Heilbrunner. A parsing automata approach to LR theory. Theoretical Computer Science, 15:117–157, 1981.zbMATHCrossRefMathSciNetGoogle Scholar
  11. 11.
    A. Johnstone and E. Scott. Generalised recursive descent parsing and follow-determinism. In K. Koskimies, editor, Compiler Construction. 7th International Conference, CC’98, Lecture Notes in Computer Science #1383, pages 16–30. Springer, 1998.CrossRefGoogle Scholar
  12. 12.
    B. Lang. Deterministic techniques for efficient non-deterministic parsers. In J. Loeckx, editor, Automata, Languages and Programming, Lecture Notes in Computer Science #14, pages 255–269. Springer, 1974.Google Scholar
  13. 13.
    T.J.Parr. We are talking really big lexical lookahead here.
  14. 14.
    T. J. Parr and R. W. Quong. ANTLR: A predicated-LL(k) parser generator. Software—Practice and Experience, 25(7):789–810, July 1995.CrossRefGoogle Scholar
  15. 15.
    B. Seité. A Yacc extension for LRR grammar parsing. Theoretical Computer Science, 52:91–143, 1987.zbMATHCrossRefMathSciNetGoogle Scholar
  16. 16.
    S. Sippu and E. Soisalon-Soininen. Parsing Theory. Springer, 1988-1990.Google Scholar
  17. 17.
    T. G. Szymanski and J. H. Williams. Non-canonical extensions of bottom-up parsing techniques. SIAM J. Computing, 5(2):231–250, June 1976.zbMATHCrossRefMathSciNetGoogle Scholar
  18. 18.
    M. Tomita. Efficient Parsing for Natural Language. Kluwer, 1986.Google Scholar
  19. 19.
    T. A. Wagner and S. L. Graham. Incremental analysis of real programming languages. ACM SIGPLAN Notices, 32(5):31–43, 1997.CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2001

Authors and Affiliations

  • Jacques Farré
    • 1
  • José Fortes Gálvez
    • 2
    • 1
  1. 1.Laboratoire I3SCNRS and Université de NiceSophia AntipolisFrance
  2. 2.Depart. de Informática y SistemasUniversidad de Las Palmas de Gran CanariaMexico

Personalised recommendations