2 /* Compiler implementation of the D programming language
3 * Copyright (C) 2015-2024 by The D Language Foundation, All Rights Reserved
4 * written by Michel Fortin
5 * https://www.digitalmars.com
6 * Distributed under the Boost Software License, Version 1.0.
7 * https://www.boost.org/LICENSE_1_0.txt
8 * https://github.com/dlang/dmd/blob/master/src/dmd/objc.h
13 #include "root/dsystem.h"
14 #include "arraytypes.h"
16 class AggregateDeclaration
;
17 class AttribDeclaration
;
18 class ClassDeclaration
;
19 class FuncDeclaration
;
21 class InterfaceDeclaration
;
27 const char *stringvalue
;
33 static ObjcSelector
*create(FuncDeclaration
*fdecl
);
36 struct ObjcClassDeclaration
41 Identifier
* identifier
;
42 ClassDeclaration
* classDeclaration
;
43 ClassDeclaration
* metaclass
;
44 DArray
<FuncDeclaration
*> methodList
;
46 bool isRootClass() const;
49 struct ObjcFuncDeclaration
51 ObjcSelector
* selector
;
52 VarDeclaration
* selectorParameter
;
61 virtual void setObjc(ClassDeclaration
* cd
) = 0;
62 virtual void setObjc(InterfaceDeclaration
*) = 0;
63 virtual const char *toPrettyChars(ClassDeclaration
*cd
, bool qualifyTypes
) const = 0;
65 virtual void setSelector(FuncDeclaration
*, Scope
* sc
) = 0;
66 virtual void validateSelector(FuncDeclaration
* fd
) = 0;
67 virtual void checkLinkage(FuncDeclaration
* fd
) = 0;
68 virtual bool isVirtual(const FuncDeclaration
*) const = 0;
69 virtual void setAsOptional(FuncDeclaration
*fd
, Scope
*sc
) const = 0;
70 virtual void validateOptional(FuncDeclaration
*fd
) const = 0;
71 virtual ClassDeclaration
* getParent(FuncDeclaration
*, ClassDeclaration
*) const = 0;
72 virtual void addToClassMethodList(FuncDeclaration
*, ClassDeclaration
*) const = 0;
73 virtual AggregateDeclaration
* isThis(FuncDeclaration
* fd
) = 0;
74 virtual VarDeclaration
* createSelectorParameter(FuncDeclaration
*, Scope
*) const = 0;
76 virtual void setMetaclass(InterfaceDeclaration
* id
, Scope
*) const = 0;
77 virtual void setMetaclass(ClassDeclaration
* id
, Scope
*) const = 0;
78 virtual ClassDeclaration
* getRuntimeMetaclass(ClassDeclaration
* cd
) = 0;
80 virtual void addSymbols(AttribDeclaration
*, ClassDeclarations
*, ClassDeclarations
*) const = 0;
81 virtual void addSymbols(ClassDeclaration
*, ClassDeclarations
*, ClassDeclarations
*) const = 0;