Advertisement

Rule splitting and attribute-directed parsing

  • David A. Watt
Attribute And Affix Grammars
Part of the Lecture Notes in Computer Science book series (LNCS, volume 94)

Abstract

Rule splitting is a phenomenon, most clearly exhibited by attribute grammars and affix grammars, in which the syntactic structure of a phrase is constrained by its attributes. In this paper, rule splitting is illustrated by examples taken from real programming languages, and two varieties of rule splitting are identified and formalized. Implementations of rule splitting (attribute-directed parsing) are demonstrated for top-down and bottom-up parsers, both one-pass and multi-pass. Finally, the problems of exploiting rule splitting in a compiler writing system based on attribute grammars are explored.

Keywords

Evaluation Rule Syntax Tree Attribute Grammar Rule Splitting Parsing Method 
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.

References

  1. Bochmann 76.
    Bochmann, G.V.: Semantic evaluation from left to right. Comm. ACM 19, 55–62 (1976)CrossRefGoogle Scholar
  2. Bochmann & Ward 75.
    Bochmann, G.V., Ward, P.: Compiler writing systems for attribute grammars. Département d'Informatique, Université de Montréal, Publication #199, July 1975Google Scholar
  3. Crowe 72.
    Crowe, D.: Constructing parsers for affix grammars. Comm. ACM 15, 728–734 (1972)CrossRefGoogle Scholar
  4. Eriksen et al 79.
    Eriksen, S.H., Kristensen, B.B., Madsen, O.L.: The BOBS-system. Aarhus University, Report DAIMI PB-71 (revised version), 1979Google Scholar
  5. Ganzinger et al 77.
    Ganzinger, H., Ripken, K., Wilhelm, R.: Automatic generation of optimizing multipass compilers. In: Proc. IFIP 77 Congress, pp. 535–540. Amsterdam: North-Holland 1977Google Scholar
  6. Hoare 72.
    Hoare, C.A.R.: Notes on data structuring. In: Structured Programming (O.-J. Dahl, E.W. Dijkstra, C.A.R. Hoare), pp. 83–174. London-New York: Academic Press 1972Google Scholar
  7. Jazayeri & Walter 75.
    Jazayeri, M., Walter, K.G.: Alternating semantic evaluation. Proc. ACM Annual Conference, Minneapolis, 1975Google Scholar
  8. Jespersen et al 79.
    Jespersen, P., Madsen, M., Riis, H.: NEATS, New Extended Attribute Translation System. Aarhus University, 1979Google Scholar
  9. Knuth 68.
    Knuth, D.E.: Semantics of context-free languages. Mathematical Systems Theory 2, 127–145 (1968)CrossRefGoogle Scholar
  10. Koster 71a.
    Koster, C.H.A.: Affix grammars. In: ALGOL 68 Implementation (J.E. Peck, ed.), pp. 95–109. Amsterdam: North-Holland 1971Google Scholar
  11. Koster 71b.
    Koster, C.H.A.: A compiler compiler. Mathematisch Centrum, Amsterdam, Report MR127 (November 1971). Also: Using the CDL compiler compiler. In: Compiler Construction, an Advanced Course (F.L. Bauer, J. Eickel, eds.), pp. 366–426. Lecture Notes in Computer Science, Vol. 21. Berlin-Heidelberg-New York: Springer 1974Google Scholar
  12. Lecarme & Bochmann 74.
    Lecarme, O., Bochmann, G.V.: A (truly) usable and portable compiler writing system. In: Proc. IFIP 74 Congress, pp. 218–221. Amsterdam: North-Holland 1974Google Scholar
  13. Lewis et al 74.
    Lewis, P.M., Rosenkrantz, D.J., Stearns, R.E.: Attributed translations. J. Computer and System Sciences 9, 279–307 (1974)Google Scholar
  14. Lorho 75.
    Lorho, B.: Semantic attributes processing in the system DELTA. In: Methods of algorithmic language implementation (C.H.A. Koster, ed.), pp. 21–40. Lecture Notes in Computer Science, Vol. 47. Berlin-Heidelberg-New York: Springer 1977Google Scholar
  15. Madsen 80.
    Madsen, O.L.: On defining semantics by means of extended attribute grammars. Aarhus University, Report DAIMI PB-109, January 1980Google Scholar
  16. Watt 74a.
    Watt, D.A.: Analysis-oriented two-level grammars. University of Glasgow, Ph.D. thesis, January 1974Google Scholar
  17. Watt 74b.
    Watt, D.A.: LR parsing of affix grammars. Computing Science Department, University of Glasgow, Report 7, August 1974Google Scholar
  18. Watt 77.
    Watt, D.A.: The parsing problem for affix grammars. Acta Informatica 8, 1–20 (1977)Google Scholar
  19. Watt 79.
    Watt, D.A.: An extended attribute grammar for Pascal. SIGPLAN Notices 14, 2, 60–74 (1979)Google Scholar
  20. Watt & Madsen 79.
    Watt, D.A., Madsen, O.L.: Extended attribute grammars. Aarhus University, Report DAIMI PB-105, November 1979Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1980

Authors and Affiliations

  • David A. Watt
    • 1
  1. 1.Computing Science DepartmentUniversity of GlasgowGlasgowScotland

Personalised recommendations