#include <FSM.hpp>
Public Methods | |
| FSMState () | |
| FSMState (unsigned mystateid, char myisfinal=0) | |
| FSMState (unsigned mystateid, FSMStateSetItem *myorigdataset) | |
| void * | operator new (size_t size, MemStreamer *mem) |
| void | operator delete (void *ptr) |
| void * | operator new[] (size_t size, MemStreamer *mem) |
| void | operator delete[] (void *ptr) |
| FSMEdge * | GetOutEdges () |
| FSMStateSetItem * | GetOrigStateSet () |
| void | SetFinal (char myisfinal=1) |
| char | IsFinal () |
| char | IsOutComplete () |
| char | IsAccepting () |
| char | HasPoundsAhead () |
| int | GetStateID () |
| FSMState * | GetNextStateInList () |
| FSMEdge * | FindNegEdge () |
| FSMState * | GetNextState (TLabelID labelid, char *overpoundedge=NULL) |
|
|
Definition at line 132 of file FSM.hpp. 00132 {}
|
|
||||||||||||
|
Definition at line 143 of file FSM.cpp. 00144 {
00145 stateid=mystateid;
00146 isfinal=myisfinal;
00147 outedges=NULL;
00148 next=NULL;
00149 origstateset=NULL;
00150 }
|
|
||||||||||||
|
|
|
|
Definition at line 152 of file FSM.cpp. Referenced by ConsiderLabelIDAtState().
00155 {
00156 FSMEdge *edge=outedges;
00157
00158 while(edge!=NULL)
00159 {
00160 if(edge->GetType()==EDGETYPE_NEGLABELLIST)
00161 return edge;
00162 edge=edge->next;
00163 }
00164 return NULL;
00165 }
|
|
||||||||||||
|
Definition at line 167 of file FSM.cpp. Referenced by PathTreeNode::ComputeNextStateList(), and pathtreemem().
00172 {
00173 FSMEdge *edge=outedges;
00174 FSMEdge *defaultedge=NULL;
00175 char isattrib=ISATTRIB(labelid);
00176
00177 if(overpoundedge!=NULL)
00178 *overpoundedge=0;
00179
00180 while(edge!=NULL)
00181 {
00182 switch(edge->GetType())
00183 {
00184 case EDGETYPE_LABEL:
00185 // If a label edge matches the label exactly, then we can return immediately
00186 if(edge->labelid==labelid)
00187 return edge->GetNextState();
00188
00189 // If we have a pound-edge, we save its pointer
00190 // (if we don't have a default edge already)
00191 if((((edge->labelid==elementpoundlabelid)&&(isattrib==0))||
00192 ((edge->labelid==attribpoundlabelid)&&(isattrib==1)))&&
00193 (defaultedge==NULL))
00194 {
00195 defaultedge=edge;
00196 if(overpoundedge!=NULL)
00197 *overpoundedge=1;
00198 }
00199 break;
00200
00201 case EDGETYPE_NEGLABELLIST:
00202 {
00203 // A negative edge automatically becomes the default edge,
00204 // (And we overwrite any previous pound-edge!)
00205 // if 'labelid' is not contained in the negative list
00206
00207 if(!IsInLabelList(edge->labellist,labelid))
00208 // 'labelid' is not in the negative list?
00209 {
00210 defaultedge=edge;
00211 if(overpoundedge!=NULL)
00212 *overpoundedge=0;
00213 }
00214 break;
00215 }
00216 // case EDGETYPE_EMPTY:
00217 // return NULL; // This should never happen !
00218 }
00219 edge=edge->next;
00220 }
00221 // If we didn't find any exactly matching label edge, then we choose
00222 // the default edge. If there is no default edge, then there is no match
00223 if(defaultedge!=NULL)
00224 return defaultedge->GetNextState();
00225 else
00226 return NULL;
00227 }
|
|
|
Definition at line 154 of file FSM.hpp. 00154 { return next; }
|
|
|
Definition at line 146 of file FSM.hpp. Referenced by ConsiderLabelIDAtState(), and ConsiderNegEdgeAtState().
00146 { return origstateset; }
|
|
|
Definition at line 145 of file FSM.hpp. Referenced by CreateStateSet().
00145 { return outedges; }
|
|
|
Definition at line 153 of file FSM.hpp. Referenced by CheckEqual().
00153 { return stateid; }
|
|
|
Definition at line 152 of file FSM.hpp. Referenced by pathtreemem().
00152 { return haspoundsahead; }
|
|
|
Definition at line 151 of file FSM.hpp. 00151 { return isaccepting; }
|
|
|
Definition at line 149 of file FSM.hpp. Referenced by FSM::AddFSM(), and FSMState().
00149 { return isfinal; }
|
|
|
Definition at line 150 of file FSM.hpp. 00150 { return isoutcomplete; }
|
|
|
Definition at line 148 of file FSM.hpp. 00148 { isfinal=myisfinal; }
|
|
|
Definition at line 137 of file FSM.hpp. 00137 {}
|
|
|
Definition at line 139 of file FSM.hpp. 00139 {}
|
|
||||||||||||
|
Definition at line 136 of file FSM.hpp. 00136 { return mem->GetByteBlock(size);}
|
|
||||||||||||
|
Definition at line 138 of file FSM.hpp. 00138 { return mem->GetByteBlock(size);}
|
1.2.11.1 written by Dimitri van Heesch,
© 1997-2001