* c-lex.c (c_lex): Remove CPP_INT, CPP_FLOAT cases.
* c-parse.in (yyerror, _yylex): Similarly.
* cppexp.c (parse_number, parse_defined, lex, _cpp_parse_expr):
Don't use CPP_INT, CPP_FLOAT; CPP_NUMBER is enough.
Update comments.
* cpplib.h (CPP_INT, CPP_FLOAT): Remove.
* cp/spew.c (read_token, yyerror): Remove CPP_INT, CPP_FLOAT cases.
From-SVN: r44144
+2001-07-19 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * c-lex.c (c_lex): Remove CPP_INT, CPP_FLOAT cases.
+ * c-parse.in (yyerror, _yylex): Similarly.
+ * cppexp.c (parse_number, parse_defined, lex, _cpp_parse_expr):
+ Don't use CPP_INT, CPP_FLOAT; CPP_NUMBER is enough.
+ Update comments.
+ * cpplib.h (CPP_INT, CPP_FLOAT): Remove.
+ * cp/spew.c (read_token, yyerror): Remove CPP_INT, CPP_FLOAT cases.
+
2001-07-18 Jeff Sturm <jsturm@one-point.com>
* dwarf2out.c (dwarf2out_abstract_function): Don't emit
*value = HT_IDENT_TO_GCC_IDENT (HT_NODE (tok.val.node));
break;
- case CPP_INT:
- case CPP_FLOAT:
case CPP_NUMBER:
*value = lex_number ((const char *)tok.val.str.text, tok.val.str.len);
break;
else if (last_token == CPP_STRING
|| last_token == CPP_WSTRING)
error ("%s before string constant", string);
- else if (last_token == CPP_NUMBER
- || last_token == CPP_INT
- || last_token == CPP_FLOAT)
+ else if (last_token == CPP_NUMBER)
error ("%s before numeric constant", string);
else if (last_token == CPP_NAME)
error ("%s before \"%s\"", string, IDENTIFIER_POINTER (yylval.ttype));
case CPP_NAME:
return yylexname ();
- case CPP_INT:
- case CPP_FLOAT:
case CPP_NUMBER:
case CPP_CHAR:
case CPP_WCHAR:
+2001-07-19 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * spew.c (read_token, yyerror): Remove CPP_INT, CPP_FLOAT cases.
+
2001-07-18 Mark Mitchell <mark@codesourcery.com>
* class.c (type_requires_array_cookie): New function.
t->yychar = read_process_identifier (&t->yylval);
break;
- case CPP_INT:
- case CPP_FLOAT:
case CPP_NUMBER:
case CPP_CHAR:
case CPP_WCHAR:
else if (last_token == CPP_STRING
|| last_token == CPP_WSTRING)
error ("%s before string constant", string);
- else if (last_token == CPP_NUMBER
- || last_token == CPP_INT
- || last_token == CPP_FLOAT)
+ else if (last_token == CPP_NUMBER)
error ("%s before numeric constant", string);
else if (last_token == CPP_NAME)
{
#define SYNTAX_ERROR2(msgid, arg) \
do { cpp_error (pfile, msgid, arg); goto syntax_error; } while(0)
-/* Parse and convert an integer for #if. Accepts decimal, hex, or octal
- with or without size suffixes. */
struct suffix
{
unsigned char s[4];
};
#define Nsuff(tab) (sizeof tab / sizeof (struct suffix))
+/* Parse and convert an integer for #if. Accepts decimal, hex, or
+ octal with or without size suffixes. Returned op is CPP_ERROR on
+ error, otherwise it is a CPP_NUMBER. */
+
static struct op
parse_number (pfile, tok)
cpp_reader *pfile;
}
op.value = n;
- op.op = CPP_INT;
+ op.op = CPP_NUMBER;
return op;
invalid_suffix:
{
op.value = node->type == NT_MACRO;
op.unsignedp = 0;
- op.op = CPP_INT;
+ op.op = CPP_NUMBER;
/* No macros? At top of file? */
if (pfile->mi_state == MI_OUTSIDE && pfile->mi_cmacro == 0
return op;
}
-/* Read one token. */
+/* Read a token. The returned type is CPP_NUMBER for a valid number
+ (an interpreted preprocessing number or character constant, or the
+ result of the "defined" or "#" operators), CPP_ERROR on error,
+ CPP_EOF, or the type of an operator token. */
static struct op
lex (pfile, skip_evaluation, token)
switch (token->type)
{
- case CPP_INT:
case CPP_NUMBER:
return parse_number (pfile, token);
/* This is always a signed type. */
op.unsignedp = 0;
- op.op = CPP_INT;
+ op.op = CPP_NUMBER;
op.value = cpp_interpret_charconst (pfile, token, 1, 0, &chars_seen);
return op;
}
case CPP_WSTRING:
SYNTAX_ERROR ("string constants are not valid in #if");
- case CPP_FLOAT:
- SYNTAX_ERROR ("floating point numbers are not valid in #if");
-
case CPP_OTHER:
if (ISGRAPH (token->val.c))
SYNTAX_ERROR2 ("invalid character '%c' in #if", token->val.c);
&& (token->val.node == pfile->spec_nodes.n_true
|| token->val.node == pfile->spec_nodes.n_false))
{
- op.op = CPP_INT;
+ op.op = CPP_NUMBER;
op.unsignedp = 0;
op.value = (token->val.node == pfile->spec_nodes.n_true);
could become macros in the future). */
pfile->mi_state = MI_FAILED;
- op.op = CPP_INT;
+ op.op = CPP_NUMBER;
op.unsignedp = 0;
op.value = 0;
{
int temp;
- op.op = CPP_INT;
+ op.op = CPP_NUMBER;
if (_cpp_test_assertion (pfile, &temp))
op.op = CPP_ERROR;
op.unsignedp = 0;
case CPP_ERROR:
goto syntax_error;
push_immediate:
- case CPP_INT:
+ case CPP_NUMBER:
/* Push a value onto the stack. */
if (top->flags & HAVE_VALUE)
SYNTAX_ERROR ("missing binary operator");
OP(CPP_ATSIGN, "@") /* used in Objective C */ \
\
TK(CPP_NAME, SPELL_IDENT) /* word */ \
- TK(CPP_INT, SPELL_STRING) /* 23 */ \
- TK(CPP_FLOAT, SPELL_STRING) /* 3.14159 */ \
TK(CPP_NUMBER, SPELL_STRING) /* 34_be+ta */ \
\
TK(CPP_CHAR, SPELL_STRING) /* 'char' */ \