#include <exprparser.hpp>
|
| ExprParser (ErrorHandler &errorHandler, const Context &context, Locals &locals, Literals &literals, bool argument=false) |
|
char | getType () const |
| Return type of parsed expression ('l' integer, 'f' float) More...
|
|
virtual bool | parseInt (int value, const TokenLoc &loc, Scanner &scanner) |
|
virtual bool | parseFloat (float value, const TokenLoc &loc, Scanner &scanner) |
|
virtual bool | parseName (const std::string &name, const TokenLoc &loc, Scanner &scanner) |
|
virtual bool | parseKeyword (int keyword, const TokenLoc &loc, Scanner &scanner) |
|
virtual bool | parseSpecial (int code, const TokenLoc &loc, Scanner &scanner) |
|
void | reset () |
| Reset parser to clean state. More...
|
|
char | append (std::vector< Interpreter::Type_Code > &code) |
|
int | parseArguments (const std::string &arguments, Scanner &scanner, std::vector< Interpreter::Type_Code > &code, int ignoreKeyword=-1) |
|
const TokenLoc & | getTokenLoc () const |
|
| Parser (ErrorHandler &errorHandler, const Context &context) |
| constructor More...
|
|
virtual | ~Parser () |
| destructor More...
|
|
virtual bool | parseComment (const std::string &comment, const TokenLoc &loc, Scanner &scanner) |
|
virtual void | parseEOF (Scanner &scanner) |
|
void | setOptional (bool optional) |
|
void | start () |
| Mark parser as non-empty (at least one token has been parser). More...
|
|
bool | isEmpty () const |
| Has anything been parsed? More...
|
|
constructor
- Parameters
-
argument | Parser is used to parse function- or instruction- arguments (this influences the precedence rules). |
Generate code for parsed expression.
- Returns
- Type ('l': integer, 'f': float)
void Compiler::ExprParser::close |
( |
| ) |
|
|
private |
char Compiler::ExprParser::getOperandType |
( |
int |
Index = 0 | ) |
const |
|
private |
char Compiler::ExprParser::getOperator |
( |
| ) |
const |
|
private |
int Compiler::ExprParser::getPriority |
( |
char |
op | ) |
const |
|
private |
const TokenLoc & Compiler::ExprParser::getTokenLoc |
( |
| ) |
const |
char Compiler::ExprParser::getType |
( |
| ) |
const |
Return type of parsed expression ('l' integer, 'f' float)
bool Compiler::ExprParser::handleMemberAccess |
( |
const std::string & |
name | ) |
|
|
private |
bool Compiler::ExprParser::isOpen |
( |
| ) |
const |
|
private |
int Compiler::ExprParser::parseArguments |
( |
const std::string & |
arguments, |
|
|
Scanner & |
scanner |
|
) |
| |
|
private |
Parse sequence of arguments specified by arguments.
- Parameters
-
arguments | Uses ScriptArgs typedef |
- See Also
- Compiler::ScriptArgs
- Parameters
-
invert | Store arguments in reverted order. |
ignoreKeyword | A keyword that is seen as junk |
- Returns
- number of optional arguments
- Todo:
- disable this when operating in strict mode
Handle a float token.
- Returns
- fetch another token?
Reimplemented from Compiler::Parser.
Handle an int token.
- Returns
- fetch another token?
Reimplemented from Compiler::Parser.
Handle a keyword token.
- Returns
- fetch another token?
Reimplemented from Compiler::Parser.
bool Compiler::ExprParser::parseName |
( |
const std::string & |
name, |
|
|
const TokenLoc & |
loc, |
|
|
Scanner & |
scanner |
|
) |
| |
|
virtual |
Handle a name token.
- Returns
- fetch another token?
Reimplemented from Compiler::Parser.
Handle a special character token.
- Returns
- fetch another token?
- Todo:
- add option to disable this workaround
Reimplemented from Compiler::Parser.
void Compiler::ExprParser::pop |
( |
| ) |
|
|
private |
void Compiler::ExprParser::popOperand |
( |
| ) |
|
|
private |
void Compiler::ExprParser::popOperator |
( |
| ) |
|
|
private |
void Compiler::ExprParser::pushBinaryOperator |
( |
char |
c | ) |
|
|
private |
void Compiler::ExprParser::pushFloatLiteral |
( |
float |
value | ) |
|
|
private |
void Compiler::ExprParser::pushIntegerLiteral |
( |
int |
value | ) |
|
|
private |
void Compiler::ExprParser::replaceBinaryOperands |
( |
| ) |
|
|
private |
void Compiler::ExprParser::reset |
( |
| ) |
|
|
virtual |
bool Compiler::ExprParser::mArgument |
|
private |
std::string Compiler::ExprParser::mExplicit |
|
private |
bool Compiler::ExprParser::mFirst |
|
private |
Literals& Compiler::ExprParser::mLiterals |
|
private |
Locals& Compiler::ExprParser::mLocals |
|
private |
bool Compiler::ExprParser::mMemberOp |
|
private |
bool Compiler::ExprParser::mNextOperand |
|
private |
std::vector<char> Compiler::ExprParser::mOperands |
|
private |
std::vector<char> Compiler::ExprParser::mOperators |
|
private |
bool Compiler::ExprParser::mRefOp |
|
private |
TokenLoc Compiler::ExprParser::mTokenLoc |
|
private |
The documentation for this class was generated from the following files: