A top-down no backtrack parsing of general context-free languages

  • Jaroslav Král
Part of the Lecture Notes in Computer Science book series (LNCS, volume 53)


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.


Error Recovery Input String Analysis Picture Syntax Analysis Initial Symbol 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Graham, S.L., Harrison, M.A., Parsing of General Context-Free Languages, Advances in Computers 14, (1976), pp. 77–185.Google Scholar
  2. 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. 3.
    Král,J., Semitop-Down Transition Diagrams Driven Syntax Analysis, Report of the Institute of Computation Technique, Dec. 1974.Google Scholar
  4. 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. 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. 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
  7. 7.
    Irons, T., An Error Correcting Parse Algorithm, Comm. ACM 6, (1963), pp. 669–673.CrossRefGoogle Scholar
  8. 8.
    Graham, S.L., Rhodes, S.P., Practical Syntactic Error Recovery, Comm. ACM 18, (1975), 639–649.CrossRefGoogle Scholar
  9. 9.
    Sklenář,I., Private Communication.Google Scholar
  10. 10.
    Tseitin,G.S., ALGOL 68, the implementation methods (in Russian), Leningr. Univ. Press, Leningrad 1976.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1977

Authors and Affiliations

  • Jaroslav Král
    • 1
  1. 1.ÚVT ČVUTPrague 2Czechoslovakia

Personalised recommendations