OpenMW
Public Member Functions | Private Types | Private Member Functions | Private Attributes
Compiler::ControlParser Class Reference

#include <controlparser.hpp>

List of all members.

Public Member Functions

 ControlParser (ErrorHandler &errorHandler, Context &context, Locals &locals, Literals &literals)
void appendCode (std::vector< Interpreter::Type_Code > &code) const
 store generated code in \æ code.
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.

Private Types

enum  State {
  StartState, IfEndState, IfBodyState, IfElseifEndState,
  IfElseifBodyState, IfElseEndState, IfElseBodyState, IfEndifState,
  WhileEndState, WhileBodyState, WhileEndwhileState
}
typedef std::vector
< Interpreter::Type_Code
Codes
typedef std::vector< std::pair
< Codes, Codes > > 
IfCodes

Private Member Functions

bool parseIfBody (int keyword, const TokenLoc &loc, Scanner &scanner)
bool parseWhileBody (int keyword, const TokenLoc &loc, Scanner &scanner)

Private Attributes

LocalsmLocals
LiteralsmLiterals
Codes mCode
Codes mCodeBlock
IfCodes mIfCode
LineParser mLineParser
ExprParser mExprParser
State mState

Member Typedef Documentation

typedef std::vector<std::pair<Codes, Codes> > Compiler::ControlParser::IfCodes [private]

Member Enumeration Documentation

Enumerator:
StartState 
IfEndState 
IfBodyState 
IfElseifEndState 
IfElseifBodyState 
IfElseEndState 
IfElseBodyState 
IfEndifState 
WhileEndState 
WhileBodyState 
WhileEndwhileState 

Constructor & Destructor Documentation

Compiler::ControlParser::ControlParser ( ErrorHandler errorHandler,
Context context,
Locals locals,
Literals literals 
)

Member Function Documentation

void Compiler::ControlParser::appendCode ( std::vector< Interpreter::Type_Code > &  code) const

store generated code in \æ code.

bool Compiler::ControlParser::parseIfBody ( int  keyword,
const TokenLoc loc,
Scanner scanner 
) [private]
bool Compiler::ControlParser::parseKeyword ( int  keyword,
const TokenLoc loc,
Scanner scanner 
) [virtual]

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.

bool Compiler::ControlParser::parseSpecial ( int  code,
const TokenLoc loc,
Scanner scanner 
) [virtual]

Handle a special character token.

Returns:
fetch another token?

Reimplemented from Compiler::Parser.

bool Compiler::ControlParser::parseWhileBody ( int  keyword,
const TokenLoc loc,
Scanner scanner 
) [private]
void Compiler::ControlParser::reset ( ) [virtual]

Reset parser to clean state.

Reimplemented from Compiler::Parser.


Member Data Documentation


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