Skip to main content
Log in

On parsing two-level grammars

  • Published:
Acta Informatica Aims and scope Submit manuscript

Summary

Making use of the fact that two-level grammars (TLGs) may be thought of as finite specification of context-free grammars (CFGs) with “infinite” sets of productions, known techniques for parsing CFGs are applied to TLGs by first specifying a canonical CFG G′ — called skeleton grammar — obtained from the “cross-reference” of the TLG G. Under very natural restrictions it can be shown that for these grammar pairs (G, G′) there exists a 1 — 1 correspondence between leftmost derivations in G and leftmost derivations in G′. With these results a straightforward parsing algorithm for restricted TLGs is given.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Aho A, Ullman J (1972) The theory of parsing, translation, and compiling, Vol.I: Parsing. Prentice Hall, Englewood Cliffs, NJ

    Google Scholar 

  2. Aho A, Ullman J (1973) The theory of parsing, translation, and compiling, Vol.II: Compiling. Prentice Hall, Englewood Cliffs, NJ

    Google Scholar 

  3. Ambler AL (1973) Nested LR(k) parsing using grammars of the van Wijngaarden type, Ph.D. Thesis, Dept. of Computer Sciences, Univ. of Wisconsin

  4. Baker JL (1972) Grammars with structured vocabulary: a model for the Algol 68 definition. Information and Control 20:351–395

    Google Scholar 

  5. Branquart P. Cardinal JP, Delescaille JP, Lewi J (1972) A context-free syntax of Algol 68. Information Processing Lett. 1:141–148

    Google Scholar 

  6. Deussen P (1975) A decidability criterion for van Wijngaarden grammars. Acta Informat. 5:353–375

    Google Scholar 

  7. Deussen P, Mehlhorn K (1977) Van Wijngaarden grammars and space complexity class EXSPACE. Acta Informat. 8:193–199

    Google Scholar 

  8. Deussen P, Wegner L (1978) A bibliography of van Wijngaarden grammars, Bulletin of the European Ass. for Theoretical Computer Science (EATCS) 6

  9. Greibach SA (1974) Some restrictions on W-grammars, ACM Proceedings of the 6th Symposium on the Theory of Computing, Seattle

  10. Gries D (1971) Compiler construction for digital computers. John Wiley, New York

    Google Scholar 

  11. Hesse W (1976) Vollständige formale Beschreibung von Programmiersprachen mit zweischichtigen Grammatiken, Dissertation, Technische Universität München, Bericht Nr. 7623

  12. Koster CHA (1972) Affix grammars. In: Algol 68 implementation. Proc. of the IFIP Work. Conf. on Algol 68 implementation, 95–109, North Holland, Amsterdam

    Google Scholar 

  13. Makanin GS (1977) The problem of solvability of equations in a free semigroup (in Russian). Matematiceskij sbornik 103 (145), No. 2(6), pp. 147–236; english summary in: (1977) Dokl Akad Nauk SSSR, Soviet Math Dokl 18 330–334

    Google Scholar 

  14. Maurer H (1969) Theoretische Grundlagen der Programmiersprachen — Theorie der Syntax. Bibliographisches Institut, Mannheim

    Google Scholar 

  15. Rounds WC (1973) Complexity of recognition in intermediate — level languages, in: Proc. of the IEEE 14th Annual Symposium on Switching and Automata Theory, 145–158

  16. Salomaa A (1973) Formal languages. Academic Press, New York, London

    Google Scholar 

  17. Sintzoff M (1967) Existence of a van Wijngaarden syntax for every recursively enumerable set. Ann Soc Sci Bruxelles 81:115–118

    Google Scholar 

  18. Watt DA (1977) The parsing problem for affix grammars. Acta Informat 8:1–20

    Google Scholar 

  19. Wegner L (1977) Analysis of two-level grammars. Ph.D. thesis, Hochschul-Verlag, Stuttgart

    Google Scholar 

  20. Wegner L (1979) Bracketed two-level grammars — a decidable and practical approach to language definitions. ICALP 79, Graz. Springer, Berlin Heidelberg New York (Lecture Notes in Computer Sciences, Vol. 71, p. 668)

    Google Scholar 

  21. Wegner L (1979) Two-level grammar translations, GI-9. Jahrestagung, Bonn. Springer, Berlin Heidelberg New York (Informatik Fachberichte, Band 19 (1965) p. 163)

    Google Scholar 

  22. Wijngaarden A van (1965) Orthogonal design and Description of formal languages. Mathematisch Centrum Amsterdam, MR 76

    Google Scholar 

  23. Wijngaarden A van (ed.) (1969) Report on the Algorithmic language ALGOL 68. Numer 14:79–218

  24. Wijngaarden A van, Mailloux BJ, Peck JEL, Koster CHA, Sintzoff M, Lindsey CH, Meertens LGLT, Fisker RG (eds.) (1976) Revised report on the Algorithmic language ALGOL 68. Springer, Berlin Heidelberg New York

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

About this article

Cite this article

Wegner, L.M. On parsing two-level grammars. Acta Informatica 14, 175–193 (1980). https://doi.org/10.1007/BF00288543

Download citation

  • Received:

  • Revised:

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF00288543

Keywords

Navigation