Abstract
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 [1]). 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.
Preview
Unable to display preview. Download preview PDF.
References
Graham, S.L., Harrison, M.A., Parsing of General Context-Free Languages, Advances in Computers 14, (1976), pp. 77–185.
Král,J., Bottom-up Versus Top Down Syntax Analysis Revised, Report of Institute of Comp. Technique, 10/74, Prague, Dec. 1974.
Král,J., Semitop-Down Transition Diagrams Driven Syntax Analysis, Report of the Institute of Computation Technique, Dec. 1974.
Aho,A.V., Ullman,J.D., The Theory of Parsing, Translation and Compiling, Vol.1,2, Prentice Hall, Englewood Cliffs, 1972, 1973.
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–74
Aho,A.V., Hopcroft,J.E. and Ullman,J.D., The Design and Analysis of Computer Algorithms, Addison-Wesley, Reading, Mass., 1974.
Irons, T., An Error Correcting Parse Algorithm, Comm. ACM 6, (1963), pp. 669–673.
Graham, S.L., Rhodes, S.P., Practical Syntactic Error Recovery, Comm. ACM 18, (1975), 639–649.
Sklenář,I., Private Communication.
Tseitin,G.S., ALGOL 68, the implementation methods (in Russian), Leningr. Univ. Press, Leningrad 1976.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1977 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Král, J. (1977). A top-down no backtrack parsing of general context-free languages. In: Gruska, J. (eds) Mathematical Foundations of Computer Science 1977. MFCS 1977. Lecture Notes in Computer Science, vol 53. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-08353-7_153
Download citation
DOI: https://doi.org/10.1007/3-540-08353-7_153
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-08353-5
Online ISBN: 978-3-540-37285-1
eBook Packages: Springer Book Archive