1 /* Parser grammar for quick source code scan of Java(TM) language programs.
2 Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
3 Contributed by Alexandre Petit-Bianco (apbianco@cygnus.com)
5 This file is part of GNU CC.
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING. If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.
22 Java and all Java-based marks are trademarks or registered trademarks
23 of Sun Microsystems, Inc. in the United States and other countries.
24 The Free Software Foundation is independent of Sun Microsystems, Inc. */
26 /* This file parses Java source code. Action can be further completed
27 to achieve a desired behavior. This file isn't part of the Java
28 language gcc front end.
30 The grammar conforms to the Java grammar described in "The Java(TM)
31 Language Specification. J. Gosling, B. Joy, G. Steele. Addison Wesley
32 1996, ISBN 0-201-63451-1"
34 Some rules have been modified to support JDK1.1 inner classes
35 definitions and other extensions. */
46 extern char *input_filename;
47 extern FILE *finput, *out;
49 /* Obstack for the lexer. */
50 struct obstack temporary_obstack;
52 /* The current parser context. */
53 static struct parser_ctxt *ctxp;
55 /* Error and warning counts, current line number, because they're used
58 int java_warning_count;
61 /* Tweak default rules when necessary. */
63 #define USE_ABSORBER absorber = 0
65 /* Keep track of the current class name and package name. */
66 static const char *current_class;
67 static const char *package_name;
69 /* Keep track of the current inner class qualifier. */
70 static char *inner_qualifier;
71 static int inner_qualifier_length;
73 /* Keep track of whether things have be listed before. */
74 static int previous_output;
76 /* Record modifier uses */
77 static int modifier_value;
79 /* Keep track of number of bracket pairs after a variable declarator
81 static int bracket_count;
83 /* Record a method declaration */
84 struct method_declarator {
85 const char *method_name;
88 #define NEW_METHOD_DECLARATOR(D,N,A) \
91 (struct method_declarator *)xmalloc (sizeof (struct method_declarator)); \
92 (D)->method_name = (N); \
96 /* Two actions for this grammar */
97 static void report_class_declaration PARAMS ((const char *));
98 static void report_main_declaration PARAMS ((struct method_declarator *));
99 static void push_class_context PARAMS ((const char *));
100 static void pop_class_context PARAMS ((void));
108 struct method_declarator *declarator;
109 int value; /* For modifiers */
118 /* Things defined here have to match the order of what's in the
119 binop_lookup table. */
121 %token PLUS_TK MINUS_TK MULT_TK DIV_TK REM_TK
122 %token LS_TK SRS_TK ZRS_TK
123 %token AND_TK XOR_TK OR_TK
124 %token BOOL_AND_TK BOOL_OR_TK
125 %token EQ_TK NEQ_TK GT_TK GTE_TK LT_TK LTE_TK
127 /* This maps to the same binop_lookup entry than the token above */
129 %token PLUS_ASSIGN_TK MINUS_ASSIGN_TK MULT_ASSIGN_TK DIV_ASSIGN_TK
131 %token LS_ASSIGN_TK SRS_ASSIGN_TK ZRS_ASSIGN_TK
132 %token AND_ASSIGN_TK XOR_ASSIGN_TK OR_ASSIGN_TK
135 /* Modifier TOKEN have to be kept in this order. Don't scramble it */
137 %token PUBLIC_TK PRIVATE_TK PROTECTED_TK
138 %token STATIC_TK FINAL_TK SYNCHRONIZED_TK
139 %token VOLATILE_TK TRANSIENT_TK NATIVE_TK
140 %token PAD_TK ABSTRACT_TK MODIFIER_TK
142 /* Keep those two in order, too */
143 %token DECR_TK INCR_TK
145 /* From now one, things can be in any order */
147 %token DEFAULT_TK IF_TK THROW_TK
148 %token BOOLEAN_TK DO_TK IMPLEMENTS_TK
149 %token THROWS_TK BREAK_TK IMPORT_TK
150 %token ELSE_TK INSTANCEOF_TK RETURN_TK
151 %token VOID_TK CATCH_TK INTERFACE_TK
152 %token CASE_TK EXTENDS_TK FINALLY_TK
153 %token SUPER_TK WHILE_TK CLASS_TK
154 %token SWITCH_TK CONST_TK TRY_TK
155 %token FOR_TK NEW_TK CONTINUE_TK
156 %token GOTO_TK PACKAGE_TK THIS_TK
158 %token BYTE_TK SHORT_TK INT_TK LONG_TK
159 %token CHAR_TK INTEGRAL_TK
161 %token FLOAT_TK DOUBLE_TK FP_TK
165 %token REL_QM_TK REL_CL_TK NOT_TK NEG_TK
167 %token ASSIGN_ANY_TK ASSIGN_TK
168 %token OP_TK CP_TK OCB_TK CCB_TK OSB_TK CSB_TK SC_TK C_TK DOT_TK
170 %token STRING_LIT_TK CHAR_LIT_TK INT_LIT_TK FP_LIT_TK
171 %token TRUE_TK FALSE_TK BOOL_LIT_TK NULL_TK
173 %type <node> ID_TK identifier name simple_name qualified_name type
174 primitive_type reference_type array_type formal_parameter_list
175 formal_parameter class_or_interface_type class_type interface_type
176 %type <declarator> method_declarator
177 %type <value> MODIFIER_TK
180 /* 19.2 Production from 2.3: The Syntactic Grammar */
185 /* 19.3 Productions from 3: Lexical structure */
195 /* 19.4 Productions from 4: Types, Values and Variables */
204 /* use preset global here. FIXME */
205 $$ = xstrdup ("int");
209 /* use preset global here. FIXME */
210 $$ = xstrdup ("double");
214 /* use preset global here. FIXME */
215 $$ = xstrdup ("boolean");
220 class_or_interface_type
224 class_or_interface_type:
229 class_or_interface_type /* Default rule */
233 class_or_interface_type
237 primitive_type OSB_TK CSB_TK
240 $$ = concat ("[", $1, NULL);
242 | array_type OSB_TK CSB_TK
244 $$ = concat ("[", $1, NULL);
248 /* 19.5 Productions from 6: Names */
250 simple_name /* Default rule */
251 | qualified_name /* Default rule */
255 identifier /* Default rule */
259 name DOT_TK identifier
261 $$ = concat ($1, ".", $3, NULL);
269 /* 19.6: Production from 7: Packages */
271 | package_declaration
272 | import_declarations
274 | package_declaration import_declarations
275 | package_declaration type_declarations
276 | import_declarations type_declarations
277 | package_declaration import_declarations type_declarations
282 | import_declarations import_declaration
287 | type_declarations type_declaration
291 PACKAGE_TK name SC_TK
292 { package_name = $2; }
296 single_type_import_declaration
297 | type_import_on_demand_declaration
300 single_type_import_declaration:
304 type_import_on_demand_declaration:
305 IMPORT_TK name DOT_TK MULT_TK SC_TK
310 | interface_declaration
314 /* 19.7 Shortened from the original:
315 modifiers: modifier | modifiers modifier
316 modifier: any of public... */
326 | modifiers MODIFIER_TK
336 /* 19.8.1 Production from $8.1: Class Declaration */
338 modifiers CLASS_TK identifier super interfaces
340 report_class_declaration($3);
344 | CLASS_TK identifier super interfaces
345 { report_class_declaration($2); }
350 | EXTENDS_TK class_type
354 | IMPLEMENTS_TK interface_type_list
360 | interface_type_list C_TK interface_type
366 { pop_class_context (); }
367 | OCB_TK class_body_declarations CCB_TK
368 { pop_class_context (); }
371 class_body_declarations:
372 class_body_declaration
373 | class_body_declarations class_body_declaration
376 class_body_declaration:
377 class_member_declaration
379 | constructor_declaration
380 | block /* Added, JDK1.1, instance initializer */
383 class_member_declaration:
386 | class_declaration /* Added, JDK1.1 inner classes */
387 | interface_declaration /* Added, JDK1.1 inner classes */
390 /* 19.8.2 Productions from 8.3: Field Declarations */
392 type variable_declarators SC_TK
394 | modifiers type variable_declarators SC_TK
395 { modifier_value = 0; }
398 variable_declarators:
399 /* Should we use build_decl_list () instead ? FIXME */
400 variable_declarator /* Default rule */
401 | variable_declarators C_TK variable_declarator
405 variable_declarator_id
406 | variable_declarator_id ASSIGN_TK variable_initializer
409 variable_declarator_id:
411 { bracket_count = 0; USE_ABSORBER; }
412 | variable_declarator_id OSB_TK CSB_TK
416 variable_initializer:
421 /* 19.8.3 Productions from 8.4: Method Declarations */
423 method_header method_body
427 type method_declarator throws
429 | VOID_TK method_declarator throws
430 | modifiers type method_declarator throws
431 { modifier_value = 0; }
432 | modifiers VOID_TK method_declarator throws
434 report_main_declaration ($3);
440 identifier OP_TK CP_TK
442 struct method_declarator *d;
443 NEW_METHOD_DECLARATOR (d, $1, NULL);
446 | identifier OP_TK formal_parameter_list CP_TK
448 struct method_declarator *d;
449 NEW_METHOD_DECLARATOR (d, $1, $3);
452 | method_declarator OSB_TK CSB_TK
455 formal_parameter_list:
457 | formal_parameter_list C_TK formal_parameter
459 $$ = concat ($1, ",", $3, NULL);
464 type variable_declarator_id
470 char *n = xmalloc (bracket_count + 1 + strlen ($$));
471 for (i = 0; i < bracket_count; ++i)
473 strcpy (n + bracket_count, $$);
479 | modifiers type variable_declarator_id /* Added, JDK1.1 final locals */
484 char *n = xmalloc (bracket_count + 1 + strlen ($$));
485 for (i = 0; i < bracket_count; ++i)
487 strcpy (n + bracket_count, $$);
496 | THROWS_TK class_type_list
502 | class_type_list C_TK class_type
512 /* 19.8.4 Productions from 8.5: Static Initializers */
515 | static block SC_TK /* Shouldn't be here. FIXME */
518 static: /* Test lval.sub_token here */
523 /* 19.8.5 Productions from 8.6: Constructor Declarations */
524 /* NOTE FOR FURTHER WORK ON CONSTRUCTORS:
525 - If a forbidded modifier is found, the the error is either the use of
526 a forbidded modifier for a constructor OR bogus attempt to declare a
527 method without having specified the return type. FIXME */
528 constructor_declaration:
529 constructor_declarator throws constructor_body
530 | modifiers constructor_declarator throws constructor_body
531 { modifier_value = 0; }
532 /* extra SC_TK, FIXME */
533 | constructor_declarator throws constructor_body SC_TK
534 /* extra SC_TK, FIXME */
535 | modifiers constructor_declarator throws constructor_body SC_TK
536 { modifier_value = 0; }
537 /* I'm not happy with the SC_TK addition. It isn't in the grammer and should
538 probably be matched by and empty statement. But it doesn't work. FIXME */
541 constructor_declarator:
542 simple_name OP_TK CP_TK
544 | simple_name OP_TK formal_parameter_list CP_TK
550 | OCB_TK explicit_constructor_invocation CCB_TK
551 | OCB_TK block_statements CCB_TK
552 | OCB_TK explicit_constructor_invocation block_statements CCB_TK
555 /* Error recovery for that rule moved down expression_statement: rule. */
556 explicit_constructor_invocation:
557 this_or_super OP_TK CP_TK SC_TK
558 | this_or_super OP_TK argument_list CP_TK SC_TK
559 /* Added, JDK1.1 inner classes. Modified because the rule
560 'primary' couldn't work. */
561 | name DOT_TK SUPER_TK OP_TK argument_list CP_TK SC_TK
563 | name DOT_TK SUPER_TK OP_TK CP_TK SC_TK
567 this_or_super: /* Added, simplifies error diagnostics */
572 /* 19.9 Productions from 9: Interfaces */
573 /* 19.9.1 Productions from 9.1: Interfaces Declarations */
574 interface_declaration:
575 INTERFACE_TK identifier
576 { report_class_declaration ($2); modifier_value = 0; }
578 | modifiers INTERFACE_TK identifier
579 { report_class_declaration ($3); modifier_value = 0; }
581 | INTERFACE_TK identifier extends_interfaces
582 { report_class_declaration ($2); modifier_value = 0; }
584 | modifiers INTERFACE_TK identifier extends_interfaces
585 { report_class_declaration ($3); modifier_value = 0; }
590 EXTENDS_TK interface_type
591 | extends_interfaces C_TK interface_type
596 { pop_class_context (); }
597 | OCB_TK interface_member_declarations CCB_TK
598 { pop_class_context (); }
601 interface_member_declarations:
602 interface_member_declaration
603 | interface_member_declarations interface_member_declaration
606 interface_member_declaration:
608 | abstract_method_declaration
609 | class_declaration /* Added, JDK1.1 inner classes */
610 | interface_declaration /* Added, JDK1.1 inner classes */
613 constant_declaration:
617 abstract_method_declaration:
621 /* 19.10 Productions from 10: Arrays */
624 | OCB_TK variable_initializers CCB_TK
626 | OCB_TK variable_initializers C_TK CCB_TK
629 variable_initializers:
631 | variable_initializers C_TK variable_initializer
634 /* 19.11 Production from 14: Blocks and Statements */
637 | OCB_TK block_statements CCB_TK
642 | block_statements block_statement
646 local_variable_declaration_statement
648 | class_declaration /* Added, JDK1.1 inner classes */
651 local_variable_declaration_statement:
652 local_variable_declaration SC_TK /* Can't catch missing ';' here */
655 local_variable_declaration:
656 type variable_declarators
658 | modifiers type variable_declarators /* Added, JDK1.1 final locals */
659 { modifier_value = 0; }
663 statement_without_trailing_substatement
666 | if_then_else_statement
672 statement_without_trailing_substatement
673 | labeled_statement_nsi
674 | if_then_else_statement_nsi
675 | while_statement_nsi
679 statement_without_trailing_substatement:
682 | expression_statement
688 | synchronized_statement
706 labeled_statement_nsi:
707 label_decl statement_nsi
710 /* We concentrate here a bunch of error handling rules that we couldn't write
711 earlier, because expression_statement catches a missing ';'. */
712 expression_statement:
713 statement_expression SC_TK
716 statement_expression:
718 | pre_increment_expression
719 | pre_decrement_expression
720 | post_increment_expression
721 | post_decrement_expression
723 | class_instance_creation_expression
727 IF_TK OP_TK expression CP_TK statement
730 if_then_else_statement:
731 IF_TK OP_TK expression CP_TK statement_nsi ELSE_TK statement
734 if_then_else_statement_nsi:
735 IF_TK OP_TK expression CP_TK statement_nsi ELSE_TK statement_nsi
739 SWITCH_TK OP_TK expression CP_TK switch_block
744 | OCB_TK switch_labels CCB_TK
745 | OCB_TK switch_block_statement_groups CCB_TK
746 | OCB_TK switch_block_statement_groups switch_labels CCB_TK
749 switch_block_statement_groups:
750 switch_block_statement_group
751 | switch_block_statement_groups switch_block_statement_group
754 switch_block_statement_group:
755 switch_labels block_statements
761 | switch_labels switch_label
765 CASE_TK constant_expression REL_CL_TK
766 | DEFAULT_TK REL_CL_TK
770 WHILE_TK OP_TK expression CP_TK
774 while_expression statement
778 while_expression statement_nsi
786 do_statement_begin statement WHILE_TK OP_TK expression CP_TK SC_TK
790 for_begin SC_TK expression SC_TK for_update CP_TK statement
791 | for_begin SC_TK SC_TK for_update CP_TK statement
795 for_begin SC_TK expression SC_TK for_update CP_TK statement_nsi
796 | for_begin SC_TK SC_TK for_update CP_TK statement_nsi
806 for_init: /* Can be empty */
807 | statement_expression_list
808 | local_variable_declaration
811 for_update: /* Can be empty */
812 | statement_expression_list
815 statement_expression_list:
817 | statement_expression_list C_TK statement_expression
822 | BREAK_TK identifier SC_TK
827 | CONTINUE_TK identifier SC_TK
832 | RETURN_TK expression SC_TK
836 THROW_TK expression SC_TK
839 synchronized_statement:
840 synchronized OP_TK expression CP_TK block
841 | synchronized OP_TK expression CP_TK error
844 synchronized: /* Test lval.sub_token here */
851 | TRY_TK block finally
852 | TRY_TK block catches finally
857 | catches catch_clause
861 CATCH_TK OP_TK formal_parameter CP_TK block
868 /* 19.12 Production from 15: Expressions */
871 | array_creation_expression
874 primary_no_new_array:
877 | OP_TK expression CP_TK
878 | class_instance_creation_expression
882 /* type DOT_TK CLASS_TK doens't work. So we split the rule
883 'type' into its components. Missing is something for array,
884 which will complete the reference_type part. FIXME */
885 | name DOT_TK CLASS_TK /* Added, JDK1.1 class literals */
887 | primitive_type DOT_TK CLASS_TK /* Added, JDK1.1 class literals */
889 | VOID_TK DOT_TK CLASS_TK /* Added, JDK1.1 class literals */
890 /* Added, JDK1.1 inner classes. Documentation is wrong
891 refering to a 'ClassName' (class_name) rule that doesn't
892 exist. Used name instead. */
893 | name DOT_TK THIS_TK
897 class_instance_creation_expression:
898 NEW_TK class_type OP_TK argument_list CP_TK
899 | NEW_TK class_type OP_TK CP_TK
900 /* Added, JDK1.1 inner classes but modified to use
901 'class_type' instead of 'TypeName' (type_name) mentionned
902 in the documentation but doesn't exist. */
903 | NEW_TK class_type OP_TK argument_list CP_TK class_body
904 | NEW_TK class_type OP_TK CP_TK class_body
905 /* Added, JDK1.1 inner classes, modified to use name or
906 primary instead of primary solely which couldn't work in
908 | something_dot_new identifier OP_TK CP_TK
909 | something_dot_new identifier OP_TK CP_TK class_body
910 | something_dot_new identifier OP_TK argument_list CP_TK
911 | something_dot_new identifier OP_TK argument_list CP_TK class_body
914 something_dot_new: /* Added, not part of the specs. */
917 | primary DOT_TK NEW_TK
922 | argument_list C_TK expression
923 | argument_list C_TK error
926 array_creation_expression:
927 NEW_TK primitive_type dim_exprs
928 | NEW_TK class_or_interface_type dim_exprs
929 | NEW_TK primitive_type dim_exprs dims
930 | NEW_TK class_or_interface_type dim_exprs dims
931 /* Added, JDK1.1 anonymous array. Initial documentation rule
933 | NEW_TK class_or_interface_type dims array_initializer
934 | NEW_TK primitive_type dims array_initializer
943 OSB_TK expression CSB_TK
952 primary DOT_TK identifier
953 | SUPER_TK DOT_TK identifier
959 | name OP_TK argument_list CP_TK
961 | primary DOT_TK identifier OP_TK CP_TK
962 | primary DOT_TK identifier OP_TK argument_list CP_TK
963 | SUPER_TK DOT_TK identifier OP_TK CP_TK
964 | SUPER_TK DOT_TK identifier OP_TK argument_list CP_TK
968 name OSB_TK expression CSB_TK
970 | primary_no_new_array OSB_TK expression CSB_TK
977 | post_increment_expression
978 | post_decrement_expression
981 post_increment_expression:
982 postfix_expression INCR_TK
985 post_decrement_expression:
986 postfix_expression DECR_TK
990 pre_increment_expression
991 | pre_decrement_expression
992 | PLUS_TK unary_expression
993 | MINUS_TK unary_expression
994 | unary_expression_not_plus_minus
997 pre_increment_expression:
998 INCR_TK unary_expression
1001 pre_decrement_expression:
1002 DECR_TK unary_expression
1005 unary_expression_not_plus_minus:
1007 | NOT_TK unary_expression
1008 | NEG_TK unary_expression
1012 cast_expression: /* Error handling here is potentially weak */
1013 OP_TK primitive_type dims CP_TK unary_expression
1014 | OP_TK primitive_type CP_TK unary_expression
1015 | OP_TK expression CP_TK unary_expression_not_plus_minus
1016 | OP_TK name dims CP_TK unary_expression_not_plus_minus
1019 multiplicative_expression:
1021 | multiplicative_expression MULT_TK unary_expression
1022 | multiplicative_expression DIV_TK unary_expression
1023 | multiplicative_expression REM_TK unary_expression
1026 additive_expression:
1027 multiplicative_expression
1028 | additive_expression PLUS_TK multiplicative_expression
1029 | additive_expression MINUS_TK multiplicative_expression
1034 | shift_expression LS_TK additive_expression
1035 | shift_expression SRS_TK additive_expression
1036 | shift_expression ZRS_TK additive_expression
1039 relational_expression:
1041 | relational_expression LT_TK shift_expression
1042 | relational_expression GT_TK shift_expression
1043 | relational_expression LTE_TK shift_expression
1044 | relational_expression GTE_TK shift_expression
1045 | relational_expression INSTANCEOF_TK reference_type
1048 equality_expression:
1049 relational_expression
1050 | equality_expression EQ_TK relational_expression
1051 | equality_expression NEQ_TK relational_expression
1056 | and_expression AND_TK equality_expression
1059 exclusive_or_expression:
1061 | exclusive_or_expression XOR_TK and_expression
1064 inclusive_or_expression:
1065 exclusive_or_expression
1066 | inclusive_or_expression OR_TK exclusive_or_expression
1069 conditional_and_expression:
1070 inclusive_or_expression
1071 | conditional_and_expression BOOL_AND_TK inclusive_or_expression
1074 conditional_or_expression:
1075 conditional_and_expression
1076 | conditional_or_expression BOOL_OR_TK conditional_and_expression
1079 conditional_expression: /* Error handling here is weak */
1080 conditional_or_expression
1081 | conditional_or_expression REL_QM_TK expression REL_CL_TK conditional_expression
1084 assignment_expression:
1085 conditional_expression
1090 left_hand_side assignment_operator assignment_expression
1100 assignment_operator:
1106 assignment_expression
1109 constant_expression:
1115 /* Create a new parser context */
1118 java_push_parser_context ()
1120 struct parser_ctxt *new =
1121 (struct parser_ctxt *) xcalloc (1, sizeof (struct parser_ctxt));
1128 push_class_context (name)
1131 size_t name_length = strlen (name);
1132 inner_qualifier = xrealloc (inner_qualifier,
1133 inner_qualifier_length + name_length+2);
1134 memcpy (inner_qualifier+inner_qualifier_length, name, name_length);
1135 inner_qualifier_length += name_length;
1136 inner_qualifier [inner_qualifier_length] = '$';
1137 inner_qualifier [++inner_qualifier_length] = '\0';
1141 pop_class_context ()
1143 while (--inner_qualifier_length > 0
1144 && inner_qualifier [inner_qualifier_length-1] != '$')
1146 inner_qualifier = xrealloc (inner_qualifier, inner_qualifier_length+1);
1147 if (inner_qualifier_length == -1)
1148 inner_qualifier_length = 0;
1149 inner_qualifier [inner_qualifier_length] = '\0';
1152 /* Actions defined here */
1153 #define INNER_QUALIFIER (inner_qualifier ? inner_qualifier : "")
1156 report_class_declaration (name)
1159 extern int flag_dump_class, flag_list_filename;
1161 if (flag_dump_class)
1163 if (!previous_output)
1165 if (flag_list_filename)
1166 fprintf (out, "%s: ", input_filename);
1167 previous_output = 1;
1171 fprintf (out, "%s.%s%s ", package_name, INNER_QUALIFIER, name);
1173 fprintf (out, "%s%s ", INNER_QUALIFIER, name);
1176 push_class_context (name);
1177 current_class = name;
1181 report_main_declaration (declarator)
1182 struct method_declarator *declarator;
1184 extern int flag_find_main;
1187 && modifier_value == 2
1188 && !strcmp (declarator->method_name, "main")
1190 && declarator->args [0] == '['
1191 && (! strcmp (declarator->args+1, "String")
1192 || ! strcmp (declarator->args + 1, "java.lang.String"))
1195 if (!previous_output)
1198 fprintf (out, "%s.%s ", package_name, current_class);
1200 fprintf (out, "%s", current_class);
1201 previous_output = 1;
1206 /* Reset global status used by the report functions. */
1208 void reset_report ()
1210 previous_output = 0;
1211 current_class = package_name = NULL;
1216 const char *msg ATTRIBUTE_UNUSED;
1218 fprintf (stderr, "%s: %d: %s\n", input_filename, lineno, msg);