Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
Automaton Class Reference

#include <lalr.h>

Collaboration diagram for Automaton:

Public Types

typedef Node< ReadReadsGraph
typedef ReadsGraph::iterator ReadNode
typedef Node< IncludeIncludesGraph
typedef IncludesGraph::iterator IncludeNode

Public Member Functions

 Automaton (Grammar *g)
std::pair< StatePointer, bool > internState (const State &state)
void build ()
void buildNullables ()
void buildLookbackSets ()
void buildDirectReads ()
void buildReadsDigraph ()
void buildReads ()
void visitReadNode (ReadNode node)
void buildIncludesAndFollows ()
void buildIncludesDigraph ()
void visitIncludeNode (IncludeNode node)
void buildLookaheads ()
void buildDefaultReduceActions ()
void closure (StatePointer state)
int id (RulePointer rule)
int id (StatePointer state)
int id (Name name)
void dump (QTextStream &out, IncludeNode incl)
void dump (QTextStream &out, ReadNode rd)
void dump (QTextStream &out, const Lookback &lp)

Public Attributes

Grammar_M_grammar
StateList states
StatePointer start
NameSet nullables
QMultiMap< ItemPointer, Lookbacklookbacks
QMap< ItemPointer, NameSetlookaheads

Detailed Description

Definition at line 309 of file lalr.h.

Member Typedef Documentation

◆ IncludeNode

Definition at line 320 of file lalr.h.

◆ IncludesGraph

Definition at line 319 of file lalr.h.

◆ ReadNode

Definition at line 317 of file lalr.h.

◆ ReadsGraph

Definition at line 316 of file lalr.h.

Constructor & Destructor Documentation

◆ Automaton()

Automaton::Automaton ( Grammar * g)

Definition at line 236 of file lalr.cpp.

References _M_grammar, start, and states.

Referenced by main().

Here is the caller graph for this function:

Member Function Documentation

◆ build()

void Automaton::build ( )

Definition at line 257 of file lalr.cpp.

References State::State(), _M_grammar, buildDefaultReduceActions(), buildIncludesAndFollows(), buildLookaheads(), buildLookbackSets(), buildNullables(), buildReads(), closure(), Grammar::goal, internState(), Item::rule, and start.

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildDefaultReduceActions()

void Automaton::buildDefaultReduceActions ( )

Definition at line 724 of file lalr.cpp.

References states.

Referenced by build().

Here is the caller graph for this function:

◆ buildDirectReads()

void Automaton::buildDirectReads ( )

Definition at line 445 of file lalr.cpp.

References _M_grammar, Grammar::isNonTerminal(), Grammar::isTerminal(), and states.

Referenced by buildReads().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildIncludesAndFollows()

void Automaton::buildIncludesAndFollows ( )

Definition at line 565 of file lalr.cpp.

References buildIncludesDigraph(), states, and visitIncludeNode().

Referenced by build().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildIncludesDigraph()

void Automaton::buildIncludesDigraph ( )

Definition at line 586 of file lalr.cpp.

References NotNullable::NotNullable(), _M_grammar, Grammar::isNonTerminal(), and states.

Referenced by buildIncludesAndFollows().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildLookaheads()

void Automaton::buildLookaheads ( )

Definition at line 693 of file lalr.cpp.

References Lookback::state, and states.

Referenced by build().

Here is the caller graph for this function:

◆ buildLookbackSets()

void Automaton::buildLookbackSets ( )

Definition at line 391 of file lalr.cpp.

References _M_grammar, Grammar::isNonTerminal(), and states.

Referenced by build().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildNullables()

void Automaton::buildNullables ( )

Definition at line 277 of file lalr.cpp.

References NotNullable::NotNullable(), _M_grammar, nullables, and Grammar::rules.

Referenced by build().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildReads()

void Automaton::buildReads ( )

Definition at line 509 of file lalr.cpp.

References buildDirectReads(), buildReadsDigraph(), and visitReadNode().

Referenced by build().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildReadsDigraph()

void Automaton::buildReadsDigraph ( )

Definition at line 474 of file lalr.cpp.

References _M_grammar, Grammar::isNonTerminal(), nullables, and states.

Referenced by buildReads().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ closure()

void Automaton::closure ( StatePointer state)

Definition at line 327 of file lalr.cpp.

References _M_grammar, closure(), Grammar::isNonTerminal(), and Item::rule.

Referenced by build(), and closure().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dump() [1/3]

void Automaton::dump ( QTextStream & out,
const Lookback & lp )

Definition at line 762 of file lalr.cpp.

◆ dump() [2/3]

void Automaton::dump ( QTextStream & out,
IncludeNode incl )

Definition at line 752 of file lalr.cpp.

◆ dump() [3/3]

void Automaton::dump ( QTextStream & out,
ReadNode rd )

Definition at line 757 of file lalr.cpp.

◆ id() [1/3]

int Automaton::id ( Name name)

Definition at line 247 of file lalr.cpp.

References _M_grammar.

◆ id() [2/3]

int Automaton::id ( RulePointer rule)

Definition at line 242 of file lalr.cpp.

References _M_grammar, and Grammar::rules.

Referenced by CppGenerator::operator()(), and DotGraph::operator()().

Here is the caller graph for this function:

◆ id() [3/3]

int Automaton::id ( StatePointer state)

Definition at line 252 of file lalr.cpp.

References states.

◆ internState()

std::pair< StatePointer, bool > Automaton::internState ( const State & state)

Definition at line 299 of file lalr.cpp.

References states.

Referenced by build().

Here is the caller graph for this function:

◆ visitIncludeNode()

void Automaton::visitIncludeNode ( IncludeNode node)

Definition at line 647 of file lalr.cpp.

References visitIncludeNode().

Referenced by buildIncludesAndFollows(), and visitIncludeNode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ visitReadNode()

void Automaton::visitReadNode ( ReadNode node)

Definition at line 528 of file lalr.cpp.

References visitReadNode().

Referenced by buildReads(), and visitReadNode().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _M_grammar

◆ lookaheads

QMap<ItemPointer, NameSet> Automaton::lookaheads

Definition at line 356 of file lalr.h.

◆ lookbacks

QMultiMap<ItemPointer, Lookback> Automaton::lookbacks

Definition at line 355 of file lalr.h.

◆ nullables

NameSet Automaton::nullables

Definition at line 354 of file lalr.h.

Referenced by buildNullables(), buildReadsDigraph(), and NotNullable::operator()().

◆ start

StatePointer Automaton::start

Definition at line 353 of file lalr.h.

Referenced by Automaton(), and build().

◆ states


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