OSDN Git Service

2004-09-28 Andrew Haley <aph@redhat.com>
[pf3gnuchains/gcc-fork.git] / gcc / java / parse-scan.y
index 981ed47..e05fdb5 100644 (file)
@@ -1,5 +1,6 @@
 /* Parser grammar for quick source code scan of Java(TM) language programs.
-   Copyright (C) 1998, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004
+   Free Software Foundation, Inc.
    Contributed by Alexandre Petit-Bianco (apbianco@cygnus.com)
 
 This file is part of GCC.
@@ -41,27 +42,25 @@ definitions and other extensions.  */
 #include "system.h"
 #include "coretypes.h"
 #include "tm.h"
-
+#include "input.h"
 #include "obstack.h"
 #include "toplev.h"
 
-#define obstack_chunk_alloc xmalloc
-#define obstack_chunk_free free
-
-extern char *input_filename;
 extern FILE *finput, *out;
+/* Current position in real source file.  */
+
+location_t input_location;
 
 /* Obstack for the lexer.  */
 struct obstack temporary_obstack;
 
 /* The current parser context.  */
-static struct parser_ctxt *ctxp;
+struct parser_ctxt *ctxp;
 
-/* Error and warning counts, current line number, because they're used
-   elsewhere  */
+/* Error and warning counts, because they're used elsewhere  */
 int java_error_count;
 int java_warning_count;
-int lineno;
 
 /* Tweak default rules when necessary.  */
 static int absorber;
@@ -555,8 +554,8 @@ static:                             /* Test lval.sub_token here */
 
 /* 19.8.5 Productions from 8.6: Constructor Declarations  */
 /* NOTE FOR FURTHER WORK ON CONSTRUCTORS:
-   - If a forbidded modifier is found, the the error is either the use of
-     a forbidded modifier for a constructor OR bogus attempt to declare a
+   - If a forbidden modifier is found, the error is either the use of
+     a forbidden modifier for a constructor OR bogus attempt to declare a
      method without having specified the return type. FIXME */
 constructor_declaration:
        constructor_declarator throws constructor_body
@@ -567,7 +566,7 @@ constructor_declaration:
 /* extra SC_TK, FIXME */
 |      modifiers constructor_declarator throws constructor_body SC_TK
                { modifier_value = 0; }
-/* I'm not happy with the SC_TK addition. It isn't in the grammer and should
+/* I'm not happy with the SC_TK addition. It isn't in the grammar and should
    probably be matched by and empty statement. But it doesn't work. FIXME */
 ;
 
@@ -928,7 +927,7 @@ primary_no_new_array:
 |      array_access
 |      type_literals
         /* Added, JDK1.1 inner classes. Documentation is wrong
-           refering to a 'ClassName' (class_name) rule that doesn't
+           referring to a 'ClassName' (class_name) rule that doesn't
            exist. Used name instead.  */
 |      name DOT_TK THIS_TK
                { USE_ABSORBER; }
@@ -1346,7 +1345,8 @@ report (void)
 
 /* Reset global status used by the report functions.  */
 
-void reset_report (void)
+void
+reset_report (void)
 {
   previous_output = 0;
   package_name = NULL;
@@ -1357,6 +1357,6 @@ void reset_report (void)
 void
 yyerror (const char *msg ATTRIBUTE_UNUSED)
 {
-  fprintf (stderr, "%s: %d: %s\n", input_filename, lineno, msg);
+  fprintf (stderr, "%s: %d: %s\n", input_filename, input_line, msg);
   exit (1);
 }