~ubuntu-branches/ubuntu/quantal/mesa/quantal

« back to all changes in this revision

Viewing changes to src/mesa/shader/slang/MachineIndependent/Gen_glslang_tab.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-02-21 12:44:07 UTC
  • mfrom: (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 22.
  • Revision ID: james.westby@ubuntu.com-20070221124407-rgcacs32mycrtadl
ImportĀ upstreamĀ versionĀ 6.5.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* A Bison parser, made by GNU Bison 1.875.  */
2
 
 
3
 
/* Skeleton parser for Yacc-like parsing with Bison,
4
 
   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
5
 
 
6
 
   This program is free software; you can redistribute it and/or modify
7
 
   it under the terms of the GNU General Public License as published by
8
 
   the Free Software Foundation; either version 2, or (at your option)
9
 
   any later version.
10
 
 
11
 
   This program is distributed in the hope that it will be useful,
12
 
   but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 
   GNU General Public License for more details.
15
 
 
16
 
   You should have received a copy of the GNU General Public License
17
 
   along with this program; if not, write to the Free Software
18
 
   Foundation, Inc., 59 Temple Place - Suite 330,
19
 
   Boston, MA 02111-1307, USA.  */
20
 
 
21
 
/* As a special exception, when this file is copied by Bison into a
22
 
   Bison output file, you may use that output file without restriction.
23
 
   This special exception was added by the Free Software Foundation
24
 
   in version 1.24 of Bison.  */
25
 
 
26
 
/* Written by Richard Stallman by simplifying the original so called
27
 
   ``semantic'' parser.  */
28
 
 
29
 
/* All symbols defined below should begin with yy or YY, to avoid
30
 
   infringing on user name space.  This should be done even for local
31
 
   variables, as they might otherwise be expanded by user macros.
32
 
   There are some unavoidable exceptions within include files to
33
 
   define necessary library symbols; they are noted "INFRINGES ON
34
 
   USER NAME SPACE" below.  */
35
 
 
36
 
/* Identify Bison output.  */
37
 
#define YYBISON 1
38
 
 
39
 
/* Skeleton name.  */
40
 
#define YYSKELETON_NAME "yacc.c"
41
 
 
42
 
/* Pure parsers.  */
43
 
#define YYPURE 1
44
 
 
45
 
/* Using locations.  */
46
 
#define YYLSP_NEEDED 0
47
 
 
48
 
 
49
 
 
50
 
/* Tokens.  */
51
 
#ifndef YYTOKENTYPE
52
 
# define YYTOKENTYPE
53
 
   /* Put the tokens into the symbol table, so that GDB and other debuggers
54
 
      know about them.  */
55
 
   enum yytokentype {
56
 
     ATTRIBUTE = 258,
57
 
     CONST_QUAL = 259,
58
 
     BOOL_TYPE = 260,
59
 
     FLOAT_TYPE = 261,
60
 
     INT_TYPE = 262,
61
 
     BREAK = 263,
62
 
     CONTINUE = 264,
63
 
     DO = 265,
64
 
     ELSE = 266,
65
 
     FOR = 267,
66
 
     IF = 268,
67
 
     DISCARD = 269,
68
 
     RETURN = 270,
69
 
     BVEC2 = 271,
70
 
     BVEC3 = 272,
71
 
     BVEC4 = 273,
72
 
     IVEC2 = 274,
73
 
     IVEC3 = 275,
74
 
     IVEC4 = 276,
75
 
     VEC2 = 277,
76
 
     VEC3 = 278,
77
 
     VEC4 = 279,
78
 
     MATRIX2 = 280,
79
 
     MATRIX3 = 281,
80
 
     MATRIX4 = 282,
81
 
     IN_QUAL = 283,
82
 
     OUT_QUAL = 284,
83
 
     INOUT_QUAL = 285,
84
 
     UNIFORM = 286,
85
 
     VARYING = 287,
86
 
     STRUCT = 288,
87
 
     VOID_TYPE = 289,
88
 
     WHILE = 290,
89
 
     SAMPLER1D = 291,
90
 
     SAMPLER2D = 292,
91
 
     SAMPLER3D = 293,
92
 
     SAMPLERCUBE = 294,
93
 
     SAMPLER1DSHADOW = 295,
94
 
     SAMPLER2DSHADOW = 296,
95
 
     IDENTIFIER = 297,
96
 
     TYPE_NAME = 298,
97
 
     FLOATCONSTANT = 299,
98
 
     INTCONSTANT = 300,
99
 
     BOOLCONSTANT = 301,
100
 
     FIELD_SELECTION = 302,
101
 
     LEFT_OP = 303,
102
 
     RIGHT_OP = 304,
103
 
     INC_OP = 305,
104
 
     DEC_OP = 306,
105
 
     LE_OP = 307,
106
 
     GE_OP = 308,
107
 
     EQ_OP = 309,
108
 
     NE_OP = 310,
109
 
     AND_OP = 311,
110
 
     OR_OP = 312,
111
 
     XOR_OP = 313,
112
 
     MUL_ASSIGN = 314,
113
 
     DIV_ASSIGN = 315,
114
 
     ADD_ASSIGN = 316,
115
 
     MOD_ASSIGN = 317,
116
 
     LEFT_ASSIGN = 318,
117
 
     RIGHT_ASSIGN = 319,
118
 
     AND_ASSIGN = 320,
119
 
     XOR_ASSIGN = 321,
120
 
     OR_ASSIGN = 322,
121
 
     SUB_ASSIGN = 323,
122
 
     LEFT_PAREN = 324,
123
 
     RIGHT_PAREN = 325,
124
 
     LEFT_BRACKET = 326,
125
 
     RIGHT_BRACKET = 327,
126
 
     LEFT_BRACE = 328,
127
 
     RIGHT_BRACE = 329,
128
 
     DOT = 330,
129
 
     COMMA = 331,
130
 
     COLON = 332,
131
 
     EQUAL = 333,
132
 
     SEMICOLON = 334,
133
 
     BANG = 335,
134
 
     DASH = 336,
135
 
     TILDE = 337,
136
 
     PLUS = 338,
137
 
     STAR = 339,
138
 
     SLASH = 340,
139
 
     PERCENT = 341,
140
 
     LEFT_ANGLE = 342,
141
 
     RIGHT_ANGLE = 343,
142
 
     VERTICAL_BAR = 344,
143
 
     CARET = 345,
144
 
     AMPERSAND = 346,
145
 
     QUESTION = 347
146
 
   };
147
 
#endif
148
 
#define ATTRIBUTE 258
149
 
#define CONST_QUAL 259
150
 
#define BOOL_TYPE 260
151
 
#define FLOAT_TYPE 261
152
 
#define INT_TYPE 262
153
 
#define BREAK 263
154
 
#define CONTINUE 264
155
 
#define DO 265
156
 
#define ELSE 266
157
 
#define FOR 267
158
 
#define IF 268
159
 
#define DISCARD 269
160
 
#define RETURN 270
161
 
#define BVEC2 271
162
 
#define BVEC3 272
163
 
#define BVEC4 273
164
 
#define IVEC2 274
165
 
#define IVEC3 275
166
 
#define IVEC4 276
167
 
#define VEC2 277
168
 
#define VEC3 278
169
 
#define VEC4 279
170
 
#define MATRIX2 280
171
 
#define MATRIX3 281
172
 
#define MATRIX4 282
173
 
#define IN_QUAL 283
174
 
#define OUT_QUAL 284
175
 
#define INOUT_QUAL 285
176
 
#define UNIFORM 286
177
 
#define VARYING 287
178
 
#define STRUCT 288
179
 
#define VOID_TYPE 289
180
 
#define WHILE 290
181
 
#define SAMPLER1D 291
182
 
#define SAMPLER2D 292
183
 
#define SAMPLER3D 293
184
 
#define SAMPLERCUBE 294
185
 
#define SAMPLER1DSHADOW 295
186
 
#define SAMPLER2DSHADOW 296
187
 
#define IDENTIFIER 297
188
 
#define TYPE_NAME 298
189
 
#define FLOATCONSTANT 299
190
 
#define INTCONSTANT 300
191
 
#define BOOLCONSTANT 301
192
 
#define FIELD_SELECTION 302
193
 
#define LEFT_OP 303
194
 
#define RIGHT_OP 304
195
 
#define INC_OP 305
196
 
#define DEC_OP 306
197
 
#define LE_OP 307
198
 
#define GE_OP 308
199
 
#define EQ_OP 309
200
 
#define NE_OP 310
201
 
#define AND_OP 311
202
 
#define OR_OP 312
203
 
#define XOR_OP 313
204
 
#define MUL_ASSIGN 314
205
 
#define DIV_ASSIGN 315
206
 
#define ADD_ASSIGN 316
207
 
#define MOD_ASSIGN 317
208
 
#define LEFT_ASSIGN 318
209
 
#define RIGHT_ASSIGN 319
210
 
#define AND_ASSIGN 320
211
 
#define XOR_ASSIGN 321
212
 
#define OR_ASSIGN 322
213
 
#define SUB_ASSIGN 323
214
 
#define LEFT_PAREN 324
215
 
#define RIGHT_PAREN 325
216
 
#define LEFT_BRACKET 326
217
 
#define RIGHT_BRACKET 327
218
 
#define LEFT_BRACE 328
219
 
#define RIGHT_BRACE 329
220
 
#define DOT 330
221
 
#define COMMA 331
222
 
#define COLON 332
223
 
#define EQUAL 333
224
 
#define SEMICOLON 334
225
 
#define BANG 335
226
 
#define DASH 336
227
 
#define TILDE 337
228
 
#define PLUS 338
229
 
#define STAR 339
230
 
#define SLASH 340
231
 
#define PERCENT 341
232
 
#define LEFT_ANGLE 342
233
 
#define RIGHT_ANGLE 343
234
 
#define VERTICAL_BAR 344
235
 
#define CARET 345
236
 
#define AMPERSAND 346
237
 
#define QUESTION 347
238
 
 
239
 
 
240
 
 
241
 
 
242
 
/* Copy the first part of user declarations.  */
243
 
#line 39 "glslang.y"
244
 
 
245
 
 
246
 
/* Based on:
247
 
ANSI C Yacc grammar
248
 
 
249
 
In 1985, Jeff Lee published his Yacc grammar (which is accompanied by a 
250
 
matching Lex specification) for the April 30, 1985 draft version of the 
251
 
ANSI C standard.  Tom Stockfisch reposted it to net.sources in 1987; that
252
 
original, as mentioned in the answer to question 17.25 of the comp.lang.c
253
 
FAQ, can be ftp'ed from ftp.uu.net, file usenet/net.sources/ansi.c.grammar.Z.
254
 
 
255
 
I intend to keep this version as close to the current C Standard grammar as 
256
 
possible; please let me know if you discover discrepancies. 
257
 
 
258
 
Jutta Degener, 1995 
259
 
*/
260
 
 
261
 
#include "SymbolTable.h"
262
 
#include "ParseHelper.h"
263
 
#include "../Public/ShaderLang.h"
264
 
 
265
 
#ifdef _WIN32
266
 
    #define YYPARSE_PARAM parseContext
267
 
    #define YYPARSE_PARAM_DECL TParseContext&
268
 
    #define YY_DECL int yylex(YYSTYPE* pyylval, TParseContext& parseContext)
269
 
    #define YYLEX_PARAM parseContext
270
 
#else
271
 
    #define YYPARSE_PARAM parseContextLocal
272
 
    #define parseContext (*((TParseContext*)(parseContextLocal)))
273
 
    #define YY_DECL int yylex(YYSTYPE* pyylval, void* parseContextLocal)
274
 
    #define YYLEX_PARAM (void*)(parseContextLocal)
275
 
    extern void yyerror(char*);    
276
 
#endif
277
 
 
278
 
#define FRAG_VERT_ONLY(S, L) {                                                  \
279
 
    if (parseContext.language != EShLangFragment &&                             \
280
 
        parseContext.language != EShLangVertex) {                               \
281
 
        parseContext.error(L, " supported in vertex/fragment shaders only ", S, "", "");   \
282
 
        parseContext.recover();                                                            \
283
 
    }                                                                           \
284
 
}
285
 
 
286
 
#define VERTEX_ONLY(S, L) {                                                     \
287
 
    if (parseContext.language != EShLangVertex) {                               \
288
 
        parseContext.error(L, " supported in vertex shaders only ", S, "", "");            \
289
 
        parseContext.recover();                                                            \
290
 
    }                                                                           \
291
 
}
292
 
 
293
 
#define FRAG_ONLY(S, L) {                                                       \
294
 
    if (parseContext.language != EShLangFragment) {                             \
295
 
        parseContext.error(L, " supported in fragment shaders only ", S, "", "");          \
296
 
        parseContext.recover();                                                            \
297
 
    }                                                                           \
298
 
}
299
 
 
300
 
#define PACK_ONLY(S, L) {                                                       \
301
 
    if (parseContext.language != EShLangPack) {                                 \
302
 
        parseContext.error(L, " supported in pack shaders only ", S, "", "");              \
303
 
        parseContext.recover();                                                            \
304
 
    }                                                                           \
305
 
}
306
 
 
307
 
#define UNPACK_ONLY(S, L) {                                                     \
308
 
    if (parseContext.language != EShLangUnpack) {                               \
309
 
        parseContext.error(L, " supported in unpack shaders only ", S, "", "");            \
310
 
        parseContext.recover();                                                            \
311
 
    }                                                                           \
312
 
}
313
 
 
314
 
#define PACK_UNPACK_ONLY(S, L) {                                                \
315
 
    if (parseContext.language != EShLangUnpack &&                               \
316
 
        parseContext.language != EShLangPack) {                                 \
317
 
        parseContext.error(L, " supported in pack/unpack shaders only ", S, "", "");       \
318
 
        parseContext.recover();                                                            \
319
 
    }                                                                           \
320
 
}
321
 
 
322
 
 
323
 
/* Enabling traces.  */
324
 
#ifndef YYDEBUG
325
 
# define YYDEBUG 1
326
 
#endif
327
 
 
328
 
/* Enabling verbose error messages.  */
329
 
#ifdef YYERROR_VERBOSE
330
 
# undef YYERROR_VERBOSE
331
 
# define YYERROR_VERBOSE 1
332
 
#else
333
 
# define YYERROR_VERBOSE 0
334
 
#endif
335
 
 
336
 
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
337
 
#line 117 "glslang.y"
338
 
typedef union YYSTYPE {
339
 
    struct {
340
 
        TSourceLoc line;
341
 
        union {
342
 
            TString *string;
343
 
            float f;
344
 
            int i;
345
 
            bool b;
346
 
        };
347
 
        TSymbol* symbol;
348
 
    } lex;
349
 
    struct {
350
 
        TSourceLoc line;
351
 
        TOperator op;
352
 
        union {
353
 
            TIntermNode* intermNode;
354
 
            TIntermNodePair nodePair;
355
 
            TIntermTyped* intermTypedNode;
356
 
            TIntermAggregate* intermAggregate;
357
 
        };
358
 
        union {
359
 
            TPublicType type;
360
 
            TQualifier qualifier;
361
 
            TFunction* function;
362
 
            TParameter param;
363
 
            TTypeLine typeLine;
364
 
            TTypeList* typeList;
365
 
        };
366
 
    } interm;
367
 
} YYSTYPE;
368
 
/* Line 191 of yacc.c.  */
369
 
#line 369 "glslang.tab.c"
370
 
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
371
 
# define YYSTYPE_IS_DECLARED 1
372
 
# define YYSTYPE_IS_TRIVIAL 1
373
 
#endif
374
 
 
375
 
 
376
 
 
377
 
/* Copy the second part of user declarations.  */
378
 
#line 148 "glslang.y"
379
 
 
380
 
#ifndef _WIN32
381
 
    extern int yylex(YYSTYPE*, void*);
382
 
#endif
383
 
 
384
 
 
385
 
/* Line 214 of yacc.c.  */
386
 
#line 386 "glslang.tab.c"
387
 
 
388
 
#if ! defined (yyoverflow) || YYERROR_VERBOSE
389
 
 
390
 
/* The parser invokes alloca or malloc; define the necessary symbols.  */
391
 
 
392
 
# if YYSTACK_USE_ALLOCA
393
 
#  define YYSTACK_ALLOC alloca
394
 
# else
395
 
#  ifndef YYSTACK_USE_ALLOCA
396
 
#   if defined (alloca) || defined (_ALLOCA_H)
397
 
#    define YYSTACK_ALLOC alloca
398
 
#   else
399
 
#    ifdef __GNUC__
400
 
#     define YYSTACK_ALLOC __builtin_alloca
401
 
#    endif
402
 
#   endif
403
 
#  endif
404
 
# endif
405
 
 
406
 
# ifdef YYSTACK_ALLOC
407
 
   /* Pacify GCC's `empty if-body' warning. */
408
 
#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
409
 
# else
410
 
#  if defined (__STDC__) || defined (__cplusplus)
411
 
#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
412
 
#   define YYSIZE_T size_t
413
 
#  endif
414
 
#  define YYSTACK_ALLOC malloc
415
 
#  define YYSTACK_FREE free
416
 
# endif
417
 
#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
418
 
 
419
 
 
420
 
#if (! defined (yyoverflow) \
421
 
     && (! defined (__cplusplus) \
422
 
         || (YYSTYPE_IS_TRIVIAL)))
423
 
 
424
 
/* A type that is properly aligned for any stack member.  */
425
 
union yyalloc
426
 
{
427
 
  short yyss;
428
 
  YYSTYPE yyvs;
429
 
  };
430
 
 
431
 
/* The size of the maximum gap between one aligned stack and the next.  */
432
 
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
433
 
 
434
 
/* The size of an array large to enough to hold all stacks, each with
435
 
   N elements.  */
436
 
# define YYSTACK_BYTES(N) \
437
 
     ((N) * (sizeof (short) + sizeof (YYSTYPE))                         \
438
 
      + YYSTACK_GAP_MAXIMUM)
439
 
 
440
 
/* Copy COUNT objects from FROM to TO.  The source and destination do
441
 
   not overlap.  */
442
 
# ifndef YYCOPY
443
 
#  if 1 < __GNUC__
444
 
#   define YYCOPY(To, From, Count) \
445
 
      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
446
 
#  else
447
 
#   define YYCOPY(To, From, Count)              \
448
 
      do                                        \
449
 
        {                                       \
450
 
          register YYSIZE_T yyi;                \
451
 
          for (yyi = 0; yyi < (Count); yyi++)   \
452
 
            (To)[yyi] = (From)[yyi];            \
453
 
        }                                       \
454
 
      while (0)
455
 
#  endif
456
 
# endif
457
 
 
458
 
/* Relocate STACK from its old location to the new one.  The
459
 
   local variables YYSIZE and YYSTACKSIZE give the old and new number of
460
 
   elements in the stack, and YYPTR gives the new location of the
461
 
   stack.  Advance YYPTR to a properly aligned location for the next
462
 
   stack.  */
463
 
# define YYSTACK_RELOCATE(Stack)                                        \
464
 
    do                                                                  \
465
 
      {                                                                 \
466
 
        YYSIZE_T yynewbytes;                                            \
467
 
        YYCOPY (&yyptr->Stack, Stack, yysize);                          \
468
 
        Stack = &yyptr->Stack;                                          \
469
 
        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
470
 
        yyptr += yynewbytes / sizeof (*yyptr);                          \
471
 
      }                                                                 \
472
 
    while (0)
473
 
 
474
 
#endif
475
 
 
476
 
#if defined (__STDC__) || defined (__cplusplus)
477
 
   typedef signed char yysigned_char;
478
 
#else
479
 
   typedef short yysigned_char;
480
 
#endif
481
 
 
482
 
/* YYFINAL -- State number of the termination state. */
483
 
#define YYFINAL  59
484
 
/* YYLAST -- Last index in YYTABLE.  */
485
 
#define YYLAST   1231
486
 
 
487
 
/* YYNTOKENS -- Number of terminals. */
488
 
#define YYNTOKENS  93
489
 
/* YYNNTS -- Number of nonterminals. */
490
 
#define YYNNTS  75
491
 
/* YYNRULES -- Number of rules. */
492
 
#define YYNRULES  214
493
 
/* YYNRULES -- Number of states. */
494
 
#define YYNSTATES  331
495
 
 
496
 
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
497
 
#define YYUNDEFTOK  2
498
 
#define YYMAXUTOK   347
499
 
 
500
 
#define YYTRANSLATE(YYX)                                                \
501
 
  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
502
 
 
503
 
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
504
 
static const unsigned char yytranslate[] =
505
 
{
506
 
       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
507
 
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
508
 
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
509
 
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
510
 
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
511
 
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
512
 
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
513
 
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
514
 
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
515
 
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
516
 
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
517
 
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
518
 
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
519
 
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
520
 
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
521
 
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
522
 
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
523
 
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
524
 
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
525
 
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
526
 
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
527
 
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
528
 
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
529
 
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
530
 
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
531
 
       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
532
 
       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
533
 
      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
534
 
      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
535
 
      35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
536
 
      45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
537
 
      55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
538
 
      65,    66,    67,    68,    69,    70,    71,    72,    73,    74,
539
 
      75,    76,    77,    78,    79,    80,    81,    82,    83,    84,
540
 
      85,    86,    87,    88,    89,    90,    91,    92
541
 
};
542
 
 
543
 
#if YYDEBUG
544
 
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
545
 
   YYRHS.  */
546
 
static const unsigned short yyprhs[] =
547
 
{
548
 
       0,     0,     3,     5,     7,     9,    11,    13,    17,    19,
549
 
      24,    26,    30,    33,    36,    38,    40,    43,    46,    49,
550
 
      51,    54,    58,    61,    63,    65,    67,    69,    71,    73,
551
 
      75,    77,    79,    81,    83,    85,    87,    89,    91,    93,
552
 
      95,    97,    99,   102,   105,   108,   110,   112,   114,   116,
553
 
     118,   122,   126,   130,   132,   136,   140,   142,   146,   150,
554
 
     152,   156,   160,   164,   168,   170,   174,   178,   180,   184,
555
 
     186,   190,   192,   196,   198,   202,   204,   208,   210,   214,
556
 
     216,   222,   224,   228,   230,   232,   234,   236,   238,   240,
557
 
     242,   244,   246,   248,   250,   252,   256,   258,   261,   264,
558
 
     267,   269,   271,   274,   278,   282,   285,   291,   295,   298,
559
 
     302,   305,   306,   308,   310,   312,   314,   319,   321,   325,
560
 
     331,   338,   344,   346,   349,   354,   360,   365,   367,   370,
561
 
     372,   374,   376,   378,   380,   382,   384,   386,   388,   390,
562
 
     392,   394,   396,   398,   400,   402,   404,   406,   408,   410,
563
 
     412,   414,   416,   418,   420,   422,   424,   426,   432,   437,
564
 
     439,   442,   446,   448,   452,   454,   459,   461,   463,   465,
565
 
     467,   469,   471,   473,   475,   477,   480,   481,   482,   488,
566
 
     490,   492,   495,   499,   501,   504,   506,   509,   515,   519,
567
 
     521,   523,   528,   529,   536,   537,   546,   547,   555,   557,
568
 
     559,   561,   562,   565,   569,   572,   575,   578,   582,   585,
569
 
     587,   590,   592,   594,   595
570
 
};
571
 
 
572
 
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
573
 
static const short yyrhs[] =
574
 
{
575
 
     164,     0,    -1,    42,    -1,    94,    -1,    45,    -1,    44,
576
 
      -1,    46,    -1,    69,   121,    70,    -1,    95,    -1,    96,
577
 
      71,    97,    72,    -1,    98,    -1,    96,    75,    47,    -1,
578
 
      96,    50,    -1,    96,    51,    -1,   121,    -1,    99,    -1,
579
 
     101,    70,    -1,   100,    70,    -1,   102,    34,    -1,   102,
580
 
      -1,   102,   119,    -1,   101,    76,   119,    -1,   103,    69,
581
 
      -1,   104,    -1,    42,    -1,     6,    -1,     7,    -1,     5,
582
 
      -1,    22,    -1,    23,    -1,    24,    -1,    16,    -1,    17,
583
 
      -1,    18,    -1,    19,    -1,    20,    -1,    21,    -1,    25,
584
 
      -1,    26,    -1,    27,    -1,    43,    -1,    96,    -1,    50,
585
 
     105,    -1,    51,   105,    -1,   106,   105,    -1,    83,    -1,
586
 
      81,    -1,    80,    -1,    82,    -1,   105,    -1,   107,    84,
587
 
     105,    -1,   107,    85,   105,    -1,   107,    86,   105,    -1,
588
 
     107,    -1,   108,    83,   107,    -1,   108,    81,   107,    -1,
589
 
     108,    -1,   109,    48,   108,    -1,   109,    49,   108,    -1,
590
 
     109,    -1,   110,    87,   109,    -1,   110,    88,   109,    -1,
591
 
     110,    52,   109,    -1,   110,    53,   109,    -1,   110,    -1,
592
 
     111,    54,   110,    -1,   111,    55,   110,    -1,   111,    -1,
593
 
     112,    91,   111,    -1,   112,    -1,   113,    90,   112,    -1,
594
 
     113,    -1,   114,    89,   113,    -1,   114,    -1,   115,    56,
595
 
     114,    -1,   115,    -1,   116,    58,   115,    -1,   116,    -1,
596
 
     117,    57,   116,    -1,   117,    -1,   117,    92,   121,    77,
597
 
     119,    -1,   118,    -1,   105,   120,   119,    -1,    78,    -1,
598
 
      59,    -1,    60,    -1,    62,    -1,    61,    -1,    68,    -1,
599
 
      63,    -1,    64,    -1,    65,    -1,    66,    -1,    67,    -1,
600
 
     119,    -1,   121,    76,   119,    -1,   118,    -1,   124,    79,
601
 
      -1,   132,    79,    -1,   125,    70,    -1,   127,    -1,   126,
602
 
      -1,   127,   129,    -1,   126,    76,   129,    -1,   134,    42,
603
 
      69,    -1,   136,    42,    -1,   136,    42,    71,   122,    72,
604
 
      -1,   135,   130,   128,    -1,   130,   128,    -1,   135,   130,
605
 
     131,    -1,   130,   131,    -1,    -1,    28,    -1,    29,    -1,
606
 
      30,    -1,   136,    -1,   136,    71,   122,    72,    -1,   133,
607
 
      -1,   132,    76,    42,    -1,   132,    76,    42,    71,    72,
608
 
      -1,   132,    76,    42,    71,   122,    72,    -1,   132,    76,
609
 
      42,    78,   142,    -1,   134,    -1,   134,    42,    -1,   134,
610
 
      42,    71,    72,    -1,   134,    42,    71,   122,    72,    -1,
611
 
     134,    42,    78,   142,    -1,   136,    -1,   135,   136,    -1,
612
 
       4,    -1,     3,    -1,    32,    -1,    31,    -1,    34,    -1,
613
 
       6,    -1,     7,    -1,     5,    -1,    22,    -1,    23,    -1,
614
 
      24,    -1,    16,    -1,    17,    -1,    18,    -1,    19,    -1,
615
 
      20,    -1,    21,    -1,    25,    -1,    26,    -1,    27,    -1,
616
 
      36,    -1,    37,    -1,    38,    -1,    39,    -1,    40,    -1,
617
 
      41,    -1,   137,    -1,    43,    -1,    33,    42,    73,   138,
618
 
      74,    -1,    33,    73,   138,    74,    -1,   139,    -1,   138,
619
 
     139,    -1,   136,   140,    79,    -1,   141,    -1,   140,    76,
620
 
     141,    -1,    42,    -1,    42,    71,   122,    72,    -1,   119,
621
 
      -1,   123,    -1,   146,    -1,   145,    -1,   143,    -1,   152,
622
 
      -1,   153,    -1,   156,    -1,   163,    -1,    73,    74,    -1,
623
 
      -1,    -1,    73,   147,   151,   148,    74,    -1,   150,    -1,
624
 
     145,    -1,    73,    74,    -1,    73,   151,    74,    -1,   144,
625
 
      -1,   151,   144,    -1,    79,    -1,   121,    79,    -1,    13,
626
 
      69,   121,    70,   154,    -1,   144,    11,   144,    -1,   144,
627
 
      -1,   121,    -1,   134,    42,    78,   142,    -1,    -1,    35,
628
 
      69,   157,   155,    70,   149,    -1,    -1,    10,   158,   144,
629
 
      35,    69,   121,    70,    79,    -1,    -1,    12,    69,   159,
630
 
     160,   162,    70,   149,    -1,   152,    -1,   143,    -1,   155,
631
 
      -1,    -1,   161,    79,    -1,   161,    79,   121,    -1,     9,
632
 
      79,    -1,     8,    79,    -1,    15,    79,    -1,    15,   121,
633
 
      79,    -1,    14,    79,    -1,   165,    -1,   164,   165,    -1,
634
 
     166,    -1,   123,    -1,    -1,   124,   167,   150,    -1
635
 
};
636
 
 
637
 
