-
/* 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. */
%{
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
----
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 */
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 *);
%}
insn=itbl_add_insn ($1, $3, $4, sbit, ebit, $6);
}
fieldspecs NL
+ {}
| NL
| error NL
;
;
%%
-void
-yyerror (char *msg)
+static int
+yyerror (msg)
+ const char *msg;
{
printf ("line %d: %s\n", insntbl_line, msg);
+ return 0;
}
-