The Meta-Environment API
00001 #ifndef __TERM_ACTIONS__ 00002 #define __TERM_ACTIONS__ 00003 00004 #include <pretty-print-utils.tb> 00005 #include <term-utils.tb> 00006 #include <apply-function.idef> 00007 00008 process EqualTrees(Tree1 : term, Tree2 : term, Result : term?) is 00009 let 00010 Value : term 00011 in 00012 TODO("term-actions.tb bevat niet-action processes"). 00013 snd-msg(equal-trees(Tree1, Tree2)) 00014 . rec-msg(tree-is-equal(Value?)) 00015 . 00016 if equal(Value, quote(true)) then 00017 Result := true 00018 else 00019 Result := false 00020 fi 00021 endlet 00022 00023 process ActionAddPosInfo(EditorId : session-id, Tree : term, ResultTree : term?) is 00024 let 00025 Filename : str 00026 in 00027 GetPath(EditorId, Filename?) 00028 . AnnotateTree(Tree, Filename, ResultTree?) 00029 endlet 00030 00031 process ApplyFunction(FuncName : str, SortName : str, Arguments : list, Tree : term?) is 00032 snd-msg(apply-function(FuncName, SortName, Arguments)) 00033 . rec-msg(tree(Tree?)) 00034 00035 process AddBracketsAction(EditorId : session-id) is 00036 let 00037 Tree : term, 00038 RTree : term, 00039 ModuleId: module-id, 00040 Path: str, 00041 Table: term 00042 in 00043 GetModuleId(EditorId, ModuleId?) 00044 . GetPath(EditorId, Path?) 00045 . GetTermParsetree(ModuleId, Path, Tree?) 00046 . 00047 if not-equal(Tree, UNDEFINED) then 00048 AddTermBrackets(ModuleId, Tree, RTree?) 00049 . 00050 if not-equal(RTree, UNDEFINED) then 00051 ReplaceFocus(EditorId, RTree) 00052 else 00053 tau 00054 fi 00055 else tau 00056 fi 00057 endlet 00058 00059 #endif /*__TERM_ACTIONS__*/