File: ConcreteSyntax.ag

package info (click to toggle)
uuagc 0.9.56-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 5,764 kB
  • sloc: haskell: 84,340; makefile: 11
file content (132 lines) | stat: -rw-r--r-- 4,565 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
imports
{
import UU.Scanner.Position (Pos)
import Patterns   (Pattern)
import Expression (Expression)
import CommonTypes
import Macro --marcos
}


TYPE Elems     = [Elem]

TYPE Alts      = [Alt]

TYPE Fields    = [Field]

TYPE SemAlts   = [SemAlt]

TYPE SemDefs   = [SemDef]

DATA AG        | AG     elems  : Elems

DATA Elem      | Data   pos     : {Pos}
                        contype : {ConstructorType}
                        ctx     : {ClassContext}
                        names   : NontSet
                        params  : {[Identifier]}
                        attrs   : Attrs
                        alts    : Alts
                        ext     : {Bool}

               | Type   pos    : {Pos}
                        ctx    : {ClassContext}
                        name   : {NontermIdent}
                        params : {[Identifier]}
                        type   : {ComplexType}

               | Attr   pos    : {Pos}
                        ctx    : {ClassContext}
                        names  : NontSet
                        quants : {[String]}
                        attrs  : Attrs

               | Sem    pos    : {Pos}
                        ctx    : {ClassContext}
                        names  : NontSet
                        attrs  : Attrs
                        quants : {[String]}
                        alts   : SemAlts

               | Txt    pos    : {Pos}
                        kind   : {BlockKind}
                        mbNt   : {Maybe NontermIdent}
                        lines  : {[String]}

               | Set    pos    : {Pos}
                        name   : {NontermIdent}
                        merge  : Bool
                        set    : NontSet

               | Deriving pos  : {Pos}
                          set  : NontSet
                          classes : {[NontermIdent]}

               | Wrapper  pos  : {Pos}
                          set  : NontSet

               | Nocatas  pos  : {Pos}
                          set  : NontSet

               | Pragma   pos  : {Pos}
                          names: {[NontermIdent]}

               | Module   pos     : {Pos}
                          name    : {String}  -- name of the haskell module
                          exports : {String}  -- exports of the haskell module
                          imports : {String}  -- imports to replicate to generated haskell modules

DATA Attrs     | Attrs  pos    : {Pos}
                        inh,chn,syn : {AttrNames}

DATA Alt       | Alt    pos    : {Pos}
                        names  : ConstructorSet
                        tyvars : {[Identifier]}
                        fields : Fields
                        macro  : MaybeMacro --marcos: macro extension

DATA Field     | FChild  name : Identifier
                         tp   : Type
               | FCtx    tps  : {[Type]}

DATA SemAlt    | SemAlt pos    : {Pos}
                        constructorSet   : ConstructorSet
                        rules  : SemDefs

DATA SemDef    | Def    pos    : Pos
                        mbName : {Maybe Identifier}
                        pattern: Pattern
                        rhs    : {Expression}
                        owrt   : {Bool}
                        pure   : Bool
                        eager  : Bool
               | TypeDef pos   : {Pos}
                         ident : {Identifier}
                         tp    : Type
               | UniqueDef ident : {Identifier}
                           ref   : {Identifier}
               | AugmentDef ident : {Identifier}
                            rhs   : {Expression}
               | AroundDef ident : {Identifier}
                           rhs    : {Expression}
               | MergeDef  target  : {Identifier}
                           nt      : {Identifier}
                           sources : {[Identifier]}
                           rhs     : {Expression}
               | SemPragma  names : {[NontermIdent]}
               | AttrOrderBefore  before : {[Occurrence]}
                                  after  : {[Occurrence]}

DATA ConstructorSet | CName       name      : {ConstructorIdent}
                    | CUnion      set1,set2 : ConstructorSet
                    | CDifference set1,set2 : ConstructorSet
                    | CAll

DATA NontSet   | NamedSet   name      : {NontermIdent}
               | All
               | Union      set1,set2 : NontSet
               | Intersect  set1,set2 : NontSet
               | Difference set1,set2 : NontSet
               | Path       from,to   : {NontermIdent}