OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
Compiler::ScriptParser Class Reference

#include <scriptparser.hpp>

Inheritance diagram for Compiler::ScriptParser:
Collaboration diagram for Compiler::ScriptParser:

Public Member Functions

 ScriptParser (ErrorHandler &errorHandler, const Context &context, Locals &locals, bool end=false)
 
void getCode (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)
 
virtual void parseEOF (Scanner &scanner)
 Handle EOF token. More...
 
void reset ()
 Reset parser to clean state. More...
 
- Public Member Functions inherited from Compiler::Parser
 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)
 
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...
 

Private Attributes

Output mOutput
 
LineParser mLineParser
 
ControlParser mControlParser
 
bool mEnd
 

Additional Inherited Members

- Protected Member Functions inherited from Compiler::Parser
void reportSeriousError (const std::string &message, const TokenLoc &loc)
 Report the error and throw a exception. More...
 
void reportWarning (const std::string &message, const TokenLoc &loc)
 Report the warning without throwing an exception. More...
 
void reportEOF ()
 Report an unexpected EOF condition. More...
 
ErrorHandlergetErrorHandler ()
 Return error handler. More...
 
const ContextgetContext () const
 Return context. More...
 
- Static Protected Member Functions inherited from Compiler::Parser
static std::string toLower (const std::string &name)
 

Constructor & Destructor Documentation

Compiler::ScriptParser::ScriptParser ( ErrorHandler errorHandler,
const Context context,
Locals locals,
bool  end = false 
)
Parameters
endof script is marked by end keyword.

Member Function Documentation

void Compiler::ScriptParser::getCode ( std::vector< Interpreter::Type_Code > &  code) const

store generated code in code.

Here is the call graph for this function:

Here is the caller graph for this function:

void Compiler::ScriptParser::parseEOF ( Scanner scanner)
virtual

Handle EOF token.

Reimplemented from Compiler::Parser.

Here is the call graph for this function:

bool Compiler::ScriptParser::parseKeyword ( int  keyword,
const TokenLoc loc,
Scanner scanner 
)
virtual

Handle a keyword token.

Returns
fetch another token?
Todo:
add an option to disable this nonsense

Reimplemented from Compiler::Parser.

Here is the call graph for this function:

Here is the caller graph for this function:

bool Compiler::ScriptParser::parseName ( const std::string &  name,
const TokenLoc loc,
Scanner scanner 
)
virtual

Handle a name token.

Returns
fetch another token?

Reimplemented from Compiler::Parser.

Here is the call graph for this function:

bool Compiler::ScriptParser::parseSpecial ( int  code,
const TokenLoc loc,
Scanner scanner 
)
virtual

Handle a special character token.

Returns
fetch another token?
Todo:
Option to switch this off

Reimplemented from Compiler::Parser.

Here is the call graph for this function:

void Compiler::ScriptParser::reset ( )
virtual

Reset parser to clean state.

Reimplemented from Compiler::Parser.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

ControlParser Compiler::ScriptParser::mControlParser
private
bool Compiler::ScriptParser::mEnd
private
LineParser Compiler::ScriptParser::mLineParser
private
Output Compiler::ScriptParser::mOutput
private

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