/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
638
 
static const unsigned short yyrline[] =
639
 
{
640
 
       0,   210,   210,   245,   248,   261,   266,   271,   277,   280,
641
 
     348,   351,   460,   470,   483,   491,   586,   590,   597,   601,
642
 
     608,   614,   623,   629,   640,   656,   657,   658,   659,   660,
643
 
     661,   662,   663,   664,   665,   666,   667,   668,   669,   670,
644
 
     671,   682,   685,   695,   705,   727,   728,   729,   730,   736,
645
 
     737,   746,   755,   767,   768,   776,   787,   788,   797,   809,
646
 
     810,   820,   830,   840,   853,   854,   864,   877,   878,   890,
647
 
     891,   903,   904,   916,   917,   930,   931,   944,   945,   958,
648
 
     959,   976,   977,   990,   991,   992,   993,   994,   995,   996,
649
 
     997,   998,   999,  1000,  1004,  1007,  1018,  1026,  1027,  1035,
650
 
    1071,  1074,  1081,  1089,  1110,  1129,  1140,  1167,  1172,  1182,
651
 
    1187,  1197,  1200,  1203,  1206,  1212,  1217,  1235,  1238,  1246,
652
 
    1254,  1262,  1284,  1288,  1297,  1306,  1315,  1405,  1408,  1425,
653
 
    1429,  1436,  1444,  1453,  1458,  1463,  1468,  1479,  1484,  1489,
654
 
    1494,  1499,  1504,  1509,  1514,  1519,  1524,  1530,  1536,  1542,
655
 
    1548,  1554,  1560,  1566,  1572,  1578,  1583,  1596,  1606,  1614,
656
 
    1617,  1632,  1650,  1654,  1660,  1665,  1681,  1685,  1689,  1690,
657
 
    1696,  1697,  1698,  1699,  1700,  1704,  1705,  1705,  1705,  1713,
658
 
    1714,  1719,  1722,  1730,  1733,  1739,  1740,  1744,  1752,  1756,
659
 
    1766,  1771,  1788,  1788,  1793,  1793,  1800,  1800,  1813,  1816,
660
 
    1822,  1825,  1831,  1835,  1842,  1849,  1856,  1863,  1874,  1883,
661
 
    1887,  1894,  1897,  1903,  1903
662
 
};
663
 
#endif
664
 
 
665
 
#if YYDEBUG || YYERROR_VERBOSE
666
 
/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
667
 
   First, the terminals, then, starting at YYNTOKENS, nonterminals. */
668
 
static const char *const yytname[] =
669
 
{
670
 
  "$end", "error", "$undefined", "ATTRIBUTE", "CONST_QUAL", "BOOL_TYPE", 
671
 
  "FLOAT_TYPE", "INT_TYPE", "BREAK", "CONTINUE", "DO", "ELSE", "FOR", 
672
 
  "IF", "DISCARD", "RETURN", "BVEC2", "BVEC3", "BVEC4", "IVEC2", "IVEC3", 
673
 
  "IVEC4", "VEC2", "VEC3", "VEC4", "MATRIX2", "MATRIX3", "MATRIX4", 
674
 
  "IN_QUAL", "OUT_QUAL", "INOUT_QUAL", "UNIFORM", "VARYING", "STRUCT", 
675
 
  "VOID_TYPE", "WHILE", "SAMPLER1D", "SAMPLER2D", "SAMPLER3D", 
676
 
  "SAMPLERCUBE", "SAMPLER1DSHADOW", "SAMPLER2DSHADOW", "IDENTIFIER", 
677
 
  "TYPE_NAME", "FLOATCONSTANT", "INTCONSTANT", "BOOLCONSTANT", 
678
 
  "FIELD_SELECTION", "LEFT_OP", "RIGHT_OP", "INC_OP", "DEC_OP", "LE_OP", 
679
 
  "GE_OP", "EQ_OP", "NE_OP", "AND_OP", "OR_OP", "XOR_OP", "MUL_ASSIGN", 
680
 
  "DIV_ASSIGN", "ADD_ASSIGN", "MOD_ASSIGN", "LEFT_ASSIGN", "RIGHT_ASSIGN", 
681
 
  "AND_ASSIGN", "XOR_ASSIGN", "OR_ASSIGN", "SUB_ASSIGN", "LEFT_PAREN", 
682
 
  "RIGHT_PAREN", "LEFT_BRACKET", "RIGHT_BRACKET", "LEFT_BRACE", 
683
 
  "RIGHT_BRACE", "DOT", "COMMA", "COLON", "EQUAL", "SEMICOLON", "BANG", 
684
 
  "DASH", "TILDE", "PLUS", "STAR", "SLASH", "PERCENT", "LEFT_ANGLE", 
685
 
  "RIGHT_ANGLE", "VERTICAL_BAR", "CARET", "AMPERSAND", "QUESTION", 
686
 
  "$accept", "variable_identifier", "primary_expression", 
687
 
  "postfix_expression", "integer_expression", "function_call", 
688
 
  "function_call_generic", "function_call_header_no_parameters", 
689
 
  "function_call_header_with_parameters", "function_call_header", 
690
 
  "function_identifier", "constructor_identifier", "unary_expression", 
691
 
  "unary_operator", "multiplicative_expression", "additive_expression", 
692
 
  "shift_expression", "relational_expression", "equality_expression", 
693
 
  "and_expression", "exclusive_or_expression", "inclusive_or_expression", 
694
 
  "logical_and_expression", "logical_xor_expression", 
695
 
  "logical_or_expression", "conditional_expression", 
696
 
  "assignment_expression", "assignment_operator", "expression", 
697
 
  "constant_expression", "declaration", "function_prototype", 
698
 
  "function_declarator", "function_header_with_parameters", 
699
 
  "function_header", "parameter_declarator", "parameter_declaration", 
700
 
  "parameter_qualifier", "parameter_type_specifier", 
701
 
  "init_declarator_list", "single_declaration", "fully_specified_type", 
702
 
  "type_qualifier", "type_specifier", "struct_specifier", 
703
 
  "struct_declaration_list", "struct_declaration", 
704
 
  "struct_declarator_list", "struct_declarator", "initializer", 
705
 
  "declaration_statement", "statement", "simple_statement", 
706
 
  "compound_statement", "@1", "@2", "statement_no_new_scope", 
707
 
  "compound_statement_no_new_scope", "statement_list", 
708
 
  "expression_statement", "selection_statement", 
709
 
  "selection_rest_statement", "condition", "iteration_statement", "@3", 
710
 
  "@4", "@5", "for_init_statement", "conditionopt", "for_rest_statement", 
711
 
  "jump_statement", "translation_unit", "external_declaration", 
712
 
  "function_definition", "@6", 0
713
 
};
714
 
#endif
715
 
 
716
 
# ifdef YYPRINT
717
 
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
718
 
   token YYLEX-NUM.  */
719
 
static const unsigned short yytoknum[] =
720
 
{
721
 
       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
722
 
     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
723
 
     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
724
 
     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
725
 
     295,   296,   297,   298,   299,   300,   301,   302,   303,   304,
726
 
     305,   306,   307,   308,   309,   310,   311,   312,   313,   314,
727
 
     315,   316,   317,   318,   319,   320,   321,   322,   323,   324,
728
 
     325,   326,   327,   328,   329,   330,   331,   332,   333,   334,
729
 
     335,   336,   337,   338,   339,   340,   341,   342,   343,   344,
730
 
     345,   346,   347
731
 
};
732
 
# endif
733
 
 
734
 
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
735
 
static const unsigned char yyr1[] =
736
 
{
737
 
       0,    93,    94,    95,    95,    95,    95,    95,    96,    96,
738
 
      96,    96,    96,    96,    97,    98,    99,    99,   100,   100,
739
 
     101,   101,   102,   103,   103,   104,   104,   104,   104,   104,
740
 
     104,   104,   104,   104,   104,   104,   104,   104,   104,   104,
741
 
     104,   105,   105,   105,   105,   106,   106,   106,   106,   107,
742
 
     107,   107,   107,   108,   108,   108,   109,   109,   109,   110,
743
 
     110,   110,   110,   110,   111,   111,   111,   112,   112,   113,
744
 
     113,   114,   114,   115,   115,   116,   116,   117,   117,   118,
745
 
     118,   119,   119,   120,   120,   120,   120,   120,   120,   120,
746
 
     120,   120,   120,   120,   121,   121,   122,   123,   123,   124,
747
 
     125,   125,   126,   126,   127,   128,   128,   129,   129,   129,
748
 
     129,   130,   130,   130,   130,   131,   131,   132,   132,   132,
749
 
     132,   132,   133,   133,   133,   133,   133,   134,   134,   135,
750
 
     135,   135,   135,   136,   136,   136,   136,   136,   136,   136,
751
 
     136,   136,   136,   136,   136,   136,   136,   136,   136,   136,
752
 
     136,   136,   136,   136,   136,   136,   136,   137,   137,   138,
753
 
     138,   139,   140,   140,   141,   141,   142,   143,   144,   144,
754
 
     145,   145,   145,   145,   145,   146,   147,   148,   146,   149,
755
 
     149,   150,   150,   151,   151,   152,   152,   153,   154,   154,
756
 
     155,   155,   157,   156,   158,   156,   159,   156,   160,   160,
757
 
     161,   161,   162,   162,   163,   163,   163,   163,   163,   164,
758
 
     164,   165,   165,   167,   166
759
 
};
760
 
 
761
 
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
762
 
static const unsigned char yyr2[] =
763
 
{
764
 
       0,     2,     1,     1,     1,     1,     1,     3,     1,     4,
765
 
       1,     3,     2,     2,     1,     1,     2,     2,     2,     1,
766
 
       2,     3,     2,     1,     1,     1,     1,     1,     1,     1,
767
 
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
768
 
       1,     1,     2,     2,     2,     1,     1,     1,     1,     1,
769
 
       3,     3,     3,     1,     3,     3,     1,     3,     3,     1,
770
 
       3,     3,     3,     3,     1,     3,     3,     1,     3,     1,
771
 
       3,     1,     3,     1,     3,     1,     3,     1,     3,     1,
772
 
       5,     1,     3,     1,     1,     1,     1,     1,     1,     1,
773
 
       1,     1,     1,     1,     1,     3,     1,     2,     2,     2,
774
 
       1,     1,     2,     3,     3,     2,     5,     3,     2,     3,
775
 
       2,     0,     1,     1,     1,     1,     4,     1,     3,     5,
776
 
       6,     5,     1,     2,     4,     5,     4,     1,     2,     1,
777
 
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
778
 
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
779
 
       1,     1,     1,     1,     1,     1,     1,     5,     4,     1,
780
 
       2,     3,     1,     3,     1,     4,     1,     1,     1,     1,
781
 
       1,     1,     1,     1,     1,     2,     0,     0,     5,     1,
782
 
       1,     2,     3,     1,     2,     1,     2,     5,     3,     1,
783
 
       1,     4,     0,     6,     0,     8,     0,     7,     1,     1,
784
 
       1,     0,     2,     3,     2,     2,     2,     3,     2,     1,
785
 
       2,     1,     1,     0,     3
786
 
};
787
 
 
788
 
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
789
 
   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
790
 
   means the default is an error.  */
791
 
static const unsigned char yydefact[] =
792
 
{
793
 
       0,   130,   129,   136,   134,   135,   140,   141,   142,   143,
794
 
     144,   145,   137,   138,   139,   146,   147,   148,   132,   131,
795
 
       0,   133,   149,   150,   151,   152,   153,   154,   156,   212,
796
 
     213,     0,   101,   111,     0,   117,   122,     0,   127,   155,
797
 
       0,   209,   211,     0,     0,    97,     0,    99,   111,   112,
798
 
     113,   114,   102,     0,   111,     0,    98,   123,   128,     1,
799
 
     210,     0,     0,     0,   159,     0,   214,   103,   108,   110,
800
 
     115,     0,   118,   104,     0,     0,     0,   164,     0,   162,
801
 
     158,   160,   136,   134,   135,     0,     0,   194,     0,     0,
802
 
       0,     0,   140,   141,   142,   143,   144,   145,   137,   138,
803
 
     139,   146,   147,   148,     0,     2,   156,     5,     4,     6,
804
 
       0,     0,     0,   176,   181,   185,    47,    46,    48,    45,
805
 
       3,     8,    41,    10,    15,     0,     0,    19,     0,    23,
806
 
      49,     0,    53,    56,    59,    64,    67,    69,    71,    73,
807
 
      75,    77,    79,    81,    94,     0,   167,     0,   170,   183,
808
 
     169,   168,     0,   171,   172,   173,   174,   105,     0,   107,
809
 
     109,     0,     0,    27,    25,    26,    31,    32,    33,    34,
810
 
      35,    36,    28,    29,    30,    37,    38,    39,    40,   124,
811
 
      49,    96,     0,   166,   126,   157,     0,     0,   161,   205,
812
 
     204,     0,   196,     0,   208,   206,     0,   192,    42,    43,
813
 
       0,   175,     0,    12,    13,     0,     0,    17,    16,     0,
814
 
      18,    20,    22,    84,    85,    87,    86,    89,    90,    91,
815
 
      92,    93,    88,    83,     0,    44,     0,     0,     0,     0,
816
 
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
817
 
       0,     0,     0,     0,     0,     0,     0,   186,   182,   184,
818
 
       0,     0,   119,     0,   121,   125,     0,   163,     0,     0,
819
 
       0,   207,     0,     7,   177,     0,    14,    11,    21,    82,
820
 
      50,    51,    52,    55,    54,    57,    58,    62,    63,    60,
821
 
      61,    65,    66,    68,    70,    72,    74,    76,    78,     0,
822
 
      95,     0,   116,   120,   165,     0,   199,   198,   201,     0,
823
 
     190,     0,     0,     0,     9,     0,   106,     0,   200,     0,
824
 
       0,   189,   187,     0,     0,   178,    80,     0,   202,     0,
825
 
       0,     0,   180,   193,   179,     0,   203,   197,   188,   191,
826
 
     195
827
 
};
828
 
 
829
 
/* YYDEFGOTO[NTERM-NUM]. */
830
 
static const short yydefgoto[] =
831
 
{
832
 
      -1,   120,   121,   122,   265,   123,   124,   125,   126,   127,
833
 
     128,   129,   130,   131,   132,   133,   134,   135,   136,   137,
834
 
     138,   139,   140,   141,   142,   143,   144,   224,   145,   182,
835
 
     146,   147,    31,    32,    33,    68,    52,    53,    69,    34,
836
 
      35,    36,    37,    38,    39,    63,    64,    78,    79,   184,
837
 
     148,   149,   150,   151,   202,   303,   323,   324,   152,   153,
838
 
     154,   312,   302,   155,   262,   191,   259,   298,   309,   310,
839
 
     156,    40,    41,    42,    46
840
 
};
841
 
 
842
 
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
843
 
   STATE-NUM.  */
844
 
#define YYPACT_NINF -297
845
 
static const short yypact[] =
846
 
{
847
 
    1149,  -297,  -297,  -297,  -297,  -297,  -297,  -297,  -297,  -297,
848
 
    -297,  -297,  -297,  -297,  -297,  -297,  -297,  -297,  -297,  -297,
849
 
     -27,  -297,  -297,  -297,  -297,  -297,  -297,  -297,  -297,  -297,
850
 
     -42,   -28,   -32,     4,    18,  -297,    19,  1188,  -297,  -297,
851
 
    1108,  -297,  -297,   -10,  1188,  -297,    -3,  -297,    36,  -297,
852
 
    -297,  -297,  -297,  1188,    83,    33,  -297,    -9,  -297,  -297,
853
 
    -297,  1188,    39,  1025,  -297,   235,  -297,  -297,  -297,  -297,
854
 
     -18,  1188,   -52,  -297,   685,   957,  1064,   -17,    20,  -297,
855
 
    -297,  -297,    29,    45,    63,    21,    23,  -297,    75,    77,
856
 
      66,   753,    78,    79,    81,    82,    84,    85,    87,    89,
857
 
      90,    91,    93,    94,    95,    96,    97,  -297,  -297,  -297,
858
 
     957,   957,   957,   120,  -297,  -297,  -297,  -297,  -297,  -297,
859
 
    -297,  -297,     5,  -297,  -297,    98,     1,   821,   100,  -297,
860
 
      57,   957,    42,   -56,    37,   -40,    76,    61,    80,   106,
861
 
     111,   138,   -41,  -297,  -297,    30,  -297,   -42,  -297,  -297,
862
 
    -297,  -297,   316,  -297,  -297,  -297,  -297,   127,   957,  -297,
863
 
    -297,   889,   957,  -297,  -297,  -297,  -297,  -297,  -297,  -297,
864
 
    -297,  -297,  -297,  -297,  -297,  -297,  -297,  -297,  -297,  -297,
865
 
    -297,  -297,   128,  -297,  -297,  -297,   957,    39,  -297,  -297,
866
 
    -297,   397,  -297,   957,  -297,  -297,    31,  -297,  -297,  -297,
867
 
       3,  -297,   397,  -297,  -297,   957,   152,  -297,  -297,   957,
868
 
    -297,  -297,  -297,  -297,  -297,  -297,  -297,  -297,  -297,  -297,
869
 
    -297,  -297,  -297,  -297,   957,  -297,   957,   957,   957,   957,
870
 
     957,   957,   957,   957,   957,   957,   957,   957,   957,   957,
871
 
     957,   957,   957,   957,   957,   957,   957,  -297,  -297,  -297,
872
 
     957,   129,  -297,   130,  -297,  -297,   131,  -297,   169,   549,
873
 
      12,  -297,   617,  -297,   397,   133,   134,  -297,  -297,  -297,
874
 
    -297,  -297,  -297,    42,    42,   -56,   -56,    37,    37,    37,
875
 
      37,   -40,   -40,    76,    61,    80,   106,   111,   138,    60,
876
 
    -297,   135,  -297,  -297,  -297,   137,  -297,  -297,   617,   397,
877
 
     134,   167,   141,   140,  -297,   957,  -297,   957,  -297,   136,
878
 
     142,   205,  -297,   143,   478,  -297,  -297,    13,   957,   478,
879
 
     397,   957,  -297,  -297,  -297,   139,   134,  -297,  -297,  -297,
880
 
    -297
881
 
};
882
 
 
883
 
/* YYPGOTO[NTERM-NUM].  */
884
 
static const short yypgoto[] =
885
 
{
886
 
    -297,  -297,  -297,  -297,  -297,  -297,  -297,  -297,  -297,  -297,
887
 
    -297,  -297,   -53,  -297,   -91,   -89,  -143,   -97,   -20,   -16,
888
 
     -21,   -15,   -14,   -22,  -297,   -57,   -75,  -297,   -90,  -155,
889
 
       9,    10,  -297,  -297,  -297,   154,   175,   172,   160,  -297,
890
 
    -297,  -257,   -19,   -33,  -297,   171,    -4,  -297,    46,  -160,
891
 
     -25,  -107,  -296,  -297,  -297,  -297,   -84,   190,    35,     6,
892
 
    -297,  -297,   -35,  -297,  -297,  -297,  -297,  -297,  -297,  -297,
893
 
    -297,  -297,   224,  -297,  -297
894
 
};
895
 
 
896
 
/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
897
 
   positive, shift that token.  If negative, reduce the rule which
898
 
   number is the opposite.  If zero, do what YYDEFACT says.
899
 
   If YYTABLE_NINF, syntax error.  */
900
 
#define YYTABLE_NINF -101
901
 
static const short yytable[] =
902
 
{
903
 
     183,   196,   254,   251,    58,   301,   253,     1,     2,    29,
904
 
      30,    62,   233,   234,    54,    43,   244,   181,   322,   161,
905
 
      70,   180,   200,   322,   157,   229,   162,   230,    62,    54,
906
 
      62,   256,    49,    50,    51,    18,    19,    45,    70,     1,
907
 
       2,   301,    47,    62,    48,   249,    44,   235,   236,    29,
908
 
      30,   245,   211,   158,   186,   203,   204,   198,   199,    81,
909
 
      73,    57,    74,    61,    49,    50,    51,    18,    19,    75,
910
 
      65,   208,    81,   263,  -100,    72,   205,   209,   225,   246,
911
 
     206,    77,   299,   325,   258,   231,   232,   183,   246,   246,
912
 
     277,   278,   279,   280,    55,   291,   187,    56,   -27,   188,
913
 
     189,   181,   190,   260,   181,   180,   246,   246,   180,   247,
914
 
     261,    49,    50,    51,   -25,   266,   213,   214,   215,   216,
915
 
     217,   218,   219,   220,   221,   222,   226,   227,   228,   181,
916
 
     237,   238,   -26,   180,   268,   223,   246,   305,   273,   274,
917
 
     281,   282,   275,   276,   192,   194,   193,   -31,   -32,   269,
918
 
     -33,   -34,   239,   -35,   -36,   289,   -28,   249,   -29,   -30,
919
 
     -37,   329,   -38,   -39,   197,   -24,   -40,   242,   207,   212,
920
 
     240,   290,   300,   270,   271,   272,   180,   180,   180,   180,
921
 
     180,   180,   180,   180,   180,   180,   180,   180,   180,   180,
922
 
     180,   180,   311,   181,   201,   241,   243,   180,   250,   267,
923
 
     255,   292,   293,   294,   295,   304,   307,   306,   300,   313,
924
 
     246,   314,   319,   328,   315,   318,   320,   317,   330,   283,
925
 
     285,   321,   288,    67,   284,   159,    71,   286,   326,   287,
926
 
     316,   160,    76,   257,   296,   327,    66,   264,     1,     2,
927
 
      82,    83,    84,    85,    86,    87,   183,    88,    89,    90,
928
 
      91,    92,    93,    94,    95,    96,    97,    98,    99,   100,
929
 
     101,   102,   103,   308,    60,   297,    18,    19,    20,    21,
930
 
     104,    22,    23,    24,    25,    26,    27,   105,   106,   107,
931
 
     108,   109,     0,     0,     0,   110,   111,     0,     0,     0,
932
 
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
933
 
       0,     0,     0,     0,   112,     0,     0,     0,   113,   114,
934
 
       0,     0,     0,     0,   115,   116,   117,   118,   119,     1,
935
 
       2,    82,    83,    84,    85,    86,    87,     0,    88,    89,
936
 
      90,    91,    92,    93,    94,    95,    96,    97,    98,    99,
937
 
     100,   101,   102,   103,     0,     0,     0,    18,    19,    20,
938
 
      21,   104,    22,    23,    24,    25,    26,    27,   105,   106,
939
 
     107,   108,   109,     0,     0,     0,   110,   111,     0,     0,
940
 
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
941
 
       0,     0,     0,     0,     0,   112,     0,     0,     0,   113,
942
 
     248,     0,     0,     0,     0,   115,   116,   117,   118,   119,
943
 
       1,     2,    82,    83,    84,    85,    86,    87,     0,    88,
944
 
      89,    90,    91,    92,    93,    94,    95,    96,    97,    98,
945
 
      99,   100,   101,   102,   103,     0,     0,     0,    18,    19,
946
 
      20,    21,   104,    22,    23,    24,    25,    26,    27,   105,
947
 
     106,   107,   108,   109,     0,     0,     0,   110,   111,     0,
948
 
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
949
 
       0,     0,     0,     0,     0,     0,   112,     0,     0,     0,
950
 
     113,     0,     0,     0,     0,     0,   115,   116,   117,   118,
951
 
     119,     1,     2,    82,    83,    84,    85,    86,    87,     0,
952
 
      88,    89,    90,    91,    92,    93,    94,    95,    96,    97,
953
 
      98,    99,   100,   101,   102,   103,     0,     0,     0,    18,
954
 
      19,    20,    21,   104,    22,    23,    24,    25,    26,    27,
955
 
     105,   106,   107,   108,   109,     0,     0,     0,   110,   111,
956
 
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
957
 
       0,     0,     0,     0,     0,     0,     0,   112,     0,     0,
958
 
       0,    65,     1,     2,    82,    83,    84,   115,   116,   117,
959
 
     118,   119,     0,     0,     0,    92,    93,    94,    95,    96,
960
 
      97,    98,    99,   100,   101,   102,   103,     0,     0,     0,
961
 
      18,    19,    20,    21,     0,    22,    23,    24,    25,    26,
962
 
      27,   105,   106,   107,   108,   109,     0,     0,     0,   110,
963
 
     111,     0,     0,     0,     0,     0,     0,     0,     0,     0,
964
 
       0,     0,     0,     0,     0,     0,     0,     0,   112,     0,
965
 
       1,     2,    82,    83,    84,     0,     0,     0,   115,   116,
966
 
     117,   118,   119,    92,    93,    94,    95,    96,    97,    98,
967
 
      99,   100,   101,   102,   103,     0,     0,     0,    18,    19,
968
 
      20,    21,     0,    22,    23,    24,    25,    26,    27,   105,
969
 
     106,   107,   108,   109,     0,     0,     0,   110,   111,     0,
970
 
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
971
 
       0,     0,     0,     0,     0,     0,   112,     0,     0,     0,
972
 
     163,   164,   165,     0,     0,     0,     0,   116,   117,   118,
973
 
     119,   166,   167,   168,   169,   170,   171,   172,   173,   174,
974
 
     175,   176,   177,     0,     0,     0,     0,     0,     0,     0,
975
 
       0,     0,     0,     0,     0,     0,     0,   105,   178,   107,
976
 
     108,   109,     0,     0,     0,   110,   111,     0,     0,     0,
977
 
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
978
 
       0,     0,     0,     0,   112,     0,     0,   179,   163,   164,
979
 
     165,     0,     0,     0,     0,   116,   117,   118,   119,   166,
980
 
     167,   168,   169,   170,   171,   172,   173,   174,   175,   176,
981
 
     177,     0,     0,     0,     0,     0,     0,     0,     0,     0,
982
 
       0,     0,     0,     0,     0,   105,   178,   107,   108,   109,
983
 
       0,     0,     0,   110,   111,     0,     0,     0,     0,     0,
984
 
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
985
 
       0,     0,   112,     0,     0,     0,   163,   164,   165,     0,
986
 
       0,     0,   195,   116,   117,   118,   119,   166,   167,   168,
987
 
     169,   170,   171,   172,   173,   174,   175,   176,   177,     0,
988
 
       0,     0,     0,     0,     0,   210,     0,     0,     0,     0,
989
 
       0,     0,     0,   105,   178,   107,   108,   109,     0,     0,
990
 
       0,   110,   111,     0,     0,     0,     0,     0,     0,     0,
991
 
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
992
 
     112,     0,     0,     0,   163,   164,   165,     0,     0,     0,
993
 
       0,   116,   117,   118,   119,   166,   167,   168,   169,   170,
994
 
     171,   172,   173,   174,   175,   176,   177,     0,     0,     0,
995
 
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
996
 
       0,   105,   178,   107,   108,   109,     0,     0,     0,   110,
997
 
     111,     0,     0,     0,     0,     0,     0,     0,     0,     0,
998
 
       0,     0,     0,     0,     0,     0,     0,     0,   112,     0,
999
 
       0,   252,   163,   164,   165,     0,     0,     0,     0,   116,
1000
 
     117,   118,   119,   166,   167,   168,   169,   170,   171,   172,
1001
 
     173,   174,   175,   176,   177,     0,     0,     0,     0,     0,
1002
 
       0,     0,     0,     0,     0,     0,     0,     0,     0,   105,
1003
 
     178,   107,   108,   109,     0,     0,     0,   110,   111,     0,
1004
 
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1005
 
       0,     0,     0,     0,     0,     0,   112,     0,     0,     0,
1006
 
       3,     4,     5,     0,     0,     0,     0,   116,   117,   118,
1007
 
     119,     6,     7,     8,     9,    10,    11,    12,    13,    14,
1008
 
      15,    16,    17,     0,     0,     0,     0,     0,    20,    21,
1009
 
       0,    22,    23,    24,    25,    26,    27,     0,    28,     3,
1010
 
       4,     5,     0,     0,     0,     0,     0,     0,     0,     0,
1011
 
       6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
1012
 
      16,    17,     0,     0,     0,     0,     0,    20,    21,    80,
1013
 
      22,    23,    24,    25,    26,    27,     0,    28,    59,     0,
1014
 
       0,     1,     2,     3,     4,     5,     0,     0,     0,     0,
1015
 
       0,     0,     0,     0,     6,     7,     8,     9,    10,    11,
1016
 
      12,    13,    14,    15,    16,    17,     0,     0,   185,    18,
1017
 
      19,    20,    21,     0,    22,    23,    24,    25,    26,    27,
1018
 
       0,    28,     1,     2,     3,     4,     5,     0,     0,     0,
1019
 
       0,     0,     0,     0,     0,     6,     7,     8,     9,    10,
1020
 
      11,    12,    13,    14,    15,    16,    17,     0,     0,     0,
1021
 
      18,    19,    20,    21,     0,    22,    23,    24,    25,    26,
1022
 
      27,     0,    28,     3,     4,     5,     0,     0,     0,     0,
1023
 
       0,     0,     0,     0,     6,     7,     8,     9,    10,    11,
1024
 
      12,    13,    14,    15,    16,    17,     0,     0,     0,     0,
1025
 
       0,    20,    21,     0,    22,    23,    24,    25,    26,    27,
1026
 
       0,    28
1027
 
};
1028
 
 
1029
 
