Google OR-Tools v9.14
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-2025 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
487
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);
526YY_BUFFER_STATE yy_create_buffer(FILE* file, int size, 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/log/check.h"
716#include "absl/strings/numbers.h"
718#if defined(_MSC_VER)
719#define YY_NO_UNISTD_H
720#include "io.h"
721#define isatty _isatty
722#endif
723#line 769 "./ortools/flatzinc/parser.yy.cc"
724/* Rules that parse the bottom-line string tokens of a .fz file and
725 convert them into YACC tokens, which may carry a value. See the
726 LexerInfo struct and the %token declarations in ./parser.yy. */
727#line 773 "./ortools/flatzinc/parser.yy.cc"
728
729#define INITIAL 0
730
731#ifndef YY_NO_UNISTD_H
732/* Special case for "unistd.h", since it is non-ANSI. We include it way
733 * down here because we want the user's section 1 to have been scanned first.
734 * The user has a chance to override it with an option.
735 */
736#include <unistd.h>
737#endif
738
739#ifndef YY_EXTRA_TYPE
740#define YY_EXTRA_TYPE void*
741#endif
742
743/* Holds the entire state of the reentrant scanner. */
744struct yyguts_t {
745 /* User-defined. Not touched by flex. */
747
748 /* The rest are the same as the globals declared in the non-reentrant scanner.
749 */
766
769
770 char* yytext_r;
773
775
776}; /* end struct yyguts_t */
777
778static int yy_init_globals(yyscan_t yyscanner);
779
780/* This must go here because YYSTYPE and YYLTYPE are included
781 * from bison output in section 1.*/
782#define yylval yyg->yylval_r
783
784int yylex_init(yyscan_t* scanner);
785
786int yylex_init_extra(YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
787
788/* Accessor methods to globals.
789 These are made visible to non-reentrant scanners for convenience. */
790
791int yylex_destroy(yyscan_t yyscanner);
792
793int yyget_debug(yyscan_t yyscanner);
794
795void yyset_debug(int debug_flag, yyscan_t yyscanner);
796
798
799void yyset_extra(YY_EXTRA_TYPE user_defined, yyscan_t yyscanner);
800
801FILE* yyget_in(yyscan_t yyscanner);
802
803void yyset_in(FILE* _in_str, yyscan_t yyscanner);
804
805FILE* yyget_out(yyscan_t yyscanner);
806
807void yyset_out(FILE* _out_str, yyscan_t yyscanner);
808
809int yyget_leng(yyscan_t yyscanner);
810
811char* yyget_text(yyscan_t yyscanner);
812
813int yyget_lineno(yyscan_t yyscanner);
814
815void yyset_lineno(int _line_number, yyscan_t yyscanner);
816
817int yyget_column(yyscan_t yyscanner);
818
819void yyset_column(int _column_no, yyscan_t yyscanner);
820
822
823void yyset_lval(YYSTYPE* yylval_param, yyscan_t yyscanner);
824
825/* Macros after this point can all be overridden by user definitions in
826 * section 1.
827 */
828
829#ifndef YY_SKIP_YYWRAP
830#ifdef __cplusplus
831extern "C" int yywrap(yyscan_t yyscanner);
832#else
833extern int yywrap(yyscan_t yyscanner);
834#endif
835#endif
836
837#ifndef YY_NO_UNPUT
838
839static void yyunput(int c, char* buf_ptr, yyscan_t yyscanner);
840
841#endif
842
843#ifndef yytext_ptr
844static void yy_flex_strncpy(char*, const char*, int, yyscan_t yyscanner);
845#endif
846
847#ifdef YY_NEED_STRLEN
848static int yy_flex_strlen(const char*, yyscan_t yyscanner);
849#endif
850
851#ifndef YY_NO_INPUT
852#ifdef __cplusplus
853static int yyinput(yyscan_t yyscanner);
854#else
855static int input(yyscan_t yyscanner);
856#endif
857
858#endif
859
860/* Amount of stuff to slurp up with each read. */
861#ifndef YY_READ_BUF_SIZE
862#ifdef __ia64__
863/* On IA-64, the buffer size is 16k, not 8k */
864#define YY_READ_BUF_SIZE 16384
865#else
866#define YY_READ_BUF_SIZE 8192
867#endif /* __ia64__ */
868#endif
869
870/* Copy whatever the last rule matched to the standard output. */
871#ifndef ECHO
872/* This used to be an fputs(), but since the string might contain NUL's,
873 * we now use fwrite().
874 */
875#define ECHO \
876 do { \
877 if (fwrite(yytext, (size_t)yyleng, 1, yyout)) { \
878 } \
879 } while (0)
880#endif
881
882/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
883 * is returned in "result".
884 */
885#ifndef YY_INPUT
886#define YY_INPUT(buf, result, max_size) \
887 if (YY_CURRENT_BUFFER_LVALUE->yy_is_interactive) { \
888 int c = '*'; \
889 int n; \
890 for (n = 0; n < max_size && (c = getc(yyin)) != EOF && c != '\n'; ++n) \
891 buf[n] = (char)c; \
892 if (c == '\n') buf[n++] = (char)c; \
893 if (c == EOF && ferror(yyin)) \
894 YY_FATAL_ERROR("input in flex scanner failed"); \
895 result = n; \
896 } else { \
897 errno = 0; \
898 while ((result = (int)fread(buf, 1, (yy_size_t)max_size, yyin)) == 0 && \
899 ferror(yyin)) { \
900 if (errno != EINTR) { \
901 YY_FATAL_ERROR("input in flex scanner failed"); \
902 break; \
903 } \
904 errno = 0; \
905 clearerr(yyin); \
906 } \
907 }
908
909#endif
910
911/* No semi-colon after return; correct usage is to write "yyterminate();" -
912 * we don't want an extra ';' after the "return" because that will cause
913 * some compilers to complain about unreachable statements.
914 */
915#ifndef yyterminate
916#define yyterminate() return YY_NULL
917#endif
918
919/* Number of entries by which start-condition stack grows. */
920#ifndef YY_START_STACK_INCR
921#define YY_START_STACK_INCR 25
922#endif
923
924/* Report a fatal error. */
925#ifndef YY_FATAL_ERROR
926#define YY_FATAL_ERROR(msg) yy_fatal_error(msg, yyscanner)
927#endif
928
929/* end tables serialization structures and prototypes */
930
931/* Default declaration of generated scanner - a define so the user can
932 * easily add parameters.
933 */
934#ifndef YY_DECL
935#define YY_DECL_IS_OURS 1
936
937extern int yylex(YYSTYPE* yylval_param, yyscan_t yyscanner);
938
939#define YY_DECL int yylex(YYSTYPE* yylval_param, yyscan_t yyscanner)
940#endif /* !YY_DECL */
941
942/* Code executed at the beginning of each rule, after yytext and yyleng
943 * have been set up.
944 */
945#ifndef YY_USER_ACTION
946#define YY_USER_ACTION
947#endif
948
949/* Code executed at the end of each rule. */
950#ifndef YY_BREAK
951#define YY_BREAK /*LINTED*/ break;
952#endif
953
954#define YY_RULE_SETUP YY_USER_ACTION
955
959 yy_state_type yy_current_state;
960 char *yy_cp, *yy_bp;
962 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
963
964 yylval = yylval_param;
965
966 if (!yyg->yy_init) {
967 yyg->yy_init = 1;
968
969#ifdef YY_USER_INIT
970 YY_USER_INIT;
971#endif
972
973 if (!yyg->yy_start) yyg->yy_start = 1; /* first start state */
974
975 if (!yyin) yyin = stdin;
976
977 if (!yyout) yyout = stdout;
978
979 if (!YY_CURRENT_BUFFER) {
980 yyensure_buffer_stack(yyscanner);
982 }
983
984 yy_load_buffer_state(yyscanner);
985 }
986
987 {
988#line 26 "./ortools/flatzinc/parser.lex"
989
990#line 1049 "./ortools/flatzinc/parser.yy.cc"
991
992 while (/*CONSTCOND*/ 1) /* loops until end-of-file is reached */
993 {
994 yy_cp = yyg->yy_c_buf_p;
995
996 /* Support of yytext. */
997 *yy_cp = yyg->yy_hold_char;
998
999 /* yy_bp points to the position in yy_ch_buf of the start of
1000 * the current run.
1001 */
1002 yy_bp = yy_cp;
1003
1004 yy_current_state = yyg->yy_start;
1005 yy_match:
1006 do {
1007 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1008 if (yy_accept[yy_current_state]) {
1009 yyg->yy_last_accepting_state = yy_current_state;
1010 yyg->yy_last_accepting_cpos = yy_cp;
1011 }
1012 while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) {
1013 yy_current_state = (int)yy_def[yy_current_state];
1014 if (yy_current_state >= 117) yy_c = yy_meta[yy_c];
1015 }
1016 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1017 ++yy_cp;
1018 } while (yy_base[yy_current_state] != 175);
1019
1020 yy_find_action:
1021 yy_act = yy_accept[yy_current_state];
1022 if (yy_act == 0) { /* have to back up */
1023 yy_cp = yyg->yy_last_accepting_cpos;
1024 yy_current_state = yyg->yy_last_accepting_state;
1025 yy_act = yy_accept[yy_current_state];
1026 }
1027
1029
1031 int yyl;
1032 for (yyl = 0; yyl < yyleng; ++yyl)
1033 if (yytext[yyl] == '\n') do {
1034 yylineno++;
1035 yycolumn = 0;
1036 } while (0);
1037 }
1038
1039 do_action: /* This label is used only to access EOF actions. */
1040
1041 switch (yy_act) { /* beginning of action switch */
1042 case 0: /* must back up */
1043 /* undo the effects of YY_DO_BEFORE_ACTION */
1044 *yy_cp = yyg->yy_hold_char;
1045 yy_cp = yyg->yy_last_accepting_cpos;
1046 yy_current_state = yyg->yy_last_accepting_state;
1047 goto yy_find_action;
1048
1049 case 1:
1051#line 27 "./ortools/flatzinc/parser.lex"
1052 {
1053 return ARRAY;
1054 }
1055 YY_BREAK
1056 case 2:
1058#line 28 "./ortools/flatzinc/parser.lex"
1059 {
1060 return TOKEN_BOOL;
1061 }
1062 YY_BREAK
1063 case 3:
1065#line 29 "./ortools/flatzinc/parser.lex"
1066 {
1067 return CONSTRAINT;
1068 }
1069 YY_BREAK
1070 case 4:
1072#line 30 "./ortools/flatzinc/parser.lex"
1073 {
1074 return TOKEN_FLOAT;
1075 }
1076 YY_BREAK
1077 case 5:
1079#line 31 "./ortools/flatzinc/parser.lex"
1080 {
1081 return TOKEN_INT;
1082 }
1083 YY_BREAK
1084 case 6:
1086#line 32 "./ortools/flatzinc/parser.lex"
1087 {
1088 return MAXIMIZE;
1089 }
1090 YY_BREAK
1091 case 7:
1093#line 33 "./ortools/flatzinc/parser.lex"
1094 {
1095 return MINIMIZE;
1096 }
1097 YY_BREAK
1098 case 8:
1100#line 34 "./ortools/flatzinc/parser.lex"
1101 {
1102 return OF;
1103 }
1104 YY_BREAK
1105 case 9:
1107#line 35 "./ortools/flatzinc/parser.lex"
1108 {
1109 return PREDICATE;
1110 }
1111 YY_BREAK
1112 case 10:
1114#line 36 "./ortools/flatzinc/parser.lex"
1115 {
1116 return SATISFY;
1117 }
1118 YY_BREAK
1119 case 11:
1121#line 37 "./ortools/flatzinc/parser.lex"
1122 {
1123 return SET;
1124 }
1125 YY_BREAK
1126 case 12:
1128#line 38 "./ortools/flatzinc/parser.lex"
1129 {
1130 return SOLVE;
1131 }
1132 YY_BREAK
1133 case 13:
1135#line 39 "./ortools/flatzinc/parser.lex"
1136 {
1137 return VAR;
1138 }
1139 YY_BREAK
1140 case 14:
1142#line 40 "./ortools/flatzinc/parser.lex"
1143 {
1144 return DOTDOT;
1145 }
1146 YY_BREAK
1147 case 15:
1149#line 41 "./ortools/flatzinc/parser.lex"
1150 {
1151 return COLONCOLON;
1152 }
1153 YY_BREAK
1154 case 16:
1156#line 43 "./ortools/flatzinc/parser.lex"
1157 {
1158 yylval->integer_value = 1;
1159 return IVALUE;
1160 }
1161 YY_BREAK
1162 case 17:
1164#line 47 "./ortools/flatzinc/parser.lex"
1165 {
1166 yylval->integer_value = 0;
1167 return IVALUE;
1168 }
1169 YY_BREAK
1170 case 18:
1172#line 51 "./ortools/flatzinc/parser.lex"
1173 {
1174 CHECK(absl::SimpleAtoi(yytext, &yylval->integer_value));
1175 return IVALUE;
1176 }
1177 YY_BREAK
1178 case 19:
1180#line 55 "./ortools/flatzinc/parser.lex"
1181 {
1182 CHECK(absl::SimpleAtoi(yytext, &yylval->integer_value));
1183 return IVALUE;
1184 }
1185 YY_BREAK
1186 case 20:
1188#line 59 "./ortools/flatzinc/parser.lex"
1189 {
1190 CHECK(absl::SimpleAtoi(yytext, &yylval->integer_value));
1191 return IVALUE;
1192 }
1193 YY_BREAK
1194 case 21:
1196#line 63 "./ortools/flatzinc/parser.lex"
1197 {
1198 CHECK(absl::SimpleAtod(yytext, &yylval->double_value));
1199 return DVALUE;
1200 }
1201 YY_BREAK
1202 case 22:
1204#line 67 "./ortools/flatzinc/parser.lex"
1205 {
1206 CHECK(absl::SimpleAtod(yytext, &yylval->double_value));
1207 return DVALUE;
1208 }
1209 YY_BREAK
1210 case 23:
1212#line 71 "./ortools/flatzinc/parser.lex"
1213 {
1214 CHECK(absl::SimpleAtod(yytext, &yylval->double_value));
1215 return DVALUE;
1216 }
1217 YY_BREAK
1218 case 24:
1220#line 76 "./ortools/flatzinc/parser.lex"
1221 {
1222 yylval->string_value = yytext;
1223 return IDENTIFIER;
1224 }
1225 YY_BREAK
1226 case 25:
1228#line 80 "./ortools/flatzinc/parser.lex"
1229 {
1230 yylval->string_value = yytext;
1231 return IDENTIFIER;
1232 }
1233 YY_BREAK
1234 case 26:
1236#line 84 "./ortools/flatzinc/parser.lex"
1237 {
1238 yylval->string_value = yytext;
1239 return SVALUE;
1240 }
1241 YY_BREAK
1242 case 27:
1243 /* rule 27 can match eol */
1245#line 85 "./ortools/flatzinc/parser.lex"
1246 ;
1247 YY_BREAK
1248 case 28:
1250#line 86 "./ortools/flatzinc/parser.lex"
1251 ;
1252 YY_BREAK
1253 case 29:
1255#line 87 "./ortools/flatzinc/parser.lex"
1256 ;
1257 YY_BREAK
1258 case 30:
1260#line 88 "./ortools/flatzinc/parser.lex"
1261 {
1262 return yytext[0];
1263 }
1264 YY_BREAK
1265 case 31:
1267#line 89 "./ortools/flatzinc/parser.lex"
1268 ECHO;
1269 YY_BREAK
1270#line 1305 "./ortools/flatzinc/parser.yy.cc"
1271 case YY_STATE_EOF(INITIAL):
1272 yyterminate();
1273
1274 case YY_END_OF_BUFFER: {
1275 /* Amount of text matched not including the EOB char. */
1276 int yy_amount_of_matched_text = (int)(yy_cp - yyg->yytext_ptr) - 1;
1277
1278 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1279 *yy_cp = yyg->yy_hold_char;
1281
1282 if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW) {
1283 /* We're scanning a new file or input source. It's
1284 * possible that this happened because the user
1285 * just pointed yyin at a new source and called
1286 * yylex(). If so, then we have to assure
1287 * consistency between YY_CURRENT_BUFFER and our
1288 * globals. Here is the right place to do so, because
1289 * this is the first action (other than possibly a
1290 * back-up) that will match for the new input source.
1291 */
1292 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1293 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1294 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1295 }
1296
1297 /* Note that here we test for yy_c_buf_p "<=" to the position
1298 * of the first EOB in the buffer, since yy_c_buf_p will
1299 * already have been incremented past the NUL character
1300 * (since all states make transitions on EOB to the
1301 * end-of-buffer state). Contrast this with the test
1302 * in input().
1303 */
1304 if (yyg->yy_c_buf_p <=
1306 ->yy_ch_buf[yyg->yy_n_chars]) { /* This was really a NUL. */
1307 yy_state_type yy_next_state;
1308
1309 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1310
1311 yy_current_state = yy_get_previous_state(yyscanner);
1312
1313 /* Okay, we're now positioned to make the NUL
1314 * transition. We couldn't have
1315 * yy_get_previous_state() go ahead and do it
1316 * for us because it doesn't know how to deal
1317 * with the possibility of jamming (and we don't
1318 * want to build jamming into it because then it
1319 * will run more slowly).
1320 */
1321
1322 yy_next_state = yy_try_NUL_trans(yy_current_state, yyscanner);
1323
1324 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1325
1326 if (yy_next_state) {
1327 /* Consume the NUL. */
1328 yy_cp = ++yyg->yy_c_buf_p;
1329 yy_current_state = yy_next_state;
1330 goto yy_match;
1331 }
1332
1333 else {
1334 yy_cp = yyg->yy_c_buf_p;
1335 goto yy_find_action;
1336 }
1337 }
1338
1339 else
1340 switch (yy_get_next_buffer(yyscanner)) {
1341 case EOB_ACT_END_OF_FILE: {
1342 yyg->yy_did_buffer_switch_on_eof = 0;
1343
1344 if (yywrap(yyscanner)) {
1345 /* Note: because we've taken care in
1346 * yy_get_next_buffer() to have set up
1347 * yytext, we can now set up
1348 * yy_c_buf_p so that if some total
1349 * hoser (like flex itself) wants to
1350 * call the scanner after we return the
1351 * YY_NULL, it'll still work - another
1352 * YY_NULL will get returned.
1353 */
1354 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1355
1357 goto do_action;
1358 }
1359
1360 else {
1361 if (!yyg->yy_did_buffer_switch_on_eof) YY_NEW_FILE;
1362 }
1363 break;
1364 }
1365
1367 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1368
1369 yy_current_state = yy_get_previous_state(yyscanner);
1370
1371 yy_cp = yyg->yy_c_buf_p;
1372 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1373 goto yy_match;
1374
1375 case EOB_ACT_LAST_MATCH:
1376 yyg->yy_c_buf_p =
1377 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1378
1379 yy_current_state = yy_get_previous_state(yyscanner);
1380
1381 yy_cp = yyg->yy_c_buf_p;
1382 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1383 goto yy_find_action;
1384 }
1385 break;
1386 }
1387
1388 default:
1389 YY_FATAL_ERROR("fatal flex scanner internal error--no action found");
1390 } /* end of action switch */
1391 } /* end of scanning one token */
1392 } /* end of user's declarations */
1393} /* end of yylex */
1394
1395/* yy_get_next_buffer - try to read in a new buffer
1396 *
1397 * Returns a code representing an action:
1398 * EOB_ACT_LAST_MATCH -
1399 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1400 * EOB_ACT_END_OF_FILE - end of file
1401 */
1402static int yy_get_next_buffer(yyscan_t yyscanner) {
1403 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
1404 char* dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1405 char* source = yyg->yytext_ptr;
1406 int number_to_move, i;
1407 int ret_val;
1408
1409 if (yyg->yy_c_buf_p >
1410 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1])
1411 YY_FATAL_ERROR("fatal flex scanner internal error--end of buffer missed");
1412
1413 if (YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer ==
1414 0) { /* Don't try to fill the buffer, so this is an EOF. */
1415 if (yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1) {
1416 /* We matched a single character, the EOB, so
1417 * treat this as a final EOF.
1418 */
1419 return EOB_ACT_END_OF_FILE;
1420 }
1421
1422 else {
1423 /* We matched some text prior to the EOB, first
1424 * process it.
1425 */
1426 return EOB_ACT_LAST_MATCH;
1427 }
1428 }
1429
1430 /* Try to read more data. */
1431
1432 /* First move last chars to start of buffer. */
1433 number_to_move = (int)(yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
1434
1435 for (i = 0; i < number_to_move; ++i) *(dest++) = *(source++);
1436
1437 if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING)
1438 /* don't do the read, it's not guaranteed to return an EOF,
1439 * just force an EOF
1440 */
1441 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1442
1443 else {
1444 int num_to_read =
1445 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1446
1447 while (num_to_read <= 0) { /* Not enough room in the buffer - grow it. */
1448
1449 /* just a shorter name for the current buffer */
1451
1452 int yy_c_buf_p_offset = (int)(yyg->yy_c_buf_p - b->yy_ch_buf);
1453
1454 if (b->yy_is_our_buffer) {
1455 int new_size = b->yy_buf_size * 2;
1456
1457 if (new_size <= 0)
1458 b->yy_buf_size += b->yy_buf_size / 8;
1459 else
1460 b->yy_buf_size *= 2;
1461
1462 b->yy_ch_buf = (char*)
1463 /* Include room in for 2 EOB chars. */
1464 yyrealloc((void*)b->yy_ch_buf, (yy_size_t)(b->yy_buf_size + 2),
1465 yyscanner);
1466 } else
1467 /* Can't grow it, we don't own it. */
1468 b->yy_ch_buf = NULL;
1469
1470 if (!b->yy_ch_buf)
1471 YY_FATAL_ERROR("fatal error - scanner input buffer overflow");
1472
1473 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1474
1475 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1476 }
1477
1478 if (num_to_read > YY_READ_BUF_SIZE) num_to_read = YY_READ_BUF_SIZE;
1479
1480 /* Read in more data. */
1481 YY_INPUT((&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1482 yyg->yy_n_chars, num_to_read);
1483
1484 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1485 }
1486
1487 if (yyg->yy_n_chars == 0) {
1488 if (number_to_move == YY_MORE_ADJ) {
1489 ret_val = EOB_ACT_END_OF_FILE;
1490 yyrestart(yyin, yyscanner);
1491 }
1492
1493 else {
1494 ret_val = EOB_ACT_LAST_MATCH;
1496 }
1497 }
1498
1499 else
1500 ret_val = EOB_ACT_CONTINUE_SCAN;
1501
1502 if ((yyg->yy_n_chars + number_to_move) >
1503 YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1504 /* Extend the array by 50%, plus the number we really need. */
1505 int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
1506 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf =
1507 (char*)yyrealloc((void*)YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,
1508 (yy_size_t)new_size, yyscanner);
1509 if (!YY_CURRENT_BUFFER_LVALUE->yy_ch_buf)
1510 YY_FATAL_ERROR("out of dynamic memory in yy_get_next_buffer()");
1511 /* "- 2" to take care of EOB's */
1512 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int)(new_size - 2);
1513 }
1514
1515 yyg->yy_n_chars += number_to_move;
1516 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1517 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] =
1519
1520 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1521
1522 return ret_val;
1523}
1524
1525/* yy_get_previous_state - get the state just before the EOB char was reached */
1526
1528 yy_state_type yy_current_state;
1529 char* yy_cp;
1530 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
1531
1532 yy_current_state = yyg->yy_start;
1533
1534 for (yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p;
1535 ++yy_cp) {
1536 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1537 if (yy_accept[yy_current_state]) {
1538 yyg->yy_last_accepting_state = yy_current_state;
1539 yyg->yy_last_accepting_cpos = yy_cp;
1540 }
1541 while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) {
1542 yy_current_state = (int)yy_def[yy_current_state];
1543 if (yy_current_state >= 117) yy_c = yy_meta[yy_c];
1544 }
1545 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1546 }
1547
1548 return yy_current_state;
1549}
1550
1551/* yy_try_NUL_trans - try to make a transition on the NUL character
1552 *
1553 * synopsis
1554 * next_state = yy_try_NUL_trans( current_state );
1555 */
1556static yy_state_type yy_try_NUL_trans(yy_state_type yy_current_state,
1557 yyscan_t yyscanner) {
1558 int yy_is_jam;
1559 struct yyguts_t* yyg = (struct yyguts_t*)
1560 yyscanner; /* This var may be unused depending upon options. */
1561 char* yy_cp = yyg->yy_c_buf_p;
1562
1563 YY_CHAR yy_c = 1;
1564 if (yy_accept[yy_current_state]) {
1565 yyg->yy_last_accepting_state = yy_current_state;
1566 yyg->yy_last_accepting_cpos = yy_cp;
1567 }
1568 while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) {
1569 yy_current_state = (int)yy_def[yy_current_state];
1570 if (yy_current_state >= 117) yy_c = yy_meta[yy_c];
1571 }
1572 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1573 yy_is_jam = (yy_current_state == 116);
1574
1575 (void)yyg;
1576 return yy_is_jam ? 0 : yy_current_state;
1577}
1578
1579#ifndef YY_NO_UNPUT
1580
1581static void yyunput(int c, char* yy_bp, yyscan_t yyscanner) {
1582 char* yy_cp;
1583 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
1584
1585 yy_cp = yyg->yy_c_buf_p;
1586
1587 /* undo effects of setting up yytext */
1588 *yy_cp = yyg->yy_hold_char;
1589
1591 2) { /* need to shift things up to make room */
1592 /* +2 for EOB chars. */
1593 int number_to_move = yyg->yy_n_chars + 2;
1594 char* dest = &YY_CURRENT_BUFFER_LVALUE
1595 ->yy_ch_buf[YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1596 char* source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1597
1598 while (source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) *--dest = *--source;
1599
1600 yy_cp += (int)(dest - source);
1601 yy_bp += (int)(dest - source);
1602 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars =
1603 (int)YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1604
1605 if (yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2)
1606 YY_FATAL_ERROR("flex scanner push-back overflow");
1607 }
1608
1609 *--yy_cp = (char)c;
1610
1611 if (c == '\n') {
1612 --yylineno;
1613 }
1614
1615 yyg->yytext_ptr = yy_bp;
1616 yyg->yy_hold_char = *yy_cp;
1617 yyg->yy_c_buf_p = yy_cp;
1618}
1619
1620#endif
1621
1622#ifndef YY_NO_INPUT
1623#ifdef __cplusplus
1624static int yyinput(yyscan_t yyscanner)
1625#else
1626static int input(yyscan_t yyscanner)
1627#endif
1628
1629{
1630 int c;
1631 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
1632
1633 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1634
1635 if (*yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR) {
1636 /* yy_c_buf_p now points to the character we want to return.
1637 * If this occurs *before* the EOB characters, then it's a
1638 * valid NUL; if not, then we've hit the end of the buffer.
1639 */
1640 if (yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars])
1641 /* This was really a NUL. */
1642 *yyg->yy_c_buf_p = '\0';
1643
1644 else { /* need more input */
1645 int offset = (int)(yyg->yy_c_buf_p - yyg->yytext_ptr);
1646 ++yyg->yy_c_buf_p;
1647
1648 switch (yy_get_next_buffer(yyscanner)) {
1649 case EOB_ACT_LAST_MATCH:
1650 /* This happens because yy_g_n_b()
1651 * sees that we've accumulated a
1652 * token and flags that we need to
1653 * try matching the token before
1654 * proceeding. But for input(),
1655 * there's no matching to consider.
1656 * So convert the EOB_ACT_LAST_MATCH
1657 * to EOB_ACT_END_OF_FILE.
1658 */
1659
1660 /* Reset buffer status. */
1661 yyrestart(yyin, yyscanner);
1662
1663 /*FALLTHROUGH*/
1664
1665 case EOB_ACT_END_OF_FILE: {
1666 if (yywrap(yyscanner)) return 0;
1667
1668 if (!yyg->yy_did_buffer_switch_on_eof) YY_NEW_FILE;
1669#ifdef __cplusplus
1670 return yyinput(yyscanner);
1671#else
1672 return input(yyscanner);
1673#endif
1674 }
1675
1677 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
1678 break;
1679 }
1680 }
1681 }
1682
1683 c = *(unsigned char*)yyg->yy_c_buf_p; /* cast for 8-bit char's */
1684 *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
1685 yyg->yy_hold_char = *++yyg->yy_c_buf_p;
1686
1687 if (c == '\n') do {
1688 yylineno++;
1689 yycolumn = 0;
1690 } while (0);
1691
1692 return c;
1693}
1694#endif /* ifndef YY_NO_INPUT */
1695
1701void yyrestart(FILE* input_file, yyscan_t yyscanner) {
1702 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
1703
1704 if (!YY_CURRENT_BUFFER) {
1705 yyensure_buffer_stack(yyscanner);
1707 }
1708
1709 yy_init_buffer(YY_CURRENT_BUFFER, input_file, yyscanner);
1710 yy_load_buffer_state(yyscanner);
1711}
1712
1717void yy_switch_to_buffer(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner) {
1718 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
1719
1720 /* TODO. We should be able to replace this entire function body
1721 * with
1722 * yypop_buffer_state();
1723 * yypush_buffer_state(new_buffer);
1724 */
1725 yyensure_buffer_stack(yyscanner);
1726 if (YY_CURRENT_BUFFER == new_buffer) return;
1727
1728 if (YY_CURRENT_BUFFER) {
1729 /* Flush out information for old buffer. */
1730 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1731 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1732 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1733 }
1734
1735 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1736 yy_load_buffer_state(yyscanner);
1737
1738 /* We don't actually know whether we did this switch during
1739 * EOF (yywrap()) processing, but the only time this flag
1740 * is looked at is after yywrap() is called, so it's safe
1741 * to go ahead and always set it.
1742 */
1743 yyg->yy_did_buffer_switch_on_eof = 1;
1744}
1745
1746static void yy_load_buffer_state(yyscan_t yyscanner) {
1747 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
1748 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1749 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1750 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1751 yyg->yy_hold_char = *yyg->yy_c_buf_p;
1752}
1753
1761YY_BUFFER_STATE yy_create_buffer(FILE* file, int size, yyscan_t yyscanner) {
1763
1764 b = (YY_BUFFER_STATE)yyalloc(sizeof(struct yy_buffer_state), yyscanner);
1765 if (!b) YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()");
1766
1767 b->yy_buf_size = size;
1768
1769 /* yy_ch_buf has to be 2 characters longer than the size given because
1770 * we need to put in 2 end-of-buffer characters.
1771 */
1772 b->yy_ch_buf = (char*)yyalloc((yy_size_t)(b->yy_buf_size + 2), yyscanner);
1773 if (!b->yy_ch_buf)
1774 YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()");
1775
1776 b->yy_is_our_buffer = 1;
1777
1778 yy_init_buffer(b, file, yyscanner);
1779
1780 return b;
1781}
1782
1787void yy_delete_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner) {
1788 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
1789
1790 if (!b) return;
1791
1792 if (b == YY_CURRENT_BUFFER) /* Not sure if we should pop here. */
1794
1795 if (b->yy_is_our_buffer) yyfree((void*)b->yy_ch_buf, yyscanner);
1796
1797 yyfree((void*)b, yyscanner);
1798}
1799
1800/* Initializes or reinitializes a buffer.
1801 * This function is sometimes called more than once on the same buffer,
1802 * such as during a yyrestart() or at EOF.
1803 */
1804static void yy_init_buffer(YY_BUFFER_STATE b, FILE* file, yyscan_t yyscanner)
1805
1806{
1807 int oerrno = errno;
1808 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
1809
1810 yy_flush_buffer(b, yyscanner);
1811
1812 b->yy_input_file = file;
1813 b->yy_fill_buffer = 1;
1814
1815 /* If b is the current buffer, then yy_init_buffer was _probably_
1816 * called from yyrestart() or through yy_get_next_buffer.
1817 * In that case, we don't want to reset the lineno or column.
1818 */
1819 if (b != YY_CURRENT_BUFFER) {
1820 b->yy_bs_lineno = 1;
1821 b->yy_bs_column = 0;
1822 }
1823
1824 b->yy_is_interactive = file ? (isatty(fileno(file)) > 0) : 0;
1825
1826 errno = oerrno;
1827}
1828
1833void yy_flush_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner) {
1834 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
1835 if (!b) return;
1836
1837 b->yy_n_chars = 0;
1838
1839 /* We always need two end-of-buffer characters. The first causes
1840 * a transition to the end-of-buffer state. The second causes
1841 * a jam in that state.
1842 */
1843 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1844 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1845
1846 b->yy_buf_pos = &b->yy_ch_buf[0];
1847
1848 b->yy_at_bol = 1;
1849 b->yy_buffer_status = YY_BUFFER_NEW;
1850
1851 if (b == YY_CURRENT_BUFFER) yy_load_buffer_state(yyscanner);
1852}
1853
1860void yypush_buffer_state(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner) {
1861 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
1862 if (new_buffer == NULL) return;
1863
1864 yyensure_buffer_stack(yyscanner);
1865
1866 /* This block is copied from yy_switch_to_buffer. */
1867 if (YY_CURRENT_BUFFER) {
1868 /* Flush out information for old buffer. */
1869 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1870 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1871 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1872 }
1873
1874 /* Only push if top exists. Otherwise, replace top. */
1875 if (YY_CURRENT_BUFFER) yyg->yy_buffer_stack_top++;
1876 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1877
1878 /* copied from yy_switch_to_buffer. */
1879 yy_load_buffer_state(yyscanner);
1880 yyg->yy_did_buffer_switch_on_eof = 1;
1881}
1882
1887void yypop_buffer_state(yyscan_t yyscanner) {
1888 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
1889 if (!YY_CURRENT_BUFFER) return;
1890
1893 if (yyg->yy_buffer_stack_top > 0) --yyg->yy_buffer_stack_top;
1894
1895 if (YY_CURRENT_BUFFER) {
1896 yy_load_buffer_state(yyscanner);
1897 yyg->yy_did_buffer_switch_on_eof = 1;
1898 }
1899}
1900
1901/* Allocates the stack if it does not exist.
1902 * Guarantees space for at least one push.
1903 */
1904static void yyensure_buffer_stack(yyscan_t yyscanner) {
1905 yy_size_t num_to_alloc;
1906 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
1907
1908 if (!yyg->yy_buffer_stack) {
1909 /* First allocation is just for 2 elements, since we don't know if this
1910 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1911 * immediate realloc on the next call.
1912 */
1913 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
1914 yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc(
1915 num_to_alloc * sizeof(struct yy_buffer_state*), yyscanner);
1916 if (!yyg->yy_buffer_stack)
1917 YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()");
1918
1919 memset(yyg->yy_buffer_stack, 0,
1920 num_to_alloc * sizeof(struct yy_buffer_state*));
1921
1922 yyg->yy_buffer_stack_max = num_to_alloc;
1923 yyg->yy_buffer_stack_top = 0;
1924 return;
1925 }
1926
1927 if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1) {
1928 /* Increase the buffer to prepare for a possible push. */
1929 yy_size_t grow_size = 8 /* arbitrary grow size */;
1930
1931 num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
1932 yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc(
1933 yyg->yy_buffer_stack, num_to_alloc * sizeof(struct yy_buffer_state*),
1934 yyscanner);
1935 if (!yyg->yy_buffer_stack)
1936 YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()");
1937
1938 /* zero only the new slots.*/
1939 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0,
1940 grow_size * sizeof(struct yy_buffer_state*));
1941 yyg->yy_buffer_stack_max = num_to_alloc;
1942 }
1943}
1944
1952YY_BUFFER_STATE yy_scan_buffer(char* base, yy_size_t size, yyscan_t yyscanner) {
1954
1955 if (size < 2 || base[size - 2] != YY_END_OF_BUFFER_CHAR ||
1956 base[size - 1] != YY_END_OF_BUFFER_CHAR)
1957 /* They forgot to leave room for the EOB's. */
1958 return NULL;
1959
1960 b = (YY_BUFFER_STATE)yyalloc(sizeof(struct yy_buffer_state), yyscanner);
1961 if (!b) YY_FATAL_ERROR("out of dynamic memory in yy_scan_buffer()");
1962
1963 b->yy_buf_size = (int)(size - 2); /* "- 2" to take care of EOB's */
1964 b->yy_buf_pos = b->yy_ch_buf = base;
1965 b->yy_is_our_buffer = 0;
1966 b->yy_input_file = NULL;
1967 b->yy_n_chars = b->yy_buf_size;
1968 b->yy_is_interactive = 0;
1969 b->yy_at_bol = 1;
1970 b->yy_fill_buffer = 0;
1971 b->yy_buffer_status = YY_BUFFER_NEW;
1972
1973 yy_switch_to_buffer(b, yyscanner);
1974
1975 return b;
1976}
1977
1986YY_BUFFER_STATE yy_scan_string(const char* yystr, yyscan_t yyscanner) {
1987 return yy_scan_bytes(yystr, (int)strlen(yystr), yyscanner);
1988}
1989
1997YY_BUFFER_STATE yy_scan_bytes(const char* yybytes, int _yybytes_len,
1998 yyscan_t yyscanner) {
2000 char* buf;
2001 yy_size_t n;
2002 int i;
2003
2004 /* Get memory for full buffer, including space for trailing EOB's. */
2005 n = (yy_size_t)(_yybytes_len + 2);
2006 buf = (char*)yyalloc(n, yyscanner);
2007 if (!buf) YY_FATAL_ERROR("out of dynamic memory in yy_scan_bytes()");
2008
2009 for (i = 0; i < _yybytes_len; ++i) buf[i] = yybytes[i];
2010
2011 buf[_yybytes_len] = buf[_yybytes_len + 1] = YY_END_OF_BUFFER_CHAR;
2012
2013 b = yy_scan_buffer(buf, n, yyscanner);
2014 if (!b) YY_FATAL_ERROR("bad buffer in yy_scan_bytes()");
2015
2016 /* It's okay to grow etc. this buffer, and we should throw it
2017 * away when we're done.
2018 */
2019 b->yy_is_our_buffer = 1;
2020
2021 return b;
2022}
2023
2024#ifndef YY_EXIT_FAILURE
2025#define YY_EXIT_FAILURE 2
2026#endif
2027
2028static void yynoreturn yy_fatal_error(const char* msg, yyscan_t yyscanner) {
2029 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2030 (void)yyg;
2031 fprintf(stderr, "%s\n", msg);
2032 exit(YY_EXIT_FAILURE);
2033}
2034
2035/* Redefine yyless() so it works in section 3 code. */
2036
2037#undef yyless
2038#define yyless(n) \
2039 do { \
2040 /* Undo effects of setting up yytext. */ \
2041 int yyless_macro_arg = (n); \
2042 YY_LESS_LINENO(yyless_macro_arg); \
2043 yytext[yyleng] = yyg->yy_hold_char; \
2044 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
2045 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
2046 *yyg->yy_c_buf_p = '\0'; \
2047 yyleng = yyless_macro_arg; \
2048 } while (0)
2049
2050/* Accessor methods (get/set functions) to struct members. */
2051
2056 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2057 return yyextra;
2058}
2059
2063int yyget_lineno(yyscan_t yyscanner) {
2064 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2065
2066 if (!YY_CURRENT_BUFFER) return 0;
2067
2068 return yylineno;
2069}
2070
2074int yyget_column(yyscan_t yyscanner) {
2075 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2076
2077 if (!YY_CURRENT_BUFFER) return 0;
2078
2079 return yycolumn;
2080}
2081
2085FILE* yyget_in(yyscan_t yyscanner) {
2086 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2087 return yyin;
2088}
2089
2093FILE* yyget_out(yyscan_t yyscanner) {
2094 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2095 return yyout;
2096}
2097
2101int yyget_leng(yyscan_t yyscanner) {
2102 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2103 return yyleng;
2104}
2105
2109
2110char* yyget_text(yyscan_t yyscanner) {
2111 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2112 return yytext;
2113}
2114
2119void yyset_extra(YY_EXTRA_TYPE user_defined, yyscan_t yyscanner) {
2120 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2121 yyextra = user_defined;
2122}
2123
2128void yyset_lineno(int _line_number, yyscan_t yyscanner) {
2129 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2130
2131 /* lineno is only valid if an input buffer exists. */
2132 if (!YY_CURRENT_BUFFER) YY_FATAL_ERROR("yyset_lineno called with no buffer");
2133
2134 yylineno = _line_number;
2135}
2136
2141void yyset_column(int _column_no, yyscan_t yyscanner) {
2142 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2143
2144 /* column is only valid if an input buffer exists. */
2145 if (!YY_CURRENT_BUFFER) YY_FATAL_ERROR("yyset_column called with no buffer");
2146
2147 yycolumn = _column_no;
2148}
2149
2156void yyset_in(FILE* _in_str, yyscan_t yyscanner) {
2157 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2158 yyin = _in_str;
2159}
2160
2161void yyset_out(FILE* _out_str, yyscan_t yyscanner) {
2162 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2163 yyout = _out_str;
2164}
2165
2166int yyget_debug(yyscan_t yyscanner) {
2167 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2168 return yy_flex_debug;
2169}
2170
2171void yyset_debug(int _bdebug, yyscan_t yyscanner) {
2172 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2173 yy_flex_debug = _bdebug;
2174}
2175
2176/* Accessor methods for yylval and yylloc */
2177
2178YYSTYPE* yyget_lval(yyscan_t yyscanner) {
2179 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2180 return yylval;
2181}
2182
2183void yyset_lval(YYSTYPE* yylval_param, yyscan_t yyscanner) {
2184 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2185 yylval = yylval_param;
2186}
2187
2188/* User-visible API */
2189
2190/* yylex_init is special because it creates the scanner itself, so it is
2191 * the ONLY reentrant function that doesn't take the scanner as the last
2192 * argument. That's why we explicitly handle the declaration, instead of using
2193 * our macros.
2194 */
2195int yylex_init(yyscan_t* ptr_yy_globals) {
2196 if (ptr_yy_globals == NULL) {
2197 errno = EINVAL;
2198 return 1;
2199 }
2200
2201 *ptr_yy_globals = (yyscan_t)yyalloc(sizeof(struct yyguts_t), NULL);
2202
2203 if (*ptr_yy_globals == NULL) {
2204 errno = ENOMEM;
2205 return 1;
2206 }
2207
2208 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for
2209 * releases. */
2210 memset(*ptr_yy_globals, 0x00, sizeof(struct yyguts_t));
2211
2212 return yy_init_globals(*ptr_yy_globals);
2213}
2214
2215/* yylex_init_extra has the same functionality as yylex_init, but follows the
2216 * convention of taking the scanner as the last argument. Note however, that
2217 * this is a *pointer* to a scanner, as it will be allocated by this call (and
2218 * is the reason, too, why this function also must handle its own declaration).
2219 * The user defined value in the first argument will be available to yyalloc in
2220 * the yyextra field.
2221 */
2222int yylex_init_extra(YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals) {
2223 struct yyguts_t dummy_yyguts;
2224
2225 yyset_extra(yy_user_defined, &dummy_yyguts);
2226
2227 if (ptr_yy_globals == NULL) {
2228 errno = EINVAL;
2229 return 1;
2230 }
2231
2232 *ptr_yy_globals = (yyscan_t)yyalloc(sizeof(struct yyguts_t), &dummy_yyguts);
2233
2234 if (*ptr_yy_globals == NULL) {
2235 errno = ENOMEM;
2236 return 1;
2237 }
2238
2239 /* By setting to 0xAA, we expose bugs in
2240 yy_init_globals. Leave at 0x00 for releases. */
2241 memset(*ptr_yy_globals, 0x00, sizeof(struct yyguts_t));
2242
2243 yyset_extra(yy_user_defined, *ptr_yy_globals);
2244
2245 return yy_init_globals(*ptr_yy_globals);
2246}
2247
2248static int yy_init_globals(yyscan_t yyscanner) {
2249 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2250 /* Initialization is the same as for the non-reentrant scanner.
2251 * This function is called from yylex_destroy(), so don't allocate here.
2252 */
2253
2254 yyg->yy_buffer_stack = NULL;
2255 yyg->yy_buffer_stack_top = 0;
2256 yyg->yy_buffer_stack_max = 0;
2257 yyg->yy_c_buf_p = NULL;
2258 yyg->yy_init = 0;
2259 yyg->yy_start = 0;
2260
2261 yyg->yy_start_stack_ptr = 0;
2262 yyg->yy_start_stack_depth = 0;
2263 yyg->yy_start_stack = NULL;
2264
2265/* Defined in main.c */
2266#ifdef YY_STDINIT
2267 yyin = stdin;
2268 yyout = stdout;
2269#else
2270 yyin = NULL;
2271 yyout = NULL;
2272#endif
2273
2274 /* For future reference: Set errno on error, since we are called by
2275 * yylex_init()
2276 */
2277 return 0;
2278}
2279
2280/* yylex_destroy is for both reentrant and non-reentrant scanners. */
2281int yylex_destroy(yyscan_t yyscanner) {
2282 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2283
2284 /* Pop the buffer stack, destroying each element. */
2285 while (YY_CURRENT_BUFFER) {
2288 yypop_buffer_state(yyscanner);
2289 }
2290
2291 /* Destroy the stack itself. */
2292 yyfree(yyg->yy_buffer_stack, yyscanner);
2293 yyg->yy_buffer_stack = NULL;
2294
2295 /* Destroy the start condition stack. */
2296 yyfree(yyg->yy_start_stack, yyscanner);
2297 yyg->yy_start_stack = NULL;
2298
2299 /* Reset the globals. This is important in a non-reentrant scanner so the next
2300 * time yylex() is called, initialization will occur. */
2301 yy_init_globals(yyscanner);
2302
2303 /* Destroy the main struct (reentrant only). */
2304 yyfree(yyscanner, yyscanner);
2305 yyscanner = NULL;
2306 return 0;
2307}
2308
2309/*
2310 * Internal utility routines.
2311 */
2312
2313#ifndef yytext_ptr
2314static void yy_flex_strncpy(char* s1, const char* s2, int n,
2315 yyscan_t yyscanner) {
2316 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2317 (void)yyg;
2318
2319 int i;
2320 for (i = 0; i < n; ++i) s1[i] = s2[i];
2321}
2322#endif
2323
2324#ifdef YY_NEED_STRLEN
2325static int yy_flex_strlen(const char* s, yyscan_t yyscanner) {
2326 int n;
2327 for (n = 0; s[n]; ++n);
2328
2329 return n;
2330}
2331#endif
2332
2333void* yyalloc(yy_size_t size, yyscan_t yyscanner) {
2334 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2335 (void)yyg;
2336 return malloc(size);
2337}
2338
2339void* yyrealloc(void* ptr, yy_size_t size, yyscan_t yyscanner) {
2340 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2341 (void)yyg;
2342
2343 /* The cast to (char *) in the following accommodates both
2344 * implementations that use char* generic pointers, and those
2345 * that use void* generic pointers. It works with the latter
2346 * because both ANSI C and C++ allow castless assignment from
2347 * any pointer type to void*, and deal with argument conversions
2348 * as though doing an assignment.
2349 */
2350 return realloc(ptr, size);
2351}
2352
2353void yyfree(void* ptr, yyscan_t yyscanner) {
2354 struct yyguts_t* yyg = (struct yyguts_t*)yyscanner;
2355 (void)yyg;
2356 free((char*)ptr); /* see yyrealloc() for (char *) cast */
2357}
2358
2359#define YYTABLES_NAME "yytables"
2360
2361#line 89 "./ortools/flatzinc/parser.lex"
Definition file.cc:326
#define YYSTYPE
Definition parser.tab.cc:67
@ 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:740
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:951
#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:961
#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:960
#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:954
#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:962
#define yylval
Definition parser.yy.cc:782
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:729
#define yyget_extra
Definition parser.yy.cc:147
char * yy_bp
Definition parser.yy.cc:960
#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:866
#define YY_INPUT(buf, result, max_size)
Definition parser.yy.cc:886
#define ECHO
Definition parser.yy.cc:875
#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:926
#define yyterminate()
Definition parser.yy.cc:916
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:939
#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:750
int yy_did_buffer_switch_on_eof
Definition parser.yy.cc:760
int yy_start_stack_depth
Definition parser.yy.cc:762
FILE * yyout_r
Definition parser.yy.cc:750
size_t yy_buffer_stack_max
Definition parser.yy.cc:752
char * yy_last_accepting_cpos
Definition parser.yy.cc:765
YYSTYPE * yylval_r
Definition parser.yy.cc:774
int yy_flex_debug_r
Definition parser.yy.cc:768
int yy_more_flag
Definition parser.yy.cc:771
int yy_more_len
Definition parser.yy.cc:772
yy_state_type yy_last_accepting_state
Definition parser.yy.cc:764
int yy_start
Definition parser.yy.cc:759
int yy_n_chars
Definition parser.yy.cc:755
int yylineno_r
Definition parser.yy.cc:767
char * yy_c_buf_p
Definition parser.yy.cc:757
int yyleng_r
Definition parser.yy.cc:756
int yy_init
Definition parser.yy.cc:758
YY_BUFFER_STATE * yy_buffer_stack
Definition parser.yy.cc:753
int yy_start_stack_ptr
Definition parser.yy.cc:761
char yy_hold_char
Definition parser.yy.cc:754
char * yytext_r
Definition parser.yy.cc:770
YY_EXTRA_TYPE yyextra_r
Definition parser.yy.cc:746
int * yy_start_stack
Definition parser.yy.cc:763
size_t yy_buffer_stack_top
Definition parser.yy.cc:751