source: git/Singular/grammar.cc @ 16f511

spielwiese
Last change on this file since 16f511 was 16f511, checked in by Oleksandr Motsak <motsak@…>, 11 years ago
Fixed the usage of "config.h" (if defined HAVE_CONFIG_H)
  • Property mode set to 100644
File size: 122.5 KB
Line 
1/* A Bison parser, made by GNU Bison 1.875d.  */
2
3/* Skeleton parser for Yacc-like parsing with Bison,
4   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
5
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2, or (at your option)
9   any later version.
10
11   This program is distributed in the hope that it will be useful,
12   but WITHOUT ANY WARRANTY; without even the implied warranty of
13   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   GNU General Public License for more details.
15
16   You should have received a copy of the GNU General Public License
17   along with this program; if not, write to the Free Software
18   Foundation, Inc., 59 Temple Place - Suite 330,
19   Boston, MA 02111-1307, USA.  */
20
21/* As a special exception, when this file is copied by Bison into a
22   Bison output file, you may use that output file without restriction.
23   This special exception was added by the Free Software Foundation
24   in version 1.24 of Bison.  */
25
26/* Written by Richard Stallman by simplifying the original so called
27   ``semantic'' parser.  */
28
29/* All symbols defined below should begin with yy or YY, to avoid
30   infringing on user name space.  This should be done even for local
31   variables, as they might otherwise be expanded by user macros.
32   There are some unavoidable exceptions within include files to
33   define necessary library symbols; they are noted "INFRINGES ON
34   USER NAME SPACE" below.  */
35
36/* Identify Bison output.  */
37#define YYBISON 1
38
39/* Skeleton name.  */
40#define YYSKELETON_NAME "yacc.c"
41
42/* Pure parsers.  */
43#define YYPURE 1
44
45/* Using locations.  */
46#define YYLSP_NEEDED 0
47
48
49
50/* Tokens.  */
51#ifndef YYTOKENTYPE
52# define YYTOKENTYPE
53   /* Put the tokens into the symbol table, so that GDB and other debuggers
54      know about them.  */
55   enum yytokentype {
56     DOTDOT = 258,
57     EQUAL_EQUAL = 259,
58     GE = 260,
59     LE = 261,
60     MINUSMINUS = 262,
61     NOT = 263,
62     NOTEQUAL = 264,
63     PLUSPLUS = 265,
64     COLONCOLON = 266,
65     GRING_CMD = 267,
66     BIGINTMAT_CMD = 268,
67     INTMAT_CMD = 269,
68     PROC_CMD = 270,
69     RING_CMD = 271,
70     BEGIN_RING = 272,
71     IDEAL_CMD = 273,
72     MAP_CMD = 274,
73     MATRIX_CMD = 275,
74     MODUL_CMD = 276,
75     NUMBER_CMD = 277,
76     POLY_CMD = 278,
77     RESOLUTION_CMD = 279,
78     VECTOR_CMD = 280,
79     BETTI_CMD = 281,
80     COEFFS_CMD = 282,
81     COEF_CMD = 283,
82     CONTRACT_CMD = 284,
83     DEGREE_CMD = 285,
84     DEG_CMD = 286,
85     DIFF_CMD = 287,
86     DIM_CMD = 288,
87     DIVISION_CMD = 289,
88     ELIMINATION_CMD = 290,
89     E_CMD = 291,
90     FAREY_CMD = 292,
91     FETCH_CMD = 293,
92     FREEMODULE_CMD = 294,
93     KEEPRING_CMD = 295,
94     HILBERT_CMD = 296,
95     HOMOG_CMD = 297,
96     IMAP_CMD = 298,
97     INDEPSET_CMD = 299,
98     INTERRED_CMD = 300,
99     INTERSECT_CMD = 301,
100     JACOB_CMD = 302,
101     JET_CMD = 303,
102     KBASE_CMD = 304,
103     KOSZUL_CMD = 305,
104     LEADCOEF_CMD = 306,
105     LEADEXP_CMD = 307,
106     LEAD_CMD = 308,
107     LEADMONOM_CMD = 309,
108     LIFTSTD_CMD = 310,
109     LIFT_CMD = 311,
110     MAXID_CMD = 312,
111     MINBASE_CMD = 313,
112     MINOR_CMD = 314,
113     MINRES_CMD = 315,
114     MODULO_CMD = 316,
115     MONOM_CMD = 317,
116     MRES_CMD = 318,
117     MULTIPLICITY_CMD = 319,
118     ORD_CMD = 320,
119     PAR_CMD = 321,
120     PARDEG_CMD = 322,
121     PREIMAGE_CMD = 323,
122     QUOTIENT_CMD = 324,
123     QHWEIGHT_CMD = 325,
124     REDUCE_CMD = 326,
125     REGULARITY_CMD = 327,
126     RES_CMD = 328,
127     SBA_CMD = 329,
128     SIMPLIFY_CMD = 330,
129     SORTVEC_CMD = 331,
130     SRES_CMD = 332,
131     STD_CMD = 333,
132     SUBST_CMD = 334,
133     SYZYGY_CMD = 335,
134     VAR_CMD = 336,
135     VDIM_CMD = 337,
136     WEDGE_CMD = 338,
137     WEIGHT_CMD = 339,
138     VALTVARS = 340,
139     VMAXDEG = 341,
140     VMAXMULT = 342,
141     VNOETHER = 343,
142     VMINPOLY = 344,
143     END_RING = 345,
144     CMD_1 = 346,
145     CMD_2 = 347,
146     CMD_3 = 348,
147     CMD_12 = 349,
148     CMD_13 = 350,
149     CMD_23 = 351,
150     CMD_123 = 352,
151     CMD_M = 353,
152     ROOT_DECL = 354,
153     ROOT_DECL_LIST = 355,
154     RING_DECL = 356,
155     RING_DECL_LIST = 357,
156     EXAMPLE_CMD = 358,
157     EXPORT_CMD = 359,
158     HELP_CMD = 360,
159     KILL_CMD = 361,
160     LIB_CMD = 362,
161     LISTVAR_CMD = 363,
162     SETRING_CMD = 364,
163     TYPE_CMD = 365,
164     STRINGTOK = 366,
165     BLOCKTOK = 367,
166     INT_CONST = 368,
167     UNKNOWN_IDENT = 369,
168     RINGVAR = 370,
169     PROC_DEF = 371,
170     BREAK_CMD = 372,
171     CONTINUE_CMD = 373,
172     ELSE_CMD = 374,
173     EVAL = 375,
174     QUOTE = 376,
175     FOR_CMD = 377,
176     IF_CMD = 378,
177     SYS_BREAK = 379,
178     WHILE_CMD = 380,
179     RETURN = 381,
180     PARAMETER = 382,
181     SYSVAR = 383,
182     UMINUS = 384
183   };
184#endif
185#define DOTDOT 258
186#define EQUAL_EQUAL 259
187#define GE 260
188#define LE 261
189#define MINUSMINUS 262
190#define NOT 263
191#define NOTEQUAL 264
192#define PLUSPLUS 265
193#define COLONCOLON 266
194#define GRING_CMD 267
195#define BIGINTMAT_CMD 268
196#define INTMAT_CMD 269
197#define PROC_CMD 270
198#define RING_CMD 271
199#define BEGIN_RING 272
200#define IDEAL_CMD 273
201#define MAP_CMD 274
202#define MATRIX_CMD 275
203#define MODUL_CMD 276
204#define NUMBER_CMD 277
205#define POLY_CMD 278
206#define RESOLUTION_CMD 279
207#define VECTOR_CMD 280
208#define BETTI_CMD 281
209#define COEFFS_CMD 282
210#define COEF_CMD 283
211#define CONTRACT_CMD 284
212#define DEGREE_CMD 285
213#define DEG_CMD 286
214#define DIFF_CMD 287
215#define DIM_CMD 288
216#define DIVISION_CMD 289
217#define ELIMINATION_CMD 290
218#define E_CMD 291
219#define FAREY_CMD 292
220#define FETCH_CMD 293
221#define FREEMODULE_CMD 294
222#define KEEPRING_CMD 295
223#define HILBERT_CMD 296
224#define HOMOG_CMD 297
225#define IMAP_CMD 298
226#define INDEPSET_CMD 299
227#define INTERRED_CMD 300
228#define INTERSECT_CMD 301
229#define JACOB_CMD 302
230#define JET_CMD 303
231#define KBASE_CMD 304
232#define KOSZUL_CMD 305
233#define LEADCOEF_CMD 306
234#define LEADEXP_CMD 307
235#define LEAD_CMD 308
236#define LEADMONOM_CMD 309
237#define LIFTSTD_CMD 310
238#define LIFT_CMD 311
239#define MAXID_CMD 312
240#define MINBASE_CMD 313
241#define MINOR_CMD 314
242#define MINRES_CMD 315
243#define MODULO_CMD 316
244#define MONOM_CMD 317
245#define MRES_CMD 318
246#define MULTIPLICITY_CMD 319
247#define ORD_CMD 320
248#define PAR_CMD 321
249#define PARDEG_CMD 322
250#define PREIMAGE_CMD 323
251#define QUOTIENT_CMD 324
252#define QHWEIGHT_CMD 325
253#define REDUCE_CMD 326
254#define REGULARITY_CMD 327
255#define RES_CMD 328
256#define SBA_CMD 329
257#define SIMPLIFY_CMD 330
258#define SORTVEC_CMD 331
259#define SRES_CMD 332
260#define STD_CMD 333
261#define SUBST_CMD 334
262#define SYZYGY_CMD 335
263#define VAR_CMD 336
264#define VDIM_CMD 337
265#define WEDGE_CMD 338
266#define WEIGHT_CMD 339
267#define VALTVARS 340
268#define VMAXDEG 341
269#define VMAXMULT 342
270#define VNOETHER 343
271#define VMINPOLY 344
272#define END_RING 345
273#define CMD_1 346
274#define CMD_2 347
275#define CMD_3 348
276#define CMD_12 349
277#define CMD_13 350
278#define CMD_23 351
279#define CMD_123 352
280#define CMD_M 353
281#define ROOT_DECL 354
282#define ROOT_DECL_LIST 355
283#define RING_DECL 356
284#define RING_DECL_LIST 357
285#define EXAMPLE_CMD 358
286#define EXPORT_CMD 359
287#define HELP_CMD 360
288#define KILL_CMD 361
289#define LIB_CMD 362
290#define LISTVAR_CMD 363
291#define SETRING_CMD 364
292#define TYPE_CMD 365
293#define STRINGTOK 366
294#define BLOCKTOK 367
295#define INT_CONST 368
296#define UNKNOWN_IDENT 369
297#define RINGVAR 370
298#define PROC_DEF 371
299#define BREAK_CMD 372
300#define CONTINUE_CMD 373
301#define ELSE_CMD 374
302#define EVAL 375
303#define QUOTE 376
304#define FOR_CMD 377
305#define IF_CMD 378
306#define SYS_BREAK 379
307#define WHILE_CMD 380
308#define RETURN 381
309#define PARAMETER 382
310#define SYSVAR 383
311#define UMINUS 384
312
313
314
315
316/* Copy the first part of user declarations.  */
317#line 7 "grammar.y"
318
319
320#include <stdio.h>
321#include <stddef.h>
322#include <stdlib.h>
323#include <stdarg.h>
324#include <string.h>
325
326#ifdef HAVE_CONFIG_H
327#include "config.h"
328#endif /* HAVE_CONFIG_H */
329#include <misc/auxiliary.h>
330
331#include <kernel/mod2.h>
332#include <misc/mylimits.h>
333#include <omalloc/omalloc.h>
334#include <Singular/tok.h>
335#include <misc/options.h>
336#include <Singular/stype.h>
337#include <Singular/fehelp.h>
338#include <Singular/ipid.h>
339#include <misc/intvec.h>
340#include <kernel/febase.h>
341#include <polys/matpol.h>
342#include <polys/monomials/ring.h>
343#include <kernel/kstd1.h>
344#include <Singular/subexpr.h>
345#include <Singular/ipshell.h>
346#include <Singular/ipconv.h>
347#include <Singular/sdb.h>
348#include <kernel/ideals.h>
349#include <coeffs/numbers.h>
350#include <kernel/polys.h>
351#include <kernel/stairc.h>
352#include <kernel/timer.h>
353#include <Singular/cntrlc.h>
354#include <polys/monomials/maps.h>
355#include <kernel/syz.h>
356#include <Singular/lists.h>
357#include <kernel/longrat.h>
358#include <Singular/libparse.h>
359#include <coeffs/bigintmat.h>
360
361#if 0
362void debug_list(leftv v)
363{
364  idhdl r=basePackHdl;
365  idhdl h;
366  BOOLEAN found=FALSE;
367  const char *nn=v->name;
368  h=IDROOT->get(nn,myynest);
369  if (h!=NULL)
370  {
371     Print("Curr::%s, (%s)\n",nn,Tok2Cmdname((int)IDTYP(h)));
372     found=TRUE;
373  }
374  else         Print("`%s` not found in IDROOT\n",nn);
375  while (r!=NULL)
376  {
377    if ((IDTYP(r)==PACKAGE_CMD)
378    || (IDTYP(r)==RING_CMD)
379    || (IDTYP(r)==QRING_CMD))
380    {
381      h=IDPACKAGE(r)->idroot->get(nn,myynest);
382      if (h!=NULL)
383      {
384        Print("%s::%s, (%s)\n",r->id,nn,Tok2Cmdname((int)IDTYP(h)));
385        found=TRUE;
386      }
387      else         Print("%s::%s not found\n",r->id,nn);
388    }
389    if (r==basePackHdl) r=IDPACKAGE(r)->idroot;
390    r=r->next;
391   if (r==basePackHdl) break;
392  }
393  if (!found)
394  {
395    listall(TRUE);
396  }
397}
398#endif
399
400/* From the bison docu:
401
402     By defining the macro `YYMAXDEPTH', you can control how deep the
403parser stack can become before a stack overflow occurs.  Define the
404macro with a value that is an integer.  This value is the maximum number
405of tokens that can be shifted (and not reduced) before overflow.  It
406must be a constant expression whose value is known at compile time.
407
408   The stack space allowed is not necessarily allocated.  If you
409specify a large value for `YYMAXDEPTH', the parser actually allocates a
410small stack at first, and then makes it bigger by stages as needed.
411This increasing allocation happens automatically and silently.
412Therefore, you do not need to make `YYMAXDEPTH' painfully small merely
413to save space for ordinary inputs that do not need much stack.
414
415   The default value of `YYMAXDEPTH', if you do not define it, is 10000.
416*/
417#define YYMAXDEPTH MAX_INT_VAL
418
419extern int   yylineno;
420extern FILE* yyin;
421
422const  char *  currid;
423BOOLEAN    yyInRingConstruction=FALSE;
424BOOLEAN    expected_parms;
425int        cmdtok;
426int        inerror = 0;
427
428#define TESTSETINT(a,i)                                \
429   if ((a).Typ() != INT_CMD)                           \
430   {                                                   \
431     WerrorS("no int expression");                     \
432     YYERROR;                                          \
433   }                                                   \
434   (i) = (int)((long)(a).Data());(a).CleanUp()
435
436#define MYYERROR(a) { WerrorS(a); YYERROR; }
437
438void yyerror(const char * fmt)
439{
440
441  BOOLEAN old_errorreported=errorreported;
442  errorreported = TRUE;
443  if (currid!=NULL)
444  {
445    killid(currid,&IDROOT);
446    currid = NULL;
447  }
448  if(inerror==0)
449  {
450    {
451      if ((strlen(fmt)>1)
452      && (strncmp(fmt,"parse",5)!=0)
453      && (strncmp(fmt,"syntax",6)!=0))
454        WerrorS(fmt);
455      Werror( "error occurred in or before %s line %d: `%s`"
456             ,VoiceName(), yylineno, my_yylinebuf);
457    }
458    if (cmdtok!=0)
459    {
460      const char *s=Tok2Cmdname(cmdtok);
461      if (expected_parms)
462      {
463        Werror("expected %s-expression. type \'help %s;\'",s,s);
464      }
465      else
466      {
467        Werror("wrong type declaration. type \'help %s;\'",s);
468      }
469    }
470    if (!old_errorreported && (lastreserved!=NULL))
471    {
472      Werror("last reserved name was `%s`",lastreserved);
473    }
474    inerror=1;
475  }
476  if ((currentVoice!=NULL)
477  && (currentVoice->prev!=NULL)
478  && (myynest>0)
479#ifdef HAVE_SDB
480  && ((sdb_flags &1)==0)
481#endif
482  )
483  {
484    Werror("leaving %s",VoiceName());
485  }
486#ifdef HAVE_FACTORY
487  // libfac:
488#ifdef HAVE_LIBFAC
489  extern int libfac_interruptflag;
490  libfac_interruptflag=0;
491#endif // #ifdef HAVE_LIBFAC
492#endif
493}
494
495
496
497/* Enabling traces.  */
498#ifndef YYDEBUG
499# define YYDEBUG 1
500#endif
501
502/* Enabling verbose error messages.  */
503#ifdef YYERROR_VERBOSE
504# undef YYERROR_VERBOSE
505# define YYERROR_VERBOSE 1
506#else
507# define YYERROR_VERBOSE 0
508#endif
509
510#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
511typedef int YYSTYPE;
512# define yystype YYSTYPE /* obsolescent; will be withdrawn */
513# define YYSTYPE_IS_DECLARED 1
514# define YYSTYPE_IS_TRIVIAL 1
515#endif
516
517
518
519/* Copy the second part of user declarations.  */
520
521
522/* Line 214 of yacc.c.  */
523#line 519 "grammar.cc"
524
525#if ! defined (yyoverflow) || YYERROR_VERBOSE
526
527# ifndef YYFREE
528#  define YYFREE free
529# endif
530# ifndef YYMALLOC
531#  define YYMALLOC malloc
532# endif
533
534/* The parser invokes alloca or malloc; define the necessary symbols.  */
535
536# ifdef YYSTACK_USE_ALLOCA
537#  if YYSTACK_USE_ALLOCA
538#   define YYSTACK_ALLOC alloca
539#  endif
540# else
541#  if defined (alloca) || defined (_ALLOCA_H)
542#   define YYSTACK_ALLOC alloca
543#  else
544#   ifdef __GNUC__
545#    define YYSTACK_ALLOC __builtin_alloca
546#   endif
547#  endif
548# endif
549
550# ifdef YYSTACK_ALLOC
551   /* Pacify GCC's `empty if-body' warning. */
552#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
553# else
554#  if defined (__STDC__) || defined (__cplusplus)
555#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
556#   define YYSIZE_T size_t
557#  endif
558#  define YYSTACK_ALLOC YYMALLOC
559#  define YYSTACK_FREE YYFREE
560# endif
561#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
562
563
564#if (! defined (yyoverflow) \
565     && (! defined (__cplusplus) \
566         || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
567
568/* A type that is properly aligned for any stack member.  */
569union yyalloc
570{
571  short int yyss;
572  YYSTYPE yyvs;
573  };
574
575/* The size of the maximum gap between one aligned stack and the next.  */
576# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
577
578/* The size of an array large to enough to hold all stacks, each with
579   N elements.  */
580# define YYSTACK_BYTES(N) \
581     ((N) * (sizeof (short int) + sizeof (YYSTYPE))                     \
582      + YYSTACK_GAP_MAXIMUM)
583
584/* Copy COUNT objects from FROM to TO.  The source and destination do
585   not overlap.  */
586# ifndef YYCOPY
587#  if defined (__GNUC__) && 1 < __GNUC__
588#   define YYCOPY(To, From, Count) \
589      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
590#  else
591#   define YYCOPY(To, From, Count)              \
592      do                                        \
593        {                                       \
594          register YYSIZE_T yyi;                \
595          for (yyi = 0; yyi < (Count); yyi++)   \
596            (To)[yyi] = (From)[yyi];            \
597        }                                       \
598      while (0)
599#  endif
600# endif
601
602/* Relocate STACK from its old location to the new one.  The
603   local variables YYSIZE and YYSTACKSIZE give the old and new number of
604   elements in the stack, and YYPTR gives the new location of the
605   stack.  Advance YYPTR to a properly aligned location for the next
606   stack.  */
607# define YYSTACK_RELOCATE(Stack)                                        \
608    do                                                                  \
609      {                                                                 \
610        YYSIZE_T yynewbytes;                                            \
611        YYCOPY (&yyptr->Stack, Stack, yysize);                          \
612        Stack = &yyptr->Stack;                                          \
613        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
614        yyptr += yynewbytes / sizeof (*yyptr);                          \
615      }                                                                 \
616    while (0)
617
618#endif
619
620#if defined (__STDC__) || defined (__cplusplus)
621   typedef signed char yysigned_char;
622#else
623   typedef short int yysigned_char;
624#endif
625
626/* YYFINAL -- State number of the termination state. */
627#define YYFINAL  2
628/* YYLAST -- Last index in YYTABLE.  */
629#define YYLAST   1807
630
631/* YYNTOKENS -- Number of terminals. */
632#define YYNTOKENS  148
633/* YYNNTS -- Number of nonterminals. */
634#define YYNNTS  44
635/* YYNRULES -- Number of rules. */
636#define YYNRULES  164
637/* YYNRULES -- Number of states. */
638#define YYNSTATES  355
639
640/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
641#define YYUNDEFTOK  2
642#define YYMAXUTOK   384
643
644#define YYTRANSLATE(YYX)                                                \
645  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
646
647/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
648static const unsigned char yytranslate[] =
649{
650       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
651       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
652       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
653       2,     2,     2,     2,     2,     2,     2,     2,   140,     2,
654     144,   145,   142,   132,   138,   133,   146,   134,     2,     2,
655       2,     2,     2,     2,     2,     2,     2,     2,   141,   139,
656     130,   129,   131,     2,     2,     2,     2,     2,     2,     2,
657       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
658       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
659       2,   135,     2,   136,   137,     2,   147,     2,     2,     2,
660       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
661       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
662       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
663       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
664       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
665       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
666       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
667       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
668       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
669       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
670       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
671       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
672       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
673       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
674       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
675       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
676       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
677      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
678      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
679      35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
680      45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
681      55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
682      65,    66,    67,    68,    69,    70,    71,    72,    73,    74,
683      75,    76,    77,    78,    79,    80,    81,    82,    83,    84,
684      85,    86,    87,    88,    89,    90,    91,    92,    93,    94,
685      95,    96,    97,    98,    99,   100,   101,   102,   103,   104,
686     105,   106,   107,   108,   109,   110,   111,   112,   113,   114,
687     115,   116,   117,   118,   119,   120,   121,   122,   123,   124,
688     125,   126,   127,   128,   143
689};
690
691#if YYDEBUG
692/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
693   YYRHS.  */
694static const unsigned short int yyprhs[] =
695{
696       0,     0,     3,     4,     7,     9,    12,    15,    17,    19,
697      21,    24,    26,    28,    30,    32,    34,    36,    38,    40,
698      43,    45,    47,    49,    51,    53,    55,    57,    59,    61,
699      64,    66,    68,    72,    76,    80,    85,    89,    91,    93,
700      95,   100,   104,   106,   108,   110,   114,   121,   126,   131,
701     136,   140,   145,   150,   154,   159,   166,   175,   182,   191,
702     196,   201,   208,   213,   220,   229,   238,   242,   247,   256,
703     261,   270,   275,   279,   285,   286,   292,   295,   297,   300,
704     303,   307,   311,   315,   319,   323,   327,   331,   335,   339,
705     343,   346,   349,   352,   355,   357,   361,   364,   367,   370,
706     373,   382,   385,   389,   392,   394,   396,   402,   404,   406,
707     411,   413,   417,   419,   423,   425,   427,   429,   431,   432,
708     437,   441,   444,   448,   451,   454,   458,   463,   468,   473,
709     478,   483,   488,   493,   498,   505,   512,   519,   526,   533,
710     540,   547,   551,   553,   562,   565,   568,   570,   572,   575,
711     578,   580,   586,   589,   595,   597,   599,   603,   609,   613,
712     617,   622,   625,   628,   633
713};
714
715/* YYRHS -- A `-1'-separated list of the rules' RHS. */
716static const short int yyrhs[] =
717{
718     149,     0,    -1,    -1,   149,   150,    -1,   151,    -1,   153,
719     139,    -1,   164,   139,    -1,   191,    -1,   124,    -1,   139,
720      -1,     1,   139,    -1,   186,    -1,   187,    -1,   152,    -1,
721     188,    -1,   189,    -1,   173,    -1,   175,    -1,   176,    -1,
722     103,   112,    -1,   154,    -1,   177,    -1,   178,    -1,   179,
723      -1,   190,    -1,   181,    -1,   182,    -1,   184,    -1,   185,
724      -1,   162,   156,    -1,   115,    -1,   163,    -1,   155,    11,
725     155,    -1,   155,   146,   155,    -1,   155,   144,   145,    -1,
726     155,   144,   156,   145,    -1,   135,   156,   136,    -1,   113,
727      -1,   128,    -1,   165,    -1,    15,   144,   157,   145,    -1,
728     156,   138,   157,    -1,   157,    -1,   161,    -1,   155,    -1,
729     144,   156,   145,    -1,   157,   135,   157,   138,   157,   136,
730      -1,   157,   135,   157,   136,    -1,    99,   144,   157,   145,
731      -1,   100,   144,   156,   145,    -1,   100,   144,   145,    -1,
732     101,   144,   157,   145,    -1,   102,   144,   156,   145,    -1,
733     102,   144,   145,    -1,    91,   144,   157,   145,    -1,    92,
734     144,   157,   138,   157,   145,    -1,    93,   144,   157,   138,
735     157,   138,   157,   145,    -1,    96,   144,   157,   138,   157,
736     145,    -1,    96,   144,   157,   138,   157,   138,   157,   145,
737      -1,    94,   144,   157,   145,    -1,    95,   144,   157,   145,
738      -1,    94,   144,   157,   138,   157,   145,    -1,    97,   144,
739     157,   145,    -1,    97,   144,   157,   138,   157,   145,    -1,
740      95,   144,   157,   138,   157,   138,   157,   145,    -1,    97,
741     144,   157,   138,   157,   138,   157,   145,    -1,    98,   144,
742     145,    -1,    98,   144,   156,   145,    -1,   172,   144,   157,
743     138,   157,   138,   157,   145,    -1,   172,   144,   157,   145,
744      -1,    16,   144,   166,   138,   166,   138,   170,   145,    -1,
745      16,   144,   157,   145,    -1,   159,   157,   160,    -1,   159,
746     157,   129,   157,   160,    -1,    -1,   120,   144,   158,   157,
747     145,    -1,   121,   144,    -1,   145,    -1,   157,    10,    -1,
748     157,     7,    -1,   157,   132,   157,    -1,   157,   133,   157,
749      -1,   157,   134,   157,    -1,   157,   137,   157,    -1,   157,
750     130,   157,    -1,   157,   140,   157,    -1,   157,     9,   157,
751      -1,   157,     4,   157,    -1,   157,     3,   157,    -1,   157,
752     141,   157,    -1,     8,   157,    -1,   133,   157,    -1,   164,
753     171,    -1,   156,   129,    -1,   114,    -1,   147,   157,   147,
754      -1,    99,   155,    -1,   100,   155,    -1,   101,   155,    -1,
755     102,   155,    -1,   172,   155,   135,   157,   136,   135,   157,
756     136,    -1,   172,   155,    -1,   164,   138,   155,    -1,    15,
757     155,    -1,   111,    -1,   157,    -1,   144,   157,   138,   156,
758     145,    -1,   114,    -1,   167,    -1,   167,   144,   156,   145,
759      -1,   168,    -1,   168,   138,   169,    -1,   168,    -1,   144,
760     169,   145,    -1,   129,    -1,    20,    -1,    14,    -1,    13,
761      -1,    -1,   130,   165,   174,   139,    -1,   105,   111,   139,
762      -1,   105,   139,    -1,   103,   111,   139,    -1,   104,   156,
763      -1,   106,   155,    -1,   178,   138,   155,    -1,   108,   144,
764      99,   145,    -1,   108,   144,   100,   145,    -1,   108,   144,
765     101,   145,    -1,   108,   144,   102,   145,    -1,   108,   144,
766      16,   145,    -1,   108,   144,   172,   145,    -1,   108,   144,
767      15,   145,    -1,   108,   144,   155,   145,    -1,   108,   144,
768     155,   138,    99,   145,    -1,   108,   144,   155,   138,   100,
769     145,    -1,   108,   144,   155,   138,   101,   145,    -1,   108,
770     144,   155,   138,   102,   145,    -1,   108,   144,   155,   138,
771      16,   145,    -1,   108,   144,   155,   138,   172,   145,    -1,
772     108,   144,   155,   138,    15,   145,    -1,   108,   144,   145,
773      -1,    16,    -1,   180,   155,   171,   166,   138,   166,   138,
774     170,    -1,   180,   155,    -1,   128,   165,    -1,   109,    -1,
775      40,    -1,   183,   157,    -1,   110,   157,    -1,   156,    -1,
776     123,   144,   157,   145,   112,    -1,   119,   112,    -1,   123,
777     144,   157,   145,   117,    -1,   117,    -1,   118,    -1,   125,
778     111,   112,    -1,   122,   111,   111,   111,   112,    -1,    15,
779     163,   112,    -1,   116,   111,   112,    -1,   116,   111,   111,
780     112,    -1,   127,   164,    -1,   127,   157,    -1,   126,   144,
781     156,   145,    -1,   126,   144,   145,    -1
782};
783
784/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
785static const unsigned short int yyrline[] =
786{
787       0,   364,   364,   366,   400,   401,   403,   405,   409,   414,
788     416,   467,   468,   469,   470,   471,   472,   473,   474,   478,
789     481,   482,   483,   484,   485,   486,   487,   488,   489,   492,
790     499,   504,   508,   512,   516,   520,   533,   561,   585,   591,
791     597,   604,   615,   621,   626,   627,   628,   632,   636,   640,
792     644,   648,   652,   656,   660,   664,   668,   672,   676,   680,
793     684,   688,   692,   696,   700,   704,   708,   712,   716,   720,
794     724,   728,   732,   736,   754,   753,   771,   779,   788,   792,
795     796,   800,   804,   808,   812,   816,   820,   824,   828,   832,
796     836,   843,   850,   851,   870,   871,   883,   888,   893,   897,
797     901,   941,   967,   988,   996,  1000,  1001,  1015,  1023,  1032,
798    1077,  1078,  1087,  1088,  1094,  1100,  1102,  1104,  1114,  1113,
799    1121,  1126,  1133,  1141,  1153,  1169,  1188,  1192,  1196,  1201,
800    1205,  1209,  1213,  1217,  1222,  1228,  1234,  1240,  1246,  1252,
801    1258,  1270,  1277,  1281,  1318,  1328,  1334,  1334,  1337,  1409,
802    1413,  1442,  1455,  1472,  1481,  1486,  1494,  1506,  1525,  1535,
803    1554,  1577,  1583,  1595,  1601
804};
805#endif
806
807#if YYDEBUG || YYERROR_VERBOSE
808/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
809   First, the terminals, then, starting at YYNTOKENS, nonterminals. */
810static const char *const yytname[] =
811{
812  "$end", "error", "$undefined", "DOTDOT", "EQUAL_EQUAL", "GE", "LE",
813  "MINUSMINUS", "NOT", "NOTEQUAL", "PLUSPLUS", "COLONCOLON", "GRING_CMD",
814  "BIGINTMAT_CMD", "INTMAT_CMD", "PROC_CMD", "RING_CMD", "BEGIN_RING",
815  "IDEAL_CMD", "MAP_CMD", "MATRIX_CMD", "MODUL_CMD", "NUMBER_CMD",
816  "POLY_CMD", "RESOLUTION_CMD", "VECTOR_CMD", "BETTI_CMD", "COEFFS_CMD",
817  "COEF_CMD", "CONTRACT_CMD", "DEGREE_CMD", "DEG_CMD", "DIFF_CMD",
818  "DIM_CMD", "DIVISION_CMD", "ELIMINATION_CMD", "E_CMD", "FAREY_CMD",
819  "FETCH_CMD", "FREEMODULE_CMD", "KEEPRING_CMD", "HILBERT_CMD",
820  "HOMOG_CMD", "IMAP_CMD", "INDEPSET_CMD", "INTERRED_CMD", "INTERSECT_CMD",
821  "JACOB_CMD", "JET_CMD", "KBASE_CMD", "KOSZUL_CMD", "LEADCOEF_CMD",
822  "LEADEXP_CMD", "LEAD_CMD", "LEADMONOM_CMD", "LIFTSTD_CMD", "LIFT_CMD",
823  "MAXID_CMD", "MINBASE_CMD", "MINOR_CMD", "MINRES_CMD", "MODULO_CMD",
824  "MONOM_CMD", "MRES_CMD", "MULTIPLICITY_CMD", "ORD_CMD", "PAR_CMD",
825  "PARDEG_CMD", "PREIMAGE_CMD", "QUOTIENT_CMD", "QHWEIGHT_CMD",
826  "REDUCE_CMD", "REGULARITY_CMD", "RES_CMD", "SBA_CMD", "SIMPLIFY_CMD",
827  "SORTVEC_CMD", "SRES_CMD", "STD_CMD", "SUBST_CMD", "SYZYGY_CMD",
828  "VAR_CMD", "VDIM_CMD", "WEDGE_CMD", "WEIGHT_CMD", "VALTVARS", "VMAXDEG",
829  "VMAXMULT", "VNOETHER", "VMINPOLY", "END_RING", "CMD_1", "CMD_2",
830  "CMD_3", "CMD_12", "CMD_13", "CMD_23", "CMD_123", "CMD_M", "ROOT_DECL",
831  "ROOT_DECL_LIST", "RING_DECL", "RING_DECL_LIST", "EXAMPLE_CMD",
832  "EXPORT_CMD", "HELP_CMD", "KILL_CMD", "LIB_CMD", "LISTVAR_CMD",
833  "SETRING_CMD", "TYPE_CMD", "STRINGTOK", "BLOCKTOK", "INT_CONST",
834  "UNKNOWN_IDENT", "RINGVAR", "PROC_DEF", "BREAK_CMD", "CONTINUE_CMD",
835  "ELSE_CMD", "EVAL", "QUOTE", "FOR_CMD", "IF_CMD", "SYS_BREAK",
836  "WHILE_CMD", "RETURN", "PARAMETER", "SYSVAR", "'='", "'<'", "'>'", "'+'",
837  "'-'", "'/'", "'['", "']'", "'^'", "','", "';'", "'&'", "':'", "'*'",
838  "UMINUS", "'('", "')'", "'.'", "'`'", "$accept", "lines", "pprompt",
839  "flowctrl", "example_dummy", "command", "assign", "elemexpr", "exprlist",
840  "expr", "@1", "quote_start", "quote_end", "expr_arithmetic",
841  "left_value", "extendedid", "declare_ip_variable", "stringexpr", "rlist",
842  "ordername", "orderelem", "OrderingList", "ordering", "cmdeq", "mat_cmd",
843  "filecmd", "@2", "helpcmd", "examplecmd", "exportcmd", "killcmd",
844  "listcmd", "ringcmd1", "ringcmd", "scriptcmd", "setrings", "setringcmd",
845  "typecmd", "ifcmd", "whilecmd", "forcmd", "proccmd", "parametercmd",
846  "returncmd", 0
847};
848#endif
849
850# ifdef YYPRINT
851/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
852   token YYLEX-NUM.  */
853static const unsigned short int yytoknum[] =
854{
855       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
856     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
857     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
858     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
859     295,   296,   297,   298,   299,   300,   301,   302,   303,   304,
860     305,   306,   307,   308,   309,   310,   311,   312,   313,   314,
861     315,   316,   317,   318,   319,   320,   321,   322,   323,   324,
862     325,   326,   327,   328,   329,   330,   331,   332,   333,   334,
863     335,   336,   337,   338,   339,   340,   341,   342,   343,   344,
864     345,   346,   347,   348,   349,   350,   351,   352,   353,   354,
865     355,   356,   357,   358,   359,   360,   361,   362,   363,   364,
866     365,   366,   367,   368,   369,   370,   371,   372,   373,   374,
867     375,   376,   377,   378,   379,   380,   381,   382,   383,    61,
868      60,    62,    43,    45,    47,    91,    93,    94,    44,    59,
869      38,    58,    42,   384,    40,    41,    46,    96
870};
871# endif
872
873/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
874static const unsigned char yyr1[] =
875{
876       0,   148,   149,   149,   150,   150,   150,   150,   150,   150,
877     150,   151,   151,   151,   151,   151,   151,   151,   151,   152,
878     153,   153,   153,   153,   153,   153,   153,   153,   153,   154,
879     155,   155,   155,   155,   155,   155,   155,   155,   155,   155,
880     155,   156,   156,   157,   157,   157,   157,   157,   157,   157,
881     157,   157,   157,   157,   157,   157,   157,   157,   157,   157,
882     157,   157,   157,   157,   157,   157,   157,   157,   157,   157,
883     157,   157,   157,   157,   158,   157,   159,   160,   161,   161,
884     161,   161,   161,   161,   161,   161,   161,   161,   161,   161,
885     161,   161,   162,   162,   163,   163,   164,   164,   164,   164,
886     164,   164,   164,   164,   165,   166,   166,   167,   168,   168,
887     169,   169,   170,   170,   171,   172,   172,   172,   174,   173,
888     175,   175,   176,   177,   178,   178,   179,   179,   179,   179,
889     179,   179,   179,   179,   179,   179,   179,   179,   179,   179,
890     179,   179,   180,   181,   181,   182,   183,   183,   184,   185,
891     185,   186,   186,   186,   186,   186,   187,   188,   189,   189,
892     189,   190,   190,   191,   191
893};
894
895/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
896static const unsigned char yyr2[] =
897{
898       0,     2,     0,     2,     1,     2,     2,     1,     1,     1,
899       2,     1,     1,     1,     1,     1,     1,     1,     1,     2,
900       1,     1,     1,     1,     1,     1,     1,     1,     1,     2,
901       1,     1,     3,     3,     3,     4,     3,     1,     1,     1,
902       4,     3,     1,     1,     1,     3,     6,     4,     4,     4,
903       3,     4,     4,     3,     4,     6,     8,     6,     8,     4,
904       4,     6,     4,     6,     8,     8,     3,     4,     8,     4,
905       8,     4,     3,     5,     0,     5,     2,     1,     2,     2,
906       3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
907       2,     2,     2,     2,     1,     3,     2,     2,     2,     2,
908       8,     2,     3,     2,     1,     1,     5,     1,     1,     4,
909       1,     3,     1,     3,     1,     1,     1,     1,     0,     4,
910       3,     2,     3,     2,     2,     3,     4,     4,     4,     4,
911       4,     4,     4,     4,     6,     6,     6,     6,     6,     6,
912       6,     3,     1,     8,     2,     2,     1,     1,     2,     2,
913       1,     5,     2,     5,     1,     1,     3,     5,     3,     3,
914       4,     2,     2,     4,     3
915};
916
917/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
918   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
919   means the default is an error.  */
920static const unsigned char yydefact[] =
921{
922       2,     0,     1,     0,     0,   117,   116,     0,   142,   115,
923     147,     0,     0,     0,     0,     0,     0,     0,     0,     0,
924       0,     0,     0,     0,     0,     0,     0,     0,   146,     0,
925     104,    37,    94,    30,     0,   154,   155,     0,     0,     0,
926       0,     0,     8,     0,     0,     0,    38,     0,     0,     0,
927       9,     0,     0,     3,     4,    13,     0,    20,    44,   150,
928      42,     0,    43,     0,    31,     0,    39,     0,    16,    17,
929      18,    21,    22,    23,     0,    25,    26,     0,    27,    28,
930      11,    12,    14,    15,    24,     7,    10,     0,     0,     0,
931       0,     0,     0,    38,    90,     0,     0,   103,    31,     0,
932       0,     0,     0,     0,     0,     0,     0,     0,     0,    96,
933       0,    97,     0,    98,     0,    99,     0,    19,   123,     0,
934     121,   124,     0,   149,     0,   152,    74,    76,     0,     0,
935       0,     0,     0,   162,   161,   145,   118,    91,     0,     0,
936       0,     5,     0,     0,     0,    93,     0,     0,     0,    79,
937       0,    78,     0,     0,     0,     0,     0,     0,     0,     0,
938       0,    29,   114,     0,     6,    92,     0,   101,     0,   144,
939     148,     0,   158,     0,   105,     0,     0,     0,     0,     0,
940       0,     0,     0,    66,     0,     0,    50,     0,     0,    53,
941       0,   122,   120,     0,     0,     0,     0,     0,     0,   141,
942       0,     0,     0,   159,     0,     0,     0,   156,   164,     0,
943       0,    36,    45,    95,    32,    34,     0,    33,    41,    88,
944      87,    86,    84,    80,    81,    82,     0,    83,    85,    89,
945       0,    77,    72,   102,     0,     0,   125,     0,    40,    42,
946      71,     0,    54,     0,     0,     0,    59,     0,    60,     0,
947       0,    62,    67,    48,    49,    51,    52,   132,   130,   126,
948     127,   128,   129,     0,   133,   131,   160,     0,     0,     0,
949     163,   119,    35,    47,     0,     0,     0,    69,     0,   105,
950       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
951       0,     0,     0,     0,     0,     0,    75,   157,   151,   153,
952       0,    73,     0,     0,     0,     0,     0,    55,     0,    61,
953       0,     0,    57,     0,    63,   140,   138,   134,   135,   136,
954     137,   139,    46,     0,     0,     0,   106,   107,     0,   108,
955     112,     0,     0,     0,     0,     0,     0,     0,     0,   110,
956       0,     0,    70,    56,    64,    58,    65,    68,   100,   143,
957       0,   113,     0,   111,   109
958};
959
960/* YYDEFGOTO[NTERM-NUM]. */
961static const short int yydefgoto[] =
962{
963      -1,     1,    53,    54,    55,    56,    57,    58,   139,    60,
964     204,    61,   232,    62,    63,    64,    65,    66,   175,   329,
965     330,   340,   331,   165,    95,    68,   210,    69,    70,    71,
966      72,    73,    74,    75,    76,    77,    78,    79,    80,    81,
967      82,    83,    84,    85
968};
969
970/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
971   STATE-NUM.  */
972#define YYPACT_NINF -313
973static const short int yypact[] =
974{
975    -313,   253,  -313,  -136,  1167,  -313,  -313,   849,  -137,  -313,
976    -313,  -131,  -126,  -114,  -103,   -78,   -70,   -53,   -45,   874,
977    1484,  1558,  1625,   -33,  1167,  -102,   674,   -44,  -313,  1167,
978    -313,  -313,  -313,  -313,   -54,  -313,  -313,   -10,   -39,   -37,
979      13,   -36,  -313,    17,   -34,  1224,    22,    22,  1167,  1167,
980    -313,  1167,  1167,  -313,  -313,  -313,   -27,  -313,     1,  -118,
981    1557,  1167,  -313,  1167,  -313,  -124,  -313,  1660,  -313,  -313,
982    -313,  -313,   -13,  -313,   674,  -313,  -313,  1167,  -313,  -313,
983    -313,  -313,  -313,  -313,  -313,  -313,  -313,   -18,  -137,   -15,
984      -9,    -4,    16,  -313,    62,    31,  1167,     1,    45,  1283,
985    1167,  1167,  1167,  1167,  1167,  1167,  1167,   826,  1167,     1,
986     935,     1,  1167,     1,   992,     1,    -5,  -313,    38,    39,
987    -313,     1,  1631,  1557,   -26,  -313,  -313,  -313,    73,  1167,
988      75,  1051,   849,  1557,    51,  -313,  -313,    62,   -83,  -121,
989      61,  -313,   674,  1108,   674,  -313,  1167,  1167,  1167,  -313,
990    1167,  -313,  1167,  1167,  1167,  1167,  1167,  1167,  1167,  1167,
991      80,    38,  -313,   674,  -313,  -313,  1167,    -3,   674,    20,
992    1557,   430,  -313,  1167,   444,    52,   465,  1324,  1339,    94,
993     176,  1351,   272,  -313,   -99,   479,  -313,   -96,   493,  -313,
994     -95,  -313,  -313,   -51,    47,    55,    58,    66,    71,  -313,
995      -7,    77,   106,  -313,  1167,    95,   525,  -313,  -313,   -91,
996      84,  -313,  -313,  -313,    87,  -313,   -87,  -313,  1557,  1581,
997     420,   420,   404,    70,    70,    62,  1303,    19,    18,    70,
998    1167,  -313,  -313,     1,   291,  1167,     1,  1283,  -313,  1363,
999    -313,  1283,  -313,  1167,  1167,  1167,  -313,  1167,  -313,  1167,
1000    1167,  -313,  -313,  -313,  -313,  -313,  -313,  -313,  -313,  -313,
1001    -313,  -313,  -313,   634,  -313,  -313,  -313,   539,   118,   -56,
1002    -313,  -313,  -313,  -313,  1167,   583,  1167,  -313,  1383,  1557,
1003      98,  1167,    99,   632,  1398,   678,  1410,   326,   386,    93,
1004      96,    97,   101,   102,   103,   104,  -313,  -313,  -313,  -313,
1005    1422,  -313,  1442,   105,  1283,   -86,  -112,  -313,  1167,  -313,
1006    1167,  1167,  -313,  1167,  -313,  -313,  -313,  -313,  -313,  -313,
1007    -313,  -313,  -313,  1167,  1167,   113,  -313,  -313,   129,   100,
1008    -313,   110,   692,   722,   736,   750,   771,  1502,  -112,   119,
1009     125,  1167,  -313,  -313,  -313,  -313,  -313,  -313,  -313,  -313,
1010     129,  -313,   -63,  -313,  -313
1011};
1012
1013/* YYPGOTO[NTERM-NUM].  */
1014static const short int yypgoto[] =
1015{
1016    -313,  -313,  -313,  -313,  -313,  -313,  -313,    14,    -1,    15,
1017    -313,  -313,     2,  -313,  -313,   264,   227,    49,  -231,  -313,
1018    -312,   -76,   -60,   114,     0,  -313,  -313,  -313,  -313,  -313,
1019    -313,  -313,  -313,  -313,  -313,  -313,  -313,  -313,  -313,  -313,
1020    -313,  -313,  -313,  -313
1021};
1022
1023/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
1024   positive, shift that token.  If negative, reduce the rule which
1025   number is the opposite.  If zero, do what YYDEFACT says.
1026   If YYTABLE_NINF, syntax error.  */
1027#define YYTABLE_NINF -1
1028static const short int yytable[] =
1029{
1030      59,    67,   327,    86,   142,   162,   280,    99,   142,   119,
1031     282,   145,   142,   100,   163,   164,   339,   146,   101,    94,
1032     146,    97,   148,   118,   212,   149,   149,   150,   151,   151,
1033     102,   142,   328,   109,   111,   113,   115,   120,   339,   146,
1034     121,   103,   146,   146,   123,    67,   252,   146,   138,   254,
1035     256,   146,   146,   211,   270,   146,   298,   124,   272,   326,
1036     133,   299,   161,   137,   147,   148,   104,   140,   149,   149,
1037     150,   151,   151,   325,   105,   146,   160,   149,   116,   117,
1038     151,   167,   354,   147,   148,   202,   203,   149,   169,   150,
1039     151,   106,   170,    96,   257,   135,   136,   147,   148,   107,
1040     122,   149,   125,   150,   151,   126,   184,   127,   129,   187,
1041     131,   171,   141,   190,   174,   176,   177,   178,   179,   180,
1042     181,   182,   201,   185,   128,   168,    96,   188,   130,   108,
1043     209,   263,   235,    30,   191,   110,   200,   143,   264,   144,
1044     112,   143,   216,   144,   206,   143,    97,   144,   152,   162,
1045     153,   154,   155,   156,   156,   157,   214,   172,   217,   159,
1046     114,   218,   219,   220,   143,   221,   144,   222,   223,   224,
1047     225,   226,   227,   228,   229,   166,   146,   233,   192,   147,
1048     148,   234,   236,   149,   205,   150,   151,   207,   239,   163,
1049     241,   152,   258,   153,   154,   155,   156,   156,   157,   157,
1050     259,   158,   159,   260,   155,   156,   268,   157,   213,   230,
1051     152,   261,   153,   154,   155,   156,   262,   157,   266,   267,
1052     158,   159,   265,   271,   152,   231,   153,   154,   155,   156,
1053     297,   157,   245,   144,   158,   159,   304,   306,   315,   246,
1054     324,   316,   317,   327,   341,   275,   318,   319,   320,   321,
1055     278,   338,   279,     2,     3,   342,   279,   350,   283,   284,
1056     285,     4,   286,   295,   287,   288,     5,     6,     7,     8,
1057     351,    98,   134,     9,   353,   147,   148,   301,   349,   149,
1058     305,   150,   151,   237,     0,     0,     0,     0,     0,   300,
1059       0,   302,     0,    10,   147,   148,     0,     0,   149,     0,
1060     150,   151,     0,     0,     0,     0,   152,     0,   153,   154,
1061     155,   156,     0,   157,   247,     0,   158,   159,     0,   279,
1062       0,   248,     0,   332,     0,   333,   334,     0,   335,   147,
1063     148,     0,     0,   149,     0,   150,   151,     0,   336,   337,
1064     352,     0,     0,     0,    11,    12,    13,    14,    15,    16,
1065      17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
1066       0,    27,    28,    29,    30,     0,    31,    32,    33,    34,
1067      35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
1068      45,    46,     0,    47,     0,     0,    48,     0,    49,   147,
1069     148,     0,    50,   149,     0,   150,   151,    51,     0,     0,
1070      52,     0,   152,     0,   153,   154,   155,   156,     0,   157,
1071     250,   149,   158,   159,   151,     0,     0,   251,     0,     0,
1072       0,   152,     0,   153,   154,   155,   156,   149,   157,   276,
1073     151,   158,   159,   147,   148,     0,   277,   149,     0,   150,
1074     151,     0,     0,     0,     0,     0,     0,   147,   148,     0,
1075       0,   149,     0,   150,   151,     0,   152,     0,   153,   154,
1076     155,   156,     0,   157,   311,     0,   158,   159,   147,   148,
1077       0,   312,   149,     0,   150,   151,     0,     0,     0,     0,
1078       0,     0,   147,   148,     0,     0,   149,     0,   150,   151,
1079       0,     0,     0,     0,     0,     0,   147,   148,     0,     0,
1080     149,     0,   150,   151,     0,     0,     0,     0,     0,     0,
1081       0,     0,     0,     0,     0,     0,   152,     0,   153,   154,
1082     155,   156,     0,   157,   313,     0,   158,   159,   147,   148,
1083       0,   314,   149,     0,   150,   151,   153,   154,   155,   156,
1084       0,   157,   147,   148,     0,   159,   149,     0,   150,   151,
1085     152,     0,   153,   154,   155,   156,     0,   157,     0,     0,
1086     152,   159,   153,   154,   155,   156,     0,   157,     0,     0,
1087     158,   159,     0,     0,   152,   238,   153,   154,   155,   156,
1088       0,   157,     0,     0,   158,   159,   147,   148,     0,   240,
1089     149,     0,   150,   151,     0,   152,     0,   153,   154,   155,
1090     156,     0,   157,     0,     0,   158,   159,     0,     0,   152,
1091     242,   153,   154,   155,   156,     0,   157,     0,     0,   158,
1092     159,     0,     0,   152,   253,   153,   154,   155,   156,     0,
1093     157,     0,     0,   158,   159,   147,   148,     0,   255,   149,
1094       0,   150,   151,     0,     0,     0,     0,     5,     6,   289,
1095     290,     0,     0,     0,     9,   152,     0,   153,   154,   155,
1096     156,     0,   157,     0,     0,   158,   159,     0,     0,   152,
1097     269,   153,   154,   155,   156,     0,   157,     0,     0,   158,
1098     159,   147,   148,     0,   296,   149,     0,   150,   151,    87,
1099       0,     0,     0,     0,     0,   147,   148,     0,     0,   149,
1100       0,   150,   151,     0,     0,     0,     0,     0,     0,     0,
1101       0,     0,     0,   152,     0,   153,   154,   155,   156,     0,
1102     157,     0,     0,   158,   159,   147,   148,     0,   231,   149,
1103       0,   150,   151,   291,   292,   293,   294,     0,     0,   147,
1104     148,     0,     0,   149,     0,   150,   151,     0,     0,     0,
1105       0,     0,     0,   147,   148,     0,     0,   149,     0,   150,
1106     151,     0,   152,     0,   153,   154,   155,   156,     0,   157,
1107       0,     0,   158,   159,   147,   148,     0,   307,   149,     0,
1108     150,   151,     0,     0,     0,    30,     0,    31,    32,    33,
1109       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1110       0,     0,    93,     0,     0,     0,     0,     0,   152,    49,
1111     153,   154,   155,   156,     0,   157,     0,     0,   158,   159,
1112       0,    52,   152,   309,   153,   154,   155,   156,     0,   157,
1113       0,     0,   158,   159,     4,     0,     0,   343,     0,     5,
1114       6,    87,    88,     0,     0,     0,     9,     0,     0,     0,
1115       0,     0,   152,     0,   153,   154,   155,   156,     0,   157,
1116       0,     0,   158,   159,    87,     0,   152,   344,   153,   154,
1117     155,   156,     0,   157,     0,     0,   158,   159,     0,     0,
1118     152,   345,   153,   154,   155,   156,     0,   157,     0,    87,
1119     158,   159,     0,     0,     0,   346,     0,     0,     0,     0,
1120       0,   152,     0,   153,   154,   155,   156,     0,   157,     0,
1121       0,   158,   159,     0,     0,     0,   347,    11,    12,    13,
1122      14,    15,    16,    17,    18,    89,    90,    91,    92,     0,
1123       0,     0,     0,     0,     0,     0,     0,    30,     0,    31,
1124      32,    33,     0,     4,     0,     0,    38,    39,     5,     6,
1125      87,    88,     0,     0,    93,     9,     0,     0,     0,    48,
1126      30,    49,    31,    32,    33,     0,     0,     0,     0,     0,
1127      51,   183,     0,    52,     0,     0,     0,    93,     0,     0,
1128       0,     0,     0,     0,    49,    30,     0,    31,    32,    33,
1129       0,     0,     0,    96,     0,     0,    52,     0,     0,     0,
1130       4,     0,    93,     0,     0,     5,     6,    87,    88,    49,
1131       0,     0,     9,     0,     0,     0,     0,     0,   108,     0,
1132       0,    52,     0,     0,     0,     0,    11,    12,    13,    14,
1133      15,    16,    17,    18,    89,    90,    91,    92,     0,     0,
1134       0,     0,     0,     0,     0,     0,    30,     0,    31,    32,
1135      33,     0,     0,     0,     0,    38,    39,     0,     0,     4,
1136       0,     0,     0,    93,     5,     6,    87,    88,    48,     0,
1137      49,     9,     0,     0,     0,     0,     0,     0,     0,    51,
1138     186,     0,    52,    11,    12,    13,    14,    15,    16,    17,
1139      18,    89,    90,    91,    92,     0,     0,     0,     0,     0,
1140       0,     0,     0,    30,     0,    31,    32,    33,     0,     0,
1141       0,     0,    38,    39,     0,     0,     4,     0,     0,     0,
1142      93,     5,     6,    87,    88,    48,     0,    49,     9,     0,
1143       0,     0,     0,     0,     0,     0,    51,   189,     0,    52,
1144       0,     0,    11,    12,    13,    14,    15,    16,    17,    18,
1145      89,    90,    91,    92,     0,     0,     0,     0,     0,     0,
1146       0,     0,    30,     0,    31,    32,    33,     0,     0,     0,
1147       0,    38,    39,     0,     0,     4,     0,     0,     0,    93,
1148       5,     6,    87,    88,    48,     0,    49,     9,     0,     0,
1149       0,     0,     0,     0,     0,    51,   208,     0,    52,    11,
1150      12,    13,    14,    15,    16,    17,    18,    89,    90,    91,
1151      92,     0,     0,     0,     0,     0,     0,     0,     0,    30,
1152       0,    31,    32,    33,     0,     0,     0,     0,    38,    39,
1153       0,     0,     4,     0,     0,     0,    93,     5,     6,   132,
1154      88,    48,     0,    49,     9,     0,     0,     0,     0,     0,
1155       0,     0,    51,   215,     0,    52,     0,     0,    11,    12,
1156      13,    14,    15,    16,    17,    18,    89,    90,    91,    92,
1157       0,     0,     0,     0,     0,     0,     0,     0,    30,     0,
1158      31,    32,    33,     0,     0,     0,     0,    38,    39,     0,
1159       0,     4,     0,     0,     0,    93,     5,     6,    87,    88,
1160      48,     0,    49,     9,     0,     0,   147,   148,     0,     0,
1161     149,    51,   150,   151,    52,    11,    12,    13,    14,    15,
1162      16,    17,    18,    19,    20,    21,    22,   147,   148,     0,
1163       0,   149,     0,   150,   151,    30,     0,    31,    32,    33,
1164       0,     0,   147,   148,    38,    39,   149,     0,   150,   151,
1165       0,     0,    93,     0,   147,   148,     0,    48,   149,    49,
1166     150,   151,     0,     0,     0,     0,   147,   148,    51,     0,
1167     149,    52,   150,   151,    11,    12,    13,    14,    15,    16,
1168      17,    18,    89,    90,    91,    92,   147,   148,     0,     0,
1169     149,     0,   150,   151,    30,     0,    31,    32,    33,     0,
1170       0,   147,   148,    38,    39,   149,     0,   150,   151,     0,
1171       0,    93,     0,   147,   148,     0,    48,   149,    49,   150,
1172     151,     0,     0,     0,     0,   147,   148,   173,     0,   149,
1173      52,   150,   151,   152,     0,   153,   154,   155,   156,   273,
1174     157,   274,     0,   158,   159,   147,   148,     0,     0,   149,
1175       0,   150,   151,     0,   152,     0,   153,   154,   155,   156,
1176       0,   157,   243,     0,   158,   159,     0,     0,     0,   152,
1177       0,   153,   154,   155,   156,     0,   157,   244,     0,   158,
1178     159,   152,     0,   153,   154,   155,   156,     0,   157,   249,
1179       0,   158,   159,   152,     0,   153,   154,   155,   156,    87,
1180     157,   281,     0,   158,   159,   147,   148,     0,     0,   149,
1181       0,   150,   151,   152,     0,   153,   154,   155,   156,   303,
1182     157,     0,     0,   158,   159,     0,     0,     0,   152,     0,
1183     153,   154,   155,   156,     0,   157,   308,     0,   158,   159,
1184     152,     0,   153,   154,   155,   156,     0,   157,   310,     0,
1185     158,   159,   152,     0,   153,   154,   155,   156,   322,   157,
1186     147,   148,   158,   159,   149,     0,   150,   151,     0,     0,
1187       0,     0,   152,    87,   153,   154,   155,   156,     0,   157,
1188     323,     0,   158,   159,    -1,   148,     0,     0,   149,     0,
1189     150,   151,     0,     0,     0,    30,     0,    31,    32,    33,
1190       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1191       0,     0,    93,     0,     0,     0,     0,     0,     0,    49,
1192       0,     0,     0,     0,     0,     0,     0,     0,   110,     0,
1193       0,    52,   152,     0,   153,   154,   155,   156,   348,   157,
1194      87,     0,   158,   159,     5,     6,   193,   194,     0,     0,
1195       0,     9,     0,     0,     0,     0,     0,     0,     0,     0,
1196       0,     0,     0,     0,     0,     0,     0,     0,     0,    30,
1197       0,    31,    32,    33,     0,    87,     0,     0,     0,     0,
1198       0,     0,     0,     0,     0,     0,    93,   152,     0,   153,
1199     154,   155,   156,    49,   157,     0,     0,   158,   159,     0,
1200       0,     0,   112,     0,     0,    52,     0,     0,     0,     0,
1201       0,   152,     0,   153,   154,   155,   156,     0,   157,     0,
1202       0,   158,   159,     0,     0,     0,     0,     0,     0,     0,
1203     195,   196,   197,   198,     0,     0,    30,     0,    31,    32,
1204      33,     0,    30,     0,    31,    32,    33,     0,     0,     0,
1205       0,     0,     0,    93,     0,     0,     0,     0,     0,    93,
1206      49,     0,     0,     0,     0,     0,    49,     0,     0,   114,
1207       0,    30,    52,    31,    32,    33,   199,     0,    52,     0,
1208       0,     0,     0,     0,     0,     0,     0,     0,    93,     0,
1209       0,     0,     0,     0,     0,    49,     0,     0,     0,     0,
1210       0,     0,     0,     0,   166,     0,     0,    52
1211};
1212
1213static const short int yycheck[] =
1214{
1215       1,     1,   114,   139,    11,   129,   237,   144,    11,   111,
1216     241,   129,    11,   144,   138,   139,   328,   138,   144,     4,
1217     138,     7,     4,    24,   145,     7,     7,     9,    10,    10,
1218     144,    11,   144,    19,    20,    21,    22,   139,   350,   138,
1219      26,   144,   138,   138,    29,    45,   145,   138,    49,   145,
1220     145,   138,   138,   136,   145,   138,   112,   111,   145,   145,
1221      45,   117,    63,    48,     3,     4,   144,    52,     7,     7,
1222       9,    10,    10,   304,   144,   138,    61,     7,   111,   112,
1223      10,    67,   145,     3,     4,   111,   112,     7,    74,     9,
1224      10,   144,    77,   144,   145,    46,    47,     3,     4,   144,
1225     144,     7,   112,     9,    10,   144,   107,   144,   144,   110,
1226     144,    96,   139,   114,    99,   100,   101,   102,   103,   104,
1227     105,   106,   122,   108,   111,   138,   144,   112,   111,   144,
1228     131,   138,   135,   111,   139,   144,   122,   144,   145,   146,
1229     144,   144,   143,   146,   129,   144,   132,   146,   130,   129,
1230     132,   133,   134,   135,   135,   137,   142,   112,   144,   141,
1231     144,   146,   147,   148,   144,   150,   146,   152,   153,   154,
1232     155,   156,   157,   158,   159,   144,   138,   163,   139,     3,
1233       4,   166,   168,     7,   111,     9,    10,   112,   173,   138,
1234     138,   130,   145,   132,   133,   134,   135,   135,   137,   137,
1235     145,   140,   141,   145,   134,   135,   111,   137,   147,   129,
1236     130,   145,   132,   133,   134,   135,   145,   137,   112,   204,
1237     140,   141,   145,   139,   130,   145,   132,   133,   134,   135,
1238     112,   137,   138,   146,   140,   141,   138,   138,   145,   145,
1239     135,   145,   145,   114,   144,   230,   145,   145,   145,   145,
1240     235,   138,   237,     0,     1,   145,   241,   138,   243,   244,
1241     245,     8,   247,   263,   249,   250,    13,    14,    15,    16,
1242     145,     7,    45,    20,   350,     3,     4,   275,   338,     7,
1243     281,     9,    10,   169,    -1,    -1,    -1,    -1,    -1,   274,
1244      -1,   276,    -1,    40,     3,     4,    -1,    -1,     7,    -1,
1245       9,    10,    -1,    -1,    -1,    -1,   130,    -1,   132,   133,
1246     134,   135,    -1,   137,   138,    -1,   140,   141,    -1,   304,
1247      -1,   145,    -1,   308,    -1,   310,   311,    -1,   313,     3,
1248       4,    -1,    -1,     7,    -1,     9,    10,    -1,   323,   324,
1249     341,    -1,    -1,    -1,    91,    92,    93,    94,    95,    96,
1250      97,    98,    99,   100,   101,   102,   103,   104,   105,   106,
1251      -1,   108,   109,   110,   111,    -1,   113,   114,   115,   116,
1252     117,   118,   119,   120,   121,   122,   123,   124,   125,   126,
1253     127,   128,    -1,   130,    -1,    -1,   133,    -1,   135,     3,
1254       4,    -1,   139,     7,    -1,     9,    10,   144,    -1,    -1,
1255     147,    -1,   130,    -1,   132,   133,   134,   135,    -1,   137,
1256     138,     7,   140,   141,    10,    -1,    -1,   145,    -1,    -1,
1257      -1,   130,    -1,   132,   133,   134,   135,     7,   137,   138,
1258      10,   140,   141,     3,     4,    -1,   145,     7,    -1,     9,
1259      10,    -1,    -1,    -1,    -1,    -1,    -1,     3,     4,    -1,
1260      -1,     7,    -1,     9,    10,    -1,   130,    -1,   132,   133,
1261     134,   135,    -1,   137,   138,    -1,   140,   141,     3,     4,
1262      -1,   145,     7,    -1,     9,    10,    -1,    -1,    -1,    -1,
1263      -1,    -1,     3,     4,    -1,    -1,     7,    -1,     9,    10,
1264      -1,    -1,    -1,    -1,    -1,    -1,     3,     4,    -1,    -1,
1265       7,    -1,     9,    10,    -1,    -1,    -1,    -1,    -1,    -1,
1266      -1,    -1,    -1,    -1,    -1,    -1,   130,    -1,   132,   133,
1267     134,   135,    -1,   137,   138,    -1,   140,   141,     3,     4,
1268      -1,   145,     7,    -1,     9,    10,   132,   133,   134,   135,
1269      -1,   137,     3,     4,    -1,   141,     7,    -1,     9,    10,
1270     130,    -1,   132,   133,   134,   135,    -1,   137,    -1,    -1,
1271     130,   141,   132,   133,   134,   135,    -1,   137,    -1,    -1,
1272     140,   141,    -1,    -1,   130,   145,   132,   133,   134,   135,
1273      -1,   137,    -1,    -1,   140,   141,     3,     4,    -1,   145,
1274       7,    -1,     9,    10,    -1,   130,    -1,   132,   133,   134,
1275     135,    -1,   137,    -1,    -1,   140,   141,    -1,    -1,   130,
1276     145,   132,   133,   134,   135,    -1,   137,    -1,    -1,   140,
1277     141,    -1,    -1,   130,   145,   132,   133,   134,   135,    -1,
1278     137,    -1,    -1,   140,   141,     3,     4,    -1,   145,     7,
1279      -1,     9,    10,    -1,    -1,    -1,    -1,    13,    14,    15,
1280      16,    -1,    -1,    -1,    20,   130,    -1,   132,   133,   134,
1281     135,    -1,   137,    -1,    -1,   140,   141,    -1,    -1,   130,
1282     145,   132,   133,   134,   135,    -1,   137,    -1,    -1,   140,
1283     141,     3,     4,    -1,   145,     7,    -1,     9,    10,    15,
1284      -1,    -1,    -1,    -1,    -1,     3,     4,    -1,    -1,     7,
1285      -1,     9,    10,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1286      -1,    -1,    -1,   130,    -1,   132,   133,   134,   135,    -1,
1287     137,    -1,    -1,   140,   141,     3,     4,    -1,   145,     7,
1288      -1,     9,    10,    99,   100,   101,   102,    -1,    -1,     3,
1289       4,    -1,    -1,     7,    -1,     9,    10,    -1,    -1,    -1,
1290      -1,    -1,    -1,     3,     4,    -1,    -1,     7,    -1,     9,
1291      10,    -1,   130,    -1,   132,   133,   134,   135,    -1,   137,
1292      -1,    -1,   140,   141,     3,     4,    -1,   145,     7,    -1,
1293       9,    10,    -1,    -1,    -1,   111,    -1,   113,   114,   115,
1294      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1295      -1,    -1,   128,    -1,    -1,    -1,    -1,    -1,   130,   135,
1296     132,   133,   134,   135,    -1,   137,    -1,    -1,   140,   141,
1297      -1,   147,   130,   145,   132,   133,   134,   135,    -1,   137,
1298      -1,    -1,   140,   141,     8,    -1,    -1,   145,    -1,    13,
1299      14,    15,    16,    -1,    -1,    -1,    20,    -1,    -1,    -1,
1300      -1,    -1,   130,    -1,   132,   133,   134,   135,    -1,   137,
1301      -1,    -1,   140,   141,    15,    -1,   130,   145,   132,   133,
1302     134,   135,    -1,   137,    -1,    -1,   140,   141,    -1,    -1,
1303     130,   145,   132,   133,   134,   135,    -1,   137,    -1,    15,
1304     140,   141,    -1,    -1,    -1,   145,    -1,    -1,    -1,    -1,
1305      -1,   130,    -1,   132,   133,   134,   135,    -1,   137,    -1,
1306      -1,   140,   141,    -1,    -1,    -1,   145,    91,    92,    93,
1307      94,    95,    96,    97,    98,    99,   100,   101,   102,    -1,
1308      -1,    -1,    -1,    -1,    -1,    -1,    -1,   111,    -1,   113,
1309     114,   115,    -1,     8,    -1,    -1,   120,   121,    13,    14,
1310      15,    16,    -1,    -1,   128,    20,    -1,    -1,    -1,   133,
1311     111,   135,   113,   114,   115,    -1,    -1,    -1,    -1,    -1,
1312     144,   145,    -1,   147,    -1,    -1,    -1,   128,    -1,    -1,
1313      -1,    -1,    -1,    -1,   135,   111,    -1,   113,   114,   115,
1314      -1,    -1,    -1,   144,    -1,    -1,   147,    -1,    -1,    -1,
1315       8,    -1,   128,    -1,    -1,    13,    14,    15,    16,   135,
1316      -1,    -1,    20,    -1,    -1,    -1,    -1,    -1,   144,    -1,
1317      -1,   147,    -1,    -1,    -1,    -1,    91,    92,    93,    94,
1318      95,    96,    97,    98,    99,   100,   101,   102,    -1,    -1,
1319      -1,    -1,    -1,    -1,    -1,    -1,   111,    -1,   113,   114,
1320     115,    -1,    -1,    -1,    -1,   120,   121,    -1,    -1,     8,
1321      -1,    -1,    -1,   128,    13,    14,    15,    16,   133,    -1,
1322     135,    20,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   144,
1323     145,    -1,   147,    91,    92,    93,    94,    95,    96,    97,
1324      98,    99,   100,   101,   102,    -1,    -1,    -1,    -1,    -1,
1325      -1,    -1,    -1,   111,    -1,   113,   114,   115,    -1,    -1,
1326      -1,    -1,   120,   121,    -1,    -1,     8,    -1,    -1,    -1,
1327     128,    13,    14,    15,    16,   133,    -1,   135,    20,    -1,
1328      -1,    -1,    -1,    -1,    -1,    -1,   144,   145,    -1,   147,
1329      -1,    -1,    91,    92,    93,    94,    95,    96,    97,    98,
1330      99,   100,   101,   102,    -1,    -1,    -1,    -1,    -1,    -1,
1331      -1,    -1,   111,    -1,   113,   114,   115,    -1,    -1,    -1,
1332      -1,   120,   121,    -1,    -1,     8,    -1,    -1,    -1,   128,
1333      13,    14,    15,    16,   133,    -1,   135,    20,    -1,    -1,
1334      -1,    -1,    -1,    -1,    -1,   144,   145,    -1,   147,    91,
1335      92,    93,    94,    95,    96,    97,    98,    99,   100,   101,
1336     102,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   111,
1337      -1,   113,   114,   115,    -1,    -1,    -1,    -1,   120,   121,
1338      -1,    -1,     8,    -1,    -1,    -1,   128,    13,    14,    15,
1339      16,   133,    -1,   135,    20,    -1,    -1,    -1,    -1,    -1,
1340      -1,    -1,   144,   145,    -1,   147,    -1,    -1,    91,    92,
1341      93,    94,    95,    96,    97,    98,    99,   100,   101,   102,
1342      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   111,    -1,
1343     113,   114,   115,    -1,    -1,    -1,    -1,   120,   121,    -1,
1344      -1,     8,    -1,    -1,    -1,   128,    13,    14,    15,    16,
1345     133,    -1,   135,    20,    -1,    -1,     3,     4,    -1,    -1,
1346       7,   144,     9,    10,   147,    91,    92,    93,    94,    95,
1347      96,    97,    98,    99,   100,   101,   102,     3,     4,    -1,
1348      -1,     7,    -1,     9,    10,   111,    -1,   113,   114,   115,
1349      -1,    -1,     3,     4,   120,   121,     7,    -1,     9,    10,
1350      -1,    -1,   128,    -1,     3,     4,    -1,   133,     7,   135,
1351       9,    10,    -1,    -1,    -1,    -1,     3,     4,   144,    -1,
1352       7,   147,     9,    10,    91,    92,    93,    94,    95,    96,
1353      97,    98,    99,   100,   101,   102,     3,     4,    -1,    -1,
1354       7,    -1,     9,    10,   111,    -1,   113,   114,   115,    -1,
1355      -1,     3,     4,   120,   121,     7,    -1,     9,    10,    -1,
1356      -1,   128,    -1,     3,     4,    -1,   133,     7,   135,     9,
1357      10,    -1,    -1,    -1,    -1,     3,     4,   144,    -1,     7,
1358     147,     9,    10,   130,    -1,   132,   133,   134,   135,   136,
1359     137,   138,    -1,   140,   141,     3,     4,    -1,    -1,     7,
1360      -1,     9,    10,    -1,   130,    -1,   132,   133,   134,   135,
1361      -1,   137,   138,    -1,   140,   141,    -1,    -1,    -1,   130,
1362      -1,   132,   133,   134,   135,    -1,   137,   138,    -1,   140,
1363     141,   130,    -1,   132,   133,   134,   135,    -1,   137,   138,
1364      -1,   140,   141,   130,    -1,   132,   133,   134,   135,    15,
1365     137,   138,    -1,   140,   141,     3,     4,    -1,    -1,     7,
1366      -1,     9,    10,   130,    -1,   132,   133,   134,   135,   136,
1367     137,    -1,    -1,   140,   141,    -1,    -1,    -1,   130,    -1,
1368     132,   133,   134,   135,    -1,   137,   138,    -1,   140,   141,
1369     130,    -1,   132,   133,   134,   135,    -1,   137,   138,    -1,
1370     140,   141,   130,    -1,   132,   133,   134,   135,   136,   137,
1371       3,     4,   140,   141,     7,    -1,     9,    10,    -1,    -1,
1372      -1,    -1,   130,    15,   132,   133,   134,   135,    -1,   137,
1373     138,    -1,   140,   141,     3,     4,    -1,    -1,     7,    -1,
1374       9,    10,    -1,    -1,    -1,   111,    -1,   113,   114,   115,
1375      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1376      -1,    -1,   128,    -1,    -1,    -1,    -1,    -1,    -1,   135,
1377      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   144,    -1,
1378      -1,   147,   130,    -1,   132,   133,   134,   135,   136,   137,
1379      15,    -1,   140,   141,    13,    14,    15,    16,    -1,    -1,
1380      -1,    20,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1381      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   111,
1382      -1,   113,   114,   115,    -1,    15,    -1,    -1,    -1,    -1,
1383      -1,    -1,    -1,    -1,    -1,    -1,   128,   130,    -1,   132,
1384     133,   134,   135,   135,   137,    -1,    -1,   140,   141,    -1,
1385      -1,    -1,   144,    -1,    -1,   147,    -1,    -1,    -1,    -1,
1386      -1,   130,    -1,   132,   133,   134,   135,    -1,   137,    -1,
1387      -1,   140,   141,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1388      99,   100,   101,   102,    -1,    -1,   111,    -1,   113,   114,
1389     115,    -1,   111,    -1,   113,   114,   115,    -1,    -1,    -1,
1390      -1,    -1,    -1,   128,    -1,    -1,    -1,    -1,    -1,   128,
1391     135,    -1,    -1,    -1,    -1,    -1,   135,    -1,    -1,   144,
1392      -1,   111,   147,   113,   114,   115,   145,    -1,   147,    -1,
1393      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   128,    -1,
1394      -1,    -1,    -1,    -1,    -1,   135,    -1,    -1,    -1,    -1,
1395      -1,    -1,    -1,    -1,   144,    -1,    -1,   147
1396};
1397
1398/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1399   symbol of state STATE-NUM.  */
1400static const unsigned char yystos[] =
1401{
1402       0,   149,     0,     1,     8,    13,    14,    15,    16,    20,
1403      40,    91,    92,    93,    94,    95,    96,    97,    98,    99,
1404     100,   101,   102,   103,   104,   105,   106,   108,   109,   110,
1405     111,   113,   114,   115,   116,   117,   118,   119,   120,   121,
1406     122,   123,   124,   125,   126,   127,   128,   130,   133,   135,
1407     139,   144,   147,   150,   151,   152,   153,   154,   155,   156,
1408     157,   159,   161,   162,   163,   164,   165,   172,   173,   175,
1409     176,   177,   178,   179,   180,   181,   182,   183,   184,   185,
1410     186,   187,   188,   189,   190,   191,   139,    15,    16,    99,
1411     100,   101,   102,   128,   157,   172,   144,   155,   163,   144,
1412     144,   144,   144,   144,   144,   144,   144,   144,   144,   155,
1413     144,   155,   144,   155,   144,   155,   111,   112,   156,   111,
1414     139,   155,   144,   157,   111,   112,   144,   144,   111,   144,
1415     111,   144,    15,   157,   164,   165,   165,   157,   156,   156,
1416     157,   139,    11,   144,   146,   129,   138,     3,     4,     7,
1417       9,    10,   130,   132,   133,   134,   135,   137,   140,   141,
1418     157,   156,   129,   138,   139,   171,   144,   155,   138,   155,
1419     157,   157,   112,   144,   157,   166,   157,   157,   157,   157,
1420     157,   157,   157,   145,   156,   157,   145,   156,   157,   145,
1421     156,   139,   139,    15,    16,    99,   100,   101,   102,   145,
1422     155,   172,   111,   112,   158,   111,   157,   112,   145,   156,
1423     174,   136,   145,   147,   155,   145,   156,   155,   157,   157,
1424     157,   157,   157,   157,   157,   157,   157,   157,   157,   157,
1425     129,   145,   160,   155,   157,   135,   155,   171,   145,   157,
1426     145,   138,   145,   138,   138,   138,   145,   138,   145,   138,
1427     138,   145,   145,   145,   145,   145,   145,   145,   145,   145,
1428     145,   145,   145,   138,   145,   145,   112,   157,   111,   145,
1429     145,   139,   145,   136,   138,   157,   138,   145,   157,   157,
1430     166,   138,   166,   157,   157,   157,   157,   157,   157,    15,
1431      16,    99,   100,   101,   102,   172,   145,   112,   112,   117,
1432     157,   160,   157,   136,   138,   156,   138,   145,   138,   145,
1433     138,   138,   145,   138,   145,   145,   145,   145,   145,   145,
1434     145,   145,   136,   138,   135,   166,   145,   114,   144,   167,
1435     168,   170,   157,   157,   157,   157,   157,   157,   138,   168,
1436     169,   144,   145,   145,   145,   145,   145,   145,   136,   170,
1437     138,   145,   156,   169,   145
1438};
1439
1440#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
1441# define YYSIZE_T __SIZE_TYPE__
1442#endif
1443#if ! defined (YYSIZE_T) && defined (size_t)
1444# define YYSIZE_T size_t
1445#endif
1446#if ! defined (YYSIZE_T)
1447# if defined (__STDC__) || defined (__cplusplus)
1448#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1449#  define YYSIZE_T size_t
1450# endif
1451#endif
1452#if ! defined (YYSIZE_T)
1453# define YYSIZE_T unsigned int
1454#endif
1455
1456#define yyerrok         (yyerrstatus = 0)
1457#define yyclearin       (yychar = YYEMPTY)
1458#define YYEMPTY         (-2)
1459#define YYEOF           0
1460
1461#define YYACCEPT        goto yyacceptlab
1462#define YYABORT         goto yyabortlab
1463#define YYERROR         goto yyerrorlab
1464
1465
1466/* Like YYERROR except do call yyerror.  This remains here temporarily
1467   to ease the transition to the new meaning of YYERROR, for GCC.
1468   Once GCC version 2 has supplanted version 1, this can go.  */
1469
1470#define YYFAIL          goto yyerrlab
1471
1472#define YYRECOVERING()  (!!yyerrstatus)
1473
1474#define YYBACKUP(Token, Value)                                  \
1475do                                                              \
1476  if (yychar == YYEMPTY && yylen == 1)                          \
1477    {                                                           \
1478      yychar = (Token);                                         \
1479      yylval = (Value);                                         \
1480      yytoken = YYTRANSLATE (yychar);                           \
1481      YYPOPSTACK;                                               \
1482      goto yybackup;                                            \
1483    }                                                           \
1484  else                                                          \
1485    {                                                           \
1486      yyerror ("syntax error: cannot back up");\
1487      YYERROR;                                                  \
1488    }                                                           \
1489while (0)
1490
1491#define YYTERROR        1
1492#define YYERRCODE       256
1493
1494/* YYLLOC_DEFAULT -- Compute the default location (before the actions
1495   are run).  */
1496
1497#ifndef YYLLOC_DEFAULT
1498# define YYLLOC_DEFAULT(Current, Rhs, N)                \
1499   ((Current).first_line   = (Rhs)[1].first_line,       \
1500    (Current).first_column = (Rhs)[1].first_column,     \
1501    (Current).last_line    = (Rhs)[N].last_line,        \
1502    (Current).last_column  = (Rhs)[N].last_column)
1503#endif
1504
1505/* YYLEX -- calling `yylex' with the right arguments.  */
1506
1507#ifdef YYLEX_PARAM
1508# define YYLEX yylex (&yylval, YYLEX_PARAM)
1509#else
1510# define YYLEX yylex (&yylval)
1511#endif
1512
1513/* Enable debugging if requested.  */
1514#if YYDEBUG
1515
1516# ifndef YYFPRINTF
1517#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1518#  define YYFPRINTF fprintf
1519# endif
1520
1521# define YYDPRINTF(Args)                        \
1522do {                                            \
1523  if (yydebug)                                  \
1524    YYFPRINTF Args;                             \
1525} while (0)
1526
1527# define YYDSYMPRINT(Args)                      \
1528do {                                            \
1529  if (yydebug)                                  \
1530    yysymprint Args;                            \
1531} while (0)
1532
1533# define YYDSYMPRINTF(Title, Token, Value, Location)            \
1534do {                                                            \
1535  if (yydebug)                                                  \
1536    {                                                           \
1537      YYFPRINTF (stderr, "%s ", Title);                         \
1538      yysymprint (stderr,                                       \
1539                  Token, Value);        \
1540      YYFPRINTF (stderr, "\n");                                 \
1541    }                                                           \
1542} while (0)
1543
1544/*------------------------------------------------------------------.
1545| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1546| TOP (included).                                                   |
1547`------------------------------------------------------------------*/
1548
1549#if defined (__STDC__) || defined (__cplusplus)
1550static void
1551yy_stack_print (short int *bottom, short int *top)
1552#else
1553static void
1554yy_stack_print (bottom, top)
1555    short int *bottom;
1556    short int *top;
1557#endif
1558{
1559  YYFPRINTF (stderr, "Stack now");
1560  for (/* Nothing. */; bottom <= top; ++bottom)
1561    YYFPRINTF (stderr, " %d", *bottom);
1562  YYFPRINTF (stderr, "\n");
1563}
1564
1565# define YY_STACK_PRINT(Bottom, Top)                            \
1566do {                                                            \
1567  if (yydebug)                                                  \
1568    yy_stack_print ((Bottom), (Top));                           \
1569} while (0)
1570
1571
1572/*------------------------------------------------.
1573| Report that the YYRULE is going to be reduced.  |
1574`------------------------------------------------*/
1575
1576#if defined (__STDC__) || defined (__cplusplus)
1577static void
1578yy_reduce_print (int yyrule)
1579#else
1580static void
1581yy_reduce_print (yyrule)
1582    int yyrule;
1583#endif
1584{
1585  int yyi;
1586  unsigned int yylno = yyrline[yyrule];
1587  YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
1588             yyrule - 1, yylno);
1589  /* Print the symbols being reduced, and their result.  */
1590  for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
1591    YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
1592  YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
1593}
1594
1595# define YY_REDUCE_PRINT(Rule)          \
1596do {                                    \
1597  if (yydebug)                          \
1598    yy_reduce_print (Rule);             \
1599} while (0)
1600
1601/* Nonzero means print parse trace.  It is left uninitialized so that
1602   multiple parsers can coexist.  */
1603int yydebug;
1604#else /* !YYDEBUG */
1605# define YYDPRINTF(Args)
1606# define YYDSYMPRINT(Args)
1607# define YYDSYMPRINTF(Title, Token, Value, Location)
1608# define YY_STACK_PRINT(Bottom, Top)
1609# define YY_REDUCE_PRINT(Rule)
1610#endif /* !YYDEBUG */
1611
1612
1613/* YYINITDEPTH -- initial size of the parser's stacks.  */
1614#ifndef YYINITDEPTH
1615# define YYINITDEPTH 200
1616#endif
1617
1618/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1619   if the built-in stack extension method is used).
1620
1621   Do not make this value too large; the results are undefined if
1622   SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
1623   evaluated with infinite-precision integer arithmetic.  */
1624
1625#if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
1626# undef YYMAXDEPTH
1627#endif
1628
1629#ifndef YYMAXDEPTH
1630# define YYMAXDEPTH 10000
1631#endif
1632
1633
1634
1635#if YYERROR_VERBOSE
1636
1637# ifndef yystrlen
1638#  if defined (__GLIBC__) && defined (_STRING_H)
1639#   define yystrlen strlen
1640#  else
1641/* Return the length of YYSTR.  */
1642static YYSIZE_T
1643#   if defined (__STDC__) || defined (__cplusplus)
1644yystrlen (const char *yystr)
1645#   else
1646yystrlen (yystr)
1647     const char *yystr;
1648#   endif
1649{
1650  register const char *yys = yystr;
1651
1652  while (*yys++ != '\0')
1653    continue;
1654
1655  return yys - yystr - 1;
1656}
1657#  endif
1658# endif
1659
1660# ifndef yystpcpy
1661#  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1662#   define yystpcpy stpcpy
1663#  else
1664/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1665   YYDEST.  */
1666static char *
1667#   if defined (__STDC__) || defined (__cplusplus)
1668yystpcpy (char *yydest, const char *yysrc)
1669#   else
1670yystpcpy (yydest, yysrc)
1671     char *yydest;
1672     const char *yysrc;
1673#   endif
1674{
1675  register char *yyd = yydest;
1676  register const char *yys = yysrc;
1677
1678  while ((*yyd++ = *yys++) != '\0')
1679    continue;
1680
1681  return yyd - 1;
1682}
1683#  endif
1684# endif
1685
1686#endif /* !YYERROR_VERBOSE */
1687
1688
1689
1690#if YYDEBUG
1691/*--------------------------------.
1692| Print this symbol on YYOUTPUT.  |
1693`--------------------------------*/
1694
1695#if defined (__STDC__) || defined (__cplusplus)
1696static void
1697yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
1698#else
1699static void
1700yysymprint (yyoutput, yytype, yyvaluep)
1701    FILE *yyoutput;
1702    int yytype;
1703    YYSTYPE *yyvaluep;
1704#endif
1705{
1706  /* Pacify ``unused variable'' warnings.  */
1707  (void) yyvaluep;
1708
1709  if (yytype < YYNTOKENS)
1710    {
1711      YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1712# ifdef YYPRINT
1713      YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1714# endif
1715    }
1716  else
1717    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1718
1719  switch (yytype)
1720    {
1721      default:
1722        break;
1723    }
1724  YYFPRINTF (yyoutput, ")");
1725}
1726
1727#endif /* ! YYDEBUG */
1728/*-----------------------------------------------.
1729| Release the memory associated to this symbol.  |
1730`-----------------------------------------------*/
1731
1732#if defined (__STDC__) || defined (__cplusplus)
1733static void
1734yydestruct (int yytype, YYSTYPE *yyvaluep)
1735#else
1736static void
1737yydestruct (yytype, yyvaluep)
1738    int yytype;
1739    YYSTYPE *yyvaluep;
1740#endif
1741{
1742  /* Pacify ``unused variable'' warnings.  */
1743  (void) yyvaluep;
1744
1745  switch (yytype)
1746    {
1747
1748      default:
1749        break;
1750    }
1751}
1752
1753
1754/* Prevent warnings from -Wmissing-prototypes.  */
1755
1756#ifdef YYPARSE_PARAM
1757# if defined (__STDC__) || defined (__cplusplus)
1758int yyparse (void *YYPARSE_PARAM);
1759# else
1760int yyparse ();
1761# endif
1762#else /* ! YYPARSE_PARAM */
1763#if defined (__STDC__) || defined (__cplusplus)
1764int yyparse (void);
1765#else
1766int yyparse ();
1767#endif
1768#endif /* ! YYPARSE_PARAM */
1769
1770
1771
1772
1773
1774
1775/*----------.
1776| yyparse.  |
1777`----------*/
1778
1779#ifdef YYPARSE_PARAM
1780# if defined (__STDC__) || defined (__cplusplus)
1781int yyparse (void *YYPARSE_PARAM)
1782# else
1783int yyparse (YYPARSE_PARAM)
1784  void *YYPARSE_PARAM;
1785# endif
1786#else /* ! YYPARSE_PARAM */
1787#if defined (__STDC__) || defined (__cplusplus)
1788int
1789yyparse (void)
1790#else
1791int
1792yyparse ()
1793
1794#endif
1795#endif
1796{
1797  /* The lookahead symbol.  */
1798int yychar;
1799
1800/* The semantic value of the lookahead symbol.  */
1801YYSTYPE yylval;
1802
1803/* Number of syntax errors so far.  */
1804int yynerrs;
1805
1806  register int yystate;
1807  register int yyn;
1808  int yyresult;
1809  /* Number of tokens to shift before error messages enabled.  */
1810  int yyerrstatus;
1811  /* Lookahead token as an internal (translated) token number.  */
1812  int yytoken = 0;
1813
1814  /* Three stacks and their tools:
1815     `yyss': related to states,
1816     `yyvs': related to semantic values,
1817     `yyls': related to locations.
1818
1819     Refer to the stacks thru separate pointers, to allow yyoverflow
1820     to reallocate them elsewhere.  */
1821
1822  /* The state stack.  */
1823  short int yyssa[YYINITDEPTH];
1824  short int *yyss = yyssa;
1825  register short int *yyssp;
1826
1827  /* The semantic value stack.  */
1828  YYSTYPE yyvsa[YYINITDEPTH];
1829  YYSTYPE *yyvs = yyvsa;
1830  register YYSTYPE *yyvsp;
1831
1832
1833
1834#define YYPOPSTACK   (yyvsp--, yyssp--)
1835
1836  YYSIZE_T yystacksize = YYINITDEPTH;
1837
1838  /* The variables used to return semantic value and location from the
1839     action routines.  */
1840  YYSTYPE yyval;
1841
1842
1843  /* When reducing, the number of symbols on the RHS of the reduced
1844     rule.  */
1845  int yylen;
1846
1847  YYDPRINTF ((stderr, "Starting parse\n"));
1848
1849  yystate = 0;
1850  yyerrstatus = 0;
1851  yynerrs = 0;
1852  yychar = YYEMPTY;             /* Cause a token to be read.  */
1853
1854  /* Initialize stack pointers.
1855     Waste one element of value and location stack
1856     so that they stay on the same level as the state stack.
1857     The wasted elements are never initialized.  */
1858
1859  yyssp = yyss;
1860  yyvsp = yyvs;
1861
1862
1863  goto yysetstate;
1864
1865/*------------------------------------------------------------.
1866| yynewstate -- Push a new state, which is found in yystate.  |
1867`------------------------------------------------------------*/
1868 yynewstate:
1869  /* In all cases, when you get here, the value and location stacks
1870     have just been pushed. so pushing a state here evens the stacks.
1871     */
1872  yyssp++;
1873
1874 yysetstate:
1875  *yyssp = yystate;
1876
1877  if (yyss + yystacksize - 1 <= yyssp)
1878    {
1879      /* Get the current used size of the three stacks, in elements.  */
1880      YYSIZE_T yysize = yyssp - yyss + 1;
1881
1882#ifdef yyoverflow
1883      {
1884        /* Give user a chance to reallocate the stack. Use copies of
1885           these so that the &'s don't force the real ones into
1886           memory.  */
1887        YYSTYPE *yyvs1 = yyvs;
1888        short int *yyss1 = yyss;
1889
1890
1891        /* Each stack pointer address is followed by the size of the
1892           data in use in that stack, in bytes.  This used to be a
1893           conditional around just the two extra args, but that might
1894           be undefined if yyoverflow is a macro.  */
1895        yyoverflow ("parser stack overflow",
1896                    &yyss1, yysize * sizeof (*yyssp),
1897                    &yyvs1, yysize * sizeof (*yyvsp),
1898
1899                    &yystacksize);
1900
1901        yyss = yyss1;
1902        yyvs = yyvs1;
1903      }
1904#else /* no yyoverflow */
1905# ifndef YYSTACK_RELOCATE
1906      goto yyoverflowlab;
1907# else
1908      /* Extend the stack our own way.  */
1909      if (YYMAXDEPTH <= yystacksize)
1910        goto yyoverflowlab;
1911      yystacksize *= 2;
1912      if (YYMAXDEPTH < yystacksize)
1913        yystacksize = YYMAXDEPTH;
1914
1915      {
1916        short int *yyss1 = yyss;
1917        union yyalloc *yyptr =
1918          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1919        if (! yyptr)
1920          goto yyoverflowlab;
1921        YYSTACK_RELOCATE (yyss);
1922        YYSTACK_RELOCATE (yyvs);
1923
1924#  undef YYSTACK_RELOCATE
1925        if (yyss1 != yyssa)
1926          YYSTACK_FREE (yyss1);
1927      }
1928# endif
1929#endif /* no yyoverflow */
1930
1931      yyssp = yyss + yysize - 1;
1932      yyvsp = yyvs + yysize - 1;
1933
1934
1935      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1936                  (unsigned long int) yystacksize));
1937
1938      if (yyss + yystacksize - 1 <= yyssp)
1939        YYABORT;
1940    }
1941
1942  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1943
1944  goto yybackup;
1945
1946/*-----------.
1947| yybackup.  |
1948`-----------*/
1949yybackup:
1950
1951/* Do appropriate processing given the current state.  */
1952/* Read a lookahead token if we need one and don't already have one.  */
1953/* yyresume: */
1954
1955  /* First try to decide what to do without reference to lookahead token.  */
1956
1957  yyn = yypact[yystate];
1958  if (yyn == YYPACT_NINF)
1959    goto yydefault;
1960
1961  /* Not known => get a lookahead token if don't already have one.  */
1962
1963  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1964  if (yychar == YYEMPTY)
1965    {
1966      YYDPRINTF ((stderr, "Reading a token: "));
1967      yychar = YYLEX;
1968    }
1969
1970  if (yychar <= YYEOF)
1971    {
1972      yychar = yytoken = YYEOF;
1973      YYDPRINTF ((stderr, "Now at end of input.\n"));
1974    }
1975  else
1976    {
1977      yytoken = YYTRANSLATE (yychar);
1978      YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
1979    }
1980
1981  /* If the proper action on seeing token YYTOKEN is to reduce or to
1982     detect an error, take that action.  */
1983  yyn += yytoken;
1984  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1985    goto yydefault;
1986  yyn = yytable[yyn];
1987  if (yyn <= 0)
1988    {
1989      if (yyn == 0 || yyn == YYTABLE_NINF)
1990        goto yyerrlab;
1991      yyn = -yyn;
1992      goto yyreduce;
1993    }
1994
1995  if (yyn == YYFINAL)
1996    YYACCEPT;
1997
1998  /* Shift the lookahead token.  */
1999  YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
2000
2001  /* Discard the token being shifted unless it is eof.  */
2002  if (yychar != YYEOF)
2003    yychar = YYEMPTY;
2004
2005  *++yyvsp = yylval;
2006
2007
2008  /* Count tokens shifted since error; after three, turn off error
2009     status.  */
2010  if (yyerrstatus)
2011    yyerrstatus--;
2012
2013  yystate = yyn;
2014  goto yynewstate;
2015
2016
2017/*-----------------------------------------------------------.
2018| yydefault -- do the default action for the current state.  |
2019`-----------------------------------------------------------*/
2020yydefault:
2021  yyn = yydefact[yystate];
2022  if (yyn == 0)
2023    goto yyerrlab;
2024  goto yyreduce;
2025
2026
2027/*-----------------------------.
2028| yyreduce -- Do a reduction.  |
2029`-----------------------------*/
2030yyreduce:
2031  /* yyn is the number of a rule to reduce with.  */
2032  yylen = yyr2[yyn];
2033
2034  /* If YYLEN is nonzero, implement the default value of the action:
2035     `$$ = $1'.
2036
2037     Otherwise, the following line sets YYVAL to garbage.
2038     This behavior is undocumented and Bison
2039     users should not rely upon it.  Assigning to YYVAL
2040     unconditionally makes the parser a bit smaller, and it avoids a
2041     GCC warning that YYVAL may be used uninitialized.  */
2042  yyval = yyvsp[1-yylen];
2043
2044
2045  YY_REDUCE_PRINT (yyn);
2046  switch (yyn)
2047    {
2048        case 3:
2049#line 367 "grammar.y"
2050    {
2051            if (timerv)
2052            {
2053              writeTime("used time:");
2054              startTimer();
2055            }
2056            if (rtimerv)
2057            {
2058              writeRTime("used real time:");
2059              startRTimer();
2060            }
2061            prompt_char = '>';
2062#ifdef HAVE_SDB
2063            if (sdb_flags & 2) { sdb_flags=1; YYERROR; }
2064#endif
2065            if(siCntrlc)
2066            {
2067              WerrorS("abort...");
2068              while((currentVoice!=NULL) && (currentVoice->prev!=NULL)) exitVoice();
2069              if (currentVoice!=NULL) currentVoice->ifsw=0;
2070            }
2071            if (errorreported) /* also catches abort... */
2072            {
2073              yyerror("");
2074            }
2075            if (inerror==2) PrintLn();
2076            errorreported = inerror = cmdtok = 0;
2077            lastreserved = currid = NULL;
2078            expected_parms = siCntrlc = FALSE;
2079          ;}
2080    break;
2081
2082  case 5:
2083#line 402 "grammar.y"
2084    {currentVoice->ifsw=0;;}
2085    break;
2086
2087  case 6:
2088#line 404 "grammar.y"
2089    { yyvsp[-1].lv.CleanUp(); currentVoice->ifsw=0;;}
2090    break;
2091
2092  case 7:
2093#line 406 "grammar.y"
2094    {
2095            YYACCEPT;
2096          ;}
2097    break;
2098
2099  case 8:
2100#line 410 "grammar.y"
2101    {
2102            currentVoice->ifsw=0;
2103            iiDebug();
2104          ;}
2105    break;
2106
2107  case 9:
2108#line 415 "grammar.y"
2109    {currentVoice->ifsw=0;;}
2110    break;
2111
2112  case 10:
2113#line 417 "grammar.y"
2114    {
2115            #ifdef SIQ
2116            siq=0;
2117            #endif
2118            yyInRingConstruction = FALSE;
2119            currentVoice->ifsw=0;
2120            if (inerror)
2121            {
2122/*  bison failed here*/
2123              if ((inerror!=3) && (yyvsp[-1].i<UMINUS) && (yyvsp[-1].i>' '))
2124              {
2125                // 1: yyerror called
2126                // 2: scanner put actual string
2127                // 3: error rule put token+\n
2128                inerror=3;
2129                Print(" error at token `%s`\n",iiTwoOps(yyvsp[-1].i));
2130              }
2131/**/
2132
2133            }
2134            if (!errorreported) WerrorS("...parse error");
2135            yyerror("");
2136            yyerrok;
2137#ifdef HAVE_SDB
2138            if ((sdb_flags & 1) && currentVoice->pi!=NULL)
2139            {
2140              currentVoice->pi->trace_flag |=1;
2141            }
2142            else
2143#endif
2144            if (myynest>0)
2145            {
2146              feBufferTypes t=currentVoice->Typ();
2147              //PrintS("leaving yyparse\n");
2148              exitBuffer(BT_proc);
2149              if (t==BT_example)
2150                YYACCEPT;
2151              else
2152                YYABORT;
2153            }
2154            else if (currentVoice->prev!=NULL)
2155            {
2156              exitVoice();
2157            }
2158#ifdef HAVE_SDB
2159            if (sdb_flags &2) sdb_flags=1;
2160#endif
2161          ;}
2162    break;
2163
2164  case 18:
2165#line 475 "grammar.y"
2166    {if (currentVoice!=NULL) currentVoice->ifsw=0;;}
2167    break;
2168
2169  case 19:
2170#line 478 "grammar.y"
2171    { omFree((ADDRESS)yyvsp[0].name); ;}
2172    break;
2173
2174  case 29:
2175#line 493 "grammar.y"
2176    {
2177            if(iiAssign(&yyvsp[-1].lv,&yyvsp[0].lv)) YYERROR;
2178          ;}
2179    break;
2180
2181  case 30:
2182#line 500 "grammar.y"
2183    {
2184            if (currRing==NULL) MYYERROR("no ring active");
2185            syMake(&yyval.lv,omStrDup(yyvsp[0].name));
2186          ;}
2187    break;
2188
2189  case 31:
2190#line 505 "grammar.y"
2191    {
2192            syMake(&yyval.lv,yyvsp[0].name);
2193          ;}
2194    break;
2195
2196  case 32:
2197#line 509 "grammar.y"
2198    {
2199            if(iiExprArith2(&yyval.lv, &yyvsp[-2].lv, COLONCOLON, &yyvsp[0].lv)) YYERROR;
2200          ;}
2201    break;
2202
2203  case 33:
2204#line 513 "grammar.y"
2205    {
2206            if(iiExprArith2(&yyval.lv, &yyvsp[-2].lv, '.', &yyvsp[0].lv)) YYERROR;
2207          ;}
2208    break;
2209
2210  case 34:
2211#line 517 "grammar.y"
2212    {
2213            if(iiExprArith1(&yyval.lv,&yyvsp[-2].lv,'(')) YYERROR;
2214          ;}
2215    break;
2216
2217  case 35:
2218#line 521 "grammar.y"
2219    {
2220            if (yyvsp[-3].lv.rtyp==UNKNOWN)
2221            { // for x(i)(j)
2222              if(iiExprArith2(&yyval.lv,&yyvsp[-3].lv,'(',&yyvsp[-1].lv)) YYERROR;
2223            }
2224            else
2225            {
2226              yyvsp[-3].lv.next=(leftv)omAllocBin(sleftv_bin);
2227              memcpy(yyvsp[-3].lv.next,&yyvsp[-1].lv,sizeof(sleftv));
2228              if(iiExprArithM(&yyval.lv,&yyvsp[-3].lv,'(')) YYERROR;
2229            }
2230          ;}
2231    break;
2232
2233  case 36:
2234#line 534 "grammar.y"
2235    {
2236            if (currRingHdl==NULL) MYYERROR("no ring active");
2237            int j = 0;
2238            memset(&yyval.lv,0,sizeof(sleftv));
2239            yyval.lv.rtyp=VECTOR_CMD;
2240            leftv v = &yyvsp[-1].lv;
2241            while (v!=NULL)
2242            {
2243              int i,t;
2244              sleftv tmp;
2245              memset(&tmp,0,sizeof(tmp));
2246              i=iiTestConvert((t=v->Typ()),POLY_CMD);
2247              if((i==0) || (iiConvert(t /*v->Typ()*/,POLY_CMD,i,v,&tmp)))
2248              {
2249                pDelete((poly *)&yyval.lv.data);
2250                yyvsp[-1].lv.CleanUp();
2251                MYYERROR("expected '[poly,...'");
2252              }
2253              poly p = (poly)tmp.CopyD(POLY_CMD);
2254              pSetCompP(p,++j);
2255              yyval.lv.data = (void *)pAdd((poly)yyval.lv.data,p);
2256              v->next=tmp.next;tmp.next=NULL;
2257              tmp.CleanUp();
2258              v=v->next;
2259            }
2260            yyvsp[-1].lv.CleanUp();
2261          ;}
2262    break;
2263
2264  case 37:
2265#line 562 "grammar.y"
2266    {
2267            memset(&yyval.lv,0,sizeof(yyval.lv));
2268            int i = atoi(yyvsp[0].name);
2269            /*remember not to omFree($1)
2270            *because it is a part of the scanner buffer*/
2271            yyval.lv.rtyp  = INT_CMD;
2272            yyval.lv.data = (void *)(long)i;
2273
2274            /* check: out of range input */
2275            int l = strlen(yyvsp[0].name)+2;
2276            number n;
2277            if (l >= MAX_INT_LEN)
2278            {
2279              char tmp[MAX_INT_LEN+5];
2280              sprintf(tmp,"%d",i);
2281              if (strcmp(tmp,yyvsp[0].name)!=0)
2282              {
2283                n_Read(yyvsp[0].name,&n,coeffs_BIGINT);
2284                yyval.lv.rtyp=BIGINT_CMD;
2285                yyval.lv.data = n;
2286              }
2287            }
2288          ;}
2289    break;
2290
2291  case 38:
2292#line 586 "grammar.y"
2293    {
2294            memset(&yyval.lv,0,sizeof(yyval.lv));
2295            yyval.lv.rtyp = yyvsp[0].i;
2296            yyval.lv.data = yyval.lv.Data();
2297          ;}
2298    break;
2299
2300  case 39:
2301#line 592 "grammar.y"
2302    {
2303            memset(&yyval.lv,0,sizeof(yyval.lv));
2304            yyval.lv.rtyp  = STRING_CMD;
2305            yyval.lv.data = yyvsp[0].name;
2306          ;}
2307    break;
2308
2309  case 40:
2310#line 598 "grammar.y"
2311    {
2312            if(iiExprArith1(&yyval.lv,&yyvsp[-1].lv,yyvsp[-3].i)) YYERROR;
2313          ;}
2314    break;
2315
2316  case 41:
2317#line 605 "grammar.y"
2318    {
2319            leftv v = &yyvsp[-2].lv;
2320            while (v->next!=NULL)
2321            {
2322              v=v->next;
2323            }
2324            v->next = (leftv)omAllocBin(sleftv_bin);
2325            memcpy(v->next,&(yyvsp[0].lv),sizeof(sleftv));
2326            yyval.lv = yyvsp[-2].lv;
2327          ;}
2328    break;
2329
2330  case 42:
2331#line 616 "grammar.y"
2332    {
2333            yyval.lv = yyvsp[0].lv;
2334          ;}
2335    break;
2336
2337  case 43:
2338#line 622 "grammar.y"
2339    {
2340            /*if ($1.typ == eunknown) YYERROR;*/
2341            yyval.lv = yyvsp[0].lv;
2342          ;}
2343    break;
2344
2345  case 44:
2346#line 626 "grammar.y"
2347    { yyval.lv = yyvsp[0].lv; ;}
2348    break;
2349
2350  case 45:
2351#line 627 "grammar.y"
2352    { yyval.lv = yyvsp[-1].lv; ;}
2353    break;
2354
2355  case 46:
2356#line 629 "grammar.y"
2357    {
2358            if(iiExprArith3(&yyval.lv,'[',&yyvsp[-5].lv,&yyvsp[-3].lv,&yyvsp[-1].lv)) YYERROR;
2359          ;}
2360    break;
2361
2362  case 47:
2363#line 633 "grammar.y"
2364    {
2365            if(iiExprArith2(&yyval.lv,&yyvsp[-3].lv,'[',&yyvsp[-1].lv)) YYERROR;
2366          ;}
2367    break;
2368
2369  case 48:
2370#line 637 "grammar.y"
2371    {
2372            if(iiExprArith1(&yyval.lv,&yyvsp[-1].lv,yyvsp[-3].i)) YYERROR;
2373          ;}
2374    break;
2375
2376  case 49:
2377#line 641 "grammar.y"
2378    {
2379            if(iiExprArithM(&yyval.lv,&yyvsp[-1].lv,yyvsp[-3].i)) YYERROR;
2380          ;}
2381    break;
2382
2383  case 50:
2384#line 645 "grammar.y"
2385    {
2386            if(iiExprArithM(&yyval.lv,NULL,yyvsp[-2].i)) YYERROR;
2387          ;}
2388    break;
2389
2390  case 51:
2391#line 649 "grammar.y"
2392    {
2393            if(iiExprArith1(&yyval.lv,&yyvsp[-1].lv,yyvsp[-3].i)) YYERROR;
2394          ;}
2395    break;
2396
2397  case 52:
2398#line 653 "grammar.y"
2399    {
2400            if(iiExprArithM(&yyval.lv,&yyvsp[-1].lv,yyvsp[-3].i)) YYERROR;
2401          ;}
2402    break;
2403
2404  case 53:
2405#line 657 "grammar.y"
2406    {
2407            if(iiExprArithM(&yyval.lv,NULL,yyvsp[-2].i)) YYERROR;
2408          ;}
2409    break;
2410
2411  case 54:
2412#line 661 "grammar.y"
2413    {
2414            if(iiExprArith1(&yyval.lv,&yyvsp[-1].lv,yyvsp[-3].i)) YYERROR;
2415          ;}
2416    break;
2417
2418  case 55:
2419#line 665 "grammar.y"
2420    {
2421            if(iiExprArith2(&yyval.lv,&yyvsp[-3].lv,yyvsp[-5].i,&yyvsp[-1].lv,TRUE)) YYERROR;
2422          ;}
2423    break;
2424
2425  case 56:
2426#line 669 "grammar.y"
2427    {
2428            if(iiExprArith3(&yyval.lv,yyvsp[-7].i,&yyvsp[-5].lv,&yyvsp[-3].lv,&yyvsp[-1].lv)) YYERROR;
2429          ;}
2430    break;
2431
2432  case 57:
2433#line 673 "grammar.y"
2434    {
2435            if(iiExprArith2(&yyval.lv,&yyvsp[-3].lv,yyvsp[-5].i,&yyvsp[-1].lv,TRUE)) YYERROR;
2436          ;}
2437    break;
2438
2439  case 58:
2440#line 677 "grammar.y"
2441    {
2442            if(iiExprArith3(&yyval.lv,yyvsp[-7].i,&yyvsp[-5].lv,&yyvsp[-3].lv,&yyvsp[-1].lv)) YYERROR;
2443          ;}
2444    break;
2445
2446  case 59:
2447#line 681 "grammar.y"
2448    {
2449            if(iiExprArith1(&yyval.lv,&yyvsp[-1].lv,yyvsp[-3].i)) YYERROR;
2450          ;}
2451    break;
2452
2453  case 60:
2454#line 685 "grammar.y"
2455    {
2456            if(iiExprArith1(&yyval.lv,&yyvsp[-1].lv,yyvsp[-3].i)) YYERROR;
2457          ;}
2458    break;
2459
2460  case 61:
2461#line 689 "grammar.y"
2462    {
2463            if(iiExprArith2(&yyval.lv,&yyvsp[-3].lv,yyvsp[-5].i,&yyvsp[-1].lv,TRUE)) YYERROR;
2464          ;}
2465    break;
2466
2467  case 62:
2468#line 693 "grammar.y"
2469    {
2470            if(iiExprArith1(&yyval.lv,&yyvsp[-1].lv,yyvsp[-3].i)) YYERROR;
2471          ;}
2472    break;
2473
2474  case 63:
2475#line 697 "grammar.y"
2476    {
2477            if(iiExprArith2(&yyval.lv,&yyvsp[-3].lv,yyvsp[-5].i,&yyvsp[-1].lv,TRUE)) YYERROR;
2478          ;}
2479    break;
2480
2481  case 64:
2482#line 701 "grammar.y"
2483    {
2484            if(iiExprArith3(&yyval.lv,yyvsp[-7].i,&yyvsp[-5].lv,&yyvsp[-3].lv,&yyvsp[-1].lv)) YYERROR;
2485          ;}
2486    break;
2487
2488  case 65:
2489#line 705 "grammar.y"
2490    {
2491            if(iiExprArith3(&yyval.lv,yyvsp[-7].i,&yyvsp[-5].lv,&yyvsp[-3].lv,&yyvsp[-1].lv)) YYERROR;
2492          ;}
2493    break;
2494
2495  case 66:
2496#line 709 "grammar.y"
2497    {
2498            if(iiExprArithM(&yyval.lv,NULL,yyvsp[-2].i)) YYERROR;
2499          ;}
2500    break;
2501
2502  case 67:
2503#line 713 "grammar.y"
2504    {
2505            if(iiExprArithM(&yyval.lv,&yyvsp[-1].lv,yyvsp[-3].i)) YYERROR;
2506          ;}
2507    break;
2508
2509  case 68:
2510#line 717 "grammar.y"
2511    {
2512            if(iiExprArith3(&yyval.lv,yyvsp[-7].i,&yyvsp[-5].lv,&yyvsp[-3].lv,&yyvsp[-1].lv)) YYERROR;
2513          ;}
2514    break;
2515
2516  case 69:
2517#line 721 "grammar.y"
2518    {
2519            if(iiExprArith1(&yyval.lv,&yyvsp[-1].lv,yyvsp[-3].i)) YYERROR;
2520          ;}
2521    break;
2522
2523  case 70:
2524#line 725 "grammar.y"
2525    {
2526            if(iiExprArith3(&yyval.lv,RING_CMD,&yyvsp[-5].lv,&yyvsp[-3].lv,&yyvsp[-1].lv)) YYERROR;
2527          ;}
2528    break;
2529
2530  case 71:
2531#line 729 "grammar.y"
2532    {
2533            if(iiExprArith1(&yyval.lv,&yyvsp[-1].lv,RING_CMD)) YYERROR;
2534          ;}
2535    break;
2536
2537  case 72:
2538#line 733 "grammar.y"
2539    {
2540            yyval.lv=yyvsp[-1].lv;
2541          ;}
2542    break;
2543
2544  case 73:
2545#line 737 "grammar.y"
2546    {
2547            #ifdef SIQ
2548            siq++;
2549            if (siq>0)
2550            { if (iiExprArith2(&yyval.lv,&yyvsp[-3].lv,'=',&yyvsp[-1].lv)) YYERROR; }
2551            else
2552            #endif
2553            {
2554              memset(&yyval.lv,0,sizeof(yyval.lv));
2555              yyval.lv.rtyp=NONE;
2556              if (iiAssign(&yyvsp[-3].lv,&yyvsp[-1].lv)) YYERROR;
2557            }
2558            #ifdef SIQ
2559            siq--;
2560            #endif
2561          ;}
2562    break;
2563
2564  case 74:
2565#line 754 "grammar.y"
2566    {
2567            #ifdef SIQ
2568            siq--;
2569            #endif
2570          ;}
2571    break;
2572
2573  case 75:
2574#line 760 "grammar.y"
2575    {
2576            #ifdef SIQ
2577            if (siq<=0) yyvsp[-1].lv.Eval();
2578            #endif
2579            yyval.lv=yyvsp[-1].lv;
2580            #ifdef SIQ
2581            siq++;
2582            #endif
2583          ;}
2584    break;
2585
2586  case 76:
2587#line 772 "grammar.y"
2588    {
2589            #ifdef SIQ
2590            siq++;
2591            #endif
2592          ;}
2593    break;
2594
2595  case 77:
2596#line 780 "grammar.y"
2597    {
2598            #ifdef SIQ
2599            siq--;
2600            #endif
2601          ;}
2602    break;
2603
2604  case 78:
2605#line 789 "grammar.y"
2606    {
2607            if(iiExprArith1(&yyval.lv,&yyvsp[-1].lv,PLUSPLUS)) YYERROR;
2608          ;}
2609    break;
2610
2611  case 79:
2612#line 793 "grammar.y"
2613    {
2614            if(iiExprArith1(&yyval.lv,&yyvsp[-1].lv,MINUSMINUS)) YYERROR;
2615          ;}
2616    break;
2617
2618  case 80:
2619#line 797 "grammar.y"
2620    {
2621            if(iiExprArith2(&yyval.lv,&yyvsp[-2].lv,'+',&yyvsp[0].lv)) YYERROR;
2622          ;}
2623    break;
2624
2625  case 81:
2626#line 801 "grammar.y"
2627    {
2628            if(iiExprArith2(&yyval.lv,&yyvsp[-2].lv,'-',&yyvsp[0].lv)) YYERROR;
2629          ;}
2630    break;
2631
2632  case 82:
2633#line 805 "grammar.y"
2634    {
2635            if(iiExprArith2(&yyval.lv,&yyvsp[-2].lv,yyvsp[-1].i,&yyvsp[0].lv)) YYERROR;
2636          ;}
2637    break;
2638
2639  case 83:
2640#line 809 "grammar.y"
2641    {
2642            if(iiExprArith2(&yyval.lv,&yyvsp[-2].lv,'^',&yyvsp[0].lv)) YYERROR;
2643          ;}
2644    break;
2645
2646  case 84:
2647#line 813 "grammar.y"
2648    {
2649            if(iiExprArith2(&yyval.lv,&yyvsp[-2].lv,yyvsp[-1].i,&yyvsp[0].lv)) YYERROR;
2650          ;}
2651    break;
2652
2653  case 85:
2654#line 817 "grammar.y"
2655    {
2656            if(iiExprArith2(&yyval.lv,&yyvsp[-2].lv,yyvsp[-1].i,&yyvsp[0].lv)) YYERROR;
2657          ;}
2658    break;
2659
2660  case 86:
2661#line 821 "grammar.y"
2662    {
2663            if(iiExprArith2(&yyval.lv,&yyvsp[-2].lv,NOTEQUAL,&yyvsp[0].lv)) YYERROR;
2664          ;}
2665    break;
2666
2667  case 87:
2668#line 825 "grammar.y"
2669    {
2670            if(iiExprArith2(&yyval.lv,&yyvsp[-2].lv,EQUAL_EQUAL,&yyvsp[0].lv)) YYERROR;
2671          ;}
2672    break;
2673
2674  case 88:
2675#line 829 "grammar.y"
2676    {
2677            if(iiExprArith2(&yyval.lv,&yyvsp[-2].lv,DOTDOT,&yyvsp[0].lv)) YYERROR;
2678          ;}
2679    break;
2680
2681  case 89:
2682#line 833 "grammar.y"
2683    {
2684            if(iiExprArith2(&yyval.lv,&yyvsp[-2].lv,':',&yyvsp[0].lv)) YYERROR;
2685          ;}
2686    break;
2687
2688  case 90:
2689#line 837 "grammar.y"
2690    {
2691            memset(&yyval.lv,0,sizeof(yyval.lv));
2692            int i; TESTSETINT(yyvsp[0].lv,i);
2693            yyval.lv.rtyp  = INT_CMD;
2694            yyval.lv.data = (void *)(long)(i == 0 ? 1 : 0);
2695          ;}
2696    break;
2697
2698  case 91:
2699#line 844 "grammar.y"
2700    {
2701            if(iiExprArith1(&yyval.lv,&yyvsp[0].lv,'-')) YYERROR;
2702          ;}
2703    break;
2704
2705  case 92:
2706#line 850 "grammar.y"
2707    { yyval.lv = yyvsp[-1].lv; ;}
2708    break;
2709
2710  case 93:
2711#line 852 "grammar.y"
2712    {
2713            if (yyvsp[-1].lv.rtyp==0)
2714            {
2715              Werror("`%s` is undefined",yyvsp[-1].lv.Fullname());
2716              YYERROR;
2717            }
2718            else if ((yyvsp[-1].lv.rtyp==MODUL_CMD)
2719            // matrix m; m[2]=...
2720            && (yyvsp[-1].lv.e!=NULL) && (yyvsp[-1].lv.e->next==NULL))
2721            {
2722              MYYERROR("matrix must have 2 indices");
2723            }
2724            yyval.lv = yyvsp[-1].lv;
2725          ;}
2726    break;
2727
2728  case 95:
2729#line 872 "grammar.y"
2730    {
2731            if (yyvsp[-1].lv.Typ()!=STRING_CMD)
2732            {
2733              MYYERROR("string expression expected");
2734            }
2735            yyval.name = (char *)yyvsp[-1].lv.CopyD(STRING_CMD);
2736            yyvsp[-1].lv.CleanUp();
2737          ;}
2738    break;
2739
2740  case 96:
2741#line 884 "grammar.y"
2742    {
2743            if (iiDeclCommand(&yyval.lv,&yyvsp[0].lv,myynest,yyvsp[-1].i,&(yyvsp[0].lv.req_packhdl->idroot)))
2744              YYERROR;
2745          ;}
2746    break;
2747
2748  case 97:
2749#line 889 "grammar.y"
2750    {
2751            if (iiDeclCommand(&yyval.lv,&yyvsp[0].lv,myynest,yyvsp[-1].i,&(yyvsp[0].lv.req_packhdl->idroot)))
2752              YYERROR;
2753          ;}
2754    break;
2755
2756  case 98:
2757#line 894 "grammar.y"
2758    {
2759            if (iiDeclCommand(&yyval.lv,&yyvsp[0].lv,myynest,yyvsp[-1].i,&(currRing->idroot), TRUE)) YYERROR;
2760          ;}
2761    break;
2762
2763  case 99:
2764#line 898 "grammar.y"
2765    {
2766            if (iiDeclCommand(&yyval.lv,&yyvsp[0].lv,myynest,yyvsp[-1].i,&(currRing->idroot), TRUE)) YYERROR;
2767          ;}
2768    break;
2769
2770  case 100:
2771#line 902 "grammar.y"
2772    {
2773            int r; TESTSETINT(yyvsp[-4].lv,r);
2774            int c; TESTSETINT(yyvsp[-1].lv,c);
2775            if (r < 1)
2776              MYYERROR("rows must be greater than 0");
2777            if (c < 0)
2778              MYYERROR("cols must be greater than -1");
2779            leftv v;
2780            idhdl h;
2781            if (yyvsp[-7].i == MATRIX_CMD)
2782            {
2783              if (iiDeclCommand(&yyval.lv,&yyvsp[-6].lv,myynest,yyvsp[-7].i,&(currRing->idroot), TRUE)) YYERROR;
2784              v=&yyval.lv;
2785              h=(idhdl)v->data;
2786              idDelete(&IDIDEAL(h));
2787              IDMATRIX(h) = mpNew(r,c);
2788              if (IDMATRIX(h)==NULL) YYERROR;
2789            }
2790            else if (yyvsp[-7].i == INTMAT_CMD)
2791            {
2792              if (iiDeclCommand(&yyval.lv,&yyvsp[-6].lv,myynest,yyvsp[-7].i,&(yyvsp[-6].lv.req_packhdl->idroot)))
2793                YYERROR;
2794              v=&yyval.lv;
2795              h=(idhdl)v->data;
2796              delete IDINTVEC(h);
2797              IDINTVEC(h) = new intvec(r,c,0);
2798              if (IDINTVEC(h)==NULL) YYERROR;
2799            }
2800            else /* BIGINTMAT_CMD */
2801            {
2802              if (iiDeclCommand(&yyval.lv,&yyvsp[-6].lv,myynest,yyvsp[-7].i,&(yyvsp[-6].lv.req_packhdl->idroot)))
2803                YYERROR;
2804              v=&yyval.lv;
2805              h=(idhdl)v->data;
2806              delete IDBIMAT(h);
2807              IDBIMAT(h) = new bigintmat(r, c, coeffs_BIGINT);
2808              if (IDBIMAT(h)==NULL) YYERROR;
2809            }
2810          ;}
2811    break;
2812
2813  case 101:
2814#line 942 "grammar.y"
2815    {
2816            if (yyvsp[-1].i == MATRIX_CMD)
2817            {
2818              if (iiDeclCommand(&yyval.lv,&yyvsp[0].lv,myynest,yyvsp[-1].i,&(currRing->idroot), TRUE)) YYERROR;
2819            }
2820            else if (yyvsp[-1].i == INTMAT_CMD)
2821            {
2822              if (iiDeclCommand(&yyval.lv,&yyvsp[0].lv,myynest,yyvsp[-1].i,&(yyvsp[0].lv.req_packhdl->idroot)))
2823                YYERROR;
2824              leftv v=&yyval.lv;
2825              idhdl h;
2826              do
2827              {
2828                 h=(idhdl)v->data;
2829                 delete IDINTVEC(h);
2830                 IDINTVEC(h) = new intvec(1,1,0);
2831                 v=v->next;
2832              } while (v!=NULL);
2833            }
2834            else /* BIGINTMAT_CMD */
2835            {
2836              if (iiDeclCommand(&yyval.lv,&yyvsp[0].lv,myynest,yyvsp[-1].i,&(yyvsp[0].lv.req_packhdl->idroot)))
2837                YYERROR;
2838            }
2839          ;}
2840    break;
2841
2842  case 102:
2843#line 968 "grammar.y"
2844    {
2845            int t=yyvsp[-2].lv.Typ();
2846            sleftv r;
2847            memset(&r,0,sizeof(sleftv));
2848            if ((BEGIN_RING<t) && (t<END_RING))
2849            {
2850              if (iiDeclCommand(&r,&yyvsp[0].lv,myynest,t,&(currRing->idroot), TRUE))
2851                YYERROR;
2852            }
2853            else
2854            {
2855              if (iiDeclCommand(&r,&yyvsp[0].lv,myynest,t,&(yyvsp[0].lv.req_packhdl->idroot)))
2856                YYERROR;
2857            }
2858            leftv v=&yyvsp[-2].lv;
2859            while (v->next!=NULL) v=v->next;
2860            v->next=(leftv)omAllocBin(sleftv_bin);
2861            memcpy(v->next,&r,sizeof(sleftv));
2862            yyval.lv=yyvsp[-2].lv;
2863          ;}
2864    break;
2865
2866  case 103:
2867#line 989 "grammar.y"
2868    {
2869            if (iiDeclCommand(&yyval.lv,&yyvsp[0].lv,myynest,yyvsp[-1].i,&(yyvsp[0].lv.req_packhdl->idroot)))
2870              YYERROR;
2871          ;}
2872    break;
2873
2874  case 106:
2875#line 1002 "grammar.y"
2876    {
2877            leftv v = &yyvsp[-3].lv;
2878            while (v->next!=NULL)
2879            {
2880              v=v->next;
2881            }
2882            v->next = (leftv)omAllocBin(sleftv_bin);
2883            memcpy(v->next,&(yyvsp[-1].lv),sizeof(sleftv));
2884            yyval.lv = yyvsp[-3].lv;
2885          ;}
2886    break;
2887
2888  case 107:
2889#line 1016 "grammar.y"
2890    {
2891          // let rInit take care of any errors
2892          yyval.i=rOrderName(yyvsp[0].name);
2893        ;}
2894    break;
2895
2896  case 108:
2897#line 1024 "grammar.y"
2898    {
2899            memset(&yyval.lv,0,sizeof(yyval.lv));
2900            intvec *iv = new intvec(2);
2901            (*iv)[0] = 1;
2902            (*iv)[1] = yyvsp[0].i;
2903            yyval.lv.rtyp = INTVEC_CMD;
2904            yyval.lv.data = (void *)iv;
2905          ;}
2906    break;
2907
2908  case 109:
2909#line 1033 "grammar.y"
2910    {
2911            memset(&yyval.lv,0,sizeof(yyval.lv));
2912            leftv sl = &yyvsp[-1].lv;
2913            int slLength;
2914            {
2915              slLength =  exprlist_length(sl);
2916              int l = 2 +  slLength;
2917              intvec *iv = new intvec(l);
2918              (*iv)[0] = slLength;
2919              (*iv)[1] = yyvsp[-3].i;
2920
2921              int i = 2;
2922              while ((i<l) && (sl!=NULL))
2923              {
2924                if (sl->Typ() == INT_CMD)
2925                {
2926                  (*iv)[i++] = (int)((long)(sl->Data()));
2927                }
2928                else if ((sl->Typ() == INTVEC_CMD)
2929                ||(sl->Typ() == INTMAT_CMD))
2930                {
2931                  intvec *ivv = (intvec *)(sl->Data());
2932                  int ll = 0,l = ivv->length();
2933                  for (; l>0; l--)
2934                  {
2935                    (*iv)[i++] = (*ivv)[ll++];
2936                  }
2937                }
2938                else
2939                {
2940                  delete iv;
2941                  yyvsp[-1].lv.CleanUp();
2942                  MYYERROR("wrong type in ordering");
2943                }
2944                sl = sl->next;
2945              }
2946              yyval.lv.rtyp = INTVEC_CMD;
2947              yyval.lv.data = (void *)iv;
2948            }
2949            yyvsp[-1].lv.CleanUp();
2950          ;}
2951    break;
2952
2953  case 111:
2954#line 1079 "grammar.y"
2955    {
2956            yyval.lv = yyvsp[-2].lv;
2957            yyval.lv.next = (sleftv *)omAllocBin(sleftv_bin);
2958            memcpy(yyval.lv.next,&yyvsp[0].lv,sizeof(sleftv));
2959          ;}
2960    break;
2961
2962  case 113:
2963#line 1089 "grammar.y"
2964    {
2965            yyval.lv = yyvsp[-1].lv;
2966          ;}
2967    break;
2968
2969  case 114:
2970#line 1095 "grammar.y"
2971    {
2972            expected_parms = TRUE;
2973          ;}
2974    break;
2975
2976  case 115:
2977#line 1101 "grammar.y"
2978    { yyval.i = yyvsp[0].i; ;}
2979    break;
2980
2981  case 116:
2982#line 1103 "grammar.y"
2983    { yyval.i = yyvsp[0].i; ;}
2984    break;
2985
2986  case 117:
2987#line 1105 "grammar.y"
2988    { yyval.i = yyvsp[0].i; ;}
2989    break;
2990
2991  case 118:
2992#line 1114 "grammar.y"
2993    { if (yyvsp[-1].i != '<') YYERROR;
2994            if((feFilePending=feFopen(yyvsp[0].name,"r",NULL,TRUE))==NULL) YYERROR; ;}
2995    break;
2996
2997  case 119:
2998#line 1117 "grammar.y"
2999    { newFile(yyvsp[-2].name,feFilePending); ;}
3000    break;
3001
3002  case 120:
3003#line 1122 "grammar.y"
3004    {
3005            feHelp(yyvsp[-1].name);
3006            omFree((ADDRESS)yyvsp[-1].name);
3007          ;}
3008    break;
3009
3010  case 121:
3011#line 1127 "grammar.y"
3012    {
3013            feHelp(NULL);
3014          ;}
3015    break;
3016
3017  case 122:
3018#line 1134 "grammar.y"
3019    {
3020            singular_example(yyvsp[-1].name);
3021            omFree((ADDRESS)yyvsp[-1].name);
3022          ;}
3023    break;
3024
3025  case 123:
3026#line 1142 "grammar.y"
3027    {
3028          if (basePack!=yyvsp[0].lv.req_packhdl)
3029          {
3030            if(iiExport(&yyvsp[0].lv,0,currPackHdl)) YYERROR;
3031          }
3032          else
3033            if (iiExport(&yyvsp[0].lv,0)) YYERROR;
3034        ;}
3035    break;
3036
3037  case 124:
3038#line 1154 "grammar.y"
3039    {
3040          leftv v=&yyvsp[0].lv;
3041          if (v->rtyp!=IDHDL)
3042          {
3043            if (v->name!=NULL)
3044            {
3045               Werror("`%s` is undefined in kill",v->name);
3046            }
3047            else               WerrorS("kill what ?");
3048          }
3049          else
3050          {
3051            killhdl((idhdl)v->data,v->req_packhdl);
3052          }
3053        ;}
3054    break;
3055
3056  case 125:
3057#line 1170 "grammar.y"
3058    {
3059          leftv v=&yyvsp[0].lv;
3060          if (v->rtyp!=IDHDL)
3061          {
3062            if (v->name!=NULL)
3063            {
3064               Werror("`%s` is undefined in kill",v->name);
3065            }
3066            else               WerrorS("kill what ?");
3067          }
3068          else
3069          {
3070            killhdl((idhdl)v->data,v->req_packhdl);
3071          }
3072        ;}
3073    break;
3074
3075  case 126:
3076#line 1189 "grammar.y"
3077    {
3078            list_cmd(yyvsp[-1].i,NULL,"// ",TRUE);
3079          ;}
3080    break;
3081
3082  case 127:
3083#line 1193 "grammar.y"
3084    {
3085            list_cmd(yyvsp[-1].i,NULL,"// ",TRUE);
3086          ;}
3087    break;
3088
3089  case 128:
3090#line 1197 "grammar.y"
3091    {
3092            if (yyvsp[-1].i==QRING_CMD) yyvsp[-1].i=RING_CMD;
3093            list_cmd(yyvsp[-1].i,NULL,"// ",TRUE);
3094          ;}
3095    break;
3096
3097  case 129:
3098#line 1202 "grammar.y"
3099    {
3100            list_cmd(yyvsp[-1].i,NULL,"// ",TRUE);
3101          ;}
3102    break;
3103
3104  case 130:
3105#line 1206 "grammar.y"
3106    {
3107            list_cmd(RING_CMD,NULL,"// ",TRUE);
3108          ;}
3109    break;
3110
3111  case 131:
3112#line 1210 "grammar.y"
3113    {
3114            list_cmd(yyvsp[-1].i,NULL,"// ",TRUE);
3115           ;}
3116    break;
3117
3118  case 132:
3119#line 1214 "grammar.y"
3120    {
3121            list_cmd(PROC_CMD,NULL,"// ",TRUE);
3122          ;}
3123    break;
3124
3125  case 133:
3126#line 1218 "grammar.y"
3127    {
3128            list_cmd(0,yyvsp[-1].lv.Fullname(),"// ",TRUE);
3129            yyvsp[-1].lv.CleanUp();
3130          ;}
3131    break;
3132
3133  case 134:
3134#line 1223 "grammar.y"
3135    {
3136            if(yyvsp[-3].lv.Typ() == PACKAGE_CMD)
3137              list_cmd(yyvsp[-1].i,NULL,"// ",TRUE);
3138            yyvsp[-3].lv.CleanUp();
3139          ;}
3140    break;
3141
3142  case 135:
3143#line 1229 "grammar.y"
3144    {
3145            if(yyvsp[-3].lv.Typ() == PACKAGE_CMD)
3146              list_cmd(yyvsp[-1].i,NULL,"// ",TRUE);
3147            yyvsp[-3].lv.CleanUp();
3148          ;}
3149    break;
3150
3151  case 136:
3152#line 1235 "grammar.y"
3153    {
3154            if(yyvsp[-3].lv.Typ() == PACKAGE_CMD)
3155              list_cmd(yyvsp[-1].i,NULL,"// ",TRUE);
3156            yyvsp[-3].lv.CleanUp();
3157          ;}
3158    break;
3159
3160  case 137:
3161#line 1241 "grammar.y"
3162    {
3163            if(yyvsp[-3].lv.Typ() == PACKAGE_CMD)
3164              list_cmd(yyvsp[-1].i,NULL,"// ",TRUE);
3165            yyvsp[-3].lv.CleanUp();
3166          ;}
3167    break;
3168
3169  case 138:
3170#line 1247 "grammar.y"
3171    {
3172            if(yyvsp[-3].lv.Typ() == PACKAGE_CMD)
3173              list_cmd(yyvsp[-1].i,NULL,"// ",TRUE);
3174            yyvsp[-3].lv.CleanUp();
3175          ;}
3176    break;
3177
3178  case 139:
3179#line 1253 "grammar.y"
3180    {
3181            if(yyvsp[-3].lv.Typ() == PACKAGE_CMD)
3182              list_cmd(yyvsp[-1].i,NULL,"// ",TRUE);
3183            yyvsp[-3].lv.CleanUp();
3184          ;}
3185    break;
3186
3187  case 140:
3188#line 1259 "grammar.y"
3189    {
3190            if(yyvsp[-3].lv.Typ() == PACKAGE_CMD)
3191              list_cmd(yyvsp[-1].i,NULL,"// ",TRUE);
3192            yyvsp[-3].lv.CleanUp();
3193          ;}
3194    break;
3195
3196  case 141:
3197#line 1271 "grammar.y"
3198    {
3199            list_cmd(-1,NULL,"// ",TRUE);
3200          ;}
3201    break;
3202
3203  case 142:
3204#line 1277 "grammar.y"
3205    { yyInRingConstruction = TRUE; ;}
3206    break;
3207
3208  case 143:
3209#line 1286 "grammar.y"
3210    {
3211            const char *ring_name = yyvsp[-6].lv.name;
3212            ring b=
3213            rInit(&yyvsp[-4].lv,            /* characteristik and list of parameters*/
3214                  &yyvsp[-2].lv,            /* names of ringvariables */
3215                  &yyvsp[0].lv);            /* ordering */
3216            idhdl newRingHdl=NULL;
3217
3218            if (b!=NULL)
3219            {
3220              newRingHdl=enterid(ring_name, myynest, RING_CMD,
3221                                   &(yyvsp[-6].lv.req_packhdl->idroot),FALSE);
3222              yyvsp[-6].lv.CleanUp();
3223              if (newRingHdl!=NULL)
3224              {
3225                IDRING(newRingHdl)=b;
3226              }
3227              else
3228              {
3229                rKill(b);
3230              }
3231            }
3232            yyInRingConstruction = FALSE;
3233            if (newRingHdl==NULL)
3234            {
3235              MYYERROR("cannot make ring");
3236            }
3237            else
3238            {
3239              rSetHdl(newRingHdl);
3240            }
3241          ;}
3242    break;
3243
3244  case 144:
3245#line 1319 "grammar.y"
3246    {
3247            const char *ring_name = yyvsp[0].lv.name;
3248            if (!inerror) rDefault(ring_name);
3249            yyInRingConstruction = FALSE;
3250            yyvsp[0].lv.CleanUp();
3251          ;}
3252    break;
3253
3254  case 145:
3255#line 1329 "grammar.y"
3256    {
3257            if ((yyvsp[-1].i!=LIB_CMD)||(jjLOAD(yyvsp[0].name,TRUE))) YYERROR;
3258          ;}
3259    break;
3260
3261  case 148:
3262#line 1338 "grammar.y"
3263    {
3264            if ((yyvsp[-1].i==KEEPRING_CMD) && (myynest==0))
3265               MYYERROR("only inside a proc allowed");
3266            const char * n=yyvsp[0].lv.Name();
3267            if (((yyvsp[0].lv.Typ()==RING_CMD)||(yyvsp[0].lv.Typ()==QRING_CMD))
3268            && (yyvsp[0].lv.rtyp==IDHDL))
3269            {
3270              idhdl h=(idhdl)yyvsp[0].lv.data;
3271              if (yyvsp[0].lv.e!=NULL) h=rFindHdl((ring)yyvsp[0].lv.Data(),NULL, NULL);
3272              //Print("setring %s lev %d (ptr:%x)\n",IDID(h),IDLEV(h),IDRING(h));
3273              if (yyvsp[-1].i==KEEPRING_CMD)
3274              {
3275                if (h!=NULL)
3276                {
3277                  if (IDLEV(h)!=0)
3278                  {
3279                    if (iiExport(&yyvsp[0].lv,myynest-1)) YYERROR;
3280#if 1
3281                    idhdl p=IDRING(h)->idroot;
3282                    idhdl root=p;
3283                    int prevlev=myynest-1;
3284                    while (p!=NULL)
3285                    {
3286                      if (IDLEV(p)==myynest)
3287                      {
3288                        idhdl old=root->get(IDID(p),prevlev);
3289                        if (old!=NULL)
3290                        {
3291                          if (BVERBOSE(V_REDEFINE))
3292                            Warn("redefining %s",IDID(p));
3293                          killhdl2(old,&root,IDRING(h));
3294                          IDRING(h)->idroot=root;
3295                        }
3296                        IDLEV(p)=prevlev;
3297                      }
3298                      p=IDNEXT(p);
3299                    }
3300#endif
3301                  }
3302#ifdef USE_IILOCALRING
3303                  iiLocalRing[myynest-1]=IDRING(h);
3304#endif
3305                  procstack->cRing=IDRING(h);
3306                  procstack->cRingHdl=h;
3307                }
3308                else
3309                {
3310                  Werror("%s is no identifier",n);
3311                  yyvsp[0].lv.CleanUp();
3312                  YYERROR;
3313                }
3314              }
3315              if (h!=NULL) rSetHdl(h);
3316              else
3317              {
3318                Werror("cannot find the name of the basering %s",n);
3319                yyvsp[0].lv.CleanUp();
3320                YYERROR;
3321              }
3322              yyvsp[0].lv.CleanUp();
3323            }
3324            else
3325            {
3326              Werror("%s is no name of a ring/qring",n);
3327              yyvsp[0].lv.CleanUp();
3328              YYERROR;
3329            }
3330          ;}
3331    break;
3332
3333  case 149:
3334#line 1410 "grammar.y"
3335    {
3336            type_cmd(&(yyvsp[0].lv));
3337          ;}
3338    break;
3339
3340  case 150:
3341#line 1414 "grammar.y"
3342    {
3343            //Print("typ is %d, rtyp:%d\n",$1.Typ(),$1.rtyp);
3344            #ifdef SIQ
3345            if (yyvsp[0].lv.rtyp!=COMMAND)
3346            {
3347            #endif
3348              if (yyvsp[0].lv.Typ()==UNKNOWN)
3349              {
3350                if (yyvsp[0].lv.name!=NULL)
3351                {
3352                  Werror("`%s` is undefined",yyvsp[0].lv.name);
3353                  omFree((ADDRESS)yyvsp[0].lv.name);
3354                }
3355                YYERROR;
3356              }
3357            #ifdef SIQ
3358            }
3359            #endif
3360            yyvsp[0].lv.Print(&sLastPrinted);
3361            yyvsp[0].lv.CleanUp(currRing);
3362            if (errorreported) YYERROR;
3363          ;}
3364    break;
3365
3366  case 151:
3367#line 1443 "grammar.y"
3368    {
3369            int i; TESTSETINT(yyvsp[-2].lv,i);
3370            if (i!=0)
3371            {
3372              newBuffer( yyvsp[0].name, BT_if);
3373            }
3374            else
3375            {
3376              omFree((ADDRESS)yyvsp[0].name);
3377              currentVoice->ifsw=1;
3378            }
3379          ;}
3380    break;
3381
3382  case 152:
3383#line 1456 "grammar.y"
3384    {
3385            if (currentVoice->ifsw==1)
3386            {
3387              currentVoice->ifsw=0;
3388              newBuffer( yyvsp[0].name, BT_else);
3389            }
3390            else
3391            {
3392              if (currentVoice->ifsw!=2)
3393              {
3394                Warn("`else` without `if` in level %d",myynest);
3395              }
3396              omFree((ADDRESS)yyvsp[0].name);
3397            }
3398            currentVoice->ifsw=0;
3399          ;}
3400    break;
3401
3402  case 153:
3403#line 1473 "grammar.y"
3404    {
3405            int i; TESTSETINT(yyvsp[-2].lv,i);
3406            if (i)
3407            {
3408              if (exitBuffer(BT_break)) YYERROR;
3409            }
3410            currentVoice->ifsw=0;
3411          ;}
3412    break;
3413
3414  case 154:
3415#line 1482 "grammar.y"
3416    {
3417            if (exitBuffer(BT_break)) YYERROR;
3418            currentVoice->ifsw=0;
3419          ;}
3420    break;
3421
3422  case 155:
3423#line 1487 "grammar.y"
3424    {
3425            if (contBuffer(BT_break)) YYERROR;
3426            currentVoice->ifsw=0;
3427          ;}
3428    break;
3429
3430  case 156:
3431#line 1495 "grammar.y"
3432    {
3433            /* -> if(!$2) break; $3; continue;*/
3434            char * s = (char *)omAlloc( strlen(yyvsp[-1].name) + strlen(yyvsp[0].name) + 36);
3435            sprintf(s,"whileif (!(%s)) break;\n%scontinue;\n " ,yyvsp[-1].name,yyvsp[0].name);
3436            newBuffer(s,BT_break);
3437            omFree((ADDRESS)yyvsp[-1].name);
3438            omFree((ADDRESS)yyvsp[0].name);
3439          ;}
3440    break;
3441
3442  case 157:
3443#line 1507 "grammar.y"
3444    {
3445            /* $2 */
3446            /* if (!$3) break; $5; $4; continue; */
3447            char * s = (char *)omAlloc( strlen(yyvsp[-2].name)+strlen(yyvsp[-1].name)+strlen(yyvsp[0].name)+36);
3448            sprintf(s,"forif (!(%s)) break;\n%s%s;\ncontinue;\n "
3449                   ,yyvsp[-2].name,yyvsp[0].name,yyvsp[-1].name);
3450            omFree((ADDRESS)yyvsp[-2].name);
3451            omFree((ADDRESS)yyvsp[-1].name);
3452            omFree((ADDRESS)yyvsp[0].name);
3453            newBuffer(s,BT_break);
3454            s = (char *)omAlloc( strlen(yyvsp[-3].name) + 3);
3455            sprintf(s,"%s;\n",yyvsp[-3].name);
3456            omFree((ADDRESS)yyvsp[-3].name);
3457            newBuffer(s,BT_if);
3458          ;}
3459    break;
3460
3461  case 158:
3462#line 1526 "grammar.y"
3463    {
3464            idhdl h = enterid(yyvsp[-1].name,myynest,PROC_CMD,&IDROOT,TRUE);
3465            if (h==NULL) {omFree((ADDRESS)yyvsp[-1].name);omFree((ADDRESS)yyvsp[0].name); YYERROR;}
3466            iiInitSingularProcinfo(IDPROC(h),"", yyvsp[-1].name, 0, 0);
3467            IDPROC(h)->data.s.body = (char *)omAlloc(strlen(yyvsp[0].name)+31);;
3468            sprintf(IDPROC(h)->data.s.body,"parameter list #;\n%s;return();\n\n",yyvsp[0].name);
3469            omFree((ADDRESS)yyvsp[0].name);
3470            omFree((ADDRESS)yyvsp[-1].name);
3471          ;}
3472    break;
3473
3474  case 159:
3475#line 1536 "grammar.y"
3476    {
3477            idhdl h = enterid(yyvsp[-2].name,myynest,PROC_CMD,&IDROOT,TRUE);
3478            if (h==NULL)
3479            {
3480              omFree((ADDRESS)yyvsp[-2].name);
3481              omFree((ADDRESS)yyvsp[-1].name);
3482              omFree((ADDRESS)yyvsp[0].name);
3483              YYERROR;
3484            }
3485            char *args=iiProcArgs(yyvsp[-1].name,FALSE);
3486            omFree((ADDRESS)yyvsp[-1].name);
3487            iiInitSingularProcinfo(IDPROC(h),"", yyvsp[-2].name, 0, 0);
3488            IDPROC(h)->data.s.body = (char *)omAlloc(strlen(yyvsp[0].name)+strlen(args)+14);;
3489            sprintf(IDPROC(h)->data.s.body,"%s\n%s;return();\n\n",args,yyvsp[0].name);
3490            omFree((ADDRESS)args);
3491            omFree((ADDRESS)yyvsp[0].name);
3492            omFree((ADDRESS)yyvsp[-2].name);
3493          ;}
3494    break;
3495
3496  case 160:
3497#line 1555 "grammar.y"
3498    {
3499            omFree((ADDRESS)yyvsp[-1].name);
3500            idhdl h = enterid(yyvsp[-3].name,myynest,PROC_CMD,&IDROOT,TRUE);
3501            if (h==NULL)
3502            {
3503              omFree((ADDRESS)yyvsp[-3].name);
3504              omFree((ADDRESS)yyvsp[-2].name);
3505              omFree((ADDRESS)yyvsp[0].name);
3506              YYERROR;
3507            }
3508            char *args=iiProcArgs(yyvsp[-2].name,FALSE);
3509            omFree((ADDRESS)yyvsp[-2].name);
3510            iiInitSingularProcinfo(IDPROC(h),"", yyvsp[-3].name, 0, 0);
3511            omFree((ADDRESS)yyvsp[-3].name);
3512            IDPROC(h)->data.s.body = (char *)omAlloc(strlen(yyvsp[0].name)+strlen(args)+14);;
3513            sprintf(IDPROC(h)->data.s.body,"%s\n%s;return();\n\n",args,yyvsp[0].name);
3514            omFree((ADDRESS)args);
3515            omFree((ADDRESS)yyvsp[0].name);
3516          ;}
3517    break;
3518
3519  case 161:
3520#line 1578 "grammar.y"
3521    {
3522            // decl. of type proc p(int i)
3523            if (yyvsp[-1].i==PARAMETER)  { if (iiParameter(&yyvsp[0].lv)) YYERROR; }
3524            else                { if (iiAlias(&yyvsp[0].lv)) YYERROR; }
3525          ;}
3526    break;
3527
3528  case 162:
3529#line 1584 "grammar.y"
3530    {
3531            // decl. of type proc p(i)
3532            sleftv tmp_expr;
3533            if (yyvsp[-1].i==ALIAS_CMD) MYYERROR("alias requires a type");
3534            if ((iiDeclCommand(&tmp_expr,&yyvsp[0].lv,myynest,DEF_CMD,&IDROOT))
3535            || (iiParameter(&tmp_expr)))
3536              YYERROR;
3537          ;}
3538    break;
3539
3540  case 163:
3541#line 1596 "grammar.y"
3542    {
3543            iiRETURNEXPR.Copy(&yyvsp[-1].lv);
3544            yyvsp[-1].lv.CleanUp();
3545            if (exitBuffer(BT_proc)) YYERROR;
3546          ;}
3547    break;
3548
3549  case 164:
3550#line 1602 "grammar.y"
3551    {
3552            if (yyvsp[-2].i==RETURN)
3553            {
3554              iiRETURNEXPR.Init();
3555              iiRETURNEXPR.rtyp=NONE;
3556              if (exitBuffer(BT_proc)) YYERROR;
3557            }
3558          ;}
3559    break;
3560
3561
3562    }
3563
3564/* Line 1010 of yacc.c.  */
3565#line 3561 "grammar.cc"
3566
3567  yyvsp -= yylen;
3568  yyssp -= yylen;
3569
3570
3571  YY_STACK_PRINT (yyss, yyssp);
3572
3573  *++yyvsp = yyval;
3574
3575
3576  /* Now `shift' the result of the reduction.  Determine what state
3577     that goes to, based on the state we popped back to and the rule
3578     number reduced by.  */
3579
3580  yyn = yyr1[yyn];
3581
3582  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
3583  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
3584    yystate = yytable[yystate];
3585  else
3586    yystate = yydefgoto[yyn - YYNTOKENS];
3587
3588  goto yynewstate;
3589
3590
3591/*------------------------------------.
3592| yyerrlab -- here on detecting error |
3593`------------------------------------*/
3594yyerrlab:
3595  /* If not already recovering from an error, report this error.  */
3596  if (!yyerrstatus)
3597    {
3598      ++yynerrs;
3599#if YYERROR_VERBOSE
3600      yyn = yypact[yystate];
3601
3602      if (YYPACT_NINF < yyn && yyn < YYLAST)
3603        {
3604          YYSIZE_T yysize = 0;
3605          int yytype = YYTRANSLATE (yychar);
3606          const char* yyprefix;
3607          char *yymsg;
3608          int yyx;
3609
3610          /* Start YYX at -YYN if negative to avoid negative indexes in
3611             YYCHECK.  */
3612          int yyxbegin = yyn < 0 ? -yyn : 0;
3613
3614          /* Stay within bounds of both yycheck and yytname.  */
3615          int yychecklim = YYLAST - yyn;
3616          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
3617          int yycount = 0;
3618
3619          yyprefix = ", expecting ";
3620          for (yyx = yyxbegin; yyx < yyxend; ++yyx)
3621            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
3622              {
3623                yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
3624                yycount += 1;
3625                if (yycount == 5)
3626                  {
3627                    yysize = 0;
3628                    break;
3629                  }
3630              }
3631          yysize += (sizeof ("syntax error, unexpected ")
3632                     + yystrlen (yytname[yytype]));
3633          yymsg = (char *) YYSTACK_ALLOC (yysize);
3634          if (yymsg != 0)
3635            {
3636              char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
3637              yyp = yystpcpy (yyp, yytname[yytype]);
3638
3639              if (yycount < 5)
3640                {
3641                  yyprefix = ", expecting ";
3642                  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
3643                    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
3644                      {
3645                        yyp = yystpcpy (yyp, yyprefix);
3646                        yyp = yystpcpy (yyp, yytname[yyx]);
3647                        yyprefix = " or ";
3648                      }
3649                }
3650              yyerror (yymsg);
3651              YYSTACK_FREE (yymsg);
3652            }
3653          else
3654            yyerror ("syntax error; also virtual memory exhausted");
3655        }
3656      else
3657#endif /* YYERROR_VERBOSE */
3658        yyerror ("syntax error");
3659    }
3660
3661
3662
3663  if (yyerrstatus == 3)
3664    {
3665      /* If just tried and failed to reuse lookahead token after an
3666         error, discard it.  */
3667
3668      if (yychar <= YYEOF)
3669        {
3670          /* If at end of input, pop the error token,
3671             then the rest of the stack, then return failure.  */
3672          if (yychar == YYEOF)
3673             for (;;)
3674               {
3675                 YYPOPSTACK;
3676                 if (yyssp == yyss)
3677                   YYABORT;
3678                 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
3679                 yydestruct (yystos[*yyssp], yyvsp);
3680               }
3681        }
3682      else
3683        {
3684          YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
3685          yydestruct (yytoken, &yylval);
3686          yychar = YYEMPTY;
3687
3688        }
3689    }
3690
3691  /* Else will try to reuse lookahead token after shifting the error
3692     token.  */
3693  goto yyerrlab1;
3694
3695
3696/*---------------------------------------------------.
3697| yyerrorlab -- error raised explicitly by YYERROR.  |
3698`---------------------------------------------------*/
3699yyerrorlab:
3700
3701#ifdef __GNUC__
3702  /* Pacify GCC when the user code never invokes YYERROR and the label
3703     yyerrorlab therefore never appears in user code.  */
3704  if (0)
3705     goto yyerrorlab;
3706#endif
3707
3708  yyvsp -= yylen;
3709  yyssp -= yylen;
3710  yystate = *yyssp;
3711  goto yyerrlab1;
3712
3713
3714/*-------------------------------------------------------------.
3715| yyerrlab1 -- common code for both syntax error and YYERROR.  |
3716`-------------------------------------------------------------*/
3717yyerrlab1:
3718  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
3719
3720  for (;;)
3721    {
3722      yyn = yypact[yystate];
3723      if (yyn != YYPACT_NINF)
3724        {
3725          yyn += YYTERROR;
3726          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
3727            {
3728              yyn = yytable[yyn];
3729              if (0 < yyn)
3730                break;
3731            }
3732        }
3733
3734      /* Pop the current state because it cannot handle the error token.  */
3735      if (yyssp == yyss)
3736        YYABORT;
3737
3738      YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
3739      yydestruct (yystos[yystate], yyvsp);
3740      YYPOPSTACK;
3741      yystate = *yyssp;
3742      YY_STACK_PRINT (yyss, yyssp);
3743    }
3744
3745  if (yyn == YYFINAL)
3746    YYACCEPT;
3747
3748  YYDPRINTF ((stderr, "Shifting error token, "));
3749
3750  *++yyvsp = yylval;
3751
3752
3753  yystate = yyn;
3754  goto yynewstate;
3755
3756
3757/*-------------------------------------.
3758| yyacceptlab -- YYACCEPT comes here.  |
3759`-------------------------------------*/
3760yyacceptlab:
3761  yyresult = 0;
3762  goto yyreturn;
3763
3764/*-----------------------------------.
3765| yyabortlab -- YYABORT comes here.  |
3766`-----------------------------------*/
3767yyabortlab:
3768  yyresult = 1;
3769  goto yyreturn;
3770
3771#ifndef yyoverflow
3772/*----------------------------------------------.
3773| yyoverflowlab -- parser overflow comes here.  |
3774`----------------------------------------------*/
3775yyoverflowlab:
3776  yyerror ("parser stack overflow");
3777  yyresult = 2;
3778  /* Fall through.  */
3779#endif
3780
3781yyreturn:
3782#ifndef yyoverflow
3783  if (yyss != yyssa)
3784    YYSTACK_FREE (yyss);
3785#endif
3786  return yyresult;
3787}
3788
3789
3790
Note: See TracBrowser for help on using the repository browser.