2005-05-09 Kelley Cook <kcook@gcc.gnu.org>
[deliverable/binutils-gdb.git] / binutils / arparse.y
index dccdf8e3633d26df26aafd900212843fba7b35a1..a7ea0157f4113b48043ee98ef00ff1ab5330bfb9 100644 (file)
@@ -1,7 +1,8 @@
 %{
 /* arparse.y - Stange script language parser */
 
-/*   Copyright (C) 1992 Free Software Foundation, Inc.
+/*   Copyright 1992, 1993, 1995, 1997, 1999, 2002, 2003
+     Free Software Foundation, Inc.
 
 This file is part of GNU Binutils.
 
@@ -17,7 +18,7 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
+Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
 
 
 /* Contributed by Steve Chamberlain
@@ -26,13 +27,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 */
 #define DONTDECLARE_MALLOC
 #include "bfd.h"
-#include <sysdep.h>
+#include "bucomm.h"
 #include "arsup.h"
-extern int interactive;
-extern bfd *inarch;
 extern int verbose;
-void (*command)();
-FILE *listing;
+extern int yylex (void);
+static int yyerror (const char *);
 %}
 
 %union {
@@ -76,6 +75,7 @@ session:
 
 command_line:
                command NEWLINE { prompt(); }
+       ;
 
 command:
                open_command    
@@ -86,15 +86,22 @@ command:
        |       clear_command
        |       addmod_command
        |       save_command
+        |       extract_command
        |       replace_command
        |       delete_command
        |       list_command
-       |       END      { return 0; }
+       |       END      { ar_end(); return 0; }
        |       error
+       |       FILENAME { yyerror("foo"); }
        |
        ;
 
 
+extract_command:
+                EXTRACT modulename
+               { ar_extract($2); }
+       ;
+
 replace_command:       
                REPLACE modulename
                { ar_replace($2); }
@@ -186,12 +193,11 @@ verbose_command:
 
 %%
 
-
-int
-yyerror(x)
-char *x;
+static int
+yyerror (const char *x ATTRIBUTE_UNUSED)
 {
   extern int linenumber;
-  printf("Synax error in archive script, line %d\n", linenumber + 1);
+
+  printf (_("Syntax error in archive script, line %d\n"), linenumber + 1);
   return 0;
 }
This page took 0.03903 seconds and 4 git commands to generate.