summaryrefslogtreecommitdiff
path: root/includes/compiler/CScope.h
blob: 7a4c3de2728821d685de4b853d3de7ea8481dde3 (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
108
#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

// this might be called NameResult
typedef struct CScopeParseResult {
    NameSpace *nspace_0;
    HashNameNode *name_4;
    Type *x8;
    UInt32 xC; // qual
    ObjBase *obj_10;
    NameSpaceObjectList *nsol_14;
    BClassList *bcl_18;
    Boolean x1C;
    Boolean x1D;
    Boolean isambig;
    Boolean x1F;
    Boolean x20;
    Boolean x21;
} CScopeParseResult;

typedef struct CScopeNSIterator {
    NameSpace *nspace;
    NameSpaceLookupList *lookup;
    CScopeParseResult *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(CScopeParseResult *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(CScopeParseResult *result);
extern Boolean CScope_ParseDeclName(CScopeParseResult *result);
extern Boolean CScope_ParseQualifiedNameSpace(CScopeParseResult *result, Boolean flag1, Boolean flag2);
extern Boolean CScope_ParseElaborateName(CScopeParseResult *result);
extern Boolean CScope_FindObject(NameSpace *nspace, CScopeParseResult *result, HashNameNode *name);
extern Boolean CScope_FindNonClassObject(NameSpace *nspace, CScopeParseResult *result, HashNameNode *name);
extern NameSpaceObjectList *CScope_FindObjectList(CScopeParseResult *result, HashNameNode *name);
extern Boolean CScope_PossibleTypeName(HashNameNode *name);
extern Boolean CScope_FindClassMemberObject(TypeClass *tclass, CScopeParseResult *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, CScopeParseResult *result);
extern NameSpaceObjectList *CScope_GetLocalObject(NameSpace *nspace, HashNameNode *name);
extern BClassList *CScope_GetClassAccessPath(BClassList *list, TypeClass *tclass);
extern Boolean CScope_ParseMemberName(TypeClass *tclass, CScopeParseResult *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