Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.5555/1880999.1881017guideproceedingsArticle/Chapter ViewAbstractPublication PagesConference Proceedingsacm-pubtype
Article

On LR(k)-parsers of polynomial size

Published: 06 July 2010 Publication History

Abstract

Usually, a parser for an LR(k)-grammar G is a deterministic pushdown transducer which produces backwards the unique rightmost derivation for a given input string xL(G). The best known upper bound for the size of such a parser is O(2|G||Σ|k+1) where |G| and |Σ| are the sizes of the grammar G and the terminal alphabet Σ, respectively. If we add to a parser the possibility to manipulate a directed graph of size O(|G|n) where n is the length of the input then we obtain an extended parser. The graph is used for an efficient parallel simulation of all potential leftmost derivations of the current right sentential form such that the unique rightmost derivation of the input can be computed. Given an arbitrary LR(k)-grammar G, we show how to construct an extended parser of O(|G| + #LA|N|2kk log k) size where |N| is the number of nonterminal symbols and #LA is the number of possible lookaheads with respect to the grammar G. As the usual parser, this extended parser uses only tables as data structure. Using some ingenious data structures and increasing the parsing time by a small constant factor, the size of the extended parser can be reduced to O(|G|+#LA|N|k2). The parsing time is O(ld(input) + k|G|n) where ld(input) is the length of the derivation of the input. Moreover, we have constructed a one pass parser.

References

[1]
Aho, A.V., Ullman, J.D.: The Theory of Parsing, Translation, and Compiling. Parsing, vol. I. Prentice-Hall, Englewood Cliffs (1972).
[2]
Blum, N.: Theoretische Informatik: Eine anwendungsorientierte Einführung. Oldenbourg Verlag (1998).
[3]
Blum, N.: On parsing LL-languages. TCS 267, 49-59 (2001).
[4]
Blum, N.: On LR(k)-parsers of polynomial size, Research report No. 85308, Dept. of Computer Science, University of Bonn (2010), http://theory.cs.uni-bonn.de/blum/papers/lr4.pdf
[5]
Chapman, N.P.: LR Parsing: Theory and Practice. Cambridge University Press, Cambridge (1987).
[6]
DeRemer, F.L.: Practical Translators for LR(k) Languages. Ph.D. Thesis, MIT, Harvard, Mass (1969).
[7]
Earley, J.: An efficient context-free parsing algorithm. CACM 13, 94-102 (1970).
[8]
Grune, D., Jacobs, C.J.H.: Parsing Techniques: A Practical Guide, 2nd edn. Monographs in Computer Science. Springer, Heidelberg (2008).
[9]
Sippu, S., Soisalon-Soininen, E.: Parsing Theory, vol. I: Languages and Parsing. EATCS Monographs on Theoretical Computer Science, vol. 15. Springer, Heidelberg (1988).
[10]
Sippu, S., Soisalon-Soininen, E.: Parsing Theory, vol. II: LR(k) and LL(k) Parsing. EATCS Monographs on Theoretical Computer Science, vol. 20. Springer, Heidelberg (1990).
[11]
Tomita, M.: An efficient context-free parsing algorithm for natural languages. In: IJCAI, pp. 756-764 (1985).
[12]
Ukkonen, E.: Lower bounds on the size of deterministic parsers. JCSS 26, 153-170 (1983).
[13]
Wilhelm, R., Maurer, D.: Compiler Design. Addison-Wesley, Reading (1995).

Recommendations

Comments

Information & Contributors

Information

Published In

cover image Guide Proceedings
ICALP'10: Proceedings of the 37th international colloquium conference on Automata, languages and programming: Part II
July 2010
614 pages
ISBN:3642141617

Sponsors

  • GDR Informatique Mathématique
  • CNRS: Centre National De La Rechercue Scientifique
  • Communauté Urbaine de Bordeaux
  • Conseil Rgional d'Aquitaine
  • INRIA: Institut Natl de Recherche en Info et en Automatique

Publisher

Springer-Verlag

Berlin, Heidelberg

Publication History

Published: 06 July 2010

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 0
    Total Downloads
  • Downloads (Last 12 months)0
  • Downloads (Last 6 weeks)0
Reflects downloads up to 01 Jan 2025

Other Metrics

Citations

View Options

View options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media