Lines Matching refs:sym

37 static void examine_symbol(struct symbol *sym);
68 static inline void show_symbol_tag(FILE *fp, struct symbol *sym) in show_symbol_tag() argument
70 fprintf(fp, "%s\t%s\t%d;\"\t%c\tfile:\n", show_ident(sym->ident), in show_symbol_tag()
71 stream_name(sym->pos.stream), sym->pos.line, (int)sym->kind); in show_symbol_tag()
76 struct symbol *sym; in show_tags() local
91 FOR_EACH_PTR(list, sym) { in show_tags()
92 if (ident == sym->ident && pos.line == sym->pos.line && in show_tags()
93 !strcmp(filename, stream_name(sym->pos.stream))) in show_tags()
96 show_symbol_tag(fp, sym); in show_tags()
97 ident = sym->ident; in show_tags()
98 pos = sym->pos; in show_tags()
99 filename = stream_name(sym->pos.stream); in show_tags()
100 } END_FOR_EACH_PTR(sym); in show_tags()
104 static inline void add_tag(struct symbol *sym) in add_tag() argument
106 if (sym->ident && !sym->visited) { in add_tag()
107 sym->visited = 1; in add_tag()
108 add_symbol(&taglist, sym); in add_tag()
114 struct symbol *sym; in examine_members() local
116 FOR_EACH_PTR(list, sym) { in examine_members()
117 sym->kind = 'm'; in examine_members()
118 examine_symbol(sym); in examine_members()
119 } END_FOR_EACH_PTR(sym); in examine_members()
122 static void examine_symbol(struct symbol *sym) in examine_symbol() argument
124 struct symbol *base = sym; in examine_symbol()
126 if (!sym || sym->visited) in examine_symbol()
128 if (sym->ident && sym->ident->reserved) in examine_symbol()
130 if (sym->type == SYM_KEYWORD || sym->type == SYM_PREPROCESSOR) in examine_symbol()
133 add_tag(sym); in examine_symbol()
134 base = sym->ctype.base_type; in examine_symbol()
136 switch (sym->type) { in examine_symbol()
139 sym->kind = 'f'; in examine_symbol()
143 sym->kind = 's'; in examine_symbol()
144 examine_members(sym->symbol_list); in examine_symbol()
147 sym->kind = 'u'; in examine_symbol()
148 examine_members(sym->symbol_list); in examine_symbol()
151 sym->kind = 'e'; in examine_symbol()
157 examine_symbol(sym->ctype.base_type); in examine_symbol()
163 die("unknown symbol %s namespace:%d type:%d\n", show_ident(sym->ident), in examine_symbol()
164 sym->namespace, sym->type); in examine_symbol()
166 if (!sym->kind) in examine_symbol()
167 sym->kind = 'v'; in examine_symbol()
171 static void examine_namespace(struct symbol *sym) in examine_namespace() argument
173 if (sym->visited) in examine_namespace()
175 if (sym->ident && sym->ident->reserved) in examine_namespace()
178 switch(sym->namespace) { in examine_namespace()
183 sym->kind = 'l'; in examine_namespace()
187 sym->kind = 'd'; in examine_namespace()
190 sym->kind = 't'; in examine_namespace()
193 examine_symbol(sym); in examine_namespace()
196 die("unknown namespace %d symbol:%s type:%d\n", sym->namespace, in examine_namespace()
197 show_ident(sym->ident), sym->type); in examine_namespace()
199 add_tag(sym); in examine_namespace()
204 struct symbol *sym; in examine_symbol_list() local
208 FOR_EACH_PTR(list, sym) { in examine_symbol_list()
209 examine_namespace(sym); in examine_symbol_list()
210 } END_FOR_EACH_PTR(sym); in examine_symbol_list()