Lines Matching refs:flags
66 long flags; /* coupled flags */
67 long options; /* uncoupled flags */
341 if (proto->flags & LINESYNC)
361 init(struct proto* proto, char* op, int flags)
365 if (flags & INIT_DEFINE)
486 #define SYNC() do{SYNCIN();SYNCOUT();proto->flags&=~(EXTERN|INIT|OTHER|VARIADIC|VARIADIC2);proto->flags|=flags&(EXTERN|INIT|OTHER|VARIADIC|VARIADIC2);proto->call=call;}while(0)
545 lex(register struct proto* proto, register long flags)
586 if (flags & EXTERN) KEEPOUT();
639 if ((flags & (EXTERN|MATCH)) == EXTERN) BACKOUT();
653 if ((flags & (EXTERN|MATCH)) == EXTERN) BACKOUT();
673 if ((flags & (DECLARE|GLOBAL|RECURSIVE)) == GLOBAL && (proto->flags & MORE))
676 if (!(flags & EXTERN)) /* XXX */
678 flags |= SLIDE;
680 if (!(flags & MATCH))
686 proto->flags |= ERROR;
691 if (flags & MATCH)
704 proto->flags &= ~MORE;
714 proto->flags &= ~MORE;
720 if (!(flags & RECURSIVE) && (state = rp[c = EOF]))
753 if (!(flags & DIRECTIVE))
787 if (flags & CLASSIC) PUTCHR(c);
803 lex(proto, (flags & GLOBAL) | RECURSIVE);
840 if ((flags & EXTERN) && *proto->tp == 's' && !strncmp(proto->tp, "static", 6))
855 if (flags & EXTERN)
863 if (flags & DIRECTIVE)
866 if (flags & CLASSIC)
868 if (flags & EXTERN) BACKOUT();
869 if (flags & JUNK)
876 flags &= ~(DEFINE|DIRECTIVE|IDID|INDIRECT|JUNK|MATCH|SHARP|TYPEDEF);
881 if ((flags & (DEFINE|SHARP)) == (DEFINE|SHARP))
915 flags &= ~(DEFINE|DIRECTIVE|IDID|INDIRECT|MATCH|OTHER|SHARP|SKIP|TOKENS|TYPEDEF);
922 if (paren == 0 && (flags & (MATCH|RECURSIVE|SKIP|SLIDE)) == SLIDE)
925 if (flags & EXTERN) BACKOUT();
951 if (!(flags & DECLARE)) switch (RESERVED(*proto->tp, *(ip - 1), ip - proto->tp))
961 if (!(flags & RECURSIVE) && (flags & (DIRECTIVE|TOKENS)) != DIRECTIVE && !strncmp(proto->tp, "else", 4))
972 if (!(flags & RECURSIVE) && !strncmp(proto->tp, "for", 3))
982 if (!strncmp(proto->tp, "inline", 6) && !(flags & (MATCH|SKIP|TOKENS|TYPEDEF)) && proto->brace == 0 && paren == 0 && group == 0 && (last == ';' || last == '}' || last == '\n' || last == 0))
984 flags |= SKIP;
992 if (!(flags & RECURSIVE) && !strncmp(proto->tp, "return", 6))
1002 flags |= EXTERNALIZE;
1006 if (!(flags & RECURSIVE) && !strncmp(proto->tp, "typedef", 7))
1008 flags |= TYPEDEF;
1018 if (flags & (CLASSIC|PLUSONLY|INIT_DEFINE|INIT_INCLUDE)) c = T_VOID;
1023 if (lex(proto, (flags & GLOBAL) | RECURSIVE) == '*')
1036 if (!(flags & RECURSIVE) && !strncmp(proto->tp, "while", 5))
1044 if ((flags & CLASSIC) && c != T_EXTERN)
1055 if ((flags & (EXTERN|MATCH)) == EXTERN)
1095 if (!(flags & (INIT_DEFINE|INIT_INCLUDE|RECURSIVE)))
1097 if (!(flags & DIRECTIVE)) switch (c)
1101 if (!(flags & CLASSIC) || proto->brace == 0)
1107 if (!(flags & CLASSIC) || group <= 1)
1114 else if (flags & INDIRECT) call++;
1115 flags |= MATCH;
1126 flags &= ~MATCH;
1129 else if (flags & INDIRECT)
1134 else if ((flags & (MATCH|TOKENS)) == MATCH)
1143 flags &= ~MATCH;
1147 else if ((flags & MATCH) && sub == 1 && *nns(ip) != '*')
1149 flags &= ~MATCH;
1153 flags &= ~TOKENS;
1158 if (!(flags & CLASSIC) || proto->brace == 0)
1163 if (flags & CLASSIC)
1175 else if (paren == 1 && (flags & INDIRECT) && !aie)
1184 flags |= INDIRECT;
1191 if (proto->brace == 0 && paren == 0 && last != '=' && (flags & (CLASSIC|DECLARE|DIRECTIVE|MATCH|PLUSONLY|SKIP|TOKENS)) == (MATCH|TOKENS) && ((dir & DIR) != DIR_en || ((dir>>2) & DIR) != DIR_if))
1192 flags |= DIRECTIVE;
1193 else if (!(flags & (DECLARE|DIRECTIVE)))
1195 flags |= DIRECTIVE;
1196 if (!(flags & PLUSONLY))
1211 else if ((flags & (CLASSIC|EXTERN)) == CLASSIC)
1224 flags |= JUNK|MATCH;
1244 flags |= JUNK|MATCH;
1290 flags |= DEFINE|MATCH;
1304 flags |= DEFINE|MATCH;
1319 if (last == '=') flags |= INIT;
1321 else if (flags & CLASSIC)
1323 if ((flags & (MATCH|OTHER|SKIP)) == MATCH)
1363 if (flags & EXTERN)
1414 if (flags & EXTERN)
1487 else if ((flags & EXTERN) && (op == om || *(op - 1) == ' ') && *ie == 'r' && !strncmp(ie, "register", 8) && (*(ie + 8) == ' ' || *(ie + 8) == '\t' || *(ie + 8) == '\n'))
1497 if (flags & EXTERN)
1510 flags &= ~(MATCH|SKIP);
1514 else if ((flags & (MATCH|PLUSONLY|SKIP|TOKENS)) == (MATCH|TOKENS))
1522 flags &= ~(MATCH|SKIP);
1523 if (flags & VARIADIC)
1531 flags |= SKIP;
1538 switch (lex(proto, (flags & GLOBAL) | RECURSIVE))
1553 if (flags & MATCH)
1555 flags &= ~(MATCH|SKIP);
1565 if (flags & MATCH)
1567 flags &= ~(MATCH|SKIP);
1578 flags |= MATCH;
1591 if (!(flags & SKIP))
1593 flags |= SKIP;
1600 lex(proto, (flags & GLOBAL) | DECLARE);
1607 if (flags & EXTERNALIZE) memcpy(proto->ox, "extern", 6);
1609 if (flags & DIRECTIVE)
1615 else if (!(flags & VARIADIC)) PUTCHR('{');
1618 flags &= ~(IDID|INDIRECT|MATCH|OTHER|SKIP);
1623 flags &= ~(IDID|INDIRECT|MATCH|OTHER|SKIP|TOKENS);
1626 flags &= ~(INIT|VARIADIC|VARIADIC2);
1628 if (flags & EXTERN) BACKOUT();
1636 if (last == '?') flags |= DIRECTIVE;
1637 else if (paren == 0 && (flags & (INIT|MATCH|SKIP)) == MATCH)
1639 if (last == ')' && proto->brace && (group != 2 || call != 2)) flags |= SKIP;
1645 if (flags & CLASSIC)
1651 flags &= ~MATCH;
1656 if (paren == 0 && (flags & DECLARE)) *(op - 1) = c = ';';
1660 if (flags & INIT) /* ignore */;
1662 else if (flags & CLASSIC)
1666 if ((flags & MATCH) && last == ')')
1667 flags &= ~MATCH;
1668 if (!(flags & MATCH))
1672 flags &= ~SKIP;
1673 if (flags & EXTERN) BACKOUT();
1674 if (flags & SLIDE)
1683 if ((flags & (EXTERN|SKIP)) == (EXTERN|SKIP))
1691 if ((flags & (MATCH|OTHER|SKIP)) == MATCH && call > 1)
1693 if ((flags & MANGLE) && func)
1701 if ((flags & (DECLARE|INDIRECT)) == INDIRECT && aim && aie < im)
1708 if (v == aie || !(flags & PLUSPLUS))
1710 if (flags & PLUSPLUS) n = 3;
1721 if (flags & PLUSPLUS) memcopy(aom, "(...))", 6);
1736 else if (flags & TYPEDEF)
1749 if (flags & OTHER)
1751 else if (flags & PLUSPLUS)
1754 if (!(flags & TOKENS)) op = strcopy(op, "(...)");
1760 if (flags & DECLARE) op = strcopy(om, "()");
1761 else if (!(flags & TOKENS)) op = strcopy(om, "(__VARARG__)");
1768 if (flags & EXTERNALIZE) memcpy(proto->ox, "extern", 6);
1771 flags &= ~(MATCH|VARIADIC|VARIADIC2);
1772 if (c == ',' && !(flags & INDIRECT))
1779 else if (flags & (OTHER|SKIP)) call = 0;
1782 flags &= ~(EXTERNALIZE|MANGLE|TOKENS|TYPEDEF);
1784 if (flags & SLIDE)
1792 flags &= ~(IDID|INDIRECT|MATCH|OTHER|SKIP);
1794 else if (paren == 1 && group == 1 && !(flags & (IDID|MANGLE))) flags |= TOKENS|OTHER;
1798 flags |= TOKENS|SKIP;
1802 if (flags & CLASSIC)
1805 flags |= SKIP;
1809 if (paren == 0 && !(flags & TYPEDEF))
1811 flags |= MANGLE;
1812 if (!(flags & PLUSONLY) || proto->package)
1827 if (paren == 0 && (flags & (DECLARE|VARIADIC)) == DECLARE)
1833 if (paren == 1 && !(flags & SKIP))
1834 flags |= VARIADIC;
1835 flags |= TOKENS;
1840 if ((flags & (PLUSONLY|VARIADIC)) == VARIADIC)
1842 flags &= ~MATCH;
1848 switch (lex(proto, (flags & GLOBAL) | RECURSIVE))
1854 if (!(flags & MATCH))
1856 flags |= MATCH;
1867 if (flags & MATCH)
1880 flags &= ~MATCH;
1886 switch (lex(proto, (flags & GLOBAL) | RECURSIVE))
1894 if (flags & MATCH)
1896 flags &= ~MATCH;
1897 if (!(flags & VARIADIC2))
1920 if (flags & MATCH)
1922 flags &= ~MATCH;
1923 if (!(flags & VARIADIC2))
1948 flags |= MATCH;
1959 flags |= VARIADIC2;
1968 if (flags & CLASSIC)
1978 if (proto->brace == 0 && !(flags & DECLARE)) flags |= SKIP;
1981 else if ((flags & SKIP) || c == T_ID || c == T_VOID) call++;
1982 else flags |= SKIP;
1983 if (last == T_ID) flags |= IDID;
1986 flags |= TOKENS;
2043 if ((flags & CLASSIC) && paren == 0 && group <= 2) flags |= SKIP;
2049 if (flags & CLASSIC) break;
2051 flags |= TOKENS;
2052 if (paren == 0) flags |= OTHER;
2055 else if (c == '#' && *ip != '(') flags |= SHARP;
2058 if ((flags & (EXTERN|MATCH)) == (EXTERN|MATCH) && ((flags & (DIRECTIVE|SKIP)) || proto->brace || c != '(' && c != ')' && c != '*' && c != T_ID))
2065 else if (flags & (INIT_DEFINE|INIT_INCLUDE))
2068 if ((flags & YACC) && c == '%' && *ip == '{') t = 0;
2089 op = init(proto, op, flags);
2091 flags &= ~(INIT_DEFINE|INIT_INCLUDE);
2092 proto->flags &= ~(INIT_DEFINE|INIT_INCLUDE);
2108 if (proto->flags & MORE) close(proto->fd);
2125 pppopen(char* file, int fd, char* notice, char* options, char* package, char* comment, int flags)
2146 if (flags & PROTO_CLASSIC) flags &= ~PROTO_INCLUDE;
2148 if (flags & PROTO_RETAIN) flags &= ~retain;
2183 proto->flags |= MORE;
2208 if (!(proto->flags & MORE))
2259 if (!(flags & PROTO_DISABLE) || (flags & PROTO_NOPRAGMA))
2275 proto->flags |= YACC;
2310 if (flags & PROTO_PLUSPLUS) proto->flags |= PLUSPLUS;
2311 if (flags & PROTO_TEST) proto->test = 1;
2312 if (flags & PROTO_EXTERNALIZE) proto->options |= EXTERNALIZE;
2314 if (flags & PROTO_CLASSIC) pragma = -pragma;
2315 if (flags & PROTO_DISABLE) pragma = 0;
2316 if (flags & PROTO_LINESYNC) proto->flags |= LINESYNC;
2317 if (!(proto->flags & YACC) && file && (m = strlen(file)) > 2 && file[--m] == 'y' && file[--m] == '.')
2318 proto->flags |= YACC;
2322 if (flags & PROTO_PLUSPLUS)
2324 flags &= ~(PROTO_HEADER|PROTO_INCLUDE);
2325 proto->flags |= PLUSONLY;
2327 else if (!(flags & (PROTO_FORCE|PROTO_PASS)))
2332 else if ((flags & (PROTO_FORCE|PROTO_PASS)) == PROTO_PASS || !pragma)
2334 proto->flags |= PASS;
2335 if (proto->flags & MORE)
2357 if (!(flags & PROTO_CLASSIC) && !(proto->flags & YACC))
2375 if (notice || options || (flags & (PROTO_HEADER|PROTO_INCLUDE)))
2386 if (flags & PROTO_INCLUDE)
2388 proto->flags |= INIT_INCLUDE;
2389 if (flags & PROTO_RETAIN)
2392 else if (flags & PROTO_HEADER)
2394 if (flags & PROTO_RETAIN) retain |= PROTO_HEADER;
2396 if (flags & PROTO_CLASSIC)
2406 proto->flags |= INIT_DEFINE;
2409 if (!(flags & PROTO_CLASSIC))
2411 if (proto->flags & YACC)
2424 else if (proto->flags & (INIT_DEFINE|INIT_INCLUDE))
2425 proto->op = init(proto, proto->op, proto->flags);
2433 if (flags & PROTO_CLASSIC)
2435 proto->flags |= CLASSIC;
2436 if (!(flags & PROTO_HEADER)) proto->flags |= EXTERN;
2453 if (proto->flags & PASS)
2460 else if (!(proto->flags & MORE)) n = 0;
2463 proto->flags &= ~MORE;
2471 if (proto->flags & ERROR) return -1;
2473 if (proto->flags & YACC)
2482 if (!(proto->flags & MORE)) n = 0;
2486 proto->flags &= ~MORE;
2491 if (proto->flags & YACCSPLIT)
2493 proto->flags &= ~YACCSPLIT;
2497 if (proto->flags & YACC2) proto->flags &= ~YACC;
2498 else proto->flags |= YACC2;
2501 if (proto->flags & YACC)
2510 if (proto->flags & YACC2) proto->flags &= ~YACC;
2511 else proto->flags |= YACC2;
2517 proto->flags |= YACCSPLIT;
2528 lex(proto, proto->flags);
2529 if ((proto->flags & (ERROR|MORE)) == ERROR)
2551 if (proto->flags & MORE)
2553 proto->flags &= ~MORE;