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

#include <recognizer.h>

Inheritance diagram for Recognizer:
Collaboration diagram for Recognizer:

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 ()
QStringsym (int index)
int nextToken ()
void inp ()
QString expand (const QString &text) const

Protected Attributes

int tos
int stack_size
QList< QStringsym_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

Protected Types inherited from grammar
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 Protected Member Functions inherited from grammar
static int nt_action (int state, int nt)
static int t_action (int state, int token)
Static Protected Attributes inherited from grammar
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 []

Detailed Description

Definition at line 17 of file recognizer.h.

Constructor & Destructor Documentation

◆ Recognizer()

Recognizer::Recognizer ( Grammar * grammar,
bool no_lines )

Definition at line 14 of file recognizer.cpp.

◆ ~Recognizer()

Recognizer::~Recognizer ( )

Definition at line 25 of file recognizer.cpp.

Member Function Documentation

◆ decls()

QString Recognizer::decls ( ) const
inline

Definition at line 25 of file recognizer.h.

◆ expand()

QString Recognizer::expand ( const QString & text) const
protected

Definition at line 130 of file main.cpp.

References Grammar::rules, and Grammar::start.

◆ impls()

QString Recognizer::impls ( ) const
inline

Definition at line 26 of file recognizer.h.

◆ inp()

void Recognizer::inp ( )
inlineprotected

Definition at line 37 of file recognizer.h.

◆ nextToken()

int Recognizer::nextToken ( )
protected

Definition at line 46 of file recognizer.cpp.

◆ parse()

bool Recognizer::parse ( const QString & input_file = QString ())

Definition at line 248 of file recognizer.cpp.

References Grammar::TokenInfo::assoc, Grammar::current_assoc, Grammar::current_prec, Grammar::declared_lhs, Grammar::isTerminal(), Grammar::Left, Grammar::non_terminals, Grammar::NonAssoc, Grammar::TokenInfo::prec, Grammar::Right, Grammar::rules, Grammar::start, and Grammar::terminals.

Here is the call graph for this function:

◆ reallocateStack()

void Recognizer::reallocateStack ( )
inlineprotected

Definition at line 31 of file recognizer.cpp.

◆ sym()

QString & Recognizer::sym ( int index)
inlineprotected

Definition at line 31 of file recognizer.h.

Member Data Documentation

◆ _M_action_line

int Recognizer::_M_action_line
protected

Definition at line 67 of file recognizer.h.

◆ _M_contents

QString Recognizer::_M_contents
protected

Definition at line 59 of file recognizer.h.

◆ _M_current_rule

RulePointer Recognizer::_M_current_rule
protected

Definition at line 69 of file recognizer.h.

◆ _M_current_value

QString Recognizer::_M_current_value
protected

Definition at line 74 of file recognizer.h.

◆ _M_currentChar

QString::const_iterator Recognizer::_M_currentChar
protected

Definition at line 62 of file recognizer.h.

◆ _M_decls

QString Recognizer::_M_decls
protected

Definition at line 72 of file recognizer.h.

◆ _M_firstChar

QString::const_iterator Recognizer::_M_firstChar
protected

Definition at line 60 of file recognizer.h.

◆ _M_grammar

Grammar* Recognizer::_M_grammar
protected

Definition at line 68 of file recognizer.h.

◆ _M_impls

QString Recognizer::_M_impls
protected

Definition at line 73 of file recognizer.h.

◆ _M_input_file

QString Recognizer::_M_input_file
protected

Definition at line 70 of file recognizer.h.

◆ _M_lastChar

QString::const_iterator Recognizer::_M_lastChar
protected

Definition at line 61 of file recognizer.h.

◆ _M_line

int Recognizer::_M_line
protected

Definition at line 66 of file recognizer.h.

◆ _M_no_lines

bool Recognizer::_M_no_lines
protected

Definition at line 75 of file recognizer.h.

◆ ch

QChar Recognizer::ch
protected

Definition at line 65 of file recognizer.h.

◆ stack_size

int Recognizer::stack_size
protected

Definition at line 55 of file recognizer.h.

◆ state_stack

int* Recognizer::state_stack
protected

Definition at line 57 of file recognizer.h.

◆ sym_stack

QList<QString> Recognizer::sym_stack
protected

Definition at line 56 of file recognizer.h.

◆ tos

int Recognizer::tos
protected

Definition at line 54 of file recognizer.h.


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