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
Grammar Class Reference

#include <lalr.h>

Collaboration diagram for Grammar:

Classes

struct  TokenInfo

Public Types

enum  Assoc { NonAssoc , Left , Right }

Public Member Functions

 Grammar ()
Name intern (const QString &id)
Name intern (const char *id)
bool isTerminal (Name name) const
bool isNonTerminal (Name name) const
void buildRuleMap ()
void buildExtendedGrammar ()

Public Attributes

QString merged_output
QString table_name
QString decl_file_name
QString impl_file_name
QString token_prefix
std::list< QStringnames
Name start
NameSet terminals
NameSet non_terminals
QMap< Name, QStringspells
debug_infot rules
RuleMap rule_map
RulePointer goal
Name tk_end
Name accept_symbol
NameSet declared_lhs
int expected_shift_reduce
int expected_reduce_reduce
QMap< Name, TokenInfotoken_info
Assoc current_assoc
int current_prec

Detailed Description

Definition at line 214 of file lalr.h.

Member Enumeration Documentation

◆ Assoc

Enumerator
NonAssoc 
Left 
Right 

Definition at line 251 of file lalr.h.

Constructor & Destructor Documentation

◆ Grammar()

Grammar::Grammar ( )

Definition at line 166 of file lalr.cpp.

References Grammar(), current_assoc, current_prec, expected_reduce_reduce, expected_shift_reduce, intern(), NonAssoc, terminals, and tk_end.

Referenced by Grammar().

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

Member Function Documentation

◆ buildExtendedGrammar()

void Grammar::buildExtendedGrammar ( )

Definition at line 213 of file lalr.cpp.

References accept_symbol, goal, intern(), non_terminals, rules, start, and tk_end.

Referenced by main().

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

◆ buildRuleMap()

void Grammar::buildRuleMap ( )

Definition at line 193 of file lalr.cpp.

References declared_lhs, isTerminal(), rule_map, and rules.

Referenced by main().

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

◆ intern() [1/2]

Name Grammar::intern ( const char * id)
inline

Definition at line 220 of file lalr.h.

Referenced by Grammar(), and buildExtendedGrammar().

Here is the caller graph for this function:

◆ intern() [2/2]

Name Grammar::intern ( const QString & id)

Definition at line 183 of file lalr.cpp.

◆ isNonTerminal()

bool Grammar::isNonTerminal ( Name name) const
inline

Definition at line 225 of file lalr.h.

References non_terminals.

Referenced by Automaton::buildDirectReads(), Automaton::buildIncludesDigraph(), Automaton::buildLookbackSets(), Automaton::buildReadsDigraph(), Automaton::closure(), CppGenerator::operator()(), and ParseTable::operator()().

Here is the caller graph for this function:

◆ isTerminal()

bool Grammar::isTerminal ( Name name) const
inline

Definition at line 222 of file lalr.h.

References terminals.

Referenced by Automaton::buildDirectReads(), buildRuleMap(), DotGraph::operator()(), ParseTable::operator()(), and Recognizer::parse().

Here is the caller graph for this function:

Member Data Documentation

◆ accept_symbol

Name Grammar::accept_symbol

Definition at line 246 of file lalr.h.

Referenced by buildExtendedGrammar().

◆ current_assoc

Assoc Grammar::current_assoc

Definition at line 263 of file lalr.h.

Referenced by Grammar(), and Recognizer::parse().

◆ current_prec

int Grammar::current_prec

Definition at line 264 of file lalr.h.

Referenced by Grammar(), and Recognizer::parse().

◆ decl_file_name

QString Grammar::decl_file_name

Definition at line 234 of file lalr.h.

◆ declared_lhs

NameSet Grammar::declared_lhs

Definition at line 247 of file lalr.h.

Referenced by buildRuleMap(), and Recognizer::parse().

◆ expected_reduce_reduce

int Grammar::expected_reduce_reduce

Definition at line 249 of file lalr.h.

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

◆ expected_shift_reduce

int Grammar::expected_shift_reduce

Definition at line 248 of file lalr.h.

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

◆ goal

RulePointer Grammar::goal

Definition at line 244 of file lalr.h.

Referenced by Automaton::build(), buildExtendedGrammar(), and CppGenerator::operator()().

◆ impl_file_name

QString Grammar::impl_file_name

Definition at line 235 of file lalr.h.

◆ merged_output

QString Grammar::merged_output

Definition at line 232 of file lalr.h.

◆ names

std::list<QString> Grammar::names

Definition at line 237 of file lalr.h.

◆ non_terminals

NameSet Grammar::non_terminals

◆ rule_map

RuleMap Grammar::rule_map

Definition at line 243 of file lalr.h.

Referenced by buildRuleMap().

◆ rules

◆ spells

QMap<Name, QString> Grammar::spells

Definition at line 241 of file lalr.h.

◆ start

Name Grammar::start

Definition at line 238 of file lalr.h.

Referenced by buildExtendedGrammar(), Recognizer::expand(), main(), and Recognizer::parse().

◆ table_name

QString Grammar::table_name

Definition at line 233 of file lalr.h.

◆ terminals

NameSet Grammar::terminals

Definition at line 239 of file lalr.h.

Referenced by Grammar(), isTerminal(), CppGenerator::operator()(), and Recognizer::parse().

◆ tk_end

Name Grammar::tk_end

Definition at line 245 of file lalr.h.

Referenced by Grammar(), and buildExtendedGrammar().

◆ token_info

QMap<Name, TokenInfo> Grammar::token_info

Definition at line 262 of file lalr.h.

◆ token_prefix

QString Grammar::token_prefix

Definition at line 236 of file lalr.h.


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