X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gas%2Fitbl-parse.y;h=cf757fb66eb8502152ef9d15f44fdd6447941bee;hb=b0f260d61e5b5b3de1fcac6042f4b225bf132d45;hp=9806ecc2f6573180f104ab6cf3bd12b869ecf913;hpb=efec4a282c17a6814a2ff28b15d6305af8aaf2bb;p=deliverable%2Fbinutils-gdb.git diff --git a/gas/itbl-parse.y b/gas/itbl-parse.y index 9806ecc2f6..cf757fb66e 100644 --- a/gas/itbl-parse.y +++ b/gas/itbl-parse.y @@ -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 +#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; } -