static const short yycheck[] =
1030
 
{
1031
 
      75,    91,   162,   158,    37,   262,   161,     3,     4,     0,
1032
 
       0,    44,    52,    53,    33,    42,    57,    74,   314,    71,
1033
 
      53,    74,   112,   319,    42,    81,    78,    83,    61,    48,
1034
 
      63,   186,    28,    29,    30,    31,    32,    79,    71,     3,
1035
 
       4,   298,    70,    76,    76,   152,    73,    87,    88,    40,
1036
 
      40,    92,   127,    71,    71,    50,    51,   110,   111,    63,
1037
 
      69,    42,    71,    73,    28,    29,    30,    31,    32,    78,
1038
 
      73,    70,    76,    70,    70,    42,    71,    76,   131,    76,
1039
 
      75,    42,    70,    70,   191,    48,    49,   162,    76,    76,
1040
 
     233,   234,   235,   236,    76,   250,    76,    79,    69,    79,
1041
 
      79,   158,    79,   193,   161,   158,    76,    76,   161,    79,
1042
 
      79,    28,    29,    30,    69,   205,    59,    60,    61,    62,
1043
 
      63,    64,    65,    66,    67,    68,    84,    85,    86,   186,
1044
 
      54,    55,    69,   186,   209,    78,    76,    77,   229,   230,
1045
 
     237,   238,   231,   232,    69,    79,    69,    69,    69,   224,
1046
 
      69,    69,    91,    69,    69,   245,    69,   264,    69,    69,
1047
 
      69,   321,    69,    69,    69,    69,    69,    56,    70,    69,
1048
 
      90,   246,   262,   226,   227,   228,   229,   230,   231,   232,
1049
 
     233,   234,   235,   236,   237,   238,   239,   240,   241,   242,
1050
 
     243,   244,   299,   250,    74,    89,    58,   250,    71,    47,
1051
 
      72,    72,    72,    72,    35,    72,    69,    72,   298,    42,
1052
 
      76,    70,    70,   320,    74,    79,    11,   307,    79,   239,
1053
 
     241,    78,   244,    48,   240,    71,    54,   242,   318,   243,
1054
 
     305,    71,    61,   187,   259,   319,    46,   202,     3,     4,
1055
 
       5,     6,     7,     8,     9,    10,   321,    12,    13,    14,
1056
 
      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
1057
 
      25,    26,    27,   298,    40,   259,    31,    32,    33,    34,
1058
 
      35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
1059
 
      45,    46,    -1,    -1,    -1,    50,    51,    -1,    -1,    -1,
1060
 
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1061
 
      -1,    -1,    -1,    -1,    69,    -1,    -1,    -1,    73,    74,
1062
 
      -1,    -1,    -1,    -1,    79,    80,    81,    82,    83,     3,
1063
 
       4,     5,     6,     7,     8,     9,    10,    -1,    12,    13,
1064
 
      14,    15,    16,    17,    18,    19,    20,    21,    22,    23,
1065
 
      24,    25,    26,    27,    -1,    -1,    -1,    31,    32,    33,
1066
 
      34,    35,    36,    37,    38,    39,    40,    41,    42,    43,
1067
 
      44,    45,    46,    -1,    -1,    -1,    50,    51,    -1,    -1,
1068
 
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1069
 
      -1,    -1,    -1,    -1,    -1,    69,    -1,    -1,    -1,    73,
1070
 
      74,    -1,    -1,    -1,    -1,    79,    80,    81,    82,    83,
1071
 
       3,     4,     5,     6,     7,     8,     9,    10,    -1,    12,
1072
 
      13,    14,    15,    16,    17,    18,    19,    20,    21,    22,
1073
 
      23,    24,    25,    26,    27,    -1,    -1,    -1,    31,    32,
1074
 
      33,    34,    35,    36,    37,    38,    39,    40,    41,    42,
1075
 
      43,    44,    45,    46,    -1,    -1,    -1,    50,    51,    -1,
1076
 
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1077
 
      -1,    -1,    -1,    -1,    -1,    -1,    69,    -1,    -1,    -1,
1078
 
      73,    -1,    -1,    -1,    -1,    -1,    79,    80,    81,    82,
1079
 
      83,     3,     4,     5,     6,     7,     8,     9,    10,    -1,
1080
 
      12,    13,    14,    15,    16,    17,    18,    19,    20,    21,
1081
 
      22,    23,    24,    25,    26,    27,    -1,    -1,    -1,    31,
1082
 
      32,    33,    34,    35,    36,    37,    38,    39,    40,    41,
1083
 
      42,    43,    44,    45,    46,    -1,    -1,    -1,    50,    51,
1084
 
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1085
 
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    69,    -1,    -1,
1086
 
      -1,    73,     3,     4,     5,     6,     7,    79,    80,    81,
1087
 
      82,    83,    -1,    -1,    -1,    16,    17,    18,    19,    20,
1088
 
      21,    22,    23,    24,    25,    26,    27,    -1,    -1,    -1,
1089
 
      31,    32,    33,    34,    -1,    36,    37,    38,    39,    40,
1090
 
      41,    42,    43,    44,    45,    46,    -1,    -1,    -1,    50,
1091
 
      51,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1092
 
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    69,    -1,
1093
 
       3,     4,     5,     6,     7,    -1,    -1,    -1,    79,    80,
1094
 
      81,    82,    83,    16,    17,    18,    19,    20,    21,    22,
1095
 
      23,    24,    25,    26,    27,    -1,    -1,    -1,    31,    32,
1096
 
      33,    34,    -1,    36,    37,    38,    39,    40,    41,    42,
1097
 
      43,    44,    45,    46,    -1,    -1,    -1,    50,    51,    -1,
1098
 
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1099
 
      -1,    -1,    -1,    -1,    -1,    -1,    69,    -1,    -1,    -1,
1100
 
       5,     6,     7,    -1,    -1,    -1,    -1,    80,    81,    82,
1101
 
      83,    16,    17,    18,    19,    20,    21,    22,    23,    24,
1102
 
      25,    26,    27,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1103
 
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    42,    43,    44,
1104
 
      45,    46,    -1,    -1,    -1,    50,    51,    -1,    -1,    -1,
1105
 
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1106
 
      -1,    -1,    -1,    -1,    69,    -1,    -1,    72,     5,     6,
1107
 
       7,    -1,    -1,    -1,    -1,    80,    81,    82,    83,    16,
1108
 
      17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
1109
 
      27,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1110
 
      -1,    -1,    -1,    -1,    -1,    42,    43,    44,    45,    46,
1111
 
      -1,    -1,    -1,    50,    51,    -1,    -1,    -1,    -1,    -1,
1112
 
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1113
 
      -1,    -1,    69,    -1,    -1,    -1,     5,     6,     7,    -1,
1114
 
      -1,    -1,    79,    80,    81,    82,    83,    16,    17,    18,
1115
 
      19,    20,    21,    22,    23,    24,    25,    26,    27,    -1,
1116
 
      -1,    -1,    -1,    -1,    -1,    34,    -1,    -1,    -1,    -1,
1117
 
      -1,    -1,    -1,    42,    43,    44,    45,    46,    -1,    -1,
1118
 
      -1,    50,    51,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1119
 
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1120
 
      69,    -1,    -1,    -1,     5,     6,     7,    -1,    -1,    -1,
1121
 
      -1,    80,    81,    82,    83,    16,    17,    18,    19,    20,
1122
 
      21,    22,    23,    24,    25,    26,    27,    -1,    -1,    -1,
1123
 
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1124
 
      -1,    42,    43,    44,    45,    46,    -1,    -1,    -1,    50,
1125
 
      51,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1126
 
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    69,    -1,
1127
 
      -1,    72,     5,     6,     7,    -1,    -1,    -1,    -1,    80,
1128
 
      81,    82,    83,    16,    17,    18,    19,    20,    21,    22,
1129
 
      23,    24,    25,    26,    27,    -1,    -1,    -1,    -1,    -1,
1130
 
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    42,
1131
 
      43,    44,    45,    46,    -1,    -1,    -1,    50,    51,    -1,
1132
 
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1133
 
      -1,    -1,    -1,    -1,    -1,    -1,    69,    -1,    -1,    -1,
1134
 
       5,     6,     7,    -1,    -1,    -1,    -1,    80,    81,    82,
1135
 
      83,    16,    17,    18,    19,    20,    21,    22,    23,    24,
1136
 
      25,    26,    27,    -1,    -1,    -1,    -1,    -1,    33,    34,
1137
 
      -1,    36,    37,    38,    39,    40,    41,    -1,    43,     5,
1138
 
       6,     7,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1139
 
      16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
1140
 
      26,    27,    -1,    -1,    -1,    -1,    -1,    33,    34,    74,
1141
 
      36,    37,    38,    39,    40,    41,    -1,    43,     0,    -1,
1142
 
      -1,     3,     4,     5,     6,     7,    -1,    -1,    -1,    -1,
1143
 
      -1,    -1,    -1,    -1,    16,    17,    18,    19,    20,    21,
1144
 
      22,    23,    24,    25,    26,    27,    -1,    -1,    74,    31,
1145
 
      32,    33,    34,    -1,    36,    37,    38,    39,    40,    41,
1146
 
      -1,    43,     3,     4,     5,     6,     7,    -1,    -1,    -1,
1147
 
      -1,    -1,    -1,    -1,    -1,    16,    17,    18,    19,    20,
1148
 
      21,    22,    23,    24,    25,    26,    27,    -1,    -1,    -1,
1149
 
      31,    32,    33,    34,    -1,    36,    37,    38,    39,    40,
1150
 
      41,    -1,    43,     5,     6,     7,    -1,    -1,    -1,    -1,
1151
 
      -1,    -1,    -1,    -1,    16,    17,    18,    19,    20,    21,
1152
 
      22,    23,    24,    25,    26,    27,    -1,    -1,    -1,    -1,
1153
 
      -1,    33,    34,    -1,    36,    37,    38,    39,    40,    41,
1154
 
      -1,    43
1155
 
};
1156
 
 
1157
 
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1158
 
   symbol of state STATE-NUM.  */
1159
 
static const unsigned char yystos[] =
1160
 
{
1161
 
       0,     3,     4,     5,     6,     7,    16,    17,    18,    19,
1162
 
      20,    21,    22,    23,    24,    25,    26,    27,    31,    32,
1163
 
      33,    34,    36,    37,    38,    39,    40,    41,    43,   123,
1164
 
     124,   125,   126,   127,   132,   133,   134,   135,   136,   137,
1165
 
     164,   165,   166,    42,    73,    79,   167,    70,    76,    28,
1166
 
      29,    30,   129,   130,   135,    76,    79,    42,   136,     0,
1167
 
     165,    73,   136,   138,   139,    73,   150,   129,   128,   131,
1168
 
     136,   130,    42,    69,    71,    78,   138,    42,   140,   141,
1169
 
      74,   139,     5,     6,     7,     8,     9,    10,    12,    13,
1170
 
      14,    15,    16,    17,    18,    19,    20,    21,    22,    23,
1171
 
      24,    25,    26,    27,    35,    42,    43,    44,    45,    46,
1172
 
      50,    51,    69,    73,    74,    79,    80,    81,    82,    83,
1173
 
      94,    95,    96,    98,    99,   100,   101,   102,   103,   104,
1174
 
     105,   106,   107,   108,   109,   110,   111,   112,   113,   114,
1175
 
     115,   116,   117,   118,   119,   121,   123,   124,   143,   144,
1176
 
     145,   146,   151,   152,   153,   156,   163,    42,    71,   128,
1177
 
     131,    71,    78,     5,     6,     7,    16,    17,    18,    19,
1178
 
      20,    21,    22,    23,    24,    25,    26,    27,    43,    72,
1179
 
     105,   118,   122,   119,   142,    74,    71,    76,    79,    79,
1180
 
      79,   158,    69,    69,    79,    79,   121,    69,   105,   105,
1181
 
     121,    74,   147,    50,    51,    71,    75,    70,    70,    76,
1182
 
      34,   119,    69,    59,    60,    61,    62,    63,    64,    65,
1183
 
      66,    67,    68,    78,   120,   105,    84,    85,    86,    81,
1184
 
      83,    48,    49,    52,    53,    87,    88,    54,    55,    91,
1185
 
      90,    89,    56,    58,    57,    92,    76,    79,    74,   144,
1186
 
      71,   122,    72,   122,   142,    72,   122,   141,   144,   159,
1187
 
     121,    79,   157,    70,   151,    97,   121,    47,   119,   119,
1188
 
     105,   105,   105,   107,   107,   108,   108,   109,   109,   109,
1189
 
     109,   110,   110,   111,   112,   113,   114,   115,   116,   121,
1190
 
     119,   122,    72,    72,    72,    35,   143,   152,   160,    70,
1191
 
     121,   134,   155,   148,    72,    77,    72,    69,   155,   161,
1192
 
     162,   144,   154,    42,    70,    74,   119,   121,    79,    70,
1193
 
      11,    78,   145,   149,   150,    70,   121,   149,   144,   142,
1194
 
      79
1195
 
};
1196
 
 
1197
 
#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
1198
 
# define YYSIZE_T __SIZE_TYPE__
1199
 
#endif
1200
 
#if ! defined (YYSIZE_T) && defined (size_t)
1201
 
# define YYSIZE_T size_t
1202
 
#endif
1203
 
#if ! defined (YYSIZE_T)
1204
 
# if defined (__STDC__) || defined (__cplusplus)
1205
 
#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1206
 
#  define YYSIZE_T size_t
1207
 
# endif
1208
 
#endif
1209
 
#if ! defined (YYSIZE_T)
1210
 
# define YYSIZE_T unsigned int
1211
 
#endif
1212
 
 
1213
 
#define yyerrok         (yyerrstatus = 0)
1214
 
#define yyclearin       (yychar = YYEMPTY)
1215
 
#define YYEMPTY         (-2)
1216
 
#define YYEOF           0
1217
 
 
1218
 
#define YYACCEPT        goto yyacceptlab
1219
 
#define YYABORT         goto yyabortlab
1220
 
#define YYERROR         goto yyerrlab1
1221
 
 
1222
 
 
1223
 
/* Like YYERROR except do call yyerror.  This remains here temporarily
1224
 
   to ease the transition to the new meaning of YYERROR, for GCC.
1225
 
   Once GCC version 2 has supplanted version 1, this can go.  */
1226
 
 
1227
 
#define YYFAIL          goto yyerrlab
1228
 
 
1229
 
#define YYRECOVERING()  (!!yyerrstatus)
1230
 
 
1231
 
#define YYBACKUP(Token, Value)                                  \
1232
 
do                                                              \
1233
 
  if (yychar == YYEMPTY && yylen == 1)                          \
1234
 
    {                                                           \
1235
 
      yychar = (Token);                                         \
1236
 
      yylval = (Value);                                         \
1237
 
      yytoken = YYTRANSLATE (yychar);                           \
1238
 
      YYPOPSTACK;                                               \
1239
 
      goto yybackup;                                            \
1240
 
    }                                                           \
1241
 
  else                                                          \
1242
 
    {                                                           \
1243
 
      yyerror ("syntax error: cannot back up");\
1244
 
      YYERROR;                                                  \
1245
 
    }                                                           \
1246
 
while (0)
1247
 
 
1248
 
#define YYTERROR        1
1249
 
#define YYERRCODE       256
1250
 
 
1251
 
/* YYLLOC_DEFAULT -- Compute the default location (before the actions
1252
 
   are run).  */
1253
 
 
1254
 
#ifndef YYLLOC_DEFAULT
1255
 
# define YYLLOC_DEFAULT(Current, Rhs, N)         \
1256
 
  Current.first_line   = Rhs[1].first_line;      \
1257
 
  Current.first_column = Rhs[1].first_column;    \
1258
 
  Current.last_line    = Rhs[N].last_line;       \
1259
 
  Current.last_column  = Rhs[N].last_column;
1260
 
#endif
1261
 
 
1262
 
/* YYLEX -- calling `yylex' with the right arguments.  */
1263
 
 
1264
 
#ifdef YYLEX_PARAM
1265
 
# define YYLEX yylex (&yylval, YYLEX_PARAM)
1266
 
#else
1267
 
# define YYLEX yylex (&yylval)
1268
 
#endif
1269
 
 
1270
 
/* Enable debugging if requested.  */
1271
 
#if YYDEBUG
1272
 
 
1273
 
# ifndef YYFPRINTF
1274
 
#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1275
 
#  define YYFPRINTF fprintf
1276
 
# endif
1277
 
 
1278
 
# define YYDPRINTF(Args)                        \
1279
 
do {                                            \
1280
 
  if (yydebug)                                  \
1281
 
    YYFPRINTF Args;                             \
1282
 
} while (0)
1283
 
 
1284
 
# define YYDSYMPRINT(Args)                      \
1285
 
do {                                            \
1286
 
  if (yydebug)                                  \
1287
 
    yysymprint Args;                            \
1288
 
} while (0)
1289
 
 
1290
 
# define YYDSYMPRINTF(Title, Token, Value, Location)            \
1291
 
do {                                                            \
1292
 
  if (yydebug)                                                  \
1293
 
    {                                                           \
1294
 
      YYFPRINTF (stderr, "%s ", Title);                         \
1295
 
      yysymprint (stderr,                                       \
1296
 
                  Token, Value);        \
1297
 
      YYFPRINTF (stderr, "\n");                                 \
1298
 
    }                                                           \
1299
 
} while (0)
1300
 
 
1301
 
/*------------------------------------------------------------------.
1302
 
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1303
 
| TOP (cinluded).                                                   |
1304
 
`------------------------------------------------------------------*/
1305
 
 
1306
 
#if defined (__STDC__) || defined (__cplusplus)
1307
 
static void
1308
 
yy_stack_print (short *bottom, short *top)
1309
 
#else
1310
 
static void
1311
 
yy_stack_print (bottom, top)
1312
 
    short *bottom;
1313
 
    short *top;
1314
 
#endif
1315
 
{
1316
 
  YYFPRINTF (stderr, "Stack now");
1317
 
  for (/* Nothing. */; bottom <= top; ++bottom)
1318
 
    YYFPRINTF (stderr, " %d", *bottom);
1319
 
  YYFPRINTF (stderr, "\n");
1320
 
}
1321
 
 
1322
 
# define YY_STACK_PRINT(Bottom, Top)                            \
1323
 
do {                                                            \
1324
 
  if (yydebug)                                                  \
1325
 
    yy_stack_print ((Bottom), (Top));                           \
1326
 
} while (0)
1327
 
 
1328
 
 
1329
 
/*------------------------------------------------.
1330
 
| Report that the YYRULE is going to be reduced.  |
1331
 
`------------------------------------------------*/
1332
 
 
1333
 
#if defined (__STDC__) || defined (__cplusplus)
1334
 
static void
1335
 
yy_reduce_print (int yyrule)
1336
 
#else
1337
 
static void
1338
 
yy_reduce_print (yyrule)
1339
 
    int yyrule;
1340
 
#endif
1341
 
{
1342
 
  int yyi;
1343
 
  unsigned int yylineno = yyrline[yyrule];
1344
 
  YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
1345
 
             yyrule - 1, yylineno);
1346
 
  /* Print the symbols being reduced, and their result.  */
1347
 
  for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
1348
 
    YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
1349
 
  YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
1350
 
}
1351
 
 
1352
 
# define YY_REDUCE_PRINT(Rule)          \
1353
 
do {                                    \
1354
 
  if (yydebug)                          \
1355
 
    yy_reduce_print (Rule);             \
1356
 
} while (0)
1357
 
 
1358
 
/* Nonzero means print parse trace.  It is left uninitialized so that
1359
 
   multiple parsers can coexist.  */
1360
 
int yydebug;
1361
 
#else /* !YYDEBUG */
1362
 
# define YYDPRINTF(Args)
1363
 
# define YYDSYMPRINT(Args)
1364
 
# define YYDSYMPRINTF(Title, Token, Value, Location)
1365
 
# define YY_STACK_PRINT(Bottom, Top)
1366
 
# define YY_REDUCE_PRINT(Rule)
1367
 
#endif /* !YYDEBUG */
1368
 
 
1369
 
 
1370
 
/* YYINITDEPTH -- initial size of the parser's stacks.  */
1371
 
#ifndef YYINITDEPTH
1372
 
# define YYINITDEPTH 200
1373
 
#endif
1374
 
 
1375
 
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1376
 
   if the built-in stack extension method is used).
1377
 
 
1378
 
   Do not make this value too large; the results are undefined if
1379
 
   SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
1380
 
   evaluated with infinite-precision integer arithmetic.  */
1381
 
 
1382
 
#if YYMAXDEPTH == 0
1383
 
# undef YYMAXDEPTH
1384
 
#endif
1385
 
 
1386
 
#ifndef YYMAXDEPTH
1387
 
# define YYMAXDEPTH 10000
1388
 
#endif
1389
 
 
1390
 
 
1391
 
 
1392
 
#if YYERROR_VERBOSE
1393
 
 
1394
 
# ifndef yystrlen
1395
 
#  if defined (__GLIBC__) && defined (_STRING_H)
1396
 
#   define yystrlen strlen
1397
 
#  else
1398
 
/* Return the length of YYSTR.  */
1399
 
static YYSIZE_T
1400
 
#   if defined (__STDC__) || defined (__cplusplus)
1401
 
yystrlen (const char *yystr)
1402
 
#   else
1403
 
yystrlen (yystr)
1404
 
     const char *yystr;
1405
 
#   endif
1406
 
{
1407
 
  register const char *yys = yystr;
1408
 
 
1409
 
  while (*yys++ != '\0')
1410
 
    continue;
1411
 
 
1412
 
  return yys - yystr - 1;
1413
 
}
1414
 
#  endif
1415
 
# endif
1416
 
 
1417
 
# ifndef yystpcpy
1418
 
#  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1419
 
#   define yystpcpy stpcpy
1420
 
#  else
1421
 
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1422
 
   YYDEST.  */
1423
 
static char *
1424
 
#   if defined (__STDC__) || defined (__cplusplus)
1425
 
yystpcpy (char *yydest, const char *yysrc)
1426
 
#   else
1427
 
yystpcpy (yydest, yysrc)
1428
 
     char *yydest;
1429
 
     const char *yysrc;
1430
 
#   endif
1431
 
{
1432
 
  register char *yyd = yydest;
1433
 
  register const char *yys = yysrc;
1434
 
 
1435
 
  while ((*yyd++ = *yys++) != '\0')
1436
 
    continue;
1437
 
 
1438
 
  return yyd - 1;
1439
 
}
1440
 
#  endif
1441
 
# endif
1442
 
 
1443
 
#endif /* !YYERROR_VERBOSE */
1444
 
 
1445
 
 
1446
 
 
1447
 
#if YYDEBUG
1448
 
/*--------------------------------.
1449
 
| Print this symbol on YYOUTPUT.  |
1450
 
`--------------------------------*/
1451
 
 
1452
 
#if defined (__STDC__) || defined (__cplusplus)
1453
 
static void
1454
 
yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
1455
 
#else
1456
 
static void
1457
 
yysymprint (yyoutput, yytype, yyvaluep)
1458
 
    FILE *yyoutput;
1459
 
    int yytype;
1460
 
    YYSTYPE *yyvaluep;
1461
 
#endif
1462
 
