
Definition at line 35 of file parser.cc.
Public Member Functions | |
| BisonListener (IBuilder *, string fileName) | |
| virtual | ~BisonListener () |
| virtual void | setType (EToken type) |
| token type detected | |
| virtual void | glVar (Token token) |
| global variable | |
| virtual void | fncInit (Token token) |
| fnc decl/def detected | |
| virtual void | fncDecl () |
| fnc declaration complete | |
| virtual void | fncDefEnter () |
| fnc definition body enter | |
| virtual void | fncDefLeave () |
| fnc definition body leave | |
| virtual void | argDecl () |
| arg in fnc declaration | |
| virtual void | argDef (Token token) |
| arg in fnc definition | |
| virtual void | lcVar (Token token) |
| local variable in fnc def | |
| virtual void | assign (Token token) |
| virtual void | ifEnter (Token token) |
| virtual void | ifElse () |
| virtual void | ifLeave () |
| virtual void | whileInit (Token token) |
| virtual void | whileEnter () |
| virtual void | whileLeave () |
| virtual void | pushToken (Token token) |
| virtual void | evalUnOp (Token token) |
| virtual void | evalBinOp (Token token) |
| virtual void | fncCallInit (Token token) |
| fnc call detected | |
| virtual void | fncCallArg () |
| fnc call arg | |
| virtual void | fncCallPrintArg () |
| fnc call arg of print() | |
| virtual void | fncCallAsCmd () |
| fnc call as command | |
| virtual void | fncCallAsExpr () |
| fnc call as expression | |
Private Types | |
| typedef TFncCall * | TStack |
Private Member Functions | |
| bool | initDeclIfNeeded () |
| init function declaration in higher layer (if not already initiated) | |
| bool | initDefIfNeeded () |
| init function definition in higher layer (if not already initiated) | |
| void | errMixedDeclDef () |
| handle error caused by mixed syntax of function declaration/definition | |
| bool | chkStack () |
| check stack if not empty; if so handle such error; return true on success | |
Private Attributes | |
| IBuilder * | builder_ |
| entry point to higher layer (IBuilder object) | |
| string | fileName_ |
| name (or alias) of input file (used in messages) | |
| EToken | type_ |
| last type detected by bison (will be never T_VOID) | |
| EToken | fncType_ |
| return type of function currently being read | |
| Token | fncId_ |
| name (as defining token) of function currently being read | |
| bool | fncInitDeclSent_ |
| true if higher layer is now reading function declaration | |
| bool | fncInitDefSent_ |
| true if higher layer is now reading function definition | |
| EToken | fncPrint_ |
| type of print function currently being read (if any) | |
| TStack | stack_ |
| function call stack | |
Classes | |
| struct | TFncCall |
| BisonListener | ( | IBuilder * | builder, | |
| string | fileName | |||
| ) |
| virtual ~BisonListener | ( | ) | [inline, virtual] |
| void setType | ( | EToken | type | ) | [virtual] |
| void glVar | ( | Token | token | ) | [virtual] |
| void fncInit | ( | Token | token | ) | [virtual] |
fnc decl/def detected
Definition at line 102 of file parser.cc.
References fncId_, fncInitDeclSent_, fncInitDefSent_, fncType_, and type_.
| void fncDecl | ( | ) | [virtual] |
fnc declaration complete
Definition at line 109 of file parser.cc.
References builder_, and initDeclIfNeeded().

| void fncDefEnter | ( | ) | [virtual] |
fnc definition body enter
Definition at line 114 of file parser.cc.
References builder_, and initDefIfNeeded().

| void fncDefLeave | ( | ) | [virtual] |
fnc definition body leave
Definition at line 119 of file parser.cc.
References builder_, and initDefIfNeeded().

| void argDecl | ( | ) | [virtual] |
arg in fnc declaration
Definition at line 124 of file parser.cc.
References builder_, initDeclIfNeeded(), and type_.

| void argDef | ( | Token | token | ) | [virtual] |
arg in fnc definition
Definition at line 129 of file parser.cc.
References builder_, initDefIfNeeded(), and type_.

| void lcVar | ( | Token | token | ) | [virtual] |
local variable in fnc def
Definition at line 134 of file parser.cc.
References builder_, initDefIfNeeded(), and type_.

