Characterizations of the LL(k) property
Characterizations of the LL(k) property for context-free grammars are given, which lead to efficient algorithms for testing an arbitrary context-free grammar for the LL(k) property. The characterizations are based on succinct nondeterministic representations of a finite-state automaton used for constructing a canonical LL(k) parser. The resulting testing algorithms are usually of the same order to time complexity as their LR(k) counterparts. For example, one characterization (the LR(k) counterpart of which has been used by Hunt, Szymanski and Ullman for obtaining the fastest known algorithm for LR(k) testing) implies an 0(nk+2) algorithm for LL(k) testing, where n is the size of the grammar in question and k is considered to be a fixed integer. This time bound for LL(k) testing has previously only been obtained indirectly, by a linear time-bounded reduction of LL(k) testing to LR(k) testing. Moreover, it is shown that the LL(k) property allows an especially convenient characterization, one which allows an 0(nk+1) algorithm for LL(k) testing. This new time bound suggests that the LL(k) property might be strictly easier to test than the LR(k) property.
KeywordsAccessible State General String Nondeterministic Automaton Succinct Representation Terminal String
Unable to display preview. Download preview PDF.
- 1.Aho, A.V., and J.D. Ullman, The Theory of Parsing, Translation and Compiling. Vol. 1: Parsing. Prentice-Hall, 1972.Google Scholar
- 2.Brosgol, B.M., Deterministic Translation Grammars. TR 3–74, Center for Research in Computing Technology, Harvard University, 1974.Google Scholar
- 3.Harrison, M.A., Introduction to Formal Language Theory. Addison-Wesley, 1978.Google Scholar
- 4.Hunt, H.B., III, T.G. Szymanski and J.D. Ullman, Operations on sparse relations and efficient algorithms for grammar problems. IEEE 15th Annual Symposium on Switching and Automata Theory, 1974, 127–132.Google Scholar
- 5.Hunt, H.B., III, T.G. Szymanski and J.D. Ullman, On the complexity of LR(k) testing. Comm. ACM 18 (1975), 707–716.Google Scholar
- 6.Hunt, H.B., III, and T.G. Szymanski, Lower bounds and reductions between grammar problems. J. ACM 25 (1978), 32–51. (Corrigendum: J. ACM 25 (1978), 687–688.)Google Scholar
- 7.Johnson, D.B., and R. Sethi, Efficient Construction of LL(1) Parsers. Technical Report No. 164, Computer Science Department, The Pennsylvania State University, 1975.Google Scholar
- 8.Sippu, S., and E. Soisalon-Soininen, On constructing LL(k) parsers. Automata, Languages and Programming, Sixth Colloquium, Graz, July 1979 (H.A. Maurer, ed.). Springer-Verlag, 1979, 585–595.Google Scholar