imports { import Common.CommonTypes hiding (Dirty (..)) import Presentation.PresLayerTypes import Presentation.PresLayerUtils import Presentation.XprezLib import Presentation.XLatex hiding (bold) import Evaluation.DocumentEdit import List import Maybe import qualified Data.Map as Map import Data.Map (Map) import Evaluation.DocTypes (DocumentLevel (..)) import DocTypes_Generated import DocUtils_Generated import DocumentEdit_Generated import ProxParser } INCLUDE "PresentationAG_Generated.ag" SEM EnrichedDoc | RootEnr loc.pres = structural $ col $ [ text $ "Tree with depth "++show @trees.depths , @trees.pres , text "more trees" , @trees2.pres , text $ show $ @trees.self ] ATTR List_Tree ConsList_Tree [ | | depths : {[Int]} ] SEM List_Tree | HoleList_Tree lhs.depths = [] | ParseErrList_Tree lhs.depths = [] SEM ConsList_Tree | Cons_Tree lhs.depths = @head.depth : @tail.depths | Nil_Tree lhs.depths = [] SEM Tree [ | | depth : Int ] | Bin lhs.depth = @left.depth `max` @right.depth + 1 | Leaf lhs.depth = 1 | HoleTree ParseErrTree lhs.depth = 0 { token idp str = TokenP idp (UserTk 0 (SymToken str) str Nothing idp) } SEM List_Tree | List_Tree loc.pres = structural $ row $ intersperse vLine @elts.press SEM Tree | Bin loc.pres = parsingWithParser pBin @self $ row [ token @idp0 "Bin" , token @idp1 "(" , @left.pres , token @idp2 ")" , token @idp3 "(" , @right.pres , token @idp4 ")" ] {- loc.pres = structural $ row [ col [ vSpace 10, @left.pres] , text "Bin" , col [ vSpace 10, @right.pres ] ] -} | Leaf loc.pres = structural $ row [ token @idp0 "Leaf" , token @idp1 $ show @int ] {- loc.pres = parsingWithParser pLeaf @self $ row [ text $ "Leaf" ++ show @int ] -} {- SEM Tree | Bin loc.pres = parsing $ row [ text "Bin (", @left.pres, text ") (", @right.pres, text ")" ] | Leaf loc.pres = loc NoNode $ parsing $ row [ text "Leaf" ] -}