sun::parsing::NFA

sun::parsing::NFA

class · Source (opens in a new tab)

class sun::parsing::NFA

Creates an empty nondeterministic automaton ready for pattern construction.

Public Functions

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::acceptingState

No documentation comment.

Related: State

startState

public · variable · Source (opens in a new tab)

State* sun::parsing::NFA::startState

No 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.

Related: State, NFA

Private Fields

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::allStates

No 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_ = false

No 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 = 256

No documentation comment.

maxGroupId_

private · variable · Source (opens in a new tab)

int sun::parsing::NFA::maxGroupId_ = 0

No documentation comment.

numStates_

private · variable · Source (opens in a new tab)

int sun::parsing::NFA::numStates_ = 0

No 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 DFA

No documentation comment.