sun::parsing::NFA
class · Source (opens in a new tab)
class sun::parsing::NFACreates an empty nondeterministic automaton ready for pattern construction.
Public Functions
- NFA
- acquireStatesFrom
- compile
- createForAnyChar
- createForChar
- createForCharClass
- createForConcatenation
- createForEpsilon
- createForKleeneStar
- createForOptional
- createForPlus
- createForUnion
- ensureCompiled
NFA
public · function · Source (opens in a new tab)
sun::parsing::NFA::NFA()Creates an empty nondeterministic automaton ready for pattern construction.
acquireStatesFrom
public · function · Source (opens in a new tab)
void sun::parsing::NFA::acquireStatesFrom(NFA &other)Transfers another automaton's states into this one.
Related: NFA
compile
public · function · Source (opens in a new tab)
void sun::parsing::NFA::compile()Builds the transition representation used to execute this automaton.
createForAnyChar
public · function · static · Source (opens in a new tab)
static NFA sun::parsing::NFA::createForAnyChar()Creates an automaton that accepts any input character.
Related: NFA
createForChar
public · function · static · Source (opens in a new tab)
static NFA sun::parsing::NFA::createForChar(char c)Creates an automaton that accepts the supplied character.
Related: NFA
createForCharClass
createForCharClass(const std::string &chars, bool negated=false)
public · function · static · Source (opens in a new tab)
static NFA sun::parsing::NFA::createForCharClass(const std::string &chars, bool negated=false)Creates an automaton accepting characters in, or outside, a character class.
Related: NFA
createForCharClass(const std::set< unsigned char > &charSet, bool negated=false)
public · function · static · Source (opens in a new tab)
static NFA sun::parsing::NFA::createForCharClass(const std::set< unsigned char > &charSet, bool negated=false)Negation spans the full 0-255 byte range, so [^"\] and friends accept UTF-8 continuation bytes inside string literals and comments.
Related: NFA
createForConcatenation
public · function · static · Source (opens in a new tab)
static NFA sun::parsing::NFA::createForConcatenation(NFA &n1, NFA &n2)Combines two automata so their patterns match in sequence.
Related: NFA
createForEpsilon
public · function · static · Source (opens in a new tab)
static NFA sun::parsing::NFA::createForEpsilon()Creates an automaton that accepts the empty string.
Related: NFA
createForKleeneStar
public · function · static · Source (opens in a new tab)
static NFA sun::parsing::NFA::createForKleeneStar(NFA &n)Creates an automaton accepting zero or more repetitions of a pattern.
Related: NFA
createForOptional
public · function · static · Source (opens in a new tab)
static NFA sun::parsing::NFA::createForOptional(NFA &n)Creates an automaton accepting a pattern or the empty string.
Related: NFA
createForPlus
public · function · static · Source (opens in a new tab)
static NFA sun::parsing::NFA::createForPlus(NFA &n)Creates an automaton accepting one or more repetitions of a pattern.
Related: NFA
createForUnion
public · function · static · Source (opens in a new tab)
static NFA sun::parsing::NFA::createForUnion(NFA &n1, NFA &n2)Combines two automata so either pattern can match.
Related: NFA
ensureCompiled
public · function · Source (opens in a new tab)
void sun::parsing::NFA::ensureCompiled()Builds the compiled transition tables when they are first needed.
Public Fields
acceptingState
public · variable · Source (opens in a new tab)
State* sun::parsing::NFA::acceptingStateNo documentation comment.
Related: State
startState
public · variable · Source (opens in a new tab)
State* sun::parsing::NFA::startStateNo documentation comment.
Related: State
Private Functions
computeReachability
private · function · Source (opens in a new tab)
void sun::parsing::NFA::computeReachability()States that can reach an accepting state via a non-empty path.
createState
private · function · Source (opens in a new tab)
State * sun::parsing::NFA::createState()Creates an automaton state owned by this NFA.
Private Fields
- accepting_
- allStates
- anyOff_
- anyTargets_
- charOff_
- charTargets_
- compiled_
- enterGroup_
- epsOff_
- epsTargets_
- exitGroup_
- groupId_
- groupNameNum_
- groupName_
- idOf_
- kAlphabet
- maxGroupId_
- numStates_
- reachNonEmpty_
- startClosure_
accepting_
private · variable · Source (opens in a new tab)
std::vector<uint8_t> sun::parsing::NFA::accepting_No documentation comment.
allStates
private · variable · Source (opens in a new tab)
std::vector<std::unique_ptr<State> > sun::parsing::NFA::allStatesNo documentation comment.
Related: State
anyOff_
private · variable · Source (opens in a new tab)
std::vector<int> sun::parsing::NFA::anyOff_No documentation comment.
anyTargets_
private · variable · Source (opens in a new tab)
std::vector<int> sun::parsing::NFA::anyTargets_No documentation comment.
charOff_
private · variable · Source (opens in a new tab)
std::vector<int> sun::parsing::NFA::charOff_No documentation comment.
charTargets_
private · variable · Source (opens in a new tab)
std::vector<int> sun::parsing::NFA::charTargets_No documentation comment.
compiled_
private · variable · Source (opens in a new tab)
bool sun::parsing::NFA::compiled_ = falseNo documentation comment.
enterGroup_
private · variable · Source (opens in a new tab)
std::vector<uint8_t> sun::parsing::NFA::enterGroup_No documentation comment.
epsOff_
private · variable · Source (opens in a new tab)
std::vector<int> sun::parsing::NFA::epsOff_No documentation comment.
epsTargets_
private · variable · Source (opens in a new tab)
std::vector<int> sun::parsing::NFA::epsTargets_No documentation comment.
exitGroup_
private · variable · Source (opens in a new tab)
std::vector<uint8_t> sun::parsing::NFA::exitGroup_No documentation comment.
groupId_
private · variable · Source (opens in a new tab)
std::vector<int> sun::parsing::NFA::groupId_No documentation comment.
groupNameNum_
private · variable · Source (opens in a new tab)
std::vector<int> sun::parsing::NFA::groupNameNum_No documentation comment.
groupName_
private · variable · Source (opens in a new tab)
std::vector<const std::string*> sun::parsing::NFA::groupName_No documentation comment.
idOf_
private · variable · Source (opens in a new tab)
std::unordered_map<const State*, int> sun::parsing::NFA::idOf_No documentation comment.
Related: State
kAlphabet
private · variable · static · Source (opens in a new tab)
int sun::parsing::NFA::kAlphabet = 256No documentation comment.
maxGroupId_
private · variable · Source (opens in a new tab)
int sun::parsing::NFA::maxGroupId_ = 0No documentation comment.
numStates_
private · variable · Source (opens in a new tab)
int sun::parsing::NFA::numStates_ = 0No documentation comment.
reachNonEmpty_
private · variable · Source (opens in a new tab)
std::vector<uint8_t> sun::parsing::NFA::reachNonEmpty_No documentation comment.
startClosure_
private · variable · Source (opens in a new tab)
std::vector<int> sun::parsing::NFA::startClosure_No documentation comment.
Private Friends
DFA
private · friend · Source (opens in a new tab)
friend class DFANo documentation comment.