00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 #ifndef _AGTREE_H_
00010 #define _AGTREE_H_
00011 
00012 #include "AGTypes.h"
00013 #include <list>
00014 #include <string>
00015 using namespace std;
00016 
00017 #ifdef _MSC_VER
00018 #define DllExport __declspec( dllexport )
00019 #else
00020 #define DllExport
00021 #endif
00022 
00024 
00036 DllExport AnnotationId
00037 tree_init_tree(const AnnotationType& type, const Id& id="AGTree");
00038 
00040 
00050 DllExport bool
00051 tree_move_down(const AnnotationId& anno,
00052                const AnnotationType& type="syn",
00053                AnnotationId new_anno="");
00054 
00056 
00063 DllExport bool
00064 tree_move_up(const AnnotationId& anno);
00065 
00067 
00075 DllExport bool
00076 tree_promote_right(const AnnotationId& anno);
00077 
00079 
00087 DllExport bool
00088 tree_promote_left(const AnnotationId& anno);
00089 
00091 
00098 DllExport bool
00099 tree_demote_right(const AnnotationId& anno);
00100 
00102 
00109 DllExport bool
00110 tree_demote_left(const AnnotationId& anno);
00111 
00113 
00119 DllExport AnnotationId
00120 tree_first_tree(const AGId& agId);
00121 
00123 
00129 DllExport AnnotationId
00130 tree_last_tree(const AGId& agId);
00131 
00133 
00144 DllExport bool
00145 tree_move(const AnnotationId& x, const AnnotationId& y);
00146 
00148 
00160 DllExport AnnotationId
00161 tree_insert_node_left(const AnnotationId& x,
00162                       const AnnotationType& type="wrd",
00163                       AnnotationId annoId="");
00164 
00166 
00178 DllExport AnnotationId
00179 tree_insert_node_right(const AnnotationId& x,
00180                        const AnnotationType& type="wrd",
00181                        AnnotationId annoId="");
00182 
00184 
00191 DllExport bool
00192 tree_delete_node_left(const AnnotationId& x);
00193 
00195 
00202 DllExport bool
00203 tree_delete_node_right(const AnnotationId& x);
00204 
00206 
00218 DllExport AnnotationId
00219 tree_root(AnnotationId x, int depth=1);
00220 
00222 
00228 DllExport AnnotationId
00229 tree_parent(const AnnotationId& x);
00230 
00232 
00238 DllExport list<AnnotationIds>
00239 tree_children(const AnnotationId& x);
00240 
00242 
00248 DllExport AnnotationId
00249 tree_left(const AnnotationId& x);
00250 
00252 
00258 DllExport AnnotationId
00259 tree_right(const AnnotationId& x);
00260 
00262 
00269 DllExport list<AnnotationId>
00270 tree_path(AnnotationId x);
00271 
00273 
00279 DllExport AnnotationId
00280 tree_common_ancestor(const AnnotationId& x, const AnnotationId& y);
00281 
00283 
00295 DllExport AnnotationId
00296 tree_insert_node(const AnnotationId& x,
00297                  const AnnotationId& y,
00298                  const AnnotationType& type="syn",
00299                  const AnnotationId& annoId="");
00300 
00302 
00308 DllExport bool
00309 tree_delete_node(const AnnotationId& x);
00310 
00311 #endif