- 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 276 additions and 263 deletions
|
|
@ -41,6 +41,9 @@
|
|||
*/
|
||||
|
||||
#include "m_random.h"
|
||||
#include "sc_man.h"
|
||||
#include "s_sound.h"
|
||||
#include "actor.h"
|
||||
|
||||
|
||||
#define CHECKRESOLVED() if (isresolved) return this; isresolved=true;
|
||||
|
|
@ -58,14 +61,15 @@ class FxJumpStatement;
|
|||
//
|
||||
//
|
||||
//==========================================================================
|
||||
struct FScriptPosition;
|
||||
|
||||
struct FCompileContext
|
||||
{
|
||||
TArray<FxJumpStatement *> Jumps;
|
||||
PPrototype *ReturnProto;
|
||||
PClassActor *Class;
|
||||
PClass *Class;
|
||||
|
||||
FCompileContext(PClassActor *cls = nullptr, PPrototype *ret = nullptr);
|
||||
FCompileContext(PClass *cls = nullptr, PPrototype *ret = nullptr);
|
||||
|
||||
PSymbol *FindInClass(FName identifier);
|
||||
PSymbol *FindGlobal(FName identifier);
|
||||
|
|
@ -1175,7 +1179,6 @@ public:
|
|||
class FxDamageValue : public FxExpression
|
||||
{
|
||||
FxExpression *val;
|
||||
VMScriptFunction *MyFunction;
|
||||
|
||||
public:
|
||||
|
||||
|
|
@ -1184,8 +1187,6 @@ public:
|
|||
FxExpression *Resolve(FCompileContext&);
|
||||
|
||||
ExpEmit Emit(VMFunctionBuilder *build);
|
||||
VMScriptFunction *GetFunction() const { return MyFunction; }
|
||||
void SetFunction(VMScriptFunction *func) { MyFunction = func; }
|
||||
};
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue