#include <cursor.h>
Inherits astl::stack_cursor_concept.
Public Types | |
typedef ForwardCursor::char_traits | char_traits |
Character traits describing char_type. | |
typedef ForwardCursor::char_type | char_type |
The type of the transitions letters. | |
typedef ForwardCursor::state_type | state_type |
The type of the automaton-states identifiers. | |
typedef ForwardCursor::tag_type | tag_type |
The type of the data attached to states. | |
Public Member Functions | |
state_type | aim () const |
Returns the aim state of the pointed transition. | |
bool | aim_final () const |
Returns true if the aim state of the transition that this cursor points to is final. | |
tag_type | aim_tag () const |
Returns the data attached to the aim state of the pointed transition. | |
bool | backward () |
Pops the stack top and return false if the resulting stack is empty. | |
bool | exists (const char_type &a) const |
Returns true if an outgoing transition labeled with a exists. | |
bool | find (const char_type &a) |
Makes this cursor point to the transition labeled with a . | |
bool | first () |
Makes this cursor point to the first element of the transitions sequence of the source state. | |
bool | forward (const char_type &a) |
Moves along the outgoing transition labeled with a if defined, otherwise moves to sink state and returns false . | |
void | forward () |
Moves forward along the pointed transition and the resulting cursor is pushed onto the stack. | |
char_type | letter () const |
Returns the letter on the pointed transition. | |
bool | next () |
Moves this cursor to the next element of the transitions sequence of the source state. | |
bool | sink () const |
Returns true if this cursor points to the sink state. | |
state_type | sink_state () const |
Returns the sink state identifier. | |
state_type | src () const |
Returns the identifier of the state that this cursor points to. | |
bool | src_final () const |
Returns true if the state that this cursor points to is final. | |
tag_type | src_tag () const |
Returns the data attached to the state that this cursor points to. | |
stack_cursor () | |
Creates a cursor with an empty stack. | |
stack_cursor (const ForwardCursor &x) | |
Creates a cursor with a stack containing x . | |
const ForwardCursor & | top () const |
Returns the stack top. |
Each forward move along a transition pushes a new forward_cursor onto the stack top and an extra method backward() allows to pop. The depth-first traversal cursor dfirst_cursor relies on the stack_cursor
Parameter | Description | Default | Requirements |
---|---|---|---|
ForwardCursor | The type of the cursors that are stored on the stack | ForwardCursor is a model of forward cursor | |
StackContainer | The type of the sequential container managing the stack | vector<ForwardCursor> | StackContainer is a model of back insertion sequence and StackContainer::value_type is ForwardCursor |
state_type aim | ( | ) | const |
Returns the aim state of the pointed transition.
The cursor shall have been set to point to a defined transition beforehand by successfully calling first, next or find
Referenced by DFA_min_hash::insert().
bool aim_final | ( | ) | const |
Returns true
if the aim state of the transition that this cursor points to is final.
tag_type aim_tag | ( | ) | const |
Returns the data attached to the aim state of the pointed transition.
bool backward | ( | ) |
Pops the stack top and return false
if the resulting stack is empty.
Referenced by DFA_min_hash::insert().
bool exists | ( | const char_type & | a | ) | const |
Returns true
if an outgoing transition labeled with a
exists.
bool find | ( | const char_type & | a | ) |
Makes this cursor point to the transition labeled with a
.
Returns true
if such a transition exists, otherwise the pointed transition is undefined.
Referenced by DFA_min_hash::insert().
bool first | ( | ) |
Makes this cursor point to the first element of the transitions sequence of the source state.
Returns true
if such an element exists (if any transition is defined), otherwise the pointed transition is undefined.
bool forward | ( | const char_type & | a | ) |
Moves along the outgoing transition labeled with a
if defined, otherwise moves to sink state and returns false
.
The resulting cursor is pushed onto the stack.
void forward | ( | ) |
char_type letter | ( | ) | const |
Returns the letter on the pointed transition.
The cursor shall have been set to point to a defined transition beforehand by successfully calling first, next or find
Referenced by DFA_min_hash::insert().
bool next | ( | ) |
bool sink | ( | ) | const |
state_type sink_state | ( | ) | const |
Returns the sink state identifier.
state_type src | ( | ) | const |
Returns the identifier of the state that this cursor points to.
The stack is not empty.
Referenced by DFA_min_hash::insert().
bool src_final | ( | ) | const |
tag_type src_tag | ( | ) | const |
Returns the data attached to the state that this cursor points to.
const ForwardCursor& top | ( | ) | const |
Returns the stack top.