Commit 0a2138e2 by Alexandre Petit-Bianco Committed by Alexandre Petit-Bianco

java-tree.h (pop_labeled_block, [...]): New function prototypes.

Wed Oct 14 18:21:29 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
	* java-tree.h (pop_labeled_block, lang_printable_name,
 	maybe_add_interface, set_super_info, get_access_flags_from_decl,
 	interface_of_p, inherits_from_p, fix_classpath,
 	complete_start_java_method, emit_handlers, init_outgoing_cpool,
 	make_class_data, register_class, alloc_name_constant): New
 	function prototypes.
	* lang.c (lang_decode_option): Set argc argument unused. Fixed
 	indentation. Added cast to remove warning.
	(lang_printable_name): Set v argument unused.
	(lang_print_error): Added argument to lang_printable_name call.
	(java_dummy_print, print_lang_decl, print_lang_type,
 	print_lang_identifier, lang_print_xnode): All argument marked
 	unused.
	* lex.c (java_unget_unicode): Removed unnecessary argument.
	(java_allocate_new_line): Unused local variable is gone.
	(java_read_char): Added parenthesis in expressions to remove
 	warnings.  Added final return statement.
	(java_read_unicode): Added parenthesis in expression to remove
 	warning.
	(java_parse_end_comment): Fixed java_unget_unicode invocation.
	(java_parse_escape_sequence): Likewise.
	(java_lex): Unused local variables are gone. Fixed
 	java_unget_unicode invocation.
	* lex.h (set_float_handler): Prototype added when JC1_LITE not
 	defined.
	* parse.h (ERROR_CANT_CONVERT_TO_BOOLEAN): Fixed
 	lang_printable_name invocation in macro.
	(ERROR_CANT_CONVERT_TO_NUMERIC, ERROR_CAST_NEEDED_TO_INTEGRAL):
 	Likewise.
	(duplicate_declaration_error): Suppressed unused argument in
 	prototype.
	(identical_subpath_p): Function declaration is gone.
	(patch_invoke): Suppressed unused argument in prototype.
	(patch_cast, build_labeled_block, check_thrown_exceptions):
 	Likewise.
	* parse.y (setjmp.h): Included
	(toplev.h): Likewise.
	(field_declaration:): Suppressed unused local
	(label_decl:): Fixed build_labeled_block invocation.
	(java_pop_parser_context): Put extra parenthesis around assignment
 	in if.
	(yyerror): Suppressed unused local variables.
	(variable_redefinition_error): Fixed lang_printable_name
 	invocation.
	(create_interface): Suppressed unused local variables.
	(create_class): Likewise.
	(duplicate_declaration_error): Suppressed unused argument. Fixed
 	lang_printable_name invocation.
	(register_fields): Suppressed unused local variable. Fixed
 	duplicate_declaration_error invocation.
	(method_header): Suppressed unused local variable.
	(method_declarator, parser_check_super): Likewise.
	(java_complete_class): Suppressed unused local variable. Fixed
 	fatal error message.
	(complete_class_report_errors): Added default: in switch.
	(java_check_regular_methods): Fixed lang_printable_name
 	invocations.
	(check_throws_clauses): Likewise.
	(java_check_abstract_methods): Suppressed unused local
 	variable. Fixed lang_printable_name invocation.
	(read_import_entry): Added supplemental return statement.
	(read_import_dir): Suppressed unused local variables.
	(check_pkg_class_access, declare_local_variables): Likewise.
	(source_start_java_method): Suppressed unused extern variable
 	declarations
	(expand_start_java_method): Suppressed unused extern and local
 	variable declarations.
	(java_complete_expand_methods): Likewise.
	(java_complete_expand_method): Suppressed unused local variables.
	(make_qualified_name): Likewise.
	(resolve_qualified_expression_name): Added default: in
 	switch. Fixed lang_printable_name invocation.
	(class_instance_creation_expression): Added parenthesis around
 	expressions.
	(patch_method_invocation_stmt): Fixed lang_printable_name and
 	patch_invoke invocations.
	(check_for_static_method_reference): Fixed lang_printable_name
 	invocation.
	(patch_invoke): Suppressed unused arguments and local variables.
	(lookup_method_invoke): Suppressed unused local variables.
	(qualify_ambiguous_name): Added default: in switch.
	(identical_subpath_p): Function removed.
	(patch_assignment): Suppressed unused local variables. Suppressed
 	unnecessary if statement. Fixed lang_printable_name invocations.
	(try_builtin_assignconv): Fixed lang_printable_name invocations.
	(valid_ref_assignconv_cast_p): Parenthesis around
 	expression. Suppressed unused local variables.
	(build_binop): Suppressed unused local variables. fixed
 	lang_printable_name invocations.
	(string_constant_concatenation): Suppressed unused local
 	variables.
	(patch_unaryop): Fixed lang_printable_name invocation.
	(patch_cast): Suppressed unnecessary argument. Fixed
 	lang_printable_name invocation.
	(patch_array_ref): Fixed lang_printable_name invocation.
	(patch_newarray, patch_return, patch_if_else_statement): Likewise.
	(build_labeled_block): Suppressed unused argument.
	(generate_labeled_block): Fixed build_labeled_block invocation.
	(build_loop_body): Suppressed unused local variables.
	(patch_loop_statement): Likewise.
	(patch_exit): Fixed lang_printable_name invocation.
	(patch_switch_statement): Likewise.
	(case_identity): First argument marked unused.
	(patch_try_statement): Fixed lang_printable_name invocations.
	(patch_synchronized_statement, patch_throw_statement): Likewise.
	(check_thrown_exceptions): Fixed check_thrown_exceptions and
 	lang_printable_name invocations.
	(check_thrown_exceptions_do): Suppressed unused argument.
