-- -- Flattened attribute grammar representation -- DATA Fag | Ag datas : Datas itfs : Itfs blocks : Blocks -- -- Data declarations -- TYPE Datas = [Data] DATA Data | Data name : Ident vars : Idents cons : Cons TYPE Cons = [Con] DATA Con | Con name : Ident sigs : FieldSigs TYPE FieldSigs = [FieldSig] TYPE InhSigs = [InhSig] TYPE SynSigs = [SynSig] DATA FieldSig | Sig name : Ident tp : Type DATA InhSig | Sig name : Ident tp : Type DATA SynSig | Sig name : Ident tp : Type -- -- Interface declarations -- TYPE Itfs = [Itf] DATA Itf | Itf name : Ident vars : Idents inhs : InhSigs ctxs : Ctxs TYPE Ctxs = [Ctx] DATA Ctx | Ctx name : Ident syns : SynSigs mbTail : MaybeTail TYPE MaybeTail = MAYBE Tail DATA Tail | Tail mbNm : {Maybe Ident} tp : Internal -- -- Blocks -- TYPE Blocks = [Block] TYPE MaybeBlock = MAYBE Block DATA Block | Code kind : BlockKind items : Codes TYPE Codes = [Code] DATA Code | Plain pos : Pos txt : String | Attr pos : Pos name : Ident field : Ident | Sem pos : Pos tp : Scheme clauses : Clauses TYPE Clauses = [Clause] DATA Clause | Clause name : Ident mbCtx : {Maybe Ident} defs : Defs TYPE Defs = [Def] DATA Def | Child name : Ident tp : Internal def : Block merge : MergeInfo | Visit child : Ident mbTail : {Maybe Ident} mbCtx : {Maybe Ident} mbDef : MaybeBlock merge : MergeInfo | Bind kind : BindKind pat : Pat def : Block merge : MergeInfo | Tail def : Block merge : MergeInfo DATA MergeInfo | Auto | Label name : Ident info : MergeInfo | Before name : Ident info : MergeInfo | After name : Ident info : MergeInfo TYPE Pats = [Pat] DATA Pat | Attr child : Ident field : Ident | Con name : Ident pats : Pats | ConAttr child : Ident tp : Ident con : Ident | Tup pats : Pats | Underscore