Line parser, to be used in console scripts and as part of ScriptParser.
More...
#include <lineparser.hpp>
|
| | LineParser (ErrorHandler &errorHandler, const Context &context, Locals &locals, Literals &literals, std::vector< Interpreter::Type_Code > &code, bool allowExpression=false) |
| |
| 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...
|
| |
| | 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...
|
| |
|
| enum | State {
BeginState,
SetState,
SetLocalVarState,
SetGlobalVarState,
SetPotentialMemberVarState,
SetMemberVarState,
SetMemberVarState2,
MessageState,
MessageCommaState,
MessageButtonState,
MessageButtonCommaState,
EndState,
PotentialEndState,
PotentialExplicitState,
ExplicitState,
MemberState
} |
| |
Line parser, to be used in console scripts and as part of ScriptParser.
| Enumerator |
|---|
| BeginState |
|
| SetState |
|
| SetLocalVarState |
|
| SetGlobalVarState |
|
| SetPotentialMemberVarState |
|
| SetMemberVarState |
|
| SetMemberVarState2 |
|
| MessageState |
|
| MessageCommaState |
|
| MessageButtonState |
|
| MessageButtonCommaState |
|
| EndState |
|
| PotentialEndState |
|
| PotentialExplicitState |
|
| ExplicitState |
|
| MemberState |
|
- Parameters
-
| allowExpression | Allow lines consisting of a naked expression (result is send to the messagebox interface) |
| void Compiler::LineParser::parseExpression |
( |
Scanner & |
scanner, |
|
|
const TokenLoc & |
loc |
|
) |
| |
|
private |
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?
- Todo:
- add option to disable this
- Todo:
- add option to disable this
Reimplemented from Compiler::Parser.
| bool Compiler::LineParser::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::LineParser::reset |
( |
| ) |
|
|
virtual |
| bool Compiler::LineParser::mAllowExpression |
|
private |
| int Compiler::LineParser::mButtons |
|
private |
| std::string Compiler::LineParser::mExplicit |
|
private |
| Literals& Compiler::LineParser::mLiterals |
|
private |
| Locals& Compiler::LineParser::mLocals |
|
private |
| std::string Compiler::LineParser::mMemberName |
|
private |
| std::string Compiler::LineParser::mName |
|
private |
| bool Compiler::LineParser::mReferenceMember |
|
private |
| State Compiler::LineParser::mState |
|
private |
| char Compiler::LineParser::mType |
|
private |
The documentation for this class was generated from the following files: