A top-down no backtrack parsing of general context-free languages
A new parsing algorithm is presented. The algorithm works in a top-down manner and it is easily implementable. The algorithm works for all non left-recursive ε-free context-free grammars. For LR(1) left-recursion-free grammars works like an LR(1) push-down acceptor. The time bounds are O(n3) for all context-free grammars, O(n2) for a superset of unambiguous grammars and O(n) for a superset of LR grammars (see Graham, Harrison ). It is hoped that the ideas used in the algorithm can help to find an accepting algorithm working in time O(n2). The method has promising properties for error recovery in compilers and produces all the possible parses in a string encoding. In any case, the ideas presented in the paper can contribute to the understanding of the parsing problem of general context-free languages.
KeywordsError Recovery Input String Analysis Picture Syntax Analysis Initial Symbol
Unable to display preview. Download preview PDF.
- 1.Graham, S.L., Harrison, M.A., Parsing of General Context-Free Languages, Advances in Computers 14, (1976), pp. 77–185.Google Scholar
- 2.Král,J., Bottom-up Versus Top Down Syntax Analysis Revised, Report of Institute of Comp. Technique, 10/74, Prague, Dec. 1974.Google Scholar
- 3.Král,J., Semitop-Down Transition Diagrams Driven Syntax Analysis, Report of the Institute of Computation Technique, Dec. 1974.Google Scholar
- 4.Aho,A.V., Ullman,J.D., The Theory of Parsing, Translation and Compiling, Vol.1,2, Prentice Hall, Englewood Cliffs, 1972, 1973.Google Scholar
- 5.Král,J., Demner,J., Parsing as a Subtask of Compiling, Mathematical Foundations of Computer Science 1975, Lecture Notes in Computer Science 32, Springer V., Berlin (1975), pp. 61–74Google Scholar
- 6.Aho,A.V., Hopcroft,J.E. and Ullman,J.D., The Design and Analysis of Computer Algorithms, Addison-Wesley, Reading, Mass., 1974.Google Scholar
- 9.Sklenář,I., Private Communication.Google Scholar
- 10.Tseitin,G.S., ALGOL 68, the implementation methods (in Russian), Leningr. Univ. Press, Leningrad 1976.Google Scholar