| virtual void assign | ( | Token | token | ) | [inline, virtual] |
| virtual void ifEnter | ( | Token | token | ) | [inline, virtual] |
| virtual void ifElse | ( | ) | [inline, virtual] |
| virtual void ifLeave | ( | ) | [inline, virtual] |
| virtual void whileInit | ( | Token | token | ) | [inline, virtual] |
| virtual void whileEnter | ( | ) | [inline, virtual] |
| virtual void whileLeave | ( | ) | [inline, virtual] |
| virtual void pushToken | ( | Token | token | ) | [inline, virtual] |
| virtual void evalUnOp | ( | Token | token | ) | [inline, virtual] |
| virtual void evalBinOp | ( | Token | token | ) | [inline, virtual] |
| void fncCallInit | ( | Token | token | ) | [virtual] |
fnc call detected
Definition at line 139 of file parser.cc.
References StreamDecorator::C_LIGHT_PURPLE, StreamDecorator::C_NO_COLOR, ETOKEN_NULL, fncPrint_, and stack_.
| void fncCallArg | ( | ) | [virtual] |
fnc call arg
Definition at line 150 of file parser.cc.
References StreamDecorator::C_LIGHT_PURPLE, StreamDecorator::C_NO_COLOR, BisonListener::TFncCall::first, BisonListener::TFncCall::second, and stack_.
| void fncCallPrintArg | ( | ) | [virtual] |
fnc call arg of print()
Definition at line 162 of file parser.cc.
References builder_, chkStack(), StreamDecorator::E_ERROR, IBuilder::errorDetected(), fileName_, BisonListener::TFncCall::first, fncPrint_, stack_, Token::text, and type_.

| void fncCallAsCmd | ( | ) | [virtual] |
fnc call as command
Definition at line 174 of file parser.cc.
References builder_, StreamDecorator::C_LIGHT_PURPLE, StreamDecorator::C_NO_COLOR, chkStack(), ETOKEN_NULL, BisonListener::TFncCall::first, fncPrint_, BisonListener::TFncCall::second, and stack_.

| void fncCallAsExpr | ( | ) | [virtual] |
fnc call as expression
Definition at line 192 of file parser.cc.
References builder_, StreamDecorator::C_LIGHT_PURPLE, StreamDecorator::C_NO_COLOR, chkStack(), BisonListener::TFncCall::first, BisonListener::TFncCall::second, and stack_.

| bool initDeclIfNeeded | ( | ) | [private] |
init function declaration in higher layer (if not already initiated)
Definition at line 207 of file parser.cc.
References builder_, errMixedDeclDef(), fncId_, fncInitDeclSent_, fncInitDefSent_, and fncType_.
Referenced by argDecl(), and fncDecl().


| bool initDefIfNeeded | ( | ) | [private] |
init function definition in higher layer (if not already initiated)
Definition at line 220 of file parser.cc.
References builder_, errMixedDeclDef(), fncId_, fncInitDeclSent_, fncInitDefSent_, and fncType_.
Referenced by argDef(), fncDefEnter(), fncDefLeave(), and lcVar().


| void errMixedDeclDef | ( | ) | [private] |
handle error caused by mixed syntax of function declaration/definition
Definition at line 242 of file parser.cc.
References builder_, StreamDecorator::E_ERROR, fileName_, and fncId_.
Referenced by initDeclIfNeeded(), and initDefIfNeeded().

| bool chkStack | ( | ) | [private] |
check stack if not empty; if so handle such error; return true on success
Definition at line 233 of file parser.cc.
References builder_, StreamDecorator::E_ERROR, fileName_, and stack_.
Referenced by fncCallAsCmd(), fncCallAsExpr(), and fncCallPrintArg().

entry point to higher layer (IBuilder object)
Definition at line 64 of file parser.cc.
Referenced by argDecl(), argDef(), assign(), chkStack(), errMixedDeclDef(), evalBinOp(), evalUnOp(), fncCallAsCmd(), fncCallAsExpr(), fncCallPrintArg(), fncDecl(), fncDefEnter(), fncDefLeave(), glVar(), ifElse(), ifEnter(), ifLeave(), initDeclIfNeeded(), initDefIfNeeded(), lcVar(), pushToken(), whileEnter(), whileInit(), and whileLeave().
string fileName_ [private] |
name (or alias) of input file (used in messages)
Definition at line 65 of file parser.cc.
Referenced by chkStack(), errMixedDeclDef(), and fncCallPrintArg().
return type of function currently being read
Definition at line 67 of file parser.cc.
Referenced by fncInit(), initDeclIfNeeded(), and initDefIfNeeded().
name (as defining token) of function currently being read
Definition at line 68 of file parser.cc.
Referenced by errMixedDeclDef(), fncInit(), initDeclIfNeeded(), and initDefIfNeeded().
bool fncInitDeclSent_ [private] |
true if higher layer is now reading function declaration
Definition at line 69 of file parser.cc.
Referenced by fncInit(), initDeclIfNeeded(), and initDefIfNeeded().
bool fncInitDefSent_ [private] |
true if higher layer is now reading function definition
Definition at line 70 of file parser.cc.
Referenced by fncInit(), initDeclIfNeeded(), and initDefIfNeeded().
type of print function currently being read (if any)
Definition at line 71 of file parser.cc.
Referenced by fncCallAsCmd(), fncCallInit(), and fncCallPrintArg().
function call stack
Definition at line 75 of file parser.cc.
Referenced by chkStack(), fncCallArg(), fncCallAsCmd(), fncCallAsExpr(), fncCallInit(), and fncCallPrintArg().
1.5.4