Subversion Repositories HelenOS

Rev

Rev 2714 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. /* A Bison parser, made by GNU Bison 2.3.  */
  2.  
  3. /* Skeleton implementation for Bison's Yacc-like parsers in C
  4.  
  5.    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
  6.    Free Software Foundation, Inc.
  7.  
  8.    This program is free software; you can redistribute it and/or modify
  9.    it under the terms of the GNU General Public License as published by
  10.    the Free Software Foundation; either version 2, or (at your option)
  11.    any later version.
  12.  
  13.    This program is distributed in the hope that it will be useful,
  14.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.    GNU General Public License for more details.
  17.  
  18.    You should have received a copy of the GNU General Public License
  19.    along with this program; if not, write to the Free Software
  20.    Foundation, Inc., 51 Franklin Street, Fifth Floor,
  21.    Boston, MA 02110-1301, USA.  */
  22.  
  23. /* As a special exception, you may create a larger work that contains
  24.    part or all of the Bison parser skeleton and distribute that work
  25.    under terms of your choice, so long as that work isn't itself a
  26.    parser generator using the skeleton or a modified version thereof
  27.    as a parser skeleton.  Alternatively, if you modify or redistribute
  28.    the parser skeleton itself, you may (at your option) remove this
  29.    special exception, which will cause the skeleton and the resulting
  30.    Bison output files to be licensed under the GNU General Public
  31.    License without this special exception.
  32.  
  33.    This special exception was added by the Free Software Foundation in
  34.    version 2.2 of Bison.  */
  35.  
  36. /* C LALR(1) parser skeleton written by Richard Stallman, by
  37.    simplifying the original so-called "semantic" parser.  */
  38.  
  39. /* All symbols defined below should begin with yy or YY, to avoid
  40.    infringing on user name space.  This should be done even for local
  41.    variables, as they might otherwise be expanded by user macros.
  42.    There are some unavoidable exceptions within include files to
  43.    define necessary library symbols; they are noted "INFRINGES ON
  44.    USER NAME SPACE" below.  */
  45.  
  46. /* Identify Bison output.  */
  47. #define YYBISON 1
  48.  
  49. /* Bison version.  */
  50. #define YYBISON_VERSION "2.3"
  51.  
  52. /* Skeleton name.  */
  53. #define YYSKELETON_NAME "yacc.c"
  54.  
  55. /* Pure parsers.  */
  56. #define YYPURE 0
  57.  
  58. /* Using locations.  */
  59. #define YYLSP_NEEDED 0
  60.  
  61.  
  62.  
  63. /* Tokens.  */
  64. #ifndef YYTOKENTYPE
  65. # define YYTOKENTYPE
  66.    /* Put the tokens into the symbol table, so that GDB and other debuggers
  67.       know about them.  */
  68.    enum yytokentype {
  69.      ARITH_NUM = 258,
  70.      ARITH_LPAREN = 259,
  71.      ARITH_RPAREN = 260,
  72.      ARITH_OR = 261,
  73.      ARITH_AND = 262,
  74.      ARITH_BOR = 263,
  75.      ARITH_BXOR = 264,
  76.      ARITH_BAND = 265,
  77.      ARITH_NE = 266,
  78.      ARITH_EQ = 267,
  79.      ARITH_LE = 268,
  80.      ARITH_GE = 269,
  81.      ARITH_GT = 270,
  82.      ARITH_LT = 271,
  83.      ARITH_RSHIFT = 272,
  84.      ARITH_LSHIFT = 273,
  85.      ARITH_SUB = 274,
  86.      ARITH_ADD = 275,
  87.      ARITH_REM = 276,
  88.      ARITH_DIV = 277,
  89.      ARITH_MUL = 278,
  90.      ARITH_BNOT = 279,
  91.      ARITH_NOT = 280,
  92.      ARITH_UNARYPLUS = 281,
  93.      ARITH_UNARYMINUS = 282
  94.    };
  95. #endif
  96. /* Tokens.  */
  97. #define ARITH_NUM 258
  98. #define ARITH_LPAREN 259
  99. #define ARITH_RPAREN 260
  100. #define ARITH_OR 261
  101. #define ARITH_AND 262
  102. #define ARITH_BOR 263
  103. #define ARITH_BXOR 264
  104. #define ARITH_BAND 265
  105. #define ARITH_NE 266
  106. #define ARITH_EQ 267
  107. #define ARITH_LE 268
  108. #define ARITH_GE 269
  109. #define ARITH_GT 270
  110. #define ARITH_LT 271
  111. #define ARITH_RSHIFT 272
  112. #define ARITH_LSHIFT 273
  113. #define ARITH_SUB 274
  114. #define ARITH_ADD 275
  115. #define ARITH_REM 276
  116. #define ARITH_DIV 277
  117. #define ARITH_MUL 278
  118. #define ARITH_BNOT 279
  119. #define ARITH_NOT 280
  120. #define ARITH_UNARYPLUS 281
  121. #define ARITH_UNARYMINUS 282
  122.  
  123.  
  124.  
  125.  
  126. /* Copy the first part of user declarations.  */
  127. #line 1 "arith.y"
  128.  
  129. /*  $NetBSD: arith.y,v 1.13 1999/07/09 03:05:49 christos Exp $  */
  130.  
  131. /*-
  132.  * Copyright (c) 1993
  133.  *  The Regents of the University of California.  All rights reserved.
  134.  *
  135.  * This code is derived from software contributed to Berkeley by
  136.  * Kenneth Almquist.
  137.  *
  138.  * Redistribution and use in source and binary forms, with or without
  139.  * modification, are permitted provided that the following conditions
  140.  * are met:
  141.  * 1. Redistributions of source code must retain the above copyright
  142.  *    notice, this list of conditions and the following disclaimer.
  143.  * 2. Redistributions in binary form must reproduce the above copyright
  144.  *    notice, this list of conditions and the following disclaimer in the
  145.  *    documentation and/or other materials provided with the distribution.
  146.  * 3. All advertising materials mentioning features or use of this software
  147.  *    must display the following acknowledgement:
  148.  *  This product includes software developed by the University of
  149.  *  California, Berkeley and its contributors.
  150.  * 4. Neither the name of the University nor the names of its contributors
  151.  *    may be used to endorse or promote products derived from this software
  152.  *    without specific prior written permission.
  153.  *
  154.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  155.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  156.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  157.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  158.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  159.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  160.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  161.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  162.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  163.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  164.  * SUCH DAMAGE.
  165.  */
  166.  
  167. #include <sys/cdefs.h>
  168. #ifndef lint
  169. #if 0
  170. static char sccsid[] = "@(#)arith.y 8.3 (Berkeley) 5/4/95";
  171. #else
  172. __RCSID("$NetBSD: arith.y,v 1.13 1999/07/09 03:05:49 christos Exp $");
  173. #endif
  174. #endif /* not lint */
  175.  
  176. #include <stdlib.h>
  177. #include "expand.h"
  178. #include "shell.h"
  179. #include "error.h"
  180. #include "output.h"
  181. #include "memalloc.h"
  182.  
  183. const char *arith_buf, *arith_startbuf;
  184.  
  185. void yyerror (const char *);
  186. int yyparse (void);
  187. #ifdef TESTARITH
  188. int main (int , char *[]);
  189. int error (char *);
  190. #endif
  191.  
  192. int
  193. arith(s)
  194.     const char *s;
  195. {
  196.     long result;
  197.  
  198.     arith_buf = arith_startbuf = s;
  199.  
  200.     INTOFF;
  201.     result = yyparse();
  202.     arith_lex_reset();  /* reprime lex */
  203.     INTON;
  204.  
  205.     return (result);
  206. }
  207.  
  208.  
  209. /*
  210.  *  The exp(1) builtin.
  211.  */
  212. int
  213. expcmd(argc, argv)
  214.     int argc;
  215.     char **argv;
  216. {
  217.     const char *p;
  218.     char *concat;
  219.     char **ap;
  220.     long i;
  221.  
  222.     if (argc > 1) {
  223.         p = argv[1];
  224.         if (argc > 2) {
  225.             /*
  226.              * concatenate arguments
  227.              */
  228.             STARTSTACKSTR(concat);
  229.             ap = argv + 2;
  230.             for (;;) {
  231.                 while (*p)
  232.                     STPUTC(*p++, concat);
  233.                 if ((p = *ap++) == NULL)
  234.                     break;
  235.                 STPUTC(' ', concat);
  236.             }
  237.             STPUTC('\0', concat);
  238.             p = grabstackstr(concat);
  239.         }
  240.     } else
  241.         p = "";
  242.  
  243.     i = arith(p);
  244.  
  245.     out1fmt("%ld\n", i);
  246.     return (! i);
  247. }
  248.  
  249. /*************************/
  250. #ifdef TEST_ARITH
  251. #include <stdio.h>
  252. main(argc, argv)
  253.     char *argv[];
  254. {
  255.     printf("%d\n", exp(argv[1]));
  256. }
  257. error(s)
  258.     char *s;
  259. {
  260.     fprintf(stderr, "exp: %s\n", s);
  261.     exit(1);
  262. }
  263. #endif
  264.  
  265.  
  266. /* Enabling traces.  */
  267. #ifndef YYDEBUG
  268. # define YYDEBUG 0
  269. #endif
  270.  
  271. /* Enabling verbose error messages.  */
  272. #ifdef YYERROR_VERBOSE
  273. # undef YYERROR_VERBOSE
  274. # define YYERROR_VERBOSE 1
  275. #else
  276. # define YYERROR_VERBOSE 0
  277. #endif
  278.  
  279. /* Enabling the token table.  */
  280. #ifndef YYTOKEN_TABLE
  281. # define YYTOKEN_TABLE 0
  282. #endif
  283.  
  284. #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
  285. typedef int YYSTYPE;
  286. # define yystype YYSTYPE /* obsolescent; will be withdrawn */
  287. # define YYSTYPE_IS_DECLARED 1
  288. # define YYSTYPE_IS_TRIVIAL 1
  289. #endif
  290.  
  291.  
  292.  
  293. /* Copy the second part of user declarations.  */
  294.  
  295.  
  296. /* Line 216 of yacc.c.  */
  297. #line 298 "y.tab.c"
  298.  
  299. #ifdef short
  300. # undef short
  301. #endif
  302.  
  303. #ifdef YYTYPE_UINT8
  304. typedef YYTYPE_UINT8 yytype_uint8;
  305. #else
  306. typedef unsigned char yytype_uint8;
  307. #endif
  308.  
  309. #ifdef YYTYPE_INT8
  310. typedef YYTYPE_INT8 yytype_int8;
  311. #elif (defined __STDC__ || defined __C99__FUNC__ \
  312.      || defined __cplusplus || defined _MSC_VER)
  313. typedef signed char yytype_int8;
  314. #else
  315. typedef short int yytype_int8;
  316. #endif
  317.  
  318. #ifdef YYTYPE_UINT16
  319. typedef YYTYPE_UINT16 yytype_uint16;
  320. #else
  321. typedef unsigned short int yytype_uint16;
  322. #endif
  323.  
  324. #ifdef YYTYPE_INT16
  325. typedef YYTYPE_INT16 yytype_int16;
  326. #else
  327. typedef short int yytype_int16;
  328. #endif
  329.  
  330. #ifndef YYSIZE_T
  331. # ifdef __SIZE_TYPE__
  332. #  define YYSIZE_T __SIZE_TYPE__
  333. # elif defined size_t
  334. #  define YYSIZE_T size_t
  335. # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
  336.      || defined __cplusplus || defined _MSC_VER)
  337. #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
  338. #  define YYSIZE_T size_t
  339. # else
  340. #  define YYSIZE_T unsigned int
  341. # endif
  342. #endif
  343.  
  344. #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
  345.  
  346. #ifndef YY_
  347. # if YYENABLE_NLS
  348. #  if ENABLE_NLS
  349. #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
  350. #   define YY_(msgid) dgettext ("bison-runtime", msgid)
  351. #  endif
  352. # endif
  353. # ifndef YY_
  354. #  define YY_(msgid) msgid
  355. # endif
  356. #endif
  357.  
  358. /* Suppress unused-variable warnings by "using" E.  */
  359. #if ! defined lint || defined __GNUC__
  360. # define YYUSE(e) ((void) (e))
  361. #else
  362. # define YYUSE(e) /* empty */
  363. #endif
  364.  
  365. /* Identity function, used to suppress warnings about constant conditions.  */
  366. #ifndef lint
  367. # define YYID(n) (n)
  368. #else
  369. #if (defined __STDC__ || defined __C99__FUNC__ \
  370.      || defined __cplusplus || defined _MSC_VER)
  371. static int
  372. YYID (int i)
  373. #else
  374. static int
  375. YYID (i)
  376.     int i;
  377. #endif
  378. {
  379.   return i;
  380. }
  381. #endif
  382.  
  383. #if ! defined yyoverflow || YYERROR_VERBOSE
  384.  
  385. /* The parser invokes alloca or malloc; define the necessary symbols.  */
  386.  
  387. # ifdef YYSTACK_USE_ALLOCA
  388. #  if YYSTACK_USE_ALLOCA
  389. #   ifdef __GNUC__
  390. #    define YYSTACK_ALLOC __builtin_alloca
  391. #   elif defined __BUILTIN_VA_ARG_INCR
  392. #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
  393. #   elif defined _AIX
  394. #    define YYSTACK_ALLOC __alloca
  395. #   elif defined _MSC_VER
  396. #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
  397. #    define alloca _alloca
  398. #   else
  399. #    define YYSTACK_ALLOC alloca
  400. #    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
  401.      || defined __cplusplus || defined _MSC_VER)
  402. #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
  403. #     ifndef _STDLIB_H
  404. #      define _STDLIB_H 1
  405. #     endif
  406. #    endif
  407. #   endif
  408. #  endif
  409. # endif
  410.  
  411. # ifdef YYSTACK_ALLOC
  412.    /* Pacify GCC's `empty if-body' warning.  */
  413. #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
  414. #  ifndef YYSTACK_ALLOC_MAXIMUM
  415.     /* The OS might guarantee only one guard page at the bottom of the stack,
  416.        and a page size can be as small as 4096 bytes.  So we cannot safely
  417.        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
  418.        to allow for a few compiler-allocated temporary stack slots.  */
  419. #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
  420. #  endif
  421. # else
  422. #  define YYSTACK_ALLOC YYMALLOC
  423. #  define YYSTACK_FREE YYFREE
  424. #  ifndef YYSTACK_ALLOC_MAXIMUM
  425. #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
  426. #  endif
  427. #  if (defined __cplusplus && ! defined _STDLIB_H \
  428.        && ! ((defined YYMALLOC || defined malloc) \
  429.          && (defined YYFREE || defined free)))
  430. #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
  431. #   ifndef _STDLIB_H
  432. #    define _STDLIB_H 1
  433. #   endif
  434. #  endif
  435. #  ifndef YYMALLOC
  436. #   define YYMALLOC malloc
  437. #   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
  438.      || defined __cplusplus || defined _MSC_VER)
  439. void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
  440. #   endif
  441. #  endif
  442. #  ifndef YYFREE
  443. #   define YYFREE free
  444. #   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
  445.      || defined __cplusplus || defined _MSC_VER)
  446. void free (void *); /* INFRINGES ON USER NAME SPACE */
  447. #   endif
  448. #  endif
  449. # endif
  450. #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
  451.  
  452.  
  453. #if (! defined yyoverflow \
  454.      && (! defined __cplusplus \
  455.      || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
  456.  
  457. /* A type that is properly aligned for any stack member.  */
  458. union yyalloc
  459. {
  460.   yytype_int16 yyss;
  461.   YYSTYPE yyvs;
  462.   };
  463.  
  464. /* The size of the maximum gap between one aligned stack and the next.  */
  465. # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
  466.  
  467. /* The size of an array large to enough to hold all stacks, each with
  468.    N elements.  */
  469. # define YYSTACK_BYTES(N) \
  470.      ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
  471.       + YYSTACK_GAP_MAXIMUM)
  472.  
  473. /* Copy COUNT objects from FROM to TO.  The source and destination do
  474.    not overlap.  */
  475. # ifndef YYCOPY
  476. #  if defined __GNUC__ && 1 < __GNUC__
  477. #   define YYCOPY(To, From, Count) \
  478.       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
  479. #  else
  480. #   define YYCOPY(To, From, Count)      \
  481.       do                    \
  482.     {                   \
  483.       YYSIZE_T yyi;             \
  484.       for (yyi = 0; yyi < (Count); yyi++)   \
  485.         (To)[yyi] = (From)[yyi];        \
  486.     }                   \
  487.       while (YYID (0))
  488. #  endif
  489. # endif
  490.  
  491. /* Relocate STACK from its old location to the new one.  The
  492.    local variables YYSIZE and YYSTACKSIZE give the old and new number of
  493.    elements in the stack, and YYPTR gives the new location of the
  494.    stack.  Advance YYPTR to a properly aligned location for the next
  495.    stack.  */
  496. # define YYSTACK_RELOCATE(Stack)                    \
  497.     do                                  \
  498.       {                                 \
  499.     YYSIZE_T yynewbytes;                        \
  500.     YYCOPY (&yyptr->Stack, Stack, yysize);              \
  501.     Stack = &yyptr->Stack;                      \
  502.     yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
  503.     yyptr += yynewbytes / sizeof (*yyptr);              \
  504.       }                                 \
  505.     while (YYID (0))
  506.  
  507. #endif
  508.  
  509. /* YYFINAL -- State number of the termination state.  */
  510. #define YYFINAL  14
  511. /* YYLAST -- Last index in YYTABLE.  */
  512. #define YYLAST   170
  513.  
  514. /* YYNTOKENS -- Number of terminals.  */
  515. #define YYNTOKENS  28
  516. /* YYNNTS -- Number of nonterminals.  */
  517. #define YYNNTS  3
  518. /* YYNRULES -- Number of rules.  */
  519. #define YYNRULES  26
  520. /* YYNRULES -- Number of states.  */
  521. #define YYNSTATES  52
  522.  
  523. /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
  524. #define YYUNDEFTOK  2
  525. #define YYMAXUTOK   282
  526.  
  527. #define YYTRANSLATE(YYX)                        \
  528.   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
  529.  
  530. /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
  531. static const yytype_uint8 yytranslate[] =
  532. {
  533.        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  534.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  535.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  536.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  537.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  538.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  539.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  540.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  541.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  542.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  543.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  544.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  545.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  546.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  547.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  548.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  549.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  550.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  551.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  552.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  553.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  554.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  555.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  556.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  557.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  558.        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
  559.        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
  560.       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
  561.       25,    26,    27
  562. };
  563.  
  564. #if YYDEBUG
  565. /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
  566.    YYRHS.  */
  567. static const yytype_uint8 yyprhs[] =
  568. {
  569.        0,     0,     3,     5,     9,    13,    17,    21,    25,    29,
  570.       33,    37,    41,    45,    49,    53,    57,    61,    65,    69,
  571.       73,    77,    81,    84,    87,    90,    93
  572. };
  573.  
  574. /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
  575. static const yytype_int8 yyrhs[] =
  576. {
  577.       29,     0,    -1,    30,    -1,     4,    30,     5,    -1,    30,
  578.        6,    30,    -1,    30,     7,    30,    -1,    30,     8,    30,
  579.       -1,    30,     9,    30,    -1,    30,    10,    30,    -1,    30,
  580.       12,    30,    -1,    30,    15,    30,    -1,    30,    14,    30,
  581.       -1,    30,    16,    30,    -1,    30,    13,    30,    -1,    30,
  582.       11,    30,    -1,    30,    18,    30,    -1,    30,    17,    30,
  583.       -1,    30,    20,    30,    -1,    30,    19,    30,    -1,    30,
  584.       23,    30,    -1,    30,    22,    30,    -1,    30,    21,    30,
  585.       -1,    25,    30,    -1,    24,    30,    -1,    19,    30,    -1,
  586.       20,    30,    -1,     3,    -1
  587. };
  588.  
  589. /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
  590. static const yytype_uint8 yyrline[] =
  591. {
  592.        0,   153,   153,   159,   160,   161,   162,   163,   164,   165,
  593.      166,   167,   168,   169,   170,   171,   172,   173,   174,   175,
  594.      176,   181,   186,   187,   188,   189,   190
  595. };
  596. #endif
  597.  
  598. #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
  599. /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
  600.    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
  601. static const char *const yytname[] =
  602. {
  603.   "$end", "error", "$undefined", "ARITH_NUM", "ARITH_LPAREN",
  604.   "ARITH_RPAREN", "ARITH_OR", "ARITH_AND", "ARITH_BOR", "ARITH_BXOR",
  605.   "ARITH_BAND", "ARITH_NE", "ARITH_EQ", "ARITH_LE", "ARITH_GE", "ARITH_GT",
  606.   "ARITH_LT", "ARITH_RSHIFT", "ARITH_LSHIFT", "ARITH_SUB", "ARITH_ADD",
  607.   "ARITH_REM", "ARITH_DIV", "ARITH_MUL", "ARITH_BNOT", "ARITH_NOT",
  608.   "ARITH_UNARYPLUS", "ARITH_UNARYMINUS", "$accept", "exp", "expr", 0
  609. };
  610. #endif
  611.  
  612. # ifdef YYPRINT
  613. /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
  614.    token YYLEX-NUM.  */
  615. static const yytype_uint16 yytoknum[] =
  616. {
  617.        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
  618.      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
  619.      275,   276,   277,   278,   279,   280,   281,   282
  620. };
  621. # endif
  622.  
  623. /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
  624. static const yytype_uint8 yyr1[] =
  625. {
  626.        0,    28,    29,    30,    30,    30,    30,    30,    30,    30,
  627.       30,    30,    30,    30,    30,    30,    30,    30,    30,    30,
  628.       30,    30,    30,    30,    30,    30,    30
  629. };
  630.  
  631. /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
  632. static const yytype_uint8 yyr2[] =
  633. {
  634.        0,     2,     1,     3,     3,     3,     3,     3,     3,     3,
  635.        3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
  636.        3,     3,     2,     2,     2,     2,     1
  637. };
  638.  
  639. /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
  640.    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
  641.    means the default is an error.  */
  642. static const yytype_uint8 yydefact[] =
  643. {
  644.        0,    26,     0,     0,     0,     0,     0,     0,     2,     0,
  645.       24,    25,    23,    22,     1,     0,     0,     0,     0,     0,
  646.        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  647.        0,     0,     0,     3,     4,     5,     6,     7,     8,    14,
  648.        9,    13,    11,    10,    12,    16,    15,    18,    17,    21,
  649.       20,    19
  650. };
  651.  
  652. /* YYDEFGOTO[NTERM-NUM].  */
  653. static const yytype_int8 yydefgoto[] =
  654. {
  655.       -1,     7,     8
  656. };
  657.  
  658. /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
  659.    STATE-NUM.  */
  660. #define YYPACT_NINF -13
  661. static const yytype_int16 yypact[] =
  662. {
  663.       28,   -13,    28,    28,    28,    28,    28,    12,    67,    49,
  664.      -13,   -13,   -13,   -13,   -13,    28,    28,    28,    28,    28,
  665.       28,    28,    28,    28,    28,    28,    28,    28,    28,    28,
  666.       28,    28,    28,   -13,    84,   100,   115,    23,   128,   139,
  667.      139,   -12,   -12,   -12,   -12,   144,   144,   147,   147,   -13,
  668.      -13,   -13
  669. };
  670.  
  671. /* YYPGOTO[NTERM-NUM].  */
  672. static const yytype_int8 yypgoto[] =
  673. {
  674.      -13,   -13,    -2
  675. };
  676.  
  677. /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
  678.    positive, shift that token.  If negative, reduce the rule which
  679.    number is the opposite.  If zero, do what YYDEFACT says.
  680.    If YYTABLE_NINF, syntax error.  */
  681. #define YYTABLE_NINF -1
  682. static const yytype_uint8 yytable[] =
  683. {
  684.        9,    10,    11,    12,    13,    26,    27,    28,    29,    30,
  685.       31,    32,    14,    34,    35,    36,    37,    38,    39,    40,
  686.       41,    42,    43,    44,    45,    46,    47,    48,    49,    50,
  687.       51,     1,     2,    19,    20,    21,    22,    23,    24,    25,
  688.       26,    27,    28,    29,    30,    31,    32,     3,     4,     0,
  689.        0,     0,     5,     6,    33,    15,    16,    17,    18,    19,
  690.       20,    21,    22,    23,    24,    25,    26,    27,    28,    29,
  691.       30,    31,    32,    15,    16,    17,    18,    19,    20,    21,
  692.       22,    23,    24,    25,    26,    27,    28,    29,    30,    31,
  693.       32,    16,    17,    18,    19,    20,    21,    22,    23,    24,
  694.       25,    26,    27,    28,    29,    30,    31,    32,    17,    18,
  695.       19,    20,    21,    22,    23,    24,    25,    26,    27,    28,
  696.       29,    30,    31,    32,    18,    19,    20,    21,    22,    23,
  697.       24,    25,    26,    27,    28,    29,    30,    31,    32,    20,
  698.       21,    22,    23,    24,    25,    26,    27,    28,    29,    30,
  699.       31,    32,    22,    23,    24,    25,    26,    27,    28,    29,
  700.       30,    31,    32,    28,    29,    30,    31,    32,    30,    31,
  701.       32
  702. };
  703.  
  704. static const yytype_int8 yycheck[] =
  705. {
  706.        2,     3,     4,     5,     6,    17,    18,    19,    20,    21,
  707.       22,    23,     0,    15,    16,    17,    18,    19,    20,    21,
  708.       22,    23,    24,    25,    26,    27,    28,    29,    30,    31,
  709.       32,     3,     4,    10,    11,    12,    13,    14,    15,    16,
  710.       17,    18,    19,    20,    21,    22,    23,    19,    20,    -1,
  711.       -1,    -1,    24,    25,     5,     6,     7,     8,     9,    10,
  712.       11,    12,    13,    14,    15,    16,    17,    18,    19,    20,
  713.       21,    22,    23,     6,     7,     8,     9,    10,    11,    12,
  714.       13,    14,    15,    16,    17,    18,    19,    20,    21,    22,
  715.       23,     7,     8,     9,    10,    11,    12,    13,    14,    15,
  716.       16,    17,    18,    19,    20,    21,    22,    23,     8,     9,
  717.       10,    11,    12,    13,    14,    15,    16,    17,    18,    19,
  718.       20,    21,    22,    23,     9,    10,    11,    12,    13,    14,
  719.       15,    16,    17,    18,    19,    20,    21,    22,    23,    11,
  720.       12,    13,    14,    15,    16,    17,    18,    19,    20,    21,
  721.       22,    23,    13,    14,    15,    16,    17,    18,    19,    20,
  722.       21,    22,    23,    19,    20,    21,    22,    23,    21,    22,
  723.       23
  724. };
  725.  
  726. /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
  727.    symbol of state STATE-NUM.  */
  728. static const yytype_uint8 yystos[] =
  729. {
  730.        0,     3,     4,    19,    20,    24,    25,    29,    30,    30,
  731.       30,    30,    30,    30,     0,     6,     7,     8,     9,    10,
  732.       11,    12,    13,    14,    15,    16,    17,    18,    19,    20,
  733.       21,    22,    23,     5,    30,    30,    30,    30,    30,    30,
  734.       30,    30,    30,    30,    30,    30,    30,    30,    30,    30,
  735.       30,    30
  736. };
  737.  
  738. #define yyerrok     (yyerrstatus = 0)
  739. #define yyclearin   (yychar = YYEMPTY)
  740. #define YYEMPTY     (-2)
  741. #define YYEOF       0
  742.  
  743. #define YYACCEPT    goto yyacceptlab
  744. #define YYABORT     goto yyabortlab
  745. #define YYERROR     goto yyerrorlab
  746.  
  747.  
  748. /* Like YYERROR except do call yyerror.  This remains here temporarily
  749.    to ease the transition to the new meaning of YYERROR, for GCC.
  750.    Once GCC version 2 has supplanted version 1, this can go.  */
  751.  
  752. #define YYFAIL      goto yyerrlab
  753.  
  754. #define YYRECOVERING()  (!!yyerrstatus)
  755.  
  756. #define YYBACKUP(Token, Value)                  \
  757. do                              \
  758.   if (yychar == YYEMPTY && yylen == 1)              \
  759.     {                               \
  760.       yychar = (Token);                     \
  761.       yylval = (Value);                     \
  762.       yytoken = YYTRANSLATE (yychar);               \
  763.       YYPOPSTACK (1);                       \
  764.       goto yybackup;                        \
  765.     }                               \
  766.   else                              \
  767.     {                               \
  768.       yyerror (YY_("syntax error: cannot back up")); \
  769.       YYERROR;                          \
  770.     }                               \
  771. while (YYID (0))
  772.  
  773.  
  774. #define YYTERROR    1
  775. #define YYERRCODE   256
  776.  
  777.  
  778. /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
  779.    If N is 0, then set CURRENT to the empty location which ends
  780.    the previous symbol: RHS[0] (always defined).  */
  781.  
  782. #define YYRHSLOC(Rhs, K) ((Rhs)[K])
  783. #ifndef YYLLOC_DEFAULT
  784. # define YYLLOC_DEFAULT(Current, Rhs, N)                \
  785.     do                                  \
  786.       if (YYID (N))                                                    \
  787.     {                               \
  788.       (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;    \
  789.       (Current).first_column = YYRHSLOC (Rhs, 1).first_column;  \
  790.       (Current).last_line    = YYRHSLOC (Rhs, N).last_line;     \
  791.       (Current).last_column  = YYRHSLOC (Rhs, N).last_column;   \
  792.     }                               \
  793.       else                              \
  794.     {                               \
  795.       (Current).first_line   = (Current).last_line   =      \
  796.         YYRHSLOC (Rhs, 0).last_line;                \
  797.       (Current).first_column = (Current).last_column =      \
  798.         YYRHSLOC (Rhs, 0).last_column;              \
  799.     }                               \
  800.     while (YYID (0))
  801. #endif
  802.  
  803.  
  804. /* YY_LOCATION_PRINT -- Print the location on the stream.
  805.    This macro was not mandated originally: define only if we know
  806.    we won't break user code: when these are the locations we know.  */
  807.  
  808. #ifndef YY_LOCATION_PRINT
  809. # if YYLTYPE_IS_TRIVIAL
  810. #  define YY_LOCATION_PRINT(File, Loc)          \
  811.      fprintf (File, "%d.%d-%d.%d",          \
  812.           (Loc).first_line, (Loc).first_column, \
  813.           (Loc).last_line,  (Loc).last_column)
  814. # else
  815. #  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
  816. # endif
  817. #endif
  818.  
  819.  
  820. /* YYLEX -- calling `yylex' with the right arguments.  */
  821.  
  822. #ifdef YYLEX_PARAM
  823. # define YYLEX yylex (YYLEX_PARAM)
  824. #else
  825. # define YYLEX yylex ()
  826. #endif
  827.  
  828. /* Enable debugging if requested.  */
  829. #if YYDEBUG
  830.  
  831. # ifndef YYFPRINTF
  832. #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
  833. #  define YYFPRINTF fprintf
  834. # endif
  835.  
  836. # define YYDPRINTF(Args)            \
  837. do {                        \
  838.   if (yydebug)                  \
  839.     YYFPRINTF Args;             \
  840. } while (YYID (0))
  841.  
  842. # define YY_SYMBOL_PRINT(Title, Type, Value, Location)            \
  843. do {                                      \
  844.   if (yydebug)                                \
  845.     {                                     \
  846.       YYFPRINTF (stderr, "%s ", Title);                   \
  847.       yy_symbol_print (stderr,                        \
  848.           Type, Value); \
  849.       YYFPRINTF (stderr, "\n");                       \
  850.     }                                     \
  851. } while (YYID (0))
  852.  
  853.  
  854. /*--------------------------------.
  855. | Print this symbol on YYOUTPUT.  |
  856. `--------------------------------*/
  857.  
  858. /*ARGSUSED*/
  859. #if (defined __STDC__ || defined __C99__FUNC__ \
  860.      || defined __cplusplus || defined _MSC_VER)
  861. static void
  862. yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
  863. #else
  864. static void
  865. yy_symbol_value_print (yyoutput, yytype, yyvaluep)
  866.     FILE *yyoutput;
  867.     int yytype;
  868.     YYSTYPE const * const yyvaluep;
  869. #endif
  870. {
  871.   if (!yyvaluep)
  872.     return;
  873. # ifdef YYPRINT
  874.   if (yytype < YYNTOKENS)
  875.     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
  876. # else
  877.   YYUSE (yyoutput);
  878. # endif
  879.   switch (yytype)
  880.     {
  881.       default:
  882.     break;
  883.     }
  884. }
  885.  
  886.  
  887. /*--------------------------------.
  888. | Print this symbol on YYOUTPUT.  |
  889. `--------------------------------*/
  890.  
  891. #if (defined __STDC__ || defined __C99__FUNC__ \
  892.      || defined __cplusplus || defined _MSC_VER)
  893. static void
  894. yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
  895. #else
  896. static void
  897. yy_symbol_print (yyoutput, yytype, yyvaluep)
  898.     FILE *yyoutput;
  899.     int yytype;
  900.     YYSTYPE const * const yyvaluep;
  901. #endif
  902. {
  903.   if (yytype < YYNTOKENS)
  904.     YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
  905.   else
  906.     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
  907.  
  908.   yy_symbol_value_print (yyoutput, yytype, yyvaluep);
  909.   YYFPRINTF (yyoutput, ")");
  910. }
  911.  
  912. /*------------------------------------------------------------------.
  913. | yy_stack_print -- Print the state stack from its BOTTOM up to its |
  914. | TOP (included).                                                   |
  915. `------------------------------------------------------------------*/
  916.  
  917. #if (defined __STDC__ || defined __C99__FUNC__ \
  918.      || defined __cplusplus || defined _MSC_VER)
  919. static void
  920. yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
  921. #else
  922. static void
  923. yy_stack_print (bottom, top)
  924.     yytype_int16 *bottom;
  925.     yytype_int16 *top;
  926. #endif
  927. {
  928.   YYFPRINTF (stderr, "Stack now");
  929.   for (; bottom <= top; ++bottom)
  930.     YYFPRINTF (stderr, " %d", *bottom);
  931.   YYFPRINTF (stderr, "\n");
  932. }
  933.  
  934. # define YY_STACK_PRINT(Bottom, Top)                \
  935. do {                                \
  936.   if (yydebug)                          \
  937.     yy_stack_print ((Bottom), (Top));               \
  938. } while (YYID (0))
  939.  
  940.  
  941. /*------------------------------------------------.
  942. | Report that the YYRULE is going to be reduced.  |
  943. `------------------------------------------------*/
  944.  
  945. #if (defined __STDC__ || defined __C99__FUNC__ \
  946.      || defined __cplusplus || defined _MSC_VER)
  947. static void
  948. yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
  949. #else
  950. static void
  951. yy_reduce_print (yyvsp, yyrule)
  952.     YYSTYPE *yyvsp;
  953.     int yyrule;
  954. #endif
  955. {
  956.   int yynrhs = yyr2[yyrule];
  957.   int yyi;
  958.   unsigned long int yylno = yyrline[yyrule];
  959.   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
  960.          yyrule - 1, yylno);
  961.   /* The symbols being reduced.  */
  962.   for (yyi = 0; yyi < yynrhs; yyi++)
  963.     {
  964.       fprintf (stderr, "   $%d = ", yyi + 1);
  965.       yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
  966.                &(yyvsp[(yyi + 1) - (yynrhs)])
  967.                            );
  968.       fprintf (stderr, "\n");
  969.     }
  970. }
  971.  
  972. # define YY_REDUCE_PRINT(Rule)      \
  973. do {                    \
  974.   if (yydebug)              \
  975.     yy_reduce_print (yyvsp, Rule); \
  976. } while (YYID (0))
  977.  
  978. /* Nonzero means print parse trace.  It is left uninitialized so that
  979.    multiple parsers can coexist.  */
  980. int yydebug;
  981. #else /* !YYDEBUG */
  982. # define YYDPRINTF(Args)
  983. # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
  984. # define YY_STACK_PRINT(Bottom, Top)
  985. # define YY_REDUCE_PRINT(Rule)
  986. #endif /* !YYDEBUG */
  987.  
  988.  
  989. /* YYINITDEPTH -- initial size of the parser's stacks.  */
  990. #ifndef YYINITDEPTH
  991. # define YYINITDEPTH 200
  992. #endif
  993.  
  994. /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
  995.    if the built-in stack extension method is used).
  996.  
  997.    Do not make this value too large; the results are undefined if
  998.    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
  999.    evaluated with infinite-precision integer arithmetic.  */
  1000.  
  1001. #ifndef YYMAXDEPTH
  1002. # define YYMAXDEPTH 10000
  1003. #endif
  1004.  
  1005.  
  1006. #if YYERROR_VERBOSE
  1007.  
  1008. # ifndef yystrlen
  1009. #  if defined __GLIBC__ && defined _STRING_H
  1010. #   define yystrlen strlen
  1011. #  else
  1012. /* Return the length of YYSTR.  */
  1013. #if (defined __STDC__ || defined __C99__FUNC__ \
  1014.      || defined __cplusplus || defined _MSC_VER)
  1015. static YYSIZE_T
  1016. yystrlen (const char *yystr)
  1017. #else
  1018. static YYSIZE_T
  1019. yystrlen (yystr)
  1020.     const char *yystr;
  1021. #endif
  1022. {
  1023.   YYSIZE_T yylen;
  1024.   for (yylen = 0; yystr[yylen]; yylen++)
  1025.     continue;
  1026.   return yylen;
  1027. }
  1028. #  endif
  1029. # endif
  1030.  
  1031. # ifndef yystpcpy
  1032. #  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
  1033. #   define yystpcpy stpcpy
  1034. #  else
  1035. /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
  1036.    YYDEST.  */
  1037. #if (defined __STDC__ || defined __C99__FUNC__ \
  1038.      || defined __cplusplus || defined _MSC_VER)
  1039. static char *
  1040. yystpcpy (char *yydest, const char *yysrc)
  1041. #else
  1042. static char *
  1043. yystpcpy (yydest, yysrc)
  1044.     char *yydest;
  1045.     const char *yysrc;
  1046. #endif
  1047. {
  1048.   char *yyd = yydest;
  1049.   const char *yys = yysrc;
  1050.  
  1051.   while ((*yyd++ = *yys++) != '\0')
  1052.     continue;
  1053.  
  1054.   return yyd - 1;
  1055. }
  1056. #  endif
  1057. # endif
  1058.  
  1059. # ifndef yytnamerr
  1060. /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
  1061.    quotes and backslashes, so that it's suitable for yyerror.  The
  1062.    heuristic is that double-quoting is unnecessary unless the string
  1063.    contains an apostrophe, a comma, or backslash (other than
  1064.    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
  1065.    null, do not copy; instead, return the length of what the result
  1066.    would have been.  */
  1067. static YYSIZE_T
  1068. yytnamerr (char *yyres, const char *yystr)
  1069. {
  1070.   if (*yystr == '"')
  1071.     {
  1072.       YYSIZE_T yyn = 0;
  1073.       char const *yyp = yystr;
  1074.  
  1075.       for (;;)
  1076.     switch (*++yyp)
  1077.       {
  1078.       case '\'':
  1079.       case ',':
  1080.         goto do_not_strip_quotes;
  1081.  
  1082.       case '\\':
  1083.         if (*++yyp != '\\')
  1084.           goto do_not_strip_quotes;
  1085.         /* Fall through.  */
  1086.       default:
  1087.         if (yyres)
  1088.           yyres[yyn] = *yyp;
  1089.         yyn++;
  1090.         break;
  1091.  
  1092.       case '"':
  1093.         if (yyres)
  1094.           yyres[yyn] = '\0';
  1095.         return yyn;
  1096.       }
  1097.     do_not_strip_quotes: ;
  1098.     }
  1099.  
  1100.   if (! yyres)
  1101.     return yystrlen (yystr);
  1102.  
  1103.   return yystpcpy (yyres, yystr) - yyres;
  1104. }
  1105. # endif
  1106.  
  1107. /* Copy into YYRESULT an error message about the unexpected token
  1108.    YYCHAR while in state YYSTATE.  Return the number of bytes copied,
  1109.    including the terminating null byte.  If YYRESULT is null, do not
  1110.    copy anything; just return the number of bytes that would be
  1111.    copied.  As a special case, return 0 if an ordinary "syntax error"
  1112.    message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
  1113.    size calculation.  */
  1114. static YYSIZE_T
  1115. yysyntax_error (char *yyresult, int yystate, int yychar)
  1116. {
  1117.   int yyn = yypact[yystate];
  1118.  
  1119.   if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
  1120.     return 0;
  1121.   else
  1122.     {
  1123.       int yytype = YYTRANSLATE (yychar);
  1124.       YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
  1125.       YYSIZE_T yysize = yysize0;
  1126.       YYSIZE_T yysize1;
  1127.       int yysize_overflow = 0;
  1128.       enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
  1129.       char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
  1130.       int yyx;
  1131.  
  1132. # if 0
  1133.       /* This is so xgettext sees the translatable formats that are
  1134.      constructed on the fly.  */
  1135.       YY_("syntax error, unexpected %s");
  1136.       YY_("syntax error, unexpected %s, expecting %s");
  1137.       YY_("syntax error, unexpected %s, expecting %s or %s");
  1138.       YY_("syntax error, unexpected %s, expecting %s or %s or %s");
  1139.       YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
  1140. # endif
  1141.       char *yyfmt;
  1142.       char const *yyf;
  1143.       static char const yyunexpected[] = "syntax error, unexpected %s";
  1144.       static char const yyexpecting[] = ", expecting %s";
  1145.       static char const yyor[] = " or %s";
  1146.       char yyformat[sizeof yyunexpected
  1147.             + sizeof yyexpecting - 1
  1148.             + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
  1149.                * (sizeof yyor - 1))];
  1150.       char const *yyprefix = yyexpecting;
  1151.  
  1152.       /* Start YYX at -YYN if negative to avoid negative indexes in
  1153.      YYCHECK.  */
  1154.       int yyxbegin = yyn < 0 ? -yyn : 0;
  1155.  
  1156.       /* Stay within bounds of both yycheck and yytname.  */
  1157.       int yychecklim = YYLAST - yyn + 1;
  1158.       int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
  1159.       int yycount = 1;
  1160.  
  1161.       yyarg[0] = yytname[yytype];
  1162.       yyfmt = yystpcpy (yyformat, yyunexpected);
  1163.  
  1164.       for (yyx = yyxbegin; yyx < yyxend; ++yyx)
  1165.     if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
  1166.       {
  1167.         if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
  1168.           {
  1169.         yycount = 1;
  1170.         yysize = yysize0;
  1171.         yyformat[sizeof yyunexpected - 1] = '\0';
  1172.         break;
  1173.           }
  1174.         yyarg[yycount++] = yytname[yyx];
  1175.         yysize1 = yysize + yytnamerr (0, yytname[yyx]);
  1176.         yysize_overflow |= (yysize1 < yysize);
  1177.         yysize = yysize1;
  1178.         yyfmt = yystpcpy (yyfmt, yyprefix);
  1179.         yyprefix = yyor;
  1180.       }
  1181.  
  1182.       yyf = YY_(yyformat);
  1183.       yysize1 = yysize + yystrlen (yyf);
  1184.       yysize_overflow |= (yysize1 < yysize);
  1185.       yysize = yysize1;
  1186.  
  1187.       if (yysize_overflow)
  1188.     return YYSIZE_MAXIMUM;
  1189.  
  1190.       if (yyresult)
  1191.     {
  1192.       /* Avoid sprintf, as that infringes on the user's name space.
  1193.          Don't have undefined behavior even if the translation
  1194.          produced a string with the wrong number of "%s"s.  */
  1195.       char *yyp = yyresult;
  1196.       int yyi = 0;
  1197.       while ((*yyp = *yyf) != '\0')
  1198.         {
  1199.           if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
  1200.         {
  1201.           yyp += yytnamerr (yyp, yyarg[yyi++]);
  1202.           yyf += 2;
  1203.         }
  1204.           else
  1205.         {
  1206.           yyp++;
  1207.           yyf++;
  1208.         }
  1209.         }
  1210.     }
  1211.       return yysize;
  1212.     }
  1213. }
  1214. #endif /* YYERROR_VERBOSE */
  1215.  
  1216. /*-----------------------------------------------.
  1217. | Release the memory associated to this symbol.  |
  1218. `-----------------------------------------------*/
  1219.  
  1220. /*ARGSUSED*/
  1221. #if (defined __STDC__ || defined __C99__FUNC__ \
  1222.      || defined __cplusplus || defined _MSC_VER)
  1223. static void
  1224. yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
  1225. #else
  1226. static void
  1227. yydestruct (yymsg, yytype, yyvaluep)
  1228.     const char *yymsg;
  1229.     int yytype;
  1230.     YYSTYPE *yyvaluep;
  1231. #endif
  1232. {
  1233.   YYUSE (yyvaluep);
  1234.  
  1235.   if (!yymsg)
  1236.     yymsg = "Deleting";
  1237.   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
  1238.  
  1239.   switch (yytype)
  1240.     {
  1241.  
  1242.       default:
  1243.     break;
  1244.     }
  1245. }
  1246.  
  1247. /* Prevent warnings from -Wmissing-prototypes.  */
  1248.  
  1249. #ifdef YYPARSE_PARAM
  1250. #if defined __STDC__ || defined __cplusplus
  1251. int yyparse (void *YYPARSE_PARAM);
  1252. #else
  1253. int yyparse ();
  1254. #endif
  1255. #else /* ! YYPARSE_PARAM */
  1256. #if defined __STDC__ || defined __cplusplus
  1257. int yyparse (void);
  1258. #else
  1259. int yyparse ();
  1260. #endif
  1261. #endif /* ! YYPARSE_PARAM */
  1262.  
  1263.  
  1264.  
  1265. /* The look-ahead symbol.  */
  1266. int yychar;
  1267.  
  1268. /* The semantic value of the look-ahead symbol.  */
  1269. YYSTYPE yylval;
  1270.  
  1271. /* Number of syntax errors so far.  */
  1272. int yynerrs;
  1273.  
  1274.  
  1275.  
  1276. /*----------.
  1277. | yyparse.  |
  1278. `----------*/
  1279.  
  1280. #ifdef YYPARSE_PARAM
  1281. #if (defined __STDC__ || defined __C99__FUNC__ \
  1282.      || defined __cplusplus || defined _MSC_VER)
  1283. int
  1284. yyparse (void *YYPARSE_PARAM)
  1285. #else
  1286. int
  1287. yyparse (YYPARSE_PARAM)
  1288.     void *YYPARSE_PARAM;
  1289. #endif
  1290. #else /* ! YYPARSE_PARAM */
  1291. #if (defined __STDC__ || defined __C99__FUNC__ \
  1292.      || defined __cplusplus || defined _MSC_VER)
  1293. int
  1294. yyparse (void)
  1295. #else
  1296. int
  1297. yyparse ()
  1298.  
  1299. #endif
  1300. #endif
  1301. {
  1302.  
  1303.   int yystate;
  1304.   int yyn;
  1305.   int yyresult;
  1306.   /* Number of tokens to shift before error messages enabled.  */
  1307.   int yyerrstatus;
  1308.   /* Look-ahead token as an internal (translated) token number.  */
  1309.   int yytoken = 0;
  1310. #if YYERROR_VERBOSE
  1311.   /* Buffer for error messages, and its allocated size.  */
  1312.   char yymsgbuf[128];
  1313.   char *yymsg = yymsgbuf;
  1314.   YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
  1315. #endif
  1316.  
  1317.   /* Three stacks and their tools:
  1318.      `yyss': related to states,
  1319.      `yyvs': related to semantic values,
  1320.      `yyls': related to locations.
  1321.  
  1322.      Refer to the stacks thru separate pointers, to allow yyoverflow
  1323.      to reallocate them elsewhere.  */
  1324.  
  1325.   /* The state stack.  */
  1326.   yytype_int16 yyssa[YYINITDEPTH];
  1327.   yytype_int16 *yyss = yyssa;
  1328.   yytype_int16 *yyssp;
  1329.  
  1330.   /* The semantic value stack.  */
  1331.   YYSTYPE yyvsa[YYINITDEPTH];
  1332.   YYSTYPE *yyvs = yyvsa;
  1333.   YYSTYPE *yyvsp;
  1334.  
  1335.  
  1336.  
  1337. #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
  1338.  
  1339.   YYSIZE_T yystacksize = YYINITDEPTH;
  1340.  
  1341.   /* The variables used to return semantic value and location from the
  1342.      action routines.  */
  1343.   YYSTYPE yyval;
  1344.  
  1345.  
  1346.   /* The number of symbols on the RHS of the reduced rule.
  1347.      Keep to zero when no symbol should be popped.  */
  1348.   int yylen = 0;
  1349.  
  1350.   YYDPRINTF ((stderr, "Starting parse\n"));
  1351.  
  1352.   yystate = 0;
  1353.   yyerrstatus = 0;
  1354.   yynerrs = 0;
  1355.   yychar = YYEMPTY;     /* Cause a token to be read.  */
  1356.  
  1357.   /* Initialize stack pointers.
  1358.      Waste one element of value and location stack
  1359.      so that they stay on the same level as the state stack.
  1360.      The wasted elements are never initialized.  */
  1361.  
  1362.   yyssp = yyss;
  1363.   yyvsp = yyvs;
  1364.  
  1365.   goto yysetstate;
  1366.  
  1367. /*------------------------------------------------------------.
  1368. | yynewstate -- Push a new state, which is found in yystate.  |
  1369. `------------------------------------------------------------*/
  1370.  yynewstate:
  1371.   /* In all cases, when you get here, the value and location stacks
  1372.      have just been pushed.  So pushing a state here evens the stacks.  */
  1373.   yyssp++;
  1374.  
  1375.  yysetstate:
  1376.   *yyssp = yystate;
  1377.  
  1378.   if (yyss + yystacksize - 1 <= yyssp)
  1379.     {
  1380.       /* Get the current used size of the three stacks, in elements.  */
  1381.       YYSIZE_T yysize = yyssp - yyss + 1;
  1382.  
  1383. #ifdef yyoverflow
  1384.       {
  1385.     /* Give user a chance to reallocate the stack.  Use copies of
  1386.        these so that the &'s don't force the real ones into
  1387.        memory.  */
  1388.     YYSTYPE *yyvs1 = yyvs;
  1389.     yytype_int16 *yyss1 = yyss;
  1390.  
  1391.  
  1392.     /* Each stack pointer address is followed by the size of the
  1393.        data in use in that stack, in bytes.  This used to be a
  1394.        conditional around just the two extra args, but that might
  1395.        be undefined if yyoverflow is a macro.  */
  1396.     yyoverflow (YY_("memory exhausted"),
  1397.             &yyss1, yysize * sizeof (*yyssp),
  1398.             &yyvs1, yysize * sizeof (*yyvsp),
  1399.  
  1400.             &yystacksize);
  1401.  
  1402.     yyss = yyss1;
  1403.     yyvs = yyvs1;
  1404.       }
  1405. #else /* no yyoverflow */
  1406. # ifndef YYSTACK_RELOCATE
  1407.       goto yyexhaustedlab;
  1408. # else
  1409.       /* Extend the stack our own way.  */
  1410.       if (YYMAXDEPTH <= yystacksize)
  1411.     goto yyexhaustedlab;
  1412.       yystacksize *= 2;
  1413.       if (YYMAXDEPTH < yystacksize)
  1414.     yystacksize = YYMAXDEPTH;
  1415.  
  1416.       {
  1417.     yytype_int16 *yyss1 = yyss;
  1418.     union yyalloc *yyptr =
  1419.       (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
  1420.     if (! yyptr)
  1421.       goto yyexhaustedlab;
  1422.     YYSTACK_RELOCATE (yyss);
  1423.     YYSTACK_RELOCATE (yyvs);
  1424.  
  1425. #  undef YYSTACK_RELOCATE
  1426.     if (yyss1 != yyssa)
  1427.       YYSTACK_FREE (yyss1);
  1428.       }
  1429. # endif
  1430. #endif /* no yyoverflow */
  1431.  
  1432.       yyssp = yyss + yysize - 1;
  1433.       yyvsp = yyvs + yysize - 1;
  1434.  
  1435.  
  1436.       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
  1437.           (unsigned long int) yystacksize));
  1438.  
  1439.       if (yyss + yystacksize - 1 <= yyssp)
  1440.     YYABORT;
  1441.     }
  1442.  
  1443.   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
  1444.  
  1445.   goto yybackup;
  1446.  
  1447. /*-----------.
  1448. | yybackup.  |
  1449. `-----------*/
  1450. yybackup:
  1451.  
  1452.   /* Do appropriate processing given the current state.  Read a
  1453.      look-ahead token if we need one and don't already have one.  */
  1454.  
  1455.   /* First try to decide what to do without reference to look-ahead token.  */
  1456.   yyn = yypact[yystate];
  1457.   if (yyn == YYPACT_NINF)
  1458.     goto yydefault;
  1459.  
  1460.   /* Not known => get a look-ahead token if don't already have one.  */
  1461.  
  1462.   /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
  1463.   if (yychar == YYEMPTY)
  1464.     {
  1465.       YYDPRINTF ((stderr, "Reading a token: "));
  1466.       yychar = YYLEX;
  1467.     }
  1468.  
  1469.   if (yychar <= YYEOF)
  1470.     {
  1471.       yychar = yytoken = YYEOF;
  1472.       YYDPRINTF ((stderr, "Now at end of input.\n"));
  1473.     }
  1474.   else
  1475.     {
  1476.       yytoken = YYTRANSLATE (yychar);
  1477.       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
  1478.     }
  1479.  
  1480.   /* If the proper action on seeing token YYTOKEN is to reduce or to
  1481.      detect an error, take that action.  */
  1482.   yyn += yytoken;
  1483.   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
  1484.     goto yydefault;
  1485.   yyn = yytable[yyn];
  1486.   if (yyn <= 0)
  1487.     {
  1488.       if (yyn == 0 || yyn == YYTABLE_NINF)
  1489.     goto yyerrlab;
  1490.       yyn = -yyn;
  1491.       goto yyreduce;
  1492.     }
  1493.  
  1494.   if (yyn == YYFINAL)
  1495.     YYACCEPT;
  1496.  
  1497.   /* Count tokens shifted since error; after three, turn off error
  1498.      status.  */
  1499.   if (yyerrstatus)
  1500.     yyerrstatus--;
  1501.  
  1502.   /* Shift the look-ahead token.  */
  1503.   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
  1504.  
  1505.   /* Discard the shifted token unless it is eof.  */
  1506.   if (yychar != YYEOF)
  1507.     yychar = YYEMPTY;
  1508.  
  1509.   yystate = yyn;
  1510.   *++yyvsp = yylval;
  1511.  
  1512.   goto yynewstate;
  1513.  
  1514.  
  1515. /*-----------------------------------------------------------.
  1516. | yydefault -- do the default action for the current state.  |
  1517. `-----------------------------------------------------------*/
  1518. yydefault:
  1519.   yyn = yydefact[yystate];
  1520.   if (yyn == 0)
  1521.     goto yyerrlab;
  1522.   goto yyreduce;
  1523.  
  1524.  
  1525. /*-----------------------------.
  1526. | yyreduce -- Do a reduction.  |
  1527. `-----------------------------*/
  1528. yyreduce:
  1529.   /* yyn is the number of a rule to reduce with.  */
  1530.   yylen = yyr2[yyn];
  1531.  
  1532.   /* If YYLEN is nonzero, implement the default value of the action:
  1533.      `$$ = $1'.
  1534.  
  1535.      Otherwise, the following line sets YYVAL to garbage.
  1536.      This behavior is undocumented and Bison
  1537.      users should not rely upon it.  Assigning to YYVAL
  1538.      unconditionally makes the parser a bit smaller, and it avoids a
  1539.      GCC warning that YYVAL may be used uninitialized.  */
  1540.   yyval = yyvsp[1-yylen];
  1541.  
  1542.  
  1543.   YY_REDUCE_PRINT (yyn);
  1544.   switch (yyn)
  1545.     {
  1546.         case 2:
  1547. #line 153 "arith.y"
  1548.     {
  1549.             return ((yyvsp[(1) - (1)]));
  1550.         }
  1551.     break;
  1552.  
  1553.   case 3:
  1554. #line 159 "arith.y"
  1555.     { (yyval) = (yyvsp[(2) - (3)]); }
  1556.     break;
  1557.  
  1558.   case 4:
  1559. #line 160 "arith.y"
  1560.     { (yyval) = (yyvsp[(1) - (3)]) ? (yyvsp[(1) - (3)]) : (yyvsp[(3) - (3)]) ? (yyvsp[(3) - (3)]) : 0; }
  1561.     break;
  1562.  
  1563.   case 5:
  1564. #line 161 "arith.y"
  1565.     { (yyval) = (yyvsp[(1) - (3)]) ? ( (yyvsp[(3) - (3)]) ? (yyvsp[(3) - (3)]) : 0 ) : 0; }
  1566.     break;
  1567.  
  1568.   case 6:
  1569. #line 162 "arith.y"
  1570.     { (yyval) = (yyvsp[(1) - (3)]) | (yyvsp[(3) - (3)]); }
  1571.     break;
  1572.  
  1573.   case 7:
  1574. #line 163 "arith.y"
  1575.     { (yyval) = (yyvsp[(1) - (3)]) ^ (yyvsp[(3) - (3)]); }
  1576.     break;
  1577.  
  1578.   case 8:
  1579. #line 164 "arith.y"
  1580.     { (yyval) = (yyvsp[(1) - (3)]) & (yyvsp[(3) - (3)]); }
  1581.     break;
  1582.  
  1583.   case 9:
  1584. #line 165 "arith.y"
  1585.     { (yyval) = (yyvsp[(1) - (3)]) == (yyvsp[(3) - (3)]); }
  1586.     break;
  1587.  
  1588.   case 10:
  1589. #line 166 "arith.y"
  1590.     { (yyval) = (yyvsp[(1) - (3)]) > (yyvsp[(3) - (3)]); }
  1591.     break;
  1592.  
  1593.   case 11:
  1594. #line 167 "arith.y"
  1595.     { (yyval) = (yyvsp[(1) - (3)]) >= (yyvsp[(3) - (3)]); }
  1596.     break;
  1597.  
  1598.   case 12:
  1599. #line 168 "arith.y"
  1600.     { (yyval) = (yyvsp[(1) - (3)]) < (yyvsp[(3) - (3)]); }
  1601.     break;
  1602.  
  1603.   case 13:
  1604. #line 169 "arith.y"
  1605.     { (yyval) = (yyvsp[(1) - (3)]) <= (yyvsp[(3) - (3)]); }
  1606.     break;
  1607.  
  1608.   case 14:
  1609. #line 170 "arith.y"
  1610.     { (yyval) = (yyvsp[(1) - (3)]) != (yyvsp[(3) - (3)]); }
  1611.     break;
  1612.  
  1613.   case 15:
  1614. #line 171 "arith.y"
  1615.     { (yyval) = (yyvsp[(1) - (3)]) << (yyvsp[(3) - (3)]); }
  1616.     break;
  1617.  
  1618.   case 16:
  1619. #line 172 "arith.y"
  1620.     { (yyval) = (yyvsp[(1) - (3)]) >> (yyvsp[(3) - (3)]); }
  1621.     break;
  1622.  
  1623.   case 17:
  1624. #line 173 "arith.y"
  1625.     { (yyval) = (yyvsp[(1) - (3)]) + (yyvsp[(3) - (3)]); }
  1626.     break;
  1627.  
  1628.   case 18:
  1629. #line 174 "arith.y"
  1630.     { (yyval) = (yyvsp[(1) - (3)]) - (yyvsp[(3) - (3)]); }
  1631.     break;
  1632.  
  1633.   case 19:
  1634. #line 175 "arith.y"
  1635.     { (yyval) = (yyvsp[(1) - (3)]) * (yyvsp[(3) - (3)]); }
  1636.     break;
  1637.  
  1638.   case 20:
  1639. #line 176 "arith.y"
  1640.     {
  1641.             if ((yyvsp[(3) - (3)]) == 0)
  1642.                 yyerror("division by zero");
  1643.             (yyval) = (yyvsp[(1) - (3)]) / (yyvsp[(3) - (3)]);
  1644.             }
  1645.     break;
  1646.  
  1647.   case 21:
  1648. #line 181 "arith.y"
  1649.     {
  1650.             if ((yyvsp[(3) - (3)]) == 0)
  1651.                 yyerror("division by zero");
  1652.             (yyval) = (yyvsp[(1) - (3)]) % (yyvsp[(3) - (3)]);
  1653.             }
  1654.     break;
  1655.  
  1656.   case 22:
  1657. #line 186 "arith.y"
  1658.     { (yyval) = !((yyvsp[(2) - (2)])); }
  1659.     break;
  1660.  
  1661.   case 23:
  1662. #line 187 "arith.y"
  1663.     { (yyval) = ~((yyvsp[(2) - (2)])); }
  1664.     break;
  1665.  
  1666.   case 24:
  1667. #line 188 "arith.y"
  1668.     { (yyval) = -((yyvsp[(2) - (2)])); }
  1669.     break;
  1670.  
  1671.   case 25:
  1672. #line 189 "arith.y"
  1673.     { (yyval) = (yyvsp[(2) - (2)]); }
  1674.     break;
  1675.  
  1676.  
  1677. /* Line 1267 of yacc.c.  */
  1678. #line 1682 "y.tab.c"
  1679.       default: break;
  1680.     }
  1681.   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
  1682.  
  1683.   YYPOPSTACK (yylen);
  1684.   yylen = 0;
  1685.   YY_STACK_PRINT (yyss, yyssp);
  1686.  
  1687.   *++yyvsp = yyval;
  1688.  
  1689.  
  1690.   /* Now `shift' the result of the reduction.  Determine what state
  1691.      that goes to, based on the state we popped back to and the rule
  1692.      number reduced by.  */
  1693.  
  1694.   yyn = yyr1[yyn];
  1695.  
  1696.   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
  1697.   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
  1698.     yystate = yytable[yystate];
  1699.   else
  1700.     yystate = yydefgoto[yyn - YYNTOKENS];
  1701.  
  1702.   goto yynewstate;
  1703.  
  1704.  
  1705. /*------------------------------------.
  1706. | yyerrlab -- here on detecting error |
  1707. `------------------------------------*/
  1708. yyerrlab:
  1709.   /* If not already recovering from an error, report this error.  */
  1710.   if (!yyerrstatus)
  1711.     {
  1712.       ++yynerrs;
  1713. #if ! YYERROR_VERBOSE
  1714.       yyerror (YY_("syntax error"));
  1715. #else
  1716.       {
  1717.     YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
  1718.     if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
  1719.       {
  1720.         YYSIZE_T yyalloc = 2 * yysize;
  1721.         if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
  1722.           yyalloc = YYSTACK_ALLOC_MAXIMUM;
  1723.         if (yymsg != yymsgbuf)
  1724.           YYSTACK_FREE (yymsg);
  1725.         yymsg = (char *) YYSTACK_ALLOC (yyalloc);
  1726.         if (yymsg)
  1727.           yymsg_alloc = yyalloc;
  1728.         else
  1729.           {
  1730.         yymsg = yymsgbuf;
  1731.         yymsg_alloc = sizeof yymsgbuf;
  1732.           }
  1733.       }
  1734.  
  1735.     if (0 < yysize && yysize <= yymsg_alloc)
  1736.       {
  1737.         (void) yysyntax_error (yymsg, yystate, yychar);
  1738.         yyerror (yymsg);
  1739.       }
  1740.     else
  1741.       {
  1742.         yyerror (YY_("syntax error"));
  1743.         if (yysize != 0)
  1744.           goto yyexhaustedlab;
  1745.       }
  1746.       }
  1747. #endif
  1748.     }
  1749.  
  1750.  
  1751.  
  1752.   if (yyerrstatus == 3)
  1753.     {
  1754.       /* If just tried and failed to reuse look-ahead token after an
  1755.      error, discard it.  */
  1756.  
  1757.       if (yychar <= YYEOF)
  1758.     {
  1759.       /* Return failure if at end of input.  */
  1760.       if (yychar == YYEOF)
  1761.         YYABORT;
  1762.     }
  1763.       else
  1764.     {
  1765.       yydestruct ("Error: discarding",
  1766.               yytoken, &yylval);
  1767.       yychar = YYEMPTY;
  1768.     }
  1769.     }
  1770.  
  1771.   /* Else will try to reuse look-ahead token after shifting the error
  1772.      token.  */
  1773.   goto yyerrlab1;
  1774.  
  1775.  
  1776. /*---------------------------------------------------.
  1777. | yyerrorlab -- error raised explicitly by YYERROR.  |
  1778. `---------------------------------------------------*/
  1779. yyerrorlab:
  1780.  
  1781.   /* Pacify compilers like GCC when the user code never invokes
  1782.      YYERROR and the label yyerrorlab therefore never appears in user
  1783.      code.  */
  1784.   if (/*CONSTCOND*/ 0)
  1785.      goto yyerrorlab;
  1786.  
  1787.   /* Do not reclaim the symbols of the rule which action triggered
  1788.      this YYERROR.  */
  1789.   YYPOPSTACK (yylen);
  1790.   yylen = 0;
  1791.   YY_STACK_PRINT (yyss, yyssp);
  1792.   yystate = *yyssp;
  1793.   goto yyerrlab1;
  1794.  
  1795.  
  1796. /*-------------------------------------------------------------.
  1797. | yyerrlab1 -- common code for both syntax error and YYERROR.  |
  1798. `-------------------------------------------------------------*/
  1799. yyerrlab1:
  1800.   yyerrstatus = 3;  /* Each real token shifted decrements this.  */
  1801.  
  1802.   for (;;)
  1803.     {
  1804.       yyn = yypact[yystate];
  1805.       if (yyn != YYPACT_NINF)
  1806.     {
  1807.       yyn += YYTERROR;
  1808.       if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
  1809.         {
  1810.           yyn = yytable[yyn];
  1811.           if (0 < yyn)
  1812.         break;
  1813.         }
  1814.     }
  1815.  
  1816.       /* Pop the current state because it cannot handle the error token.  */
  1817.       if (yyssp == yyss)
  1818.     YYABORT;
  1819.  
  1820.  
  1821.       yydestruct ("Error: popping",
  1822.           yystos[yystate], yyvsp);
  1823.       YYPOPSTACK (1);
  1824.       yystate = *yyssp;
  1825.       YY_STACK_PRINT (yyss, yyssp);
  1826.     }
  1827.  
  1828.   if (yyn == YYFINAL)
  1829.     YYACCEPT;
  1830.  
  1831.   *++yyvsp = yylval;
  1832.  
  1833.  
  1834.   /* Shift the error token.  */
  1835.   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
  1836.  
  1837.   yystate = yyn;
  1838.   goto yynewstate;
  1839.  
  1840.  
  1841. /*-------------------------------------.
  1842. | yyacceptlab -- YYACCEPT comes here.  |
  1843. `-------------------------------------*/
  1844. yyacceptlab:
  1845.   yyresult = 0;
  1846.   goto yyreturn;
  1847.  
  1848. /*-----------------------------------.
  1849. | yyabortlab -- YYABORT comes here.  |
  1850. `-----------------------------------*/
  1851. yyabortlab:
  1852.   yyresult = 1;
  1853.   goto yyreturn;
  1854.  
  1855. #ifndef yyoverflow
  1856. /*-------------------------------------------------.
  1857. | yyexhaustedlab -- memory exhaustion comes here.  |
  1858. `-------------------------------------------------*/
  1859. yyexhaustedlab:
  1860.   yyerror (YY_("memory exhausted"));
  1861.   yyresult = 2;
  1862.   /* Fall through.  */
  1863. #endif
  1864.  
  1865. yyreturn:
  1866.   if (yychar != YYEOF && yychar != YYEMPTY)
  1867.      yydestruct ("Cleanup: discarding lookahead",
  1868.          yytoken, &yylval);
  1869.   /* Do not reclaim the symbols of the rule which action triggered
  1870.      this YYABORT or YYACCEPT.  */
  1871.   YYPOPSTACK (yylen);
  1872.   YY_STACK_PRINT (yyss, yyssp);
  1873.   while (yyssp != yyss)
  1874.     {
  1875.       yydestruct ("Cleanup: popping",
  1876.           yystos[*yyssp], yyvsp);
  1877.       YYPOPSTACK (1);
  1878.     }
  1879. #ifndef yyoverflow
  1880.   if (yyss != yyssa)
  1881.     YYSTACK_FREE (yyss);
  1882. #endif
  1883. #if YYERROR_VERBOSE
  1884.   if (yymsg != yymsgbuf)
  1885.     YYSTACK_FREE (yymsg);
  1886. #endif
  1887.   /* Make sure YYID is used.  */
  1888.   return YYID (yyresult);
  1889. }
  1890.  
  1891.  
  1892. #line 192 "arith.y"
  1893.  
  1894. void
  1895. yyerror(s)
  1896.     const char *s;
  1897. {
  1898.  
  1899.     yyclearin;
  1900.     arith_lex_reset();  /* reprime lex */
  1901.     error("arithmetic expression: %s: \"%s\"", s, arith_startbuf);
  1902.     /* NOTREACHED */
  1903. }
  1904.  
  1905.