Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
parser.yy.cc
Go to the documentation of this file.
1// Copyright 2010-2024 Google LLC
2// Licensed under the Apache License, Version 2.0 (the "License");
3// you may not use this file except in compliance with the License.
4// You may obtain a copy of the License at
5//
6// http://www.apache.org/licenses/LICENSE-2.0
7//
8// Unless required by applicable law or agreed to in writing, software
9// distributed under the License is distributed on an "AS IS" BASIS,
10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11// See the License for the specific language governing permissions and
12// limitations under the License.
13
14#line 2 "./ortools/flatzinc/parser.yy.cc"
15
16#line 4 "./ortools/flatzinc/parser.yy.cc"
17
18#define YY_INT_ALIGNED short int
19
20/* A lexical scanner generated by flex */
21
22#define FLEX_SCANNER
23#define YY_FLEX_MAJOR_VERSION 2
24#define YY_FLEX_MINOR_VERSION 6
25#define YY_FLEX_SUBMINOR_VERSION 4
26#if YY_FLEX_SUBMINOR_VERSION > 0
27#define FLEX_BETA
28#endif
29
30#ifdef yy_create_buffer
31#define orfz__create_buffer_ALREADY_DEFINED
32#else
33#define yy_create_buffer orfz__create_buffer
34#endif
35
36#ifdef yy_delete_buffer
37#define orfz__delete_buffer_ALREADY_DEFINED
38#else
39#define yy_delete_buffer orfz__delete_buffer
40#endif
41
42#ifdef yy_scan_buffer
43#define orfz__scan_buffer_ALREADY_DEFINED
44#else
45#define yy_scan_buffer orfz__scan_buffer
46#endif
47
48#ifdef yy_scan_string
49#define orfz__scan_string_ALREADY_DEFINED
50#else
51#define yy_scan_string orfz__scan_string
52#endif
53
54#ifdef yy_scan_bytes
55#define orfz__scan_bytes_ALREADY_DEFINED
56#else
57#define yy_scan_bytes orfz__scan_bytes
58#endif
59
60#ifdef yy_init_buffer
61#define orfz__init_buffer_ALREADY_DEFINED
62#else
63#define yy_init_buffer orfz__init_buffer
64#endif
65
66#ifdef yy_flush_buffer
67#define orfz__flush_buffer_ALREADY_DEFINED
68#else
69#define yy_flush_buffer orfz__flush_buffer
70#endif
71
72#ifdef yy_load_buffer_state
73#define orfz__load_buffer_state_ALREADY_DEFINED
74#else
75#define yy_load_buffer_state orfz__load_buffer_state
76#endif
77
78#ifdef yy_switch_to_buffer
79#define orfz__switch_to_buffer_ALREADY_DEFINED
80#else
81#define yy_switch_to_buffer orfz__switch_to_buffer
82#endif
83
84#ifdef yypush_buffer_state
85#define orfz_push_buffer_state_ALREADY_DEFINED
86#else
87#define yypush_buffer_state orfz_push_buffer_state
88#endif
89
90#ifdef yypop_buffer_state
91#define orfz_pop_buffer_state_ALREADY_DEFINED
92#else
93#define yypop_buffer_state orfz_pop_buffer_state
94#endif
95
96#ifdef yyensure_buffer_stack
97#define orfz_ensure_buffer_stack_ALREADY_DEFINED
98#else
99#define yyensure_buffer_stack orfz_ensure_buffer_stack
100#endif
101
102#ifdef yylex
103#define orfz_lex_ALREADY_DEFINED
104#else
105#define yylex orfz_lex
106#endif
107
108#ifdef yyrestart
109#define orfz_restart_ALREADY_DEFINED
110#else
111#define yyrestart orfz_restart
112#endif
113
114#ifdef yylex_init
115#define orfz_lex_init_ALREADY_DEFINED
116#else
117#define yylex_init orfz_lex_init
118#endif
119
120#ifdef yylex_init_extra
121#define orfz_lex_init_extra_ALREADY_DEFINED
122#else
123#define yylex_init_extra orfz_lex_init_extra
124#endif
125
126#ifdef yylex_destroy
127#define orfz_lex_destroy_ALREADY_DEFINED
128#else
129#define yylex_destroy orfz_lex_destroy
130#endif
131
132#ifdef yyget_debug
133#define orfz_get_debug_ALREADY_DEFINED
134#else
135#define yyget_debug orfz_get_debug
136#endif
137
138#ifdef yyset_debug
139#define orfz_set_debug_ALREADY_DEFINED
140#else
141#define yyset_debug orfz_set_debug
142#endif
143
144#ifdef yyget_extra
145#define orfz_get_extra_ALREADY_DEFINED
146#else
147#define yyget_extra orfz_get_extra
148#endif
149
150#ifdef yyset_extra
151#define orfz_set_extra_ALREADY_DEFINED
152#else
153#define yyset_extra orfz_set_extra
154#endif
155
156#ifdef yyget_in
157#define orfz_get_in_ALREADY_DEFINED
158#else
159#define yyget_in orfz_get_in
160#endif
161
162#ifdef yyset_in
163#define orfz_set_in_ALREADY_DEFINED
164#else
165#define yyset_in orfz_set_in
166#endif
167
168#ifdef yyget_out
169#define orfz_get_out_ALREADY_DEFINED
170#else
171#define yyget_out orfz_get_out
172#endif
173
174#ifdef yyset_out
175#define orfz_set_out_ALREADY_DEFINED
176#else
177#define yyset_out orfz_set_out
178#endif
179
180#ifdef yyget_leng
181#define orfz_get_leng_ALREADY_DEFINED
182#else
183#define yyget_leng orfz_get_leng
184#endif
185
186#ifdef yyget_text
187#define orfz_get_text_ALREADY_DEFINED
188#else
189#define yyget_text orfz_get_text
190#endif
191
192#ifdef yyget_lineno
193#define orfz_get_lineno_ALREADY_DEFINED
194#else
195#define yyget_lineno orfz_get_lineno
196#endif
197
198#ifdef yyset_lineno
199#define orfz_set_lineno_ALREADY_DEFINED
200#else
201#define yyset_lineno orfz_set_lineno
202#endif
203
204#ifdef yyget_column
205#define orfz_get_column_ALREADY_DEFINED
206#else
207#define yyget_column orfz_get_column
208#endif
209
210#ifdef yyset_column
211#define orfz_set_column_ALREADY_DEFINED
212#else
213#define yyset_column orfz_set_column
214#endif
215
216#ifdef yywrap
217#define orfz_wrap_ALREADY_DEFINED
218#else
219#define yywrap orfz_wrap
220#endif
221
222#ifdef yyget_lval
223#define orfz_get_lval_ALREADY_DEFINED
224#else
225#define yyget_lval orfz_get_lval
226#endif
227
228#ifdef yyset_lval
229#define orfz_set_lval_ALREADY_DEFINED
230#else
231#define yyset_lval orfz_set_lval
232#endif
233
234#ifdef yyalloc
235#define orfz_alloc_ALREADY_DEFINED
236#else
237#define yyalloc orfz_alloc
238#endif
239
240#ifdef yyrealloc
241#define orfz_realloc_ALREADY_DEFINED
242#else
243#define yyrealloc orfz_realloc
244#endif
245
246#ifdef yyfree
247#define orfz_free_ALREADY_DEFINED
248#else
249#define yyfree orfz_free
250#endif
251
252/* First, we deal with platform-specific or compiler-specific issues. */
253
254/* begin standard C headers. */
255#include <errno.h>
256#include <stdio.h>
257#include <stdlib.h>
258#include <string.h>
259
260/* end standard C headers. */
261
262/* flex integer type definitions */
263
264#ifndef FLEXINT_H
265#define FLEXINT_H
266
267/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
268
269#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
270
271/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
272 * if you want the limit (max/min) macros for int types.
273 */
274#ifndef __STDC_LIMIT_MACROS
275#define __STDC_LIMIT_MACROS 1
276#endif
277
278#include <inttypes.h>
279typedef int8_t flex_int8_t;
280typedef uint8_t flex_uint8_t;
281typedef int16_t flex_int16_t;
282typedef uint16_t flex_uint16_t;
283typedef int32_t flex_int32_t;
284typedef uint32_t flex_uint32_t;
285#else
286typedef signed char flex_int8_t;
287typedef short int flex_int16_t;
288typedef int flex_int32_t;
289typedef unsigned char flex_uint8_t;
290typedef unsigned short int flex_uint16_t;
291typedef unsigned int flex_uint32_t;
292
293/* Limits of integral types. */
294#ifndef INT8_MIN
295#define INT8_MIN (-128)
296#endif
297#ifndef INT16_MIN
298#define INT16_MIN (-32767 - 1)
299#endif
300#ifndef INT32_MIN
301#define INT32_MIN (-2147483647 - 1)
302#endif
303#ifndef INT8_MAX
304#define INT8_MAX (127)
305#endif
306#ifndef INT16_MAX
307#define INT16_MAX (32767)
308#endif
309#ifndef INT32_MAX
310#define INT32_MAX (2147483647)
311#endif
312#ifndef UINT8_MAX
313#define UINT8_MAX (255U)
314#endif
315#ifndef UINT16_MAX
316#define UINT16_MAX (65535U)
317#endif
318#ifndef UINT32_MAX
319#define UINT32_MAX (4294967295U)
320#endif
321
322#ifndef SIZE_MAX
323#define SIZE_MAX (~(size_t)0)
324#endif
325
326#endif /* ! C99 */
327
328#endif /* ! FLEXINT_H */
329
330/* begin standard C++ headers. */
331
332/* TODO: this is always defined, so inline it */
333#define yyconst const
334
335#if defined(__GNUC__) && __GNUC__ >= 3
336#define yynoreturn __attribute__((__noreturn__))
337#else
338#define yynoreturn
339#endif
340
341/* Returned upon end-of-file. */
342#define YY_NULL 0
343
344/* Promotes a possibly negative, possibly signed char to an
345 * integer in range [0..255] for use as an array index.
346 */
347#define YY_SC_TO_UI(c) ((YY_CHAR)(c))
348
349/* An opaque pointer. */
350#ifndef YY_TYPEDEF_YY_SCANNER_T
351#define YY_TYPEDEF_YY_SCANNER_T
352typedef void* yyscan_t;
353#endif
354
355/* For convenience, these vars (plus the bison vars far below)
356 are macros in the reentrant scanner. */
357#define yyin yyg->yyin_r
358#define yyout yyg->yyout_r
359#define yyextra yyg->yyextra_r
360#define yyleng yyg->yyleng_r
361#define yytext yyg->yytext_r
362#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
363#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
364#define yy_flex_debug yyg->yy_flex_debug_r
365
366/* Enter a start condition. This macro really ought to take a parameter,
367 * but we do it the disgusting crufty way forced on us by the ()-less
368 * definition of BEGIN.
369 */
370#define BEGIN yyg->yy_start = 1 + 2 *
371/* Translate the current start state into a value that can be later handed
372 * to BEGIN to return to the state. The YYSTATE alias is for lex
373 * compatibility.
374 */
375#define YY_START ((yyg->yy_start - 1) / 2)
376#define YYSTATE YY_START
377/* Action number for EOF rule of a given start state. */
378#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
379/* Special action meaning "start processing a new file". */
380#define YY_NEW_FILE yyrestart(yyin, yyscanner)
381#define YY_END_OF_BUFFER_CHAR 0
382
383/* Size of default input buffer. */
384#ifndef YY_BUF_SIZE
385#ifdef __ia64__
386/* On IA-64, the buffer size is 16k, not 8k.
387 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
388 * Ditto for the __ia64__ case accordingly.
389 */
390#define YY_BUF_SIZE 32768
391#else
392#define YY_BUF_SIZE 16384
393#endif /* __ia64__ */
394#endif
395
396/* The state buf must be large enough to hold one state per character in the
397 * main buffer.
398 */
399#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
400
401#ifndef YY_TYPEDEF_YY_BUFFER_STATE
402#define YY_TYPEDEF_YY_BUFFER_STATE
404#endif
405
406#ifndef YY_TYPEDEF_YY_SIZE_T
407#define YY_TYPEDEF_YY_SIZE_T
408typedef size_t yy_size_t;
409#endif
410
411#define EOB_ACT_CONTINUE_SCAN 0
412#define EOB_ACT_END_OF_FILE 1
413#define EOB_ACT_LAST_MATCH 2
414
415/* Note: We specifically omit the test for yy_rule_can_match_eol because it
416 * requires access to the local variable yy_act. Since yyless() is a macro, it
417 * would break existing scanners that call yyless() from OUTSIDE yylex. One
418 * obvious solution it to make yy_act a global. I tried that, and saw a 5%
419 * performance hit in a non-yylineno scanner, because yy_act is normally
420 * declared as a register variable-- so it is not worth it.
421 */
422#define YY_LESS_LINENO(n) \
423 do { \
424 int yyl; \
425 for (yyl = n; yyl < yyleng; ++yyl) \
426 if (yytext[yyl] == '\n') --yylineno; \
427 } while (0)
428#define YY_LINENO_REWIND_TO(dst) \
429 do { \
430 const char* p; \
431 for (p = yy_cp - 1; p >= (dst); --p) \
432 if (*p == '\n') --yylineno; \
433 } while (0)
434
435/* Return all but the first "n" matched characters back to the input stream. */
436#define yyless(n) \
437 do { \
438 /* Undo effects of setting up yytext. */ \
439 int yyless_macro_arg = (n); \
440 YY_LESS_LINENO(yyless_macro_arg); \
441 *yy_cp = yyg->yy_hold_char; \
442 YY_RESTORE_YY_MORE_OFFSET \
443 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
444 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
445 } while (0)
446#define unput(c) yyunput(c, yyg->yytext_ptr, yyscanner)
447
448#ifndef YY_STRUCT_YY_BUFFER_STATE
449#define YY_STRUCT_YY_BUFFER_STATE
452
453 char* yy_ch_buf; /* input buffer */
454 char* yy_buf_pos; /* current position in input buffer */
455
456 /* Size of input buffer in bytes, not including room for EOB
457 * characters.
458 */
460
461 /* Number of characters read into yy_ch_buf, not including EOB
462 * characters.
463 */
465
466 /* Whether we "own" the buffer - i.e., we know we created it,
467 * and can realloc() it to grow it, and should free() it to
468 * delete it.
469 */
471
472 /* Whether this is an "interactive" input source; if so, and
473 * if we're using stdio for input, then we want to use getc()
474 * instead of fread(), to make sure we stop fetching input after
475 * each newline.
476 */
478
479 /* Whether we're considered to be at the beginning of a line.
480 * If so, '^' rules will be active on the next match, otherwise
481 * not.
482 */
484
488 /* Whether to try to fill the input buffer when we reach the
489 * end of it.
490 */
492
494
495#define YY_BUFFER_NEW 0
496#define YY_BUFFER_NORMAL 1
497 /* When an EOF's been seen but there's still some text to process
498 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
499 * shouldn't try reading from the input source any more. We might
500 * still have a bunch of tokens to match, though, because of
501 * possible backing-up.
502 *
503 * When we actually see the EOF, we change the status to "new"
504 * (via yyrestart()), so that the user can continue scanning by
505 * just pointing yyin at a new input file.
506 */
507#define YY_BUFFER_EOF_PENDING 2
508};
509#endif /* !YY_STRUCT_YY_BUFFER_STATE */
510
511/* We provide macros for accessing buffer states in case in the
512 * future we want to put the buffer states in a more general
513 * "scanner state".
514 *
515 * Returns the top of the stack, or NULL.
516 */
517#define YY_CURRENT_BUFFER \
518 (yyg->yy_buffer_stack ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] : NULL)
519/* Same as previous macro, but useful when we know that the buffer stack is not
520 * NULL or when we need an lvalue. For internal use only.
521 */
522#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
523
524void yyrestart(FILE* input_file, yyscan_t yyscanner);
525void yy_switch_to_buffer(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner);
529void yypush_buffer_state(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner);
531
532static void yyensure_buffer_stack(yyscan_t yyscanner);
533static void yy_load_buffer_state(yyscan_t yyscanner);
534static void yy_init_buffer(YY_BUFFER_STATE b, FILE* file, yyscan_t yyscanner);
535#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER, yyscanner)
536
538YY_BUFFER_STATE yy_scan_string(const char* yy_str, yyscan_t yyscanner);
539YY_BUFFER_STATE yy_scan_bytes(const char* bytes, int len, yyscan_t yyscanner);
540
541void* yyalloc(yy_size_t, yyscan_t yyscanner);
542void* yyrealloc(void*, yy_size_t, yyscan_t yyscanner);
543void yyfree(void*, yyscan_t yyscanner);
544
545#define yy_new_buffer yy_create_buffer
546#define yy_set_interactive(is_interactive) \
547 { \
548 if (!YY_CURRENT_BUFFER) { \
549 yyensure_buffer_stack(yyscanner); \
550 YY_CURRENT_BUFFER_LVALUE = \
551 yy_create_buffer(yyin, YY_BUF_SIZE, yyscanner); \
552 } \
553 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
554 }
555#define yy_set_bol(at_bol) \
556 { \
557 if (!YY_CURRENT_BUFFER) { \
558 yyensure_buffer_stack(yyscanner); \
559 YY_CURRENT_BUFFER_LVALUE = \
560 yy_create_buffer(yyin, YY_BUF_SIZE, yyscanner); \
561 } \
562 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
563 }
564#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
565
566/* Begin user sect3 */
567
568#define orfz_wrap(yyscanner) (/*CONSTCOND*/ 1)
569#define YY_SKIP_YYWRAP
571
572typedef int yy_state_type;
573
574#define yytext_ptr yytext_r
575
578 yyscan_t yyscanner);
579static int yy_get_next_buffer(yyscan_t yyscanner);
580static void yynoreturn yy_fatal_error(const char* msg, yyscan_t yyscanner);
581
582/* Done after the current pattern has been matched and before the
583 * corresponding action - sets up yytext.
584 */
585#define YY_DO_BEFORE_ACTION \
586 yyg->yytext_ptr = yy_bp; \
587 yyleng = (int)(yy_cp - yy_bp); \
588 yyg->yy_hold_char = *yy_cp; \
589 *yy_cp = '\0'; \
590 yyg->yy_c_buf_p = yy_cp;
591#define YY_NUM_RULES 31
592#define YY_END_OF_BUFFER 32
593/* This struct is not used in this scanner,
594 but its presence is necessary. */
599static const flex_int16_t yy_accept[117] = {
600 0, 0, 0, 32, 30, 28, 27, 30, 29, 30, 30, 18, 18, 30, 24, 30, 24,
601 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 0, 26, 29, 18, 18, 14, 0,
602 0, 0, 0, 15, 24, 25, 0, 24, 24, 24, 24, 24, 24, 24, 24, 8, 24,
603 24, 24, 24, 24, 24, 21, 0, 23, 20, 19, 25, 24, 24, 24, 24, 24, 5,
604 24, 24, 24, 24, 11, 24, 24, 13, 0, 24, 2, 24, 24, 24, 24, 24, 24,
605 24, 24, 16, 0, 22, 1, 24, 17, 4, 24, 24, 24, 24, 12, 24, 24,
606
607 24, 24, 24, 24, 24, 24, 24, 10, 24, 6, 7, 24, 24, 9, 3, 0};
608
609static const YY_CHAR yy_ec[256] = {
610 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1,
611 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 4, 1, 1, 5,
612 1, 1, 1, 1, 1, 6, 1, 7, 8, 1, 9, 10, 10, 10, 10, 10, 10, 10, 11,
613 11, 12, 1, 1, 1, 1, 1, 1, 13, 13, 13, 13, 14, 13, 15, 15, 15, 15, 15,
614 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 1, 1, 1, 1,
615 16, 1, 17, 18, 19, 20,
616
617 21, 22, 15, 15, 23, 15, 15, 24, 25, 26, 27, 28, 15, 29, 30, 31, 32, 33, 15,
618 34, 35, 36, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
619 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
620 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
621 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
622 1, 1, 1, 1, 1,
623
624 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
625 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
626 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
627
628static const YY_CHAR yy_meta[37] = {0, 1, 1, 2, 1, 1, 1, 1, 1, 3, 3, 3, 1,
629 4, 4, 5, 5, 4, 4, 4, 4, 4, 4, 5, 5, 5,
630 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5};
631
632static const flex_int16_t yy_base[123] = {
633 0, 0, 0, 174, 175, 175, 175, 169, 0, 28, 164, 32, 17, 159, 0,
634 154, 140, 141, 140, 28, 140, 31, 143, 135, 40, 134, 145, 157, 175, 0,
635 0, 0, 175, 53, 62, 40, 0, 175, 0, 0, 144, 130, 131, 131, 132,
636 128, 123, 119, 126, 0, 130, 119, 118, 124, 115, 117, 65, 71, 74, 46,
637 0, 0, 128, 120, 113, 112, 124, 0, 117, 116, 118, 114, 0, 103, 114,
638 0, 81, 99, 0, 102, 111, 100, 105, 104, 105, 97, 105, 0, 84, 87,
639 0, 96, 0, 0, 101, 100, 103, 99, 0, 103, 83,
640
641 69, 83, 54, 55, 56, 49, 34, 0, 34, 0, 0, 37, 16, 0, 0,
642 175, 98, 103, 106, 108, 111, 113};
643
644static const flex_int16_t yy_def[123] = {
645 0, 116, 1, 116, 116, 116, 116, 117, 118, 116, 116, 116, 11, 116, 119,
646 120, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 117, 116, 118,
647 11, 12, 116, 116, 116, 116, 121, 116, 119, 122, 120, 119, 119, 119, 119,
648 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 116, 116, 116, 116,
649 121, 122, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119,
650 119, 116, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 116, 116,
651 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119,
652
653 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119,
654 0, 116, 116, 116, 116, 116, 116};
655
656static const flex_int16_t yy_nxt[212] = {
657 0, 4, 5, 6, 7, 8, 4, 9, 10, 11, 12, 12, 13, 14, 14,
658 14, 15, 16, 17, 18, 14, 14, 19, 20, 14, 21, 14, 22, 23, 14,
659 24, 25, 14, 26, 14, 14, 14, 30, 31, 31, 33, 31, 31, 31, 116,
660 44, 34, 115, 47, 59, 59, 116, 45, 34, 48, 59, 59, 51, 114, 35,
661 113, 52, 56, 56, 56, 112, 36, 53, 57, 57, 111, 58, 58, 58, 56,
662 56, 56, 110, 109, 76, 58, 58, 58, 58, 58, 58, 76, 88, 88, 108,
663 89, 89, 89, 89, 89, 89, 89, 89, 89, 27, 107,
664
665 27, 27, 27, 29, 106, 29, 29, 29, 38, 38, 38, 39, 39, 60, 60,
666 61, 61, 61, 105, 104, 103, 102, 101, 100, 99, 98, 97, 96, 95, 94,
667 93, 92, 91, 90, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77,
668 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 40,
669 28, 55, 54, 50, 49, 46, 43, 42, 41, 40, 37, 32, 28, 116, 3,
670 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
671 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
672
673 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116};
674
675static const flex_int16_t yy_chk[212] = {
676 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
677 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
678 1, 1, 1, 1, 1, 1, 1, 9, 9, 9, 11, 11, 11, 11, 12,
679 19, 11, 113, 21, 35, 35, 12, 19, 11, 21, 59, 59, 24, 112, 11,
680 109, 24, 33, 33, 33, 107, 11, 24, 34, 34, 106, 34, 34, 34, 56,
681 56, 56, 105, 104, 56, 57, 57, 57, 58, 58, 58, 56, 76, 76, 103,
682 76, 76, 76, 88, 88, 88, 89, 89, 89, 117, 102,
683
684 117, 117, 117, 118, 101, 118, 118, 118, 119, 119, 119, 120, 120, 121, 121,
685 122, 122, 122, 100, 99, 97, 96, 95, 94, 91, 86, 85, 84, 83, 82,
686 81, 80, 79, 77, 74, 73, 71, 70, 69, 68, 66, 65, 64, 63, 62,
687 55, 54, 53, 52, 51, 50, 48, 47, 46, 45, 44, 43, 42, 41, 40,
688 27, 26, 25, 23, 22, 20, 18, 17, 16, 15, 13, 10, 7, 3, 116,
689 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
690 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
691
692 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116};
693
694/* Table of booleans, true if rule could match eol. */
696 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
697 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
698};
699
700/* The intent behind this definition is that it'll catch
701 * any uses of REJECT which flex missed.
702 */
703#define REJECT reject_used_but_not_detected
704#define yymore() yymore_used_but_not_detected
705#define YY_MORE_ADJ 0
706#define YY_RESTORE_YY_MORE_OFFSET
707#line 1 "./ortools/flatzinc/parser.lex"
708/* Create a reentrant parser. */
709/* Allow parameter passing to and from the bison parser. */
710/* Rename yy to orfz_ in public functions. */
711#line 11 "./ortools/flatzinc/parser.lex"
712#include <cstdint>
713#include <string>
714
715#include "absl/strings/numbers.h"
717#if defined(_MSC_VER)
718#define YY_NO_UNISTD_H
719#include "io.h"
720#define isatty _isatty
721#endif
722#line 769 "./ortools/flatzinc/parser.yy.cc"
723/* Rules that parse the bottom-line string tokens of a .fz file and
724 convert them into YACC tokens, which may carry a value. See the
725 LexerInfo struct and the %token declarations in ./parser.yy. */
726#line 773 "./ortools/flatzinc/parser.yy.cc"
727
728#define INITIAL 0
729
730#ifndef YY_NO_UNISTD_H
731/* Special case for "unistd.h", since it is non-ANSI. We include it way
732 * down here because we want the user's section 1 to have been scanned first.
733 * The user has a chance to override it with an option.
734 */
735#include <unistd.h>
736#endif
737
738#ifndef YY_EXTRA_TYPE
739#define YY_EXTRA_TYPE void*
740#endif
741
742/* Holds the entire state of the reentrant scanner. */
743struct yyguts_t {
744 /* User-defined. Not touched by flex. */
746
747 /* The rest are the same as the globals declared in the non-reentrant scanner.
748 */
765
768
769 char* yytext_r;
772
774
775}; /* end struct yyguts_t */
776
777static int yy_init_globals(yyscan_t yyscanner);
778
779/* This must go here because YYSTYPE and YYLTYPE are included
780 * from bison output in section 1.*/
781#define yylval yyg->yylval_r
782
783int yylex_init(yyscan_t* scanner);
784
785int yylex_init_extra(YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
786
787/* Accessor methods to globals.
788 These are made visible to non-reentrant scanners for convenience. */
789
790int yylex_destroy(yyscan_t yyscanner);
791
792int yyget_debug(yyscan_t yyscanner);
793
794void yyset_debug(int debug_flag, yyscan_t yyscanner);
795
797
798void yyset_extra(YY_EXTRA_TYPE user_defined, yyscan_t yyscanner);
799
800FILE* yyget_in(yyscan_t yyscanner);
801
802void yyset_in(FILE* _in_str, yyscan_t yyscanner);
803
804FILE* yyget_out(yyscan_t yyscanner);
805
806void yyset_out(FILE* _out_str, yyscan_t yyscanner);
807
808int yyget_leng(yyscan_t yyscanner);
809
810char* yyget_text(yyscan_t yyscanner);
811
812int yyget_lineno(yyscan_t yyscanner);
813
814void yyset_lineno(int _line_number, yyscan_t yyscanner);
815
816int yyget_column(yyscan_t yyscanner);
817
818void yyset_column(int _column_no, yyscan_t yyscanner);
819
821
822void yyset_lval(YYSTYPE* yylval_param, yyscan_t yyscanner);
823
824/* Macros after this point can all be overridden by user definitions in
825 * section 1.
826 */
827
828#ifndef YY_SKIP_YYWRAP
829#ifdef __cplusplus
830extern "C" int yywrap(yyscan_t yyscanner);
831#else
832extern int yywrap(yyscan_t yyscanner);
833#endif
834#endif
835
836#ifndef YY_NO_UNPUT
837
838static void yyunput(int c, char* buf_ptr, yyscan_t yyscanner);
839
840#endif
841
842#ifndef yytext_ptr
843static void yy_flex_strncpy(char*, const char*, int, yyscan_t yyscanner);
844#endif
845
846#ifdef YY_NEED_STRLEN
847static int yy_flex_strlen(const char*, yyscan_t yyscanner);
848#endif
849
850#ifndef YY_NO_INPUT
851#ifdef __cplusplus
852static int yyinput(yyscan_t yyscanner);
853#else
854static int input(yyscan_t yyscanner);
855#endif
856
857#endif
858
859/* Amount of stuff to slurp up with each read. */
860#ifndef YY_READ_BUF_SIZE
861#ifdef __ia64__
862/* On IA-64, the buffer size is 16k, not 8k */
863#define YY_READ_BUF_SIZE 16384
864#else
865#define YY_READ_BUF_SIZE 8192
866#endif /* __ia64__ */
867#endif
868
869/* Copy whatever the last rule matched to the standard output. */
870#ifndef ECHO
871/* This used to be an fputs(), but since the string might contain NUL's,
872 * we now use fwrite().
873 */
874#define ECHO \
875 do { \
876 if (fwrite(yytext, (size_t)yyleng, 1, yyout)) { \
877 } \
878 } while (0)
879#endif
880
881/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
882 * is returned in "result".
883 */
884#ifndef YY_INPUT
885#define YY_INPUT(buf, result, max_size) \
886 if (YY_CURRENT_BUFFER_LVALUE->yy_is_interactive) { \
887 int c = '*'; \
888 int n; \
889 for (n = 0; n < max_size && (c = getc(yyin)) != EOF && c != '\n'; ++n) \
890 buf[n] = (char)c; \
891 if (c == '\n') buf[n++] = (char)c; \
892 if (c == EOF && ferror(yyin)) \
893 YY_FATAL_ERROR("input in flex scanner failed"); \
894 result = n; \
895 } else { \
896 errno = 0; \
897 while ((result = (int)fread(buf, 1, (yy_size_t)max_size, yyin)) == 0 && \
898 ferror(yyin)) { \
899 if (errno != EINTR) { \
900 YY_FATAL_ERROR("input in flex scanner failed"); \
901 break; \
902 } \
903 errno = 0; \
904 clearerr(yyin); \
905 } \
906 }
907
908#endif
909
910/* No semi-colon after return; correct usage is to write "yyterminate();" -
911 * we don't want an extra ';' after the "return" because that will cause
912 * some compilers to complain about unreachable statements.
913 */
914#ifndef yyterminate
915#define yyterminate() return YY_NULL
916#endif
917
918/* Number of entries by which start-condition stack grows. */
919#ifndef YY_START_STACK_INCR
920#define YY_START_STACK_INCR 25
921#endif
922
923/* Report a fatal error. */
924#ifndef YY_FATAL_ERROR
925#define YY_FATAL_ERROR(msg) yy_fatal_error(msg, yyscanner)
926#endif
927
928/* end tables serialization structures and prototypes */
929
930/* Default declaration of generated scanner - a define so the user can
931 * easily add parameters.
932 */
933#ifndef YY_DECL
934#define YY_DECL_IS_OURS 1
935
936extern int yylex(YYSTYPE* yylval_param, yyscan_t yyscanner);
937
938#define YY_DECL int yylex(YYSTYPE* yylval_param, yyscan_t yyscanner)
939#endif /* !YY_DECL */
940
941/* Code executed at the beginning of each rule, after yytext and yyleng
942 * have been set up.
943 */
944#ifndef YY_USER_ACTION
945#define YY_USER_ACTION
946#endif
947
948/* Code executed at the end of each rule. */
949#ifndef YY_BREAK
950#define YY_BREAK /*LINTED*/ break;
951#endif
952
953#define YY_RULE_SETUP YY_USER_ACTION
954
958 yy_state_type yy_current_state;
959 char *yy_cp, *yy_bp;
961 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
962
963 yylval = yylval_param;
964
965 if (!yyg->yy_init) {
966 yyg->yy_init = 1;
967
968#ifdef YY_USER_INIT
969 YY_USER_INIT;
970#endif
971
972 if (!yyg->yy_start) yyg->yy_start = 1; /* first start state */
973
974 if (!yyin) yyin = stdin;
975
976 if (!yyout) yyout = stdout;
977
978 if (!YY_CURRENT_BUFFER) {
979 yyensure_buffer_stack(yyscanner);
981 }
982
983 yy_load_buffer_state(yyscanner);
984 }
985
986 {
987#line 26 "./ortools/flatzinc/parser.lex"
988
989#line 1049 "./ortools/flatzinc/parser.yy.cc"
990
991 while (/*CONSTCOND*/ 1) /* loops until end-of-file is reached */
992 {
994
995 /* Support of yytext. */
997
998 /* yy_bp points to the position in yy_ch_buf of the start of
999 * the current run.
1000 */
1001 yy_bp = yy_cp;
1002
1003 yy_current_state = yyg->yy_start;
1004 yy_match:
1005 do {
1006 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1007 if (yy_accept[yy_current_state]) {
1008 yyg->yy_last_accepting_state = yy_current_state;
1010 }
1011 while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) {
1012 yy_current_state = (int)yy_def[yy_current_state];
1013 if (yy_current_state >= 117) yy_c = yy_meta[yy_c];
1014 }
1015 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1016 ++yy_cp;
1017 } while (yy_base[yy_current_state] != 175);
1018
1019 yy_find_action:
1020 yy_act = yy_accept[yy_current_state];
1021 if (yy_act == 0) { /* have to back up */
1023 yy_current_state = yyg->yy_last_accepting_state;
1024 yy_act = yy_accept[yy_current_state];
1025 }
1026
1028
1030 int yyl;
1031 for (yyl = 0; yyl < yyleng; ++yyl)
1032 if (yytext[yyl] == '\n') do {
1033 yylineno++;
1034 yycolumn = 0;
1035 } while (0);
1036 }
1037
1038 do_action: /* This label is used only to access EOF actions. */
1039
1040 switch (yy_act) { /* beginning of action switch */
1041 case 0: /* must back up */
1042 /* undo the effects of YY_DO_BEFORE_ACTION */
1045 yy_current_state = yyg->yy_last_accepting_state;
1046 goto yy_find_action;
1047
1048 case 1:
1050#line 27 "./ortools/flatzinc/parser.lex"
1051 {
1052 return ARRAY;
1053 }
1054 YY_BREAK
1055 case 2:
1057#line 28 "./ortools/flatzinc/parser.lex"
1058 {
1059 return TOKEN_BOOL;
1060 }
1061 YY_BREAK
1062 case 3:
1064#line 29 "./ortools/flatzinc/parser.lex"
1065 {
1066 return CONSTRAINT;
1067 }
1068 YY_BREAK
1069 case 4:
1071#line 30 "./ortools/flatzinc/parser.lex"
1072 {
1073 return TOKEN_FLOAT;
1074 }
1075 YY_BREAK
1076 case 5:
1078#line 31 "./ortools/flatzinc/parser.lex"
1079 {
1080 return TOKEN_INT;
1081 }
1082 YY_BREAK
1083 case 6:
1085#line 32 "./ortools/flatzinc/parser.lex"
1086 {
1087 return MAXIMIZE;
1088 }
1089 YY_BREAK
1090 case 7:
1092#line 33 "./ortools/flatzinc/parser.lex"
1093 {
1094 return MINIMIZE;
1095 }
1096 YY_BREAK
1097 case 8:
1099#line 34 "./ortools/flatzinc/parser.lex"
1100 {
1101 return OF;
1102 }
1103 YY_BREAK
1104 case 9:
1106#line 35 "./ortools/flatzinc/parser.lex"
1107 {
1108 return PREDICATE;
1109 }
1110 YY_BREAK
1111 case 10:
1113#line 36 "./ortools/flatzinc/parser.lex"
1114 {
1115 return SATISFY;
1116 }
1117 YY_BREAK
1118 case 11:
1120#line 37 "./ortools/flatzinc/parser.lex"
1121 {
1122 return SET;
1123 }
1124 YY_BREAK
1125 case 12:
1127#line 38 "./ortools/flatzinc/parser.lex"
1128 {
1129 return SOLVE;
1130 }
1131 YY_BREAK
1132 case 13:
1134#line 39 "./ortools/flatzinc/parser.lex"
1135 {
1136 return VAR;
1137 }
1138 YY_BREAK
1139 case 14:
1141#line 40 "./ortools/flatzinc/parser.lex"
1142 {
1143 return DOTDOT;
1144 }
1145 YY_BREAK
1146 case 15:
1148#line 41 "./ortools/flatzinc/parser.lex"
1149 {
1150 return COLONCOLON;
1151 }
1152 YY_BREAK
1153 case 16:
1155#line 43 "./ortools/flatzinc/parser.lex"
1156 {
1157 yylval->integer_value = 1;
1158 return IVALUE;
1159 }
1160 YY_BREAK
1161 case 17:
1163#line 47 "./ortools/flatzinc/parser.lex"
1164 {
1165 yylval->integer_value = 0;
1166 return IVALUE;
1167 }
1168 YY_BREAK
1169 case 18:
1171#line 51 "./ortools/flatzinc/parser.lex"
1172 {
1173 CHECK(absl::SimpleAtoi(yytext, &yylval->integer_value));
1174 return IVALUE;
1175 }
1176 YY_BREAK
1177 case 19:
1179#line 55 "./ortools/flatzinc/parser.lex"
1180 {
1181 CHECK(absl::SimpleAtoi(yytext, &yylval->integer_value));
1182 return IVALUE;
1183 }
1184 YY_BREAK
1185 case 20:
1187#line 59 "./ortools/flatzinc/parser.lex"
1188 {
1189 CHECK(absl::SimpleAtoi(yytext, &yylval->integer_value));
1190 return IVALUE;
1191 }
1192 YY_BREAK
1193 case 21:
1195#line 63 "./ortools/flatzinc/parser.lex"
1196 {
1197 CHECK(absl::SimpleAtod(yytext, &yylval->double_value));
1198 return DVALUE;
1199 }
1200 YY_BREAK
1201 case 22:
1203#line 67 "./ortools/flatzinc/parser.lex"
1204 {
1205 CHECK(absl::SimpleAtod(yytext, &yylval->double_value));
1206 return DVALUE;
1207 }
1208 YY_BREAK
1209 case 23:
1211#line 71 "./ortools/flatzinc/parser.lex"
1212 {
1213 CHECK(absl::SimpleAtod(yytext, &yylval->double_value));
1214 return DVALUE;
1215 }
1216 YY_BREAK
1217 case 24:
1219#line 76 "./ortools/flatzinc/parser.lex"
1220 {
1221 yylval->string_value = yytext;
1222 return IDENTIFIER;
1223 }
1224 YY_BREAK
1225 case 25:
1227#line 80 "./ortools/flatzinc/parser.lex"
1228 {
1229 yylval->string_value = yytext;
1230 return IDENTIFIER;
1231 }
1232 YY_BREAK
1233 case 26:
1235#line 84 "./ortools/flatzinc/parser.lex"
1236 {
1237 yylval->string_value = yytext;
1238 return SVALUE;
1239 }
1240 YY_BREAK
1241 case 27:
1242 /* rule 27 can match eol */
1244#line 85 "./ortools/flatzinc/parser.lex"
1245 ;
1246 YY_BREAK
1247 case 28:
1249#line 86 "./ortools/flatzinc/parser.lex"
1250 ;
1251 YY_BREAK
1252 case 29:
1254#line 87 "./ortools/flatzinc/parser.lex"
1255 ;
1256 YY_BREAK
1257 case 30:
1259#line 88 "./ortools/flatzinc/parser.lex"
1260 {
1261 return yytext[0];
1262 }
1263 YY_BREAK
1264 case 31:
1266#line 89 "./ortools/flatzinc/parser.lex"
1267 ECHO;
1268 YY_BREAK
1269#line 1305 "./ortools/flatzinc/parser.yy.cc"
1270 case YY_STATE_EOF(INITIAL):
1271 yyterminate();
1272
1273 case YY_END_OF_BUFFER: {
1274 /* Amount of text matched not including the EOB char. */
1275 int yy_amount_of_matched_text = (int)(yy_cp - yyg->yytext_ptr) - 1;
1276
1277 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1280
1281 if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW) {
1282 /* We're scanning a new file or input source. It's
1283 * possible that this happened because the user
1284 * just pointed yyin at a new source and called
1285 * yylex(). If so, then we have to assure
1286 * consistency between YY_CURRENT_BUFFER and our
1287 * globals. Here is the right place to do so, because
1288 * this is the first action (other than possibly a
1289 * back-up) that will match for the new input source.
1290 */
1292 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1293 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1294 }
1295
1296 /* Note that here we test for yy_c_buf_p "<=" to the position
1297 * of the first EOB in the buffer, since yy_c_buf_p will
1298 * already have been incremented past the NUL character
1299 * (since all states make transitions on EOB to the
1300 * end-of-buffer state). Contrast this with the test
1301 * in input().
1302 */
1303 if (yyg->yy_c_buf_p <=
1305 ->yy_ch_buf[yyg->yy_n_chars]) { /* This was really a NUL. */
1306 yy_state_type yy_next_state;
1307
1308 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1309
1310 yy_current_state = yy_get_previous_state(yyscanner);
1311
1312 /* Okay, we're now positioned to make the NUL
1313 * transition. We couldn't have
1314 * yy_get_previous_state() go ahead and do it
1315 * for us because it doesn't know how to deal
1316 * with the possibility of jamming (and we don't
1317 * want to build jamming into it because then it
1318 * will run more slowly).
1319 */
1320
1321 yy_next_state = yy_try_NUL_trans(yy_current_state, yyscanner);
1322
1323 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1324
1325 if (yy_next_state) {
1326 /* Consume the NUL. */
1327 yy_cp = ++yyg->yy_c_buf_p;
1328 yy_current_state = yy_next_state;
1329 goto yy_match;
1330 }
1331
1332 else {
1333 yy_cp = yyg->yy_c_buf_p;
1334 goto yy_find_action;
1335 }
1336 }
1337
1338 else
1339 switch (yy_get_next_buffer(yyscanner)) {
1340 case EOB_ACT_END_OF_FILE: {
1342
1343 if (yywrap(yyscanner)) {
1344 /* Note: because we've taken care in
1345 * yy_get_next_buffer() to have set up
1346 * yytext, we can now set up
1347 * yy_c_buf_p so that if some total
1348 * hoser (like flex itself) wants to
1349 * call the scanner after we return the
1350 * YY_NULL, it'll still work - another
1351 * YY_NULL will get returned.
1352 */
1353 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1354
1356 goto do_action;
1357 }
1358
1359 else {
1361 }
1362 break;
1363 }
1364
1366 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1367
1368 yy_current_state = yy_get_previous_state(yyscanner);
1369
1370 yy_cp = yyg->yy_c_buf_p;
1371 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1372 goto yy_match;
1373
1374 case EOB_ACT_LAST_MATCH:
1375 yyg->yy_c_buf_p =
1377
1378 yy_current_state = yy_get_previous_state(yyscanner);
1379
1380 yy_cp = yyg->yy_c_buf_p;
1381 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1382 goto yy_find_action;
1383 }
1384 break;
1385 }
1386
1387 default:
1388 YY_FATAL_ERROR("fatal flex scanner internal error--no action found");
1389 } /* end of action switch */
1390 } /* end of scanning one token */
1391 } /* end of user's declarations */
1392} /* end of yylex */
1393
1394/* yy_get_next_buffer - try to read in a new buffer
1395 *
1396 * Returns a code representing an action:
1397 * EOB_ACT_LAST_MATCH -
1398 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1399 * EOB_ACT_END_OF_FILE - end of file
1400 */
1401static int yy_get_next_buffer(yyscan_t yyscanner) {
1402 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
1403 char* dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1404 char* source = yyg->yytext_ptr;
1405 int number_to_move, i;
1406 int ret_val;
1407
1408 if (yyg->yy_c_buf_p >
1409 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1])
1410 YY_FATAL_ERROR("fatal flex scanner internal error--end of buffer missed");
1411
1412 if (YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer ==
1413 0) { /* Don't try to fill the buffer, so this is an EOF. */
1414 if (yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1) {
1415 /* We matched a single character, the EOB, so
1416 * treat this as a final EOF.
1417 */
1418 return EOB_ACT_END_OF_FILE;
1419 }
1420
1421 else {
1422 /* We matched some text prior to the EOB, first
1423 * process it.
1424 */
1425 return EOB_ACT_LAST_MATCH;
1426 }
1427 }
1428
1429 /* Try to read more data. */
1430
1431 /* First move last chars to start of buffer. */
1432 number_to_move = (int)(yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
1433
1434 for (i = 0; i < number_to_move; ++i) *(dest++) = *(source++);
1435
1436 if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING)
1437 /* don't do the read, it's not guaranteed to return an EOF,
1438 * just force an EOF
1439 */
1440 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1441
1442 else {
1443 int num_to_read =
1444 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1445
1446 while (num_to_read <= 0) { /* Not enough room in the buffer - grow it. */
1447
1448 /* just a shorter name for the current buffer */
1450
1451 int yy_c_buf_p_offset = (int)(yyg->yy_c_buf_p - b->yy_ch_buf);
1452
1453 if (b->yy_is_our_buffer) {
1454 int new_size = b->yy_buf_size * 2;
1455
1456 if (new_size <= 0)
1457 b->yy_buf_size += b->yy_buf_size / 8;
1458 else
1459 b->yy_buf_size *= 2;
1460
1461 b->yy_ch_buf = (char*)
1462 /* Include room in for 2 EOB chars. */
1463 yyrealloc((void*)b->yy_ch_buf, (yy_size_t)(b->yy_buf_size + 2),
1464 yyscanner);
1465 } else
1466 /* Can't grow it, we don't own it. */
1467 b->yy_ch_buf = NULL;
1468
1469 if (!b->yy_ch_buf)
1470 YY_FATAL_ERROR("fatal error - scanner input buffer overflow");
1471
1472 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1473
1474 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1475 }
1476
1477 if (num_to_read > YY_READ_BUF_SIZE) num_to_read = YY_READ_BUF_SIZE;
1478
1479 /* Read in more data. */
1480 YY_INPUT((&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1481 yyg->yy_n_chars, num_to_read);
1482
1484 }
1485
1486 if (yyg->yy_n_chars == 0) {
1487 if (number_to_move == YY_MORE_ADJ) {
1488 ret_val = EOB_ACT_END_OF_FILE;
1489 yyrestart(yyin, yyscanner);
1490 }
1491
1492 else {
1493 ret_val = EOB_ACT_LAST_MATCH;
1495 }
1496 }
1497
1498 else
1499 ret_val = EOB_ACT_CONTINUE_SCAN;
1500
1501 if ((yyg->yy_n_chars + number_to_move) >
1502 YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1503 /* Extend the array by 50%, plus the number we really need. */
1504 int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
1505 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf =
1506 (char*)yyrealloc((void*)YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,
1507 (yy_size_t)new_size, yyscanner);
1508 if (!YY_CURRENT_BUFFER_LVALUE->yy_ch_buf)
1509 YY_FATAL_ERROR("out of dynamic memory in yy_get_next_buffer()");
1510 /* "- 2" to take care of EOB's */
1511 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int)(new_size - 2);
1512 }
1513
1514 yyg->yy_n_chars += number_to_move;
1516 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] =
1518
1519 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1520
1521 return ret_val;
1522}
1523
1524/* yy_get_previous_state - get the state just before the EOB char was reached */
1525
1527 yy_state_type yy_current_state;
1528 char* yy_cp;
1529 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
1530
1531 yy_current_state = yyg->yy_start;
1532
1533 for (yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p;
1534 ++yy_cp) {
1535 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1536 if (yy_accept[yy_current_state]) {
1537 yyg->yy_last_accepting_state = yy_current_state;
1539 }
1540 while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) {
1541 yy_current_state = (int)yy_def[yy_current_state];
1542 if (yy_current_state >= 117) yy_c = yy_meta[yy_c];
1543 }
1544 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1545 }
1546
1547 return yy_current_state;
1548}
1549
1550/* yy_try_NUL_trans - try to make a transition on the NUL character
1551 *
1552 * synopsis
1553 * next_state = yy_try_NUL_trans( current_state );
1554 */
1555static yy_state_type yy_try_NUL_trans(yy_state_type yy_current_state,
1556 yyscan_t yyscanner) {
1557 int yy_is_jam;
1558 struct yyguts_t* yyg = (struct yyguts_t*)
1559 yyscanner; /* This var may be unused depending upon options. */
1560 char* yy_cp = yyg->yy_c_buf_p;
1561
1562 YY_CHAR yy_c = 1;
1563 if (yy_accept[yy_current_state]) {
1564 yyg->yy_last_accepting_state = yy_current_state;
1566 }
1567 while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) {
1568 yy_current_state = (int)yy_def[yy_current_state];
1569 if (yy_current_state >= 117) yy_c = yy_meta[yy_c];
1570 }
1571 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1572 yy_is_jam = (yy_current_state == 116);
1573
1574 (void)yyg;
1575 return yy_is_jam ? 0 : yy_current_state;
1576}
1577
1578#ifndef YY_NO_UNPUT
1579
1580static void yyunput(int c, char* yy_bp, yyscan_t yyscanner) {
1581 char* yy_cp;
1582 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
1583
1584 yy_cp = yyg->yy_c_buf_p;
1585
1586 /* undo effects of setting up yytext */
1588
1590 2) { /* need to shift things up to make room */
1591 /* +2 for EOB chars. */
1592 int number_to_move = yyg->yy_n_chars + 2;
1593 char* dest = &YY_CURRENT_BUFFER_LVALUE
1594 ->yy_ch_buf[YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1595 char* source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1596
1597 while (source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) *--dest = *--source;
1598
1599 yy_cp += (int)(dest - source);
1600 yy_bp += (int)(dest - source);
1601 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars =
1602 (int)YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1603
1604 if (yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2)
1605 YY_FATAL_ERROR("flex scanner push-back overflow");
1606 }
1607
1608 *--yy_cp = (char)c;
1609
1610 if (c == '\n') {
1611 --yylineno;
1612 }
1613
1614 yyg->yytext_ptr = yy_bp;
1616 yyg->yy_c_buf_p = yy_cp;
1617}
1618
1619#endif
1620
1621#ifndef YY_NO_INPUT
1622#ifdef __cplusplus
1623static int yyinput(yyscan_t yyscanner)
1624#else
1625static int input(yyscan_t yyscanner)
1626#endif
1627
1628{
1629 int c;
1630 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
1631
1633
1635 /* yy_c_buf_p now points to the character we want to return.
1636 * If this occurs *before* the EOB characters, then it's a
1637 * valid NUL; if not, then we've hit the end of the buffer.
1638 */
1640 /* This was really a NUL. */
1641 *yyg->yy_c_buf_p = '\0';
1642
1643 else { /* need more input */
1644 int offset = (int)(yyg->yy_c_buf_p - yyg->yytext_ptr);
1645 ++yyg->yy_c_buf_p;
1646
1647 switch (yy_get_next_buffer(yyscanner)) {
1648 case EOB_ACT_LAST_MATCH:
1649 /* This happens because yy_g_n_b()
1650 * sees that we've accumulated a
1651 * token and flags that we need to
1652 * try matching the token before
1653 * proceeding. But for input(),
1654 * there's no matching to consider.
1655 * So convert the EOB_ACT_LAST_MATCH
1656 * to EOB_ACT_END_OF_FILE.
1657 */
1658
1659 /* Reset buffer status. */
1660 yyrestart(yyin, yyscanner);
1661
1662 /*FALLTHROUGH*/
1663
1664 case EOB_ACT_END_OF_FILE: {
1665 if (yywrap(yyscanner)) return 0;
1666
1668#ifdef __cplusplus
1669 return yyinput(yyscanner);
1670#else
1671 return input(yyscanner);
1672#endif
1673 }
1674
1676 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
1677 break;
1678 }
1679 }
1680 }
1681
1682 c = *(unsigned char*)yyg->yy_c_buf_p; /* cast for 8-bit char's */
1683 *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
1685
1686 if (c == '\n') do {
1687 yylineno++;
1688 yycolumn = 0;
1689 } while (0);
1690
1691 return c;
1692}
1693#endif /* ifndef YY_NO_INPUT */
1694
1700void yyrestart(FILE* input_file, yyscan_t yyscanner) {
1701 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
1702
1703 if (!YY_CURRENT_BUFFER) {
1704 yyensure_buffer_stack(yyscanner);
1706 }
1707
1708 yy_init_buffer(YY_CURRENT_BUFFER, input_file, yyscanner);
1709 yy_load_buffer_state(yyscanner);
1710}
1711
1716void yy_switch_to_buffer(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner) {
1717 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
1718
1719 /* TODO. We should be able to replace this entire function body
1720 * with
1721 * yypop_buffer_state();
1722 * yypush_buffer_state(new_buffer);
1723 */
1724 yyensure_buffer_stack(yyscanner);
1725 if (YY_CURRENT_BUFFER == new_buffer) return;
1726
1727 if (YY_CURRENT_BUFFER) {
1728 /* Flush out information for old buffer. */
1732 }
1733
1734 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1735 yy_load_buffer_state(yyscanner);
1736
1737 /* We don't actually know whether we did this switch during
1738 * EOF (yywrap()) processing, but the only time this flag
1739 * is looked at is after yywrap() is called, so it's safe
1740 * to go ahead and always set it.
1741 */
1743}
1744
1745static void yy_load_buffer_state(yyscan_t yyscanner) {
1746 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
1748 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1749 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1751}
1752
1760YY_BUFFER_STATE yy_create_buffer(FILE* file, int size, yyscan_t yyscanner) {
1762
1763 b = (YY_BUFFER_STATE)yyalloc(sizeof(struct yy_buffer_state), yyscanner);
1764 if (!b) YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()");
1765
1766 b->yy_buf_size = size;
1767
1768 /* yy_ch_buf has to be 2 characters longer than the size given because
1769 * we need to put in 2 end-of-buffer characters.
1770 */
1771 b->yy_ch_buf = (char*)yyalloc((yy_size_t)(b->yy_buf_size + 2), yyscanner);
1772 if (!b->yy_ch_buf)
1773 YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()");
1774
1775 b->yy_is_our_buffer = 1;
1776
1777 yy_init_buffer(b, file, yyscanner);
1778
1779 return b;
1780}
1781
1786void yy_delete_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner) {
1787 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
1788
1789 if (!b) return;
1790
1791 if (b == YY_CURRENT_BUFFER) /* Not sure if we should pop here. */
1793
1794 if (b->yy_is_our_buffer) yyfree((void*)b->yy_ch_buf, yyscanner);
1795
1796 yyfree((void*)b, yyscanner);
1797}
1798
1799/* Initializes or reinitializes a buffer.
1800 * This function is sometimes called more than once on the same buffer,
1801 * such as during a yyrestart() or at EOF.
1802 */
1803static void yy_init_buffer(YY_BUFFER_STATE b, FILE* file, yyscan_t yyscanner)
1804
1805{
1806 int oerrno = errno;
1807 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
1808
1809 yy_flush_buffer(b, yyscanner);
1810
1811 b->yy_input_file = file;
1812 b->yy_fill_buffer = 1;
1813
1814 /* If b is the current buffer, then yy_init_buffer was _probably_
1815 * called from yyrestart() or through yy_get_next_buffer.
1816 * In that case, we don't want to reset the lineno or column.
1817 */
1818 if (b != YY_CURRENT_BUFFER) {
1819 b->yy_bs_lineno = 1;
1820 b->yy_bs_column = 0;
1821 }
1822
1823 b->yy_is_interactive = file ? (isatty(fileno(file)) > 0) : 0;
1824
1825 errno = oerrno;
1826}
1827
1832void yy_flush_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner) {
1833 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
1834 if (!b) return;
1835
1836 b->yy_n_chars = 0;
1837
1838 /* We always need two end-of-buffer characters. The first causes
1839 * a transition to the end-of-buffer state. The second causes
1840 * a jam in that state.
1841 */
1842 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1843 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1844
1845 b->yy_buf_pos = &b->yy_ch_buf[0];
1846
1847 b->yy_at_bol = 1;
1848 b->yy_buffer_status = YY_BUFFER_NEW;
1849
1850 if (b == YY_CURRENT_BUFFER) yy_load_buffer_state(yyscanner);
1851}
1852
1859void yypush_buffer_state(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner) {
1860 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
1861 if (new_buffer == NULL) return;
1862
1863 yyensure_buffer_stack(yyscanner);
1864
1865 /* This block is copied from yy_switch_to_buffer. */
1866 if (YY_CURRENT_BUFFER) {
1867 /* Flush out information for old buffer. */
1871 }
1872
1873 /* Only push if top exists. Otherwise, replace top. */
1875 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1876
1877 /* copied from yy_switch_to_buffer. */
1878 yy_load_buffer_state(yyscanner);
1880}
1881
1886void yypop_buffer_state(yyscan_t yyscanner) {
1887 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
1888 if (!YY_CURRENT_BUFFER) return;
1889
1893
1894 if (YY_CURRENT_BUFFER) {
1895 yy_load_buffer_state(yyscanner);
1897 }
1898}
1899
1900/* Allocates the stack if it does not exist.
1901 * Guarantees space for at least one push.
1902 */
1903static void yyensure_buffer_stack(yyscan_t yyscanner) {
1904 yy_size_t num_to_alloc;
1905 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
1906
1907 if (!yyg->yy_buffer_stack) {
1908 /* First allocation is just for 2 elements, since we don't know if this
1909 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1910 * immediate realloc on the next call.
1911 */
1912 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
1914 num_to_alloc * sizeof(struct yy_buffer_state*), yyscanner);
1915 if (!yyg->yy_buffer_stack)
1916 YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()");
1917
1918 memset(yyg->yy_buffer_stack, 0,
1919 num_to_alloc * sizeof(struct yy_buffer_state*));
1920
1921 yyg->yy_buffer_stack_max = num_to_alloc;
1923 return;
1924 }
1925
1927 /* Increase the buffer to prepare for a possible push. */
1928 yy_size_t grow_size = 8 /* arbitrary grow size */;
1929
1930 num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
1932 yyg->yy_buffer_stack, num_to_alloc * sizeof(struct yy_buffer_state*),
1933 yyscanner);
1934 if (!yyg->yy_buffer_stack)
1935 YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()");
1936
1937 /* zero only the new slots.*/
1939 grow_size * sizeof(struct yy_buffer_state*));
1940 yyg->yy_buffer_stack_max = num_to_alloc;
1941 }
1942}
1943
1951YY_BUFFER_STATE yy_scan_buffer(char* base, yy_size_t size, yyscan_t yyscanner) {
1953
1954 if (size < 2 || base[size - 2] != YY_END_OF_BUFFER_CHAR ||
1955 base[size - 1] != YY_END_OF_BUFFER_CHAR)
1956 /* They forgot to leave room for the EOB's. */
1957 return NULL;
1958
1959 b = (YY_BUFFER_STATE)yyalloc(sizeof(struct yy_buffer_state), yyscanner);
1960 if (!b) YY_FATAL_ERROR("out of dynamic memory in yy_scan_buffer()");
1961
1962 b->yy_buf_size = (int)(size - 2); /* "- 2" to take care of EOB's */
1963 b->yy_buf_pos = b->yy_ch_buf = base;
1964 b->yy_is_our_buffer = 0;
1965 b->yy_input_file = NULL;
1966 b->yy_n_chars = b->yy_buf_size;
1967 b->yy_is_interactive = 0;
1968 b->yy_at_bol = 1;
1969 b->yy_fill_buffer = 0;
1970 b->yy_buffer_status = YY_BUFFER_NEW;
1971
1972 yy_switch_to_buffer(b, yyscanner);
1973
1974 return b;
1975}
1976
1985YY_BUFFER_STATE yy_scan_string(const char* yystr, yyscan_t yyscanner) {
1986 return yy_scan_bytes(yystr, (int)strlen(yystr), yyscanner);
1987}
1988
1996YY_BUFFER_STATE yy_scan_bytes(const char* yybytes, int _yybytes_len,
1997 yyscan_t yyscanner) {
1999 char* buf;
2000 yy_size_t n;
2001 int i;
2002
2003 /* Get memory for full buffer, including space for trailing EOB's. */
2004 n = (yy_size_t)(_yybytes_len + 2);
2005 buf = (char*)yyalloc(n, yyscanner);
2006 if (!buf) YY_FATAL_ERROR("out of dynamic memory in yy_scan_bytes()");
2007
2008 for (i = 0; i < _yybytes_len; ++i) buf[i] = yybytes[i];
2009
2010 buf[_yybytes_len] = buf[_yybytes_len + 1] = YY_END_OF_BUFFER_CHAR;
2011
2012 b = yy_scan_buffer(buf, n, yyscanner);
2013 if (!b) YY_FATAL_ERROR("bad buffer in yy_scan_bytes()");
2014
2015 /* It's okay to grow etc. this buffer, and we should throw it
2016 * away when we're done.
2017 */
2018 b->yy_is_our_buffer = 1;
2019
2020 return b;
2021}
2022
2023#ifndef YY_EXIT_FAILURE
2024#define YY_EXIT_FAILURE 2
2025#endif
2026
2027static void yynoreturn yy_fatal_error(const char* msg, yyscan_t yyscanner) {
2028 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2029 (void)yyg;
2030 fprintf(stderr, "%s\n", msg);
2031 exit(YY_EXIT_FAILURE);
2032}
2033
2034/* Redefine yyless() so it works in section 3 code. */
2035
2036#undef yyless
2037#define yyless(n) \
2038 do { \
2039 /* Undo effects of setting up yytext. */ \
2040 int yyless_macro_arg = (n); \
2041 YY_LESS_LINENO(yyless_macro_arg); \
2042 yytext[yyleng] = yyg->yy_hold_char; \
2043 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
2044 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
2045 *yyg->yy_c_buf_p = '\0'; \
2046 yyleng = yyless_macro_arg; \
2047 } while (0)
2048
2049/* Accessor methods (get/set functions) to struct members. */
2050
2055 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2056 return yyextra;
2057}
2058
2062int yyget_lineno(yyscan_t yyscanner) {
2063 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2064
2065 if (!YY_CURRENT_BUFFER) return 0;
2066
2067 return yylineno;
2068}
2069
2073int yyget_column(yyscan_t yyscanner) {
2074 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2075
2076 if (!YY_CURRENT_BUFFER) return 0;
2077
2078 return yycolumn;
2079}
2080
2084FILE* yyget_in(yyscan_t yyscanner) {
2085 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2086 return yyin;
2087}
2088
2092FILE* yyget_out(yyscan_t yyscanner) {
2093 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2094 return yyout;
2095}
2096
2100int yyget_leng(yyscan_t yyscanner) {
2101 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2102 return yyleng;
2103}
2104
2109char* yyget_text(yyscan_t yyscanner) {
2110 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2111 return yytext;
2112}
2113
2118void yyset_extra(YY_EXTRA_TYPE user_defined, yyscan_t yyscanner) {
2119 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2120 yyextra = user_defined;
2121}
2122
2127void yyset_lineno(int _line_number, yyscan_t yyscanner) {
2128 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2129
2130 /* lineno is only valid if an input buffer exists. */
2131 if (!YY_CURRENT_BUFFER) YY_FATAL_ERROR("yyset_lineno called with no buffer");
2132
2133 yylineno = _line_number;
2134}
2135
2140void yyset_column(int _column_no, yyscan_t yyscanner) {
2141 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2142
2143 /* column is only valid if an input buffer exists. */
2144 if (!YY_CURRENT_BUFFER) YY_FATAL_ERROR("yyset_column called with no buffer");
2145
2146 yycolumn = _column_no;
2147}
2148
2155void yyset_in(FILE* _in_str, yyscan_t yyscanner) {
2156 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2157 yyin = _in_str;
2158}
2159
2160void yyset_out(FILE* _out_str, yyscan_t yyscanner) {
2161 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2162 yyout = _out_str;
2163}
2164
2165int yyget_debug(yyscan_t yyscanner) {
2166 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2167 return yy_flex_debug;
2168}
2169
2170void yyset_debug(int _bdebug, yyscan_t yyscanner) {
2171 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2172 yy_flex_debug = _bdebug;
2173}
2174
2175/* Accessor methods for yylval and yylloc */
2176
2177YYSTYPE* yyget_lval(yyscan_t yyscanner) {
2178 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2179 return yylval;
2180}
2181
2182void yyset_lval(YYSTYPE* yylval_param, yyscan_t yyscanner) {
2183 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2184 yylval = yylval_param;
2185}
2186
2187/* User-visible API */
2188
2189/* yylex_init is special because it creates the scanner itself, so it is
2190 * the ONLY reentrant function that doesn't take the scanner as the last
2191 * argument. That's why we explicitly handle the declaration, instead of using
2192 * our macros.
2193 */
2194int yylex_init(yyscan_t* ptr_yy_globals) {
2195 if (ptr_yy_globals == NULL) {
2196 errno = EINVAL;
2197 return 1;
2198 }
2199
2200 *ptr_yy_globals = (yyscan_t)yyalloc(sizeof(struct yyguts_t), NULL);
2201
2202 if (*ptr_yy_globals == NULL) {
2203 errno = ENOMEM;
2204 return 1;
2205 }
2206
2207 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for
2208 * releases. */
2209 memset(*ptr_yy_globals, 0x00, sizeof(struct yyguts_t));
2210
2211 return yy_init_globals(*ptr_yy_globals);
2212}
2213
2214/* yylex_init_extra has the same functionality as yylex_init, but follows the
2215 * convention of taking the scanner as the last argument. Note however, that
2216 * this is a *pointer* to a scanner, as it will be allocated by this call (and
2217 * is the reason, too, why this function also must handle its own declaration).
2218 * The user defined value in the first argument will be available to yyalloc in
2219 * the yyextra field.
2220 */
2221int yylex_init_extra(YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals) {
2222 struct yyguts_t dummy_yyguts;
2223
2224 yyset_extra(yy_user_defined, &dummy_yyguts);
2225
2226 if (ptr_yy_globals == NULL) {
2227 errno = EINVAL;
2228 return 1;
2229 }
2230
2231 *ptr_yy_globals = (yyscan_t)yyalloc(sizeof(struct yyguts_t), &dummy_yyguts);
2232
2233 if (*ptr_yy_globals == NULL) {
2234 errno = ENOMEM;
2235 return 1;
2236 }
2237
2238 /* By setting to 0xAA, we expose bugs in
2239 yy_init_globals. Leave at 0x00 for releases. */
2240 memset(*ptr_yy_globals, 0x00, sizeof(struct yyguts_t));
2241
2242 yyset_extra(yy_user_defined, *ptr_yy_globals);
2243
2244 return yy_init_globals(*ptr_yy_globals);
2245}
2246
2247static int yy_init_globals(yyscan_t yyscanner) {
2248 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2249 /* Initialization is the same as for the non-reentrant scanner.
2250 * This function is called from yylex_destroy(), so don't allocate here.
2251 */
2252
2253 yyg->yy_buffer_stack = NULL;
2256 yyg->yy_c_buf_p = NULL;
2257 yyg->yy_init = 0;
2258 yyg->yy_start = 0;
2259
2262 yyg->yy_start_stack = NULL;
2263
2264/* Defined in main.c */
2265#ifdef YY_STDINIT
2266 yyin = stdin;
2267 yyout = stdout;
2268#else
2269 yyin = NULL;
2270 yyout = NULL;
2271#endif
2272
2273 /* For future reference: Set errno on error, since we are called by
2274 * yylex_init()
2275 */
2276 return 0;
2277}
2278
2279/* yylex_destroy is for both reentrant and non-reentrant scanners. */
2280int yylex_destroy(yyscan_t yyscanner) {
2281 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2282
2283 /* Pop the buffer stack, destroying each element. */
2284 while (YY_CURRENT_BUFFER) {
2287 yypop_buffer_state(yyscanner);
2288 }
2289
2290 /* Destroy the stack itself. */
2291 yyfree(yyg->yy_buffer_stack, yyscanner);
2292 yyg->yy_buffer_stack = NULL;
2293
2294 /* Destroy the start condition stack. */
2295 yyfree(yyg->yy_start_stack, yyscanner);
2296 yyg->yy_start_stack = NULL;
2297
2298 /* Reset the globals. This is important in a non-reentrant scanner so the next
2299 * time yylex() is called, initialization will occur. */
2300 yy_init_globals(yyscanner);
2301
2302 /* Destroy the main struct (reentrant only). */
2303 yyfree(yyscanner, yyscanner);
2304 yyscanner = NULL;
2305 return 0;
2306}
2307
2308/*
2309 * Internal utility routines.
2310 */
2311
2312#ifndef yytext_ptr
2313static void yy_flex_strncpy(char* s1, const char* s2, int n,
2314 yyscan_t yyscanner) {
2315 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2316 (void)yyg;
2317
2318 int i;
2319 for (i = 0; i < n; ++i) s1[i] = s2[i];
2320}
2321#endif
2322
2323#ifdef YY_NEED_STRLEN
2324static int yy_flex_strlen(const char* s, yyscan_t yyscanner) {
2325 int n;
2326 for (n = 0; s[n]; ++n);
2327
2328 return n;
2329}
2330#endif
2331
2332void* yyalloc(yy_size_t size, yyscan_t yyscanner) {
2333 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2334 (void)yyg;
2335 return malloc(size);
2336}
2337
2338void* yyrealloc(void* ptr, yy_size_t size, yyscan_t yyscanner) {
2339 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2340 (void)yyg;
2341
2342 /* The cast to (char *) in the following accommodates both
2343 * implementations that use char* generic pointers, and those
2344 * that use void* generic pointers. It works with the latter
2345 * because both ANSI C and C++ allow castless assignment from
2346 * any pointer type to void*, and deal with argument conversions
2347 * as though doing an assignment.
2348 */
2349 return realloc(ptr, size);
2350}
2351
2352void yyfree(void* ptr, yyscan_t yyscanner) {
2353 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2354 (void)yyg;
2355 free((char*)ptr); /* see yyrealloc() for (char *) cast */
2356}
2357
2358#define YYTABLES_NAME "yytables"
2359
2360#line 89 "./ortools/flatzinc/parser.lex"
IntegerValue size
int64_t b
Definition table.cc:45
Definition file.cc:169
@ TOKEN_FLOAT
@ ARRAY
@ MINIMIZE
@ MAXIMIZE
@ SVALUE
@ CONSTRAINT
@ OF
@ IDENTIFIER
@ IVALUE
@ TOKEN_INT
@ PREDICATE
@ DOTDOT
@ SET
@ SOLVE
@ COLONCOLON
@ SATISFY
@ DVALUE
@ TOKEN_BOOL
@ VAR
void * malloc(YYSIZE_T)
void free(void *)
#define yy_load_buffer_state
Definition parser.yy.cc:75
#define YY_NEW_FILE
Definition parser.yy.cc:380
#define yyset_extra
Definition parser.yy.cc:153
#define yytext
Definition parser.yy.cc:361
#define yyget_lval
Definition parser.yy.cc:225
#define yyget_column
Definition parser.yy.cc:207
unsigned char flex_uint8_t
Definition parser.yy.cc:289
#define yyset_lineno
Definition parser.yy.cc:201
#define yyset_lval
Definition parser.yy.cc:231
static const flex_int16_t yy_nxt[212]
Definition parser.yy.cc:656
void * yyscan_t
Definition parser.yy.cc:352
#define yylex_init
Definition parser.yy.cc:117
static int yy_init_globals(yyscan_t yyscanner)
static void yynoreturn yy_fatal_error(const char *msg, yyscan_t yyscanner)
#define yyrestart
Definition parser.yy.cc:111
#define yyset_debug
Definition parser.yy.cc:141
#define YY_EXTRA_TYPE
Definition parser.yy.cc:739
static int yy_get_next_buffer(yyscan_t yyscanner)
static const YY_CHAR yy_meta[37]
Definition parser.yy.cc:628
short int flex_int16_t
Definition parser.yy.cc:287
#define yy_flex_debug
Definition parser.yy.cc:364
#define yyget_out
Definition parser.yy.cc:171
unsigned int flex_uint32_t
Definition parser.yy.cc:291
static yy_state_type yy_try_NUL_trans(yy_state_type current_state, yyscan_t yyscanner)
#define yy_scan_bytes
Definition parser.yy.cc:57
#define YY_BREAK
Definition parser.yy.cc:950
#define yylex_init_extra
Definition parser.yy.cc:123
#define yynoreturn
Definition parser.yy.cc:338
#define yyget_debug
Definition parser.yy.cc:135
int yy_act
Definition parser.yy.cc:960
#define yypush_buffer_state
Definition parser.yy.cc:87
struct yy_buffer_state * YY_BUFFER_STATE
Definition parser.yy.cc:403
#define yyfree
Definition parser.yy.cc:249
#define yyout
Definition parser.yy.cc:358
#define YY_BUFFER_NEW
Definition parser.yy.cc:495
#define yyget_lineno
Definition parser.yy.cc:195
#define yylex
Definition parser.yy.cc:105
#define YY_RESTORE_YY_MORE_OFFSET
Definition parser.yy.cc:706
static int input(yyscan_t yyscanner)
#define yywrap
Definition parser.yy.cc:219
#define yyget_text
Definition parser.yy.cc:189
#define YY_BUFFER_NORMAL
Definition parser.yy.cc:496
char * yy_cp
Definition parser.yy.cc:959
#define yyensure_buffer_stack
Definition parser.yy.cc:99
#define yy_scan_buffer
Definition parser.yy.cc:45
#define YY_MORE_ADJ
Definition parser.yy.cc:705
#define YY_RULE_SETUP
Definition parser.yy.cc:953
#define yy_scan_string
Definition parser.yy.cc:51
static const flex_int16_t yy_base[123]
Definition parser.yy.cc:632
#define yyextra
Definition parser.yy.cc:359
struct yyguts_t * yyg
Definition parser.yy.cc:961
#define yylval
Definition parser.yy.cc:781
signed char flex_int8_t
Definition parser.yy.cc:286
#define yyget_leng
Definition parser.yy.cc:183
#define EOB_ACT_END_OF_FILE
Definition parser.yy.cc:412
#define yyalloc
Definition parser.yy.cc:237
static void yyunput(int c, char *buf_ptr, yyscan_t yyscanner)
#define yypop_buffer_state
Definition parser.yy.cc:93
#define YY_CURRENT_BUFFER_LVALUE
Definition parser.yy.cc:522
int flex_int32_t
Definition parser.yy.cc:288
#define yylex_destroy
Definition parser.yy.cc:129
#define YY_START
Definition parser.yy.cc:375
#define yyset_column
Definition parser.yy.cc:213
#define yy_switch_to_buffer
Definition parser.yy.cc:81
static const flex_int16_t yy_def[123]
Definition parser.yy.cc:644
int yy_state_type
Definition parser.yy.cc:572
#define YY_CURRENT_BUFFER
Definition parser.yy.cc:517
#define yy_init_buffer
Definition parser.yy.cc:63
#define INITIAL
Definition parser.yy.cc:728
#define yyget_extra
Definition parser.yy.cc:147
char * yy_bp
Definition parser.yy.cc:959
#define yyin
Definition parser.yy.cc:357
static const flex_int16_t yy_chk[212]
Definition parser.yy.cc:675
#define YY_READ_BUF_SIZE
Definition parser.yy.cc:865
#define YY_INPUT(buf, result, max_size)
Definition parser.yy.cc:885
#define ECHO
Definition parser.yy.cc:874
#define yy_flush_buffer
Definition parser.yy.cc:69
#define yyrealloc
Definition parser.yy.cc:243
#define YY_END_OF_BUFFER
Definition parser.yy.cc:592
#define YY_STATE_EOF(state)
Definition parser.yy.cc:378
#define YY_END_OF_BUFFER_CHAR
Definition parser.yy.cc:381
static const flex_int16_t yy_accept[117]
Definition parser.yy.cc:599
#define YY_FATAL_ERROR(msg)
Definition parser.yy.cc:925
#define yyterminate()
Definition parser.yy.cc:915
unsigned short int flex_uint16_t
Definition parser.yy.cc:290
static const flex_int32_t yy_rule_can_match_eol[32]
Definition parser.yy.cc:695
#define yy_create_buffer
Definition parser.yy.cc:33
flex_uint8_t YY_CHAR
Definition parser.yy.cc:570
#define YY_DO_BEFORE_ACTION
Definition parser.yy.cc:585
#define yy_delete_buffer
Definition parser.yy.cc:39
#define EOB_ACT_LAST_MATCH
Definition parser.yy.cc:413
#define yyget_in
Definition parser.yy.cc:159
size_t yy_size_t
Definition parser.yy.cc:408
#define YY_BUFFER_EOF_PENDING
Definition parser.yy.cc:507
#define yylineno
Definition parser.yy.cc:362
static const YY_CHAR yy_ec[256]
Definition parser.yy.cc:609
#define yycolumn
Definition parser.yy.cc:363
#define yyset_out
Definition parser.yy.cc:177
#define EOB_ACT_CONTINUE_SCAN
Definition parser.yy.cc:411
#define YY_DECL
Definition parser.yy.cc:938
#define YY_BUF_SIZE
Definition parser.yy.cc:392
#define YY_EXIT_FAILURE
static yy_state_type yy_get_previous_state(yyscan_t yyscanner)
#define YY_SC_TO_UI(c)
Definition parser.yy.cc:347
#define yyleng
Definition parser.yy.cc:360
#define yyset_in
Definition parser.yy.cc:165
FILE * yy_input_file
Definition parser.yy.cc:451
flex_int32_t yy_verify
Definition parser.yy.cc:596
flex_int32_t yy_nxt
Definition parser.yy.cc:597
FILE * yyin_r
Definition parser.yy.cc:749
int yy_did_buffer_switch_on_eof
Definition parser.yy.cc:759
int yy_start_stack_depth
Definition parser.yy.cc:761
FILE * yyout_r
Definition parser.yy.cc:749
size_t yy_buffer_stack_max
Definition parser.yy.cc:751
char * yy_last_accepting_cpos
Definition parser.yy.cc:764
YYSTYPE * yylval_r
Definition parser.yy.cc:773
int yy_flex_debug_r
Definition parser.yy.cc:767
int yy_more_flag
Definition parser.yy.cc:770
int yy_more_len
Definition parser.yy.cc:771
yy_state_type yy_last_accepting_state
Definition parser.yy.cc:763
int yy_start
Definition parser.yy.cc:758
int yy_n_chars
Definition parser.yy.cc:754
int yylineno_r
Definition parser.yy.cc:766
char * yy_c_buf_p
Definition parser.yy.cc:756
int yyleng_r
Definition parser.yy.cc:755
int yy_init
Definition parser.yy.cc:757
YY_BUFFER_STATE * yy_buffer_stack
Definition parser.yy.cc:752
int yy_start_stack_ptr
Definition parser.yy.cc:760
char yy_hold_char
Definition parser.yy.cc:753
char * yytext_r
Definition parser.yy.cc:769
YY_EXTRA_TYPE yyextra_r
Definition parser.yy.cc:745
int * yy_start_stack
Definition parser.yy.cc:762
size_t yy_buffer_stack_top
Definition parser.yy.cc:750