• Main Page
  • Related Pages
  • Data Structures
  • Files
  • File List
  • Globals

src/libsphinxbase/lm/jsgf_parser.c

00001 
00002 /* A Bison parser, made by GNU Bison 2.4.1.  */
00003 
00004 /* Skeleton implementation for Bison's Yacc-like parsers in C
00005    
00006       Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
00007    Free Software Foundation, Inc.
00008    
00009    This program is free software: you can redistribute it and/or modify
00010    it under the terms of the GNU General Public License as published by
00011    the Free Software Foundation, either version 3 of the License, or
00012    (at your option) any later version.
00013    
00014    This program is distributed in the hope that it will be useful,
00015    but WITHOUT ANY WARRANTY; without even the implied warranty of
00016    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017    GNU General Public License for more details.
00018    
00019    You should have received a copy of the GNU General Public License
00020    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
00021 
00022 /* As a special exception, you may create a larger work that contains
00023    part or all of the Bison parser skeleton and distribute that work
00024    under terms of your choice, so long as that work isn't itself a
00025    parser generator using the skeleton or a modified version thereof
00026    as a parser skeleton.  Alternatively, if you modify or redistribute
00027    the parser skeleton itself, you may (at your option) remove this
00028    special exception, which will cause the skeleton and the resulting
00029    Bison output files to be licensed under the GNU General Public
00030    License without this special exception.
00031    
00032    This special exception was added by the Free Software Foundation in
00033    version 2.2 of Bison.  */
00034 
00035 /* C LALR(1) parser skeleton written by Richard Stallman, by
00036    simplifying the original so-called "semantic" parser.  */
00037 
00038 /* All symbols defined below should begin with yy or YY, to avoid
00039    infringing on user name space.  This should be done even for local
00040    variables, as they might otherwise be expanded by user macros.
00041    There are some unavoidable exceptions within include files to
00042    define necessary library symbols; they are noted "INFRINGES ON
00043    USER NAME SPACE" below.  */
00044 
00045 /* Identify Bison output.  */
00046 #define YYBISON 1
00047 
00048 /* Bison version.  */
00049 #define YYBISON_VERSION "2.4.1"
00050 
00051 /* Skeleton name.  */
00052 #define YYSKELETON_NAME "yacc.c"
00053 
00054 /* Pure parsers.  */
00055 #define YYPURE 1
00056 
00057 /* Push parsers.  */
00058 #define YYPUSH 0
00059 
00060 /* Pull parsers.  */
00061 #define YYPULL 1
00062 
00063 /* Using locations.  */
00064 #define YYLSP_NEEDED 0
00065 
00066 
00067 
00068 /* Copy the first part of user declarations.  */
00069 
00070 /* Line 189 of yacc.c  */
00071 #line 37 "jsgf_parser.y"
00072 
00073 #include <stdio.h>
00074 #include <string.h>
00075 
00076 #include <hash_table.h>
00077 #include <ckd_alloc.h>
00078 #include <err.h>
00079 
00080 #include "jsgf_internal.h"
00081 #include "jsgf_parser.h"
00082 #include "jsgf_scanner.h"
00083 
00084 void yyerror(yyscan_t lex, jsgf_t *jsgf, const char *s);
00085 
00086 
00087 
00088 /* Line 189 of yacc.c  */
00089 #line 90 "jsgf_parser.c"
00090 
00091 /* Enabling traces.  */
00092 #ifndef YYDEBUG
00093 # define YYDEBUG 0
00094 #endif
00095 
00096 /* Enabling verbose error messages.  */
00097 #ifdef YYERROR_VERBOSE
00098 # undef YYERROR_VERBOSE
00099 # define YYERROR_VERBOSE 1
00100 #else
00101 # define YYERROR_VERBOSE 0
00102 #endif
00103 
00104 /* Enabling the token table.  */
00105 #ifndef YYTOKEN_TABLE
00106 # define YYTOKEN_TABLE 0
00107 #endif
00108 
00109 
00110 /* Tokens.  */
00111 #ifndef YYTOKENTYPE
00112 # define YYTOKENTYPE
00113    /* Put the tokens into the symbol table, so that GDB and other debuggers
00114       know about them.  */
00115    enum yytokentype {
00116      HEADER = 258,
00117      GRAMMAR = 259,
00118      IMPORT = 260,
00119      PUBLIC = 261,
00120      TOKEN = 262,
00121      RULENAME = 263,
00122      TAG = 264,
00123      WEIGHT = 265
00124    };
00125 #endif
00126 /* Tokens.  */
00127 #define HEADER 258
00128 #define GRAMMAR 259
00129 #define IMPORT 260
00130 #define PUBLIC 261
00131 #define TOKEN 262
00132 #define RULENAME 263
00133 #define TAG 264
00134 #define WEIGHT 265
00135 
00136 
00137 
00138 
00139 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
00140 typedef union YYSTYPE
00141 {
00142 
00143 /* Line 214 of yacc.c  */
00144 #line 58 "jsgf_parser.y"
00145 
00146        char *name;
00147        float weight;
00148        jsgf_rule_t *rule;
00149        jsgf_rhs_t *rhs;
00150        jsgf_atom_t *atom;
00151 
00152 
00153 
00154 /* Line 214 of yacc.c  */
00155 #line 156 "jsgf_parser.c"
00156 } YYSTYPE;
00157 # define YYSTYPE_IS_TRIVIAL 1
00158 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
00159 # define YYSTYPE_IS_DECLARED 1
00160 #endif
00161 
00162 
00163 /* Copy the second part of user declarations.  */
00164 
00165 
00166 /* Line 264 of yacc.c  */
00167 #line 168 "jsgf_parser.c"
00168 
00169 #ifdef short
00170 # undef short
00171 #endif
00172 
00173 #ifdef YYTYPE_UINT8
00174 typedef YYTYPE_UINT8 yytype_uint8;
00175 #else
00176 typedef unsigned char yytype_uint8;
00177 #endif
00178 
00179 #ifdef YYTYPE_INT8
00180 typedef YYTYPE_INT8 yytype_int8;
00181 #elif (defined __STDC__ || defined __C99__FUNC__ \
00182      || defined __cplusplus || defined _MSC_VER)
00183 typedef signed char yytype_int8;
00184 #else
00185 typedef short int yytype_int8;
00186 #endif
00187 
00188 #ifdef YYTYPE_UINT16
00189 typedef YYTYPE_UINT16 yytype_uint16;
00190 #else
00191 typedef unsigned short int yytype_uint16;
00192 #endif
00193 
00194 #ifdef YYTYPE_INT16
00195 typedef YYTYPE_INT16 yytype_int16;
00196 #else
00197 typedef short int yytype_int16;
00198 #endif
00199 
00200 #ifndef YYSIZE_T
00201 # ifdef __SIZE_TYPE__
00202 #  define YYSIZE_T __SIZE_TYPE__
00203 # elif defined size_t
00204 #  define YYSIZE_T size_t
00205 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
00206      || defined __cplusplus || defined _MSC_VER)
00207 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
00208 #  define YYSIZE_T size_t
00209 # else
00210 #  define YYSIZE_T unsigned int
00211 # endif
00212 #endif
00213 
00214 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
00215 
00216 #ifndef YY_
00217 # if YYENABLE_NLS
00218 #  if ENABLE_NLS
00219 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
00220 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
00221 #  endif
00222 # endif
00223 # ifndef YY_
00224 #  define YY_(msgid) msgid
00225 # endif
00226 #endif
00227 
00228 /* Suppress unused-variable warnings by "using" E.  */
00229 #if ! defined lint || defined __GNUC__
00230 # define YYUSE(e) ((void) (e))
00231 #else
00232 # define YYUSE(e) /* empty */
00233 #endif
00234 
00235 /* Identity function, used to suppress warnings about constant conditions.  */
00236 #ifndef lint
00237 # define YYID(n) (n)
00238 #else
00239 #if (defined __STDC__ || defined __C99__FUNC__ \
00240      || defined __cplusplus || defined _MSC_VER)
00241 static int
00242 YYID (int yyi)
00243 #else
00244 static int
00245 YYID (yyi)
00246     int yyi;
00247 #endif
00248 {
00249   return yyi;
00250 }
00251 #endif
00252 
00253 #if ! defined yyoverflow || YYERROR_VERBOSE
00254 
00255 /* The parser invokes alloca or malloc; define the necessary symbols.  */
00256 
00257 # ifdef YYSTACK_USE_ALLOCA
00258 #  if YYSTACK_USE_ALLOCA
00259 #   ifdef __GNUC__
00260 #    define YYSTACK_ALLOC __builtin_alloca
00261 #   elif defined __BUILTIN_VA_ARG_INCR
00262 #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
00263 #   elif defined _AIX
00264 #    define YYSTACK_ALLOC __alloca
00265 #   elif defined _MSC_VER
00266 #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
00267 #    define alloca _alloca
00268 #   else
00269 #    define YYSTACK_ALLOC alloca
00270 #    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
00271      || defined __cplusplus || defined _MSC_VER)
00272 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
00273 #     ifndef _STDLIB_H
00274 #      define _STDLIB_H 1
00275 #     endif
00276 #    endif
00277 #   endif
00278 #  endif
00279 # endif
00280 
00281 # ifdef YYSTACK_ALLOC
00282    /* Pacify GCC's `empty if-body' warning.  */
00283 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
00284 #  ifndef YYSTACK_ALLOC_MAXIMUM
00285     /* The OS might guarantee only one guard page at the bottom of the stack,
00286        and a page size can be as small as 4096 bytes.  So we cannot safely
00287        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
00288        to allow for a few compiler-allocated temporary stack slots.  */
00289 #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
00290 #  endif
00291 # else
00292 #  define YYSTACK_ALLOC YYMALLOC
00293 #  define YYSTACK_FREE YYFREE
00294 #  ifndef YYSTACK_ALLOC_MAXIMUM
00295 #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
00296 #  endif
00297 #  if (defined __cplusplus && ! defined _STDLIB_H \
00298        && ! ((defined YYMALLOC || defined malloc) \
00299              && (defined YYFREE || defined free)))
00300 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
00301 #   ifndef _STDLIB_H
00302 #    define _STDLIB_H 1
00303 #   endif
00304 #  endif
00305 #  ifndef YYMALLOC
00306 #   define YYMALLOC malloc
00307 #   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
00308      || defined __cplusplus || defined _MSC_VER)
00309 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
00310 #   endif
00311 #  endif
00312 #  ifndef YYFREE
00313 #   define YYFREE free
00314 #   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
00315      || defined __cplusplus || defined _MSC_VER)
00316 void free (void *); /* INFRINGES ON USER NAME SPACE */
00317 #   endif
00318 #  endif
00319 # endif
00320 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
00321 
00322 
00323 #if (! defined yyoverflow \
00324      && (! defined __cplusplus \
00325          || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
00326 
00327 /* A type that is properly aligned for any stack member.  */
00328 union yyalloc
00329 {
00330   yytype_int16 yyss_alloc;
00331   YYSTYPE yyvs_alloc;
00332 };
00333 
00334 /* The size of the maximum gap between one aligned stack and the next.  */
00335 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
00336 
00337 /* The size of an array large to enough to hold all stacks, each with
00338    N elements.  */
00339 # define YYSTACK_BYTES(N) \
00340      ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
00341       + YYSTACK_GAP_MAXIMUM)
00342 
00343 /* Copy COUNT objects from FROM to TO.  The source and destination do
00344    not overlap.  */
00345 # ifndef YYCOPY
00346 #  if defined __GNUC__ && 1 < __GNUC__
00347 #   define YYCOPY(To, From, Count) \
00348       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
00349 #  else
00350 #   define YYCOPY(To, From, Count)              \
00351       do                                        \
00352         {                                       \
00353           YYSIZE_T yyi;                         \
00354           for (yyi = 0; yyi < (Count); yyi++)   \
00355             (To)[yyi] = (From)[yyi];            \
00356         }                                       \
00357       while (YYID (0))
00358 #  endif
00359 # endif
00360 
00361 /* Relocate STACK from its old location to the new one.  The
00362    local variables YYSIZE and YYSTACKSIZE give the old and new number of
00363    elements in the stack, and YYPTR gives the new location of the
00364    stack.  Advance YYPTR to a properly aligned location for the next
00365    stack.  */
00366 # define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
00367     do                                                                  \
00368       {                                                                 \
00369         YYSIZE_T yynewbytes;                                            \
00370         YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
00371         Stack = &yyptr->Stack_alloc;                                    \
00372         yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
00373         yyptr += yynewbytes / sizeof (*yyptr);                          \
00374       }                                                                 \
00375     while (YYID (0))
00376 
00377 #endif
00378 
00379 /* YYFINAL -- State number of the termination state.  */
00380 #define YYFINAL  7
00381 /* YYLAST -- Last index in YYTABLE.  */
00382 #define YYLAST   54
00383 
00384 /* YYNTOKENS -- Number of terminals.  */
00385 #define YYNTOKENS  20
00386 /* YYNNTS -- Number of nonterminals.  */
00387 #define YYNNTS  16
00388 /* YYNRULES -- Number of rules.  */
00389 #define YYNRULES  33
00390 /* YYNRULES -- Number of states.  */
00391 #define YYNSTATES  58
00392 
00393 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
00394 #define YYUNDEFTOK  2
00395 #define YYMAXUTOK   265
00396 
00397 #define YYTRANSLATE(YYX)                                                \
00398   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
00399 
00400 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
00401 static const yytype_uint8 yytranslate[] =
00402 {
00403        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00404        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00405        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00406        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00407       14,    15,    18,    19,     2,     2,     2,     2,     2,     2,
00408        2,     2,     2,     2,     2,     2,     2,     2,     2,    11,
00409        2,    12,     2,     2,     2,     2,     2,     2,     2,     2,
00410        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00411        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00412        2,    16,     2,    17,     2,     2,     2,     2,     2,     2,
00413        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00414        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00415        2,     2,     2,     2,    13,     2,     2,     2,     2,     2,
00416        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00417        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00418        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00419        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00420        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00421        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00422        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00423        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00424        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00425        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00426        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00427        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00428        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
00429        5,     6,     7,     8,     9,    10
00430 };
00431 
00432 #if YYDEBUG
00433 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
00434    YYRHS.  */
00435 static const yytype_uint8 yyprhs[] =
00436 {
00437        0,     0,     3,     5,     8,    12,    15,    18,    22,    27,
00438       33,    37,    39,    42,    46,    48,    51,    56,    62,    64,
00439       68,    70,    73,    75,    78,    80,    83,    87,    91,    93,
00440       95,    97,    99,   102
00441 };
00442 
00443 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
00444 static const yytype_int8 yyrhs[] =
00445 {
00446       21,     0,    -1,    22,    -1,    22,    27,    -1,    22,    25,
00447       27,    -1,    23,    24,    -1,     3,    11,    -1,     3,     7,
00448       11,    -1,     3,     7,     7,    11,    -1,     3,     7,     7,
00449        7,    11,    -1,     4,     7,    11,    -1,    26,    -1,    25,
00450       26,    -1,     5,     8,    11,    -1,    28,    -1,    27,    28,
00451       -1,     8,    12,    29,    11,    -1,     6,     8,    12,    29,
00452       11,    -1,    30,    -1,    29,    13,    30,    -1,    31,    -1,
00453       30,    31,    -1,    32,    -1,    31,     9,    -1,    35,    -1,
00454       10,    35,    -1,    14,    29,    15,    -1,    16,    29,    17,
00455       -1,     7,    -1,     8,    -1,    33,    -1,    34,    -1,    35,
00456       18,    -1,    35,    19,    -1
00457 };
00458 
00459 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
00460 static const yytype_uint8 yyrline[] =
00461 {
00462        0,    75,    75,    76,    77,    80,    83,    84,    85,    86,
00463       90,    93,    94,    97,   100,   101,   104,   105,   108,   109,
00464      114,   116,   120,   121,   125,   126,   129,   132,   135,   136,
00465      137,   138,   139,   140
00466 };
00467 #endif
00468 
00469 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
00470 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
00471    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
00472 static const char *const yytname[] =
00473 {
00474   "$end", "error", "$undefined", "HEADER", "GRAMMAR", "IMPORT", "PUBLIC",
00475   "TOKEN", "RULENAME", "TAG", "WEIGHT", "';'", "'='", "'|'", "'('", "')'",
00476   "'['", "']'", "'*'", "'+'", "$accept", "grammar", "header",
00477   "jsgf_header", "grammar_header", "import_header", "import_statement",
00478   "rule_list", "rule", "alternate_list", "rule_expansion",
00479   "tagged_rule_item", "rule_item", "rule_group", "rule_optional",
00480   "rule_atom", 0
00481 };
00482 #endif
00483 
00484 # ifdef YYPRINT
00485 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
00486    token YYLEX-NUM.  */
00487 static const yytype_uint16 yytoknum[] =
00488 {
00489        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
00490      265,    59,    61,   124,    40,    41,    91,    93,    42,    43
00491 };
00492 # endif
00493 
00494 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
00495 static const yytype_uint8 yyr1[] =
00496 {
00497        0,    20,    21,    21,    21,    22,    23,    23,    23,    23,
00498       24,    25,    25,    26,    27,    27,    28,    28,    29,    29,
00499       30,    30,    31,    31,    32,    32,    33,    34,    35,    35,
00500       35,    35,    35,    35
00501 };
00502 
00503 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
00504 static const yytype_uint8 yyr2[] =
00505 {
00506        0,     2,     1,     2,     3,     2,     2,     3,     4,     5,
00507        3,     1,     2,     3,     1,     2,     4,     5,     1,     3,
00508        1,     2,     1,     2,     1,     2,     3,     3,     1,     1,
00509        1,     1,     2,     2
00510 };
00511 
00512 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
00513    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
00514    means the default is an error.  */
00515 static const yytype_uint8 yydefact[] =
00516 {
00517        0,     0,     0,     2,     0,     0,     6,     1,     0,     0,
00518        0,     0,    11,     3,    14,     0,     5,     0,     7,     0,
00519        0,     0,    12,     4,    15,     0,     0,     8,    13,     0,
00520       28,    29,     0,     0,     0,     0,    18,    20,    22,    30,
00521       31,    24,    10,     9,     0,    25,     0,     0,    16,     0,
00522       21,    23,    32,    33,    17,    26,    27,    19
00523 };
00524 
00525 /* YYDEFGOTO[NTERM-NUM].  */
00526 static const yytype_int8 yydefgoto[] =
00527 {
00528       -1,     2,     3,     4,    16,    11,    12,    13,    14,    35,
00529       36,    37,    38,    39,    40,    41
00530 };
00531 
00532 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
00533    STATE-NUM.  */
00534 #define YYPACT_NINF -37
00535 static const yytype_int8 yypact[] =
00536 {
00537       -1,    -2,    36,    22,    35,     8,   -37,   -37,    32,    33,
00538       30,    22,   -37,    17,   -37,    37,   -37,    13,   -37,    34,
00539       31,    -4,   -37,    17,   -37,    38,    39,   -37,   -37,    -4,
00540      -37,   -37,     0,    -4,    -4,    18,    -4,    42,   -37,   -37,
00541      -37,    19,   -37,   -37,    21,    19,    20,     9,   -37,    -4,
00542       42,   -37,   -37,   -37,   -37,   -37,   -37,    -4
00543 };
00544 
00545 /* YYPGOTO[NTERM-NUM].  */
00546 static const yytype_int8 yypgoto[] =
00547 {
00548      -37,   -37,   -37,   -37,   -37,   -37,    41,    43,   -12,   -16,
00549       -3,   -36,   -37,   -37,   -37,    15
00550 };
00551 
00552 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
00553    positive, shift that token.  If negative, reduce the rule which
00554    number is the opposite.  If zero, do what YYDEFACT says.
00555    If YYTABLE_NINF, syntax error.  */
00556 #define YYTABLE_NINF -1
00557 static const yytype_uint8 yytable[] =
00558 {
00559       50,    24,     1,    30,    31,     5,    32,    30,    31,     6,
00560       33,    24,    34,    44,    33,    17,    34,    46,    47,    18,
00561       26,    50,    49,     9,    27,    10,    56,     8,     9,    48,
00562       10,    49,    54,    49,    49,    55,     7,    52,    53,    15,
00563       19,    20,    21,    29,    25,    28,    57,    45,     0,    42,
00564       43,    51,    22,     0,    23
00565 };
00566 
00567 static const yytype_int8 yycheck[] =
00568 {
00569       36,    13,     3,     7,     8,     7,    10,     7,     8,    11,
00570       14,    23,    16,    29,    14,     7,    16,    33,    34,    11,
00571        7,    57,    13,     6,    11,     8,    17,     5,     6,    11,
00572        8,    13,    11,    13,    13,    15,     0,    18,    19,     4,
00573        8,     8,    12,    12,     7,    11,    49,    32,    -1,    11,
00574       11,     9,    11,    -1,    11
00575 };
00576 
00577 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
00578    symbol of state STATE-NUM.  */
00579 static const yytype_uint8 yystos[] =
00580 {
00581        0,     3,    21,    22,    23,     7,    11,     0,     5,     6,
00582        8,    25,    26,    27,    28,     4,    24,     7,    11,     8,
00583        8,    12,    26,    27,    28,     7,     7,    11,    11,    12,
00584        7,     8,    10,    14,    16,    29,    30,    31,    32,    33,
00585       34,    35,    11,    11,    29,    35,    29,    29,    11,    13,
00586       31,     9,    18,    19,    11,    15,    17,    30
00587 };
00588 
00589 #define yyerrok         (yyerrstatus = 0)
00590 #define yyclearin       (yychar = YYEMPTY)
00591 #define YYEMPTY         (-2)
00592 #define YYEOF           0
00593 
00594 #define YYACCEPT        goto yyacceptlab
00595 #define YYABORT         goto yyabortlab
00596 #define YYERROR         goto yyerrorlab
00597 
00598 
00599 /* Like YYERROR except do call yyerror.  This remains here temporarily
00600    to ease the transition to the new meaning of YYERROR, for GCC.
00601    Once GCC version 2 has supplanted version 1, this can go.  */
00602 
00603 #define YYFAIL          goto yyerrlab
00604 
00605 #define YYRECOVERING()  (!!yyerrstatus)
00606 
00607 #define YYBACKUP(Token, Value)                                  \
00608 do                                                              \
00609   if (yychar == YYEMPTY && yylen == 1)                          \
00610     {                                                           \
00611       yychar = (Token);                                         \
00612       yylval = (Value);                                         \
00613       yytoken = YYTRANSLATE (yychar);                           \
00614       YYPOPSTACK (1);                                           \
00615       goto yybackup;                                            \
00616     }                                                           \
00617   else                                                          \
00618     {                                                           \
00619       yyerror (yyscanner, jsgf, YY_("syntax error: cannot back up")); \
00620       YYERROR;                                                  \
00621     }                                                           \
00622 while (YYID (0))
00623 
00624 
00625 #define YYTERROR        1
00626 #define YYERRCODE       256
00627 
00628 
00629 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
00630    If N is 0, then set CURRENT to the empty location which ends
00631    the previous symbol: RHS[0] (always defined).  */
00632 
00633 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
00634 #ifndef YYLLOC_DEFAULT
00635 # define YYLLOC_DEFAULT(Current, Rhs, N)                                \
00636     do                                                                  \
00637       if (YYID (N))                                                    \
00638         {                                                               \
00639           (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
00640           (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
00641           (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
00642           (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
00643         }                                                               \
00644       else                                                              \
00645         {                                                               \
00646           (Current).first_line   = (Current).last_line   =              \
00647             YYRHSLOC (Rhs, 0).last_line;                                \
00648           (Current).first_column = (Current).last_column =              \
00649             YYRHSLOC (Rhs, 0).last_column;                              \
00650         }                                                               \
00651     while (YYID (0))
00652 #endif
00653 
00654 
00655 /* YY_LOCATION_PRINT -- Print the location on the stream.
00656    This macro was not mandated originally: define only if we know
00657    we won't break user code: when these are the locations we know.  */
00658 
00659 #ifndef YY_LOCATION_PRINT
00660 # if YYLTYPE_IS_TRIVIAL
00661 #  define YY_LOCATION_PRINT(File, Loc)                  \
00662      fprintf (File, "%d.%d-%d.%d",                      \
00663               (Loc).first_line, (Loc).first_column,     \
00664               (Loc).last_line,  (Loc).last_column)
00665 # else
00666 #  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
00667 # endif
00668 #endif
00669 
00670 
00671 /* YYLEX -- calling `yylex' with the right arguments.  */
00672 
00673 #ifdef YYLEX_PARAM
00674 # define YYLEX yylex (&yylval, YYLEX_PARAM)
00675 #else
00676 # define YYLEX yylex (&yylval, yyscanner)
00677 #endif
00678 
00679 /* Enable debugging if requested.  */
00680 #if YYDEBUG
00681 
00682 # ifndef YYFPRINTF
00683 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
00684 #  define YYFPRINTF fprintf
00685 # endif
00686 
00687 # define YYDPRINTF(Args)                        \
00688 do {                                            \
00689   if (yydebug)                                  \
00690     YYFPRINTF Args;                             \
00691 } while (YYID (0))
00692 
00693 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
00694 do {                                                                      \
00695   if (yydebug)                                                            \
00696     {                                                                     \
00697       YYFPRINTF (stderr, "%s ", Title);                                   \
00698       yy_symbol_print (stderr,                                            \
00699                   Type, Value, yyscanner, jsgf); \
00700       YYFPRINTF (stderr, "\n");                                           \
00701     }                                                                     \
00702 } while (YYID (0))
00703 
00704 
00705 /*--------------------------------.
00706 | Print this symbol on YYOUTPUT.  |
00707 `--------------------------------*/
00708 
00709 /*ARGSUSED*/
00710 #if (defined __STDC__ || defined __C99__FUNC__ \
00711      || defined __cplusplus || defined _MSC_VER)
00712 static void
00713 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, yyscan_t yyscanner, jsgf_t *jsgf)
00714 #else
00715 static void
00716 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yyscanner, jsgf)
00717     FILE *yyoutput;
00718     int yytype;
00719     YYSTYPE const * const yyvaluep;
00720     yyscan_t yyscanner;
00721     jsgf_t *jsgf;
00722 #endif
00723 {
00724   if (!yyvaluep)
00725     return;
00726   YYUSE (yyscanner);
00727   YYUSE (jsgf);
00728 # ifdef YYPRINT
00729   if (yytype < YYNTOKENS)
00730     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
00731 # else
00732   YYUSE (yyoutput);
00733 # endif
00734   switch (yytype)
00735     {
00736       default:
00737         break;
00738     }
00739 }
00740 
00741 
00742 /*--------------------------------.
00743 | Print this symbol on YYOUTPUT.  |
00744 `--------------------------------*/
00745 
00746 #if (defined __STDC__ || defined __C99__FUNC__ \
00747      || defined __cplusplus || defined _MSC_VER)
00748 static void
00749 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, yyscan_t yyscanner, jsgf_t *jsgf)
00750 #else
00751 static void
00752 yy_symbol_print (yyoutput, yytype, yyvaluep, yyscanner, jsgf)
00753     FILE *yyoutput;
00754     int yytype;
00755     YYSTYPE const * const yyvaluep;
00756     yyscan_t yyscanner;
00757     jsgf_t *jsgf;
00758 #endif
00759 {
00760   if (yytype < YYNTOKENS)
00761     YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
00762   else
00763     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
00764 
00765   yy_symbol_value_print (yyoutput, yytype, yyvaluep, yyscanner, jsgf);
00766   YYFPRINTF (yyoutput, ")");
00767 }
00768 
00769 /*------------------------------------------------------------------.
00770 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
00771 | TOP (included).                                                   |
00772 `------------------------------------------------------------------*/
00773 
00774 #if (defined __STDC__ || defined __C99__FUNC__ \
00775      || defined __cplusplus || defined _MSC_VER)
00776 static void
00777 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
00778 #else
00779 static void
00780 yy_stack_print (yybottom, yytop)
00781     yytype_int16 *yybottom;
00782     yytype_int16 *yytop;
00783 #endif
00784 {
00785   YYFPRINTF (stderr, "Stack now");
00786   for (; yybottom <= yytop; yybottom++)
00787     {
00788       int yybot = *yybottom;
00789       YYFPRINTF (stderr, " %d", yybot);
00790     }
00791   YYFPRINTF (stderr, "\n");
00792 }
00793 
00794 # define YY_STACK_PRINT(Bottom, Top)                            \
00795 do {                                                            \
00796   if (yydebug)                                                  \
00797     yy_stack_print ((Bottom), (Top));                           \
00798 } while (YYID (0))
00799 
00800 
00801 /*------------------------------------------------.
00802 | Report that the YYRULE is going to be reduced.  |
00803 `------------------------------------------------*/
00804 
00805 #if (defined __STDC__ || defined __C99__FUNC__ \
00806      || defined __cplusplus || defined _MSC_VER)
00807 static void
00808 yy_reduce_print (YYSTYPE *yyvsp, int yyrule, yyscan_t yyscanner, jsgf_t *jsgf)
00809 #else
00810 static void
00811 yy_reduce_print (yyvsp, yyrule, yyscanner, jsgf)
00812     YYSTYPE *yyvsp;
00813     int yyrule;
00814     yyscan_t yyscanner;
00815     jsgf_t *jsgf;
00816 #endif
00817 {
00818   int yynrhs = yyr2[yyrule];
00819   int yyi;
00820   unsigned long int yylno = yyrline[yyrule];
00821   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
00822              yyrule - 1, yylno);
00823   /* The symbols being reduced.  */
00824   for (yyi = 0; yyi < yynrhs; yyi++)
00825     {
00826       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
00827       yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
00828                        &(yyvsp[(yyi + 1) - (yynrhs)])
00829                                        , yyscanner, jsgf);
00830       YYFPRINTF (stderr, "\n");
00831     }
00832 }
00833 
00834 # define YY_REDUCE_PRINT(Rule)          \
00835 do {                                    \
00836   if (yydebug)                          \
00837     yy_reduce_print (yyvsp, Rule, yyscanner, jsgf); \
00838 } while (YYID (0))
00839 
00840 /* Nonzero means print parse trace.  It is left uninitialized so that
00841    multiple parsers can coexist.  */
00842 int yydebug;
00843 #else /* !YYDEBUG */
00844 # define YYDPRINTF(Args)
00845 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
00846 # define YY_STACK_PRINT(Bottom, Top)
00847 # define YY_REDUCE_PRINT(Rule)
00848 #endif /* !YYDEBUG */
00849 
00850 
00851 /* YYINITDEPTH -- initial size of the parser's stacks.  */
00852 #ifndef YYINITDEPTH
00853 # define YYINITDEPTH 200
00854 #endif
00855 
00856 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
00857    if the built-in stack extension method is used).
00858 
00859    Do not make this value too large; the results are undefined if
00860    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
00861    evaluated with infinite-precision integer arithmetic.  */
00862 
00863 #ifndef YYMAXDEPTH
00864 # define YYMAXDEPTH 10000
00865 #endif
00866 
00867 
00868 
00869 #if YYERROR_VERBOSE
00870 
00871 # ifndef yystrlen
00872 #  if defined __GLIBC__ && defined _STRING_H
00873 #   define yystrlen strlen
00874 #  else
00875 /* Return the length of YYSTR.  */
00876 #if (defined __STDC__ || defined __C99__FUNC__ \
00877      || defined __cplusplus || defined _MSC_VER)
00878 static YYSIZE_T
00879 yystrlen (const char *yystr)
00880 #else
00881 static YYSIZE_T
00882 yystrlen (yystr)
00883     const char *yystr;
00884 #endif
00885 {
00886   YYSIZE_T yylen;
00887   for (yylen = 0; yystr[yylen]; yylen++)
00888     continue;
00889   return yylen;
00890 }
00891 #  endif
00892 # endif
00893 
00894 # ifndef yystpcpy
00895 #  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
00896 #   define yystpcpy stpcpy
00897 #  else
00898 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
00899    YYDEST.  */
00900 #if (defined __STDC__ || defined __C99__FUNC__ \
00901      || defined __cplusplus || defined _MSC_VER)
00902 static char *
00903 yystpcpy (char *yydest, const char *yysrc)
00904 #else
00905 static char *
00906 yystpcpy (yydest, yysrc)
00907     char *yydest;
00908     const char *yysrc;
00909 #endif
00910 {
00911   char *yyd = yydest;
00912   const char *yys = yysrc;
00913 
00914   while ((*yyd++ = *yys++) != '\0')
00915     continue;
00916 
00917   return yyd - 1;
00918 }
00919 #  endif
00920 # endif
00921 
00922 # ifndef yytnamerr
00923 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
00924    quotes and backslashes, so that it's suitable for yyerror.  The
00925    heuristic is that double-quoting is unnecessary unless the string
00926    contains an apostrophe, a comma, or backslash (other than
00927    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
00928    null, do not copy; instead, return the length of what the result
00929    would have been.  */
00930 static YYSIZE_T
00931 yytnamerr (char *yyres, const char *yystr)
00932 {
00933   if (*yystr == '"')
00934     {
00935       YYSIZE_T yyn = 0;
00936       char const *yyp = yystr;
00937 
00938       for (;;)
00939         switch (*++yyp)
00940           {
00941           case '\'':
00942           case ',':
00943             goto do_not_strip_quotes;
00944 
00945           case '\\':
00946             if (*++yyp != '\\')
00947               goto do_not_strip_quotes;
00948             /* Fall through.  */
00949           default:
00950             if (yyres)
00951               yyres[yyn] = *yyp;
00952             yyn++;
00953             break;
00954 
00955           case '"':
00956             if (yyres)
00957               yyres[yyn] = '\0';
00958             return yyn;
00959           }
00960     do_not_strip_quotes: ;
00961     }
00962 
00963   if (! yyres)
00964     return yystrlen (yystr);
00965 
00966   return yystpcpy (yyres, yystr) - yyres;
00967 }
00968 # endif
00969 
00970 /* Copy into YYRESULT an error message about the unexpected token
00971    YYCHAR while in state YYSTATE.  Return the number of bytes copied,
00972    including the terminating null byte.  If YYRESULT is null, do not
00973    copy anything; just return the number of bytes that would be
00974    copied.  As a special case, return 0 if an ordinary "syntax error"
00975    message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
00976    size calculation.  */
00977 static YYSIZE_T
00978 yysyntax_error (char *yyresult, int yystate, int yychar)
00979 {
00980   int yyn = yypact[yystate];
00981 
00982   if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
00983     return 0;
00984   else
00985     {
00986       int yytype = YYTRANSLATE (yychar);
00987       YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
00988       YYSIZE_T yysize = yysize0;
00989       YYSIZE_T yysize1;
00990       int yysize_overflow = 0;
00991       enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
00992       char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
00993       int yyx;
00994 
00995 # if 0
00996       /* This is so xgettext sees the translatable formats that are
00997          constructed on the fly.  */
00998       YY_("syntax error, unexpected %s");
00999       YY_("syntax error, unexpected %s, expecting %s");
01000       YY_("syntax error, unexpected %s, expecting %s or %s");
01001       YY_("syntax error, unexpected %s, expecting %s or %s or %s");
01002       YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
01003 # endif
01004       char *yyfmt;
01005       char const *yyf;
01006       static char const yyunexpected[] = "syntax error, unexpected %s";
01007       static char const yyexpecting[] = ", expecting %s";
01008       static char const yyor[] = " or %s";
01009       char yyformat[sizeof yyunexpected
01010                     + sizeof yyexpecting - 1
01011                     + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
01012                        * (sizeof yyor - 1))];
01013       char const *yyprefix = yyexpecting;
01014 
01015       /* Start YYX at -YYN if negative to avoid negative indexes in
01016          YYCHECK.  */
01017       int yyxbegin = yyn < 0 ? -yyn : 0;
01018 
01019       /* Stay within bounds of both yycheck and yytname.  */
01020       int yychecklim = YYLAST - yyn + 1;
01021       int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
01022       int yycount = 1;
01023 
01024       yyarg[0] = yytname[yytype];
01025       yyfmt = yystpcpy (yyformat, yyunexpected);
01026 
01027       for (yyx = yyxbegin; yyx < yyxend; ++yyx)
01028         if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
01029           {
01030             if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
01031               {
01032                 yycount = 1;
01033                 yysize = yysize0;
01034                 yyformat[sizeof yyunexpected - 1] = '\0';
01035                 break;
01036               }
01037             yyarg[yycount++] = yytname[yyx];
01038             yysize1 = yysize + yytnamerr (0, yytname[yyx]);
01039             yysize_overflow |= (yysize1 < yysize);
01040             yysize = yysize1;
01041             yyfmt = yystpcpy (yyfmt, yyprefix);
01042             yyprefix = yyor;
01043           }
01044 
01045       yyf = YY_(yyformat);
01046       yysize1 = yysize + yystrlen (yyf);
01047       yysize_overflow |= (yysize1 < yysize);
01048       yysize = yysize1;
01049 
01050       if (yysize_overflow)
01051         return YYSIZE_MAXIMUM;
01052 
01053       if (yyresult)
01054         {
01055           /* Avoid sprintf, as that infringes on the user's name space.
01056              Don't have undefined behavior even if the translation
01057              produced a string with the wrong number of "%s"s.  */
01058           char *yyp = yyresult;
01059           int yyi = 0;
01060           while ((*yyp = *yyf) != '\0')
01061             {
01062               if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
01063                 {
01064                   yyp += yytnamerr (yyp, yyarg[yyi++]);
01065                   yyf += 2;
01066                 }
01067               else
01068                 {
01069                   yyp++;
01070                   yyf++;
01071                 }
01072             }
01073         }
01074       return yysize;
01075     }
01076 }
01077 #endif /* YYERROR_VERBOSE */
01078 
01079 
01080 /*-----------------------------------------------.
01081 | Release the memory associated to this symbol.  |
01082 `-----------------------------------------------*/
01083 
01084 /*ARGSUSED*/
01085 #if (defined __STDC__ || defined __C99__FUNC__ \
01086      || defined __cplusplus || defined _MSC_VER)
01087 static void
01088 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, yyscan_t yyscanner, jsgf_t *jsgf)
01089 #else
01090 static void
01091 yydestruct (yymsg, yytype, yyvaluep, yyscanner, jsgf)
01092     const char *yymsg;
01093     int yytype;
01094     YYSTYPE *yyvaluep;
01095     yyscan_t yyscanner;
01096     jsgf_t *jsgf;
01097 #endif
01098 {
01099   YYUSE (yyvaluep);
01100   YYUSE (yyscanner);
01101   YYUSE (jsgf);
01102 
01103   if (!yymsg)
01104     yymsg = "Deleting";
01105   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
01106 
01107   switch (yytype)
01108     {
01109 
01110       default:
01111         break;
01112     }
01113 }
01114 
01115 /* Prevent warnings from -Wmissing-prototypes.  */
01116 #ifdef YYPARSE_PARAM
01117 #if defined __STDC__ || defined __cplusplus
01118 int yyparse (void *YYPARSE_PARAM);
01119 #else
01120 int yyparse ();
01121 #endif
01122 #else /* ! YYPARSE_PARAM */
01123 #if defined __STDC__ || defined __cplusplus
01124 int yyparse (yyscan_t yyscanner, jsgf_t *jsgf);
01125 #else
01126 int yyparse ();
01127 #endif
01128 #endif /* ! YYPARSE_PARAM */
01129 
01130 
01131 
01132 
01133 
01134 /*-------------------------.
01135 | yyparse or yypush_parse.  |
01136 `-------------------------*/
01137 
01138 #ifdef YYPARSE_PARAM
01139 #if (defined __STDC__ || defined __C99__FUNC__ \
01140      || defined __cplusplus || defined _MSC_VER)
01141 int
01142 yyparse (void *YYPARSE_PARAM)
01143 #else
01144 int
01145 yyparse (YYPARSE_PARAM)
01146     void *YYPARSE_PARAM;
01147 #endif
01148 #else /* ! YYPARSE_PARAM */
01149 #if (defined __STDC__ || defined __C99__FUNC__ \
01150      || defined __cplusplus || defined _MSC_VER)
01151 int
01152 yyparse (yyscan_t yyscanner, jsgf_t *jsgf)
01153 #else
01154 int
01155 yyparse (yyscanner, jsgf)
01156     yyscan_t yyscanner;
01157     jsgf_t *jsgf;
01158 #endif
01159 #endif
01160 {
01161 /* The lookahead symbol.  */
01162 int yychar;
01163 
01164 /* The semantic value of the lookahead symbol.  */
01165 YYSTYPE yylval;
01166 
01167     /* Number of syntax errors so far.  */
01168     int yynerrs;
01169 
01170     int yystate;
01171     /* Number of tokens to shift before error messages enabled.  */
01172     int yyerrstatus;
01173 
01174     /* The stacks and their tools:
01175        `yyss': related to states.
01176        `yyvs': related to semantic values.
01177 
01178        Refer to the stacks thru separate pointers, to allow yyoverflow
01179        to reallocate them elsewhere.  */
01180 
01181     /* The state stack.  */
01182     yytype_int16 yyssa[YYINITDEPTH];
01183     yytype_int16 *yyss;
01184     yytype_int16 *yyssp;
01185 
01186     /* The semantic value stack.  */
01187     YYSTYPE yyvsa[YYINITDEPTH];
01188     YYSTYPE *yyvs;
01189     YYSTYPE *yyvsp;
01190 
01191     YYSIZE_T yystacksize;
01192 
01193   int yyn;
01194   int yyresult;
01195   /* Lookahead token as an internal (translated) token number.  */
01196   int yytoken;
01197   /* The variables used to return semantic value and location from the
01198      action routines.  */
01199   YYSTYPE yyval;
01200 
01201 #if YYERROR_VERBOSE
01202   /* Buffer for error messages, and its allocated size.  */
01203   char yymsgbuf[128];
01204   char *yymsg = yymsgbuf;
01205   YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
01206 #endif
01207 
01208 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
01209 
01210   /* The number of symbols on the RHS of the reduced rule.
01211      Keep to zero when no symbol should be popped.  */
01212   int yylen = 0;
01213 
01214   yytoken = 0;
01215   yyss = yyssa;
01216   yyvs = yyvsa;
01217   yystacksize = YYINITDEPTH;
01218 
01219   YYDPRINTF ((stderr, "Starting parse\n"));
01220 
01221   yystate = 0;
01222   yyerrstatus = 0;
01223   yynerrs = 0;
01224   yychar = YYEMPTY; /* Cause a token to be read.  */
01225 
01226   /* Initialize stack pointers.
01227      Waste one element of value and location stack
01228      so that they stay on the same level as the state stack.
01229      The wasted elements are never initialized.  */
01230   yyssp = yyss;
01231   yyvsp = yyvs;
01232 
01233   goto yysetstate;
01234 
01235 /*------------------------------------------------------------.
01236 | yynewstate -- Push a new state, which is found in yystate.  |
01237 `------------------------------------------------------------*/
01238  yynewstate:
01239   /* In all cases, when you get here, the value and location stacks
01240      have just been pushed.  So pushing a state here evens the stacks.  */
01241   yyssp++;
01242 
01243  yysetstate:
01244   *yyssp = yystate;
01245 
01246   if (yyss + yystacksize - 1 <= yyssp)
01247     {
01248       /* Get the current used size of the three stacks, in elements.  */
01249       YYSIZE_T yysize = yyssp - yyss + 1;
01250 
01251 #ifdef yyoverflow
01252       {
01253         /* Give user a chance to reallocate the stack.  Use copies of
01254            these so that the &'s don't force the real ones into
01255            memory.  */
01256         YYSTYPE *yyvs1 = yyvs;
01257         yytype_int16 *yyss1 = yyss;
01258 
01259         /* Each stack pointer address is followed by the size of the
01260            data in use in that stack, in bytes.  This used to be a
01261            conditional around just the two extra args, but that might
01262            be undefined if yyoverflow is a macro.  */
01263         yyoverflow (YY_("memory exhausted"),
01264                     &yyss1, yysize * sizeof (*yyssp),
01265                     &yyvs1, yysize * sizeof (*yyvsp),
01266                     &yystacksize);
01267 
01268         yyss = yyss1;
01269         yyvs = yyvs1;
01270       }
01271 #else /* no yyoverflow */
01272 # ifndef YYSTACK_RELOCATE
01273       goto yyexhaustedlab;
01274 # else
01275       /* Extend the stack our own way.  */
01276       if (YYMAXDEPTH <= yystacksize)
01277         goto yyexhaustedlab;
01278       yystacksize *= 2;
01279       if (YYMAXDEPTH < yystacksize)
01280         yystacksize = YYMAXDEPTH;
01281 
01282       {
01283         yytype_int16 *yyss1 = yyss;
01284         union yyalloc *yyptr =
01285           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
01286         if (! yyptr)
01287           goto yyexhaustedlab;
01288         YYSTACK_RELOCATE (yyss_alloc, yyss);
01289         YYSTACK_RELOCATE (yyvs_alloc, yyvs);
01290 #  undef YYSTACK_RELOCATE
01291         if (yyss1 != yyssa)
01292           YYSTACK_FREE (yyss1);
01293       }
01294 # endif
01295 #endif /* no yyoverflow */
01296 
01297       yyssp = yyss + yysize - 1;
01298       yyvsp = yyvs + yysize - 1;
01299 
01300       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
01301                   (unsigned long int) yystacksize));
01302 
01303       if (yyss + yystacksize - 1 <= yyssp)
01304         YYABORT;
01305     }
01306 
01307   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
01308 
01309   if (yystate == YYFINAL)
01310     YYACCEPT;
01311 
01312   goto yybackup;
01313 
01314 /*-----------.
01315 | yybackup.  |
01316 `-----------*/
01317 yybackup:
01318 
01319   /* Do appropriate processing given the current state.  Read a
01320      lookahead token if we need one and don't already have one.  */
01321 
01322   /* First try to decide what to do without reference to lookahead token.  */
01323   yyn = yypact[yystate];
01324   if (yyn == YYPACT_NINF)
01325     goto yydefault;
01326 
01327   /* Not known => get a lookahead token if don't already have one.  */
01328 
01329   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
01330   if (yychar == YYEMPTY)
01331     {
01332       YYDPRINTF ((stderr, "Reading a token: "));
01333       yychar = YYLEX;
01334     }
01335 
01336   if (yychar <= YYEOF)
01337     {
01338       yychar = yytoken = YYEOF;
01339       YYDPRINTF ((stderr, "Now at end of input.\n"));
01340     }
01341   else
01342     {
01343       yytoken = YYTRANSLATE (yychar);
01344       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
01345     }
01346 
01347   /* If the proper action on seeing token YYTOKEN is to reduce or to
01348      detect an error, take that action.  */
01349   yyn += yytoken;
01350   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
01351     goto yydefault;
01352   yyn = yytable[yyn];
01353   if (yyn <= 0)
01354     {
01355       if (yyn == 0 || yyn == YYTABLE_NINF)
01356         goto yyerrlab;
01357       yyn = -yyn;
01358       goto yyreduce;
01359     }
01360 
01361   /* Count tokens shifted since error; after three, turn off error
01362      status.  */
01363   if (yyerrstatus)
01364     yyerrstatus--;
01365 
01366   /* Shift the lookahead token.  */
01367   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
01368 
01369   /* Discard the shifted token.  */
01370   yychar = YYEMPTY;
01371 
01372   yystate = yyn;
01373   *++yyvsp = yylval;
01374 
01375   goto yynewstate;
01376 
01377 
01378 /*-----------------------------------------------------------.
01379 | yydefault -- do the default action for the current state.  |
01380 `-----------------------------------------------------------*/
01381 yydefault:
01382   yyn = yydefact[yystate];
01383   if (yyn == 0)
01384     goto yyerrlab;
01385   goto yyreduce;
01386 
01387 
01388 /*-----------------------------.
01389 | yyreduce -- Do a reduction.  |
01390 `-----------------------------*/
01391 yyreduce:
01392   /* yyn is the number of a rule to reduce with.  */
01393   yylen = yyr2[yyn];
01394 
01395   /* If YYLEN is nonzero, implement the default value of the action:
01396      `$$ = $1'.
01397 
01398      Otherwise, the following line sets YYVAL to garbage.
01399      This behavior is undocumented and Bison
01400      users should not rely upon it.  Assigning to YYVAL
01401      unconditionally makes the parser a bit smaller, and it avoids a
01402      GCC warning that YYVAL may be used uninitialized.  */
01403   yyval = yyvsp[1-yylen];
01404 
01405 
01406   YY_REDUCE_PRINT (yyn);
01407   switch (yyn)
01408     {
01409         case 5:
01410 
01411 /* Line 1455 of yacc.c  */
01412 #line 80 "jsgf_parser.y"
01413     { jsgf->name = (yyvsp[(2) - (2)].name); }
01414     break;
01415 
01416   case 7:
01417 
01418 /* Line 1455 of yacc.c  */
01419 #line 84 "jsgf_parser.y"
01420     { jsgf->version = (yyvsp[(2) - (3)].name); }
01421     break;
01422 
01423   case 8:
01424 
01425 /* Line 1455 of yacc.c  */
01426 #line 85 "jsgf_parser.y"
01427     { jsgf->version = (yyvsp[(2) - (4)].name); jsgf->charset = (yyvsp[(3) - (4)].name); }
01428     break;
01429 
01430   case 9:
01431 
01432 /* Line 1455 of yacc.c  */
01433 #line 86 "jsgf_parser.y"
01434     { jsgf->version = (yyvsp[(2) - (5)].name); jsgf->charset = (yyvsp[(3) - (5)].name);
01435                                          jsgf->locale = (yyvsp[(4) - (5)].name); }
01436     break;
01437 
01438   case 10:
01439 
01440 /* Line 1455 of yacc.c  */
01441 #line 90 "jsgf_parser.y"
01442     { (yyval.name) = (yyvsp[(2) - (3)].name); }
01443     break;
01444 
01445   case 13:
01446 
01447 /* Line 1455 of yacc.c  */
01448 #line 97 "jsgf_parser.y"
01449     { jsgf_import_rule(jsgf, (yyvsp[(2) - (3)].name)); ckd_free((yyvsp[(2) - (3)].name)); }
01450     break;
01451 
01452   case 16:
01453 
01454 /* Line 1455 of yacc.c  */
01455 #line 104 "jsgf_parser.y"
01456     { jsgf_define_rule(jsgf, (yyvsp[(1) - (4)].name), (yyvsp[(3) - (4)].rhs), 0); ckd_free((yyvsp[(1) - (4)].name)); }
01457     break;
01458 
01459   case 17:
01460 
01461 /* Line 1455 of yacc.c  */
01462 #line 105 "jsgf_parser.y"
01463     { jsgf_define_rule(jsgf, (yyvsp[(2) - (5)].name), (yyvsp[(4) - (5)].rhs), 1); ckd_free((yyvsp[(2) - (5)].name)); }
01464     break;
01465 
01466   case 18:
01467 
01468 /* Line 1455 of yacc.c  */
01469 #line 108 "jsgf_parser.y"
01470     { (yyval.rhs) = (yyvsp[(1) - (1)].rhs); (yyval.rhs)->atoms = glist_reverse((yyval.rhs)->atoms); }
01471     break;
01472 
01473   case 19:
01474 
01475 /* Line 1455 of yacc.c  */
01476 #line 109 "jsgf_parser.y"
01477     { (yyval.rhs) = (yyvsp[(3) - (3)].rhs);
01478                                               (yyval.rhs)->atoms = glist_reverse((yyval.rhs)->atoms);
01479                                               (yyval.rhs)->alt = (yyvsp[(1) - (3)].rhs); }
01480     break;
01481 
01482   case 20:
01483 
01484 /* Line 1455 of yacc.c  */
01485 #line 114 "jsgf_parser.y"
01486     { (yyval.rhs) = ckd_calloc(1, sizeof(*(yyval.rhs)));
01487                                    (yyval.rhs)->atoms = glist_add_ptr((yyval.rhs)->atoms, (yyvsp[(1) - (1)].atom)); }
01488     break;
01489 
01490   case 21:
01491 
01492 /* Line 1455 of yacc.c  */
01493 #line 116 "jsgf_parser.y"
01494     { (yyval.rhs) = (yyvsp[(1) - (2)].rhs);
01495                                             (yyval.rhs)->atoms = glist_add_ptr((yyval.rhs)->atoms, (yyvsp[(2) - (2)].atom)); }
01496     break;
01497 
01498   case 23:
01499 
01500 /* Line 1455 of yacc.c  */
01501 #line 121 "jsgf_parser.y"
01502     { (yyval.atom) = (yyvsp[(1) - (2)].atom);
01503                                  (yyval.atom)->tags = glist_add_ptr((yyval.atom)->tags, (yyvsp[(2) - (2)].name)); }
01504     break;
01505 
01506   case 25:
01507 
01508 /* Line 1455 of yacc.c  */
01509 #line 126 "jsgf_parser.y"
01510     { (yyval.atom) = (yyvsp[(2) - (2)].atom); (yyval.atom)->weight = (yyvsp[(1) - (2)].weight); }
01511     break;
01512 
01513   case 26:
01514 
01515 /* Line 1455 of yacc.c  */
01516 #line 129 "jsgf_parser.y"
01517     { (yyval.rule) = jsgf_define_rule(jsgf, NULL, (yyvsp[(2) - (3)].rhs), 0); }
01518     break;
01519 
01520   case 27:
01521 
01522 /* Line 1455 of yacc.c  */
01523 #line 132 "jsgf_parser.y"
01524     { (yyval.rule) = jsgf_optional_new(jsgf, (yyvsp[(2) - (3)].rhs)); }
01525     break;
01526 
01527   case 28:
01528 
01529 /* Line 1455 of yacc.c  */
01530 #line 135 "jsgf_parser.y"
01531     { (yyval.atom) = jsgf_atom_new((yyvsp[(1) - (1)].name), 1.0); ckd_free((yyvsp[(1) - (1)].name)); }
01532     break;
01533 
01534   case 29:
01535 
01536 /* Line 1455 of yacc.c  */
01537 #line 136 "jsgf_parser.y"
01538     { (yyval.atom) = jsgf_atom_new((yyvsp[(1) - (1)].name), 1.0); ckd_free((yyvsp[(1) - (1)].name)); }
01539     break;
01540 
01541   case 30:
01542 
01543 /* Line 1455 of yacc.c  */
01544 #line 137 "jsgf_parser.y"
01545     { (yyval.atom) = jsgf_atom_new((yyvsp[(1) - (1)].rule)->name, 1.0); }
01546     break;
01547 
01548   case 31:
01549 
01550 /* Line 1455 of yacc.c  */
01551 #line 138 "jsgf_parser.y"
01552     { (yyval.atom) = jsgf_atom_new((yyvsp[(1) - (1)].rule)->name, 1.0); }
01553     break;
01554 
01555   case 32:
01556 
01557 /* Line 1455 of yacc.c  */
01558 #line 139 "jsgf_parser.y"
01559     { (yyval.atom) = jsgf_kleene_new(jsgf, (yyvsp[(1) - (2)].atom), 0); }
01560     break;
01561 
01562   case 33:
01563 
01564 /* Line 1455 of yacc.c  */
01565 #line 140 "jsgf_parser.y"
01566     { (yyval.atom) = jsgf_kleene_new(jsgf, (yyvsp[(1) - (2)].atom), 1); }
01567     break;
01568 
01569 
01570 
01571 /* Line 1455 of yacc.c  */
01572 #line 1573 "jsgf_parser.c"
01573       default: break;
01574     }
01575   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
01576 
01577   YYPOPSTACK (yylen);
01578   yylen = 0;
01579   YY_STACK_PRINT (yyss, yyssp);
01580 
01581   *++yyvsp = yyval;
01582 
01583   /* Now `shift' the result of the reduction.  Determine what state
01584      that goes to, based on the state we popped back to and the rule
01585      number reduced by.  */
01586 
01587   yyn = yyr1[yyn];
01588 
01589   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
01590   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
01591     yystate = yytable[yystate];
01592   else
01593     yystate = yydefgoto[yyn - YYNTOKENS];
01594 
01595   goto yynewstate;
01596 
01597 
01598 /*------------------------------------.
01599 | yyerrlab -- here on detecting error |
01600 `------------------------------------*/
01601 yyerrlab:
01602   /* If not already recovering from an error, report this error.  */
01603   if (!yyerrstatus)
01604     {
01605       ++yynerrs;
01606 #if ! YYERROR_VERBOSE
01607       yyerror (yyscanner, jsgf, YY_("syntax error"));
01608 #else
01609       {
01610         YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
01611         if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
01612           {
01613             YYSIZE_T yyalloc = 2 * yysize;
01614             if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
01615               yyalloc = YYSTACK_ALLOC_MAXIMUM;
01616             if (yymsg != yymsgbuf)
01617               YYSTACK_FREE (yymsg);
01618             yymsg = (char *) YYSTACK_ALLOC (yyalloc);
01619             if (yymsg)
01620               yymsg_alloc = yyalloc;
01621             else
01622               {
01623                 yymsg = yymsgbuf;
01624                 yymsg_alloc = sizeof yymsgbuf;
01625               }
01626           }
01627 
01628         if (0 < yysize && yysize <= yymsg_alloc)
01629           {
01630             (void) yysyntax_error (yymsg, yystate, yychar);
01631             yyerror (yyscanner, jsgf, yymsg);
01632           }
01633         else
01634           {
01635             yyerror (yyscanner, jsgf, YY_("syntax error"));
01636             if (yysize != 0)
01637               goto yyexhaustedlab;
01638           }
01639       }
01640 #endif
01641     }
01642 
01643 
01644 
01645   if (yyerrstatus == 3)
01646     {
01647       /* If just tried and failed to reuse lookahead token after an
01648          error, discard it.  */
01649 
01650       if (yychar <= YYEOF)
01651         {
01652           /* Return failure if at end of input.  */
01653           if (yychar == YYEOF)
01654             YYABORT;
01655         }
01656       else
01657         {
01658           yydestruct ("Error: discarding",
01659                       yytoken, &yylval, yyscanner, jsgf);
01660           yychar = YYEMPTY;
01661         }
01662     }
01663 
01664   /* Else will try to reuse lookahead token after shifting the error
01665      token.  */
01666   goto yyerrlab1;
01667 
01668 
01669 /*---------------------------------------------------.
01670 | yyerrorlab -- error raised explicitly by YYERROR.  |
01671 `---------------------------------------------------*/
01672 yyerrorlab:
01673 
01674   /* Pacify compilers like GCC when the user code never invokes
01675      YYERROR and the label yyerrorlab therefore never appears in user
01676      code.  */
01677   if (/*CONSTCOND*/ 0)
01678      goto yyerrorlab;
01679 
01680   /* Do not reclaim the symbols of the rule which action triggered
01681      this YYERROR.  */
01682   YYPOPSTACK (yylen);
01683   yylen = 0;
01684   YY_STACK_PRINT (yyss, yyssp);
01685   yystate = *yyssp;
01686   goto yyerrlab1;
01687 
01688 
01689 /*-------------------------------------------------------------.
01690 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
01691 `-------------------------------------------------------------*/
01692 yyerrlab1:
01693   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
01694 
01695   for (;;)
01696     {
01697       yyn = yypact[yystate];
01698       if (yyn != YYPACT_NINF)
01699         {
01700           yyn += YYTERROR;
01701           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
01702             {
01703               yyn = yytable[yyn];
01704               if (0 < yyn)
01705                 break;
01706             }
01707         }
01708 
01709       /* Pop the current state because it cannot handle the error token.  */
01710       if (yyssp == yyss)
01711         YYABORT;
01712 
01713 
01714       yydestruct ("Error: popping",
01715                   yystos[yystate], yyvsp, yyscanner, jsgf);
01716       YYPOPSTACK (1);
01717       yystate = *yyssp;
01718       YY_STACK_PRINT (yyss, yyssp);
01719     }
01720 
01721   *++yyvsp = yylval;
01722 
01723 
01724   /* Shift the error token.  */
01725   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
01726 
01727   yystate = yyn;
01728   goto yynewstate;
01729 
01730 
01731 /*-------------------------------------.
01732 | yyacceptlab -- YYACCEPT comes here.  |
01733 `-------------------------------------*/
01734 yyacceptlab:
01735   yyresult = 0;
01736   goto yyreturn;
01737 
01738 /*-----------------------------------.
01739 | yyabortlab -- YYABORT comes here.  |
01740 `-----------------------------------*/
01741 yyabortlab:
01742   yyresult = 1;
01743   goto yyreturn;
01744 
01745 #if !defined(yyoverflow) || YYERROR_VERBOSE
01746 /*-------------------------------------------------.
01747 | yyexhaustedlab -- memory exhaustion comes here.  |
01748 `-------------------------------------------------*/
01749 yyexhaustedlab:
01750   yyerror (yyscanner, jsgf, YY_("memory exhausted"));
01751   yyresult = 2;
01752   /* Fall through.  */
01753 #endif
01754 
01755 yyreturn:
01756   if (yychar != YYEMPTY)
01757      yydestruct ("Cleanup: discarding lookahead",
01758                  yytoken, &yylval, yyscanner, jsgf);
01759   /* Do not reclaim the symbols of the rule which action triggered
01760      this YYABORT or YYACCEPT.  */
01761   YYPOPSTACK (yylen);
01762   YY_STACK_PRINT (yyss, yyssp);
01763   while (yyssp != yyss)
01764     {
01765       yydestruct ("Cleanup: popping",
01766                   yystos[*yyssp], yyvsp, yyscanner, jsgf);
01767       YYPOPSTACK (1);
01768     }
01769 #ifndef yyoverflow
01770   if (yyss != yyssa)
01771     YYSTACK_FREE (yyss);
01772 #endif
01773 #if YYERROR_VERBOSE
01774   if (yymsg != yymsgbuf)
01775     YYSTACK_FREE (yymsg);
01776 #endif
01777   /* Make sure YYID is used.  */
01778   return YYID (yyresult);
01779 }
01780 
01781 
01782 
01783 /* Line 1675 of yacc.c  */
01784 #line 143 "jsgf_parser.y"
01785 
01786 
01787 void
01788 yyerror(yyscan_t lex, jsgf_t *jsgf, const char *s)
01789 {
01790     fprintf(stderr, "ERROR: %s\n", s);
01791 }
01792 

Generated on Thu Jan 6 2011 for SphinxBase by  doxygen 1.7.1