Lines Matching refs:token

293 /* The following local token type is used.  */
298 /* More information about the type of a CPP_NAME token. */
310 /* A single C token after string literal concatenation and conversion
314 /* The kind of token. */
316 /* If this token is a CPP_NAME, this value indicates whether also
319 /* If this token is a keyword, this value indicates which keyword.
322 /* If this token is a CPP_PRAGMA, this indicates the pragma that
325 /* True if this token is from a system header. */
327 /* The value associated with this token, if any. */
329 /* The location at which this token was found. */
360 /* Read in and lex a single token, storing it in *TOKEN. */
363 c_lex_one_token (c_token *token, c_parser *parser)
367 token->type = c_lex_with_flags (&token->value, &token->location, NULL);
368 token->id_kind = C_ID_NONE;
369 token->keyword = RID_MAX;
370 token->pragma_kind = PRAGMA_NONE;
371 token->in_system_header = in_system_header;
373 switch (token->type)
382 if (C_IS_RESERVED_WORD (token->value))
384 enum rid rid_code = C_RID_CODE (token->value);
392 token->value = ridpointers[(int) rid_code];
393 token->type = CPP_KEYWORD;
394 token->keyword = rid_code;
412 token->type = CPP_KEYWORD;
413 token->keyword = rid_code;
422 token->value = ridpointers[(int) rid_code];
423 token->type = CPP_KEYWORD;
424 token->keyword = rid_code;
429 decl = lookup_name (token->value);
434 token->id_kind = C_ID_TYPENAME;
440 tree objc_interface_decl = objc_is_class_name (token->value);
448 token->value = objc_interface_decl;
449 token->id_kind = C_ID_CLASSNAME;
453 token->id_kind = C_ID_ID;
458 token->type = CPP_KEYWORD;
459 token->keyword = C_RID_CODE (token->value);
471 token->pragma_kind = TREE_INT_CST_LOW (token->value);
472 token->value = NULL;
480 /* Return a pointer to the next token from PARSER, reading it in if
497 /* Return true if the next token from PARSER has the indicated
506 /* Return true if the next token from PARSER does not have the
515 /* Return true if the next token from PARSER is the indicated
521 c_token *token;
523 /* Peek at the next token. */
524 token = c_parser_peek_token (parser);
526 return token->keyword == keyword;
532 c_token_starts_typename (c_token *token)
534 switch (token->type)
537 switch (token->id_kind)
550 switch (token->keyword)
587 /* Return true if the next token from PARSER can start a type name,
592 c_token *token = c_parser_peek_token (parser);
593 return c_token_starts_typename (token);
599 c_token_starts_declspecs (c_token *token)
601 switch (token->type)
604 switch (token->id_kind)
617 switch (token->keyword)
661 /* Return true if the next token from PARSER can start declaration
666 c_token *token = c_parser_peek_token (parser);
670 return c_token_starts_declspecs (token)
671 && (token->id_kind != C_ID_CLASSNAME
676 /* Return a pointer to the next-but-one token from PARSER, reading it
677 in if necessary. The next token is already read in. */
695 /* Consume the next token from PARSER. */
709 /* Expect the current token to be a #pragma. Consume it and remember
727 c_parser_set_source_position_from_token (c_token *token)
729 if (token->type != CPP_EOF)
731 input_location = token->location;
732 in_system_header = token->in_system_header;
738 where TOKEN is the next token in the input stream of PARSER.
751 c_token *token = c_parser_peek_token (parser);
758 the token we just peeked at. */
759 c_parser_set_source_position_from_token (token);
764 (token->type == CPP_KEYWORD ? CPP_NAME : token->type),
765 token->value);
768 /* If the next token is of the indicated TYPE, consume it. Otherwise,
790 /* If the next token is the indicated keyword, consume it. Otherwise,
811 desired token is found. An error message is still produced if the
812 next token is not as expected. If MSGID is NULL then a message has
826 /* Skip tokens until the desired token is found. */
829 /* Peek at the next token. */
830 c_token *token = c_parser_peek_token (parser);
831 /* If we've reached the token we want, consume it and stop. */
832 if (token->type == type && !nesting_depth)
839 if (token->type == CPP_EOF)
841 if (token->type == CPP_PRAGMA_EOL && parser->in_pragma)
843 if (token->type == CPP_OPEN_BRACE
844 || token->type == CPP_OPEN_PAREN
845 || token->type == CPP_OPEN_SQUARE)
847 else if (token->type == CPP_CLOSE_BRACE
848 || token->type == CPP_CLOSE_PAREN
849 || token->type == CPP_CLOSE_SQUARE)
854 /* Consume this token. */
870 c_token *token = c_parser_peek_token (parser);
871 if ((token->type == CPP_COMMA || token->type == CPP_SEMICOLON)
875 if (token->type == CPP_EOF)
877 if (token->type == CPP_PRAGMA_EOL && parser->in_pragma)
879 if (token->type == CPP_OPEN_BRACE
880 || token->type == CPP_OPEN_PAREN
881 || token->type == CPP_OPEN_SQUARE)
883 else if (token->type == CPP_CLOSE_BRACE
884 || token->type == CPP_CLOSE_PAREN
885 || token->type == CPP_CLOSE_SQUARE)
890 /* Consume this token. */
908 c_token *token = c_parser_peek_token (parser);
909 if (token->type == CPP_EOF)
911 if (token->type == CPP_PRAGMA_EOL)
933 c_token *token;
935 /* Peek at the next token. */
936 token = c_parser_peek_token (parser);
938 switch (token->type)
949 /* If the next token is a ';', we have reached the
960 /* If the next token is a non-nested '}', then we have
970 /* If it the next token is a '{', then we are entering a new
3599 /* ??? Locating this diagnostic on the token after the
6506 c_token_starts_methodproto (c_token *token)
6508 return token->type == CPP_PLUS
6509 || token->type == CPP_MINUS
6510 || (token->type == CPP_KEYWORD
6511 && (token->keyword == RID_AT_REQUIRED
6512 || token->keyword == RID_AT_OPTIONAL));
6537 c_token *token;
6538 token = c_parser_peek_token (parser);
6539 if (token->type == CPP_KEYWORD
6540 && token->keyword == RID_AT_PROPERTY)
6547 if (c_token_starts_methodproto (token))
6777 c_token *token = c_parser_peek_token (parser);
6778 if (token->type == CPP_KEYWORD
6779 && (token->keyword == RID_IN
6780 || token->keyword == RID_OUT
6781 || token->keyword == RID_INOUT
6782 || token->keyword == RID_BYCOPY
6783 || token->keyword == RID_BYREF
6784 || token->keyword == RID_ONEWAY))
6787 quals = chainon (build_tree_list (NULL_TREE, token->value), quals);
6944 next token is not an objc-selector.
6960 c_token *token = c_parser_peek_token (parser);
6961 tree value = token->value;
6962 if (token->type == CPP_NAME)
6967 if (token->type != CPP_KEYWORD)
6969 switch (token->keyword)
7259 the token is not consumed. Otherwise appropriate pragma_omp_clause is
7260 returned and the token is consumed. */
8481 /* Use local storage to begin. If the first token is a pragma, parse it.