summaryrefslogtreecommitdiff
path: root/includes/compiler/CScope.h
blob: d19a655a5c516f3ad850977d0949567037a88c23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#ifndef COMPILER_CSCOPE_H
#define COMPILER_CSCOPE_H

#include "compiler/common.h"

#ifdef __MWERKS__
#pragma options align=mac68k
#endif

extern Boolean cscope_is_member_func;
extern Object *cscope_currentfunc;
extern TypeClass *cscope_currentclass;
extern NameSpace *cscope_current;
extern NameSpace *cscope_root;

struct CScopeSave {
    NameSpace *current;
    TypeClass *currentclass;
    Object *currentfunc;
    Boolean is_member_func;
}; // assumed name

typedef struct NameResult {
    NameSpace *nspace_0;
    HashNameNode *name_4;
    Type *type;
    UInt32 qual;
    ObjBase *obj_10;
    NameSpaceObjectList *nsol_14;
    BClassList *bcl_18;
    Boolean x1C;
    Boolean x1D;
    Boolean isambig;
    Boolean x1F;
    Boolean x20;
    Boolean x21;
} NameResult;

typedef struct CScopeNSIterator {
    NameSpace *nspace;
    NameSpaceLookupList *lookup;
    NameResult *result;
} CScopeNSIterator;

typedef struct CScopeObjectIterator {
    NameSpace *nspace;
    NameSpaceName *nextname;
    NameSpaceObjectList *currlist;
    int hashindex;
} CScopeObjectIterator;

extern void CScope_Setup(void);
extern void CScope_Cleanup(void);
extern void CScope_GetScope(CScopeSave *save);
extern void CScope_SetNameSpaceScope(NameSpace *nspace, CScopeSave *save);
extern void CScope_SetClassScope(TypeClass *cls, CScopeSave *save);
extern void CScope_SetClassDefScope(TypeClass *cls, CScopeSave *save);
extern void CScope_SetFunctionScope(Object *function, CScopeSave *save);
extern void CScope_SetMethodScope(Object *function, TypeClass *cls, Boolean is_static, CScopeSave *save);
extern void CScope_RestoreScope(CScopeSave *saved);
extern Boolean CScope_IsEmptySymTable(void);
extern Boolean CScope_IsInLocalNameSpace(NameSpace *nspace);
extern NameSpaceObjectList *CScope_FindName(NameSpace *nspace, HashNameNode *name);
extern NameSpaceName *CScope_FindNameSpaceName(NameSpace *nspace, HashNameNode *name);
extern NameSpaceObjectList *CScope_InsertName(NameSpace *nspace, HashNameNode *name);
extern NameSpaceObjectList *CScope_ArgumentDependentNameLookup(NameSpaceObjectList *list, HashNameNode *name, ENodeList *argNodes, Boolean flag);
extern NameSpace *CScope_NewHashNameSpace(HashNameNode *name);
extern NameSpace *CScope_NewListNameSpace(HashNameNode *name, Boolean is_global);
extern NameSpace *CScope_FindNonClassNonFunctionNS(NameSpace *nspace);
extern NameSpace *CScope_FindGlobalNS(NameSpace *nspoce);
extern Boolean CScope_IsStdNameSpace(NameSpace *nspace);
extern Boolean CScope_IsEmptyNameSpace(NameSpace *nspace);
extern void CScope_MergeNameSpace(NameSpace *dst, NameSpace *src);
extern void CScope_AddObject(NameSpace *nspace, HashNameNode *name, ObjBase *obj);
extern void CScope_AddGlobalObject(Object *obj);
extern NameSpaceLookupList *CScope_BuildNameSpaceLookupList(NameSpace *nspace);
extern Boolean CScope_FindQualifiedClassMember(NameResult *result, TypeClass *tclass, HashNameNode *name);
extern Type *CScope_GetType(NameSpace *nspace, HashNameNode *name, UInt32 *qual);
extern Type *CScope_GetTagType(NameSpace *nspace, HashNameNode *name);
extern Boolean CScope_ParseExprName(NameResult *result);
extern Boolean CScope_ParseDeclName(NameResult *result);
extern Boolean CScope_ParseQualifiedNameSpace(NameResult *result, Boolean flag1, Boolean flag2);
extern Boolean CScope_ParseElaborateName(NameResult *result);
extern Boolean CScope_FindObject(NameSpace *nspace, NameResult *result, HashNameNode *name);
extern Boolean CScope_FindNonClassObject(NameSpace *nspace, NameResult *result, HashNameNode *name);
extern NameSpaceObjectList *CScope_FindObjectList(NameResult *result, HashNameNode *name);
extern Boolean CScope_PossibleTypeName(HashNameNode *name);
extern Boolean CScope_FindClassMemberObject(TypeClass *tclass, NameResult *result, HashNameNode *name);
extern void CScope_InitObjectIterator(CScopeObjectIterator *iterator, NameSpace *nspace);
extern ObjBase *CScope_NextObjectIteratorObject(CScopeObjectIterator *iterator);
extern NameSpaceObjectList *CScope_NextObjectIteratorObjectList(CScopeObjectIterator *iterator);
extern void CScope_DefineTypeTag(NameSpace *nspace, HashNameNode *name, Type *type);
extern Type *CScope_GetLocalTagType(NameSpace *nspace, HashNameNode *name);
extern Boolean CScope_FindTypeName(NameSpace *nspace, HashNameNode *name, NameResult *result);
extern NameSpaceObjectList *CScope_GetLocalObject(NameSpace *nspace, HashNameNode *name);
extern BClassList *CScope_GetClassAccessPath(BClassList *list, TypeClass *tclass);
extern Boolean CScope_ParseMemberName(TypeClass *tclass, NameResult *result, Boolean flag);
extern void CScope_AddClassUsingDeclaration(TypeClass *tclass, TypeClass *tclass2, HashNameNode *name, AccessType access);
extern void CScope_ParseUsingDeclaration(NameSpace *nspace, AccessType access, Boolean flag);
extern void CScope_ParseNameSpaceAlias(HashNameNode *name);
extern void CScope_ParseUsingDirective(NameSpace *nspace);

#ifdef __MWERKS__
#pragma options align=reset
#endif

#endif