Skip to main content

Improved GLR Parsing Algorithm

  • Conference paper
Advances in Intelligent Computing (ICIC 2005)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 3645))

Included in the following conference series:

  • 1082 Accesses

Abstract

Tomita devised a method of generalized LR(GLR) parsing to parse ambiguous grammars efficiently. A GLR parser uses linear-time LR parsing techniques as long as possible, falling back on more expensive general techniques when necessary. In this paper, the motivation of adopting the GLR parsing algorithm to construct parsers for programming languages is presented. We create a multi-level scheme to fasten the GLR parser. We introduce runtime control mechanisms to the GLR parser to invoke semantic actions attached to grammar rules. The algorithm has been implemented in Development Expert Tools (DET), a compiler which is designed by Institute of Intelligent Machines, Chinese Academy of Sciences, at Hefei. Experiments show that the speed of our GLR parser is comparable to LALR(1) parsers when parsing deterministic programming languages.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Tomita, M.: An Efficient Augumented-Contxt-Free Parsing Algorithm. Computational Lingustics 13, 31–46 (1987)

    Google Scholar 

  2. Gao, Z.Y., Jin, M.Z.: The Theory and Construction of Compilers, pp. 100–127. Beijing University of Aeronautics and Astronautics Press, Beijing (1990)

    Google Scholar 

  3. Billot, S., Lang, B.: The structure of shared forest in ambiguous parsing. In: Proc. of the 6th Int’l Computational Ligustics (ACL 1989), pp. 143–151 (1989)

    Google Scholar 

  4. Parr, T.J.: Obtaining practical variants of LL(K) and LR(k) for k>1 by splitting the atomic k-tuple (Ph.D.Thesis). West Lafayette, Purdue University (1993)

    Google Scholar 

  5. McPeak, S., Elkhound, N.G.: A GLR parser generator. In: Proc. of the 13th Int’l Conf. on Complier Construction, pp. 51–56. Springer, Heidelberg (2004)

    Google Scholar 

  6. Tomita, M.: Generalized LR Parsing. Kluwer Academic Publishers, Dordrecht (1991)

    MATH  Google Scholar 

  7. McPeak, S., Elkhoud, N.G.: A GLR parser generator. In: Proc. of the 13th Int’l Conf. on Compiler Construction, pp. 51–56. Springer, Heidelberg (2004)

    Google Scholar 

  8. Bhamidipaty, A., Proebsting, T.A.: Very Fast YACC-Compatiable Parsers(For Very Little Effort). Technical Report TR 95-09, Department of Computer Science, University of Arizona (1995)

    Google Scholar 

  9. Eades, P., Lin, X., Smyth, W.F.: A fast and effective heuristic for the feedback arc set problem. Information Processing Letters 47, 319–323 (1993)

    Article  MATH  MathSciNet  Google Scholar 

  10. Kipps, J.R.: GLR parsing in Time O(n2). In: Tomita, pp. 43–59 (1984)

    Google Scholar 

  11. Knuth, D.E.: On the Translation of Languages from Left to Right. Information and Control 8, 607–693 (1965)

    Article  MathSciNet  Google Scholar 

  12. Kruseman Aretz, F.E.J.: On a Recursive Ascent Parser. Information Processing Letters 29, 201–206 (1998)

    Article  Google Scholar 

  13. Leermakers, R.: Recursive ascent parsing: From Early to Marcus. Theoretical Computer Science 104, 299–312 (1992)

    Article  MATH  MathSciNet  Google Scholar 

  14. Aho, A.V., Scthi, R., Ullman, J.D.: Compiler:Principals, Techniques, and Tools. Addison-Wesley, Reading (1986)

    Google Scholar 

  15. Weng, F.L., Zhou, B., Wu, L.D.: Process the phenomena of extra grammaticality in NL parsing. Journal of Chinese Information Processing 8, 1–13 (1994)

    Google Scholar 

  16. Parr, T.J., Quong, R.W.: ANTLR: A predicated-LL(k) parser generator. Software-Practice and Experience 25, 789–810 (1995)

    Article  Google Scholar 

  17. Aycock, J.: Faster Tomita Parsing. MSc thesis, University of Victoria (1998)

    Google Scholar 

  18. Aycock, J., Horspool, N., Janousek, J., Melichar, B.: Even faster generalize parsing. Acta Informatica 37, 633–651 (2001)

    Article  MATH  MathSciNet  Google Scholar 

  19. Donelly, C., Stallmen, R.: The Bison Manual: Using the YACC-Compatible Parser Generator, for Bison Version 1.875. GUN Press, Boston (2004)

    Google Scholar 

  20. Fisher, M., Ellis, J., Bruce, J.: JDBC API Tutorial and Reference, 3rd edn., Sun Microsystem (2004)

    Google Scholar 

  21. Flanagan, D.: Java Example in a Nutshell, 2nd edn. O’Reilly & Association, Sebastopol (2003)

    Google Scholar 

  22. Armstrong, E., et al.: The Java Web Services Tutorial. Pearson Education (2003)

    Google Scholar 

  23. Oaks, S., Wong, H.: Java Threads. O’Reilly & Association, Sebastopol (1999)

    Google Scholar 

  24. Tomita, M.: An Effective Parsing for Natural Language. Kluwer Academic Publishers, Dordrecht (1986)

    Google Scholar 

  25. Zhou, M., Liu, X., Huang, C.N.: An efficient stochastic context-free parsing algorithm. Journal of Software 9, 59–87 (1998)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2005 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Li, M., Wei, Z., Zhang, J., Hu, Z. (2005). Improved GLR Parsing Algorithm. In: Huang, DS., Zhang, XP., Huang, GB. (eds) Advances in Intelligent Computing. ICIC 2005. Lecture Notes in Computer Science, vol 3645. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11538356_18

Download citation

  • DOI: https://doi.org/10.1007/11538356_18

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-28227-3

  • Online ISBN: 978-3-540-31907-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics