2002-10-01 Andrew Cagney <ac131313@redhat.com>
[deliverable/binutils-gdb.git] / gdb / f-exp.y
index 5afed8d8e1ea56b04672595b4947f9340e426b30..b9004264eec69d25a9447bab97ebfaa9467ea77d 100644 (file)
@@ -1,6 +1,6 @@
 /* YACC parser for Fortran expressions, for GDB.
-   Copyright 1986, 1989, 1990, 1991, 1993, 1994, 2001 Free Software
-   Foundation, Inc.
+   Copyright 1986, 1989, 1990, 1991, 1993, 1994, 1995, 1996, 2000, 2001
+   Free Software Foundation, Inc.
 
    Contributed by Motorola.  Adapted from the C parser by Farooq Butt
    (fmbutt@engage.sps.mot.com).
@@ -91,6 +91,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define        yylloc  f_lloc
 #define yyreds f_reds          /* With YYDEBUG defined */
 #define yytoks f_toks          /* With YYDEBUG defined */
+#define yyname f_name          /* With YYDEBUG defined */
+#define yyrule f_rule          /* With YYDEBUG defined */
 #define yylhs  f_yylhs
 #define yylen  f_yylen
 #define yydefred f_yydefred
@@ -102,9 +104,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define yycheck         f_yycheck
 
 #ifndef YYDEBUG
-#define        YYDEBUG 1               /* Default to no yydebug support */
+#define        YYDEBUG 1               /* Default to yydebug support */
 #endif
 
+#define YYFPRINTF parser_fprintf
+
 int yyparse (void);
 
 static int yylex (void);
@@ -924,7 +928,9 @@ yylex ()
   char *tokstart;
   
  retry:
-  
+  prev_lexptr = lexptr;
   tokstart = lexptr;
   
   /* First of all, let us make sure we are not dealing with the 
@@ -1171,5 +1177,8 @@ void
 yyerror (msg)
      char *msg;
 {
+  if (prev_lexptr)
+    lexptr = prev_lexptr;
+
   error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr);
 }
This page took 0.043139 seconds and 4 git commands to generate.