From 9a46dd0e2e80790d9848c0bbd718932a27c23269 Mon Sep 17 00:00:00 2001 From: Ash Wolf Date: Mon, 7 Nov 2022 03:06:21 +0000 Subject: honk --- includes/compiler/CDecl.h | 127 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 includes/compiler/CDecl.h (limited to 'includes/compiler/CDecl.h') diff --git a/includes/compiler/CDecl.h b/includes/compiler/CDecl.h new file mode 100644 index 0000000..eda8669 --- /dev/null +++ b/includes/compiler/CDecl.h @@ -0,0 +1,127 @@ +#ifndef COMPILER_CDECL_H +#define COMPILER_CDECL_H + +#include "compiler/common.h" +#include "compiler/tokens.h" +#include "compiler/types.h" + +#ifdef __MWERKS__ +#pragma options align=mac68k +#endif + +// named because it's 0xE bytes big (hurr) +typedef struct DeclE { + ObjBase **objlist; + void *x4; + unsigned short x8; + unsigned short xA; + Boolean xC; +} DeclE; + +struct DeclInfo { + Type *thetype; + UInt32 qual; + NameSpace *nspace; + HashNameNode *name; + Object *x10; + NameSpaceObjectList *x14; + void *x18; + void *x1C; + Type *x20; + ENode *x24; + TemplClass *x28; + TemplArg *expltargs; + void *x30; + void *x34; + void *x38; + Boolean x3C; + Boolean x3D; + short x3E; + short storageclass; + UInt8 section; + UInt8 exportflags; + Boolean x44; + Boolean x45; + Boolean x46; + Boolean x47; + Boolean x48; + Boolean x49; + Boolean x4A; + Boolean x4B; + Boolean x4C; + Boolean x4D; + Boolean x4E; + Boolean x4F; + Boolean x50; + Boolean x51; + Boolean has_expltargs; + Boolean x53; + Boolean x54; + Boolean x55; + Boolean x56; + Boolean x57; + FileOffsetInfo fileoffsetinfo; +}; + +typedef struct BigDeclInfo { + DeclInfo declinfo; + DeclInfo declinfo2; + Boolean xCC; + Boolean xCD; +} BigDeclInfo; + +extern AccessType global_access; +extern FileOffsetInfo member_fileoffset; + +extern Type *CDecl_NewStructType(SInt32 size, SInt16 align); +extern Type *CDecl_NewArrayType(Type *type, SInt32 size); +extern Type *CDecl_NewPointerType(Type *type); +extern Type *CDecl_NewRefPointerType(Type *type); +extern Type *CDecl_NewTemplDepType(TypeTemplDepType tdt); +extern void CDecl_SetResultReg(TypeFunc *tfunc); +extern void CDecl_SetFuncFlags(TypeFunc *tfunc, UInt32 flags); +extern void CDecl_NewConvFuncType(DeclInfo *declinfo); +extern void CDecl_CompleteType(Type *type); +extern Boolean IsCompleteType(Type *type); +extern Boolean CanAllocObject(Type *type); +extern Boolean CanCreateObject(Type *type); +extern void makethetypepointer(DeclInfo *declinfo, UInt32 qual); +extern void CDecl_AddThisPointerArgument(TypeFunc *tfunc, TypeClass *tclass); +extern void CDecl_MakePTMFuncType(TypeFunc *tfunc); +extern void CDecl_AddArgument(TypeFunc *tfunc, Type *argtype); +extern Boolean CDecl_CheckArrayIntegr(Type *type); +extern void CDecl_ParseDirectFuncDecl(DeclInfo *declinfo); +extern void makememberpointertype(DeclInfo *declinfo, TypeClass *tclass, UInt32 qual); +extern void CDecl_ScanPointer(DeclInfo *declinfo, NameSpace *nspace, Boolean flag); +extern void scandeclarator(DeclInfo *declinfo); +extern void conversion_type_name(DeclInfo *declinfo); +extern void MergeDefaultArgs(FuncArg *a, FuncArg *b); +extern void CheckDefaultArgs(FuncArg *args); +extern Object *CDecl_GetFunctionObject(DeclInfo *declinfo, NameSpace *nspace, Boolean *pflag, Boolean someotherflag); +extern void CDecl_TypedefDeclarator(DeclInfo *declinfo); +extern Boolean CDecl_FunctionDeclarator(DeclInfo *declinfo, NameSpace *nspace, Boolean flag, Boolean flag2); +extern void CDecl_ScanDeclarator(DeclInfo *declinfo); +extern void scandeclaratorlist(DeclInfo *declinfo); +extern void CDecl_ComputeUnderlyingEnumType(TypeEnum *tenum); +extern void scanenum(DeclInfo *declinfo); +extern void CDecl_ScanStructDeclarator(BigDeclInfo *bde); +extern void scanstruct(DeclInfo *declinfo, short structtype); +extern void CDecl_ExtractClassExportFlags(DeclInfo *declinfo, UInt8 flags); +extern TypeMethod *CDecl_MakeTypeMemberFunc(TypeFunc *tfunc, TypeClass *tclass, Boolean flag); +extern void CDecl_PackDeclInfo(PackedDeclInfo *packed, DeclInfo *declinfo); +extern void CDecl_UnpackDeclInfo(DeclInfo *declinfo, PackedDeclInfo *packed); +extern void CDecl_AddFriend(TypeClass *tclass, Object *friendfunc, TypeClass *friendclass); +extern void CDecl_CheckCtorIntegrity(FuncArg *args, TypeClass *tclass); +extern void CDecl_MakeVBaseList(TypeClass *tclass); +extern Boolean CDecl_CheckNewBase(TypeClass *a, TypeClass *b, Boolean flag); +extern TypeMethod *CDecl_MakeDefaultDtorType(TypeClass *tclass, Boolean is_virtual); +extern void CDecl_CompleteClass(DeclE *decle, TypeClass *tclass); +extern TypeClass *CDecl_DefineClass(NameSpace *nspace, HashNameNode *name, TypeClass *tclass, short mode, Boolean flag2, Boolean flag3); +extern void CDecl_ParseClassDeclSpec(UInt8 *declspec); +extern void CDecl_ParseClass(DeclInfo *declinfo, short mode, Boolean flag1, UInt8 class_declspec); + +#ifdef __MWERKS__ +#pragma options align=reset +#endif + +#endif -- cgit v1.2.3