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 133 134 135 136 137
|
-- UUAGC 0.9.56 (src-ag/AbstractSyntax.ag)
module AbstractSyntax where
{-# LINE 2 "src-ag/AbstractSyntax.ag" #-}
-- AbstractSyntax.ag imports
import Data.Set(Set)
import Data.Map(Map)
import Patterns (Pattern(..),Patterns)
import Expression (Expression(..))
import Macro --marcos
import CommonTypes
import ErrorMessages
{-# LINE 16 "src-generated/AbstractSyntax.hs" #-}
-- Child -------------------------------------------------------
{-
alternatives:
alternative Child:
child name : {Identifier}
child tp : {Type}
child kind : {ChildKind}
-}
data Child = Child (Identifier) (Type) (ChildKind)
-- Children ----------------------------------------------------
{-
alternatives:
alternative Cons:
child hd : Child
child tl : Children
alternative Nil:
-}
type Children = [Child]
-- Grammar -----------------------------------------------------
{-
alternatives:
alternative Grammar:
child typeSyns : {TypeSyns}
child useMap : {UseMap}
child derivings : {Derivings}
child wrappers : {Set NontermIdent}
child nonts : Nonterminals
child pragmas : {PragmaMap}
child manualAttrOrderMap : {AttrOrderMap}
child paramMap : {ParamMap}
child contextMap : {ContextMap}
child quantMap : {QuantMap}
child uniqueMap : {UniqueMap}
child augmentsMap : {Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))}
child aroundsMap : {Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))}
child mergeMap : {Map NontermIdent (Map ConstructorIdent (Map Identifier (Identifier, [Identifier], Expression)))}
-}
data Grammar = Grammar (TypeSyns) (UseMap) (Derivings) ((Set NontermIdent)) (Nonterminals) (PragmaMap) (AttrOrderMap) (ParamMap) (ContextMap) (QuantMap) (UniqueMap) ((Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression])))) ((Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression])))) ((Map NontermIdent (Map ConstructorIdent (Map Identifier (Identifier, [Identifier], Expression)))))
-- Nonterminal -------------------------------------------------
{-
alternatives:
alternative Nonterminal:
child nt : {NontermIdent}
child params : {[Identifier]}
child inh : {Attributes}
child syn : {Attributes}
child prods : Productions
-}
data Nonterminal = Nonterminal (NontermIdent) (([Identifier])) (Attributes) (Attributes) (Productions)
-- Nonterminals ------------------------------------------------
{-
alternatives:
alternative Cons:
child hd : Nonterminal
child tl : Nonterminals
alternative Nil:
-}
type Nonterminals = [Nonterminal]
-- Production --------------------------------------------------
{-
alternatives:
alternative Production:
child con : {ConstructorIdent}
child params : {[Identifier]}
child constraints : {[Type]}
child children : Children
child rules : Rules
child typeSigs : TypeSigs
child macro : {MaybeMacro}
-}
data Production = Production (ConstructorIdent) (([Identifier])) (([Type])) (Children) (Rules) (TypeSigs) (MaybeMacro)
-- Productions -------------------------------------------------
{-
alternatives:
alternative Cons:
child hd : Production
child tl : Productions
alternative Nil:
-}
type Productions = [Production]
-- Rule --------------------------------------------------------
{-
alternatives:
alternative Rule:
child mbName : {Maybe Identifier}
child pattern : {Pattern}
child rhs : {Expression}
child owrt : {Bool}
child origin : {String}
child explicit : {Bool}
child pure : {Bool}
child identity : {Bool}
child mbError : {Maybe Error}
child eager : {Bool}
-}
data Rule = Rule ((Maybe Identifier)) (Pattern) (Expression) (Bool) (String) (Bool) (Bool) (Bool) ((Maybe Error)) (Bool)
-- Rules -------------------------------------------------------
{-
alternatives:
alternative Cons:
child hd : Rule
child tl : Rules
alternative Nil:
-}
type Rules = [Rule]
-- TypeSig -----------------------------------------------------
{-
alternatives:
alternative TypeSig:
child name : {Identifier}
child tp : {Type}
-}
data TypeSig = TypeSig (Identifier) (Type)
-- TypeSigs ----------------------------------------------------
{-
alternatives:
alternative Cons:
child hd : TypeSig
child tl : TypeSigs
alternative Nil:
-}
type TypeSigs = [TypeSig]
|