{
1463
 
  /* Pacify ``unused variable'' warnings.  */
1464
 
  (void) yyvaluep;
1465
 
 
1466
 
  if (yytype < YYNTOKENS)
1467
 
    {
1468
 
      YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1469
 
# ifdef YYPRINT
1470
 
      YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1471
 
# endif
1472
 
    }
1473
 
  else
1474
 
    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1475
 
 
1476
 
  switch (yytype)
1477
 
    {
1478
 
      default:
1479
 
        break;
1480
 
    }
1481
 
  YYFPRINTF (yyoutput, ")");
1482
 
}
1483
 
 
1484
 
#endif /* ! YYDEBUG */
1485
 
/*-----------------------------------------------.
1486
 
| Release the memory associated to this symbol.  |
1487
 
`-----------------------------------------------*/
1488
 
 
1489
 
#if defined (__STDC__) || defined (__cplusplus)
1490
 
static void
1491
 
yydestruct (int yytype, YYSTYPE *yyvaluep)
1492
 
#else
1493
 
static void
1494
 
yydestruct (yytype, yyvaluep)
1495
 
    int yytype;
1496
 
    YYSTYPE *yyvaluep;
1497
 
#endif
1498
 
{
1499
 
  /* Pacify ``unused variable'' warnings.  */
1500
 
  (void) yyvaluep;
1501
 
 
1502
 
  switch (yytype)
1503
 
    {
1504
 
 
1505
 
      default:
1506
 
        break;
1507
 
    }
1508
 
}
1509
 
 
1510
 
 
1511
 
/* Prevent warnings from -Wmissing-prototypes.  */
1512
 
 
1513
 
#ifdef YYPARSE_PARAM
1514
 
# if defined (__STDC__) || defined (__cplusplus)
1515
 
int yyparse (void *YYPARSE_PARAM);
1516
 
# else
1517
 
int yyparse ();
1518
 
# endif
1519
 
#else /* ! YYPARSE_PARAM */
1520
 
#if defined (__STDC__) || defined (__cplusplus)
1521
 
int yyparse (void);
1522
 
#else
1523
 
int yyparse ();
1524
 
#endif
1525
 
#endif /* ! YYPARSE_PARAM */
1526
 
 
1527
 
 
1528
 
 
1529
 
 
1530
 
 
1531
 
 
1532
 
/*----------.
1533
 
| yyparse.  |
1534
 
`----------*/
1535
 
 
1536
 
#ifdef YYPARSE_PARAM
1537
 
# if defined (__STDC__) || defined (__cplusplus)
1538
 
int yyparse (void *YYPARSE_PARAM)
1539
 
# else
1540
 
int yyparse (YYPARSE_PARAM)
1541
 
  void *YYPARSE_PARAM;
1542
 
# endif
1543
 
#else /* ! YYPARSE_PARAM */
1544
 
#if defined (__STDC__) || defined (__cplusplus)
1545
 
int
1546
 
yyparse (void)
1547
 
#else
1548
 
int
1549
 
yyparse ()
1550
 
 
1551
 
#endif
1552
 
#endif
1553
 
{
1554
 
  /* The lookahead symbol.  */
1555
 
int yychar;
1556
 
 
1557
 
/* The semantic value of the lookahead symbol.  */
1558
 
YYSTYPE yylval;
1559
 
 
1560
 
/* Number of syntax errors so far.  */
1561
 
int yynerrs;
1562
 
 
1563
 
  register int yystate;
1564
 
  register int yyn;
1565
 
  int yyresult;
1566
 
  /* Number of tokens to shift before error messages enabled.  */
1567
 
  int yyerrstatus;
1568
 
  /* Lookahead token as an internal (translated) token number.  */
1569
 
  int yytoken = 0;
1570
 
 
1571
 
  /* Three stacks and their tools:
1572
 
     `yyss': related to states,
1573
 
     `yyvs': related to semantic values,
1574
 
     `yyls': related to locations.
1575
 
 
1576
 
     Refer to the stacks thru separate pointers, to allow yyoverflow
1577
 
     to reallocate them elsewhere.  */
1578
 
 
1579
 
  /* The state stack.  */
1580
 
  short yyssa[YYINITDEPTH];
1581
 
  short *yyss = yyssa;
1582
 
  register short *yyssp;
1583
 
 
1584
 
  /* The semantic value stack.  */
1585
 
  YYSTYPE yyvsa[YYINITDEPTH];
1586
 
  YYSTYPE *yyvs = yyvsa;
1587
 
  register YYSTYPE *yyvsp;
1588
 
 
1589
 
 
1590
 
 
1591
 
#define YYPOPSTACK   (yyvsp--, yyssp--)
1592
 
 
1593
 
  YYSIZE_T yystacksize = YYINITDEPTH;
1594
 
 
1595
 
  /* The variables used to return semantic value and location from the
1596
 
     action routines.  */
1597
 
  YYSTYPE yyval;
1598
 
 
1599
 
 
1600
 
  /* When reducing, the number of symbols on the RHS of the reduced
1601
 
     rule.  */
1602
 
  int yylen;
1603
 
 
1604
 
  YYDPRINTF ((stderr, "Starting parse\n"));
1605
 
 
1606
 
  yystate = 0;
1607
 
  yyerrstatus = 0;
1608
 
  yynerrs = 0;
1609
 
  yychar = YYEMPTY;             /* Cause a token to be read.  */
1610
 
 
1611
 
  /* Initialize stack pointers.
1612
 
     Waste one element of value and location stack
1613
 
     so that they stay on the same level as the state stack.
1614
 
     The wasted elements are never initialized.  */
1615
 
 
1616
 
  yyssp = yyss;
1617
 
  yyvsp = yyvs;
1618
 
 
1619
 
  goto yysetstate;
1620
 
 
1621
 
/*------------------------------------------------------------.
1622
 
| yynewstate -- Push a new state, which is found in yystate.  |
1623
 
`------------------------------------------------------------*/
1624
 
 yynewstate:
1625
 
  /* In all cases, when you get here, the value and location stacks
1626
 
     have just been pushed. so pushing a state here evens the stacks.
1627
 
     */
1628
 
  yyssp++;
1629
 
 
1630
 
 yysetstate:
1631
 
  *yyssp = yystate;
1632
 
 
1633
 
  if (yyss + yystacksize - 1 <= yyssp)
1634
 
    {
1635
 
      /* Get the current used size of the three stacks, in elements.  */
1636
 
      YYSIZE_T yysize = yyssp - yyss + 1;
1637
 
 
1638
 
#ifdef yyoverflow
1639
 
      {
1640
 
        /* Give user a chance to reallocate the stack. Use copies of
1641
 
           these so that the &'s don't force the real ones into
1642
 
           memory.  */
1643
 
        YYSTYPE *yyvs1 = yyvs;
1644
 
        short *yyss1 = yyss;
1645
 
 
1646
 
 
1647
 
        /* Each stack pointer address is followed by the size of the
1648
 
           data in use in that stack, in bytes.  This used to be a
1649
 
           conditional around just the two extra args, but that might
1650
 
           be undefined if yyoverflow is a macro.  */
1651
 
        yyoverflow ("parser stack overflow",
1652
 
                    &yyss1, yysize * sizeof (*yyssp),
1653
 
                    &yyvs1, yysize * sizeof (*yyvsp),
1654
 
 
1655
 
                    &yystacksize);
1656
 
 
1657
 
        yyss = yyss1;
1658
 
        yyvs = yyvs1;
1659
 
      }
1660
 
#else /* no yyoverflow */
1661
 
# ifndef YYSTACK_RELOCATE
1662
 
      goto yyoverflowlab;
1663
 
# else
1664
 
      /* Extend the stack our own way.  */
1665
 
      if (YYMAXDEPTH <= yystacksize)
1666
 
        goto yyoverflowlab;
1667
 
      yystacksize *= 2;
1668
 
      if (YYMAXDEPTH < yystacksize)
1669
 
        yystacksize = YYMAXDEPTH;
1670
 
 
1671
 
      {
1672
 
        short *yyss1 = yyss;
1673
 
        union yyalloc *yyptr =
1674
 
          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1675
 
        if (! yyptr)
1676
 
          goto yyoverflowlab;
1677
 
        YYSTACK_RELOCATE (yyss);
1678
 
        YYSTACK_RELOCATE (yyvs);
1679
 
 
1680
 
#  undef YYSTACK_RELOCATE
1681
 
        if (yyss1 != yyssa)
1682
 
          YYSTACK_FREE (yyss1);
1683
 
      }
1684
 
# endif
1685
 
#endif /* no yyoverflow */
1686
 
 
1687
 
      yyssp = yyss + yysize - 1;
1688
 
      yyvsp = yyvs + yysize - 1;
1689
 
 
1690
 
 
1691
 
      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1692
 
                  (unsigned long int) yystacksize));
1693
 
 
1694
 
      if (yyss + yystacksize - 1 <= yyssp)
1695
 
        YYABORT;
1696
 
    }
1697
 
 
1698
 
  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1699
 
 
1700
 
  goto yybackup;
1701
 
 
1702
 
/*-----------.
1703
 
| yybackup.  |
1704
 
`-----------*/
1705
 
yybackup:
1706
 
 
1707
 
/* Do appropriate processing given the current state.  */
1708
 
/* Read a lookahead token if we need one and don't already have one.  */
1709
 
/* yyresume: */
1710
 
 
1711
 
  /* First try to decide what to do without reference to lookahead token.  */
1712
 
 
1713
 
  yyn = yypact[yystate];
1714
 
  if (yyn == YYPACT_NINF)
1715
 
    goto yydefault;
1716
 
 
1717
 
  /* Not known => get a lookahead token if don't already have one.  */
1718
 
 
1719
 
  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1720
 
  if (yychar == YYEMPTY)
1721
 
    {
1722
 
      YYDPRINTF ((stderr, "Reading a token: "));
1723
 
      yychar = YYLEX;
1724
 
    }
1725
 
 
1726
 
  if (yychar <= YYEOF)
1727
 
    {
1728
 
      yychar = yytoken = YYEOF;
1729
 
      YYDPRINTF ((stderr, "Now at end of input.\n"));
1730
 
    }
1731
 
  else
1732
 
    {
1733
 
      yytoken = YYTRANSLATE (yychar);
1734
 
      YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
1735
 
    }
1736
 
 
1737
 
  /* If the proper action on seeing token YYTOKEN is to reduce or to
1738
 
     detect an error, take that action.  */
1739
 
  yyn += yytoken;
1740
 
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1741
 
    goto yydefault;
1742
 
  yyn = yytable[yyn];
1743
 
  if (yyn <= 0)
1744
 
    {
1745
 
      if (yyn == 0 || yyn == YYTABLE_NINF)
1746
 
        goto yyerrlab;
1747
 
      yyn = -yyn;
1748
 
      goto yyreduce;
1749
 
    }
1750
 
 
1751
 
  if (yyn == YYFINAL)
1752
 
    YYACCEPT;
1753
 
 
1754
 
  /* Shift the lookahead token.  */
1755
 
  YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
1756
 
 
1757
 
  /* Discard the token being shifted unless it is eof.  */
1758
 
  if (yychar != YYEOF)
1759
 
    yychar = YYEMPTY;
1760
 
 
1761
 
  *++yyvsp = yylval;
1762
 
 
1763
 
 
1764
 
  /* Count tokens shifted since error; after three, turn off error
1765
 
     status.  */
1766
 
  if (yyerrstatus)
1767
 
    yyerrstatus--;
1768
 
 
1769
 
  yystate = yyn;
1770
 
  goto yynewstate;
1771
 
 
1772
 
 
1773
 
/*-----------------------------------------------------------.
1774
 
| yydefault -- do the default action for the current state.  |
1775
 
`-----------------------------------------------------------*/
1776
 
yydefault:
1777
 
  yyn = yydefact[yystate];
1778
 
  if (yyn == 0)
1779
 
    goto yyerrlab;
1780
 
  goto yyreduce;
1781
 
 
1782
 
 
1783
 
/*-----------------------------.
1784
 
| yyreduce -- Do a reduction.  |
1785
 
`-----------------------------*/
1786
 
yyreduce:
1787
 
  /* yyn is the number of a rule to reduce with.  */
1788
 
  yylen = yyr2[yyn];
1789
 
 
1790
 
  /* If YYLEN is nonzero, implement the default value of the action:
1791
 
     `$$ = $1'.
1792
 
 
1793
 
     Otherwise, the following line sets YYVAL to garbage.
1794
 
     This behavior is undocumented and Bison
1795
 
     users should not rely upon it.  Assigning to YYVAL
1796
 
     unconditionally makes the parser a bit smaller, and it avoids a
1797
 
     GCC warning that YYVAL may be used uninitialized.  */
1798
 
  yyval = yyvsp[1-yylen];
1799
 
 
1800
 
 
1801
 
  YY_REDUCE_PRINT (yyn);
1802
 
  switch (yyn)
1803
 
    {
1804
 
        case 2:
1805
 
#line 210 "glslang.y"
1806
 
    {
1807
 
        // The symbol table search was done in the lexical phase
1808
 
        const TSymbol* symbol = yyvsp[0].lex.symbol;
1809
 
        const TVariable* variable;
1810
 
        if (symbol == 0) {
1811
 
            parseContext.error(yyvsp[0].lex.line, "undeclared identifier", yyvsp[0].lex.string->c_str(), "");
1812
 
            parseContext.recover();
1813
 
            TType type(EbtFloat);
1814
 
            TVariable* fakeVariable = new TVariable(yyvsp[0].lex.string, type);
1815
 
            parseContext.symbolTable.insert(*fakeVariable);
1816
 
            variable = fakeVariable;
1817
 
        } else {
1818
 
            // This identifier can only be a variable type symbol 
1819
 
            if (! symbol->isVariable()) {
1820
 
                parseContext.error(yyvsp[0].lex.line, "variable expected", yyvsp[0].lex.string->c_str(), "");
1821
 
                parseContext.recover();
1822
 
            }
1823
 
            variable = static_cast<const TVariable*>(symbol);
1824
 
        }
1825
 
 
1826
 
        // don't delete $1.string, it's used by error recovery, and the pool
1827
 
        // pop will reclaim the memory
1828
 
 
1829
 
        if (variable->getType().getQualifier() == EvqConst ) {
1830
 
            constUnion* constArray = variable->getConstPointer();
1831
 
            TType t(variable->getType());
1832
 
            yyval.interm.intermTypedNode = parseContext.intermediate.addConstantUnion(constArray, t, yyvsp[0].lex.line);        
1833
 
        } else
1834
 
            yyval.interm.intermTypedNode = parseContext.intermediate.addSymbol(variable->getUniqueId(), 
1835
 
                                                     variable->getName(), 
1836
 
                                                     variable->getType(), yyvsp[0].lex.line);
1837
 
    ;}
1838
 
    break;
1839
 
 
1840
 
  case 3:
1841
 
#line 245 "glslang.y"
1842
 
    {
1843
 
        yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode;
1844
 
    ;}
1845
 
    break;
1846
 
 
1847
 
  case 4:
1848
 
#line 248 "glslang.y"
1849
 
    {
1850
 
        //
1851
 
        // INT_TYPE is only 16-bit plus sign bit for vertex/fragment shaders, 
1852
 
        // check for overflow for constants
1853
 
        //
1854
 
        if (abs(yyvsp[0].lex.i) >= (1 << 16)) {
1855
 
            parseContext.error(yyvsp[0].lex.line, " integer constant overflow", "", "");
1856
 
            parseContext.recover();
1857
 
        }
1858
 
        constUnion *unionArray = new constUnion[1];
1859
 
        unionArray->iConst = yyvsp[0].lex.i;
1860
 
        yyval.interm.intermTypedNode = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtInt, EvqConst), yyvsp[0].lex.line);
1861
 
    ;}
1862
 
    break;
1863
 
 
1864
 
  case 5:
1865
 
#line 261 "glslang.y"
1866
 
    {
1867
 
        constUnion *unionArray = new constUnion[1];
1868
 
        unionArray->fConst = yyvsp[0].lex.f;
1869
 
        yyval.interm.intermTypedNode = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtFloat, EvqConst), yyvsp[0].lex.line);
1870
 
    ;}
1871
 
    break;
1872
 
 
1873
 
  case 6:
1874
 
#line 266 "glslang.y"
1875
 
    {
1876
 
        constUnion *unionArray = new constUnion[1];
1877
 
        unionArray->bConst = yyvsp[0].lex.b;
1878
 
        yyval.interm.intermTypedNode = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtBool, EvqConst), yyvsp[0].lex.line);
1879
 
    ;}
1880
 
    break;
1881
 
 
1882
 
  case 7:
1883
 
#line 271 "glslang.y"
1884
 
    {
1885
 
        yyval.interm.intermTypedNode = yyvsp[-1].interm.intermTypedNode;
1886
 
    ;}
1887
 
    break;
1888
 
 
1889
 
  case 8:
1890
 
#line 277 "glslang.y"
1891
 
    { 
1892
 
        yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode;
1893
 
    ;}
1894
 
    break;
1895
 
 
1896
 
  case 9:
1897
 
#line 280 "glslang.y"
1898
 
    {
1899
 
        if (!yyvsp[-3].interm.intermTypedNode->isArray() && !yyvsp[-3].interm.intermTypedNode->isMatrix() && !yyvsp[-3].interm.intermTypedNode->isVector()) {
1900
 
            if (yyvsp[-3].interm.intermTypedNode->getAsSymbolNode())
1901
 
                parseContext.error(yyvsp[-2].lex.line, " left of '[' is not of type array, matrix, or vector ", yyvsp[-3].interm.intermTypedNode->getAsSymbolNode()->getSymbol().c_str(), "");
1902
 
            else
1903
 
                parseContext.error(yyvsp[-2].lex.line, " left of '[' is not of type array, matrix, or vector ", "expression", "");
1904
 
            parseContext.recover();
1905
 
        }
1906
 
        if (yyvsp[-3].interm.intermTypedNode->getType().getQualifier() == EvqConst && !yyvsp[-3].interm.intermTypedNode->isArray() && yyvsp[-1].interm.intermTypedNode->getQualifier() == EvqConst) {
1907
 
             if (yyvsp[-3].interm.intermTypedNode->isVector()) {  // constant folding for vectors
1908
 
                TVectorFields fields;
1909
 
                fields.num = 1;
1910
 
                fields.offsets[0] = yyvsp[-1].interm.intermTypedNode->getAsConstantUnion()->getUnionArrayPointer()->iConst; // need to do it this way because v.xy sends fields integer array
1911
 
                yyval.interm.intermTypedNode = parseContext.addConstVectorNode(fields, yyvsp[-3].interm.intermTypedNode, yyvsp[-2].lex.line);
1912
 
            } else if (yyvsp[-3].interm.intermTypedNode->isMatrix()) { // constant folding for matrices
1913
 
                yyval.interm.intermTypedNode = parseContext.addConstMatrixNode(yyvsp[-1].interm.intermTypedNode->getAsConstantUnion()->getUnionArrayPointer()->iConst, yyvsp[-3].interm.intermTypedNode, yyvsp[-2].lex.line);
1914
 
            }
1915
 
        } else {
1916
 
            if (yyvsp[-1].interm.intermTypedNode->getQualifier() == EvqConst) {
1917
 
                if ((yyvsp[-3].interm.intermTypedNode->isVector() || yyvsp[-3].interm.intermTypedNode->isMatrix()) && yyvsp[-3].interm.intermTypedNode->getType().getNominalSize() <= yyvsp[-1].interm.intermTypedNode->getAsConstantUnion()->getUnionArrayPointer()->iConst && !yyvsp[-3].interm.intermTypedNode->isArray() ) {
1918
 
                    parseContext.error(yyvsp[-2].lex.line, "", "[", "field selection out of range '%d'", yyvsp[-1].interm.intermTypedNode->getAsConstantUnion()->getUnionArrayPointer()->iConst);
1919
 
                    parseContext.recover();
1920
 
                } else {
1921
 
                    if (yyvsp[-3].interm.intermTypedNode->isArray()) {
1922
 
                        if (yyvsp[-3].interm.intermTypedNode->getType().getArraySize() == 0) {
1923
 
                            if (yyvsp[-3].interm.intermTypedNode->getType().getMaxArraySize() <= yyvsp[-1].interm.intermTypedNode->getAsConstantUnion()->getUnionArrayPointer()->iConst) {
1924
 
                                if (parseContext.arraySetMaxSize(yyvsp[-3].interm.intermTypedNode->getAsSymbolNode(), yyvsp[-3].interm.intermTypedNode->getTypePointer(), yyvsp[-1].interm.intermTypedNode->getAsConstantUnion()->getUnionArrayPointer()->iConst, true, yyvsp[-2].lex.line))
1925
 
                                    parseContext.recover(); 
1926
 
                            } else {
1927
 
                                if (parseContext.arraySetMaxSize(yyvsp[-3].interm.intermTypedNode->getAsSymbolNode(), yyvsp[-3].interm.intermTypedNode->getTypePointer(), 0, false, yyvsp[-2].lex.line))
1928
 
                                    parseContext.recover(); 
1929
 
                            }
1930
 
                        } else if ( yyvsp[-1].interm.intermTypedNode->getAsConstantUnion()->getUnionArrayPointer()->iConst >= yyvsp[-3].interm.intermTypedNode->getType().getArraySize()) {
1931
 
                            parseContext.error(yyvsp[-2].lex.line, "", "[", "array index out of range '%d'", yyvsp[-1].interm.intermTypedNode->getAsConstantUnion()->getUnionArrayPointer()->iConst);
1932
 
                            parseContext.recover();
1933
 
                        }
1934
 
                    }
1935
 
                    yyval.interm.intermTypedNode = parseContext.intermediate.addIndex(EOpIndexDirect, yyvsp[-3].interm.intermTypedNode, yyvsp[-1].interm.intermTypedNode, yyvsp[-2].lex.line);
1936
 
                }
1937
 
            } else {
1938
 
                if (yyvsp[-3].interm.intermTypedNode->isArray() && yyvsp[-3].interm.intermTypedNode->getType().getArraySize() == 0) {
1939
 
                    parseContext.error(yyvsp[-2].lex.line, "", "[", "array must be redeclared with a size before being indexed with a variable");
1940
 
                    parseContext.recover();
1941
 
                }
1942
 
                
1943
 
                yyval.interm.intermTypedNode = parseContext.intermediate.addIndex(EOpIndexIndirect, yyvsp[-3].interm.intermTypedNode, yyvsp[-1].interm.intermTypedNode, yyvsp[-2].lex.line);
1944
 
            }
1945
 
        } 
1946
 
        if (yyval.interm.intermTypedNode == 0) {
1947
 
            constUnion *unionArray = new constUnion[1];
1948
 
            unionArray->fConst = 0.0;
1949
 
            yyval.interm.intermTypedNode = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtFloat, EvqConst), yyvsp[-2].lex.line);
1950
 
        } else if (yyvsp[-3].interm.intermTypedNode->isArray()) {
1951
 
            if (yyvsp[-3].interm.intermTypedNode->getType().getStruct())
1952
 
                yyval.interm.intermTypedNode->setType(TType(yyvsp[-3].interm.intermTypedNode->getType().getStruct(), yyvsp[-3].interm.intermTypedNode->getType().getTypeName()));
1953
 
            else
1954
 
                yyval.interm.intermTypedNode->setType(TType(yyvsp[-3].interm.intermTypedNode->getBasicType(), EvqTemporary, yyvsp[-3].interm.intermTypedNode->getNominalSize(), yyvsp[-3].interm.intermTypedNode->isMatrix()));
1955
 
        } else if (yyvsp[-3].interm.intermTypedNode->isMatrix() && yyvsp[-3].interm.intermTypedNode->getType().getQualifier() == EvqConst)         
1956
 
            yyval.interm.intermTypedNode->setType(TType(yyvsp[-3].interm.intermTypedNode->getBasicType(), EvqConst, yyvsp[-3].interm.intermTypedNode->getNominalSize()));     
1957
 
        else if (yyvsp[-3].interm.intermTypedNode->isMatrix())            
1958
 
            yyval.interm.intermTypedNode->setType(TType(yyvsp[-3].interm.intermTypedNode->getBasicType(), EvqTemporary, yyvsp[-3].interm.intermTypedNode->getNominalSize()));     
1959
 
        else if (yyvsp[-3].interm.intermTypedNode->isVector() && yyvsp[-3].interm.intermTypedNode->getType().getQualifier() == EvqConst)          
1960
 
            yyval.interm.intermTypedNode->setType(TType(yyvsp[-3].interm.intermTypedNode->getBasicType(), EvqConst));     
1961
 
        else if (yyvsp[-3].interm.intermTypedNode->isVector())       
1962
 
            yyval.interm.intermTypedNode->setType(TType(yyvsp[-3].interm.intermTypedNode->getBasicType(), EvqTemporary));
1963
 
        else
1964
 
            yyval.interm.intermTypedNode->setType(yyvsp[-3].interm.intermTypedNode->getType()); 
1965
 
    ;}
1966
 
    break;
1967
 
 
1968
 
  case 10:
1969
 
#line 348 "glslang.y"
1970
 
    {
1971
 
        yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode;
1972
 
    ;}
1973
 
    break;
1974
 
 
1975
 
  case 11:
1976
 
#line 351 "glslang.y"
1977
 
    {        
1978
 
        if (yyvsp[-2].interm.intermTypedNode->isArray()) {
1979
 
            parseContext.error(yyvsp[0].lex.line, "cannot apply dot operator to an array", ".", "");
1980
 
            parseContext.recover();
1981
 
        }
1982
 
 
1983
 
        if (yyvsp[-2].interm.intermTypedNode->isVector()) {
1984
 
            TVectorFields fields;
1985
 
            if (! parseContext.parseVectorFields(*yyvsp[0].lex.string, yyvsp[-2].interm.intermTypedNode->getNominalSize(), fields, yyvsp[0].lex.line)) {
1986
 
                fields.num = 1;
1987
 
                fields.offsets[0] = 0;
1988
 
                parseContext.recover();
1989
 
            }
1990
 
 
1991
 
            if (yyvsp[-2].interm.intermTypedNode->getType().getQualifier() == EvqConst) { // constant folding for vector fields
1992
 
                yyval.interm.intermTypedNode = parseContext.addConstVectorNode(fields, yyvsp[-2].interm.intermTypedNode, yyvsp[0].lex.line);
1993
 
                if (yyval.interm.intermTypedNode == 0) {
1994
 
                    parseContext.recover();
1995
 
                    yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode;
1996
 
                }
1997
 
                else
1998
 
                    yyval.interm.intermTypedNode->setType(TType(yyvsp[-2].interm.intermTypedNode->getBasicType(), EvqConst, (int) (*yyvsp[0].lex.string).size()));
1999
 
            } else {
2000
 
                if (fields.num == 1) {
2001
 
                    constUnion *unionArray = new constUnion[1];
2002
 
                    unionArray->iConst = fields.offsets[0];
2003
 
                    TIntermTyped* index = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtInt, EvqConst), yyvsp[0].lex.line);
2004
 
                    yyval.interm.intermTypedNode = parseContext.intermediate.addIndex(EOpIndexDirect, yyvsp[-2].interm.intermTypedNode, index, yyvsp[-1].lex.line);
2005
 
                    yyval.interm.intermTypedNode->setType(TType(yyvsp[-2].interm.intermTypedNode->getBasicType()));
2006
 
                } else {
2007
 
                    TString vectorString = *yyvsp[0].lex.string;
2008
 
                    TIntermTyped* index = parseContext.intermediate.addSwizzle(fields, yyvsp[0].lex.line);                
2009
 
                    yyval.interm.intermTypedNode = parseContext.intermediate.addIndex(EOpVectorSwizzle, yyvsp[-2].interm.intermTypedNode, index, yyvsp[-1].lex.line);
2010
 
                    yyval.interm.intermTypedNode->setType(TType(yyvsp[-2].interm.intermTypedNode->getBasicType(),EvqTemporary, (int) vectorString.size()));  
2011
 
                }
2012
 
            }
