teditor  1.8.0@@fee5e94
Terminal based editor written in C++
Functions
To manually step during regex match phase

Functions

bool teditor::parser::NFA::isMatch (bool lastStateRemaining=false) const
 checks if we have reached match state, indicating a regex match More...
 
bool teditor::parser::NFA::areActiveStatesEmpty () const
 Tells if after the current step() whether there are any active states still remaining. So, this can be used to prematurely stop the regex search in the string. More...
 
const Pointteditor::parser::NFA::getMatchPos () const
 After the search has finished, use this to know the latest position of the match of the regex in the input string. More...
 
bool teditor::parser::NFA::step (char c, const Point &pos)
 Step through the NFA state using the current char. More...
 
void teditor::parser::NFA::reset ()
 Reset all the variables used during regex search. This needs to be called once before beginning of every search. More...
 

Detailed Description

Function Documentation

◆ areActiveStatesEmpty()

bool teditor::parser::NFA::areActiveStatesEmpty ( ) const
inline

Tells if after the current step() whether there are any active states still remaining. So, this can be used to prematurely stop the regex search in the string.

Returns
true if there are no more actives states, else false

◆ getMatchPos()

const Point& teditor::parser::NFA::getMatchPos ( ) const
inline

After the search has finished, use this to know the latest position of the match of the regex in the input string.

Returns
if match found, its latest position in string, else NFA::NoMatch

◆ isMatch()

bool teditor::parser::NFA::isMatch ( bool  lastStateRemaining = false) const

checks if we have reached match state, indicating a regex match

Parameters
lastStateRemainingif set to true, means that this will expect only one state to be remaining which should be Match state.
Returns
true if match has been found, else false

◆ reset()

void teditor::parser::NFA::reset ( )

Reset all the variables used during regex search. This needs to be called once before beginning of every search.

◆ step()

bool teditor::parser::NFA::step ( char  c,
const Point pos 
)

Step through the NFA state using the current char.

Parameters
ccurrent char
posits position in the input string
Returns
true if input was consumed by any of the active states, else false