reflex::Pattern::DFA Struct Reference

updated Tue Oct 29 2024 by Robert van Engelen
 
Classes | Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
reflex::Pattern::DFA Struct Reference

DFA created by subset construction from regex patterns. More...

Collaboration diagram for reflex::Pattern::DFA:
Collaboration graph
[legend]

Classes

struct  MetaEdgesClosure
 
struct  State
 

Public Types

typedef std::list< State * > List
 

Public Member Functions

 DFA ()
 
 ~DFA ()
 
void clear ()
 delete DFA and reset to initial state. More...
 
Statestate ()
 new DFA state. More...
 
Statestate (Positions &pos)
 new DFA state with positions, destroys pos. More...
 
Statestate (State *tnode)
 new DFA state with optional tree DFA node and positions, destroys pos. More...
 
Statestate (State *tnode, Positions &pos)
 new DFA state with optional tree DFA node and positions, destroys pos. More...
 
Stateroot ()
 root of the DFA is the first state created or NULL. More...
 
Statestart ()
 start state the DFA is the first state created. More...
 

Public Attributes

List list
 block allocation list More...
 
uint16_t next
 block allocation, next available slot in last block More...
 

Static Public Attributes

static const uint16_t ALLOC = 1024
 allocate 1024 DFA states at a time, to improve performance More...
 
static const uint16_t MAX_DEPTH = 256
 analyze DFA up to states this deep to improve predict match More...
 
static const Index MAX_STATES = Const::GMAX
 maximum number of states More...
 
static const Index DEAD_PATH = 1
 state marker "path always and only reaches backedges" (a dead end) More...
 
static const Index KEEP_PATH = MAX_DEPTH
 state marker "required path" (from a newline edge) More...
 
static const Index LOOP_PATH = MAX_DEPTH + 1
 state marker "path reaches a backedge" (collect lookback chars) More...
 

Detailed Description

DFA created by subset construction from regex patterns.

Member Typedef Documentation

typedef std::list<State*> reflex::Pattern::DFA::List

Constructor & Destructor Documentation

reflex::Pattern::DFA::DFA ( )
inline
reflex::Pattern::DFA::~DFA ( )
inline

Member Function Documentation

void reflex::Pattern::DFA::clear ( )
inline

delete DFA and reset to initial state.

State* reflex::Pattern::DFA::root ( )
inline

root of the DFA is the first state created or NULL.

State* reflex::Pattern::DFA::start ( )
inline

start state the DFA is the first state created.

State* reflex::Pattern::DFA::state ( )
inline

new DFA state.

State* reflex::Pattern::DFA::state ( Positions pos)
inline

new DFA state with positions, destroys pos.

State* reflex::Pattern::DFA::state ( State tnode)
inline

new DFA state with optional tree DFA node and positions, destroys pos.

State* reflex::Pattern::DFA::state ( State tnode,
Positions pos 
)
inline

new DFA state with optional tree DFA node and positions, destroys pos.

Member Data Documentation

const uint16_t reflex::Pattern::DFA::ALLOC = 1024
static

allocate 1024 DFA states at a time, to improve performance

const Index reflex::Pattern::DFA::DEAD_PATH = 1
static

state marker "path always and only reaches backedges" (a dead end)

const Index reflex::Pattern::DFA::KEEP_PATH = MAX_DEPTH
static

state marker "required path" (from a newline edge)

List reflex::Pattern::DFA::list

block allocation list

const Index reflex::Pattern::DFA::LOOP_PATH = MAX_DEPTH + 1
static

state marker "path reaches a backedge" (collect lookback chars)

const uint16_t reflex::Pattern::DFA::MAX_DEPTH = 256
static

analyze DFA up to states this deep to improve predict match

const Index reflex::Pattern::DFA::MAX_STATES = Const::GMAX
static

maximum number of states

uint16_t reflex::Pattern::DFA::next

block allocation, next available slot in last block


The documentation for this struct was generated from the following file: