Parsing as a subtask of compiling

  • Jaroslav Král
  • Jiří Demner
Invited Lectures
Part of the Lecture Notes in Computer Science book series (LNCS, volume 32)


In the last years the research of context-free languages was concentrated on the problems of syntactic analysis and recently on the problems of the integrated theory of parsing and compiling using affix (Koster [18]) or attribute grammars (Lewis [25], Bochmann [2], Knuth [16]).

In this paper the requirements on parsing methods in compilers are discussed. The advantages of top-down parsing method are summarized and a modification of the top-down method able to parse LR(k) grammars without left recursive symbols is given.

The problem of the syntactic analysis is then reduced to the problem how to insert “action symbols” (controlling the compiling) into the input string. It is shown that in such a treatment the differencies between the bottom-up and top-down methods are in some sense less important. Some bottom-up methods, especially the LR(k) ones, have hidden top-down features which can be easily used up. Some modifications of bottom up methods allowing to produce top-down like parsing information are discussed.


Error Recovery Syntactic Analysis Semantic Action Attribute Grammar Formal Language Theory 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Aho, A.V. and Ullman, J.D., The Theory of Parsing, Translation and Compiling Vol I, II, Prentice Hall (1972, 1974).Google Scholar
  2. 2.
    Bochman,G.V., Semantics Evaluated from Left to Right, Dept. d' Informatique, Univ. de Montreal,1973.Google Scholar
  3. 3.
    Demner, J., One Method of Compiler Oriented Syntactic Analysis with the Semi-Top-Down Strategy. Report ÚVT ČVUT, ÚVT 9/74/M, Oct. 1974.Google Scholar
  4. 4.
    DeRemer, F.L., Simple LR(k) Grammars, Comm. ACM, 14 (1971), 453–460.CrossRefGoogle Scholar
  5. 5.
    Dömölki, B., Algorithms for the Recognition of Properties of Sequences of Symbols (in Russian), U.S.S.R. Comp. Math. and Math. Physics, 5 (1967), Pergamon Press 1967, 101–103.CrossRefGoogle Scholar
  6. 6.
    Duplínský, J., Šturc J., Translator Writing System User Manual (in Slovak), UNO Research Comping Centre, Bratislava 1973.Google Scholar
  7. 7.
    Floyd, R.W., Syntactic Analysis and Operator Precedence, J. ACM, 10 (1963), 316–333.CrossRefGoogle Scholar
  8. 8.
    Floyd, R.W., Bounded Context Syntactic Analysis. Comm. ACM, 7 (1964), 62–67.CrossRefGoogle Scholar
  9. 9.
    Ginsburg, S., The Mathematical Theory of Context-free Languages, Mc Graw-Hill, 1966.Google Scholar
  10. 10.
    Gray, J.N., Precedence Parsers for Programming Languages, Ph.D. Thesis, Univ. of California Berkeley, 1969.Google Scholar
  11. 11.
    Gries, D., Compiler Construction for Digital Compilers, John Wiley, New York, 1971.Google Scholar
  12. 12.
    Harrison, M.A. and Havel, I.M., Strict Deterministic Grammars, J. Comp. System Sci, 7 (1973), 237–277.Google Scholar
  13. 13.
    Havel, I.M., Strict Deterministic Languages, PhD Thesis, Univ. of California, Berkeley, Dec. 1971.Google Scholar
  14. 14.
    Hopcroft, J.E. and Ullman J.D., Formal Languages and Their Relation to Automata, Addison-Wesley, Reading, Mass., 1969.Google Scholar
  15. 15.
    Knuth, D.E., On the Translation of Languages from Left to Right, Information and Control, 8 (1965), 607–639.CrossRefGoogle Scholar
  16. 16.
    Knuth, D.E., Semantics of Context-Free Languages, Math. Syst. Theory 2, (1968), 127–145.CrossRefGoogle Scholar
  17. 17.
    Kopřiva, J., A Contribution to the Top Down Parsing Rehabilitation, Kybernetika (Prague), (1968).Google Scholar
  18. 18.
    Koster, C.H.A., Affix Grammars, In Algol 68 Implementation, (J.E.L. Peck, Ed.), 95–109, North Holland, Amsterdam, 1971.Google Scholar
  19. 19.
    Král, J. and Demner, J., Semi-Top-Down Syntactic Analysis, Report ÚVT ČVUT, ÚVT 6/73/M, 1973.Google Scholar
  20. 20.
    Král, J., A Concise Graphic Form Expressing the Algol 68 Syntax, to appear in Information Processing Machines 19.Google Scholar
  21. 21.
    Král, J., Demner, J., A Note on the Number of the States of DeRemer's Recognizer, Information Processing Letters, 2 (1973), 22–23.CrossRefGoogle Scholar
  22. 22.
    Král, J., Semi-Top-Down Transition Diagrams Driven Syntax Analysis. Report of the Institute of Computation Technique of Prague Technical Univ., ÚVT 11/74, Dec. 1974.Google Scholar
  23. 23.
    Král, J., Bottom-Up Versus Top-Down Syntax Analysis Revised, Report of the Institute of Computation Techniques of the Prague Technical University, ÚVT 10/74, December 1974, presented at the MFCS 74 Conference, Jadwisin, June 1974. (Cf. Lecture Notes in Computer Science 28, Springer-Verlag, Berlin, 1975, pp. 256–273).Google Scholar
  24. 24.
    Křetínský, J., Private communication. (1974).Google Scholar
  25. 25.
    Lewis, P.M., Rosenkrantz, D.J. and Stearns, R.E., Attributed Translations, J. Comp. System Sci., 9 (1974), 279–307.Google Scholar
  26. 26.
    Rozenkrantz, D.J. and Stearns, R.E., Properties of Deterministic Top-Down Grammars, Inf. and Control, 17 (1970), 226–256.Google Scholar
  27. 27.
    Ružička, P. and Šturc, J., Two Classes of LR-Parsable Ambiguous Grammars, (in Slovak), Conference Integrated Information Systems, Bratislava (1974).Google Scholar
  28. 28.
    Ružička, P., LR Methods of Syntactic Analysis (in Slovak), Proceedings of SOFSEM 74 Symposium, UNO Computing and Research Centre, 1974.Google Scholar
  29. 29.
    Šturc, J., Translator Writing Systems and Error Treatment in the Syntax Directed Translation (in Slovak), Seminar SOFSEM 74, High Tatras (1974), 1–27.Google Scholar
  30. 30.
    Salomaa, A., Formal Languages, Academic Press, New York, 1973.Google Scholar
  31. 31.
    Voda, P., Duplinský, J., Kubíšová, M., Ružička, P. and Šturc, J., Languages of Programming Systems, Metasystem Means of Language Systems III, (in Slovak), Report UNO Research Computing Centre, Bratislava, (March 1975).Google Scholar
  32. 32.
    van Wijngaarden et al, Revised Report on the Algorithmic Language ALGOL 68, Technical Report TR 74-3, Dept. of Comp. Sci, The University of Alberta, Edmonton, Alberta (1974).Google Scholar
  33. 33.
    Wirth, N., The Programming Language PASCAL, Berichte der Fachgruppe Computer-Wissenschaften, Eidgnöstische TH Zürich (Nov 1972).Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1975

Authors and Affiliations

  • Jaroslav Král
    • 1
  • Jiří Demner
    • 1
  1. 1.Institute of Computation TechniqueTechnical University of PragueCzechoslovak

Personalised recommendations