opcodes/
[deliverable/binutils-gdb.git] / gas / itbl-parse.y
index 9806ecc2f6573180f104ab6cf3bd12b869ecf913..cf757fb66eb8502152ef9d15f44fdd6447941bee 100644 (file)
@@ -1,24 +1,22 @@
-
 /* itbl-parse.y
+   Copyright 1997, 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
 
-        Copyright (C) 1997  Free Software Foundation, Inc.
-
-        This file is part of GAS, the GNU Assembler.
+   This file is part of GAS, the GNU Assembler.
 
-        GAS is free software; you can redistribute it and/or modify
-        it under the terms of the GNU General Public License as published by
-        the Free Software Foundation; either version 2, or (at your option)
-        any later version.
+   GAS is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
 
-        GAS is distributed in the hope that it will be useful,
-        but WITHOUT ANY WARRANTY; without even the implied warranty of
-        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-        GNU General Public License for more details.
+   GAS is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-        You should have received a copy of the GNU General Public License
-        along with GAS; see the file COPYING.  If not, write to the Free
-        Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-        02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with GAS; see the file COPYING.  If not, write to the Free
+   Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+   02110-1301, USA.  */
 
 %{
 
@@ -154,7 +152,7 @@ Here is the grammar for the coprocessor table:
            char -> any printable character
            ltr -> ['a'..'z'|'A'..'Z'] 
            dec -> ['0'..'9']*                                       ; value in decimal
-           hex -> '0x'['0'..'9' | 'a'..'f' | 'A'..'F']*        ; value in hexidecimal 
+           hex -> '0x'['0'..'9' | 'a'..'f' | 'A'..'F']*        ; value in hexadecimal 
 
 
 Examples
@@ -241,14 +239,15 @@ was deleted from the original format such that we now count the fields.
 
 ----
 FIXME! should really change lexical analyzer 
-to recognize 'dreg' etc. in context sensative way.
+to recognize 'dreg' etc. in context sensitive way.
 Currently function names or mnemonics may be incorrectly parsed as keywords
 
 FIXME! hex is ambiguous with any digit
 
 */
 
-#include <stdio.h>
+#include "as.h"
+#include "itbl-lex.h"
 #include "itbl-ops.h"
 
 /* #define DEBUG */
@@ -275,9 +274,7 @@ FIXME! hex is ambiguous with any digit
 
 static int sbit, ebit;
 static struct itbl_entry *insn=0;
-extern int insntbl_line;
-int yyparse (void);
-int yylex (void);
+static int yyerror (const char *);
 
 %}
 
@@ -322,6 +319,7 @@ entry:
            insn=itbl_add_insn ($1, $3, $4, sbit, ebit, $6);
          }
        fieldspecs NL
+         {}
        | NL
        | error NL
        ;
@@ -451,9 +449,10 @@ value:
        ;
 %%
 
-void 
-yyerror (char *msg)
+static int
+yyerror (msg)
+     const char *msg;
 {
   printf ("line %d: %s\n", insntbl_line, msg);
+  return 0;
 }
-
This page took 0.076843 seconds and 4 git commands to generate.