imports { -- 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 } DATA Grammar | Grammar typeSyns : {TypeSyns} useMap : {UseMap} derivings : {Derivings} wrappers : {Set NontermIdent} nonts : Nonterminals pragmas : {PragmaMap} -- pragmas defined at a certain alternative manualAttrOrderMap : {AttrOrderMap} -- manually enforced dependencies between attributes paramMap : {ParamMap} contextMap : {ContextMap} quantMap : {QuantMap} uniqueMap : {UniqueMap} augmentsMap : {Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))} aroundsMap : {Map NontermIdent (Map ConstructorIdent (Map Identifier [Expression]))} mergeMap : {Map NontermIdent (Map ConstructorIdent (Map Identifier (Identifier, [Identifier], Expression)))} TYPE Nonterminals = [Nonterminal] TYPE Productions = [Production] TYPE Children = [Child] TYPE Rules = [Rule] TYPE TypeSigs = [TypeSig] DATA Nonterminal | Nonterminal nt : {NontermIdent} params : {[Identifier]} inh : {Attributes} syn : {Attributes} prods : Productions DATA Production | Production con : {ConstructorIdent} params : {[Identifier]} constraints : {[Type]} children : Children rules : Rules typeSigs : TypeSigs macro : MaybeMacro --marcos DATA Child | Child name : {Identifier} tp : {Type} kind : {ChildKind} DATA Rule | Rule mbName : {Maybe Identifier} pattern : Pattern rhs : Expression owrt : {Bool} origin : String -- just for documentation (and maybe errors) explicit : Bool -- True if this rule defined in the source code pure : Bool -- True if this rule is pure (does not have side effects) identity : Bool -- True if this rule is an identity rule mbError : {Maybe Error} -- scheduling this rule yields the given error, if present eager : Bool -- for ordered scheduling: use an eager semantics DATA TypeSig | TypeSig name : {Identifier} tp : {Type} SET AllAbstractSyntax = Grammar Nonterminal Nonterminals Production Productions Child Children Rule Rules TypeSig TypeSigs