1 1.1 mrg 2 1.1 mrg /* Compiler implementation of the D programming language 3 1.1 mrg * Copyright (C) 2015-2019 by The D Language Foundation, All Rights Reserved 4 1.1 mrg * written by Michel Fortin 5 1.1 mrg * http://www.digitalmars.com 6 1.1 mrg * Distributed under the Boost Software License, Version 1.0. 7 1.1 mrg * http://www.boost.org/LICENSE_1_0.txt 8 1.1 mrg * https://github.com/dlang/dmd/blob/master/src/dmd/objc.h 9 1.1 mrg */ 10 1.1 mrg 11 1.1 mrg #pragma once 12 1.1 mrg 13 1.1 mrg #include "root/root.h" 14 1.1 mrg #include "root/stringtable.h" 15 1.1 mrg 16 1.1 mrg class Identifier; 17 1.1 mrg class FuncDeclaration; 18 1.1 mrg class ClassDeclaration; 19 1.1 mrg class InterfaceDeclaration; 20 1.1 mrg struct Scope; 21 1.1 mrg class StructDeclaration; 22 1.1 mrg 23 1.1 mrg struct ObjcSelector 24 1.1 mrg { 25 1.1 mrg static StringTable stringtable; 26 1.1 mrg static StringTable vTableDispatchSelectors; 27 1.1 mrg static int incnum; 28 1.1 mrg 29 1.1 mrg const char *stringvalue; 30 1.1 mrg size_t stringlen; 31 1.1 mrg size_t paramCount; 32 1.1 mrg 33 1.1 mrg static void _init(); 34 1.1 mrg 35 1.1 mrg ObjcSelector(const char *sv, size_t len, size_t pcount); 36 1.1 mrg 37 1.1 mrg static ObjcSelector *lookup(const char *s); 38 1.1 mrg static ObjcSelector *lookup(const char *s, size_t len, size_t pcount); 39 1.1 mrg 40 1.1 mrg static ObjcSelector *create(FuncDeclaration *fdecl); 41 1.1 mrg }; 42 1.1 mrg 43 1.1 mrg class Objc 44 1.1 mrg { 45 1.1 mrg public: 46 1.1 mrg static void _init(); 47 1.1 mrg 48 1.1 mrg virtual void setObjc(ClassDeclaration* cd) = 0; 49 1.1 mrg virtual void setObjc(InterfaceDeclaration*) = 0; 50 1.1 mrg virtual void setSelector(FuncDeclaration*, Scope* sc) = 0; 51 1.1 mrg virtual void validateSelector(FuncDeclaration* fd) = 0; 52 1.1 mrg virtual void checkLinkage(FuncDeclaration* fd) = 0; 53 1.1 mrg }; 54