ModErn Text Analysis
META Enumerates Textual Applications
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
meta::parser::transition Class Reference

Represents a transition taken by the parser. More...

#include <transition.h>

Inheritance diagram for meta::parser::transition:
meta::util::comparable< transition >

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.
 

Detailed Description

Represents a transition taken by the parser.

Consists of a type and, for UNARY or REDUCE_L and REDUCE_R actions, a label.

Constructor & Destructor Documentation

meta::parser::transition::transition ( type_t  t)

Constructs a transition given a type.

This constructor should be used for SHIFT, FINALIZE, and IDLE transitions.

Parameters
tThe 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.

Parameters
tThe transition type
lblThe label for the transition.

Member Function Documentation

auto meta::parser::transition::type ( ) const
Returns
the type of this transition
const class_label & meta::parser::transition::label ( ) const
Returns
the label for this transition
bool meta::parser::transition::operator< ( const transition rhs) const
Parameters
rhsThe transition to compare against
Returns
whether the current transition is lexicographically less than the other transition

The documentation for this class was generated from the following files: