home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
oct93
/
graphics
/
graphtal.lha
/
Graphtal
/
yacc.C
< prev
next >
Wrap
C/C++ Source or Header
|
1992-11-20
|
66KB
|
2,121 lines
/* A Bison parser, made from yacc.y */
#define YYBISON 1 /* Identify Bison output. */
#define tVALUE 258
#define tNAME 259
#define tCONSTANT 260
#define tLSYSTEM 261
#define tTABLE 262
#define tCONST 263
#define tATTRIBUTES 264
#define tDERIVATION 265
#define tAXIOM 266
#define tPITCH 267
#define tROLL 268
#define tTURN 269
#define tANGLE 270
#define tFORWARD 271
#define tRANDOMIZE 272
#define tINFINITY 273
#define tTROPISM 274
#define tWEIGHT 275
#define tEYE 276
#define tLOOKAT 277
#define tUP 278
#define tFOV 279
#define tCONERES 280
#define tSPHERERES 281
#define tHULL 282
#define tSPHERE 283
#define tTRIANGLE 284
#define tPLANE 285
#define tCYLINDER 286
#define tCONE 287
#define tTRANSLATE 288
#define tROTATE 289
#define tSCALE 290
#define tTRANSFORM 291
#define tSIN 292
#define tCOS 293
#define tTAN 294
#define tASIN 295
#define tACOS 296
#define tATAN 297
#define tABS 298
#define tSQRT 299
#define tEXP 300
#define tLOG 301
#define tLOG10 302
#define tRAND 303
#define tGAUSS 304
#define tIF 305
#define tTURTLEX 306
#define tTURTLEY 307
#define tTURTLEZ 308
#define tSCOPE 309
#define tAND 310
#define tOR 311
#define tEQ 312
#define tNEQ 313
#define tGEQ 314
#define tLEQ 315
#define tARROW 316
#define tPOW 317
#define tUMINUS 318
#line 1 "yacc.y"
/*
* yacc.y - parser for graphtal.
*
* Copyright (C) 1992, Christoph Streit (streit@iam.unibe.ch)
* University of Berne, Switzerland
* All rights reserved.
*
* This software may be freely copied, modified, and redistributed
* provided that this copyright notice is preserved on all copies.
*
* You may not distribute this software, in whole or in part, as part of
* any commercial product without the express consent of the authors.
*
* There is no warranty or other guarantee of fitness of this software
* for any purpose. It is provided solely "as is".
*
*/
/*
* #ifdef _AIX
* #pragma alloca
* # include <malloc.h>
* # include <unistd.h>
* #else
*/
#ifdef __GNUC__
# include <osfcn.h>
#else
# include <unistd.h>
# ifndef alloca
# include <malloc.h>
# ifndef alloca
# define alloca
# endif
# endif
#endif
/*
* #endif
*/
#include <stdlib.h>
#include <iostream.h>
#include "yyerror.h"
#include "rcString.h"
#include "LSystem.h"
#include "Expression.h"
#include "ExprItems.h"
#include "table.h"
#include "Color.h"
#include "Options.h"
#include "Primitives.h"
#include "Hull.h"
#include "Interpreter.h"
extern int yylex();
LSystem* lsystem = NULL;
declareTable(ExprSymtab, rcString, ExpressionPtr);
implementTable(ExprSymtab, rcString, ExpressionPtr);
declareTable(IntSymtab, rcString, int);
implementTable(IntSymtab, rcString, int);
declareTable(TableSymtab, rcString, TablePtr)
implementTable(TableSymtab, rcString, TablePtr)
static ExprSymtab GlobalConst(503);
static ExprSymtab* LocalConst = new ExprSymtab(503);
static IntSymtab* FormalParam = new IntSymtab(17);
static HullSymtab* theHulls = new HullSymtab(17);
static TableSymtab theTables(17);
static int definingLocalConst = 0;
static int nthParam = 0;
static ProdModuleList* axiom = NULL;
static DerivationList* derivation = NULL;
#line 83 "yacc.y"
typedef union { double realnumber;
int intnumber;
Vector* vector;
TransMatrix* trans;
GeoObject* geoObject;
Hull* hull;
DerivationList* derivations;
TableList* table_list;
Table* table;
ProductionList* prod_list;
Production* production;
Predecessor* predecessor;
NameList* name_list;
SuccessorList* succ_list;
Successor* successor;
ProdModuleList* module_list;
ProdModule* module;
ExpressionList* expr_list;
Expression* expr;
Value* value;
rcString* name;
} YYSTYPE;
#ifndef YYLTYPE
typedef
struct yyltype
{
int timestamp;
int first_line;
int first_column;
int last_line;
int last_column;
char *text;
}
yyltype;
#define YYLTYPE yyltype
#endif
#ifndef YYDEBUG
#define YYDEBUG 1
#endif
#include <stdio.h>
#ifndef __STDC__
#define const
#endif
#define YYFINAL 303
#define YYFLAG -32768
#define YYNTBASE 88
#define YYTRANSLATE(x) ((unsigned)(x) <= 318 ? yytranslate[x] : 126)
static const char yytranslate[] = { 0,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 57, 2, 2, 81, 70, 78, 2, 83,
86, 68, 66, 84, 67, 82, 69, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 85, 87, 62,
73, 63, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
76, 79, 77, 71, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 74, 80, 75, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 1, 2, 3, 4, 5,
6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
56, 58, 59, 60, 61, 64, 65, 72
};
#if YYDEBUG != 0
static const short yyprhs[] = { 0,
0, 8, 10, 11, 14, 16, 19, 24, 25, 28,
35, 37, 40, 43, 47, 51, 56, 60, 65, 71,
75, 77, 80, 83, 85, 87, 90, 93, 98, 102,
107, 113, 115, 118, 126, 128, 131, 135, 140, 142,
145, 147, 149, 151, 153, 155, 157, 159, 161, 163,
165, 167, 169, 171, 173, 175, 179, 181, 185, 188,
190, 193, 197, 200, 201, 205, 207, 210, 212, 217,
219, 223, 225, 227, 229, 231, 233, 236, 240, 244,
248, 252, 256, 260, 264, 268, 271, 275, 279, 283,
287, 291, 295, 299, 302, 305, 308, 311, 314, 317,
320, 323, 326, 329, 332, 335, 338, 341, 350, 353,
358, 362, 365, 369, 375, 376, 379, 383, 387, 391,
395, 399, 403, 407, 410, 414, 422, 426, 434, 442,
450, 454, 458, 462, 465, 470, 471, 475, 479, 481
};
#endif
static const short yyrhs[] = { 6,
4, 124, 89, 93, 101, 119, 0, 90, 0, 0,
8, 91, 0, 92, 0, 91, 92, 0, 5, 73,
116, 124, 0, 0, 93, 94, 0, 27, 4, 74,
95, 75, 124, 0, 96, 0, 96, 99, 0, 95,
96, 0, 95, 96, 99, 0, 28, 98, 97, 0,
29, 97, 97, 97, 0, 30, 97, 97, 0, 31,
98, 97, 97, 0, 32, 98, 97, 98, 97, 0,
98, 98, 98, 0, 3, 0, 67, 3, 0, 66,
3, 0, 4, 0, 100, 0, 99, 100, 0, 33,
97, 0, 35, 98, 98, 98, 0, 34, 97, 98,
0, 36, 97, 97, 97, 0, 36, 97, 97, 97,
97, 0, 102, 0, 101, 102, 0, 7, 4, 74,
90, 103, 75, 124, 0, 104, 0, 103, 104, 0,
105, 110, 124, 0, 105, 109, 110, 124, 0, 106,
0, 106, 107, 0, 74, 0, 75, 0, 76, 0,
77, 0, 71, 0, 78, 0, 66, 0, 67, 0,
79, 0, 69, 0, 80, 0, 81, 0, 82, 0,
70, 0, 4, 0, 83, 108, 125, 0, 4, 0,
108, 84, 4, 0, 85, 116, 0, 111, 0, 110,
111, 0, 64, 112, 113, 0, 64, 112, 0, 0,
83, 3, 86, 0, 114, 0, 113, 114, 0, 106,
0, 106, 83, 115, 125, 0, 116, 0, 115, 84,
116, 0, 3, 0, 51, 0, 52, 0, 53, 0,
4, 0, 54, 4, 0, 116, 56, 116, 0, 116,
55, 116, 0, 116, 58, 116, 0, 116, 59, 116,
0, 116, 60, 116, 0, 116, 61, 116, 0, 116,
63, 116, 0, 116, 62, 116, 0, 57, 116, 0,
116, 66, 116, 0, 116, 67, 116, 0, 116, 68,
116, 0, 116, 69, 116, 0, 116, 70, 116, 0,
116, 65, 116, 0, 116, 71, 116, 0, 67, 116,
0, 37, 118, 0, 38, 118, 0, 39, 118, 0,
40, 118, 0, 41, 118, 0, 42, 118, 0, 43,
118, 0, 44, 118, 0, 45, 118, 0, 46, 118,
0, 47, 118, 0, 48, 117, 0, 49, 117, 0,
50, 83, 116, 84, 116, 84, 116, 125, 0, 4,
117, 0, 4, 83, 115, 125, 0, 83, 116, 125,
0, 83, 125, 0, 83, 116, 125, 0, 9, 74,
120, 75, 124, 0, 0, 120, 121, 0, 10, 122,
124, 0, 11, 113, 124, 0, 12, 116, 124, 0,
13, 116, 124, 0, 14, 116, 124, 0, 15, 116,
124, 0, 16, 116, 124, 0, 17, 124, 0, 17,
116, 124, 0, 19, 116, 84, 116, 84, 116, 124,
0, 20, 116, 124, 0, 21, 116, 84, 116, 84,
116, 124, 0, 22, 116, 84, 116, 84, 116, 124,
0, 23, 116, 84, 116, 84, 116, 124, 0, 24,
116, 124, 0, 25, 3, 124, 0, 26, 3, 124,
0, 4, 123, 0, 122, 84, 4, 123, 0, 0,
83, 116, 125, 0, 83, 18, 125, 0, 87, 0,
86, 0
};
#if YYDEBUG != 0
static const short yyrline[] = { 0,
172, 185, 189, 190, 193, 194, 197, 211, 212, 215,
223, 228, 236, 241, 251, 258, 267, 275, 283, 293,
299, 304, 310, 315, 328, 332, 340, 346, 351, 357,
364, 374, 379, 386, 402, 408, 416, 425, 436, 441,
448, 450, 452, 454, 456, 458, 460, 462, 464, 466,
468, 470, 472, 474, 476, 480, 484, 493, 504, 508,
513, 520, 524, 530, 531, 536, 541, 548, 553, 560,
565, 572, 575, 579, 582, 585, 605, 616, 618, 620,
622, 624, 626, 628, 630, 632, 635, 637, 639, 641,
643, 645, 647, 649, 652, 654, 656, 658, 660, 662,
664, 666, 668, 670, 672, 674, 676, 678, 680, 684,
688, 692, 695, 699, 702, 703, 706, 708, 710, 715,
719, 724, 731, 736, 755, 760, 766, 770, 777, 784,
790, 795, 800, 807, 818, 831, 833, 837, 841, 842
};
static const char * const yytname[] = { "$","error","$illegal.","tVALUE","tNAME",
"tCONSTANT","tLSYSTEM","tTABLE","tCONST","tATTRIBUTES","tDERIVATION","tAXIOM",
"tPITCH","tROLL","tTURN","tANGLE","tFORWARD","tRANDOMIZE","tINFINITY","tTROPISM",
"tWEIGHT","tEYE","tLOOKAT","tUP","tFOV","tCONERES","tSPHERERES","tHULL","tSPHERE",
"tTRIANGLE","tPLANE","tCYLINDER","tCONE","tTRANSLATE","tROTATE","tSCALE","tTRANSFORM",
"tSIN","tCOS","tTAN","tASIN","tACOS","tATAN","tABS","tSQRT","tEXP","tLOG","tLOG10",
"tRAND","tGAUSS","tIF","tTURTLEX","tTURTLEY","tTURTLEZ","tSCOPE","tAND","tOR",
"'!'","tEQ","tNEQ","tGEQ","tLEQ","'<'","'>'","tARROW","tPOW","'+'","'-'","'*'",
"'/'","'%'","'^'","tUMINUS","'='","'{'","'}'","'['","']'","'&'","'\\\\'","'|'",
"'$'","'.'","'('","','","':'","')'","';'","lgrammar","global_const","constant_def",
"constants","constant","hulls","hull","primitives","primitive","vector","number",
"transforms","transformation","tables","table","productions","production","predecessor",
"name","arguments","parameters","condition","successors","successor","probability",
"modules","module","expr_list","expression","no_argument","one_argument","attributes",
"attr_list","attr_item","derivations","steps","sc","rp",""
};
#endif
static const short yyr1[] = { 0,
88, 89, 90, 90, 91, 91, 92, 93, 93, 94,
95, 95, 95, 95, 96, 96, 96, 96, 96, 97,
98, 98, 98, 98, 99, 99, 100, 100, 100, 100,
100, 101, 101, 102, 103, 103, 104, 104, 105, 105,
106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
106, 106, 106, 106, 106, 107, 108, 108, 109, 110,
110, 111, 111, 112, 112, 113, 113, 114, 114, 115,
115, 116, 116, 116, 116, 116, 116, 116, 116, 116,
116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
116, 117, 118, 119, 120, 120, 121, 121, 121, 121,
121, 121, 121, 121, 121, 121, 121, 121, 121, 121,
121, 121, 121, 122, 122, 123, 123, 123, 124, 125
};
static const short yyr2[] = { 0,
7, 1, 0, 2, 1, 2, 4, 0, 2, 6,
1, 2, 2, 3, 3, 4, 3, 4, 5, 3,
1, 2, 2, 1, 1, 2, 2, 4, 3, 4,
5, 1, 2, 7, 1, 2, 3, 4, 1, 2,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 3, 1, 3, 2, 1,
2, 3, 2, 0, 3, 1, 2, 1, 4, 1,
3, 1, 1, 1, 1, 1, 2, 3, 3, 3,
3, 3, 3, 3, 3, 2, 3, 3, 3, 3,
3, 3, 3, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 8, 2, 4,
3, 2, 3, 5, 0, 2, 3, 3, 3, 3,
3, 3, 3, 2, 3, 7, 3, 7, 7, 7,
3, 3, 3, 2, 4, 0, 3, 3, 1, 1
};
static const short yydefact[] = { 0,
0, 0, 139, 3, 0, 8, 2, 0, 4, 5,
0, 0, 6, 0, 0, 9, 0, 32, 72, 76,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 73, 74, 75, 0, 0, 0,
0, 0, 0, 0, 0, 33, 1, 0, 109, 0,
95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
105, 0, 106, 107, 0, 77, 86, 94, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 7, 3, 0, 115, 140, 0,
70, 112, 0, 0, 111, 79, 78, 80, 81, 82,
83, 85, 84, 92, 87, 88, 89, 90, 91, 93,
0, 0, 0, 0, 0, 0, 0, 11, 0, 0,
110, 113, 0, 55, 47, 48, 50, 54, 45, 41,
42, 43, 44, 46, 49, 51, 52, 53, 0, 35,
0, 39, 21, 24, 0, 0, 0, 0, 0, 0,
0, 0, 0, 13, 0, 0, 0, 0, 12, 25,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 116, 71, 0,
42, 36, 64, 0, 0, 0, 60, 0, 40, 23,
22, 15, 0, 0, 17, 0, 0, 10, 14, 27,
0, 0, 0, 26, 136, 0, 68, 0, 66, 0,
0, 0, 0, 0, 0, 124, 0, 0, 0, 0,
0, 0, 0, 0, 114, 0, 34, 0, 63, 59,
0, 61, 37, 57, 0, 16, 20, 18, 0, 29,
0, 0, 0, 134, 0, 117, 0, 67, 118, 119,
120, 121, 122, 123, 125, 0, 127, 0, 0, 0,
131, 132, 133, 0, 0, 62, 38, 0, 56, 19,
28, 30, 0, 0, 136, 0, 0, 0, 0, 0,
108, 65, 58, 31, 138, 137, 135, 69, 0, 0,
0, 0, 0, 0, 0, 0, 126, 128, 129, 130,
0, 0, 0
};
static const short yydefgoto[] = { 301,
6, 7, 9, 10, 11, 16, 117, 118, 148, 149,
159, 160, 17, 18, 139, 140, 141, 207, 189, 235,
185, 186, 187, 229, 208, 209, 90, 91, 49, 51,
47, 119, 178, 206, 244, 4, 92
};
static const short yypact[] = { 10,
16, -64,-32768, 29, 45,-32768,-32768, -17, 45,-32768,
12, 402,-32768, 75, 84,-32768, -3,-32768,-32768, -7,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 22, 22, 23,-32768,-32768,-32768, 86, 402, 402,
402, 405, 21, 33, 41,-32768,-32768, 298,-32768, 402,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-32768, 47,-32768,-32768, 402,-32768, -57, -57, 428, 402,
402, 402, 402, 402, 402, 402, 402, 402, 402, 402,
402, 402, 402, 402,-32768, 29, 72,-32768,-32768, -29,
630,-32768, 428, 353,-32768, 661, 647, 675, 675, 172,
172, 172, 172, -57, 13, 13, -57, -57, -57, -57,
146, 7, 7, 7, 7, 7, 2, 93, 295, 402,
-32768,-32768, 402,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 194,-32768,
-49, 51,-32768,-32768, 133, 134, 7, 7, 7, 7,
7, 7, -64, 93, 7, 7, 7, 7, 93,-32768,
135, 146, 402, 402, 402, 402, 402, 246, 402, 402,
402, 402, 402, 402, 138, 139, -64,-32768, 630, 450,
-64,-32768, 62, 402, 79, -61,-32768, 142,-32768,-32768,
-32768,-32768, 7, 7,-32768, 7, 7,-32768, 93,-32768,
7, 7, 7,-32768, 64, -66, 65, 43,-32768, 405,
405, 405, 405, 405, 405,-32768, 470, 405, 490, 510,
530, 405, -64, -64,-32768, 402,-32768, 160, 146, 630,
-61,-32768,-32768,-32768, 1,-32768,-32768,-32768, 7,-32768,
7, 7, 350,-32768, 162,-32768, 402,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768, 402,-32768, 402, 402, 402,
-32768,-32768,-32768, 428, 78, 146,-32768, 164,-32768,-32768,
-32768, 7, 47, 428, 64, -29, 550, 570, 590, 610,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 402, 402,
402, 402, 405, 405, 405, 405,-32768,-32768,-32768,-32768,
170, 179,-32768
};
static const short yypgoto[] = {-32768,
-32768, 94,-32768, 173,-32768,-32768,-32768, 66, -107, -103,
30, -157,-32768, 171,-32768, 50,-32768, -87,-32768,-32768,
-32768, 5, -151,-32768, -38, -191, -55, -12, 60, 349,
-32768,-32768,-32768,-32768, -82, -37, -68
};
#define YYLAST 746
static const short yytable[] = { 42,
95, 204, 183, 14, 85, 45, 150, 78, 147, 143,
144, 151, 152, 84, 183, 1, 248, 245, 14, 2,
3, 121, 3, 142, 122, 3, 67, 68, 69, 112,
113, 114, 115, 116, 232, 184, 5, 93, 15, 192,
193, 204, 195, 196, 197, 194, 124, 200, 201, 8,
203, 142, 94, 202, 120, 12, 89, 96, 97, 98,
99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
109, 110, 145, 146, 248, 48, 153, 78, 43, 232,
81, 82, 83, 84, 268, 236, 89, 44, 238, 66,
237, 63, 64, 239, 86, 242, 50, 240, 241, 112,
113, 114, 115, 116, 62, 65, 87, 179, 125, 126,
180, 127, 128, 129, 88, 198, 130, 131, 132, 133,
134, 135, 136, 137, 138, 155, 156, 157, 158, 3,
216, 270, 89, 188, 272, 190, 191, 271, 205, 225,
223, 224, 183, 227, 228, 234, 243, 247, 233, 124,
210, 211, 212, 213, 214, 215, 217, 218, 219, 220,
221, 222, 265, 282, 284, 275, 269, 283, 246, 302,
249, 230, 250, 251, 252, 253, 254, 255, 303, 111,
257, 13, 154, 199, 261, 262, 263, 46, 182, 231,
266, 276, 287, 267, 0, 281, 0, 124, 0, 0,
0, 0, 0, 0, 285, 286, 0, 288, 0, 0,
0, 125, 126, 264, 127, 128, 129, 0, 0, 130,
131, 132, 133, 134, 135, 136, 137, 138, 0, 0,
274,-32768,-32768,-32768,-32768, 0, 78, 79, 80, 81,
82, 83, 84, 277, 0, 278, 279, 280, 19, 20,
0, 0, 0, 0, 0, 297, 298, 299, 300, 125,
126, 0, 127, 128, 129, 0, 0, 130, 181, 132,
133, 134, 135, 136, 137, 138, 293, 294, 295, 296,
0, 0, 21, 22, 23, 24, 25, 26, 27, 28,
29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
19, 20, 39, 0, 161, 162, 163, 164, 165, 166,
167, 168, 40, 169, 170, 171, 172, 173, 174, 175,
176, 0, 0, 0, 0, 0, 0, 0, 41, 0,
0, 0, 3, 0, 21, 22, 23, 24, 25, 26,
27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
37, 38, 19, 20, 39, 0, 0, 0, 0, 0,
0, 0, 0, 0, 40, 0, 0, 273, 0, 177,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
41, 0, 0, 89, 0, 0, 21, 22, 23, 24,
25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
35, 36, 37, 38, 19, 20, 39, 70, 71, 0,
72, 73, 74, 75, 76, 77, 40, 78, 79, 80,
81, 82, 83, 84, 0, 0, 0, 0, 0, 0,
0, 0, 41, 0, 0, 0, 123, 0, 21, 22,
23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
33, 34, 35, 36, 37, 38, 0, 0, 39, 70,
71, 0, 72, 73, 74, 75, 76, 77, 40, 78,
79, 80, 81, 82, 83, 84, 0, 0, 0, 0,
0, 0, 70, 71, 41, 72, 73, 74, 75, 76,
77, 3, 78, 79, 80, 81, 82, 83, 84, 0,
0, 0, 0, 0, 70, 71, 0, 72, 73, 74,
75, 76, 77, 89, 78, 79, 80, 81, 82, 83,
84, 0, 0, 0, 70, 71, 0, 72, 73, 74,
75, 76, 77, 226, 78, 79, 80, 81, 82, 83,
84, 0, 0, 0, 70, 71, 0, 72, 73, 74,
75, 76, 77, 256, 78, 79, 80, 81, 82, 83,
84, 0, 0, 0, 70, 71, 0, 72, 73, 74,
75, 76, 77, 258, 78, 79, 80, 81, 82, 83,
84, 0, 0, 0, 70, 71, 0, 72, 73, 74,
75, 76, 77, 259, 78, 79, 80, 81, 82, 83,
84, 0, 0, 0, 70, 71, 0, 72, 73, 74,
75, 76, 77, 260, 78, 79, 80, 81, 82, 83,
84, 0, 0, 0, 70, 71, 0, 72, 73, 74,
75, 76, 77, 289, 78, 79, 80, 81, 82, 83,
84, 0, 0, 0, 70, 71, 0, 72, 73, 74,
75, 76, 77, 290, 78, 79, 80, 81, 82, 83,
84, 0, 0, 0, 70, 71, 0, 72, 73, 74,
75, 76, 77, 291, 78, 79, 80, 81, 82, 83,
84, 0, 0, 0, 70, 71, 0, 72, 73, 74,
75, 76, 77, 292, 78, 79, 80, 81, 82, 83,
84, 70, 0, 0, 72, 73, 74, 75, 76, 77,
0, 78, 79, 80, 81, 82, 83, 84, 72, 73,
74, 75, 76, 77, 0, 78, 79, 80, 81, 82,
83, 84,-32768,-32768, 74, 75, 76, 77, 0, 78,
79, 80, 81, 82, 83, 84
};
static const short yycheck[] = { 12,
69, 159, 64, 7, 42, 9, 114, 65, 112, 3,
4, 115, 116, 71, 64, 6, 208, 84, 7, 4,
87, 90, 87, 111, 93, 87, 39, 40, 41, 28,
29, 30, 31, 32, 186, 85, 8, 50, 27, 147,
148, 199, 150, 151, 152, 149, 4, 155, 156, 5,
158, 139, 65, 157, 84, 73, 86, 70, 71, 72,
73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
83, 84, 66, 67, 266, 83, 75, 65, 4, 231,
68, 69, 70, 71, 84, 193, 86, 4, 196, 4,
194, 32, 33, 197, 74, 203, 83, 201, 202, 28,
29, 30, 31, 32, 83, 83, 74, 120, 66, 67,
123, 69, 70, 71, 74, 153, 74, 75, 76, 77,
78, 79, 80, 81, 82, 33, 34, 35, 36, 87,
168, 239, 86, 83, 242, 3, 3, 241, 4, 177,
3, 3, 64, 181, 83, 4, 83, 83, 186, 4,
163, 164, 165, 166, 167, 168, 169, 170, 171, 172,
173, 174, 3, 86, 272, 4, 235, 4, 206, 0,
208, 184, 210, 211, 212, 213, 214, 215, 0, 86,
218, 9, 117, 154, 222, 223, 224, 17, 139, 185,
229, 247, 275, 231, -1, 264, -1, 4, -1, -1,
-1, -1, -1, -1, 273, 274, -1, 276, -1, -1,
-1, 66, 67, 226, 69, 70, 71, -1, -1, 74,
75, 76, 77, 78, 79, 80, 81, 82, -1, -1,
243, 60, 61, 62, 63, -1, 65, 66, 67, 68,
69, 70, 71, 256, -1, 258, 259, 260, 3, 4,
-1, -1, -1, -1, -1, 293, 294, 295, 296, 66,
67, -1, 69, 70, 71, -1, -1, 74, 75, 76,
77, 78, 79, 80, 81, 82, 289, 290, 291, 292,
-1, -1, 37, 38, 39, 40, 41, 42, 43, 44,
45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
3, 4, 57, -1, 10, 11, 12, 13, 14, 15,
16, 17, 67, 19, 20, 21, 22, 23, 24, 25,
26, -1, -1, -1, -1, -1, -1, -1, 83, -1,
-1, -1, 87, -1, 37, 38, 39, 40, 41, 42,
43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
53, 54, 3, 4, 57, -1, -1, -1, -1, -1,
-1, -1, -1, -1, 67, -1, -1, 18, -1, 75,
22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
83, -1, -1, 86, -1, -1, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
51, 52, 53, 54, 3, 4, 57, 55, 56, -1,
58, 59, 60, 61, 62, 63, 67, 65, 66, 67,
68, 69, 70, 71, -1, -1, -1, -1, -1, -1,
-1, -1, 83, -1, -1, -1, 84, -1, 37, 38,
39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
49, 50, 51, 52, 53, 54, -1, -1, 57, 55,
56, -1, 58, 59, 60, 61, 62, 63, 67, 65,
66, 67, 68, 69, 70, 71, -1, -1, -1, -1,
-1, -1, 55, 56, 83, 58, 59, 60, 61, 62,
63, 87, 65, 66, 67, 68, 69, 70, 71, -1,
-1, -1, -1, -1, 55, 56, -1, 58, 59, 60,
61, 62, 63, 86, 65, 66, 67, 68, 69, 70,
71, -1, -1, -1, 55, 56, -1, 58, 59, 60,
61, 62, 63, 84, 65, 66, 67, 68, 69, 70,
71, -1, -1, -1, 55, 56, -1, 58, 59, 60,
61, 62, 63, 84, 65, 66, 67, 68, 69, 70,
71, -1, -1, -1, 55, 56, -1, 58, 59, 60,
61, 62, 63, 84, 65, 66, 67, 68, 69, 70,
71, -1, -1, -1, 55, 56, -1, 58, 59, 60,
61, 62, 63, 84, 65, 66, 67, 68, 69, 70,
71, -1, -1, -1, 55, 56, -1, 58, 59, 60,
61, 62, 63, 84, 65, 66, 67, 68, 69, 70,
71, -1, -1, -1, 55, 56, -1, 58, 59, 60,
61, 62, 63, 84, 65, 66, 67, 68, 69, 70,
71, -1, -1, -1, 55, 56, -1, 58, 59, 60,
61, 62, 63, 84, 65, 66, 67, 68, 69, 70,
71, -1, -1, -1, 55, 56, -1, 58, 59, 60,
61, 62, 63, 84, 65, 66, 67, 68, 69, 70,
71, -1, -1, -1, 55, 56, -1, 58, 59, 60,
61, 62, 63, 84, 65, 66, 67, 68, 69, 70,
71, 55, -1, -1, 58, 59, 60, 61, 62, 63,
-1, 65, 66, 67, 68, 69, 70, 71, 58, 59,
60, 61, 62, 63, -1, 65, 66, 67, 68, 69,
70, 71, 58, 59, 60, 61, 62, 63, -1, 65,
66, 67, 68, 69, 70, 71
};
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
#line 3 "/usr/local/lib/bison/bison.simple"
/* Skeleton output parser for bison,
Copyright (C) 1984, 1989, 1990 Bob Corbett and Richard Stallman
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef alloca
#ifdef __GNUC__
#define alloca __builtin_alloca
#else /* not GNU C. */
#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__)
#include <alloca.h>
#else /* not sparc */
#if defined (MSDOS) && !defined (__TURBOC__)
#include <malloc.h>
#else /* not MSDOS, or __TURBOC__ */
#if defined(_AIX)
#include <malloc.h>
#pragma alloca
#endif /* not _AIX */
#endif /* not MSDOS, or __TURBOC__ */
#endif /* not sparc. */
#endif /* not GNU C. */
#endif /* alloca not defined. */
/* This is the parser code that is written into each bison parser
when the %semantic_parser declaration is not specified in the grammar.
It was written by Richard Stallman by simplifying the hairy parser
used when %semantic_parser is specified. */
/* Note: there must be only one dollar sign in this file.
It is replaced by the list of actions, each action
as one case of the switch. */
#define yyerrok (yyerrstatus = 0)
#define yyclearin (yychar = YYEMPTY)
#define YYEMPTY -2
#define YYEOF 0
#define YYACCEPT return(0)
#define YYABORT return(1)
#define YYERROR goto yyerrlab1
/* Like YYERROR except do call yyerror.
This remains here temporarily to ease the
transition to the new meaning of YYERROR, for GCC.
Once GCC version 2 has supplanted version 1, this can go. */
#define YYFAIL goto yyerrlab
#define YYRECOVERING() (!!yyerrstatus)
#define YYBACKUP(token, value) \
do \
if (yychar == YYEMPTY && yylen == 1) \
{ yychar = (token), yylval = (value); \
yychar1 = YYTRANSLATE (yychar); \
YYPOPSTACK; \
goto yybackup; \
} \
else \
{ yyerror ("syntax error: cannot back up"); YYERROR; } \
while (0)
#define YYTERROR 1
#define YYERRCODE 256
#ifndef YYPURE
#define YYLEX yylex()
#endif
#ifdef YYPURE
#ifdef YYLSP_NEEDED
#define YYLEX yylex(&yylval, &yylloc)
#else
#define YYLEX yylex(&yylval)
#endif
#endif
/* If nonreentrant, generate the variables here */
#ifndef YYPURE
int yychar; /* the lookahead symbol */
YYSTYPE yylval; /* the semantic value of the */
/* lookahead symbol */
#ifdef YYLSP_NEEDED
YYLTYPE yylloc; /* location data for the lookahead */
/* symbol */
#endif
int yynerrs; /* number of parse errors so far */
#endif /* not YYPURE */
#if YYDEBUG != 0
int yydebug; /* nonzero means print parse trace */
/* Since this is uninitialized, it does not stop multiple parsers
from coexisting. */
#endif
/* YYINITDEPTH indicates the initial size of the parser's stacks */
#ifndef YYINITDEPTH
#define YYINITDEPTH 200
#endif
/* YYMAXDEPTH is the maximum size the stacks can grow to
(effective only if the built-in stack extension method is used). */
#if YYMAXDEPTH == 0
#undef YYMAXDEPTH
#endif
#ifndef YYMAXDEPTH
#define YYMAXDEPTH 10000
#endif
#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
#define __yy_bcopy(FROM,TO,COUNT) __builtin_memcpy(TO,FROM,COUNT)
#else /* not GNU C or C++ */
#ifndef __cplusplus
/* This is the most reliable way to avoid incompatibilities
in available built-in functions on various systems. */
static void
__yy_bcopy (from, to, count)
char *from;
char *to;
int count;
{
register char *f = from;
register char *t = to;
register int i = count;
while (i-- > 0)
*t++ = *f++;
}
#else /* __cplusplus */
/* This is the most reliable way to avoid incompatibilities
in available built-in functions on various systems. */
static void
__yy_bcopy (char *from, char *to, int count)
{
register char *f = from;
register char *t = to;
register int i = count;
while (i-- > 0)
*t++ = *f++;
}
#endif
#endif
#line 169 "/usr/local/lib/bison/bison.simple"
int
yyparse()
{
register int yystate;
register int yyn;
register short *yyssp;
register YYSTYPE *yyvsp;
int yyerrstatus; /* number of tokens to shift before error messages enabled */
int yychar1; /* lookahead token as an internal (translated) token number */
short yyssa[YYINITDEPTH]; /* the state stack */
YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
short *yyss = yyssa; /* refer to the stacks thru separate pointers */
YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
#ifdef YYLSP_NEEDED
YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
YYLTYPE *yyls = yylsa;
YYLTYPE *yylsp;
#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
#else
#define YYPOPSTACK (yyvsp--, yyssp--)
#endif
int yystacksize = YYINITDEPTH;
#ifdef YYPURE
int yychar;
YYSTYPE yylval;
int yynerrs;
#ifdef YYLSP_NEEDED
YYLTYPE yylloc;
#endif
#endif
YYSTYPE yyval; /* the variable used to return */
/* semantic values from the action */
/* routines */
int yylen;
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Starting parse\n");
#endif
yystate = 0;
yyerrstatus = 0;
yynerrs = 0;
yychar = YYEMPTY; /* Cause a token to be read. */
/* Initialize stack pointers.
Waste one element of value and location stack
so that they stay on the same level as the state stack. */
yyssp = yyss - 1;
yyvsp = yyvs;
#ifdef YYLSP_NEEDED
yylsp = yyls;
#endif
/* Push a new state, which is found in yystate . */
/* In all cases, when you get here, the value and location stacks
have just been pushed. so pushing a state here evens the stacks. */
yynewstate:
*++yyssp = yystate;
if (yyssp >= yyss + yystacksize - 1)
{
/* Give user a chance to reallocate the stack */
/* Use copies of these so that the &'s don't force the real ones into memory. */
YYSTYPE *yyvs1 = yyvs;
short *yyss1 = yyss;
#ifdef YYLSP_NEEDED
YYLTYPE *yyls1 = yyls;
#endif
/* Get the current used size of the three stacks, in elements. */
int size = yyssp - yyss + 1;
#ifdef yyoverflow
/* Each stack pointer address is followed by the size of
the data in use in that stack, in bytes. */
yyoverflow("parser stack overflow",
&yyss1, size * sizeof (*yyssp),
&yyvs1, size * sizeof (*yyvsp),
#ifdef YYLSP_NEEDED
&yyls1, size * sizeof (*yylsp),
#endif
&yystacksize);
yyss = yyss1; yyvs = yyvs1;
#ifdef YYLSP_NEEDED
yyls = yyls1;
#endif
#else /* no yyoverflow */
/* Extend the stack our own way. */
if (yystacksize >= YYMAXDEPTH)
{
yyerror("parser stack overflow");
return 2;
}
yystacksize *= 2;
if (yystacksize > YYMAXDEPTH)
yystacksize = YYMAXDEPTH;
yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
__yy_bcopy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp));
yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
__yy_bcopy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp));
#ifdef YYLSP_NEEDED
yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
__yy_bcopy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp));
#endif
#endif /* no yyoverflow */
yyssp = yyss + size - 1;
yyvsp = yyvs + size - 1;
#ifdef YYLSP_NEEDED
yylsp = yyls + size - 1;
#endif
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Stack size increased to %d\n", yystacksize);
#endif
if (yyssp >= yyss + yystacksize - 1)
YYABORT;
}
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Entering state %d\n", yystate);
#endif
yybackup:
/* Do appropriate processing given the current state. */
/* Read a lookahead token if we need one and don't already have one. */
/* yyresume: */
/* First try to decide what to do without reference to lookahead token. */
yyn = yypact[yystate];
if (yyn == YYFLAG)
goto yydefault;
/* Not known => get a lookahead token if don't already have one. */
/* yychar is either YYEMPTY or YYEOF
or a valid token in external form. */
if (yychar == YYEMPTY)
{
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Reading a token: ");
#endif
yychar = YYLEX;
}
/* Convert token to internal form (in yychar1) for indexing tables with */
if (yychar <= 0) /* This means end of input. */
{
yychar1 = 0;
yychar = YYEOF; /* Don't call YYLEX any more */
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Now at end of input.\n");
#endif
}
else
{
yychar1 = YYTRANSLATE(yychar);
#if YYDEBUG != 0
if (yydebug)
{
fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
/* Give the individual parser a way to print the precise meaning
of a token, for further debugging info. */
#ifdef YYPRINT
YYPRINT (stderr, yychar, yylval);
#endif
fprintf (stderr, ")\n");
}
#endif
}
yyn += yychar1;
if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
goto yydefault;
yyn = yytable[yyn];
/* yyn is what to do for this token type in this state.
Negative => reduce, -yyn is rule number.
Positive => shift, yyn is new state.
New state is final state => don't bother to shift,
just return success.
0, or most negative number => error. */
if (yyn < 0)
{
if (yyn == YYFLAG)
goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
else if (yyn == 0)
goto yyerrlab;
if (yyn == YYFINAL)
YYACCEPT;
/* Shift the lookahead token. */
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
#endif
/* Discard the token being shifted unless it is eof. */
if (yychar != YYEOF)
yychar = YYEMPTY;
*++yyvsp = yylval;
#ifdef YYLSP_NEEDED
*++yylsp = yylloc;
#endif
/* count tokens shifted since error; after three, turn off error status. */
if (yyerrstatus) yyerrstatus--;
yystate = yyn;
goto yynewstate;
/* Do the default action for the current state. */
yydefault:
yyn = yydefact[yystate];
if (yyn == 0)
goto yyerrlab;
/* Do a reduction. yyn is the number of a rule to reduce with. */
yyreduce:
yylen = yyr2[yyn];
yyval = yyvsp[1-yylen]; /* implement default value of the action */
#if YYDEBUG != 0
if (yydebug)
{
int i;
fprintf (stderr, "Reducing via rule %d (line %d), ",
yyn, yyrline[yyn]);
/* Print the symboles being reduced, and their result. */
for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
fprintf (stderr, "%s ", yytname[yyrhs[i]]);
fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
}
#endif
switch (yyn) {
case 1:
#line 174 "yacc.y"
{
if (!axiom)
yyerror("no axiom defined");
if (!derivation)
yyerror("no derivation list defined");
lsystem = new LSystem(Name(yyvsp[-5].name), yyvsp[-1].table_list, axiom, derivation);
theOptions.hulls = theHulls;
delete yyvsp[-5].name;
;
break;}
case 2:
#line 186 "yacc.y"
{ definingLocalConst = 1; ;
break;}
case 7:
#line 198 "yacc.y"
{
if (definingLocalConst) {
if (!LocalConst->insert(*yyvsp[-3].name, yyvsp[-1].expr->simplify()))
yyerror("Constant " + *yyvsp[-3].name + " already defined");
}
else {
if (!GlobalConst.insert(*yyvsp[-3].name, yyvsp[-1].expr->simplify()))
yyerror("Constant " + *yyvsp[-3].name + " already defined");
}
delete yyvsp[-3].name;
;
break;}
case 10:
#line 216 "yacc.y"
{
if (!theHulls->insert(*yyvsp[-4].name, yyvsp[-2].hull))
yyerror("hull " + *yyvsp[-4].name + " already defined");
delete yyvsp[-4].name;
;
break;}
case 11:
#line 224 "yacc.y"
{
yyval.hull = new Hull;
yyval.hull->addPrimitive(yyvsp[0].geoObject);
;
break;}
case 12:
#line 229 "yacc.y"
{
if (!yyvsp[-1].geoObject->setTransform(yyvsp[0].trans))
yyerror("singular matrix");
yyval.hull = new Hull;
yyval.hull->addPrimitive(yyvsp[-1].geoObject);
;
break;}
case 13:
#line 237 "yacc.y"
{
yyval.hull = yyvsp[-1].hull;
yyval.hull->addPrimitive(yyvsp[0].geoObject);
;
break;}
case 14:
#line 242 "yacc.y"
{
if (!yyvsp[-1].geoObject->setTransform(yyvsp[0].trans))
yyerror("singular matrix");
yyval.hull = yyvsp[-2].hull;
yyval.hull->addPrimitive(yyvsp[-1].geoObject);
;
break;}
case 15:
#line 252 "yacc.y"
{
if ((yyval.geoObject = Sphere::create(yyvsp[-1].realnumber, *yyvsp[0].vector)) == NULL)
yyerror("degenerate sphere");
delete yyvsp[0].vector;
;
break;}
case 16:
#line 259 "yacc.y"
{
if ((yyval.geoObject = Triangle::create(*yyvsp[-2].vector, *yyvsp[-1].vector, *yyvsp[0].vector)) == NULL)
yyerror("degenerate triangle");
delete yyvsp[-2].vector;
delete yyvsp[-1].vector;
delete yyvsp[0].vector;
;
break;}
case 17:
#line 268 "yacc.y"
{
if ((yyval.geoObject = Plane::create(*yyvsp[-1].vector, *yyvsp[0].vector)) == NULL)
yyerror("degenerate plane normal");
delete yyvsp[-1].vector;
delete yyvsp[0].vector;
;
break;}
case 18:
#line 276 "yacc.y"
{
if ((yyval.geoObject = Cylinder::create(yyvsp[-2].realnumber, *yyvsp[-1].vector, *yyvsp[0].vector)) == NULL)
yyerror("degenerate cylinder");
delete yyvsp[-1].vector;
delete yyvsp[0].vector;
;
break;}
case 19:
#line 284 "yacc.y"
{
if ((yyval.geoObject = Cone::create(yyvsp[-3].realnumber, *yyvsp[-2].vector, yyvsp[-1].realnumber, *yyvsp[0].vector)) == NULL)
yyerror("degenerate cone");
delete yyvsp[-2].vector;
delete yyvsp[0].vector;
;
break;}
case 20:
#line 294 "yacc.y"
{
yyval.vector = new Vector(yyvsp[-2].realnumber, yyvsp[-1].realnumber, yyvsp[0].realnumber);
;
break;}
case 21:
#line 300 "yacc.y"
{
yyval.realnumber = *yyvsp[0].value;
delete yyvsp[0].value;
;
break;}
case 22:
#line 305 "yacc.y"
{
yyval.realnumber = *yyvsp[0].value;
yyval.realnumber = -yyval.realnumber;
delete yyvsp[0].value;
;
break;}
case 23:
#line 311 "yacc.y"
{
yyval.realnumber = *yyvsp[0].value;
delete yyvsp[0].value;
;
break;}
case 24:
#line 316 "yacc.y"
{
Expression *expr;
if (!GlobalConst.lookup(*yyvsp[0].name, expr))
yyerror(*yyvsp[0].name + " unknown");
else
yyval.realnumber = expr->evaluate();
delete yyvsp[0].name;
;
break;}
case 25:
#line 329 "yacc.y"
{
yyval.trans = yyvsp[0].trans;
;
break;}
case 26:
#line 333 "yacc.y"
{
(*yyvsp[-1].trans) *= (*yyvsp[0].trans);
yyval.trans = yyvsp[-1].trans;
delete yyvsp[0].trans;
;
break;}
case 27:
#line 341 "yacc.y"
{
yyval.trans = new TransMatrix;
yyval.trans->translate(*yyvsp[0].vector);
delete yyvsp[0].vector;
;
break;}
case 28:
#line 347 "yacc.y"
{
yyval.trans = new TransMatrix;
yyval.trans->scale(yyvsp[-2].realnumber, yyvsp[-1].realnumber, yyvsp[0].realnumber);
;
break;}
case 29:
#line 352 "yacc.y"
{
yyval.trans = new TransMatrix;
yyval.trans->rotate(*yyvsp[-1].vector, dtor(yyvsp[0].realnumber));
delete yyvsp[-1].vector;
;
break;}
case 30:
#line 358 "yacc.y"
{
yyval.trans = new TransMatrix(*yyvsp[-2].vector, *yyvsp[-1].vector, *yyvsp[0].vector);
delete yyvsp[-2].vector;
delete yyvsp[-1].vector;
delete yyvsp[0].vector;
;
break;}
case 31:
#line 365 "yacc.y"
{
yyval.trans = new TransMatrix(*yyvsp[-3].vector, *yyvsp[-2].vector, *yyvsp[-1].vector, *yyvsp[0].vector);
delete yyvsp[-3].vector;
delete yyvsp[-2].vector;
delete yyvsp[-1].vector;
delete yyvsp[0].vector;
;
break;}
case 32:
#line 375 "yacc.y"
{
yyval.table_list = new TableList(1);
yyval.table_list->append(yyvsp[0].table);
;
break;}
case 33:
#line 380 "yacc.y"
{
yyval.table_list = yyvsp[-1].table_list;
yyval.table_list->append(yyvsp[0].table);
;
break;}
case 34:
#line 387 "yacc.y"
{
Table *table = new Table(Name(yyvsp[-5].name), yyvsp[-2].prod_list);
if (!theTables.insert(*yyvsp[-5].name, table))
yyerror("Table " + *yyvsp[-5].name + " already defined");
else {
// delete current local constants
delete LocalConst;
LocalConst = new ExprSymtab(503);
yyval.table = table;
}
delete yyvsp[-5].name;
;
break;}
case 35:
#line 403 "yacc.y"
{
nthParam = 0;
yyval.prod_list = new ProductionList;
yyval.prod_list->append(yyvsp[0].production);
;
break;}
case 36:
#line 409 "yacc.y"
{
nthParam = 0;
yyval.prod_list = yyvsp[-1].prod_list;
yyval.prod_list->append(yyvsp[0].production);
;
break;}
case 37:
#line 417 "yacc.y"
{
yyval.production = new Production(yyvsp[-2].predecessor, NULL, yyvsp[-1].succ_list);
if (yyval.production->cumulateProbability())
yyerror("Sum of production probabilities is > 1");
delete FormalParam;
FormalParam = new IntSymtab(17);
;
break;}
case 38:
#line 426 "yacc.y"
{
yyval.production = new Production(yyvsp[-3].predecessor, yyvsp[-2].expr, yyvsp[-1].succ_list);
if (yyval.production->cumulateProbability())
yyerror("Sum of production probabilities is > 1");
delete FormalParam;
FormalParam = new IntSymtab(17);
;
break;}
case 39:
#line 437 "yacc.y"
{
yyval.predecessor = new Predecessor(Name(yyvsp[0].name), NULL);
delete yyvsp[0].name;
;
break;}
case 40:
#line 442 "yacc.y"
{
yyval.predecessor = new Predecessor(Name(yyvsp[-1].name), yyvsp[0].name_list);
delete yyvsp[-1].name;
;
break;}
case 41:
#line 449 "yacc.y"
{ yyval.name = new rcString("{"); ;
break;}
case 42:
#line 451 "yacc.y"
{ yyval.name = new rcString("}"); ;
break;}
case 43:
#line 453 "yacc.y"
{ yyval.name = new rcString("["); ;
break;}
case 44:
#line 455 "yacc.y"
{ yyval.name = new rcString("]"); ;
break;}
case 45:
#line 457 "yacc.y"
{ yyval.name = new rcString("^"); ;
break;}
case 46:
#line 459 "yacc.y"
{ yyval.name = new rcString("&"); ;
break;}
case 47:
#line 461 "yacc.y"
{ yyval.name = new rcString("+"); ;
break;}
case 48:
#line 463 "yacc.y"
{ yyval.name = new rcString("-"); ;
break;}
case 49:
#line 465 "yacc.y"
{ yyval.name = new rcString("\\"); ;
break;}
case 50:
#line 467 "yacc.y"
{ yyval.name = new rcString("/"); ;
break;}
case 51:
#line 469 "yacc.y"
{ yyval.name = new rcString("|"); ;
break;}
case 52:
#line 471 "yacc.y"
{ yyval.name = new rcString("$"); ;
break;}
case 53:
#line 473 "yacc.y"
{ yyval.name = new rcString("."); ;
break;}
case 54:
#line 475 "yacc.y"
{ yyval.name = new rcString("~"); ;
break;}
case 55:
#line 477 "yacc.y"
{ yyval.name = yyvsp[0].name; ;
break;}
case 56:
#line 481 "yacc.y"
{ yyval.name_list = yyvsp[-1].name_list; ;
break;}
case 57:
#line 485 "yacc.y"
{
yyval.name_list = new NameList(1);
yyval.name_list->append(new Name(yyvsp[0].name));
if (!FormalParam->insert(*yyvsp[0].name, nthParam++))
yyerror("Parameter " + *yyvsp[0].name + " already used");
delete yyvsp[0].name;
;
break;}
case 58:
#line 494 "yacc.y"
{
yyval.name_list = yyvsp[-2].name_list;
yyval.name_list->append(new Name(yyvsp[0].name));
if (!FormalParam->insert(*yyvsp[0].name, nthParam++))
yyerror("Parameter " + *yyvsp[0].name + " already used");
delete yyvsp[0].name;
;
break;}
case 59:
#line 505 "yacc.y"
{ yyval.expr = yyvsp[0].expr->simplify(); ;
break;}
case 60:
#line 509 "yacc.y"
{
yyval.succ_list = new SuccessorList(1);
yyval.succ_list->append(yyvsp[0].successor);
;
break;}
case 61:
#line 514 "yacc.y"
{
yyval.succ_list = yyvsp[-1].succ_list;
yyval.succ_list->append(yyvsp[0].successor);
;
break;}
case 62:
#line 521 "yacc.y"
{
yyval.successor = new Successor(yyvsp[-1].realnumber, yyvsp[0].module_list);
;
break;}
case 63:
#line 525 "yacc.y"
{
yyval.successor = new Successor(yyvsp[0].realnumber, NULL);
;
break;}
case 64:
#line 530 "yacc.y"
{ yyval.realnumber = 1.0; ;
break;}
case 65:
#line 531 "yacc.y"
{ yyval.realnumber = *yyvsp[-1].value;
delete yyvsp[-1].value;
;
break;}
case 66:
#line 537 "yacc.y"
{
yyval.module_list = new ProdModuleList(1);
yyval.module_list->append(yyvsp[0].module);
;
break;}
case 67:
#line 542 "yacc.y"
{
yyval.module_list = yyvsp[-1].module_list;
yyval.module_list->append(yyvsp[0].module);
;
break;}
case 68:
#line 549 "yacc.y"
{
yyval.module = new ProdModule(Name(yyvsp[0].name), NULL);
delete yyvsp[0].name;
;
break;}
case 69:
#line 554 "yacc.y"
{
yyval.module = new ProdModule(Name(yyvsp[-3].name), yyvsp[-1].expr_list);
delete yyvsp[-3].name;
;
break;}
case 70:
#line 561 "yacc.y"
{
yyval.expr_list = new ExpressionList(1);
yyval.expr_list->append(yyvsp[0].expr->simplify());
;
break;}
case 71:
#line 566 "yacc.y"
{
yyvsp[-2].expr_list->append(yyvsp[0].expr->simplify());
yyval.expr_list = yyvsp[-2].expr_list;
;
break;}
case 72:
#line 572 "yacc.y"
{ yyval.expr = new Expression(new ValueItem(yyvsp[0].value));
delete yyvsp[0].value;
;
break;}
case 73:
#line 576 "yacc.y"
{ yyval.expr = new Expression(new Variable(Name("tx"),
Interpreter::getTx()));
;
break;}
case 74:
#line 580 "yacc.y"
{ yyval.expr = new Expression(new Variable(Name("ty"),
Interpreter::getTy())); ;
break;}
case 75:
#line 583 "yacc.y"
{ yyval.expr = new Expression(new Variable(Name("tz"),
Interpreter::getTz())); ;
break;}
case 76:
#line 586 "yacc.y"
{ Expression *expr;
int nth;
// a formal parameter, local or global constant ?
if (!FormalParam->lookup(*yyvsp[0].name, nth)) {
if (!LocalConst->lookup(*yyvsp[0].name, expr)) {
if (!GlobalConst.lookup(*yyvsp[0].name, expr))
yyerror("`" + *yyvsp[0].name + "' unknown");
else
yyval.expr = new Expression(*expr);
}
else
yyval.expr = new Expression(*expr);
}
else
yyval.expr = new Expression(new Variable(Name(yyvsp[0].name),
Formals(nth)));
delete yyvsp[0].name;
;
break;}
case 77:
#line 606 "yacc.y"
{
Expression *expr;
if (!GlobalConst.lookup(*yyvsp[0].name, expr))
yyerror("::" + *yyvsp[0].name + " unknown");
else
yyval.expr = new Expression(*expr);
delete yyvsp[0].name;
;
break;}
case 78:
#line 617 "yacc.y"
{ yyval.expr = new Expression(new Or, yyvsp[-2].expr, yyvsp[0].expr); ;
break;}
case 79:
#line 619 "yacc.y"
{ yyval.expr = new Expression(new And, yyvsp[-2].expr, yyvsp[0].expr); ;
break;}
case 80:
#line 621 "yacc.y"
{ yyval.expr = new Expression(new Eq, yyvsp[-2].expr, yyvsp[0].expr); ;
break;}
case 81:
#line 623 "yacc.y"
{ yyval.expr = new Expression(new Neq, yyvsp[-2].expr, yyvsp[0].expr); ;
break;}
case 82:
#line 625 "yacc.y"
{ yyval.expr = new Expression(new Geq, yyvsp[-2].expr, yyvsp[0].expr); ;
break;}
case 83:
#line 627 "yacc.y"
{ yyval.expr = new Expression(new Leq, yyvsp[-2].expr, yyvsp[0].expr); ;
break;}
case 84:
#line 629 "yacc.y"
{ yyval.expr = new Expression(new Gt, yyvsp[-2].expr, yyvsp[0].expr); ;
break;}
case 85:
#line 631 "yacc.y"
{ yyval.expr = new Expression(new Lt, yyvsp[-2].expr, yyvsp[0].expr); ;
break;}
case 86:
#line 633 "yacc.y"
{ yyval.expr = new Expression(new Not, yyvsp[0].expr); ;
break;}
case 87:
#line 636 "yacc.y"
{ yyval.expr = new Expression(new Add, yyvsp[-2].expr, yyvsp[0].expr); ;
break;}
case 88:
#line 638 "yacc.y"
{ yyval.expr = new Expression(new Sub, yyvsp[-2].expr, yyvsp[0].expr); ;
break;}
case 89:
#line 640 "yacc.y"
{ yyval.expr = new Expression(new Mul, yyvsp[-2].expr, yyvsp[0].expr); ;
break;}
case 90:
#line 642 "yacc.y"
{ yyval.expr = new Expression(new Div, yyvsp[-2].expr, yyvsp[0].expr); ;
break;}
case 91:
#line 644 "yacc.y"
{ yyval.expr = new Expression(new Mod, yyvsp[-2].expr, yyvsp[0].expr); ;
break;}
case 92:
#line 646 "yacc.y"
{ yyval.expr = new Expression(new Pow, yyvsp[-2].expr, yyvsp[0].expr); ;
break;}
case 93:
#line 648 "yacc.y"
{ yyval.expr = new Expression(new Pow, yyvsp[-2].expr, yyvsp[0].expr); ;
break;}
case 94:
#line 650 "yacc.y"
{ yyval.expr = new Expression(new Uminus, yyvsp[0].expr); ;
break;}
case 95:
#line 653 "yacc.y"
{ yyval.expr = new Expression(new Sin, yyvsp[0].expr); ;
break;}
case 96:
#line 655 "yacc.y"
{ yyval.expr = new Expression(new Cos, yyvsp[0].expr); ;
break;}
case 97:
#line 657 "yacc.y"
{ yyval.expr = new Expression(new Tan, yyvsp[0].expr); ;
break;}
case 98:
#line 659 "yacc.y"
{ yyval.expr = new Expression(new Asin, yyvsp[0].expr); ;
break;}
case 99:
#line 661 "yacc.y"
{ yyval.expr = new Expression(new Acos, yyvsp[0].expr); ;
break;}
case 100:
#line 663 "yacc.y"
{ yyval.expr = new Expression(new Atan, yyvsp[0].expr); ;
break;}
case 101:
#line 665 "yacc.y"
{ yyval.expr = new Expression(new Abs, yyvsp[0].expr); ;
break;}
case 102:
#line 667 "yacc.y"
{ yyval.expr = new Expression(new Sqrt, yyvsp[0].expr); ;
break;}
case 103:
#line 669 "yacc.y"
{ yyval.expr = new Expression(new Exp, yyvsp[0].expr); ;
break;}
case 104:
#line 671 "yacc.y"
{ yyval.expr = new Expression(new Log, yyvsp[0].expr); ;
break;}
case 105:
#line 673 "yacc.y"
{ yyval.expr = new Expression(new Log, yyvsp[0].expr); ;
break;}
case 106:
#line 675 "yacc.y"
{ yyval.expr = new Expression(new Rand); ;
break;}
case 107:
#line 677 "yacc.y"
{ yyval.expr = new Expression(new Gauss); ;
break;}
case 108:
#line 679 "yacc.y"
{ yyval.expr = new Expression(new If, yyvsp[-5].expr, yyvsp[-3].expr, yyvsp[-1].expr); ;
break;}
case 109:
#line 681 "yacc.y"
{
yyerror("Function " + *yyvsp[-1].name + "() unknown");
;
break;}
case 110:
#line 685 "yacc.y"
{
yyerror("Function " + *yyvsp[-3].name + "(arguments) unknown");
;
break;}
case 111:
#line 689 "yacc.y"
{ yyval.expr = yyvsp[-1].expr; ;
break;}
case 112:
#line 693 "yacc.y"
{ yyval.expr = NULL; ;
break;}
case 113:
#line 696 "yacc.y"
{ yyval.expr = yyvsp[-1].expr->simplify(); ;
break;}
case 117:
#line 707 "yacc.y"
{ derivation = yyvsp[-1].derivations; ;
break;}
case 118:
#line 709 "yacc.y"
{ axiom = yyvsp[-1].module_list; ;
break;}
case 119:
#line 711 "yacc.y"
{
theOptions.defaultPitch = dtor(yyvsp[-1].expr->evaluate());
delete yyvsp[-1].expr;
;
break;}
case 120:
#line 716 "yacc.y"
{ theOptions.defaultRoll = dtor(yyvsp[-1].expr->evaluate());
delete yyvsp[-1].expr;
;
break;}
case 121:
#line 720 "yacc.y"
{
theOptions.defaultTurn = dtor(yyvsp[-1].expr->evaluate());
delete yyvsp[-1].expr;
;
break;}
case 122:
#line 725 "yacc.y"
{
theOptions.defaultPitch =
theOptions.defaultRoll =
theOptions.defaultTurn = dtor(yyvsp[-1].expr->evaluate());
delete yyvsp[-1].expr;
;
break;}
case 123:
#line 732 "yacc.y"
{
theOptions.defaultForward = yyvsp[-1].expr->evaluate();
delete yyvsp[-1].expr;
;
break;}
case 124:
#line 737 "yacc.y"
{
long now;
/*
* #if defined(_AIX)
* stime(&now);
* #elif defined(__DECCXX)
*/
#if defined(__DECCXX)
now = getpid();
#else
time(&now);
#endif
if (theOptions.verbose)
cerr << "randomize " << now << "\n";
srand48(now);
;
break;}
case 125:
#line 756 "yacc.y"
{
srand48((long)yyvsp[-1].expr->evaluate());
delete yyvsp[-1].expr;
;
break;}
case 126:
#line 761 "yacc.y"
{
theOptions.tropismX = yyvsp[-5].expr->simplify();
theOptions.tropismY = yyvsp[-3].expr->simplify();
theOptions.tropismZ = yyvsp[-1].expr->simplify();
;
break;}
case 127:
#line 767 "yacc.y"
{
theOptions.weight = yyvsp[-1].expr->simplify();
;
break;}
case 128:
#line 771 "yacc.y"
{
theOptions.autoscale = 0;
theOptions.eye =
Vector(yyvsp[-5].expr->evaluate(), yyvsp[-3].expr->evaluate(), yyvsp[-1].expr->evaluate());
delete yyvsp[-5].expr; delete yyvsp[-3].expr; delete yyvsp[-1].expr;
;
break;}
case 129:
#line 778 "yacc.y"
{
theOptions.autoscale = 0;
theOptions.lookat =
Vector(yyvsp[-5].expr->evaluate(), yyvsp[-3].expr->evaluate(), yyvsp[-1].expr->evaluate());
delete yyvsp[-5].expr; delete yyvsp[-3].expr; delete yyvsp[-1].expr;
;
break;}
case 130:
#line 785 "yacc.y"
{
theOptions.up =
Vector(yyvsp[-5].expr->evaluate(), yyvsp[-3].expr->evaluate(), yyvsp[-1].expr->evaluate());
delete yyvsp[-5].expr; delete yyvsp[-3].expr; delete yyvsp[-1].expr;
;
break;}
case 131:
#line 791 "yacc.y"
{
theOptions.fov = yyvsp[-1].expr->evaluate();
delete yyvsp[-1].expr;
;
break;}
case 132:
#line 796 "yacc.y"
{
theOptions.coneResolution = (int) *yyvsp[-1].value;
delete yyvsp[-1].value;
;
break;}
case 133:
#line 801 "yacc.y"
{
theOptions.sphereResolution = (int) *yyvsp[-1].value;
delete yyvsp[-1].value;
;
break;}
case 134:
#line 808 "yacc.y"
{ Table *t;
if (!theTables.lookup(*yyvsp[-1].name, t))
yyerror("Unknown table " + *yyvsp[-1].name);
else {
yyval.derivations = new DerivationList(1);
yyval.derivations->append(new DerivationItem(t,yyvsp[0].intnumber));
}
delete yyvsp[-1].name;
;
break;}
case 135:
#line 819 "yacc.y"
{ Table *t;
yyval.derivations = yyvsp[-3].derivations;
if (!theTables.lookup(*yyvsp[-1].name, t))
yyerror("Unknown table " + *yyvsp[-1].name);
else
yyval.derivations->append(new DerivationItem(t,yyvsp[0].intnumber));
delete yyvsp[-1].name;
;
break;}
case 136:
#line 832 "yacc.y"
{ yyval.intnumber = 1; ;
break;}
case 137:
#line 834 "yacc.y"
{ yyval.intnumber = (int) real(yyvsp[-1].expr->evaluate());
delete yyvsp[-1].expr;
;
break;}
case 138:
#line 838 "yacc.y"
{ yyval.intnumber = -1; ;
break;}
case 139:
#line 841 "yacc.y"
{ yyerrok; ;
break;}
case 140:
#line 842 "yacc.y"
{ yyerrok; ;
break;}
}
/* the action file gets copied in in place of this dollarsign */
#line 440 "/usr/local/lib/bison/bison.simple"
yyvsp -= yylen;
yyssp -= yylen;
#ifdef YYLSP_NEEDED
yylsp -= yylen;
#endif
#if YYDEBUG != 0
if (yydebug)
{
short *ssp1 = yyss - 1;
fprintf (stderr, "state stack now");
while (ssp1 != yyssp)
fprintf (stderr, " %d", *++ssp1);
fprintf (stderr, "\n");
}
#endif
*++yyvsp = yyval;
#ifdef YYLSP_NEEDED
yylsp++;
if (yylen == 0)
{
yylsp->first_line = yylloc.first_line;
yylsp->first_column = yylloc.first_column;
yylsp->last_line = (yylsp-1)->last_line;
yylsp->last_column = (yylsp-1)->last_column;
yylsp->text = 0;
}
else
{
yylsp->last_line = (yylsp+yylen-1)->last_line;
yylsp->last_column = (yylsp+yylen-1)->last_column;
}
#endif
/* Now "shift" the result of the reduction.
Determine what state that goes to,
based on the state we popped back to
and the rule number reduced by. */
yyn = yyr1[yyn];
yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
yystate = yytable[yystate];
else
yystate = yydefgoto[yyn - YYNTBASE];
goto yynewstate;
yyerrlab: /* here on detecting error */
if (! yyerrstatus)
/* If not already recovering from an error, report this error. */
{
++yynerrs;
#ifdef YYERROR_VERBOSE
yyn = yypact[yystate];
if (yyn > YYFLAG && yyn < YYLAST)
{
int size = 0;
char *msg;
int x, count;
count = 0;
for (x = 0; x < (sizeof(yytname) / sizeof(char *)); x++)
if (yycheck[x + yyn] == x)
size += strlen(yytname[x]) + 15, count++;
msg = (char *) malloc(size + 15);
if (msg != 0)
{
strcpy(msg, "parse error");
if (count < 5)
{
count = 0;
for (x = 0; x < (sizeof(yytname) / sizeof(char *)); x++)
if (yycheck[x + yyn] == x)
{
strcat(msg, count == 0 ? ", expecting `" : " or `");
strcat(msg, yytname[x]);
strcat(msg, "'");
count++;
}
}
yyerror(msg);
free(msg);
}
else
yyerror ("parse error; also virtual memory exceeded");
}
else
#endif /* YYERROR_VERBOSE */
yyerror("parse error");
}
yyerrlab1: /* here on error raised explicitly by an action */
if (yyerrstatus == 3)
{
/* if just tried and failed to reuse lookahead token after an error, discard it. */
/* return failure if at end of input */
if (yychar == YYEOF)
YYABORT;
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
#endif
yychar = YYEMPTY;
}
/* Else will try to reuse lookahead token
after shifting the error token. */
yyerrstatus = 3; /* Each real token shifted decrements this */
goto yyerrhandle;
yyerrdefault: /* current state does not do anything special for the error token. */
#if 0
/* This is wrong; only states that explicitly want error tokens
should shift them. */
yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
if (yyn) goto yydefault;
#endif
yyerrpop: /* pop the current state because it cannot handle the error token */
if (yyssp == yyss) YYABORT;
yyvsp--;
yystate = *--yyssp;
#ifdef YYLSP_NEEDED
yylsp--;
#endif
#if YYDEBUG != 0
if (yydebug)
{
short *ssp1 = yyss - 1;
fprintf (stderr, "Error: state stack now");
while (ssp1 != yyssp)
fprintf (stderr, " %d", *++ssp1);
fprintf (stderr, "\n");
}
#endif
yyerrhandle:
yyn = yypact[yystate];
if (yyn == YYFLAG)
goto yyerrdefault;
yyn += YYTERROR;
if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
goto yyerrdefault;
yyn = yytable[yyn];
if (yyn < 0)
{
if (yyn == YYFLAG)
goto yyerrpop;
yyn = -yyn;
goto yyreduce;
}
else if (yyn == 0)
goto yyerrpop;
if (yyn == YYFINAL)
YYACCEPT;
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Shifting error token, ");
#endif
*++yyvsp = yylval;
#ifdef YYLSP_NEEDED
*++yylsp = yylloc;
#endif
yystate = yyn;
goto yynewstate;
}
#line 845 "yacc.y"