Attribute grammar: Difference between revisions
EndreyMark (talk | contribs) (→Separation of concerns: connections between monads, arrows and attribute grammars) |
EndreyMark (talk | contribs) m (Initiating new page Separation of concerns) |
||
Line 14: | Line 14: | ||
* both on its [http://www.cs.uu.nl/wiki/Ehc/WebHome project page] | * both on its [http://www.cs.uu.nl/wiki/Ehc/WebHome project page] | ||
* and on a separate [http://www.cs.uu.nl/wiki/HUT/AttributeGrammarSystem attribute grammar] page: | * and on a separate [http://www.cs.uu.nl/wiki/HUT/AttributeGrammarSystem attribute grammar] page: | ||
the reason may be that a compiler project is complex enough to require good separation of concerns, modularity, reuse (goals of Aspect Oriented Programming, too), and attribute grammars are powerful tools to achieve these goals. | the reason may be that a compiler project is complex enough to require good [[separation of concerns]], modularity, reuse (goals of Aspect Oriented Programming, too), and attribute grammars are powerful tools to achieve these goals. | ||
[http://en.wikipedia.org/wiki/Attribute_grammar Wikipedia article] | [http://en.wikipedia.org/wiki/Attribute_grammar Wikipedia article] | ||
Line 20: | Line 20: | ||
== Separation of concerns == | == Separation of concerns == | ||
Both Swiestra's article (mentioned above) and the Essential Haskell Compiler Project tool (mentioned below) remarks the connection of attribute grammars to the topic of separation of concerns, a goal of aspect orinted programming. This goal can be achieved by multiple ways in functional programming, see the concepts [[monad]] and [[arrow]]). Swiestra'a article mentions analogies between | Both Swiestra's article (mentioned above) and the Essential Haskell Compiler Project tool (mentioned below) remarks the connection of attribute grammars to the topic of [[separation of concerns]], a goal of aspect orinted programming. This goal can be achieved by multiple ways in functional programming, see the concepts [[monad]] and [[arrow]]). Swiestra'a article mentions analogies between | ||
* attribute grammars, | * attribute grammars, | ||
* (Reader, Writer, State) [[monad]]s, | * (Reader, Writer, State) [[monad]]s, |
Revision as of 15:28, 11 June 2006
Introduction
Especially for functional programmers (with Haskell examples) -- see Wouter Swierstra: Why Attribute Grammars Matter (published in The Monad.Reader, Issue Four). And also very deep connections with
- catamorhisms, category theory
- attribute grammars
are described there. And there are links from that article to other materials providing deep insights in these powerful theories: attribute grammar tools and articles of the Essential Haskell Compiler project.
It is no wonder that it is exactly a compiler project homepage that provides good circular programming and attribute grammar tutorials
- both on its project page
- and on a separate attribute grammar page:
the reason may be that a compiler project is complex enough to require good separation of concerns, modularity, reuse (goals of Aspect Oriented Programming, too), and attribute grammars are powerful tools to achieve these goals.
Separation of concerns
Both Swiestra's article (mentioned above) and the Essential Haskell Compiler Project tool (mentioned below) remarks the connection of attribute grammars to the topic of separation of concerns, a goal of aspect orinted programming. This goal can be achieved by multiple ways in functional programming, see the concepts monad and arrow). Swiestra'a article mentions analogies between
Portals or other rich resources
Tools
Utrecht University's Attribute Grammar System tools include also an attribute grammar compiler, UUAGC. The concept of attribute grammar was used in their Essential Haskell Compiler project, which gives us not only a working programming language, but also a good didactical material about using attribute grammars, e.g. in writing compilers.
Albeits these materials are self-contained, they reveal that the theory of attribute grammars is related to other concepts (circular programming, catamorphism).
Related concepts
- Circular programming
- Catamorphism, see Category theory