125b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* A Bison parser, made by GNU Bison 2.5.  */
225b3c049e70834cf33790a28643ab058b507b35cBen Cheng
325b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* Bison implementation for Yacc-like parsers in C
425b3c049e70834cf33790a28643ab058b507b35cBen Cheng
525b3c049e70834cf33790a28643ab058b507b35cBen Cheng      Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
625b3c049e70834cf33790a28643ab058b507b35cBen Cheng
725b3c049e70834cf33790a28643ab058b507b35cBen Cheng   This program is free software: you can redistribute it and/or modify
825b3c049e70834cf33790a28643ab058b507b35cBen Cheng   it under the terms of the GNU General Public License as published by
925b3c049e70834cf33790a28643ab058b507b35cBen Cheng   the Free Software Foundation, either version 3 of the License, or
1025b3c049e70834cf33790a28643ab058b507b35cBen Cheng   (at your option) any later version.
1125b3c049e70834cf33790a28643ab058b507b35cBen Cheng
1225b3c049e70834cf33790a28643ab058b507b35cBen Cheng   This program is distributed in the hope that it will be useful,
1325b3c049e70834cf33790a28643ab058b507b35cBen Cheng   but WITHOUT ANY WARRANTY; without even the implied warranty of
1425b3c049e70834cf33790a28643ab058b507b35cBen Cheng   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1525b3c049e70834cf33790a28643ab058b507b35cBen Cheng   GNU General Public License for more details.
1625b3c049e70834cf33790a28643ab058b507b35cBen Cheng
1725b3c049e70834cf33790a28643ab058b507b35cBen Cheng   You should have received a copy of the GNU General Public License
1825b3c049e70834cf33790a28643ab058b507b35cBen Cheng   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
1925b3c049e70834cf33790a28643ab058b507b35cBen Cheng
2025b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* As a special exception, you may create a larger work that contains
2125b3c049e70834cf33790a28643ab058b507b35cBen Cheng   part or all of the Bison parser skeleton and distribute that work
2225b3c049e70834cf33790a28643ab058b507b35cBen Cheng   under terms of your choice, so long as that work isn't itself a
2325b3c049e70834cf33790a28643ab058b507b35cBen Cheng   parser generator using the skeleton or a modified version thereof
2425b3c049e70834cf33790a28643ab058b507b35cBen Cheng   as a parser skeleton.  Alternatively, if you modify or redistribute
2525b3c049e70834cf33790a28643ab058b507b35cBen Cheng   the parser skeleton itself, you may (at your option) remove this
2625b3c049e70834cf33790a28643ab058b507b35cBen Cheng   special exception, which will cause the skeleton and the resulting
2725b3c049e70834cf33790a28643ab058b507b35cBen Cheng   Bison output files to be licensed under the GNU General Public
2825b3c049e70834cf33790a28643ab058b507b35cBen Cheng   License without this special exception.
2925b3c049e70834cf33790a28643ab058b507b35cBen Cheng
3025b3c049e70834cf33790a28643ab058b507b35cBen Cheng   This special exception was added by the Free Software Foundation in
3125b3c049e70834cf33790a28643ab058b507b35cBen Cheng   version 2.2 of Bison.  */
3225b3c049e70834cf33790a28643ab058b507b35cBen Cheng
3325b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* C LALR(1) parser skeleton written by Richard Stallman, by
3425b3c049e70834cf33790a28643ab058b507b35cBen Cheng   simplifying the original so-called "semantic" parser.  */
3525b3c049e70834cf33790a28643ab058b507b35cBen Cheng
3625b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* All symbols defined below should begin with yy or YY, to avoid
3725b3c049e70834cf33790a28643ab058b507b35cBen Cheng   infringing on user name space.  This should be done even for local
3825b3c049e70834cf33790a28643ab058b507b35cBen Cheng   variables, as they might otherwise be expanded by user macros.
3925b3c049e70834cf33790a28643ab058b507b35cBen Cheng   There are some unavoidable exceptions within include files to
4025b3c049e70834cf33790a28643ab058b507b35cBen Cheng   define necessary library symbols; they are noted "INFRINGES ON
4125b3c049e70834cf33790a28643ab058b507b35cBen Cheng   USER NAME SPACE" below.  */
4225b3c049e70834cf33790a28643ab058b507b35cBen Cheng
4325b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* Identify Bison output.  */
4425b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define YYBISON 1
4525b3c049e70834cf33790a28643ab058b507b35cBen Cheng
4625b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* Bison version.  */
4725b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define YYBISON_VERSION "2.5"
4825b3c049e70834cf33790a28643ab058b507b35cBen Cheng
4925b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* Skeleton name.  */
5025b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define YYSKELETON_NAME "yacc.c"
5125b3c049e70834cf33790a28643ab058b507b35cBen Cheng
5225b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* Pure parsers.  */
5325b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define YYPURE 0
5425b3c049e70834cf33790a28643ab058b507b35cBen Cheng
5525b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* Push parsers.  */
5625b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define YYPUSH 0
5725b3c049e70834cf33790a28643ab058b507b35cBen Cheng
5825b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* Pull parsers.  */
5925b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define YYPULL 1
6025b3c049e70834cf33790a28643ab058b507b35cBen Cheng
6125b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* Using locations.  */
6225b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define YYLSP_NEEDED 0
6325b3c049e70834cf33790a28643ab058b507b35cBen Cheng
6425b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* Substitute the variable and function names.  */
6525b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define yyparse         i386_parse
6625b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define yylex           i386_lex
6725b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define yyerror         i386_error
6825b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define yylval          i386_lval
6925b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define yychar          i386_char
7025b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define yydebug         i386_debug
7125b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define yynerrs         i386_nerrs
7225b3c049e70834cf33790a28643ab058b507b35cBen Cheng
7325b3c049e70834cf33790a28643ab058b507b35cBen Cheng
7425b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* Copy the first part of user declarations.  */
7525b3c049e70834cf33790a28643ab058b507b35cBen Cheng
7625b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* Line 268 of yacc.c  */
7725b3c049e70834cf33790a28643ab058b507b35cBen Cheng#line 1 "i386_parse.y"
7825b3c049e70834cf33790a28643ab058b507b35cBen Cheng
7925b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* Parser for i386 CPU description.
8025b3c049e70834cf33790a28643ab058b507b35cBen Cheng   Copyright (C) 2004, 2005, 2007, 2008, 2009 Red Hat, Inc.
8125b3c049e70834cf33790a28643ab058b507b35cBen Cheng   Written by Ulrich Drepper <drepper@redhat.com>, 2004.
8225b3c049e70834cf33790a28643ab058b507b35cBen Cheng
8325b3c049e70834cf33790a28643ab058b507b35cBen Cheng   Red Hat elfutils is free software; you can redistribute it and/or modify
8425b3c049e70834cf33790a28643ab058b507b35cBen Cheng   it under the terms of the GNU General Public License as published by the
8525b3c049e70834cf33790a28643ab058b507b35cBen Cheng   Free Software Foundation; version 2 of the License.
8625b3c049e70834cf33790a28643ab058b507b35cBen Cheng
8725b3c049e70834cf33790a28643ab058b507b35cBen Cheng   Red Hat elfutils is distributed in the hope that it will be useful, but
8825b3c049e70834cf33790a28643ab058b507b35cBen Cheng   WITHOUT ANY WARRANTY; without even the implied warranty of
8925b3c049e70834cf33790a28643ab058b507b35cBen Cheng   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
9025b3c049e70834cf33790a28643ab058b507b35cBen Cheng   General Public License for more details.
9125b3c049e70834cf33790a28643ab058b507b35cBen Cheng
9225b3c049e70834cf33790a28643ab058b507b35cBen Cheng   You should have received a copy of the GNU General Public License along
9325b3c049e70834cf33790a28643ab058b507b35cBen Cheng   with Red Hat elfutils; if not, write to the Free Software Foundation,
9425b3c049e70834cf33790a28643ab058b507b35cBen Cheng   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
9525b3c049e70834cf33790a28643ab058b507b35cBen Cheng
9625b3c049e70834cf33790a28643ab058b507b35cBen Cheng   Red Hat elfutils is an included package of the Open Invention Network.
9725b3c049e70834cf33790a28643ab058b507b35cBen Cheng   An included package of the Open Invention Network is a package for which
9825b3c049e70834cf33790a28643ab058b507b35cBen Cheng   Open Invention Network licensees cross-license their patents.  No patent
9925b3c049e70834cf33790a28643ab058b507b35cBen Cheng   license is granted, either expressly or impliedly, by designation as an
10025b3c049e70834cf33790a28643ab058b507b35cBen Cheng   included package.  Should you wish to participate in the Open Invention
10125b3c049e70834cf33790a28643ab058b507b35cBen Cheng   Network licensing program, please visit www.openinventionnetwork.com
10225b3c049e70834cf33790a28643ab058b507b35cBen Cheng   <http://www.openinventionnetwork.com>.  */
10325b3c049e70834cf33790a28643ab058b507b35cBen Cheng
10425b3c049e70834cf33790a28643ab058b507b35cBen Cheng#ifdef HAVE_CONFIG_H
10525b3c049e70834cf33790a28643ab058b507b35cBen Cheng# include <config.h>
10625b3c049e70834cf33790a28643ab058b507b35cBen Cheng#endif
10725b3c049e70834cf33790a28643ab058b507b35cBen Cheng
10825b3c049e70834cf33790a28643ab058b507b35cBen Cheng#include <assert.h>
10925b3c049e70834cf33790a28643ab058b507b35cBen Cheng#include <ctype.h>
11025b3c049e70834cf33790a28643ab058b507b35cBen Cheng#include <errno.h>
11125b3c049e70834cf33790a28643ab058b507b35cBen Cheng#include <error.h>
11225b3c049e70834cf33790a28643ab058b507b35cBen Cheng#include <inttypes.h>
11325b3c049e70834cf33790a28643ab058b507b35cBen Cheng#include <libintl.h>
11425b3c049e70834cf33790a28643ab058b507b35cBen Cheng#include <math.h>
11525b3c049e70834cf33790a28643ab058b507b35cBen Cheng#include <obstack.h>
11625b3c049e70834cf33790a28643ab058b507b35cBen Cheng#include <search.h>
11725b3c049e70834cf33790a28643ab058b507b35cBen Cheng#include <stdbool.h>
11825b3c049e70834cf33790a28643ab058b507b35cBen Cheng#include <stdio.h>
11925b3c049e70834cf33790a28643ab058b507b35cBen Cheng#include <stdlib.h>
12025b3c049e70834cf33790a28643ab058b507b35cBen Cheng#include <string.h>
12125b3c049e70834cf33790a28643ab058b507b35cBen Cheng#include <sys/param.h>
12225b3c049e70834cf33790a28643ab058b507b35cBen Cheng
12325b3c049e70834cf33790a28643ab058b507b35cBen Cheng#include <system.h>
12425b3c049e70834cf33790a28643ab058b507b35cBen Cheng
12525b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define obstack_chunk_alloc xmalloc
12625b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define obstack_chunk_free free
12725b3c049e70834cf33790a28643ab058b507b35cBen Cheng
12825b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* The error handler.  */
12925b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic void yyerror (const char *s);
13025b3c049e70834cf33790a28643ab058b507b35cBen Cheng
13125b3c049e70834cf33790a28643ab058b507b35cBen Chengextern int yylex (void);
13225b3c049e70834cf33790a28643ab058b507b35cBen Chengextern int i386_lineno;
13325b3c049e70834cf33790a28643ab058b507b35cBen Chengextern char *infname;
13425b3c049e70834cf33790a28643ab058b507b35cBen Cheng
13525b3c049e70834cf33790a28643ab058b507b35cBen Cheng
13625b3c049e70834cf33790a28643ab058b507b35cBen Chengstruct known_bitfield
13725b3c049e70834cf33790a28643ab058b507b35cBen Cheng{
13825b3c049e70834cf33790a28643ab058b507b35cBen Cheng  char *name;
13925b3c049e70834cf33790a28643ab058b507b35cBen Cheng  unsigned long int bits;
14025b3c049e70834cf33790a28643ab058b507b35cBen Cheng  int tmp;
14125b3c049e70834cf33790a28643ab058b507b35cBen Cheng};
14225b3c049e70834cf33790a28643ab058b507b35cBen Cheng
14325b3c049e70834cf33790a28643ab058b507b35cBen Cheng
14425b3c049e70834cf33790a28643ab058b507b35cBen Chengstruct bitvalue
14525b3c049e70834cf33790a28643ab058b507b35cBen Cheng{
14625b3c049e70834cf33790a28643ab058b507b35cBen Cheng  enum bittype { zeroone, field, failure } type;
14725b3c049e70834cf33790a28643ab058b507b35cBen Cheng  union
14825b3c049e70834cf33790a28643ab058b507b35cBen Cheng  {
14925b3c049e70834cf33790a28643ab058b507b35cBen Cheng    unsigned int value;
15025b3c049e70834cf33790a28643ab058b507b35cBen Cheng    struct known_bitfield *field;
15125b3c049e70834cf33790a28643ab058b507b35cBen Cheng  };
15225b3c049e70834cf33790a28643ab058b507b35cBen Cheng  struct bitvalue *next;
15325b3c049e70834cf33790a28643ab058b507b35cBen Cheng};
15425b3c049e70834cf33790a28643ab058b507b35cBen Cheng
15525b3c049e70834cf33790a28643ab058b507b35cBen Cheng
15625b3c049e70834cf33790a28643ab058b507b35cBen Chengstruct argname
15725b3c049e70834cf33790a28643ab058b507b35cBen Cheng{
15825b3c049e70834cf33790a28643ab058b507b35cBen Cheng  enum nametype { string, nfield } type;
15925b3c049e70834cf33790a28643ab058b507b35cBen Cheng  union
16025b3c049e70834cf33790a28643ab058b507b35cBen Cheng  {
16125b3c049e70834cf33790a28643ab058b507b35cBen Cheng    char *str;
16225b3c049e70834cf33790a28643ab058b507b35cBen Cheng    struct known_bitfield *field;
16325b3c049e70834cf33790a28643ab058b507b35cBen Cheng  };
16425b3c049e70834cf33790a28643ab058b507b35cBen Cheng  struct argname *next;
16525b3c049e70834cf33790a28643ab058b507b35cBen Cheng};
16625b3c049e70834cf33790a28643ab058b507b35cBen Cheng
16725b3c049e70834cf33790a28643ab058b507b35cBen Cheng
16825b3c049e70834cf33790a28643ab058b507b35cBen Chengstruct argument
16925b3c049e70834cf33790a28643ab058b507b35cBen Cheng{
17025b3c049e70834cf33790a28643ab058b507b35cBen Cheng  struct argname *name;
17125b3c049e70834cf33790a28643ab058b507b35cBen Cheng  struct argument *next;
17225b3c049e70834cf33790a28643ab058b507b35cBen Cheng};
17325b3c049e70834cf33790a28643ab058b507b35cBen Cheng
17425b3c049e70834cf33790a28643ab058b507b35cBen Cheng
17525b3c049e70834cf33790a28643ab058b507b35cBen Chengstruct instruction
17625b3c049e70834cf33790a28643ab058b507b35cBen Cheng{
17725b3c049e70834cf33790a28643ab058b507b35cBen Cheng  /* The byte encoding.  */
17825b3c049e70834cf33790a28643ab058b507b35cBen Cheng  struct bitvalue *bytes;
17925b3c049e70834cf33790a28643ab058b507b35cBen Cheng
18025b3c049e70834cf33790a28643ab058b507b35cBen Cheng  /* Prefix possible.  */
18125b3c049e70834cf33790a28643ab058b507b35cBen Cheng  int repe;
18225b3c049e70834cf33790a28643ab058b507b35cBen Cheng  int rep;
18325b3c049e70834cf33790a28643ab058b507b35cBen Cheng
18425b3c049e70834cf33790a28643ab058b507b35cBen Cheng  /* Mnemonic.  */
18525b3c049e70834cf33790a28643ab058b507b35cBen Cheng  char *mnemonic;
18625b3c049e70834cf33790a28643ab058b507b35cBen Cheng
18725b3c049e70834cf33790a28643ab058b507b35cBen Cheng  /* Suffix.  */
18825b3c049e70834cf33790a28643ab058b507b35cBen Cheng  enum { suffix_none = 0, suffix_w, suffix_w0, suffix_W, suffix_tttn,
18925b3c049e70834cf33790a28643ab058b507b35cBen Cheng	 suffix_w1, suffix_W1, suffix_D } suffix;
19025b3c049e70834cf33790a28643ab058b507b35cBen Cheng
19125b3c049e70834cf33790a28643ab058b507b35cBen Cheng  /* Flag set if modr/m is used.  */
19225b3c049e70834cf33790a28643ab058b507b35cBen Cheng  int modrm;
19325b3c049e70834cf33790a28643ab058b507b35cBen Cheng
19425b3c049e70834cf33790a28643ab058b507b35cBen Cheng  /* Operands.  */
19525b3c049e70834cf33790a28643ab058b507b35cBen Cheng  struct operand
19625b3c049e70834cf33790a28643ab058b507b35cBen Cheng  {
19725b3c049e70834cf33790a28643ab058b507b35cBen Cheng    char *fct;
19825b3c049e70834cf33790a28643ab058b507b35cBen Cheng    char *str;
19925b3c049e70834cf33790a28643ab058b507b35cBen Cheng    int off1;
20025b3c049e70834cf33790a28643ab058b507b35cBen Cheng    int off2;
20125b3c049e70834cf33790a28643ab058b507b35cBen Cheng    int off3;
20225b3c049e70834cf33790a28643ab058b507b35cBen Cheng  } operands[3];
20325b3c049e70834cf33790a28643ab058b507b35cBen Cheng
20425b3c049e70834cf33790a28643ab058b507b35cBen Cheng  struct instruction *next;
20525b3c049e70834cf33790a28643ab058b507b35cBen Cheng};
20625b3c049e70834cf33790a28643ab058b507b35cBen Cheng
20725b3c049e70834cf33790a28643ab058b507b35cBen Cheng
20825b3c049e70834cf33790a28643ab058b507b35cBen Chengstruct synonym
20925b3c049e70834cf33790a28643ab058b507b35cBen Cheng{
21025b3c049e70834cf33790a28643ab058b507b35cBen Cheng  char *from;
21125b3c049e70834cf33790a28643ab058b507b35cBen Cheng  char *to;
21225b3c049e70834cf33790a28643ab058b507b35cBen Cheng};
21325b3c049e70834cf33790a28643ab058b507b35cBen Cheng
21425b3c049e70834cf33790a28643ab058b507b35cBen Cheng
21525b3c049e70834cf33790a28643ab058b507b35cBen Chengstruct suffix
21625b3c049e70834cf33790a28643ab058b507b35cBen Cheng{
21725b3c049e70834cf33790a28643ab058b507b35cBen Cheng  char *name;
21825b3c049e70834cf33790a28643ab058b507b35cBen Cheng  int idx;
21925b3c049e70834cf33790a28643ab058b507b35cBen Cheng};
22025b3c049e70834cf33790a28643ab058b507b35cBen Cheng
22125b3c049e70834cf33790a28643ab058b507b35cBen Cheng
22225b3c049e70834cf33790a28643ab058b507b35cBen Chengstruct argstring
22325b3c049e70834cf33790a28643ab058b507b35cBen Cheng{
22425b3c049e70834cf33790a28643ab058b507b35cBen Cheng  char *str;
22525b3c049e70834cf33790a28643ab058b507b35cBen Cheng  int idx;
22625b3c049e70834cf33790a28643ab058b507b35cBen Cheng  int off;
22725b3c049e70834cf33790a28643ab058b507b35cBen Cheng};
22825b3c049e70834cf33790a28643ab058b507b35cBen Cheng
22925b3c049e70834cf33790a28643ab058b507b35cBen Cheng
23025b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic struct known_bitfield ax_reg =
23125b3c049e70834cf33790a28643ab058b507b35cBen Cheng  {
23225b3c049e70834cf33790a28643ab058b507b35cBen Cheng    .name = "ax", .bits = 0, .tmp = 0
23325b3c049e70834cf33790a28643ab058b507b35cBen Cheng  };
23425b3c049e70834cf33790a28643ab058b507b35cBen Cheng
23525b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic struct known_bitfield dx_reg =
23625b3c049e70834cf33790a28643ab058b507b35cBen Cheng  {
23725b3c049e70834cf33790a28643ab058b507b35cBen Cheng    .name = "dx", .bits = 0, .tmp = 0
23825b3c049e70834cf33790a28643ab058b507b35cBen Cheng  };
23925b3c049e70834cf33790a28643ab058b507b35cBen Cheng
24025b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic struct known_bitfield di_reg =
24125b3c049e70834cf33790a28643ab058b507b35cBen Cheng  {
24225b3c049e70834cf33790a28643ab058b507b35cBen Cheng    .name = "es_di", .bits = 0, .tmp = 0
24325b3c049e70834cf33790a28643ab058b507b35cBen Cheng  };
24425b3c049e70834cf33790a28643ab058b507b35cBen Cheng
24525b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic struct known_bitfield si_reg =
24625b3c049e70834cf33790a28643ab058b507b35cBen Cheng  {
24725b3c049e70834cf33790a28643ab058b507b35cBen Cheng    .name = "ds_si", .bits = 0, .tmp = 0
24825b3c049e70834cf33790a28643ab058b507b35cBen Cheng  };
24925b3c049e70834cf33790a28643ab058b507b35cBen Cheng
25025b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic struct known_bitfield bx_reg =
25125b3c049e70834cf33790a28643ab058b507b35cBen Cheng  {
25225b3c049e70834cf33790a28643ab058b507b35cBen Cheng    .name = "ds_bx", .bits = 0, .tmp = 0
25325b3c049e70834cf33790a28643ab058b507b35cBen Cheng  };
25425b3c049e70834cf33790a28643ab058b507b35cBen Cheng
25525b3c049e70834cf33790a28643ab058b507b35cBen Cheng
25625b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic int bitfield_compare (const void *p1, const void *p2);
25725b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic void new_bitfield (char *name, unsigned long int num);
25825b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic void check_bits (struct bitvalue *value);
25925b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic int check_duplicates (struct bitvalue *val);
26025b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic int check_argsdef (struct bitvalue *bitval, struct argument *args);
26125b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic int check_bitsused (struct bitvalue *bitval,
26225b3c049e70834cf33790a28643ab058b507b35cBen Cheng			   struct known_bitfield *suffix,
26325b3c049e70834cf33790a28643ab058b507b35cBen Cheng			   struct argument *args);
26425b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic struct argname *combine (struct argname *name);
26525b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic void fillin_arg (struct bitvalue *bytes, struct argname *name,
26625b3c049e70834cf33790a28643ab058b507b35cBen Cheng			struct instruction *instr, int n);
26725b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic void find_numbers (void);
26825b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic int compare_syn (const void *p1, const void *p2);
26925b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic int compare_suf (const void *p1, const void *p2);
27025b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic void instrtable_out (void);
27125b3c049e70834cf33790a28643ab058b507b35cBen Cheng#if 0
27225b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic void create_mnemonic_table (void);
27325b3c049e70834cf33790a28643ab058b507b35cBen Cheng#endif
27425b3c049e70834cf33790a28643ab058b507b35cBen Cheng
27525b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic void *bitfields;
27625b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic struct instruction *instructions;
27725b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic size_t ninstructions;
27825b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic void *synonyms;
27925b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic void *suffixes;
28025b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic int nsuffixes;
28125b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic void *mnemonics;
28225b3c049e70834cf33790a28643ab058b507b35cBen Chengsize_t nmnemonics;
28325b3c049e70834cf33790a28643ab058b507b35cBen Chengextern FILE *outfile;
28425b3c049e70834cf33790a28643ab058b507b35cBen Cheng
28525b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* Number of bits used mnemonics.  */
28625b3c049e70834cf33790a28643ab058b507b35cBen Cheng#if 0
28725b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic size_t best_mnemonic_bits;
28825b3c049e70834cf33790a28643ab058b507b35cBen Cheng#endif
28925b3c049e70834cf33790a28643ab058b507b35cBen Cheng
29025b3c049e70834cf33790a28643ab058b507b35cBen Cheng
29125b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* Line 268 of yacc.c  */
29225b3c049e70834cf33790a28643ab058b507b35cBen Cheng#line 293 "i386_parse.c"
29325b3c049e70834cf33790a28643ab058b507b35cBen Cheng
29425b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* Enabling traces.  */
29525b3c049e70834cf33790a28643ab058b507b35cBen Cheng#ifndef YYDEBUG
29625b3c049e70834cf33790a28643ab058b507b35cBen Cheng# define YYDEBUG 0
29725b3c049e70834cf33790a28643ab058b507b35cBen Cheng#endif
29825b3c049e70834cf33790a28643ab058b507b35cBen Cheng
29925b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* Enabling verbose error messages.  */
30025b3c049e70834cf33790a28643ab058b507b35cBen Cheng#ifdef YYERROR_VERBOSE
30125b3c049e70834cf33790a28643ab058b507b35cBen Cheng# undef YYERROR_VERBOSE
30225b3c049e70834cf33790a28643ab058b507b35cBen Cheng# define YYERROR_VERBOSE 1
30325b3c049e70834cf33790a28643ab058b507b35cBen Cheng#else
30425b3c049e70834cf33790a28643ab058b507b35cBen Cheng# define YYERROR_VERBOSE 0
30525b3c049e70834cf33790a28643ab058b507b35cBen Cheng#endif
30625b3c049e70834cf33790a28643ab058b507b35cBen Cheng
30725b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* Enabling the token table.  */
30825b3c049e70834cf33790a28643ab058b507b35cBen Cheng#ifndef YYTOKEN_TABLE
30925b3c049e70834cf33790a28643ab058b507b35cBen Cheng# define YYTOKEN_TABLE 0
31025b3c049e70834cf33790a28643ab058b507b35cBen Cheng#endif
31125b3c049e70834cf33790a28643ab058b507b35cBen Cheng
31225b3c049e70834cf33790a28643ab058b507b35cBen Cheng
31325b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* Tokens.  */
31425b3c049e70834cf33790a28643ab058b507b35cBen Cheng#ifndef YYTOKENTYPE
31525b3c049e70834cf33790a28643ab058b507b35cBen Cheng# define YYTOKENTYPE
31625b3c049e70834cf33790a28643ab058b507b35cBen Cheng   /* Put the tokens into the symbol table, so that GDB and other debuggers
31725b3c049e70834cf33790a28643ab058b507b35cBen Cheng      know about them.  */
31825b3c049e70834cf33790a28643ab058b507b35cBen Cheng   enum yytokentype {
31925b3c049e70834cf33790a28643ab058b507b35cBen Cheng     kMASK = 258,
32025b3c049e70834cf33790a28643ab058b507b35cBen Cheng     kPREFIX = 259,
32125b3c049e70834cf33790a28643ab058b507b35cBen Cheng     kSUFFIX = 260,
32225b3c049e70834cf33790a28643ab058b507b35cBen Cheng     kSYNONYM = 261,
32325b3c049e70834cf33790a28643ab058b507b35cBen Cheng     kID = 262,
32425b3c049e70834cf33790a28643ab058b507b35cBen Cheng     kNUMBER = 263,
32525b3c049e70834cf33790a28643ab058b507b35cBen Cheng     kPERCPERC = 264,
32625b3c049e70834cf33790a28643ab058b507b35cBen Cheng     kBITFIELD = 265,
32725b3c049e70834cf33790a28643ab058b507b35cBen Cheng     kCHAR = 266,
32825b3c049e70834cf33790a28643ab058b507b35cBen Cheng     kSPACE = 267
32925b3c049e70834cf33790a28643ab058b507b35cBen Cheng   };
33025b3c049e70834cf33790a28643ab058b507b35cBen Cheng#endif
33125b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* Tokens.  */
33225b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define kMASK 258
33325b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define kPREFIX 259
33425b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define kSUFFIX 260
33525b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define kSYNONYM 261
33625b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define kID 262
33725b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define kNUMBER 263
33825b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define kPERCPERC 264
33925b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define kBITFIELD 265
34025b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define kCHAR 266
34125b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define kSPACE 267
34225b3c049e70834cf33790a28643ab058b507b35cBen Cheng
34325b3c049e70834cf33790a28643ab058b507b35cBen Cheng
34425b3c049e70834cf33790a28643ab058b507b35cBen Cheng
34525b3c049e70834cf33790a28643ab058b507b35cBen Cheng
34625b3c049e70834cf33790a28643ab058b507b35cBen Cheng#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
34725b3c049e70834cf33790a28643ab058b507b35cBen Chengtypedef union YYSTYPE
34825b3c049e70834cf33790a28643ab058b507b35cBen Cheng{
34925b3c049e70834cf33790a28643ab058b507b35cBen Cheng
35025b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* Line 293 of yacc.c  */
35125b3c049e70834cf33790a28643ab058b507b35cBen Cheng#line 214 "i386_parse.y"
35225b3c049e70834cf33790a28643ab058b507b35cBen Cheng
35325b3c049e70834cf33790a28643ab058b507b35cBen Cheng  unsigned long int num;
35425b3c049e70834cf33790a28643ab058b507b35cBen Cheng  char *str;
35525b3c049e70834cf33790a28643ab058b507b35cBen Cheng  char ch;
35625b3c049e70834cf33790a28643ab058b507b35cBen Cheng  struct known_bitfield *field;
35725b3c049e70834cf33790a28643ab058b507b35cBen Cheng  struct bitvalue *bit;
35825b3c049e70834cf33790a28643ab058b507b35cBen Cheng  struct argname *name;
35925b3c049e70834cf33790a28643ab058b507b35cBen Cheng  struct argument *arg;
36025b3c049e70834cf33790a28643ab058b507b35cBen Cheng
36125b3c049e70834cf33790a28643ab058b507b35cBen Cheng
36225b3c049e70834cf33790a28643ab058b507b35cBen Cheng
36325b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* Line 293 of yacc.c  */
36425b3c049e70834cf33790a28643ab058b507b35cBen Cheng#line 365 "i386_parse.c"
36525b3c049e70834cf33790a28643ab058b507b35cBen Cheng} YYSTYPE;
36625b3c049e70834cf33790a28643ab058b507b35cBen Cheng# define YYSTYPE_IS_TRIVIAL 1
36725b3c049e70834cf33790a28643ab058b507b35cBen Cheng# define yystype YYSTYPE /* obsolescent; will be withdrawn */
36825b3c049e70834cf33790a28643ab058b507b35cBen Cheng# define YYSTYPE_IS_DECLARED 1
36925b3c049e70834cf33790a28643ab058b507b35cBen Cheng#endif
37025b3c049e70834cf33790a28643ab058b507b35cBen Cheng
37125b3c049e70834cf33790a28643ab058b507b35cBen Cheng
37225b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* Copy the second part of user declarations.  */
37325b3c049e70834cf33790a28643ab058b507b35cBen Cheng
37425b3c049e70834cf33790a28643ab058b507b35cBen Cheng
37525b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* Line 343 of yacc.c  */
37625b3c049e70834cf33790a28643ab058b507b35cBen Cheng#line 377 "i386_parse.c"
37725b3c049e70834cf33790a28643ab058b507b35cBen Cheng
37825b3c049e70834cf33790a28643ab058b507b35cBen Cheng#ifdef short
37925b3c049e70834cf33790a28643ab058b507b35cBen Cheng# undef short
38025b3c049e70834cf33790a28643ab058b507b35cBen Cheng#endif
38125b3c049e70834cf33790a28643ab058b507b35cBen Cheng
38225b3c049e70834cf33790a28643ab058b507b35cBen Cheng#ifdef YYTYPE_UINT8
38325b3c049e70834cf33790a28643ab058b507b35cBen Chengtypedef YYTYPE_UINT8 yytype_uint8;
38425b3c049e70834cf33790a28643ab058b507b35cBen Cheng#else
38525b3c049e70834cf33790a28643ab058b507b35cBen Chengtypedef unsigned char yytype_uint8;
38625b3c049e70834cf33790a28643ab058b507b35cBen Cheng#endif
38725b3c049e70834cf33790a28643ab058b507b35cBen Cheng
38825b3c049e70834cf33790a28643ab058b507b35cBen Cheng#ifdef YYTYPE_INT8
38925b3c049e70834cf33790a28643ab058b507b35cBen Chengtypedef YYTYPE_INT8 yytype_int8;
39025b3c049e70834cf33790a28643ab058b507b35cBen Cheng#elif (defined __STDC__ || defined __C99__FUNC__ \
39125b3c049e70834cf33790a28643ab058b507b35cBen Cheng     || defined __cplusplus || defined _MSC_VER)
39225b3c049e70834cf33790a28643ab058b507b35cBen Chengtypedef signed char yytype_int8;
39325b3c049e70834cf33790a28643ab058b507b35cBen Cheng#else
39425b3c049e70834cf33790a28643ab058b507b35cBen Chengtypedef short int yytype_int8;
39525b3c049e70834cf33790a28643ab058b507b35cBen Cheng#endif
39625b3c049e70834cf33790a28643ab058b507b35cBen Cheng
39725b3c049e70834cf33790a28643ab058b507b35cBen Cheng#ifdef YYTYPE_UINT16
39825b3c049e70834cf33790a28643ab058b507b35cBen Chengtypedef YYTYPE_UINT16 yytype_uint16;
39925b3c049e70834cf33790a28643ab058b507b35cBen Cheng#else
40025b3c049e70834cf33790a28643ab058b507b35cBen Chengtypedef unsigned short int yytype_uint16;
40125b3c049e70834cf33790a28643ab058b507b35cBen Cheng#endif
40225b3c049e70834cf33790a28643ab058b507b35cBen Cheng
40325b3c049e70834cf33790a28643ab058b507b35cBen Cheng#ifdef YYTYPE_INT16
40425b3c049e70834cf33790a28643ab058b507b35cBen Chengtypedef YYTYPE_INT16 yytype_int16;
40525b3c049e70834cf33790a28643ab058b507b35cBen Cheng#else
40625b3c049e70834cf33790a28643ab058b507b35cBen Chengtypedef short int yytype_int16;
40725b3c049e70834cf33790a28643ab058b507b35cBen Cheng#endif
40825b3c049e70834cf33790a28643ab058b507b35cBen Cheng
40925b3c049e70834cf33790a28643ab058b507b35cBen Cheng#ifndef YYSIZE_T
41025b3c049e70834cf33790a28643ab058b507b35cBen Cheng# ifdef __SIZE_TYPE__
41125b3c049e70834cf33790a28643ab058b507b35cBen Cheng#  define YYSIZE_T __SIZE_TYPE__
41225b3c049e70834cf33790a28643ab058b507b35cBen Cheng# elif defined size_t
41325b3c049e70834cf33790a28643ab058b507b35cBen Cheng#  define YYSIZE_T size_t
41425b3c049e70834cf33790a28643ab058b507b35cBen Cheng# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
41525b3c049e70834cf33790a28643ab058b507b35cBen Cheng     || defined __cplusplus || defined _MSC_VER)
41625b3c049e70834cf33790a28643ab058b507b35cBen Cheng#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
41725b3c049e70834cf33790a28643ab058b507b35cBen Cheng#  define YYSIZE_T size_t
41825b3c049e70834cf33790a28643ab058b507b35cBen Cheng# else
41925b3c049e70834cf33790a28643ab058b507b35cBen Cheng#  define YYSIZE_T unsigned int
42025b3c049e70834cf33790a28643ab058b507b35cBen Cheng# endif
42125b3c049e70834cf33790a28643ab058b507b35cBen Cheng#endif
42225b3c049e70834cf33790a28643ab058b507b35cBen Cheng
42325b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
42425b3c049e70834cf33790a28643ab058b507b35cBen Cheng
42525b3c049e70834cf33790a28643ab058b507b35cBen Cheng#ifndef YY_
42625b3c049e70834cf33790a28643ab058b507b35cBen Cheng# if defined YYENABLE_NLS && YYENABLE_NLS
42725b3c049e70834cf33790a28643ab058b507b35cBen Cheng#  if ENABLE_NLS
42825b3c049e70834cf33790a28643ab058b507b35cBen Cheng#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
42925b3c049e70834cf33790a28643ab058b507b35cBen Cheng#   define YY_(msgid) dgettext ("bison-runtime", msgid)
43025b3c049e70834cf33790a28643ab058b507b35cBen Cheng#  endif
43125b3c049e70834cf33790a28643ab058b507b35cBen Cheng# endif
43225b3c049e70834cf33790a28643ab058b507b35cBen Cheng# ifndef YY_
43325b3c049e70834cf33790a28643ab058b507b35cBen Cheng#  define YY_(msgid) msgid
43425b3c049e70834cf33790a28643ab058b507b35cBen Cheng# endif
43525b3c049e70834cf33790a28643ab058b507b35cBen Cheng#endif
43625b3c049e70834cf33790a28643ab058b507b35cBen Cheng
43725b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* Suppress unused-variable warnings by "using" E.  */
43825b3c049e70834cf33790a28643ab058b507b35cBen Cheng#if ! defined lint || defined __GNUC__
43925b3c049e70834cf33790a28643ab058b507b35cBen Cheng# define YYUSE(e) ((void) (e))
44025b3c049e70834cf33790a28643ab058b507b35cBen Cheng#else
44125b3c049e70834cf33790a28643ab058b507b35cBen Cheng# define YYUSE(e) /* empty */
44225b3c049e70834cf33790a28643ab058b507b35cBen Cheng#endif
44325b3c049e70834cf33790a28643ab058b507b35cBen Cheng
44425b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* Identity function, used to suppress warnings about constant conditions.  */
44525b3c049e70834cf33790a28643ab058b507b35cBen Cheng#ifndef lint
44625b3c049e70834cf33790a28643ab058b507b35cBen Cheng# define YYID(n) (n)
44725b3c049e70834cf33790a28643ab058b507b35cBen Cheng#else
44825b3c049e70834cf33790a28643ab058b507b35cBen Cheng#if (defined __STDC__ || defined __C99__FUNC__ \
44925b3c049e70834cf33790a28643ab058b507b35cBen Cheng     || defined __cplusplus || defined _MSC_VER)
45025b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic int
45125b3c049e70834cf33790a28643ab058b507b35cBen ChengYYID (int yyi)
45225b3c049e70834cf33790a28643ab058b507b35cBen Cheng#else
45325b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic int
45425b3c049e70834cf33790a28643ab058b507b35cBen ChengYYID (yyi)
45525b3c049e70834cf33790a28643ab058b507b35cBen Cheng    int yyi;
45625b3c049e70834cf33790a28643ab058b507b35cBen Cheng#endif
45725b3c049e70834cf33790a28643ab058b507b35cBen Cheng{
45825b3c049e70834cf33790a28643ab058b507b35cBen Cheng  return yyi;
45925b3c049e70834cf33790a28643ab058b507b35cBen Cheng}
46025b3c049e70834cf33790a28643ab058b507b35cBen Cheng#endif
46125b3c049e70834cf33790a28643ab058b507b35cBen Cheng
46225b3c049e70834cf33790a28643ab058b507b35cBen Cheng#if ! defined yyoverflow || YYERROR_VERBOSE
46325b3c049e70834cf33790a28643ab058b507b35cBen Cheng
46425b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* The parser invokes alloca or malloc; define the necessary symbols.  */
46525b3c049e70834cf33790a28643ab058b507b35cBen Cheng
46625b3c049e70834cf33790a28643ab058b507b35cBen Cheng# ifdef YYSTACK_USE_ALLOCA
46725b3c049e70834cf33790a28643ab058b507b35cBen Cheng#  if YYSTACK_USE_ALLOCA
46825b3c049e70834cf33790a28643ab058b507b35cBen Cheng#   ifdef __GNUC__
46925b3c049e70834cf33790a28643ab058b507b35cBen Cheng#    define YYSTACK_ALLOC __builtin_alloca
47025b3c049e70834cf33790a28643ab058b507b35cBen Cheng#   elif defined __BUILTIN_VA_ARG_INCR
47125b3c049e70834cf33790a28643ab058b507b35cBen Cheng#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
47225b3c049e70834cf33790a28643ab058b507b35cBen Cheng#   elif defined _AIX
47325b3c049e70834cf33790a28643ab058b507b35cBen Cheng#    define YYSTACK_ALLOC __alloca
47425b3c049e70834cf33790a28643ab058b507b35cBen Cheng#   elif defined _MSC_VER
47525b3c049e70834cf33790a28643ab058b507b35cBen Cheng#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
47625b3c049e70834cf33790a28643ab058b507b35cBen Cheng#    define alloca _alloca
47725b3c049e70834cf33790a28643ab058b507b35cBen Cheng#   else
47825b3c049e70834cf33790a28643ab058b507b35cBen Cheng#    define YYSTACK_ALLOC alloca
47925b3c049e70834cf33790a28643ab058b507b35cBen Cheng#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
48025b3c049e70834cf33790a28643ab058b507b35cBen Cheng     || defined __cplusplus || defined _MSC_VER)
48125b3c049e70834cf33790a28643ab058b507b35cBen Cheng#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
48225b3c049e70834cf33790a28643ab058b507b35cBen Cheng#     ifndef EXIT_SUCCESS
48325b3c049e70834cf33790a28643ab058b507b35cBen Cheng#      define EXIT_SUCCESS 0
48425b3c049e70834cf33790a28643ab058b507b35cBen Cheng#     endif
48525b3c049e70834cf33790a28643ab058b507b35cBen Cheng#    endif
48625b3c049e70834cf33790a28643ab058b507b35cBen Cheng#   endif
48725b3c049e70834cf33790a28643ab058b507b35cBen Cheng#  endif
48825b3c049e70834cf33790a28643ab058b507b35cBen Cheng# endif
48925b3c049e70834cf33790a28643ab058b507b35cBen Cheng
49025b3c049e70834cf33790a28643ab058b507b35cBen Cheng# ifdef YYSTACK_ALLOC
49125b3c049e70834cf33790a28643ab058b507b35cBen Cheng   /* Pacify GCC's `empty if-body' warning.  */
49225b3c049e70834cf33790a28643ab058b507b35cBen Cheng#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
49325b3c049e70834cf33790a28643ab058b507b35cBen Cheng#  ifndef YYSTACK_ALLOC_MAXIMUM
49425b3c049e70834cf33790a28643ab058b507b35cBen Cheng    /* The OS might guarantee only one guard page at the bottom of the stack,
49525b3c049e70834cf33790a28643ab058b507b35cBen Cheng       and a page size can be as small as 4096 bytes.  So we cannot safely
49625b3c049e70834cf33790a28643ab058b507b35cBen Cheng       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
49725b3c049e70834cf33790a28643ab058b507b35cBen Cheng       to allow for a few compiler-allocated temporary stack slots.  */
49825b3c049e70834cf33790a28643ab058b507b35cBen Cheng#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
49925b3c049e70834cf33790a28643ab058b507b35cBen Cheng#  endif
50025b3c049e70834cf33790a28643ab058b507b35cBen Cheng# else
50125b3c049e70834cf33790a28643ab058b507b35cBen Cheng#  define YYSTACK_ALLOC YYMALLOC
50225b3c049e70834cf33790a28643ab058b507b35cBen Cheng#  define YYSTACK_FREE YYFREE
50325b3c049e70834cf33790a28643ab058b507b35cBen Cheng#  ifndef YYSTACK_ALLOC_MAXIMUM
50425b3c049e70834cf33790a28643ab058b507b35cBen Cheng#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
50525b3c049e70834cf33790a28643ab058b507b35cBen Cheng#  endif
50625b3c049e70834cf33790a28643ab058b507b35cBen Cheng#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
50725b3c049e70834cf33790a28643ab058b507b35cBen Cheng       && ! ((defined YYMALLOC || defined malloc) \
50825b3c049e70834cf33790a28643ab058b507b35cBen Cheng	     && (defined YYFREE || defined free)))
50925b3c049e70834cf33790a28643ab058b507b35cBen Cheng#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
51025b3c049e70834cf33790a28643ab058b507b35cBen Cheng#   ifndef EXIT_SUCCESS
51125b3c049e70834cf33790a28643ab058b507b35cBen Cheng#    define EXIT_SUCCESS 0
51225b3c049e70834cf33790a28643ab058b507b35cBen Cheng#   endif
51325b3c049e70834cf33790a28643ab058b507b35cBen Cheng#  endif
51425b3c049e70834cf33790a28643ab058b507b35cBen Cheng#  ifndef YYMALLOC
51525b3c049e70834cf33790a28643ab058b507b35cBen Cheng#   define YYMALLOC malloc
51625b3c049e70834cf33790a28643ab058b507b35cBen Cheng#   if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
51725b3c049e70834cf33790a28643ab058b507b35cBen Cheng     || defined __cplusplus || defined _MSC_VER)
51825b3c049e70834cf33790a28643ab058b507b35cBen Chengvoid *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
51925b3c049e70834cf33790a28643ab058b507b35cBen Cheng#   endif
52025b3c049e70834cf33790a28643ab058b507b35cBen Cheng#  endif
52125b3c049e70834cf33790a28643ab058b507b35cBen Cheng#  ifndef YYFREE
52225b3c049e70834cf33790a28643ab058b507b35cBen Cheng#   define YYFREE free
52325b3c049e70834cf33790a28643ab058b507b35cBen Cheng#   if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
52425b3c049e70834cf33790a28643ab058b507b35cBen Cheng     || defined __cplusplus || defined _MSC_VER)
52525b3c049e70834cf33790a28643ab058b507b35cBen Chengvoid free (void *); /* INFRINGES ON USER NAME SPACE */
52625b3c049e70834cf33790a28643ab058b507b35cBen Cheng#   endif
52725b3c049e70834cf33790a28643ab058b507b35cBen Cheng#  endif
52825b3c049e70834cf33790a28643ab058b507b35cBen Cheng# endif
52925b3c049e70834cf33790a28643ab058b507b35cBen Cheng#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
53025b3c049e70834cf33790a28643ab058b507b35cBen Cheng
53125b3c049e70834cf33790a28643ab058b507b35cBen Cheng
53225b3c049e70834cf33790a28643ab058b507b35cBen Cheng#if (! defined yyoverflow \
53325b3c049e70834cf33790a28643ab058b507b35cBen Cheng     && (! defined __cplusplus \
53425b3c049e70834cf33790a28643ab058b507b35cBen Cheng	 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
53525b3c049e70834cf33790a28643ab058b507b35cBen Cheng
53625b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* A type that is properly aligned for any stack member.  */
53725b3c049e70834cf33790a28643ab058b507b35cBen Chengunion yyalloc
53825b3c049e70834cf33790a28643ab058b507b35cBen Cheng{
53925b3c049e70834cf33790a28643ab058b507b35cBen Cheng  yytype_int16 yyss_alloc;
54025b3c049e70834cf33790a28643ab058b507b35cBen Cheng  YYSTYPE yyvs_alloc;
54125b3c049e70834cf33790a28643ab058b507b35cBen Cheng};
54225b3c049e70834cf33790a28643ab058b507b35cBen Cheng
54325b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* The size of the maximum gap between one aligned stack and the next.  */
54425b3c049e70834cf33790a28643ab058b507b35cBen Cheng# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
54525b3c049e70834cf33790a28643ab058b507b35cBen Cheng
54625b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* The size of an array large to enough to hold all stacks, each with
54725b3c049e70834cf33790a28643ab058b507b35cBen Cheng   N elements.  */
54825b3c049e70834cf33790a28643ab058b507b35cBen Cheng# define YYSTACK_BYTES(N) \
54925b3c049e70834cf33790a28643ab058b507b35cBen Cheng     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
55025b3c049e70834cf33790a28643ab058b507b35cBen Cheng      + YYSTACK_GAP_MAXIMUM)
55125b3c049e70834cf33790a28643ab058b507b35cBen Cheng
55225b3c049e70834cf33790a28643ab058b507b35cBen Cheng# define YYCOPY_NEEDED 1
55325b3c049e70834cf33790a28643ab058b507b35cBen Cheng
55425b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* Relocate STACK from its old location to the new one.  The
55525b3c049e70834cf33790a28643ab058b507b35cBen Cheng   local variables YYSIZE and YYSTACKSIZE give the old and new number of
55625b3c049e70834cf33790a28643ab058b507b35cBen Cheng   elements in the stack, and YYPTR gives the new location of the
55725b3c049e70834cf33790a28643ab058b507b35cBen Cheng   stack.  Advance YYPTR to a properly aligned location for the next
55825b3c049e70834cf33790a28643ab058b507b35cBen Cheng   stack.  */
55925b3c049e70834cf33790a28643ab058b507b35cBen Cheng# define YYSTACK_RELOCATE(Stack_alloc, Stack)				\
56025b3c049e70834cf33790a28643ab058b507b35cBen Cheng    do									\
56125b3c049e70834cf33790a28643ab058b507b35cBen Cheng      {									\
56225b3c049e70834cf33790a28643ab058b507b35cBen Cheng	YYSIZE_T yynewbytes;						\
56325b3c049e70834cf33790a28643ab058b507b35cBen Cheng	YYCOPY (&yyptr->Stack_alloc, Stack, yysize);			\
56425b3c049e70834cf33790a28643ab058b507b35cBen Cheng	Stack = &yyptr->Stack_alloc;					\
56525b3c049e70834cf33790a28643ab058b507b35cBen Cheng	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
56625b3c049e70834cf33790a28643ab058b507b35cBen Cheng	yyptr += yynewbytes / sizeof (*yyptr);				\
56725b3c049e70834cf33790a28643ab058b507b35cBen Cheng      }									\
56825b3c049e70834cf33790a28643ab058b507b35cBen Cheng    while (YYID (0))
56925b3c049e70834cf33790a28643ab058b507b35cBen Cheng
57025b3c049e70834cf33790a28643ab058b507b35cBen Cheng#endif
57125b3c049e70834cf33790a28643ab058b507b35cBen Cheng
57225b3c049e70834cf33790a28643ab058b507b35cBen Cheng#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
57325b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* Copy COUNT objects from FROM to TO.  The source and destination do
57425b3c049e70834cf33790a28643ab058b507b35cBen Cheng   not overlap.  */
57525b3c049e70834cf33790a28643ab058b507b35cBen Cheng# ifndef YYCOPY
57625b3c049e70834cf33790a28643ab058b507b35cBen Cheng#  if defined __GNUC__ && 1 < __GNUC__
57725b3c049e70834cf33790a28643ab058b507b35cBen Cheng#   define YYCOPY(To, From, Count) \
57825b3c049e70834cf33790a28643ab058b507b35cBen Cheng      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
57925b3c049e70834cf33790a28643ab058b507b35cBen Cheng#  else
58025b3c049e70834cf33790a28643ab058b507b35cBen Cheng#   define YYCOPY(To, From, Count)		\
58125b3c049e70834cf33790a28643ab058b507b35cBen Cheng      do					\
58225b3c049e70834cf33790a28643ab058b507b35cBen Cheng	{					\
58325b3c049e70834cf33790a28643ab058b507b35cBen Cheng	  YYSIZE_T yyi;				\
58425b3c049e70834cf33790a28643ab058b507b35cBen Cheng	  for (yyi = 0; yyi < (Count); yyi++)	\
58525b3c049e70834cf33790a28643ab058b507b35cBen Cheng	    (To)[yyi] = (From)[yyi];		\
58625b3c049e70834cf33790a28643ab058b507b35cBen Cheng	}					\
58725b3c049e70834cf33790a28643ab058b507b35cBen Cheng      while (YYID (0))
58825b3c049e70834cf33790a28643ab058b507b35cBen Cheng#  endif
58925b3c049e70834cf33790a28643ab058b507b35cBen Cheng# endif
59025b3c049e70834cf33790a28643ab058b507b35cBen Cheng#endif /* !YYCOPY_NEEDED */
59125b3c049e70834cf33790a28643ab058b507b35cBen Cheng
59225b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* YYFINAL -- State number of the termination state.  */
59325b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define YYFINAL  12
59425b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* YYLAST -- Last index in YYTABLE.  */
59525b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define YYLAST   37
59625b3c049e70834cf33790a28643ab058b507b35cBen Cheng
59725b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* YYNTOKENS -- Number of terminals.  */
59825b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define YYNTOKENS  18
59925b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* YYNNTS -- Number of nonterminals.  */
60025b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define YYNNTS  14
60125b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* YYNRULES -- Number of rules.  */
60225b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define YYNRULES  32
60325b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* YYNRULES -- Number of states.  */
60425b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define YYNSTATES  49
60525b3c049e70834cf33790a28643ab058b507b35cBen Cheng
60625b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
60725b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define YYUNDEFTOK  2
60825b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define YYMAXUTOK   267
60925b3c049e70834cf33790a28643ab058b507b35cBen Cheng
61025b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define YYTRANSLATE(YYX)						\
61125b3c049e70834cf33790a28643ab058b507b35cBen Cheng  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
61225b3c049e70834cf33790a28643ab058b507b35cBen Cheng
61325b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
61425b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic const yytype_uint8 yytranslate[] =
61525b3c049e70834cf33790a28643ab058b507b35cBen Cheng{
61625b3c049e70834cf33790a28643ab058b507b35cBen Cheng       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
61725b3c049e70834cf33790a28643ab058b507b35cBen Cheng      13,     2,     2,     2,     2,     2,     2,     2,     2,     2,
61825b3c049e70834cf33790a28643ab058b507b35cBen Cheng       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
61925b3c049e70834cf33790a28643ab058b507b35cBen Cheng       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
62025b3c049e70834cf33790a28643ab058b507b35cBen Cheng       2,     2,     2,     2,    15,     2,     2,     2,    16,    17,
62125b3c049e70834cf33790a28643ab058b507b35cBen Cheng       2,     2,     2,     2,     2,     2,     2,     2,    14,     2,
62225b3c049e70834cf33790a28643ab058b507b35cBen Cheng       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
62325b3c049e70834cf33790a28643ab058b507b35cBen Cheng       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
62425b3c049e70834cf33790a28643ab058b507b35cBen Cheng       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
62525b3c049e70834cf33790a28643ab058b507b35cBen Cheng       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
62625b3c049e70834cf33790a28643ab058b507b35cBen Cheng       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
62725b3c049e70834cf33790a28643ab058b507b35cBen Cheng       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
62825b3c049e70834cf33790a28643ab058b507b35cBen Cheng       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
62925b3c049e70834cf33790a28643ab058b507b35cBen Cheng       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
63025b3c049e70834cf33790a28643ab058b507b35cBen Cheng       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
63125b3c049e70834cf33790a28643ab058b507b35cBen Cheng       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
63225b3c049e70834cf33790a28643ab058b507b35cBen Cheng       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
63325b3c049e70834cf33790a28643ab058b507b35cBen Cheng       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
63425b3c049e70834cf33790a28643ab058b507b35cBen Cheng       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
63525b3c049e70834cf33790a28643ab058b507b35cBen Cheng       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
63625b3c049e70834cf33790a28643ab058b507b35cBen Cheng       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
63725b3c049e70834cf33790a28643ab058b507b35cBen Cheng       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
63825b3c049e70834cf33790a28643ab058b507b35cBen Cheng       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
63925b3c049e70834cf33790a28643ab058b507b35cBen Cheng       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
64025b3c049e70834cf33790a28643ab058b507b35cBen Cheng       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
64125b3c049e70834cf33790a28643ab058b507b35cBen Cheng       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
64225b3c049e70834cf33790a28643ab058b507b35cBen Cheng       5,     6,     7,     8,     9,    10,    11,    12
64325b3c049e70834cf33790a28643ab058b507b35cBen Cheng};
64425b3c049e70834cf33790a28643ab058b507b35cBen Cheng
64525b3c049e70834cf33790a28643ab058b507b35cBen Cheng#if YYDEBUG
64625b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
64725b3c049e70834cf33790a28643ab058b507b35cBen Cheng   YYRHS.  */
64825b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic const yytype_uint8 yyprhs[] =
64925b3c049e70834cf33790a28643ab058b507b35cBen Cheng{
65025b3c049e70834cf33790a28643ab058b507b35cBen Cheng       0,     0,     3,     8,    12,    14,    18,    21,    24,    28,
65125b3c049e70834cf33790a28643ab058b507b35cBen Cheng      29,    33,    35,    42,    43,    45,    46,    50,    52,    55,
65225b3c049e70834cf33790a28643ab058b507b35cBen Cheng      57,    59,    61,    63,    66,    67,    71,    73,    76,    78,
65325b3c049e70834cf33790a28643ab058b507b35cBen Cheng      80,    82,    84
65425b3c049e70834cf33790a28643ab058b507b35cBen Cheng};
65525b3c049e70834cf33790a28643ab058b507b35cBen Cheng
65625b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
65725b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic const yytype_int8 yyrhs[] =
65825b3c049e70834cf33790a28643ab058b507b35cBen Cheng{
65925b3c049e70834cf33790a28643ab058b507b35cBen Cheng      19,     0,    -1,    20,     9,    13,    22,    -1,    20,    13,
66025b3c049e70834cf33790a28643ab058b507b35cBen Cheng      21,    -1,    21,    -1,     3,    10,     8,    -1,     4,    10,
66125b3c049e70834cf33790a28643ab058b507b35cBen Cheng      -1,     5,    10,    -1,     6,    10,    10,    -1,    -1,    22,
66225b3c049e70834cf33790a28643ab058b507b35cBen Cheng      13,    23,    -1,    23,    -1,    25,    14,    24,     7,    24,
66325b3c049e70834cf33790a28643ab058b507b35cBen Cheng      28,    -1,    -1,    10,    -1,    -1,    25,    15,    26,    -1,
66425b3c049e70834cf33790a28643ab058b507b35cBen Cheng      26,    -1,    26,    27,    -1,    27,    -1,    16,    -1,    17,
66525b3c049e70834cf33790a28643ab058b507b35cBen Cheng      -1,    10,    -1,    12,    29,    -1,    -1,    29,    15,    30,
66625b3c049e70834cf33790a28643ab058b507b35cBen Cheng      -1,    30,    -1,    30,    31,    -1,    31,    -1,    10,    -1,
66725b3c049e70834cf33790a28643ab058b507b35cBen Cheng      11,    -1,     7,    -1,    14,    -1
66825b3c049e70834cf33790a28643ab058b507b35cBen Cheng};
66925b3c049e70834cf33790a28643ab058b507b35cBen Cheng
67025b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
67125b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic const yytype_uint16 yyrline[] =
67225b3c049e70834cf33790a28643ab058b507b35cBen Cheng{
67325b3c049e70834cf33790a28643ab058b507b35cBen Cheng       0,   244,   244,   254,   255,   258,   260,   262,   264,   276,
67425b3c049e70834cf33790a28643ab058b507b35cBen Cheng     279,   280,   283,   366,   369,   385,   388,   398,   405,   413,
67525b3c049e70834cf33790a28643ab058b507b35cBen Cheng     417,   424,   431,   453,   456,   459,   469,   477,   485,   488,
67625b3c049e70834cf33790a28643ab058b507b35cBen Cheng     520,   529,   536
67725b3c049e70834cf33790a28643ab058b507b35cBen Cheng};
67825b3c049e70834cf33790a28643ab058b507b35cBen Cheng#endif
67925b3c049e70834cf33790a28643ab058b507b35cBen Cheng
68025b3c049e70834cf33790a28643ab058b507b35cBen Cheng#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
68125b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
68225b3c049e70834cf33790a28643ab058b507b35cBen Cheng   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
68325b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic const char *const yytname[] =
68425b3c049e70834cf33790a28643ab058b507b35cBen Cheng{
68525b3c049e70834cf33790a28643ab058b507b35cBen Cheng  "$end", "error", "$undefined", "kMASK", "kPREFIX", "kSUFFIX",
68625b3c049e70834cf33790a28643ab058b507b35cBen Cheng  "kSYNONYM", "kID", "kNUMBER", "kPERCPERC", "kBITFIELD", "kCHAR",
68725b3c049e70834cf33790a28643ab058b507b35cBen Cheng  "kSPACE", "'\\n'", "':'", "','", "'0'", "'1'", "$accept", "spec",
68825b3c049e70834cf33790a28643ab058b507b35cBen Cheng  "masks", "mask", "instrs", "instr", "bitfieldopt", "bytes", "byte",
68925b3c049e70834cf33790a28643ab058b507b35cBen Cheng  "bit", "optargs", "args", "arg", "argcomp", 0
69025b3c049e70834cf33790a28643ab058b507b35cBen Cheng};
69125b3c049e70834cf33790a28643ab058b507b35cBen Cheng#endif
69225b3c049e70834cf33790a28643ab058b507b35cBen Cheng
69325b3c049e70834cf33790a28643ab058b507b35cBen Cheng# ifdef YYPRINT
69425b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
69525b3c049e70834cf33790a28643ab058b507b35cBen Cheng   token YYLEX-NUM.  */
69625b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic const yytype_uint16 yytoknum[] =
69725b3c049e70834cf33790a28643ab058b507b35cBen Cheng{
69825b3c049e70834cf33790a28643ab058b507b35cBen Cheng       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
69925b3c049e70834cf33790a28643ab058b507b35cBen Cheng     265,   266,   267,    10,    58,    44,    48,    49
70025b3c049e70834cf33790a28643ab058b507b35cBen Cheng};
70125b3c049e70834cf33790a28643ab058b507b35cBen Cheng# endif
70225b3c049e70834cf33790a28643ab058b507b35cBen Cheng
70325b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
70425b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic const yytype_uint8 yyr1[] =
70525b3c049e70834cf33790a28643ab058b507b35cBen Cheng{
70625b3c049e70834cf33790a28643ab058b507b35cBen Cheng       0,    18,    19,    20,    20,    21,    21,    21,    21,    21,
70725b3c049e70834cf33790a28643ab058b507b35cBen Cheng      22,    22,    23,    23,    24,    24,    25,    25,    26,    26,
70825b3c049e70834cf33790a28643ab058b507b35cBen Cheng      27,    27,    27,    28,    28,    29,    29,    30,    30,    31,
70925b3c049e70834cf33790a28643ab058b507b35cBen Cheng      31,    31,    31
71025b3c049e70834cf33790a28643ab058b507b35cBen Cheng};
71125b3c049e70834cf33790a28643ab058b507b35cBen Cheng
71225b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
71325b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic const yytype_uint8 yyr2[] =
71425b3c049e70834cf33790a28643ab058b507b35cBen Cheng{
71525b3c049e70834cf33790a28643ab058b507b35cBen Cheng       0,     2,     4,     3,     1,     3,     2,     2,     3,     0,
71625b3c049e70834cf33790a28643ab058b507b35cBen Cheng       3,     1,     6,     0,     1,     0,     3,     1,     2,     1,
71725b3c049e70834cf33790a28643ab058b507b35cBen Cheng       1,     1,     1,     2,     0,     3,     1,     2,     1,     1,
71825b3c049e70834cf33790a28643ab058b507b35cBen Cheng       1,     1,     1
71925b3c049e70834cf33790a28643ab058b507b35cBen Cheng};
72025b3c049e70834cf33790a28643ab058b507b35cBen Cheng
72125b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
72225b3c049e70834cf33790a28643ab058b507b35cBen Cheng   Performed when YYTABLE doesn't specify something else to do.  Zero
72325b3c049e70834cf33790a28643ab058b507b35cBen Cheng   means the default is an error.  */
72425b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic const yytype_uint8 yydefact[] =
72525b3c049e70834cf33790a28643ab058b507b35cBen Cheng{
72625b3c049e70834cf33790a28643ab058b507b35cBen Cheng       9,     0,     0,     0,     0,     0,     0,     4,     0,     6,
72725b3c049e70834cf33790a28643ab058b507b35cBen Cheng       7,     0,     1,     0,     9,     5,     8,    13,     3,    22,
72825b3c049e70834cf33790a28643ab058b507b35cBen Cheng      20,    21,     2,    11,     0,    17,    19,    13,    15,     0,
72925b3c049e70834cf33790a28643ab058b507b35cBen Cheng      18,    10,    14,     0,    16,    15,    24,     0,    12,    31,
73025b3c049e70834cf33790a28643ab058b507b35cBen Cheng      29,    30,    32,    23,    26,    28,     0,    27,    25
73125b3c049e70834cf33790a28643ab058b507b35cBen Cheng};
73225b3c049e70834cf33790a28643ab058b507b35cBen Cheng
73325b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* YYDEFGOTO[NTERM-NUM].  */
73425b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic const yytype_int8 yydefgoto[] =
73525b3c049e70834cf33790a28643ab058b507b35cBen Cheng{
73625b3c049e70834cf33790a28643ab058b507b35cBen Cheng      -1,     5,     6,     7,    22,    23,    33,    24,    25,    26,
73725b3c049e70834cf33790a28643ab058b507b35cBen Cheng      38,    43,    44,    45
73825b3c049e70834cf33790a28643ab058b507b35cBen Cheng};
73925b3c049e70834cf33790a28643ab058b507b35cBen Cheng
74025b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
74125b3c049e70834cf33790a28643ab058b507b35cBen Cheng   STATE-NUM.  */
74225b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define YYPACT_NINF -35
74325b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic const yytype_int8 yypact[] =
74425b3c049e70834cf33790a28643ab058b507b35cBen Cheng{
74525b3c049e70834cf33790a28643ab058b507b35cBen Cheng      12,     9,    10,    11,    13,    22,    -2,   -35,    16,   -35,
74625b3c049e70834cf33790a28643ab058b507b35cBen Cheng     -35,    15,   -35,    14,    12,   -35,   -35,    -4,   -35,   -35,
74725b3c049e70834cf33790a28643ab058b507b35cBen Cheng     -35,   -35,    17,   -35,   -12,    -4,   -35,    -4,    18,    -4,
74825b3c049e70834cf33790a28643ab058b507b35cBen Cheng     -35,   -35,   -35,    19,    -4,    18,    20,    -6,   -35,   -35,
74925b3c049e70834cf33790a28643ab058b507b35cBen Cheng     -35,   -35,   -35,    21,    -6,   -35,    -6,   -35,    -6
75025b3c049e70834cf33790a28643ab058b507b35cBen Cheng};
75125b3c049e70834cf33790a28643ab058b507b35cBen Cheng
75225b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* YYPGOTO[NTERM-NUM].  */
75325b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic const yytype_int8 yypgoto[] =
75425b3c049e70834cf33790a28643ab058b507b35cBen Cheng{
75525b3c049e70834cf33790a28643ab058b507b35cBen Cheng     -35,   -35,   -35,    23,   -35,     2,    -1,   -35,     4,   -25,
75625b3c049e70834cf33790a28643ab058b507b35cBen Cheng     -35,   -35,   -15,   -34
75725b3c049e70834cf33790a28643ab058b507b35cBen Cheng};
75825b3c049e70834cf33790a28643ab058b507b35cBen Cheng
75925b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
76025b3c049e70834cf33790a28643ab058b507b35cBen Cheng   positive, shift that token.  If negative, reduce the rule which
76125b3c049e70834cf33790a28643ab058b507b35cBen Cheng   number is the opposite.  If YYTABLE_NINF, syntax error.  */
76225b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define YYTABLE_NINF -1
76325b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic const yytype_uint8 yytable[] =
76425b3c049e70834cf33790a28643ab058b507b35cBen Cheng{
76525b3c049e70834cf33790a28643ab058b507b35cBen Cheng      30,    39,    28,    29,    40,    41,    19,    13,    42,    30,
76625b3c049e70834cf33790a28643ab058b507b35cBen Cheng      47,    14,    20,    21,    47,     1,     2,     3,     4,     8,
76725b3c049e70834cf33790a28643ab058b507b35cBen Cheng       9,    10,    12,    11,    15,    16,    35,    17,    32,    31,
76825b3c049e70834cf33790a28643ab058b507b35cBen Cheng      27,    48,    37,    34,    36,     0,    46,    18
76925b3c049e70834cf33790a28643ab058b507b35cBen Cheng};
77025b3c049e70834cf33790a28643ab058b507b35cBen Cheng
77125b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define yypact_value_is_default(yystate) \
77225b3c049e70834cf33790a28643ab058b507b35cBen Cheng  ((yystate) == (-35))
77325b3c049e70834cf33790a28643ab058b507b35cBen Cheng
77425b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define yytable_value_is_error(yytable_value) \
77525b3c049e70834cf33790a28643ab058b507b35cBen Cheng  YYID (0)
77625b3c049e70834cf33790a28643ab058b507b35cBen Cheng
77725b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic const yytype_int8 yycheck[] =
77825b3c049e70834cf33790a28643ab058b507b35cBen Cheng{
77925b3c049e70834cf33790a28643ab058b507b35cBen Cheng      25,     7,    14,    15,    10,    11,    10,     9,    14,    34,
78025b3c049e70834cf33790a28643ab058b507b35cBen Cheng      44,    13,    16,    17,    48,     3,     4,     5,     6,    10,
78125b3c049e70834cf33790a28643ab058b507b35cBen Cheng      10,    10,     0,    10,     8,    10,     7,    13,    10,    27,
78225b3c049e70834cf33790a28643ab058b507b35cBen Cheng      13,    46,    12,    29,    35,    -1,    15,    14
78325b3c049e70834cf33790a28643ab058b507b35cBen Cheng};
78425b3c049e70834cf33790a28643ab058b507b35cBen Cheng
78525b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
78625b3c049e70834cf33790a28643ab058b507b35cBen Cheng   symbol of state STATE-NUM.  */
78725b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic const yytype_uint8 yystos[] =
78825b3c049e70834cf33790a28643ab058b507b35cBen Cheng{
78925b3c049e70834cf33790a28643ab058b507b35cBen Cheng       0,     3,     4,     5,     6,    19,    20,    21,    10,    10,
79025b3c049e70834cf33790a28643ab058b507b35cBen Cheng      10,    10,     0,     9,    13,     8,    10,    13,    21,    10,
79125b3c049e70834cf33790a28643ab058b507b35cBen Cheng      16,    17,    22,    23,    25,    26,    27,    13,    14,    15,
79225b3c049e70834cf33790a28643ab058b507b35cBen Cheng      27,    23,    10,    24,    26,     7,    24,    12,    28,     7,
79325b3c049e70834cf33790a28643ab058b507b35cBen Cheng      10,    11,    14,    29,    30,    31,    15,    31,    30
79425b3c049e70834cf33790a28643ab058b507b35cBen Cheng};
79525b3c049e70834cf33790a28643ab058b507b35cBen Cheng
79625b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define yyerrok		(yyerrstatus = 0)
79725b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define yyclearin	(yychar = YYEMPTY)
79825b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define YYEMPTY		(-2)
79925b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define YYEOF		0
80025b3c049e70834cf33790a28643ab058b507b35cBen Cheng
80125b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define YYACCEPT	goto yyacceptlab
80225b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define YYABORT		goto yyabortlab
80325b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define YYERROR		goto yyerrorlab
80425b3c049e70834cf33790a28643ab058b507b35cBen Cheng
80525b3c049e70834cf33790a28643ab058b507b35cBen Cheng
80625b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* Like YYERROR except do call yyerror.  This remains here temporarily
80725b3c049e70834cf33790a28643ab058b507b35cBen Cheng   to ease the transition to the new meaning of YYERROR, for GCC.
80825b3c049e70834cf33790a28643ab058b507b35cBen Cheng   Once GCC version 2 has supplanted version 1, this can go.  However,
80925b3c049e70834cf33790a28643ab058b507b35cBen Cheng   YYFAIL appears to be in use.  Nevertheless, it is formally deprecated
81025b3c049e70834cf33790a28643ab058b507b35cBen Cheng   in Bison 2.4.2's NEWS entry, where a plan to phase it out is
81125b3c049e70834cf33790a28643ab058b507b35cBen Cheng   discussed.  */
81225b3c049e70834cf33790a28643ab058b507b35cBen Cheng
81325b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define YYFAIL		goto yyerrlab
81425b3c049e70834cf33790a28643ab058b507b35cBen Cheng#if defined YYFAIL
81525b3c049e70834cf33790a28643ab058b507b35cBen Cheng  /* This is here to suppress warnings from the GCC cpp's
81625b3c049e70834cf33790a28643ab058b507b35cBen Cheng     -Wunused-macros.  Normally we don't worry about that warning, but
81725b3c049e70834cf33790a28643ab058b507b35cBen Cheng     some users do, and we want to make it easy for users to remove
81825b3c049e70834cf33790a28643ab058b507b35cBen Cheng     YYFAIL uses, which will produce warnings from Bison 2.5.  */
81925b3c049e70834cf33790a28643ab058b507b35cBen Cheng#endif
82025b3c049e70834cf33790a28643ab058b507b35cBen Cheng
82125b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define YYRECOVERING()  (!!yyerrstatus)
82225b3c049e70834cf33790a28643ab058b507b35cBen Cheng
82325b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define YYBACKUP(Token, Value)					\
82425b3c049e70834cf33790a28643ab058b507b35cBen Chengdo								\
82525b3c049e70834cf33790a28643ab058b507b35cBen Cheng  if (yychar == YYEMPTY && yylen == 1)				\
82625b3c049e70834cf33790a28643ab058b507b35cBen Cheng    {								\
82725b3c049e70834cf33790a28643ab058b507b35cBen Cheng      yychar = (Token);						\
82825b3c049e70834cf33790a28643ab058b507b35cBen Cheng      yylval = (Value);						\
82925b3c049e70834cf33790a28643ab058b507b35cBen Cheng      YYPOPSTACK (1);						\
83025b3c049e70834cf33790a28643ab058b507b35cBen Cheng      goto yybackup;						\
83125b3c049e70834cf33790a28643ab058b507b35cBen Cheng    }								\
83225b3c049e70834cf33790a28643ab058b507b35cBen Cheng  else								\
83325b3c049e70834cf33790a28643ab058b507b35cBen Cheng    {								\
83425b3c049e70834cf33790a28643ab058b507b35cBen Cheng      yyerror (YY_("syntax error: cannot back up")); \
83525b3c049e70834cf33790a28643ab058b507b35cBen Cheng      YYERROR;							\
83625b3c049e70834cf33790a28643ab058b507b35cBen Cheng    }								\
83725b3c049e70834cf33790a28643ab058b507b35cBen Chengwhile (YYID (0))
83825b3c049e70834cf33790a28643ab058b507b35cBen Cheng
83925b3c049e70834cf33790a28643ab058b507b35cBen Cheng
84025b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define YYTERROR	1
84125b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define YYERRCODE	256
84225b3c049e70834cf33790a28643ab058b507b35cBen Cheng
84325b3c049e70834cf33790a28643ab058b507b35cBen Cheng
84425b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
84525b3c049e70834cf33790a28643ab058b507b35cBen Cheng   If N is 0, then set CURRENT to the empty location which ends
84625b3c049e70834cf33790a28643ab058b507b35cBen Cheng   the previous symbol: RHS[0] (always defined).  */
84725b3c049e70834cf33790a28643ab058b507b35cBen Cheng
84825b3c049e70834cf33790a28643ab058b507b35cBen Cheng#define YYRHSLOC(Rhs, K) ((Rhs)[K])
84925b3c049e70834cf33790a28643ab058b507b35cBen Cheng#ifndef YYLLOC_DEFAULT
85025b3c049e70834cf33790a28643ab058b507b35cBen Cheng# define YYLLOC_DEFAULT(Current, Rhs, N)				\
85125b3c049e70834cf33790a28643ab058b507b35cBen Cheng    do									\
85225b3c049e70834cf33790a28643ab058b507b35cBen Cheng      if (YYID (N))                                                    \
85325b3c049e70834cf33790a28643ab058b507b35cBen Cheng	{								\
85425b3c049e70834cf33790a28643ab058b507b35cBen Cheng	  (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;	\
85525b3c049e70834cf33790a28643ab058b507b35cBen Cheng	  (Current).first_column = YYRHSLOC (Rhs, 1).first_column;	\
85625b3c049e70834cf33790a28643ab058b507b35cBen Cheng	  (Current).last_line    = YYRHSLOC (Rhs, N).last_line;		\
85725b3c049e70834cf33790a28643ab058b507b35cBen Cheng	  (Current).last_column  = YYRHSLOC (Rhs, N).last_column;	\
85825b3c049e70834cf33790a28643ab058b507b35cBen Cheng	}								\
85925b3c049e70834cf33790a28643ab058b507b35cBen Cheng      else								\
86025b3c049e70834cf33790a28643ab058b507b35cBen Cheng	{								\
86125b3c049e70834cf33790a28643ab058b507b35cBen Cheng	  (Current).first_line   = (Current).last_line   =		\
86225b3c049e70834cf33790a28643ab058b507b35cBen Cheng	    YYRHSLOC (Rhs, 0).last_line;				\
86325b3c049e70834cf33790a28643ab058b507b35cBen Cheng	  (Current).first_column = (Current).last_column =		\
86425b3c049e70834cf33790a28643ab058b507b35cBen Cheng	    YYRHSLOC (Rhs, 0).last_column;				\
86525b3c049e70834cf33790a28643ab058b507b35cBen Cheng	}								\
86625b3c049e70834cf33790a28643ab058b507b35cBen Cheng    while (YYID (0))
86725b3c049e70834cf33790a28643ab058b507b35cBen Cheng#endif
86825b3c049e70834cf33790a28643ab058b507b35cBen Cheng
86925b3c049e70834cf33790a28643ab058b507b35cBen Cheng
87025b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* This macro is provided for backward compatibility. */
87125b3c049e70834cf33790a28643ab058b507b35cBen Cheng
87225b3c049e70834cf33790a28643ab058b507b35cBen Cheng#ifndef YY_LOCATION_PRINT
87325b3c049e70834cf33790a28643ab058b507b35cBen Cheng# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
87425b3c049e70834cf33790a28643ab058b507b35cBen Cheng#endif
87525b3c049e70834cf33790a28643ab058b507b35cBen Cheng
87625b3c049e70834cf33790a28643ab058b507b35cBen Cheng
87725b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* YYLEX -- calling `yylex' with the right arguments.  */
87825b3c049e70834cf33790a28643ab058b507b35cBen Cheng
87925b3c049e70834cf33790a28643ab058b507b35cBen Cheng#ifdef YYLEX_PARAM
88025b3c049e70834cf33790a28643ab058b507b35cBen Cheng# define YYLEX yylex (YYLEX_PARAM)
88125b3c049e70834cf33790a28643ab058b507b35cBen Cheng#else
88225b3c049e70834cf33790a28643ab058b507b35cBen Cheng# define YYLEX yylex ()
88325b3c049e70834cf33790a28643ab058b507b35cBen Cheng#endif
88425b3c049e70834cf33790a28643ab058b507b35cBen Cheng
88525b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* Enable debugging if requested.  */
88625b3c049e70834cf33790a28643ab058b507b35cBen Cheng#if YYDEBUG
88725b3c049e70834cf33790a28643ab058b507b35cBen Cheng
88825b3c049e70834cf33790a28643ab058b507b35cBen Cheng# ifndef YYFPRINTF
88925b3c049e70834cf33790a28643ab058b507b35cBen Cheng#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
89025b3c049e70834cf33790a28643ab058b507b35cBen Cheng#  define YYFPRINTF fprintf
89125b3c049e70834cf33790a28643ab058b507b35cBen Cheng# endif
89225b3c049e70834cf33790a28643ab058b507b35cBen Cheng
89325b3c049e70834cf33790a28643ab058b507b35cBen Cheng# define YYDPRINTF(Args)			\
89425b3c049e70834cf33790a28643ab058b507b35cBen Chengdo {						\
89525b3c049e70834cf33790a28643ab058b507b35cBen Cheng  if (yydebug)					\
89625b3c049e70834cf33790a28643ab058b507b35cBen Cheng    YYFPRINTF Args;				\
89725b3c049e70834cf33790a28643ab058b507b35cBen Cheng} while (YYID (0))
89825b3c049e70834cf33790a28643ab058b507b35cBen Cheng
89925b3c049e70834cf33790a28643ab058b507b35cBen Cheng# define YY_SYMBOL_PRINT(Title, Type, Value, Location)			  \
90025b3c049e70834cf33790a28643ab058b507b35cBen Chengdo {									  \
90125b3c049e70834cf33790a28643ab058b507b35cBen Cheng  if (yydebug)								  \
90225b3c049e70834cf33790a28643ab058b507b35cBen Cheng    {									  \
90325b3c049e70834cf33790a28643ab058b507b35cBen Cheng      YYFPRINTF (stderr, "%s ", Title);					  \
90425b3c049e70834cf33790a28643ab058b507b35cBen Cheng      yy_symbol_print (stderr,						  \
90525b3c049e70834cf33790a28643ab058b507b35cBen Cheng		  Type, Value); \
90625b3c049e70834cf33790a28643ab058b507b35cBen Cheng      YYFPRINTF (stderr, "\n");						  \
90725b3c049e70834cf33790a28643ab058b507b35cBen Cheng    }									  \
90825b3c049e70834cf33790a28643ab058b507b35cBen Cheng} while (YYID (0))
90925b3c049e70834cf33790a28643ab058b507b35cBen Cheng
91025b3c049e70834cf33790a28643ab058b507b35cBen Cheng
91125b3c049e70834cf33790a28643ab058b507b35cBen Cheng/*--------------------------------.
91225b3c049e70834cf33790a28643ab058b507b35cBen Cheng| Print this symbol on YYOUTPUT.  |
91325b3c049e70834cf33790a28643ab058b507b35cBen Cheng`--------------------------------*/
91425b3c049e70834cf33790a28643ab058b507b35cBen Cheng
91525b3c049e70834cf33790a28643ab058b507b35cBen Cheng/*ARGSUSED*/
91625b3c049e70834cf33790a28643ab058b507b35cBen Cheng#if (defined __STDC__ || defined __C99__FUNC__ \
91725b3c049e70834cf33790a28643ab058b507b35cBen Cheng     || defined __cplusplus || defined _MSC_VER)
91825b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic void
91925b3c049e70834cf33790a28643ab058b507b35cBen Chengyy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
92025b3c049e70834cf33790a28643ab058b507b35cBen Cheng#else
92125b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic void
92225b3c049e70834cf33790a28643ab058b507b35cBen Chengyy_symbol_value_print (yyoutput, yytype, yyvaluep)
92325b3c049e70834cf33790a28643ab058b507b35cBen Cheng    FILE *yyoutput;
92425b3c049e70834cf33790a28643ab058b507b35cBen Cheng    int yytype;
92525b3c049e70834cf33790a28643ab058b507b35cBen Cheng    YYSTYPE const * const yyvaluep;
92625b3c049e70834cf33790a28643ab058b507b35cBen Cheng#endif
92725b3c049e70834cf33790a28643ab058b507b35cBen Cheng{
92825b3c049e70834cf33790a28643ab058b507b35cBen Cheng  if (!yyvaluep)
92925b3c049e70834cf33790a28643ab058b507b35cBen Cheng    return;
93025b3c049e70834cf33790a28643ab058b507b35cBen Cheng# ifdef YYPRINT
93125b3c049e70834cf33790a28643ab058b507b35cBen Cheng  if (yytype < YYNTOKENS)
93225b3c049e70834cf33790a28643ab058b507b35cBen Cheng    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
93325b3c049e70834cf33790a28643ab058b507b35cBen Cheng# else
93425b3c049e70834cf33790a28643ab058b507b35cBen Cheng  YYUSE (yyoutput);
93525b3c049e70834cf33790a28643ab058b507b35cBen Cheng# endif
93625b3c049e70834cf33790a28643ab058b507b35cBen Cheng  switch (yytype)
93725b3c049e70834cf33790a28643ab058b507b35cBen Cheng    {
93825b3c049e70834cf33790a28643ab058b507b35cBen Cheng      default:
93925b3c049e70834cf33790a28643ab058b507b35cBen Cheng	break;
94025b3c049e70834cf33790a28643ab058b507b35cBen Cheng    }
94125b3c049e70834cf33790a28643ab058b507b35cBen Cheng}
94225b3c049e70834cf33790a28643ab058b507b35cBen Cheng
94325b3c049e70834cf33790a28643ab058b507b35cBen Cheng
94425b3c049e70834cf33790a28643ab058b507b35cBen Cheng/*--------------------------------.
94525b3c049e70834cf33790a28643ab058b507b35cBen Cheng| Print this symbol on YYOUTPUT.  |
94625b3c049e70834cf33790a28643ab058b507b35cBen Cheng`--------------------------------*/
94725b3c049e70834cf33790a28643ab058b507b35cBen Cheng
94825b3c049e70834cf33790a28643ab058b507b35cBen Cheng#if (defined __STDC__ || defined __C99__FUNC__ \
94925b3c049e70834cf33790a28643ab058b507b35cBen Cheng     || defined __cplusplus || defined _MSC_VER)
95025b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic void
95125b3c049e70834cf33790a28643ab058b507b35cBen Chengyy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
95225b3c049e70834cf33790a28643ab058b507b35cBen Cheng#else
95325b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic void
95425b3c049e70834cf33790a28643ab058b507b35cBen Chengyy_symbol_print (yyoutput, yytype, yyvaluep)
95525b3c049e70834cf33790a28643ab058b507b35cBen Cheng    FILE *yyoutput;
95625b3c049e70834cf33790a28643ab058b507b35cBen Cheng    int yytype;
95725b3c049e70834cf33790a28643ab058b507b35cBen Cheng    YYSTYPE const * const yyvaluep;
95825b3c049e70834cf33790a28643ab058b507b35cBen Cheng#endif
95925b3c049e70834cf33790a28643ab058b507b35cBen Cheng{
96025b3c049e70834cf33790a28643ab058b507b35cBen Cheng  if (yytype < YYNTOKENS)
96125b3c049e70834cf33790a28643ab058b507b35cBen Cheng    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
96225b3c049e70834cf33790a28643ab058b507b35cBen Cheng  else
96325b3c049e70834cf33790a28643ab058b507b35cBen Cheng    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
96425b3c049e70834cf33790a28643ab058b507b35cBen Cheng
96525b3c049e70834cf33790a28643ab058b507b35cBen Cheng  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
96625b3c049e70834cf33790a28643ab058b507b35cBen Cheng  YYFPRINTF (yyoutput, ")");
96725b3c049e70834cf33790a28643ab058b507b35cBen Cheng}
96825b3c049e70834cf33790a28643ab058b507b35cBen Cheng
96925b3c049e70834cf33790a28643ab058b507b35cBen Cheng/*------------------------------------------------------------------.
97025b3c049e70834cf33790a28643ab058b507b35cBen Cheng| yy_stack_print -- Print the state stack from its BOTTOM up to its |
97125b3c049e70834cf33790a28643ab058b507b35cBen Cheng| TOP (included).                                                   |
97225b3c049e70834cf33790a28643ab058b507b35cBen Cheng`------------------------------------------------------------------*/
97325b3c049e70834cf33790a28643ab058b507b35cBen Cheng
97425b3c049e70834cf33790a28643ab058b507b35cBen Cheng#if (defined __STDC__ || defined __C99__FUNC__ \
97525b3c049e70834cf33790a28643ab058b507b35cBen Cheng     || defined __cplusplus || defined _MSC_VER)
97625b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic void
97725b3c049e70834cf33790a28643ab058b507b35cBen Chengyy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
97825b3c049e70834cf33790a28643ab058b507b35cBen Cheng#else
97925b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic void
98025b3c049e70834cf33790a28643ab058b507b35cBen Chengyy_stack_print (yybottom, yytop)
98125b3c049e70834cf33790a28643ab058b507b35cBen Cheng    yytype_int16 *yybottom;
98225b3c049e70834cf33790a28643ab058b507b35cBen Cheng    yytype_int16 *yytop;
98325b3c049e70834cf33790a28643ab058b507b35cBen Cheng#endif
98425b3c049e70834cf33790a28643ab058b507b35cBen Cheng{
98525b3c049e70834cf33790a28643ab058b507b35cBen Cheng  YYFPRINTF (stderr, "Stack now");
98625b3c049e70834cf33790a28643ab058b507b35cBen Cheng  for (; yybottom <= yytop; yybottom++)
98725b3c049e70834cf33790a28643ab058b507b35cBen Cheng    {
98825b3c049e70834cf33790a28643ab058b507b35cBen Cheng      int yybot = *yybottom;
98925b3c049e70834cf33790a28643ab058b507b35cBen Cheng      YYFPRINTF (stderr, " %d", yybot);
99025b3c049e70834cf33790a28643ab058b507b35cBen Cheng    }
99125b3c049e70834cf33790a28643ab058b507b35cBen Cheng  YYFPRINTF (stderr, "\n");
99225b3c049e70834cf33790a28643ab058b507b35cBen Cheng}
99325b3c049e70834cf33790a28643ab058b507b35cBen Cheng
99425b3c049e70834cf33790a28643ab058b507b35cBen Cheng# define YY_STACK_PRINT(Bottom, Top)				\
99525b3c049e70834cf33790a28643ab058b507b35cBen Chengdo {								\
99625b3c049e70834cf33790a28643ab058b507b35cBen Cheng  if (yydebug)							\
99725b3c049e70834cf33790a28643ab058b507b35cBen Cheng    yy_stack_print ((Bottom), (Top));				\
99825b3c049e70834cf33790a28643ab058b507b35cBen Cheng} while (YYID (0))
99925b3c049e70834cf33790a28643ab058b507b35cBen Cheng
100025b3c049e70834cf33790a28643ab058b507b35cBen Cheng
100125b3c049e70834cf33790a28643ab058b507b35cBen Cheng/*------------------------------------------------.
100225b3c049e70834cf33790a28643ab058b507b35cBen Cheng| Report that the YYRULE is going to be reduced.  |
100325b3c049e70834cf33790a28643ab058b507b35cBen Cheng`------------------------------------------------*/
100425b3c049e70834cf33790a28643ab058b507b35cBen Cheng
100525b3c049e70834cf33790a28643ab058b507b35cBen Cheng#if (defined __STDC__ || defined __C99__FUNC__ \
100625b3c049e70834cf33790a28643ab058b507b35cBen Cheng     || defined __cplusplus || defined _MSC_VER)
100725b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic void
100825b3c049e70834cf33790a28643ab058b507b35cBen Chengyy_reduce_print (YYSTYPE *yyvsp, int yyrule)
100925b3c049e70834cf33790a28643ab058b507b35cBen Cheng#else
101025b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic void
101125b3c049e70834cf33790a28643ab058b507b35cBen Chengyy_reduce_print (yyvsp, yyrule)
101225b3c049e70834cf33790a28643ab058b507b35cBen Cheng    YYSTYPE *yyvsp;
101325b3c049e70834cf33790a28643ab058b507b35cBen Cheng    int yyrule;
101425b3c049e70834cf33790a28643ab058b507b35cBen Cheng#endif
101525b3c049e70834cf33790a28643ab058b507b35cBen Cheng{
101625b3c049e70834cf33790a28643ab058b507b35cBen Cheng  int yynrhs = yyr2[yyrule];
101725b3c049e70834cf33790a28643ab058b507b35cBen Cheng  int yyi;
101825b3c049e70834cf33790a28643ab058b507b35cBen Cheng  unsigned long int yylno = yyrline[yyrule];
101925b3c049e70834cf33790a28643ab058b507b35cBen Cheng  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
102025b3c049e70834cf33790a28643ab058b507b35cBen Cheng	     yyrule - 1, yylno);
102125b3c049e70834cf33790a28643ab058b507b35cBen Cheng  /* The symbols being reduced.  */
102225b3c049e70834cf33790a28643ab058b507b35cBen Cheng  for (yyi = 0; yyi < yynrhs; yyi++)
102325b3c049e70834cf33790a28643ab058b507b35cBen Cheng    {
102425b3c049e70834cf33790a28643ab058b507b35cBen Cheng      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
102525b3c049e70834cf33790a28643ab058b507b35cBen Cheng      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
102625b3c049e70834cf33790a28643ab058b507b35cBen Cheng		       &(yyvsp[(yyi + 1) - (yynrhs)])
102725b3c049e70834cf33790a28643ab058b507b35cBen Cheng		       		       );
102825b3c049e70834cf33790a28643ab058b507b35cBen Cheng      YYFPRINTF (stderr, "\n");
102925b3c049e70834cf33790a28643ab058b507b35cBen Cheng    }
103025b3c049e70834cf33790a28643ab058b507b35cBen Cheng}
103125b3c049e70834cf33790a28643ab058b507b35cBen Cheng
103225b3c049e70834cf33790a28643ab058b507b35cBen Cheng# define YY_REDUCE_PRINT(Rule)		\
103325b3c049e70834cf33790a28643ab058b507b35cBen Chengdo {					\
103425b3c049e70834cf33790a28643ab058b507b35cBen Cheng  if (yydebug)				\
103525b3c049e70834cf33790a28643ab058b507b35cBen Cheng    yy_reduce_print (yyvsp, Rule); \
103625b3c049e70834cf33790a28643ab058b507b35cBen Cheng} while (YYID (0))
103725b3c049e70834cf33790a28643ab058b507b35cBen Cheng
103825b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* Nonzero means print parse trace.  It is left uninitialized so that
103925b3c049e70834cf33790a28643ab058b507b35cBen Cheng   multiple parsers can coexist.  */
104025b3c049e70834cf33790a28643ab058b507b35cBen Chengint yydebug;
104125b3c049e70834cf33790a28643ab058b507b35cBen Cheng#else /* !YYDEBUG */
104225b3c049e70834cf33790a28643ab058b507b35cBen Cheng# define YYDPRINTF(Args)
104325b3c049e70834cf33790a28643ab058b507b35cBen Cheng# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
104425b3c049e70834cf33790a28643ab058b507b35cBen Cheng# define YY_STACK_PRINT(Bottom, Top)
104525b3c049e70834cf33790a28643ab058b507b35cBen Cheng# define YY_REDUCE_PRINT(Rule)
104625b3c049e70834cf33790a28643ab058b507b35cBen Cheng#endif /* !YYDEBUG */
104725b3c049e70834cf33790a28643ab058b507b35cBen Cheng
104825b3c049e70834cf33790a28643ab058b507b35cBen Cheng
104925b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* YYINITDEPTH -- initial size of the parser's stacks.  */
105025b3c049e70834cf33790a28643ab058b507b35cBen Cheng#ifndef	YYINITDEPTH
105125b3c049e70834cf33790a28643ab058b507b35cBen Cheng# define YYINITDEPTH 200
105225b3c049e70834cf33790a28643ab058b507b35cBen Cheng#endif
105325b3c049e70834cf33790a28643ab058b507b35cBen Cheng
105425b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
105525b3c049e70834cf33790a28643ab058b507b35cBen Cheng   if the built-in stack extension method is used).
105625b3c049e70834cf33790a28643ab058b507b35cBen Cheng
105725b3c049e70834cf33790a28643ab058b507b35cBen Cheng   Do not make this value too large; the results are undefined if
105825b3c049e70834cf33790a28643ab058b507b35cBen Cheng   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
105925b3c049e70834cf33790a28643ab058b507b35cBen Cheng   evaluated with infinite-precision integer arithmetic.  */
106025b3c049e70834cf33790a28643ab058b507b35cBen Cheng
106125b3c049e70834cf33790a28643ab058b507b35cBen Cheng#ifndef YYMAXDEPTH
106225b3c049e70834cf33790a28643ab058b507b35cBen Cheng# define YYMAXDEPTH 10000
106325b3c049e70834cf33790a28643ab058b507b35cBen Cheng#endif
106425b3c049e70834cf33790a28643ab058b507b35cBen Cheng
106525b3c049e70834cf33790a28643ab058b507b35cBen Cheng
106625b3c049e70834cf33790a28643ab058b507b35cBen Cheng#if YYERROR_VERBOSE
106725b3c049e70834cf33790a28643ab058b507b35cBen Cheng
106825b3c049e70834cf33790a28643ab058b507b35cBen Cheng# ifndef yystrlen
106925b3c049e70834cf33790a28643ab058b507b35cBen Cheng#  if defined __GLIBC__ && defined _STRING_H
107025b3c049e70834cf33790a28643ab058b507b35cBen Cheng#   define yystrlen strlen
107125b3c049e70834cf33790a28643ab058b507b35cBen Cheng#  else
107225b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* Return the length of YYSTR.  */
107325b3c049e70834cf33790a28643ab058b507b35cBen Cheng#if (defined __STDC__ || defined __C99__FUNC__ \
107425b3c049e70834cf33790a28643ab058b507b35cBen Cheng     || defined __cplusplus || defined _MSC_VER)
107525b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic YYSIZE_T
107625b3c049e70834cf33790a28643ab058b507b35cBen Chengyystrlen (const char *yystr)
107725b3c049e70834cf33790a28643ab058b507b35cBen Cheng#else
107825b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic YYSIZE_T
107925b3c049e70834cf33790a28643ab058b507b35cBen Chengyystrlen (yystr)
108025b3c049e70834cf33790a28643ab058b507b35cBen Cheng    const char *yystr;
108125b3c049e70834cf33790a28643ab058b507b35cBen Cheng#endif
108225b3c049e70834cf33790a28643ab058b507b35cBen Cheng{
108325b3c049e70834cf33790a28643ab058b507b35cBen Cheng  YYSIZE_T yylen;
108425b3c049e70834cf33790a28643ab058b507b35cBen Cheng  for (yylen = 0; yystr[yylen]; yylen++)
108525b3c049e70834cf33790a28643ab058b507b35cBen Cheng    continue;
108625b3c049e70834cf33790a28643ab058b507b35cBen Cheng  return yylen;
108725b3c049e70834cf33790a28643ab058b507b35cBen Cheng}
108825b3c049e70834cf33790a28643ab058b507b35cBen Cheng#  endif
108925b3c049e70834cf33790a28643ab058b507b35cBen Cheng# endif
109025b3c049e70834cf33790a28643ab058b507b35cBen Cheng
109125b3c049e70834cf33790a28643ab058b507b35cBen Cheng# ifndef yystpcpy
109225b3c049e70834cf33790a28643ab058b507b35cBen Cheng#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
109325b3c049e70834cf33790a28643ab058b507b35cBen Cheng#   define yystpcpy stpcpy
109425b3c049e70834cf33790a28643ab058b507b35cBen Cheng#  else
109525b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
109625b3c049e70834cf33790a28643ab058b507b35cBen Cheng   YYDEST.  */
109725b3c049e70834cf33790a28643ab058b507b35cBen Cheng#if (defined __STDC__ || defined __C99__FUNC__ \
109825b3c049e70834cf33790a28643ab058b507b35cBen Cheng     || defined __cplusplus || defined _MSC_VER)
109925b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic char *
110025b3c049e70834cf33790a28643ab058b507b35cBen Chengyystpcpy (char *yydest, const char *yysrc)
110125b3c049e70834cf33790a28643ab058b507b35cBen Cheng#else
110225b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic char *
110325b3c049e70834cf33790a28643ab058b507b35cBen Chengyystpcpy (yydest, yysrc)
110425b3c049e70834cf33790a28643ab058b507b35cBen Cheng    char *yydest;
110525b3c049e70834cf33790a28643ab058b507b35cBen Cheng    const char *yysrc;
110625b3c049e70834cf33790a28643ab058b507b35cBen Cheng#endif
110725b3c049e70834cf33790a28643ab058b507b35cBen Cheng{
110825b3c049e70834cf33790a28643ab058b507b35cBen Cheng  char *yyd = yydest;
110925b3c049e70834cf33790a28643ab058b507b35cBen Cheng  const char *yys = yysrc;
111025b3c049e70834cf33790a28643ab058b507b35cBen Cheng
111125b3c049e70834cf33790a28643ab058b507b35cBen Cheng  while ((*yyd++ = *yys++) != '\0')
111225b3c049e70834cf33790a28643ab058b507b35cBen Cheng    continue;
111325b3c049e70834cf33790a28643ab058b507b35cBen Cheng
111425b3c049e70834cf33790a28643ab058b507b35cBen Cheng  return yyd - 1;
111525b3c049e70834cf33790a28643ab058b507b35cBen Cheng}
111625b3c049e70834cf33790a28643ab058b507b35cBen Cheng#  endif
111725b3c049e70834cf33790a28643ab058b507b35cBen Cheng# endif
111825b3c049e70834cf33790a28643ab058b507b35cBen Cheng
111925b3c049e70834cf33790a28643ab058b507b35cBen Cheng# ifndef yytnamerr
112025b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
112125b3c049e70834cf33790a28643ab058b507b35cBen Cheng   quotes and backslashes, so that it's suitable for yyerror.  The
112225b3c049e70834cf33790a28643ab058b507b35cBen Cheng   heuristic is that double-quoting is unnecessary unless the string
112325b3c049e70834cf33790a28643ab058b507b35cBen Cheng   contains an apostrophe, a comma, or backslash (other than
112425b3c049e70834cf33790a28643ab058b507b35cBen Cheng   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
112525b3c049e70834cf33790a28643ab058b507b35cBen Cheng   null, do not copy; instead, return the length of what the result
112625b3c049e70834cf33790a28643ab058b507b35cBen Cheng   would have been.  */
112725b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic YYSIZE_T
112825b3c049e70834cf33790a28643ab058b507b35cBen Chengyytnamerr (char *yyres, const char *yystr)
112925b3c049e70834cf33790a28643ab058b507b35cBen Cheng{
113025b3c049e70834cf33790a28643ab058b507b35cBen Cheng  if (*yystr == '"')
113125b3c049e70834cf33790a28643ab058b507b35cBen Cheng    {
113225b3c049e70834cf33790a28643ab058b507b35cBen Cheng      YYSIZE_T yyn = 0;
113325b3c049e70834cf33790a28643ab058b507b35cBen Cheng      char const *yyp = yystr;
113425b3c049e70834cf33790a28643ab058b507b35cBen Cheng
113525b3c049e70834cf33790a28643ab058b507b35cBen Cheng      for (;;)
113625b3c049e70834cf33790a28643ab058b507b35cBen Cheng	switch (*++yyp)
113725b3c049e70834cf33790a28643ab058b507b35cBen Cheng	  {
113825b3c049e70834cf33790a28643ab058b507b35cBen Cheng	  case '\'':
113925b3c049e70834cf33790a28643ab058b507b35cBen Cheng	  case ',':
114025b3c049e70834cf33790a28643ab058b507b35cBen Cheng	    goto do_not_strip_quotes;
114125b3c049e70834cf33790a28643ab058b507b35cBen Cheng
114225b3c049e70834cf33790a28643ab058b507b35cBen Cheng	  case '\\':
114325b3c049e70834cf33790a28643ab058b507b35cBen Cheng	    if (*++yyp != '\\')
114425b3c049e70834cf33790a28643ab058b507b35cBen Cheng	      goto do_not_strip_quotes;
114525b3c049e70834cf33790a28643ab058b507b35cBen Cheng	    /* Fall through.  */
114625b3c049e70834cf33790a28643ab058b507b35cBen Cheng	  default:
114725b3c049e70834cf33790a28643ab058b507b35cBen Cheng	    if (yyres)
114825b3c049e70834cf33790a28643ab058b507b35cBen Cheng	      yyres[yyn] = *yyp;
114925b3c049e70834cf33790a28643ab058b507b35cBen Cheng	    yyn++;
115025b3c049e70834cf33790a28643ab058b507b35cBen Cheng	    break;
115125b3c049e70834cf33790a28643ab058b507b35cBen Cheng
115225b3c049e70834cf33790a28643ab058b507b35cBen Cheng	  case '"':
115325b3c049e70834cf33790a28643ab058b507b35cBen Cheng	    if (yyres)
115425b3c049e70834cf33790a28643ab058b507b35cBen Cheng	      yyres[yyn] = '\0';
115525b3c049e70834cf33790a28643ab058b507b35cBen Cheng	    return yyn;
115625b3c049e70834cf33790a28643ab058b507b35cBen Cheng	  }
115725b3c049e70834cf33790a28643ab058b507b35cBen Cheng    do_not_strip_quotes: ;
115825b3c049e70834cf33790a28643ab058b507b35cBen Cheng    }
115925b3c049e70834cf33790a28643ab058b507b35cBen Cheng
116025b3c049e70834cf33790a28643ab058b507b35cBen Cheng  if (! yyres)
116125b3c049e70834cf33790a28643ab058b507b35cBen Cheng    return yystrlen (yystr);
116225b3c049e70834cf33790a28643ab058b507b35cBen Cheng
116325b3c049e70834cf33790a28643ab058b507b35cBen Cheng  return yystpcpy (yyres, yystr) - yyres;
116425b3c049e70834cf33790a28643ab058b507b35cBen Cheng}
116525b3c049e70834cf33790a28643ab058b507b35cBen Cheng# endif
116625b3c049e70834cf33790a28643ab058b507b35cBen Cheng
116725b3c049e70834cf33790a28643ab058b507b35cBen Cheng/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
116825b3c049e70834cf33790a28643ab058b507b35cBen Cheng   about the unexpected token YYTOKEN for the state stack whose top is
116925b3c049e70834cf33790a28643ab058b507b35cBen Cheng   YYSSP.
117025b3c049e70834cf33790a28643ab058b507b35cBen Cheng
117125b3c049e70834cf33790a28643ab058b507b35cBen Cheng   Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
117225b3c049e70834cf33790a28643ab058b507b35cBen Cheng   not large enough to hold the message.  In that case, also set
117325b3c049e70834cf33790a28643ab058b507b35cBen Cheng   *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
117425b3c049e70834cf33790a28643ab058b507b35cBen Cheng   required number of bytes is too large to store.  */
117525b3c049e70834cf33790a28643ab058b507b35cBen Chengstatic int
117625b3c049e70834cf33790a28643ab058b507b35cBen Chengyysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
117725b3c049e70834cf33790a28643ab058b507b35cBen Cheng                yytype_int16 *yyssp, int yytoken)
117825b3c049e70834cf33790a28643ab058b507b35cBen Cheng{
117925b3c049e70834cf33790a28643ab058b507b35cBen Cheng  YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
118025b3c049e70834cf33790a28643ab058b507b35cBen Cheng  YYSIZE_T yysize = yysize0;
118125b3c049e70834cf33790a28643ab058b507b35cBen Cheng  YYSIZE_T yysize1;
118225b3c049e70834cf33790a28643ab058b507b35cBen Cheng  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
118325b3c049e70834cf33790a28643ab058b507b35cBen Cheng  /* Internationalized format string. */
118425b3c049e70834cf33790a28643ab058b507b35cBen Cheng  const char *yyformat = 0;
118525b3c049e70834cf33790a28643ab058b507b35cBen Cheng  /* Arguments of yyformat. */
118625b3c049e70834cf33790a28643ab058b507b35cBen Cheng  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
118725b3c049e70834cf33790a28643ab058b507b35cBen Cheng  /* Number of reported tokens (one for the "unexpected", one per
118825b3c049e70834cf33790a28643ab058b507b35cBen Cheng     "expected"). */
118925b3c049e70834cf33790a28643ab058b507b35cBen Cheng  int yycount = 0;
119025b3c049e70834cf33790a28643ab058b507b35cBen Cheng
119125b3c049e70834cf33790a28643ab058b507b35cBen Cheng  /* There are many possibilities here to consider:
119225b3c049e70834cf33790a28643ab058b507b35cBen Cheng     - Assume YYFAIL is not used.  It's too flawed to consider.  See
119325b3c049e70834cf33790a28643ab058b507b35cBen Cheng       <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
119425b3c049e70834cf33790a28643ab058b507b35cBen Cheng       for details.  YYERROR is fine as it does not invoke this
119525b3c049e70834cf33790a28643ab058b507b35cBen Cheng       function.
119625b3c049e70834cf33790a28643ab058b507b35cBen Cheng     - If this state is a consistent state with a default action, then
119725b3c049e70834cf33790a28643ab058b507b35cBen Cheng       the only way this function was invoked is if the default action
119825b3c049e70834cf33790a28643ab058b507b35cBen Cheng       is an error action.  In that case, don't check for expected
119925b3c049e70834cf33790a28643ab058b507b35cBen Cheng       tokens because there are none.
120025b3c049e70834cf33790a28643ab058b507b35cBen Cheng     - The only way there can be no lookahead present (in yychar) is if
120125b3c049e70834cf33790a28643ab058b507b35cBen Cheng       this state is a consistent state with a default action.  Thus,
120225b3c049e70834cf33790a28643ab058b507b35cBen Cheng       detecting the absence of a lookahead is sufficient to determine
120325b3c049e70834cf33790a28643ab058b507b35cBen Cheng       that there is no unexpected or expected token to report.  In that
120425b3c049e70834cf33790a28643ab058b507b35cBen Cheng       case, just report a simple "syntax error".
120525b3c049e70834cf33790a28643ab058b507b35cBen Cheng     - Don't assume there isn't a lookahead just because this state is a
120625b3c049e70834cf33790a28643ab058b507b35cBen Cheng       consistent state with a default action.  There might have been a
120725b3c049e70834cf33790a28643ab058b507b35cBen Cheng       previous inconsistent state, consistent state with a non-default
120825b3c049e70834cf33790a28643ab058b507b35cBen Cheng       action, or user semantic action that manipulated yychar.
120925b3c049e70834cf33790a28643ab058b507b35cBen Cheng     - Of course, the expected token list depends on states to have
121025b3c049e70834cf33790a28643ab058b507b35cBen Cheng       correct lookahead information, and it depends on the parser not
121125b3c049e70834cf33790a28643ab058b507b35cBen Cheng       to perform extra reductions after fetching a lookahead from the
121225b3c049e70834cf33790a28643ab058b507b35cBen Cheng       scanner and before detecting a syntax error.  Thus, state merging
121325b3c049e70834cf33790a28643ab058b507b35cBen Cheng       (from LALR or IELR) and default reductions corrupt the expected
121425b3c049e70834cf33790a28643ab058b507b35cBen Cheng       token list.  However, the list is correct for canonical LR with
121525b3c049e70834cf33790a28643ab058b507b35cBen Cheng       one exception: it will still contain any token that will not be
121625b3c049e70834cf33790a28643ab058b507b35cBen Cheng       accepted due to an error action in a later state.
121725b3c049e70834cf33790a28643ab058b507b35cBen Cheng  */
121825b3c049e70834cf33790a28643ab058b507b35cBen Cheng  if (yytoken != YYEMPTY)
121925b3c049e70834cf33790a28643ab058b507b35cBen Cheng    {
122025b3c049e70834cf33790a28643ab058b507b35cBen Cheng      int yyn = yypact[*yyssp];
122125b3c049e70834cf33790a28643ab058b507b35cBen Cheng      yyarg[yycount++] = yytname[yytoken];
122225b3c049e70834cf33790a28643ab058b507b35cBen Cheng      if (!yypact_value_is_default (yyn))
122325b3c049e70834cf33790a28643ab058b507b35cBen Cheng        {
122425b3c049e70834cf33790a28643ab058b507b35cBen Cheng          /* Start YYX at -YYN if negative to avoid negative indexes in
122525b3c049e70834cf33790a28643ab058b507b35cBen Cheng             YYCHECK.  In other words, skip the first -YYN actions for
122625b3c049e70834cf33790a28643ab058b507b35cBen Cheng             this state because they are default actions.  */
122725b3c049e70834cf33790a28643ab058b507b35cBen Cheng          int yyxbegin = yyn < 0 ? -yyn : 0;
122825b3c049e70834cf33790a28643ab058b507b35cBen Cheng          /* Stay within bounds of both yycheck and yytname.  */
122925b3c049e70834cf33790a28643ab058b507b35cBen Cheng          int yychecklim = YYLAST - yyn + 1;
123025b3c049e70834cf33790a28643ab058b507b35cBen Cheng          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
123125b3c049e70834cf33790a28643ab058b507b35cBen Cheng          int yyx;
123225b3c049e70834cf33790a28643ab058b507b35cBen Cheng
123325b3c049e70834cf33790a28643ab058b507b35cBen Cheng          for (yyx = yyxbegin; yyx < yyxend; ++yyx)
123425b3c049e70834cf33790a28643ab058b507b35cBen Cheng            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
123525b3c049e70834cf33790a28643ab058b507b35cBen Cheng                && !yytable_value_is_error (yytable[yyx + yyn]))
123625b3c049e70834cf33790a28643ab058b507b35cBen Cheng              {
123725b3c049e70834cf33790a28643ab058b507b35cBen Cheng                if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
123825b3c049e70834cf33790a28643ab058b507b35cBen Cheng                  {
123925b3c049e70834cf33790a28643ab058b507b35cBen Cheng                    yycount = 1;
124025b3c049e70834cf33790a28643ab058b507b35cBen Cheng                    yysize = yysize0;
124125b3c049e70834cf33790a28643ab058b507b35cBen Cheng                    break;
124225b3c049e70834cf33790a28643ab058b507b35cBen Cheng                  }
124325b3c049e70834cf33790a28643ab058b507b35cBen Cheng                yyarg[yycount++] = yytname[yyx];
124425b3c049e70834cf33790a28643ab058b507b35cBen Cheng                yysize1 = yysize + yytnamerr (0, yytname[yyx]);
124525b3c049e70834cf33790a28643ab058b507b35cBen Cheng                if (! (yysize <= yysize1
124625b3c049e70834cf33790a28643ab058b507b35cBen Cheng                       && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
124725b3c049e70834cf33790a28643ab058b507b35cBen Cheng                  return 2;
124825b3c049e70834cf33790a28643ab058b507b35cBen Cheng                yysize = yysize1;
124925b3c049e70834cf33790a28643ab058b507b35cBen Cheng              }
125025b3c049e70834cf33790a28643ab058b507b35cBen Cheng        }
125125b3c049e70834cf33790a28643ab058b507b35cBen Cheng    }
125225b3c049e70834cf33790a28643ab058b507b35cBen Cheng
125325b3c049e70834cf33790a28643ab058b507b35cBen Cheng  switch (yycount)
125425b3c049e70834cf33790a28643ab058b507b35cBen Cheng    {
125525b3c049e70834cf33790a28643ab058b507b35cBen Cheng# define YYCASE_(N, S)                      \
125625b3c049e70834cf33790a28643ab058b507b35cBen Cheng      case N:                               \
125725b3c049e70834cf33790a28643ab058b507b35cBen Cheng        yyformat = S;                       \
125825b3c049e70834cf33790a28643ab058b507b35cBen Cheng      break
125925b3c049e70834cf33790a28643ab058b507b35cBen Cheng      YYCASE_(0, YY_("syntax error"));
126025b3c049e70834cf33790a28643ab058b507b35cBen Cheng      YYCASE_(1, YY_("syntax error, unexpected %s"));
126125b3c049e70834cf33790a28643ab058b507b35cBen Cheng      YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
126225b3c049e70834cf33790a28643ab058b507b35cBen Cheng      YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
126325b3c049e70834cf33790a28643ab058b507b35cBen Cheng      YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
126425b3c049e70834cf33790a28643ab058b507b35cBen Cheng      YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
126525b3c049e70834cf33790a28643ab058b507b35cBen Cheng# undef YYCASE_
126625b3c049e70834cf33790a28643ab058b507b35cBen Cheng    }
126725b3c049e70834cf33790a28643ab058b507b35cBen Cheng
1268