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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Tomita, M.: An Efficient Augumented-Contxt-Free Parsing Algorithm. Computational Lingustics 13, 31–46 (1987)
Gao, Z.Y., Jin, M.Z.: The Theory and Construction of Compilers, pp. 100–127. Beijing University of Aeronautics and Astronautics Press, Beijing (1990)
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)
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)
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)
Tomita, M.: Generalized LR Parsing. Kluwer Academic Publishers, Dordrecht (1991)
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)
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)
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)
Kipps, J.R.: GLR parsing in Time O(n2). In: Tomita, pp. 43–59 (1984)
Knuth, D.E.: On the Translation of Languages from Left to Right. Information and Control 8, 607–693 (1965)
Kruseman Aretz, F.E.J.: On a Recursive Ascent Parser. Information Processing Letters 29, 201–206 (1998)
Leermakers, R.: Recursive ascent parsing: From Early to Marcus. Theoretical Computer Science 104, 299–312 (1992)
Aho, A.V., Scthi, R., Ullman, J.D.: Compiler:Principals, Techniques, and Tools. Addison-Wesley, Reading (1986)
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)
Parr, T.J., Quong, R.W.: ANTLR: A predicated-LL(k) parser generator. Software-Practice and Experience 25, 789–810 (1995)
Aycock, J.: Faster Tomita Parsing. MSc thesis, University of Victoria (1998)
Aycock, J., Horspool, N., Janousek, J., Melichar, B.: Even faster generalize parsing. Acta Informatica 37, 633–651 (2001)
Donelly, C., Stallmen, R.: The Bison Manual: Using the YACC-Compatible Parser Generator, for Bison Version 1.875. GUN Press, Boston (2004)
Fisher, M., Ellis, J., Bruce, J.: JDBC API Tutorial and Reference, 3rd edn., Sun Microsystem (2004)
Flanagan, D.: Java Example in a Nutshell, 2nd edn. O’Reilly & Association, Sebastopol (2003)
Armstrong, E., et al.: The Java Web Services Tutorial. Pearson Education (2003)
Oaks, S., Wong, H.: Java Threads. O’Reilly & Association, Sebastopol (1999)
Tomita, M.: An Effective Parsing for Natural Language. Kluwer Academic Publishers, Dordrecht (1986)
Zhou, M., Liu, X., Huang, C.N.: An efficient stochastic context-free parsing algorithm. Journal of Software 9, 59–87 (1998)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)