Skip to main content

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

  • Communications
  • Conference paper
  • First Online:
Mathematical Foundations of Computer Science 1977 (MFCS 1977)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 53))

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  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–74

    Google 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 

  7. Irons, T., An Error Correcting Parse Algorithm, Comm. ACM 6, (1963), pp. 669–673.

    Article  Google Scholar 

  8. Graham, S.L., Rhodes, S.P., Practical Syntactic Error Recovery, Comm. ACM 18, (1975), 639–649.

    Article  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 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Jozef Gruska

Rights and permissions

Reprints 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

Publish with us

Policies and ethics