Abstract
The Generalized LR parsing algorithm for context-free grammars is notable for having a decent worst-case running time (cubic in the length of the input string), as well as much better performance on “good” grammars. This paper extends the Generalized LR algorithm to the case of “grammars with left contexts” (M. Barash, A. Okhotin, “An extension of context-free grammars with one-sided context specifications”, Inform. Comput., 2014), which augment the context-free grammars with special operators for referring to the left context of the current substring, as well as with a conjunction operator (as in conjunctive grammars) for combining syntactical conditions. All usual components of the LR algorithm, such as the parsing table, shift and reduce actions, etc., are extended to handle the context operators. The resulting algorithm is applicable to any grammar with left contexts and has the same worst-case cubic-time performance as in the case of context-free grammars.
Supported by the Academy of Finland under grant 257857.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Aizikowitz, T., Kaminski, M.: LR(0) conjunctive grammars and deterministic synchronized alternating pushdown automata. In: Kulikov, A., Vereshchagin, N. (eds.) CSR 2011. LNCS, vol. 6651, pp. 345–358. Springer, Heidelberg (2011)
Barash, M.: Programming language specification by a grammar with contexts. In: NCMA 2013, Umeå, Sweden, pp. 51–67, 13–14 August 2013
Barash, M., Okhotin, A.: An extension of context-free grammars with one-sided context specifications. Inf. Comput. 237, 268–293 (2014)
Kipps, J.R.: GLR parsing in time \({\cal O}(n^3)\). In: Tomita, M. (ed.) Generalized LR Parsing, pp. 43–59. Kluwer, Boston (1991)
Knuth, D.E.: On the translation of languages from left to right. Inf. Control 8, 607–639 (1965)
Kowalski, R.: Logic for Problem Solving. Elsevier, Amsterdam (1979)
Lang, B.: Deterministic techniques for efficient non-deterministic parsers. In: Loeckx, J. (ed.) Automata, Languages and Programming. LNCS, vol. 14, pp. 255–269. Springer, Heidelberg (1974)
Okhotin, A.: Conjunctive grammars. J. Automata Lang. Comb. 6(4), 519–535 (2001)
Okhotin, A.: LR parsing for conjunctive grammars. Grammars 5, 81–124 (2002)
Okhotin, A.: Generalized LR parsing algorithm for Boolean grammars. Int. J. Found. Comput. Sci. 17(3), 629–664 (2006)
Okhotin, A.: Conjunctive and Boolean grammars: the true general case of the context-free grammars. Comput. Sci. Rev. 9, 27–59 (2013)
Okhotin, A.: Improved normal form for grammars with one-sided contexts. In: Jurgensen, H., Reis, R. (eds.) DCFS 2013. LNCS, vol. 8031, pp. 205–216. Springer, Heidelberg (2013)
Pereira, F.C.N., Warren, D.H.D.: Parsing as deduction. In: 21st Annual Meeting of the Association for Computational Linguistics, Cambridge, USA, pp. 137–144, 15–17 June 1983
Rabkin, M.: Recognizing two-sided contexts in cubic time. In: Hirsch, E.A., Kuznetsov, S.O., Pin, J.É., Vereshchagin, N.K. (eds.) CSR 2014. LNCS, vol. 8476, pp. 314–324. Springer, Heidelberg (2014)
Rounds, W.C.: LFP: a logic for linguistic descriptions and an analysis of its complexity. Comput. Linguist. 14(4), 1–9 (1988)
Tomita, M.: Efficient Parsing for Natural Language. Kluwer, Boston (1986)
Tomita, M.: An efficient augmented context-free parsing algorithm. Comput. Linguist. 13(1), 31–46 (1987)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2015 Springer International Publishing Switzerland
About this paper
Cite this paper
Barash, M., Okhotin, A. (2015). Generalized LR Parsing for Grammars with Contexts. In: Beklemishev, L., Musatov, D. (eds) Computer Science -- Theory and Applications. CSR 2015. Lecture Notes in Computer Science(), vol 9139. Springer, Cham. https://doi.org/10.1007/978-3-319-20297-6_5
Download citation
DOI: https://doi.org/10.1007/978-3-319-20297-6_5
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-20296-9
Online ISBN: 978-3-319-20297-6
eBook Packages: Computer ScienceComputer Science (R0)