#include <WorldCodeGenerator.h>
|
| WorldCodeGenerator (Engine *engine, std::ostream &output) |
| Constructor. More...
|
|
const InstPtr | FindFirstCall () |
| Finds the first function call. More...
|
|
const InstPtr | FindLastCall () |
| Finds the last function call. More...
|
|
virtual void | ProcessSpecialMetadata (const InstPtr inst, char c, int pos) |
| Processes special metadata in an instruction. More...
|
|
| CodeGenerator (Engine *engine, std::ostream &output, ARGUMENT_ORDER bin_order, ARGUMENT_ORDER call_order) |
| Constructor. More...
|
|
virtual | ~CodeGenerator () |
| Destructor. More...
|
|
LuaLanguage & | GetLanguage () |
| Retrieves the target language. More...
|
|
void | WriteFunctionCall (std::string function_name, std::string param_format, const std::vector< ValuePtr > ¶ms) |
| Writes a function call. More...
|
|
virtual void | Generate (InstVec &insts, const Graph &graph) |
| Generates code from the provided graph and outputs it to stdout. More...
|
|
virtual void | AddOutputLine (std::string line, bool unindent_before=false, bool indent_after=false) |
| Adds a line of code to the current group. More...
|
|
void | WriteTodo (std::string class_name, std::string instruction) |
| Writes a comment line indicating an unimplemented opcode. More...
|
|
void | WriteAssignment (ValuePtr dst, ValuePtr src) |
| Generate an assignment statement. More...
|
|
void | AddArg (ValuePtr arg) |
| Add an argument to the argument list. More...
|
|
virtual void | ProcessSpecialMetadata (const InstPtr inst, char c, int pos) |
| Process a single character of metadata. More...
|
|
virtual ValueList | GetArgList () |
| Retrieves the argument list. More...
|
|
virtual ARGUMENT_ORDER | GetBinaryOrder () |
| Retrieves the order of operands for binary operations. More...
|
|
◆ WorldCodeGenerator()
WorldCodeGenerator::WorldCodeGenerator |
( |
Engine * |
engine, |
|
|
std::ostream & |
output |
|
) |
| |
Constructor.
- Parameters
-
[in] | engine | The engine. |
[out] | output | The generated script. |
◆ ConstructFuncSignature()
std::string WorldCodeGenerator::ConstructFuncSignature |
( |
const Function & |
function | ) |
|
|
protectedvirtual |
Constructs the function signature.
The function signature is the LUA function declaration, and it looks like this:
function_name = function(self)
- Parameters
-
[in] | function | The function to construct the signature for. |
- Returns
- The function signature.
Reimplemented from CodeGenerator.
◆ FindFirstCall()
const InstPtr WorldCodeGenerator::FindFirstCall |
( |
| ) |
|
Finds the first function call.
- Returns
- A pointer to the first call instruction.
◆ FindLastCall()
const InstPtr WorldCodeGenerator::FindLastCall |
( |
| ) |
|
Finds the last function call.
- Returns
- A pointer to the last call instruction.
◆ ProcessSpecialMetadata()
void WorldCodeGenerator::ProcessSpecialMetadata |
( |
const InstPtr |
inst, |
|
|
char |
c, |
|
|
int |
pos |
|
) |
| |
|
virtual |
Processes special metadata in an instruction.
- Parameters
-
[in] | inst | The instruction to process. |
[in] | c | |
[in] | pos | |
- Todo:
- understand and document.
Reimplemented from CodeGenerator.
The documentation for this class was generated from the following files: