Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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 current_assoc, current_prec, expected_reduce_reduce, expected_shift_reduce, QMap< Key, T >::insert(), intern(), NonAssoc, spells, table_name, terminals, and tk_end.

+ Here is the call 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, and tk_end.

+ Here is the call graph for this function:

◆ buildRuleMap()

void Grammar::buildRuleMap ( )

Definition at line 193 of file lalr.cpp.

References declared_lhs, QMap< Key, T >::end(), QMap< Key, T >::find(), QMap< Key, T >::insert(), QMultiMap< Key, T >::insert(), isTerminal(), it, qPrintable, rule, rule_map, and rules.

+ Here is the call graph for this function:

◆ intern() [1/2]

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

Definition at line 220 of file lalr.h.

References QString::fromUtf8(), and intern().

Referenced by intern().

+ Here is the call graph for this function:
+ 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.

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

+ Here is the caller graph for this function:

◆ isNonTerminal()

bool Grammar::isNonTerminal ( Name name) const
inline

Definition at line 225 of file lalr.h.

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

+ Here is the caller graph for this function:

◆ isTerminal()

bool Grammar::isTerminal ( Name name) const
inline

Definition at line 222 of file lalr.h.

Referenced by Automaton::buildDirectReads(), buildRuleMap(), 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.

Referenced by Recognizer::parse().

◆ 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 Recognizer::parse().

◆ expected_shift_reduce

int Grammar::expected_shift_reduce

Definition at line 248 of file lalr.h.

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

◆ goal

RulePointer Grammar::goal

Definition at line 244 of file lalr.h.

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

◆ impl_file_name

QString Grammar::impl_file_name

Definition at line 235 of file lalr.h.

Referenced by Recognizer::parse().

◆ merged_output

QString Grammar::merged_output

Definition at line 232 of file lalr.h.

Referenced by Recognizer::parse().

◆ names

std::list<QString> Grammar::names

Definition at line 237 of file lalr.h.

Referenced by Recognizer::expand(), Automaton::id(), and Recognizer::parse().

◆ non_terminals

NameSet Grammar::non_terminals

Definition at line 240 of file lalr.h.

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

◆ rule_map

RuleMap Grammar::rule_map

◆ rules

◆ spells

QMap<Name, QString> Grammar::spells

Definition at line 241 of file lalr.h.

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

◆ start

Name Grammar::start

Definition at line 238 of file lalr.h.

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

◆ table_name

QString Grammar::table_name

Definition at line 233 of file lalr.h.

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

◆ terminals

NameSet Grammar::terminals

Definition at line 239 of file lalr.h.

Referenced by Grammar(), 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.

Referenced by Recognizer::parse().

◆ token_prefix

QString Grammar::token_prefix

Definition at line 236 of file lalr.h.

Referenced by Recognizer::parse().


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