Skip to main content

Construction of efficient generalized LR parsers

  • Contributed Papers
  • Conference paper
  • First Online:
Automata Implementation (WIA 1997)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1436))

Included in the following conference series:

Abstract

We show how LR parsers for the analysis of arbitrary context-free grammars can be derived from classical Earley's parsing algorithm. The result is a Generalized LR parsing algorithm working at complexity O(n 3) in the worst case, which is achieved by the use of dynamic programming to represent the non-deterministic evolution of the stack instead of graph-structured stack representations, as has often been the case in previous approaches. The algorithm behaves better in practical cases, achieving linear complexity on LR grammars. Experimental results show the performance of our proposal.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Aho, A. V., Ullman,J. D.: The theory of parsing, translation and compiling. Prentice Hall (1972)

    Google Scholar 

  2. Donnelly, C., Stallman, R. M.: BISON reference manual. Free Software Foundation, Inc., 675 Mass Avenue, Cambridge, MA 02139, USA, 1.20 edition (1992)

    Google Scholar 

  3. Earley, J.: An efficient context-free parsing algorithm. Communications of the ACM 13 (1970) 94–102

    Google Scholar 

  4. Heering, J., Hendriks, P. R. H., Klint, P., Rekers, J.: The syntax definition formalism SDF — reference manual. SIGPLAN Notices 24 (1989) 43–75

    Google Scholar 

  5. Lang, B.: Towards a uniform formal framework for parsing. In Tomita, M. (ed.): Current Issues in Parsing Technology. Kluwer Academic Publishers (1991) 153–171

    Google Scholar 

  6. McLean, P., Horspool, R. N.: A faster Earley parser. Proc. of International Conference on Compiler Construction (1996) 281–293

    Google Scholar 

  7. Nederhof, M.-J., Sarbo, J. J.: Increasing the applicability of LR parsing. Proc. of Third International Workshop on Parsing Technologies (1993) 187–201

    Google Scholar 

  8. Pereira, F. C. N., Warren, D. H. D.: Definite Clause Grammars for language analysis — a survey of the formalism and a comparison with Augmented Transition Networks. Artificial Intelligence 13 (1980) 231–278

    Google Scholar 

  9. Rekers, J.: Parsing Generation for Interactive Environments. PhD thesis. University of Amsterdam (1992)

    Google Scholar 

  10. Sheil, B. A.: Observations on context-free grammars. Proc. of Statistical Methods in Linguistics (1976) 71–109

    Google Scholar 

  11. Shieber, S. M., Schabes, Y., Pereira, F. C. N.: Principles and implementation of deductive parsing. Journal of Logic Programming 24 (1995) 3–36

    Google Scholar 

  12. Sikkel, K.: Parsing Schemata — A Framework for Specification and Analysis of Parsing Algorithms. Texts in Theoretical Computer Science — An EATCS Series. Springer-Verlag (1997)

    Google Scholar 

  13. Tomita, M.: Efficient Parsing for Natural Language. Kluwer Academic Publishers (1986)

    Google Scholar 

  14. Vilares Ferro, M., Alonso Pardo, M. A.: An LALR extension for DCGs in dynamic programming. In Martin Vide, C. (ed.): Mathematical Linguistics, vol. II. John Benjamins Publishing Company (to appear)

    Google Scholar 

  15. Vilares Ferro, M., Dion, B. A.: Efficient incremental parsing for context-free languages. Proc. of the 5th IEEE International Conference on Computer Languages (1994) 241–252

    Google Scholar 

  16. Villemonte de la Clergerie, E.: Automates à Piles et Programmation Dynamique. DyALog: Une Application à la Programmation en Logique. PhD thesis. Université Paris 7 (1993)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Derick Wood Sheng Yu

Rights and permissions

Reprints and permissions

Copyright information

© 1998 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Alonso, M.A., Cabrero, D., Vilares, M. (1998). Construction of efficient generalized LR parsers. In: Wood, D., Yu, S. (eds) Automata Implementation. WIA 1997. Lecture Notes in Computer Science, vol 1436. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0031377

Download citation

  • DOI: https://doi.org/10.1007/BFb0031377

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-64694-5

  • Online ISBN: 978-3-540-69104-4

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics