blob: 2760a562387304d72b66444c0d39285dcbfc3628 [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
Luc Ferrone49f1e92018-01-24 14:47:55 -050052
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
Luc Ferrone49f1e92018-01-24 14:47:55 -050059
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
Luc Ferrone49f1e92018-01-24 14:47:55 -050066
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
Luc Ferrone49f1e92018-01-24 14:47:55 -050073
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
Luc Ferrone49f1e92018-01-24 14:47:55 -050080
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
Luc Ferrone49f1e92018-01-24 14:47:55 -050087
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
Luc Ferrone49f1e92018-01-24 14:47:55 -050094
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
Luc Ferrone49f1e92018-01-24 14:47:55 -0500101
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
Luc Ferrone49f1e92018-01-24 14:47:55 -0500108
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
Luc Ferrone49f1e92018-01-24 14:47:55 -0500115
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
Luc Ferrone49f1e92018-01-24 14:47:55 -0500122
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
Luc Ferrone49f1e92018-01-24 14:47:55 -0500129
Corentin Wallez168d5e82017-02-01 12:18:56 -0800130#ifdef yylex
131#define pplex_ALREADY_DEFINED
132#else
133#define yylex pplex
134#endif
135
Luc Ferrone49f1e92018-01-24 14:47:55 -0500136
Corentin Wallez168d5e82017-02-01 12:18:56 -0800137#ifdef yyrestart
138#define pprestart_ALREADY_DEFINED
139#else
140#define yyrestart pprestart
141#endif
142
Luc Ferrone49f1e92018-01-24 14:47:55 -0500143
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
Luc Ferrone49f1e92018-01-24 14:47:55 -0500150
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
Luc Ferrone49f1e92018-01-24 14:47:55 -0500157
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
Luc Ferrone49f1e92018-01-24 14:47:55 -0500164
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
Luc Ferrone49f1e92018-01-24 14:47:55 -0500171
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
Luc Ferrone49f1e92018-01-24 14:47:55 -0500178
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
Luc Ferrone49f1e92018-01-24 14:47:55 -0500185
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
Luc Ferrone49f1e92018-01-24 14:47:55 -0500192
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
Luc Ferrone49f1e92018-01-24 14:47:55 -0500199
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
Luc Ferrone49f1e92018-01-24 14:47:55 -0500206
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
Luc Ferrone49f1e92018-01-24 14:47:55 -0500213
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
Luc Ferrone49f1e92018-01-24 14:47:55 -0500220
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
Luc Ferrone49f1e92018-01-24 14:47:55 -0500227
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
Luc Ferrone49f1e92018-01-24 14:47:55 -0500234
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
Luc Ferrone49f1e92018-01-24 14:47:55 -0500241
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
Luc Ferrone49f1e92018-01-24 14:47:55 -0500248
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
Luc Ferrone49f1e92018-01-24 14:47:55 -0500256
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
Luc Ferrone49f1e92018-01-24 14:47:55 -0500263
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
Luc Ferrone49f1e92018-01-24 14:47:55 -0500271
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
Luc Ferrone49f1e92018-01-24 14:47:55 -0500281
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
Luc Ferrone49f1e92018-01-24 14:47:55 -0500288
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
Luc Ferrone49f1e92018-01-24 14:47:55 -0500298
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
Luc Ferrone49f1e92018-01-24 14:47:55 -0500314
Corentin Wallez168d5e82017-02-01 12:18:56 -0800315#ifdef yyrealloc
316#define pprealloc_ALREADY_DEFINED
317#else
318#define yyrealloc pprealloc
319#endif
320
Luc Ferrone49f1e92018-01-24 14:47:55 -0500321
Corentin Wallez168d5e82017-02-01 12:18:56 -0800322#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,
Luc Ferrone49f1e92018-01-24 14:47:55 -0500356 * if you want the limit (max/min) macros for int types.
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000357 */
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;
Luc Ferrone49f1e92018-01-24 14:47:55 -0500373typedef unsigned char flex_uint8_t;
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000374typedef 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
Luc Ferrone49f1e92018-01-24 14:47:55 -0500538
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)
Luc Ferrone49f1e92018-01-24 14:47:55 -0500541
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000542/* 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;
Corentin Wallezdc0fa462017-02-01 14:44:43 -0500727#define YY_NUM_RULES 37
728#define YY_END_OF_BUFFER 38
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 Wallezdc0fa462017-02-01 14:44:43 -0500736static const flex_int16_t yy_accept[95] =
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000737 { 0,
Corentin Wallezdc0fa462017-02-01 14:44:43 -0500738 0, 0, 0, 0, 38, 36, 34, 35, 35, 33,
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000739 7, 33, 33, 33, 33, 33, 33, 33, 33, 9,
Corentin Wallezdc0fa462017-02-01 14:44:43 -0500740 9, 33, 33, 33, 8, 33, 33, 3, 5, 5,
741 4, 34, 35, 19, 27, 20, 30, 25, 12, 23,
742 13, 24, 10, 2, 1, 26, 10, 9, 11, 11,
743 11, 9, 11, 9, 9, 14, 16, 18, 17, 15,
744 8, 31, 21, 32, 22, 3, 5, 6, 11, 10,
745 11, 10, 1, 10, 11, 10, 0, 10, 9, 9,
746 9, 28, 29, 0, 10, 10, 10, 10, 9, 10,
747 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,
Corentin Wallezdc0fa462017-02-01 14:44:43 -0500762 9, 1, 9, 27, 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,
Corentin Wallezdc0fa462017-02-01 14:44:43 -0500766 24, 24, 9, 28, 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 Wallezdc0fa462017-02-01 14:44:43 -0500783static const YY_CHAR yy_meta[29] =
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,
Corentin Wallezdc0fa462017-02-01 14:44:43 -0500787 5, 5, 5, 5, 5, 5, 1, 1
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000788 } ;
789
Corentin Wallezdc0fa462017-02-01 14:44:43 -0500790static const flex_int16_t yy_base[100] =
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000791 { 0,
Corentin Wallezdc0fa462017-02-01 14:44:43 -0500792 0, 0, 26, 28, 133, 195, 130, 195, 128, 105,
793 195, 104, 25, 195, 100, 23, 27, 32, 31, 38,
794 50, 38, 93, 49, 0, 16, 51, 0, 195, 105,
795 87, 93, 195, 195, 195, 195, 195, 195, 195, 195,
796 195, 195, 67, 195, 0, 195, 81, 55, 84, 98,
797 110, 53, 61, 0, 52, 39, 195, 195, 195, 33,
798 0, 195, 195, 195, 195, 0, 195, 195, 113, 0,
799 126, 0, 0, 0, 133, 0, 56, 128, 0, 133,
800 0, 195, 195, 101, 141, 143, 145, 0, 15, 154,
801 195, 0, 195, 195, 177, 32, 182, 187, 189
shannon.woods%transgaming.com@gtempaccount.combcde56f2013-04-13 03:32:12 +0000802
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000803 } ;
804
Corentin Wallezdc0fa462017-02-01 14:44:43 -0500805static const flex_int16_t yy_def[100] =
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000806 { 0,
Corentin Wallezdc0fa462017-02-01 14:44:43 -0500807 94, 1, 95, 95, 94, 94, 94, 94, 94, 94,
808 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
809 20, 94, 94, 94, 96, 94, 94, 97, 94, 94,
810 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
811 94, 94, 94, 94, 98, 94, 94, 20, 20, 49,
812 50, 50, 99, 21, 50, 94, 94, 94, 94, 94,
813 96, 94, 94, 94, 94, 97, 94, 94, 43, 43,
814 69, 69, 98, 47, 50, 50, 94, 51, 50, 99,
815 50, 94, 94, 94, 71, 75, 94, 50, 50, 94,
816 94, 50, 94, 0, 94, 94, 94, 94, 94
shannon.woods%transgaming.com@gtempaccount.combcde56f2013-04-13 03:32:12 +0000817
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000818 } ;
819
Corentin Wallez168d5e82017-02-01 12:18:56 -0800820static const flex_int16_t yy_nxt[224] =
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000821 { 0,
822 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
823 16, 17, 18, 19, 20, 21, 21, 22, 23, 24,
Corentin Wallezdc0fa462017-02-01 14:44:43 -0500824 25, 25, 25, 25, 25, 25, 26, 27, 29, 30,
825 29, 30, 36, 39, 62, 31, 61, 31, 41, 92,
826 44, 40, 63, 37, 45, 42, 43, 43, 43, 46,
827 47, 83, 48, 48, 49, 56, 57, 82, 50, 51,
828 50, 50, 52, 53, 54, 54, 54, 59, 60, 64,
829 87, 87, 87, 50, 55, 50, 81, 79, 65, 69,
830 50, 70, 70, 70, 50, 50, 50, 69, 71, 72,
831 69, 69, 69, 50, 32, 74, 74, 74, 49, 49,
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000832
Corentin Wallezdc0fa462017-02-01 14:44:43 -0500833 68, 50, 75, 76, 50, 50, 50, 67, 50, 50,
834 50, 58, 50, 50, 50, 90, 90, 90, 38, 50,
835 77, 77, 35, 34, 78, 78, 78, 69, 69, 69,
836 33, 32, 94, 94, 69, 69, 84, 84, 94, 94,
837 85, 85, 85, 84, 84, 50, 94, 86, 86, 86,
838 88, 94, 94, 94, 94, 94, 50, 89, 50, 87,
839 87, 87, 94, 72, 94, 76, 94, 91, 90, 90,
840 90, 94, 94, 94, 94, 94, 93, 28, 28, 28,
841 28, 28, 66, 94, 94, 66, 66, 73, 94, 73,
842 73, 73, 80, 80, 5, 94, 94, 94, 94, 94,
shannonwoods@chromium.orgc8100b82013-05-30 00:20:34 +0000843
Corentin Wallezdc0fa462017-02-01 14:44:43 -0500844 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
845 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
846 94, 94, 94
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000847 } ;
848
Corentin Wallez168d5e82017-02-01 12:18:56 -0800849static const flex_int16_t yy_chk[224] =
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000850 { 0,
851 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
852 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Corentin Wallezdc0fa462017-02-01 14:44:43 -0500853 1, 1, 1, 1, 1, 1, 1, 1, 3, 3,
854 4, 4, 13, 16, 26, 3, 96, 4, 17, 89,
855 19, 16, 26, 13, 19, 17, 18, 18, 18, 19,
856 20, 60, 20, 20, 20, 22, 22, 56, 20, 20,
857 20, 20, 20, 20, 21, 21, 21, 24, 24, 27,
858 77, 77, 77, 53, 21, 21, 55, 52, 27, 43,
859 48, 43, 43, 43, 53, 53, 53, 43, 43, 43,
860 43, 43, 43, 47, 32, 47, 47, 47, 49, 49,
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000861
Corentin Wallezdc0fa462017-02-01 14:44:43 -0500862 31, 47, 47, 47, 47, 47, 47, 30, 49, 49,
863 50, 23, 50, 50, 50, 84, 84, 84, 15, 50,
864 51, 51, 12, 10, 51, 51, 51, 69, 69, 69,
865 9, 7, 5, 0, 69, 69, 71, 71, 78, 78,
866 71, 71, 71, 75, 75, 80, 0, 75, 75, 75,
867 78, 85, 85, 86, 86, 0, 80, 80, 80, 87,
868 87, 87, 0, 85, 0, 86, 0, 87, 90, 90,
869 90, 0, 0, 0, 0, 0, 90, 95, 95, 95,
870 95, 95, 97, 0, 0, 97, 97, 98, 0, 98,
871 98, 98, 99, 99, 94, 94, 94, 94, 94, 94,
shannonwoods@chromium.orgc8100b82013-05-30 00:20:34 +0000872
Corentin Wallezdc0fa462017-02-01 14:44:43 -0500873 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
874 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
875 94, 94, 94
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000876 } ;
877
878/* The intent behind this definition is that it'll catch
879 * any uses of REJECT which flex missed.
880 */
881#define REJECT reject_used_but_not_detected
882#define yymore() yymore_used_but_not_detected
883#define YY_MORE_ADJ 0
884#define YY_RESTORE_YY_MORE_OFFSET
885/*
886//
Jamie Madill88f6e942014-02-19 10:27:53 -0500887// Copyright (c) 2002-2014 The ANGLE Project Authors. All rights reserved.
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000888// Use of this source code is governed by a BSD-style license that can be
889// found in the LICENSE file.
890//
891
892This file contains the Lex specification for GLSL ES preprocessor.
893Based on Microsoft Visual Studio 2010 Preprocessor Grammar:
894http://msdn.microsoft.com/en-us/library/2scxys89.aspx
895
896IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN generate_parser.sh.
897*/
898
Scott Grahama8975422015-05-01 11:09:12 -0700899#if defined(_MSC_VER)
900#pragma warning(disable: 4005)
901#endif
902
Corentin Wallez054f7ed2016-09-20 17:15:59 -0400903#include "compiler/preprocessor/Tokenizer.h"
alokp@chromium.org2c958ee2012-05-17 20:35:42 +0000904
Corentin Wallez054f7ed2016-09-20 17:15:59 -0400905#include "compiler/preprocessor/DiagnosticsBase.h"
906#include "compiler/preprocessor/Token.h"
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000907
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +0000908#if defined(__GNUC__)
909// Triggered by the auto-generated yy_fatal_error function.
910#pragma GCC diagnostic ignored "-Wmissing-noreturn"
Minmin Gong794e0002015-04-07 18:31:54 -0700911#elif defined(_MSC_VER)
912#pragma warning(disable: 4244)
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +0000913#endif
Nico Weber41b072b2018-02-09 10:01:32 -0500914#if defined(__clang__)
915// Flex uses `/*FALLTHROUGH*/` instead of dedicated statements.
916#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
917#endif
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +0000918
Jamie Madill2dc8bf82015-04-30 15:56:52 -0400919// Workaround for flex using the register keyword, deprecated in C++11.
920#ifdef __cplusplus
921#if __cplusplus > 199711L
922#define register
923#endif
924#endif
925
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000926typedef std::string YYSTYPE;
alokp@chromium.org2c958ee2012-05-17 20:35:42 +0000927typedef pp::SourceLocation YYLTYPE;
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000928
929// Use the unused yycolumn variable to track file (string) number.
930#define yyfileno yycolumn
931
932#define YY_USER_INIT \
933 do { \
934 yyfileno = 0; \
935 yylineno = 1; \
936 yyextra->leadingSpace = false; \
937 yyextra->lineStart = true; \
938 } while(0);
939
U-GOOGLE\courtneygobab086a2018-03-30 16:08:42 -0600940#define YY_NO_INPUT
alokp@chromium.org19d7aa62012-05-31 17:34:05 +0000941#define YY_USER_ACTION \
942 do \
943 { \
944 pp::Input* input = &yyextra->input; \
945 pp::Input::Location* scanLoc = &yyextra->scanLoc; \
946 while ((scanLoc->sIndex < input->count()) && \
947 (scanLoc->cIndex >= input->length(scanLoc->sIndex))) \
948 { \
949 scanLoc->cIndex -= input->length(scanLoc->sIndex++); \
950 ++yyfileno; yylineno = 1; \
951 } \
952 yylloc->file = yyfileno; \
953 yylloc->line = yylineno; \
954 scanLoc->cIndex += yyleng; \
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000955 } while(0);
956
957#define YY_INPUT(buf, result, maxSize) \
Olli Etuaho26e355b2015-08-14 14:16:19 +0300958 result = yyextra->input.read(buf, maxSize, &yylineno);
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000959
Geoff Lang93561c32016-09-20 10:22:55 -0400960
961
962
963
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000964#define INITIAL 0
965#define COMMENT 1
966
Geoff Lang93561c32016-09-20 10:22:55 -0400967
968
969
970
971
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000972#define YY_EXTRA_TYPE pp::Tokenizer::Context*
973
Geoff Lang93561c32016-09-20 10:22:55 -0400974
975
976
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000977/* Holds the entire state of the reentrant scanner. */
978struct yyguts_t
979 {
980
981 /* User-defined. Not touched by flex. */
982 YY_EXTRA_TYPE yyextra_r;
983
984 /* The rest are the same as the globals declared in the non-reentrant scanner. */
985 FILE *yyin_r, *yyout_r;
986 size_t yy_buffer_stack_top; /**< index of top of stack. */
987 size_t yy_buffer_stack_max; /**< capacity of stack. */
988 YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
989 char yy_hold_char;
Geoff Lang93561c32016-09-20 10:22:55 -0400990 int yy_n_chars;
991 int yyleng_r;
alokp@chromium.org04d7d222012-05-16 19:24:07 +0000992 char *yy_c_buf_p;
993 int yy_init;
994 int yy_start;
995 int yy_did_buffer_switch_on_eof;
996 int yy_start_stack_ptr;
997 int yy_start_stack_depth;
998 int *yy_start_stack;
999 yy_state_type yy_last_accepting_state;
1000 char* yy_last_accepting_cpos;
1001
1002 int yylineno_r;
1003 int yy_flex_debug_r;
1004
Geoff Lang93561c32016-09-20 10:22:55 -04001005
1006
1007
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001008 char *yytext_r;
1009 int yy_more_flag;
1010 int yy_more_len;
1011
Geoff Lang93561c32016-09-20 10:22:55 -04001012
1013
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001014 YYSTYPE * yylval_r;
1015
Geoff Lang93561c32016-09-20 10:22:55 -04001016
1017
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001018 YYLTYPE * yylloc_r;
1019
Geoff Lang93561c32016-09-20 10:22:55 -04001020
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001021 }; /* end struct yyguts_t */
1022
Geoff Lang93561c32016-09-20 10:22:55 -04001023
1024
1025
Corentin Wallez168d5e82017-02-01 12:18:56 -08001026static int yy_init_globals ( yyscan_t yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001027
Luc Ferrone49f1e92018-01-24 14:47:55 -05001028
1029
1030
1031
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001032 /* This must go here because YYSTYPE and YYLTYPE are included
1033 * from bison output in section 1.*/
1034 # define yylval yyg->yylval_r
Luc Ferrone49f1e92018-01-24 14:47:55 -05001035
Geoff Lang93561c32016-09-20 10:22:55 -04001036
Luc Ferrone49f1e92018-01-24 14:47:55 -05001037
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001038 # define yylloc yyg->yylloc_r
Luc Ferrone49f1e92018-01-24 14:47:55 -05001039
1040
Geoff Lang93561c32016-09-20 10:22:55 -04001041
Corentin Wallez168d5e82017-02-01 12:18:56 -08001042int yylex_init (yyscan_t* scanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001043
Corentin Wallez168d5e82017-02-01 12:18:56 -08001044int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001045
Geoff Lang93561c32016-09-20 10:22:55 -04001046
1047
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001048/* Accessor methods to globals.
1049 These are made visible to non-reentrant scanners for convenience. */
1050
Geoff Lang93561c32016-09-20 10:22:55 -04001051
Corentin Wallez168d5e82017-02-01 12:18:56 -08001052int yylex_destroy ( yyscan_t yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001053
Geoff Lang93561c32016-09-20 10:22:55 -04001054
1055
Corentin Wallez168d5e82017-02-01 12:18:56 -08001056int yyget_debug ( yyscan_t yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001057
Geoff Lang93561c32016-09-20 10:22:55 -04001058
1059
Corentin Wallez168d5e82017-02-01 12:18:56 -08001060void yyset_debug ( int debug_flag , yyscan_t yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001061
Geoff Lang93561c32016-09-20 10:22:55 -04001062
1063
Corentin Wallez168d5e82017-02-01 12:18:56 -08001064YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001065
Geoff Lang93561c32016-09-20 10:22:55 -04001066
1067
Corentin Wallez168d5e82017-02-01 12:18:56 -08001068void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001069
Geoff Lang93561c32016-09-20 10:22:55 -04001070
1071
Corentin Wallez168d5e82017-02-01 12:18:56 -08001072FILE *yyget_in ( yyscan_t yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001073
Geoff Lang93561c32016-09-20 10:22:55 -04001074
1075
Corentin Wallez168d5e82017-02-01 12:18:56 -08001076void yyset_in ( FILE * _in_str , yyscan_t yyscanner );
Geoff Lang93561c32016-09-20 10:22:55 -04001077
1078
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001079
Corentin Wallez168d5e82017-02-01 12:18:56 -08001080FILE *yyget_out ( yyscan_t yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001081
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001082
Geoff Lang93561c32016-09-20 10:22:55 -04001083
Corentin Wallez168d5e82017-02-01 12:18:56 -08001084void yyset_out ( FILE * _out_str , yyscan_t yyscanner );
Geoff Lang93561c32016-09-20 10:22:55 -04001085
1086
1087
Corentin Wallez168d5e82017-02-01 12:18:56 -08001088 int yyget_leng ( yyscan_t yyscanner );
Geoff Lang93561c32016-09-20 10:22:55 -04001089
1090
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001091
Corentin Wallez168d5e82017-02-01 12:18:56 -08001092char *yyget_text ( yyscan_t yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001093
Geoff Lang93561c32016-09-20 10:22:55 -04001094
1095
Corentin Wallez168d5e82017-02-01 12:18:56 -08001096int yyget_lineno ( yyscan_t yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001097
Geoff Lang93561c32016-09-20 10:22:55 -04001098
1099
Corentin Wallez168d5e82017-02-01 12:18:56 -08001100void yyset_lineno ( int _line_number , yyscan_t yyscanner );
Geoff Lang93561c32016-09-20 10:22:55 -04001101
1102
1103
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001104
Corentin Wallez168d5e82017-02-01 12:18:56 -08001105int yyget_column ( yyscan_t yyscanner );
Zhenyao Mof1d723c2013-09-23 14:57:07 -04001106
Geoff Lang93561c32016-09-20 10:22:55 -04001107
1108
1109
1110
Corentin Wallez168d5e82017-02-01 12:18:56 -08001111void yyset_column ( int _column_no , yyscan_t yyscanner );
Geoff Lang93561c32016-09-20 10:22:55 -04001112
1113
1114
Zhenyao Mof1d723c2013-09-23 14:57:07 -04001115
Corentin Wallez168d5e82017-02-01 12:18:56 -08001116YYSTYPE * yyget_lval ( yyscan_t yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001117
Geoff Lang93561c32016-09-20 10:22:55 -04001118
Corentin Wallez168d5e82017-02-01 12:18:56 -08001119void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001120
Geoff Lang93561c32016-09-20 10:22:55 -04001121
Luc Ferrone49f1e92018-01-24 14:47:55 -05001122
1123 YYLTYPE *yyget_lloc ( yyscan_t yyscanner );
1124
1125
1126
Corentin Wallez168d5e82017-02-01 12:18:56 -08001127 void yyset_lloc ( YYLTYPE * yylloc_param , yyscan_t yyscanner );
Luc Ferrone49f1e92018-01-24 14:47:55 -05001128
1129
Geoff Lang93561c32016-09-20 10:22:55 -04001130
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001131/* Macros after this point can all be overridden by user definitions in
1132 * section 1.
1133 */
1134
1135#ifndef YY_SKIP_YYWRAP
1136#ifdef __cplusplus
Corentin Wallez168d5e82017-02-01 12:18:56 -08001137extern "C" int yywrap ( yyscan_t yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001138#else
Corentin Wallez168d5e82017-02-01 12:18:56 -08001139extern int yywrap ( yyscan_t yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001140#endif
1141#endif
1142
Geoff Lang93561c32016-09-20 10:22:55 -04001143#ifndef YY_NO_UNPUT
Luc Ferrone49f1e92018-01-24 14:47:55 -05001144
Geoff Lang93561c32016-09-20 10:22:55 -04001145#endif
1146
1147
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001148#ifndef yytext_ptr
Corentin Wallez168d5e82017-02-01 12:18:56 -08001149static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001150#endif
1151
1152#ifdef YY_NEED_STRLEN
Corentin Wallez168d5e82017-02-01 12:18:56 -08001153static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001154#endif
1155
1156#ifndef YY_NO_INPUT
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001157#ifdef __cplusplus
Corentin Wallez168d5e82017-02-01 12:18:56 -08001158static int yyinput ( yyscan_t yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001159#else
Corentin Wallez168d5e82017-02-01 12:18:56 -08001160static int input ( yyscan_t yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001161#endif
1162
1163#endif
1164
Geoff Lang93561c32016-09-20 10:22:55 -04001165
1166
1167
1168
1169
1170
1171
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001172/* Amount of stuff to slurp up with each read. */
1173#ifndef YY_READ_BUF_SIZE
Geoff Lang93561c32016-09-20 10:22:55 -04001174#ifdef __ia64__
1175/* On IA-64, the buffer size is 16k, not 8k */
1176#define YY_READ_BUF_SIZE 16384
1177#else
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001178#define YY_READ_BUF_SIZE 8192
Geoff Lang93561c32016-09-20 10:22:55 -04001179#endif /* __ia64__ */
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001180#endif
1181
Geoff Lang93561c32016-09-20 10:22:55 -04001182
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001183/* Copy whatever the last rule matched to the standard output. */
1184#ifndef ECHO
1185/* This used to be an fputs(), but since the string might contain NUL's,
1186 * we now use fwrite().
1187 */
Geoff Lang93561c32016-09-20 10:22:55 -04001188#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001189#endif
1190
Geoff Lang93561c32016-09-20 10:22:55 -04001191
1192
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001193/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1194 * is returned in "result".
1195 */
1196#ifndef YY_INPUT
1197#define YY_INPUT(buf,result,max_size) \
1198 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1199 { \
1200 int c = '*'; \
Corentin Wallez168d5e82017-02-01 12:18:56 -08001201 int n; \
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001202 for ( n = 0; n < max_size && \
1203 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1204 buf[n] = (char) c; \
1205 if ( c == '\n' ) \
1206 buf[n++] = (char) c; \
1207 if ( c == EOF && ferror( yyin ) ) \
1208 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1209 result = n; \
1210 } \
1211 else \
1212 { \
1213 errno=0; \
Corentin Wallez168d5e82017-02-01 12:18:56 -08001214 while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001215 { \
1216 if( errno != EINTR) \
1217 { \
1218 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1219 break; \
1220 } \
1221 errno=0; \
1222 clearerr(yyin); \
1223 } \
1224 }\
1225\
1226
1227#endif
1228
Geoff Lang93561c32016-09-20 10:22:55 -04001229
1230
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001231/* No semi-colon after return; correct usage is to write "yyterminate();" -
1232 * we don't want an extra ';' after the "return" because that will cause
1233 * some compilers to complain about unreachable statements.
1234 */
1235#ifndef yyterminate
1236#define yyterminate() return YY_NULL
1237#endif
1238
Geoff Lang93561c32016-09-20 10:22:55 -04001239
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001240/* Number of entries by which start-condition stack grows. */
1241#ifndef YY_START_STACK_INCR
1242#define YY_START_STACK_INCR 25
1243#endif
1244
Geoff Lang93561c32016-09-20 10:22:55 -04001245
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001246/* Report a fatal error. */
1247#ifndef YY_FATAL_ERROR
1248#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
1249#endif
1250
Geoff Lang93561c32016-09-20 10:22:55 -04001251
1252
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001253/* end tables serialization structures and prototypes */
1254
Geoff Lang93561c32016-09-20 10:22:55 -04001255
1256
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001257/* Default declaration of generated scanner - a define so the user can
1258 * easily add parameters.
1259 */
1260#ifndef YY_DECL
1261#define YY_DECL_IS_OURS 1
1262
Luc Ferrone49f1e92018-01-24 14:47:55 -05001263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
Corentin Wallez168d5e82017-02-01 12:18:56 -08001279extern int yylex \
1280 (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001281
Corentin Wallez168d5e82017-02-01 12:18:56 -08001282#define YY_DECL int yylex \
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001283 (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
1284#endif /* !YY_DECL */
1285
Geoff Lang93561c32016-09-20 10:22:55 -04001286
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001287/* Code executed at the beginning of each rule, after yytext and yyleng
1288 * have been set up.
1289 */
1290#ifndef YY_USER_ACTION
1291#define YY_USER_ACTION
1292#endif
1293
Geoff Lang93561c32016-09-20 10:22:55 -04001294
1295
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001296/* Code executed at the end of each rule. */
1297#ifndef YY_BREAK
Geoff Lang93561c32016-09-20 10:22:55 -04001298#define YY_BREAK /*LINTED*/break;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001299#endif
1300
Geoff Lang93561c32016-09-20 10:22:55 -04001301
1302
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001303#define YY_RULE_SETUP \
1304 YY_USER_ACTION
1305
Geoff Lang93561c32016-09-20 10:22:55 -04001306
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001307/** The main scanner function which does all the work.
1308 */
1309YY_DECL
1310{
Geoff Lang93561c32016-09-20 10:22:55 -04001311 yy_state_type yy_current_state;
1312 char *yy_cp, *yy_bp;
1313 int yy_act;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001314 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1315
Geoff Lang93561c32016-09-20 10:22:55 -04001316
1317
1318
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001319 yylval = yylval_param;
1320
Geoff Lang93561c32016-09-20 10:22:55 -04001321
1322
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001323 yylloc = yylloc_param;
1324
Geoff Lang93561c32016-09-20 10:22:55 -04001325
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001326 if ( !yyg->yy_init )
1327 {
1328 yyg->yy_init = 1;
1329
1330#ifdef YY_USER_INIT
1331 YY_USER_INIT;
1332#endif
1333
Geoff Lang93561c32016-09-20 10:22:55 -04001334
1335
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001336 if ( ! yyg->yy_start )
1337 yyg->yy_start = 1; /* first start state */
1338
1339 if ( ! yyin )
1340 yyin = stdin;
1341
1342 if ( ! yyout )
1343 yyout = stdout;
1344
1345 if ( ! YY_CURRENT_BUFFER ) {
Corentin Wallez168d5e82017-02-01 12:18:56 -08001346 yyensure_buffer_stack (yyscanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001347 YY_CURRENT_BUFFER_LVALUE =
Corentin Wallez168d5e82017-02-01 12:18:56 -08001348 yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001349 }
1350
Corentin Wallez168d5e82017-02-01 12:18:56 -08001351 yy_load_buffer_state( yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001352 }
1353
Jamie Madill185de882014-12-22 15:17:52 -05001354 {
1355
Geoff Lang93561c32016-09-20 10:22:55 -04001356
Jamie Madill185de882014-12-22 15:17:52 -05001357 /* Line comment */
1358
Geoff Lang93561c32016-09-20 10:22:55 -04001359 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001360 {
1361 yy_cp = yyg->yy_c_buf_p;
1362
1363 /* Support of yytext. */
1364 *yy_cp = yyg->yy_hold_char;
1365
1366 /* yy_bp points to the position in yy_ch_buf of the start of
1367 * the current run.
1368 */
1369 yy_bp = yy_cp;
1370
1371 yy_current_state = yyg->yy_start;
1372yy_match:
1373 do
1374 {
Geoff Lang93561c32016-09-20 10:22:55 -04001375 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001376 if ( yy_accept[yy_current_state] )
1377 {
1378 yyg->yy_last_accepting_state = yy_current_state;
1379 yyg->yy_last_accepting_cpos = yy_cp;
1380 }
1381 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1382 {
1383 yy_current_state = (int) yy_def[yy_current_state];
Corentin Wallezdc0fa462017-02-01 14:44:43 -05001384 if ( yy_current_state >= 95 )
Corentin Wallez168d5e82017-02-01 12:18:56 -08001385 yy_c = yy_meta[yy_c];
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001386 }
Corentin Wallez168d5e82017-02-01 12:18:56 -08001387 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001388 ++yy_cp;
1389 }
Corentin Wallezdc0fa462017-02-01 14:44:43 -05001390 while ( yy_current_state != 94 );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001391 yy_cp = yyg->yy_last_accepting_cpos;
1392 yy_current_state = yyg->yy_last_accepting_state;
1393
1394yy_find_action:
1395 yy_act = yy_accept[yy_current_state];
1396
1397 YY_DO_BEFORE_ACTION;
1398
Geoff Lang93561c32016-09-20 10:22:55 -04001399
1400
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001401do_action: /* This label is used only to access EOF actions. */
1402
Geoff Lang93561c32016-09-20 10:22:55 -04001403
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001404 switch ( yy_act )
1405 { /* beginning of action switch */
1406 case 0: /* must back up */
1407 /* undo the effects of YY_DO_BEFORE_ACTION */
1408 *yy_cp = yyg->yy_hold_char;
1409 yy_cp = yyg->yy_last_accepting_cpos;
1410 yy_current_state = yyg->yy_last_accepting_state;
1411 goto yy_find_action;
1412
1413case 1:
1414YY_RULE_SETUP
1415
1416 YY_BREAK
1417/* Block comment */
1418/* Line breaks are just counted - not returned. */
Jamie Madillb96687d2015-04-30 15:56:51 -04001419/* The comment is replaced by a single space. */
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001420case 2:
1421YY_RULE_SETUP
1422{ BEGIN(COMMENT); }
1423 YY_BREAK
1424case 3:
1425YY_RULE_SETUP
1426
1427 YY_BREAK
1428case 4:
1429YY_RULE_SETUP
1430
1431 YY_BREAK
1432case 5:
1433/* rule 5 can match eol */
1434YY_RULE_SETUP
Corentin Wallezdc0fa462017-02-01 14:44:43 -05001435{
1436 if (yylineno == INT_MAX)
1437 {
1438 *yylval = "Integer overflow on line number";
1439 return pp::Token::GOT_ERROR;
1440 }
1441 ++yylineno;
1442}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001443 YY_BREAK
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001444case 6:
1445YY_RULE_SETUP
alokp@chromium.org2c958ee2012-05-17 20:35:42 +00001446{
1447 yyextra->leadingSpace = true;
1448 BEGIN(INITIAL);
1449}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001450 YY_BREAK
1451case 7:
1452YY_RULE_SETUP
1453{
1454 // # is only valid at start of line for preprocessor directives.
alokp@chromium.org432d6fc2012-06-27 22:13:21 +00001455 yylval->assign(1, yytext[0]);
1456 return yyextra->lineStart ? pp::Token::PP_HASH : pp::Token::PP_OTHER;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001457}
1458 YY_BREAK
1459case 8:
1460YY_RULE_SETUP
1461{
1462 yylval->assign(yytext, yyleng);
1463 return pp::Token::IDENTIFIER;
1464}
1465 YY_BREAK
1466case 9:
1467YY_RULE_SETUP
1468{
1469 yylval->assign(yytext, yyleng);
1470 return pp::Token::CONST_INT;
1471}
1472 YY_BREAK
1473case 10:
1474YY_RULE_SETUP
1475{
1476 yylval->assign(yytext, yyleng);
1477 return pp::Token::CONST_FLOAT;
1478}
1479 YY_BREAK
1480/* Anything that starts with a {DIGIT} or .{DIGIT} must be a number. */
1481/* Rule to catch all invalid integers and floats. */
1482case 11:
1483YY_RULE_SETUP
1484{
alokp@chromium.org432d6fc2012-06-27 22:13:21 +00001485 yylval->assign(yytext, yyleng);
1486 return pp::Token::PP_NUMBER;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001487}
1488 YY_BREAK
1489case 12:
1490YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001491{
1492 yylval->assign(yytext, yyleng);
1493 return pp::Token::OP_INC;
1494}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001495 YY_BREAK
1496case 13:
1497YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001498{
1499 yylval->assign(yytext, yyleng);
1500 return pp::Token::OP_DEC;
1501}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001502 YY_BREAK
1503case 14:
1504YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001505{
1506 yylval->assign(yytext, yyleng);
1507 return pp::Token::OP_LEFT;
1508}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001509 YY_BREAK
1510case 15:
1511YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001512{
1513 yylval->assign(yytext, yyleng);
1514 return pp::Token::OP_RIGHT;
1515}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001516 YY_BREAK
1517case 16:
1518YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001519{
1520 yylval->assign(yytext, yyleng);
1521 return pp::Token::OP_LE;
1522}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001523 YY_BREAK
1524case 17:
1525YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001526{
1527 yylval->assign(yytext, yyleng);
1528 return pp::Token::OP_GE;
1529}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001530 YY_BREAK
1531case 18:
1532YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001533{
1534 yylval->assign(yytext, yyleng);
1535 return pp::Token::OP_EQ;
1536}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001537 YY_BREAK
1538case 19:
1539YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001540{
1541 yylval->assign(yytext, yyleng);
1542 return pp::Token::OP_NE;
1543}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001544 YY_BREAK
1545case 20:
1546YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001547{
1548 yylval->assign(yytext, yyleng);
1549 return pp::Token::OP_AND;
1550}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001551 YY_BREAK
1552case 21:
1553YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001554{
1555 yylval->assign(yytext, yyleng);
1556 return pp::Token::OP_XOR;
1557}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001558 YY_BREAK
1559case 22:
1560YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001561{
1562 yylval->assign(yytext, yyleng);
1563 return pp::Token::OP_OR;
1564}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001565 YY_BREAK
1566case 23:
1567YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001568{
1569 yylval->assign(yytext, yyleng);
1570 return pp::Token::OP_ADD_ASSIGN;
1571}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001572 YY_BREAK
1573case 24:
1574YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001575{
1576 yylval->assign(yytext, yyleng);
1577 return pp::Token::OP_SUB_ASSIGN;
1578}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001579 YY_BREAK
1580case 25:
1581YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001582{
1583 yylval->assign(yytext, yyleng);
1584 return pp::Token::OP_MUL_ASSIGN;
1585}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001586 YY_BREAK
1587case 26:
1588YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001589{
1590 yylval->assign(yytext, yyleng);
1591 return pp::Token::OP_DIV_ASSIGN;
1592}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001593 YY_BREAK
1594case 27:
1595YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001596{
1597 yylval->assign(yytext, yyleng);
1598 return pp::Token::OP_MOD_ASSIGN;
1599}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001600 YY_BREAK
1601case 28:
1602YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001603{
1604 yylval->assign(yytext, yyleng);
1605 return pp::Token::OP_LEFT_ASSIGN;
1606}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001607 YY_BREAK
1608case 29:
1609YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001610{
1611 yylval->assign(yytext, yyleng);
1612 return pp::Token::OP_RIGHT_ASSIGN;
1613}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001614 YY_BREAK
1615case 30:
1616YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001617{
1618 yylval->assign(yytext, yyleng);
1619 return pp::Token::OP_AND_ASSIGN;
1620}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001621 YY_BREAK
1622case 31:
1623YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001624{
1625 yylval->assign(yytext, yyleng);
1626 return pp::Token::OP_XOR_ASSIGN;
1627}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001628 YY_BREAK
1629case 32:
1630YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001631{
1632 yylval->assign(yytext, yyleng);
1633 return pp::Token::OP_OR_ASSIGN;
1634}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001635 YY_BREAK
1636case 33:
1637YY_RULE_SETUP
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001638{
1639 yylval->assign(1, yytext[0]);
1640 return yytext[0];
1641}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001642 YY_BREAK
1643case 34:
1644YY_RULE_SETUP
1645{ yyextra->leadingSpace = true; }
1646 YY_BREAK
1647case 35:
1648/* rule 35 can match eol */
1649YY_RULE_SETUP
1650{
Corentin Wallezdc0fa462017-02-01 14:44:43 -05001651 if (yylineno == INT_MAX)
1652 {
1653 *yylval = "Integer overflow on line number";
1654 return pp::Token::GOT_ERROR;
1655 }
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001656 ++yylineno;
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001657 yylval->assign(1, '\n');
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001658 return '\n';
1659}
1660 YY_BREAK
1661case 36:
1662YY_RULE_SETUP
1663{
alokp@chromium.org432d6fc2012-06-27 22:13:21 +00001664 yylval->assign(1, yytext[0]);
1665 return pp::Token::PP_OTHER;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001666}
1667 YY_BREAK
1668case YY_STATE_EOF(INITIAL):
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001669case YY_STATE_EOF(COMMENT):
1670{
alokp@chromium.org19d7aa62012-05-31 17:34:05 +00001671 // YY_USER_ACTION is not invoked for handling EOF.
1672 // Set the location for EOF token manually.
1673 pp::Input* input = &yyextra->input;
1674 pp::Input::Location* scanLoc = &yyextra->scanLoc;
shannon.woods@transgaming.comd64b3da2013-02-28 23:19:26 +00001675 yy_size_t sIndexMax = input->count() ? input->count() - 1 : 0;
alokp@chromium.org19d7aa62012-05-31 17:34:05 +00001676 if (scanLoc->sIndex != sIndexMax)
1677 {
1678 // We can only reach here if there are empty strings at the
1679 // end of the input.
1680 scanLoc->sIndex = sIndexMax; scanLoc->cIndex = 0;
shannon.woods@transgaming.comd64b3da2013-02-28 23:19:26 +00001681 // FIXME: this is not 64-bit clean.
1682 yyfileno = static_cast<int>(sIndexMax); yylineno = 1;
alokp@chromium.org19d7aa62012-05-31 17:34:05 +00001683 }
1684 yylloc->file = yyfileno;
1685 yylloc->line = yylineno;
1686 yylval->clear();
1687
Corentin Wallezd78e33a2017-10-30 12:33:52 -04001688 // Line number overflows fake EOFs to exit early, check for this case.
1689 if (yylineno == INT_MAX)
1690 {
1691 yyextra->diagnostics->report(pp::Diagnostics::PP_TOKENIZER_ERROR,
1692 pp::SourceLocation(yyfileno, yylineno),
1693 "Integer overflow on line number");
1694 }
1695 else if (YY_START == COMMENT)
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001696 {
Shannon Woods7f2d7942013-11-19 15:07:58 -05001697 yyextra->diagnostics->report(pp::Diagnostics::PP_EOF_IN_COMMENT,
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001698 pp::SourceLocation(yyfileno, yylineno),
Corentin Wallezd78e33a2017-10-30 12:33:52 -04001699 "EOF while in a comment");
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001700 }
alokp@chromium.org07d921d2012-05-22 20:22:08 +00001701 yyterminate();
1702}
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001703 YY_BREAK
Corentin Wallezdc0fa462017-02-01 14:44:43 -05001704case 37:
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001705YY_RULE_SETUP
1706ECHO;
1707 YY_BREAK
1708
1709 case YY_END_OF_BUFFER:
1710 {
1711 /* Amount of text matched not including the EOB char. */
1712 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
1713
1714 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1715 *yy_cp = yyg->yy_hold_char;
1716 YY_RESTORE_YY_MORE_OFFSET
1717
1718 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1719 {
1720 /* We're scanning a new file or input source. It's
1721 * possible that this happened because the user
1722 * just pointed yyin at a new source and called
Corentin Wallez168d5e82017-02-01 12:18:56 -08001723 * yylex(). If so, then we have to assure
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001724 * consistency between YY_CURRENT_BUFFER and our
1725 * globals. Here is the right place to do so, because
1726 * this is the first action (other than possibly a
1727 * back-up) that will match for the new input source.
1728 */
1729 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1730 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1731 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1732 }
1733
1734 /* Note that here we test for yy_c_buf_p "<=" to the position
1735 * of the first EOB in the buffer, since yy_c_buf_p will
1736 * already have been incremented past the NUL character
1737 * (since all states make transitions on EOB to the
1738 * end-of-buffer state). Contrast this with the test
1739 * in input().
1740 */
1741 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1742 { /* This was really a NUL. */
1743 yy_state_type yy_next_state;
1744
1745 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1746
1747 yy_current_state = yy_get_previous_state( yyscanner );
1748
1749 /* Okay, we're now positioned to make the NUL
1750 * transition. We couldn't have
1751 * yy_get_previous_state() go ahead and do it
1752 * for us because it doesn't know how to deal
1753 * with the possibility of jamming (and we don't
1754 * want to build jamming into it because then it
1755 * will run more slowly).
1756 */
1757
1758 yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1759
1760 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1761
1762 if ( yy_next_state )
1763 {
1764 /* Consume the NUL. */
1765 yy_cp = ++yyg->yy_c_buf_p;
1766 yy_current_state = yy_next_state;
1767 goto yy_match;
1768 }
1769
1770 else
1771 {
1772 yy_cp = yyg->yy_last_accepting_cpos;
1773 yy_current_state = yyg->yy_last_accepting_state;
1774 goto yy_find_action;
1775 }
1776 }
1777
1778 else switch ( yy_get_next_buffer( yyscanner ) )
1779 {
1780 case EOB_ACT_END_OF_FILE:
1781 {
1782 yyg->yy_did_buffer_switch_on_eof = 0;
1783
Corentin Wallez168d5e82017-02-01 12:18:56 -08001784 if ( yywrap( yyscanner ) )
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001785 {
1786 /* Note: because we've taken care in
1787 * yy_get_next_buffer() to have set up
1788 * yytext, we can now set up
1789 * yy_c_buf_p so that if some total
1790 * hoser (like flex itself) wants to
1791 * call the scanner after we return the
1792 * YY_NULL, it'll still work - another
1793 * YY_NULL will get returned.
1794 */
1795 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1796
1797 yy_act = YY_STATE_EOF(YY_START);
1798 goto do_action;
1799 }
1800
1801 else
1802 {
1803 if ( ! yyg->yy_did_buffer_switch_on_eof )
1804 YY_NEW_FILE;
1805 }
1806 break;
1807 }
1808
1809 case EOB_ACT_CONTINUE_SCAN:
1810 yyg->yy_c_buf_p =
1811 yyg->yytext_ptr + yy_amount_of_matched_text;
1812
1813 yy_current_state = yy_get_previous_state( yyscanner );
1814
1815 yy_cp = yyg->yy_c_buf_p;
1816 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1817 goto yy_match;
1818
1819 case EOB_ACT_LAST_MATCH:
1820 yyg->yy_c_buf_p =
1821 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1822
1823 yy_current_state = yy_get_previous_state( yyscanner );
1824
1825 yy_cp = yyg->yy_c_buf_p;
1826 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1827 goto yy_find_action;
1828 }
1829 break;
1830 }
1831
1832 default:
1833 YY_FATAL_ERROR(
1834 "fatal flex scanner internal error--no action found" );
1835 } /* end of action switch */
1836 } /* end of scanning one token */
Jamie Madill185de882014-12-22 15:17:52 -05001837 } /* end of user's declarations */
Corentin Wallez168d5e82017-02-01 12:18:56 -08001838} /* end of yylex */
Geoff Lang93561c32016-09-20 10:22:55 -04001839
1840
1841
1842
1843
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001844/* yy_get_next_buffer - try to read in a new buffer
1845 *
1846 * Returns a code representing an action:
1847 * EOB_ACT_LAST_MATCH -
1848 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1849 * EOB_ACT_END_OF_FILE - end of file
1850 */
1851static int yy_get_next_buffer (yyscan_t yyscanner)
1852{
1853 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
Geoff Lang93561c32016-09-20 10:22:55 -04001854 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1855 char *source = yyg->yytext_ptr;
Corentin Wallez168d5e82017-02-01 12:18:56 -08001856 int number_to_move, i;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001857 int ret_val;
1858
1859 if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1860 YY_FATAL_ERROR(
1861 "fatal flex scanner internal error--end of buffer missed" );
1862
1863 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1864 { /* Don't try to fill the buffer, so this is an EOF. */
1865 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1866 {
1867 /* We matched a single character, the EOB, so
1868 * treat this as a final EOF.
1869 */
1870 return EOB_ACT_END_OF_FILE;
1871 }
1872
1873 else
1874 {
1875 /* We matched some text prior to the EOB, first
1876 * process it.
1877 */
1878 return EOB_ACT_LAST_MATCH;
1879 }
1880 }
1881
1882 /* Try to read more data. */
1883
1884 /* First move last chars to start of buffer. */
Corentin Wallez168d5e82017-02-01 12:18:56 -08001885 number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001886
1887 for ( i = 0; i < number_to_move; ++i )
1888 *(dest++) = *(source++);
1889
1890 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1891 /* don't do the read, it's not guaranteed to return an EOF,
1892 * just force an EOF
1893 */
1894 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1895
1896 else
1897 {
Geoff Lang93561c32016-09-20 10:22:55 -04001898 int num_to_read =
Corentin Wallez168d5e82017-02-01 12:18:56 -08001899 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001900
1901 while ( num_to_read <= 0 )
1902 { /* Not enough room in the buffer - grow it. */
1903
1904 /* just a shorter name for the current buffer */
Zhenyao Mof1d723c2013-09-23 14:57:07 -04001905 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001906
1907 int yy_c_buf_p_offset =
1908 (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1909
1910 if ( b->yy_is_our_buffer )
1911 {
Geoff Lang93561c32016-09-20 10:22:55 -04001912 int new_size = b->yy_buf_size * 2;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001913
1914 if ( new_size <= 0 )
1915 b->yy_buf_size += b->yy_buf_size / 8;
1916 else
1917 b->yy_buf_size *= 2;
1918
1919 b->yy_ch_buf = (char *)
1920 /* Include room in for 2 EOB chars. */
Corentin Wallez168d5e82017-02-01 12:18:56 -08001921 yyrealloc( (void *) b->yy_ch_buf,
1922 (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001923 }
1924 else
1925 /* Can't grow it, we don't own it. */
Geoff Lang93561c32016-09-20 10:22:55 -04001926 b->yy_ch_buf = NULL;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001927
1928 if ( ! b->yy_ch_buf )
1929 YY_FATAL_ERROR(
1930 "fatal error - scanner input buffer overflow" );
1931
1932 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1933
Corentin Wallez168d5e82017-02-01 12:18:56 -08001934 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1935 number_to_move - 1;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001936
1937 }
1938
1939 if ( num_to_read > YY_READ_BUF_SIZE )
1940 num_to_read = YY_READ_BUF_SIZE;
1941
1942 /* Read in more data. */
Geoff Lang93561c32016-09-20 10:22:55 -04001943 yy_size_t ret = 0;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001944 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
Geoff Lang93561c32016-09-20 10:22:55 -04001945 ret, num_to_read );
1946 yyg->yy_n_chars = static_cast<int>(ret);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001947
1948 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1949 }
1950
1951 if ( yyg->yy_n_chars == 0 )
1952 {
1953 if ( number_to_move == YY_MORE_ADJ )
1954 {
1955 ret_val = EOB_ACT_END_OF_FILE;
Corentin Wallez168d5e82017-02-01 12:18:56 -08001956 yyrestart( yyin , yyscanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001957 }
1958
1959 else
1960 {
1961 ret_val = EOB_ACT_LAST_MATCH;
1962 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1963 YY_BUFFER_EOF_PENDING;
1964 }
1965 }
1966
1967 else
1968 ret_val = EOB_ACT_CONTINUE_SCAN;
1969
Corentin Wallez168d5e82017-02-01 12:18:56 -08001970 if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001971 /* Extend the array by 50%, plus the number we really need. */
Corentin Wallez168d5e82017-02-01 12:18:56 -08001972 int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
1973 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
1974 (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001975 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1976 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
Corentin Wallez168d5e82017-02-01 12:18:56 -08001977 /* "- 2" to take care of EOB's */
1978 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001979 }
1980
Corentin Wallez168d5e82017-02-01 12:18:56 -08001981 yyg->yy_n_chars += number_to_move;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001982 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1983 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1984
1985 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1986
1987 return ret_val;
1988}
1989
Geoff Lang93561c32016-09-20 10:22:55 -04001990
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001991/* yy_get_previous_state - get the state just before the EOB char was reached */
1992
1993 static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
1994{
Geoff Lang93561c32016-09-20 10:22:55 -04001995 yy_state_type yy_current_state;
1996 char *yy_cp;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00001997 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1998
1999 yy_current_state = yyg->yy_start;
2000
2001 for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
2002 {
Geoff Lang93561c32016-09-20 10:22:55 -04002003 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002004 if ( yy_accept[yy_current_state] )
2005 {
2006 yyg->yy_last_accepting_state = yy_current_state;
2007 yyg->yy_last_accepting_cpos = yy_cp;
2008 }
2009 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2010 {
2011 yy_current_state = (int) yy_def[yy_current_state];
Corentin Wallezdc0fa462017-02-01 14:44:43 -05002012 if ( yy_current_state >= 95 )
Corentin Wallez168d5e82017-02-01 12:18:56 -08002013 yy_c = yy_meta[yy_c];
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002014 }
Corentin Wallez168d5e82017-02-01 12:18:56 -08002015 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002016 }
2017
2018 return yy_current_state;
2019}
2020
Geoff Lang93561c32016-09-20 10:22:55 -04002021
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002022/* yy_try_NUL_trans - try to make a transition on the NUL character
2023 *
2024 * synopsis
2025 * next_state = yy_try_NUL_trans( current_state );
2026 */
2027 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
2028{
Geoff Lang93561c32016-09-20 10:22:55 -04002029 int yy_is_jam;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002030 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
Geoff Lang93561c32016-09-20 10:22:55 -04002031 char *yy_cp = yyg->yy_c_buf_p;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002032
Geoff Lang93561c32016-09-20 10:22:55 -04002033 YY_CHAR yy_c = 1;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002034 if ( yy_accept[yy_current_state] )
2035 {
2036 yyg->yy_last_accepting_state = yy_current_state;
2037 yyg->yy_last_accepting_cpos = yy_cp;
2038 }
2039 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2040 {
2041 yy_current_state = (int) yy_def[yy_current_state];
Corentin Wallezdc0fa462017-02-01 14:44:43 -05002042 if ( yy_current_state >= 95 )
Corentin Wallez168d5e82017-02-01 12:18:56 -08002043 yy_c = yy_meta[yy_c];
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002044 }
Corentin Wallez168d5e82017-02-01 12:18:56 -08002045 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
Corentin Wallezdc0fa462017-02-01 14:44:43 -05002046 yy_is_jam = (yy_current_state == 94);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002047
Zhenyao Mof1d723c2013-09-23 14:57:07 -04002048 (void)yyg;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002049 return yy_is_jam ? 0 : yy_current_state;
2050}
2051
Geoff Lang93561c32016-09-20 10:22:55 -04002052
2053#ifndef YY_NO_UNPUT
2054
2055#endif
2056
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002057#ifndef YY_NO_INPUT
2058#ifdef __cplusplus
2059 static int yyinput (yyscan_t yyscanner)
2060#else
2061 static int input (yyscan_t yyscanner)
2062#endif
2063
2064{
2065 int c;
2066 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2067
2068 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2069
2070 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
2071 {
2072 /* yy_c_buf_p now points to the character we want to return.
2073 * If this occurs *before* the EOB characters, then it's a
2074 * valid NUL; if not, then we've hit the end of the buffer.
2075 */
2076 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2077 /* This was really a NUL. */
2078 *yyg->yy_c_buf_p = '\0';
2079
2080 else
2081 { /* need more input */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002082 int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002083 ++yyg->yy_c_buf_p;
2084
2085 switch ( yy_get_next_buffer( yyscanner ) )
2086 {
2087 case EOB_ACT_LAST_MATCH:
2088 /* This happens because yy_g_n_b()
2089 * sees that we've accumulated a
2090 * token and flags that we need to
2091 * try matching the token before
2092 * proceeding. But for input(),
2093 * there's no matching to consider.
2094 * So convert the EOB_ACT_LAST_MATCH
2095 * to EOB_ACT_END_OF_FILE.
2096 */
2097
2098 /* Reset buffer status. */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002099 yyrestart( yyin , yyscanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002100
2101 /*FALLTHROUGH*/
2102
2103 case EOB_ACT_END_OF_FILE:
2104 {
Corentin Wallez168d5e82017-02-01 12:18:56 -08002105 if ( yywrap( yyscanner ) )
Geoff Lang93561c32016-09-20 10:22:55 -04002106 return 0;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002107
2108 if ( ! yyg->yy_did_buffer_switch_on_eof )
2109 YY_NEW_FILE;
2110#ifdef __cplusplus
2111 return yyinput(yyscanner);
2112#else
2113 return input(yyscanner);
2114#endif
2115 }
2116
2117 case EOB_ACT_CONTINUE_SCAN:
2118 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
2119 break;
2120 }
2121 }
2122 }
2123
2124 c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
2125 *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
2126 yyg->yy_hold_char = *++yyg->yy_c_buf_p;
2127
Geoff Lang93561c32016-09-20 10:22:55 -04002128
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002129 return c;
2130}
2131#endif /* ifndef YY_NO_INPUT */
2132
2133/** Immediately switch to a different input stream.
2134 * @param input_file A readable stream.
2135 * @param yyscanner The scanner object.
2136 * @note This function does not reset the start condition to @c INITIAL .
2137 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002138 void yyrestart (FILE * input_file , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002139{
2140 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2141
2142 if ( ! YY_CURRENT_BUFFER ){
Corentin Wallez168d5e82017-02-01 12:18:56 -08002143 yyensure_buffer_stack (yyscanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002144 YY_CURRENT_BUFFER_LVALUE =
Corentin Wallez168d5e82017-02-01 12:18:56 -08002145 yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002146 }
2147
Corentin Wallez168d5e82017-02-01 12:18:56 -08002148 yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);
2149 yy_load_buffer_state( yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002150}
2151
Geoff Lang93561c32016-09-20 10:22:55 -04002152
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002153/** Switch to a different input buffer.
2154 * @param new_buffer The new input buffer.
2155 * @param yyscanner The scanner object.
2156 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002157 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002158{
2159 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2160
2161 /* TODO. We should be able to replace this entire function body
2162 * with
Corentin Wallez168d5e82017-02-01 12:18:56 -08002163 * yypop_buffer_state();
2164 * yypush_buffer_state(new_buffer);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002165 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002166 yyensure_buffer_stack (yyscanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002167 if ( YY_CURRENT_BUFFER == new_buffer )
2168 return;
2169
2170 if ( YY_CURRENT_BUFFER )
2171 {
2172 /* Flush out information for old buffer. */
2173 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2174 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2175 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2176 }
2177
2178 YY_CURRENT_BUFFER_LVALUE = new_buffer;
Corentin Wallez168d5e82017-02-01 12:18:56 -08002179 yy_load_buffer_state( yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002180
2181 /* We don't actually know whether we did this switch during
Corentin Wallez168d5e82017-02-01 12:18:56 -08002182 * EOF (yywrap()) processing, but the only time this flag
2183 * is looked at is after yywrap() is called, so it's safe
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002184 * to go ahead and always set it.
2185 */
2186 yyg->yy_did_buffer_switch_on_eof = 1;
2187}
2188
Geoff Lang93561c32016-09-20 10:22:55 -04002189
Corentin Wallez168d5e82017-02-01 12:18:56 -08002190static void yy_load_buffer_state (yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002191{
2192 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2193 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2194 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2195 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2196 yyg->yy_hold_char = *yyg->yy_c_buf_p;
2197}
2198
2199/** Allocate and initialize an input buffer state.
2200 * @param file A readable stream.
2201 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2202 * @param yyscanner The scanner object.
2203 * @return the allocated buffer state.
2204 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002205 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002206{
2207 YY_BUFFER_STATE b;
Luc Ferrone49f1e92018-01-24 14:47:55 -05002208
2209 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002210 if ( ! b )
Corentin Wallez168d5e82017-02-01 12:18:56 -08002211 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002212
Corentin Wallez168d5e82017-02-01 12:18:56 -08002213 b->yy_buf_size = size;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002214
2215 /* yy_ch_buf has to be 2 characters longer than the size given because
2216 * we need to put in 2 end-of-buffer characters.
2217 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002218 b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002219 if ( ! b->yy_ch_buf )
Corentin Wallez168d5e82017-02-01 12:18:56 -08002220 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002221
2222 b->yy_is_our_buffer = 1;
2223
Corentin Wallez168d5e82017-02-01 12:18:56 -08002224 yy_init_buffer( b, file , yyscanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002225
2226 return b;
2227}
2228
Geoff Lang93561c32016-09-20 10:22:55 -04002229
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002230/** Destroy the buffer.
Corentin Wallez168d5e82017-02-01 12:18:56 -08002231 * @param b a buffer created with yy_create_buffer()
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002232 * @param yyscanner The scanner object.
2233 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002234 void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002235{
2236 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2237
2238 if ( ! b )
2239 return;
2240
2241 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2242 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2243
2244 if ( b->yy_is_our_buffer )
Corentin Wallez168d5e82017-02-01 12:18:56 -08002245 yyfree( (void *) b->yy_ch_buf , yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002246
Corentin Wallez168d5e82017-02-01 12:18:56 -08002247 yyfree( (void *) b , yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002248}
2249
Geoff Lang93561c32016-09-20 10:22:55 -04002250
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002251/* Initializes or reinitializes a buffer.
2252 * This function is sometimes called more than once on the same buffer,
Corentin Wallez168d5e82017-02-01 12:18:56 -08002253 * such as during a yyrestart() or at EOF.
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002254 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002255 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002256
2257{
2258 int oerrno = errno;
2259 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2260
Corentin Wallez168d5e82017-02-01 12:18:56 -08002261 yy_flush_buffer( b , yyscanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002262
2263 b->yy_input_file = file;
2264 b->yy_fill_buffer = 1;
2265
Corentin Wallez168d5e82017-02-01 12:18:56 -08002266 /* If b is the current buffer, then yy_init_buffer was _probably_
2267 * called from yyrestart() or through yy_get_next_buffer.
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002268 * In that case, we don't want to reset the lineno or column.
2269 */
2270 if (b != YY_CURRENT_BUFFER){
2271 b->yy_bs_lineno = 1;
2272 b->yy_bs_column = 0;
2273 }
2274
Geoff Lang93561c32016-09-20 10:22:55 -04002275
Luc Ferrone49f1e92018-01-24 14:47:55 -05002276
2277 b->yy_is_interactive = 0;
2278
2279
2280 errno = oerrno;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002281}
2282
2283/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2284 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2285 * @param yyscanner The scanner object.
2286 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002287 void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002288{
2289 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2290 if ( ! b )
2291 return;
2292
2293 b->yy_n_chars = 0;
2294
2295 /* We always need two end-of-buffer characters. The first causes
2296 * a transition to the end-of-buffer state. The second causes
2297 * a jam in that state.
2298 */
2299 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2300 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2301
2302 b->yy_buf_pos = &b->yy_ch_buf[0];
2303
2304 b->yy_at_bol = 1;
2305 b->yy_buffer_status = YY_BUFFER_NEW;
2306
2307 if ( b == YY_CURRENT_BUFFER )
Corentin Wallez168d5e82017-02-01 12:18:56 -08002308 yy_load_buffer_state( yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002309}
2310
2311/** Pushes the new state onto the stack. The new state becomes
2312 * the current state. This function will allocate the stack
2313 * if necessary.
2314 * @param new_buffer The new state.
2315 * @param yyscanner The scanner object.
2316 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002317void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002318{
2319 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
Luc Ferrone49f1e92018-01-24 14:47:55 -05002320 if (new_buffer == NULL)
2321 return;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002322
Luc Ferrone49f1e92018-01-24 14:47:55 -05002323 yyensure_buffer_stack(yyscanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002324
Luc Ferrone49f1e92018-01-24 14:47:55 -05002325 /* This block is copied from yy_switch_to_buffer. */
2326 if ( YY_CURRENT_BUFFER )
2327 {
2328 /* Flush out information for old buffer. */
2329 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2330 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2331 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002332 }
2333
2334 /* Only push if top exists. Otherwise, replace top. */
2335 if (YY_CURRENT_BUFFER)
2336 yyg->yy_buffer_stack_top++;
2337 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2338
Corentin Wallez168d5e82017-02-01 12:18:56 -08002339 /* copied from yy_switch_to_buffer. */
2340 yy_load_buffer_state( yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002341 yyg->yy_did_buffer_switch_on_eof = 1;
2342}
2343
Geoff Lang93561c32016-09-20 10:22:55 -04002344
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002345/** Removes and deletes the top of the stack, if present.
2346 * The next element becomes the new top.
2347 * @param yyscanner The scanner object.
2348 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002349void yypop_buffer_state (yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002350{
2351 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2352 if (!YY_CURRENT_BUFFER)
2353 return;
2354
Corentin Wallez168d5e82017-02-01 12:18:56 -08002355 yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner);
Luc Ferrone49f1e92018-01-24 14:47:55 -05002356 YY_CURRENT_BUFFER_LVALUE = NULL;
2357 if (yyg->yy_buffer_stack_top > 0)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002358 --yyg->yy_buffer_stack_top;
2359
2360 if (YY_CURRENT_BUFFER) {
Corentin Wallez168d5e82017-02-01 12:18:56 -08002361 yy_load_buffer_state( yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002362 yyg->yy_did_buffer_switch_on_eof = 1;
2363 }
2364}
2365
Geoff Lang93561c32016-09-20 10:22:55 -04002366
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002367/* Allocates the stack if it does not exist.
2368 * Guarantees space for at least one push.
2369 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002370static void yyensure_buffer_stack (yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002371{
shannonwoods@chromium.orgb0757162013-05-30 00:21:27 +00002372 yy_size_t num_to_alloc;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002373 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2374
2375 if (!yyg->yy_buffer_stack) {
2376
2377 /* First allocation is just for 2 elements, since we don't know if this
2378 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2379 * immediate realloc on the next call.
2380 */
Geoff Lang93561c32016-09-20 10:22:55 -04002381 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002382 yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002383 (num_to_alloc * sizeof(struct yy_buffer_state*)
2384 , yyscanner);
2385 if ( ! yyg->yy_buffer_stack )
Corentin Wallez168d5e82017-02-01 12:18:56 -08002386 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2387
2388
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002389 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
Corentin Wallez168d5e82017-02-01 12:18:56 -08002390
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002391 yyg->yy_buffer_stack_max = num_to_alloc;
2392 yyg->yy_buffer_stack_top = 0;
2393 return;
2394 }
2395
2396 if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
2397
2398 /* Increase the buffer to prepare for a possible push. */
Geoff Lang93561c32016-09-20 10:22:55 -04002399 yy_size_t grow_size = 8 /* arbitrary grow size */;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002400
2401 num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
Corentin Wallez168d5e82017-02-01 12:18:56 -08002402 yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002403 (yyg->yy_buffer_stack,
2404 num_to_alloc * sizeof(struct yy_buffer_state*)
2405 , yyscanner);
2406 if ( ! yyg->yy_buffer_stack )
Corentin Wallez168d5e82017-02-01 12:18:56 -08002407 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002408
2409 /* zero only the new slots.*/
2410 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
2411 yyg->yy_buffer_stack_max = num_to_alloc;
2412 }
2413}
2414
Geoff Lang93561c32016-09-20 10:22:55 -04002415
2416
2417
2418
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002419/** Setup the input buffer state to scan directly from a user-specified character buffer.
2420 * @param base the character buffer
2421 * @param size the size in bytes of the character buffer
2422 * @param yyscanner The scanner object.
Corentin Wallez168d5e82017-02-01 12:18:56 -08002423 * @return the newly allocated buffer state object.
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002424 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002425YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002426{
2427 YY_BUFFER_STATE b;
Luc Ferrone49f1e92018-01-24 14:47:55 -05002428
2429 if ( size < 2 ||
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002430 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2431 base[size-1] != YY_END_OF_BUFFER_CHAR )
2432 /* They forgot to leave room for the EOB's. */
Luc Ferrone49f1e92018-01-24 14:47:55 -05002433 return NULL;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002434
Luc Ferrone49f1e92018-01-24 14:47:55 -05002435 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002436 if ( ! b )
Corentin Wallez168d5e82017-02-01 12:18:56 -08002437 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002438
Corentin Wallez168d5e82017-02-01 12:18:56 -08002439 b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002440 b->yy_buf_pos = b->yy_ch_buf = base;
2441 b->yy_is_our_buffer = 0;
Luc Ferrone49f1e92018-01-24 14:47:55 -05002442 b->yy_input_file = NULL;
2443 b->yy_n_chars = b->yy_buf_size;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002444 b->yy_is_interactive = 0;
2445 b->yy_at_bol = 1;
2446 b->yy_fill_buffer = 0;
2447 b->yy_buffer_status = YY_BUFFER_NEW;
2448
Corentin Wallez168d5e82017-02-01 12:18:56 -08002449 yy_switch_to_buffer( b , yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002450
2451 return b;
2452}
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 a string. The next call to yylex() will
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002458 * scan from a @e copy of @a str.
2459 * @param yystr a NUL-terminated string to scan
2460 * @param yyscanner The scanner object.
2461 * @return the newly allocated buffer state object.
2462 * @note If you want to scan bytes that may contain NUL values, then use
Corentin Wallez168d5e82017-02-01 12:18:56 -08002463 * yy_scan_bytes() instead.
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002464 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002465YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002466{
Luc Ferrone49f1e92018-01-24 14:47:55 -05002467
2468 return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002469}
2470
Geoff Lang93561c32016-09-20 10:22:55 -04002471
2472
2473
Corentin Wallez168d5e82017-02-01 12:18:56 -08002474/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002475 * scan from a @e copy of @a bytes.
Zhenyao Mof1d723c2013-09-23 14:57:07 -04002476 * @param yybytes the byte buffer to scan
2477 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002478 * @param yyscanner The scanner object.
2479 * @return the newly allocated buffer state object.
2480 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002481YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002482{
2483 YY_BUFFER_STATE b;
2484 char *buf;
Zhenyao Mof1d723c2013-09-23 14:57:07 -04002485 yy_size_t n;
Corentin Wallez168d5e82017-02-01 12:18:56 -08002486 int i;
Luc Ferrone49f1e92018-01-24 14:47:55 -05002487
2488 /* Get memory for full buffer, including space for trailing EOB's. */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002489 n = (yy_size_t) (_yybytes_len + 2);
2490 buf = (char *) yyalloc( n , yyscanner );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002491 if ( ! buf )
Corentin Wallez168d5e82017-02-01 12:18:56 -08002492 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002493
Corentin Wallez168d5e82017-02-01 12:18:56 -08002494 for ( i = 0; i < _yybytes_len; ++i )
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002495 buf[i] = yybytes[i];
2496
2497 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2498
Corentin Wallez168d5e82017-02-01 12:18:56 -08002499 b = yy_scan_buffer( buf, n , yyscanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002500 if ( ! b )
Corentin Wallez168d5e82017-02-01 12:18:56 -08002501 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002502
2503 /* It's okay to grow etc. this buffer, and we should throw it
2504 * away when we're done.
2505 */
2506 b->yy_is_our_buffer = 1;
2507
2508 return b;
2509}
2510
Geoff Lang93561c32016-09-20 10:22:55 -04002511
2512
2513
2514
2515
2516
2517
2518
2519
2520
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002521#ifndef YY_EXIT_FAILURE
2522#define YY_EXIT_FAILURE 2
2523#endif
2524
Corentin Wallez168d5e82017-02-01 12:18:56 -08002525static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002526{
Geoff Lang93561c32016-09-20 10:22:55 -04002527 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2528 (void)yyg;
Corentin Wallez168d5e82017-02-01 12:18:56 -08002529 fprintf( stderr, "%s\n", msg );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002530 exit( YY_EXIT_FAILURE );
2531}
2532
2533/* Redefine yyless() so it works in section 3 code. */
2534
2535#undef yyless
2536#define yyless(n) \
2537 do \
2538 { \
2539 /* Undo effects of setting up yytext. */ \
2540 int yyless_macro_arg = (n); \
2541 YY_LESS_LINENO(yyless_macro_arg);\
2542 yytext[yyleng] = yyg->yy_hold_char; \
2543 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
2544 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
2545 *yyg->yy_c_buf_p = '\0'; \
2546 yyleng = yyless_macro_arg; \
2547 } \
2548 while ( 0 )
2549
Geoff Lang93561c32016-09-20 10:22:55 -04002550
2551
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002552/* Accessor methods (get/set functions) to struct members. */
2553
Geoff Lang93561c32016-09-20 10:22:55 -04002554
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002555/** Get the user-defined data for this scanner.
2556 * @param yyscanner The scanner object.
2557 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002558YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002559{
2560 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2561 return yyextra;
2562}
2563
Geoff Lang93561c32016-09-20 10:22:55 -04002564
2565
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002566/** Get the current line number.
2567 * @param yyscanner The scanner object.
2568 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002569int yyget_lineno (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
Luc Ferrone49f1e92018-01-24 14:47:55 -05002573
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002574 if (! YY_CURRENT_BUFFER)
2575 return 0;
Luc Ferrone49f1e92018-01-24 14:47:55 -05002576
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002577 return yylineno;
2578}
2579
Geoff Lang93561c32016-09-20 10:22:55 -04002580
2581
2582
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002583/** Get the current column number.
2584 * @param yyscanner The scanner object.
2585 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002586int yyget_column (yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002587{
2588 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
Corentin Wallez168d5e82017-02-01 12:18:56 -08002589
Luc Ferrone49f1e92018-01-24 14:47:55 -05002590
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002591 if (! YY_CURRENT_BUFFER)
2592 return 0;
Luc Ferrone49f1e92018-01-24 14:47:55 -05002593
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002594 return yycolumn;
2595}
2596
Geoff Lang93561c32016-09-20 10:22:55 -04002597
2598
2599
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002600/** Get the input stream.
2601 * @param yyscanner The scanner object.
2602 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002603FILE *yyget_in (yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002604{
2605 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2606 return yyin;
2607}
2608
Geoff Lang93561c32016-09-20 10:22:55 -04002609
2610
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002611/** Get the output stream.
2612 * @param yyscanner The scanner object.
2613 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002614FILE *yyget_out (yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002615{
2616 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2617 return yyout;
2618}
2619
Geoff Lang93561c32016-09-20 10:22:55 -04002620
2621
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002622/** Get the length of the current token.
2623 * @param yyscanner The scanner object.
2624 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002625int yyget_leng (yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002626{
2627 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2628 return yyleng;
2629}
2630
Geoff Lang93561c32016-09-20 10:22:55 -04002631
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002632/** Get the current token.
2633 * @param yyscanner The scanner object.
2634 */
2635
Corentin Wallez168d5e82017-02-01 12:18:56 -08002636char *yyget_text (yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002637{
2638 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2639 return yytext;
2640}
2641
Geoff Lang93561c32016-09-20 10:22:55 -04002642
2643
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002644/** Set the user-defined data. This data is never touched by the scanner.
2645 * @param user_defined The data to be associated with this scanner.
2646 * @param yyscanner The scanner object.
2647 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002648void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002649{
2650 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2651 yyextra = user_defined ;
2652}
2653
Geoff Lang93561c32016-09-20 10:22:55 -04002654
2655
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002656/** Set the current line number.
Geoff Lang93561c32016-09-20 10:22:55 -04002657 * @param _line_number line number
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002658 * @param yyscanner The scanner object.
2659 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002660void yyset_lineno (int _line_number , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002661{
2662 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2663
Luc Ferrone49f1e92018-01-24 14:47:55 -05002664
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002665 /* lineno is only valid if an input buffer exists. */
2666 if (! YY_CURRENT_BUFFER )
Corentin Wallez168d5e82017-02-01 12:18:56 -08002667 YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
Luc Ferrone49f1e92018-01-24 14:47:55 -05002668
Geoff Lang93561c32016-09-20 10:22:55 -04002669 yylineno = _line_number;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002670}
2671
Geoff Lang93561c32016-09-20 10:22:55 -04002672
2673
2674
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002675/** Set the current column.
Geoff Lang93561c32016-09-20 10:22:55 -04002676 * @param _column_no column number
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002677 * @param yyscanner The scanner object.
2678 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002679void yyset_column (int _column_no , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002680{
2681 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2682
Luc Ferrone49f1e92018-01-24 14:47:55 -05002683
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002684 /* column is only valid if an input buffer exists. */
2685 if (! YY_CURRENT_BUFFER )
Corentin Wallez168d5e82017-02-01 12:18:56 -08002686 YY_FATAL_ERROR( "yyset_column called with no buffer" );
Luc Ferrone49f1e92018-01-24 14:47:55 -05002687
Geoff Lang93561c32016-09-20 10:22:55 -04002688 yycolumn = _column_no;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002689}
2690
Geoff Lang93561c32016-09-20 10:22:55 -04002691
2692
2693
2694
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002695/** Set the input stream. This does not discard the current
2696 * input buffer.
Geoff Lang93561c32016-09-20 10:22:55 -04002697 * @param _in_str A readable stream.
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002698 * @param yyscanner The scanner object.
Corentin Wallez168d5e82017-02-01 12:18:56 -08002699 * @see yy_switch_to_buffer
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002700 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002701void yyset_in (FILE * _in_str , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002702{
2703 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
Geoff Lang93561c32016-09-20 10:22:55 -04002704 yyin = _in_str ;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002705}
2706
Geoff Lang93561c32016-09-20 10:22:55 -04002707
2708
Corentin Wallez168d5e82017-02-01 12:18:56 -08002709void yyset_out (FILE * _out_str , 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 yyout = _out_str ;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002713}
2714
Geoff Lang93561c32016-09-20 10:22:55 -04002715
2716
2717
Corentin Wallez168d5e82017-02-01 12:18:56 -08002718int yyget_debug (yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002719{
2720 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2721 return yy_flex_debug;
2722}
2723
Geoff Lang93561c32016-09-20 10:22:55 -04002724
2725
Corentin Wallez168d5e82017-02-01 12:18:56 -08002726void yyset_debug (int _bdebug , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002727{
2728 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
Geoff Lang93561c32016-09-20 10:22:55 -04002729 yy_flex_debug = _bdebug ;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002730}
2731
Geoff Lang93561c32016-09-20 10:22:55 -04002732
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002733/* Accessor methods for yylval and yylloc */
2734
Geoff Lang93561c32016-09-20 10:22:55 -04002735
Corentin Wallez168d5e82017-02-01 12:18:56 -08002736YYSTYPE * yyget_lval (yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002737{
2738 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2739 return yylval;
2740}
2741
Geoff Lang93561c32016-09-20 10:22:55 -04002742
2743
Corentin Wallez168d5e82017-02-01 12:18:56 -08002744void yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002745{
2746 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2747 yylval = yylval_param;
2748}
2749
Luc Ferrone49f1e92018-01-24 14:47:55 -05002750
2751
2752
Corentin Wallez168d5e82017-02-01 12:18:56 -08002753YYLTYPE *yyget_lloc (yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002754{
2755 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2756 return yylloc;
2757}
Luc Ferrone49f1e92018-01-24 14:47:55 -05002758
Geoff Lang93561c32016-09-20 10:22:55 -04002759
Luc Ferrone49f1e92018-01-24 14:47:55 -05002760
Corentin Wallez168d5e82017-02-01 12:18:56 -08002761void yyset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002762{
2763 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2764 yylloc = yylloc_param;
2765}
Luc Ferrone49f1e92018-01-24 14:47:55 -05002766
2767
2768
2769
Geoff Lang93561c32016-09-20 10:22:55 -04002770
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002771/* User-visible API */
2772
Corentin Wallez168d5e82017-02-01 12:18:56 -08002773/* yylex_init is special because it creates the scanner itself, so it is
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002774 * the ONLY reentrant function that doesn't take the scanner as the last argument.
2775 * That's why we explicitly handle the declaration, instead of using our macros.
2776 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002777int yylex_init(yyscan_t* ptr_yy_globals)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002778{
Luc Ferrone49f1e92018-01-24 14:47:55 -05002779 if (ptr_yy_globals == NULL){
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002780 errno = EINVAL;
2781 return 1;
2782 }
2783
Luc Ferrone49f1e92018-01-24 14:47:55 -05002784 *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002785
Luc Ferrone49f1e92018-01-24 14:47:55 -05002786 if (*ptr_yy_globals == NULL){
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002787 errno = ENOMEM;
2788 return 1;
2789 }
2790
2791 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
2792 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2793
2794 return yy_init_globals ( *ptr_yy_globals );
2795}
2796
Geoff Lang93561c32016-09-20 10:22:55 -04002797
Corentin Wallez168d5e82017-02-01 12:18:56 -08002798/* yylex_init_extra has the same functionality as yylex_init, but follows the
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002799 * convention of taking the scanner as the last argument. Note however, that
2800 * this is a *pointer* to a scanner, as it will be allocated by this call (and
2801 * is the reason, too, why this function also must handle its own declaration).
Corentin Wallez168d5e82017-02-01 12:18:56 -08002802 * The user defined value in the first argument will be available to yyalloc in
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002803 * the yyextra field.
2804 */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002805int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002806{
2807 struct yyguts_t dummy_yyguts;
2808
Corentin Wallez168d5e82017-02-01 12:18:56 -08002809 yyset_extra (yy_user_defined, &dummy_yyguts);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002810
Luc Ferrone49f1e92018-01-24 14:47:55 -05002811 if (ptr_yy_globals == NULL){
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002812 errno = EINVAL;
2813 return 1;
2814 }
Corentin Wallez168d5e82017-02-01 12:18:56 -08002815
2816 *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
2817
Luc Ferrone49f1e92018-01-24 14:47:55 -05002818 if (*ptr_yy_globals == NULL){
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002819 errno = ENOMEM;
2820 return 1;
2821 }
Corentin Wallez168d5e82017-02-01 12:18:56 -08002822
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002823 /* By setting to 0xAA, we expose bugs in
2824 yy_init_globals. Leave at 0x00 for releases. */
2825 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
Corentin Wallez168d5e82017-02-01 12:18:56 -08002826
2827 yyset_extra (yy_user_defined, *ptr_yy_globals);
2828
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002829 return yy_init_globals ( *ptr_yy_globals );
2830}
2831
Geoff Lang93561c32016-09-20 10:22:55 -04002832
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002833static int yy_init_globals (yyscan_t yyscanner)
2834{
2835 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2836 /* Initialization is the same as for the non-reentrant scanner.
Corentin Wallez168d5e82017-02-01 12:18:56 -08002837 * This function is called from yylex_destroy(), so don't allocate here.
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002838 */
2839
Luc Ferrone49f1e92018-01-24 14:47:55 -05002840
2841 yyg->yy_buffer_stack = NULL;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002842 yyg->yy_buffer_stack_top = 0;
2843 yyg->yy_buffer_stack_max = 0;
Luc Ferrone49f1e92018-01-24 14:47:55 -05002844 yyg->yy_c_buf_p = NULL;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002845 yyg->yy_init = 0;
2846 yyg->yy_start = 0;
2847
Geoff Lang93561c32016-09-20 10:22:55 -04002848
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002849 yyg->yy_start_stack_ptr = 0;
2850 yyg->yy_start_stack_depth = 0;
Luc Ferrone49f1e92018-01-24 14:47:55 -05002851 yyg->yy_start_stack = NULL;
2852
2853
2854
2855
2856
Geoff Lang93561c32016-09-20 10:22:55 -04002857
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002858/* Defined in main.c */
2859#ifdef YY_STDINIT
2860 yyin = stdin;
2861 yyout = stdout;
2862#else
Luc Ferrone49f1e92018-01-24 14:47:55 -05002863 yyin = NULL;
2864 yyout = NULL;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002865#endif
2866
2867 /* For future reference: Set errno on error, since we are called by
Corentin Wallez168d5e82017-02-01 12:18:56 -08002868 * yylex_init()
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002869 */
2870 return 0;
2871}
2872
Geoff Lang93561c32016-09-20 10:22:55 -04002873
Corentin Wallez168d5e82017-02-01 12:18:56 -08002874/* yylex_destroy is for both reentrant and non-reentrant scanners. */
2875int yylex_destroy (yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002876{
2877 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2878
2879 /* Pop the buffer stack, destroying each element. */
2880 while(YY_CURRENT_BUFFER){
Corentin Wallez168d5e82017-02-01 12:18:56 -08002881 yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
Luc Ferrone49f1e92018-01-24 14:47:55 -05002882 YY_CURRENT_BUFFER_LVALUE = NULL;
2883 yypop_buffer_state(yyscanner);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002884 }
2885
2886 /* Destroy the stack itself. */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002887 yyfree(yyg->yy_buffer_stack , yyscanner);
Luc Ferrone49f1e92018-01-24 14:47:55 -05002888 yyg->yy_buffer_stack = NULL;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002889
Luc Ferrone49f1e92018-01-24 14:47:55 -05002890
2891 /* Destroy the start condition stack. */
Corentin Wallez168d5e82017-02-01 12:18:56 -08002892 yyfree( yyg->yy_start_stack , yyscanner );
Luc Ferrone49f1e92018-01-24 14:47:55 -05002893 yyg->yy_start_stack = NULL;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002894
Geoff Lang93561c32016-09-20 10:22:55 -04002895
Luc Ferrone49f1e92018-01-24 14:47:55 -05002896
2897
2898 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2899 * yylex() is called, initialization will occur. */
2900 yy_init_globals( yyscanner);
2901
2902 /* Destroy the main struct (reentrant only). */
2903 yyfree ( yyscanner , yyscanner );
2904 yyscanner = NULL;
2905 return 0;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002906}
2907
Geoff Lang93561c32016-09-20 10:22:55 -04002908
2909
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002910/*
2911 * Internal utility routines.
2912 */
2913
Geoff Lang93561c32016-09-20 10:22:55 -04002914
2915
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002916#ifndef yytext_ptr
Corentin Wallez168d5e82017-02-01 12:18:56 -08002917static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002918{
Geoff Lang93561c32016-09-20 10:22:55 -04002919 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2920 (void)yyg;
2921
2922 int i;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002923 for ( i = 0; i < n; ++i )
2924 s1[i] = s2[i];
2925}
2926#endif
2927
Geoff Lang93561c32016-09-20 10:22:55 -04002928
2929
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002930#ifdef YY_NEED_STRLEN
Corentin Wallez168d5e82017-02-01 12:18:56 -08002931static int yy_flex_strlen (const char * s , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002932{
Geoff Lang93561c32016-09-20 10:22:55 -04002933 int n;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002934 for ( n = 0; s[n]; ++n )
2935 ;
2936
2937 return n;
2938}
2939#endif
2940
Geoff Lang93561c32016-09-20 10:22:55 -04002941
2942
Corentin Wallez168d5e82017-02-01 12:18:56 -08002943void *yyalloc (yy_size_t size , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002944{
Geoff Lang93561c32016-09-20 10:22:55 -04002945 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2946 (void)yyg;
2947 return malloc(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 *yyrealloc (void * ptr, yy_size_t size , 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;
2956
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002957 /* The cast to (char *) in the following accommodates both
2958 * implementations that use char* generic pointers, and those
2959 * that use void* generic pointers. It works with the latter
2960 * because both ANSI C and C++ allow castless assignment from
2961 * any pointer type to void*, and deal with argument conversions
2962 * as though doing an assignment.
2963 */
Geoff Lang93561c32016-09-20 10:22:55 -04002964 return realloc(ptr, size);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002965}
2966
Geoff Lang93561c32016-09-20 10:22:55 -04002967
2968
Corentin Wallez168d5e82017-02-01 12:18:56 -08002969void yyfree (void * ptr , yyscan_t yyscanner)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002970{
Geoff Lang93561c32016-09-20 10:22:55 -04002971 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2972 (void)yyg;
Corentin Wallez168d5e82017-02-01 12:18:56 -08002973 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002974}
2975
Geoff Lang93561c32016-09-20 10:22:55 -04002976
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002977#define YYTABLES_NAME "yytables"
2978
Geoff Lang93561c32016-09-20 10:22:55 -04002979
2980
2981
2982
2983
2984
2985
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002986namespace pp {
2987
Corentin Wallez054f7ed2016-09-20 17:15:59 -04002988Tokenizer::Tokenizer(Diagnostics *diagnostics) : mHandle(nullptr), mMaxTokenSize(256)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002989{
alokp@chromium.org2c958ee2012-05-17 20:35:42 +00002990 mContext.diagnostics = diagnostics;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002991}
2992
2993Tokenizer::~Tokenizer()
2994{
2995 destroyScanner();
2996}
2997
Zhenyao Mod526f982014-05-13 14:51:19 -07002998bool Tokenizer::init(size_t count, const char * const string[], const int length[])
alokp@chromium.org04d7d222012-05-16 19:24:07 +00002999{
Zhenyao Mod526f982014-05-13 14:51:19 -07003000 if ((count > 0) && (string == 0))
3001 return false;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00003002
3003 mContext.input = Input(count, string, length);
3004 return initScanner();
3005}
3006
alokp@chromium.org46aa13d2012-06-15 15:40:27 +00003007void Tokenizer::setFileNumber(int file)
3008{
3009 // We use column number as file number.
3010 // See macro yyfileno.
Corentin Wallez168d5e82017-02-01 12:18:56 -08003011 yyset_column(file, mHandle);
alokp@chromium.org46aa13d2012-06-15 15:40:27 +00003012}
3013
3014void Tokenizer::setLineNumber(int line)
3015{
Corentin Wallez168d5e82017-02-01 12:18:56 -08003016 yyset_lineno(line, mHandle);
alokp@chromium.org46aa13d2012-06-15 15:40:27 +00003017}
3018
Jamie Madill5508f392014-02-20 13:31:36 -05003019void Tokenizer::setMaxTokenSize(size_t maxTokenSize)
3020{
3021 mMaxTokenSize = maxTokenSize;
3022}
3023
Zhenyao Mod526f982014-05-13 14:51:19 -07003024void Tokenizer::lex(Token *token)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00003025{
Corentin Wallezdc0fa462017-02-01 14:44:43 -05003026 int tokenType = yylex(&token->text, &token->location, mHandle);
3027
3028 if (tokenType == Token::GOT_ERROR)
3029 {
3030 mContext.diagnostics->report(Diagnostics::PP_TOKENIZER_ERROR, token->location, token->text);
3031 token->type = Token::LAST;
3032 }
3033 else
3034 {
3035 token->type = tokenType;
3036 }
3037
Jamie Madill5508f392014-02-20 13:31:36 -05003038 if (token->text.size() > mMaxTokenSize)
alokp@chromium.orgc022c3a2012-07-09 15:56:42 +00003039 {
Shannon Woods7f2d7942013-11-19 15:07:58 -05003040 mContext.diagnostics->report(Diagnostics::PP_TOKEN_TOO_LONG,
alokp@chromium.orgc022c3a2012-07-09 15:56:42 +00003041 token->location, token->text);
Jamie Madill5508f392014-02-20 13:31:36 -05003042 token->text.erase(mMaxTokenSize);
alokp@chromium.orgc022c3a2012-07-09 15:56:42 +00003043 }
3044
alokp@chromium.org7fc38dd2012-06-14 18:23:23 +00003045 token->flags = 0;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00003046
alokp@chromium.org19d7aa62012-05-31 17:34:05 +00003047 token->setAtStartOfLine(mContext.lineStart);
3048 mContext.lineStart = token->type == '\n';
3049
alokp@chromium.org04d7d222012-05-16 19:24:07 +00003050 token->setHasLeadingSpace(mContext.leadingSpace);
3051 mContext.leadingSpace = false;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00003052}
3053
3054bool Tokenizer::initScanner()
3055{
Corentin Wallez168d5e82017-02-01 12:18:56 -08003056 if ((mHandle == nullptr) && yylex_init_extra(&mContext, &mHandle))
alokp@chromium.org04d7d222012-05-16 19:24:07 +00003057 return false;
3058
Corentin Wallez168d5e82017-02-01 12:18:56 -08003059 yyrestart(0, mHandle);
alokp@chromium.org04d7d222012-05-16 19:24:07 +00003060 return true;
3061}
3062
3063void Tokenizer::destroyScanner()
3064{
Corentin Wallez054f7ed2016-09-20 17:15:59 -04003065 if (mHandle == nullptr)
alokp@chromium.org04d7d222012-05-16 19:24:07 +00003066 return;
3067
Corentin Wallez168d5e82017-02-01 12:18:56 -08003068 yylex_destroy(mHandle);
Corentin Wallez054f7ed2016-09-20 17:15:59 -04003069 mHandle = nullptr;
alokp@chromium.org04d7d222012-05-16 19:24:07 +00003070}
3071
3072} // namespace pp
3073
Geoff Lang93561c32016-09-20 10:22:55 -04003074