Affiliation:
1. Harvard Univ., Cambridge, MA
2. Princeton Univ., Princeton, NJ
Abstract
The problem of determining whether an arbitrary context-free grammar is a member of some easily parsed subclass of grammars such as the LR(k) grammars is considered. The time complexity of this problem is analyzed both when k is considered to be a fixed integer and when k is considered to be a parameter of the test. In the first case, it is shown that for every k there exists an O(n
k+2
) algorithm for testing the LR(k) property, where n is the size of the grammar in question. On the other hand, if both k and the subject grammar are problem parameters, then the complexity of the problem depends very strongly on the representation chosen for k. More specifically, it is shown that this problem is NP-complete when k is expressed in unary. When k is expressed in binary the problem is complete for nondeterministic exponential time. These results carry over to many other parameterized classes of grammars, such as the LL(k), strong LL(k), SLR(k), LC(k), and strong LC(k) grammars.
Publisher
Association for Computing Machinery (ACM)
Reference9 articles.
1. Operations on sparse relations and efficient algorithms for grammar problems
2. Context-free languages and Turing machine computations
3. Aho A.V. and UUman J.D. The Theory of Parsing Translation and Compiling Vols. 1 and 2. Prentice-Hall Englewood Cliffs N.J. 1972 and 1973. Aho A.V. and UUman J.D. The Theory of Parsing Translation and Compiling Vols. 1 and 2. Prentice-Hall Englewood Cliffs N.J. 1972 and 1973.
4. On the translation of languages from left to right
5. Simple deterministic languages
Cited by
19 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献