ModErn Text Analysis
META Enumerates Textual Applications
|
Represents a transition taken by the parser. More...
#include <transition.h>
Classes | |
class | exception |
Exception thrown during interactions with transitions. More... | |
Public Types | |
enum | type_t { SHIFT = 0, REDUCE_L, REDUCE_R, UNARY, FINALIZE, IDLE } |
The transition types. | |
Public Member Functions | |
transition (type_t t) | |
Constructs a transition given a type. More... | |
transition (type_t t, class_label lbl) | |
Constructs a transition given a type and label. More... | |
type_t | type () const |
const class_label & | label () const |
bool | operator< (const transition &rhs) const |
Private Attributes | |
type_t | type_ |
The type of this transition. | |
util::optional< class_label > | label_ |
The label of this transition, if it exists. | |
Represents a transition taken by the parser.
Consists of a type and, for UNARY or REDUCE_L and REDUCE_R actions, a label.
meta::parser::transition::transition | ( | type_t | t | ) |
Constructs a transition given a type.
This constructor should be used for SHIFT, FINALIZE, and IDLE transitions.
t | The transition type |
meta::parser::transition::transition | ( | type_t | t, |
class_label | lbl | ||
) |
Constructs a transition given a type and label.
This constructor should be used for REDUCE_L, REDUCE_R, and UNARY transitions.
t | The transition type |
lbl | The label for the transition. |
auto meta::parser::transition::type | ( | ) | const |
const class_label & meta::parser::transition::label | ( | ) | const |
bool meta::parser::transition::operator< | ( | const transition & | rhs | ) | const |
rhs | The transition to compare against |