OpenMW
|
Collection of compiler extensions. More...
#include <extensions.hpp>
Classes | |
struct | Function |
struct | Instruction |
Public Member Functions | |
Extensions () | |
int | searchKeyword (const std::string &keyword) const |
bool | isFunction (int keyword, char &returnType, std::string &argumentType, bool explicitReference) const |
bool | isInstruction (int keyword, std::string &argumentType, bool explicitReference) const |
Is this keyword registered with a function? If yes, return argument types. | |
void | registerFunction (const std::string &keyword, char returnType, const std::string &argumentType, int code, int codeExplicit=-1) |
void | registerInstruction (const std::string &keyword, const std::string &argumentType, int code, int codeExplicit=-1) |
void | generateFunctionCode (int keyword, std::vector< Interpreter::Type_Code > &code, Literals &literals, const std::string &id, int optionalArguments) const |
Append code for function to code. | |
void | generateInstructionCode (int keyword, std::vector< Interpreter::Type_Code > &code, Literals &literals, const std::string &id, int optionalArguments) const |
Append code for function to code. | |
void | listKeywords (std::vector< std::string > &keywords) const |
Append all known keywords to \æ kaywords. | |
Private Attributes | |
int | mNextKeywordIndex |
std::map< std::string, int > | mKeywords |
std::map< int, Function > | mFunctions |
std::map< int, Instruction > | mInstructions |
Collection of compiler extensions.
void Compiler::Extensions::generateFunctionCode | ( | int | keyword, |
std::vector< Interpreter::Type_Code > & | code, | ||
Literals & | literals, | ||
const std::string & | id, | ||
int | optionalArguments | ||
) | const |
Append code for function to code.
void Compiler::Extensions::generateInstructionCode | ( | int | keyword, |
std::vector< Interpreter::Type_Code > & | code, | ||
Literals & | literals, | ||
const std::string & | id, | ||
int | optionalArguments | ||
) | const |
Append code for function to code.
bool Compiler::Extensions::isFunction | ( | int | keyword, |
char & | returnType, | ||
std::string & | argumentType, | ||
bool | explicitReference | ||
) | const |
Is this keyword registered with a function? If yes, return return and argument types.
bool Compiler::Extensions::isInstruction | ( | int | keyword, |
std::string & | argumentType, | ||
bool | explicitReference | ||
) | const |
Is this keyword registered with a function? If yes, return argument types.
void Compiler::Extensions::listKeywords | ( | std::vector< std::string > & | keywords | ) | const |
Append all known keywords to \æ kaywords.
void Compiler::Extensions::registerFunction | ( | const std::string & | keyword, |
char | returnType, | ||
const std::string & | argumentType, | ||
int | code, | ||
int | codeExplicit = -1 |
||
) |
Register a custom function
void Compiler::Extensions::registerInstruction | ( | const std::string & | keyword, |
const std::string & | argumentType, | ||
int | code, | ||
int | codeExplicit = -1 |
||
) |
Register a custom instruction
int Compiler::Extensions::searchKeyword | ( | const std::string & | keyword | ) | const |
Return extension keyword code, that is assigned to the string keyword.
std::map<int, Function> Compiler::Extensions::mFunctions [private] |
std::map<int, Instruction> Compiler::Extensions::mInstructions [private] |
std::map<std::string, int> Compiler::Extensions::mKeywords [private] |
int Compiler::Extensions::mNextKeywordIndex [private] |