![]() |
Qt 6.x
The Qt SDK
|
#include <recognizer.h>
Public Member Functions | |
Recognizer (Grammar *grammar, bool no_lines) | |
~Recognizer () | |
bool | parse (const QString &input_file=QString()) |
QString | decls () const |
QString | impls () const |
Protected Member Functions | |
void | reallocateStack () |
QString & | sym (int index) |
int | nextToken () |
void | inp () |
QString | expand (const QString &text) const |
Protected Attributes | |
int | tos |
int | stack_size |
QList< QString > | sym_stack |
int * | state_stack |
QString | _M_contents |
QString::const_iterator | _M_firstChar |
QString::const_iterator | _M_lastChar |
QString::const_iterator | _M_currentChar |
QChar | ch |
int | _M_line |
int | _M_action_line |
Grammar * | _M_grammar |
RulePointer | _M_current_rule |
QString | _M_input_file |
QString | _M_decls |
QString | _M_impls |
QString | _M_current_value |
bool | _M_no_lines |
Additional Inherited Members | |
![]() | |
enum | VariousConstants { EOF_SYMBOL = 0 , COLON = 16 , DECL = 19 , DECL_FILE = 3 , ERROR = 21 , EXPECT = 4 , EXPECT_RR = 5 , ID = 1 , IMPL = 20 , IMPL_FILE = 6 , LEFT = 7 , MERGED_OUTPUT = 8 , NONASSOC = 9 , OR = 17 , PARSER = 10 , PREC = 11 , RIGHT = 12 , SEMICOLON = 18 , START = 13 , STRING_LITERAL = 2 , TOKEN = 14 , TOKEN_PREFIX = 15 , ACCEPT_STATE = 68 , RULE_COUNT = 45 , STATE_COUNT = 69 , TERMINAL_COUNT = 22 , NON_TERMINAL_COUNT = 24 , GOTO_INDEX_OFFSET = 69 , GOTO_INFO_OFFSET = 57 , GOTO_CHECK_OFFSET = 57 } |
![]() | |
static int | nt_action (int state, int nt) |
static int | t_action (int state, int token) |
![]() | |
static const char *const | spell [] |
static const short | lhs [] |
static const short | rhs [] |
static const short | goto_default [] |
static const short | action_default [] |
static const short | action_index [] |
static const short | action_info [] |
static const short | action_check [] |
Definition at line 18 of file recognizer.h.
Recognizer::Recognizer | ( | Grammar * | grammar, |
bool | no_lines | ||
) |
Definition at line 14 of file recognizer.cpp.
Recognizer::~Recognizer | ( | ) |
Definition at line 25 of file recognizer.cpp.
References stack_size, and state_stack.
|
inline |
Definition at line 26 of file recognizer.h.
References _M_decls.
Definition at line 130 of file main.cpp.
References _M_current_rule, _M_grammar, Grammar::names, QString::number(), QString::replace(), Grammar::rules, Grammar::start, Grammar::table_name, text, and QString::toLower().
Referenced by parse().
|
inline |
Definition at line 27 of file recognizer.h.
References _M_impls.
|
inlineprotected |
Definition at line 38 of file recognizer.h.
References _M_currentChar, _M_lastChar, _M_line, and ch.
Referenced by nextToken(), and parse().
|
protected |
Definition at line 46 of file recognizer.cpp.
References _M_action_line, _M_current_value, _M_input_file, _M_line, _M_no_lines, ch, QString::clear(), grammar::COLON, grammar::DECL, grammar::DECL_FILE, Qt::endl(), grammar::EOF_SYMBOL, grammar::ERROR, grammar::EXPECT, grammar::EXPECT_RR, forever, QDir::fromNativeSeparators(), grammar::ID, grammar::IMPL, grammar::IMPL_FILE, inp(), QChar::isLetterOrNumber(), QChar::isNull(), QChar::isSpace(), grammar::LEFT, grammar::MERGED_OUTPUT, grammar::NONASSOC, QString::number(), grammar::OR, grammar::PARSER, grammar::PREC, qerr(), grammar::RIGHT, grammar::SEMICOLON, grammar::START, grammar::STRING_LITERAL, text, token, grammar::TOKEN, grammar::TOKEN_PREFIX, and QChar::unicode().
Referenced by parse().
Definition at line 248 of file recognizer.cpp.
References _M_contents, _M_current_rule, _M_current_value, _M_currentChar, _M_decls, _M_firstChar, _M_grammar, _M_impls, _M_input_file, _M_lastChar, _M_line, grammar::ACCEPT_STATE, grammar::action_index, QString::clear(), QString::constBegin(), QString::constEnd(), Grammar::current_assoc, Grammar::current_prec, Grammar::decl_file_name, Grammar::declared_lhs, Qt::endl(), expand(), Grammar::expected_reduce_reduce, Grammar::expected_shift_reduce, file, Grammar::impl_file_name, info, inp(), QMap< Key, T >::insert(), Grammar::intern(), Grammar::isTerminal(), it, Grammar::Left, grammar::lhs, Grammar::merged_output, Grammar::names, nextToken(), Grammar::non_terminals, Grammar::NonAssoc, grammar::nt_action(), QFile::open(), qerr(), QIODeviceBase::ReadOnly, reallocateStack(), grammar::rhs, Grammar::Right, Grammar::rules, Grammar::spells, stack_size, Grammar::start, state_stack, sym(), sym_stack, grammar::t_action(), Grammar::table_name, grammar::TERMINAL_COUNT, Grammar::terminals, QString::toInt(), Grammar::token_info, Grammar::token_prefix, and tos.
|
inlineprotected |
Definition at line 31 of file recognizer.cpp.
References QList< T >::resize(), stack_size, state_stack, and sym_stack.
Referenced by parse().
|
inlineprotected |
Definition at line 32 of file recognizer.h.
References sym_stack, and tos.
Referenced by parse().
|
protected |
Definition at line 68 of file recognizer.h.
Referenced by nextToken().
|
protected |
Definition at line 60 of file recognizer.h.
Referenced by parse().
|
protected |
Definition at line 70 of file recognizer.h.
|
protected |
Definition at line 75 of file recognizer.h.
Referenced by nextToken(), and parse().
|
protected |
Definition at line 63 of file recognizer.h.
|
protected |
Definition at line 73 of file recognizer.h.
|
protected |
Definition at line 61 of file recognizer.h.
Referenced by parse().
|
protected |
Definition at line 69 of file recognizer.h.
|
protected |
Definition at line 74 of file recognizer.h.
|
protected |
Definition at line 71 of file recognizer.h.
Referenced by nextToken(), and parse().
|
protected |
Definition at line 62 of file recognizer.h.
|
protected |
Definition at line 67 of file recognizer.h.
Referenced by inp(), nextToken(), and parse().
|
protected |
Definition at line 76 of file recognizer.h.
Referenced by nextToken().
|
protected |
Definition at line 66 of file recognizer.h.
Referenced by inp(), and nextToken().
|
protected |
Definition at line 56 of file recognizer.h.
Referenced by ~Recognizer(), parse(), and reallocateStack().
|
protected |
Definition at line 58 of file recognizer.h.
Referenced by ~Recognizer(), parse(), and reallocateStack().
Definition at line 57 of file recognizer.h.
Referenced by parse(), reallocateStack(), and sym().
|
protected |
Definition at line 55 of file recognizer.h.