Added mixins for classes.

This commit is contained in:
Chronos Ouroboros 2019-11-01 18:33:15 -03:00
commit e63b6d494a
7 changed files with 206 additions and 0 deletions

View file

@ -135,6 +135,8 @@ enum EZCCTreeNodeType
AST_StaticArrayStatement,
AST_Property,
AST_FlagDef,
AST_MixinDef,
AST_MixinStmt,
NUM_AST_NODE_TYPES
};
@ -168,6 +170,13 @@ enum EZCCBuiltinType
ZCC_NUM_BUILT_IN_TYPES
};
enum EZCCMixinType
{
ZCC_Mixin_Class,
ZCC_NUM_MIXIN_TYPES
};
enum EZCCExprType
{
#define xx(a,z) PEX_##a,
@ -241,6 +250,13 @@ struct ZCC_Class : ZCC_Struct
PClass *CType() { return static_cast<PClassType *>(Type)->Descriptor; }
};
struct ZCC_MixinDef : ZCC_NamedNode
{
ZCC_TreeNode *Body;
EZCCMixinType MixinType;
};
struct ZCC_Enum : ZCC_NamedNode
{
EZCCBuiltinType EnumType;
@ -568,6 +584,11 @@ struct ZCC_FlagStmt : ZCC_Statement
bool set;
};
struct ZCC_MixinStmt : ZCC_Statement
{
ENamedName MixinName;
};
FString ZCC_PrintAST(ZCC_TreeNode *root);