2013
 
        } else if (yyvsp[-2].interm.intermTypedNode->isMatrix()) {
2014
 
            TMatrixFields fields;
2015
 
            if (! parseContext.parseMatrixFields(*yyvsp[0].lex.string, yyvsp[-2].interm.intermTypedNode->getNominalSize(), fields, yyvsp[0].lex.line)) {
2016
 
                fields.wholeRow = false;
2017
 
                fields.wholeCol = false;
2018
 
                fields.row = 0;
2019
 
                fields.col = 0;
2020
 
                parseContext.recover();
2021
 
            }
2022
 
 
2023
 
            if (fields.wholeRow || fields.wholeCol) {
2024
 
                parseContext.error(yyvsp[-1].lex.line, " non-scalar fields not implemented yet", ".", "");
2025
 
                parseContext.recover();
2026
 
                constUnion *unionArray = new constUnion[1];
2027
 
                unionArray->iConst = 0;
2028
 
                TIntermTyped* index = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtInt, EvqConst), yyvsp[0].lex.line);
2029
 
                yyval.interm.intermTypedNode = parseContext.intermediate.addIndex(EOpIndexDirect, yyvsp[-2].interm.intermTypedNode, index, yyvsp[-1].lex.line);                
2030
 
                yyval.interm.intermTypedNode->setType(TType(yyvsp[-2].interm.intermTypedNode->getBasicType(), EvqTemporary, yyvsp[-2].interm.intermTypedNode->getNominalSize()));
2031
 
            } else {
2032
 
                constUnion *unionArray = new constUnion[1];
2033
 
                unionArray->iConst = fields.col * yyvsp[-2].interm.intermTypedNode->getNominalSize() + fields.row;
2034
 
                TIntermTyped* index = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtInt, EvqConst), yyvsp[0].lex.line);
2035
 
                yyval.interm.intermTypedNode = parseContext.intermediate.addIndex(EOpIndexDirect, yyvsp[-2].interm.intermTypedNode, index, yyvsp[-1].lex.line);                
2036
 
                yyval.interm.intermTypedNode->setType(TType(yyvsp[-2].interm.intermTypedNode->getBasicType()));
2037
 
            }
2038
 
        } else if (yyvsp[-2].interm.intermTypedNode->getBasicType() == EbtStruct) {
2039
 
            bool fieldFound = false;
2040
 
            TTypeList* fields = yyvsp[-2].interm.intermTypedNode->getType().getStruct();
2041
 
            if (fields == 0) {
2042
 
                parseContext.error(yyvsp[-1].lex.line, "structure has no fields", "Internal Error", "");
2043
 
                parseContext.recover();
2044
 
                yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode;
2045
 
            } else {
2046
 
                unsigned int i;
2047
 
                for (i = 0; i < fields->size(); ++i) {
2048
 
                    if ((*fields)[i].type->getFieldName() == *yyvsp[0].lex.string) {
2049
 
                        fieldFound = true;
2050
 
                        break;
2051
 
                    }                
2052
 
                }
2053
 
                if (fieldFound) {
2054
 
                    if (yyvsp[-2].interm.intermTypedNode->getType().getQualifier() == EvqConst) {
2055
 
                        yyval.interm.intermTypedNode = parseContext.addConstStruct(*yyvsp[0].lex.string, yyvsp[-2].interm.intermTypedNode, yyvsp[-1].lex.line);
2056
 
                        if (yyval.interm.intermTypedNode == 0) {
2057
 
                            parseContext.recover();
2058
 
                            yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode;
2059
 
                        }
2060
 
                        else {
2061
 
                            yyval.interm.intermTypedNode->setType(*(*fields)[i].type);
2062
 
                            // change the qualifier of the return type, not of the structure field
2063
 
                            // as the structure definition is shared between various structures.
2064
 
                            yyval.interm.intermTypedNode->getTypePointer()->changeQualifier(EvqConst);
2065
 
                        }
2066
 
                    } else {
2067
 
                        constUnion *unionArray = new constUnion[1];
2068
 
                        unionArray->iConst = i;
2069
 
                        TIntermTyped* index = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtInt, EvqConst), yyvsp[0].lex.line);
2070
 
                        yyval.interm.intermTypedNode = parseContext.intermediate.addIndex(EOpIndexDirectStruct, yyvsp[-2].interm.intermTypedNode, index, yyvsp[-1].lex.line);                
2071
 
                        yyval.interm.intermTypedNode->setType(*(*fields)[i].type);
2072
 
                    }
2073
 
                } else {
2074
 
                    parseContext.error(yyvsp[-1].lex.line, " no such field in structure", yyvsp[0].lex.string->c_str(), "");
2075
 
                    parseContext.recover();
2076
 
                    yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode;
2077
 
                }
2078
 
            }
2079
 
        } else {
2080
 
            parseContext.error(yyvsp[-1].lex.line, " field selection requires structure, vector, or matrix on left hand side", yyvsp[0].lex.string->c_str(), "");
2081
 
            parseContext.recover();
2082
 
            yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode;
2083
 
        }
2084
 
        // don't delete $3.string, it's from the pool
2085
 
    ;}
2086
 
    break;
2087
 
 
2088
 
  case 12:
2089
 
#line 460 "glslang.y"
2090
 
    {
2091
 
        if (parseContext.lValueErrorCheck(yyvsp[0].lex.line, "++", yyvsp[-1].interm.intermTypedNode))
2092
 
            parseContext.recover();
2093
 
        yyval.interm.intermTypedNode = parseContext.intermediate.addUnaryMath(EOpPostIncrement, yyvsp[-1].interm.intermTypedNode, yyvsp[0].lex.line, parseContext.symbolTable);
2094
 
        if (yyval.interm.intermTypedNode == 0) {
2095
 
            parseContext.unaryOpError(yyvsp[0].lex.line, "++", yyvsp[-1].interm.intermTypedNode->getCompleteString());
2096
 
            parseContext.recover();
2097
 
            yyval.interm.intermTypedNode = yyvsp[-1].interm.intermTypedNode;
2098
 
        }
2099
 
    ;}
2100
 
    break;
2101
 
 
2102
 
  case 13:
2103
 
#line 470 "glslang.y"
2104
 
    {
2105
 
        if (parseContext.lValueErrorCheck(yyvsp[0].lex.line, "--", yyvsp[-1].interm.intermTypedNode))
2106
 
            parseContext.recover();
2107
 
        yyval.interm.intermTypedNode = parseContext.intermediate.addUnaryMath(EOpPostDecrement, yyvsp[-1].interm.intermTypedNode, yyvsp[0].lex.line, parseContext.symbolTable);
2108
 
        if (yyval.interm.intermTypedNode == 0) {
2109
 
            parseContext.unaryOpError(yyvsp[0].lex.line, "--", yyvsp[-1].interm.intermTypedNode->getCompleteString());
2110
 
            parseContext.recover();
2111
 
            yyval.interm.intermTypedNode = yyvsp[-1].interm.intermTypedNode;
2112
 
        }
2113
 
    ;}
2114
 
    break;
2115
 
 
2116
 
  case 14:
2117
 
#line 483 "glslang.y"
2118
 
    {
2119
 
        if (parseContext.integerErrorCheck(yyvsp[0].interm.intermTypedNode, "[]"))
2120
 
            parseContext.recover();
2121
 
        yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; 
2122
 
    ;}
2123
 
    break;
2124
 
 
2125
 
  case 15:
2126
 
#line 491 "glslang.y"
2127
 
    {
2128
 
        TFunction* fnCall = yyvsp[0].interm.function;
2129
 
        TOperator op = fnCall->getBuiltInOp();
2130
 
        
2131
 
        if (op != EOpNull) {
2132
 
            //
2133
 
            // Then this should be a constructor.
2134
 
            //
2135
 
            TType type(EbtVoid);  // use this to get the type back
2136
 
            if (parseContext.constructorErrorCheck(yyvsp[0].interm.line, yyvsp[0].interm.intermNode, *fnCall, op, &type)) {
2137
 
                yyval.interm.intermTypedNode = 0;
2138
 
            } else {
2139
 
                //
2140
 
                // It's a constructor, of type 'type'.
2141
 
                //
2142
 
                yyval.interm.intermTypedNode = parseContext.addConstructor(yyvsp[0].interm.intermNode, &type, op, fnCall, yyvsp[0].interm.line);
2143
 
            }
2144
 
            
2145
 
            if (yyval.interm.intermTypedNode == 0) {        
2146
 
                parseContext.recover();
2147
 
                yyval.interm.intermTypedNode = parseContext.intermediate.setAggregateOperator(0, op, yyvsp[0].interm.line);
2148
 
            }
2149
 
            yyval.interm.intermTypedNode->setType(type);
2150
 
        } else {
2151
 
            //
2152
 
            // Not a constructor.  Find it in the symbol table.
2153
 
            //
2154
 
            const TFunction* fnCandidate;
2155
 
            bool builtIn;
2156
 
            fnCandidate = parseContext.findFunction(yyvsp[0].interm.line, fnCall, &builtIn);
2157
 
            if (fnCandidate) {
2158
 
                //
2159
 
                // A declared function.  But, it might still map to a built-in
2160
 
                // operation.
2161
 
                //
2162
 
                op = fnCandidate->getBuiltInOp();
2163
 
                if (builtIn && op != EOpNull) {
2164
 
                    //
2165
 
                    // A function call mapped to a built-in operation.
2166
 
                    //
2167
 
                    if (fnCandidate->getParamCount() == 1) {
2168
 
                        //
2169
 
                        // Treat it like a built-in unary operator.
2170
 
                        //
2171
 
                        yyval.interm.intermTypedNode = parseContext.intermediate.addUnaryMath(op, yyvsp[0].interm.intermNode, 0, parseContext.symbolTable);
2172
 
                        if (yyval.interm.intermTypedNode == 0)  {
2173
 
                            parseContext.error(yyvsp[0].interm.intermNode->getLine(), " wrong operand type", "Internal Error", 
2174
 
                                "built in unary operator function.  Type: %s",
2175
 
                                static_cast<TIntermTyped*>(yyvsp[0].interm.intermNode)->getCompleteString().c_str());
2176
 
                            YYERROR;
2177
 
                        }
2178
 
                    } else {
2179
 
                        yyval.interm.intermTypedNode = parseContext.intermediate.setAggregateOperator(yyvsp[0].interm.intermAggregate, op, yyvsp[0].interm.line);
2180
 
                    }
2181
 
                } else {
2182
 
                    // This is a real function call
2183
 
                    
2184
 
                    yyval.interm.intermTypedNode = parseContext.intermediate.setAggregateOperator(yyvsp[0].interm.intermAggregate, EOpFunctionCall, yyvsp[0].interm.line);
2185
 
                    yyval.interm.intermTypedNode->setType(fnCandidate->getReturnType());                   
2186
 
                    
2187
 
                    // this is how we know whether the given function is a builtIn function or a user defined function
2188
 
                    // if builtIn == false, it's a userDefined -> could be an overloaded builtIn function also
2189
 
                    // if builtIn == true, it's definitely a builtIn function with EOpNull
2190
 
                    if (!builtIn) 
2191
 
                        yyval.interm.intermTypedNode->getAsAggregate()->setUserDefined(); 
2192
 
                    yyval.interm.intermTypedNode->getAsAggregate()->setName(fnCandidate->getMangledName());
2193
 
 
2194
 
                    TQualifier qual;
2195
 
                    TQualifierList& qualifierList = yyval.interm.intermTypedNode->getAsAggregate()->getQualifier();
2196
 
                    for (int i = 0; i < fnCandidate->getParamCount(); ++i) {
2197
 
                        qual = (*fnCandidate)[i].type->getQualifier();
2198
 
                        if (qual == EvqOut || qual == EvqInOut) {
2199
 
                            if (parseContext.lValueErrorCheck(yyval.interm.intermTypedNode->getLine(), "assign", yyval.interm.intermTypedNode->getAsAggregate()->getSequence()[i]->getAsTyped())) {
2200
 
                                parseContext.error(yyvsp[0].interm.intermNode->getLine(), "Constant value cannot be passed for 'out' or 'inout' parameters.", "Error", "");
2201
 
                                parseContext.recover();
2202
 
                            }
2203
 
                        }
2204
 
                        qualifierList.push_back(qual);
2205
 
                    }
2206
 
                }
2207
 
                yyval.interm.intermTypedNode->setType(fnCandidate->getReturnType());
2208
 
            } else {
2209
 
                // error message was put out by PaFindFunction()
2210
 
                // Put on a dummy node for error recovery
2211
 
                constUnion *unionArray = new constUnion[1];
2212
 
                unionArray->fConst = 0.0;
2213
 
                yyval.interm.intermTypedNode = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtFloat, EvqConst), yyvsp[0].interm.line);
2214
 
                parseContext.recover();
2215
 
            }
2216
 
        }
2217
 
        delete fnCall;
2218
 
    ;}
2219
 
    break;
2220
 
 
2221
 
  case 16:
2222
 
#line 586 "glslang.y"
2223
 
    {
2224
 
        yyval.interm = yyvsp[-1].interm;
2225
 
        yyval.interm.line = yyvsp[0].lex.line;
2226
 
    ;}
2227
 
    break;
2228
 
 
2229
 
  case 17:
2230
 
#line 590 "glslang.y"
2231
 
    {
2232
 
        yyval.interm = yyvsp[-1].interm;
2233
 
        yyval.interm.line = yyvsp[0].lex.line;
2234
 
    ;}
2235
 
    break;
2236
 
 
2237
 
  case 18:
2238
 
#line 597 "glslang.y"
2239
 
    {
2240
 
        yyval.interm.function = yyvsp[-1].interm.function;
2241
 
        yyval.interm.intermNode = 0;
2242
 
    ;}
2243
 
    break;
2244
 
 
2245
 
  case 19:
2246
 
#line 601 "glslang.y"
2247
 
    {
2248
 
        yyval.interm.function = yyvsp[0].interm.function;
2249
 
        yyval.interm.intermNode = 0;
2250
 
    ;}
2251
 
    break;
2252
 
 
2253
 
  case 20:
2254
 
#line 608 "glslang.y"
2255
 
    {
2256
 
        TParameter param = { 0, new TType(yyvsp[0].interm.intermTypedNode->getType()) };
2257
 
        yyvsp[-1].interm.function->addParameter(param);
2258
 
        yyval.interm.function = yyvsp[-1].interm.function;
2259
 
        yyval.interm.intermNode = yyvsp[0].interm.intermTypedNode;
2260
 
    ;}
2261
 
    break;
2262
 
 
2263
 
  case 21:
2264
 
#line 614 "glslang.y"
2265
 
    {
2266
 
        TParameter param = { 0, new TType(yyvsp[0].interm.intermTypedNode->getType()) };
2267
 
        yyvsp[-2].interm.function->addParameter(param);
2268
 
        yyval.interm.function = yyvsp[-2].interm.function;
2269
 
        yyval.interm.intermNode = parseContext.intermediate.growAggregate(yyvsp[-2].interm.intermNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line);
2270
 
    ;}
2271
 
    break;
2272
 
 
2273
 
  case 22:
2274
 
#line 623 "glslang.y"
2275
 
    {
2276
 
        yyval.interm.function = yyvsp[-1].interm.function;
2277
 
    ;}
2278
 
    break;
2279
 
 
2280
 
  case 23:
2281
 
#line 629 "glslang.y"
2282
 
    {
2283
 
        if (yyvsp[0].interm.op == EOpConstructStruct) {
2284
 
            TString tempString = "";
2285
 
            TFunction *function = new TFunction(&tempString, *(yyvsp[0].interm.type.userDef), yyvsp[0].interm.op);
2286
 
            yyval.interm.function = function;
2287
 
        }
2288
 
        else {
2289
 
            TFunction *function = new TFunction(yyvsp[0].interm.op);
2290
 
            yyval.interm.function = function;
2291
 
        }
2292
 
    ;}
2293
 
    break;
2294
 
 
2295
 
  case 24:
2296
 
#line 640 "glslang.y"
2297
 
    {
2298
 
        if (parseContext.reservedErrorCheck(yyvsp[0].lex.line, *yyvsp[0].lex.string)) 
2299
 
            parseContext.recover();
2300
 
        TType type(EbtVoid);
2301
 
        TFunction *function = new TFunction(yyvsp[0].lex.string, type);
2302
 
        yyval.interm.function = function;        
2303
 
    ;}
2304
 
    break;
2305
 
 
2306
 
  case 25:
2307
 
#line 656 "glslang.y"
2308
 
    {                                   yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpConstructFloat; ;}
2309
 
    break;
2310
 
 
2311
 
  case 26:
2312
 
#line 657 "glslang.y"
2313
 
    {                                   yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpConstructInt;   ;}
2314
 
    break;
2315
 
 
2316
 
  case 27:
2317
 
#line 658 "glslang.y"
2318
 
    {                                   yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpConstructBool;  ;}
2319
 
    break;
2320
 
 
2321
 
  case 28:
2322
 
#line 659 "glslang.y"
2323
 
    {                                   yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpConstructVec2;  ;}
2324
 
    break;
2325
 
 
2326
 
  case 29:
2327
 
#line 660 "glslang.y"
2328
 
    {                                   yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpConstructVec3;  ;}
2329
 
    break;
2330
 
 
2331
 
  case 30:
2332
 
#line 661 "glslang.y"
2333
 
    {                                   yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpConstructVec4;  ;}
2334
 
    break;
2335
 
 
2336
 
  case 31:
2337
 
#line 662 "glslang.y"
2338
 
    { FRAG_VERT_ONLY("bvec2", yyvsp[0].lex.line); yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpConstructBVec2; ;}
2339
 
    break;
2340
 
 
2341
 
  case 32:
2342
 
#line 663 "glslang.y"
2343
 
    { FRAG_VERT_ONLY("bvec3", yyvsp[0].lex.line); yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpConstructBVec3; ;}
2344
 
    break;
2345
 
 
2346
 
  case 33:
2347
 
#line 664 "glslang.y"
2348
 
    { FRAG_VERT_ONLY("bvec4", yyvsp[0].lex.line); yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpConstructBVec4; ;}
2349
 
    break;
2350
 
 
2351
 
  case 34:
2352
 
#line 665 "glslang.y"
2353
 
    { FRAG_VERT_ONLY("ivec2", yyvsp[0].lex.line); yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpConstructIVec2; ;}
2354
 
    break;
2355
 
 
2356
 
  case 35:
2357
 
#line 666 "glslang.y"
2358
 
    { FRAG_VERT_ONLY("ivec3", yyvsp[0].lex.line); yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpConstructIVec3; ;}
2359
 
    break;
2360
 
 
2361
 
  case 36:
2362
 
#line 667 "glslang.y"
2363
 
    { FRAG_VERT_ONLY("ivec4", yyvsp[0].lex.line); yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpConstructIVec4; ;}
2364
 
    break;
2365
 
 
2366
 
  case 37:
2367
 
#line 668 "glslang.y"
2368
 
    { FRAG_VERT_ONLY("mat2", yyvsp[0].lex.line);  yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpConstructMat2;  ;}
2369
 
    break;
2370
 
 
2371
 
  case 38:
2372
 
#line 669 "glslang.y"
2373
 
    { FRAG_VERT_ONLY("mat3", yyvsp[0].lex.line);  yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpConstructMat3;  ;}
2374
 
    break;
2375
 
 
2376
 
  case 39:
2377
 
#line 670 "glslang.y"
2378
 
    { FRAG_VERT_ONLY("mat4", yyvsp[0].lex.line);  yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpConstructMat4;  ;}
2379
 
    break;
2380
 
 
2381
 
  case 40:
2382
 
#line 671 "glslang.y"
2383
 
    {                                   
2384
 
        TType& structure = static_cast<TVariable*>(yyvsp[0].lex.symbol)->getType();
2385
 
        TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
2386
 
        TPublicType t = { EbtStruct, qual, 1, false, false, &structure, yyvsp[0].lex.line }; 
2387
 
        yyval.interm.type = t;
2388
 
        yyval.interm.line = yyvsp[0].lex.line; 
2389
 
        yyval.interm.op = EOpConstructStruct; 
2390
 
    ;}
2391
 
    break;
2392
 
 
2393
 
  case 41:
2394
 
#line 682 "glslang.y"
2395
 
    {
2396
 
        yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode;
2397
 
    ;}
2398
 
    break;
2399
 
 
2400
 
  case 42:
2401
 
