From 6b8d70461b50eb2950a4b9c10d816d1d1700b9df Mon Sep 17 00:00:00 2001 From: tromey Date: Thu, 8 Nov 2001 15:38:10 +0000 Subject: * parse.y (trap_overflow_corner_case): New rule. (unary_expression): Use it. * lex.c (java_init_lex): Don't set minus_seen. (yylex): Don't use minus_seen. Communicate overflow to parser for it to handle. (error_if_numeric_overflow): New function. * parse.h (minus_seen): Removed field. (JAVA_RADIX10_FLAG): New define. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46846 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/java/parse.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'gcc/java/parse.h') diff --git a/gcc/java/parse.h b/gcc/java/parse.h index 220567157d0..b9f4b0f8921 100644 --- a/gcc/java/parse.h +++ b/gcc/java/parse.h @@ -752,8 +752,6 @@ struct parser_ctxt { /* Indicates that a context already contains saved data and that the next save operation will require a new context to be created. */ unsigned saved_data:1; - /* Integral literal overflow */ - unsigned minus_seen:1; /* Report error when true */ unsigned java_error_flag:1; /* @deprecated tag seen */ @@ -914,6 +912,11 @@ struct parser_ctxt { if (CPC_INSTANCE_INITIALIZER_LIST(C)) \ TREE_PURPOSE (CPC_INSTANCE_INITIALIZER_LIST (C)) = (S); +/* This is used by the lexer to communicate with the parser. It is + set on an integer constant if the radix is 10, so that the parser + can correctly diagnose a numeric overflow. */ +#define JAVA_RADIX10_FLAG(NODE) TREE_LANG_FLAG_0(NODE) + #ifndef JC1_LITE void java_complete_class PARAMS ((void)); void java_check_circular_reference PARAMS ((void)); -- cgit v1.2.1