Lines Matching refs:token

95   cpp_token *token = _cpp_temp_token (pfile);  in new_string_token()  local
98 token->type = CPP_STRING; in new_string_token()
99 token->val.str.len = len; in new_string_token()
100 token->val.str.text = text; in new_string_token()
101 token->flags = 0; in new_string_token()
102 return token; in new_string_token()
367 const cpp_token *token = arg->first[i]; in stringify_arg() local
369 if (token->type == CPP_PADDING) in stringify_arg()
372 source = token->val.source; in stringify_arg()
376 escape_it = (token->type == CPP_STRING || token->type == CPP_WSTRING in stringify_arg()
377 || token->type == CPP_CHAR || token->type == CPP_WCHAR); in stringify_arg()
381 len = cpp_token_len (token); in stringify_arg()
397 source = token; in stringify_arg()
407 len = cpp_spell_token (pfile, token, buf, true) - buf; in stringify_arg()
412 dest = cpp_spell_token (pfile, token, dest, true); in stringify_arg()
414 if (token->type == CPP_OTHER && token->val.str.text[0] == '\\') in stringify_arg()
513 rhs = FIRST (context).token++; in paste_all_tokens()
582 const cpp_token *token; in collect_args() local
619 token = cpp_get_token (pfile); in collect_args()
621 if (token->type == CPP_PADDING) in collect_args()
627 else if (token->type == CPP_OPEN_PAREN) in collect_args()
629 else if (token->type == CPP_CLOSE_PAREN) in collect_args()
634 else if (token->type == CPP_COMMA) in collect_args()
642 else if (token->type == CPP_EOF in collect_args()
643 || (token->type == CPP_HASH && token->flags & BOL)) in collect_args()
646 arg->first[ntokens++] = token; in collect_args()
665 while (token->type != CPP_CLOSE_PAREN && token->type != CPP_EOF); in collect_args()
667 if (token->type == CPP_EOF) in collect_args()
713 const cpp_token *token, *padding = NULL; in funlike_invocation_p() local
717 token = cpp_get_token (pfile); in funlike_invocation_p()
718 if (token->type != CPP_PADDING) in funlike_invocation_p()
721 || (!(padding->flags & PREV_WHITE) && token->val.source == NULL)) in funlike_invocation_p()
722 padding = token; in funlike_invocation_p()
725 if (token->type == CPP_OPEN_PAREN) in funlike_invocation_p()
733 if (token->type != CPP_EOF || token == &pfile->eof) in funlike_invocation_p()
921 cpp_token *token = _cpp_temp_token (pfile); in replace_args() local
922 token->type = (*paste_flag)->type; in replace_args()
923 token->val = (*paste_flag)->val; in replace_args()
925 token->flags = (*paste_flag)->flags | PASTE_LEFT; in replace_args()
927 token->flags = (*paste_flag)->flags & ~PASTE_LEFT; in replace_args()
928 *paste_flag = token; in replace_args()
998 FIRST (context).token = first; in _cpp_push_token_context()
999 LAST (context).token = first + count; in _cpp_push_token_context()
1043 const cpp_token *token; in expand_arg() local
1052 token = cpp_get_token (pfile); in expand_arg()
1054 if (token->type == CPP_EOF) in expand_arg()
1057 arg->expanded[arg->expanded_count++] = token; in expand_arg()
1106 else if (FIRST (context).token != LAST (context).token) in cpp_get_token()
1109 result = FIRST (context).token++; in cpp_get_token()
1226 FIRST (pfile->context).token--; in _cpp_backup_tokens()
1329 const cpp_token *token = _cpp_lex_token (pfile); in parse_params() local
1331 switch (token->type) in parse_params()
1336 if (token->type == CPP_COMMENT in parse_params()
1342 cpp_token_as_text (pfile, token)); in parse_params()
1354 if (_cpp_save_parameter (pfile, macro, token->val.node)) in parse_params()
1391 token = _cpp_lex_token (pfile); in parse_params()
1392 if (token->type == CPP_CLOSE_PAREN) in parse_params()
1418 cpp_token *token, *saved_cur_token; in lex_expansion_token() local
1422 token = _cpp_lex_direct (pfile); in lex_expansion_token()
1426 if (token->type == CPP_NAME in lex_expansion_token()
1427 && (token->val.node->flags & NODE_MACRO_ARG) != 0) in lex_expansion_token()
1429 token->type = CPP_MACRO_ARG; in lex_expansion_token()
1430 token->val.arg_no = token->val.node->value.arg_index; in lex_expansion_token()
1433 && (token->type == CPP_STRING || token->type == CPP_CHAR)) in lex_expansion_token()
1434 check_trad_stringification (pfile, macro, &token->val.str); in lex_expansion_token()
1436 return token; in lex_expansion_token()
1442 cpp_token *token; in create_iso_definition() local
1506 token = lex_expansion_token (pfile, macro); in create_iso_definition()
1509 token = alloc_expansion_token (pfile, macro); in create_iso_definition()
1510 *token = *ctoken; in create_iso_definition()
1517 if (macro->count > 1 && token[-1].type == CPP_HASH && macro->fun_like) in create_iso_definition()
1519 if (token->type == CPP_MACRO_ARG) in create_iso_definition()
1521 token->flags &= ~PREV_WHITE; in create_iso_definition()
1522 token->flags |= STRINGIFY_ARG; in create_iso_definition()
1523 token->flags |= token[-1].flags & PREV_WHITE; in create_iso_definition()
1524 token[-1] = token[0]; in create_iso_definition()
1536 if (token->type == CPP_EOF) in create_iso_definition()
1540 if (token->type == CPP_PASTE) in create_iso_definition()
1545 token = lex_expansion_token (pfile, macro); in create_iso_definition()
1547 if (macro->count == 0 || token->type == CPP_EOF) in create_iso_definition()
1554 token[-1].flags |= PASTE_LEFT; in create_iso_definition()
1557 token = lex_expansion_token (pfile, macro); in create_iso_definition()
1741 cpp_token *token = &macro->exp.tokens[i]; in cpp_macro_definition() local
1743 if (token->type == CPP_MACRO_ARG) in cpp_macro_definition()
1744 len += NODE_LEN (macro->params[token->val.arg_no - 1]); in cpp_macro_definition()
1746 len += cpp_token_len (token); in cpp_macro_definition()
1748 if (token->flags & STRINGIFY_ARG) in cpp_macro_definition()
1750 if (token->flags & PASTE_LEFT) in cpp_macro_definition()
1752 if (token->flags & PREV_WHITE) in cpp_macro_definition()
1805 cpp_token *token = &macro->exp.tokens[i]; in cpp_macro_definition() local
1807 if (token->flags & PREV_WHITE) in cpp_macro_definition()
1809 if (token->flags & STRINGIFY_ARG) in cpp_macro_definition()
1812 if (token->type == CPP_MACRO_ARG) in cpp_macro_definition()
1815 NODE_NAME (macro->params[token->val.arg_no - 1]), in cpp_macro_definition()
1816 NODE_LEN (macro->params[token->val.arg_no - 1])); in cpp_macro_definition()
1817 buffer += NODE_LEN (macro->params[token->val.arg_no - 1]); in cpp_macro_definition()
1820 buffer = cpp_spell_token (pfile, token, buffer, false); in cpp_macro_definition()
1822 if (token->flags & PASTE_LEFT) in cpp_macro_definition()