00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef __RE_NODE_HH__
00038 #define __RE_NODE_HH__
00039
00040 #include "debug.h"
00041 #include "parse_util.hh"
00042
00043 class ReNodeAlgo;
00044
00050 class ReNode
00051 {
00052 public:
00053
00054 ReNode (const Position &pos_) :
00055 pos(pos_)
00056 {}
00057
00058 virtual ~ReNode () {};
00059
00063 virtual ReNode* clone () = 0;
00064
00068 virtual bool isLeaf () { return getChildCount() == 0; }
00069
00073 virtual int getChildCount () = 0;
00074
00075
00081 virtual ReNode& operator [] (int index) = 0;
00082
00088 virtual bool dfTraverse (ReNodeAlgo &algo);
00089
00090 const Position& getPos () const { return pos; }
00091
00092 #ifdef DEBUG
00093
00094 virtual void dump (ostream &os) const = 0;
00095
00096 #endif
00097
00098 private:
00099
00100 Position pos;
00101
00102 };
00103
00104 #endif