Abstract
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.
Chapter PDF
Similar content being viewed by others
References
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.
T. P. Baker. Extending look-ahead for LR parsers. J. Comput. Syst. Sci., 22(2):243–259, 1981.
M. E. Bermudez and K. M. Schimpf. Practical arbitrary lookahead LR parsing. Journal of Computer and System Sciences, 41:230–250, 1990.
P. Boullier. Contribution-a la construction automatique d’analyseurs lexicographiques et syntaxiques. PhD thesis, Université d’Orléans, France, 1984. In French.
K. Čulik II and R. Cohen. LR-regular grammars — an extension of LR(k) grammars. J. Comput. Syst. Sci., 7:66–96, 1973.
J. Earley. An efficient context-free parsing algorithm. Communications of the ACM, 13(2):94–102, Feb. 1970.
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.
J. Gosling, B. Joy, and G. Steele. The Java™ Language Specification. Addison-Wesley, 1996.
D. Grune and C. J. H. Jacobs. A programmer-friendly LL(1) parser generator. Software—Practice and Experience, 18(1):29–38, Jan. 1988.
S. Heilbrunner. A parsing automata approach to LR theory. Theoretical Computer Science, 15:117–157, 1981.
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.
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.
T.J.Parr. We are talking really big lexical lookahead here. http://www.antlr.org/articles.html
T. J. Parr and R. W. Quong. ANTLR: A predicated-LL(k) parser generator. Software—Practice and Experience, 25(7):789–810, July 1995.
B. Seité. A Yacc extension for LRR grammar parsing. Theoretical Computer Science, 52:91–143, 1987.
S. Sippu and E. Soisalon-Soininen. Parsing Theory. Springer, 1988-1990.
T. G. Szymanski and J. H. Williams. Non-canonical extensions of bottom-up parsing techniques. SIAM J. Computing, 5(2):231–250, June 1976.
M. Tomita. Efficient Parsing for Natural Language. Kluwer, 1986.
T. A. Wagner and S. L. Graham. Incremental analysis of real programming languages. ACM SIGPLAN Notices, 32(5):31–43, 1997.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2001 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Farré, J., Gálvez, J.F. (2001). A Bounded Graph-Connect Construction for LR-regular Parsers. In: Wilhelm, R. (eds) Compiler Construction. CC 2001. Lecture Notes in Computer Science, vol 2027. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45306-7_17
Download citation
DOI: https://doi.org/10.1007/3-540-45306-7_17
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-41861-0
Online ISBN: 978-3-540-45306-2
eBook Packages: Springer Book Archive