Suppresses warnings during the compilation of parse.y (including
lex.c) and lang.c

From-SVN: r23090
parent c8bcefd8
Wed Oct 14 18:21:29 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
* java-tree.h (pop_labeled_block, lang_printable_name,
maybe_add_interface, set_super_info, get_access_flags_from_decl,
interface_of_p, inherits_from_p, fix_classpath,
complete_start_java_method, emit_handlers, init_outgoing_cpool,
make_class_data, register_class, alloc_name_constant): New
function prototypes.
* lang.c (lang_decode_option): Set argc argument unused. Fixed
indentation. Added cast to remove warning.
(lang_printable_name): Set v argument unused.
(lang_print_error): Added argument to lang_printable_name call.
(java_dummy_print, print_lang_decl, print_lang_type,
print_lang_identifier, lang_print_xnode): All argument marked
unused.
* lex.c (java_unget_unicode): Removed unnecessary argument.
(java_allocate_new_line): Unused local variable is gone.
(java_read_char): Added parenthesis in expressions to remove
warnings. Added final return statement.
(java_read_unicode): Added parenthesis in expression to remove
warning.
(java_parse_end_comment): Fixed java_unget_unicode invocation.
(java_parse_escape_sequence): Likewise.
(java_lex): Unused local variables are gone. Fixed
java_unget_unicode invocation.
* lex.h (set_float_handler): Prototype added when JC1_LITE not
defined.
* parse.h (ERROR_CANT_CONVERT_TO_BOOLEAN): Fixed
lang_printable_name invocation in macro.
(ERROR_CANT_CONVERT_TO_NUMERIC, ERROR_CAST_NEEDED_TO_INTEGRAL):
Likewise.
(duplicate_declaration_error): Suppressed unused argument in
prototype.
(identical_subpath_p): Function declaration is gone.
(patch_invoke): Suppressed unused argument in prototype.
(patch_cast, build_labeled_block, check_thrown_exceptions):
Likewise.
* parse.y (setjmp.h): Included
(toplev.h): Likewise.
(field_declaration:): Suppressed unused local
(label_decl:): Fixed build_labeled_block invocation.
(java_pop_parser_context): Put extra parenthesis around assignment
in if.
(yyerror): Suppressed unused local variables.
(variable_redefinition_error): Fixed lang_printable_name
invocation.
(create_interface): Suppressed unused local variables.
(create_class): Likewise.
(duplicate_declaration_error): Suppressed unused argument. Fixed
lang_printable_name invocation.
(register_fields): Suppressed unused local variable. Fixed
duplicate_declaration_error invocation.
(method_header): Suppressed unused local variable.
(method_declarator, parser_check_super): Likewise.
(java_complete_class): Suppressed unused local variable. Fixed
fatal error message.
(complete_class_report_errors): Added default: in switch.
(java_check_regular_methods): Fixed lang_printable_name
invocations.
(check_throws_clauses): Likewise.
(java_check_abstract_methods): Suppressed unused local
variable. Fixed lang_printable_name invocation.
(read_import_entry): Added supplemental return statement.
(read_import_dir): Suppressed unused local variables.
(check_pkg_class_access, declare_local_variables): Likewise.
(source_start_java_method): Suppressed unused extern variable
declarations
(expand_start_java_method): Suppressed unused extern and local
variable declarations.
(java_complete_expand_methods): Likewise.
(java_complete_expand_method): Suppressed unused local variables.
(make_qualified_name): Likewise.
(resolve_qualified_expression_name): Added default: in
switch. Fixed lang_printable_name invocation.
(class_instance_creation_expression): Added parenthesis around
expressions.
(patch_method_invocation_stmt): Fixed lang_printable_name and
patch_invoke invocations.
(check_for_static_method_reference): Fixed lang_printable_name
invocation.
(patch_invoke): Suppressed unused arguments and local variables.
(lookup_method_invoke): Suppressed unused local variables.
(qualify_ambiguous_name): Added default: in switch.
(identical_subpath_p): Function removed.
(patch_assignment): Suppressed unused local variables. Suppressed
unnecessary if statement. Fixed lang_printable_name invocations.
(try_builtin_assignconv): Fixed lang_printable_name invocations.
(valid_ref_assignconv_cast_p): Parenthesis around
expression. Suppressed unused local variables.
(build_binop): Suppressed unused local variables. fixed
lang_printable_name invocations.
(string_constant_concatenation): Suppressed unused local
variables.
(patch_unaryop): Fixed lang_printable_name invocation.
(patch_cast): Suppressed unnecessary argument. Fixed
lang_printable_name invocation.
(patch_array_ref): Fixed lang_printable_name invocation.
(patch_newarray, patch_return, patch_if_else_statement): Likewise.
(build_labeled_block): Suppressed unused argument.
(generate_labeled_block): Fixed build_labeled_block invocation.
(build_loop_body): Suppressed unused local variables.
(patch_loop_statement): Likewise.
(patch_exit): Fixed lang_printable_name invocation.
(patch_switch_statement): Likewise.
(case_identity): First argument marked unused.
(patch_try_statement): Fixed lang_printable_name invocations.
(patch_synchronized_statement, patch_throw_statement): Likewise.
(check_thrown_exceptions): Fixed check_thrown_exceptions and
lang_printable_name invocations.
(check_thrown_exceptions_do): Suppressed unused argument.
1998-10-14 Tom Tromey <tromey@cygnus.com> 1998-10-14 Tom Tromey <tromey@cygnus.com>
* jcf-write.c (write_classfile): Add output class file as target. * jcf-write.c (write_classfile): Add output class file as target.
......
...@@ -507,6 +507,20 @@ extern void push_labeled_block PROTO ((tree)); ...@@ -507,6 +507,20 @@ extern void push_labeled_block PROTO ((tree));
extern tree prepare_eh_table_type PROTO ((tree)); extern tree prepare_eh_table_type PROTO ((tree));
extern void java_set_exception_lang_code PROTO (()); extern void java_set_exception_lang_code PROTO (());
extern tree generate_name PROTO ((void)); extern tree generate_name PROTO ((void));
extern void pop_labeled_block PROTO (());
extern char *lang_printable_name PROTO ((tree, int));
extern tree maybe_add_interface PROTO ((tree, tree));
extern void set_super_info PROTO ((int, tree, tree, int));
extern int get_access_flags_from_decl PROTO ((tree));
extern int interface_of_p PROTO ((tree, tree));
extern int inherits_from_p PROTO ((tree, tree));
extern void fix_classpath PROTO (());
extern void complete_start_java_method PROTO ((tree));
extern void emit_handlers PROTO (());
extern void init_outgoing_cpool PROTO (());
extern void make_class_data PROTO ((tree));
extern void register_class PROTO (());
extern int alloc_name_constant PROTO ((int, tree));
/* Access flags etc for a method (a FUNCTION_DECL): */ /* Access flags etc for a method (a FUNCTION_DECL): */
......
...@@ -118,7 +118,7 @@ static int dependency_tracking = 0; ...@@ -118,7 +118,7 @@ static int dependency_tracking = 0;
*/ */
int int
lang_decode_option (argc, argv) lang_decode_option (argc, argv)
int argc; int argc __attribute__ ((__unused__));
char **argv; char **argv;
{ {
char *p = argv[0]; char *p = argv[0];
...@@ -132,8 +132,9 @@ lang_decode_option (argc, argv) ...@@ -132,8 +132,9 @@ lang_decode_option (argc, argv)
p += 2; p += 2;
for (j = 0; for (j = 0;
!found && j < sizeof (lang_f_options) / sizeof (lang_f_options[0]); !found
j++) && j < (int)(sizeof (lang_f_options) / sizeof (lang_f_options[0]));
j++)
{ {
if (!strcmp (p, lang_f_options[j].string)) if (!strcmp (p, lang_f_options[j].string))
{ {
...@@ -363,7 +364,7 @@ put_decl_node (node) ...@@ -363,7 +364,7 @@ put_decl_node (node)
char * char *
lang_printable_name (decl, v) lang_printable_name (decl, v)
tree decl; tree decl;
int v; int v __attribute__ ((__unused__));
{ {
decl_bufpos = 0; decl_bufpos = 0;
put_decl_node (decl); put_decl_node (decl);
...@@ -389,7 +390,7 @@ lang_print_error (file) ...@@ -389,7 +390,7 @@ lang_print_error (file)
last_error_function_context = DECL_CONTEXT (current_function_decl); last_error_function_context = DECL_CONTEXT (current_function_decl);
fprintf (stderr, "In class `%s':\n", fprintf (stderr, "In class `%s':\n",
lang_printable_name (last_error_function_context)); lang_printable_name (last_error_function_context, 0));
} }
if (last_error_function != current_function_decl) if (last_error_function != current_function_decl)
{ {
...@@ -451,7 +452,7 @@ lang_init () ...@@ -451,7 +452,7 @@ lang_init ()
function prototypes. */ function prototypes. */
void java_dummy_print (s) void java_dummy_print (s)
char *s; char *s __attribute__ ((__unused__));
{ {
} }
...@@ -493,25 +494,25 @@ lang_identify () ...@@ -493,25 +494,25 @@ lang_identify ()
void void
print_lang_decl (file, node, indent) print_lang_decl (file, node, indent)
FILE *file; FILE *file __attribute ((__unused__));
tree node; tree node __attribute ((__unused__));
int indent; int indent __attribute ((__unused__));
{ {
} }
void void
print_lang_type (file, node, indent) print_lang_type (file, node, indent)
FILE *file; FILE *file __attribute ((__unused__));
tree node; tree node __attribute ((__unused__));
int indent; int indent __attribute ((__unused__));
{ {
} }
void void
print_lang_identifier (file, node, indent) print_lang_identifier (file, node, indent)
FILE *file; FILE *file __attribute ((__unused__));
tree node; tree node __attribute ((__unused__));
int indent; int indent __attribute ((__unused__));
{ {
} }
...@@ -524,8 +525,8 @@ print_lang_statistics () ...@@ -524,8 +525,8 @@ print_lang_statistics ()
void void
lang_print_xnode (file, node, indent) lang_print_xnode (file, node, indent)
FILE *file; FILE *file __attribute ((__unused__));
tree node; tree node __attribute ((__unused__));
int indent; int indent __attribute ((__unused__));
{ {
} }
...@@ -36,6 +36,7 @@ Addison Wesley 1996" (http://java.sun.com/docs/books/jls/html/3.doc.html) */ ...@@ -36,6 +36,7 @@ Addison Wesley 1996" (http://java.sun.com/docs/books/jls/html/3.doc.html) */
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <strings.h>
#include <setjmp.h> #include <setjmp.h>
#ifdef JAVA_LEX_DEBUG #ifdef JAVA_LEX_DEBUG
...@@ -125,8 +126,7 @@ java_sneak_unicode () ...@@ -125,8 +126,7 @@ java_sneak_unicode ()
} }
static void static void
java_unget_unicode (c) java_unget_unicode ()
unicode_t c;
{ {
if (!ctxp->c_line->current) if (!ctxp->c_line->current)
fatal ("can't unget unicode - java_unget_unicode"); fatal ("can't unget unicode - java_unget_unicode");
...@@ -137,7 +137,6 @@ java_unget_unicode (c) ...@@ -137,7 +137,6 @@ java_unget_unicode (c)
void void
java_allocate_new_line () java_allocate_new_line ()
{ {
int i;
unicode_t ahead = (ctxp->c_line ? ctxp->c_line->ahead[0] : '\0'); unicode_t ahead = (ctxp->c_line ? ctxp->c_line->ahead[0] : '\0');
char ahead_escape_p = (ctxp->c_line ? char ahead_escape_p = (ctxp->c_line ?
ctxp->c_line->unicode_escape_ahead_p : 0); ctxp->c_line->unicode_escape_ahead_p : 0);
...@@ -200,25 +199,26 @@ java_read_char () ...@@ -200,25 +199,26 @@ java_read_char ()
return UEOF; return UEOF;
else else
{ {
if (c & 0xe0 == 0xc0) if (c & (0xe0 == 0xc0))
{ {
c1 = GETC (); c1 = GETC ();
if (c1 & 0xc0 == 0x80) if (c1 & (0xc0 == 0x80))
return (unicode_t)(((c &0x1f) << 6) + (c1 & 0x3f)); return (unicode_t)(((c &0x1f) << 6) + (c1 & 0x3f));
} }
else if (c & 0xf0 == 0xe0) else if (c & (0xf0 == 0xe0))
{ {
c1 = GETC (); c1 = GETC ();
if (c1 & 0xc0 == 0x80) if (c1 & (0xc0 == 0x80))
{ {
c2 = GETC (); c2 = GETC ();
if (c2 & 0xc0 == 0x80) if (c2 & (0xc0 == 0x80))
return (unicode_t)(((c & 0xf) << 12) + return (unicode_t)(((c & 0xf) << 12) +
(( c1 & 0x3f) << 6) + (c2 & 0x3f)); (( c1 & 0x3f) << 6) + (c2 & 0x3f));
} }
} }
java_lex_error ("Bad utf8 encoding", 0); java_lex_error ("Bad utf8 encoding", 0);
} }
return 0;
} }
static void static void
...@@ -277,7 +277,7 @@ java_read_unicode (term_context, unicode_escape_p) ...@@ -277,7 +277,7 @@ java_read_unicode (term_context, unicode_escape_p)
if (c >= '0' && c <= '9') if (c >= '0' && c <= '9')
unicode |= (unicode_t)((c-'0') << shift); unicode |= (unicode_t)((c-'0') << shift);
else if ((c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F')) else if ((c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'))
unicode |= (unicode_t)(10+(c | 0x20)-'a' << shift); unicode |= (unicode_t)((10+(c | 0x20)-'a') << shift);
else else
java_lex_error java_lex_error
("Non hex digit in Unicode escape sequence", 0); ("Non hex digit in Unicode escape sequence", 0);
...@@ -364,7 +364,7 @@ java_parse_end_comment () ...@@ -364,7 +364,7 @@ java_parse_end_comment ()
case '/': case '/':
return; return;
case '*': /* reparse only '*' */ case '*': /* reparse only '*' */
java_unget_unicode (c); java_unget_unicode ();
} }
} }
} }
...@@ -413,7 +413,7 @@ java_parse_escape_sequence () ...@@ -413,7 +413,7 @@ java_parse_escape_sequence ()
c = java_get_unicode ()) c = java_get_unicode ())
octal_escape [octal_escape_index++] = c; octal_escape [octal_escape_index++] = c;
java_unget_unicode (c); java_unget_unicode ();
if ((octal_escape_index == 3) && (octal_escape [0] > '3')) if ((octal_escape_index == 3) && (octal_escape [0] > '3'))
{ {
...@@ -448,7 +448,6 @@ java_lex (java_lval) ...@@ -448,7 +448,6 @@ java_lex (java_lval)
YYSTYPE *java_lval; YYSTYPE *java_lval;
{ {
unicode_t c, first_unicode; unicode_t c, first_unicode;
int line_terminator;
int ascii_index, all_ascii; int ascii_index, all_ascii;
char *string; char *string;
...@@ -471,7 +470,7 @@ java_lex (java_lval) ...@@ -471,7 +470,7 @@ java_lex (java_lval)
if ((c = java_get_unicode ()) == UEOF) if ((c = java_get_unicode ()) == UEOF)
return 0; /* Ok here */ return 0; /* Ok here */
else else
java_unget_unicode (c); /* Caught latter at the end the function */ java_unget_unicode (); /* Caught latter at the end the function */
} }
/* Handle EOF here */ /* Handle EOF here */
if (c == UEOF) /* Should probably do something here... */ if (c == UEOF) /* Should probably do something here... */
...@@ -544,7 +543,7 @@ java_lex (java_lval) ...@@ -544,7 +543,7 @@ java_lex (java_lval)
java_lex_error java_lex_error
("Comment not terminated at end of input", 0); ("Comment not terminated at end of input", 0);
java_unget_unicode (c); java_unget_unicode ();
deprecated [deprecated_index] = '\0'; deprecated [deprecated_index] = '\0';
if (!strcmp (deprecated, "deprecated")) if (!strcmp (deprecated, "deprecated"))
{ {
...@@ -555,13 +554,13 @@ java_lex (java_lval) ...@@ -555,13 +554,13 @@ java_lex (java_lval)
} }
} }
else else
java_unget_unicode (c); java_unget_unicode ();
java_parse_end_comment (); java_parse_end_comment ();
goto step1; goto step1;
break; break;
default: default:
java_unget_unicode (c); java_unget_unicode ();
c = '/'; c = '/';
break; break;
} }
...@@ -575,7 +574,6 @@ java_lex (java_lval) ...@@ -575,7 +574,6 @@ java_lex (java_lval)
/* Numeric literals */ /* Numeric literals */
if (JAVA_ASCII_DIGIT (c) || (c == '.')) if (JAVA_ASCII_DIGIT (c) || (c == '.'))
{ {
unicode_t peep;
/* This section of code is borrowed from gcc/c-lex.c */ /* This section of code is borrowed from gcc/c-lex.c */
#define TOTAL_PARTS ((HOST_BITS_PER_WIDE_INT / HOST_BITS_PER_CHAR) * 2 + 2) #define TOTAL_PARTS ((HOST_BITS_PER_WIDE_INT / HOST_BITS_PER_CHAR) * 2 + 2)
int parts[TOTAL_PARTS]; int parts[TOTAL_PARTS];
...@@ -614,7 +612,7 @@ java_lex (java_lval) ...@@ -614,7 +612,7 @@ java_lex (java_lval)
else if (c == '.') else if (c == '.')
{ {
/* Push the '.' back and prepare for a FP parsing... */ /* Push the '.' back and prepare for a FP parsing... */
java_unget_unicode (c); java_unget_unicode ();
c = '0'; c = '0';
} }
else else
...@@ -635,7 +633,7 @@ java_lex (java_lval) ...@@ -635,7 +633,7 @@ java_lex (java_lval)
double_type_node); double_type_node);
return (FP_LIT_TK); return (FP_LIT_TK);
default: default:
java_unget_unicode (c); java_unget_unicode ();
SET_LVAL_NODE_TYPE (integer_zero_node, int_type_node); SET_LVAL_NODE_TYPE (integer_zero_node, int_type_node);
return (INT_LIT_TK); return (INT_LIT_TK);
} }
...@@ -745,7 +743,7 @@ java_lex (java_lval) ...@@ -745,7 +743,7 @@ java_lex (java_lval)
#endif #endif
if (stage != 4) /* Don't push back fF/dD */ if (stage != 4) /* Don't push back fF/dD */
java_unget_unicode (c); java_unget_unicode ();
/* An exponent (if any) must have seen a digit. */ /* An exponent (if any) must have seen a digit. */
if (seen_exponent && !seen_digit) if (seen_exponent && !seen_digit)
...@@ -790,7 +788,7 @@ java_lex (java_lval) ...@@ -790,7 +788,7 @@ java_lex (java_lval)
else if (radix == 16 && !literal_index) else if (radix == 16 && !literal_index)
java_lex_error ("No digit specified for hexadecimal literal", 0); java_lex_error ("No digit specified for hexadecimal literal", 0);
else else
java_unget_unicode (c); java_unget_unicode ();
#ifdef JAVA_LEX_DEBUG #ifdef JAVA_LEX_DEBUG
literal_token [literal_index] = '\0'; /* So JAVA_LEX_LIT is safe. */ literal_token [literal_index] = '\0'; /* So JAVA_LEX_LIT is safe. */
...@@ -965,7 +963,7 @@ java_lex (java_lval) ...@@ -965,7 +963,7 @@ java_lex (java_lval)
variable_declarator: rule, it has to be seen as '=' as opposed variable_declarator: rule, it has to be seen as '=' as opposed
to being seen as an ordinary assignment operator in to being seen as an ordinary assignment operator in
assignment_operators: rule. */ assignment_operators: rule. */
java_unget_unicode (c); java_unget_unicode ();
BUILD_OPERATOR (ASSIGN_TK); BUILD_OPERATOR (ASSIGN_TK);
} }
...@@ -984,17 +982,17 @@ java_lex (java_lval) ...@@ -984,17 +982,17 @@ java_lex (java_lval)
} }
else else
{ {
java_unget_unicode (c); java_unget_unicode ();
BUILD_OPERATOR (ZRS_TK); BUILD_OPERATOR (ZRS_TK);
} }
case '=': case '=':
BUILD_OPERATOR2 (SRS_ASSIGN_TK); BUILD_OPERATOR2 (SRS_ASSIGN_TK);
default: default:
java_unget_unicode (c); java_unget_unicode ();
BUILD_OPERATOR (SRS_TK); BUILD_OPERATOR (SRS_TK);
} }
default: default:
java_unget_unicode (c); java_unget_unicode ();
BUILD_OPERATOR (GT_TK); BUILD_OPERATOR (GT_TK);
} }
...@@ -1010,11 +1008,11 @@ java_lex (java_lval) ...@@ -1010,11 +1008,11 @@ java_lex (java_lval)
} }
else else
{ {
java_unget_unicode (c); java_unget_unicode ();
BUILD_OPERATOR (LS_TK); BUILD_OPERATOR (LS_TK);
} }
default: default:
java_unget_unicode (c); java_unget_unicode ();
BUILD_OPERATOR (LT_TK); BUILD_OPERATOR (LT_TK);
} }
...@@ -1026,7 +1024,7 @@ java_lex (java_lval) ...@@ -1026,7 +1024,7 @@ java_lex (java_lval)
case '=': case '=':
BUILD_OPERATOR2 (AND_ASSIGN_TK); BUILD_OPERATOR2 (AND_ASSIGN_TK);
default: default:
java_unget_unicode (c); java_unget_unicode ();
BUILD_OPERATOR (AND_TK); BUILD_OPERATOR (AND_TK);
} }
...@@ -1038,7 +1036,7 @@ java_lex (java_lval) ...@@ -1038,7 +1036,7 @@ java_lex (java_lval)
case '=': case '=':
BUILD_OPERATOR2 (OR_ASSIGN_TK); BUILD_OPERATOR2 (OR_ASSIGN_TK);
default: default:
java_unget_unicode (c); java_unget_unicode ();
BUILD_OPERATOR (OR_TK); BUILD_OPERATOR (OR_TK);
} }
...@@ -1050,7 +1048,7 @@ java_lex (java_lval) ...@@ -1050,7 +1048,7 @@ java_lex (java_lval)
case '=': case '=':
BUILD_OPERATOR2 (PLUS_ASSIGN_TK); BUILD_OPERATOR2 (PLUS_ASSIGN_TK);
default: default:
java_unget_unicode (c); java_unget_unicode ();
BUILD_OPERATOR (PLUS_TK); BUILD_OPERATOR (PLUS_TK);
} }
...@@ -1062,7 +1060,7 @@ java_lex (java_lval) ...@@ -1062,7 +1060,7 @@ java_lex (java_lval)
case '=': case '=':
BUILD_OPERATOR2 (MINUS_ASSIGN_TK); BUILD_OPERATOR2 (MINUS_ASSIGN_TK);
default: default:
java_unget_unicode (c); java_unget_unicode ();
ctxp->minus_seen = 1; ctxp->minus_seen = 1;
BUILD_OPERATOR (MINUS_TK); BUILD_OPERATOR (MINUS_TK);
} }
...@@ -1074,7 +1072,7 @@ java_lex (java_lval) ...@@ -1074,7 +1072,7 @@ java_lex (java_lval)
} }
else else
{ {
java_unget_unicode (c); java_unget_unicode ();
BUILD_OPERATOR (MULT_TK); BUILD_OPERATOR (MULT_TK);
} }
...@@ -1085,7 +1083,7 @@ java_lex (java_lval) ...@@ -1085,7 +1083,7 @@ java_lex (java_lval)
} }
else else
{ {
java_unget_unicode (c); java_unget_unicode ();
BUILD_OPERATOR (DIV_TK); BUILD_OPERATOR (DIV_TK);
} }
...@@ -1096,7 +1094,7 @@ java_lex (java_lval) ...@@ -1096,7 +1094,7 @@ java_lex (java_lval)
} }
else else
{ {
java_unget_unicode (c); java_unget_unicode ();
BUILD_OPERATOR (XOR_TK); BUILD_OPERATOR (XOR_TK);
} }
...@@ -1107,7 +1105,7 @@ java_lex (java_lval) ...@@ -1107,7 +1105,7 @@ java_lex (java_lval)
} }
else else
{ {
java_unget_unicode (c); java_unget_unicode ();
BUILD_OPERATOR (REM_TK); BUILD_OPERATOR (REM_TK);
} }
...@@ -1118,7 +1116,7 @@ java_lex (java_lval) ...@@ -1118,7 +1116,7 @@ java_lex (java_lval)
} }
else else
{ {
java_unget_unicode (c); java_unget_unicode ();
BUILD_OPERATOR (NEG_TK); BUILD_OPERATOR (NEG_TK);
} }
...@@ -1144,7 +1142,7 @@ java_lex (java_lval) ...@@ -1144,7 +1142,7 @@ java_lex (java_lval)
obstack_1grow (&temporary_obstack, '\0'); obstack_1grow (&temporary_obstack, '\0');
string = obstack_finish (&temporary_obstack); string = obstack_finish (&temporary_obstack);
java_unget_unicode (c); java_unget_unicode ();
/* If we have something all ascii, we consider a keyword, a boolean /* If we have something all ascii, we consider a keyword, a boolean
literal, a null literal or an all ASCII identifier. Otherwise, literal, a null literal or an all ASCII identifier. Otherwise,
......
...@@ -140,6 +140,7 @@ typedef struct _java_lc { ...@@ -140,6 +140,7 @@ typedef struct _java_lc {
#else #else
extern void set_float_handler PROTO((jmp_buf));
static tree build_wfl_node (); static tree build_wfl_node ();
#define SET_FLOAT_HANDLER(H) set_float_handler ((H)) #define SET_FLOAT_HANDLER(H) set_float_handler ((H))
#define DCONST0 dconst0 #define DCONST0 dconst0
......
...@@ -191,12 +191,12 @@ extern tree stabilize_reference PROTO ((tree)); ...@@ -191,12 +191,12 @@ extern tree stabilize_reference PROTO ((tree));
#define ERROR_CANT_CONVERT_TO_BOOLEAN(OPERATOR, NODE, TYPE) \ #define ERROR_CANT_CONVERT_TO_BOOLEAN(OPERATOR, NODE, TYPE) \
parse_error_context \ parse_error_context \
((OPERATOR), "Incompatible type for `%s'. Can't convert `%s' to " \ ((OPERATOR), "Incompatible type for `%s'. Can't convert `%s' to " \
"boolean", operator_string ((NODE)), lang_printable_name ((TYPE))) "boolean", operator_string ((NODE)), lang_printable_name ((TYPE),0))
#define ERROR_CANT_CONVERT_TO_NUMERIC(OPERATOR, NODE, TYPE) \ #define ERROR_CANT_CONVERT_TO_NUMERIC(OPERATOR, NODE, TYPE) \
parse_error_context \ parse_error_context \
((OPERATOR), "Incompatible type for `%s'. Can't convert `%s' to " \ ((OPERATOR), "Incompatible type for `%s'. Can't convert `%s' to " \
"numeric type", operator_string ((NODE)), lang_printable_name ((TYPE))) "numeric type", operator_string ((NODE)), lang_printable_name ((TYPE), 0))
#define ERROR_CAST_NEEDED_TO_INTEGRAL(OPERATOR, NODE, TYPE) \ #define ERROR_CAST_NEEDED_TO_INTEGRAL(OPERATOR, NODE, TYPE) \
parse_error_context \ parse_error_context \
...@@ -204,7 +204,7 @@ extern tree stabilize_reference PROTO ((tree)); ...@@ -204,7 +204,7 @@ extern tree stabilize_reference PROTO ((tree));
"Incompatible type for `%s'. Explicit cast needed to convert " \ "Incompatible type for `%s'. Explicit cast needed to convert " \
"`%s' to integral" : "Incompatible type for `%s'. Can't convert " \ "`%s' to integral" : "Incompatible type for `%s'. Can't convert " \
"`%s' to integral"), operator_string ((NODE)), \ "`%s' to integral"), operator_string ((NODE)), \
lang_printable_name ((TYPE))) lang_printable_name ((TYPE), 0))
#define ERROR_VARIABLE_NOT_INITIALIZED(WFL, V) \ #define ERROR_VARIABLE_NOT_INITIALIZED(WFL, V) \
parse_error_context \ parse_error_context \
...@@ -560,7 +560,7 @@ static tree create_class PROTO ((int, tree, tree, tree)); ...@@ -560,7 +560,7 @@ static tree create_class PROTO ((int, tree, tree, tree));
static tree create_interface PROTO ((int, tree, tree)); static tree create_interface PROTO ((int, tree, tree));
static tree find_field PROTO ((tree, tree)); static tree find_field PROTO ((tree, tree));
static tree lookup_field_wrapper PROTO ((tree, tree)); static tree lookup_field_wrapper PROTO ((tree, tree));
static int duplicate_declaration_error PROTO ((tree, tree, tree, tree)); static int duplicate_declaration_error PROTO ((tree, tree, tree));
static void register_fields PROTO ((int, tree, tree)); static void register_fields PROTO ((int, tree, tree));
static tree parser_qualified_classname PROTO ((tree)); static tree parser_qualified_classname PROTO ((tree));
static int parser_check_super PROTO ((tree, tree, tree)); static int parser_check_super PROTO ((tree, tree, tree));
...@@ -595,12 +595,11 @@ static tree patch_method_invocation_stmt PROTO ((tree, tree, tree, int *, tree * ...@@ -595,12 +595,11 @@ static tree patch_method_invocation_stmt PROTO ((tree, tree, tree, int *, tree *
static int breakdown_qualified PROTO ((tree *, tree *, tree)); static int breakdown_qualified PROTO ((tree *, tree *, tree));
static tree resolve_and_layout PROTO ((tree, tree)); static tree resolve_and_layout PROTO ((tree, tree));
static tree resolve_no_layout PROTO ((tree, tree)); static tree resolve_no_layout PROTO ((tree, tree));
static int identical_subpath_p PROTO ((tree, tree));
static int invocation_mode PROTO ((tree, int)); static int invocation_mode PROTO ((tree, int));
static tree find_applicable_accessible_methods_list PROTO ((tree, tree, tree)); static tree find_applicable_accessible_methods_list PROTO ((tree, tree, tree));
static tree find_most_specific_methods_list PROTO ((tree)); static tree find_most_specific_methods_list PROTO ((tree));
static int argument_types_convertible PROTO ((tree, tree)); static int argument_types_convertible PROTO ((tree, tree));
static tree patch_invoke PROTO ((tree, tree, tree, tree)); static tree patch_invoke PROTO ((tree, tree, tree));
static tree lookup_method_invoke PROTO ((int, tree, tree, tree, tree)); static tree lookup_method_invoke PROTO ((int, tree, tree, tree, tree));
static tree register_incomplete_type PROTO ((int, tree, tree, tree)); static tree register_incomplete_type PROTO ((int, tree, tree, tree));
static tree obtain_incomplete_type PROTO ((tree)); static tree obtain_incomplete_type PROTO ((tree));
...@@ -624,7 +623,7 @@ static tree build_unaryop PROTO ((int, int, tree)); ...@@ -624,7 +623,7 @@ static tree build_unaryop PROTO ((int, int, tree));
static tree build_incdec PROTO ((int, int, tree, int)); static tree build_incdec PROTO ((int, int, tree, int));
static tree patch_unaryop PROTO ((tree, tree)); static tree patch_unaryop PROTO ((tree, tree));
static tree build_cast PROTO ((int, tree, tree)); static tree build_cast PROTO ((int, tree, tree));
static tree patch_cast PROTO ((tree, tree, tree)); static tree patch_cast PROTO ((tree, tree));
static int valid_ref_assignconv_cast_p PROTO ((tree, tree, int)); static int valid_ref_assignconv_cast_p PROTO ((tree, tree, int));
static int valid_builtin_assignconv_identity_widening_p PROTO ((tree, tree)); static int valid_builtin_assignconv_identity_widening_p PROTO ((tree, tree));
static int valid_cast_to_p PROTO ((tree, tree)); static int valid_cast_to_p PROTO ((tree, tree));
...@@ -658,7 +657,7 @@ static tree patch_if_else_statement PROTO ((tree)); ...@@ -658,7 +657,7 @@ static tree patch_if_else_statement PROTO ((tree));
static tree add_stmt_to_compound PROTO ((tree, tree, tree)); static tree add_stmt_to_compound PROTO ((tree, tree, tree));
static tree add_stmt_to_block PROTO ((tree, tree, tree)); static tree add_stmt_to_block PROTO ((tree, tree, tree));
static tree patch_exit_expr PROTO ((tree)); static tree patch_exit_expr PROTO ((tree));
static tree build_labeled_block PROTO ((int, tree, tree)); static tree build_labeled_block PROTO ((int, tree));
static tree generate_labeled_block PROTO (()); static tree generate_labeled_block PROTO (());
static tree complete_labeled_statement PROTO ((tree, tree)); static tree complete_labeled_statement PROTO ((tree, tree));
static tree build_bc_statement PROTO ((int, int, tree)); static tree build_bc_statement PROTO ((int, int, tree));
...@@ -680,7 +679,7 @@ static tree patch_try_statement PROTO ((tree)); ...@@ -680,7 +679,7 @@ static tree patch_try_statement PROTO ((tree));
static tree patch_synchronized_statement PROTO ((tree, tree)); static tree patch_synchronized_statement PROTO ((tree, tree));
static tree patch_throw_statement PROTO ((tree, tree)); static tree patch_throw_statement PROTO ((tree, tree));
static void check_thrown_exceptions PROTO ((int, tree)); static void check_thrown_exceptions PROTO ((int, tree));
static int check_thrown_exceptions_do PROTO ((int, tree)); static int check_thrown_exceptions_do PROTO ((tree));
static void purge_unchecked_exceptions PROTO ((tree)); static void purge_unchecked_exceptions PROTO ((tree));
static void check_throws_clauses PROTO ((tree, tree, tree)); static void check_throws_clauses PROTO ((tree, tree, tree));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment