#include <controlparser.hpp>
|
| ControlParser (ErrorHandler &errorHandler, const Context &context, Locals &locals, Literals &literals) |
|
void | appendCode (std::vector< Interpreter::Type_Code > &code) const |
| store generated code in code. More...
|
|
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...
|
|
| Parser (ErrorHandler &errorHandler, const Context &context) |
| constructor More...
|
|
virtual | ~Parser () |
| destructor More...
|
|
virtual bool | parseInt (int value, const TokenLoc &loc, Scanner &scanner) |
|
virtual bool | parseFloat (float value, const TokenLoc &loc, Scanner &scanner) |
|
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...
|
|
|
enum | State {
StartState,
IfEndState,
IfBodyState,
IfElseifEndState,
IfElseifBodyState,
IfElseEndState,
IfElseBodyState,
IfEndifState,
WhileEndState,
WhileBodyState,
WhileEndwhileState,
IfElseJunkState
} |
|
typedef std::vector
< Interpreter::Type_Code > | Codes |
|
typedef std::vector< std::pair
< Codes, Codes > > | IfCodes |
|
Enumerator |
---|
StartState |
|
IfEndState |
|
IfBodyState |
|
IfElseifEndState |
|
IfElseifBodyState |
|
IfElseEndState |
|
IfElseBodyState |
|
IfEndifState |
|
WhileEndState |
|
WhileBodyState |
|
WhileEndwhileState |
|
IfElseJunkState |
|
store generated code in code.
- Todo:
- should be IfElseEndState; add an option for that
Handle a keyword token.
- Returns
- fetch another token?
Reimplemented from Compiler::Parser.
bool Compiler::ControlParser::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?
Reimplemented from Compiler::Parser.
void Compiler::ControlParser::reset |
( |
| ) |
|
|
virtual |
Codes Compiler::ControlParser::mCode |
|
private |
Codes Compiler::ControlParser::mCodeBlock |
|
private |
IfCodes Compiler::ControlParser::mIfCode |
|
private |
Literals& Compiler::ControlParser::mLiterals |
|
private |
Locals& Compiler::ControlParser::mLocals |
|
private |
State Compiler::ControlParser::mState |
|
private |
The documentation for this class was generated from the following files: