c-lex.c (c_lex): Remove CPP_INT, CPP_FLOAT cases.

* 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
This commit is contained in:
Neil Booth 2001-07-19 06:12:50 +00:00 committed by Neil Booth
parent dbc957f103
commit c60e94a70e
7 changed files with 31 additions and 28 deletions

View File

@ -1,3 +1,13 @@
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

View File

@ -775,8 +775,6 @@ c_lex (value)
*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;

View File

@ -3603,9 +3603,7 @@ yyerror (msgid)
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));
@ -3734,8 +3732,6 @@ _yylex ()
case CPP_NAME:
return yylexname ();
case CPP_INT:
case CPP_FLOAT:
case CPP_NUMBER:
case CPP_CHAR:
case CPP_WCHAR:

View File

@ -1,3 +1,7 @@
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.

View File

@ -340,8 +340,6 @@ read_token (t)
t->yychar = read_process_identifier (&t->yylval);
break;
case CPP_INT:
case CPP_FLOAT:
case CPP_NUMBER:
case CPP_CHAR:
case CPP_WCHAR:
@ -1490,9 +1488,7 @@ yyerror (msgid)
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)
{

View File

@ -61,8 +61,6 @@ struct op
#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];
@ -87,6 +85,10 @@ const struct suffix vsuf_3[] = {
};
#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;
@ -198,7 +200,7 @@ parse_number (pfile, tok)
}
op.value = n;
op.op = CPP_INT;
op.op = CPP_NUMBER;
return op;
invalid_suffix:
@ -263,7 +265,7 @@ parse_defined (pfile)
{
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
@ -281,7 +283,10 @@ parse_defined (pfile)
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)
@ -295,7 +300,6 @@ lex (pfile, skip_evaluation, token)
switch (token->type)
{
case CPP_INT:
case CPP_NUMBER:
return parse_number (pfile, token);
@ -306,7 +310,7 @@ lex (pfile, skip_evaluation, 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;
}
@ -315,9 +319,6 @@ lex (pfile, skip_evaluation, token)
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);
@ -336,7 +337,7 @@ lex (pfile, skip_evaluation, token)
&& (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);
@ -354,7 +355,7 @@ lex (pfile, skip_evaluation, token)
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;
@ -368,7 +369,7 @@ lex (pfile, skip_evaluation, token)
{
int temp;
op.op = CPP_INT;
op.op = CPP_NUMBER;
if (_cpp_test_assertion (pfile, &temp))
op.op = CPP_ERROR;
op.unsignedp = 0;
@ -627,7 +628,7 @@ _cpp_parse_expr (pfile)
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");

View File

@ -124,8 +124,6 @@ struct ht;
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' */ \