mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-06-03 18:31:36 +00:00
- separated the code generation from the DECORATE parser and cleaned up the interface to the code generator. Most importantly, the VMScriptFunctions are now preallocated when being added to the list of functions to compile and will be filled in later by the code generator. This allowed the removal of some ugly maintenance code.
This commit is contained in:
parent
59ed26c0b6
commit
a72fbb771f
16 changed files with 287 additions and 274 deletions
|
@ -26,7 +26,7 @@ public:
|
|||
VMFunctionBuilder(bool checkself = false);
|
||||
~VMFunctionBuilder();
|
||||
|
||||
VMScriptFunction *MakeFunction();
|
||||
void MakeFunction(VMScriptFunction *func);
|
||||
|
||||
// Returns the constant register holding the value.
|
||||
int GetConstantInt(int val);
|
||||
|
@ -87,4 +87,34 @@ private:
|
|||
|
||||
};
|
||||
|
||||
void DumpFunction(FILE *dump, VMScriptFunction *sfunc, const char *label, int labellen);
|
||||
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
class FxExpression;
|
||||
|
||||
class FFunctionBuildList
|
||||
{
|
||||
struct Item
|
||||
{
|
||||
PClass *Class = nullptr;
|
||||
FxExpression *Code = nullptr;
|
||||
PPrototype *Proto = nullptr;
|
||||
VMScriptFunction *Function = nullptr;
|
||||
FString DumpName;
|
||||
int type; // temporary kludge
|
||||
};
|
||||
|
||||
TArray<Item> mItems;
|
||||
|
||||
public:
|
||||
VMFunction *AddFunction(PClass *cls, FxExpression *code, const FString &name, bool statecall = false);
|
||||
void Build();
|
||||
};
|
||||
|
||||
extern FFunctionBuildList FunctionBuildList;
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue