Lines Matching refs:sym
60 register struct ppsymbol* sym; in assert() local
95 if (sym = ppsymref(pp.symtab, pred)) in assert()
96 sym->flags &= ~SYM_PREDICATE; in assert()
108 if (sym = ppsymset(pp.symtab, pred)) in assert()
109 sym->flags |= SYM_PREDICATE; in assert()
162 register struct ppsymbol* sym; in macsym() local
169 sym = pprefmac(pp.token, REF_CREATE); in macsym()
170 if ((sym->flags & SYM_FINAL) && (pp.mode & HOSTED)) return 0; in macsym()
171 if (sym->flags & (SYM_ACTIVE|SYM_READONLY)) in macsym()
174 error(2, "%s: macro is %s", sym->name, (sym->flags & SYM_READONLY) ? "readonly" : "active"); in macsym()
177 if (!sym->macro) sym->macro = newof(0, struct ppmacro, 1, 0); in macsym()
178 return sym; in macsym()
261 register struct ppsymbol* sym; in ppcontrol() local
422 sym = pprefmac(pp.token, REF_IF); in ppcontrol()
431 pp.in->symbol = sym ? sym : pprefmac(pp.token, REF_CREATE); in ppcontrol()
437 sym = 0; in ppcontrol()
441 *pp.control |= ((sym != 0) == (directive == IFDEF)) ? KEPT : SKIP; in ppcontrol()
651 if (!(sym = macsym(c))) in ppcontrol()
655 mac = sym->macro; in ppcontrol()
661 i0 = sym->flags; in ppcontrol()
662 …sym->flags &= ~(SYM_BUILTIN|SYM_EMPTY|SYM_FINAL|SYM_FUNCTION|SYM_INIT|SYM_INITIAL|SYM_MULTILINE|SY… in ppcontrol()
665 sym->flags |= SYM_MULTILINE; in ppcontrol()
675 sym->flags |= SYM_FUNCTION; in ppcontrol()
694 else error(2, "%s: formal argument %s ignored", sym->name, pp.token); in ppcontrol()
768 error(1, "%s: macro formal argument expected", sym->name); in ppcontrol()
776 if (sym->flags & SYM_VARIADIC) in ppcontrol()
777 error(2, "%s: %s: duplicate macro formal argument", sym->name, pp.token); in ppcontrol()
778 sym->flags |= SYM_VARIADIC; in ppcontrol()
784 if (sym->flags & SYM_VARIADIC) in ppcontrol()
785 error(2, "%s: %s: macro formal argument cannot follow ...", sym->name, v); in ppcontrol()
787 error(2, "%s: %s: invalid macro formal argument", sym->name, v); in ppcontrol()
795 error(2, "%s: %s: duplicate macro formal argument", sym->name, v); in ppcontrol()
800 error(2, "%s: %s: macro formal argument ignored", sym->name, v); in ppcontrol()
808 error(1, "%s: macro formal argument expected", sym->name); in ppcontrol()
817 if (sym->flags & SYM_VARIADIC) in ppcontrol()
818 error(2, "%s: %s: duplicate macro formal argument", sym->name, pp.token); in ppcontrol()
819 sym->flags |= SYM_VARIADIC; in ppcontrol()
848 error(2, "%s: invalid macro formal argument list", sym->name); in ppcontrol()
856 sym->macro = 0; in ppcontrol()
926 …error(1, "%s: %s: formal should be parenthesized in macro value (t=%x o=%#c c=%#c)", sym->name, pp… in ppcontrol()
937 sym->flags |= SYM_EMPTY; in ppcontrol()
952 if (!(sym->flags & (SYM_FUNCTION|SYM_MULTILINE))) break; in ppcontrol()
954 if (!(sym->flags & SYM_FUNCTION)) break; in ppcontrol()
972 if (sym->flags & SYM_MULTILINE) in ppcontrol()
1046 if ((sym->flags & SYM_FUNCTION) && (pp.state & (COMPATIBILITY|TRANSITION))) in ppcontrol()
1089 if (sym->flags & SYM_MULTILINE) in ppcontrol()
1102 error(2, "%s: missing #%s", sym->name, dirname(ENDMAC)); in ppcontrol()
1193 …if ((i0 & SYM_FUNCTION) != (sym->flags & SYM_FUNCTION) || old.arity != mac->arity || !streq(old.va… in ppcontrol()
1228 error(1, "%s redefined", sym->name); in ppcontrol()
1239 else if (!pp.truncate) ppfsm(FSM_MACRO, sym->name); in ppcontrol()
1241 …if ((pp.option & (DEFINITIONS|PREDEFINITIONS|REGUARD)) && !sym->hidden && !(sym->flags & SYM_MULTI… in ppcontrol()
1244 ppprintf("#%s %s", dirname(DEFINE), sym->name); in ppcontrol()
1245 if (sym->flags & SYM_FUNCTION) in ppcontrol()
1288 if (pp.mode & BUILTIN) sym->flags |= SYM_BUILTIN; in ppcontrol()
1289 if (pp.option & FINAL) sym->flags |= SYM_FINAL; in ppcontrol()
1290 if (pp.mode & INIT) sym->flags |= SYM_INIT; in ppcontrol()
1291 if (pp.option & INITIAL) sym->flags |= SYM_INITIAL; in ppcontrol()
1292 if (pp.state & NOEXPAND) sym->flags |= SYM_NOEXPAND; in ppcontrol()
1293 if (pp.option & PREDEFINED) sym->flags |= SYM_PREDEFINED; in ppcontrol()
1294 if (pp.mode & READONLY) sym->flags |= SYM_READONLY; in ppcontrol()
1295 …if (pp.macref) (*pp.macref)(sym, error_info.file, n2, mac ? error_info.line - n2 + 1 : REF_UNDEF, … in ppcontrol()
1337 ppfsm(FSM_MACRO, sym->name); in ppcontrol()
1364 error(2, "%s: > omitted in tuple macro definition", sym->name); in ppcontrol()
1411 if (!(sym = macsym(c = pplex()))) goto eatdirective; in ppcontrol()
1414 error(2, "%s: = expected", sym->name); in ppcontrol()
1417 sym->flags &= ~(SYM_BUILTIN|SYM_FUNCTION|SYM_MULTILINE|SYM_PREDEFINED|SYM_VARIADIC); in ppcontrol()
1418 mac = sym->macro; in ppcontrol()
1422 if (!(sym->flags & SYM_REDEFINE) && !sym->hidden) in ppcontrol()
1423 error(1, "%s: redefined", sym->name); in ppcontrol()
1434 ppfsm(FSM_MACRO, sym->name); in ppcontrol()
1446 sym->flags |= SYM_REDEFINE; in ppcontrol()
1746 else if (sym = ppsymset(pp.symtab, pp.token)) in ppcontrol()
1750 sym->flags &= ~SYM_NOTICED; in ppcontrol()
1751 ppfsm(FSM_MACRO, sym->name); in ppcontrol()
1755 if (!sym->hidden && !(sym->hidden = newof(0, struct pphide, 1, 0))) in ppcontrol()
1757 if (!sym->macro) in ppcontrol()
1758 ppfsm(FSM_MACRO, sym->name); in ppcontrol()
1759 if (!sym->hidden->level++) in ppcontrol()
1762 if (sym->macro && !(sym->flags & (SYM_ACTIVE|SYM_READONLY))) in ppcontrol()
1764 sym->hidden->macro = sym->macro; in ppcontrol()
1765 sym->macro = 0; in ppcontrol()
1766 sym->hidden->flags = sym->flags; in ppcontrol()
1767 …sym->flags &= ~(SYM_BUILTIN|SYM_FUNCTION|SYM_INIT|SYM_MULTILINE|SYM_PREDEFINED|SYM_REDEFINE|SYM_VA… in ppcontrol()
1771 else if (sym->hidden) in ppcontrol()
1773 if ((mac = sym->macro) && !(sym->flags & (SYM_ACTIVE|SYM_READONLY))) in ppcontrol()
1778 sym->macro = 0; in ppcontrol()
1779 …sym->flags &= ~(SYM_BUILTIN|SYM_FUNCTION|SYM_INIT|SYM_MULTILINE|SYM_PREDEFINED|SYM_REDEFINE|SYM_VA… in ppcontrol()
1781 if (!--sym->hidden->level) in ppcontrol()
1784 if (sym->hidden->macro) in ppcontrol()
1786 sym->macro = sym->hidden->macro; in ppcontrol()
1787 sym->flags = sym->hidden->flags; in ppcontrol()
1789 free(sym->hidden); in ppcontrol()
1790 sym->hidden = 0; in ppcontrol()
2131 if (!(sym = pprefmac(pp.token, REF_DELETE)) || !sym->macro) in ppcontrol()
2133 if (sym->flags & (SYM_ACTIVE|SYM_READONLY)) in ppcontrol()
2136 error(2, "%s: macro is %s", sym->name, (sym->flags & SYM_READONLY) ? "readonly" : "active"); in ppcontrol()
2160 var.symbol->flags = sym->flags; in ppcontrol()
2161 …sym->flags &= ~(SYM_BUILTIN|SYM_FUNCTION|SYM_INIT|SYM_MULTILINE|SYM_PREDEFINED|SYM_REDEFINE|SYM_VA… in ppcontrol()
2162 var.symbol->macro = sym->macro; in ppcontrol()
2163 sym->macro = 0; in ppcontrol()
2171 if (sym = pprefmac(pp.token, REF_DELETE)) in ppcontrol()
2173 if (mac = sym->macro) in ppcontrol()
2175 if (sym->flags & (SYM_ACTIVE|SYM_READONLY)) in ppcontrol()
2178 error(2, "%s: macro is %s", sym->name, (sym->flags & SYM_READONLY) ? "readonly" : "active"); in ppcontrol()
2184 mac = sym->macro = 0; in ppcontrol()
2186 …if ((pp.option & (DEFINITIONS|PREDEFINITIONS|REGUARD)) && !sym->hidden && !(sym->flags & SYM_MULTI… in ppcontrol()
2189 ppprintf("#%s %s", dirname(UNDEF), sym->name); in ppcontrol()
2192 …sym->flags &= ~(SYM_BUILTIN|SYM_FUNCTION|SYM_INIT|SYM_MULTILINE|SYM_PREDEFINED|SYM_REDEFINE|SYM_VA… in ppcontrol()