#line 685 "glslang.y"
2402
 
    {
2403
 
        if (parseContext.lValueErrorCheck(yyvsp[-1].lex.line, "++", yyvsp[0].interm.intermTypedNode))
2404
 
            parseContext.recover();
2405
 
        yyval.interm.intermTypedNode = parseContext.intermediate.addUnaryMath(EOpPreIncrement, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
2406
 
        if (yyval.interm.intermTypedNode == 0) {
2407
 
            parseContext.unaryOpError(yyvsp[-1].lex.line, "++", yyvsp[0].interm.intermTypedNode->getCompleteString());
2408
 
            parseContext.recover();
2409
 
            yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode;
2410
 
        }
2411
 
    ;}
2412
 
    break;
2413
 
 
2414
 
  case 43:
2415
 
#line 695 "glslang.y"
2416
 
    {
2417
 
        if (parseContext.lValueErrorCheck(yyvsp[-1].lex.line, "--", yyvsp[0].interm.intermTypedNode))
2418
 
            parseContext.recover();
2419
 
        yyval.interm.intermTypedNode = parseContext.intermediate.addUnaryMath(EOpPreDecrement, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
2420
 
        if (yyval.interm.intermTypedNode == 0) {
2421
 
            parseContext.unaryOpError(yyvsp[-1].lex.line, "--", yyvsp[0].interm.intermTypedNode->getCompleteString());
2422
 
            parseContext.recover();
2423
 
            yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode;
2424
 
        }
2425
 
    ;}
2426
 
    break;
2427
 
 
2428
 
  case 44:
2429
 
#line 705 "glslang.y"
2430
 
    {
2431
 
        if (yyvsp[-1].interm.op != EOpNull) {
2432
 
            yyval.interm.intermTypedNode = parseContext.intermediate.addUnaryMath(yyvsp[-1].interm.op, yyvsp[0].interm.intermTypedNode, yyvsp[-1].interm.line, parseContext.symbolTable);
2433
 
            if (yyval.interm.intermTypedNode == 0) {
2434
 
                char* errorOp = "";
2435
 
                switch(yyvsp[-1].interm.op) {
2436
 
                case EOpNegative:   errorOp = "-"; break;
2437
 
                case EOpLogicalNot: errorOp = "!"; break;
2438
 
                case EOpBitwiseNot: errorOp = "~"; break;
2439
 
                                default: break;
2440
 
                }
2441
 
                parseContext.unaryOpError(yyvsp[-1].interm.line, errorOp, yyvsp[0].interm.intermTypedNode->getCompleteString());
2442
 
                parseContext.recover();
2443
 
                yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode;
2444
 
            }
2445
 
        } else
2446
 
            yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode;
2447
 
    ;}
2448
 
    break;
2449
 
 
2450
 
  case 45:
2451
 
#line 727 "glslang.y"
2452
 
    { yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpNull; ;}
2453
 
    break;
2454
 
 
2455
 
  case 46:
2456
 
#line 728 "glslang.y"
2457
 
    { yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpNegative; ;}
2458
 
    break;
2459
 
 
2460
 
  case 47:
2461
 
#line 729 "glslang.y"
2462
 
    { yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpLogicalNot; ;}
2463
 
    break;
2464
 
 
2465
 
  case 48:
2466
 
#line 730 "glslang.y"
2467
 
    { PACK_UNPACK_ONLY("~", yyvsp[0].lex.line);  
2468
 
              yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpBitwiseNot; ;}
2469
 
    break;
2470
 
 
2471
 
  case 49:
2472
 
#line 736 "glslang.y"
2473
 
    { yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ;}
2474
 
    break;
2475
 
 
2476
 
  case 50:
2477
 
#line 737 "glslang.y"
2478
 
    {
2479
 
        FRAG_VERT_ONLY("*", yyvsp[-1].lex.line);
2480
 
        yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpMul, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
2481
 
        if (yyval.interm.intermTypedNode == 0) {
2482
 
            parseContext.binaryOpError(yyvsp[-1].lex.line, "*", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
2483
 
            parseContext.recover();
2484
 
            yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode;
2485
 
        }
2486
 
    ;}
2487
 
    break;
2488
 
 
2489
 
  case 51:
2490
 
#line 746 "glslang.y"
2491
 
    {
2492
 
        FRAG_VERT_ONLY("/", yyvsp[-1].lex.line); 
2493
 
        yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpDiv, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
2494
 
        if (yyval.interm.intermTypedNode == 0) {
2495
 
            parseContext.binaryOpError(yyvsp[-1].lex.line, "/", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
2496
 
            parseContext.recover();
2497
 
            yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode;
2498
 
        }
2499
 
    ;}
2500
 
    break;
2501
 
 
2502
 
  case 52:
2503
 
#line 755 "glslang.y"
2504
 
    {
2505
 
        PACK_UNPACK_ONLY("%", yyvsp[-1].lex.line);
2506
 
        yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpMod, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
2507
 
        if (yyval.interm.intermTypedNode == 0) {
2508
 
            parseContext.binaryOpError(yyvsp[-1].lex.line, "%", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
2509
 
            parseContext.recover();
2510
 
            yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode;
2511
 
        }
2512
 
    ;}
2513
 
    break;
2514
 
 
2515
 
  case 53:
2516
 
#line 767 "glslang.y"
2517
 
    { yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ;}
2518
 
    break;
2519
 
 
2520
 
  case 54:
2521
 
#line 768 "glslang.y"
2522
 
    {  
2523
 
        yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpAdd, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
2524
 
        if (yyval.interm.intermTypedNode == 0) {
2525
 
            parseContext.binaryOpError(yyvsp[-1].lex.line, "+", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
2526
 
            parseContext.recover();
2527
 
            yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode;
2528
 
        }
2529
 
    ;}
2530
 
    break;
2531
 
 
2532
 
  case 55:
2533
 
#line 776 "glslang.y"
2534
 
    {
2535
 
        yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpSub, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
2536
 
        if (yyval.interm.intermTypedNode == 0) {
2537
 
            parseContext.binaryOpError(yyvsp[-1].lex.line, "-", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
2538
 
            parseContext.recover();
2539
 
            yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode;
2540
 
        } 
2541
 
    ;}
2542
 
    break;
2543
 
 
2544
 
  case 56:
2545
 
#line 787 "glslang.y"
2546
 
    { yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ;}
2547
 
    break;
2548
 
 
2549
 
  case 57:
2550
 
#line 788 "glslang.y"
2551
 
    {
2552
 
        PACK_UNPACK_ONLY("<<", yyvsp[-1].lex.line);
2553
 
        yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpLeftShift, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
2554
 
        if (yyval.interm.intermTypedNode == 0) {
2555
 
            parseContext.binaryOpError(yyvsp[-1].lex.line, "<<", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
2556
 
            parseContext.recover();
2557
 
            yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode;
2558
 
        }
2559
 
    ;}
2560
 
    break;
2561
 
 
2562
 
  case 58:
2563
 
#line 797 "glslang.y"
2564
 
    {
2565
 
        PACK_UNPACK_ONLY(">>", yyvsp[-1].lex.line);
2566
 
        yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpRightShift, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
2567
 
        if (yyval.interm.intermTypedNode == 0) {
2568
 
            parseContext.binaryOpError(yyvsp[-1].lex.line, ">>", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
2569
 
            parseContext.recover();
2570
 
            yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode;
2571
 
        }
2572
 
    ;}
2573
 
    break;
2574
 
 
2575
 
  case 59:
2576
 
#line 809 "glslang.y"
2577
 
    { yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ;}
2578
 
    break;
2579
 
 
2580
 
  case 60:
2581
 
#line 810 "glslang.y"
2582
 
    { 
2583
 
        yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpLessThan, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
2584
 
        if (yyval.interm.intermTypedNode == 0) {
2585
 
            parseContext.binaryOpError(yyvsp[-1].lex.line, "<", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
2586
 
            parseContext.recover();
2587
 
            constUnion *unionArray = new constUnion[1];
2588
 
            unionArray->bConst = false;
2589
 
            yyval.interm.intermTypedNode = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtBool, EvqConst), yyvsp[-1].lex.line);
2590
 
        }
2591
 
    ;}
2592
 
    break;
2593
 
 
2594
 
  case 61:
2595
 
#line 820 "glslang.y"
2596
 
    { 
2597
 
        yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpGreaterThan, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
2598
 
        if (yyval.interm.intermTypedNode == 0) {
2599
 
            parseContext.binaryOpError(yyvsp[-1].lex.line, ">", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
2600
 
            parseContext.recover();
2601
 
            constUnion *unionArray = new constUnion[1];
2602
 
            unionArray->bConst = false;
2603
 
            yyval.interm.intermTypedNode = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtBool, EvqConst), yyvsp[-1].lex.line);
2604
 
        }
2605
 
    ;}
2606
 
    break;
2607
 
 
2608
 
  case 62:
2609
 
#line 830 "glslang.y"
2610
 
    { 
2611
 
        yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpLessThanEqual, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
2612
 
        if (yyval.interm.intermTypedNode == 0) {
2613
 
            parseContext.binaryOpError(yyvsp[-1].lex.line, "<=", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
2614
 
            parseContext.recover();
2615
 
            constUnion *unionArray = new constUnion[1];
2616
 
            unionArray->bConst = false;
2617
 
            yyval.interm.intermTypedNode = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtBool, EvqConst), yyvsp[-1].lex.line);
2618
 
        }
2619
 
    ;}
2620
 
    break;
2621
 
 
2622
 
  case 63:
2623
 
#line 840 "glslang.y"
2624
 
    { 
2625
 
        yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpGreaterThanEqual, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
2626
 
        if (yyval.interm.intermTypedNode == 0) {
2627
 
            parseContext.binaryOpError(yyvsp[-1].lex.line, ">=", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
2628
 
            parseContext.recover();
2629
 
            constUnion *unionArray = new constUnion[1];
2630
 
            unionArray->bConst = false;
2631
 
            yyval.interm.intermTypedNode = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtBool, EvqConst), yyvsp[-1].lex.line);
2632
 
        }
2633
 
    ;}
2634
 
    break;
2635
 
 
2636
 
  case 64:
2637
 
#line 853 "glslang.y"
2638
 
    { yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ;}
2639
 
    break;
2640
 
 
2641
 
  case 65:
2642
 
#line 854 "glslang.y"
2643
 
    { 
2644
 
        yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpEqual, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
2645
 
        if (yyval.interm.intermTypedNode == 0) {
2646
 
            parseContext.binaryOpError(yyvsp[-1].lex.line, "==", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
2647
 
            parseContext.recover();
2648
 
            constUnion *unionArray = new constUnion[1];
2649
 
            unionArray->bConst = false;
2650
 
            yyval.interm.intermTypedNode = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtBool, EvqConst), yyvsp[-1].lex.line);
2651
 
        }
2652
 
    ;}
2653
 
    break;
2654
 
 
2655
 
  case 66:
2656
 
#line 864 "glslang.y"
2657
 
    { 
2658
 
        yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpNotEqual, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
2659
 
        if (yyval.interm.intermTypedNode == 0) {
2660
 
            parseContext.binaryOpError(yyvsp[-1].lex.line, "!=", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
2661
 
            parseContext.recover();
2662
 
            constUnion *unionArray = new constUnion[1];
2663
 
            unionArray->bConst = false;
2664
 
            yyval.interm.intermTypedNode = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtBool, EvqConst), yyvsp[-1].lex.line);
2665
 
        }
2666
 
    ;}
2667
 
    break;
2668
 
 
2669
 
  case 67:
2670
 
#line 877 "glslang.y"
2671
 
    { yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ;}
2672
 
    break;
2673
 
 
2674
 
  case 68:
2675
 
#line 878 "glslang.y"
2676
 
    {
2677
 
        PACK_UNPACK_ONLY("&", yyvsp[-1].lex.line);
2678
 
        yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpAnd, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
2679
 
        if (yyval.interm.intermTypedNode == 0) {
2680
 
            parseContext.binaryOpError(yyvsp[-1].lex.line, "&", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
2681
 
            parseContext.recover();
2682
 
            yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode;
2683
 
        }
2684
 
    ;}
2685
 
    break;
2686
 
 
2687
 
  case 69:
2688
 
#line 890 "glslang.y"
2689
 
    { yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ;}
2690
 
    break;
2691
 
 
2692
 
  case 70:
2693
 
#line 891 "glslang.y"
2694
 
    {
2695
 
        PACK_UNPACK_ONLY("^", yyvsp[-1].lex.line);
2696
 
        yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpExclusiveOr, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
2697
 
        if (yyval.interm.intermTypedNode == 0) {
2698
 
            parseContext.binaryOpError(yyvsp[-1].lex.line, "^", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
2699
 
            parseContext.recover();
2700
 
            yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode;
2701
 
        }
2702
 
    ;}
2703
 
    break;
2704
 
 
2705
 
  case 71:
2706
 
#line 903 "glslang.y"
2707
 
    { yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ;}
2708
 
    break;
2709
 
 
2710
 
  case 72:
2711
 
#line 904 "glslang.y"
2712
 
    {
2713
 
        PACK_UNPACK_ONLY("|", yyvsp[-1].lex.line);
2714
 
        yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpInclusiveOr, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
2715
 
        if (yyval.interm.intermTypedNode == 0) {
2716
 
            parseContext.binaryOpError(yyvsp[-1].lex.line, "|", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
2717
 
            parseContext.recover();
2718
 
            yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode;
2719
 
        }
2720
 
    ;}
2721
 
    break;
2722
 
 
2723
 
  case 73:
2724
 
#line 916 "glslang.y"
2725
 
    { yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ;}
2726
 
    break;
2727
 
 
2728
 
  case 74:
2729
 
#line 917 "glslang.y"
2730
 
    {
2731
 
        yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpLogicalAnd, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
2732
 
        if (yyval.interm.intermTypedNode == 0) {
2733
 
            parseContext.binaryOpError(yyvsp[-1].lex.line, "&&", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
2734
 
            parseContext.recover();
2735
 
            constUnion *unionArray = new constUnion[1];
2736
 
            unionArray->bConst = false;
2737
 
            yyval.interm.intermTypedNode = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtBool, EvqConst), yyvsp[-1].lex.line);
2738
 
        }
2739
 
    ;}
2740
 
    break;
2741
 
 
2742
 
  case 75:
2743
 
#line 930 "glslang.y"
2744
 
    { yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ;}
2745
 
    break;
2746
 
 
2747
 
  case 76:
2748
 
#line 931 "glslang.y"
2749
 
    { 
2750
 
        yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpLogicalXor, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
2751
 
        if (yyval.interm.intermTypedNode == 0) {
2752
 
            parseContext.binaryOpError(yyvsp[-1].lex.line, "^^", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
2753
 
            parseContext.recover();
2754
 
            constUnion *unionArray = new constUnion[1];
2755
 
            unionArray->bConst = false;
2756
 
            yyval.interm.intermTypedNode = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtBool, EvqConst), yyvsp[-1].lex.line);
2757
 
        }
2758
 
    ;}
2759
 
    break;
2760
 
 
2761
 
  case 77:
2762
 
#line 944 "glslang.y"
2763
 
    { yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ;}
2764
 
    break;
2765
 
 
2766
 
  case 78:
2767
 
#line 945 "glslang.y"
2768
 
    { 
2769
 
        yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpLogicalOr, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
2770
 
        if (yyval.interm.intermTypedNode == 0) {
2771
 
            parseContext.binaryOpError(yyvsp[-1].lex.line, "||", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
2772
 
            parseContext.recover();
2773
 
            constUnion *unionArray = new constUnion[1];
2774
 
            unionArray->bConst = false;
2775
 
            yyval.interm.intermTypedNode = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtBool, EvqConst), yyvsp[-1].lex.line);
2776
 
        }
2777
 
    ;}
2778
 
    break;
2779
 
 
2780
 
  case 79:
2781
 
#line 958 "glslang.y"
2782
 
    { yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ;}
2783
 
    break;
2784
 
 
2785
 
  case 80:
2786
 
#line 959 "glslang.y"
2787
 
    {
2788
 
       if (parseContext.boolErrorCheck(yyvsp[-3].lex.line, yyvsp[-4].interm.intermTypedNode))
2789
 
            parseContext.recover();
2790
 
       
2791
 
        yyval.interm.intermTypedNode = parseContext.intermediate.addSelection(yyvsp[-4].interm.intermTypedNode, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-3].lex.line);
2792
 
        if (yyvsp[-2].interm.intermTypedNode->getType() != yyvsp[0].interm.intermTypedNode->getType())
2793
 
            yyval.interm.intermTypedNode = 0;
2794
 
            
2795
 
        if (yyval.interm.intermTypedNode == 0) {
2796
 
            parseContext.binaryOpError(yyvsp[-3].lex.line, ":", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
2797
 
            parseContext.recover();
2798
 
            yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode;
2799
 
        }
2800
 
    ;}
2801
 
    break;
2802
 
 
2803
 
  case 81:
2804
 
#line 976 "glslang.y"
2805
 
    { yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ;}
2806
 
    break;
2807
 
 
2808
 
  case 82:
2809
 
#line 977 "glslang.y"
2810
 
    {
2811
 
        if (parseContext.lValueErrorCheck(yyvsp[-1].interm.line, "assign", yyvsp[-2].interm.intermTypedNode))
2812
 
            parseContext.recover();
2813
 
        yyval.interm.intermTypedNode = parseContext.intermediate.addAssign(yyvsp[-1].interm.op, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].interm.line);
2814
 
        if (yyval.interm.intermTypedNode == 0) {
2815
 
            parseContext.assignError(yyvsp[-1].interm.line, "assign", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
2816
 
            parseContext.recover();
2817
 
            yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode;
2818
 
        }
2819
 
    ;}
2820
 
    break;
2821
 
 
2822
 
  case 83:
2823
 
#line 990 "glslang.y"
2824
 
    {                                    yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpAssign; ;}
2825
 
    break;
2826
 
 
2827
 
  case 84:
2828
 
#line 991 "glslang.y"
2829
 
    { FRAG_VERT_ONLY("*=", yyvsp[0].lex.line);     yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpMulAssign; ;}
2830
 
    break;
2831
 
 
2832
 
  case 85:
2833
 
#line 992 "glslang.y"
2834
 
    { FRAG_VERT_ONLY("/=", yyvsp[0].lex.line);     yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpDivAssign; ;}
2835
 
    break;
2836
 
 
2837
 
  case 86:
2838
 
#line 993 "glslang.y"
2839
 
    { PACK_UNPACK_ONLY("%=", yyvsp[0].lex.line);   yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpModAssign; ;}
2840
 
    break;
2841
 
 
2842
 
  case 87:
2843
 
#line 994 "glslang.y"
2844
 
    {                                    yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpAddAssign; ;}
2845
 
    break;
2846
 
 
2847
 
  case 88:
2848
 
#line 995 "glslang.y"
2849
 
    {                                    yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpSubAssign; ;}
2850
 
    break;
2851
 
 
2852
 
  case 89:
2853
 
#line 996 "glslang.y"
2854
 
    { PACK_UNPACK_ONLY("<<=", yyvsp[0].lex.line);  yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpLeftShiftAssign; ;}
2855
 
    break;
2856
 
 
2857
 
  case 90:
2858
 
#line 997 "glslang.y"
2859
 
    { PACK_UNPACK_ONLY("<<=", yyvsp[0].lex.line);  yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpRightShiftAssign; ;}
2860
 
    break;
2861
 
 
2862
 
  case 91:
2863
 
#line 998 "glslang.y"
2864
 
    { PACK_UNPACK_ONLY("&=",  yyvsp[0].lex.line);  yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpAndAssign; ;}
2865
 
    break;
2866
 
 
2867
 
  case 92:
2868
 
#line 999 "glslang.y"
2869
 
    { PACK_UNPACK_ONLY("^=",  yyvsp[0].lex.line);  yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpExclusiveOrAssign; ;}
2870
 
    break;
2871
 
 
2872
 
  case 93:
2873
 
#line 1000 "glslang.y"
2874
 
    { PACK_UNPACK_ONLY("|=",  yyvsp[0].lex.line);  yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpInclusiveOrAssign; ;}
2875
 
    break;
2876
 
 
2877
 
  case 94:
2878
 
#line 1004 "glslang.y"
2879
 
    {
2880
 
        yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode;
2881
 
    ;}
2882
 
    break;
2883
 
 
2884
 
  case 95:
2885
 
#line 1007 "glslang.y"
2886
 
    {
2887
 
        yyval.interm.intermTypedNode = parseContext.intermediate.addComma(yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line);
2888
 
        if (yyval.interm.intermTypedNode == 0) {
2889
 
            parseContext.binaryOpError(yyvsp[-1].lex.line, ",", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
2890
 
            parseContext.recover();
2891
 
            yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode;
2892
 
        }
2893
 
    ;}
2894
 
    break;
2895
 
 
2896
 
  case 96:
2897
 
#line 1018 "glslang.y"
2898
 
    {
2899
 
        if (parseContext.constErrorCheck(yyvsp[0].interm.intermTypedNode))
2900
 
            parseContext.recover();
2901
 
        yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode;
2902
 
    ;}
2903
 
    break;
2904
 
 
2905
 
  case 97:
2906
 
#line 1026 "glslang.y"
2907
 
    { yyval.interm.intermNode = 0; ;}
2908
 
    break;
2909
 
 
2910
 
  case 98:
2911
 
#line 1027 "glslang.y"
2912
 
    { 
2913
 
        if (yyvsp[-1].interm.intermAggregate)
2914
 
            yyvsp[-1].interm.intermAggregate->setOperator(EOpSequence); 
2915
 
        yyval.interm.intermNode = yyvsp[-1].interm.intermAggregate; 
2916
 
    ;}
2917
 
    break;
2918
 
 
2919
 
  case 99:
2920
 
#line 1035 "glslang.y"
2921
 
    {
2922
 
        //
2923
 
        // Multiple declarations of the same function are allowed.
2924
 
        //
2925
 
        // If this is a definition, the definition production code will check for redefinitions 
2926
 
        // (we don't know at this point if it's a definition or not).
2927
 
        //
2928
 
        // Redeclarations are allowed.  But, return types and parameter qualifiers must match.
2929
 
        //        
2930
 
        TFunction* prevDec = static_cast<TFunction*>(parseContext.symbolTable.find(yyvsp[-1].interm.function->getMangledName()));
2931
 
        if (prevDec) {
2932
 
            if (prevDec->getReturnType() != yyvsp[-1].interm.function->getReturnType()) {
2933
 
                parseContext.error(yyvsp[0].lex.line, "overloaded functions must have the same return type", yyvsp[-1].interm.function->getReturnType().getBasicString(), "");
2934
 
                parseContext.recover();
2935
 
            }
2936
 
            for (int i = 0; i < prevDec->getParamCount(); ++i) {
2937
 
                if ((*prevDec)[i].type->getQualifier() != (*yyvsp[-1].interm.function)[i].type->getQualifier()) {
2938
 
                    parseContext.error(yyvsp[0].lex.line, "overloaded functions must have the same parameter qualifiers", (*yyvsp[-1].interm.function)[i].type->getQualifierString(), "");
2939
 
                    parseContext.recover();
2940
 
                }
2941
 
            }
2942
 
        }
2943
 
        
2944
 
        //
2945
 
        // If this is a redeclaration, it could also be a definition,
2946
 
        // in which case, we want to use the variable names from this one, and not the one that's
2947
 
        // being redeclared.  So, pass back up this declaration, not the one in the symbol table.
2948
 
        //
2949
 
        yyval.interm.function = yyvsp[-1].interm.function;
2950
 
        yyval.interm.line = yyvsp[0].lex.line;
2951
 
 
2952
 
        parseContext.symbolTable.insert(*yyval.interm.function);
2953
 
    ;}
2954
 
    break;
2955
 
 
2956
 
  case 100:
2957
 
#line 1071 "glslang.y"
2958
 
    {
2959
 
        yyval.interm.function = yyvsp[0].interm.function;
2960
 
    ;}
2961
 
    break;
2962
 
 
2963
 
  case 101:
2964
 
#line 1074 "glslang.y"
2965
 
    { 
2966
 
        yyval.interm.function = yyvsp[0].interm.function;  
2967
 
    ;}
2968
 
    break;
2969
 
 
2970
 
  case 102:
2971
 
#line 1081 "glslang.y"
2972
 
    {
2973
 
        // Add the parameter 
2974
 
        yyval.interm.function = yyvsp[-1].interm.function;
2975
 
        if (yyvsp[0].interm.param.type->getBasicType() != EbtVoid)
2976
 
            yyvsp[-1].interm.function->addParameter(yyvsp[0].interm.param);
2977
 
        else
2978
 
            delete yyvsp[0].interm.param.type;
2979
 
    ;}
2980
 
    break;
2981
 
 
2982
 
  case 103:
2983
 
#line 1089 "glslang.y"
2984
 
    {   
2985
 
        //
2986
 
        // Only first parameter of one-parameter functions can be void
2987
 
        // The check for named parameters not being void is done in parameter_declarator 
2988
 
        //
2989
 
        if (yyvsp[0].interm.param.type->getBasicType() == EbtVoid) {
2990
 
            //
2991
 
            // This parameter > first is void
2992
 
            //
2993
 
            parseContext.error(yyvsp[-1].lex.line, "cannot be an argument type except for '(void)'", "void", "");
2994
 
            parseContext.recover();
2995
 
            delete yyvsp[0].interm.param.type;
2996
 
        } else {
2997
 
            // Add the parameter 
2998
 
            yyval.interm.function = yyvsp[-2].interm.function; 
2999
 
            yyvsp[-2].interm.function->addParameter(yyvsp[0].interm.param);
3000
 
        }
3001
 
    ;}
3002
 
    break;
3003
 
 
3004
 
  case 104:
3005
 
#line 1110 "glslang.y"
3006
 
    {
3007
 
        if (yyvsp[-2].interm.type.qualifier != EvqGlobal && yyvsp[-2].interm.type.qualifier != EvqTemporary) {
3008
 
            parseContext.error(yyvsp[-1].lex.line, "no qualifiers allowed for function return", getQualifierString(yyvsp[-2].interm.type.qualifier), "");
3009
 
            parseContext.recover();
3010
 
        }
3011
 
        // make sure a sampler is not involved as well...
3012
 
        if (parseContext.structQualifierErrorCheck(yyvsp[-1].lex.line, yyvsp[-2].interm.type))
3013
 
            parseContext.recover();
3014
 
        
3015
 
        // Add the function as a prototype after parsing it (we do not support recursion) 
3016
 
        TFunction *function;
3017
 
        TType type(yyvsp[-2].interm.type);
3018
 
        function = new TFunction(yyvsp[-1].lex.string, type);
3019
 
        yyval.interm.function = function;
3020
 
    ;}
3021
 
    break;
3022
 
 
3023
 
  case 105:
3024
 
#line 1129 "glslang.y"
3025
 
    {
3026
 
        if (yyvsp[-1].interm.type.type == EbtVoid) {
3027
 
            parseContext.error(yyvsp[0].lex.line, "illegal use of type 'void'", yyvsp[0].lex.string->c_str(), "");
3028
 
            parseContext.recover();
3029
 
        }
3030
 
        if (parseContext.reservedErrorCheck(yyvsp[0].lex.line, *yyvsp[0].lex.string))
3031
 
            parseContext.recover();
3032
 
        TParameter param = {yyvsp[0].lex.string, new TType(yyvsp[-1].interm.type)};
3033
 
        yyval.interm.line = yyvsp[0].lex.line;
3034
 
        yyval.interm.param = param;
3035
 
    ;}
3036
 
    break;
3037
 
 
3038
 
  case 106:
3039
 
#line 1140 "glslang.y"
3040
 
    {
3041
 
        // Check that we can make an array out of this type
3042
 
        if (yyvsp[-4].interm.type.array) {
3043
 
            parseContext.error(yyvsp[-2].lex.line, "cannot declare arrays of this type", TType(yyvsp[-4].interm.type).getCompleteString().c_str(), "");
3044
 
            parseContext.recover();
3045
 
        }
3046
 
        if (parseContext.reservedErrorCheck(yyvsp[-3].lex.line, *yyvsp[-3].lex.string))
3047
 
            parseContext.recover();
3048
 
        yyvsp[-4].interm.type.array = true;
3049
 
        TType* type = new TType(yyvsp[-4].interm.type);        
3050
 
        if (yyvsp[-1].interm.intermTypedNode->getAsConstantUnion())
3051
 
            type->setArraySize(yyvsp[-1].interm.intermTypedNode->getAsConstantUnion()->getUnionArrayPointer()->iConst);
3052
 
        TParameter param = { yyvsp[-3].lex.string, type };
3053
 
        yyval.interm.line = yyvsp[-3].lex.line;
3054
 
        yyval.interm.param = param;
3055
 
    ;}
3056
 
    break;
3057
 
 
3058
 
  case 107:
3059
 
#line 1167 "glslang.y"
3060
 
    {
3061
 
        yyval.interm = yyvsp[0].interm;
3062
 
        if (parseContext.paramErrorCheck(yyvsp[0].interm.line, yyvsp[-2].interm.type.qualifier, yyvsp[-1].interm.qualifier, yyval.interm.param.type))
3063
 
            parseContext.recover();
3064
 
    ;}
3065
 
    break;
3066
 
 
3067
 
  case 108:
3068
 
#line 1172 "glslang.y"
3069
 
    {
3070
 
        yyval.interm = yyvsp[0].interm;
3071
 
        if (parseContext.parameterSamplerErrorCheck(yyvsp[0].interm.line, yyvsp[-1].interm.qualifier, *yyvsp[0].interm.param.type))
3072
 
            parseContext.recover();
3073
 
        if (parseContext.paramErrorCheck(yyvsp[0].interm.line, EvqTemporary, yyvsp[-1].interm.qualifier, yyval.interm.param.type))
3074
 
            parseContext.recover();
3075
 
    ;}
3076
 
    break;
3077
 
 
3078
 
  case 109:
3079
 
#line 1182 "glslang.y"
3080
 
    {
3081
 
        yyval.interm = yyvsp[0].interm;
3082
 
        if (parseContext.paramErrorCheck(yyvsp[0].interm.line, yyvsp[-2].interm.type.qualifier, yyvsp[-1].interm.qualifier, yyval.interm.param.type))
3083
 
            parseContext.recover();
3084
 
    ;}
3085
 
    break;
3086
 
 
3087
 
  case 110:
3088
 
#line 1187 "glslang.y"
3089
 
    {
3090
 
        yyval.interm = yyvsp[0].interm;
3091
 
        if (parseContext.parameterSamplerErrorCheck(yyvsp[0].interm.line, yyvsp[-1].interm.qualifier, *yyvsp[0].interm.param.type))
3092
 
            parseContext.recover();
3093
 
        if (parseContext.paramErrorCheck(yyvsp[0].interm.line, EvqTemporary, yyvsp[-1].interm.qualifier, yyval.interm.param.type))
3094
 
            parseContext.recover();
3095
 
    ;}
3096
 
    break;
3097
 
 
3098
 
  case 111:
3099
 
#line 1197 "glslang.y"
3100
 
    {
3101
 
        yyval.interm.qualifier = EvqIn;
3102
 
    ;}
3103
 
    break;
3104
 
 
3105
 
  case 112:
3106
 
#line 1200 "glslang.y"
3107
 
    {
3108
 
        yyval.interm.qualifier = EvqIn;
3109
 
    ;}
3110
 
    break;
3111
 
 
3112
 
  case 113:
3113
 
#line 1203 "glslang.y"
3114
 
    {
3115
 
        yyval.interm.qualifier = EvqOut;
3116
 
    ;}
3117
 
    break;
3118
 
 
3119
 
  case 114:
3120
 
#line 1206 "glslang.y"
3121
 
    {
3122
 
        yyval.interm.qualifier = EvqInOut;
3123
 
    ;}
3124
 
    break;
3125
 
 
3126
 
  case 115:
3127
 
#line 1212 "glslang.y"
3128
 
    {
3129
 
        TParameter param = { 0, new TType(yyvsp[0].interm.type) };
3130
 
        yyval.interm.param = param;
3131
 
        
3132
 
    ;}
3133
 
    break;
3134
 
 
3135
 
  case 116:
3136
 
#line 1217 "glslang.y"
3137
 
    {
3138
 
        // Check that we can make an array out of this type 
3139
 
        if (yyvsp[-3].interm.type.array) {
3140
 
            parseContext.error(yyvsp[-2].lex.line, "cannot declare arrays of this type", TType(yyvsp[-3].interm.type).getCompleteString().c_str(), "");
3141
 
            parseContext.recover();
3142
 
        }
3143
 
        yyvsp[-3].interm.type.array = true;
3144
 
        TType* type = new TType(yyvsp[-3].interm.type);       
3145
 
        if (yyvsp[-1].interm.intermTypedNode->getAsConstantUnion())
3146
 
            type->setArraySize(yyvsp[-1].interm.intermTypedNode->getAsConstantUnion()->getUnionArrayPointer()->iConst);
3147
 
 
3148
 
        TParameter param = { 0, type };
3149
 
        yyval.interm.line = yyvsp[-2].lex.line;
3150
 
        yyval.interm.param = param;
3151
 
    ;}
3152
 
    break;
3153
 
 
3154
 
  case 117:
3155
 
#line 1235 "glslang.y"
3156
 
    {
3157
 
        yyval.interm = yyvsp[0].interm;
3158
 
    ;}
3159
 
    break;
3160
 
 
3161
 
  case 118:
3162
 
#line 1238 "glslang.y"
3163
 
    {
3164
 
        yyval.interm = yyvsp[-2].interm;
3165
 
        if (parseContext.structQualifierErrorCheck(yyvsp[0].lex.line, yyvsp[-2].interm.type))
3166
 
            parseContext.recover();
3167
 
        
3168
 
        if (parseContext.nonInitErrorCheck(yyvsp[0].lex.line, *yyvsp[0].lex.string, yyval.interm.type))
3169
 
            parseContext.recover();
3170
 
    ;}
3171
 
    break;
3172
 
 
3173
 
  case 119:
3174
 
#line 1246 "glslang.y"
3175
 
    {
3176
 
        yyval.interm = yyvsp[-4].interm;
3177
 
        if (parseContext.structQualifierErrorCheck(yyvsp[-2].lex.line, yyvsp[-4].interm.type))
3178
 
            parseContext.recover();
3179
 
            
3180
 
        if (parseContext.arrayErrorCheck(yyvsp[-1].lex.line, *yyvsp[-2].lex.string, yyval.interm.type, 0))
3181
 
            parseContext.recover();
3182
 
    ;}
3183
 
    break;
3184
 
 
3185
 
  case 120:
3186
 
#line 1254 "glslang.y"
3187
 
    {
3188
 
        yyval.interm = yyvsp[-5].interm;
3189
 
        if (parseContext.structQualifierErrorCheck(yyvsp[-3].lex.line, yyvsp[-5].interm.type))
3190
 
            parseContext.recover();
3191
 
            
3192
 
        if (parseContext.arrayErrorCheck(yyvsp[-2].lex.line, *yyvsp[-3].lex.string, yyval.interm.type, yyvsp[-1].interm.intermTypedNode))
3193
 
            parseContext.recover();
3194
 
    ;}
3195
 
    break;
3196
 
 
3197
 
  case 121:
3198
 
#line 1262 "glslang.y"
3199
 
    {
3200
 
        yyval.interm = yyvsp[-4].interm;
3201
 
        if (parseContext.structQualifierErrorCheck(yyvsp[-2].lex.line, yyvsp[-4].interm.type))
3202
 
            parseContext.recover();
3203
 
        
3204
 
        TIntermNode* intermNode;
3205
 
        if (!parseContext.executeInitializer(yyvsp[-2].lex.line, *yyvsp[-2].lex.string, yyvsp[-4].interm.type, yyvsp[0].interm.intermTypedNode, intermNode)) {
3206
 
            //
3207
 
            // build the intermediate representation
3208
 
            //
3209
 
            if (intermNode)
3210
 
                yyval.interm.intermAggregate = parseContext.intermediate.growAggregate(yyvsp[-4].interm.intermNode, intermNode, yyvsp[-1].lex.line);
3211
 
            else
3212
 
                yyval.interm.intermAggregate = yyvsp[-4].interm.intermAggregate;
3213
 
        } else {
3214
 
            parseContext.recover();
3215
 
            yyval.interm.intermAggregate = 0;
3216
 
        }
3217
 
    ;}
3218
 
    break;
3219
 
 
3220
 
  case 122:
3221
 
#line 1284 "glslang.y"
3222
 
    {
3223
 
        yyval.interm.type = yyvsp[0].interm.type;
3224
 
        yyval.interm.intermAggregate = 0;
3225
 
    ;}
3226
 
    break;
3227
 
 
3228
 
  case 123:
3229
 
#line 1288 "glslang.y"
3230
 
    {
3231
 
        yyval.interm.intermAggregate = 0;
3232
 
        yyval.interm.type = yyvsp[-1].interm.type;
3233
 
        if (parseContext.structQualifierErrorCheck(yyvsp[0].lex.line, yyvsp[-1].interm.type))
3234
 
            parseContext.recover();
3235
 
        
3236
 
        if (parseContext.nonInitErrorCheck(yyvsp[0].lex.line, *yyvsp[0].lex.string, yyval.interm.type))
3237
 
            parseContext.recover();
3238
 
    ;}
3239
 
    break;
3240
 
 
3241
 
  case 124:
3242
 
#line 1297 "glslang.y"
3243
 
    {
3244
 
        yyval.interm.intermAggregate = 0;
3245
 
        yyval.interm.type = yyvsp[-3].interm.type;
3246
 
        if (parseContext.structQualifierErrorCheck(yyvsp[-2].lex.line, yyvsp[-3].interm.type))
3247
 
            parseContext.recover();
3248
 
        
3249
 
        if (parseContext.arrayErrorCheck(yyvsp[-1].lex.line, *yyvsp[-2].lex.string, yyval.interm.type, 0))
3250
 
            parseContext.recover();
3251
 
    ;}
3252
 
    break;
3253
 
 
3254
 
  case 125:
3255
 
#line 1306 "glslang.y"
3256
 
    {
3257
 
        yyval.interm.intermAggregate = 0;
3258
 
        yyval.interm.type = yyvsp[-4].interm.type;
3259
 
        if (parseContext.structQualifierErrorCheck(yyvsp[-3].lex.line, yyvsp[-4].interm.type))
3260
 
            parseContext.recover();
3261
 
        
3262
 
        if (parseContext.arrayErrorCheck(yyvsp[-2].lex.line, *yyvsp[-3].lex.string, yyval.interm.type, yyvsp[-1].interm.intermTypedNode))
3263
 
            parseContext.recover();
3264
 
    ;}
3265
 
    break;
3266
 
 
3267
 
  case 126:
3268
 
#line 1315 "glslang.y"
3269
 
    {
3270
 
        yyval.interm.type = yyvsp[-3].interm.type;
3271
 
        if (parseContext.structQualifierErrorCheck(yyvsp[-2].lex.line, yyvsp[-3].interm.type))
3272
 
            parseContext.recover();
3273
 
        
3274
 
        TIntermNode* intermNode;
3275
 
        if (!parseContext.executeInitializer(yyvsp[-2].lex.line, *yyvsp[-2].lex.string, yyvsp[-3].interm.type, yyvsp[0].interm.intermTypedNode, intermNode)) {
3276
 
            //
3277
 
            // Build intermediate representation
3278
 
            //
3279
 
            if (intermNode)
3280
 
                yyval.interm.intermAggregate = parseContext.intermediate.makeAggregate(intermNode, yyvsp[-1].lex.line);
3281
 
            else
3282
 
                yyval.interm.intermAggregate = 0;
3283
 
        } else {
3284
 
            parseContext.recover();
3285
 
            yyval.interm.intermAggregate = 0;
3286
 
        }
3287
 
    ;}
3288
 
    break;
3289
 
 
3290
 
  case 127:
3291
 
#line 1405 "glslang.y"
3292
 
    {
3293
 
        yyval.interm.type = yyvsp[0].interm.type;
3294
 
    ;}
3295
 
    break;
3296
 
 
3297
 
  case 128:
3298
 
#line 1408 "glslang.y"
3299
 
    { 
3300
 
        TPublicType t = { yyvsp[0].interm.type.type, yyvsp[-1].interm.type.qualifier, yyvsp[0].interm.type.size, yyvsp[0].interm.type.matrix, false, yyvsp[0].interm.type.userDef, 0 };
3301
 
        if (yyvsp[-1].interm.type.qualifier == EvqAttribute &&
3302
 
            (yyvsp[0].interm.type.type == EbtBool || yyvsp[0].interm.type.type == EbtInt)) {
3303
 
            parseContext.error(yyvsp[0].interm.type.line, "cannot be bool or int", getQualifierString(yyvsp[-1].interm.type.qualifier), "");
3304
 
            parseContext.recover();
3305
 
        }
3306
 
        if ((yyvsp[-1].interm.type.qualifier == EvqVaryingIn || yyvsp[-1].interm.type.qualifier == EvqVaryingOut) &&
3307
 
            (yyvsp[0].interm.type.type == EbtBool || yyvsp[0].interm.type.type == EbtInt)) {
3308
 
            parseContext.error(yyvsp[0].interm.type.line, "cannot be bool or int", getQualifierString(yyvsp[-1].interm.type.qualifier), "");
3309
 
            parseContext.recover();
3310
 
        }
3311
 
        yyval.interm.type = t;
3312
 
    ;}
3313
 
    break;
3314
 
 
3315
 
  case 129:
3316
 
#line 1425 "glslang.y"
3317
 
    { 
3318
 
        TPublicType t = { EbtVoid,  EvqConst,     1, false, false, 0 }; 
3319
 
        yyval.interm.type = t; 
3320
 
    ;}
3321
 
    break;
3322
 
 
3323
 
  case 130:
3324
 
#line 1429 "glslang.y"
3325
 
    { 
3326
 
        VERTEX_ONLY("attribute", yyvsp[0].lex.line);
3327
 
        if (parseContext.globalErrorCheck(yyvsp[0].lex.line, parseContext.symbolTable.atGlobalLevel(), "attribute"))
3328
 
            parseContext.recover();
3329
 
        TPublicType t = { EbtVoid,  EvqAttribute, 1, false, false, 0 }; 
3330
 
        yyval.interm.type = t; 
3331
 
    ;}
3332
 
    break;
3333
 
 
3334
 
  case 131:
3335
 
#line 1436 "glslang.y"
3336
 
    {
3337
 
        if (parseContext.globalErrorCheck(yyvsp[0].lex.line, parseContext.symbolTable.atGlobalLevel(), "varying"))
3338
 
            parseContext.recover();
3339
 
        TPublicType t = { EbtVoid,  EvqVaryingIn, 1, false, false, 0 };
3340
 
        if (parseContext.language == EShLangVertex)
3341
 
            t.qualifier = EvqVaryingOut;
3342
 
        yyval.interm.type = t; 
3343
 
    ;}
3344
 
    break;
3345
 
 
3346
 
  case 132:
3347
 
#line 1444 "glslang.y"
3348
 
    {
3349
 
        if (parseContext.globalErrorCheck(yyvsp[0].lex.line, parseContext.symbolTable.atGlobalLevel(), "uniform"))
3350
 
            parseContext.recover();
3351
 
        TPublicType t = { EbtVoid,  EvqUniform,   1, false, false, 0 }; 
3352
 
        yyval.interm.type = t;
3353
 
    ;}
3354
 
    break;
3355
 
 
3356
 
  case 133:
3357
 
#line 1453 "glslang.y"
3358
 
    {
3359
 
        TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3360
 
        TPublicType t = { EbtVoid, qual, 1, false, false, 0, yyvsp[0].lex.line }; 
3361
 
        yyval.interm.type = t; 
3362
 
    ;}
3363
 
    break;
3364
 
 
3365
 
  case 134:
3366
 
#line 1458 "glslang.y"
3367
 
    {
3368
 
        TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3369
 
        TPublicType t = { EbtFloat, qual, 1, false, false, 0, yyvsp[0].lex.line }; 
3370
 
        yyval.interm.type = t; 
3371
 
    ;}
3372
 
    break;
3373
 
 
3374
 
  case 135:
3375
 
#line 1463 "glslang.y"
3376
 
    {
3377
 
        TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3378
 
        TPublicType t = { EbtInt, qual, 1, false, false, 0, yyvsp[0].lex.line }; 
3379
 
        yyval.interm.type = t; 
3380
 
    ;}
3381
 
    break;
3382
 
 
3383
 
  case 136:
3384
 
#line 1468 "glslang.y"
3385
 
    {
3386
 
        TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3387
 
        TPublicType t = { EbtBool, qual, 1, false, false, 0, yyvsp[0].lex.line }; 
3388
 
        yyval.interm.type = t; 
3389
 
    ;}
3390
 
    break;
3391
 
 
3392
 
  case 137:
3393
 
#line 1479 "glslang.y"
3394
 
    {
3395
 
        TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3396
 
        TPublicType t = { EbtFloat, qual, 2, false, false, 0, yyvsp[0].lex.line }; 
3397
 
        yyval.interm.type = t; 
3398
 
    ;}
3399
 
    break;
3400
 
 
3401
 
  case 138:
3402
 
#line 1484 "glslang.y"
3403
 
    {
3404
 
        TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3405
 
        TPublicType t = { EbtFloat, qual, 3, false, false, 0, yyvsp[0].lex.line }; 
3406
 
        yyval.interm.type = t; 
3407
 
    ;}
3408
 
    break;
3409
 
 
3410
 
  case 139:
3411
 
#line 1489 "glslang.y"
3412
 
    {
3413
 
        TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3414
 
        TPublicType t = { EbtFloat, qual, 4, false, false, 0, yyvsp[0].lex.line }; 
3415
 
        yyval.interm.type = t; 
3416
 
    ;}
3417
 
    break;
3418
 
 
3419
 
  case 140:
3420
 
#line 1494 "glslang.y"
3421
 
    {
3422
 
        TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3423
 
        TPublicType t = { EbtBool, qual, 2, false, false, 0, yyvsp[0].lex.line }; 
3424
 
        yyval.interm.type = t; 
3425
 
    ;}
3426
 
    break;
3427
 
 
3428
 
  case 141:
3429
 
#line 1499 "glslang.y"
3430
 
    {
3431
 
        TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3432
 
        TPublicType t = { EbtBool, qual, 3, false, false, 0, yyvsp[0].lex.line }; 
3433
 
        yyval.interm.type = t; 
3434
 
    ;}
3435
 
    break;
3436
 
 
3437
 
  case 142:
3438
 
#line 1504 "glslang.y"
3439
 
    {
3440
 
        TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3441
 
        TPublicType t = { EbtBool, qual, 4, false, false, 0, yyvsp[0].lex.line }; 
3442
 
        yyval.interm.type = t; 
3443
 
    ;}
3444
 
    break;
3445
 
 
3446
 
  case 143:
3447
 
#line 1509 "glslang.y"
3448
 
    {
3449
 
        TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3450
 
        TPublicType t = { EbtInt, qual, 2, false, false, 0, yyvsp[0].lex.line }; 
3451
 
        yyval.interm.type = t; 
3452
 
    ;}
3453
 
    break;
3454
 
 
3455
 
  case 144:
3456
 
#line 1514 "glslang.y"
3457
 
    {
3458
 
        TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3459
 
        TPublicType t = { EbtInt, qual, 3, false, false, 0, yyvsp[0].lex.line }; 
3460
 
        yyval.interm.type = t; 
3461
 
    ;}
3462
 
    break;
3463
 
 
3464
 
  case 145:
3465
 
#line 1519 "glslang.y"
3466
 
    {
3467
 
        TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3468
 
        TPublicType t = { EbtInt, qual, 4, false, false, 0, yyvsp[0].lex.line }; 
3469
 
        yyval.interm.type = t; 
3470
 
    ;}
3471
 
    break;
3472
 
 
3473
 
  case 146:
3474
 
#line 1524 "glslang.y"
3475
 
    {
3476
 
        FRAG_VERT_ONLY("mat2", yyvsp[0].lex.line); 
3477
 
        TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3478
 
        TPublicType t = { EbtFloat, qual, 2, true, false, 0, yyvsp[0].lex.line }; 
3479
 
        yyval.interm.type = t; 
3480
 
    ;}
3481
 
    break;
3482
 
 
3483
 
  case 147:
3484
 
#line 1530 "glslang.y"
3485
 
    { 
3486
 
        FRAG_VERT_ONLY("mat3", yyvsp[0].lex.line); 
3487
 
        TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3488
 
        TPublicType t = { EbtFloat, qual, 3, true, false, 0, yyvsp[0].lex.line }; 
3489
 
        yyval.interm.type = t; 
3490
 
    ;}
3491
 
    break;
3492
 
 
3493
 
  case 148:
3494
 
#line 1536 "glslang.y"
3495
 
    { 
3496
 
        FRAG_VERT_ONLY("mat4", yyvsp[0].lex.line);
3497
 
        TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3498
 
        TPublicType t = { EbtFloat, qual, 4, true, false, 0, yyvsp[0].lex.line }; 
3499
 
        yyval.interm.type = t; 
3500
 
    ;}
3501
 
    break;
3502
 
 
3503
 
  case 149:
3504
 
#line 1542 "glslang.y"
3505
 
    {
3506
 
        FRAG_VERT_ONLY("sampler1D", yyvsp[0].lex.line);
3507
 
        TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3508
 
        TPublicType t = { EbtSampler1D, qual, 1, false, false, 0, yyvsp[0].lex.line }; 
3509
 
        yyval.interm.type = t;
3510
 
    ;}
3511
 
    break;
3512
 
 
3513
 
  case 150:
3514
 
#line 1548 "glslang.y"
3515
 
    {
3516
 
        FRAG_VERT_ONLY("sampler2D", yyvsp[0].lex.line);
3517
 
        TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3518
 
        TPublicType t = { EbtSampler2D, qual, 1, false, false, 0, yyvsp[0].lex.line }; 
3519
 
        yyval.interm.type = t;
3520
 
    ;}
3521
 
    break;
3522
 
 
3523
 
  case 151:
3524
 
#line 1554 "glslang.y"
3525
 
    {
3526
 
        FRAG_VERT_ONLY("sampler3D", yyvsp[0].lex.line);
3527
 
        TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3528
 
        TPublicType t = { EbtSampler3D, qual, 1, false, false, 0, yyvsp[0].lex.line }; 
3529
 
        yyval.interm.type = t;
3530
 
    ;}
3531
 
    break;
3532
 
 
3533
 
  case 152:
3534
 
#line 1560 "glslang.y"
3535
 
    {
3536
 
        FRAG_VERT_ONLY("samplerCube", yyvsp[0].lex.line);
3537
 
        TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3538
 
        TPublicType t = { EbtSamplerCube, qual, 1, false, false, 0, yyvsp[0].lex.line }; 
3539
 
        yyval.interm.type = t;
3540
 
    ;}
3541
 
    break;
3542
 
 
3543
 
  case 153:
3544
 
#line 1566 "glslang.y"
3545
 
    {
3546
 
        FRAG_VERT_ONLY("sampler1DShadow", yyvsp[0].lex.line);
3547
 
        TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3548
 
        TPublicType t = { EbtSampler1DShadow, qual, 1, false, false, 0, yyvsp[0].lex.line }; 
3549
 
        yyval.interm.type = t;
3550
 
    ;}
3551
 
    break;
3552
 
 
3553
 
  case 154:
3554
 
#line 1572 "glslang.y"
3555
 
    {
3556
 
        FRAG_VERT_ONLY("sampler2DShadow", yyvsp[0].lex.line);
3557
 
        TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3558
 
        TPublicType t = { EbtSampler2DShadow, qual, 1, false, false, 0, yyvsp[0].lex.line }; 
3559
 
        yyval.interm.type = t;
3560
 
    ;}
3561
 
    break;
3562
 
 
3563
 
  case 155:
3564
 
#line 1578 "glslang.y"
3565
 
    {
3566
 
        FRAG_VERT_ONLY("struct", yyvsp[0].interm.type.line);
3567
 
        yyval.interm.type = yyvsp[0].interm.type;
3568
 
        yyval.interm.type.qualifier = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3569
 
    ;}
3570
 
    break;
3571
 
 
3572
 
  case 156:
3573
 
#line 1583 "glslang.y"
3574
 
    {     
3575
 
        //
3576
 
        // This is for user defined type names.  The lexical phase looked up the 
3577
 
        // type.
3578
 
        //
3579
 
        TType& structure = static_cast<TVariable*>(yyvsp[0].lex.symbol)->getType();
3580
 
        TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3581
 
        TPublicType t = { EbtStruct, qual, 1, false, false, &structure, yyvsp[0].lex.line }; 
3582
 
        yyval.interm.type = t;
3583
 
    ;}
3584
 
    break;
3585
 
 
3586
 
  case 157:
3587
 
#line 1596 "glslang.y"
3588
 
    {
3589
 
        TType* structure = new TType(yyvsp[-1].interm.typeList, *yyvsp[-3].lex.string);
3590
 
        TVariable* userTypeDef = new TVariable(yyvsp[-3].lex.string, *structure, true);
3591
 
        if (! parseContext.symbolTable.insert(*userTypeDef)) {
3592
 
            parseContext.error(yyvsp[-3].lex.line, "redefinition", yyvsp[-3].lex.string->c_str(), "struct");
3593
 
            parseContext.recover();
3594
 
        }
3595
 
        TPublicType t = { EbtStruct, EvqTemporary, 1, false, false, structure, yyvsp[-4].lex.line };
3596
 
        yyval.interm.type = t;
3597
 
    ;}
3598
 
    break;
3599
 
 
3600
 
  case 158:
3601
 
#line 1606 "glslang.y"
3602
 
    {
3603
 
        TType* structure = new TType(yyvsp[-1].interm.typeList, TString(""));
3604
 
        TPublicType t = { EbtStruct, EvqTemporary, 1, false, false, structure, yyvsp[-3].lex.line };
3605
 
        yyval.interm.type = t;
3606
 
    ;}
3607
 
    break;
3608
 
 
3609
 
  case 159:
3610
 
#line 1614 "glslang.y"
3611
 
    {
3612
 
        yyval.interm.typeList = yyvsp[0].interm.typeList;
3613
 
    ;}
3614
 
    break;
3615
 
 
3616
 
  case 160:
3617
 
#line 1617 "glslang.y"
3618
 
    {
3619
 
        yyval.interm.typeList = yyvsp[-1].interm.typeList;
3620
 
        for (unsigned int i = 0; i < yyvsp[0].interm.typeList->size(); ++i) {
3621
 
            for (unsigned int j = 0; j < yyval.interm.typeList->size(); ++j) {
3622
 
                if ((*yyval.interm.typeList)[j].type->getFieldName() == (*yyvsp[0].interm.typeList)[i].type->getFieldName()) {
3623
 
                    parseContext.error((*yyvsp[0].interm.typeList)[i].line, "duplicate field name in structure:", "struct", (*yyvsp[0].interm.typeList)[i].type->getFieldName().c_str());
3624
 
                    parseContext.recover();
3625
 
                }
3626
 
            }
3627
 
            yyval.interm.typeList->push_back((*yyvsp[0].interm.typeList)[i]);
3628
 
        }
3629
 
    ;}
3630
 
    break;
3631
 
 
3632
 
  case 161:
3633
 
#line 1632 "glslang.y"
3634
 
    {
3635
 
        yyval.interm.typeList = yyvsp[-1].interm.typeList;
3636
 
        
3637
 
        if (parseContext.voidErrorCheck(yyvsp[-2].interm.type.line, (*yyvsp[-1].interm.typeList)[0].type->getFieldName(), yyvsp[-2].interm.type)) {
3638
 
            parseContext.recover();
3639
 
        }
3640
 
        for (unsigned int i = 0; i < yyval.interm.typeList->size(); ++i) {
3641
 
            //
3642
 
            // Careful not to replace already know aspects of type, like array-ness
3643
 
            //
3644
 
            (*yyval.interm.typeList)[i].type->setType(yyvsp[-2].interm.type.type, yyvsp[-2].interm.type.size, yyvsp[-2].interm.type.matrix, yyvsp[-2].interm.type.userDef);
3645
 
            if (yyvsp[-2].interm.type.userDef)
3646
 
                (*yyval.interm.typeList)[i].type->setTypeName(yyvsp[-2].interm.type.userDef->getTypeName());
3647
 
        }
3648
 
    ;}
3649
 
    break;
3650
 
 
3651
 
  case 162:
3652
 
#line 1650 "glslang.y"
3653
 
    {
3654
 
        yyval.interm.typeList = NewPoolTTypeList();
3655
 
        yyval.interm.typeList->push_back(yyvsp[0].interm.typeLine);
3656
 
    ;}
3657
 
    break;
3658
 
 
3659
 
  case 163:
3660
 
#line 1654 "glslang.y"
3661
 
    {
3662
 
        yyval.interm.typeList->push_back(yyvsp[0].interm.typeLine);
3663
 
    ;}
3664
 
    break;
3665
 
 
3666
 
  case 164:
3667
 
#line 1660 "glslang.y"
3668
 
    {
3669
 
        yyval.interm.typeLine.type = new TType(EbtVoid);
3670
 
        yyval.interm.typeLine.line = yyvsp[0].lex.line;
3671
 
        yyval.interm.typeLine.type->setFieldName(*yyvsp[0].lex.string);
3672
 
    ;}
3673
 
    break;
3674
 
 
3675
 
  case 165:
3676
 
#line 1665 "glslang.y"
3677
 
    {
3678
 
        yyval.interm.typeLine.type = new TType(EbtVoid);
3679
 
        yyval.interm.typeLine.line = yyvsp[-3].lex.line;
3680
 
        yyval.interm.typeLine.type->setFieldName(*yyvsp[-3].lex.string);
3681
 
        
3682
 
        if (yyvsp[-1].interm.intermTypedNode->getAsConstantUnion() == 0 || yyvsp[-1].interm.intermTypedNode->getAsConstantUnion()->getBasicType() != EbtInt ||
3683
 
            yyvsp[-1].interm.intermTypedNode->getAsConstantUnion()->getUnionArrayPointer()->iConst <= 0) {
3684
 
            parseContext.error(yyvsp[-2].lex.line, "structure field array size must be a positive integer", yyvsp[-3].lex.string->c_str(), "");
3685
 
            parseContext.recover();
3686
 
        } else {           
3687
 
            yyval.interm.typeLine.type->setArraySize(yyvsp[-1].interm.intermTypedNode->getAsConstantUnion()->getUnionArrayPointer()->iConst);
3688
 
        }
3689
 
    ;}
3690
 
    break;
3691
 
 
3692
 
  case 166:
3693
 
#line 1681 "glslang.y"
3694
 
    { yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ;}
3695
 
    break;
3696
 
 
3697
 
  case 167:
3698
 
#line 1685 "glslang.y"
3699
 
    { yyval.interm.intermNode = yyvsp[0].interm.intermNode; ;}
3700
 
    break;
3701
 
 
3702
 
  case 168:
3703
 
#line 1689 "glslang.y"
3704
 
    { yyval.interm.intermNode = yyvsp[0].interm.intermAggregate; ;}
3705
 
    break;
3706
 
 
3707
 
  case 169:
3708
 
#line 1690 "glslang.y"
3709
 
    { yyval.interm.intermNode = yyvsp[0].interm.intermNode; ;}
3710
 
    break;
3711
 
 
3712
 
  case 170:
3713
 
#line 1696 "glslang.y"
3714
 
    { yyval.interm.intermNode = yyvsp[0].interm.intermNode; ;}
3715
 
    break;
3716
 
 
3717
 
  case 171:
3718
 
#line 1697 "glslang.y"
3719
 
    { yyval.interm.intermNode = yyvsp[0].interm.intermNode; ;}
3720
 
    break;
3721
 
 
3722
 
  case 172:
3723
 
#line 1698 "glslang.y"
3724
 
    { yyval.interm.intermNode = yyvsp[0].interm.intermNode; ;}
3725
 
    break;
3726
 
 
3727
 
  case 173:
3728
 
#line 1699 "glslang.y"
3729
 
    { yyval.interm.intermNode = yyvsp[0].interm.intermNode; ;}
3730
 
    break;
3731
 
 
3732
 
  case 174:
3733
 
#line 1700 "glslang.y"
3734
 
    { yyval.interm.intermNode = yyvsp[0].interm.intermNode; ;}
3735
 
    break;
3736
 
 
3737
 
  case 175:
3738
 
#line 1704 "glslang.y"
3739
 
    { yyval.interm.intermAggregate = 0; ;}
3740
 
    break;
3741
 
 
3742
 
  case 176:
3743
 
#line 1705 "glslang.y"
3744
 
    { parseContext.symbolTable.push(); ;}
3745
 
    break;
3746
 
 
3747
 
  case 177:
3748
 
#line 1705 "glslang.y"
3749
 
    { parseContext.symbolTable.pop(); ;}
3750
 
    break;
3751
 
 
3752
 
  case 178:
3753
 
#line 1705 "glslang.y"
3754
 
    {
3755
 
        if (yyvsp[-2].interm.intermAggregate != 0)            
3756
 
            yyvsp[-2].interm.intermAggregate->setOperator(EOpSequence); 
3757
 
        yyval.interm.intermAggregate = yyvsp[-2].interm.intermAggregate;
3758
 
    ;}
3759
 
    break;
3760
 
 
3761
 
  case 179:
3762
 
#line 1713 "glslang.y"
3763
 
    { yyval.interm.intermNode = yyvsp[0].interm.intermNode; ;}
3764
 
    break;
3765
 
 
3766
 
  case 180:
3767
 
#line 1714 "glslang.y"
3768
 
    { yyval.interm.intermNode = yyvsp[0].interm.intermNode; ;}
3769
 
    break;
3770
 
 
3771
 
  case 181:
3772
 
#line 1719 "glslang.y"
3773
 
    { 
3774
 
        yyval.interm.intermNode = 0; 
3775
 
    ;}
3776
 
    break;
3777
 
 
3778
 
  case 182:
3779
 
#line 1722 "glslang.y"
3780
 
    { 
3781
 
        if (yyvsp[-1].interm.intermAggregate)
3782
 
            yyvsp[-1].interm.intermAggregate->setOperator(EOpSequence); 
3783
 
        yyval.interm.intermNode = yyvsp[-1].interm.intermAggregate; 
3784
 
    ;}
3785
 
    break;
3786
 
 
3787
 
  case 183:
3788
 
#line 1730 "glslang.y"
3789
 
    {
3790
 
        yyval.interm.intermAggregate = parseContext.intermediate.makeAggregate(yyvsp[0].interm.intermNode, 0); 
3791
 
    ;}
3792
 
    break;
3793
 
 
3794
 
  case 184:
3795
 
#line 1733 "glslang.y"
3796
 
    { 
3797
 
        yyval.interm.intermAggregate = parseContext.intermediate.growAggregate(yyvsp[-1].interm.intermAggregate, yyvsp[0].interm.intermNode, 0);
3798
 
    ;}
3799
 
    break;
3800
 
 
3801
 
  case 185:
3802
 
#line 1739 "glslang.y"
3803
 
    { yyval.interm.intermNode = 0; ;}
3804
 
    break;
3805
 
 
3806
 
  case 186:
3807
 
#line 1740 "glslang.y"
3808
 
    { yyval.interm.intermNode = static_cast<TIntermNode*>(yyvsp[-1].interm.intermTypedNode); ;}
3809
 
    break;
3810
 
 
3811
 
  case 187:
3812
 
#line 1744 "glslang.y"
3813
 
    { 
3814
 
        if (parseContext.boolErrorCheck(yyvsp[-4].lex.line, yyvsp[-2].interm.intermTypedNode))
3815
 
            parseContext.recover();
3816
 
        yyval.interm.intermNode = parseContext.intermediate.addSelection(yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.nodePair, yyvsp[-4].lex.line);
3817
 
    ;}
3818
 
    break;
3819
 
 
3820
 
  case 188:
3821
 
#line 1752 "glslang.y"
3822
 
    {
3823
 
        yyval.interm.nodePair.node1 = yyvsp[-2].interm.intermNode;
3824
 
        yyval.interm.nodePair.node2 = yyvsp[0].interm.intermNode;
3825
 
    ;}
3826
 
    break;
3827
 
 
3828
 
  case 189:
3829
 
#line 1756 "glslang.y"
3830
 
    { 
3831
 
        yyval.interm.nodePair.node1 = yyvsp[0].interm.intermNode;
3832
 
        yyval.interm.nodePair.node2 = 0;
3833
 
    ;}
3834
 
    break;
3835
 
 
3836
 
  case 190:
3837
 
#line 1766 "glslang.y"
3838
 
    {
3839
 
        yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode;
3840
 
        if (parseContext.boolErrorCheck(yyvsp[0].interm.intermTypedNode->getLine(), yyvsp[0].interm.intermTypedNode))
3841
 
            parseContext.recover();          
3842
 
    ;}
3843
 
    break;
3844
 
 
3845
 
  case 191:
3846
 
#line 1771 "glslang.y"
3847
 
    {
3848
 
        TIntermNode* intermNode;
3849
 
        if (parseContext.structQualifierErrorCheck(yyvsp[-2].lex.line, yyvsp[-3].interm.type))
3850
 
            parseContext.recover();
3851
 
        if (parseContext.boolErrorCheck(yyvsp[-2].lex.line, yyvsp[-3].interm.type))
3852
 
            parseContext.recover();
3853
 
        
3854
 
        if (!parseContext.executeInitializer(yyvsp[-2].lex.line, *yyvsp[-2].lex.string, yyvsp[-3].interm.type, yyvsp[0].interm.intermTypedNode, intermNode))
3855
 
            yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode;
3856
 
        else {
3857
 
            parseContext.recover();
3858
 
            yyval.interm.intermTypedNode = 0;
3859
 
        }
3860
 
    ;}
3861
 
    break;
3862
 
 
3863
 
  case 192:
3864
 
#line 1788 "glslang.y"
3865
 
    { parseContext.symbolTable.push(); ++parseContext.loopNestingLevel; ;}
3866
 
    break;
3867
 
 
3868
 
  case 193:
3869
 
#line 1788 "glslang.y"
3870
 
    { 
3871
 
        parseContext.symbolTable.pop();
3872
 
        yyval.interm.intermNode = parseContext.intermediate.addLoop(yyvsp[0].interm.intermNode, yyvsp[-2].interm.intermTypedNode, 0, true, yyvsp[-5].lex.line);
3873
 
        --parseContext.loopNestingLevel;
3874
 
    ;}
3875
 
    break;
3876
 
 
3877
 
  case 194:
3878
 
#line 1793 "glslang.y"
3879
 
    { ++parseContext.loopNestingLevel; ;}
3880
 
    break;
3881
 
 
3882
 
  case 195:
3883
 
#line 1793 "glslang.y"
3884
 
    {
3885
 
        if (parseContext.boolErrorCheck(yyvsp[0].lex.line, yyvsp[-2].interm.intermTypedNode))
3886
 
            parseContext.recover();
3887
 
                    
3888
 
        yyval.interm.intermNode = parseContext.intermediate.addLoop(yyvsp[-5].interm.intermNode, yyvsp[-2].interm.intermTypedNode, 0, false, yyvsp[-4].lex.line);
3889
 
        --parseContext.loopNestingLevel;
3890
 
    ;}
3891
 
    break;
3892
 
 
3893
 
  case 196:
3894
 
#line 1800 "glslang.y"
3895
 
    { parseContext.symbolTable.push(); ++parseContext.loopNestingLevel; ;}
3896
 
    break;
3897
 
 
3898
 
  case 197:
3899
 
#line 1800 "glslang.y"
3900
 
    {
3901
 
        parseContext.symbolTable.pop();
3902
 
        yyval.interm.intermNode = parseContext.intermediate.makeAggregate(yyvsp[-3].interm.intermNode, yyvsp[-5].lex.line);
3903
 
        yyval.interm.intermNode = parseContext.intermediate.growAggregate(
3904
 
                yyval.interm.intermNode,
3905
 
                parseContext.intermediate.addLoop(yyvsp[0].interm.intermNode, reinterpret_cast<TIntermTyped*>(yyvsp[-2].interm.nodePair.node1), reinterpret_cast<TIntermTyped*>(yyvsp[-2].interm.nodePair.node2), true, yyvsp[-6].lex.line),
3906
 
                yyvsp[-6].lex.line);
3907
 
        yyval.interm.intermNode->getAsAggregate()->setOperator(EOpSequence);
3908
 
        --parseContext.loopNestingLevel;
3909
 
    ;}
3910
 
    break;
3911
 
 
3912
 
  case 198:
3913
 
#line 1813 "glslang.y"
3914
 
    {
3915
 
        yyval.interm.intermNode = yyvsp[0].interm.intermNode; 
3916
 
    ;}
3917
 
    break;
3918
 
 
3919
 
  case 199:
3920
 
#line 1816 "glslang.y"
3921
 
    {
3922
 
        yyval.interm.intermNode = yyvsp[0].interm.intermNode;
3923
 
    ;}
3924
 
    break;
3925
 
 
3926
 
  case 200:
3927
 
#line 1822 "glslang.y"
3928
 
    { 
3929
 
        yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; 
3930
 
    ;}
3931
 
    break;
3932
 
 
3933
 
  case 201:
3934
 
#line 1825 "glslang.y"
3935
 
    { 
3936
 
        yyval.interm.intermTypedNode = 0; 
3937
 
    ;}
3938
 
    break;
3939
 
 
3940
 
  case 202:
3941
 
#line 1831 "glslang.y"
3942
 
    { 
3943
 
        yyval.interm.nodePair.node1 = yyvsp[-1].interm.intermTypedNode;
3944
 
        yyval.interm.nodePair.node2 = 0;
3945
 
    ;}
3946
 
    break;
3947
 
 
3948
 
  case 203:
3949
 
#line 1835 "glslang.y"
3950
 
    {
3951
 
        yyval.interm.nodePair.node1 = yyvsp[-2].interm.intermTypedNode;
3952
 
        yyval.interm.nodePair.node2 = yyvsp[0].interm.intermTypedNode;
3953
 
    ;}
3954
 
    break;
3955
 
 
3956
 
  case 204:
3957
 
#line 1842 "glslang.y"
3958
 
    {
3959
 
        if (parseContext.loopNestingLevel <= 0) {
3960
 
            parseContext.error(yyvsp[-1].lex.line, "continue statement only allowed in loops", "", "");
3961
 
            parseContext.recover();
3962
 
        }        
3963
 
        yyval.interm.intermNode = parseContext.intermediate.addBranch(EOpContinue, yyvsp[-1].lex.line);
3964
 
    ;}
3965
 
    break;
3966
 
 
3967
 
  case 205:
3968
 
#line 1849 "glslang.y"
3969
 
    {
3970
 
        if (parseContext.loopNestingLevel <= 0) {
3971
 
            parseContext.error(yyvsp[-1].lex.line, "break statement only allowed in loops", "", "");
3972
 
            parseContext.recover();
3973
 
        }        
3974
 
        yyval.interm.intermNode = parseContext.intermediate.addBranch(EOpBreak, yyvsp[-1].lex.line);
3975
 
    ;}
3976
 
    break;
3977
 
 
3978
 
  case 206:
3979
 
#line 1856 "glslang.y"
3980
 
    {
3981
 
        yyval.interm.intermNode = parseContext.intermediate.addBranch(EOpReturn, yyvsp[-1].lex.line);
3982
 
        if (parseContext.currentFunctionType->getBasicType() != EbtVoid) {
3983
 
            parseContext.error(yyvsp[-1].lex.line, "non-void function must return a value", "return", "");
3984
 
            parseContext.recover();
3985
 
        }
3986
 
    ;}
3987
 
    break;
3988
 
 
3989
 
  case 207:
3990
 
#line 1863 "glslang.y"
3991
 
    {        
3992
 
        yyval.interm.intermNode = parseContext.intermediate.addBranch(EOpReturn, yyvsp[-1].interm.intermTypedNode, yyvsp[-2].lex.line);
3993
 
        parseContext.functionReturnsValue = true;
3994
 
        if (parseContext.currentFunctionType->getBasicType() == EbtVoid) {
3995
 
            parseContext.error(yyvsp[-2].lex.line, "void function cannot return a value", "return", "");
3996
 
            parseContext.recover();
3997
 
        } else if (*(parseContext.currentFunctionType) != yyvsp[-1].interm.intermTypedNode->getType()) {
3998
 
            parseContext.error(yyvsp[-2].lex.line, "function return is not matching type:", "return", "");
3999
 
            parseContext.recover();
4000
 
        }
4001
 
    ;}
4002
 
    break;
4003
 
 
4004
 
  case 208:
4005
 
#line 1874 "glslang.y"
4006
 
    {
4007
 
        FRAG_ONLY("discard", yyvsp[-1].lex.line);
4008
 
        yyval.interm.intermNode = parseContext.intermediate.addBranch(EOpKill, yyvsp[-1].lex.line);
4009
 
    ;}
4010
 
    break;
4011
 
 
4012
 
  case 209:
4013
 
#line 1883 "glslang.y"
4014
 
    { 
4015
 
        yyval.interm.intermNode = yyvsp[0].interm.intermNode; 
4016
 
        parseContext.treeRoot = yyval.interm.intermNode; 
4017
 
    ;}
4018
 
    break;
4019
 
 
4020
 
  case 210:
4021
 
#line 1887 "glslang.y"
4022
 
    {
4023
 
        yyval.interm.intermNode = parseContext.intermediate.growAggregate(yyvsp[-1].interm.intermNode, yyvsp[0].interm.intermNode, 0);
4024
 
        parseContext.treeRoot = yyval.interm.intermNode;
4025
 
    ;}
4026
 
    break;
4027
 
 
4028
 
  case 211:
4029
 
#line 1894 "glslang.y"
4030
 
    { 
4031
 
        yyval.interm.intermNode = yyvsp[0].interm.intermNode; 
4032
 
    ;}
4033
 
    break;
4034
 
 
4035
 
  case 212:
4036
 
#line 1897 "glslang.y"
4037
 
    { 
4038
 
        yyval.interm.intermNode = yyvsp[0].interm.intermNode; 
4039
 
    ;}
4040
 
    break;
4041
 
 
4042
 
  case 213:
4043
 
#line 1903 "glslang.y"
4044
 
    {
4045
 
        TFunction& function = *(yyvsp[0].interm.function);
4046
 
        TFunction* prevDec = static_cast<TFunction*>(parseContext.symbolTable.find(function.getMangledName()));
4047
 
        //
4048
 
        // Note:  'prevDec' could be 'function' if this is the first time we've seen function
4049
 
        // as it would have just been put in the symbol table.  Otherwise, we're looking up
4050
 
        // an earlier occurance.
4051
 
        //
4052
 
        if (prevDec->isDefined()) {
4053
 
            //
4054
 
            // Then this function already has a body.
4055
 
            //
4056
 
            parseContext.error(yyvsp[0].interm.line, "function already has a body", function.getName().c_str(), "");
4057
 
            parseContext.recover();
4058
 
        }
4059
 
        prevDec->setDefined();
4060
 
        
4061
 
        //
4062
 
        // Raise error message if main function takes any parameters or return anything other than void
4063
 
        //
4064
 
        if (function.getName() == "main") {
4065
 
            if (function.getParamCount() > 0) {
4066
 
                parseContext.error(yyvsp[0].interm.line, "function cannot take any parameter(s)", function.getName().c_str(), "");
4067
 
                parseContext.recover();
4068
 
            }
4069
 
            if (function.getReturnType().getBasicType() != EbtVoid) {
4070
 
                parseContext.error(yyvsp[0].interm.line, "", function.getReturnType().getBasicString(), "main function cannot return a value" );
4071
 
                parseContext.recover();
4072
 
            }            
4073
 
        }
4074
 
   
4075
 
        //
4076
 
        // New symbol table scope for body of function plus its arguments
4077
 
        //
4078
 
        parseContext.symbolTable.push();
4079
 
        
4080
 
        //
4081
 
        // Remember the return type for later checking for RETURN statements.
4082
 
        //
4083
 
        parseContext.currentFunctionType = &(prevDec->getReturnType());
4084
 
        parseContext.functionReturnsValue = false;
4085
 
        
4086
 
        // 
4087
 
        // Insert parameters into the symbol table.
4088
 
        // If the parameter has no name, it's not an error, just don't insert it 
4089
 
        // (could be used for unused args).
4090
 
        //
4091
 
        // Also, accumulate the list of parameters into the HIL, so lower level code
4092
 
        // knows where to find parameters.
4093
 
        //
4094
 
        TIntermAggregate* paramNodes = new TIntermAggregate;
4095
 
        for (int i = 0; i < function.getParamCount(); i++) {
4096
 
            TParameter& param = function[i];
4097
 
            if (param.name != 0) {
4098
 
                TVariable *variable = new TVariable(param.name, *param.type);
4099
 
                // 
4100
 
                // Insert the parameters with name in the symbol table.
4101
 
                //
4102
 
                if (! parseContext.symbolTable.insert(*variable)) {
4103
 
                    parseContext.error(yyvsp[0].interm.line, "redefinition", variable->getName().c_str(), "");
4104
 
                    parseContext.recover();
4105
 
                    delete variable;
4106
 
                }
4107
 
                //
4108
 
                // Transfer ownership of name pointer to symbol table.
4109
 
                //
4110
 
                param.name = 0;
4111
 
                
4112
 
                //
4113
 
                // Add the parameter to the HIL
4114
 
                //                
4115
 
                paramNodes = parseContext.intermediate.growAggregate(
4116
 
                                               paramNodes, 
4117
 
                                               parseContext.intermediate.addSymbol(variable->getUniqueId(),
4118
 
                                                                       variable->getName(),
4119
 
                                                                       variable->getType(), yyvsp[0].interm.line), 
4120
 
                                               yyvsp[0].interm.line);
4121
 
            } else {
4122
 
                paramNodes = parseContext.intermediate.growAggregate(paramNodes, parseContext.intermediate.addSymbol(0, "", *param.type, yyvsp[0].interm.line), yyvsp[0].interm.line);
4123
 
            }
4124
 
        }
4125
 
        parseContext.intermediate.setAggregateOperator(paramNodes, EOpParameters, yyvsp[0].interm.line);
4126
 
        yyvsp[0].interm.intermAggregate = paramNodes;
4127
 
        parseContext.loopNestingLevel = 0;
4128
 
    ;}
4129
 
    break;
4130
 
 
4131
 
  case 214:
4132
 
#line 1988 "glslang.y"
4133
 
    {
4134
 
        //?? Check that all paths return a value if return type != void ?
4135
 
        //   May be best done as post process phase on intermediate code
4136
 
        if (parseContext.currentFunctionType->getBasicType() != EbtVoid && ! parseContext.functionReturnsValue) {
4137
 
            parseContext.error(yyvsp[-2].interm.line, "function does not return a value:", "", yyvsp[-2].interm.function->getName().c_str());
4138
 
            parseContext.recover();
4139
 
        }
4140
 
        parseContext.symbolTable.pop();
4141
 
        yyval.interm.intermNode = parseContext.intermediate.growAggregate(yyvsp[-2].interm.intermAggregate, yyvsp[0].interm.intermNode, 0);
4142
 
        parseContext.intermediate.setAggregateOperator(yyval.interm.intermNode, EOpFunction, yyvsp[-2].interm.line);
4143
 
        yyval.interm.intermNode->getAsAggregate()->setName(yyvsp[-2].interm.function->getMangledName().c_str());
4144
 
        yyval.interm.intermNode->getAsAggregate()->setType(yyvsp[-2].interm.function->getReturnType());
4145
 
        
4146
 
        // store the pragma information for debug and optimize and other vendor specific 
4147
 
        // information. This information can be queried from the parse tree
4148
 
        yyval.interm.intermNode->getAsAggregate()->setOptimize(parseContext.contextPragma.optimize);
4149
 
        yyval.interm.intermNode->getAsAggregate()->setDebug(parseContext.contextPragma.debug);
4150
 
        yyval.interm.intermNode->getAsAggregate()->addToPragmaTable(parseContext.contextPragma.pragmaTable);
4151
 
    ;}
4152
 
    break;
4153
 
 
4154
 
 
4155
 
    }
4156
 
 
4157
 
/* Line 999 of yacc.c.  */
4158
 
#line 4158 "glslang.tab.c"
4159
 
 
4160
 
  yyvsp -= yylen;
4161
 
  yyssp -= yylen;
4162
 
 
4163
 
 
4164
 
  YY_STACK_PRINT (yyss, yyssp);
4165
 
 
4166
 
  *++yyvsp = yyval;
4167
 
 
4168
 
 
4169
 
  /* Now `shift' the result of the reduction.  Determine what state
4170
 
     that goes to, based on the state we popped back to and the rule
4171
 
     number reduced by.  */
4172
 
 
4173
 
  yyn = yyr1[yyn];
4174
 
 
4175
 
  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4176
 
  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
4177
 
    yystate = yytable[yystate];
4178
 
  else
4179
 
    yystate = yydefgoto[yyn - YYNTOKENS];
4180
 
 
4181
 
  goto yynewstate;
4182
 
 
4183
 
 
4184
 
/*------------------------------------.
4185
 
| yyerrlab -- here on detecting error |
4186
 
`------------------------------------*/
4187
 
yyerrlab:
4188
 
  /* If not already recovering from an error, report this error.  */
4189
 
  if (!yyerrstatus)
4190
 
    {
4191
 
      ++yynerrs;
4192
 
#if YYERROR_VERBOSE
4193
 
      yyn = yypact[yystate];
4194
 
 
4195
 
      if (YYPACT_NINF < yyn && yyn < YYLAST)
4196
 
        {
4197
 
          YYSIZE_T yysize = 0;
4198
 
          int yytype = YYTRANSLATE (yychar);
4199
 
          char *yymsg;
4200
 
          int yyx, yycount;
4201
 
 
4202
 
          yycount = 0;
4203
 
          /* Start YYX at -YYN if negative to avoid negative indexes in
4204
 
             YYCHECK.  */
4205
 
          for (yyx = yyn < 0 ? -yyn : 0;
4206
 
               yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
4207
 
            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
4208
 
              yysize += yystrlen (yytname[yyx]) + 15, yycount++;
4209
 
          yysize += yystrlen ("syntax error, unexpected ") + 1;
4210
 
          yysize += yystrlen (yytname[yytype]);
4211
 
          yymsg = (char *) YYSTACK_ALLOC (yysize);
4212
 
          if (yymsg != 0)
4213
 
            {
4214
 
              char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
4215
 
              yyp = yystpcpy (yyp, yytname[yytype]);
4216
 
 
4217
 
              if (yycount < 5)
4218
 
                {
4219
 
                  yycount = 0;
4220
 
                  for (yyx = yyn < 0 ? -yyn : 0;
4221
 
                       yyx < (int) (sizeof (yytname) / sizeof (char *));
4222
 
                       yyx++)
4223
 
                    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
4224
 
                      {
4225
 
                        const char *yyq = ! yycount ? ", expecting " : " or ";
4226
 
                        yyp = yystpcpy (yyp, yyq);
4227
 
                        yyp = yystpcpy (yyp, yytname[yyx]);
4228
 
                        yycount++;
4229
 
                      }
4230
 
                }
4231
 
              yyerror (yymsg);
4232
 
              YYSTACK_FREE (yymsg);
4233
 
            }
4234
 
          else
4235
 
            yyerror ("syntax error; also virtual memory exhausted");
4236
 
        }
4237
 
      else
4238
 
#endif /* YYERROR_VERBOSE */
4239
 
        yyerror ("syntax error");
4240
 
    }
4241
 
 
4242
 
 
4243
 
 
4244
 
  if (yyerrstatus == 3)
4245
 
    {
4246
 
      /* If just tried and failed to reuse lookahead token after an
4247
 
         error, discard it.  */
4248
 
 
4249
 
      /* Return failure if at end of input.  */
4250
 
      if (yychar == YYEOF)
4251
 
        {
4252
 
          /* Pop the error token.  */
4253
 
          YYPOPSTACK;
4254
 
          /* Pop the rest of the stack.  */
4255
 
          while (yyss < yyssp)
4256
 
            {
4257
 
              YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
4258
 
              yydestruct (yystos[*yyssp], yyvsp);
4259
 
              YYPOPSTACK;
4260
 
            }
4261
 
          YYABORT;
4262
 
        }
4263
 
 
4264
 
      YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
4265
 
      yydestruct (yytoken, &yylval);
4266
 
      yychar = YYEMPTY;
4267
 
 
4268
 
    }
4269
 
 
4270
 
  /* Else will try to reuse lookahead token after shifting the error
4271
 
     token.  */
4272
 
  goto yyerrlab1;
4273
 
 
4274
 
 
4275
 
/*----------------------------------------------------.
4276
 
| yyerrlab1 -- error raised explicitly by an action.  |
4277
 
`----------------------------------------------------*/
4278
 
yyerrlab1:
4279
 
  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
4280
 
 
4281
 
  for (;;)
4282
 
    {
4283
 
      yyn = yypact[yystate];
4284
 
      if (yyn != YYPACT_NINF)
4285
 
        {
4286
 
          yyn += YYTERROR;
4287
 
          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4288
 
            {
4289
 
              yyn = yytable[yyn];
4290
 
              if (0 < yyn)
4291
 
                break;
4292
 
            }
4293
 
        }
4294
 
 
4295
 
      /* Pop the current state because it cannot handle the error token.  */
4296
 
      if (yyssp == yyss)
4297
 
        YYABORT;
4298
 
 
4299
 
      YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
4300
 
      yydestruct (yystos[yystate], yyvsp);
4301
 
      yyvsp--;
4302
 
      yystate = *--yyssp;
4303
 
 
4304
 
      YY_STACK_PRINT (yyss, yyssp);
4305
 
    }
4306
 
 
4307
 
  if (yyn == YYFINAL)
4308
 
    YYACCEPT;
4309
 
 
4310
 
  YYDPRINTF ((stderr, "Shifting error token, "));
4311
 
 
4312
 
  *++yyvsp = yylval;
4313
 
 
4314
 
 
4315
 
  yystate = yyn;
4316
 
  goto yynewstate;
4317
 
 
4318
 
 
4319
 
/*-------------------------------------.
4320
 
| yyacceptlab -- YYACCEPT comes here.  |
4321
 
`-------------------------------------*/
4322
 
yyacceptlab:
4323
 
  yyresult = 0;
4324
 
  goto yyreturn;
4325
 
 
4326
 
/*-----------------------------------.
4327
 
| yyabortlab -- YYABORT comes here.  |
4328
 
`-----------------------------------*/
4329
 
yyabortlab:
4330
 
  yyresult = 1;
4331
 
  goto yyreturn;
4332
 
 
4333
 
#ifndef yyoverflow
4334
 
/*----------------------------------------------.
4335
 
| yyoverflowlab -- parser overflow comes here.  |
4336
 
`----------------------------------------------*/
4337
 
yyoverflowlab:
4338
 
  yyerror ("parser stack overflow");
4339
 
  yyresult = 2;
4340
 
  /* Fall through.  */
4341
 
#endif
4342
 
 
4343
 
yyreturn:
4344
 
#ifndef yyoverflow
4345
 
  if (yyss != yyssa)
4346
 
    YYSTACK_FREE (yyss);
4347
 
#endif
4348
 
  return yyresult;
4349
 
}
4350
 
 
4351
 
 
4352
 
#line 209 "glslang.y"
4353
 
 
4354