Lines Matching refs:sym

130 	struct symbol *sym = lookup_symbol(ident, NS_MACRO | NS_UNDEF);  in lookup_macro()  local
131 if (sym && sym->namespace != NS_MACRO) in lookup_macro()
132 sym = NULL; in lookup_macro()
133 return sym; in lookup_macro()
139 struct symbol *sym = lookup_macro(token->ident); in token_defined() local
140 if (sym) { in token_defined()
141 sym->used_in = file_scope; in token_defined()
166 struct symbol *sym = lookup_symbol(token->ident, NS_SYMBOL); in replace_with_has_builtin() local
167 replace_with_bool(token, sym && sym->builtin); in replace_with_has_builtin()
172 struct symbol *sym = lookup_symbol(token->ident, NS_KEYWORD); in replace_with_has_attribute() local
173 replace_with_bool(token, sym && sym->op && sym->op->attribute); in replace_with_has_attribute()
225 struct symbol *sym; in expand_one_symbol() local
230 sym = lookup_macro(token->ident); in expand_one_symbol()
231 if (!sym) in expand_one_symbol()
234 if (sym->expander) { in expand_one_symbol()
235 sym->expander(token); in expand_one_symbol()
238 sym->used_in = file_scope; in expand_one_symbol()
239 return expand(list, sym); in expand_one_symbol()
755 static int expand(struct token **list, struct symbol *sym) in expand() argument
761 int nargs = sym->arglist ? sym->arglist->count.normal : 0; in expand()
769 if (sym->arglist) { in expand()
772 if (!collect_arguments(token->next, sym->arglist, args, token)) in expand()
780 tail = substitute(list, sym->expansion, args); in expand()
1483 struct symbol *sym; in do_define() local
1490 sym = lookup_symbol(name, NS_MACRO | NS_UNDEF); in do_define()
1491 if (sym) { in do_define()
1494 if (attr < sym->attr) in do_define()
1497 clean = (attr == sym->attr && sym->namespace == NS_MACRO); in do_define()
1499 if (token_list_different(sym->expansion, expansion) || in do_define()
1500 token_list_different(sym->arglist, arglist)) { in do_define()
1503 || sym->used_in == file_scope) { in do_define()
1506 info(sym->pos, "this was the original definition"); in do_define()
1512 if (!sym || sym->scope != file_scope) { in do_define()
1513 sym = alloc_symbol(pos, SYM_NODE); in do_define()
1514 bind_symbol(sym, name, NS_MACRO); in do_define()
1520 sym->expansion = expansion; in do_define()
1521 sym->arglist = arglist; in do_define()
1526 sym->namespace = NS_MACRO; in do_define()
1527 sym->used_in = NULL; in do_define()
1528 sym->attr = attr; in do_define()
1627 struct symbol *sym; in do_handle_undef() local
1634 sym = lookup_symbol(left->ident, NS_MACRO | NS_UNDEF); in do_handle_undef()
1635 if (sym) { in do_handle_undef()
1636 if (attr < sym->attr) in do_handle_undef()
1638 if (attr == sym->attr && sym->namespace == NS_UNDEF) in do_handle_undef()
1643 if (!sym || sym->scope != file_scope) { in do_handle_undef()
1644 sym = alloc_symbol(left->pos, SYM_NODE); in do_handle_undef()
1645 bind_symbol(sym, left->ident, NS_MACRO); in do_handle_undef()
1648 sym->namespace = NS_UNDEF; in do_handle_undef()
1649 sym->used_in = NULL; in do_handle_undef()
1650 sym->attr = attr; in do_handle_undef()
2185 struct symbol *sym; in init_preprocessor() local
2186 sym = create_symbol(stream, normal[i].name, SYM_PREPROCESSOR, NS_PREPROCESSOR); in init_preprocessor()
2187 sym->handler = normal[i].handler; in init_preprocessor()
2188 sym->normal = 1; in init_preprocessor()
2191 struct symbol *sym; in init_preprocessor() local
2192 sym = create_symbol(stream, special[i].name, SYM_PREPROCESSOR, NS_PREPROCESSOR); in init_preprocessor()
2193 sym->handler = special[i].handler; in init_preprocessor()
2194 sym->normal = 0; in init_preprocessor()
2197 struct symbol *sym; in init_preprocessor() local
2198 sym = create_symbol(stream, dynamic[i].name, SYM_NODE, NS_MACRO); in init_preprocessor()
2199 sym->expander = dynamic[i].expander; in init_preprocessor()
2215 struct symbol *sym = lookup_symbol(token->ident, NS_PREPROCESSOR); in handle_preprocessor_line() local
2216 if (sym) { in handle_preprocessor_line()
2217 handler = sym->handler; in handle_preprocessor_line()
2218 is_normal = sym->normal; in handle_preprocessor_line()
2354 static void dump_macro(struct symbol *sym) in dump_macro() argument
2356 int nargs = sym->arglist ? sym->arglist->count.normal : 0; in dump_macro()
2360 printf("#define %s", show_ident(sym->ident)); in dump_macro()
2361 token = sym->arglist; in dump_macro()
2379 token = sym->expansion; in dump_macro()
2408 struct symbol *sym = lookup_macro(name); in dump_macro_definitions() local
2409 if (sym) in dump_macro_definitions()
2410 dump_macro(sym); in dump_macro_definitions()