----- GENERATED PART STARTS HERE. DO NOT EDIT ON OR BEYOND THIS LINE ----- -------------------------------------------------------------------------- -- presentationSheet -- -------------------------------------------------------------------------- WRAPPER Root { -- type PresentationSheet doc enr node clip token = -- enr -> doc -> FocusDoc -> WhitespaceMap -> IDPCounter -> -- (WhitespaceMap, IDPCounter, Presentation doc node clip token) presentationSheet :: PresentationSheet Document EnrichedDoc Node ClipDoc UserToken presentationSheet enrichedDoc document focusD whitespaceMap pIdC = let (Syn_EnrichedDoc pIdC' pres self whitespaceMap') = wrap_EnrichedDoc (sem_EnrichedDoc enrichedDoc) (Inh_EnrichedDoc document focusD pIdC [] whitespaceMap) in (whitespaceMap', pIdC', pres) {- A type error here means that extra attributes were declared on EnrichedDoc The attribute signature for EnrichedDoc should be: EnrichedDoc [ focusD : FocusDoc path : Path | pIdC : Int layoutMap : WhitespaceMap | pres : Presentation_Doc_Node_Clip_Token EnrichedDoc ] -} } -------------------------------------------------------------------------- -- AG data type -- -------------------------------------------------------------------------- DATA EnrichedDoc | RootEnr trees:List_Tree trees2:List_Tree | HoleEnrichedDoc | ParseErrEnrichedDoc error:{(ParseError Document Node ClipDoc UserToken)} DATA Tree | Bin idp0:IDP idp1:IDP idp2:IDP idp3:IDP idp4:IDP left:Tree right:Tree | Leaf idp0:IDP idp1:IDP int:Int | HoleTree | ParseErrTree error:{(ParseError Document Node ClipDoc UserToken)} DATA List_Tree | List_Tree elts:ConsList_Tree | HoleList_Tree | ParseErrList_Tree error:{(ParseError Document Node ClipDoc UserToken)} DATA ConsList_Tree | Cons_Tree head:Tree tail:ConsList_Tree | Nil_Tree -------------------------------------------------------------------------- -- Attr declarations -- -------------------------------------------------------------------------- ATTR EnrichedDoc Tree List_Tree ConsList_Tree [ doc : Document focusD : FocusDoc path : Path | pIdC : Int whitespaceMap : WhitespaceMap | ] ATTR EnrichedDoc Tree List_Tree [ | | pres : Presentation_Doc_Node_Clip_Token ] ATTR Tree List_Tree ConsList_Tree [ ix : Int | | parseErrors USE {++} {[]} : {[ParseErrorMessage]} ] ATTR Tree List_Tree [ | | ix : Int path : Path presXML : Presentation_Doc_Node_Clip_Token presTree : Presentation_Doc_Node_Clip_Token ] ATTR List_Tree ConsList_Tree [ | | press : {[Presentation_Doc_Node_Clip_Token]} ] ATTR ConsList_Tree [ | | pressXML : {[Presentation_Doc_Node_Clip_Token]} pressTree : {[Presentation_Doc_Node_Clip_Token]} ] -------------------------------------------------------------------------- -- General sem functions -- -------------------------------------------------------------------------- SEM EnrichedDoc | RootEnr trees.pIdC = @lhs.pIdC + 0 trees2.pIdC = @trees.pIdC lhs.pIdC = @trees2.pIdC trees.path = @lhs.path++[0] trees2.path = @lhs.path++[1] | RootEnr trees.ix = 0 trees2.ix = 1 | RootEnr lhs.pres = loc (Node_RootEnr @self @lhs.path) $ presentFocus @lhs.focusD @lhs.path @pres `withLocalPopupMenuItems` menuD (PathD @lhs.path) @lhs.doc | HoleEnrichedDoc lhs.pres = presHole @lhs.focusD "EnrichedDoc" (Node_HoleEnrichedDoc @self @lhs.path) @lhs.path `withLocalPopupMenuItems` menuD (PathD @lhs.path) @lhs.doc | ParseErrEnrichedDoc lhs.pres = presParseErr (Node_ParseErrEnrichedDoc @self @lhs.path) @error `withLocalPopupMenuItems` menuD (PathD @lhs.path) @lhs.doc SEM Tree | Bin left.pIdC = @lhs.pIdC + 5 right.pIdC = @left.pIdC lhs.pIdC = @right.pIdC left.path = @lhs.path++[0] right.path = @lhs.path++[1] | Leaf lhs.pIdC = @lhs.pIdC + 2 | Bin left.ix = 0 right.ix = 1 | Leaf | Bin lhs.pres = loc (Node_Bin @self @lhs.path) $ presentFocus @lhs.focusD @lhs.path @pres `withLocalPopupMenuItems` menuD (PathD @lhs.path) @lhs.doc | Leaf lhs.pres = loc (Node_Leaf @self @lhs.path) $ presentFocus @lhs.focusD @lhs.path @pres `withLocalPopupMenuItems` menuD (PathD @lhs.path) @lhs.doc | HoleTree lhs.pres = presHole @lhs.focusD "Tree" (Node_HoleTree @self @lhs.path) @lhs.path `withLocalPopupMenuItems` menuD (PathD @lhs.path) @lhs.doc | ParseErrTree lhs.pres = presParseErr (Node_ParseErrTree @self @lhs.path) @error `withLocalPopupMenuItems` menuD (PathD @lhs.path) @lhs.doc lhs.parseErrors = getErrorMessages @error SEM List_Tree | List_Tree lhs.press = map ( loc (Node_List_Tree @self @lhs.path) . presentFocus @lhs.focusD @lhs.path ) @elts.press -- parent is reponsible for setting parsing/structural elts.pIdC = @lhs.pIdC + 100 -- NOT RIGHT, should be taken from document type def. lhs.pIdC = @elts.pIdC elts.path = @lhs.path elts.ix = 0 | HoleList_Tree lhs.press = [] | ParseErrList_Tree lhs.press = [] | List_Tree lhs.pres = loc (Node_List_Tree @self @lhs.path) $ presentFocus @lhs.focusD @lhs.path $ @pres `withLocalPopupMenuItems` menuD (PathD @lhs.path) @lhs.doc | ParseErrList_Tree lhs.pres = presParseErr (Node_ParseErrList_Tree @self @lhs.path) @error `withLocalPopupMenuItems` menuD (PathD @lhs.path) @lhs.doc lhs.parseErrors = getErrorMessages @error | HoleList_Tree lhs.pres = presHole @lhs.focusD "Tree" (Node_HoleList_Tree @self @lhs.path) @lhs.path `withLocalPopupMenuItems` menuD (PathD @lhs.path) @lhs.doc SEM ConsList_Tree | Cons_Tree head.path = @lhs.path++[@lhs.ix] tail.path = @lhs.path lhs.press = @head.pres : @tail.press head.pIdC = @lhs.pIdC + 30 -- NOT RIGHT, should be taken from document type def. tail.pIdC = @head.pIdC lhs.pIdC = @tail.pIdC tail.ix = @lhs.ix + 1 | Nil_Tree lhs.press = [] -------------------------------------------------------------------------- -- Synthesized path rules -- -------------------------------------------------------------------------- SEM Tree | Bin lhs.path = @lhs.path | Leaf lhs.path = @lhs.path SEM List_Tree | List_Tree lhs.path = @lhs.path -------------------------------------------------------------------------- -- Sem functions for XML presentation -- -------------------------------------------------------------------------- SEM Tree | Bin lhs.presXML = presentElementXML @lhs.focusD (Node_Bin @self @lhs.path) @lhs.path "Bin" [ @left.presXML, @right.presXML ] | Leaf lhs.presXML = presentElementXML @lhs.focusD (Node_Leaf @self @lhs.path) @lhs.path "Leaf" [ presentPrimXMLInt @int ] | HoleTree lhs.presXML = presHole @lhs.focusD "Tree" (Node_HoleTree @self @lhs.path) @lhs.path | ParseErrTree lhs.presXML = presParseErr (Node_ParseErrTree @self @lhs.path) @error SEM List_Tree | List_Tree lhs.presXML = loc (Node_List_Tree @self @lhs.path) $ structural $ presentFocus @lhs.focusD @lhs.path $ col @elts.pressXML | ParseErrList_Tree lhs.presXML = loc (Node_List_Tree @self @lhs.path) $ structural $ presentFocus @lhs.focusD @lhs.path $ presParseErr (Node_ParseErrList_Tree @self @lhs.path) @error | HoleList_Tree lhs.presXML = loc (Node_List_Tree @self @lhs.path) $ structural $ presentFocus @lhs.focusD @lhs.path $ presHole @lhs.focusD "List_Tree" (Node_HoleList_Tree @self @lhs.path) @lhs.path SEM ConsList_Tree | Cons_Tree lhs.pressXML = @head.presXML : @tail.pressXML | Nil_Tree lhs.pressXML = [] -------------------------------------------------------------------------- -- Sem functions for tree presentation -- -------------------------------------------------------------------------- SEM Tree | Bin lhs.presTree = presentElementTree @lhs.focusD (Node_Bin @self @lhs.path) @lhs.path "Bin" [ @left.presTree, @right.presTree ] | Leaf lhs.presTree = presentElementTree @lhs.focusD (Node_Leaf @self @lhs.path) @lhs.path "Leaf" [ presentPrimXMLInt @int ] | HoleTree lhs.presTree = presHole @lhs.focusD "Tree" (Node_HoleTree @self @lhs.path) @lhs.path | ParseErrTree lhs.presTree = presParseErr (Node_ParseErrTree @self @lhs.path) @error SEM List_Tree | List_Tree lhs.presTree = loc (Node_List_Tree @self @lhs.path) $ structural $ presentFocus @lhs.focusD @lhs.path $ col @elts.pressTree | ParseErrList_Tree lhs.presTree = loc (Node_List_Tree @self @lhs.path) $ structural $ presentFocus @lhs.focusD @lhs.path $ presParseErr (Node_ParseErrList_Tree @self @lhs.path) @error | HoleList_Tree lhs.presTree = loc (Node_List_Tree @self @lhs.path) $ structural $ presentFocus @lhs.focusD @lhs.path $ presHole @lhs.focusD "List_Tree" (Node_HoleList_Tree @self @lhs.path) @lhs.path SEM ConsList_Tree | Cons_Tree lhs.pressTree = @head.presTree : @tail.pressTree | Nil_Tree lhs.pressTree = []