added class pointer casts. Due to grammar problems the type has to be put into parentheses to get the class token out of the global parsing namespace:

class<Actor> myclass = (class<Actor>)(GetClass());
This commit is contained in:
Christoph Oelckers 2016-11-17 20:31:53 +01:00
commit 3bcd85eb8a
8 changed files with 167 additions and 0 deletions

View file

@ -258,6 +258,7 @@ enum EFxType
EFX_JumpStatement,
EFX_ReturnStatement,
EFX_ClassTypeCast,
EFX_ClassPtrCast,
EFX_StateByIndex,
EFX_RuntimeStateIndex,
EFX_MultiNameState,
@ -1668,6 +1669,25 @@ public:
ExpEmit Emit(VMFunctionBuilder *build);
};
//==========================================================================
//
//
//
//==========================================================================
class FxClassPtrCast : public FxExpression
{
PClass *desttype;
FxExpression *basex;
public:
FxClassPtrCast(PClass *dtype, FxExpression *x);
~FxClassPtrCast();
FxExpression *Resolve(FCompileContext&);
ExpEmit Emit(VMFunctionBuilder *build);
};
//==========================================================================
//
// Only used to resolve the old jump by index feature of DECORATE