- process most of the remaining statement types.
- extend assignment operations to handle local variables (untested.) - make the implicit function arguments read only.
This commit is contained in:
parent
24394dfc92
commit
9f99ca4788
8 changed files with 275 additions and 40 deletions
|
|
@ -85,6 +85,7 @@ struct FCompileContext
|
|||
|
||||
void HandleJumps(int token, FxExpression *handler);
|
||||
void CheckReturn(PPrototype *proto, FScriptPosition &pos);
|
||||
FxLocalVariableDeclaration *FindLocalVariable(FName name);
|
||||
};
|
||||
|
||||
//==========================================================================
|
||||
|
|
@ -198,7 +199,7 @@ struct ExpEmit
|
|||
void Free(VMFunctionBuilder *build);
|
||||
void Reuse(VMFunctionBuilder *build);
|
||||
|
||||
BYTE RegNum, RegType, Konst:1, Fixed:1, Final:1;
|
||||
BYTE RegNum, RegType, Konst:1, Fixed:1, Final:1, Target:1;
|
||||
};
|
||||
|
||||
//==========================================================================
|
||||
|
|
@ -964,6 +965,24 @@ public:
|
|||
ExpEmit Emit(VMFunctionBuilder *build);
|
||||
};
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// FxLocalVariable
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
class FxLocalVariable : public FxExpression
|
||||
{
|
||||
public:
|
||||
FxLocalVariableDeclaration *Variable;
|
||||
bool AddressRequested;
|
||||
|
||||
FxLocalVariable(FxLocalVariableDeclaration*, const FScriptPosition&);
|
||||
FxExpression *Resolve(FCompileContext&);
|
||||
bool RequestAddress(bool *writable);
|
||||
ExpEmit Emit(VMFunctionBuilder *build);
|
||||
};
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// FxSelf
|
||||
|
|
@ -1382,13 +1401,15 @@ public:
|
|||
class FxLocalVariableDeclaration : public FxExpression
|
||||
{
|
||||
friend class FxCompoundStatement;
|
||||
friend class FxLocalVariable;
|
||||
|
||||
FName Name;
|
||||
FxExpression *Init;
|
||||
int VarFlags;
|
||||
public:
|
||||
int RegNum = -1;
|
||||
|
||||
FxLocalVariableDeclaration(PType *type, FName name, FxExpression *initval, const FScriptPosition &p);
|
||||
FxLocalVariableDeclaration(PType *type, FName name, FxExpression *initval, int varflags, const FScriptPosition &p);
|
||||
FxExpression *Resolve(FCompileContext&);
|
||||
ExpEmit Emit(VMFunctionBuilder *build);
|
||||
void Release(VMFunctionBuilder *build);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue