blob: 4cc0f90e6b0b5f84f670e3d485448047aaa0b1f7 [file] [log] [blame]
shannonwoods@chromium.orgb0757162013-05-30 00:21:27 +00001#line 16 "./Tokenizer.l"
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002//
Jamie Madill88f6e942014-02-19 10:27:53 -05003// Copyright (c) 2011-2014 The ANGLE Project Authors. All rights reserved.
alokp@chromium.org04d7d222012-05-16 19:24:07 +00004// Use of this source code is governed by a BSD-style license that can be
5// found in the LICENSE file.
6//
7
8// This file is auto-generated by generate_parser.sh. DO NOT EDIT!
9
10
11
alokp@chromium.org04d7d222012-05-16 19:24:07 +000012#define YY_INT_ALIGNED short int
13
14/* A lexical scanner generated by flex */
15
Geoff Lang93561c32016-09-20 10:22:55 -040016
17
18
19
20
21
22
23
24
alokp@chromium.org04d7d222012-05-16 19:24:07 +000025#define FLEX_SCANNER
26#define YY_FLEX_MAJOR_VERSION 2
Geoff Lang93561c32016-09-20 10:22:55 -040027#define YY_FLEX_MINOR_VERSION 6
Corentin Wallez168d5e82017-02-01 12:18:56 -080028#define YY_FLEX_SUBMINOR_VERSION 4
alokp@chromium.org04d7d222012-05-16 19:24:07 +000029#if YY_FLEX_SUBMINOR_VERSION > 0
30#define FLEX_BETA
31#endif
32
Geoff Lang93561c32016-09-20 10:22:55 -040033
34
35
36
37
38
39
40
41
42
43
44
45
Corentin Wallez168d5e82017-02-01 12:18:56 -080046#ifdef yy_create_buffer
47#define pp_create_buffer_ALREADY_DEFINED
48#else
49#define yy_create_buffer pp_create_buffer
50#endif
51
Geoff Lang93561c32016-09-20 10:22:55 -040052
Corentin Wallez168d5e82017-02-01 12:18:56 -080053#ifdef yy_delete_buffer
54#define pp_delete_buffer_ALREADY_DEFINED
55#else
56#define yy_delete_buffer pp_delete_buffer
57#endif
58
Geoff Lang93561c32016-09-20 10:22:55 -040059
Corentin Wallez168d5e82017-02-01 12:18:56 -080060#ifdef yy_scan_buffer
61#define pp_scan_buffer_ALREADY_DEFINED
62#else
63#define yy_scan_buffer pp_scan_buffer
64#endif
65
Geoff Lang93561c32016-09-20 10:22:55 -040066
Corentin Wallez168d5e82017-02-01 12:18:56 -080067#ifdef yy_scan_string
68#define pp_scan_string_ALREADY_DEFINED
69#else
70#define yy_scan_string pp_scan_string
71#endif
72
Geoff Lang93561c32016-09-20 10:22:55 -040073
Corentin Wallez168d5e82017-02-01 12:18:56 -080074#ifdef yy_scan_bytes
75#define pp_scan_bytes_ALREADY_DEFINED
76#else
77#define yy_scan_bytes pp_scan_bytes
78#endif
79
Geoff Lang93561c32016-09-20 10:22:55 -040080
Corentin Wallez168d5e82017-02-01 12:18:56 -080081#ifdef yy_init_buffer
82#define pp_init_buffer_ALREADY_DEFINED
83#else
84#define yy_init_buffer pp_init_buffer
85#endif
86
Geoff Lang93561c32016-09-20 10:22:55 -040087
Corentin Wallez168d5e82017-02-01 12:18:56 -080088#ifdef yy_flush_buffer
89#define pp_flush_buffer_ALREADY_DEFINED
90#else
91#define yy_flush_buffer pp_flush_buffer
92#endif
93
Geoff Lang93561c32016-09-20 10:22:55 -040094
Corentin Wallez168d5e82017-02-01 12:18:56 -080095#ifdef yy_load_buffer_state
96#define pp_load_buffer_state_ALREADY_DEFINED
97#else
98#define yy_load_buffer_state pp_load_buffer_state
99#endif
100
Geoff Lang93561c32016-09-20 10:22:55 -0400101
Corentin Wallez168d5e82017-02-01 12:18:56 -0800102#ifdef yy_switch_to_buffer
103#define pp_switch_to_buffer_ALREADY_DEFINED
104#else
105#define yy_switch_to_buffer pp_switch_to_buffer
106#endif
107
Geoff Lang93561c32016-09-20 10:22:55 -0400108
Corentin Wallez168d5e82017-02-01 12:18:56 -0800109#ifdef yypush_buffer_state
110#define pppush_buffer_state_ALREADY_DEFINED
111#else
112#define yypush_buffer_state pppush_buffer_state
113#endif
114
Geoff Lang93561c32016-09-20 10:22:55 -0400115
Corentin Wallez168d5e82017-02-01 12:18:56 -0800116#ifdef yypop_buffer_state
117#define pppop_buffer_state_ALREADY_DEFINED
118#else
119#define yypop_buffer_state pppop_buffer_state
120#endif
121
Geoff Lang93561c32016-09-20 10:22:55 -0400122
Corentin Wallez168d5e82017-02-01 12:18:56 -0800123#ifdef yyensure_buffer_stack
124#define ppensure_buffer_stack_ALREADY_DEFINED
125#else
126#define yyensure_buffer_stack ppensure_buffer_stack
127#endif
128
Geoff Lang93561c32016-09-20 10:22:55 -0400129
Corentin Wallez168d5e82017-02-01 12:18:56 -0800130#ifdef yylex
131#define pplex_ALREADY_DEFINED
132#else
133#define yylex pplex
134#endif
135
Geoff Lang93561c32016-09-20 10:22:55 -0400136
Corentin Wallez168d5e82017-02-01 12:18:56 -0800137#ifdef yyrestart
138#define pprestart_ALREADY_DEFINED
139#else
140#define yyrestart pprestart
141#endif
142
Geoff Lang93561c32016-09-20 10:22:55 -0400143
Corentin Wallez168d5e82017-02-01 12:18:56 -0800144#ifdef yylex_init
145#define pplex_init_ALREADY_DEFINED
146#else
147#define yylex_init pplex_init
148#endif
149
Geoff Lang93561c32016-09-20 10:22:55 -0400150
Corentin Wallez168d5e82017-02-01 12:18:56 -0800151#ifdef yylex_init_extra
152#define pplex_init_extra_ALREADY_DEFINED
153#else
154#define yylex_init_extra pplex_init_extra
155#endif
156
Geoff Lang93561c32016-09-20 10:22:55 -0400157
Corentin Wallez168d5e82017-02-01 12:18:56 -0800158#ifdef yylex_destroy
159#define pplex_destroy_ALREADY_DEFINED
160#else
161#define yylex_destroy pplex_destroy
162#endif
163
Geoff Lang93561c32016-09-20 10:22:55 -0400164
Corentin Wallez168d5e82017-02-01 12:18:56 -0800165#ifdef yyget_debug
166#define ppget_debug_ALREADY_DEFINED
167#else
168#define yyget_debug ppget_debug
169#endif
170
Geoff Lang93561c32016-09-20 10:22:55 -0400171
Corentin Wallez168d5e82017-02-01 12:18:56 -0800172#ifdef yyset_debug
173#define ppset_debug_ALREADY_DEFINED
174#else
175#define yyset_debug ppset_debug
176#endif
177
Geoff Lang93561c32016-09-20 10:22:55 -0400178
Corentin Wallez168d5e82017-02-01 12:18:56 -0800179#ifdef yyget_extra
180#define ppget_extra_ALREADY_DEFINED
181#else
182#define yyget_extra ppget_extra
183#endif
184
Geoff Lang93561c32016-09-20 10:22:55 -0400185
Corentin Wallez168d5e82017-02-01 12:18:56 -0800186#ifdef yyset_extra
187#define ppset_extra_ALREADY_DEFINED
188#else
189#define yyset_extra ppset_extra
190#endif
191
Geoff Lang93561c32016-09-20 10:22:55 -0400192
Corentin Wallez168d5e82017-02-01 12:18:56 -0800193#ifdef yyget_in
194#define ppget_in_ALREADY_DEFINED
195#else
196#define yyget_in ppget_in
197#endif
198
Geoff Lang93561c32016-09-20 10:22:55 -0400199
Corentin Wallez168d5e82017-02-01 12:18:56 -0800200#ifdef yyset_in
201#define ppset_in_ALREADY_DEFINED
202#else
203#define yyset_in ppset_in
204#endif
205
Geoff Lang93561c32016-09-20 10:22:55 -0400206
Corentin Wallez168d5e82017-02-01 12:18:56 -0800207#ifdef yyget_out
208#define ppget_out_ALREADY_DEFINED
209#else
210#define yyget_out ppget_out
211#endif
212
Geoff Lang93561c32016-09-20 10:22:55 -0400213
Corentin Wallez168d5e82017-02-01 12:18:56 -0800214#ifdef yyset_out
215#define ppset_out_ALREADY_DEFINED
216#else
217#define yyset_out ppset_out
218#endif
219
Geoff Lang93561c32016-09-20 10:22:55 -0400220
Corentin Wallez168d5e82017-02-01 12:18:56 -0800221#ifdef yyget_leng
222#define ppget_leng_ALREADY_DEFINED
223#else
224#define yyget_leng ppget_leng
225#endif
226
Geoff Lang93561c32016-09-20 10:22:55 -0400227
Corentin Wallez168d5e82017-02-01 12:18:56 -0800228#ifdef yyget_text
229#define ppget_text_ALREADY_DEFINED
230#else
231#define yyget_text ppget_text
232#endif
233
Geoff Lang93561c32016-09-20 10:22:55 -0400234
Corentin Wallez168d5e82017-02-01 12:18:56 -0800235#ifdef yyget_lineno
236#define ppget_lineno_ALREADY_DEFINED
237#else
238#define yyget_lineno ppget_lineno
239#endif
240
Geoff Lang93561c32016-09-20 10:22:55 -0400241
Corentin Wallez168d5e82017-02-01 12:18:56 -0800242#ifdef yyset_lineno
243#define ppset_lineno_ALREADY_DEFINED
244#else
245#define yyset_lineno ppset_lineno
246#endif
247
Geoff Lang93561c32016-09-20 10:22:55 -0400248
249
Corentin Wallez168d5e82017-02-01 12:18:56 -0800250#ifdef yyget_column
251#define ppget_column_ALREADY_DEFINED
252#else
253#define yyget_column ppget_column
254#endif
255
Geoff Lang93561c32016-09-20 10:22:55 -0400256
Corentin Wallez168d5e82017-02-01 12:18:56 -0800257#ifdef yyset_column
258#define ppset_column_ALREADY_DEFINED
259#else
260#define yyset_column ppset_column
261#endif
Geoff Lang93561c32016-09-20 10:22:55 -0400262
263
264
Corentin Wallez168d5e82017-02-01 12:18:56 -0800265#ifdef yywrap
266#define ppwrap_ALREADY_DEFINED
267#else
268#define yywrap ppwrap
269#endif
270
Geoff Lang93561c32016-09-20 10:22:55 -0400271
272
273
274
Corentin Wallez168d5e82017-02-01 12:18:56 -0800275#ifdef yyget_lval
276#define ppget_lval_ALREADY_DEFINED
277#else
278#define yyget_lval ppget_lval
279#endif
280
Geoff Lang93561c32016-09-20 10:22:55 -0400281
Corentin Wallez168d5e82017-02-01 12:18:56 -0800282#ifdef yyset_lval
283#define ppset_lval_ALREADY_DEFINED
284#else
285#define yyset_lval ppset_lval
286#endif
287
Geoff Lang93561c32016-09-20 10:22:55 -0400288
289
290
291
Corentin Wallez168d5e82017-02-01 12:18:56 -0800292#ifdef yyget_lloc
293#define ppget_lloc_ALREADY_DEFINED
294#else
295#define yyget_lloc ppget_lloc
296#endif
297
Geoff Lang93561c32016-09-20 10:22:55 -0400298
Corentin Wallez168d5e82017-02-01 12:18:56 -0800299#ifdef yyset_lloc
300#define ppset_lloc_ALREADY_DEFINED
301#else
302#define yyset_lloc ppset_lloc
303#endif
304
305
306
307
308#ifdef yyalloc
309#define ppalloc_ALREADY_DEFINED
310#else
311#define yyalloc ppalloc
312#endif
313
Geoff Lang93561c32016-09-20 10:22:55 -0400314
Corentin Wallez168d5e82017-02-01 12:18:56 -0800315#ifdef yyrealloc
316#define pprealloc_ALREADY_DEFINED
317#else
318#define yyrealloc pprealloc
319#endif
320
321
322#ifdef yyfree
323#define ppfree_ALREADY_DEFINED
324#else
325#define yyfree ppfree
326#endif
327
328
329
Geoff Lang93561c32016-09-20 10:22:55 -0400330
331
332
333
334
335
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000336/* First, we deal with platform-specific or compiler-specific issues. */
337
338/* begin standard C headers. */
339#include <stdio.h>
340#include <string.h>
341#include <errno.h>
342#include <stdlib.h>
343
344/* end standard C headers. */
345
346/* flex integer type definitions */
347
348#ifndef FLEXINT_H
349#define FLEXINT_H
350
351/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
352
353#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
354
355/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
356 * if you want the limit (max/min) macros for int types.
357 */
358#ifndef __STDC_LIMIT_MACROS
359#define __STDC_LIMIT_MACROS 1
360#endif
361
362#include <inttypes.h>
363typedef int8_t flex_int8_t;
364typedef uint8_t flex_uint8_t;
365typedef int16_t flex_int16_t;
366typedef uint16_t flex_uint16_t;
367typedef int32_t flex_int32_t;
368typedef uint32_t flex_uint32_t;
369#else
370typedef signed char flex_int8_t;
371typedef short int flex_int16_t;
372typedef int flex_int32_t;
373typedef unsigned char flex_uint8_t;
374typedef unsigned short int flex_uint16_t;
375typedef unsigned int flex_uint32_t;
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000376
377/* Limits of integral types. */
378#ifndef INT8_MIN
379#define INT8_MIN (-128)
380#endif
381#ifndef INT16_MIN
382#define INT16_MIN (-32767-1)
383#endif
384#ifndef INT32_MIN
385#define INT32_MIN (-2147483647-1)
386#endif
387#ifndef INT8_MAX
388#define INT8_MAX (127)
389#endif
390#ifndef INT16_MAX
391#define INT16_MAX (32767)
392#endif
393#ifndef INT32_MAX
394#define INT32_MAX (2147483647)
395#endif
396#ifndef UINT8_MAX
397#define UINT8_MAX (255U)
398#endif
399#ifndef UINT16_MAX
400#define UINT16_MAX (65535U)
401#endif
402#ifndef UINT32_MAX
403#define UINT32_MAX (4294967295U)
404#endif
405
Corentin Wallez168d5e82017-02-01 12:18:56 -0800406#ifndef SIZE_MAX
407#define SIZE_MAX (~(size_t)0)
408#endif
409
Zhenyao Mof1d723c2013-09-23 14:57:07 -0400410#endif /* ! C99 */
411
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000412#endif /* ! FLEXINT_H */
413
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000414
Corentin Wallez168d5e82017-02-01 12:18:56 -0800415/* begin standard C++ headers. */
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000416
Geoff Lang93561c32016-09-20 10:22:55 -0400417/* TODO: this is always defined, so inline it */
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000418#define yyconst const
Geoff Lang93561c32016-09-20 10:22:55 -0400419
420#if defined(__GNUC__) && __GNUC__ >= 3
421#define yynoreturn __attribute__((__noreturn__))
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000422#else
Geoff Lang93561c32016-09-20 10:22:55 -0400423#define yynoreturn
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000424#endif
425
426/* Returned upon end-of-file. */
427#define YY_NULL 0
428
Geoff Lang93561c32016-09-20 10:22:55 -0400429
Corentin Wallez168d5e82017-02-01 12:18:56 -0800430/* Promotes a possibly negative, possibly signed char to an
431 * integer in range [0..255] for use as an array index.
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000432 */
Corentin Wallez168d5e82017-02-01 12:18:56 -0800433#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000434
Geoff Lang93561c32016-09-20 10:22:55 -0400435
436
437
438
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000439/* An opaque pointer. */
440#ifndef YY_TYPEDEF_YY_SCANNER_T
441#define YY_TYPEDEF_YY_SCANNER_T
442typedef void* yyscan_t;
443#endif
444
Geoff Lang93561c32016-09-20 10:22:55 -0400445
446
447
448
449
450
451
452
Geoff Lang93561c32016-09-20 10:22:55 -0400453
454
455
456
457
458
459
460
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000461/* For convenience, these vars (plus the bison vars far below)
462 are macros in the reentrant scanner. */
463#define yyin yyg->yyin_r
464#define yyout yyg->yyout_r
465#define yyextra yyg->yyextra_r
466#define yyleng yyg->yyleng_r
467#define yytext yyg->yytext_r
468#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
469#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
470#define yy_flex_debug yyg->yy_flex_debug_r
471
Geoff Lang93561c32016-09-20 10:22:55 -0400472
473
474
475
476
477
478
479
Corentin Wallez168d5e82017-02-01 12:18:56 -0800480
Geoff Lang93561c32016-09-20 10:22:55 -0400481
482
483
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000484/* Enter a start condition. This macro really ought to take a parameter,
485 * but we do it the disgusting crufty way forced on us by the ()-less
486 * definition of BEGIN.
487 */
488#define BEGIN yyg->yy_start = 1 + 2 *
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000489/* Translate the current start state into a value that can be later handed
490 * to BEGIN to return to the state. The YYSTATE alias is for lex
491 * compatibility.
492 */
493#define YY_START ((yyg->yy_start - 1) / 2)
494#define YYSTATE YY_START
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000495/* Action number for EOF rule of a given start state. */
496#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000497/* Special action meaning "start processing a new file". */
Corentin Wallez168d5e82017-02-01 12:18:56 -0800498#define YY_NEW_FILE yyrestart( yyin , yyscanner )
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000499#define YY_END_OF_BUFFER_CHAR 0
500
Geoff Lang93561c32016-09-20 10:22:55 -0400501
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000502/* Size of default input buffer. */
503#ifndef YY_BUF_SIZE
Geoff Lang93561c32016-09-20 10:22:55 -0400504#ifdef __ia64__
505/* On IA-64, the buffer size is 16k, not 8k.
506 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
507 * Ditto for the __ia64__ case accordingly.
508 */
509#define YY_BUF_SIZE 32768
510#else
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000511#define YY_BUF_SIZE 16384
Geoff Lang93561c32016-09-20 10:22:55 -0400512#endif /* __ia64__ */
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000513#endif
514
Geoff Lang93561c32016-09-20 10:22:55 -0400515
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000516/* The state buf must be large enough to hold one state per character in the main buffer.
517 */
518#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
519
Geoff Lang93561c32016-09-20 10:22:55 -0400520
521
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000522#ifndef YY_TYPEDEF_YY_BUFFER_STATE
523#define YY_TYPEDEF_YY_BUFFER_STATE
524typedef struct yy_buffer_state *YY_BUFFER_STATE;
525#endif
526
shannonwoods@chromium.orgb0757162013-05-30 00:21:27 +0000527#ifndef YY_TYPEDEF_YY_SIZE_T
528#define YY_TYPEDEF_YY_SIZE_T
529typedef size_t yy_size_t;
530#endif
531
Geoff Lang93561c32016-09-20 10:22:55 -0400532
533
Zhenyao Mof1d723c2013-09-23 14:57:07 -0400534
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000535#define EOB_ACT_CONTINUE_SCAN 0
536#define EOB_ACT_END_OF_FILE 1
537#define EOB_ACT_LAST_MATCH 2
Geoff Lang93561c32016-09-20 10:22:55 -0400538
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000539 #define YY_LESS_LINENO(n)
Jamie Madill185de882014-12-22 15:17:52 -0500540 #define YY_LINENO_REWIND_TO(ptr)
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000541
542/* Return all but the first "n" matched characters back to the input stream. */
543#define yyless(n) \
544 do \
545 { \
546 /* Undo effects of setting up yytext. */ \
547 int yyless_macro_arg = (n); \
548 YY_LESS_LINENO(yyless_macro_arg);\
549 *yy_cp = yyg->yy_hold_char; \
550 YY_RESTORE_YY_MORE_OFFSET \
551 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
552 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
553 } \
554 while ( 0 )
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000555#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
556
Geoff Lang93561c32016-09-20 10:22:55 -0400557
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000558#ifndef YY_STRUCT_YY_BUFFER_STATE
559#define YY_STRUCT_YY_BUFFER_STATE
560struct yy_buffer_state
561 {
562 FILE *yy_input_file;
563
Geoff Lang93561c32016-09-20 10:22:55 -0400564
565
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000566 char *yy_ch_buf; /* input buffer */
567 char *yy_buf_pos; /* current position in input buffer */
568
569 /* Size of input buffer in bytes, not including room for EOB
570 * characters.
571 */
Geoff Lang93561c32016-09-20 10:22:55 -0400572 int yy_buf_size;
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000573
574 /* Number of characters read into yy_ch_buf, not including EOB
575 * characters.
576 */
Geoff Lang93561c32016-09-20 10:22:55 -0400577 int yy_n_chars;
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000578
579 /* Whether we "own" the buffer - i.e., we know we created it,
580 * and can realloc() it to grow it, and should free() it to
581 * delete it.
582 */
583 int yy_is_our_buffer;
584
585 /* Whether this is an "interactive" input source; if so, and
586 * if we're using stdio for input, then we want to use getc()
587 * instead of fread(), to make sure we stop fetching input after
588 * each newline.
589 */
590 int yy_is_interactive;
591
592 /* Whether we're considered to be at the beginning of a line.
593 * If so, '^' rules will be active on the next match, otherwise
594 * not.
595 */
596 int yy_at_bol;
597
598 int yy_bs_lineno; /**< The line count. */
599 int yy_bs_column; /**< The column count. */
Corentin Wallez168d5e82017-02-01 12:18:56 -0800600
Geoff Lang93561c32016-09-20 10:22:55 -0400601
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000602 /* Whether to try to fill the input buffer when we reach the
603 * end of it.
604 */
605 int yy_fill_buffer;
606
607 int yy_buffer_status;
608
609#define YY_BUFFER_NEW 0
610#define YY_BUFFER_NORMAL 1
611 /* When an EOF's been seen but there's still some text to process
612 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
613 * shouldn't try reading from the input source any more. We might
614 * still have a bunch of tokens to match, though, because of
615 * possible backing-up.
616 *
617 * When we actually see the EOF, we change the status to "new"
Corentin Wallez168d5e82017-02-01 12:18:56 -0800618 * (via yyrestart()), so that the user can continue scanning by
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000619 * just pointing yyin at a new input file.
620 */
621#define YY_BUFFER_EOF_PENDING 2
622
623 };
624#endif /* !YY_STRUCT_YY_BUFFER_STATE */
625
Geoff Lang93561c32016-09-20 10:22:55 -0400626
627
628
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000629/* We provide macros for accessing buffer states in case in the
630 * future we want to put the buffer states in a more general
631 * "scanner state".
632 *
633 * Returns the top of the stack, or NULL.
634 */
635#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
636 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
637 : NULL)
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000638/* Same as previous macro, but useful when we know that the buffer stack is not
639 * NULL or when we need an lvalue. For internal use only.
640 */
641#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
642
Geoff Lang93561c32016-09-20 10:22:55 -0400643
644
645
646
Corentin Wallez168d5e82017-02-01 12:18:56 -0800647void yyrestart ( FILE *input_file , yyscan_t yyscanner );
648void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
649YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
650void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
651void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
652void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
653void yypop_buffer_state ( yyscan_t yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000654
Geoff Lang93561c32016-09-20 10:22:55 -0400655
Corentin Wallez168d5e82017-02-01 12:18:56 -0800656static void yyensure_buffer_stack ( yyscan_t yyscanner );
657static void yy_load_buffer_state ( yyscan_t yyscanner );
658static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner );
659#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000660
Geoff Lang93561c32016-09-20 10:22:55 -0400661
Corentin Wallez168d5e82017-02-01 12:18:56 -0800662YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
663YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
664YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000665
Geoff Lang93561c32016-09-20 10:22:55 -0400666
Corentin Wallez168d5e82017-02-01 12:18:56 -0800667void *yyalloc ( yy_size_t , yyscan_t yyscanner );
668void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
669void yyfree ( void * , yyscan_t yyscanner );
Geoff Lang93561c32016-09-20 10:22:55 -0400670
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000671
Corentin Wallez168d5e82017-02-01 12:18:56 -0800672#define yy_new_buffer yy_create_buffer
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000673#define yy_set_interactive(is_interactive) \
674 { \
675 if ( ! YY_CURRENT_BUFFER ){ \
Corentin Wallez168d5e82017-02-01 12:18:56 -0800676 yyensure_buffer_stack (yyscanner); \
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000677 YY_CURRENT_BUFFER_LVALUE = \
Corentin Wallez168d5e82017-02-01 12:18:56 -0800678 yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000679 } \
680 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
681 }
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000682#define yy_set_bol(at_bol) \
683 { \
684 if ( ! YY_CURRENT_BUFFER ){\
Corentin Wallez168d5e82017-02-01 12:18:56 -0800685 yyensure_buffer_stack (yyscanner); \
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000686 YY_CURRENT_BUFFER_LVALUE = \
Corentin Wallez168d5e82017-02-01 12:18:56 -0800687 yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000688 } \
689 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
690 }
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000691#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
692
Geoff Lang93561c32016-09-20 10:22:55 -0400693
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000694/* Begin user sect3 */
695
Geoff Lang93561c32016-09-20 10:22:55 -0400696#define ppwrap(yyscanner) (/*CONSTCOND*/1)
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000697#define YY_SKIP_YYWRAP
Corentin Wallez168d5e82017-02-01 12:18:56 -0800698typedef flex_uint8_t YY_CHAR;
Geoff Lang93561c32016-09-20 10:22:55 -0400699
700
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000701typedef int yy_state_type;
702
703#define yytext_ptr yytext_r
704
Geoff Lang93561c32016-09-20 10:22:55 -0400705
706
707
708
709
Corentin Wallez168d5e82017-02-01 12:18:56 -0800710static yy_state_type yy_get_previous_state ( yyscan_t yyscanner );
711static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner);
712static int yy_get_next_buffer ( yyscan_t yyscanner );
713static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
Geoff Lang93561c32016-09-20 10:22:55 -0400714
715
716
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000717
718/* Done after the current pattern has been matched and before the
719 * corresponding action - sets up yytext.
720 */
721#define YY_DO_BEFORE_ACTION \
722 yyg->yytext_ptr = yy_bp; \
Geoff Lang93561c32016-09-20 10:22:55 -0400723 yyleng = (int) (yy_cp - yy_bp); \
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000724 yyg->yy_hold_char = *yy_cp; \
725 *yy_cp = '\0'; \
726 yyg->yy_c_buf_p = yy_cp;
shannon.woods%transgaming.com@gtempaccount.combcde56f2013-04-13 03:32:12 +0000727#define YY_NUM_RULES 38
728#define YY_END_OF_BUFFER 39
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000729/* This struct is not used in this scanner,
730 but its presence is necessary. */
731struct yy_trans_info
732 {
733 flex_int32_t yy_verify;
734 flex_int32_t yy_nxt;
735 };
Corentin Wallez168d5e82017-02-01 12:18:56 -0800736static const flex_int16_t yy_accept[98] =
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000737 { 0,
shannon.woods%transgaming.com@gtempaccount.combcde56f2013-04-13 03:32:12 +0000738 0, 0, 0, 0, 39, 37, 34, 35, 35, 33,
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000739 7, 33, 33, 33, 33, 33, 33, 33, 33, 9,
shannon.woods%transgaming.com@gtempaccount.combcde56f2013-04-13 03:32:12 +0000740 9, 33, 33, 33, 8, 37, 33, 33, 3, 5,
741 5, 4, 34, 35, 19, 27, 20, 30, 25, 12,
742 23, 13, 24, 10, 2, 1, 26, 10, 9, 11,
shannonwoods@chromium.orgc8100b82013-05-30 00:20:34 +0000743 11, 11, 9, 11, 9, 9, 14, 16, 18, 17,
744 15, 8, 36, 36, 31, 21, 32, 22, 3, 5,
shannonwoods@chromium.org2a5436f2013-05-30 00:21:41 +0000745 6, 11, 10, 11, 10, 1, 10, 11, 10, 0,
746 10, 9, 9, 9, 28, 29, 0, 10, 10, 10,
747 10, 9, 10, 10, 9, 10, 0
shannonwoods@chromium.org3f83e292013-05-30 00:21:34 +0000748
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000749 } ;
750
Corentin Wallez168d5e82017-02-01 12:18:56 -0800751static const YY_CHAR yy_ec[256] =
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000752 { 0,
753 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
754 2, 2, 4, 1, 1, 1, 1, 1, 1, 1,
755 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
756 1, 2, 5, 1, 6, 1, 7, 8, 1, 9,
757 9, 10, 11, 9, 12, 13, 14, 15, 16, 16,
758 16, 16, 16, 16, 16, 17, 17, 9, 9, 18,
shannonwoods@chromium.org2a5436f2013-05-30 00:21:41 +0000759 19, 20, 9, 1, 21, 21, 21, 21, 22, 23,
760 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
761 24, 24, 24, 24, 25, 24, 24, 26, 24, 24,
762 9, 27, 9, 28, 24, 1, 21, 21, 21, 21,
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000763
shannonwoods@chromium.org2a5436f2013-05-30 00:21:41 +0000764 22, 23, 24, 24, 24, 24, 24, 24, 24, 24,
765 24, 24, 24, 24, 24, 24, 25, 24, 24, 26,
766 24, 24, 9, 29, 9, 9, 1, 1, 1, 1,
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000767 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
768 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
769 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
770 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
771 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
772 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
773 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
774
775 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
776 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1, 1, 1,
780 1, 1, 1, 1, 1
781 } ;
782
Corentin Wallez168d5e82017-02-01 12:18:56 -0800783static const YY_CHAR yy_meta[30] =
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000784 { 0,
785 1, 1, 2, 2, 1, 1, 1, 1, 1, 3,
shannonwoods@chromium.org2a5436f2013-05-30 00:21:41 +0000786 1, 1, 4, 1, 5, 5, 5, 1, 1, 1,
787 5, 5, 5, 5, 5, 5, 1, 1, 1
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000788 } ;
789
Corentin Wallez168d5e82017-02-01 12:18:56 -0800790static const flex_int16_t yy_base[103] =
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000791 { 0,
shannonwoods@chromium.org2a5436f2013-05-30 00:21:41 +0000792 0, 0, 27, 29, 137, 194, 133, 194, 117, 100,
793 194, 98, 26, 194, 94, 24, 28, 33, 32, 39,
794 51, 39, 80, 50, 0, 68, 25, 54, 0, 194,
795 88, 71, 80, 194, 194, 194, 194, 194, 194, 194,
796 194, 194, 194, 71, 194, 0, 194, 85, 55, 64,
797 99, 111, 53, 105, 0, 50, 55, 194, 194, 194,
798 40, 0, 194, 38, 194, 194, 194, 194, 0, 194,
799 194, 117, 0, 130, 0, 0, 0, 137, 0, 88,
800 113, 0, 131, 0, 194, 194, 143, 139, 152, 150,
801 0, 13, 153, 194, 0, 194, 194, 176, 31, 181,
shannon.woods%transgaming.com@gtempaccount.combcde56f2013-04-13 03:32:12 +0000802
shannonwoods@chromium.org2a5436f2013-05-30 00:21:41 +0000803 186, 188
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000804 } ;
805
Corentin Wallez168d5e82017-02-01 12:18:56 -0800806static const flex_int16_t yy_def[103] =
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000807 { 0,
shannonwoods@chromium.org2a5436f2013-05-30 00:21:41 +0000808 97, 1, 98, 98, 97, 97, 97, 97, 97, 97,
809 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
810 20, 97, 97, 97, 99, 97, 97, 97, 100, 97,
811 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
812 97, 97, 97, 97, 97, 101, 97, 97, 20, 20,
813 50, 51, 51, 102, 21, 51, 97, 97, 97, 97,
814 97, 99, 97, 97, 97, 97, 97, 97, 100, 97,
815 97, 44, 44, 72, 72, 101, 48, 51, 51, 97,
816 52, 51, 102, 51, 97, 97, 97, 74, 78, 97,
817 51, 51, 97, 97, 51, 97, 0, 97, 97, 97,
shannon.woods%transgaming.com@gtempaccount.combcde56f2013-04-13 03:32:12 +0000818
shannonwoods@chromium.org2a5436f2013-05-30 00:21:41 +0000819 97, 97
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000820 } ;
821
Corentin Wallez168d5e82017-02-01 12:18:56 -0800822static const flex_int16_t yy_nxt[224] =
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000823 { 0,
824 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
825 16, 17, 18, 19, 20, 21, 21, 22, 23, 24,
shannonwoods@chromium.org2a5436f2013-05-30 00:21:41 +0000826 25, 25, 25, 25, 25, 25, 26, 27, 28, 30,
827 31, 30, 31, 37, 40, 62, 32, 95, 32, 42,
828 63, 45, 41, 65, 38, 46, 43, 44, 44, 44,
829 47, 48, 66, 49, 49, 50, 57, 58, 86, 51,
830 52, 51, 51, 53, 54, 55, 55, 55, 60, 61,
831 63, 64, 67, 85, 84, 56, 51, 82, 50, 50,
832 51, 33, 68, 72, 71, 73, 73, 73, 51, 51,
833 70, 72, 74, 75, 72, 72, 72, 51, 59, 77,
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000834
shannonwoods@chromium.org2a5436f2013-05-30 00:21:41 +0000835 77, 77, 90, 90, 90, 51, 78, 79, 51, 51,
836 51, 51, 39, 51, 51, 51, 36, 51, 35, 34,
837 51, 80, 80, 97, 97, 81, 81, 81, 51, 51,
838 51, 72, 72, 72, 33, 91, 97, 97, 72, 72,
839 87, 87, 97, 51, 88, 88, 88, 87, 87, 97,
840 97, 89, 89, 89, 51, 92, 51, 93, 93, 93,
841 97, 75, 97, 97, 90, 90, 90, 93, 93, 93,
842 97, 97, 94, 97, 79, 96, 29, 29, 29, 29,
843 29, 69, 97, 97, 69, 69, 76, 97, 76, 76,
844 76, 83, 83, 5, 97, 97, 97, 97, 97, 97,
shannonwoods@chromium.orgc8100b82013-05-30 00:20:34 +0000845
shannonwoods@chromium.org2a5436f2013-05-30 00:21:41 +0000846 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
847 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
848 97, 97, 97
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000849 } ;
850
Corentin Wallez168d5e82017-02-01 12:18:56 -0800851static const flex_int16_t yy_chk[224] =
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000852 { 0,
853 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
854 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
shannonwoods@chromium.org2a5436f2013-05-30 00:21:41 +0000855 1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
856 3, 4, 4, 13, 16, 99, 3, 92, 4, 17,
857 64, 19, 16, 27, 13, 19, 17, 18, 18, 18,
858 19, 20, 27, 20, 20, 20, 22, 22, 61, 20,
859 20, 20, 20, 20, 20, 21, 21, 21, 24, 24,
860 26, 26, 28, 57, 56, 21, 21, 53, 50, 50,
861 49, 33, 28, 44, 32, 44, 44, 44, 50, 50,
862 31, 44, 44, 44, 44, 44, 44, 48, 23, 48,
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000863
shannonwoods@chromium.org2a5436f2013-05-30 00:21:41 +0000864 48, 48, 80, 80, 80, 48, 48, 48, 48, 48,
865 48, 51, 15, 51, 51, 51, 12, 54, 10, 9,
866 51, 52, 52, 81, 81, 52, 52, 52, 54, 54,
867 54, 72, 72, 72, 7, 81, 5, 0, 72, 72,
868 74, 74, 0, 83, 74, 74, 74, 78, 78, 88,
869 88, 78, 78, 78, 83, 83, 83, 87, 87, 87,
870 0, 88, 89, 89, 90, 90, 90, 93, 93, 93,
871 0, 0, 90, 0, 89, 93, 98, 98, 98, 98,
872 98, 100, 0, 0, 100, 100, 101, 0, 101, 101,
873 101, 102, 102, 97, 97, 97, 97, 97, 97, 97,
shannonwoods@chromium.orgc8100b82013-05-30 00:20:34 +0000874
shannonwoods@chromium.org2a5436f2013-05-30 00:21:41 +0000875 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
876 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
877 97, 97, 97
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000878 } ;
879
880/* The intent behind this definition is that it'll catch
881 * any uses of REJECT which flex missed.
882 */
883#define REJECT reject_used_but_not_detected
884#define yymore() yymore_used_but_not_detected
885#define YY_MORE_ADJ 0
886#define YY_RESTORE_YY_MORE_OFFSET
887/*
888//
Jamie Madill88f6e942014-02-19 10:27:53 -0500889// Copyright (c) 2002-2014 The ANGLE Project Authors. All rights reserved.
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000890// Use of this source code is governed by a BSD-style license that can be
891// found in the LICENSE file.
892//
893
894This file contains the Lex specification for GLSL ES preprocessor.
895Based on Microsoft Visual Studio 2010 Preprocessor Grammar:
896http://msdn.microsoft.com/en-us/library/2scxys89.aspx
897
898IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN generate_parser.sh.
899*/
900
Scott Grahama8975422015-05-01 11:09:12 -0700901#if defined(_MSC_VER)
902#pragma warning(disable: 4005)
903#endif
904
Corentin Wallez054f7ed2016-09-20 17:15:59 -0400905#include "compiler/preprocessor/Tokenizer.h"
alokp@chromium.org2c958ee2012-05-17 20:35:42 +0000906
Corentin Wallez054f7ed2016-09-20 17:15:59 -0400907#include "compiler/preprocessor/DiagnosticsBase.h"
908#include "compiler/preprocessor/Token.h"
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000909
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +0000910#if defined(__GNUC__)
911// Triggered by the auto-generated yy_fatal_error function.
912#pragma GCC diagnostic ignored "-Wmissing-noreturn"
Minmin Gong794e0002015-04-07 18:31:54 -0700913#elif defined(_MSC_VER)
914#pragma warning(disable: 4244)
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +0000915#endif
916
Jamie Madill2dc8bf82015-04-30 15:56:52 -0400917// Workaround for flex using the register keyword, deprecated in C++11.
918#ifdef __cplusplus
919#if __cplusplus > 199711L
920#define register
921#endif
922#endif
923
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000924typedef std::string YYSTYPE;
alokp@chromium.org2c958ee2012-05-17 20:35:42 +0000925typedef pp::SourceLocation YYLTYPE;
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000926
927// Use the unused yycolumn variable to track file (string) number.
928#define yyfileno yycolumn
929
930#define YY_USER_INIT \
931 do { \
932 yyfileno = 0; \
933 yylineno = 1; \
934 yyextra->leadingSpace = false; \
935 yyextra->lineStart = true; \
936 } while(0);
937
alokp@chromium.org19d7aa62012-05-31 17:34:05 +0000938#define YY_USER_ACTION \
939 do \
940 { \
941 pp::Input* input = &yyextra->input; \
942 pp::Input::Location* scanLoc = &yyextra->scanLoc; \
943 while ((scanLoc->sIndex < input->count()) && \
944 (scanLoc->cIndex >= input->length(scanLoc->sIndex))) \
945 { \
946 scanLoc->cIndex -= input->length(scanLoc->sIndex++); \
947 ++yyfileno; yylineno = 1; \
948 } \
949 yylloc->file = yyfileno; \
950 yylloc->line = yylineno; \
951 scanLoc->cIndex += yyleng; \
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000952 } while(0);
953
954#define YY_INPUT(buf, result, maxSize) \
Olli Etuaho26e355b2015-08-14 14:16:19 +0300955 result = yyextra->input.read(buf, maxSize, &yylineno);
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000956
Geoff Lang93561c32016-09-20 10:22:55 -0400957
958
959
960
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000961#define INITIAL 0
962#define COMMENT 1
963
Geoff Lang93561c32016-09-20 10:22:55 -0400964
965
966
967
968
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000969#define YY_EXTRA_TYPE pp::Tokenizer::Context*
970
Geoff Lang93561c32016-09-20 10:22:55 -0400971
972
973
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000974/* Holds the entire state of the reentrant scanner. */
975struct yyguts_t
976 {
977
978 /* User-defined. Not touched by flex. */
979 YY_EXTRA_TYPE yyextra_r;
980
981 /* The rest are the same as the globals declared in the non-reentrant scanner. */
982 FILE *yyin_r, *yyout_r;
983 size_t yy_buffer_stack_top; /**< index of top of stack. */
984 size_t yy_buffer_stack_max; /**< capacity of stack. */
985 YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
986 char yy_hold_char;
Geoff Lang93561c32016-09-20 10:22:55 -0400987 int yy_n_chars;
988 int yyleng_r;
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000989 char *yy_c_buf_p;
990 int yy_init;
991 int yy_start;
992 int yy_did_buffer_switch_on_eof;
993 int yy_start_stack_ptr;
994 int yy_start_stack_depth;
995 int *yy_start_stack;
996 yy_state_type yy_last_accepting_state;
997 char* yy_last_accepting_cpos;
998
999 int yylineno_r;
1000 int yy_flex_debug_r;
1001
Geoff Lang93561c32016-09-20 10:22:55 -04001002
1003
1004
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001005 char *yytext_r;
1006 int yy_more_flag;
1007 int yy_more_len;
1008
Geoff Lang93561c32016-09-20 10:22:55 -04001009
1010
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001011 YYSTYPE * yylval_r;
1012
Geoff Lang93561c32016-09-20 10:22:55 -04001013
1014
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001015 YYLTYPE * yylloc_r;
1016
Geoff Lang93561c32016-09-20 10:22:55 -04001017
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001018 }; /* end struct yyguts_t */
1019
Geoff Lang93561c32016-09-20 10:22:55 -04001020
1021
1022
Corentin Wallez168d5e82017-02-01 12:18:56 -08001023static int yy_init_globals ( yyscan_t yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001024
Geoff Lang93561c32016-09-20 10:22:55 -04001025
1026
1027
1028
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001029 /* This must go here because YYSTYPE and YYLTYPE are included
1030 * from bison output in section 1.*/
1031 # define yylval yyg->yylval_r
1032
Geoff Lang93561c32016-09-20 10:22:55 -04001033
1034
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001035 # define yylloc yyg->yylloc_r
1036
Geoff Lang93561c32016-09-20 10:22:55 -04001037
1038
Corentin Wallez168d5e82017-02-01 12:18:56 -08001039int yylex_init (yyscan_t* scanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001040
Corentin Wallez168d5e82017-02-01 12:18:56 -08001041int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001042
Geoff Lang93561c32016-09-20 10:22:55 -04001043
1044
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001045/* Accessor methods to globals.
1046 These are made visible to non-reentrant scanners for convenience. */
1047
Geoff Lang93561c32016-09-20 10:22:55 -04001048
Corentin Wallez168d5e82017-02-01 12:18:56 -08001049int yylex_destroy ( yyscan_t yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001050
Geoff Lang93561c32016-09-20 10:22:55 -04001051
1052
Corentin Wallez168d5e82017-02-01 12:18:56 -08001053int yyget_debug ( yyscan_t yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001054
Geoff Lang93561c32016-09-20 10:22:55 -04001055
1056
Corentin Wallez168d5e82017-02-01 12:18:56 -08001057void yyset_debug ( int debug_flag , yyscan_t yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001058
Geoff Lang93561c32016-09-20 10:22:55 -04001059
1060
Corentin Wallez168d5e82017-02-01 12:18:56 -08001061YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001062
Geoff Lang93561c32016-09-20 10:22:55 -04001063
1064
Corentin Wallez168d5e82017-02-01 12:18:56 -08001065void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001066
Geoff Lang93561c32016-09-20 10:22:55 -04001067
1068
Corentin Wallez168d5e82017-02-01 12:18:56 -08001069FILE *yyget_in ( yyscan_t yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001070
Geoff Lang93561c32016-09-20 10:22:55 -04001071
1072
Corentin Wallez168d5e82017-02-01 12:18:56 -08001073void yyset_in ( FILE * _in_str , yyscan_t yyscanner );
Geoff Lang93561c32016-09-20 10:22:55 -04001074
1075
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001076
Corentin Wallez168d5e82017-02-01 12:18:56 -08001077FILE *yyget_out ( yyscan_t yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001078
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001079
Geoff Lang93561c32016-09-20 10:22:55 -04001080
Corentin Wallez168d5e82017-02-01 12:18:56 -08001081void yyset_out ( FILE * _out_str , yyscan_t yyscanner );
Geoff Lang93561c32016-09-20 10:22:55 -04001082
1083
1084
Corentin Wallez168d5e82017-02-01 12:18:56 -08001085 int yyget_leng ( yyscan_t yyscanner );
Geoff Lang93561c32016-09-20 10:22:55 -04001086
1087
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001088
Corentin Wallez168d5e82017-02-01 12:18:56 -08001089char *yyget_text ( yyscan_t yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001090
Geoff Lang93561c32016-09-20 10:22:55 -04001091
1092
Corentin Wallez168d5e82017-02-01 12:18:56 -08001093int yyget_lineno ( yyscan_t yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001094
Geoff Lang93561c32016-09-20 10:22:55 -04001095
1096
Corentin Wallez168d5e82017-02-01 12:18:56 -08001097void yyset_lineno ( int _line_number , yyscan_t yyscanner );
Geoff Lang93561c32016-09-20 10:22:55 -04001098
1099
1100
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001101
Corentin Wallez168d5e82017-02-01 12:18:56 -08001102int yyget_column ( yyscan_t yyscanner );
Zhenyao Mof1d723c2013-09-23 14:57:07 -04001103
Geoff Lang93561c32016-09-20 10:22:55 -04001104
1105
1106
1107
Corentin Wallez168d5e82017-02-01 12:18:56 -08001108void yyset_column ( int _column_no , yyscan_t yyscanner );
Geoff Lang93561c32016-09-20 10:22:55 -04001109
1110
1111
Zhenyao Mof1d723c2013-09-23 14:57:07 -04001112
Corentin Wallez168d5e82017-02-01 12:18:56 -08001113YYSTYPE * yyget_lval ( yyscan_t yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001114
Geoff Lang93561c32016-09-20 10:22:55 -04001115
Corentin Wallez168d5e82017-02-01 12:18:56 -08001116void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001117
Geoff Lang93561c32016-09-20 10:22:55 -04001118
1119
Corentin Wallez168d5e82017-02-01 12:18:56 -08001120 YYLTYPE *yyget_lloc ( yyscan_t yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001121
Geoff Lang93561c32016-09-20 10:22:55 -04001122
1123
Corentin Wallez168d5e82017-02-01 12:18:56 -08001124 void yyset_lloc ( YYLTYPE * yylloc_param , yyscan_t yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001125
Geoff Lang93561c32016-09-20 10:22:55 -04001126
1127
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001128/* Macros after this point can all be overridden by user definitions in
1129 * section 1.
1130 */
1131
1132#ifndef YY_SKIP_YYWRAP
1133#ifdef __cplusplus
Corentin Wallez168d5e82017-02-01 12:18:56 -08001134extern "C" int yywrap ( yyscan_t yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001135#else
Corentin Wallez168d5e82017-02-01 12:18:56 -08001136extern int yywrap ( yyscan_t yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001137#endif
1138#endif
1139
Geoff Lang93561c32016-09-20 10:22:55 -04001140#ifndef YY_NO_UNPUT
1141
1142#endif
1143
1144
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001145#ifndef yytext_ptr
Corentin Wallez168d5e82017-02-01 12:18:56 -08001146static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001147#endif
1148
1149#ifdef YY_NEED_STRLEN
Corentin Wallez168d5e82017-02-01 12:18:56 -08001150static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001151#endif
1152
1153#ifndef YY_NO_INPUT
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001154#ifdef __cplusplus
Corentin Wallez168d5e82017-02-01 12:18:56 -08001155static int yyinput ( yyscan_t yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001156#else
Corentin Wallez168d5e82017-02-01 12:18:56 -08001157static int input ( yyscan_t yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001158#endif
1159
1160#endif
1161
Geoff Lang93561c32016-09-20 10:22:55 -04001162
1163
1164
1165
1166
1167
1168
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001169/* Amount of stuff to slurp up with each read. */
1170#ifndef YY_READ_BUF_SIZE
Geoff Lang93561c32016-09-20 10:22:55 -04001171#ifdef __ia64__
1172/* On IA-64, the buffer size is 16k, not 8k */
1173#define YY_READ_BUF_SIZE 16384
1174#else
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001175#define YY_READ_BUF_SIZE 8192
Geoff Lang93561c32016-09-20 10:22:55 -04001176#endif /* __ia64__ */
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001177#endif
1178
Geoff Lang93561c32016-09-20 10:22:55 -04001179
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001180/* Copy whatever the last rule matched to the standard output. */
1181#ifndef ECHO
1182/* This used to be an fputs(), but since the string might contain NUL's,
1183 * we now use fwrite().
1184 */
Geoff Lang93561c32016-09-20 10:22:55 -04001185#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001186#endif
1187
Geoff Lang93561c32016-09-20 10:22:55 -04001188
1189
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001190/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1191 * is returned in "result".
1192 */
1193#ifndef YY_INPUT
1194#define YY_INPUT(buf,result,max_size) \
1195 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1196 { \
1197 int c = '*'; \
Corentin Wallez168d5e82017-02-01 12:18:56 -08001198 int n; \
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001199 for ( n = 0; n < max_size && \
1200 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1201 buf[n] = (char) c; \
1202 if ( c == '\n' ) \
1203 buf[n++] = (char) c; \
1204 if ( c == EOF && ferror( yyin ) ) \
1205 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1206 result = n; \
1207 } \
1208 else \
1209 { \
1210 errno=0; \
Corentin Wallez168d5e82017-02-01 12:18:56 -08001211 while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001212 { \
1213 if( errno != EINTR) \
1214 { \
1215 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1216 break; \
1217 } \
1218 errno=0; \
1219 clearerr(yyin); \
1220 } \
1221 }\
1222\
1223
1224#endif
1225
Geoff Lang93561c32016-09-20 10:22:55 -04001226
1227
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001228/* No semi-colon after return; correct usage is to write "yyterminate();" -
1229 * we don't want an extra ';' after the "return" because that will cause
1230 * some compilers to complain about unreachable statements.
1231 */
1232#ifndef yyterminate
1233#define yyterminate() return YY_NULL
1234#endif
1235
Geoff Lang93561c32016-09-20 10:22:55 -04001236
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001237/* Number of entries by which start-condition stack grows. */
1238#ifndef YY_START_STACK_INCR
1239#define YY_START_STACK_INCR 25
1240#endif
1241
Geoff Lang93561c32016-09-20 10:22:55 -04001242
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001243/* Report a fatal error. */
1244#ifndef YY_FATAL_ERROR
1245#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
1246#endif
1247
Geoff Lang93561c32016-09-20 10:22:55 -04001248
1249
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001250/* end tables serialization structures and prototypes */
1251
Geoff Lang93561c32016-09-20 10:22:55 -04001252
1253
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001254/* Default declaration of generated scanner - a define so the user can
1255 * easily add parameters.
1256 */
1257#ifndef YY_DECL
1258#define YY_DECL_IS_OURS 1
1259
Geoff Lang93561c32016-09-20 10:22:55 -04001260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
Corentin Wallez168d5e82017-02-01 12:18:56 -08001276extern int yylex \
1277 (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001278
Corentin Wallez168d5e82017-02-01 12:18:56 -08001279#define YY_DECL int yylex \
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001280 (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
1281#endif /* !YY_DECL */
1282
Geoff Lang93561c32016-09-20 10:22:55 -04001283
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001284/* Code executed at the beginning of each rule, after yytext and yyleng
1285 * have been set up.
1286 */
1287#ifndef YY_USER_ACTION
1288#define YY_USER_ACTION
1289#endif
1290
Geoff Lang93561c32016-09-20 10:22:55 -04001291
1292
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001293/* Code executed at the end of each rule. */
1294#ifndef YY_BREAK
Geoff Lang93561c32016-09-20 10:22:55 -04001295#define YY_BREAK /*LINTED*/break;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001296#endif
1297
Geoff Lang93561c32016-09-20 10:22:55 -04001298
1299
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001300#define YY_RULE_SETUP \
1301 YY_USER_ACTION
1302
Geoff Lang93561c32016-09-20 10:22:55 -04001303
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001304/** The main scanner function which does all the work.
1305 */
1306YY_DECL
1307{
Geoff Lang93561c32016-09-20 10:22:55 -04001308 yy_state_type yy_current_state;
1309 char *yy_cp, *yy_bp;
1310 int yy_act;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001311 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1312
Geoff Lang93561c32016-09-20 10:22:55 -04001313
1314
1315
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001316 yylval = yylval_param;
1317
Geoff Lang93561c32016-09-20 10:22:55 -04001318
1319
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001320 yylloc = yylloc_param;
1321
Geoff Lang93561c32016-09-20 10:22:55 -04001322
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001323 if ( !yyg->yy_init )
1324 {
1325 yyg->yy_init = 1;
1326
1327#ifdef YY_USER_INIT
1328 YY_USER_INIT;
1329#endif
1330
Geoff Lang93561c32016-09-20 10:22:55 -04001331
1332
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001333 if ( ! yyg->yy_start )
1334 yyg->yy_start = 1; /* first start state */
1335
1336 if ( ! yyin )
1337 yyin = stdin;
1338
1339 if ( ! yyout )
1340 yyout = stdout;
1341
1342 if ( ! YY_CURRENT_BUFFER ) {
Corentin Wallez168d5e82017-02-01 12:18:56 -08001343 yyensure_buffer_stack (yyscanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001344 YY_CURRENT_BUFFER_LVALUE =
Corentin Wallez168d5e82017-02-01 12:18:56 -08001345 yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001346 }
1347
Corentin Wallez168d5e82017-02-01 12:18:56 -08001348 yy_load_buffer_state( yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001349 }
1350
Jamie Madill185de882014-12-22 15:17:52 -05001351 {
1352
Geoff Lang93561c32016-09-20 10:22:55 -04001353
Jamie Madill185de882014-12-22 15:17:52 -05001354 /* Line comment */
1355
Geoff Lang93561c32016-09-20 10:22:55 -04001356 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001357 {
1358 yy_cp = yyg->yy_c_buf_p;
1359
1360 /* Support of yytext. */
1361 *yy_cp = yyg->yy_hold_char;
1362
1363 /* yy_bp points to the position in yy_ch_buf of the start of
1364 * the current run.
1365 */
1366 yy_bp = yy_cp;
1367
1368 yy_current_state = yyg->yy_start;
1369yy_match:
1370 do
1371 {
Geoff Lang93561c32016-09-20 10:22:55 -04001372 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001373 if ( yy_accept[yy_current_state] )
1374 {
1375 yyg->yy_last_accepting_state = yy_current_state;
1376 yyg->yy_last_accepting_cpos = yy_cp;
1377 }
1378 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1379 {
1380 yy_current_state = (int) yy_def[yy_current_state];
shannonwoods@chromium.org2a5436f2013-05-30 00:21:41 +00001381 if ( yy_current_state >= 98 )
Corentin Wallez168d5e82017-02-01 12:18:56 -08001382 yy_c = yy_meta[yy_c];
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001383 }
Corentin Wallez168d5e82017-02-01 12:18:56 -08001384 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001385 ++yy_cp;
1386 }
shannonwoods@chromium.org2a5436f2013-05-30 00:21:41 +00001387 while ( yy_current_state != 97 );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001388 yy_cp = yyg->yy_last_accepting_cpos;
1389 yy_current_state = yyg->yy_last_accepting_state;
1390
1391yy_find_action:
1392 yy_act = yy_accept[yy_current_state];
1393
1394 YY_DO_BEFORE_ACTION;
1395
Geoff Lang93561c32016-09-20 10:22:55 -04001396
1397
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001398do_action: /* This label is used only to access EOF actions. */
1399
Geoff Lang93561c32016-09-20 10:22:55 -04001400
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001401 switch ( yy_act )
1402 { /* beginning of action switch */
1403 case 0: /* must back up */
1404 /* undo the effects of YY_DO_BEFORE_ACTION */
1405 *yy_cp = yyg->yy_hold_char;
1406 yy_cp = yyg->yy_last_accepting_cpos;
1407 yy_current_state = yyg->yy_last_accepting_state;
1408 goto yy_find_action;
1409
1410case 1:
1411YY_RULE_SETUP
1412
1413 YY_BREAK
1414/* Block comment */
1415/* Line breaks are just counted - not returned. */
Jamie Madillb96687d2015-04-30 15:56:51 -04001416/* The comment is replaced by a single space. */
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001417case 2:
1418YY_RULE_SETUP
1419{ BEGIN(COMMENT); }
1420 YY_BREAK
1421case 3:
1422YY_RULE_SETUP
1423
1424 YY_BREAK
1425case 4:
1426YY_RULE_SETUP
1427
1428 YY_BREAK
1429case 5:
1430/* rule 5 can match eol */
1431YY_RULE_SETUP
1432{ ++yylineno; }
1433 YY_BREAK
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001434case 6:
1435YY_RULE_SETUP
alokp@chromium.org2c958ee2012-05-17 20:35:42 +00001436{
1437 yyextra->leadingSpace = true;
1438 BEGIN(INITIAL);
1439}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001440 YY_BREAK
1441case 7:
1442YY_RULE_SETUP
1443{
1444 // # is only valid at start of line for preprocessor directives.
alokp@chromium.org432d6fc2012-06-27 22:13:21 +00001445 yylval->assign(1, yytext[0]);
1446 return yyextra->lineStart ? pp::Token::PP_HASH : pp::Token::PP_OTHER;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001447}
1448 YY_BREAK
1449case 8:
1450YY_RULE_SETUP
1451{
1452 yylval->assign(yytext, yyleng);
1453 return pp::Token::IDENTIFIER;
1454}
1455 YY_BREAK
1456case 9:
1457YY_RULE_SETUP
1458{
1459 yylval->assign(yytext, yyleng);
1460 return pp::Token::CONST_INT;
1461}
1462 YY_BREAK
1463case 10:
1464YY_RULE_SETUP
1465{
1466 yylval->assign(yytext, yyleng);
1467 return pp::Token::CONST_FLOAT;
1468}
1469 YY_BREAK
1470/* Anything that starts with a {DIGIT} or .{DIGIT} must be a number. */
1471/* Rule to catch all invalid integers and floats. */
1472case 11:
1473YY_RULE_SETUP
1474{
alokp@chromium.org432d6fc2012-06-27 22:13:21 +00001475 yylval->assign(yytext, yyleng);
1476 return pp::Token::PP_NUMBER;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001477}
1478 YY_BREAK
1479case 12:
1480YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001481{
1482 yylval->assign(yytext, yyleng);
1483 return pp::Token::OP_INC;
1484}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001485 YY_BREAK
1486case 13:
1487YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001488{
1489 yylval->assign(yytext, yyleng);
1490 return pp::Token::OP_DEC;
1491}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001492 YY_BREAK
1493case 14:
1494YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001495{
1496 yylval->assign(yytext, yyleng);
1497 return pp::Token::OP_LEFT;
1498}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001499 YY_BREAK
1500case 15:
1501YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001502{
1503 yylval->assign(yytext, yyleng);
1504 return pp::Token::OP_RIGHT;
1505}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001506 YY_BREAK
1507case 16:
1508YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001509{
1510 yylval->assign(yytext, yyleng);
1511 return pp::Token::OP_LE;
1512}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001513 YY_BREAK
1514case 17:
1515YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001516{
1517 yylval->assign(yytext, yyleng);
1518 return pp::Token::OP_GE;
1519}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001520 YY_BREAK
1521case 18:
1522YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001523{
1524 yylval->assign(yytext, yyleng);
1525 return pp::Token::OP_EQ;
1526}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001527 YY_BREAK
1528case 19:
1529YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001530{
1531 yylval->assign(yytext, yyleng);
1532 return pp::Token::OP_NE;
1533}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001534 YY_BREAK
1535case 20:
1536YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001537{
1538 yylval->assign(yytext, yyleng);
1539 return pp::Token::OP_AND;
1540}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001541 YY_BREAK
1542case 21:
1543YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001544{
1545 yylval->assign(yytext, yyleng);
1546 return pp::Token::OP_XOR;
1547}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001548 YY_BREAK
1549case 22:
1550YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001551{
1552 yylval->assign(yytext, yyleng);
1553 return pp::Token::OP_OR;
1554}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001555 YY_BREAK
1556case 23:
1557YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001558{
1559 yylval->assign(yytext, yyleng);
1560 return pp::Token::OP_ADD_ASSIGN;
1561}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001562 YY_BREAK
1563case 24:
1564YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001565{
1566 yylval->assign(yytext, yyleng);
1567 return pp::Token::OP_SUB_ASSIGN;
1568}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001569 YY_BREAK
1570case 25:
1571YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001572{
1573 yylval->assign(yytext, yyleng);
1574 return pp::Token::OP_MUL_ASSIGN;
1575}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001576 YY_BREAK
1577case 26:
1578YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001579{
1580 yylval->assign(yytext, yyleng);
1581 return pp::Token::OP_DIV_ASSIGN;
1582}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001583 YY_BREAK
1584case 27:
1585YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001586{
1587 yylval->assign(yytext, yyleng);
1588 return pp::Token::OP_MOD_ASSIGN;
1589}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001590 YY_BREAK
1591case 28:
1592YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001593{
1594 yylval->assign(yytext, yyleng);
1595 return pp::Token::OP_LEFT_ASSIGN;
1596}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001597 YY_BREAK
1598case 29:
1599YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001600{
1601 yylval->assign(yytext, yyleng);
1602 return pp::Token::OP_RIGHT_ASSIGN;
1603}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001604 YY_BREAK
1605case 30:
1606YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001607{
1608 yylval->assign(yytext, yyleng);
1609 return pp::Token::OP_AND_ASSIGN;
1610}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001611 YY_BREAK
1612case 31:
1613YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001614{
1615 yylval->assign(yytext, yyleng);
1616 return pp::Token::OP_XOR_ASSIGN;
1617}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001618 YY_BREAK
1619case 32:
1620YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001621{
1622 yylval->assign(yytext, yyleng);
1623 return pp::Token::OP_OR_ASSIGN;
1624}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001625 YY_BREAK
1626case 33:
1627YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001628{
1629 yylval->assign(1, yytext[0]);
1630 return yytext[0];
1631}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001632 YY_BREAK
1633case 34:
1634YY_RULE_SETUP
1635{ yyextra->leadingSpace = true; }
1636 YY_BREAK
1637case 35:
1638/* rule 35 can match eol */
1639YY_RULE_SETUP
1640{
1641 ++yylineno;
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001642 yylval->assign(1, '\n');
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001643 return '\n';
1644}
1645 YY_BREAK
1646case 36:
shannon.woods%transgaming.com@gtempaccount.combcde56f2013-04-13 03:32:12 +00001647/* rule 36 can match eol */
1648YY_RULE_SETUP
1649{ ++yylineno; }
1650 YY_BREAK
1651case 37:
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001652YY_RULE_SETUP
1653{
alokp@chromium.org432d6fc2012-06-27 22:13:21 +00001654 yylval->assign(1, yytext[0]);
1655 return pp::Token::PP_OTHER;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001656}
1657 YY_BREAK
1658case YY_STATE_EOF(INITIAL):
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001659case YY_STATE_EOF(COMMENT):
1660{
alokp@chromium.org19d7aa62012-05-31 17:34:05 +00001661 // YY_USER_ACTION is not invoked for handling EOF.
1662 // Set the location for EOF token manually.
1663 pp::Input* input = &yyextra->input;
1664 pp::Input::Location* scanLoc = &yyextra->scanLoc;
shannon.woods@transgaming.comd64b3da2013-02-28 23:19:26 +00001665 yy_size_t sIndexMax = input->count() ? input->count() - 1 : 0;
alokp@chromium.org19d7aa62012-05-31 17:34:05 +00001666 if (scanLoc->sIndex != sIndexMax)
1667 {
1668 // We can only reach here if there are empty strings at the
1669 // end of the input.
1670 scanLoc->sIndex = sIndexMax; scanLoc->cIndex = 0;
shannon.woods@transgaming.comd64b3da2013-02-28 23:19:26 +00001671 // FIXME: this is not 64-bit clean.
1672 yyfileno = static_cast<int>(sIndexMax); yylineno = 1;
alokp@chromium.org19d7aa62012-05-31 17:34:05 +00001673 }
1674 yylloc->file = yyfileno;
1675 yylloc->line = yylineno;
1676 yylval->clear();
1677
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001678 if (YY_START == COMMENT)
1679 {
Shannon Woods7f2d7942013-11-19 15:07:58 -05001680 yyextra->diagnostics->report(pp::Diagnostics::PP_EOF_IN_COMMENT,
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001681 pp::SourceLocation(yyfileno, yylineno),
1682 "");
1683 }
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001684 yyterminate();
1685}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001686 YY_BREAK
shannon.woods%transgaming.com@gtempaccount.combcde56f2013-04-13 03:32:12 +00001687case 38:
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001688YY_RULE_SETUP
1689ECHO;
1690 YY_BREAK
1691
1692 case YY_END_OF_BUFFER:
1693 {
1694 /* Amount of text matched not including the EOB char. */
1695 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
1696
1697 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1698 *yy_cp = yyg->yy_hold_char;
1699 YY_RESTORE_YY_MORE_OFFSET
1700
1701 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1702 {
1703 /* We're scanning a new file or input source. It's
1704 * possible that this happened because the user
1705 * just pointed yyin at a new source and called
Corentin Wallez168d5e82017-02-01 12:18:56 -08001706 * yylex(). If so, then we have to assure
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001707 * consistency between YY_CURRENT_BUFFER and our
1708 * globals. Here is the right place to do so, because
1709 * this is the first action (other than possibly a
1710 * back-up) that will match for the new input source.
1711 */
1712 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1713 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1714 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1715 }
1716
1717 /* Note that here we test for yy_c_buf_p "<=" to the position
1718 * of the first EOB in the buffer, since yy_c_buf_p will
1719 * already have been incremented past the NUL character
1720 * (since all states make transitions on EOB to the
1721 * end-of-buffer state). Contrast this with the test
1722 * in input().
1723 */
1724 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1725 { /* This was really a NUL. */
1726 yy_state_type yy_next_state;
1727
1728 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1729
1730 yy_current_state = yy_get_previous_state( yyscanner );
1731
1732 /* Okay, we're now positioned to make the NUL
1733 * transition. We couldn't have
1734 * yy_get_previous_state() go ahead and do it
1735 * for us because it doesn't know how to deal
1736 * with the possibility of jamming (and we don't
1737 * want to build jamming into it because then it
1738 * will run more slowly).
1739 */
1740
1741 yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1742
1743 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1744
1745 if ( yy_next_state )
1746 {
1747 /* Consume the NUL. */
1748 yy_cp = ++yyg->yy_c_buf_p;
1749 yy_current_state = yy_next_state;
1750 goto yy_match;
1751 }
1752
1753 else
1754 {
1755 yy_cp = yyg->yy_last_accepting_cpos;
1756 yy_current_state = yyg->yy_last_accepting_state;
1757 goto yy_find_action;
1758 }
1759 }
1760
1761 else switch ( yy_get_next_buffer( yyscanner ) )
1762 {
1763 case EOB_ACT_END_OF_FILE:
1764 {
1765 yyg->yy_did_buffer_switch_on_eof = 0;
1766
Corentin Wallez168d5e82017-02-01 12:18:56 -08001767 if ( yywrap( yyscanner ) )
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001768 {
1769 /* Note: because we've taken care in
1770 * yy_get_next_buffer() to have set up
1771 * yytext, we can now set up
1772 * yy_c_buf_p so that if some total
1773 * hoser (like flex itself) wants to
1774 * call the scanner after we return the
1775 * YY_NULL, it'll still work - another
1776 * YY_NULL will get returned.
1777 */
1778 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1779
1780 yy_act = YY_STATE_EOF(YY_START);
1781 goto do_action;
1782 }
1783
1784 else
1785 {
1786 if ( ! yyg->yy_did_buffer_switch_on_eof )
1787 YY_NEW_FILE;
1788 }
1789 break;
1790 }
1791
1792 case EOB_ACT_CONTINUE_SCAN:
1793 yyg->yy_c_buf_p =
1794 yyg->yytext_ptr + yy_amount_of_matched_text;
1795
1796 yy_current_state = yy_get_previous_state( yyscanner );
1797
1798 yy_cp = yyg->yy_c_buf_p;
1799 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1800 goto yy_match;
1801
1802 case EOB_ACT_LAST_MATCH:
1803 yyg->yy_c_buf_p =
1804 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1805
1806 yy_current_state = yy_get_previous_state( yyscanner );
1807
1808 yy_cp = yyg->yy_c_buf_p;
1809 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1810 goto yy_find_action;
1811 }
1812 break;
1813 }
1814
1815 default:
1816 YY_FATAL_ERROR(
1817 "fatal flex scanner internal error--no action found" );
1818 } /* end of action switch */
1819 } /* end of scanning one token */
Jamie Madill185de882014-12-22 15:17:52 -05001820 } /* end of user's declarations */
Corentin Wallez168d5e82017-02-01 12:18:56 -08001821} /* end of yylex */
Geoff Lang93561c32016-09-20 10:22:55 -04001822
1823
1824
1825
1826
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001827/* yy_get_next_buffer - try to read in a new buffer
1828 *
1829 * Returns a code representing an action:
1830 * EOB_ACT_LAST_MATCH -
1831 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1832 * EOB_ACT_END_OF_FILE - end of file
1833 */
1834static int yy_get_next_buffer (yyscan_t yyscanner)
1835{
1836 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
Geoff Lang93561c32016-09-20 10:22:55 -04001837 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1838 char *source = yyg->yytext_ptr;
Corentin Wallez168d5e82017-02-01 12:18:56 -08001839 int number_to_move, i;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001840 int ret_val;
1841
1842 if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1843 YY_FATAL_ERROR(
1844 "fatal flex scanner internal error--end of buffer missed" );
1845
1846 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1847 { /* Don't try to fill the buffer, so this is an EOF. */
1848 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1849 {
1850 /* We matched a single character, the EOB, so
1851 * treat this as a final EOF.
1852 */
1853 return EOB_ACT_END_OF_FILE;
1854 }
1855
1856 else
1857 {
1858 /* We matched some text prior to the EOB, first
1859 * process it.
1860 */
1861 return EOB_ACT_LAST_MATCH;
1862 }
1863 }
1864
1865 /* Try to read more data. */
1866
1867 /* First move last chars to start of buffer. */
Corentin Wallez168d5e82017-02-01 12:18:56 -08001868 number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001869
1870 for ( i = 0; i < number_to_move; ++i )
1871 *(dest++) = *(source++);
1872
1873 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1874 /* don't do the read, it's not guaranteed to return an EOF,
1875 * just force an EOF
1876 */
1877 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1878
1879 else
1880 {
Geoff Lang93561c32016-09-20 10:22:55 -04001881 int num_to_read =
Corentin Wallez168d5e82017-02-01 12:18:56 -08001882 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001883
1884 while ( num_to_read <= 0 )
1885 { /* Not enough room in the buffer - grow it. */
1886
1887 /* just a shorter name for the current buffer */
Zhenyao Mof1d723c2013-09-23 14:57:07 -04001888 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001889
1890 int yy_c_buf_p_offset =
1891 (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1892
1893 if ( b->yy_is_our_buffer )
1894 {
Geoff Lang93561c32016-09-20 10:22:55 -04001895 int new_size = b->yy_buf_size * 2;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001896
1897 if ( new_size <= 0 )
1898 b->yy_buf_size += b->yy_buf_size / 8;
1899 else
1900 b->yy_buf_size *= 2;
1901
1902 b->yy_ch_buf = (char *)
1903 /* Include room in for 2 EOB chars. */
Corentin Wallez168d5e82017-02-01 12:18:56 -08001904 yyrealloc( (void *) b->yy_ch_buf,
1905 (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001906 }
1907 else
1908 /* Can't grow it, we don't own it. */
Geoff Lang93561c32016-09-20 10:22:55 -04001909 b->yy_ch_buf = NULL;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001910
1911 if ( ! b->yy_ch_buf )
1912 YY_FATAL_ERROR(
1913 "fatal error - scanner input buffer overflow" );
1914
1915 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1916
Corentin Wallez168d5e82017-02-01 12:18:56 -08001917 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1918 number_to_move - 1;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001919
1920 }
1921
1922 if ( num_to_read > YY_READ_BUF_SIZE )
1923 num_to_read = YY_READ_BUF_SIZE;
1924
1925 /* Read in more data. */
Geoff Lang93561c32016-09-20 10:22:55 -04001926 yy_size_t ret = 0;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001927 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
Geoff Lang93561c32016-09-20 10:22:55 -04001928 ret, num_to_read );
1929 yyg->yy_n_chars = static_cast<int>(ret);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001930
1931 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1932 }
1933
1934 if ( yyg->yy_n_chars == 0 )
1935 {
1936 if ( number_to_move == YY_MORE_ADJ )
1937 {
1938 ret_val = EOB_ACT_END_OF_FILE;
Corentin Wallez168d5e82017-02-01 12:18:56 -08001939 yyrestart( yyin , yyscanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001940 }
1941
1942 else
1943 {
1944 ret_val = EOB_ACT_LAST_MATCH;
1945 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1946 YY_BUFFER_EOF_PENDING;
1947 }
1948 }
1949
1950 else
1951 ret_val = EOB_ACT_CONTINUE_SCAN;
1952
Corentin Wallez168d5e82017-02-01 12:18:56 -08001953 if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001954 /* Extend the array by 50%, plus the number we really need. */
Corentin Wallez168d5e82017-02-01 12:18:56 -08001955 int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
1956 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
1957 (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001958 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1959 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
Corentin Wallez168d5e82017-02-01 12:18:56 -08001960 /* "- 2" to take care of EOB's */
1961 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001962 }
1963
Corentin Wallez168d5e82017-02-01 12:18:56 -08001964 yyg->yy_n_chars += number_to_move;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001965 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1966 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1967
1968 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1969
1970 return ret_val;
1971}
1972
Geoff Lang93561c32016-09-20 10:22:55 -04001973
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001974/* yy_get_previous_state - get the state just before the EOB char was reached */
1975
1976 static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
1977{
Geoff Lang93561c32016-09-20 10:22:55 -04001978 yy_state_type yy_current_state;
1979 char *yy_cp;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001980 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1981
1982 yy_current_state = yyg->yy_start;
1983
1984 for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1985 {
Geoff Lang93561c32016-09-20 10:22:55 -04001986 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001987 if ( yy_accept[yy_current_state] )
1988 {
1989 yyg->yy_last_accepting_state = yy_current_state;
1990 yyg->yy_last_accepting_cpos = yy_cp;
1991 }
1992 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1993 {
1994 yy_current_state = (int) yy_def[yy_current_state];
shannonwoods@chromium.org2a5436f2013-05-30 00:21:41 +00001995 if ( yy_current_state >= 98 )
Corentin Wallez168d5e82017-02-01 12:18:56 -08001996 yy_c = yy_meta[yy_c];
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001997 }
Corentin Wallez168d5e82017-02-01 12:18:56 -08001998 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001999 }
2000
2001 return yy_current_state;
2002}
2003
Geoff Lang93561c32016-09-20 10:22:55 -04002004
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002005/* yy_try_NUL_trans - try to make a transition on the NUL character
2006 *
2007 * synopsis
2008 * next_state = yy_try_NUL_trans( current_state );
2009 */
2010 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
2011{
Geoff Lang93561c32016-09-20 10:22:55 -04002012 int yy_is_jam;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002013 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
Geoff Lang93561c32016-09-20 10:22:55 -04002014 char *yy_cp = yyg->yy_c_buf_p;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002015
Geoff Lang93561c32016-09-20 10:22:55 -04002016 YY_CHAR yy_c = 1;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002017 if ( yy_accept[yy_current_state] )
2018 {
2019 yyg->yy_last_accepting_state = yy_current_state;
2020 yyg->yy_last_accepting_cpos = yy_cp;
2021 }
2022 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2023 {
2024 yy_current_state = (int) yy_def[yy_current_state];
shannonwoods@chromium.org2a5436f2013-05-30 00:21:41 +00002025 if ( yy_current_state >= 98 )
Corentin Wallez168d5e82017-02-01 12:18:56 -08002026 yy_c = yy_meta[yy_c];
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002027 }
Corentin Wallez168d5e82017-02-01 12:18:56 -08002028 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
shannonwoods@chromium.org2a5436f2013-05-30 00:21:41 +00002029 yy_is_jam = (yy_current_state == 97);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002030
Zhenyao Mof1d723c2013-09-23 14:57:07 -04002031 (void)yyg;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002032 return yy_is_jam ? 0 : yy_current_state;
2033}
2034
Geoff Lang93561c32016-09-20 10:22:55 -04002035
2036#ifndef YY_NO_UNPUT
2037
2038#endif
2039
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002040#ifndef YY_NO_INPUT
2041#ifdef __cplusplus
2042 static int yyinput (yyscan_t yyscanner)
2043#else
2044 static int input (yyscan_t yyscanner)
2045#endif
2046
2047{
2048 int c;
2049 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2050
2051 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2052
2053 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
2054 {
2055 /* yy_c_buf_p now points to the character we want to return.
2056 * If this occurs *before* the EOB characters, then it's a
2057 * valid NUL; if not, then we've hit the end of the buffer.
2058 */
2059 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2060 /* This was really a NUL. */
2061 *yyg->yy_c_buf_p = '\0';
2062
2063 else
2064 { /* need more input */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002065 int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002066 ++yyg->yy_c_buf_p;
2067
2068 switch ( yy_get_next_buffer( yyscanner ) )
2069 {
2070 case EOB_ACT_LAST_MATCH:
2071 /* This happens because yy_g_n_b()
2072 * sees that we've accumulated a
2073 * token and flags that we need to
2074 * try matching the token before
2075 * proceeding. But for input(),
2076 * there's no matching to consider.
2077 * So convert the EOB_ACT_LAST_MATCH
2078 * to EOB_ACT_END_OF_FILE.
2079 */
2080
2081 /* Reset buffer status. */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002082 yyrestart( yyin , yyscanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002083
2084 /*FALLTHROUGH*/
2085
2086 case EOB_ACT_END_OF_FILE:
2087 {
Corentin Wallez168d5e82017-02-01 12:18:56 -08002088 if ( yywrap( yyscanner ) )
Geoff Lang93561c32016-09-20 10:22:55 -04002089 return 0;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002090
2091 if ( ! yyg->yy_did_buffer_switch_on_eof )
2092 YY_NEW_FILE;
2093#ifdef __cplusplus
2094 return yyinput(yyscanner);
2095#else
2096 return input(yyscanner);
2097#endif
2098 }
2099
2100 case EOB_ACT_CONTINUE_SCAN:
2101 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
2102 break;
2103 }
2104 }
2105 }
2106
2107 c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
2108 *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
2109 yyg->yy_hold_char = *++yyg->yy_c_buf_p;
2110
Geoff Lang93561c32016-09-20 10:22:55 -04002111
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002112 return c;
2113}
2114#endif /* ifndef YY_NO_INPUT */
2115
2116/** Immediately switch to a different input stream.
2117 * @param input_file A readable stream.
2118 * @param yyscanner The scanner object.
2119 * @note This function does not reset the start condition to @c INITIAL .
2120 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002121 void yyrestart (FILE * input_file , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002122{
2123 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2124
2125 if ( ! YY_CURRENT_BUFFER ){
Corentin Wallez168d5e82017-02-01 12:18:56 -08002126 yyensure_buffer_stack (yyscanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002127 YY_CURRENT_BUFFER_LVALUE =
Corentin Wallez168d5e82017-02-01 12:18:56 -08002128 yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002129 }
2130
Corentin Wallez168d5e82017-02-01 12:18:56 -08002131 yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);
2132 yy_load_buffer_state( yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002133}
2134
Geoff Lang93561c32016-09-20 10:22:55 -04002135
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002136/** Switch to a different input buffer.
2137 * @param new_buffer The new input buffer.
2138 * @param yyscanner The scanner object.
2139 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002140 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002141{
2142 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2143
2144 /* TODO. We should be able to replace this entire function body
2145 * with
Corentin Wallez168d5e82017-02-01 12:18:56 -08002146 * yypop_buffer_state();
2147 * yypush_buffer_state(new_buffer);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002148 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002149 yyensure_buffer_stack (yyscanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002150 if ( YY_CURRENT_BUFFER == new_buffer )
2151 return;
2152
2153 if ( YY_CURRENT_BUFFER )
2154 {
2155 /* Flush out information for old buffer. */
2156 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2157 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2158 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2159 }
2160
2161 YY_CURRENT_BUFFER_LVALUE = new_buffer;
Corentin Wallez168d5e82017-02-01 12:18:56 -08002162 yy_load_buffer_state( yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002163
2164 /* We don't actually know whether we did this switch during
Corentin Wallez168d5e82017-02-01 12:18:56 -08002165 * EOF (yywrap()) processing, but the only time this flag
2166 * is looked at is after yywrap() is called, so it's safe
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002167 * to go ahead and always set it.
2168 */
2169 yyg->yy_did_buffer_switch_on_eof = 1;
2170}
2171
Geoff Lang93561c32016-09-20 10:22:55 -04002172
Corentin Wallez168d5e82017-02-01 12:18:56 -08002173static void yy_load_buffer_state (yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002174{
2175 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2176 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2177 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2178 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2179 yyg->yy_hold_char = *yyg->yy_c_buf_p;
2180}
2181
2182/** Allocate and initialize an input buffer state.
2183 * @param file A readable stream.
2184 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2185 * @param yyscanner The scanner object.
2186 * @return the allocated buffer state.
2187 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002188 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002189{
2190 YY_BUFFER_STATE b;
2191
Corentin Wallez168d5e82017-02-01 12:18:56 -08002192 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002193 if ( ! b )
Corentin Wallez168d5e82017-02-01 12:18:56 -08002194 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002195
Corentin Wallez168d5e82017-02-01 12:18:56 -08002196 b->yy_buf_size = size;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002197
2198 /* yy_ch_buf has to be 2 characters longer than the size given because
2199 * we need to put in 2 end-of-buffer characters.
2200 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002201 b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002202 if ( ! b->yy_ch_buf )
Corentin Wallez168d5e82017-02-01 12:18:56 -08002203 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002204
2205 b->yy_is_our_buffer = 1;
2206
Corentin Wallez168d5e82017-02-01 12:18:56 -08002207 yy_init_buffer( b, file , yyscanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002208
2209 return b;
2210}
2211
Geoff Lang93561c32016-09-20 10:22:55 -04002212
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002213/** Destroy the buffer.
Corentin Wallez168d5e82017-02-01 12:18:56 -08002214 * @param b a buffer created with yy_create_buffer()
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002215 * @param yyscanner The scanner object.
2216 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002217 void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002218{
2219 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2220
2221 if ( ! b )
2222 return;
2223
2224 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2225 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2226
2227 if ( b->yy_is_our_buffer )
Corentin Wallez168d5e82017-02-01 12:18:56 -08002228 yyfree( (void *) b->yy_ch_buf , yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002229
Corentin Wallez168d5e82017-02-01 12:18:56 -08002230 yyfree( (void *) b , yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002231}
2232
Geoff Lang93561c32016-09-20 10:22:55 -04002233
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002234/* Initializes or reinitializes a buffer.
2235 * This function is sometimes called more than once on the same buffer,
Corentin Wallez168d5e82017-02-01 12:18:56 -08002236 * such as during a yyrestart() or at EOF.
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002237 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002238 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002239
2240{
2241 int oerrno = errno;
2242 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2243
Corentin Wallez168d5e82017-02-01 12:18:56 -08002244 yy_flush_buffer( b , yyscanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002245
2246 b->yy_input_file = file;
2247 b->yy_fill_buffer = 1;
2248
Corentin Wallez168d5e82017-02-01 12:18:56 -08002249 /* If b is the current buffer, then yy_init_buffer was _probably_
2250 * called from yyrestart() or through yy_get_next_buffer.
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002251 * In that case, we don't want to reset the lineno or column.
2252 */
2253 if (b != YY_CURRENT_BUFFER){
2254 b->yy_bs_lineno = 1;
2255 b->yy_bs_column = 0;
2256 }
2257
Geoff Lang93561c32016-09-20 10:22:55 -04002258
2259
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002260 b->yy_is_interactive = 0;
2261
Geoff Lang93561c32016-09-20 10:22:55 -04002262
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002263 errno = oerrno;
2264}
2265
2266/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2267 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2268 * @param yyscanner The scanner object.
2269 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002270 void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002271{
2272 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2273 if ( ! b )
2274 return;
2275
2276 b->yy_n_chars = 0;
2277
2278 /* We always need two end-of-buffer characters. The first causes
2279 * a transition to the end-of-buffer state. The second causes
2280 * a jam in that state.
2281 */
2282 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2283 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2284
2285 b->yy_buf_pos = &b->yy_ch_buf[0];
2286
2287 b->yy_at_bol = 1;
2288 b->yy_buffer_status = YY_BUFFER_NEW;
2289
2290 if ( b == YY_CURRENT_BUFFER )
Corentin Wallez168d5e82017-02-01 12:18:56 -08002291 yy_load_buffer_state( yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002292}
2293
2294/** Pushes the new state onto the stack. The new state becomes
2295 * the current state. This function will allocate the stack
2296 * if necessary.
2297 * @param new_buffer The new state.
2298 * @param yyscanner The scanner object.
2299 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002300void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002301{
2302 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2303 if (new_buffer == NULL)
2304 return;
2305
Corentin Wallez168d5e82017-02-01 12:18:56 -08002306 yyensure_buffer_stack(yyscanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002307
Corentin Wallez168d5e82017-02-01 12:18:56 -08002308 /* This block is copied from yy_switch_to_buffer. */
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002309 if ( YY_CURRENT_BUFFER )
2310 {
2311 /* Flush out information for old buffer. */
2312 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2313 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2314 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2315 }
2316
2317 /* Only push if top exists. Otherwise, replace top. */
2318 if (YY_CURRENT_BUFFER)
2319 yyg->yy_buffer_stack_top++;
2320 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2321
Corentin Wallez168d5e82017-02-01 12:18:56 -08002322 /* copied from yy_switch_to_buffer. */
2323 yy_load_buffer_state( yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002324 yyg->yy_did_buffer_switch_on_eof = 1;
2325}
2326
Geoff Lang93561c32016-09-20 10:22:55 -04002327
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002328/** Removes and deletes the top of the stack, if present.
2329 * The next element becomes the new top.
2330 * @param yyscanner The scanner object.
2331 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002332void yypop_buffer_state (yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002333{
2334 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2335 if (!YY_CURRENT_BUFFER)
2336 return;
2337
Corentin Wallez168d5e82017-02-01 12:18:56 -08002338 yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002339 YY_CURRENT_BUFFER_LVALUE = NULL;
2340 if (yyg->yy_buffer_stack_top > 0)
2341 --yyg->yy_buffer_stack_top;
2342
2343 if (YY_CURRENT_BUFFER) {
Corentin Wallez168d5e82017-02-01 12:18:56 -08002344 yy_load_buffer_state( yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002345 yyg->yy_did_buffer_switch_on_eof = 1;
2346 }
2347}
2348
Geoff Lang93561c32016-09-20 10:22:55 -04002349
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002350/* Allocates the stack if it does not exist.
2351 * Guarantees space for at least one push.
2352 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002353static void yyensure_buffer_stack (yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002354{
shannonwoods@chromium.orgb0757162013-05-30 00:21:27 +00002355 yy_size_t num_to_alloc;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002356 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2357
2358 if (!yyg->yy_buffer_stack) {
2359
2360 /* First allocation is just for 2 elements, since we don't know if this
2361 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2362 * immediate realloc on the next call.
2363 */
Geoff Lang93561c32016-09-20 10:22:55 -04002364 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002365 yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002366 (num_to_alloc * sizeof(struct yy_buffer_state*)
2367 , yyscanner);
2368 if ( ! yyg->yy_buffer_stack )
Corentin Wallez168d5e82017-02-01 12:18:56 -08002369 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2370
2371
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002372 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
Corentin Wallez168d5e82017-02-01 12:18:56 -08002373
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002374 yyg->yy_buffer_stack_max = num_to_alloc;
2375 yyg->yy_buffer_stack_top = 0;
2376 return;
2377 }
2378
2379 if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
2380
2381 /* Increase the buffer to prepare for a possible push. */
Geoff Lang93561c32016-09-20 10:22:55 -04002382 yy_size_t grow_size = 8 /* arbitrary grow size */;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002383
2384 num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
Corentin Wallez168d5e82017-02-01 12:18:56 -08002385 yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002386 (yyg->yy_buffer_stack,
2387 num_to_alloc * sizeof(struct yy_buffer_state*)
2388 , yyscanner);
2389 if ( ! yyg->yy_buffer_stack )
Corentin Wallez168d5e82017-02-01 12:18:56 -08002390 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002391
2392 /* zero only the new slots.*/
2393 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
2394 yyg->yy_buffer_stack_max = num_to_alloc;
2395 }
2396}
2397
Geoff Lang93561c32016-09-20 10:22:55 -04002398
2399
2400
2401
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002402/** Setup the input buffer state to scan directly from a user-specified character buffer.
2403 * @param base the character buffer
2404 * @param size the size in bytes of the character buffer
2405 * @param yyscanner The scanner object.
Corentin Wallez168d5e82017-02-01 12:18:56 -08002406 * @return the newly allocated buffer state object.
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002407 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002408YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002409{
2410 YY_BUFFER_STATE b;
2411
2412 if ( size < 2 ||
2413 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2414 base[size-1] != YY_END_OF_BUFFER_CHAR )
2415 /* They forgot to leave room for the EOB's. */
Geoff Lang93561c32016-09-20 10:22:55 -04002416 return NULL;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002417
Corentin Wallez168d5e82017-02-01 12:18:56 -08002418 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002419 if ( ! b )
Corentin Wallez168d5e82017-02-01 12:18:56 -08002420 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002421
Corentin Wallez168d5e82017-02-01 12:18:56 -08002422 b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002423 b->yy_buf_pos = b->yy_ch_buf = base;
2424 b->yy_is_our_buffer = 0;
Geoff Lang93561c32016-09-20 10:22:55 -04002425 b->yy_input_file = NULL;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002426 b->yy_n_chars = b->yy_buf_size;
2427 b->yy_is_interactive = 0;
2428 b->yy_at_bol = 1;
2429 b->yy_fill_buffer = 0;
2430 b->yy_buffer_status = YY_BUFFER_NEW;
2431
Corentin Wallez168d5e82017-02-01 12:18:56 -08002432 yy_switch_to_buffer( b , yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002433
2434 return b;
2435}
2436
Geoff Lang93561c32016-09-20 10:22:55 -04002437
2438
2439
Corentin Wallez168d5e82017-02-01 12:18:56 -08002440/** Setup the input buffer state to scan a string. The next call to yylex() will
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002441 * scan from a @e copy of @a str.
2442 * @param yystr a NUL-terminated string to scan
2443 * @param yyscanner The scanner object.
2444 * @return the newly allocated buffer state object.
2445 * @note If you want to scan bytes that may contain NUL values, then use
Corentin Wallez168d5e82017-02-01 12:18:56 -08002446 * yy_scan_bytes() instead.
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002447 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002448YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002449{
2450
Corentin Wallez168d5e82017-02-01 12:18:56 -08002451 return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002452}
2453
Geoff Lang93561c32016-09-20 10:22:55 -04002454
2455
2456
Corentin Wallez168d5e82017-02-01 12:18:56 -08002457/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002458 * scan from a @e copy of @a bytes.
Zhenyao Mof1d723c2013-09-23 14:57:07 -04002459 * @param yybytes the byte buffer to scan
2460 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002461 * @param yyscanner The scanner object.
2462 * @return the newly allocated buffer state object.
2463 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002464YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002465{
2466 YY_BUFFER_STATE b;
2467 char *buf;
Zhenyao Mof1d723c2013-09-23 14:57:07 -04002468 yy_size_t n;
Corentin Wallez168d5e82017-02-01 12:18:56 -08002469 int i;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002470
2471 /* Get memory for full buffer, including space for trailing EOB's. */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002472 n = (yy_size_t) (_yybytes_len + 2);
2473 buf = (char *) yyalloc( n , yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002474 if ( ! buf )
Corentin Wallez168d5e82017-02-01 12:18:56 -08002475 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002476
Corentin Wallez168d5e82017-02-01 12:18:56 -08002477 for ( i = 0; i < _yybytes_len; ++i )
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002478 buf[i] = yybytes[i];
2479
2480 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2481
Corentin Wallez168d5e82017-02-01 12:18:56 -08002482 b = yy_scan_buffer( buf, n , yyscanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002483 if ( ! b )
Corentin Wallez168d5e82017-02-01 12:18:56 -08002484 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002485
2486 /* It's okay to grow etc. this buffer, and we should throw it
2487 * away when we're done.
2488 */
2489 b->yy_is_our_buffer = 1;
2490
2491 return b;
2492}
2493
Geoff Lang93561c32016-09-20 10:22:55 -04002494
2495
2496
2497
2498
2499
2500
2501
2502
2503
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002504#ifndef YY_EXIT_FAILURE
2505#define YY_EXIT_FAILURE 2
2506#endif
2507
Corentin Wallez168d5e82017-02-01 12:18:56 -08002508static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002509{
Geoff Lang93561c32016-09-20 10:22:55 -04002510 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2511 (void)yyg;
Corentin Wallez168d5e82017-02-01 12:18:56 -08002512 fprintf( stderr, "%s\n", msg );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002513 exit( YY_EXIT_FAILURE );
2514}
2515
2516/* Redefine yyless() so it works in section 3 code. */
2517
2518#undef yyless
2519#define yyless(n) \
2520 do \
2521 { \
2522 /* Undo effects of setting up yytext. */ \
2523 int yyless_macro_arg = (n); \
2524 YY_LESS_LINENO(yyless_macro_arg);\
2525 yytext[yyleng] = yyg->yy_hold_char; \
2526 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
2527 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
2528 *yyg->yy_c_buf_p = '\0'; \
2529 yyleng = yyless_macro_arg; \
2530 } \
2531 while ( 0 )
2532
Geoff Lang93561c32016-09-20 10:22:55 -04002533
2534
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002535/* Accessor methods (get/set functions) to struct members. */
2536
Geoff Lang93561c32016-09-20 10:22:55 -04002537
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002538/** Get the user-defined data for this scanner.
2539 * @param yyscanner The scanner object.
2540 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002541YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002542{
2543 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2544 return yyextra;
2545}
2546
Geoff Lang93561c32016-09-20 10:22:55 -04002547
2548
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002549/** Get the current line number.
2550 * @param yyscanner The scanner object.
2551 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002552int yyget_lineno (yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002553{
2554 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
Corentin Wallez168d5e82017-02-01 12:18:56 -08002555
Geoff Lang93561c32016-09-20 10:22:55 -04002556
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002557 if (! YY_CURRENT_BUFFER)
2558 return 0;
2559
2560 return yylineno;
2561}
2562
Geoff Lang93561c32016-09-20 10:22:55 -04002563
2564
2565
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002566/** Get the current column number.
2567 * @param yyscanner The scanner object.
2568 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002569int yyget_column (yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002570{
2571 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
Corentin Wallez168d5e82017-02-01 12:18:56 -08002572
Geoff Lang93561c32016-09-20 10:22:55 -04002573
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002574 if (! YY_CURRENT_BUFFER)
2575 return 0;
2576
2577 return yycolumn;
2578}
2579
Geoff Lang93561c32016-09-20 10:22:55 -04002580
2581
2582
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002583/** Get the input stream.
2584 * @param yyscanner The scanner object.
2585 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002586FILE *yyget_in (yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002587{
2588 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2589 return yyin;
2590}
2591
Geoff Lang93561c32016-09-20 10:22:55 -04002592
2593
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002594/** Get the output stream.
2595 * @param yyscanner The scanner object.
2596 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002597FILE *yyget_out (yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002598{
2599 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2600 return yyout;
2601}
2602
Geoff Lang93561c32016-09-20 10:22:55 -04002603
2604
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002605/** Get the length of the current token.
2606 * @param yyscanner The scanner object.
2607 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002608int yyget_leng (yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002609{
2610 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2611 return yyleng;
2612}
2613
Geoff Lang93561c32016-09-20 10:22:55 -04002614
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002615/** Get the current token.
2616 * @param yyscanner The scanner object.
2617 */
2618
Corentin Wallez168d5e82017-02-01 12:18:56 -08002619char *yyget_text (yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002620{
2621 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2622 return yytext;
2623}
2624
Geoff Lang93561c32016-09-20 10:22:55 -04002625
2626
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002627/** Set the user-defined data. This data is never touched by the scanner.
2628 * @param user_defined The data to be associated with this scanner.
2629 * @param yyscanner The scanner object.
2630 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002631void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002632{
2633 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2634 yyextra = user_defined ;
2635}
2636
Geoff Lang93561c32016-09-20 10:22:55 -04002637
2638
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002639/** Set the current line number.
Geoff Lang93561c32016-09-20 10:22:55 -04002640 * @param _line_number line number
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002641 * @param yyscanner The scanner object.
2642 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002643void yyset_lineno (int _line_number , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002644{
2645 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2646
Geoff Lang93561c32016-09-20 10:22:55 -04002647
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002648 /* lineno is only valid if an input buffer exists. */
2649 if (! YY_CURRENT_BUFFER )
Corentin Wallez168d5e82017-02-01 12:18:56 -08002650 YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002651
Geoff Lang93561c32016-09-20 10:22:55 -04002652 yylineno = _line_number;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002653}
2654
Geoff Lang93561c32016-09-20 10:22:55 -04002655
2656
2657
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002658/** Set the current column.
Geoff Lang93561c32016-09-20 10:22:55 -04002659 * @param _column_no column number
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002660 * @param yyscanner The scanner object.
2661 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002662void yyset_column (int _column_no , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002663{
2664 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2665
Geoff Lang93561c32016-09-20 10:22:55 -04002666
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002667 /* column is only valid if an input buffer exists. */
2668 if (! YY_CURRENT_BUFFER )
Corentin Wallez168d5e82017-02-01 12:18:56 -08002669 YY_FATAL_ERROR( "yyset_column called with no buffer" );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002670
Geoff Lang93561c32016-09-20 10:22:55 -04002671 yycolumn = _column_no;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002672}
2673
Geoff Lang93561c32016-09-20 10:22:55 -04002674
2675
2676
2677
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002678/** Set the input stream. This does not discard the current
2679 * input buffer.
Geoff Lang93561c32016-09-20 10:22:55 -04002680 * @param _in_str A readable stream.
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002681 * @param yyscanner The scanner object.
Corentin Wallez168d5e82017-02-01 12:18:56 -08002682 * @see yy_switch_to_buffer
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002683 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002684void yyset_in (FILE * _in_str , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002685{
2686 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
Geoff Lang93561c32016-09-20 10:22:55 -04002687 yyin = _in_str ;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002688}
2689
Geoff Lang93561c32016-09-20 10:22:55 -04002690
2691
Corentin Wallez168d5e82017-02-01 12:18:56 -08002692void yyset_out (FILE * _out_str , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002693{
2694 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
Geoff Lang93561c32016-09-20 10:22:55 -04002695 yyout = _out_str ;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002696}
2697
Geoff Lang93561c32016-09-20 10:22:55 -04002698
2699
2700
Corentin Wallez168d5e82017-02-01 12:18:56 -08002701int yyget_debug (yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002702{
2703 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2704 return yy_flex_debug;
2705}
2706
Geoff Lang93561c32016-09-20 10:22:55 -04002707
2708
Corentin Wallez168d5e82017-02-01 12:18:56 -08002709void yyset_debug (int _bdebug , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002710{
2711 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
Geoff Lang93561c32016-09-20 10:22:55 -04002712 yy_flex_debug = _bdebug ;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002713}
2714
Geoff Lang93561c32016-09-20 10:22:55 -04002715
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002716/* Accessor methods for yylval and yylloc */
2717
Geoff Lang93561c32016-09-20 10:22:55 -04002718
Corentin Wallez168d5e82017-02-01 12:18:56 -08002719YYSTYPE * yyget_lval (yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002720{
2721 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2722 return yylval;
2723}
2724
Geoff Lang93561c32016-09-20 10:22:55 -04002725
2726
Corentin Wallez168d5e82017-02-01 12:18:56 -08002727void yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002728{
2729 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2730 yylval = yylval_param;
2731}
2732
Geoff Lang93561c32016-09-20 10:22:55 -04002733
2734
2735
Corentin Wallez168d5e82017-02-01 12:18:56 -08002736YYLTYPE *yyget_lloc (yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002737{
2738 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2739 return yylloc;
2740}
2741
Geoff Lang93561c32016-09-20 10:22:55 -04002742
2743
Corentin Wallez168d5e82017-02-01 12:18:56 -08002744void yyset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002745{
2746 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2747 yylloc = yylloc_param;
2748}
2749
Geoff Lang93561c32016-09-20 10:22:55 -04002750
2751
2752
2753
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002754/* User-visible API */
2755
Corentin Wallez168d5e82017-02-01 12:18:56 -08002756/* yylex_init is special because it creates the scanner itself, so it is
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002757 * the ONLY reentrant function that doesn't take the scanner as the last argument.
2758 * That's why we explicitly handle the declaration, instead of using our macros.
2759 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002760int yylex_init(yyscan_t* ptr_yy_globals)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002761{
2762 if (ptr_yy_globals == NULL){
2763 errno = EINVAL;
2764 return 1;
2765 }
2766
Corentin Wallez168d5e82017-02-01 12:18:56 -08002767 *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002768
2769 if (*ptr_yy_globals == NULL){
2770 errno = ENOMEM;
2771 return 1;
2772 }
2773
2774 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
2775 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2776
2777 return yy_init_globals ( *ptr_yy_globals );
2778}
2779
Geoff Lang93561c32016-09-20 10:22:55 -04002780
Corentin Wallez168d5e82017-02-01 12:18:56 -08002781/* yylex_init_extra has the same functionality as yylex_init, but follows the
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002782 * convention of taking the scanner as the last argument. Note however, that
2783 * this is a *pointer* to a scanner, as it will be allocated by this call (and
2784 * is the reason, too, why this function also must handle its own declaration).
Corentin Wallez168d5e82017-02-01 12:18:56 -08002785 * The user defined value in the first argument will be available to yyalloc in
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002786 * the yyextra field.
2787 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002788int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002789{
2790 struct yyguts_t dummy_yyguts;
2791
Corentin Wallez168d5e82017-02-01 12:18:56 -08002792 yyset_extra (yy_user_defined, &dummy_yyguts);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002793
2794 if (ptr_yy_globals == NULL){
2795 errno = EINVAL;
2796 return 1;
2797 }
Corentin Wallez168d5e82017-02-01 12:18:56 -08002798
2799 *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
2800
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002801 if (*ptr_yy_globals == NULL){
2802 errno = ENOMEM;
2803 return 1;
2804 }
Corentin Wallez168d5e82017-02-01 12:18:56 -08002805
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002806 /* By setting to 0xAA, we expose bugs in
2807 yy_init_globals. Leave at 0x00 for releases. */
2808 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
Corentin Wallez168d5e82017-02-01 12:18:56 -08002809
2810 yyset_extra (yy_user_defined, *ptr_yy_globals);
2811
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002812 return yy_init_globals ( *ptr_yy_globals );
2813}
2814
Geoff Lang93561c32016-09-20 10:22:55 -04002815
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002816static int yy_init_globals (yyscan_t yyscanner)
2817{
2818 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2819 /* Initialization is the same as for the non-reentrant scanner.
Corentin Wallez168d5e82017-02-01 12:18:56 -08002820 * This function is called from yylex_destroy(), so don't allocate here.
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002821 */
2822
Geoff Lang93561c32016-09-20 10:22:55 -04002823
2824 yyg->yy_buffer_stack = NULL;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002825 yyg->yy_buffer_stack_top = 0;
2826 yyg->yy_buffer_stack_max = 0;
Geoff Lang93561c32016-09-20 10:22:55 -04002827 yyg->yy_c_buf_p = NULL;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002828 yyg->yy_init = 0;
2829 yyg->yy_start = 0;
2830
Geoff Lang93561c32016-09-20 10:22:55 -04002831
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002832 yyg->yy_start_stack_ptr = 0;
2833 yyg->yy_start_stack_depth = 0;
2834 yyg->yy_start_stack = NULL;
2835
Geoff Lang93561c32016-09-20 10:22:55 -04002836
2837
2838
2839
2840
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002841/* Defined in main.c */
2842#ifdef YY_STDINIT
2843 yyin = stdin;
2844 yyout = stdout;
2845#else
Geoff Lang93561c32016-09-20 10:22:55 -04002846 yyin = NULL;
2847 yyout = NULL;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002848#endif
2849
2850 /* For future reference: Set errno on error, since we are called by
Corentin Wallez168d5e82017-02-01 12:18:56 -08002851 * yylex_init()
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002852 */
2853 return 0;
2854}
2855
Geoff Lang93561c32016-09-20 10:22:55 -04002856
Corentin Wallez168d5e82017-02-01 12:18:56 -08002857/* yylex_destroy is for both reentrant and non-reentrant scanners. */
2858int yylex_destroy (yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002859{
2860 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2861
2862 /* Pop the buffer stack, destroying each element. */
2863 while(YY_CURRENT_BUFFER){
Corentin Wallez168d5e82017-02-01 12:18:56 -08002864 yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002865 YY_CURRENT_BUFFER_LVALUE = NULL;
Corentin Wallez168d5e82017-02-01 12:18:56 -08002866 yypop_buffer_state(yyscanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002867 }
2868
2869 /* Destroy the stack itself. */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002870 yyfree(yyg->yy_buffer_stack , yyscanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002871 yyg->yy_buffer_stack = NULL;
2872
Geoff Lang93561c32016-09-20 10:22:55 -04002873
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002874 /* Destroy the start condition stack. */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002875 yyfree( yyg->yy_start_stack , yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002876 yyg->yy_start_stack = NULL;
2877
Geoff Lang93561c32016-09-20 10:22:55 -04002878
2879
2880
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002881 /* Reset the globals. This is important in a non-reentrant scanner so the next time
Corentin Wallez168d5e82017-02-01 12:18:56 -08002882 * yylex() is called, initialization will occur. */
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002883 yy_init_globals( yyscanner);
2884
2885 /* Destroy the main struct (reentrant only). */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002886 yyfree ( yyscanner , yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002887 yyscanner = NULL;
2888 return 0;
2889}
2890
Geoff Lang93561c32016-09-20 10:22:55 -04002891
2892
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002893/*
2894 * Internal utility routines.
2895 */
2896
Geoff Lang93561c32016-09-20 10:22:55 -04002897
2898
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002899#ifndef yytext_ptr
Corentin Wallez168d5e82017-02-01 12:18:56 -08002900static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002901{
Geoff Lang93561c32016-09-20 10:22:55 -04002902 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2903 (void)yyg;
2904
2905 int i;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002906 for ( i = 0; i < n; ++i )
2907 s1[i] = s2[i];
2908}
2909#endif
2910
Geoff Lang93561c32016-09-20 10:22:55 -04002911
2912
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002913#ifdef YY_NEED_STRLEN
Corentin Wallez168d5e82017-02-01 12:18:56 -08002914static int yy_flex_strlen (const char * s , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002915{
Geoff Lang93561c32016-09-20 10:22:55 -04002916 int n;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002917 for ( n = 0; s[n]; ++n )
2918 ;
2919
2920 return n;
2921}
2922#endif
2923
Geoff Lang93561c32016-09-20 10:22:55 -04002924
2925
Corentin Wallez168d5e82017-02-01 12:18:56 -08002926void *yyalloc (yy_size_t size , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002927{
Geoff Lang93561c32016-09-20 10:22:55 -04002928 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2929 (void)yyg;
2930 return malloc(size);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002931}
2932
Geoff Lang93561c32016-09-20 10:22:55 -04002933
2934
Corentin Wallez168d5e82017-02-01 12:18:56 -08002935void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002936{
Geoff Lang93561c32016-09-20 10:22:55 -04002937 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2938 (void)yyg;
2939
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002940 /* The cast to (char *) in the following accommodates both
2941 * implementations that use char* generic pointers, and those
2942 * that use void* generic pointers. It works with the latter
2943 * because both ANSI C and C++ allow castless assignment from
2944 * any pointer type to void*, and deal with argument conversions
2945 * as though doing an assignment.
2946 */
Geoff Lang93561c32016-09-20 10:22:55 -04002947 return realloc(ptr, size);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002948}
2949
Geoff Lang93561c32016-09-20 10:22:55 -04002950
2951
Corentin Wallez168d5e82017-02-01 12:18:56 -08002952void yyfree (void * ptr , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002953{
Geoff Lang93561c32016-09-20 10:22:55 -04002954 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2955 (void)yyg;
Corentin Wallez168d5e82017-02-01 12:18:56 -08002956 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002957}
2958
Geoff Lang93561c32016-09-20 10:22:55 -04002959
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002960#define YYTABLES_NAME "yytables"
2961
Geoff Lang93561c32016-09-20 10:22:55 -04002962
2963
2964
2965
2966
2967
2968
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002969namespace pp {
2970
Corentin Wallez054f7ed2016-09-20 17:15:59 -04002971Tokenizer::Tokenizer(Diagnostics *diagnostics) : mHandle(nullptr), mMaxTokenSize(256)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002972{
alokp@chromium.org2c958ee2012-05-17 20:35:42 +00002973 mContext.diagnostics = diagnostics;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002974}
2975
2976Tokenizer::~Tokenizer()
2977{
2978 destroyScanner();
2979}
2980
Zhenyao Mod526f982014-05-13 14:51:19 -07002981bool Tokenizer::init(size_t count, const char * const string[], const int length[])
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002982{
Zhenyao Mod526f982014-05-13 14:51:19 -07002983 if ((count > 0) && (string == 0))
2984 return false;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002985
2986 mContext.input = Input(count, string, length);
2987 return initScanner();
2988}
2989
alokp@chromium.org46aa13d2012-06-15 15:40:27 +00002990void Tokenizer::setFileNumber(int file)
2991{
2992 // We use column number as file number.
2993 // See macro yyfileno.
Corentin Wallez168d5e82017-02-01 12:18:56 -08002994 yyset_column(file, mHandle);
alokp@chromium.org46aa13d2012-06-15 15:40:27 +00002995}
2996
2997void Tokenizer::setLineNumber(int line)
2998{
Corentin Wallez168d5e82017-02-01 12:18:56 -08002999 yyset_lineno(line, mHandle);
alokp@chromium.org46aa13d2012-06-15 15:40:27 +00003000}
3001
Jamie Madill5508f392014-02-20 13:31:36 -05003002void Tokenizer::setMaxTokenSize(size_t maxTokenSize)
3003{
3004 mMaxTokenSize = maxTokenSize;
3005}
3006
Zhenyao Mod526f982014-05-13 14:51:19 -07003007void Tokenizer::lex(Token *token)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00003008{
Corentin Wallez168d5e82017-02-01 12:18:56 -08003009 token->type = yylex(&token->text, &token->location, mHandle);
Jamie Madill5508f392014-02-20 13:31:36 -05003010 if (token->text.size() > mMaxTokenSize)
alokp@chromium.orgc022c3a2012-07-09 15:56:42 +00003011 {
Shannon Woods7f2d7942013-11-19 15:07:58 -05003012 mContext.diagnostics->report(Diagnostics::PP_TOKEN_TOO_LONG,
alokp@chromium.orgc022c3a2012-07-09 15:56:42 +00003013 token->location, token->text);
Jamie Madill5508f392014-02-20 13:31:36 -05003014 token->text.erase(mMaxTokenSize);
alokp@chromium.orgc022c3a2012-07-09 15:56:42 +00003015 }
3016
alokp@chromium.org7fc38dd2012-06-14 18:23:23 +00003017 token->flags = 0;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00003018
alokp@chromium.org19d7aa62012-05-31 17:34:05 +00003019 token->setAtStartOfLine(mContext.lineStart);
3020 mContext.lineStart = token->type == '\n';
3021
alokp@chromium.org04d7d222012-05-16 19:24:07 +00003022 token->setHasLeadingSpace(mContext.leadingSpace);
3023 mContext.leadingSpace = false;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00003024}
3025
3026bool Tokenizer::initScanner()
3027{
Corentin Wallez168d5e82017-02-01 12:18:56 -08003028 if ((mHandle == nullptr) && yylex_init_extra(&mContext, &mHandle))
alokp@chromium.org04d7d222012-05-16 19:24:07 +00003029 return false;
3030
Corentin Wallez168d5e82017-02-01 12:18:56 -08003031 yyrestart(0, mHandle);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00003032 return true;
3033}
3034
3035void Tokenizer::destroyScanner()
3036{
Corentin Wallez054f7ed2016-09-20 17:15:59 -04003037 if (mHandle == nullptr)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00003038 return;
3039
Corentin Wallez168d5e82017-02-01 12:18:56 -08003040 yylex_destroy(mHandle);
Corentin Wallez054f7ed2016-09-20 17:15:59 -04003041 mHandle = nullptr;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00003042}
3043
3044} // namespace pp
3045
Geoff Lang93561c32016-09-20 10:22:55 -04003046