uuagc-diagrams-0.1.2.0: Utility for drawing attribute grammar pictures with the diagrams package

Safe HaskellNone
LanguageHaskell2010

UU.UUAGC.Diagrams

Description

Example usage of this package:

import UU.UUAGC.Diagrams

dia :: AGBackend b => AGDiagram b
dia = production ["count", "level"] "Docs" ["html", "count"]
        [ child ["count", "level"] "hd" ["html", "count"]
        , child ["count", "level"] "tl" ["html", "count"]
        ]
      # agrule shaftL "lhs.count" "hd.count"
      # agrule shaftL "lhs.level" "hd.level"
      # agrule shaftR "lhs.level" "tl.level"
      # agrule shaftL "hd.html" "lhs.html"
      # agrule shaftR "tl.html" "lhs.html"
      # agrule shaftR "tl.count" "lhs.count"
      # agrule shaftT "hd.count" "tl.count"
Synopsis

Documentation

production :: AGBackend b => [String] -> String -> [String] -> [Child b] -> AGDiagram b Source #

Construct a diagram for a full production, given its inherited attributes, name, synthesized attributes and children

child :: AGBackend b => [String] -> String -> [String] -> Child b Source #

Construct a child given its inherited attributes, name and sythesized attributes.

agrule :: AGBackend b => Trail V2 Double -> String -> String -> AGDiagram b -> AGDiagram b Source #

Construct an arrow between two attributes. The first argument specifies the shape of the arrow and can be shaftL, shaftR, shaftT, shaftB of shaftD, or a special trial constructed with the diagrams library.

indrule :: AGBackend b => String -> String -> AGDiagram b -> AGDiagram b Source #

Construct an induced dependency arrow between two attributes, similar to agrule but with an explicit trial.

shaftL :: Trail V2 Double Source #

Line that first moves left and then right

shaftR :: Trail V2 Double Source #

Line that first moves right and then left

shaftT :: Trail V2 Double Source #

Top half of a circle

shaftB :: Trail V2 Double Source #

Bottom half of a circle

shaftD :: Trail V2 Double Source #

Straight line

(#) :: a -> (a -> b) -> b infixl 8 #

Postfix function application, for conveniently applying attributes. Unlike ($), (#) has a high precedence (8), so d # foo # bar can be combined with other things using operators like (|||) or (<>) without needing parentheses.

class (Renderable (Path V2 Double) b, Backend b (V b) Double) => AGBackend b Source #

Instances
(Renderable (Path V2 Double) b, Backend b (V b) Double) => AGBackend b Source # 
Instance details

Defined in UU.UUAGC.Diagrams

data Child b Source #

Child with backend b, this type has been left abstract on purpose.