00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef _TBHANDLER_H_
00010 #define _TBHANDLER_H_
00011
00012 #include <AGAPI.h>
00013 #include <stack>
00014 #include <map>
00015 #include <vector>
00016 #include "agtree.h"
00017 #include "TBEscapeHandler.h"
00018
00020 class TBhandler
00021 {
00022 private:
00023 AGId agId;
00024 AnchorId prevAncrId;
00025 int prevIdx;
00026
00027 TBEscapeHandler* escHandler;
00028
00029 stack<AnchorId> AnchorStack;
00030 stack<string> TagStack;
00031 stack<string> AnnTypeStack;
00032 stack<AnnotationId> ChildStack;
00033 vector<AnnotationId> traces;
00034
00035 bool eos_flag;
00036
00037
00038 public:
00039 TBhandler(const AGId &id, TBEscapeHandler& eh):
00040 agId(id), escHandler(&eh), eos_flag(true) {
00041 AnnotationId ann = tree_last_tree(id);
00042 if (! ann.empty()) prevAncrId = GetEndAnchor(ann);
00043 }
00044
00048 void start_paren(const string &tag, const string &label);
00049
00053 void end_paren();
00054 };
00055
00056 #endif