Advertisement

A mathematical approach to multi-pass parsing

  • Berthold Hoffmann
  • Ilse -R. Schmiedecke
Communications
Part of the Lecture Notes in Computer Science book series (LNCS, volume 88)

Abstract

Derivations from Two-Level Grammars have been defined only in terms of the infinite context-free grammars that can be generated from them. This fact has proven a severe theoretical obstacle to solving the parsing problem for two-level grammars. So far, partial solutions exist for Van Wijngaarden Grammars, Extended Affix Grammars, and Affix Grammars which allow parsing in a single pass from left to right, because these special cases could be handled without developing a full theory of parsing for two-level grammars.

In this paper, we propose a new theory of Extended Affix Grammar derivations. The key idea is to use a graph grammar for modelling the two-level derivation process. This allows us to give a precise definition of a parse, which applies correctly to any well-formed Extended Affix Grammar. The concept of multi-pass parsing originates from practical compiler design, where parses are organized as a sequence of passes in order to avoid random access to the full parse tree. We demonstrate how this concept can be incorporated into our theoretical framework by means of canonical graph derivations. This allows us not only to establish the adequacy of the multi-pass approach, but can also be used as a complexity measure for Extended Affix Grammars.

Keywords

Extended Affix Grammars Graph Grammars Two-Level Derivations Parsing Passes Pass-Complexity 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. [A68RR]
    WIJNGAARDEN v., A. (ed.): Revised Report on the Algorithmic Language ALGOL68. Springer-Verlag, Berlin-Heidelberg-New York (1974)Google Scholar
  2. [Bak72]
    BAKER, John L.: Grammars with Structured Vocabulary: a Model for the ALGOL-68 Definition. Information & Control 20, pp. 351–359 (1972)Google Scholar
  3. [CDL76]
    DEHOTTAY, J.-P., FEUERHAHN, N., KOSTER, C.H.A. STAHL, H.-M.: Syntaktische Beschreibung von CDL2. Technical Report, Research Group Softwaretechnik, TU Berlin (1976)Google Scholar
  4. [Deu75]
    DEUSSEN, P.: A Decidability Criterion for van Wijngaarden Grammars. Acta Informatica 5, pp. 355–375 (1975)Google Scholar
  5. [DM78]
    DEMBINSKI, P., MAKLUSZINSKI, J.: Attribute Grammars and Two-Level Grammars: A Unifying Approach. Proc. of the 7th Symposium on Mathematical Foundations of Computer Science, LNCS 64, Zakopane (1978)Google Scholar
  6. [Ehr79]
    EHRIG, H.: Introduction to the Algebraic Theory of Graph Grammars. In: Proceedings of the International Workshop on Graph Grammars and their Applications to Computer Science and Biology, Springer, LNCS 73, pp. 1–69 (1979)Google Scholar
  7. [FHP76]
    FRANZEN, H., HOFFMANN, B., PETERSEN, I.-R.: Ein Parser-Generator für Erweiterte Affix-Grammatiken. Research Report 76–24, FB 20, TU Berlin (1976)Google Scholar
  8. [FHS79]
    FRANZEN, H., HOFFMANN, B., SCHMIEDECKE, I.-R.: Using Two-Level Language Descriptions for Compiler Construction. In: Tagungsbericht über das “Fachgespräch Compiler-Compiler”, Berlin 78, Forschungsbericht TU Darmstadt (1979)Google Scholar
  9. [FH79]
    FRANZEN, H., HOFFMANN, B.: Automatic Determination of Data Flow in Extended Affix Grammars. Proceedings of the 8th annual GI meeting, Bonn 79, Informatik Fachbericht 19, Springer-Verlag, Berlin-Heidelberg-New York (1979)Google Scholar
  10. [Gre74]
    GREIBACH, S.A.: Some Restrictions on W-Grammars. In: ACM Proceedings of the 6th STOC, Seattle (1974)Google Scholar
  11. [GW77]
    GIEGERICH, H., WILHELM, R.: Implementierbarkeit attributierter Grammatiken. In: GI — 7.Jahrestagung, Informatik Fachbericht 10, Springer-Verlag, Berlin-Heidelberg-New York (1977)Google Scholar
  12. [HS80]
    HOFFMANN, B., SCHMIEDECKE, I.-R.: Multi-Pass Parsing for Two-Level Grammars: A Mathematical Approach. Research Report, FB 20, TU Berlin, May (1980)Google Scholar
  13. [Kas80]
    KASTENS, U.: Ordered Attributed Grammars. Acta Informatica 13,3, pp. 229–256 March (1980)Google Scholar
  14. [Knu68]
    KNUTH, D.E.: Semantics of Context-Free Languages. In: Mathematic Systems Theory, 2(2), pp. 125–145 (1968). Correction: 5(1), (1971)Google Scholar
  15. [Kos71a]
    KOSTER, C.H.A.: Affix Grammars. In: ALGOL-68-Implementation, J.E.L. Peck (ed.), North Holland Publ. Comp., Amsterdam-London, pp. 95–109 (1971)Google Scholar
  16. [Kos71b]
    KOSTER, C.H.A.: A Compiler Compiler. Technical Report MR 127, Mathematisch Centrum, Amsterdam (1971)Google Scholar
  17. [Kos74]
    KOSTER, C.H.A.: Two-Level Grammars. In: Proceedings of the Advanced Course on Compiler Construction, Munich, Lecture Notes, Springer-Verlag, Berlin-Heidelberg-New York, pp. 146–156 (1974)Google Scholar
  18. [LB74]
    LECARME, O., BOCHMANN v., G.: A (truly) Usable and Portable Compiler Writing System. In: Information Processing 1974, pp. 218, North Holland Publ. Comp., Amsterdam (1974)Google Scholar
  19. [Loh77]
    LOHRO, B.: Semantic Attributes Processing in the System DELTA. In: Methods of Algorithmic Language Implementation, Springer-Verlag, Berlin-Heidelberg-New York, pp. 21–40 (1977)Google Scholar
  20. [Sin67]
    SINTZOFF, M.: Existence of a van Wijngaarden Syntax for Every Recursive Enumerable Set. Ann. Soc. Scientifique de Bruxelles 81, pp. 115–118 (1967)Google Scholar
  21. [Wat75]
    WATT, D.A.: Analysis-Oriented Two-Level Grammars. Ph. D. thesis, Glasgow (1974), printed at the Technical University of Berlin (1975)Google Scholar
  22. [Weg78a]
    WEGNER, L.M.: On Parsing Two-Level Grammars. Bericht 7, Institut für Informationsverarbeitung, TU Graz, March (1978)Google Scholar
  23. [Weg78b]
    WEGNER, L.M.: Bracketed Two-Level Grammars: A Decidable and Practicable Approach to Language Definitions. Universität Karlsruhe, Institut für Angewandte Informatik und formale Beschreibungsverfahren, Report No. 76, Sept. 1978Google Scholar
  24. [Wij65]
    WIJNGAARDEN v., A.: Orthogonal Design and Description of Formal Language. Report MR 76, Mathematisch Centrum, Amsterdam (1965)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1980

Authors and Affiliations

  • Berthold Hoffmann
    • 1
  • Ilse -R. Schmiedecke
    • 1
  1. 1.TU Berlin, DFG-Projekt EAGLEBerlin 10

Personalised recommendations