Abstract
Bounding the size of deterministic left and right parsers for context-free grammars is studied. It is well-known that the size of an LR(k) parser is not always polynomially bounded in the size of the grammar. A similar non-polynomial size difference occurs also in LL(k) parsers. We show that such non-polynomial size differences cannot be regarded as a weakness of the LR(k) or LL(k) parser construction methods but are a consequence of the capability of these parsers to solve inherently difficult parsing problems. This is established by proving that there exists an infinite family of LL(k) grammars where k≥2 such that the size of every left parser for these grammars must be ≥2cm where m is the size of the grammar. Similarly, it is shown that there exists an infinite family of LR(k) grammars (as well as SLR(k) and LALR(k) grammars) where k≥0 such that the size of every right parser for these grammars must be ≥2c′√m.
Chapter PDF
Similar content being viewed by others
References
Aho, A.V. and J.D. Ullman: The Theory of Parsing, Translation, and Compiling. Vol. I: Parsing. Prentice-Hall, Englewood Cliffs, New Jersey, 1972.
Earley, J.: An efficient context-free parsing algorithm. Ph.D. Thesis, Carnegie-Mellon Univ., Pittsburgh, 1968.
Geller,M.M., S.L.Graham and M.A.Harrison: Production prefix parsing (extended abstract). Automata, Languages, and Programming (J.Loeckx, ed.), Lecture Notes in Computer Science 14, pp. 232–241, Springer-Verlag, 1974.
Geller, M.M., H.B. Hunt, III, T.G. Szymanski and J.D. Ullman: Economy of description by parsers, DPDA's and PDA's. Theoretical Computer Science 4 (1977), 143–153.
Harrison, M.A.: Introduction to Formal Language Theory. Addison-Wesley, Reading, Mass., 1978.
Harrison, M.A. and I.M. Havel: On the parsing of deterministic languages. Journal of the ACM 21 (1974), 525–548.
Knuth, D.E.: On the translation of languages from left to right. Information and Control 8 (1965), 607–639.
Rosenkrantz, D.J. and R.E. Stearns: Properties of deterministic top-down grammars. Information and Control 17 (1970), 226–256.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1981 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Ukkonen, E. (1981). On size bounds for deterministic parsers. In: Even, S., Kariv, O. (eds) Automata, Languages and Programming. ICALP 1981. Lecture Notes in Computer Science, vol 115. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-10843-2_18
Download citation
DOI: https://doi.org/10.1007/3-540-10843-2_18
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-10843-6
Online ISBN: 978-3-540-38745-9
eBook Packages: Springer Book Archive