1
/* A Bison parser, made by GNU Bison 1.875. */
3
/* Skeleton parser for Yacc-like parsing with Bison,
4
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
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)
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.
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. */
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. */
26
/* Written by Richard Stallman by simplifying the original so called
27
``semantic'' parser. */
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. */
36
/* Identify Bison output. */
40
#define YYSKELETON_NAME "yacc.c"
45
/* Using locations. */
46
#define YYLSP_NEEDED 0
53
/* Put the tokens into the symbol table, so that GDB and other debuggers
69
SHADER_TYPE_SURFACE = 271,
70
SHADER_TYPE_VOLUME = 272,
71
SHADER_TYPE_IMAGER = 273,
72
SHADER_TYPE_TRANSFORMATION = 274,
73
SHADER_TYPE_DISPLACEMENT = 275,
74
SHADER_TYPE_LIGHT = 276,
75
SHADER_TYPE_ATMOSPHERE = 277,
115
FLOAT_CONSTANT = 317,
119
#define IDENTIFIER 258
121
#define ARRAY_SYMBOL 260
122
#define TYPE_FLOAT 261
123
#define TYPE_POINT 262
124
#define TYPE_STRING 263
125
#define TYPE_COLOR 264
126
#define TYPE_NORMAL 265
127
#define TYPE_VECTOR 266
128
#define TYPE_VOID 267
129
#define TYPE_MATRIX 268
130
#define TYPE_UNIFORM 269
131
#define TYPE_VARYING 270
132
#define SHADER_TYPE_SURFACE 271
133
#define SHADER_TYPE_VOLUME 272
134
#define SHADER_TYPE_IMAGER 273
135
#define SHADER_TYPE_TRANSFORMATION 274
136
#define SHADER_TYPE_DISPLACEMENT 275
137
#define SHADER_TYPE_LIGHT 276
138
#define SHADER_TYPE_ATMOSPHERE 277
139
#define ATTRIBUTE 278
141
#define RENDERERINFO 280
144
#define LIGHTSOURCE 283
146
#define TEXTUREINFO 285
155
#define ILLUMINATE 294
156
#define ILLUMINANCE 295
158
#define TEXTUREMAP 297
159
#define ENVIRONMENT 298
162
#define OCCLUSION 301
167
#define DIV_ASSIGN 306
168
#define MUL_ASSIGN 307
169
#define SUB_ASSIGN 308
170
#define ADD_ASSIGN 309
178
#define FLOAT_CONSTANT 317
179
#define STRING_LITERAL 318
184
/* Copy the first part of user declarations. */
189
#pragma warning(disable : 4786)
206
#include "parsenode.h"
209
# define YYMAXDEPTH 100000
210
# define YYINITDEPTH 2000
212
using namespace Aqsis;
218
extern CqString ParseStreamName;
219
extern std::ostream* ParseErrorStream;
220
extern TqInt ParseLineNumber;
221
extern TqBool ParseSucceeded;
222
extern TqInt iArrayAccess;
223
CqParseNode* ParseTreePointer;
224
std::vector<CqString> ParseNameSpaceStack;
225
std::vector<TqInt> FunctionReturnCountStack;
226
EqShaderType gShaderType;
228
TqBool FindVariable(const char* name, SqVarRef& ref);
229
TqBool FindFunction(const char* name, std::vector<SqFuncRef>& Ref);
230
CqString strNameSpace();
233
void InitStandardNamespace();
234
void ProcessShaderArguments( CqParseNode* pArgs );
240
/* Enabling traces. */
245
/* Enabling verbose error messages. */
246
#ifdef YYERROR_VERBOSE
247
# undef YYERROR_VERBOSE
248
# define YYERROR_VERBOSE 1
250
# define YYERROR_VERBOSE 0
253
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
254
#line 60 "parser.yxx"
255
typedef union YYSTYPE {
256
CqParseNode* m_pParseNode;
258
EqShaderType m_ShaderType;
259
TqFloat m_FloatConst;
260
CqString* m_Identifier;
270
EqCommType m_CommType;
272
/* Line 191 of yacc.c. */
274
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
275
# define YYSTYPE_IS_DECLARED 1
276
# define YYSTYPE_IS_TRIVIAL 1
281
/* Copy the second part of user declarations. */
282
#line 78 "parser.yxx"
284
extern TqInt yylex();
285
static void yyerror(const CqString Message);
288
/* Line 214 of yacc.c. */
291
#if ! defined (yyoverflow) || YYERROR_VERBOSE
293
/* The parser invokes alloca or malloc; define the necessary symbols. */
295
# if YYSTACK_USE_ALLOCA
296
# define YYSTACK_ALLOC alloca
298
# ifndef YYSTACK_USE_ALLOCA
299
# if defined (alloca) || defined (_ALLOCA_H)
300
# define YYSTACK_ALLOC alloca
303
# define YYSTACK_ALLOC __builtin_alloca
309
# ifdef YYSTACK_ALLOC
310
/* Pacify GCC's `empty if-body' warning. */
311
# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
313
# if defined (__STDC__) || defined (__cplusplus)
314
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
315
# define YYSIZE_T size_t
317
# define YYSTACK_ALLOC malloc
318
# define YYSTACK_FREE free
320
#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
323
#if (! defined (yyoverflow) \
324
&& (! defined (__cplusplus) \
325
|| (YYSTYPE_IS_TRIVIAL)))
327
/* A type that is properly aligned for any stack member. */
334
/* The size of the maximum gap between one aligned stack and the next. */
335
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
337
/* The size of an array large to enough to hold all stacks, each with
339
# define YYSTACK_BYTES(N) \
340
((N) * (sizeof (short) + sizeof (YYSTYPE)) \
341
+ YYSTACK_GAP_MAXIMUM)
343
/* Copy COUNT objects from FROM to TO. The source and destination do
347
# define YYCOPY(To, From, Count) \
348
__builtin_memcpy (To, From, (Count) * sizeof (*(From)))
350
# define YYCOPY(To, From, Count) \
353
register YYSIZE_T yyi; \
354
for (yyi = 0; yyi < (Count); yyi++) \
355
(To)[yyi] = (From)[yyi]; \
361
/* Relocate STACK from its old location to the new one. The
362
local variables YYSIZE and YYSTACKSIZE give the old and new number of
363
elements in the stack, and YYPTR gives the new location of the
364
stack. Advance YYPTR to a properly aligned location for the next
366
# define YYSTACK_RELOCATE(Stack) \
369
YYSIZE_T yynewbytes; \
370
YYCOPY (&yyptr->Stack, Stack, yysize); \
371
Stack = &yyptr->Stack; \
372
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
373
yyptr += yynewbytes / sizeof (*yyptr); \
379
#if defined (__STDC__) || defined (__cplusplus)
380
typedef signed char yysigned_char;
382
typedef short yysigned_char;
385
/* YYFINAL -- State number of the termination state. */
387
/* YYLAST -- Last index in YYTABLE. */
390
/* YYNTOKENS -- Number of terminals. */
392
/* YYNNTS -- Number of nonterminals. */
394
/* YYNRULES -- Number of rules. */
396
/* YYNRULES -- Number of states. */
397
#define YYNSTATES 388
399
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
401
#define YYMAXUTOK 318
403
#define YYTRANSLATE(YYX) \
404
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
406
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
407
static const unsigned char yytranslate[] =
409
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
410
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
411
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
412
2, 2, 2, 72, 2, 2, 2, 2, 2, 2,
413
74, 75, 70, 66, 81, 67, 71, 69, 2, 2,
414
2, 2, 2, 2, 2, 2, 2, 2, 57, 80,
415
61, 51, 60, 56, 2, 2, 2, 2, 2, 2,
416
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
417
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
418
2, 82, 2, 83, 68, 2, 2, 2, 2, 2,
419
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
420
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
421
2, 2, 2, 78, 2, 79, 2, 2, 2, 2,
422
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
423
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
424
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
425
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
426
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
427
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
428
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
429
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
430
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
431
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
432
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
433
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
434
2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
435
5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
436
15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
437
25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
438
35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
439
45, 46, 47, 48, 49, 50, 52, 53, 54, 55,
440
58, 59, 62, 63, 64, 65, 73, 76, 77
444
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
446
static const unsigned short yyprhs[] =
448
0, 0, 3, 5, 8, 10, 12, 21, 30, 38,
449
46, 53, 59, 63, 66, 70, 73, 75, 77, 79,
450
81, 83, 85, 87, 91, 94, 97, 101, 104, 108,
451
111, 113, 115, 119, 122, 124, 129, 135, 139, 142,
452
144, 149, 155, 159, 162, 167, 169, 173, 175, 177,
453
179, 181, 183, 185, 187, 189, 191, 193, 196, 198,
454
201, 203, 206, 208, 211, 213, 216, 218, 220, 222,
455
225, 228, 231, 234, 237, 241, 244, 246, 249, 251,
456
255, 258, 260, 264, 268, 274, 280, 284, 288, 298,
457
308, 313, 321, 327, 337, 343, 351, 361, 373, 376,
458
378, 380, 382, 384, 388, 392, 396, 400, 404, 408,
459
411, 413, 419, 422, 424, 426, 428, 433, 435, 437,
460
439, 441, 443, 447, 455, 489, 491, 493, 495, 497,
461
499, 501, 505, 509, 513, 517, 520, 524, 528, 532,
462
536, 540, 547, 554, 561, 568, 575, 580, 584, 589,
463
593, 595, 599, 606, 612, 618, 623, 625, 627, 629,
464
631, 633, 635, 639, 642, 646, 648, 650, 652, 654,
465
656, 658, 660, 662, 664, 666, 668, 675, 684, 691
468
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
469
static const short yyrhs[] =
471
85, 0, -1, 86, -1, 85, 86, -1, 87, -1,
472
88, -1, 90, 3, 74, 91, 75, 78, 108, 79,
473
-1, 90, 4, 74, 91, 75, 78, 108, 79, -1,
474
90, 3, 74, 75, 78, 108, 79, -1, 90, 4,
475
74, 75, 78, 108, 79, -1, 89, 91, 75, 78,
476
108, 79, -1, 89, 75, 78, 108, 79, -1, 94,
477
3, 74, -1, 3, 74, -1, 94, 4, 74, -1,
478
4, 74, -1, 21, -1, 16, -1, 17, -1, 20,
479
-1, 19, -1, 18, -1, 92, -1, 91, 80, 92,
480
-1, 91, 80, -1, 94, 95, -1, 31, 94, 95,
481
-1, 94, 95, -1, 29, 94, 95, -1, 100, 101,
482
-1, 101, -1, 96, -1, 95, 81, 96, -1, 3,
483
97, -1, 3, -1, 3, 82, 127, 83, -1, 3,
484
82, 127, 83, 98, -1, 3, 82, 83, -1, 4,
485
97, -1, 4, -1, 4, 82, 127, 83, -1, 4,
486
82, 127, 83, 98, -1, 4, 82, 83, -1, 51,
487
113, -1, 51, 78, 99, 79, -1, 113, -1, 99,
488
81, 113, -1, 15, -1, 14, -1, 6, -1, 8,
489
-1, 12, -1, 102, -1, 103, -1, 104, -1, 105,
490
-1, 106, -1, 7, 107, -1, 7, -1, 9, 107,
491
-1, 9, -1, 11, 107, -1, 11, -1, 10, 107,
492
-1, 10, -1, 13, 107, -1, 13, -1, 77, -1,
493
109, -1, 108, 109, -1, 118, 80, -1, 119, 80,
494
-1, 120, 80, -1, 129, 80, -1, 38, 113, 80,
495
-1, 111, 80, -1, 110, -1, 93, 80, -1, 88,
496
-1, 78, 108, 79, -1, 78, 79, -1, 80, -1,
497
32, 117, 109, -1, 32, 113, 109, -1, 32, 117,
498
109, 33, 109, -1, 32, 113, 109, 33, 109, -1,
499
34, 117, 109, -1, 34, 113, 109, -1, 35, 74,
500
113, 80, 117, 80, 113, 75, 109, -1, 35, 74,
501
113, 80, 113, 80, 113, 75, 109, -1, 41, 74,
502
75, 109, -1, 41, 74, 113, 81, 113, 75, 109,
503
-1, 39, 74, 113, 75, 109, -1, 39, 74, 113,
504
81, 113, 81, 113, 75, 109, -1, 40, 74, 113,
505
75, 109, -1, 40, 74, 113, 81, 113, 75, 109,
506
-1, 40, 74, 113, 81, 113, 81, 113, 75, 109,
507
-1, 40, 74, 113, 81, 113, 81, 113, 81, 113,
508
75, 109, -1, 112, 127, -1, 112, -1, 37, -1,
509
36, -1, 115, -1, 113, 71, 113, -1, 113, 69,
510
113, -1, 113, 70, 113, -1, 113, 68, 113, -1,
511
113, 66, 113, -1, 113, 67, 113, -1, 67, 113,
512
-1, 114, -1, 117, 56, 113, 57, 113, -1, 101,
513
113, -1, 127, -1, 122, -1, 4, -1, 5, 82,
514
113, 83, -1, 77, -1, 119, -1, 120, -1, 129,
515
-1, 118, -1, 74, 113, 75, -1, 74, 113, 81,
516
113, 81, 113, 75, -1, 74, 113, 81, 113, 81,
517
113, 81, 113, 81, 113, 81, 113, 81, 113, 81,
518
113, 81, 113, 81, 113, 81, 113, 81, 113, 81,
519
113, 81, 113, 81, 113, 81, 113, 75, -1, 60,
520
-1, 65, -1, 61, -1, 64, -1, 63, -1, 62,
521
-1, 74, 117, 75, -1, 113, 116, 113, -1, 117,
522
59, 117, -1, 117, 58, 117, -1, 72, 117, -1,
523
4, 51, 113, -1, 4, 55, 113, -1, 4, 54,
524
113, -1, 4, 53, 113, -1, 4, 52, 113, -1,
525
5, 82, 113, 83, 51, 113, -1, 5, 82, 113,
526
83, 55, 113, -1, 5, 82, 113, 83, 54, 113,
527
-1, 5, 82, 113, 83, 53, 113, -1, 5, 82,
528
113, 83, 52, 113, -1, 4, 74, 121, 75, -1,
529
4, 74, 75, -1, 3, 74, 121, 75, -1, 3,
530
74, 75, -1, 113, -1, 121, 81, 113, -1, 123,
531
74, 124, 125, 126, 75, -1, 123, 74, 124, 126,
532
75, -1, 123, 74, 124, 125, 75, -1, 123, 74,
533
124, 75, -1, 42, -1, 43, -1, 44, -1, 45,
534
-1, 46, -1, 113, -1, 82, 113, 83, -1, 81,
535
113, -1, 126, 81, 113, -1, 76, -1, 22, -1,
536
20, -1, 28, -1, 16, -1, 23, -1, 24, -1,
537
25, -1, 26, -1, 27, -1, 30, -1, 128, 74,
538
113, 81, 4, 75, -1, 128, 74, 113, 81, 113,
539
81, 4, 75, -1, 128, 74, 113, 81, 5, 75,
540
-1, 128, 74, 113, 81, 113, 81, 5, 75, -1
543
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
544
static const unsigned short yyrline[] =
546
0, 167, 167, 168, 173, 174, 178, 191, 207, 214,
547
227, 266, 289, 297, 305, 318, 334, 337, 340, 343,
548
346, 349, 355, 368, 379, 383, 454, 530, 605, 656,
549
660, 664, 670, 678, 687, 694, 701, 710, 717, 731,
550
741, 751, 763, 776, 782, 797, 803, 811, 812, 816,
551
820, 824, 828, 829, 830, 831, 832, 836, 840, 847,
552
851, 858, 862, 869, 873, 880, 884, 891, 895, 901,
553
909, 910, 918, 926, 931, 940, 941, 942, 968, 969,
554
970, 971, 972, 980, 994, 1003, 1022, 1028, 1041, 1056,
555
1078, 1084, 1098, 1107, 1123, 1136, 1150, 1167, 1188, 1189,
556
1193, 1197, 1205, 1206, 1217, 1228, 1239, 1250, 1261, 1272,
557
1282, 1283, 1296, 1342, 1346, 1347, 1351, 1356, 1360, 1361,
558
1362, 1363, 1364, 1367, 1375, 1399, 1400, 1401, 1402, 1403,
559
1404, 1408, 1411, 1418, 1425, 1432, 1440, 1446, 1460, 1474,
560
1488, 1502, 1509, 1527, 1545, 1563, 1584, 1594, 1605, 1627,
561
1643, 1649, 1657, 1671, 1685, 1691, 1700, 1706, 1712, 1718,
562
1724, 1733, 1740, 1744, 1750, 1759, 1764, 1765, 1766, 1767,
563
1768, 1769, 1770, 1771, 1772, 1773, 1778, 1799, 1829, 1850
567
#if YYDEBUG || YYERROR_VERBOSE
568
/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
569
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
570
static const char *const yytname[] =
572
"$end", "error", "$undefined", "IDENTIFIER", "SYMBOL", "ARRAY_SYMBOL",
573
"TYPE_FLOAT", "TYPE_POINT", "TYPE_STRING", "TYPE_COLOR", "TYPE_NORMAL",
574
"TYPE_VECTOR", "TYPE_VOID", "TYPE_MATRIX", "TYPE_UNIFORM",
575
"TYPE_VARYING", "SHADER_TYPE_SURFACE", "SHADER_TYPE_VOLUME",
576
"SHADER_TYPE_IMAGER", "SHADER_TYPE_TRANSFORMATION",
577
"SHADER_TYPE_DISPLACEMENT", "SHADER_TYPE_LIGHT",
578
"SHADER_TYPE_ATMOSPHERE", "ATTRIBUTE", "OPTION", "RENDERERINFO",
579
"INCIDENT", "OPPOSITE", "LIGHTSOURCE", "EXTERN", "TEXTUREINFO",
580
"OUTPUT", "IF", "ELSE", "WHILE", "FOR", "CONTINUE", "BREAK", "RETURN",
581
"ILLUMINATE", "ILLUMINANCE", "SOLAR", "TEXTUREMAP", "ENVIRONMENT",
582
"BUMP", "SHADOW", "OCCLUSION", "SETXCOMP", "SETYCOMP", "SETZCOMP",
583
"SETCOMP", "'='", "DIV_ASSIGN", "MUL_ASSIGN", "SUB_ASSIGN",
584
"ADD_ASSIGN", "'?'", "':'", "OR_OP", "AND_OP", "'>'", "'<'", "NE_OP",
585
"EQ_OP", "LE_OP", "GE_OP", "'+'", "'-'", "'^'", "'/'", "'*'", "'.'",
586
"'!'", "NEG", "'('", "')'", "FLOAT_CONSTANT", "STRING_LITERAL", "'{'",
587
"'}'", "';'", "','", "'['", "']'", "$accept", "file", "definitions",
588
"shader_definition", "function_definition", "function_declaration",
589
"shader_type", "formals", "formal_variable_definitions",
590
"variable_definitions", "typespec", "def_expressions", "def_expression",
591
"def_init", "def_array_initialisers", "array_initialisers", "detail",
592
"type", "pspace", "cspace", "vspace", "nspace", "mspace", "spacetype",
593
"statements", "statement", "loop_control", "loop_modstmt", "loop_mod",
594
"expression", "cast_expr", "primary", "relational_operator", "relation",
595
"assignexpression", "procedurecall", "unresolvedcall", "proc_arguments",
596
"texture", "texture_type", "texture_filename", "channel",
597
"texture_arguments", "number", "comm_type", "comm_function", 0
602
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
604
static const unsigned short yytoknum[] =
606
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
607
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
608
275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
609
285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
610
295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
611
305, 61, 306, 307, 308, 309, 63, 58, 310, 311,
612
62, 60, 312, 313, 314, 315, 43, 45, 94, 47,
613
42, 46, 33, 316, 40, 41, 317, 318, 123, 125,
618
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
619
static const unsigned char yyr1[] =
621
0, 84, 85, 85, 86, 86, 87, 87, 87, 87,
622
88, 88, 89, 89, 89, 89, 90, 90, 90, 90,
623
90, 90, 91, 91, 91, 92, 92, 93, 93, 94,
624
94, 95, 95, 96, 96, 96, 96, 96, 96, 96,
625
96, 96, 96, 97, 98, 99, 99, 100, 100, 101,
626
101, 101, 101, 101, 101, 101, 101, 102, 102, 103,
627
103, 104, 104, 105, 105, 106, 106, 107, 108, 108,
628
109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
629
109, 109, 109, 109, 109, 109, 110, 110, 110, 110,
630
110, 110, 110, 110, 110, 110, 110, 110, 111, 111,
631
112, 112, 113, 113, 113, 113, 113, 113, 113, 113,
632
113, 113, 114, 115, 115, 115, 115, 115, 115, 115,
633
115, 115, 115, 115, 115, 116, 116, 116, 116, 116,
634
116, 117, 117, 117, 117, 117, 118, 118, 118, 118,
635
118, 118, 118, 118, 118, 118, 119, 119, 120, 120,
636
121, 121, 122, 122, 122, 122, 123, 123, 123, 123,
637
123, 124, 125, 126, 126, 127, 128, 128, 128, 128,
638
128, 128, 128, 128, 128, 128, 129, 129, 129, 129
641
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
642
static const unsigned char yyr2[] =
644
0, 2, 1, 2, 1, 1, 8, 8, 7, 7,
645
6, 5, 3, 2, 3, 2, 1, 1, 1, 1,
646
1, 1, 1, 3, 2, 2, 3, 2, 3, 2,
647
1, 1, 3, 2, 1, 4, 5, 3, 2, 1,
648
4, 5, 3, 2, 4, 1, 3, 1, 1, 1,
649
1, 1, 1, 1, 1, 1, 1, 2, 1, 2,
650
1, 2, 1, 2, 1, 2, 1, 1, 1, 2,
651
2, 2, 2, 2, 3, 2, 1, 2, 1, 3,
652
2, 1, 3, 3, 5, 5, 3, 3, 9, 9,
653
4, 7, 5, 9, 5, 7, 9, 11, 2, 1,
654
1, 1, 1, 3, 3, 3, 3, 3, 3, 2,
655
1, 5, 2, 1, 1, 1, 4, 1, 1, 1,
656
1, 1, 3, 7, 33, 1, 1, 1, 1, 1,
657
1, 3, 3, 3, 3, 2, 3, 3, 3, 3,
658
3, 6, 6, 6, 6, 6, 4, 3, 4, 3,
659
1, 3, 6, 5, 5, 4, 1, 1, 1, 1,
660
1, 1, 3, 2, 3, 1, 1, 1, 1, 1,
661
1, 1, 1, 1, 1, 1, 6, 8, 6, 8
664
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
665
STATE-NUM when YYTABLE doesn't specify something else to do. Zero
666
means the default is an error. */
667
static const unsigned char yydefact[] =
669
0, 0, 0, 49, 58, 50, 60, 64, 62, 51,
670
66, 48, 47, 17, 18, 21, 20, 19, 16, 0,
671
2, 4, 5, 0, 0, 0, 0, 30, 52, 53,
672
54, 55, 56, 13, 15, 67, 57, 59, 63, 61,
673
65, 1, 3, 0, 0, 0, 22, 0, 0, 0,
674
0, 0, 29, 0, 0, 0, 24, 34, 39, 25,
675
31, 0, 0, 12, 14, 26, 0, 0, 0, 169,
676
167, 166, 170, 171, 172, 173, 174, 168, 0, 175,
677
0, 0, 0, 101, 100, 0, 0, 0, 0, 0,
678
81, 78, 0, 0, 0, 68, 76, 0, 99, 0,
679
0, 0, 0, 0, 0, 23, 0, 0, 33, 0,
680
38, 0, 0, 0, 0, 0, 13, 0, 0, 0,
681
0, 0, 15, 0, 0, 0, 115, 0, 156, 157,
682
158, 159, 160, 0, 0, 0, 165, 117, 0, 0,
683
110, 102, 0, 121, 118, 119, 114, 0, 113, 120,
684
0, 0, 0, 0, 0, 0, 0, 0, 80, 0,
685
77, 34, 39, 27, 11, 69, 75, 98, 70, 71,
686
72, 0, 73, 0, 43, 37, 0, 42, 0, 32,
687
0, 0, 0, 0, 149, 150, 0, 136, 140, 139,
688
138, 137, 147, 0, 0, 28, 0, 0, 0, 109,
689
0, 135, 0, 0, 112, 125, 127, 130, 129, 128,
690
126, 0, 0, 0, 0, 0, 0, 83, 0, 0,
691
0, 0, 82, 0, 87, 86, 0, 74, 0, 0,
692
0, 0, 79, 0, 10, 35, 40, 0, 0, 0,
693
0, 148, 0, 146, 0, 0, 122, 0, 131, 107,
694
108, 106, 104, 105, 103, 0, 132, 0, 134, 133,
695
0, 161, 0, 0, 0, 0, 0, 0, 90, 0,
696
0, 0, 36, 41, 8, 0, 9, 0, 151, 0,
697
0, 0, 0, 0, 116, 0, 85, 0, 84, 155,
698
0, 0, 0, 0, 0, 0, 92, 0, 94, 0,
699
0, 115, 0, 0, 0, 6, 7, 141, 145, 144,
700
143, 142, 0, 111, 163, 0, 154, 0, 153, 0,
701
0, 0, 0, 0, 0, 0, 176, 178, 0, 0,
702
45, 0, 162, 152, 164, 0, 0, 0, 95, 0,
703
91, 0, 0, 44, 0, 123, 0, 0, 0, 0,
704
0, 0, 177, 179, 46, 0, 89, 88, 93, 96,
705
0, 0, 0, 0, 97, 0, 0, 0, 0, 0,
706
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
707
0, 0, 0, 0, 0, 0, 0, 124
710
/* YYDEFGOTO[NTERM-NUM]. */
711
static const short yydefgoto[] =
713
-1, 19, 20, 21, 91, 23, 24, 45, 46, 92,
714
93, 59, 60, 108, 272, 329, 26, 138, 28, 29,
715
30, 31, 32, 36, 94, 95, 96, 97, 98, 185,
716
140, 141, 218, 154, 143, 144, 145, 186, 146, 147,
717
262, 292, 293, 148, 102, 149
720
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
722
#define YYPACT_NINF -119
723
static const short yypact[] =
725
2133, -33, -28, -119, -17, -119, -17, -17, -17, -119,
726
-17, -119, -119, -119, -119, -119, -119, -119, -119, 971,
727
-119, -119, -119, 102, 17, 80, 531, -119, -119, -119,
728
-119, -119, -119, -119, -119, -119, -119, -119, -119, -119,
729
-119, -119, -119, 461, -9, -16, -119, 115, -25, -1,
730
18, 29, -119, 115, 1417, 28, 424, -37, -34, 14,
731
-119, 326, 376, -119, -119, 14, 52, 83, 101, -119,
732
-119, -119, -119, -119, -119, -119, -119, -119, 461, -119,
733
1681, 1681, 107, -119, -119, 1681, 110, 116, 118, 929,
734
-119, -119, 109, 152, 990, -119, -119, 113, 125, 122,
735
124, 130, 139, 135, 1417, -119, 1681, -65, -119, -11,
736
-119, 115, 138, 21, 146, 99, 1681, 1681, 1681, 1681,
737
1681, 1681, 1681, 1681, 115, 143, 117, 149, -119, -119,
738
-119, -119, -119, 1681, 1681, 1681, -119, -119, 1681, 785,
739
-119, -119, 870, -119, -119, -119, -119, 148, -119, -119,
740
785, 870, 1681, 2016, 106, 1681, 1681, 1456, -119, 1051,
741
-119, -46, -35, 14, -119, -119, -119, -119, -119, -119,
742
-119, 1681, -119, 1112, 2187, -119, 150, -119, 159, -119,
743
1417, 154, 1417, 157, -119, 2187, -18, 2187, 2187, 2187,
744
2187, 2187, -119, -7, 499, 14, 1531, 1606, 1681, -119,
745
2187, -119, 972, 66, -119, -119, -119, -119, -119, -119,
746
-119, 1681, 1681, 1681, 1681, 1681, 1681, 193, 1681, 1681,
747
1681, 1681, 194, 1681, -119, -119, 2037, -119, 1033, 1094,
748
1417, 1338, -119, 1443, -119, 177, 177, 1173, 1417, 1234,
749
1417, -119, 1681, -119, 145, 625, -119, 1681, -119, 180,
750
180, -63, 172, 172, -119, 1417, 2187, 2175, 187, -119,
751
1417, 2187, -50, 1681, 1417, 1681, 1417, 1681, -119, 1681,
752
1756, 174, -119, -119, -119, 1295, -119, 1356, 2187, 1681,
753
1681, 1681, 1681, 1681, 145, 1518, -119, 1681, -119, -119,
754
1681, 1681, 5, 7, 2058, -29, -119, 1593, -119, 1155,
755
852, 92, -42, 1668, 1681, -119, -119, 2187, 2187, 2187,
756
2187, 2187, 1681, 2187, 2187, 690, -119, 16, -119, 1681,
757
1681, 1681, 1681, 1417, 1681, 1417, -119, -119, 144, 48,
758
2187, 1216, -119, -119, 2187, 2095, 2111, 2127, -119, 1277,
759
-119, 178, 179, -119, 1681, -119, 1681, 1417, 1417, 1417,
760
1417, 1681, -119, -119, 2187, 1743, -119, -119, -119, -119,
761
2143, 1681, 1417, 1774, -119, 1681, 1796, 1681, 1818, 1681,
762
1840, 1681, 1862, 1681, 1884, 1681, 1906, 1681, 1928, 1681,
763
1950, 1681, 1972, 1681, 1994, 1681, 2159, -119
766
/* YYPGOTO[NTERM-NUM]. */
767
static const short yypgoto[] =
769
-119, -119, 238, -119, 3, -119, -119, 114, 203, -119,
770
15, -43, 151, -57, 25, -119, -119, 0, -119, -119,
771
-119, -119, -119, 199, -80, 510, -119, -119, -119, 360,
772
-119, -119, -119, -68, -52, -19, 140, -118, -119, -119,
773
-119, -119, -27, -54, -119, 270
776
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
777
positive, shift that token. If negative, reduce the rule which
778
number is the opposite. If zero, do what YYDEFACT says.
779
If YYTABLE_NINF, syntax error. */
780
#define YYTABLE_NINF -1
781
static const unsigned short yytable[] =
783
27, 110, 99, 22, 193, 106, 214, 215, 216, 159,
784
65, 136, 142, 151, 106, 25, 106, 106, 175, 27,
785
48, 49, 22, 27, 173, 289, 52, 219, 63, 220,
786
221, 290, 291, 327, 25, 100, 107, 99, 47, 64,
787
198, 33, 99, 27, 167, 107, 34, 109, 109, 61,
788
163, 321, 99, 176, 27, 178, 27, 241, 53, 55,
789
35, 27, 27, 242, 56, 136, 201, 203, 243, 54,
790
100, 47, 177, 62, 242, 100, 47, 47, 27, 193,
791
316, 195, 318, 50, 51, 100, 290, 99, 319, 27,
792
99, 333, 63, 124, 27, 111, 181, 319, 99, 99,
793
237, 56, 239, 64, 27, 110, 104, 99, 3, 4,
794
5, 6, 7, 8, 9, 10, 11, 12, 57, 58,
795
100, 99, 219, 100, 220, 221, 116, 343, 99, 344,
796
99, 100, 100, 43, 117, 118, 119, 120, 121, 27,
797
100, 248, 27, 117, 118, 119, 120, 121, 341, 342,
798
27, 27, 258, 259, 100, 161, 162, 122, 275, 27,
799
277, 100, 219, 100, 220, 221, 197, 326, 117, 118,
800
119, 120, 121, 27, 183, 113, 115, 44, 99, 56,
801
27, 152, 27, 123, 155, 99, 99, 99, 99, 160,
802
156, 197, 157, 166, 101, 295, 279, 280, 281, 282,
803
283, 136, 168, 99, 169, 37, 38, 39, 99, 40,
804
170, 100, 99, 171, 99, 172, 180, 196, 100, 100,
805
100, 100, 223, 99, 182, 99, 255, 260, 271, 101,
806
27, 198, 238, 235, 101, 240, 100, 27, 27, 27,
807
27, 100, 236, 216, 101, 100, 221, 100, 213, 214,
808
215, 216, 304, 352, 353, 27, 100, 42, 100, 105,
809
27, 273, 179, 0, 27, 317, 27, 0, 0, 0,
810
0, 99, 0, 99, 0, 27, 0, 27, 0, 101,
811
0, 0, 101, 0, 0, 0, 0, 0, 0, 0,
812
101, 101, 0, 0, 0, 99, 99, 99, 99, 101,
813
0, 0, 0, 0, 100, 0, 100, 0, 0, 0,
814
99, 0, 0, 101, 0, 0, 0, 0, 0, 0,
815
101, 0, 101, 27, 103, 27, 0, 0, 100, 100,
816
100, 100, 3, 4, 5, 6, 7, 8, 9, 10,
817
11, 12, 0, 100, 0, 0, 0, 27, 27, 27,
818
27, 0, 0, 0, 0, 0, 0, 43, 0, 103,
819
0, 0, 27, 0, 103, 0, 0, 0, 0, 0,
820
101, 0, 0, 0, 103, 0, 0, 101, 101, 101,
821
101, 0, 3, 4, 5, 6, 7, 8, 9, 10,
822
11, 12, 0, 0, 0, 101, 0, 0, 0, 0,
823
101, 112, 0, 0, 101, 0, 101, 43, 0, 103,
824
0, 0, 103, 0, 0, 101, 0, 101, 0, 0,
825
103, 103, 0, 0, 0, 0, 0, 0, 0, 103,
826
3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
827
139, 150, 0, 103, 0, 153, 0, 0, 0, 0,
828
103, 114, 103, 0, 0, 43, 0, 0, 0, 0,
829
0, 0, 0, 101, 0, 101, 174, 3, 4, 5,
830
6, 7, 8, 9, 10, 11, 12, 187, 188, 189,
831
190, 191, 0, 194, 0, 0, 0, 101, 101, 101,
832
101, 0, 0, 199, 200, 202, 0, 0, 204, 0,
833
103, 0, 101, 0, 0, 0, 0, 103, 103, 103,
834
103, 0, 226, 0, 0, 228, 229, 231, 0, 0,
835
0, 0, 0, 0, 0, 103, 0, 0, 0, 0,
836
103, 233, 0, 0, 103, 0, 103, 3, 4, 5,
837
6, 7, 8, 9, 10, 103, 0, 103, 0, 0,
838
0, 0, 0, 0, 0, 0, 0, 0, 245, 205,
839
206, 207, 208, 209, 210, 211, 212, 213, 214, 215,
840
216, 249, 250, 251, 252, 253, 254, 0, 256, 257,
841
200, 200, 244, 261, 0, 0, 0, 0, 0, 0,
842
0, 0, 0, 103, 0, 103, 0, 0, 0, 0,
843
0, 0, 278, 0, 165, 0, 0, 285, 0, 0,
844
0, 0, 0, 0, 0, 0, 0, 103, 103, 103,
845
103, 0, 0, 294, 0, 297, 0, 299, 0, 300,
846
303, 0, 103, 0, 0, 0, 0, 0, 0, 307,
847
308, 309, 310, 311, 0, 0, 0, 313, 0, 217,
848
314, 315, 222, 0, 0, 0, 0, 0, 0, 0,
849
224, 225, 0, 0, 330, 0, 0, 0, 0, 165,
850
0, 0, 331, 0, 0, 0, 0, 0, 0, 334,
851
335, 336, 337, 165, 339, 205, 206, 207, 208, 209,
852
210, 211, 212, 213, 214, 215, 216, 0, 0, 0,
853
0, 0, 0, 0, 354, 0, 355, 0, 284, 0,
854
0, 360, 0, 0, 0, 0, 0, 0, 0, 0,
855
0, 363, 0, 0, 0, 366, 0, 368, 0, 370,
856
0, 372, 0, 374, 0, 376, 0, 378, 0, 380,
857
268, 382, 0, 384, 0, 386, 0, 165, 0, 165,
858
205, 206, 207, 208, 209, 210, 211, 212, 213, 214,
859
215, 216, 0, 0, 0, 286, 0, 0, 0, 0,
860
288, 0, 0, 332, 296, 0, 298, 0, 0, 0,
861
0, 0, 0, 0, 0, 165, 0, 165, 66, 67,
862
68, 3, 4, 5, 6, 7, 8, 9, 10, 11,
863
12, 69, 0, 0, 0, 70, 0, 71, 72, 73,
864
74, 75, 76, 77, 78, 79, 0, 80, 0, 81,
865
82, 83, 84, 85, 86, 87, 88, 0, 0, 0,
866
0, 0, 0, 338, 0, 340, 0, 0, 0, 0,
867
0, 0, 0, 0, 0, 205, 206, 207, 208, 209,
868
210, 211, 212, 213, 214, 215, 216, 356, 357, 358,
869
359, 0, 0, 89, 0, 90, 0, 0, 0, 0,
870
0, 0, 364, 66, 67, 68, 3, 4, 5, 6,
871
7, 8, 9, 10, 11, 12, 69, 0, 0, 0,
872
70, 0, 71, 72, 73, 74, 75, 76, 77, 78,
873
79, 0, 80, 0, 81, 82, 83, 84, 85, 86,
874
87, 88, 205, 206, 207, 208, 209, 210, 211, 212,
875
213, 214, 215, 216, 0, 0, 219, 325, 220, 221,
876
0, 0, 66, 67, 68, 3, 4, 5, 6, 7,
877
8, 9, 10, 11, 12, 69, 0, 0, 89, 70,
878
90, 71, 72, 73, 74, 75, 76, 77, 78, 79,
879
0, 80, 0, 81, 82, 83, 84, 85, 86, 87,
880
88, 41, 0, 0, 1, 2, 0, 3, 4, 5,
881
6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
882
16, 17, 18, 66, 67, 68, 3, 4, 5, 6,
883
7, 8, 9, 10, 11, 12, 69, 89, 158, 90,
884
70, 0, 71, 72, 73, 74, 75, 76, 77, 78,
885
79, 0, 80, 0, 81, 82, 83, 84, 85, 86,
886
87, 88, 205, 206, 207, 208, 209, 210, 211, 212,
887
213, 214, 215, 216, 0, 0, 0, 246, 0, 0,
888
0, 0, 0, 247, 66, 67, 68, 3, 4, 5,
889
6, 7, 8, 9, 10, 11, 12, 69, 89, 164,
890
90, 70, 0, 71, 72, 73, 74, 75, 76, 77,
891
78, 79, 0, 80, 0, 81, 82, 83, 84, 85,
892
86, 87, 88, 205, 206, 207, 208, 209, 210, 211,
893
212, 213, 214, 215, 216, 0, 0, 0, 264, 0,
894
0, 0, 0, 0, 265, 66, 67, 68, 3, 4,
895
5, 6, 7, 8, 9, 10, 11, 12, 69, 89,
896
232, 90, 70, 0, 71, 72, 73, 74, 75, 76,
897
77, 78, 79, 0, 80, 0, 81, 82, 83, 84,
898
85, 86, 87, 88, 205, 206, 207, 208, 209, 210,
899
211, 212, 213, 214, 215, 216, 0, 0, 0, 266,
900
0, 0, 0, 0, 0, 267, 66, 67, 68, 3,
901
4, 5, 6, 7, 8, 9, 10, 11, 12, 69,
902
89, 234, 90, 70, 0, 71, 72, 73, 74, 75,
903
76, 77, 78, 79, 0, 80, 0, 81, 82, 83,
904
84, 85, 86, 87, 88, 205, 206, 207, 208, 209,
905
210, 211, 212, 213, 214, 215, 216, 0, 0, 0,
906
323, 0, 0, 0, 0, 0, 324, 66, 67, 68,
907
3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
908
69, 89, 274, 90, 70, 0, 71, 72, 73, 74,
909
75, 76, 77, 78, 79, 0, 80, 0, 81, 82,
910
83, 84, 85, 86, 87, 88, 205, 206, 207, 208,
911
209, 210, 211, 212, 213, 214, 215, 216, 0, 0,
912
0, 345, 0, 0, 0, 0, 0, 346, 66, 67,
913
68, 3, 4, 5, 6, 7, 8, 9, 10, 11,
914
12, 69, 89, 276, 90, 70, 0, 71, 72, 73,
915
74, 75, 76, 77, 78, 79, 0, 80, 0, 81,
916
82, 83, 84, 85, 86, 87, 88, 205, 206, 207,
917
208, 209, 210, 211, 212, 213, 214, 215, 216, 0,
918
0, 0, 350, 0, 0, 0, 0, 0, 351, 66,
919
67, 68, 3, 4, 5, 6, 7, 8, 9, 10,
920
11, 12, 69, 89, 305, 90, 70, 0, 71, 72,
921
73, 74, 75, 76, 77, 78, 79, 0, 80, 0,
922
81, 82, 83, 84, 85, 86, 87, 88, 205, 206,
923
207, 208, 209, 210, 211, 212, 213, 214, 215, 216,
924
0, 0, 0, 0, 0, 0, 0, 0, 0, 269,
925
66, 67, 68, 3, 4, 5, 6, 7, 8, 9,
926
10, 11, 12, 69, 89, 306, 90, 70, 0, 71,
927
72, 73, 74, 75, 76, 77, 78, 79, 0, 80,
928
0, 81, 82, 83, 84, 85, 86, 87, 88, 125,
929
126, 127, 3, 4, 5, 6, 7, 8, 9, 10,
930
0, 0, 69, 0, 0, 0, 70, 0, 71, 72,
931
73, 74, 75, 76, 77, 0, 79, 0, 0, 0,
932
0, 0, 0, 0, 0, 89, 0, 90, 128, 129,
933
130, 131, 132, 205, 206, 207, 208, 209, 210, 211,
934
212, 213, 214, 215, 216, 0, 0, 0, 0, 0,
935
0, 0, 0, 133, 270, 0, 0, 0, 134, 0,
936
135, 230, 136, 137, 125, 126, 127, 3, 4, 5,
937
6, 7, 8, 9, 10, 0, 0, 69, 0, 0,
938
0, 70, 0, 71, 72, 73, 74, 75, 76, 77,
939
0, 79, 0, 0, 0, 0, 0, 0, 0, 0,
940
0, 0, 0, 128, 129, 130, 131, 132, 205, 206,
941
207, 208, 209, 210, 211, 212, 213, 214, 215, 216,
942
0, 0, 0, 0, 0, 0, 0, 0, 133, 312,
943
0, 0, 0, 134, 0, 135, 184, 136, 137, 125,
944
126, 127, 3, 4, 5, 6, 7, 8, 9, 10,
945
0, 0, 69, 0, 0, 0, 70, 0, 71, 72,
946
73, 74, 75, 76, 77, 0, 79, 0, 0, 0,
947
0, 0, 0, 0, 0, 0, 0, 0, 128, 129,
948
130, 131, 132, 205, 206, 207, 208, 209, 210, 211,
949
212, 213, 214, 215, 216, 0, 0, 0, 0, 0,
950
0, 0, 0, 133, 322, 0, 0, 0, 134, 0,
951
135, 192, 136, 137, 125, 126, 127, 3, 4, 5,
952
6, 7, 8, 9, 10, 0, 0, 69, 0, 0,
953
0, 70, 0, 71, 72, 73, 74, 75, 76, 77,
954
0, 79, 0, 0, 0, 0, 0, 0, 0, 0,
955
0, 0, 0, 128, 129, 130, 131, 132, 205, 206,
956
207, 208, 209, 210, 211, 212, 213, 214, 215, 216,
957
0, 0, 0, 0, 0, 0, 0, 0, 133, 328,
958
0, 0, 0, 134, 0, 135, 0, 136, 137, 125,
959
301, 302, 3, 4, 5, 6, 7, 8, 9, 10,
960
0, 0, 69, 0, 0, 0, 70, 0, 71, 72,
961
73, 74, 75, 76, 77, 0, 79, 0, 0, 0,
962
0, 0, 0, 0, 0, 0, 0, 0, 128, 129,
963
130, 131, 132, 205, 206, 207, 208, 209, 210, 211,
964
212, 213, 214, 215, 216, 0, 0, 0, 0, 0,
965
0, 0, 0, 133, 361, 0, 0, 0, 134, 0,
966
135, 0, 136, 137, 205, 206, 207, 208, 209, 210,
967
211, 212, 213, 214, 215, 216, 0, 0, 0, 0,
968
0, 0, 0, 0, 0, 365, 205, 206, 207, 208,
969
209, 210, 211, 212, 213, 214, 215, 216, 0, 0,
970
0, 0, 0, 0, 0, 0, 0, 367, 205, 206,
971
207, 208, 209, 210, 211, 212, 213, 214, 215, 216,
972
0, 0, 0, 0, 0, 0, 0, 0, 0, 369,
973
205, 206, 207, 208, 209, 210, 211, 212, 213, 214,
974
215, 216, 0, 0, 0, 0, 0, 0, 0, 0,
975
0, 371, 205, 206, 207, 208, 209, 210, 211, 212,
976
213, 214, 215, 216, 0, 0, 0, 0, 0, 0,
977
0, 0, 0, 373, 205, 206, 207, 208, 209, 210,
978
211, 212, 213, 214, 215, 216, 0, 0, 0, 0,
979
0, 0, 0, 0, 0, 375, 205, 206, 207, 208,
980
209, 210, 211, 212, 213, 214, 215, 216, 0, 0,
981
0, 0, 0, 0, 0, 0, 0, 377, 205, 206,
982
207, 208, 209, 210, 211, 212, 213, 214, 215, 216,
983
0, 0, 0, 0, 0, 0, 0, 0, 0, 379,
984
205, 206, 207, 208, 209, 210, 211, 212, 213, 214,
985
215, 216, 0, 0, 0, 0, 0, 0, 0, 0,
986
0, 381, 205, 206, 207, 208, 209, 210, 211, 212,
987
213, 214, 215, 216, 0, 0, 0, 0, 0, 0,
988
0, 0, 0, 383, 205, 206, 207, 208, 209, 210,
989
211, 212, 213, 214, 215, 216, 0, 0, 0, 0,
990
0, 0, 0, 0, 0, 385, 205, 206, 207, 208,
991
209, 210, 211, 212, 213, 214, 215, 216, 0, 0,
992
0, 0, 0, 0, 0, 0, 227, 205, 206, 207,
993
208, 209, 210, 211, 212, 213, 214, 215, 216, 0,
994
0, 0, 0, 0, 0, 0, 0, 263, 205, 206,
995
207, 208, 209, 210, 211, 212, 213, 214, 215, 216,
996
0, 0, 0, 0, 0, 0, 1, 2, 320, 3,
997
4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
998
14, 15, 16, 17, 18, 205, 206, 207, 208, 209,
999
210, 211, 212, 213, 214, 215, 216, 0, 0, 0,
1000
347, 205, 206, 207, 208, 209, 210, 211, 212, 213,
1001
214, 215, 216, 0, 0, 0, 348, 205, 206, 207,
1002
208, 209, 210, 211, 212, 213, 214, 215, 216, 0,
1003
0, 0, 349, 205, 206, 207, 208, 209, 210, 211,
1004
212, 213, 214, 215, 216, 0, 0, 0, 362, 205,
1005
206, 207, 208, 209, 210, 211, 212, 213, 214, 215,
1006
216, 0, 287, 0, 387, 205, 206, 207, 208, 209,
1007
210, 211, 212, 213, 214, 215, 216, 205, 206, 207,
1008
208, 209, 210, 211, 212, 213, 214, 215, 216
1011
static const short yycheck[] =
1013
0, 58, 54, 0, 122, 51, 69, 70, 71, 89,
1014
53, 76, 80, 81, 51, 0, 51, 51, 83, 19,
1015
3, 4, 19, 23, 104, 75, 26, 56, 74, 58,
1016
59, 81, 82, 75, 19, 54, 82, 89, 23, 74,
1017
82, 74, 94, 43, 98, 82, 74, 82, 82, 74,
1018
93, 80, 104, 107, 54, 109, 56, 75, 43, 75,
1019
77, 61, 62, 81, 80, 76, 134, 135, 75, 78,
1020
89, 56, 83, 74, 81, 94, 61, 62, 78, 197,
1021
75, 124, 75, 3, 4, 104, 81, 139, 81, 89,
1022
142, 75, 74, 78, 94, 81, 75, 81, 150, 151,
1023
180, 80, 182, 74, 104, 162, 78, 159, 6, 7,
1024
8, 9, 10, 11, 12, 13, 14, 15, 3, 4,
1025
139, 173, 56, 142, 58, 59, 74, 79, 180, 81,
1026
182, 150, 151, 31, 51, 52, 53, 54, 55, 139,
1027
159, 75, 142, 51, 52, 53, 54, 55, 4, 5,
1028
150, 151, 220, 221, 173, 3, 4, 74, 238, 159,
1029
240, 180, 56, 182, 58, 59, 74, 75, 51, 52,
1030
53, 54, 55, 173, 75, 61, 62, 75, 230, 80,
1031
180, 74, 182, 82, 74, 237, 238, 239, 240, 80,
1032
74, 74, 74, 80, 54, 263, 51, 52, 53, 54,
1033
55, 76, 80, 255, 80, 6, 7, 8, 260, 10,
1034
80, 230, 264, 74, 266, 80, 78, 74, 237, 238,
1035
239, 240, 74, 275, 78, 277, 33, 33, 51, 89,
1036
230, 82, 78, 83, 94, 78, 255, 237, 238, 239,
1037
240, 260, 83, 71, 104, 264, 59, 266, 68, 69,
1038
70, 71, 78, 75, 75, 255, 275, 19, 277, 56,
1039
260, 236, 111, -1, 264, 292, 266, -1, -1, -1,
1040
-1, 323, -1, 325, -1, 275, -1, 277, -1, 139,
1041
-1, -1, 142, -1, -1, -1, -1, -1, -1, -1,
1042
150, 151, -1, -1, -1, 347, 348, 349, 350, 159,
1043
-1, -1, -1, -1, 323, -1, 325, -1, -1, -1,
1044
362, -1, -1, 173, -1, -1, -1, -1, -1, -1,
1045
180, -1, 182, 323, 54, 325, -1, -1, 347, 348,
1046
349, 350, 6, 7, 8, 9, 10, 11, 12, 13,
1047
14, 15, -1, 362, -1, -1, -1, 347, 348, 349,
1048
350, -1, -1, -1, -1, -1, -1, 31, -1, 89,
1049
-1, -1, 362, -1, 94, -1, -1, -1, -1, -1,
1050
230, -1, -1, -1, 104, -1, -1, 237, 238, 239,
1051
240, -1, 6, 7, 8, 9, 10, 11, 12, 13,
1052
14, 15, -1, -1, -1, 255, -1, -1, -1, -1,
1053
260, 75, -1, -1, 264, -1, 266, 31, -1, 139,
1054
-1, -1, 142, -1, -1, 275, -1, 277, -1, -1,
1055
150, 151, -1, -1, -1, -1, -1, -1, -1, 159,
1056
6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
1057
80, 81, -1, 173, -1, 85, -1, -1, -1, -1,
1058
180, 75, 182, -1, -1, 31, -1, -1, -1, -1,
1059
-1, -1, -1, 323, -1, 325, 106, 6, 7, 8,
1060
9, 10, 11, 12, 13, 14, 15, 117, 118, 119,
1061
120, 121, -1, 123, -1, -1, -1, 347, 348, 349,
1062
350, -1, -1, 133, 134, 135, -1, -1, 138, -1,
1063
230, -1, 362, -1, -1, -1, -1, 237, 238, 239,
1064
240, -1, 152, -1, -1, 155, 156, 157, -1, -1,
1065
-1, -1, -1, -1, -1, 255, -1, -1, -1, -1,
1066
260, 171, -1, -1, 264, -1, 266, 6, 7, 8,
1067
9, 10, 11, 12, 13, 275, -1, 277, -1, -1,
1068
-1, -1, -1, -1, -1, -1, -1, -1, 198, 60,
1069
61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
1070
71, 211, 212, 213, 214, 215, 216, -1, 218, 219,
1071
220, 221, 83, 223, -1, -1, -1, -1, -1, -1,
1072
-1, -1, -1, 323, -1, 325, -1, -1, -1, -1,
1073
-1, -1, 242, -1, 94, -1, -1, 247, -1, -1,
1074
-1, -1, -1, -1, -1, -1, -1, 347, 348, 349,
1075
350, -1, -1, 263, -1, 265, -1, 267, -1, 269,
1076
270, -1, 362, -1, -1, -1, -1, -1, -1, 279,
1077
280, 281, 282, 283, -1, -1, -1, 287, -1, 139,
1078
290, 291, 142, -1, -1, -1, -1, -1, -1, -1,
1079
150, 151, -1, -1, 304, -1, -1, -1, -1, 159,
1080
-1, -1, 312, -1, -1, -1, -1, -1, -1, 319,
1081
320, 321, 322, 173, 324, 60, 61, 62, 63, 64,
1082
65, 66, 67, 68, 69, 70, 71, -1, -1, -1,
1083
-1, -1, -1, -1, 344, -1, 346, -1, 83, -1,
1084
-1, 351, -1, -1, -1, -1, -1, -1, -1, -1,
1085
-1, 361, -1, -1, -1, 365, -1, 367, -1, 369,
1086
-1, 371, -1, 373, -1, 375, -1, 377, -1, 379,
1087
230, 381, -1, 383, -1, 385, -1, 237, -1, 239,
1088
60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
1089
70, 71, -1, -1, -1, 255, -1, -1, -1, -1,
1090
260, -1, -1, 83, 264, -1, 266, -1, -1, -1,
1091
-1, -1, -1, -1, -1, 275, -1, 277, 3, 4,
1092
5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1093
15, 16, -1, -1, -1, 20, -1, 22, 23, 24,
1094
25, 26, 27, 28, 29, 30, -1, 32, -1, 34,
1095
35, 36, 37, 38, 39, 40, 41, -1, -1, -1,
1096
-1, -1, -1, 323, -1, 325, -1, -1, -1, -1,
1097
-1, -1, -1, -1, -1, 60, 61, 62, 63, 64,
1098
65, 66, 67, 68, 69, 70, 71, 347, 348, 349,
1099
350, -1, -1, 78, -1, 80, -1, -1, -1, -1,
1100
-1, -1, 362, 3, 4, 5, 6, 7, 8, 9,
1101
10, 11, 12, 13, 14, 15, 16, -1, -1, -1,
1102
20, -1, 22, 23, 24, 25, 26, 27, 28, 29,
1103
30, -1, 32, -1, 34, 35, 36, 37, 38, 39,
1104
40, 41, 60, 61, 62, 63, 64, 65, 66, 67,
1105
68, 69, 70, 71, -1, -1, 56, 75, 58, 59,
1106
-1, -1, 3, 4, 5, 6, 7, 8, 9, 10,
1107
11, 12, 13, 14, 15, 16, -1, -1, 78, 20,
1108
80, 22, 23, 24, 25, 26, 27, 28, 29, 30,
1109
-1, 32, -1, 34, 35, 36, 37, 38, 39, 40,
1110
41, 0, -1, -1, 3, 4, -1, 6, 7, 8,
1111
9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
1112
19, 20, 21, 3, 4, 5, 6, 7, 8, 9,
1113
10, 11, 12, 13, 14, 15, 16, 78, 79, 80,
1114
20, -1, 22, 23, 24, 25, 26, 27, 28, 29,
1115
30, -1, 32, -1, 34, 35, 36, 37, 38, 39,
1116
40, 41, 60, 61, 62, 63, 64, 65, 66, 67,
1117
68, 69, 70, 71, -1, -1, -1, 75, -1, -1,
1118
-1, -1, -1, 81, 3, 4, 5, 6, 7, 8,
1119
9, 10, 11, 12, 13, 14, 15, 16, 78, 79,
1120
80, 20, -1, 22, 23, 24, 25, 26, 27, 28,
1121
29, 30, -1, 32, -1, 34, 35, 36, 37, 38,
1122
39, 40, 41, 60, 61, 62, 63, 64, 65, 66,
1123
67, 68, 69, 70, 71, -1, -1, -1, 75, -1,
1124
-1, -1, -1, -1, 81, 3, 4, 5, 6, 7,
1125
8, 9, 10, 11, 12, 13, 14, 15, 16, 78,
1126
79, 80, 20, -1, 22, 23, 24, 25, 26, 27,
1127
28, 29, 30, -1, 32, -1, 34, 35, 36, 37,
1128
38, 39, 40, 41, 60, 61, 62, 63, 64, 65,
1129
66, 67, 68, 69, 70, 71, -1, -1, -1, 75,
1130
-1, -1, -1, -1, -1, 81, 3, 4, 5, 6,
1131
7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
1132
78, 79, 80, 20, -1, 22, 23, 24, 25, 26,
1133
27, 28, 29, 30, -1, 32, -1, 34, 35, 36,
1134
37, 38, 39, 40, 41, 60, 61, 62, 63, 64,
1135
65, 66, 67, 68, 69, 70, 71, -1, -1, -1,
1136
75, -1, -1, -1, -1, -1, 81, 3, 4, 5,
1137
6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
1138
16, 78, 79, 80, 20, -1, 22, 23, 24, 25,
1139
26, 27, 28, 29, 30, -1, 32, -1, 34, 35,
1140
36, 37, 38, 39, 40, 41, 60, 61, 62, 63,
1141
64, 65, 66, 67, 68, 69, 70, 71, -1, -1,
1142
-1, 75, -1, -1, -1, -1, -1, 81, 3, 4,
1143
5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1144
15, 16, 78, 79, 80, 20, -1, 22, 23, 24,
1145
25, 26, 27, 28, 29, 30, -1, 32, -1, 34,
1146
35, 36, 37, 38, 39, 40, 41, 60, 61, 62,
1147
63, 64, 65, 66, 67, 68, 69, 70, 71, -1,
1148
-1, -1, 75, -1, -1, -1, -1, -1, 81, 3,
1149
4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
1150
14, 15, 16, 78, 79, 80, 20, -1, 22, 23,
1151
24, 25, 26, 27, 28, 29, 30, -1, 32, -1,
1152
34, 35, 36, 37, 38, 39, 40, 41, 60, 61,
1153
62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
1154
-1, -1, -1, -1, -1, -1, -1, -1, -1, 81,
1155
3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
1156
13, 14, 15, 16, 78, 79, 80, 20, -1, 22,
1157
23, 24, 25, 26, 27, 28, 29, 30, -1, 32,
1158
-1, 34, 35, 36, 37, 38, 39, 40, 41, 3,
1159
4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
1160
-1, -1, 16, -1, -1, -1, 20, -1, 22, 23,
1161
24, 25, 26, 27, 28, -1, 30, -1, -1, -1,
1162
-1, -1, -1, -1, -1, 78, -1, 80, 42, 43,
1163
44, 45, 46, 60, 61, 62, 63, 64, 65, 66,
1164
67, 68, 69, 70, 71, -1, -1, -1, -1, -1,
1165
-1, -1, -1, 67, 81, -1, -1, -1, 72, -1,
1166
74, 75, 76, 77, 3, 4, 5, 6, 7, 8,
1167
9, 10, 11, 12, 13, -1, -1, 16, -1, -1,
1168
-1, 20, -1, 22, 23, 24, 25, 26, 27, 28,
1169
-1, 30, -1, -1, -1, -1, -1, -1, -1, -1,
1170
-1, -1, -1, 42, 43, 44, 45, 46, 60, 61,
1171
62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
1172
-1, -1, -1, -1, -1, -1, -1, -1, 67, 81,
1173
-1, -1, -1, 72, -1, 74, 75, 76, 77, 3,
1174
4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
1175
-1, -1, 16, -1, -1, -1, 20, -1, 22, 23,
1176
24, 25, 26, 27, 28, -1, 30, -1, -1, -1,
1177
-1, -1, -1, -1, -1, -1, -1, -1, 42, 43,
1178
44, 45, 46, 60, 61, 62, 63, 64, 65, 66,
1179
67, 68, 69, 70, 71, -1, -1, -1, -1, -1,
1180
-1, -1, -1, 67, 81, -1, -1, -1, 72, -1,
1181
74, 75, 76, 77, 3, 4, 5, 6, 7, 8,
1182
9, 10, 11, 12, 13, -1, -1, 16, -1, -1,
1183
-1, 20, -1, 22, 23, 24, 25, 26, 27, 28,
1184
-1, 30, -1, -1, -1, -1, -1, -1, -1, -1,
1185
-1, -1, -1, 42, 43, 44, 45, 46, 60, 61,
1186
62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
1187
-1, -1, -1, -1, -1, -1, -1, -1, 67, 81,
1188
-1, -1, -1, 72, -1, 74, -1, 76, 77, 3,
1189
4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
1190
-1, -1, 16, -1, -1, -1, 20, -1, 22, 23,
1191
24, 25, 26, 27, 28, -1, 30, -1, -1, -1,
1192
-1, -1, -1, -1, -1, -1, -1, -1, 42, 43,
1193
44, 45, 46, 60, 61, 62, 63, 64, 65, 66,
1194
67, 68, 69, 70, 71, -1, -1, -1, -1, -1,
1195
-1, -1, -1, 67, 81, -1, -1, -1, 72, -1,
1196
74, -1, 76, 77, 60, 61, 62, 63, 64, 65,
1197
66, 67, 68, 69, 70, 71, -1, -1, -1, -1,
1198
-1, -1, -1, -1, -1, 81, 60, 61, 62, 63,
1199
64, 65, 66, 67, 68, 69, 70, 71, -1, -1,
1200
-1, -1, -1, -1, -1, -1, -1, 81, 60, 61,
1201
62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
1202
-1, -1, -1, -1, -1, -1, -1, -1, -1, 81,
1203
60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
1204
70, 71, -1, -1, -1, -1, -1, -1, -1, -1,
1205
-1, 81, 60, 61, 62, 63, 64, 65, 66, 67,
1206
68, 69, 70, 71, -1, -1, -1, -1, -1, -1,
1207
-1, -1, -1, 81, 60, 61, 62, 63, 64, 65,
1208
66, 67, 68, 69, 70, 71, -1, -1, -1, -1,
1209
-1, -1, -1, -1, -1, 81, 60, 61, 62, 63,
1210
64, 65, 66, 67, 68, 69, 70, 71, -1, -1,
1211
-1, -1, -1, -1, -1, -1, -1, 81, 60, 61,
1212
62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
1213
-1, -1, -1, -1, -1, -1, -1, -1, -1, 81,
1214
60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
1215
70, 71, -1, -1, -1, -1, -1, -1, -1, -1,
1216
-1, 81, 60, 61, 62, 63, 64, 65, 66, 67,
1217
68, 69, 70, 71, -1, -1, -1, -1, -1, -1,
1218
-1, -1, -1, 81, 60, 61, 62, 63, 64, 65,
1219
66, 67, 68, 69, 70, 71, -1, -1, -1, -1,
1220
-1, -1, -1, -1, -1, 81, 60, 61, 62, 63,
1221
64, 65, 66, 67, 68, 69, 70, 71, -1, -1,
1222
-1, -1, -1, -1, -1, -1, 80, 60, 61, 62,
1223
63, 64, 65, 66, 67, 68, 69, 70, 71, -1,
1224
-1, -1, -1, -1, -1, -1, -1, 80, 60, 61,
1225
62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
1226
-1, -1, -1, -1, -1, -1, 3, 4, 80, 6,
1227
7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
1228
17, 18, 19, 20, 21, 60, 61, 62, 63, 64,
1229
65, 66, 67, 68, 69, 70, 71, -1, -1, -1,
1230
75, 60, 61, 62, 63, 64, 65, 66, 67, 68,
1231
69, 70, 71, -1, -1, -1, 75, 60, 61, 62,
1232
63, 64, 65, 66, 67, 68, 69, 70, 71, -1,
1233
-1, -1, 75, 60, 61, 62, 63, 64, 65, 66,
1234
67, 68, 69, 70, 71, -1, -1, -1, 75, 60,
1235
61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
1236
71, -1, 57, -1, 75, 60, 61, 62, 63, 64,
1237
65, 66, 67, 68, 69, 70, 71, 60, 61, 62,
1238
63, 64, 65, 66, 67, 68, 69, 70, 71
1241
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1242
symbol of state STATE-NUM. */
1243
static const unsigned char yystos[] =
1245
0, 3, 4, 6, 7, 8, 9, 10, 11, 12,
1246
13, 14, 15, 16, 17, 18, 19, 20, 21, 85,
1247
86, 87, 88, 89, 90, 94, 100, 101, 102, 103,
1248
104, 105, 106, 74, 74, 77, 107, 107, 107, 107,
1249
107, 0, 86, 31, 75, 91, 92, 94, 3, 4,
1250
3, 4, 101, 94, 78, 75, 80, 3, 4, 95,
1251
96, 74, 74, 74, 74, 95, 3, 4, 5, 16,
1252
20, 22, 23, 24, 25, 26, 27, 28, 29, 30,
1253
32, 34, 35, 36, 37, 38, 39, 40, 41, 78,
1254
80, 88, 93, 94, 108, 109, 110, 111, 112, 118,
1255
119, 120, 128, 129, 78, 92, 51, 82, 97, 82,
1256
97, 81, 75, 91, 75, 91, 74, 51, 52, 53,
1257
54, 55, 74, 82, 94, 3, 4, 5, 42, 43,
1258
44, 45, 46, 67, 72, 74, 76, 77, 101, 113,
1259
114, 115, 117, 118, 119, 120, 122, 123, 127, 129,
1260
113, 117, 74, 113, 117, 74, 74, 74, 79, 108,
1261
80, 3, 4, 95, 79, 109, 80, 127, 80, 80,
1262
80, 74, 80, 108, 113, 83, 127, 83, 127, 96,
1263
78, 75, 78, 75, 75, 113, 121, 113, 113, 113,
1264
113, 113, 75, 121, 113, 95, 74, 74, 82, 113,
1265
113, 117, 113, 117, 113, 60, 61, 62, 63, 64,
1266
65, 66, 67, 68, 69, 70, 71, 109, 116, 56,
1267
58, 59, 109, 74, 109, 109, 113, 80, 113, 113,
1268
75, 113, 79, 113, 79, 83, 83, 108, 78, 108,
1269
78, 75, 81, 75, 83, 113, 75, 81, 75, 113,
1270
113, 113, 113, 113, 113, 33, 113, 113, 117, 117,
1271
33, 113, 124, 80, 75, 81, 75, 81, 109, 81,
1272
81, 51, 98, 98, 79, 108, 79, 108, 113, 51,
1273
52, 53, 54, 55, 83, 113, 109, 57, 109, 75,
1274
81, 82, 125, 126, 113, 117, 109, 113, 109, 113,
1275
113, 4, 5, 113, 78, 79, 79, 113, 113, 113,
1276
113, 113, 81, 113, 113, 113, 75, 126, 75, 81,
1277
80, 80, 81, 75, 81, 75, 75, 75, 81, 99,
1278
113, 113, 83, 75, 113, 113, 113, 113, 109, 113,
1279
109, 4, 5, 79, 81, 75, 81, 75, 75, 75,
1280
75, 81, 75, 75, 113, 113, 109, 109, 109, 109,
1281
113, 81, 75, 113, 109, 81, 113, 81, 113, 81,
1282
113, 81, 113, 81, 113, 81, 113, 81, 113, 81,
1283
113, 81, 113, 81, 113, 81, 113, 75
1286
#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
1287
# define YYSIZE_T __SIZE_TYPE__
1289
#if ! defined (YYSIZE_T) && defined (size_t)
1290
# define YYSIZE_T size_t
1292
#if ! defined (YYSIZE_T)
1293
# if defined (__STDC__) || defined (__cplusplus)
1294
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1295
# define YYSIZE_T size_t
1298
#if ! defined (YYSIZE_T)
1299
# define YYSIZE_T unsigned int
1302
#define yyerrok (yyerrstatus = 0)
1303
#define yyclearin (yychar = YYEMPTY)
1304
#define YYEMPTY (-2)
1307
#define YYACCEPT goto yyacceptlab
1308
#define YYABORT goto yyabortlab
1309
#define YYERROR goto yyerrlab1
1312
/* Like YYERROR except do call yyerror. This remains here temporarily
1313
to ease the transition to the new meaning of YYERROR, for GCC.
1314
Once GCC version 2 has supplanted version 1, this can go. */
1316
#define YYFAIL goto yyerrlab
1318
#define YYRECOVERING() (!!yyerrstatus)
1320
#define YYBACKUP(Token, Value) \
1322
if (yychar == YYEMPTY && yylen == 1) \
1326
yytoken = YYTRANSLATE (yychar); \
1332
yyerror ("syntax error: cannot back up");\
1338
#define YYERRCODE 256
1340
/* YYLLOC_DEFAULT -- Compute the default location (before the actions
1343
#ifndef YYLLOC_DEFAULT
1344
# define YYLLOC_DEFAULT(Current, Rhs, N) \
1345
Current.first_line = Rhs[1].first_line; \
1346
Current.first_column = Rhs[1].first_column; \
1347
Current.last_line = Rhs[N].last_line; \
1348
Current.last_column = Rhs[N].last_column;
1351
/* YYLEX -- calling `yylex' with the right arguments. */
1354
# define YYLEX yylex (YYLEX_PARAM)
1356
# define YYLEX yylex ()
1359
/* Enable debugging if requested. */
1363
# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1364
# define YYFPRINTF fprintf
1367
# define YYDPRINTF(Args) \
1373
# define YYDSYMPRINT(Args) \
1379
# define YYDSYMPRINTF(Title, Token, Value, Location) \
1383
YYFPRINTF (stderr, "%s ", Title); \
1384
yysymprint (stderr, \
1386
YYFPRINTF (stderr, "\n"); \
1390
/*------------------------------------------------------------------.
1391
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1393
`------------------------------------------------------------------*/
1395
#if defined (__STDC__) || defined (__cplusplus)
1397
yy_stack_print (short *bottom, short *top)
1400
yy_stack_print (bottom, top)
1405
YYFPRINTF (stderr, "Stack now");
1406
for (/* Nothing. */; bottom <= top; ++bottom)
1407
YYFPRINTF (stderr, " %d", *bottom);
1408
YYFPRINTF (stderr, "\n");
1411
# define YY_STACK_PRINT(Bottom, Top) \
1414
yy_stack_print ((Bottom), (Top)); \
1418
/*------------------------------------------------.
1419
| Report that the YYRULE is going to be reduced. |
1420
`------------------------------------------------*/
1422
#if defined (__STDC__) || defined (__cplusplus)
1424
yy_reduce_print (int yyrule)
1427
yy_reduce_print (yyrule)
1432
unsigned int yylineno = yyrline[yyrule];
1433
YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
1434
yyrule - 1, yylineno);
1435
/* Print the symbols being reduced, and their result. */
1436
for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
1437
YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
1438
YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
1441
# define YY_REDUCE_PRINT(Rule) \
1444
yy_reduce_print (Rule); \
1447
/* Nonzero means print parse trace. It is left uninitialized so that
1448
multiple parsers can coexist. */
1450
#else /* !YYDEBUG */
1451
# define YYDPRINTF(Args)
1452
# define YYDSYMPRINT(Args)
1453
# define YYDSYMPRINTF(Title, Token, Value, Location)
1454
# define YY_STACK_PRINT(Bottom, Top)
1455
# define YY_REDUCE_PRINT(Rule)
1456
#endif /* !YYDEBUG */
1459
/* YYINITDEPTH -- initial size of the parser's stacks. */
1461
# define YYINITDEPTH 200
1464
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1465
if the built-in stack extension method is used).
1467
Do not make this value too large; the results are undefined if
1468
SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
1469
evaluated with infinite-precision integer arithmetic. */
1476
# define YYMAXDEPTH 10000
1484
# if defined (__GLIBC__) && defined (_STRING_H)
1485
# define yystrlen strlen
1487
/* Return the length of YYSTR. */
1489
# if defined (__STDC__) || defined (__cplusplus)
1490
yystrlen (const char *yystr)
1496
register const char *yys = yystr;
1498
while (*yys++ != '\0')
1501
return yys - yystr - 1;
1507
# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1508
# define yystpcpy stpcpy
1510
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1513
# if defined (__STDC__) || defined (__cplusplus)
1514
yystpcpy (char *yydest, const char *yysrc)
1516
yystpcpy (yydest, yysrc)
1521
register char *yyd = yydest;
1522
register const char *yys = yysrc;
1524
while ((*yyd++ = *yys++) != '\0')
1532
#endif /* !YYERROR_VERBOSE */
1537
/*--------------------------------.
1538
| Print this symbol on YYOUTPUT. |
1539
`--------------------------------*/
1541
#if defined (__STDC__) || defined (__cplusplus)
1543
yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
1546
yysymprint (yyoutput, yytype, yyvaluep)
1552
/* Pacify ``unused variable'' warnings. */
1555
if (yytype < YYNTOKENS)
1557
YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1559
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1563
YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1570
YYFPRINTF (yyoutput, ")");
1573
#endif /* ! YYDEBUG */
1574
/*-----------------------------------------------.
1575
| Release the memory associated to this symbol. |
1576
`-----------------------------------------------*/
1578
#if defined (__STDC__) || defined (__cplusplus)
1580
yydestruct (int yytype, YYSTYPE *yyvaluep)
1583
yydestruct (yytype, yyvaluep)
1588
/* Pacify ``unused variable'' warnings. */
1600
/* Prevent warnings from -Wmissing-prototypes. */
1602
#ifdef YYPARSE_PARAM
1603
# if defined (__STDC__) || defined (__cplusplus)
1604
int yyparse (void *YYPARSE_PARAM);
1608
#else /* ! YYPARSE_PARAM */
1609
#if defined (__STDC__) || defined (__cplusplus)
1614
#endif /* ! YYPARSE_PARAM */
1618
/* The lookahead symbol. */
1621
/* The semantic value of the lookahead symbol. */
1624
/* Number of syntax errors so far. */
1633
#ifdef YYPARSE_PARAM
1634
# if defined (__STDC__) || defined (__cplusplus)
1635
int yyparse (void *YYPARSE_PARAM)
1637
int yyparse (YYPARSE_PARAM)
1638
void *YYPARSE_PARAM;
1640
#else /* ! YYPARSE_PARAM */
1641
#if defined (__STDC__) || defined (__cplusplus)
1652
register int yystate;
1655
/* Number of tokens to shift before error messages enabled. */
1657
/* Lookahead token as an internal (translated) token number. */
1660
/* Three stacks and their tools:
1661
`yyss': related to states,
1662
`yyvs': related to semantic values,
1663
`yyls': related to locations.
1665
Refer to the stacks thru separate pointers, to allow yyoverflow
1666
to reallocate them elsewhere. */
1668
/* The state stack. */
1669
short yyssa[YYINITDEPTH];
1670
short *yyss = yyssa;
1671
register short *yyssp;
1673
/* The semantic value stack. */
1674
YYSTYPE yyvsa[YYINITDEPTH];
1675
YYSTYPE *yyvs = yyvsa;
1676
register YYSTYPE *yyvsp;
1680
#define YYPOPSTACK (yyvsp--, yyssp--)
1682
YYSIZE_T yystacksize = YYINITDEPTH;
1684
/* The variables used to return semantic value and location from the
1689
/* When reducing, the number of symbols on the RHS of the reduced
1693
YYDPRINTF ((stderr, "Starting parse\n"));
1698
yychar = YYEMPTY; /* Cause a token to be read. */
1700
/* Initialize stack pointers.
1701
Waste one element of value and location stack
1702
so that they stay on the same level as the state stack.
1703
The wasted elements are never initialized. */
1710
/*------------------------------------------------------------.
1711
| yynewstate -- Push a new state, which is found in yystate. |
1712
`------------------------------------------------------------*/
1714
/* In all cases, when you get here, the value and location stacks
1715
have just been pushed. so pushing a state here evens the stacks.
1722
if (yyss + yystacksize - 1 <= yyssp)
1724
/* Get the current used size of the three stacks, in elements. */
1725
YYSIZE_T yysize = yyssp - yyss + 1;
1729
/* Give user a chance to reallocate the stack. Use copies of
1730
these so that the &'s don't force the real ones into
1732
YYSTYPE *yyvs1 = yyvs;
1733
short *yyss1 = yyss;
1736
/* Each stack pointer address is followed by the size of the
1737
data in use in that stack, in bytes. This used to be a
1738
conditional around just the two extra args, but that might
1739
be undefined if yyoverflow is a macro. */
1740
yyoverflow ("parser stack overflow",
1741
&yyss1, yysize * sizeof (*yyssp),
1742
&yyvs1, yysize * sizeof (*yyvsp),
1749
#else /* no yyoverflow */
1750
# ifndef YYSTACK_RELOCATE
1753
/* Extend the stack our own way. */
1754
if (YYMAXDEPTH <= yystacksize)
1757
if (YYMAXDEPTH < yystacksize)
1758
yystacksize = YYMAXDEPTH;
1761
short *yyss1 = yyss;
1762
union yyalloc *yyptr =
1763
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1766
YYSTACK_RELOCATE (yyss);
1767
YYSTACK_RELOCATE (yyvs);
1769
# undef YYSTACK_RELOCATE
1771
YYSTACK_FREE (yyss1);
1774
#endif /* no yyoverflow */
1776
yyssp = yyss + yysize - 1;
1777
yyvsp = yyvs + yysize - 1;
1780
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1781
(unsigned long int) yystacksize));
1783
if (yyss + yystacksize - 1 <= yyssp)
1787
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1796
/* Do appropriate processing given the current state. */
1797
/* Read a lookahead token if we need one and don't already have one. */
1800
/* First try to decide what to do without reference to lookahead token. */
1802
yyn = yypact[yystate];
1803
if (yyn == YYPACT_NINF)
1806
/* Not known => get a lookahead token if don't already have one. */
1808
/* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1809
if (yychar == YYEMPTY)
1811
YYDPRINTF ((stderr, "Reading a token: "));
1815
if (yychar <= YYEOF)
1817
yychar = yytoken = YYEOF;
1818
YYDPRINTF ((stderr, "Now at end of input.\n"));
1822
yytoken = YYTRANSLATE (yychar);
1823
YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
1826
/* If the proper action on seeing token YYTOKEN is to reduce or to
1827
detect an error, take that action. */
1829
if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1834
if (yyn == 0 || yyn == YYTABLE_NINF)
1843
/* Shift the lookahead token. */
1844
YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
1846
/* Discard the token being shifted unless it is eof. */
1847
if (yychar != YYEOF)
1853
/* Count tokens shifted since error; after three, turn off error
1862
/*-----------------------------------------------------------.
1863
| yydefault -- do the default action for the current state. |
1864
`-----------------------------------------------------------*/
1866
yyn = yydefact[yystate];
1872
/*-----------------------------.
1873
| yyreduce -- Do a reduction. |
1874
`-----------------------------*/
1876
/* yyn is the number of a rule to reduce with. */
1879
/* If YYLEN is nonzero, implement the default value of the action:
1882
Otherwise, the following line sets YYVAL to garbage.
1883
This behavior is undocumented and Bison
1884
users should not rely upon it. Assigning to YYVAL
1885
unconditionally makes the parser a bit smaller, and it avoids a
1886
GCC warning that YYVAL may be used uninitialized. */
1887
yyval = yyvsp[1-yylen];
1890
YY_REDUCE_PRINT (yyn);
1894
#line 167 "parser.yxx"
1895
{ParseTreePointer=yyvsp[0].m_pParseNode;}
1899
#line 169 "parser.yxx"
1900
{ParseTreePointer->AddLastChild(yyvsp[0].m_pParseNode);}
1904
#line 179 "parser.yxx"
1906
// Store a pointer to the actual shader.
1907
yyval.m_pParseNode=new CqParseNodeShader(yyvsp[-6].m_Identifier->c_str(),yyvsp[-7].m_ShaderType);
1908
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
1909
yyval.m_pParseNode->AddLastChild(yyvsp[-1].m_pParseNode);
1911
// Now copy any initialisers from the formals list to their respective
1912
// local variable definitions.
1913
CqParseNode* pArgs=yyvsp[-4].m_pParseNode;
1914
ProcessShaderArguments( pArgs );
1915
yyval.m_pParseNode->AddLastChild( yyvsp[-4].m_pParseNode );
1920
#line 192 "parser.yxx"
1922
// Store a pointer to the actual shader.
1924
if(yyvsp[-6].m_pSymbol.eType&1) strName=CqVarDef::GetVariablePtr(yyvsp[-6].m_pSymbol.VarRef)->strName();
1925
else strName=CqFuncDef::GetFunctionPtr(yyvsp[-6].m_pSymbol.FuncRef)->strName();
1926
yyval.m_pParseNode=new CqParseNodeShader(strName.c_str(),yyvsp[-7].m_ShaderType);
1927
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
1928
yyval.m_pParseNode->AddLastChild(yyvsp[-1].m_pParseNode);
1930
// Now copy any initialisers from the formals list to their respective
1931
// local variable definitions.
1932
CqParseNode* pArgs=yyvsp[-4].m_pParseNode;
1933
ProcessShaderArguments( pArgs );
1934
yyval.m_pParseNode->AddLastChild( yyvsp[-4].m_pParseNode );
1939
#line 208 "parser.yxx"
1941
// Store a pointer to the actual shader.
1942
yyval.m_pParseNode=new CqParseNodeShader(yyvsp[-5].m_Identifier->c_str(), yyvsp[-6].m_ShaderType);
1943
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
1944
yyval.m_pParseNode->AddLastChild(yyvsp[-1].m_pParseNode);
1949
#line 215 "parser.yxx"
1951
// Store a pointer to the actual shader.
1953
if(yyvsp[-5].m_pSymbol.eType&1) strName=CqVarDef::GetVariablePtr(yyvsp[-5].m_pSymbol.VarRef)->strName();
1954
else strName=CqFuncDef::GetFunctionPtr(yyvsp[-5].m_pSymbol.FuncRef)->strName();
1955
yyval.m_pParseNode=new CqParseNodeShader(strName.c_str(),yyvsp[-6].m_ShaderType);
1956
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
1957
yyval.m_pParseNode->AddLastChild(yyvsp[-1].m_pParseNode);
1962
#line 228 "parser.yxx"
1964
CqParseNodeDeclaration* pDecl=static_cast<CqParseNodeDeclaration*>(yyvsp[-5].m_pParseNode);
1966
// If no return/or multiple returns, then this is not a valid function.
1967
if((pDecl->Type()!=Type_Void) &&
1968
(FunctionReturnCountStack.size() <=0 ||
1969
FunctionReturnCountStack.back() != 1))
1970
yyerror("Must have one return in function");
1972
// Make a string of the parameter types.
1973
CqParseNode* pArgs=yyvsp[-4].m_pParseNode;
1974
CqString strArgTypes("");
1977
// Each child of the variable_definitions is a CqParseNodeVariable
1978
CqParseNodeVariable* pVar=static_cast<CqParseNodeVariable*>(pArgs->pFirstChild());
1981
// If storage is not specified, a function parameter defaults to varying.
1982
pVar->SetDefaultStorage(Type_Varying);
1983
// Get the type from the variable
1984
strArgTypes+=CqParseNode::TypeIdentifier(pVar->ResType());
1985
// TODO: Find out if local function arguments can have default values.
1986
// If so, they can be found as the child of pVar.
1987
pVar=static_cast<CqParseNodeVariable*>(pVar->pNext());
1991
// Add the function declaration to the list of local functions.
1992
CqFuncDef funcdef(pDecl->Type(), pDecl->strName(), pDecl->strName(), strArgTypes.c_str(), yyvsp[-1].m_pParseNode, pArgs);
1993
CqFuncDef::AddFunction(funcdef);
1994
yyval.m_pParseNode=new CqParseNode();
1995
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
1997
// Function level namespace is now defunct.
1998
ParseNameSpaceStack.erase(ParseNameSpaceStack.end()-1);
1999
FunctionReturnCountStack.erase(FunctionReturnCountStack.end()-1);
2004
#line 267 "parser.yxx"
2006
CqParseNodeDeclaration* pDecl=static_cast<CqParseNodeDeclaration*>(yyvsp[-4].m_pParseNode);
2008
// If no return/or multiple returns, then this is not a valid function.
2009
if((pDecl->Type()!=Type_Void) &&
2010
(FunctionReturnCountStack.size() <=0 ||
2011
FunctionReturnCountStack.back() != 1))
2012
yyerror("Must have one return in function");
2014
// Add the function declaration to the list of local functions.
2015
CqFuncDef funcdef(pDecl->Type(), pDecl->strName(), pDecl->strName(), "", yyvsp[-1].m_pParseNode, 0);
2016
CqFuncDef::AddFunction(funcdef);
2017
yyval.m_pParseNode=new CqParseNode();
2018
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
2020
// Function level namespace is now defunct.
2021
ParseNameSpaceStack.erase(ParseNameSpaceStack.end()-1);
2022
FunctionReturnCountStack.erase(FunctionReturnCountStack.end()-1);
2027
#line 289 "parser.yxx"
2029
yyval.m_pParseNode=new CqParseNodeDeclaration((strNameSpace()+*yyvsp[-1].m_Identifier).c_str(),yyvsp[-2].m_TypeAndSpace.Type);
2030
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
2031
// Store the name of the function being defined for use in variable namespacing.
2032
ParseNameSpaceStack.push_back(strNameSpace()+*yyvsp[-1].m_Identifier+"::");
2033
// Push a new level onto the FunctionReturnCountStack.
2034
FunctionReturnCountStack.push_back(0);
2039
#line 297 "parser.yxx"
2041
yyval.m_pParseNode=new CqParseNodeDeclaration((strNameSpace()+*yyvsp[-1].m_Identifier).c_str(),Type_Void);
2042
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
2043
// Store the name of the function being defined for use in variable namespacing.
2044
ParseNameSpaceStack.push_back(strNameSpace()+*yyvsp[-1].m_Identifier+"::");
2045
// Push a new level onto the FunctionReturnCountStack.
2046
FunctionReturnCountStack.push_back(0);
2051
#line 305 "parser.yxx"
2053
// TODO: Should warn about duplicate declarations.
2054
CqString strName(strNameSpace());
2055
if(yyvsp[-1].m_pSymbol.eType&1) strName+=CqVarDef::GetVariablePtr(yyvsp[-1].m_pSymbol.VarRef)->strName();
2056
else strName+=CqFuncDef::GetFunctionPtr(yyvsp[-1].m_pSymbol.FuncRef)->strName();
2058
yyval.m_pParseNode=new CqParseNodeDeclaration(strName.c_str(),yyvsp[-2].m_TypeAndSpace.Type);
2059
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
2060
// Store the name of the function being defined for use in variable namespacing.
2061
ParseNameSpaceStack.push_back(strName+"::");
2062
// Push a new level onto the FunctionReturnCountStack.
2063
FunctionReturnCountStack.push_back(0);
2068
#line 318 "parser.yxx"
2070
// TODO: Should warn about duplicate declarations.
2071
CqString strName(strNameSpace());
2072
if(yyvsp[-1].m_pSymbol.eType&1) strName+=CqVarDef::GetVariablePtr(yyvsp[-1].m_pSymbol.VarRef)->strName();
2073
else strName+=CqFuncDef::GetFunctionPtr(yyvsp[-1].m_pSymbol.FuncRef)->strName();
2075
yyval.m_pParseNode=new CqParseNodeDeclaration(strName.c_str(),Type_Void);
2076
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
2077
// Store the name of the function being defined for use in variable namespacing.
2078
ParseNameSpaceStack.push_back(strName+"::");
2079
// Push a new level onto the FunctionReturnCountStack.
2080
FunctionReturnCountStack.push_back(0);
2085
#line 334 "parser.yxx"
2087
yyval.m_ShaderType = Type_Lightsource;
2092
#line 337 "parser.yxx"
2094
yyval.m_ShaderType = Type_Surface;
2099
#line 340 "parser.yxx"
2101
yyval.m_ShaderType = Type_Volume;
2106
#line 343 "parser.yxx"
2108
yyval.m_ShaderType = Type_Displacement;
2113
#line 346 "parser.yxx"
2115
yyval.m_ShaderType = Type_Transformation;
2120
#line 349 "parser.yxx"
2122
yyval.m_ShaderType = Type_Imager;
2127
#line 356 "parser.yxx"
2129
// Create a list header, and add the first entry to it.
2130
yyval.m_pParseNode=new CqParseNode();
2131
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
2132
CqParseNodeVariable* pVarNode=static_cast<CqParseNodeVariable*>(yyvsp[0].m_pParseNode->pFirstChild());
2135
CqParseNodeVariable* pVarNext=static_cast<CqParseNodeVariable*>(pVarNode->pNext());
2136
yyval.m_pParseNode->AddLastChild(pVarNode);
2143
#line 369 "parser.yxx"
2145
// Add this one to the list.
2146
CqParseNodeVariable* pVarNode=static_cast<CqParseNodeVariable*>(yyvsp[0].m_pParseNode->pFirstChild());
2149
CqParseNodeVariable* pVarNext=static_cast<CqParseNodeVariable*>(pVarNode->pNext());
2150
yyval.m_pParseNode->AddLastChild(pVarNode);
2157
#line 384 "parser.yxx"
2159
yyval.m_pParseNode=new CqParseNode();
2160
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
2161
CqParseNodeDeclaration* pDecl=static_cast<CqParseNodeDeclaration*>(yyvsp[0].m_pParseNode->pFirstChild());
2164
TqInt Type=(yyvsp[-1].m_TypeAndSpace.Type);
2167
TqBool fv=CqVarDef::FindVariable((strNameSpace()+pDecl->strName()).c_str(), var);
2170
CqVarDef* pVar=CqVarDef::GetVariablePtr(var);
2171
// Check if the declaration marked it as an arry
2172
if(pVar->Type()&Type_Array)
2173
Type=(TqInt)(Type|Type_Array);
2175
pVar->SetType(Type);
2176
// Create a variable node, in the case of local variable definition, these nodes will be removed,
2177
// and only the intitialisers kept.
2178
// In the case of function parameters, the variables will be needed for type string construction.
2179
CqParseNode* pVarNode=new CqParseNodeVariable(var);
2180
pVarNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
2181
yyval.m_pParseNode->AddLastChild(pVarNode);
2183
// Copy any initialisers
2184
if(pDecl->pFirstChild())
2188
CqParseNode* pArrayInit=new CqParseNode();
2190
CqParseNode* pInitList=pDecl->pFirstChild();
2191
CqParseNode* pInit=pInitList->pFirstChild();
2195
CqParseNode* pInit2=pInit->pNext();
2196
CqParseNodeAssignArray* pInitFunc=new CqParseNodeAssignArray(var);
2198
CqParseNodeFloatConst* pIndex=new CqParseNodeFloatConst(i);
2200
pInitFunc->AddLastChild(pInit);
2201
pInitFunc->AddLastChild(pIndex);
2202
pArrayInit->AddLastChild(pInitFunc);
2207
pVarNode->AddLastChild(pArrayInit);
2211
// Create an assign operator to initialise the variable.
2212
CqParseNode* pV=new CqParseNodeAssign(var);
2213
pV->SetPos(ParseLineNumber,ParseStreamName.c_str());
2215
pV->AddLastChild(pDecl->pFirstChild());
2217
pVarNode->AddLastChild(pV);
2218
pDecl->ClearChild();
2223
CqParseNode* pTemp=pDecl;
2224
pDecl=static_cast<CqParseNodeDeclaration*>(pDecl->pNext());
2231
#line 455 "parser.yxx"
2233
yyval.m_pParseNode=new CqParseNode();
2234
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
2235
CqParseNodeDeclaration* pDecl=static_cast<CqParseNodeDeclaration*>(yyvsp[0].m_pParseNode->pFirstChild());
2238
TqInt Type=(yyvsp[-1].m_TypeAndSpace.Type);
2241
TqBool fv=CqVarDef::FindVariable((strNameSpace()+pDecl->strName()).c_str(), var);
2244
CqVarDef* pVar=CqVarDef::GetVariablePtr(var);
2245
// Check if the declaration marked it as an arry
2246
if(pVar->Type()&Type_Array)
2247
Type=(TqInt)(Type|Type_Array);
2249
pVar->SetType(Type);
2250
// Create a variable node, in the case of local variable definition, these nodes will be removed,
2251
// and only the intitialisers kept.
2252
// In the case of function parameters, the variables will be needed for type string construction.
2253
CqParseNodeVariable* pVarNode=new CqParseNodeVariable(var);
2254
pVarNode->SetOutput();
2255
pVarNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
2256
yyval.m_pParseNode->AddLastChild(pVarNode);
2258
// Copy any initialisers
2259
if(pDecl->pFirstChild())
2263
CqParseNode* pArrayInit=new CqParseNode();
2265
CqParseNode* pInitList=pDecl->pFirstChild();
2266
CqParseNode* pInit=pInitList->pFirstChild();
2270
CqParseNode* pInit2=pInit->pNext();
2271
CqParseNodeAssignArray* pInitFunc=new CqParseNodeAssignArray(var);
2273
CqParseNodeFloatConst* pIndex=new CqParseNodeFloatConst(i);
2275
pInitFunc->AddLastChild(pInit);
2276
pInitFunc->AddLastChild(pIndex);
2277
pArrayInit->AddLastChild(pInitFunc);
2282
pVarNode->AddLastChild(pArrayInit);
2286
// Create an assign operator to initialise the variable.
2287
CqParseNode* pV=new CqParseNodeAssign(var);
2288
pV->SetPos(ParseLineNumber,ParseStreamName.c_str());
2290
pV->AddLastChild(pDecl->pFirstChild());
2292
pVarNode->AddLastChild(pV);
2293
pDecl->ClearChild();
2298
CqParseNode* pTemp=pDecl;
2299
pDecl=static_cast<CqParseNodeDeclaration*>(pDecl->pNext());
2306
#line 531 "parser.yxx"
2308
yyval.m_pParseNode=new CqParseNode();
2309
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
2310
CqParseNodeDeclaration* pDecl=static_cast<CqParseNodeDeclaration*>(yyvsp[0].m_pParseNode->pFirstChild());
2313
TqInt Type=(yyvsp[-1].m_TypeAndSpace.Type);
2316
TqBool fv=CqVarDef::FindVariable((strNameSpace()+pDecl->strName()).c_str(), var);
2319
CqVarDef* pVar=CqVarDef::GetVariablePtr(var);
2320
// Check if the declaration marked it as an arry
2321
if(pVar->Type()&Type_Array)
2323
Type=(TqInt)(Type|Type_Array);
2324
if( pVar->ArrayLength() <= 0 )
2325
yyerror("Array length must be specified.");
2328
pVar->SetType(Type);
2329
// Create a variable node, in the case of local variable definition, these nodes will be removed,
2330
// and only the intitialisers kept.
2331
// In the case of function parameters, the variables will be needed for type string construction.
2332
CqParseNode* pVarNode=new CqParseNodeVariable(var);
2333
pVarNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
2334
yyval.m_pParseNode->AddLastChild(pVarNode);
2336
// Copy any initialisers
2337
if(pDecl->pFirstChild())
2341
CqParseNode* pArrayInit=new CqParseNode();
2343
CqParseNode* pInitList=pDecl->pFirstChild();
2344
CqParseNode* pInit=pInitList->pFirstChild();
2348
CqParseNode* pInit2=pInit->pNext();
2349
CqParseNodeAssignArray* pInitFunc=new CqParseNodeAssignArray(var);
2351
CqParseNodeFloatConst* pIndex=new CqParseNodeFloatConst(i);
2353
pInitFunc->AddLastChild(pInit);
2354
pInitFunc->AddLastChild(pIndex);
2355
pArrayInit->AddLastChild(pInitFunc);
2360
pVarNode->AddLastChild(pArrayInit);
2364
// Create an assign operator to initialise the variable.
2365
CqParseNode* pV=new CqParseNodeAssign(var);
2366
pV->SetPos(ParseLineNumber,ParseStreamName.c_str());
2368
pV->AddLastChild(pDecl->pFirstChild());
2370
pVarNode->AddLastChild(pV);
2371
pDecl->ClearChild();
2376
CqParseNode* pTemp=pDecl;
2377
pDecl=static_cast<CqParseNodeDeclaration*>(pDecl->pNext());
2384
#line 606 "parser.yxx"
2386
yyval.m_pParseNode=new CqParseNode();
2387
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
2388
CqParseNodeDeclaration* pDecl=static_cast<CqParseNodeDeclaration*>(yyvsp[0].m_pParseNode->pFirstChild());
2391
SqVarRef varLocal, varExtern;
2392
TqBool fvl=CqVarDef::FindVariable((strNameSpace()+pDecl->strName()).c_str(), varLocal);
2394
// As this is an extern, we need to repeatedly check in the previous namespaces
2395
// until we find the variable they are referring to.
2397
if(!ParseNameSpaceStack.empty())
2399
std::vector<CqString>::reverse_iterator i=ParseNameSpaceStack.rbegin()+1;
2400
while(!fve && i!=ParseNameSpaceStack.rend())
2403
fve=CqVarDef::FindVariable((strNS+pDecl->strName()).c_str(), varExtern);
2409
// If not found in the namespaces defined in the code, check the global namespace.
2410
fve=CqVarDef::FindStandardVariable(pDecl->strName(), varExtern);
2413
// If we found a candidate...
2416
CqVarDef* pvarLocal=CqVarDef::GetVariablePtr(varLocal);
2417
CqVarDef* pvarExtern=CqVarDef::GetVariablePtr(varExtern);
2418
CqParseNode* pVarNode=new CqParseNodeVariable(varLocal);
2419
pvarLocal->SetExtern(TqTrue, varExtern);
2420
pvarLocal->SetType(pvarExtern->Type());
2421
pVarNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
2422
yyval.m_pParseNode->AddLastChild(pVarNode);
2425
yyerror("extern not found");
2427
CqParseNode* pTemp=pDecl;
2428
pDecl=static_cast<CqParseNodeDeclaration*>(pDecl->pNext());
2435
#line 656 "parser.yxx"
2437
yyval.m_TypeAndSpace.Type=(TqInt)(yyvsp[0].m_TypeAndSpace.Type|yyvsp[-1].m_VarType);
2438
yyval.m_TypeAndSpace.Space=yyvsp[0].m_TypeAndSpace.Space;
2443
#line 664 "parser.yxx"
2445
// Create a list header and add the first element.
2446
yyval.m_pParseNode=new CqParseNode();
2447
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
2448
yyval.m_pParseNode->AddLastChild(yyvsp[0].m_pParseNode);
2453
#line 671 "parser.yxx"
2455
// This one to the list.
2456
yyval.m_pParseNode->AddLastChild(yyvsp[0].m_pParseNode);
2461
#line 678 "parser.yxx"
2463
// Create a new variable declaration based on the specified name.
2464
yyval.m_pParseNode=new CqParseNodeDeclaration(yyvsp[-1].m_Identifier->c_str());
2465
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
2466
CqVarDef vardef(Type_Void, (strNameSpace()+*yyvsp[-1].m_Identifier).c_str());
2467
CqVarDef::AddVariable(vardef);
2468
// Add the initialiser as the first child of the declaration.
2469
yyval.m_pParseNode->AddLastChild(yyvsp[0].m_pParseNode);
2474
#line 687 "parser.yxx"
2476
// Create a new variable declaration based on the specified name.
2477
yyval.m_pParseNode=new CqParseNodeDeclaration(yyvsp[0].m_Identifier->c_str());
2478
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
2479
CqVarDef vardef(Type_Void, (strNameSpace()+*yyvsp[0].m_Identifier).c_str());
2480
CqVarDef::AddVariable(vardef);
2485
#line 694 "parser.yxx"
2487
// Create a new variable declaration based on the specified name.
2488
yyval.m_pParseNode=new CqParseNodeDeclaration(yyvsp[-3].m_Identifier->c_str());
2489
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
2490
CqVarDef vardef(Type_Array, (strNameSpace()+*yyvsp[-3].m_Identifier).c_str(), static_cast<TqInt>(yyvsp[-1].m_FloatConst));
2491
CqVarDef::AddVariable(vardef);
2496
#line 702 "parser.yxx"
2498
// Create a new variable declaration based on the specified name.
2499
yyval.m_pParseNode=new CqParseNodeDeclaration(yyvsp[-4].m_Identifier->c_str());
2500
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
2501
CqVarDef vardef(Type_Array, (strNameSpace()+*yyvsp[-4].m_Identifier).c_str(), static_cast<TqInt>(yyvsp[-2].m_FloatConst));
2502
CqVarDef::AddVariable(vardef);
2503
yyval.m_pParseNode->AddLastChild(yyvsp[0].m_pParseNode);
2508
#line 710 "parser.yxx"
2510
// Create a new variable declaration based on the specified name.
2511
yyval.m_pParseNode=new CqParseNodeDeclaration(yyvsp[-2].m_Identifier->c_str());
2512
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
2513
CqVarDef vardef(Type_Array, (strNameSpace()+*yyvsp[-2].m_Identifier).c_str(), 0);
2514
CqVarDef::AddVariable(vardef);
2519
#line 717 "parser.yxx"
2521
// Create a new declaration based on the name.
2522
// TODO: Should warn about duplicate declarations.
2523
CqString strName("");
2524
if(yyvsp[-1].m_pSymbol.eType&1) strName=CqVarDef::GetVariablePtr(yyvsp[-1].m_pSymbol.VarRef)->strName();
2525
else strName=CqFuncDef::GetFunctionPtr(yyvsp[-1].m_pSymbol.FuncRef)->strName();
2527
yyval.m_pParseNode=new CqParseNodeDeclaration(strName.c_str());
2528
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
2529
CqVarDef vardef(Type_Void, (strNameSpace()+strName).c_str());
2530
CqVarDef::AddVariable(vardef);
2531
// Add the initialiser as the first child of the declaration.
2532
yyval.m_pParseNode->AddLastChild(yyvsp[0].m_pParseNode);
2537
#line 731 "parser.yxx"
2539
CqString strName("");
2540
if(yyvsp[0].m_pSymbol.eType&1) strName=CqVarDef::GetVariablePtr(yyvsp[0].m_pSymbol.VarRef)->strName();
2541
else strName=CqFuncDef::GetFunctionPtr(yyvsp[0].m_pSymbol.FuncRef)->strName();
2543
yyval.m_pParseNode=new CqParseNodeDeclaration(strName.c_str());
2544
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
2545
CqVarDef vardef(Type_Void, (strNameSpace()+strName).c_str());
2546
CqVarDef::AddVariable(vardef);
2551
#line 741 "parser.yxx"
2553
CqString strName("");
2554
if(yyvsp[-3].m_pSymbol.eType&1) strName=CqVarDef::GetVariablePtr(yyvsp[-3].m_pSymbol.VarRef)->strName();
2555
else strName=CqFuncDef::GetFunctionPtr(yyvsp[-3].m_pSymbol.FuncRef)->strName();
2557
yyval.m_pParseNode=new CqParseNodeDeclaration(strName.c_str());
2558
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
2559
CqVarDef vardef(Type_Array, (strNameSpace()+strName).c_str(), static_cast<TqInt>(yyvsp[-1].m_FloatConst));
2560
CqVarDef::AddVariable(vardef);
2565
#line 752 "parser.yxx"
2567
CqString strName("");
2568
if(yyvsp[-4].m_pSymbol.eType&1) strName=CqVarDef::GetVariablePtr(yyvsp[-4].m_pSymbol.VarRef)->strName();
2569
else strName=CqFuncDef::GetFunctionPtr(yyvsp[-4].m_pSymbol.FuncRef)->strName();
2571
yyval.m_pParseNode=new CqParseNodeDeclaration(strName.c_str());
2572
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
2573
CqVarDef vardef(Type_Array, (strNameSpace()+strName).c_str(), static_cast<TqInt>(yyvsp[-2].m_FloatConst));
2574
CqVarDef::AddVariable(vardef);
2575
yyval.m_pParseNode->AddLastChild(yyvsp[0].m_pParseNode);
2580
#line 763 "parser.yxx"
2582
CqString strName("");
2583
if(yyvsp[-2].m_pSymbol.eType&1) strName=CqVarDef::GetVariablePtr(yyvsp[-2].m_pSymbol.VarRef)->strName();
2584
else strName=CqFuncDef::GetFunctionPtr(yyvsp[-2].m_pSymbol.FuncRef)->strName();
2586
yyval.m_pParseNode=new CqParseNodeDeclaration(strName.c_str());
2587
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
2588
CqVarDef vardef(Type_Array, (strNameSpace()+strName).c_str(), 0);
2589
CqVarDef::AddVariable(vardef);
2594
#line 776 "parser.yxx"
2596
yyval.m_pParseNode=yyvsp[0].m_pParseNode;
2601
#line 783 "parser.yxx"
2603
CqParseNode* pArrayInit=new CqParseNode();
2604
CqParseNode* pInit=yyvsp[-1].m_pParseNode->pFirstChild();
2607
CqParseNode* pInit2=pInit->pNext();
2608
pArrayInit->AddLastChild(pInit);
2611
yyval.m_pParseNode=pArrayInit;
2616
#line 797 "parser.yxx"
2618
// Create a list header and add the first element.
2619
yyval.m_pParseNode=new CqParseNode();
2620
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
2621
yyval.m_pParseNode->AddLastChild(yyvsp[0].m_pParseNode);
2626
#line 804 "parser.yxx"
2628
// This one to the list.
2629
yyval.m_pParseNode->AddLastChild(yyvsp[0].m_pParseNode);
2634
#line 811 "parser.yxx"
2635
{ yyval.m_VarType=Type_Varying; }
2639
#line 812 "parser.yxx"
2640
{ yyval.m_VarType=Type_Uniform; }
2644
#line 816 "parser.yxx"
2646
yyval.m_TypeAndSpace.Type=Type_Float;
2647
yyval.m_TypeAndSpace.Space=0;
2652
#line 820 "parser.yxx"
2654
yyval.m_TypeAndSpace.Type=Type_String;
2655
yyval.m_TypeAndSpace.Space=0;
2660
#line 824 "parser.yxx"
2662
yyval.m_TypeAndSpace.Type=Type_Void;
2663
yyval.m_TypeAndSpace.Space=0;
2668
#line 836 "parser.yxx"
2670
yyval.m_TypeAndSpace.Type=Type_Point;
2671
yyval.m_TypeAndSpace.Space=yyvsp[0].m_Identifier;
2676
#line 840 "parser.yxx"
2678
yyval.m_TypeAndSpace.Type=Type_Point;
2679
yyval.m_TypeAndSpace.Space=0;
2684
#line 847 "parser.yxx"
2686
yyval.m_TypeAndSpace.Type=Type_Color;
2687
yyval.m_TypeAndSpace.Space=yyvsp[0].m_Identifier;
2692
#line 851 "parser.yxx"
2694
yyval.m_TypeAndSpace.Type=Type_Color;
2695
yyval.m_TypeAndSpace.Space=0;
2700
#line 858 "parser.yxx"
2702
yyval.m_TypeAndSpace.Type=Type_Vector;
2703
yyval.m_TypeAndSpace.Space=yyvsp[0].m_Identifier;
2708
#line 862 "parser.yxx"
2710
yyval.m_TypeAndSpace.Type=Type_Vector;
2711
yyval.m_TypeAndSpace.Space=0;
2716
#line 869 "parser.yxx"
2718
yyval.m_TypeAndSpace.Type=Type_Normal;
2719
yyval.m_TypeAndSpace.Space=yyvsp[0].m_Identifier;
2724
#line 873 "parser.yxx"
2726
yyval.m_TypeAndSpace.Type=Type_Normal;
2727
yyval.m_TypeAndSpace.Space=0;
2732
#line 880 "parser.yxx"
2734
yyval.m_TypeAndSpace.Type=Type_Matrix;
2735
yyval.m_TypeAndSpace.Space=yyvsp[0].m_Identifier;
2740
#line 884 "parser.yxx"
2742
yyval.m_TypeAndSpace.Type=Type_Matrix;
2743
yyval.m_TypeAndSpace.Space=0;
2748
#line 895 "parser.yxx"
2750
// Create a list header and add the first element.
2751
yyval.m_pParseNode=new CqParseNode();
2752
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
2753
yyval.m_pParseNode->AddFirstChild(yyvsp[0].m_pParseNode);
2758
#line 902 "parser.yxx"
2760
// Add this one to the list.
2761
yyval.m_pParseNode->AddLastChild(yyvsp[0].m_pParseNode);
2766
#line 909 "parser.yxx"
2767
{yyval.m_pParseNode->NoDup();}
2771
#line 910 "parser.yxx"
2773
if(yyval.m_pParseNode->ResType()!=Type_Void)
2775
yyval.m_pParseNode=new CqParseNodeDrop();
2776
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
2777
yyval.m_pParseNode->AddLastChild(yyvsp[-1].m_pParseNode);
2783
#line 918 "parser.yxx"
2785
if(yyval.m_pParseNode->ResType()!=Type_Void)
2787
yyval.m_pParseNode=new CqParseNodeDrop();
2788
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
2789
yyval.m_pParseNode->AddLastChild(yyvsp[-1].m_pParseNode);
2795
#line 926 "parser.yxx"
2797
yyval.m_pParseNode=new CqParseNodeDrop();
2798
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
2799
yyval.m_pParseNode->AddLastChild(yyvsp[-1].m_pParseNode);
2804
#line 932 "parser.yxx"
2806
yyval.m_pParseNode=new CqParseNode();
2807
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
2808
yyval.m_pParseNode->AddLastChild(yyvsp[-1].m_pParseNode);
2809
// Increment the count of returns for the current function.
2810
if(FunctionReturnCountStack.size() > 0)
2811
FunctionReturnCountStack.back()++;
2816
#line 943 "parser.yxx"
2818
// Remove the variable nodes from these leaving just the
2819
// intialisation code.
2820
// Each child of the variable_definitions is a CqParseNodeVariable
2821
CqParseNodeVariable* pVar=static_cast<CqParseNodeVariable*>(yyvsp[-1].m_pParseNode->pFirstChild());
2824
CqParseNodeVariable* pTemp=static_cast<CqParseNodeVariable*>(pVar->pNext());
2826
// If storage is not specified, local variable defaults to varying.
2827
pVar->SetDefaultStorage(Type_Varying);
2829
// Relink the initialisers, if any, after the variable.
2830
if(pVar->pFirstChild())
2832
// Make sure that any change in the storage type is communicated to the initialiser
2833
pVar->pFirstChild()->UpdateStorageStatus();
2834
CqParseNode* pVarying=pVar->pFirstChild();
2835
pVarying->LinkAfter(pVar);
2845
#line 969 "parser.yxx"
2846
{ yyval.m_pParseNode=yyvsp[-1].m_pParseNode; }
2850
#line 970 "parser.yxx"
2851
{ yyval.m_pParseNode=new CqParseNode(); }
2855
#line 971 "parser.yxx"
2856
{ yyval.m_pParseNode=new CqParseNode(); }
2860
#line 973 "parser.yxx"
2862
CqParseNode* pNew=new CqParseNodeConditional();
2863
pNew->SetPos(ParseLineNumber,ParseStreamName.c_str());
2864
pNew->AddLastChild(yyvsp[-1].m_pParseNode);
2865
pNew->AddLastChild(yyvsp[0].m_pParseNode);
2866
yyval.m_pParseNode=pNew;
2871
#line 980 "parser.yxx"
2873
CqParseNode* relation=new CqParseNodeRelOp(Op_NE);
2874
relation->SetPos(ParseLineNumber,ParseStreamName.c_str());
2875
relation->AddFirstChild(yyvsp[-1].m_pParseNode);
2876
CqParseNode* pcomp=new CqParseNodeFloatConst(0);
2877
relation->AddLastChild(pcomp);
2879
CqParseNode* pNew=new CqParseNodeConditional();
2880
pNew->SetPos(ParseLineNumber,ParseStreamName.c_str());
2881
pNew->AddLastChild(relation);
2882
pNew->AddLastChild(yyvsp[0].m_pParseNode);
2883
yyval.m_pParseNode=pNew;
2889
#line 995 "parser.yxx"
2891
CqParseNode* pNew=new CqParseNodeConditional();
2892
pNew->SetPos(ParseLineNumber,ParseStreamName.c_str());
2893
pNew->AddLastChild(yyvsp[-3].m_pParseNode);
2894
pNew->AddLastChild(yyvsp[-2].m_pParseNode);
2895
pNew->AddLastChild(yyvsp[0].m_pParseNode);
2896
yyval.m_pParseNode=pNew;
2901
#line 1003 "parser.yxx"
2903
CqParseNode* relation=new CqParseNodeRelOp(Op_NE);
2904
relation->SetPos(ParseLineNumber,ParseStreamName.c_str());
2905
relation->AddFirstChild(yyvsp[-3].m_pParseNode);
2906
CqParseNode* pcomp=new CqParseNodeFloatConst(0);
2907
relation->AddLastChild(pcomp);
2908
CqParseNode* pNew=new CqParseNodeConditional();
2910
pNew->SetPos(ParseLineNumber,ParseStreamName.c_str());
2911
pNew->AddLastChild(relation);
2912
pNew->AddLastChild(yyvsp[-2].m_pParseNode);
2913
pNew->AddLastChild(yyvsp[0].m_pParseNode);
2914
yyval.m_pParseNode=pNew;
2919
#line 1022 "parser.yxx"
2921
yyval.m_pParseNode=new CqParseNodeWhileConstruct();
2922
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
2923
yyval.m_pParseNode->AddLastChild(yyvsp[-1].m_pParseNode);
2924
yyval.m_pParseNode->AddLastChild(yyvsp[0].m_pParseNode);
2929
#line 1028 "parser.yxx"
2931
CqParseNode* relation=new CqParseNodeRelOp(Op_NE);
2932
relation->SetPos(ParseLineNumber,ParseStreamName.c_str());
2933
relation->AddFirstChild(yyvsp[-1].m_pParseNode);
2934
CqParseNode* pcomp=new CqParseNodeFloatConst(0);
2935
relation->AddLastChild(pcomp);
2936
CqParseNode* pNew=new CqParseNodeConditional();
2938
yyval.m_pParseNode=new CqParseNodeWhileConstruct();
2939
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
2940
yyval.m_pParseNode->AddLastChild(relation);
2941
yyval.m_pParseNode->AddLastChild(yyvsp[0].m_pParseNode);
2946
#line 1042 "parser.yxx"
2948
yyval.m_pParseNode=new CqParseNode();
2949
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
2950
yyval.m_pParseNode->AddLastChild(yyvsp[-6].m_pParseNode);
2951
CqParseNode* pW=new CqParseNodeWhileConstruct();
2952
pW->SetPos(ParseLineNumber,ParseStreamName.c_str());
2953
yyval.m_pParseNode->AddLastChild(pW);
2954
pW->AddLastChild(yyvsp[-4].m_pParseNode);
2955
pW->AddLastChild(yyvsp[0].m_pParseNode);
2956
pW->AddLastChild(yyvsp[-2].m_pParseNode);
2957
// Make sure that any assigns in the two expressions don't dup
2958
yyvsp[-6].m_pParseNode->NoDup();
2959
yyvsp[-2].m_pParseNode->NoDup();
2964
#line 1057 "parser.yxx"
2966
CqParseNode* relation=new CqParseNodeRelOp(Op_NE);
2967
relation->SetPos(ParseLineNumber,ParseStreamName.c_str());
2968
relation->AddFirstChild(yyvsp[-4].m_pParseNode);
2969
CqParseNode* pcomp=new CqParseNodeFloatConst(0);
2970
relation->AddLastChild(pcomp);
2972
CqParseNode* pNew=new CqParseNodeConditional();
2973
yyval.m_pParseNode=new CqParseNode();
2974
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
2975
yyval.m_pParseNode->AddLastChild(yyvsp[-6].m_pParseNode);
2976
CqParseNode* pW=new CqParseNodeWhileConstruct();
2977
pW->SetPos(ParseLineNumber,ParseStreamName.c_str());
2978
yyval.m_pParseNode->AddLastChild(pW);
2979
pW->AddLastChild(relation);
2980
pW->AddLastChild(yyvsp[0].m_pParseNode);
2981
pW->AddLastChild(yyvsp[-2].m_pParseNode);
2982
// Make sure that any assigns in the two expressions don't dup
2983
yyvsp[-6].m_pParseNode->NoDup();
2984
yyvsp[-2].m_pParseNode->NoDup();
2989
#line 1079 "parser.yxx"
2991
yyval.m_pParseNode=new CqParseNodeSolarConstruct();
2992
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
2993
yyval.m_pParseNode->AddLastChild(yyvsp[0].m_pParseNode);
2998
#line 1085 "parser.yxx"
3000
yyval.m_pParseNode=new CqParseNodeSolarConstruct(TqTrue);
3001
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3002
CqParseNode* pArg=new CqParseNode();
3003
pArg->SetPos(ParseLineNumber,ParseStreamName.c_str());
3004
pArg->AddFirstChild(yyvsp[-4].m_pParseNode);
3005
pArg->AddFirstChild(yyvsp[-2].m_pParseNode);
3006
yyval.m_pParseNode->AddLastChild(pArg);
3007
yyval.m_pParseNode->AddLastChild(yyvsp[0].m_pParseNode);
3008
// Make sure that any assigns in the two expressions don't dup
3009
yyvsp[-4].m_pParseNode->NoDup();
3010
yyvsp[-2].m_pParseNode->NoDup();
3015
#line 1099 "parser.yxx"
3017
yyval.m_pParseNode=new CqParseNodeIlluminateConstruct();
3018
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3019
yyval.m_pParseNode->AddLastChild(yyvsp[-2].m_pParseNode);
3020
yyval.m_pParseNode->AddLastChild(yyvsp[0].m_pParseNode);
3021
// Make sure that any assigns in the two expressions don't dup
3022
yyvsp[-2].m_pParseNode->NoDup();
3027
#line 1108 "parser.yxx"
3029
yyval.m_pParseNode=new CqParseNodeIlluminateConstruct(TqTrue);
3030
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3031
CqParseNode* pArg=new CqParseNode();
3032
pArg->SetPos(ParseLineNumber,ParseStreamName.c_str());
3033
pArg->AddFirstChild(yyvsp[-6].m_pParseNode);
3034
pArg->AddFirstChild(yyvsp[-4].m_pParseNode);
3035
pArg->AddFirstChild(yyvsp[-2].m_pParseNode);
3036
yyval.m_pParseNode->AddLastChild(pArg);
3037
yyval.m_pParseNode->AddLastChild(yyvsp[0].m_pParseNode);
3038
// Make sure that any assigns in the two expressions don't dup
3039
yyvsp[-6].m_pParseNode->NoDup();
3040
yyvsp[-4].m_pParseNode->NoDup();
3041
yyvsp[-2].m_pParseNode->NoDup();
3046
#line 1124 "parser.yxx"
3048
yyval.m_pParseNode=new CqParseNodeIlluminanceConstruct();
3049
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3050
CqParseNode* pArg=new CqParseNode();
3051
pArg->SetPos(ParseLineNumber,ParseStreamName.c_str());
3052
pArg->AddFirstChild(new CqParseNodeStringConst("")); // [category]
3053
pArg->AddFirstChild(yyvsp[-2].m_pParseNode);
3054
yyval.m_pParseNode->AddLastChild(pArg);
3055
yyval.m_pParseNode->AddLastChild(yyvsp[0].m_pParseNode);
3056
// Make sure that any assigns in the two expressions don't dup
3057
yyvsp[-2].m_pParseNode->NoDup();
3062
#line 1137 "parser.yxx"
3064
yyval.m_pParseNode=new CqParseNodeIlluminanceConstruct();
3065
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3066
CqParseNode* pArg=new CqParseNode();
3067
pArg->SetPos(ParseLineNumber,ParseStreamName.c_str());
3068
pArg->AddFirstChild(yyvsp[-4].m_pParseNode);
3069
pArg->AddFirstChild(yyvsp[-2].m_pParseNode);
3070
yyval.m_pParseNode->AddLastChild(pArg);
3071
yyval.m_pParseNode->AddLastChild(yyvsp[0].m_pParseNode);
3072
// Make sure that any assigns in the two expressions don't dup
3073
yyvsp[-4].m_pParseNode->NoDup();
3074
yyvsp[-2].m_pParseNode->NoDup();
3079
#line 1151 "parser.yxx"
3081
yyval.m_pParseNode=new CqParseNodeIlluminanceConstruct(TqTrue);
3082
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3083
CqParseNode* pArg=new CqParseNode();
3084
pArg->SetPos(ParseLineNumber,ParseStreamName.c_str());
3085
pArg->AddFirstChild(new CqParseNodeStringConst("")); // [category]
3086
pArg->AddFirstChild(yyvsp[-6].m_pParseNode);
3087
pArg->AddFirstChild(yyvsp[-4].m_pParseNode);
3088
pArg->AddFirstChild(yyvsp[-2].m_pParseNode);
3089
yyval.m_pParseNode->AddLastChild(pArg);
3090
yyval.m_pParseNode->AddLastChild(yyvsp[0].m_pParseNode);
3091
// Make sure that any assigns in the two expressions don't dup
3092
yyvsp[-6].m_pParseNode->NoDup();
3093
yyvsp[-4].m_pParseNode->NoDup();
3094
yyvsp[-2].m_pParseNode->NoDup();
3099
#line 1168 "parser.yxx"
3101
yyval.m_pParseNode=new CqParseNodeIlluminanceConstruct(TqTrue);
3102
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3103
CqParseNode* pArg=new CqParseNode();
3104
pArg->SetPos(ParseLineNumber,ParseStreamName.c_str());
3105
pArg->AddFirstChild(yyvsp[-8].m_pParseNode);
3106
pArg->AddFirstChild(yyvsp[-6].m_pParseNode);
3107
pArg->AddFirstChild(yyvsp[-4].m_pParseNode);
3108
pArg->AddFirstChild(yyvsp[-2].m_pParseNode);
3109
yyval.m_pParseNode->AddLastChild(pArg);
3110
yyval.m_pParseNode->AddLastChild(yyvsp[0].m_pParseNode);
3111
// Make sure that any assigns in the two expressions don't dup
3112
yyvsp[-8].m_pParseNode->NoDup();
3113
yyvsp[-6].m_pParseNode->NoDup();
3114
yyvsp[-4].m_pParseNode->NoDup();
3115
yyvsp[-2].m_pParseNode->NoDup();
3120
#line 1193 "parser.yxx"
3122
yyval.m_pParseNode=new CqParseNode();
3123
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3128
#line 1197 "parser.yxx"
3130
yyval.m_pParseNode=new CqParseNode();
3131
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3136
#line 1207 "parser.yxx"
3138
std::vector<SqFuncRef> func;
3139
CqFuncDef::FindFunction("operator.", func);
3140
CqParseNodeFunctionCall* pFunc=new CqParseNodeFunctionCall(func);
3141
pFunc->SetPos(ParseLineNumber,ParseStreamName.c_str());
3142
pFunc->AddLastChild(yyvsp[-2].m_pParseNode);
3143
pFunc->AddLastChild(yyvsp[0].m_pParseNode);
3145
yyval.m_pParseNode=pFunc;
3150
#line 1218 "parser.yxx"
3152
std::vector<SqFuncRef> func;
3153
CqFuncDef::FindFunction("operator/", func);
3154
CqParseNodeFunctionCall* pFunc=new CqParseNodeFunctionCall(func);
3155
pFunc->SetPos(ParseLineNumber,ParseStreamName.c_str());
3156
pFunc->AddLastChild(yyvsp[-2].m_pParseNode);
3157
pFunc->AddLastChild(yyvsp[0].m_pParseNode);
3159
yyval.m_pParseNode=pFunc;
3164
#line 1229 "parser.yxx"
3166
std::vector<SqFuncRef> func;
3167
CqFuncDef::FindFunction("operator*", func);
3168
CqParseNodeFunctionCall* pFunc=new CqParseNodeFunctionCall(func);
3169
pFunc->SetPos(ParseLineNumber,ParseStreamName.c_str());
3170
pFunc->AddLastChild(yyvsp[-2].m_pParseNode);
3171
pFunc->AddLastChild(yyvsp[0].m_pParseNode);
3173
yyval.m_pParseNode=pFunc;
3178
#line 1240 "parser.yxx"
3180
std::vector<SqFuncRef> func;
3181
CqFuncDef::FindFunction("operator^", func);
3182
CqParseNodeFunctionCall* pFunc=new CqParseNodeFunctionCall(func);
3183
pFunc->SetPos(ParseLineNumber,ParseStreamName.c_str());
3184
pFunc->AddLastChild(yyvsp[-2].m_pParseNode);
3185
pFunc->AddLastChild(yyvsp[0].m_pParseNode);
3187
yyval.m_pParseNode=pFunc;
3192
#line 1251 "parser.yxx"
3194
std::vector<SqFuncRef> func;
3195
CqFuncDef::FindFunction("operator+", func);
3196
CqParseNodeFunctionCall* pFunc=new CqParseNodeFunctionCall(func);
3197
pFunc->SetPos(ParseLineNumber,ParseStreamName.c_str());
3198
pFunc->AddLastChild(yyvsp[-2].m_pParseNode);
3199
pFunc->AddLastChild(yyvsp[0].m_pParseNode);
3201
yyval.m_pParseNode=pFunc;
3206
#line 1262 "parser.yxx"
3208
std::vector<SqFuncRef> func;
3209
CqFuncDef::FindFunction("operator-", func);
3210
CqParseNodeFunctionCall* pFunc=new CqParseNodeFunctionCall(func);
3211
pFunc->SetPos(ParseLineNumber,ParseStreamName.c_str());
3212
pFunc->AddLastChild(yyvsp[-2].m_pParseNode);
3213
pFunc->AddLastChild(yyvsp[0].m_pParseNode);
3215
yyval.m_pParseNode=pFunc;
3220
#line 1273 "parser.yxx"
3222
std::vector<SqFuncRef> func;
3223
CqFuncDef::FindFunction("operatorneg", func);
3224
CqParseNodeFunctionCall* pFunc=new CqParseNodeFunctionCall(func);
3225
pFunc->SetPos(ParseLineNumber,ParseStreamName.c_str());
3226
pFunc->AddFirstChild(yyvsp[0].m_pParseNode);
3228
yyval.m_pParseNode=pFunc;
3233
#line 1284 "parser.yxx"
3235
CqParseNode* pNew=new CqParseNodeQCond();
3236
pNew->SetPos(ParseLineNumber,ParseStreamName.c_str());
3237
pNew->AddLastChild(yyvsp[-4].m_pParseNode);
3238
pNew->AddLastChild(yyvsp[-2].m_pParseNode);
3239
pNew->AddLastChild(yyvsp[0].m_pParseNode);
3240
yyval.m_pParseNode=pNew;
3245
#line 1296 "parser.yxx"
3247
yyval.m_pParseNode=new CqParseNode();
3248
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3249
CqParseNode* pCast=new CqParseNodeCast(yyvsp[-1].m_TypeAndSpace.Type);
3250
pCast->SetPos(ParseLineNumber,ParseStreamName.c_str());
3251
pCast->AddFirstChild(yyvsp[0].m_pParseNode);
3253
TqInt Type=(TqInt)(yyvsp[-1].m_TypeAndSpace.Type&Type_Mask);
3254
CqString* pSpace=yyvsp[-1].m_TypeAndSpace.Space;
3255
// Check if the type has a valid space associated
3256
if(pSpace!=0 && pSpace->compare("")!=0 &&
3257
((Type==Type_Point) ||
3258
(Type==Type_Normal) ||
3259
(Type==Type_Vector) ||
3260
(Type==Type_Matrix) ||
3261
(Type==Type_Color) ))
3263
// Create a transform function.
3264
std::vector<SqFuncRef> funcTrans;
3265
CqString strTrans("transform");;
3266
if(Type==Type_Normal) strTrans="ntransform";
3267
else if(Type==Type_Vector) strTrans="vtransform";
3268
else if(Type==Type_Matrix) strTrans="mtransform";
3269
else if(Type==Type_Color) strTrans="ctransform";
3270
if(FindFunction(strTrans.c_str(), funcTrans))
3272
yyval.m_pParseNode=new CqParseNodeFunctionCall(funcTrans);
3273
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3275
// And create a holder for the arguments.
3276
CqParseNode* pFromSpace=new CqParseNodeStringConst((*yyvsp[-1].m_TypeAndSpace.Space).c_str());
3277
CqParseNode* pToSpace;
3278
if(Type != Type_Color) pToSpace = new CqParseNodeStringConst("current");
3279
else pToSpace = new CqParseNodeStringConst("rgb");
3280
yyval.m_pParseNode->AddLastChild(pFromSpace);
3281
yyval.m_pParseNode->AddLastChild(pToSpace);
3282
yyval.m_pParseNode->AddLastChild(pCast);
3286
yyval.m_pParseNode->AddFirstChild(pCast);
3291
#line 1342 "parser.yxx"
3293
yyval.m_pParseNode=new CqParseNodeFloatConst(yyvsp[0].m_FloatConst);
3294
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3299
#line 1347 "parser.yxx"
3301
yyval.m_pParseNode=new CqParseNodeVariable(yyvsp[0].m_pSymbol.VarRef);
3302
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3307
#line 1351 "parser.yxx"
3309
yyval.m_pParseNode=new CqParseNodeVariableArray(yyvsp[-3].m_pSymbol.VarRef);
3310
yyval.m_pParseNode->AddLastChild(yyvsp[-1].m_pParseNode);
3311
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3316
#line 1356 "parser.yxx"
3318
yyval.m_pParseNode=new CqParseNodeStringConst(yyvsp[0].m_Identifier->c_str());
3319
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3324
#line 1364 "parser.yxx"
3326
yyval.m_pParseNode=yyvsp[-1].m_pParseNode;
3331
#line 1368 "parser.yxx"
3333
yyval.m_pParseNode=new CqParseNodeTriple();
3334
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3335
yyval.m_pParseNode->AddLastChild(yyvsp[-5].m_pParseNode);
3336
yyval.m_pParseNode->AddLastChild(yyvsp[-3].m_pParseNode);
3337
yyval.m_pParseNode->AddLastChild(yyvsp[-1].m_pParseNode);
3342
#line 1376 "parser.yxx"
3344
yyval.m_pParseNode=new CqParseNodeHexTuple();
3345
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3346
yyval.m_pParseNode->AddLastChild(yyvsp[-31].m_pParseNode);
3347
yyval.m_pParseNode->AddLastChild(yyvsp[-29].m_pParseNode);
3348
yyval.m_pParseNode->AddLastChild(yyvsp[-27].m_pParseNode);
3349
yyval.m_pParseNode->AddLastChild(yyvsp[-25].m_pParseNode);
3350
yyval.m_pParseNode->AddLastChild(yyvsp[-23].m_pParseNode);
3351
yyval.m_pParseNode->AddLastChild(yyvsp[-21].m_pParseNode);
3352
yyval.m_pParseNode->AddLastChild(yyvsp[-19].m_pParseNode);
3353
yyval.m_pParseNode->AddLastChild(yyvsp[-17].m_pParseNode);
3354
yyval.m_pParseNode->AddLastChild(yyvsp[-15].m_pParseNode);
3355
yyval.m_pParseNode->AddLastChild(yyvsp[-13].m_pParseNode);
3356
yyval.m_pParseNode->AddLastChild(yyvsp[-11].m_pParseNode);
3357
yyval.m_pParseNode->AddLastChild(yyvsp[-9].m_pParseNode);
3358
yyval.m_pParseNode->AddLastChild(yyvsp[-7].m_pParseNode);
3359
yyval.m_pParseNode->AddLastChild(yyvsp[-5].m_pParseNode);
3360
yyval.m_pParseNode->AddLastChild(yyvsp[-3].m_pParseNode);
3361
yyval.m_pParseNode->AddLastChild(yyvsp[-1].m_pParseNode);
3366
#line 1399 "parser.yxx"
3367
{ yyval.m_pParseNode=new CqParseNodeRelOp(Op_G); }
3371
#line 1400 "parser.yxx"
3372
{ yyval.m_pParseNode=new CqParseNodeRelOp(Op_GE); }
3376
#line 1401 "parser.yxx"
3377
{ yyval.m_pParseNode=new CqParseNodeRelOp(Op_L); }
3381
#line 1402 "parser.yxx"
3382
{ yyval.m_pParseNode=new CqParseNodeRelOp(Op_LE); }
3386
#line 1403 "parser.yxx"
3387
{ yyval.m_pParseNode=new CqParseNodeRelOp(Op_EQ); }
3391
#line 1404 "parser.yxx"
3392
{ yyval.m_pParseNode=new CqParseNodeRelOp(Op_NE); }
3396
#line 1408 "parser.yxx"
3398
yyval.m_pParseNode=yyvsp[-1].m_pParseNode;
3403
#line 1412 "parser.yxx"
3405
yyval.m_pParseNode=yyvsp[-1].m_pParseNode;
3406
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3407
yyval.m_pParseNode->AddFirstChild(yyvsp[-2].m_pParseNode);
3408
yyval.m_pParseNode->AddFirstChild(yyvsp[0].m_pParseNode);
3413
#line 1419 "parser.yxx"
3415
yyval.m_pParseNode=new CqParseNodeLogicalOp(Op_LogAnd);
3416
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3417
yyval.m_pParseNode->AddFirstChild(yyvsp[-2].m_pParseNode);
3418
yyval.m_pParseNode->AddLastChild(yyvsp[0].m_pParseNode);
3423
#line 1426 "parser.yxx"
3425
yyval.m_pParseNode=new CqParseNodeLogicalOp(Op_LogOr);
3426
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3427
yyval.m_pParseNode->AddFirstChild(yyvsp[-2].m_pParseNode);
3428
yyval.m_pParseNode->AddLastChild(yyvsp[0].m_pParseNode);
3433
#line 1432 "parser.yxx"
3435
yyval.m_pParseNode=new CqParseNodeUnaryOp(Op_LogicalNot);
3436
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3437
yyval.m_pParseNode->AddLastChild(yyvsp[0].m_pParseNode);
3442
#line 1441 "parser.yxx"
3444
yyval.m_pParseNode=new CqParseNodeAssign(yyvsp[-2].m_pSymbol.VarRef);
3445
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3446
yyval.m_pParseNode->AddLastChild(yyvsp[0].m_pParseNode);
3451
#line 1447 "parser.yxx"
3453
yyval.m_pParseNode=new CqParseNodeAssign(yyvsp[-2].m_pSymbol.VarRef);
3454
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3456
std::vector<SqFuncRef> func;
3457
CqFuncDef::FindFunction("operator+", func);
3458
CqParseNodeFunctionCall* pFunc=new CqParseNodeFunctionCall(func);
3459
pFunc->SetPos(ParseLineNumber,ParseStreamName.c_str());
3460
pFunc->AddLastChild(new CqParseNodeVariable(yyvsp[-2].m_pSymbol.VarRef));
3461
pFunc->AddLastChild(yyvsp[0].m_pParseNode);
3463
yyval.m_pParseNode->AddLastChild(pFunc);
3468
#line 1461 "parser.yxx"
3470
yyval.m_pParseNode=new CqParseNodeAssign(yyvsp[-2].m_pSymbol.VarRef);
3471
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3473
std::vector<SqFuncRef> func;
3474
CqFuncDef::FindFunction("operator-", func);
3475
CqParseNodeFunctionCall* pFunc=new CqParseNodeFunctionCall(func);
3476
pFunc->SetPos(ParseLineNumber,ParseStreamName.c_str());
3477
pFunc->AddLastChild(new CqParseNodeVariable(yyvsp[-2].m_pSymbol.VarRef));
3478
pFunc->AddLastChild(yyvsp[0].m_pParseNode);
3480
yyval.m_pParseNode->AddLastChild(pFunc);
3485
#line 1475 "parser.yxx"
3487
yyval.m_pParseNode=new CqParseNodeAssign(yyvsp[-2].m_pSymbol.VarRef);
3488
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3490
std::vector<SqFuncRef> func;
3491
CqFuncDef::FindFunction("operator*", func);
3492
CqParseNodeFunctionCall* pFunc=new CqParseNodeFunctionCall(func);
3493
pFunc->SetPos(ParseLineNumber,ParseStreamName.c_str());
3494
pFunc->AddLastChild(new CqParseNodeVariable(yyvsp[-2].m_pSymbol.VarRef));
3495
pFunc->AddLastChild(yyvsp[0].m_pParseNode);
3497
yyval.m_pParseNode->AddLastChild(pFunc);
3502
#line 1489 "parser.yxx"
3504
yyval.m_pParseNode=new CqParseNodeAssign(yyvsp[-2].m_pSymbol.VarRef);
3505
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3507
std::vector<SqFuncRef> func;
3508
CqFuncDef::FindFunction("operator/", func);
3509
CqParseNodeFunctionCall* pFunc=new CqParseNodeFunctionCall(func);
3510
pFunc->SetPos(ParseLineNumber,ParseStreamName.c_str());
3511
pFunc->AddLastChild(new CqParseNodeVariable(yyvsp[-2].m_pSymbol.VarRef));
3512
pFunc->AddLastChild(yyvsp[0].m_pParseNode);
3514
yyval.m_pParseNode->AddLastChild(pFunc);
3519
#line 1503 "parser.yxx"
3521
yyval.m_pParseNode=new CqParseNodeAssignArray(yyvsp[-5].m_pSymbol.VarRef);
3522
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3523
yyval.m_pParseNode->AddLastChild(yyvsp[0].m_pParseNode);
3524
yyval.m_pParseNode->AddLastChild(yyvsp[-3].m_pParseNode);
3529
#line 1510 "parser.yxx"
3531
yyval.m_pParseNode=new CqParseNodeAssignArray(yyvsp[-5].m_pSymbol.VarRef);
3532
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3534
std::vector<SqFuncRef> func;
3535
CqFuncDef::FindFunction("operator+", func);
3536
CqParseNodeFunctionCall* pFunc=new CqParseNodeFunctionCall(func);
3537
pFunc->SetPos(ParseLineNumber,ParseStreamName.c_str());
3538
CqParseNodeVariableArray* pVar=new CqParseNodeVariableArray(yyvsp[-5].m_pSymbol.VarRef);
3539
pVar->AddLastChild(yyvsp[-3].m_pParseNode->Clone());
3540
pFunc->AddLastChild(pVar);
3542
pFunc->AddLastChild(yyvsp[0].m_pParseNode);
3544
yyval.m_pParseNode->AddLastChild(pFunc);
3545
yyval.m_pParseNode->AddLastChild(yyvsp[-3].m_pParseNode);
3550
#line 1528 "parser.yxx"
3552
yyval.m_pParseNode=new CqParseNodeAssignArray(yyvsp[-5].m_pSymbol.VarRef);
3553
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3555
std::vector<SqFuncRef> func;
3556
CqFuncDef::FindFunction("operator-", func);
3557
CqParseNodeFunctionCall* pFunc=new CqParseNodeFunctionCall(func);
3558
pFunc->SetPos(ParseLineNumber,ParseStreamName.c_str());
3559
CqParseNodeVariableArray* pVar=new CqParseNodeVariableArray(yyvsp[-5].m_pSymbol.VarRef);
3560
pVar->AddLastChild(yyvsp[-3].m_pParseNode->Clone());
3561
pFunc->AddLastChild(pVar);
3563
pFunc->AddLastChild(yyvsp[0].m_pParseNode);
3565
yyval.m_pParseNode->AddLastChild(pFunc);
3566
yyval.m_pParseNode->AddLastChild(yyvsp[-3].m_pParseNode);
3571
#line 1546 "parser.yxx"
3573
yyval.m_pParseNode=new CqParseNodeAssignArray(yyvsp[-5].m_pSymbol.VarRef);
3574
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3576
std::vector<SqFuncRef> func;
3577
CqFuncDef::FindFunction("operator*", func);
3578
CqParseNodeFunctionCall* pFunc=new CqParseNodeFunctionCall(func);
3579
pFunc->SetPos(ParseLineNumber,ParseStreamName.c_str());
3580
CqParseNodeVariableArray* pVar=new CqParseNodeVariableArray(yyvsp[-5].m_pSymbol.VarRef);
3581
pVar->AddLastChild(yyvsp[-3].m_pParseNode->Clone());
3582
pFunc->AddLastChild(pVar);
3584
pFunc->AddLastChild(yyvsp[0].m_pParseNode);
3586
yyval.m_pParseNode->AddLastChild(pFunc);
3587
yyval.m_pParseNode->AddLastChild(yyvsp[-3].m_pParseNode);
3592
#line 1564 "parser.yxx"
3594
yyval.m_pParseNode=new CqParseNodeAssignArray(yyvsp[-5].m_pSymbol.VarRef);
3595
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3597
std::vector<SqFuncRef> func;
3598
CqFuncDef::FindFunction("operator/", func);
3599
CqParseNodeFunctionCall* pFunc=new CqParseNodeFunctionCall(func);
3600
pFunc->SetPos(ParseLineNumber,ParseStreamName.c_str());
3601
CqParseNodeVariableArray* pVar=new CqParseNodeVariableArray(yyvsp[-5].m_pSymbol.VarRef);
3602
pVar->AddLastChild(yyvsp[-3].m_pParseNode->Clone());
3603
pFunc->AddLastChild(pVar);
3605
pFunc->AddLastChild(yyvsp[0].m_pParseNode);
3607
yyval.m_pParseNode->AddLastChild(pFunc);
3608
yyval.m_pParseNode->AddLastChild(yyvsp[-3].m_pParseNode);
3613
#line 1585 "parser.yxx"
3615
std::vector<SqFuncRef> func;
3616
CqFuncDef::FindFunction(CqFuncDef::GetFunctionPtr(yyvsp[-3].m_pSymbol.FuncRef)->strName(), func);
3617
CqParseNodeFunctionCall* pFunc=new CqParseNodeFunctionCall(func);
3618
pFunc->SetPos(ParseLineNumber,ParseStreamName.c_str());
3619
while(yyvsp[-1].m_pParseNode->pFirstChild()!=0) pFunc->AddLastChild(yyvsp[-1].m_pParseNode->pFirstChild());
3621
yyval.m_pParseNode=pFunc;
3626
#line 1594 "parser.yxx"
3628
std::vector<SqFuncRef> func;
3629
CqFuncDef::FindFunction(CqFuncDef::GetFunctionPtr(yyvsp[-2].m_pSymbol.FuncRef)->strName(), func);
3630
CqParseNodeFunctionCall* pFunc=new CqParseNodeFunctionCall(func);
3631
pFunc->SetPos(ParseLineNumber,ParseStreamName.c_str());
3633
yyval.m_pParseNode=pFunc;
3638
#line 1606 "parser.yxx"
3640
std::cerr << warning << "Unresolved function " << yyvsp[-3].m_Identifier->c_str() << " will be treated as a DSO at runtime" << std::endl;
3641
CqParseNode* pArgs=yyvsp[-1].m_pParseNode;
3642
CqString strArgTypes("");
3645
CqParseNode* pArg=static_cast<CqParseNode*>(pArgs->pFirstChild());
3648
strArgTypes+=CqParseNode::TypeIdentifier(pArg->ResType());
3649
pArg=static_cast<CqParseNode*>(pArg->pNext());
3653
CqFuncDef func_spec(Type_Nil,yyvsp[-3].m_Identifier->c_str(),"unresolved",strArgTypes.c_str(), (CqParseNode*)NULL, pArgs);
3654
CqParseNodeUnresolvedCall* pUFunc=new CqParseNodeUnresolvedCall(func_spec);
3655
pUFunc->SetPos(ParseLineNumber,ParseStreamName.c_str());
3656
while(yyvsp[-1].m_pParseNode->pFirstChild()!=0) pUFunc->AddLastChild(yyvsp[-1].m_pParseNode->pFirstChild());
3658
yyval.m_pParseNode=pUFunc;
3663
#line 1628 "parser.yxx"
3665
// Need to emit a warning.
3666
// This should in theory be the eaiest case to handle
3667
// since there are no arguments that might need casting
3669
std::cerr << warning << "Unresolved function " << yyvsp[-2].m_Identifier->c_str() << " will be treated as a DSO at runtime" << std::endl;
3670
CqFuncDef func_spec(Type_Nil, yyvsp[-2].m_Identifier->c_str(), "unresolved","");
3671
CqParseNodeUnresolvedCall* pUFunc=new CqParseNodeUnresolvedCall(func_spec);
3672
pUFunc->SetPos(ParseLineNumber,ParseStreamName.c_str());
3674
yyval.m_pParseNode=pUFunc;
3679
#line 1643 "parser.yxx"
3681
// Create a list header, and add the first entry.
3682
yyval.m_pParseNode=new CqParseNode();
3683
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3684
yyval.m_pParseNode->AddLastChild(yyvsp[0].m_pParseNode);
3689
#line 1650 "parser.yxx"
3691
// Add this entry to the list.
3692
yyval.m_pParseNode->AddLastChild(yyvsp[0].m_pParseNode);
3697
#line 1658 "parser.yxx"
3699
// Add the texture_filename as the first argument
3700
yyval.m_pParseNode->AddFirstChild(yyvsp[-3].m_pParseNode);
3701
yyval.m_pParseNode->AddLastChild(yyvsp[-2].m_pParseNode);
3702
// Add all texture_arguments as further arguments to the function.
3703
CqParseNode* pParam=yyvsp[-1].m_pParseNode->pFirstChild();
3706
CqParseNode* pTemp=pParam->pNext();
3707
yyval.m_pParseNode->AddLastChild(pParam);
3714
#line 1672 "parser.yxx"
3716
// Add the texture_filename as the first argument
3717
yyval.m_pParseNode->AddFirstChild(yyvsp[-2].m_pParseNode);
3718
yyval.m_pParseNode->AddLastChild(new CqParseNodeFloatConst(0));
3719
// Add all texture_arguments as further arguments to the function.
3720
CqParseNode* pParam=yyvsp[-1].m_pParseNode->pFirstChild();
3723
CqParseNode* pTemp=pParam->pNext();
3724
yyval.m_pParseNode->AddLastChild(pParam);
3731
#line 1686 "parser.yxx"
3733
// Add the texture_filename as the first argument
3734
yyval.m_pParseNode->AddFirstChild(yyvsp[-2].m_pParseNode);
3735
yyval.m_pParseNode->AddLastChild(yyvsp[-1].m_pParseNode);
3740
#line 1692 "parser.yxx"
3742
// Add the texture_filename as the first argument
3743
yyval.m_pParseNode->AddFirstChild(yyvsp[-1].m_pParseNode);
3744
yyval.m_pParseNode->AddLastChild(new CqParseNodeFloatConst(0));
3749
#line 1700 "parser.yxx"
3751
std::vector<SqFuncRef> func;
3752
CqFuncDef::FindFunction("texture", func);
3753
yyval.m_pParseNode=new CqParseNodeFunctionCall(func);
3754
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3759
#line 1706 "parser.yxx"
3761
std::vector<SqFuncRef> func;
3762
CqFuncDef::FindFunction("environment", func);
3763
yyval.m_pParseNode=new CqParseNodeFunctionCall(func);
3764
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3769
#line 1712 "parser.yxx"
3771
std::vector<SqFuncRef> func;
3772
CqFuncDef::FindFunction("bump", func);
3773
yyval.m_pParseNode=new CqParseNodeFunctionCall(func);
3774
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3779
#line 1718 "parser.yxx"
3781
std::vector<SqFuncRef> func;
3782
CqFuncDef::FindFunction("shadow", func);
3783
yyval.m_pParseNode=new CqParseNodeFunctionCall(func);
3784
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3789
#line 1724 "parser.yxx"
3791
std::vector<SqFuncRef> func;
3792
CqFuncDef::FindFunction("occlusion", func);
3793
yyval.m_pParseNode=new CqParseNodeFunctionCall(func);
3794
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3799
#line 1733 "parser.yxx"
3801
yyval.m_pParseNode=yyvsp[0].m_pParseNode;
3802
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3807
#line 1740 "parser.yxx"
3808
{ yyval.m_pParseNode=yyvsp[-1].m_pParseNode; }
3812
#line 1744 "parser.yxx"
3814
// Create a list header and add the first entry.
3815
yyval.m_pParseNode=new CqParseNode();
3816
yyval.m_pParseNode->SetPos(ParseLineNumber,ParseStreamName.c_str());
3817
yyval.m_pParseNode->AddFirstChild(yyvsp[0].m_pParseNode);
3822
#line 1751 "parser.yxx"
3824
// Add this entry to the list.
3825
yyval.m_pParseNode->AddLastChild(yyvsp[0].m_pParseNode);
3830
#line 1764 "parser.yxx"
3831
{yyval.m_CommType=CommTypeAtmosphere;}
3835
#line 1765 "parser.yxx"
3836
{yyval.m_CommType=CommTypeDisplacement;}
3840
#line 1766 "parser.yxx"
3841
{yyval.m_CommType=CommTypeLightsource;}
3845
#line 1767 "parser.yxx"
3846
{yyval.m_CommType=CommTypeSurface;}
3850
#line 1768 "parser.yxx"
3851
{yyval.m_CommType=CommTypeAttribute;}
3855
#line 1769 "parser.yxx"
3856
{yyval.m_CommType=CommTypeOption;}
3860
#line 1770 "parser.yxx"
3861
{yyval.m_CommType=CommTypeRendererInfo;}
3865
#line 1771 "parser.yxx"
3866
{yyval.m_CommType=CommTypeIncident;}
3870
#line 1772 "parser.yxx"
3871
{yyval.m_CommType=CommTypeOpposite;}
3875
#line 1773 "parser.yxx"
3876
{yyval.m_CommType=CommTypeTextureInfo;}
3880
#line 1779 "parser.yxx"
3883
TqBool fError=TqFalse;
3885
if((yyvsp[-3].m_pParseNode->ResType()&Type_Mask)!=Type_String) fError=TqTrue;
3887
// Get the variable, error if not a variable.
3888
if(yyvsp[-1].m_pSymbol.eType&1) pVD=CqVarDef::GetVariablePtr(yyvsp[-1].m_pSymbol.VarRef);
3890
if(pVD!=0 && !fError)
3892
yyval.m_pParseNode=new CqParseNodeCommFunction(yyvsp[-5].m_CommType, yyvsp[-1].m_pSymbol.VarRef);
3893
yyval.m_pParseNode->AddLastChild(yyvsp[-3].m_pParseNode);
3897
yyerror("invalid variable reference");
3898
yyval.m_pParseNode=new CqParseNode();
3904
#line 1801 "parser.yxx"
3907
TqBool fError=TqFalse;
3909
if((yyvsp[-5].m_pParseNode->ResType()&Type_Mask)!=Type_String) fError=TqTrue;
3911
if((yyvsp[-3].m_pParseNode->ResType()&Type_Mask)!=Type_String) fError=TqTrue;
3913
// Get the variable, error if not a variable.
3914
if(yyvsp[-1].m_pSymbol.eType&1) pVD=CqVarDef::GetVariablePtr(yyvsp[-1].m_pSymbol.VarRef);
3916
if(pVD!=0 && !fError)
3919
CqParseNode* pArgs=yyvsp[-5].m_pParseNode;
3920
CqParseNodeStringConst* pString = (CqParseNodeStringConst *) pArgs;
3921
CqString strArg("");
3922
strArg += pString->strValue();
3924
yyval.m_pParseNode=new CqParseNodeCommFunction(yyvsp[-7].m_CommType, strArg, yyvsp[-1].m_pSymbol.VarRef);
3925
yyval.m_pParseNode->AddLastChild(yyvsp[-3].m_pParseNode);
3929
yyerror("invalid variable reference");
3930
yyval.m_pParseNode=new CqParseNode();
3936
#line 1830 "parser.yxx"
3939
TqBool fError=TqFalse;
3941
if((yyvsp[-3].m_pParseNode->ResType()&Type_Mask)!=Type_String) fError=TqTrue;
3943
// Get the variable, error if not a variable.
3944
if(yyvsp[-1].m_pSymbol.eType&1) pVD=CqVarDef::GetVariablePtr(yyvsp[-1].m_pSymbol.VarRef);
3946
if(pVD!=0 && !fError)
3948
yyval.m_pParseNode=new CqParseNodeCommFunction(yyvsp[-5].m_CommType, yyvsp[-1].m_pSymbol.VarRef);
3949
yyval.m_pParseNode->AddLastChild(yyvsp[-3].m_pParseNode);
3953
yyerror("invalid variable reference");
3954
yyval.m_pParseNode=new CqParseNode();
3960
#line 1852 "parser.yxx"
3963
TqBool fError=TqFalse;
3965
if((yyvsp[-5].m_pParseNode->ResType()&Type_Mask)!=Type_String) fError=TqTrue;
3967
if((yyvsp[-3].m_pParseNode->ResType()&Type_Mask)!=Type_String) fError=TqTrue;
3969
// Get the variable, error if not a variable.
3970
if(yyvsp[-1].m_pSymbol.eType&1) pVD=CqVarDef::GetVariablePtr(yyvsp[-1].m_pSymbol.VarRef);
3972
if(pVD!=0 && !fError)
3975
CqParseNode* pArgs=yyvsp[-5].m_pParseNode;
3976
CqParseNodeStringConst* pString = (CqParseNodeStringConst *) pArgs;
3977
CqString strArg("");
3978
strArg += pString->strValue();
3980
yyval.m_pParseNode=new CqParseNodeCommFunction(yyvsp[-7].m_CommType, strArg, yyvsp[-1].m_pSymbol.VarRef);
3981
yyval.m_pParseNode->AddLastChild(yyvsp[-3].m_pParseNode);
3985
yyerror("invalid variable reference");
3986
yyval.m_pParseNode=new CqParseNode();
3994
/* Line 999 of yacc.c. */
3995
#line 3995 "y.tab.c"
4001
YY_STACK_PRINT (yyss, yyssp);
4006
/* Now `shift' the result of the reduction. Determine what state
4007
that goes to, based on the state we popped back to and the rule
4008
number reduced by. */
4012
yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4013
if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
4014
yystate = yytable[yystate];
4016
yystate = yydefgoto[yyn - YYNTOKENS];
4021
/*------------------------------------.
4022
| yyerrlab -- here on detecting error |
4023
`------------------------------------*/
4025
/* If not already recovering from an error, report this error. */
4030
yyn = yypact[yystate];
4032
if (YYPACT_NINF < yyn && yyn < YYLAST)
4034
YYSIZE_T yysize = 0;
4035
int yytype = YYTRANSLATE (yychar);
4040
/* Start YYX at -YYN if negative to avoid negative indexes in
4042
for (yyx = yyn < 0 ? -yyn : 0;
4043
yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
4044
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
4045
yysize += yystrlen (yytname[yyx]) + 15, yycount++;
4046
yysize += yystrlen ("syntax error, unexpected ") + 1;
4047
yysize += yystrlen (yytname[yytype]);
4048
yymsg = (char *) YYSTACK_ALLOC (yysize);
4051
char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
4052
yyp = yystpcpy (yyp, yytname[yytype]);
4057
for (yyx = yyn < 0 ? -yyn : 0;
4058
yyx < (int) (sizeof (yytname) / sizeof (char *));
4060
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
4062
const char *yyq = ! yycount ? ", expecting " : " or ";
4063
yyp = yystpcpy (yyp, yyq);
4064
yyp = yystpcpy (yyp, yytname[yyx]);
4069
YYSTACK_FREE (yymsg);
4072
yyerror ("syntax error; also virtual memory exhausted");
4075
#endif /* YYERROR_VERBOSE */
4076
yyerror ("syntax error");
4081
if (yyerrstatus == 3)
4083
/* If just tried and failed to reuse lookahead token after an
4084
error, discard it. */
4086
/* Return failure if at end of input. */
4087
if (yychar == YYEOF)
4089
/* Pop the error token. */
4091
/* Pop the rest of the stack. */
4092
while (yyss < yyssp)
4094
YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
4095
yydestruct (yystos[*yyssp], yyvsp);
4101
YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
4102
yydestruct (yytoken, &yylval);
4107
/* Else will try to reuse lookahead token after shifting the error
4112
/*----------------------------------------------------.
4113
| yyerrlab1 -- error raised explicitly by an action. |
4114
`----------------------------------------------------*/
4116
yyerrstatus = 3; /* Each real token shifted decrements this. */
4120
yyn = yypact[yystate];
4121
if (yyn != YYPACT_NINF)
4124
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4132
/* Pop the current state because it cannot handle the error token. */
4136
YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
4137
yydestruct (yystos[yystate], yyvsp);
4141
YY_STACK_PRINT (yyss, yyssp);
4147
YYDPRINTF ((stderr, "Shifting error token, "));
4156
/*-------------------------------------.
4157
| yyacceptlab -- YYACCEPT comes here. |
4158
`-------------------------------------*/
4163
/*-----------------------------------.
4164
| yyabortlab -- YYABORT comes here. |
4165
`-----------------------------------*/
4171
/*----------------------------------------------.
4172
| yyoverflowlab -- parser overflow comes here. |
4173
`----------------------------------------------*/
4175
yyerror ("parser stack overflow");
4183
YYSTACK_FREE (yyss);
4189
#line 1883 "parser.yxx"
4195
TqBool FindVariable(const char* name, SqVarRef& Ref)
4197
// First search in the current namespace, then in the global namespace.
4198
CqString strLocalVar(strNameSpace()+name);
4200
if(CqVarDef::FindVariable(strLocalVar.c_str(), Ref)) return(TqTrue);
4201
else return(CqVarDef::FindVariable(name, Ref));
4207
TqBool FindFunction(const char* name, std::vector<SqFuncRef>& Ref)
4209
// Search in the namespaces from local to global in order.
4210
CqString strNS(strNameSpace());
4214
CqString strLocalFunc(strNS+name);
4215
if(CqFuncDef::FindFunction(strLocalFunc.c_str(), Ref))
4218
// Extract the next namespace up.
4219
if( ( strNS.size() > 2 ) && ( strNS.substr( strNS.size()-2 ) == "::" ) )
4221
strNS = strNS.substr( 0, strNS.size()-2 );
4222
strNS = strNS.substr(0, strNS.rfind("::")+strlen("::"));
4225
}while( strNS.find_last_of("::") != std::string::npos );
4227
return(CqFuncDef::FindFunction(name, Ref));
4233
// Typecheck any declared variables.
4235
for(i=0; i<gLocalVars.size(); i++)
4237
if(gLocalVars[i].pDefValue()!=0)
4238
gLocalVars[i].pDefValue()->TypeCheck(CqParseNode::pAllTypes(), Type_Last-1);
4241
// Typecheck any local functions.
4242
for(i=0; i<gLocalFuncs.size(); i++)
4244
if(gLocalFuncs[i].pDef()!=0)
4246
// TqInt RetType=gLocalFuncs[i].Type();
4247
gLocalFuncs[i].pDefNode()->TypeCheck(CqParseNode::pAllTypes(), Type_Last-1);
4251
if(ParseTreePointer)
4252
ParseTreePointer->TypeCheck(CqParseNode::pAllTypes(), Type_Last-1);
4258
// Optimise any local functions.
4260
for(i=0; i<gLocalFuncs.size(); i++)
4262
if(gLocalFuncs[i].pDef()!=0)
4263
gLocalFuncs[i].pDefNode()->Optimise();
4266
if(ParseTreePointer)
4267
ParseTreePointer->Optimise();
4271
CqString strNameSpace()
4273
CqString strRes("");
4275
if(!ParseNameSpaceStack.empty())
4276
strRes=ParseNameSpaceStack.back();
4281
void InitStandardNamespace()
4283
ParseNameSpaceStack.push_back("");
4286
void ProcessShaderArguments( CqParseNode* pArgs )
4290
// Each child of the variable_definitions is a CqParseNodeVariable
4291
CqParseNodeVariable* pVar=static_cast<CqParseNodeVariable*>(pArgs->pFirstChild());
4295
// If storage is not specified, a shader parameter defaults to uniform.
4296
pVar->SetDefaultStorage(Type_Uniform);
4297
// Force the variable to be a parameter.
4300
// Check if a default value has been specified.
4301
CqParseNode* pDefValue=pVar->pFirstChild();
4304
// Get a pointer to the local variable.
4305
CqVarDef* pVarDef=CqVarDef::GetVariablePtr(pVar->VarRef());
4309
pDefValue->UnLink();
4310
CqParseNodeCast* pCast=new CqParseNodeCast(pVarDef->Type());
4311
Node.AddLastChild(pCast);
4312
pCast->AddLastChild(pDefValue);
4314
pVarDef->SetpDefValue(Node.pFirstChild());
4315
pVar->AddFirstChild( Node.pFirstChild() );
4318
pVar=static_cast<CqParseNodeVariable*>(pVar->pNext());
4326
static void yyerror(const CqString Message)
4328
ParseSucceeded = false;
4329
//(*ParseErrorStream) << "libslparse > parser > error: " << Message.c_str() << " at " << ParseStreamName.c_str() << " line " << ParseLineNumber << std::endl;
4330
CqString strErr( ParseStreamName.c_str() );
4332
strErr += ParseLineNumber;
4334
strErr += Message.c_str();