1
#line 2 "Gen_glslang.cpp"
2
/* A lexical scanner generated by flex */
4
/* Scanner skeleton version:
5
* $Header: /cvs/mesa/Mesa/src/mesa/shader/slang/MachineIndependent/Gen_glslang.cpp,v 1.3 2005-03-18 14:30:27 michal Exp $
9
#define YY_FLEX_MAJOR_VERSION 2
10
#define YY_FLEX_MINOR_VERSION 5
16
/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
28
/* Use prototypes in function declarations. */
31
/* The "const" storage-class-modifier is valid. */
34
#else /* ! __cplusplus */
42
#endif /* ! __cplusplus */
61
#define YY_PROTO(proto) proto
63
#define YY_PROTO(proto) ()
66
/* Returned upon end-of-file. */
69
/* Promotes a possibly negative, possibly signed char to an unsigned
70
* integer for use as an array index. If the signed char is negative,
71
* we want to instead treat it as an 8-bit unsigned char, hence the
74
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
76
/* Enter a start condition. This macro really ought to take a parameter,
77
* but we do it the disgusting crufty way forced on us by the ()-less
78
* definition of BEGIN.
80
#define BEGIN yy_start = 1 + 2 *
82
/* Translate the current start state into a value that can be later handed
83
* to BEGIN to return to the state. The YYSTATE alias is for lex
86
#define YY_START ((yy_start - 1) / 2)
87
#define YYSTATE YY_START
89
/* Action number for EOF rule of a given start state. */
90
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
92
/* Special action meaning "start processing a new file". */
93
#define YY_NEW_FILE yyrestart( yyin )
95
#define YY_END_OF_BUFFER_CHAR 0
97
/* Size of default input buffer. */
98
#define YY_BUF_SIZE 16384
100
typedef struct yy_buffer_state *YY_BUFFER_STATE;
103
extern FILE *yyin, *yyout;
105
#define EOB_ACT_CONTINUE_SCAN 0
106
#define EOB_ACT_END_OF_FILE 1
107
#define EOB_ACT_LAST_MATCH 2
109
/* The funky do-while in the following #define is used to turn the definition
110
* int a single C statement (which needs a semi-colon terminator). This
111
* avoids problems with code like:
113
* if ( condition_holds )
116
* do_something_else();
118
* Prior to using the do-while the compiler would get upset at the
119
* "else" because it interpreted the "if" statement as being all
120
* done when it reached the ';' after the yyless() call.
123
/* Return all but the first 'n' matched characters back to the input stream. */
128
/* Undo effects of setting up yytext. */ \
129
*yy_cp = yy_hold_char; \
130
YY_RESTORE_YY_MORE_OFFSET \
131
yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
132
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
136
#define unput(c) yyunput( c, yytext_ptr )
138
/* The following is because we cannot portably get our hands on size_t
139
* (without autoconf's help, which isn't available because we want
140
* flex-generated scanners to compile on their own).
142
typedef unsigned int yy_size_t;
145
struct yy_buffer_state
149
char *yy_ch_buf; /* input buffer */
150
char *yy_buf_pos; /* current position in input buffer */
152
/* Size of input buffer in bytes, not including room for EOB
155
yy_size_t yy_buf_size;
157
/* Number of characters read into yy_ch_buf, not including EOB
162
/* Whether we "own" the buffer - i.e., we know we created it,
163
* and can realloc() it to grow it, and should free() it to
166
int yy_is_our_buffer;
168
/* Whether this is an "interactive" input source; if so, and
169
* if we're using stdio for input, then we want to use getc()
170
* instead of fread(), to make sure we stop fetching input after
173
int yy_is_interactive;
175
/* Whether we're considered to be at the beginning of a line.
176
* If so, '^' rules will be active on the next match, otherwise
181
/* Whether to try to fill the input buffer when we reach the
186
int yy_buffer_status;
187
#define YY_BUFFER_NEW 0
188
#define YY_BUFFER_NORMAL 1
189
/* When an EOF's been seen but there's still some text to process
190
* then we mark the buffer as YY_EOF_PENDING, to indicate that we
191
* shouldn't try reading from the input source any more. We might
192
* still have a bunch of tokens to match, though, because of
193
* possible backing-up.
195
* When we actually see the EOF, we change the status to "new"
196
* (via yyrestart()), so that the user can continue scanning by
197
* just pointing yyin at a new input file.
199
#define YY_BUFFER_EOF_PENDING 2
202
static YY_BUFFER_STATE yy_current_buffer = 0;
204
/* We provide macros for accessing buffer states in case in the
205
* future we want to put the buffer states in a more general
208
#define YY_CURRENT_BUFFER yy_current_buffer
211
/* yy_hold_char holds the character lost when yytext is formed. */
212
static char yy_hold_char;
214
static int yy_n_chars; /* number of characters read into yy_ch_buf */
219
/* Points to current character in buffer. */
220
static char *yy_c_buf_p = (char *) 0;
221
static int yy_init = 1; /* whether we need to initialize */
222
static int yy_start = 0; /* start state number */
224
/* Flag which is used to allow yywrap()'s to do buffer switches
225
* instead of setting up a fresh yyin. A bit of a hack ...
227
static int yy_did_buffer_switch_on_eof;
229
void yyrestart YY_PROTO(( FILE *input_file ));
231
void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
232
void yy_load_buffer_state YY_PROTO(( void ));
233
YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
234
void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
235
void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
236
void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
237
#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
239
YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
240
YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
241
YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
243
static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
244
static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
245
static void yy_flex_free YY_PROTO(( void * ));
247
#define yy_new_buffer yy_create_buffer
249
#define yy_set_interactive(is_interactive) \
251
if ( ! yy_current_buffer ) \
252
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
253
yy_current_buffer->yy_is_interactive = is_interactive; \
256
#define yy_set_bol(at_bol) \
258
if ( ! yy_current_buffer ) \
259
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
260
yy_current_buffer->yy_at_bol = at_bol; \
263
#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
267
#define YY_SKIP_YYWRAP
268
typedef unsigned char YY_CHAR;
269
FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
270
typedef int yy_state_type;
272
#define yytext_ptr yytext
274
static yy_state_type yy_get_previous_state YY_PROTO(( void ));
275
static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
276
static int yy_get_next_buffer YY_PROTO(( void ));
277
static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
279
/* Done after the current pattern has been matched and before the
280
* corresponding action - sets up yytext.
282
#define YY_DO_BEFORE_ACTION \
283
yytext_ptr = yy_bp; \
284
yyleng = (int) (yy_cp - yy_bp); \
285
yy_hold_char = *yy_cp; \
289
#define YY_NUM_RULES 144
290
#define YY_END_OF_BUFFER 145
291
static yyconst short int yy_accept[428] =
293
0, 0, 0, 0, 145, 143, 142, 142, 127, 133,
294
138, 122, 123, 131, 130, 119, 128, 126, 132, 143,
295
143, 120, 116, 134, 121, 135, 139, 143, 124, 125,
296
137, 143, 143, 143, 143, 143, 143, 143, 143, 143,
297
143, 143, 143, 143, 143, 143, 143, 143, 143, 143,
298
143, 117, 136, 118, 129, 141, 144, 143, 143, 113,
299
99, 118, 107, 102, 97, 105, 95, 106, 96, 0,
300
94, 0, 98, 90, 0, 0, 0, 125, 117, 124,
301
114, 110, 112, 111, 115, 86, 103, 109, 0, 0,
302
0, 0, 0, 0, 0, 0, 0, 0, 8, 0,
304
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
305
0, 11, 13, 0, 0, 0, 0, 0, 0, 0,
306
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
307
0, 0, 0, 0, 0, 0, 0, 104, 108, 140,
308
93, 0, 1, 92, 0, 0, 88, 89, 0, 100,
309
101, 0, 0, 43, 0, 0, 0, 0, 0, 0,
310
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
311
0, 9, 0, 0, 0, 0, 0, 0, 0, 17,
312
0, 0, 0, 0, 0, 14, 0, 0, 0, 0,
313
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
315
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
316
0, 0, 0, 0, 87, 86, 0, 19, 0, 0,
317
83, 0, 0, 0, 0, 0, 0, 0, 12, 46,
318
0, 0, 0, 0, 0, 51, 65, 0, 0, 0,
319
0, 0, 0, 62, 24, 25, 26, 0, 0, 0,
320
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
321
49, 20, 0, 0, 0, 0, 0, 0, 27, 28,
322
29, 18, 0, 0, 140, 0, 0, 92, 0, 0,
323
0, 0, 6, 33, 34, 35, 44, 3, 0, 0,
324
0, 0, 76, 77, 78, 0, 21, 66, 16, 73,
326
74, 75, 70, 71, 72, 0, 15, 68, 0, 30,
327
31, 32, 0, 0, 0, 0, 0, 0, 0, 63,
328
0, 0, 0, 0, 0, 0, 0, 45, 0, 85,
329
0, 0, 10, 0, 0, 91, 0, 0, 0, 0,
330
64, 59, 54, 0, 0, 0, 69, 50, 57, 23,
331
0, 82, 58, 42, 52, 0, 0, 0, 0, 0,
332
0, 93, 92, 0, 0, 53, 22, 0, 0, 0,
333
0, 0, 0, 47, 4, 0, 5, 0, 0, 7,
334
60, 0, 0, 55, 0, 0, 0, 0, 48, 67,
335
56, 2, 61, 84, 36, 37, 38, 0, 0, 0,
337
0, 0, 0, 0, 0, 0, 0, 39, 0, 0,
338
0, 0, 0, 79, 0, 80, 0, 0, 0, 40,
339
0, 41, 0, 0, 0, 81, 0
342
static yyconst int yy_ec[256] =
344
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
345
2, 2, 4, 1, 1, 1, 1, 1, 1, 1,
346
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
347
1, 2, 5, 1, 1, 1, 6, 7, 1, 8,
348
9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
349
19, 20, 21, 21, 21, 22, 22, 23, 24, 25,
350
26, 27, 28, 1, 29, 29, 30, 31, 32, 29,
351
33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
352
33, 34, 35, 33, 33, 33, 33, 36, 33, 33,
353
37, 1, 38, 39, 33, 1, 40, 41, 42, 43,
355
44, 45, 46, 47, 48, 33, 49, 50, 51, 52,
356
53, 54, 33, 55, 56, 57, 58, 59, 60, 61,
357
62, 63, 64, 65, 66, 67, 1, 1, 1, 1,
358
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
359
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
360
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
361
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
362
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
363
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
364
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
366
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
367
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
368
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
369
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
370
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
374
static yyconst int yy_meta[68] =
376
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
377
1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
378
2, 2, 1, 1, 1, 1, 1, 1, 2, 2,
379
2, 2, 3, 3, 3, 3, 1, 1, 1, 2,
380
2, 2, 2, 2, 2, 3, 3, 3, 3, 3,
381
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
385
static yyconst short int yy_base[432] =
387
0, 0, 67, 0, 678, 679, 679, 679, 651, 109,
388
130, 679, 679, 650, 127, 679, 126, 124, 139, 151,
389
671, 647, 679, 151, 647, 121, 679, 668, 679, 679,
390
124, 147, 154, 155, 158, 171, 174, 157, 156, 184,
391
175, 160, 178, 162, 176, 181, 190, 197, 193, 195,
392
179, 679, 193, 679, 679, 679, 679, 656, 666, 679,
393
679, 679, 679, 679, 679, 679, 679, 679, 679, 665,
394
679, 665, 679, 246, 663, 662, 0, 679, 679, 679,
395
639, 679, 679, 679, 638, 253, 679, 679, 612, 605,
396
608, 616, 615, 602, 617, 604, 610, 598, 595, 608,
398
595, 592, 592, 598, 586, 593, 590, 600, 586, 592,
399
597, 679, 136, 596, 587, 581, 586, 588, 578, 592,
400
592, 575, 580, 577, 566, 200, 580, 576, 578, 567,
401
570, 136, 575, 567, 579, 203, 572, 679, 679, 263,
402
275, 616, 679, 282, 614, 311, 318, 325, 613, 679,
403
679, 612, 611, 679, 559, 563, 572, 569, 553, 553,
404
200, 568, 565, 565, 563, 560, 552, 558, 545, 556,
405
559, 679, 556, 544, 551, 553, 546, 535, 534, 547,
406
548, 543, 268, 544, 535, 532, 536, 534, 525, 528,
407
526, 536, 522, 520, 520, 522, 519, 530, 529, 201,
409
524, 519, 508, 290, 526, 528, 517, 562, 561, 337,
410
560, 349, 356, 559, 0, 363, 514, 679, 512, 293,
411
679, 504, 502, 510, 499, 516, 505, 297, 679, 679,
412
499, 509, 509, 494, 368, 679, 679, 371, 498, 492,
413
491, 492, 374, 679, 679, 679, 679, 490, 495, 486,
414
499, 494, 486, 490, 482, 485, 489, 494, 493, 484,
415
679, 679, 490, 479, 479, 484, 483, 480, 679, 679,
416
679, 679, 470, 482, 379, 386, 521, 393, 400, 520,
417
422, 482, 679, 679, 679, 679, 679, 679, 470, 471,
418
465, 475, 679, 679, 679, 466, 679, 679, 679, 679,
420
679, 679, 679, 679, 679, 473, 679, 679, 471, 679,
421
679, 679, 461, 466, 456, 469, 469, 458, 465, 679,
422
463, 465, 449, 458, 464, 459, 447, 679, 449, 679,
423
448, 451, 679, 429, 448, 679, 440, 439, 439, 452,
424
679, 454, 679, 453, 452, 439, 679, 679, 679, 679,
425
435, 679, 679, 679, 679, 432, 443, 436, 442, 439,
426
434, 679, 679, 426, 438, 679, 679, 431, 438, 437,
427
419, 441, 418, 679, 679, 418, 679, 413, 412, 679,
428
679, 411, 410, 679, 422, 405, 404, 376, 679, 679,
429
679, 679, 679, 679, 397, 242, 397, 389, 382, 384,
431
380, 380, 379, 324, 321, 321, 310, 679, 308, 292,
432
282, 266, 268, 285, 265, 679, 246, 258, 229, 679,
433
221, 679, 199, 145, 131, 679, 679, 471, 179, 473,
437
static yyconst short int yy_def[432] =
439
427, 1, 427, 3, 427, 427, 427, 427, 427, 427,
440
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
441
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
442
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
443
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
444
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
445
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
446
427, 428, 427, 427, 427, 427, 429, 427, 427, 427,
447
427, 427, 427, 427, 427, 430, 427, 427, 427, 427,
448
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
450
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
451
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
452
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
453
427, 427, 427, 427, 427, 427, 427, 427, 427, 431,
454
427, 428, 427, 427, 427, 427, 427, 427, 427, 427,
455
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
456
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
457
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
458
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
459
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
461
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
462
427, 427, 427, 427, 429, 430, 427, 427, 427, 427,
463
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
464
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
465
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
466
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
467
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
468
427, 427, 427, 427, 431, 427, 427, 427, 427, 427,
469
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
470
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
472
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
473
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
474
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
475
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
476
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
477
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
478
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
479
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
480
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
481
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
483
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
484
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
485
427, 427, 427, 427, 427, 427, 0, 427, 427, 427,
489
static yyconst short int yy_nxt[747] =
491
6, 7, 8, 7, 9, 10, 11, 12, 13, 14,
492
15, 16, 17, 18, 19, 20, 21, 21, 21, 21,
493
21, 21, 22, 23, 24, 25, 26, 27, 28, 28,
494
28, 28, 28, 28, 28, 28, 29, 30, 31, 32,
495
33, 34, 35, 36, 37, 38, 39, 40, 28, 41,
496
42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
497
28, 28, 28, 52, 53, 54, 55, 6, 56, 57,
498
56, 6, 6, 6, 6, 6, 6, 6, 6, 6,
499
6, 58, 6, 6, 6, 6, 6, 6, 6, 6,
500
6, 6, 6, 6, 6, 59, 59, 59, 59, 59,
502
59, 59, 59, 6, 6, 6, 59, 59, 59, 59,
503
59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
504
59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
505
6, 6, 6, 6, 61, 62, 63, 66, 68, 70,
506
70, 70, 70, 70, 70, 70, 84, 85, 71, 87,
507
86, 69, 67, 72, 74, 64, 79, 86, 86, 86,
508
86, 86, 88, 86, 73, 86, 75, 75, 75, 75,
509
75, 75, 76, 80, 86, 81, 82, 86, 86, 86,
510
149, 86, 86, 200, 86, 177, 77, 86, 178, 179,
511
426, 201, 180, 86, 94, 110, 86, 425, 86, 116,
513
86, 97, 89, 90, 95, 98, 91, 96, 92, 109,
514
99, 77, 93, 104, 111, 120, 100, 117, 138, 119,
515
101, 105, 102, 106, 122, 137, 107, 115, 112, 123,
516
118, 103, 108, 121, 134, 113, 124, 125, 135, 193,
517
128, 424, 114, 129, 132, 264, 126, 136, 133, 127,
518
205, 130, 206, 265, 194, 223, 224, 139, 131, 144,
519
423, 145, 145, 145, 145, 145, 145, 145, 152, 152,
520
152, 152, 152, 152, 152, 400, 401, 146, 208, 208,
521
208, 208, 208, 208, 208, 245, 246, 247, 422, 146,
522
70, 70, 70, 70, 70, 70, 70, 211, 211, 211,
524
211, 211, 211, 211, 421, 420, 210, 269, 270, 271,
525
284, 285, 286, 212, 293, 294, 295, 419, 210, 418,
526
417, 213, 416, 213, 415, 212, 214, 214, 214, 214,
527
214, 214, 214, 75, 75, 75, 75, 75, 75, 76,
528
76, 76, 76, 76, 76, 76, 76, 276, 414, 276,
529
413, 412, 277, 277, 277, 277, 277, 277, 277, 279,
530
411, 279, 410, 409, 280, 280, 280, 280, 280, 280,
531
280, 214, 214, 214, 214, 214, 214, 214, 152, 152,
532
152, 152, 152, 152, 152, 300, 301, 302, 303, 304,
533
305, 310, 311, 312, 208, 208, 208, 208, 208, 208,
535
208, 277, 277, 277, 277, 277, 277, 277, 211, 211,
536
211, 211, 211, 211, 211, 280, 280, 280, 280, 280,
537
280, 280, 408, 407, 212, 336, 406, 405, 404, 403,
538
402, 399, 362, 398, 397, 396, 212, 214, 214, 214,
539
214, 214, 214, 214, 277, 277, 277, 277, 277, 277,
540
277, 363, 395, 394, 393, 392, 391, 385, 386, 387,
541
390, 389, 384, 280, 280, 280, 280, 280, 280, 280,
542
388, 142, 142, 142, 153, 153, 209, 209, 383, 382,
543
381, 380, 379, 378, 377, 376, 375, 374, 373, 372,
544
371, 370, 369, 368, 367, 366, 365, 364, 361, 360,
546
359, 358, 357, 356, 355, 354, 353, 352, 351, 350,
547
349, 348, 347, 346, 345, 344, 343, 342, 341, 340,
548
339, 338, 337, 335, 334, 333, 332, 331, 330, 329,
549
328, 327, 326, 325, 324, 323, 322, 321, 320, 319,
550
318, 317, 316, 315, 314, 313, 309, 308, 307, 306,
551
299, 298, 297, 296, 292, 291, 290, 289, 288, 287,
552
283, 282, 281, 278, 275, 275, 274, 273, 272, 268,
553
267, 266, 263, 262, 261, 260, 259, 258, 257, 256,
554
255, 254, 253, 252, 251, 250, 249, 248, 244, 243,
555
242, 241, 240, 239, 238, 237, 236, 235, 234, 233,
557
232, 231, 230, 229, 228, 227, 226, 225, 222, 221,
558
220, 219, 218, 217, 216, 216, 215, 74, 143, 207,
559
204, 203, 202, 199, 198, 197, 196, 195, 192, 191,
560
190, 189, 188, 187, 186, 185, 184, 183, 182, 181,
561
176, 175, 174, 173, 172, 171, 170, 169, 168, 167,
562
166, 165, 164, 163, 162, 161, 160, 159, 158, 157,
563
156, 155, 154, 151, 150, 148, 147, 143, 141, 140,
564
72, 86, 83, 78, 74, 65, 60, 427, 5, 427,
565
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
566
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
568
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
569
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
570
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
571
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
572
427, 427, 427, 427, 427, 427
575
static yyconst short int yy_chk[747] =
577
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
578
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
579
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
580
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
581
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
582
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
583
1, 1, 1, 1, 1, 1, 1, 3, 3, 3,
584
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
585
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
586
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
588
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
589
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
590
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
591
3, 3, 3, 3, 10, 10, 11, 15, 17, 18,
592
18, 18, 18, 18, 18, 18, 26, 26, 19, 31,
593
32, 17, 15, 19, 20, 11, 24, 33, 34, 39,
594
38, 35, 31, 42, 19, 44, 20, 20, 20, 20,
595
20, 20, 20, 24, 36, 24, 24, 37, 41, 45,
596
429, 43, 51, 132, 46, 113, 20, 40, 113, 113,
597
425, 132, 113, 47, 34, 39, 49, 424, 50, 42,
599
48, 35, 32, 32, 34, 35, 33, 34, 33, 38,
600
35, 20, 33, 37, 39, 45, 35, 43, 53, 44,
601
36, 37, 36, 37, 46, 51, 37, 41, 40, 47,
602
43, 36, 37, 45, 50, 40, 47, 47, 50, 126,
603
48, 423, 40, 48, 49, 200, 47, 50, 49, 47,
604
136, 48, 136, 200, 126, 161, 161, 53, 48, 74,
605
421, 74, 74, 74, 74, 74, 74, 74, 86, 86,
606
86, 86, 86, 86, 86, 396, 396, 74, 140, 140,
607
140, 140, 140, 140, 140, 183, 183, 183, 419, 74,
608
141, 141, 141, 141, 141, 141, 141, 144, 144, 144,
610
144, 144, 144, 144, 418, 417, 141, 204, 204, 204,
611
220, 220, 220, 144, 228, 228, 228, 415, 141, 414,
612
413, 146, 412, 146, 411, 144, 146, 146, 146, 146,
613
146, 146, 146, 147, 147, 147, 147, 147, 147, 147,
614
148, 148, 148, 148, 148, 148, 148, 210, 410, 210,
615
409, 407, 210, 210, 210, 210, 210, 210, 210, 212,
616
406, 212, 405, 404, 212, 212, 212, 212, 212, 212,
617
212, 213, 213, 213, 213, 213, 213, 213, 216, 216,
618
216, 216, 216, 216, 216, 235, 235, 235, 238, 238,
619
238, 243, 243, 243, 275, 275, 275, 275, 275, 275,
621
275, 276, 276, 276, 276, 276, 276, 276, 278, 278,
622
278, 278, 278, 278, 278, 279, 279, 279, 279, 279,
623
279, 279, 403, 402, 278, 281, 401, 400, 399, 398,
624
397, 395, 334, 388, 387, 386, 278, 281, 281, 281,
625
281, 281, 281, 281, 334, 334, 334, 334, 334, 334,
626
334, 335, 385, 383, 382, 379, 378, 372, 372, 372,
627
376, 373, 371, 335, 335, 335, 335, 335, 335, 335,
628
372, 428, 428, 428, 430, 430, 431, 431, 370, 369,
629
368, 365, 364, 361, 360, 359, 358, 357, 356, 351,
630
346, 345, 344, 342, 340, 339, 338, 337, 332, 331,
632
329, 327, 326, 325, 324, 323, 322, 321, 319, 318,
633
317, 316, 315, 314, 313, 309, 306, 296, 292, 291,
634
290, 289, 282, 280, 277, 274, 273, 268, 267, 266,
635
265, 264, 263, 260, 259, 258, 257, 256, 255, 254,
636
253, 252, 251, 250, 249, 248, 242, 241, 240, 239,
637
234, 233, 232, 231, 227, 226, 225, 224, 223, 222,
638
219, 217, 214, 211, 209, 208, 207, 206, 205, 203,
639
202, 201, 199, 198, 197, 196, 195, 194, 193, 192,
640
191, 190, 189, 188, 187, 186, 185, 184, 182, 181,
641
180, 179, 178, 177, 176, 175, 174, 173, 171, 170,
643
169, 168, 167, 166, 165, 164, 163, 162, 160, 159,
644
158, 157, 156, 155, 153, 152, 149, 145, 142, 137,
645
135, 134, 133, 131, 130, 129, 128, 127, 125, 124,
646
123, 122, 121, 120, 119, 118, 117, 116, 115, 114,
647
111, 110, 109, 108, 107, 106, 105, 104, 103, 102,
648
101, 100, 99, 98, 97, 96, 95, 94, 93, 92,
649
91, 90, 89, 85, 81, 76, 75, 72, 70, 59,
650
58, 28, 25, 22, 21, 14, 9, 5, 427, 427,
651
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
652
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
654
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
655
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
656
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
657
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
658
427, 427, 427, 427, 427, 427
661
static yy_state_type yy_last_accepting_state;
662
static char *yy_last_accepting_cpos;
664
/* The intent behind this definition is that it'll catch
665
* any uses of REJECT which flex missed.
667
#define REJECT reject_used_but_not_detected
668
#define yymore() yymore_used_but_not_detected
669
#define YY_MORE_ADJ 0
670
#define YY_RESTORE_YY_MORE_OFFSET
676
//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
677
//All rights reserved.
679
//Redistribution and use in source and binary forms, with or without
680
//modification, are permitted provided that the following conditions
683
// Redistributions of source code must retain the above copyright
684
// notice, this list of conditions and the following disclaimer.
686
// Redistributions in binary form must reproduce the above
687
// copyright notice, this list of conditions and the following
688
// disclaimer in the documentation and/or other materials provided
689
// with the distribution.
691
// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
692
// contributors may be used to endorse or promote products derived
693
// from this software without specific prior written permission.
695
//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
696
//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
697
//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
698
//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
699
//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
700
//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
701
//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
702
//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
703
//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
704
//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
705
//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
706
//POSSIBILITY OF SUCH DAMAGE.
710
ANSI C grammar, Lex specification
712
In 1985, Jeff Lee published this Lex specification together with a Yacc
713
grammar for the April 30, 1985 ANSI C draft. Tom Stockfisch reposted
714
both to net.sources in 1987; that original, as mentioned in the answer
715
to question 17.25 of the comp.lang.c FAQ, can be ftp'ed from ftp.uu.net,
716
file usenet/net.sources/ansi.c.grammar.Z.
718
I intend to keep this version as close to the current C Standard grammar
719
as possible; please let me know if you discover discrepancies.
723
#define YY_NO_UNPUT 1
727
#include "ParseHelper.h"
728
#include "glslang_tab.h"
730
/* windows only pragma */
732
#pragma warning(disable : 4102)
735
int yy_input(char* buf, int max_size);
739
extern int yyparse(TParseContext&);
740
#define YY_DECL int yylex(YYSTYPE* pyylval, TParseContext& parseContext)
742
extern int yyparse(void*);
743
#define YY_DECL int yylex(YYSTYPE* pyylval, void* parseContextLocal)
744
#define parseContext (*((TParseContext*)(parseContextLocal)))
747
#define YY_INPUT(buf,result,max_size) (result = yy_input(buf, max_size))
749
#define YY_NEVER_INTERACTIVE 1
752
#line 753 "Gen_glslang.cpp"
754
/* Macros after this point can all be overridden by user definitions in
758
#ifndef YY_SKIP_YYWRAP
760
extern "C" int yywrap YY_PROTO(( void ));
762
extern int yywrap YY_PROTO(( void ));
767
static void yyunput YY_PROTO(( int c, char *buf_ptr ));
771
static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
774
#ifdef YY_NEED_STRLEN
775
static int yy_flex_strlen YY_PROTO(( yyconst char * ));
780
static int yyinput YY_PROTO(( void ));
782
static int input YY_PROTO(( void ));
787
static int yy_start_stack_ptr = 0;
788
static int yy_start_stack_depth = 0;
789
static int *yy_start_stack = 0;
790
#ifndef YY_NO_PUSH_STATE
791
static void yy_push_state YY_PROTO(( int new_state ));
793
#ifndef YY_NO_POP_STATE
794
static void yy_pop_state YY_PROTO(( void ));
796
#ifndef YY_NO_TOP_STATE
797
static int yy_top_state YY_PROTO(( void ));
801
#define YY_NO_PUSH_STATE 1
802
#define YY_NO_POP_STATE 1
803
#define YY_NO_TOP_STATE 1
806
#ifdef YY_MALLOC_DECL
814
/* Just try to get by without declaring the routines. This will fail
815
* miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
816
* or sizeof(void*) != sizeof(int).
821
/* Amount of stuff to slurp up with each read. */
822
#ifndef YY_READ_BUF_SIZE
823
#define YY_READ_BUF_SIZE 8192
826
/* Copy whatever the last rule matched to the standard output. */
829
/* This used to be an fputs(), but since the string might contain NUL's,
830
* we now use fwrite().
832
#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
835
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
836
* is returned in "result".
839
#define YY_INPUT(buf,result,max_size) \
840
if ( yy_current_buffer->yy_is_interactive ) \
843
for ( n = 0; n < max_size && \
844
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
847
buf[n++] = (char) c; \
848
if ( c == EOF && ferror( yyin ) ) \
849
YY_FATAL_ERROR( "input in flex scanner failed" ); \
852
else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
853
&& ferror( yyin ) ) \
854
YY_FATAL_ERROR( "input in flex scanner failed" );
857
/* No semi-colon after return; correct usage is to write "yyterminate();" -
858
* we don't want an extra ';' after the "return" because that will cause
859
* some compilers to complain about unreachable statements.
862
#define yyterminate() return YY_NULL
865
/* Number of entries by which start-condition stack grows. */
866
#ifndef YY_START_STACK_INCR
867
#define YY_START_STACK_INCR 25
870
/* Report a fatal error. */
871
#ifndef YY_FATAL_ERROR
872
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
875
/* Default declaration of generated scanner - a define so the user can
876
* easily add parameters.
879
#define YY_DECL int yylex YY_PROTO(( void ))
882
/* Code executed at the beginning of each rule, after yytext and yyleng
885
#ifndef YY_USER_ACTION
886
#define YY_USER_ACTION
889
/* Code executed at the end of each rule. */
891
#define YY_BREAK break;
894
#define YY_RULE_SETUP \
899
register yy_state_type yy_current_state;
900
register char *yy_cp, *yy_bp;
905
#line 906 "Gen_glslang.cpp"
916
yy_start = 1; /* first start state */
924
if ( ! yy_current_buffer )
926
yy_create_buffer( yyin, YY_BUF_SIZE );
928
yy_load_buffer_state();
931
while ( 1 ) /* loops until end-of-file is reached */
935
/* Support of yytext. */
936
*yy_cp = yy_hold_char;
938
/* yy_bp points to the position in yy_ch_buf of the start of
943
yy_current_state = yy_start;
947
register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
948
if ( yy_accept[yy_current_state] )
950
yy_last_accepting_state = yy_current_state;
951
yy_last_accepting_cpos = yy_cp;
953
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
955
yy_current_state = (int) yy_def[yy_current_state];
956
if ( yy_current_state >= 428 )
957
yy_c = yy_meta[(unsigned int) yy_c];
959
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
962
while ( yy_base[yy_current_state] != 679 );
965
yy_act = yy_accept[yy_current_state];
967
{ /* have to back up */
968
yy_cp = yy_last_accepting_cpos;
969
yy_current_state = yy_last_accepting_state;
970
yy_act = yy_accept[yy_current_state];
976
do_action: /* This label is used only to access EOF actions. */
980
{ /* beginning of action switch */
981
case 0: /* must back up */
982
/* undo the effects of YY_DO_BEFORE_ACTION */
983
*yy_cp = yy_hold_char;
984
yy_cp = yy_last_accepting_cpos;
985
yy_current_state = yy_last_accepting_state;
991
{ /* ?? carriage and/or line-feed? */ };
996
{ pyylval->lex.line = yylineno; return(ATTRIBUTE); }
1000
#line 95 "glslang.l"
1001
{ pyylval->lex.line = yylineno; return(CONST_QUAL); }
1005
#line 96 "glslang.l"
1006
{ pyylval->lex.line = yylineno; return(UNIFORM); }
1010
#line 97 "glslang.l"
1011
{ pyylval->lex.line = yylineno; return(VARYING); }
1015
#line 99 "glslang.l"
1016
{ pyylval->lex.line = yylineno; return(BREAK); }
1020
#line 100 "glslang.l"
1021
{ pyylval->lex.line = yylineno; return(CONTINUE); }
1025
#line 101 "glslang.l"
1026
{ pyylval->lex.line = yylineno; return(DO); }
1030
#line 102 "glslang.l"
1031
{ pyylval->lex.line = yylineno; return(FOR); }
1035
#line 103 "glslang.l"
1036
{ pyylval->lex.line = yylineno; return(WHILE); }
1040
#line 105 "glslang.l"
1041
{ pyylval->lex.line = yylineno; return(IF); }
1045
#line 106 "glslang.l"
1046
{ pyylval->lex.line = yylineno; return(ELSE); }
1050
#line 108 "glslang.l"
1051
{ pyylval->lex.line = yylineno; return(IN_QUAL); }
1055
#line 109 "glslang.l"
1056
{ pyylval->lex.line = yylineno; return(OUT_QUAL); }
1060
#line 110 "glslang.l"
1061
{ pyylval->lex.line = yylineno; return(INOUT_QUAL); }
1065
#line 112 "glslang.l"
1066
{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(FLOAT_TYPE); }
1070
#line 113 "glslang.l"
1071
{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(INT_TYPE); }
1075
#line 114 "glslang.l"
1076
{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(VOID_TYPE); }
1080
#line 115 "glslang.l"
1081
{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(BOOL_TYPE); }
1085
#line 116 "glslang.l"
1086
{ pyylval->lex.line = yylineno; pyylval->lex.b = true; return(BOOLCONSTANT); }
1090
#line 117 "glslang.l"
1091
{ pyylval->lex.line = yylineno; pyylval->lex.b = false; return(BOOLCONSTANT); }
1095
#line 119 "glslang.l"
1096
{ pyylval->lex.line = yylineno; return(DISCARD); }
1100
#line 120 "glslang.l"
1101
{ pyylval->lex.line = yylineno; return(RETURN); }
1105
#line 122 "glslang.l"
1106
{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(MATRIX2); }
1110
#line 123 "glslang.l"
1111
{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(MATRIX3); }
1115
#line 124 "glslang.l"
1116
{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(MATRIX4); }
1120
#line 126 "glslang.l"
1121
{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (VEC2); }
1125
#line 127 "glslang.l"
1126
{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (VEC3); }
1130
#line 128 "glslang.l"
1131
{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (VEC4); }
1135
#line 129 "glslang.l"
1136
{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (IVEC2); }
1140
#line 130 "glslang.l"
1141
{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (IVEC3); }
1145
#line 131 "glslang.l"
1146
{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (IVEC4); }
1150
#line 132 "glslang.l"
1151
{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (BVEC2); }
1155
#line 133 "glslang.l"
1156
{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (BVEC3); }
1160
#line 134 "glslang.l"
1161
{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (BVEC4); }
1165
#line 136 "glslang.l"
1166
{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLER1D; }
1170
#line 137 "glslang.l"
1171
{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLER2D; }
1175
#line 138 "glslang.l"
1176
{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLER3D; }
1180
#line 139 "glslang.l"
1181
{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLERCUBE; }
1185
#line 140 "glslang.l"
1186
{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLER1DSHADOW; }
1190
#line 141 "glslang.l"
1191
{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLER2DSHADOW; }
1195
#line 143 "glslang.l"
1196
{ pyylval->lex.line = yylineno; return(STRUCT); }
1200
#line 145 "glslang.l"
1201
{ PaReservedWord(); return 0; }
1205
#line 147 "glslang.l"
1206
{ PaReservedWord(); return 0; }
1210
#line 148 "glslang.l"
1211
{ PaReservedWord(); return 0; }
1215
#line 149 "glslang.l"
1216
{ PaReservedWord(); return 0; }
1220
#line 150 "glslang.l"
1221
{ PaReservedWord(); return 0; }
1225
#line 151 "glslang.l"
1226
{ PaReservedWord(); return 0; }
1230
#line 152 "glslang.l"
1231
{ PaReservedWord(); return 0; }
1235
#line 153 "glslang.l"
1236
{ PaReservedWord(); return 0; }
1240
#line 155 "glslang.l"
1241
{ PaReservedWord(); return 0; }
1245
#line 156 "glslang.l"
1246
{ PaReservedWord(); return 0; }
1250
#line 157 "glslang.l"
1251
{ PaReservedWord(); return 0; }
1255
#line 159 "glslang.l"
1256
{ PaReservedWord(); return 0; }
1260
#line 160 "glslang.l"
1261
{ PaReservedWord(); return 0; }
1265
#line 161 "glslang.l"
1266
{ PaReservedWord(); return 0; }
1270
#line 162 "glslang.l"
1271
{ PaReservedWord(); return 0; }
1275
#line 163 "glslang.l"
1276
{ PaReservedWord(); return 0; }
1280
#line 164 "glslang.l"
1281
{ PaReservedWord(); return 0; }
1285
#line 165 "glslang.l"
1286
{ PaReservedWord(); return 0; }
1290
#line 166 "glslang.l"
1291
{ PaReservedWord(); return 0; }
1295
#line 168 "glslang.l"
1296
{ PaReservedWord(); return 0; }
1300
#line 169 "glslang.l"
1301
{ PaReservedWord(); return 0; }
1305
#line 170 "glslang.l"
1306
{ PaReservedWord(); return 0; }
1310
#line 171 "glslang.l"
1311
{ PaReservedWord(); return 0; }
1315
#line 172 "glslang.l"
1316
{ PaReservedWord(); return 0; }
1320
#line 173 "glslang.l"
1321
{ PaReservedWord(); return 0; }
1325
#line 175 "glslang.l"
1326
{ PaReservedWord(); return 0; }
1330
#line 176 "glslang.l"
1331
{ PaReservedWord(); return 0; }
1335
#line 178 "glslang.l"
1336
{ PaReservedWord(); return 0; }
1340
#line 179 "glslang.l"
1341
{ PaReservedWord(); return 0; }
1345
#line 180 "glslang.l"
1346
{ PaReservedWord(); return 0; }
1350
#line 181 "glslang.l"
1351
{ PaReservedWord(); return 0; }
1355
#line 182 "glslang.l"
1356
{ PaReservedWord(); return 0; }
1360
#line 183 "glslang.l"
1361
{ PaReservedWord(); return 0; }
1365
#line 184 "glslang.l"
1366
{ PaReservedWord(); return 0; }
1370
#line 185 "glslang.l"
1371
{ PaReservedWord(); return 0; }
1375
#line 186 "glslang.l"
1376
{ PaReservedWord(); return 0; }
1380
#line 188 "glslang.l"
1381
{ PaReservedWord(); return 0; }
1385
#line 189 "glslang.l"
1386
{ PaReservedWord(); return 0; }
1390
#line 190 "glslang.l"
1391
{ PaReservedWord(); return 0; }
1395
#line 192 "glslang.l"
1396
{ PaReservedWord(); return 0; }
1400
#line 193 "glslang.l"
1401
{ PaReservedWord(); return 0; }
1405
#line 195 "glslang.l"
1406
{ PaReservedWord(); return 0; }
1410
#line 196 "glslang.l"
1411
{ PaReservedWord(); return 0; }
1415
#line 198 "glslang.l"
1417
pyylval->lex.line = yylineno;
1418
pyylval->lex.string = NewPoolTString(yytext);
1419
return PaIdentOrType(*pyylval->lex.string, parseContext, pyylval->lex.symbol);
1424
#line 204 "glslang.l"
1425
{ pyylval->lex.line = yylineno; pyylval->lex.i = strtol(yytext, 0, 0); return(INTCONSTANT); }
1429
#line 205 "glslang.l"
1430
{ pyylval->lex.line = yylineno; pyylval->lex.i = strtol(yytext, 0, 0); return(INTCONSTANT); }
1434
#line 206 "glslang.l"
1435
{ pyylval->lex.line = yylineno; parseContext.error(yylineno, "Invalid Octal number.", yytext, "", ""); parseContext.recover(); return 0;}
1439
#line 207 "glslang.l"
1440
{ pyylval->lex.line = yylineno; pyylval->lex.i = strtol(yytext, 0, 0); return(INTCONSTANT); }
1444
#line 209 "glslang.l"
1445
{ pyylval->lex.line = yylineno; pyylval->lex.f = static_cast<float>(atof(yytext)); return(FLOATCONSTANT); }
1449
#line 210 "glslang.l"
1450
{ pyylval->lex.line = yylineno; pyylval->lex.f = static_cast<float>(atof(yytext)); return(FLOATCONSTANT); }
1454
#line 211 "glslang.l"
1455
{ pyylval->lex.line = yylineno; pyylval->lex.f = static_cast<float>(atof(yytext)); return(FLOATCONSTANT); }
1459
#line 213 "glslang.l"
1460
{ int ret = PaParseComment(pyylval->lex.line, parseContext); if (!ret) return ret; }
1464
#line 215 "glslang.l"
1465
{ pyylval->lex.line = yylineno; return(ADD_ASSIGN); }
1469
#line 216 "glslang.l"
1470
{ pyylval->lex.line = yylineno; return(SUB_ASSIGN); }
1474
#line 217 "glslang.l"
1475
{ pyylval->lex.line = yylineno; return(MUL_ASSIGN); }
1479
#line 218 "glslang.l"
1480
{ pyylval->lex.line = yylineno; return(DIV_ASSIGN); }
1484
#line 219 "glslang.l"
1485
{ pyylval->lex.line = yylineno; return(MOD_ASSIGN); }
1489
#line 220 "glslang.l"
1490
{ pyylval->lex.line = yylineno; return(LEFT_ASSIGN); }
1494
#line 221 "glslang.l"
1495
{ pyylval->lex.line = yylineno; return(RIGHT_ASSIGN); }
1499
#line 222 "glslang.l"
1500
{ pyylval->lex.line = yylineno; return(AND_ASSIGN); }
1504
#line 223 "glslang.l"
1505
{ pyylval->lex.line = yylineno; return(XOR_ASSIGN); }
1509
#line 224 "glslang.l"
1510
{ pyylval->lex.line = yylineno; return(OR_ASSIGN); }
1514
#line 226 "glslang.l"
1515
{ pyylval->lex.line = yylineno; return(INC_OP); }
1519
#line 227 "glslang.l"
1520
{ pyylval->lex.line = yylineno; return(DEC_OP); }
1524
#line 228 "glslang.l"
1525
{ pyylval->lex.line = yylineno; return(AND_OP); }
1529
#line 229 "glslang.l"
1530
{ pyylval->lex.line = yylineno; return(OR_OP); }
1534
#line 230 "glslang.l"
1535
{ pyylval->lex.line = yylineno; return(XOR_OP); }
1539
#line 231 "glslang.l"
1540
{ pyylval->lex.line = yylineno; return(LE_OP); }
1544
#line 232 "glslang.l"
1545
{ pyylval->lex.line = yylineno; return(GE_OP); }
1549
#line 233 "glslang.l"
1550
{ pyylval->lex.line = yylineno; return(EQ_OP); }
1554
#line 234 "glslang.l"
1555
{ pyylval->lex.line = yylineno; return(NE_OP); }
1559
#line 235 "glslang.l"
1560
{ pyylval->lex.line = yylineno; return(LEFT_OP); }
1564
#line 236 "glslang.l"
1565
{ pyylval->lex.line = yylineno; return(RIGHT_OP); }
1569
#line 237 "glslang.l"
1570
{ pyylval->lex.line = yylineno; parseContext.lexAfterType = false; return(SEMICOLON); }
1574
#line 238 "glslang.l"
1575
{ pyylval->lex.line = yylineno; parseContext.lexAfterType = false; return(LEFT_BRACE); }
1579
#line 239 "glslang.l"
1580
{ pyylval->lex.line = yylineno; return(RIGHT_BRACE); }
1584
#line 240 "glslang.l"
1585
{ pyylval->lex.line = yylineno; if (parseContext.inTypeParen) parseContext.lexAfterType = false; return(COMMA); }
1589
#line 241 "glslang.l"
1590
{ pyylval->lex.line = yylineno; return(COLON); }
1594
#line 242 "glslang.l"
1595
{ pyylval->lex.line = yylineno; parseContext.lexAfterType = false; return(EQUAL); }
1599
#line 243 "glslang.l"
1600
{ pyylval->lex.line = yylineno; parseContext.lexAfterType = false; parseContext.inTypeParen = true; return(LEFT_PAREN); }
1604
#line 244 "glslang.l"
1605
{ pyylval->lex.line = yylineno; parseContext.inTypeParen = false; return(RIGHT_PAREN); }
1609
#line 245 "glslang.l"
1610
{ pyylval->lex.line = yylineno; return(LEFT_BRACKET); }
1614
#line 246 "glslang.l"
1615
{ pyylval->lex.line = yylineno; return(RIGHT_BRACKET); }
1619
#line 247 "glslang.l"
1620
{ BEGIN(FIELDS); return(DOT); }
1624
#line 248 "glslang.l"
1625
{ pyylval->lex.line = yylineno; return(BANG); }
1629
#line 249 "glslang.l"
1630
{ pyylval->lex.line = yylineno; return(DASH); }
1634
#line 250 "glslang.l"
1635
{ pyylval->lex.line = yylineno; return(TILDE); }
1639
#line 251 "glslang.l"
1640
{ pyylval->lex.line = yylineno; return(PLUS); }
1644
#line 252 "glslang.l"
1645
{ pyylval->lex.line = yylineno; return(STAR); }
1649
#line 253 "glslang.l"
1650
{ pyylval->lex.line = yylineno; return(SLASH); }
1654
#line 254 "glslang.l"
1655
{ pyylval->lex.line = yylineno; return(PERCENT); }
1659
#line 255 "glslang.l"
1660
{ pyylval->lex.line = yylineno; return(LEFT_ANGLE); }
1664
#line 256 "glslang.l"
1665
{ pyylval->lex.line = yylineno; return(RIGHT_ANGLE); }
1669
#line 257 "glslang.l"
1670
{ pyylval->lex.line = yylineno; return(VERTICAL_BAR); }
1674
#line 258 "glslang.l"
1675
{ pyylval->lex.line = yylineno; return(CARET); }
1679
#line 259 "glslang.l"
1680
{ pyylval->lex.line = yylineno; return(AMPERSAND); }
1684
#line 260 "glslang.l"
1685
{ pyylval->lex.line = yylineno; return(QUESTION); }
1689
#line 262 "glslang.l"
1692
pyylval->lex.line = yylineno;
1693
pyylval->lex.string = NewPoolTString(yytext);
1694
return FIELD_SELECTION; }
1698
#line 267 "glslang.l"
1703
#line 269 "glslang.l"
1706
case YY_STATE_EOF(INITIAL):
1707
case YY_STATE_EOF(FIELDS):
1708
#line 270 "glslang.l"
1709
{ (&parseContext)->AfterEOF = true; yy_delete_buffer(YY_CURRENT_BUFFER); yyterminate();}
1713
#line 271 "glslang.l"
1714
{ parseContext.infoSink.info << "FLEX: Unknown char " << yytext << "\n";
1719
#line 274 "glslang.l"
1722
#line 1723 "Gen_glslang.cpp"
1724
case YY_END_OF_BUFFER:
1726
/* Amount of text matched not including the EOB char. */
1727
int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1729
/* Undo the effects of YY_DO_BEFORE_ACTION. */
1730
*yy_cp = yy_hold_char;
1731
YY_RESTORE_YY_MORE_OFFSET
1733
if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1735
/* We're scanning a new file or input source. It's
1736
* possible that this happened because the user
1737
* just pointed yyin at a new source and called
1738
* yylex(). If so, then we have to assure
1739
* consistency between yy_current_buffer and our
1740
* globals. Here is the right place to do so, because
1741
* this is the first action (other than possibly a
1742
* back-up) that will match for the new input source.
1744
yy_n_chars = yy_current_buffer->yy_n_chars;
1745
yy_current_buffer->yy_input_file = yyin;
1746
yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1749
/* Note that here we test for yy_c_buf_p "<=" to the position
1750
* of the first EOB in the buffer, since yy_c_buf_p will
1751
* already have been incremented past the NUL character
1752
* (since all states make transitions on EOB to the
1753
* end-of-buffer state). Contrast this with the test
1756
if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1757
{ /* This was really a NUL. */
1758
yy_state_type yy_next_state;
1760
yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1762
yy_current_state = yy_get_previous_state();
1764
/* Okay, we're now positioned to make the NUL
1765
* transition. We couldn't have
1766
* yy_get_previous_state() go ahead and do it
1767
* for us because it doesn't know how to deal
1768
* with the possibility of jamming (and we don't
1769
* want to build jamming into it because then it
1770
* will run more slowly).
1773
yy_next_state = yy_try_NUL_trans( yy_current_state );
1775
yy_bp = yytext_ptr + YY_MORE_ADJ;
1777
if ( yy_next_state )
1779
/* Consume the NUL. */
1780
yy_cp = ++yy_c_buf_p;
1781
yy_current_state = yy_next_state;
1788
goto yy_find_action;
1792
else switch ( yy_get_next_buffer() )
1794
case EOB_ACT_END_OF_FILE:
1796
yy_did_buffer_switch_on_eof = 0;
1800
/* Note: because we've taken care in
1801
* yy_get_next_buffer() to have set up
1802
* yytext, we can now set up
1803
* yy_c_buf_p so that if some total
1804
* hoser (like flex itself) wants to
1805
* call the scanner after we return the
1806
* YY_NULL, it'll still work - another
1807
* YY_NULL will get returned.
1809
yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1811
yy_act = YY_STATE_EOF(YY_START);
1817
if ( ! yy_did_buffer_switch_on_eof )
1823
case EOB_ACT_CONTINUE_SCAN:
1825
yytext_ptr + yy_amount_of_matched_text;
1827
yy_current_state = yy_get_previous_state();
1830
yy_bp = yytext_ptr + YY_MORE_ADJ;
1833
case EOB_ACT_LAST_MATCH:
1835
&yy_current_buffer->yy_ch_buf[yy_n_chars];
1837
yy_current_state = yy_get_previous_state();
1840
yy_bp = yytext_ptr + YY_MORE_ADJ;
1841
goto yy_find_action;
1848
"fatal flex scanner internal error--no action found" );
1849
} /* end of action switch */
1850
} /* end of scanning one token */
1851
} /* end of yylex */
1854
/* yy_get_next_buffer - try to read in a new buffer
1856
* Returns a code representing an action:
1857
* EOB_ACT_LAST_MATCH -
1858
* EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1859
* EOB_ACT_END_OF_FILE - end of file
1862
static int yy_get_next_buffer()
1864
register char *dest = yy_current_buffer->yy_ch_buf;
1865
register char *source = yytext_ptr;
1866
register int number_to_move, i;
1869
if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1871
"fatal flex scanner internal error--end of buffer missed" );
1873
if ( yy_current_buffer->yy_fill_buffer == 0 )
1874
{ /* Don't try to fill the buffer, so this is an EOF. */
1875
if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1877
/* We matched a single character, the EOB, so
1878
* treat this as a final EOF.
1880
return EOB_ACT_END_OF_FILE;
1885
/* We matched some text prior to the EOB, first
1888
return EOB_ACT_LAST_MATCH;
1892
/* Try to read more data. */
1894
/* First move last chars to start of buffer. */
1895
number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1897
for ( i = 0; i < number_to_move; ++i )
1898
*(dest++) = *(source++);
1900
if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1901
/* don't do the read, it's not guaranteed to return an EOF,
1904
yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1909
yy_current_buffer->yy_buf_size - number_to_move - 1;
1911
while ( num_to_read <= 0 )
1912
{ /* Not enough room in the buffer - grow it. */
1913
#ifdef YY_USES_REJECT
1915
"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1918
/* just a shorter name for the current buffer */
1919
YY_BUFFER_STATE b = yy_current_buffer;
1921
int yy_c_buf_p_offset =
1922
(int) (yy_c_buf_p - b->yy_ch_buf);
1924
if ( b->yy_is_our_buffer )
1926
int new_size = b->yy_buf_size * 2;
1928
if ( new_size <= 0 )
1929
b->yy_buf_size += b->yy_buf_size / 8;
1931
b->yy_buf_size *= 2;
1933
b->yy_ch_buf = (char *)
1934
/* Include room in for 2 EOB chars. */
1935
yy_flex_realloc( (void *) b->yy_ch_buf,
1936
b->yy_buf_size + 2 );
1939
/* Can't grow it, we don't own it. */
1942
if ( ! b->yy_ch_buf )
1944
"fatal error - scanner input buffer overflow" );
1946
yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1948
num_to_read = yy_current_buffer->yy_buf_size -
1953
if ( num_to_read > YY_READ_BUF_SIZE )
1954
num_to_read = YY_READ_BUF_SIZE;
1956
/* Read in more data. */
1957
YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1958
yy_n_chars, num_to_read );
1960
yy_current_buffer->yy_n_chars = yy_n_chars;
1963
if ( yy_n_chars == 0 )
1965
if ( number_to_move == YY_MORE_ADJ )
1967
ret_val = EOB_ACT_END_OF_FILE;
1973
ret_val = EOB_ACT_LAST_MATCH;
1974
yy_current_buffer->yy_buffer_status =
1975
YY_BUFFER_EOF_PENDING;
1980
ret_val = EOB_ACT_CONTINUE_SCAN;
1982
yy_n_chars += number_to_move;
1983
yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1984
yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1986
yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1992
/* yy_get_previous_state - get the state just before the EOB char was reached */
1994
static yy_state_type yy_get_previous_state()
1996
register yy_state_type yy_current_state;
1997
register char *yy_cp;
1999
yy_current_state = yy_start;
2001
for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
2003
register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2004
if ( yy_accept[yy_current_state] )
2006
yy_last_accepting_state = yy_current_state;
2007
yy_last_accepting_cpos = yy_cp;
2009
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2011
yy_current_state = (int) yy_def[yy_current_state];
2012
if ( yy_current_state >= 428 )
2013
yy_c = yy_meta[(unsigned int) yy_c];
2015
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2018
return yy_current_state;
2022
/* yy_try_NUL_trans - try to make a transition on the NUL character
2025
* next_state = yy_try_NUL_trans( current_state );
2028
#ifdef YY_USE_PROTOS
2029
static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
2031
static yy_state_type yy_try_NUL_trans( yy_current_state )
2032
yy_state_type yy_current_state;
2035
register int yy_is_jam;
2036
register char *yy_cp = yy_c_buf_p;
2038
register YY_CHAR yy_c = 1;
2039
if ( yy_accept[yy_current_state] )
2041
yy_last_accepting_state = yy_current_state;
2042
yy_last_accepting_cpos = yy_cp;
2044
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2046
yy_current_state = (int) yy_def[yy_current_state];
2047
if ( yy_current_state >= 428 )
2048
yy_c = yy_meta[(unsigned int) yy_c];
2050
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2051
yy_is_jam = (yy_current_state == 427);
2053
return yy_is_jam ? 0 : yy_current_state;
2058
#ifdef YY_USE_PROTOS
2059
static void yyunput( int c, register char *yy_bp )
2061
static void yyunput( c, yy_bp )
2063
register char *yy_bp;
2066
register char *yy_cp = yy_c_buf_p;
2068
/* undo effects of setting up yytext */
2069
*yy_cp = yy_hold_char;
2071
if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
2072
{ /* need to shift things up to make room */
2073
/* +2 for EOB chars. */
2074
register int number_to_move = yy_n_chars + 2;
2075
register char *dest = &yy_current_buffer->yy_ch_buf[
2076
yy_current_buffer->yy_buf_size + 2];
2077
register char *source =
2078
&yy_current_buffer->yy_ch_buf[number_to_move];
2080
while ( source > yy_current_buffer->yy_ch_buf )
2081
*--dest = *--source;
2083
yy_cp += (int) (dest - source);
2084
yy_bp += (int) (dest - source);
2085
yy_current_buffer->yy_n_chars =
2086
yy_n_chars = yy_current_buffer->yy_buf_size;
2088
if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
2089
YY_FATAL_ERROR( "flex scanner push-back overflow" );
2092
*--yy_cp = (char) c;
2096
yy_hold_char = *yy_cp;
2099
#endif /* ifndef YY_NO_UNPUT */
2103
static int yyinput()
2110
*yy_c_buf_p = yy_hold_char;
2112
if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
2114
/* yy_c_buf_p now points to the character we want to return.
2115
* If this occurs *before* the EOB characters, then it's a
2116
* valid NUL; if not, then we've hit the end of the buffer.
2118
if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
2119
/* This was really a NUL. */
2123
{ /* need more input */
2124
int offset = yy_c_buf_p - yytext_ptr;
2127
switch ( yy_get_next_buffer() )
2129
case EOB_ACT_LAST_MATCH:
2130
/* This happens because yy_g_n_b()
2131
* sees that we've accumulated a
2132
* token and flags that we need to
2133
* try matching the token before
2134
* proceeding. But for input(),
2135
* there's no matching to consider.
2136
* So convert the EOB_ACT_LAST_MATCH
2137
* to EOB_ACT_END_OF_FILE.
2140
/* Reset buffer status. */
2145
case EOB_ACT_END_OF_FILE:
2150
if ( ! yy_did_buffer_switch_on_eof )
2159
case EOB_ACT_CONTINUE_SCAN:
2160
yy_c_buf_p = yytext_ptr + offset;
2166
c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
2167
*yy_c_buf_p = '\0'; /* preserve yytext */
2168
yy_hold_char = *++yy_c_buf_p;
2175
#ifdef YY_USE_PROTOS
2176
void yyrestart( FILE *input_file )
2178
void yyrestart( input_file )
2182
if ( ! yy_current_buffer )
2183
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
2185
yy_init_buffer( yy_current_buffer, input_file );
2186
yy_load_buffer_state();
2190
#ifdef YY_USE_PROTOS
2191
void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
2193
void yy_switch_to_buffer( new_buffer )
2194
YY_BUFFER_STATE new_buffer;
2197
if ( yy_current_buffer == new_buffer )
2200
if ( yy_current_buffer )
2202
/* Flush out information for old buffer. */
2203
*yy_c_buf_p = yy_hold_char;
2204
yy_current_buffer->yy_buf_pos = yy_c_buf_p;
2205
yy_current_buffer->yy_n_chars = yy_n_chars;
2208
yy_current_buffer = new_buffer;
2209
yy_load_buffer_state();
2211
/* We don't actually know whether we did this switch during
2212
* EOF (yywrap()) processing, but the only time this flag
2213
* is looked at is after yywrap() is called, so it's safe
2214
* to go ahead and always set it.
2216
yy_did_buffer_switch_on_eof = 1;
2220
#ifdef YY_USE_PROTOS
2221
void yy_load_buffer_state( void )
2223
void yy_load_buffer_state()
2226
yy_n_chars = yy_current_buffer->yy_n_chars;
2227
yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
2228
yyin = yy_current_buffer->yy_input_file;
2229
yy_hold_char = *yy_c_buf_p;
2233
#ifdef YY_USE_PROTOS
2234
YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
2236
YY_BUFFER_STATE yy_create_buffer( file, size )
2243
b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
2245
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2247
b->yy_buf_size = size;
2249
/* yy_ch_buf has to be 2 characters longer than the size given because
2250
* we need to put in 2 end-of-buffer characters.
2252
b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
2253
if ( ! b->yy_ch_buf )
2254
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2256
b->yy_is_our_buffer = 1;
2258
yy_init_buffer( b, file );
2264
#ifdef YY_USE_PROTOS
2265
void yy_delete_buffer( YY_BUFFER_STATE b )
2267
void yy_delete_buffer( b )
2274
if ( b == yy_current_buffer )
2275
yy_current_buffer = (YY_BUFFER_STATE) 0;
2277
if ( b->yy_is_our_buffer )
2278
yy_flex_free( (void *) b->yy_ch_buf );
2280
yy_flex_free( (void *) b );
2285
#ifdef YY_USE_PROTOS
2286
void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
2288
void yy_init_buffer( b, file )
2295
yy_flush_buffer( b );
2297
b->yy_input_file = file;
2298
b->yy_fill_buffer = 1;
2300
#if YY_ALWAYS_INTERACTIVE
2301
b->yy_is_interactive = 1;
2303
#if YY_NEVER_INTERACTIVE
2304
b->yy_is_interactive = 0;
2306
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2312
#ifdef YY_USE_PROTOS
2313
void yy_flush_buffer( YY_BUFFER_STATE b )
2315
void yy_flush_buffer( b )
2325
/* We always need two end-of-buffer characters. The first causes
2326
* a transition to the end-of-buffer state. The second causes
2327
* a jam in that state.
2329
b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2330
b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2332
b->yy_buf_pos = &b->yy_ch_buf[0];
2335
b->yy_buffer_status = YY_BUFFER_NEW;
2337
if ( b == yy_current_buffer )
2338
yy_load_buffer_state();
2342
#ifndef YY_NO_SCAN_BUFFER
2343
#ifdef YY_USE_PROTOS
2344
YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
2346
YY_BUFFER_STATE yy_scan_buffer( base, size )
2354
base[size-2] != YY_END_OF_BUFFER_CHAR ||
2355
base[size-1] != YY_END_OF_BUFFER_CHAR )
2356
/* They forgot to leave room for the EOB's. */
2359
b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
2361
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2363
b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2364
b->yy_buf_pos = b->yy_ch_buf = base;
2365
b->yy_is_our_buffer = 0;
2366
b->yy_input_file = 0;
2367
b->yy_n_chars = b->yy_buf_size;
2368
b->yy_is_interactive = 0;
2370
b->yy_fill_buffer = 0;
2371
b->yy_buffer_status = YY_BUFFER_NEW;
2373
yy_switch_to_buffer( b );
2380
#ifndef YY_NO_SCAN_STRING
2381
#ifdef YY_USE_PROTOS
2382
YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
2384
YY_BUFFER_STATE yy_scan_string( yy_str )
2385
yyconst char *yy_str;
2389
for ( len = 0; yy_str[len]; ++len )
2392
return yy_scan_bytes( yy_str, len );
2397
#ifndef YY_NO_SCAN_BYTES
2398
#ifdef YY_USE_PROTOS
2399
YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
2401
YY_BUFFER_STATE yy_scan_bytes( bytes, len )
2402
yyconst char *bytes;
2411
/* Get memory for full buffer, including space for trailing EOB's. */
2413
buf = (char *) yy_flex_alloc( n );
2415
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2417
for ( i = 0; i < len; ++i )
2420
buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
2422
b = yy_scan_buffer( buf, n );
2424
YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2426
/* It's okay to grow etc. this buffer, and we should throw it
2427
* away when we're done.
2429
b->yy_is_our_buffer = 1;
2436
#ifndef YY_NO_PUSH_STATE
2437
#ifdef YY_USE_PROTOS
2438
static void yy_push_state( int new_state )
2440
static void yy_push_state( new_state )
2444
if ( yy_start_stack_ptr >= yy_start_stack_depth )
2448
yy_start_stack_depth += YY_START_STACK_INCR;
2449
new_size = yy_start_stack_depth * sizeof( int );
2451
if ( ! yy_start_stack )
2452
yy_start_stack = (int *) yy_flex_alloc( new_size );
2455
yy_start_stack = (int *) yy_flex_realloc(
2456
(void *) yy_start_stack, new_size );
2458
if ( ! yy_start_stack )
2460
"out of memory expanding start-condition stack" );
2463
yy_start_stack[yy_start_stack_ptr++] = YY_START;
2470
#ifndef YY_NO_POP_STATE
2471
static void yy_pop_state()
2473
if ( --yy_start_stack_ptr < 0 )
2474
YY_FATAL_ERROR( "start-condition stack underflow" );
2476
BEGIN(yy_start_stack[yy_start_stack_ptr]);
2481
#ifndef YY_NO_TOP_STATE
2482
static int yy_top_state()
2484
return yy_start_stack[yy_start_stack_ptr - 1];
2488
#ifndef YY_EXIT_FAILURE
2489
#define YY_EXIT_FAILURE 2
2492
#ifdef YY_USE_PROTOS
2493
static void yy_fatal_error( yyconst char msg[] )
2495
static void yy_fatal_error( msg )
2499
(void) fprintf( stderr, "%s\n", msg );
2500
exit( YY_EXIT_FAILURE );
2505
/* Redefine yyless() so it works in section 3 code. */
2511
/* Undo effects of setting up yytext. */ \
2512
yytext[yyleng] = yy_hold_char; \
2513
yy_c_buf_p = yytext + n; \
2514
yy_hold_char = *yy_c_buf_p; \
2515
*yy_c_buf_p = '\0'; \
2521
/* Internal utility routines. */
2524
#ifdef YY_USE_PROTOS
2525
static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
2527
static void yy_flex_strncpy( s1, s2, n )
2534
for ( i = 0; i < n; ++i )
2539
#ifdef YY_NEED_STRLEN
2540
#ifdef YY_USE_PROTOS
2541
static int yy_flex_strlen( yyconst char *s )
2543
static int yy_flex_strlen( s )
2548
for ( n = 0; s[n]; ++n )
2556
#ifdef YY_USE_PROTOS
2557
static void *yy_flex_alloc( yy_size_t size )
2559
static void *yy_flex_alloc( size )
2563
return (void *) malloc( size );
2566
#ifdef YY_USE_PROTOS
2567
static void *yy_flex_realloc( void *ptr, yy_size_t size )
2569
static void *yy_flex_realloc( ptr, size )
2574
/* The cast to (char *) in the following accommodates both
2575
* implementations that use char* generic pointers, and those
2576
* that use void* generic pointers. It works with the latter
2577
* because both ANSI C and C++ allow castless assignment from
2578
* any pointer type to void*, and deal with argument conversions
2579
* as though doing an assignment.
2581
return (void *) realloc( (char *) ptr, size );
2584
#ifdef YY_USE_PROTOS
2585
static void yy_flex_free( void *ptr )
2587
static void yy_flex_free( ptr )
2601
#line 274 "glslang.l"
2605
//Including Pre-processor.
2607
#include "./preprocessor/preprocess.h"
2611
// The YY_INPUT macro just calls this. Maybe this could be just put into
2612
// the macro directly.
2615
int yy_input(char* buf, int max_size)
2617
char *char_token =NULL;
2620
if ((len = yylex_CPP(buf, max_size)) == 0)
2622
if (len >= max_size)
2623
YY_FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
2631
// Parse an array of strings using yyparse. We set up globals used by
2634
// Returns 0 for success, as per yyparse().
2636
int PaParseStrings(char* argv[], int strLen[], int argc, TParseContext& parseContextLocal)
2639
ScanFromString(argv[0]);
2641
//Storing the Current Compiler Parse context into the cpp structure.
2642
cpp->pC = (void*)&parseContextLocal;
2644
if (!argv || argc == 0 || !argv[0])
2648
argv0len = (int) strlen(argv[0]);
2652
(&parseContextLocal)->AfterEOF = false;
2653
cpp->PaWhichStr = 0;
2656
cpp->PaStrLen = strLen;
2659
if (*cpp->PaStrLen >= 0) {
2662
ret = yyparse(parseContextLocal);
2664
ret = yyparse((void*)(&parseContextLocal));
2666
if (cpp->CompileError == 1 || parseContextLocal.recoveredFromError || parseContextLocal.numErrors > 0)
2675
void yyerror(char *s)
2677
if (((TParseContext *)cpp->pC)->AfterEOF) {
2678
if (cpp->tokensBeforeEOF == 1) {
2679
GlobalParseContext->error(yylineno, "syntax error", "pre-mature EOF", s, "");
2680
GlobalParseContext->recover();
2683
GlobalParseContext->error(yylineno, "syntax error", yytext, s, "");
2684
GlobalParseContext->recover();
2688
void PaReservedWord()
2690
GlobalParseContext->error(yylineno, "Reserved word.", yytext, "", "");
2691
GlobalParseContext->recover();
2694
int PaIdentOrType(TString& id, TParseContext& parseContextLocal, TSymbol*& symbol)
2696
symbol = parseContextLocal.symbolTable.find(id);
2697
if (parseContextLocal.lexAfterType == false && symbol && symbol->isVariable()) {
2698
TVariable* variable = static_cast<TVariable*>(symbol);
2699
if (variable->isUserType()) {
2700
parseContextLocal.lexAfterType = true;
2708
int PaParseComment(int &lineno, TParseContext& parseContextLocal)
2710
int transitionFlag = 0;
2713
while (transitionFlag != 2) {
2714
nextChar = yyinput();
2715
if (nextChar == '\n')
2721
case '/' : /* if star is the previous character, then it is the end of comment */
2722
if (transitionFlag == 1) {
2727
/* Raise error message here */
2728
parseContextLocal.error(yylineno, "End of shader found before end of comment.", "", "", "");
2729
GlobalParseContext->recover();
2731
default : /* Any other character will be a part of the comment */
2740
void CPPDebugLogMsg(const char *msg)
2742
((TParseContext *)cpp->pC)->infoSink.debug.message(EPrefixNone, msg);
2745
void CPPWarningToInfoLog(const char *msg)
2747
((TParseContext *)cpp->pC)->infoSink.info.message(EPrefixWarning, msg, yylineno);
2750
void CPPShInfoLogMsg(const char *msg)
2752
((TParseContext *)cpp->pC)->error(yylineno,"", "",msg,"");
2753
GlobalParseContext->recover();
2756
void CPPErrorToInfoLog(char *msg)
2758
((TParseContext *)cpp->pC)->error(yylineno,"syntax error", "",msg,"");
2759
GlobalParseContext->recover();
2762
void SetLineNumber(int line)
2764
yylineno &= ~SourceLocLineMask;
2768
void SetStringNumber(int string)
2770
yylineno = (string << SourceLocStringShift) | (yylineno & SourceLocLineMask);
2773
int GetStringNumber(void)
2775
return yylineno >> 16;
2778
int GetLineNumber(void)
2780
return yylineno & SourceLocLineMask;
2783
void IncLineNumber(void)
2785
if ((yylineno & SourceLocLineMask) <= SourceLocLineMask)
2789
void DecLineNumber(void)
2791
if ((yylineno & SourceLocLineMask) > 0)
2795
void HandlePragma(const char **tokens, int numTokens)
2797
if (!strcmp(tokens[0], "optimize")) {
2798
if (numTokens != 4) {
2799
CPPShInfoLogMsg("optimize pragma syntax is incorrect");
2803
if (strcmp(tokens[1], "(")) {
2804
CPPShInfoLogMsg("\"(\" expected after 'optimize' keyword");
2808
if (!strcmp(tokens[2], "on"))
2809
((TParseContext *)cpp->pC)->contextPragma.optimize = true;
2810
else if (!strcmp(tokens[2], "off"))
2811
((TParseContext *)cpp->pC)->contextPragma.optimize = false;
2813
CPPShInfoLogMsg("\"on\" or \"off\" expected after '(' for 'optimize' pragma");
2817
if (strcmp(tokens[3], ")")) {
2818
CPPShInfoLogMsg("\")\" expected to end 'optimize' pragma");
2821
} else if (!strcmp(tokens[0], "debug")) {
2822
if (numTokens != 4) {
2823
CPPShInfoLogMsg("debug pragma syntax is incorrect");
2827
if (strcmp(tokens[1], "(")) {
2828
CPPShInfoLogMsg("\"(\" expected after 'debug' keyword");
2832
if (!strcmp(tokens[2], "on"))
2833
((TParseContext *)cpp->pC)->contextPragma.debug = true;
2834
else if (!strcmp(tokens[2], "off"))
2835
((TParseContext *)cpp->pC)->contextPragma.debug = false;
2837
CPPShInfoLogMsg("\"on\" or \"off\" expected after '(' for 'debug' pragma");
2841
if (strcmp(tokens[3], ")")) {
2842
CPPShInfoLogMsg("\")\" expected to end 'debug' pragma");
2847
// implementation specific pragma
2848
// use ((TParseContext *)cpp->pC)->contextPragma.pragmaTable to store the information about pragma
2849
// For now, just ignore the pragma that the implementation cannot recognize
2850
// An Example of one such implementation for a pragma that has a syntax like
2851
// #pragma pragmaname(pragmavalue)
2852
// This implementation stores the current pragmavalue against the pragma name in pragmaTable.
2853
if (numTokens == 4 && !strcmp(tokens[1], "(") && !strcmp(tokens[3], ")")) {
2854
TPragmaTable& pragmaTable = ((TParseContext *)cpp->pC)->contextPragma.pragmaTable;
2855
TPragmaTable::iterator iter;
2856
iter = pragmaTable.find(TString(tokens[0]));
2857
if (iter != pragmaTable.end()) {
2858
iter->second = tokens[2];
2860
pragmaTable[tokens[0]] = tokens[2];
2867
void StoreStr(char *string)
2870
strSrc = TString(string);
2872
((TParseContext *)cpp->pC)->HashErrMsg = ((TParseContext *)cpp->pC)->HashErrMsg + " " + strSrc;
2875
const char* GetStrfromTStr(void)
2877
cpp->ErrMsg = (((TParseContext *)cpp->pC)->HashErrMsg).c_str();
2881
void ResetTString(void)
2883
((TParseContext *)cpp->pC)->HashErrMsg = "";
2886
TBehavior GetBehavior(const char* behavior)
2888
if (!strcmp("require", behavior))
2890
else if (!strcmp("enable", behavior))
2892
else if (!strcmp("disable", behavior))
2894
else if (!strcmp("warn", behavior))
2897
CPPShInfoLogMsg((TString("behavior '") + behavior + "' is not supported").c_str());
2902
void updateExtensionBehavior(const char* extName, const char* behavior)
2904
TBehavior behaviorVal = GetBehavior(behavior);
2905
TMap<TString, TBehavior>:: iterator iter;
2908
// special cased for all extension
2909
if (!strcmp(extName, "all")) {
2910
if (behaviorVal == EBhRequire || behaviorVal == EBhEnable) {
2911
CPPShInfoLogMsg("extension 'all' cannot have 'require' or 'enable' behavior");
2914
for (iter = ((TParseContext *)cpp->pC)->extensionBehavior.begin(); iter != ((TParseContext *)cpp->pC)->extensionBehavior.end(); ++iter)
2915
iter->second = behaviorVal;
2918
iter = ((TParseContext *)cpp->pC)->extensionBehavior.find(TString(extName));
2919
if (iter == ((TParseContext *)cpp->pC)->extensionBehavior.end()) {
2920
switch (behaviorVal) {
2922
CPPShInfoLogMsg((TString("extension '") + extName + "' is not supported").c_str());
2927
msg = TString("extension '") + extName + "' is not supported";
2928
((TParseContext *)cpp->pC)->infoSink.info.message(EPrefixWarning, msg.c_str(), yylineno);
2933
iter->second = behaviorVal;
2939
void setInitialState()