Advertisement

On size bounds for deterministic parsers

  • Esko Ukkonen
Session 7: G. Rozenberg, Chairman
Part of the Lecture Notes in Computer Science book series (LNCS, volume 115)

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.

Key Words

size complexity left parser right parser LL(k) parsing LR(k) parsing 

References

  1. [1]
    Aho, A.V. and J.D. Ullman: The Theory of Parsing, Translation, and Compiling. Vol. I: Parsing. Prentice-Hall, Englewood Cliffs, New Jersey, 1972.Google Scholar
  2. [2]
    Earley, J.: An efficient context-free parsing algorithm. Ph.D. Thesis, Carnegie-Mellon Univ., Pittsburgh, 1968.Google Scholar
  3. [3]
    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.Google Scholar
  4. [4]
    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.Google Scholar
  5. [5]
    Harrison, M.A.: Introduction to Formal Language Theory. Addison-Wesley, Reading, Mass., 1978.Google Scholar
  6. [6]
    Harrison, M.A. and I.M. Havel: On the parsing of deterministic languages. Journal of the ACM 21 (1974), 525–548.Google Scholar
  7. [7]
    Knuth, D.E.: On the translation of languages from left to right. Information and Control 8 (1965), 607–639.Google Scholar
  8. [8]
    Rosenkrantz, D.J. and R.E. Stearns: Properties of deterministic top-down grammars. Information and Control 17 (1970), 226–256.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1981

Authors and Affiliations

  • Esko Ukkonen
    • 1
  1. 1.Department of Computer ScienceUniversity of HelsinkiHelsinki 25Finland

Personalised recommendations