65#define YYBISON_VERSION "3.7.5"
68#define YYSKELETON_NAME "yacc.c"
80#define YYSTYPE ORFZ_STYPE
82#define yyparse orfz_parse
84#define yyerror orfz_error
85#define yydebug orfz_debug
86#define yynerrs orfz_nerrs
90#define YY_CAST(Type, Val) static_cast<Type>(Val)
91#define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type>(Val)
93#define YY_CAST(Type, Val) ((Type)(Val))
94#define YY_REINTERPRET_CAST(Type, Val) ((Type)(Val))
98#if defined __cplusplus
99#if 201103L <= __cplusplus
100#define YY_NULLPTR nullptr
105#define YY_NULLPTR ((void*)0)
109#include "parser.tab.hh"
183#line 36 "./ortools/flatzinc/parser.yy"
185#include "absl/strings/match.h"
186#include "absl/strings/str_format.h"
202#line 192 "./ortools/flatzinc/parser.tab.cc"
212#ifndef __PTRDIFF_MAX__
214#if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
225#ifdef __INT_LEAST8_MAX__
227#elif defined YY_STDINT_H
233#ifdef __INT_LEAST16_MAX__
235#elif defined YY_STDINT_H
247#undef UINT_LEAST8_MAX
248#undef UINT_LEAST16_MAX
249#define UINT_LEAST8_MAX 255
250#define UINT_LEAST16_MAX 65535
253#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
255#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H && \
256 UINT_LEAST8_MAX <= INT_MAX)
258#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
264#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
266#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H && \
267 UINT_LEAST16_MAX <= INT_MAX)
269#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
276#if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
277#define YYPTRDIFF_T __PTRDIFF_TYPE__
278#define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
279#elif defined PTRDIFF_MAX
283#define YYPTRDIFF_T ptrdiff_t
284#define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
286#define YYPTRDIFF_T long
287#define YYPTRDIFF_MAXIMUM LONG_MAX
293#define YYSIZE_T __SIZE_TYPE__
295#define YYSIZE_T size_t
296#elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
298#define YYSIZE_T size_t
300#define YYSIZE_T unsigned
304#define YYSIZE_MAXIMUM \
305 YY_CAST(YYPTRDIFF_T, \
306 (YYPTRDIFF_MAXIMUM < YY_CAST(YYSIZE_T, -1) ? YYPTRDIFF_MAXIMUM \
307 : YY_CAST(YYSIZE_T, -1)))
309#define YYSIZEOF(X) YY_CAST(YYPTRDIFF_T, sizeof(X))
318#if defined YYENABLE_NLS && YYENABLE_NLS
321#define YY_(Msgid) dgettext("bison-runtime", Msgid)
325#define YY_(Msgid) Msgid
329#ifndef YY_ATTRIBUTE_PURE
330#if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
331#define YY_ATTRIBUTE_PURE __attribute__((__pure__))
333#define YY_ATTRIBUTE_PURE
337#ifndef YY_ATTRIBUTE_UNUSED
338#if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
339#define YY_ATTRIBUTE_UNUSED __attribute__((__unused__))
341#define YY_ATTRIBUTE_UNUSED
346#if !defined lint || defined __GNUC__
347#define YY_USE(E) ((void)(E))
352#if defined __GNUC__ && !defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
354#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
355 _Pragma("GCC diagnostic push") \
356 _Pragma("GCC diagnostic ignored \"-Wuninitialized\"") \
357 _Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
358#define YY_IGNORE_MAYBE_UNINITIALIZED_END _Pragma("GCC diagnostic pop")
360#define YY_INITIAL_VALUE(Value) Value
362#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
363#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
364#define YY_IGNORE_MAYBE_UNINITIALIZED_END
366#ifndef YY_INITIAL_VALUE
367#define YY_INITIAL_VALUE(Value)
370#if defined __cplusplus && defined __GNUC__ && !defined __ICC && 6 <= __GNUC__
371#define YY_IGNORE_USELESS_CAST_BEGIN \
372 _Pragma("GCC diagnostic push") \
373 _Pragma("GCC diagnostic ignored \"-Wuseless-cast\"")
374#define YY_IGNORE_USELESS_CAST_END _Pragma("GCC diagnostic pop")
376#ifndef YY_IGNORE_USELESS_CAST_BEGIN
377#define YY_IGNORE_USELESS_CAST_BEGIN
378#define YY_IGNORE_USELESS_CAST_END
381#define YY_ASSERT(E) ((void)(0 && (E)))
387#ifdef YYSTACK_USE_ALLOCA
388#if YYSTACK_USE_ALLOCA
390#define YYSTACK_ALLOC __builtin_alloca
391#elif defined __BUILTIN_VA_ARG_INCR
394#define YYSTACK_ALLOC __alloca
395#elif defined _MSC_VER
397#define alloca _alloca
399#define YYSTACK_ALLOC alloca
400#if !defined _ALLOCA_H && !defined EXIT_SUCCESS
404#define EXIT_SUCCESS 0
413#define YYSTACK_FREE(Ptr) \
417#ifndef YYSTACK_ALLOC_MAXIMUM
422#define YYSTACK_ALLOC_MAXIMUM 4032
425#define YYSTACK_ALLOC YYMALLOC
426#define YYSTACK_FREE YYFREE
427#ifndef YYSTACK_ALLOC_MAXIMUM
428#define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
430#if (defined __cplusplus && !defined EXIT_SUCCESS && \
431 !((defined YYMALLOC || defined malloc) && \
432 (defined YYFREE || defined free)))
435#define EXIT_SUCCESS 0
439#define YYMALLOC malloc
440#if !defined malloc && !defined EXIT_SUCCESS
446#if !defined free && !defined EXIT_SUCCESS
453#if (!defined yyoverflow && \
454 (!defined __cplusplus || \
455 (defined ORFZ_STYPE_IS_TRIVIAL && ORFZ_STYPE_IS_TRIVIAL)))
464#define YYSTACK_GAP_MAXIMUM (YYSIZEOF(union yyalloc) - 1)
468#define YYSTACK_BYTES(N) \
469 ((N) * (YYSIZEOF(yy_state_t) + YYSIZEOF(YYSTYPE)) + YYSTACK_GAP_MAXIMUM)
471#define YYCOPY_NEEDED 1
478#define YYSTACK_RELOCATE(Stack_alloc, Stack) \
480 YYPTRDIFF_T yynewbytes; \
481 YYCOPY(&yyptr->Stack_alloc, Stack, yysize); \
482 Stack = &yyptr->Stack_alloc; \
483 yynewbytes = yystacksize * YYSIZEOF(*Stack) + YYSTACK_GAP_MAXIMUM; \
484 yyptr += yynewbytes / YYSIZEOF(*yyptr); \
489#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
493#if defined __GNUC__ && 1 < __GNUC__
494#define YYCOPY(Dst, Src, Count) \
495 __builtin_memcpy(Dst, Src, YY_CAST(YYSIZE_T, (Count)) * sizeof(*(Src)))
497#define YYCOPY(Dst, Src, Count) \
500 for (yyi = 0; yyi < (Count); yyi++) (Dst)[yyi] = (Src)[yyi]; \
525#define YYTRANSLATE(YYX) \
526 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
527 ? YY_CAST(yysymbol_kind_t, yytranslate[YYX]) \
533 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
534 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
535 23, 24, 2, 2, 25, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 26, 22,
536 2, 29, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
537 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 27, 2, 28, 2, 2, 2, 2, 2, 2,
538 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
539 2, 2, 2, 30, 2, 31, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
540 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
541 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
542 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
543 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
544 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
545 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
546 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21};
551 0, 103, 103, 110, 114, 115, 120, 123, 124, 127, 128, 129, 130, 133,
552 134, 137, 138, 145, 146, 149, 168, 183, 194, 209, 220, 246, 279, 349,
553 350, 353, 354, 355, 358, 362, 368, 369, 382, 400, 401, 402, 403, 410,
554 411, 412, 413, 420, 421, 428, 429, 430, 433, 434, 437, 438, 439, 444,
555 445, 448, 449, 450, 455, 456, 457, 462, 463, 467, 468, 474, 478, 484,
556 485, 488, 500, 501, 504, 505, 506, 507, 508, 513, 544, 561, 586, 595,
557 599, 602, 603, 606, 607, 608, 609, 619, 628, 634, 649, 657, 668};
561#define YY_ACCESSING_SYMBOL(State) YY_CAST(yysymbol_kind_t, yystos[State])
570static const char*
const yytname[] = {
"\"end of file\"",
606 "predicate_arguments",
607 "predicate_argument",
608 "predicate_array_argument",
610 "variable_or_constant_declarations",
611 "variable_or_constant_declaration",
612 "optional_var_or_value",
613 "optional_var_or_value_array",
614 "var_or_value_array",
631 "annotation_arguments",
644static const yytype_int16 yytoknum[] = {0, 256, 257, 258, 259, 260, 261, 262,
645 263, 264, 265, 266, 267, 268, 269, 270,
646 271, 272, 273, 274, 275, 276, 59, 40,
647 41, 44, 58, 91, 93, 61, 123, 125};
650#define YYPACT_NINF (-182)
652#define yypact_value_is_default(Yyn) ((Yyn) == YYPACT_NINF)
654#define YYTABLE_NINF (-19)
656#define yytable_value_is_error(Yyn) 0
661 -182, 49, 7, -182, -15, 67, 114, 20, -182, 95, -182, 99,
662 -182, -182, -182, 136, 76, 122, 141, 11, 154, -182, -182, -182,
663 143, 130, 40, 157, 12, 151, 160, 158, -182, 155, 118, -182,
664 -182, 161, 163, -182, 162, 164, 165, 76, 156, 166, 159, 171,
665 -182, -182, 172, 11, 169, -182, -182, 175, 11, -182, -182, 167,
666 125, -182, -182, 27, 168, -182, 40, 176, 177, 179, 120, -182,
667 170, -182, 22, 80, 80, 80, -182, 121, 174, 184, 173, -182,
668 182, -182, -182, 178, -182, -182, 59, -182, 75, 187, -182, 180,
669 -182, 93, 11, 131, -182, -182, -182, 188, -182, 96, 121, -182,
670 198, 190, 199, -182, 200, 150, -182, 195, 185, -182, 34, -182,
671 196, 197, -182, 186, -182, 31, -182, 128, -182, 80, 201, 121,
672 202, 84, -182, -182, -182, 56, 60, -182, 203, 204, -182, 129,
673 -182, 189, 205, 150, -182, -182, 207, -182, -182, 147, 206, 121,
674 -182, 76, 192, 76, 209, 210, 211, -182, 212, -182, -182, 213,
675 -182, -182, -182, -182, 216, 208, 217, 218, 219, 224, -182, -182,
676 225, -182, 226, -182, -182, -182, -182, -182, 74, 85, 87, 91,
677 220, 221, 222, 223, -182, 97, 75, 64, 104, -182, 133, -182,
678 137, 227, -182, -182, 138, -182, -182, 139, -182, 75, -182, 214,
679 153, -182, -182, -182, 228, -182, -182};
685 5, 0, 0, 1, 0, 0, 0, 70, 4, 0, 3, 0, 37, 45, 38, 0, 0, 0, 0,
686 0, 0, 47, 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, 52, 53, 0, 51, 17, 0,
687 0, 84, 0, 0, 0, 0, 0, 8, 0, 0, 41, 42, 0, 0, 0, 39, 46, 0, 0,
688 40, 84, 0, 0, 69, 2, 0, 0, 6, 0, 0, 0, 0, 0, 84, 0, 50, 0, 0,
689 0, 0, 94, 0, 16, 0, 0, 13, 0, 7, 9, 0, 43, 44, 28, 54, 0, 74, 76,
690 79, 75, 0, 0, 0, 73, 96, 95, 88, 89, 90, 0, 83, 0, 0, 0, 10, 0, 0,
691 25, 60, 65, 64, 0, 19, 0, 0, 34, 35, 82, 0, 33, 0, 84, 0, 0, 0, 0,
692 0, 86, 15, 14, 0, 0, 27, 0, 0, 63, 0, 77, 0, 0, 0, 81, 78, 71, 72,
693 87, 0, 0, 0, 93, 0, 0, 0, 0, 0, 0, 61, 0, 62, 80, 0, 32, 91, 92,
694 85, 0, 0, 0, 0, 0, 0, 66, 36, 0, 11, 0, 84, 84, 84, 12, 84, 0, 0,
695 0, 31, 0, 0, 0, 0, 26, 0, 0, 0, 0, 21, 0, 68, 0, 58, 57, 23, 0,
696 56, 30, 0, 20, 0, 24, 0, 0, 22, 29, 67, 0, 55, 59};
700 -182, -182, -182, -182, 191, -182, -182, 108, -182, -182, -182,
701 -182, 25, -107, 88, 89, 92, -7, -50, 215, -182, 13,
702 -181, -182, -182, -182, -182, -72, -56, 100, -76, -182};
706 0, 1, 2, 6, 44, 45, 82, 83, 7, 20, 114, 196, 125, 126, 21, 22,
707 23, 46, 34, 35, 208, 209, 119, 204, 25, 40, 99, 100, 60, 133, 134, 41};
713 24, 70, 74, 107, 101, 102, 139, 8, 4, 29, -18, -18, -18, -18, -18,
714 90, 48, 203, 5, 49, -18, -18, -18, 11, 12, -18, 13, 14, -18, 32,
715 50, 33, 219, 15, 80, 16, 64, -18, 17, 79, 168, 18, 51, 42, 12,
716 81, 13, 14, 127, 3, 19, 92, 32, 15, 33, 43, 147, 151, 17, 148,
717 12, 18, 13, 14, 12, 142, 13, 14, 143, 15, 19, 157, 150, 15, 17,
718 159, 79, 18, 17, 171, 12, 18, 13, 14, 205, 206, 19, 9, 113, 15,
719 19, 79, 207, 115, 17, 116, 117, 18, 93, 94, 95, 96, 79, 192, 79,
720 118, 19, 97, 79, 155, 98, 122, 156, 123, 193, 32, 194, 33, 26, 131,
721 195, 124, 122, 132, 123, 201, 27, 188, 189, 190, 158, 191, 210, 76, 77,
722 38, 10, 78, 30, 103, 104, 105, 79, 56, 39, 56, 28, 202, 106, 57,
723 172, 89, 174, 56, 56, 128, 129, 31, 56, 149, 165, 212, 213, 216, 147,
724 214, 217, 218, 122, 37, 123, 169, 155, 205, 206, 47, 36, 52, 53, 54,
725 65, 58, 55, 59, 61, 67, 62, 68, 69, 71, 75, 66, 63, 72, 84,
726 87, 86, 88, 91, 108, 109, 110, 111, 120, 130, 80, 112, 121, 136, 137,
727 138, 140, 141, 146, 144, 145, 135, 166, 173, 152, 154, 163, 164, 167, 79,
728 211, 160, 161, 181, 221, 162, 153, 220, 0, 170, 175, 176, 177, 183, 184,
729 178, 179, 180, 182, 185, 186, 187, 197, 198, 199, 200, 0, 0, 0, 215,
730 0, 222, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
734 7, 51, 58, 79, 76, 77, 113, 22, 1, 16, 3, 4, 5, 6, 7, 71,
735 4, 198, 11, 7, 13, 14, 15, 3, 4, 18, 6, 7, 21, 18, 18, 20,
736 213, 13, 7, 15, 43, 30, 18, 17, 147, 21, 30, 3, 4, 18, 6, 7,
737 98, 0, 30, 29, 18, 13, 20, 15, 25, 129, 18, 28, 4, 21, 6, 7,
738 4, 31, 6, 7, 118, 13, 30, 15, 128, 13, 18, 15, 17, 21, 18, 155,
739 4, 21, 6, 7, 20, 21, 30, 20, 29, 13, 30, 17, 28, 18, 18, 20,
740 21, 21, 18, 19, 20, 21, 17, 29, 17, 30, 30, 27, 17, 25, 30, 18,
741 28, 20, 29, 18, 29, 20, 23, 23, 29, 28, 18, 27, 20, 28, 27, 183,
742 184, 185, 137, 187, 28, 8, 9, 5, 22, 12, 16, 18, 19, 20, 17, 25,
743 14, 25, 10, 197, 27, 31, 157, 31, 159, 25, 25, 24, 25, 16, 25, 31,
744 31, 28, 25, 25, 25, 28, 28, 28, 18, 26, 20, 24, 25, 20, 21, 18,
745 22, 26, 18, 21, 24, 20, 27, 20, 22, 26, 22, 16, 16, 20, 23, 25,
746 27, 18, 26, 18, 20, 18, 28, 25, 16, 28, 20, 16, 16, 7, 28, 27,
747 18, 10, 10, 16, 27, 27, 18, 18, 108, 28, 26, 18, 18, 18, 18, 18,
748 17, 200, 138, 138, 20, 216, 138, 131, 18, -1, 28, 26, 26, 26, 20, 20,
749 28, 28, 26, 26, 20, 20, 20, 27, 27, 27, 27, -1, -1, -1, 27, -1,
750 28, 66, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 56};
755 0, 33, 34, 0, 1, 11, 35, 40, 22, 20, 22, 3, 4, 6, 7, 13, 15, 18, 21,
756 30, 41, 46, 47, 48, 49, 56, 23, 27, 10, 49, 16, 16, 18, 20, 50, 51, 22, 26,
757 5, 14, 57, 63, 3, 15, 36, 37, 49, 18, 4, 7, 18, 30, 26, 18, 21, 27, 25,
758 31, 20, 20, 60, 22, 22, 27, 49, 24, 25, 26, 16, 16, 50, 20, 18, 51, 60, 23,
759 8, 9, 12, 17, 7, 18, 38, 39, 26, 36, 20, 18, 18, 31, 60, 28, 29, 18, 19,
760 20, 21, 27, 30, 58, 59, 59, 59, 18, 19, 20, 27, 62, 25, 16, 28, 20, 28, 29,
761 42, 18, 20, 21, 30, 54, 16, 27, 18, 20, 28, 44, 45, 50, 24, 25, 16, 23, 27,
762 61, 62, 39, 18, 10, 10, 45, 16, 27, 31, 50, 18, 18, 27, 25, 28, 31, 60, 59,
763 18, 61, 18, 25, 28, 15, 49, 15, 46, 47, 48, 18, 18, 31, 28, 18, 45, 24, 28,
764 62, 49, 26, 49, 26, 26, 26, 28, 28, 26, 20, 26, 20, 20, 20, 20, 20, 60, 60,
765 60, 60, 29, 29, 29, 29, 43, 27, 27, 27, 27, 28, 50, 54, 55, 20, 21, 28, 52,
766 53, 28, 44, 28, 25, 28, 27, 25, 28, 28, 54, 18, 53, 28};
770 0, 32, 33, 34, 34, 34, 35, 36, 36, 37, 37, 37, 37, 38, 38, 39, 39,
771 40, 40, 41, 41, 41, 41, 41, 41, 41, 41, 42, 42, 43, 43, 43, 44, 44,
772 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 47, 48, 48, 49, 49, 49, 50,
773 50, 51, 51, 51, 52, 52, 53, 53, 53, 54, 54, 54, 54, 54, 54, 54, 55,
774 55, 56, 56, 57, 58, 58, 59, 59, 59, 59, 59, 59, 59, 59, 59, 60, 60,
775 61, 61, 62, 62, 62, 62, 62, 62, 62, 63, 63, 63};
779 0, 2, 5, 3, 3, 0, 5, 3, 1, 3, 4, 8, 9, 1, 3, 3, 1, 3, 0, 6,
780 15, 14, 15, 14, 15, 6, 13, 2, 0, 4, 3, 0, 3, 1, 1, 1, 4, 1, 1, 3,
781 3, 3, 3, 5, 5, 1, 3, 1, 1, 1, 3, 1, 1, 1, 4, 3, 1, 1, 1, 4,
782 1, 3, 3, 2, 1, 1, 4, 3, 1, 3, 0, 6, 3, 1, 1, 1, 1, 3, 3, 1,
783 4, 3, 2, 3, 0, 3, 1, 3, 1, 1, 1, 4, 4, 3, 3, 4, 4};
787#define yyerrok (yyerrstatus = 0)
788#define yyclearin (yychar = ORFZ_EMPTY)
790#define YYACCEPT goto yyacceptlab
791#define YYABORT goto yyabortlab
792#define YYERROR goto yyerrorlab
794#define YYRECOVERING() (!!yyerrstatus)
796#define YYBACKUP(Token, Value) \
798 if (yychar == ORFZ_EMPTY) { \
805 yyerror(context, model, ok, scanner, \
806 YY_("syntax error: cannot back up")); \
813#define YYERRCODE ORFZ_UNDEF
820#define YYFPRINTF fprintf
823#define YYDPRINTF(Args) \
825 if (yydebug) YYFPRINTF Args; \
829#ifndef YY_LOCATION_PRINT
830#define YY_LOCATION_PRINT(File, Loc) ((void)0)
833#define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
836 YYFPRINTF(stderr, "%s ", Title); \
837 yy_symbol_print(stderr, Kind, Value, context, model, ok, scanner); \
838 YYFPRINTF(stderr, "\n"); \
850 FILE* yyoutput = yyo;
856 if (!yyvaluep)
return;
858 if (yykind <
YYNTOKENS) YYPRINT(yyo, yytoknum[yykind], *yyvaluep);
888 for (; yybottom <= yytop; yybottom++) {
889 int yybot = *yybottom;
895#define YY_STACK_PRINT(Bottom, Top) \
897 if (yydebug) yy_stack_print((Bottom), (Top)); \
909 int yynrhs =
yyr2[yyrule];
911 YYFPRINTF(stderr,
"Reducing stack by rule %d (line %d):\n", yyrule - 1,
914 for (yyi = 0; yyi < yynrhs; yyi++) {
917 &yyvsp[(yyi + 1) - (yynrhs)],
context,
model, ok, scanner);
922#define YY_REDUCE_PRINT(Rule) \
925 yy_reduce_print(yyssp, yyvsp, Rule, context, model, ok, scanner); \
932#define YYDPRINTF(Args) ((void)0)
933#define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
934#define YY_STACK_PRINT(Bottom, Top)
935#define YY_REDUCE_PRINT(Rule)
940#define YYINITDEPTH 200
951#define YYMAXDEPTH 10000
975 int yyxbegin = yyn < 0 ? -yyn : 0;
977 int yychecklim =
YYLAST - yyn + 1;
980 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
985 else if (yycount == yyargn)
996#if defined __GLIBC__ && defined _STRING_H
997#define yystrlen(S) (YY_CAST(YYPTRDIFF_T, strlen(S)))
1002 for (yylen = 0; yystr[yylen]; yylen++)
continue;
1009#if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1010#define yystpcpy stpcpy
1014static char*
yystpcpy(
char* yydest,
const char* yysrc) {
1016 const char* yys = yysrc;
1018 while ((*yyd++ = *yys++) !=
'\0')
continue;
1034 if (*yystr ==
'"') {
1036 char const* yyp = yystr;
1037 for (;;)
switch (*++yyp) {
1040 goto do_not_strip_quotes;
1044 goto do_not_strip_quotes;
1050 if (yyres) yyres[yyn] = *yyp;
1055 if (yyres) yyres[yyn] =
'\0';
1058 do_not_strip_quotes:;
1062 return yystpcpy(yyres, yystr) - yyres;
1097 if (yyarg) yyarg[yycount] = yyctx->
yytoken;
1119 enum { YYARGS_MAX = 5 };
1133#define YYCASE_(N, S) \
1139 YYCASE_(1,
YY_(
"syntax error, unexpected %s"));
1140 YYCASE_(2,
YY_(
"syntax error, unexpected %s, expecting %s"));
1141 YYCASE_(3,
YY_(
"syntax error, unexpected %s, expecting %s or %s"));
1142 YYCASE_(4,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s"));
1145 YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1151 yysize =
yystrlen(yyformat) - 2 * yycount + 1;
1154 for (yyi = 0; yyi < yycount; ++yyi) {
1163 if (*yymsg_alloc < yysize) {
1164 *yymsg_alloc = 2 * yysize;
1176 while ((*yyp = *yyformat) !=
'\0')
1177 if (*yyp ==
'%' && yyformat[1] ==
's' && yyi < yycount) {
1202 if (!yymsg) yymsg =
"Deleting";
1230 int yyerrstatus = 0;
1259 char* yymsg = yymsgbuf;
1262#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1268 YYDPRINTF((stderr,
"Starting parse\n"));
1270 yychar = ORFZ_EMPTY;
1285 YYDPRINTF((stderr,
"Entering state %d\n", yystate));
1292 if (yyss + yystacksize - 1 <= yyssp)
1293#if !defined yyoverflow && !defined YYSTACK_RELOCATE
1294 goto yyexhaustedlab;
1300#if defined yyoverflow
1312 yyoverflow(
YY_(
"memory exhausted"), &yyss1, yysize *
YYSIZEOF(*yyssp),
1313 &yyvs1, yysize *
YYSIZEOF(*yyvsp), &yystacksize);
1319 if (
YYMAXDEPTH <= yystacksize)
goto yyexhaustedlab;
1328 if (!yyptr)
goto yyexhaustedlab;
1331#undef YYSTACK_RELOCATE
1336 yyssp = yyss + yysize - 1;
1337 yyvsp = yyvs + yysize - 1;
1341 (stderr,
"Stack size increased to %ld\n",
YY_CAST(
long, yystacksize)));
1344 if (yyss + yystacksize - 1 <= yyssp)
YYABORT;
1366 if (yychar == ORFZ_EMPTY) {
1367 YYDPRINTF((stderr,
"Reading a token\n"));
1371 if (yychar <= ORFZ_EOF) {
1374 YYDPRINTF((stderr,
"Now at end of input.\n"));
1375 }
else if (yychar == ORFZ_error) {
1380 yychar = ORFZ_UNDEF;
1391 if (yyn < 0 ||
YYLAST < yyn ||
yycheck[yyn] != yytoken)
goto yydefault;
1401 if (yyerrstatus) yyerrstatus--;
1411 yychar = ORFZ_EMPTY;
1419 if (yyn == 0)
goto yyerrlab;
1437 yyval = yyvsp[1 - yylen];
1442#line 114 "./ortools/flatzinc/parser.yy"
1446#line 1593 "./ortools/flatzinc/parser.tab.cc"
1451#line 149 "./ortools/flatzinc/parser.yy"
1455 const Domain& domain = (yyvsp[-5].domain);
1456 const std::string& identifier = (yyvsp[-3].string_value);
1457 const Domain& assignment = (yyvsp[0].domain);
1458 std::vector<Annotation>*
const annotations = (yyvsp[-2].annotations);
1462 context->domain_map[identifier] = assignment;
1470#line 1617 "./ortools/flatzinc/parser.tab.cc"
1476#line 169 "./ortools/flatzinc/parser.yy"
1478 std::vector<Annotation>*
const annotations = (yyvsp[-4].annotations);
1480 CHECK_EQ((yyvsp[-12].integer_value), 1)
1481 <<
"Only [1..n] array are supported here.";
1482 const int64 num_constants = (yyvsp[-10].integer_value);
1483 const std::string& identifier = (yyvsp[-5].string_value);
1484 const std::vector<int64>*
const assignments = (yyvsp[-1].integers);
1485 CHECK(assignments !=
nullptr);
1486 CHECK_EQ(num_constants, assignments->size());
1488 context->integer_array_map[identifier] = *assignments;
1492#line 1636 "./ortools/flatzinc/parser.tab.cc"
1497#line 184 "./ortools/flatzinc/parser.yy"
1499 std::vector<Annotation>*
const annotations = (yyvsp[-3].annotations);
1501 CHECK_EQ((yyvsp[-11].integer_value), 1)
1502 <<
"Only [1..n] array are supported here.";
1503 const int64 num_constants = (yyvsp[-9].integer_value);
1504 CHECK_EQ(num_constants, 0) <<
"Empty arrays should have a size of 0";
1505 const std::string& identifier = (yyvsp[-4].string_value);
1506 context->integer_array_map[identifier] = std::vector<int64>();
1509#line 1651 "./ortools/flatzinc/parser.tab.cc"
1515#line 195 "./ortools/flatzinc/parser.yy"
1517 std::vector<Annotation>*
const annotations = (yyvsp[-4].annotations);
1519 CHECK_EQ((yyvsp[-12].integer_value), 1)
1520 <<
"Only [1..n] array are supported here.";
1521 const int64 num_constants = (yyvsp[-10].integer_value);
1522 const std::string& identifier = (yyvsp[-5].string_value);
1523 const std::vector<double>*
const assignments = (yyvsp[-1].doubles);
1524 CHECK(assignments !=
nullptr);
1525 CHECK_EQ(num_constants, assignments->size());
1527 context->float_array_map[identifier] = *assignments;
1531#line 1670 "./ortools/flatzinc/parser.tab.cc"
1536#line 210 "./ortools/flatzinc/parser.yy"
1538 std::vector<Annotation>*
const annotations = (yyvsp[-3].annotations);
1540 CHECK_EQ((yyvsp[-11].integer_value), 1)
1541 <<
"Only [1..n] array are supported here.";
1542 const int64 num_constants = (yyvsp[-9].integer_value);
1543 CHECK_EQ(num_constants, 0) <<
"Empty arrays should have a size of 0";
1544 const std::string& identifier = (yyvsp[-4].string_value);
1545 context->float_array_map[identifier] = std::vector<double>();
1548#line 1685 "./ortools/flatzinc/parser.tab.cc"
1554#line 221 "./ortools/flatzinc/parser.yy"
1557 CHECK_EQ((yyvsp[-12].integer_value), 1)
1558 <<
"Only [1..n] array are supported here.";
1559 const int64 num_constants = (yyvsp[-10].integer_value);
1560 const Domain& domain = (yyvsp[-7].domain);
1561 const std::string& identifier = (yyvsp[-5].string_value);
1562 const std::vector<Domain>*
const assignments = (yyvsp[-1].domains);
1563 const std::vector<Annotation>*
const annotations =
1564 (yyvsp[-4].annotations);
1565 CHECK(assignments !=
nullptr);
1566 CHECK_EQ(num_constants, assignments->size());
1569 context->domain_array_map[identifier] = *assignments;
1572 std::vector<int64> values(num_constants);
1573 for (
int i = 0; i < num_constants; ++i) {
1574 values[i] = (*assignments)[i].values.front();
1577 context->integer_array_map[identifier] = values;
1582#line 1715 "./ortools/flatzinc/parser.tab.cc"
1587#line 246 "./ortools/flatzinc/parser.yy"
1593 const Domain& domain = (yyvsp[-4].domain);
1594 const std::string& identifier = (yyvsp[-2].string_value);
1595 std::vector<Annotation>*
const annotations = (yyvsp[-1].annotations);
1597 const bool introduced =
ContainsId(annotations,
"var_is_introduced") ||
1598 absl::StartsWith(identifier,
"X_INTRODUCED");
1601 var =
model->AddVariable(identifier, domain, introduced);
1602 }
else if (assignment.
variable ==
nullptr) {
1605 identifier, Domain::IntegerValue(assignment.
value), introduced);
1608 var->Merge(identifier, domain, introduced);
1615 model->AddOutput(SolutionOutputSpecs::SingleVariable(
1620#line 1753 "./ortools/flatzinc/parser.tab.cc"
1626#line 280 "./ortools/flatzinc/parser.yy"
1631 CHECK_EQ((yyvsp[-10].integer_value), 1);
1632 const int64 num_vars = (yyvsp[-8].integer_value);
1633 const Domain& domain = (yyvsp[-4].domain);
1634 const std::string& identifier = (yyvsp[-2].string_value);
1635 std::vector<Annotation>*
const annotations = (yyvsp[-1].annotations);
1637 (yyvsp[0].var_or_value_array);
1638 CHECK(assignments ==
nullptr ||
1639 assignments->
variables.size() == num_vars);
1640 CHECK(assignments ==
nullptr || assignments->
values.size() == num_vars);
1641 const bool introduced =
ContainsId(annotations,
"var_is_introduced") ||
1642 absl::StartsWith(identifier,
"X_INTRODUCED");
1644 std::vector<IntegerVariable*> vars(num_vars,
nullptr);
1646 for (
int i = 0; i < num_vars; ++i) {
1647 const std::string var_name =
1648 absl::StrFormat(
"%s[%d]", identifier, i + 1);
1649 if (assignments ==
nullptr) {
1650 vars[i] =
model->AddVariable(var_name, domain, introduced);
1651 }
else if (assignments->
variables[i] ==
nullptr) {
1655 vars[i] =
model->AddVariable(var_name, Domain::IntegerValue(
value),
1661 vars[i]->Merge(var_name, domain, introduced);
1667 context->variable_array_map[identifier] = vars;
1672 if (annotations !=
nullptr) {
1673 for (
int i = 0; i < annotations->size(); ++i) {
1681 std::vector<SolutionOutputSpecs::Bounds>
bounds;
1685 bounds.emplace_back(SolutionOutputSpecs::Bounds(
1689 model->AddOutput(SolutionOutputSpecs::MultiDimensionalArray(
1696#line 1825 "./ortools/flatzinc/parser.tab.cc"
1700#line 349 "./ortools/flatzinc/parser.yy"
1702 (yyval.var_or_value) = (yyvsp[0].var_or_value);
1704#line 1831 "./ortools/flatzinc/parser.tab.cc"
1708#line 350 "./ortools/flatzinc/parser.yy"
1710 (yyval.var_or_value) = VariableRefOrValue::Undefined();
1712#line 1837 "./ortools/flatzinc/parser.tab.cc"
1716#line 353 "./ortools/flatzinc/parser.yy"
1718 (yyval.var_or_value_array) = (yyvsp[-1].var_or_value_array);
1720#line 1843 "./ortools/flatzinc/parser.tab.cc"
1724#line 354 "./ortools/flatzinc/parser.yy"
1726 (yyval.var_or_value_array) =
nullptr;
1728#line 1849 "./ortools/flatzinc/parser.tab.cc"
1732#line 355 "./ortools/flatzinc/parser.yy"
1734 (yyval.var_or_value_array) =
nullptr;
1736#line 1855 "./ortools/flatzinc/parser.tab.cc"
1740#line 358 "./ortools/flatzinc/parser.yy"
1742 (yyval.var_or_value_array) = (yyvsp[-2].var_or_value_array);
1743 (yyval.var_or_value_array)->PushBack((yyvsp[0].var_or_value));
1745#line 1864 "./ortools/flatzinc/parser.tab.cc"
1749#line 362 "./ortools/flatzinc/parser.yy"
1752 (yyval.var_or_value_array)->PushBack((yyvsp[0].var_or_value));
1754#line 1873 "./ortools/flatzinc/parser.tab.cc"
1758#line 368 "./ortools/flatzinc/parser.yy"
1760 (yyval.var_or_value) =
1763#line 1879 "./ortools/flatzinc/parser.tab.cc"
1767#line 369 "./ortools/flatzinc/parser.yy"
1770 const std::string&
id = (yyvsp[0].string_value);
1772 (yyval.var_or_value) =
1775 (yyval.var_or_value) = VariableRefOrValue::VariableRef(
1778 LOG(
ERROR) <<
"Unknown symbol " << id;
1779 (yyval.var_or_value) = VariableRefOrValue::Undefined();
1783#line 1897 "./ortools/flatzinc/parser.tab.cc"
1787#line 382 "./ortools/flatzinc/parser.yy"
1790 const std::string&
id = (yyvsp[-3].string_value);
1791 const int64 value = (yyvsp[-1].integer_value);
1796 (yyval.var_or_value) = VariableRefOrValue::VariableRef(
1799 LOG(
ERROR) <<
"Unknown symbol " << id;
1800 (yyval.var_or_value) = VariableRefOrValue::Undefined();
1804#line 1918 "./ortools/flatzinc/parser.tab.cc"
1808#line 400 "./ortools/flatzinc/parser.yy"
1810 (yyval.domain) = Domain::Boolean();
1812#line 1924 "./ortools/flatzinc/parser.tab.cc"
1816#line 401 "./ortools/flatzinc/parser.yy"
1818 (yyval.domain) = Domain::AllInt64();
1820#line 1930 "./ortools/flatzinc/parser.tab.cc"
1824#line 402 "./ortools/flatzinc/parser.yy"
1827 Domain::Interval((yyvsp[-2].integer_value), (yyvsp[0].integer_value));
1829#line 1936 "./ortools/flatzinc/parser.tab.cc"
1833#line 403 "./ortools/flatzinc/parser.yy"
1835 CHECK((yyvsp[-1].integers) !=
nullptr);
1836 (yyval.domain) = Domain::IntegerList(std::move(*(yyvsp[-1].integers)));
1837 delete (yyvsp[-1].integers);
1839#line 1946 "./ortools/flatzinc/parser.tab.cc"
1843#line 410 "./ortools/flatzinc/parser.yy"
1845 (yyval.domain) = Domain::SetOfBoolean();
1847#line 1952 "./ortools/flatzinc/parser.tab.cc"
1851#line 411 "./ortools/flatzinc/parser.yy"
1853 (yyval.domain) = Domain::SetOfAllInt64();
1855#line 1958 "./ortools/flatzinc/parser.tab.cc"
1859#line 412 "./ortools/flatzinc/parser.yy"
1861 (yyval.domain) = Domain::SetOfInterval((yyvsp[-2].integer_value),
1862 (yyvsp[0].integer_value));
1864#line 1964 "./ortools/flatzinc/parser.tab.cc"
1868#line 413 "./ortools/flatzinc/parser.yy"
1870 CHECK((yyvsp[-1].integers) !=
nullptr);
1872 Domain::SetOfIntegerList(std::move(*(yyvsp[-1].integers)));
1873 delete (yyvsp[-1].integers);
1875#line 1974 "./ortools/flatzinc/parser.tab.cc"
1879#line 420 "./ortools/flatzinc/parser.yy"
1881 (yyval.domain) = Domain::AllInt64();
1883#line 1980 "./ortools/flatzinc/parser.tab.cc"
1887#line 421 "./ortools/flatzinc/parser.yy"
1891 (yyval.domain) = Domain::Interval(lb, ub);
1893#line 1990 "./ortools/flatzinc/parser.tab.cc"
1897#line 428 "./ortools/flatzinc/parser.yy"
1899 (yyval.domain) = (yyvsp[0].domain);
1901#line 1996 "./ortools/flatzinc/parser.tab.cc"
1905#line 429 "./ortools/flatzinc/parser.yy"
1907 (yyval.domain) = (yyvsp[0].domain);
1909#line 2002 "./ortools/flatzinc/parser.tab.cc"
1913#line 430 "./ortools/flatzinc/parser.yy"
1915 (yyval.domain) = (yyvsp[0].domain);
1917#line 2008 "./ortools/flatzinc/parser.tab.cc"
1921#line 433 "./ortools/flatzinc/parser.yy"
1923 (yyval.integers) = (yyvsp[-2].integers);
1924 (yyval.integers)->emplace_back((yyvsp[0].integer_value));
1926#line 2014 "./ortools/flatzinc/parser.tab.cc"
1930#line 434 "./ortools/flatzinc/parser.yy"
1932 (yyval.integers) =
new std::vector<int64>();
1933 (yyval.integers)->emplace_back((yyvsp[0].integer_value));
1935#line 2020 "./ortools/flatzinc/parser.tab.cc"
1939#line 437 "./ortools/flatzinc/parser.yy"
1941 (yyval.integer_value) = (yyvsp[0].integer_value);
1943#line 2026 "./ortools/flatzinc/parser.tab.cc"
1947#line 438 "./ortools/flatzinc/parser.yy"
1949 (yyval.integer_value) =
1952#line 2032 "./ortools/flatzinc/parser.tab.cc"
1956#line 439 "./ortools/flatzinc/parser.yy"
1958 (yyval.integer_value) =
Lookup(
1960 (yyvsp[-1].integer_value));
1962#line 2040 "./ortools/flatzinc/parser.tab.cc"
1966#line 444 "./ortools/flatzinc/parser.yy"
1968 (yyval.doubles) = (yyvsp[-2].doubles);
1969 (yyval.doubles)->emplace_back((yyvsp[0].double_value));
1971#line 2046 "./ortools/flatzinc/parser.tab.cc"
1975#line 445 "./ortools/flatzinc/parser.yy"
1977 (yyval.doubles) =
new std::vector<double>();
1978 (yyval.doubles)->emplace_back((yyvsp[0].double_value));
1980#line 2052 "./ortools/flatzinc/parser.tab.cc"
1984#line 448 "./ortools/flatzinc/parser.yy"
1986 (yyval.double_value) = (yyvsp[0].double_value);
1988#line 2058 "./ortools/flatzinc/parser.tab.cc"
1992#line 449 "./ortools/flatzinc/parser.yy"
1994 (yyval.double_value) =
1997#line 2064 "./ortools/flatzinc/parser.tab.cc"
2001#line 450 "./ortools/flatzinc/parser.yy"
2003 (yyval.double_value) =
Lookup(
2005 (yyvsp[-1].integer_value));
2007#line 2072 "./ortools/flatzinc/parser.tab.cc"
2011#line 455 "./ortools/flatzinc/parser.yy"
2013 (yyval.domain) = Domain::IntegerValue((yyvsp[0].integer_value));
2015#line 2078 "./ortools/flatzinc/parser.tab.cc"
2019#line 456 "./ortools/flatzinc/parser.yy"
2022 Domain::Interval((yyvsp[-2].integer_value), (yyvsp[0].integer_value));
2024#line 2084 "./ortools/flatzinc/parser.tab.cc"
2028#line 457 "./ortools/flatzinc/parser.yy"
2030 CHECK((yyvsp[-1].integers) !=
nullptr);
2031 (yyval.domain) = Domain::IntegerList(std::move(*(yyvsp[-1].integers)));
2032 delete (yyvsp[-1].integers);
2034#line 2094 "./ortools/flatzinc/parser.tab.cc"
2038#line 462 "./ortools/flatzinc/parser.yy"
2040 (yyval.domain) = Domain::EmptyDomain();
2042#line 2100 "./ortools/flatzinc/parser.tab.cc"
2046#line 463 "./ortools/flatzinc/parser.yy"
2048 CHECK_EQ(std::round((yyvsp[0].double_value)), (yyvsp[0].double_value));
2050 Domain::IntegerValue(
static_cast<int64>((yyvsp[0].double_value)));
2052#line 2109 "./ortools/flatzinc/parser.tab.cc"
2056#line 467 "./ortools/flatzinc/parser.yy"
2058 (yyval.domain) = Domain::IntegerValue(
2061#line 2115 "./ortools/flatzinc/parser.tab.cc"
2065#line 468 "./ortools/flatzinc/parser.yy"
2067 (yyval.domain) = Domain::IntegerValue(
Lookup(
2069 (yyvsp[-1].integer_value)));
2071#line 2124 "./ortools/flatzinc/parser.tab.cc"
2075#line 474 "./ortools/flatzinc/parser.yy"
2077 (yyval.domains) = (yyvsp[-2].domains);
2078 (yyval.domains)->emplace_back((yyvsp[0].domain));
2080#line 2133 "./ortools/flatzinc/parser.tab.cc"
2084#line 478 "./ortools/flatzinc/parser.yy"
2086 (yyval.domains) =
new std::vector<Domain>();
2087 (yyval.domains)->emplace_back((yyvsp[0].domain));
2089#line 2139 "./ortools/flatzinc/parser.tab.cc"
2094#line 488 "./ortools/flatzinc/parser.yy"
2096 const std::string& identifier = (yyvsp[-4].string_value);
2097 CHECK((yyvsp[-2].args) !=
nullptr) <<
"Missing argument in constraint";
2098 const std::vector<Argument>& arguments = *(yyvsp[-2].args);
2099 std::vector<Annotation>*
const annotations = (yyvsp[0].annotations);
2101 model->AddConstraint(identifier, arguments,
2104 delete (yyvsp[-2].args);
2106#line 2154 "./ortools/flatzinc/parser.tab.cc"
2110#line 500 "./ortools/flatzinc/parser.yy"
2112 (yyval.args) = (yyvsp[-2].args);
2113 (yyval.args)->emplace_back((yyvsp[0].arg));
2115#line 2160 "./ortools/flatzinc/parser.tab.cc"
2119#line 501 "./ortools/flatzinc/parser.yy"
2121 (yyval.args) =
new std::vector<Argument>();
2122 (yyval.args)->emplace_back((yyvsp[0].arg));
2124#line 2166 "./ortools/flatzinc/parser.tab.cc"
2128#line 504 "./ortools/flatzinc/parser.yy"
2130 (yyval.arg) = Argument::IntegerValue((yyvsp[0].integer_value));
2132#line 2172 "./ortools/flatzinc/parser.tab.cc"
2136#line 505 "./ortools/flatzinc/parser.yy"
2138 (yyval.arg) = Argument::IntegerValue(
2141#line 2178 "./ortools/flatzinc/parser.tab.cc"
2145#line 506 "./ortools/flatzinc/parser.yy"
2147 (yyval.arg) = Argument::VoidArgument();
2149#line 2184 "./ortools/flatzinc/parser.tab.cc"
2153#line 507 "./ortools/flatzinc/parser.yy"
2155 (yyval.arg) = Argument::Interval((yyvsp[-2].integer_value),
2156 (yyvsp[0].integer_value));
2158#line 2190 "./ortools/flatzinc/parser.tab.cc"
2162#line 508 "./ortools/flatzinc/parser.yy"
2164 CHECK((yyvsp[-1].integers) !=
nullptr);
2165 (yyval.arg) = Argument::IntegerList(std::move(*(yyvsp[-1].integers)));
2166 delete (yyvsp[-1].integers);
2168#line 2200 "./ortools/flatzinc/parser.tab.cc"
2172#line 513 "./ortools/flatzinc/parser.yy"
2174 const std::string&
id = (yyvsp[0].string_value);
2179 (yyval.arg) = Argument::IntegerList(
2185 const auto& double_values =
2187 std::vector<int64> integer_values;
2188 for (
const double d : double_values) {
2190 integer_values.push_back(i);
2192 (yyval.arg) = Argument::IntegerList(std::move(integer_values));
2197 (yyval.arg) = Argument::IntVarRefArray(
2201 (yyval.arg) = Argument::FromDomain(d);
2204 <<
"Unknown identifier: " << id;
2205 const std::vector<Domain>& d =
2207 (yyval.arg) = Argument::DomainList(d);
2210#line 2236 "./ortools/flatzinc/parser.tab.cc"
2214#line 544 "./ortools/flatzinc/parser.yy"
2216 const std::string&
id = (yyvsp[-3].string_value);
2217 const int64 index = (yyvsp[-1].integer_value);
2219 (yyval.arg) = Argument::IntegerValue(
2222 (yyval.arg) = Argument::IntVarRef(
2226 <<
"Unknown identifier: " << id;
2229 (yyval.arg) = Argument::FromDomain(d);
2232#line 2258 "./ortools/flatzinc/parser.tab.cc"
2236#line 561 "./ortools/flatzinc/parser.yy"
2239 CHECK(arguments !=
nullptr);
2240 bool has_variables =
false;
2241 for (
int i = 0; i < arguments->
Size(); ++i) {
2242 if (arguments->
variables[i] !=
nullptr) {
2243 has_variables =
true;
2247 if (has_variables) {
2248 (yyval.arg) = Argument::IntVarRefArray(std::vector<IntegerVariable*>());
2249 (yyval.arg).variables.reserve(arguments->
Size());
2250 for (
int i = 0; i < arguments->
Size(); ++i) {
2251 if (arguments->
variables[i] !=
nullptr) {
2252 (yyval.arg).variables.emplace_back(arguments->
variables[i]);
2254 (yyval.arg).variables.emplace_back(
2259 (yyval.arg) = Argument::IntegerList(arguments->
values);
2263#line 2288 "./ortools/flatzinc/parser.tab.cc"
2267#line 586 "./ortools/flatzinc/parser.yy"
2269 (yyval.arg) = Argument::VoidArgument();
2271#line 2296 "./ortools/flatzinc/parser.tab.cc"
2275#line 595 "./ortools/flatzinc/parser.yy"
2277 (yyval.annotations) = (yyvsp[-2].annotations) !=
nullptr
2278 ? (yyvsp[-2].annotations)
2279 :
new std::vector<Annotation>();
2280 (yyval.annotations)->emplace_back((yyvsp[0].annotation));
2282#line 2305 "./ortools/flatzinc/parser.tab.cc"
2286#line 599 "./ortools/flatzinc/parser.yy"
2288 (yyval.annotations) =
nullptr;
2290#line 2311 "./ortools/flatzinc/parser.tab.cc"
2294#line 602 "./ortools/flatzinc/parser.yy"
2296 (yyval.annotations) = (yyvsp[-2].annotations);
2297 (yyval.annotations)->emplace_back((yyvsp[0].annotation));
2299#line 2317 "./ortools/flatzinc/parser.tab.cc"
2303#line 603 "./ortools/flatzinc/parser.yy"
2305 (yyval.annotations) =
new std::vector<Annotation>();
2306 (yyval.annotations)->emplace_back((yyvsp[0].annotation));
2308#line 2323 "./ortools/flatzinc/parser.tab.cc"
2312#line 606 "./ortools/flatzinc/parser.yy"
2314 (yyval.annotation) = Annotation::Interval((yyvsp[-2].integer_value),
2315 (yyvsp[0].integer_value));
2317#line 2329 "./ortools/flatzinc/parser.tab.cc"
2321#line 607 "./ortools/flatzinc/parser.yy"
2323 (yyval.annotation) = Annotation::IntegerValue((yyvsp[0].integer_value));
2325#line 2335 "./ortools/flatzinc/parser.tab.cc"
2329#line 608 "./ortools/flatzinc/parser.yy"
2331 (yyval.annotation) = Annotation::String((yyvsp[0].string_value));
2333#line 2341 "./ortools/flatzinc/parser.tab.cc"
2337#line 609 "./ortools/flatzinc/parser.yy"
2339 const std::string&
id = (yyvsp[0].string_value);
2341 (yyval.annotation) =
2344 (yyval.annotation) = Annotation::VariableList(
2347 (yyval.annotation) = Annotation::Identifier(
id);
2350#line 2356 "./ortools/flatzinc/parser.tab.cc"
2354#line 619 "./ortools/flatzinc/parser.yy"
2356 std::vector<Annotation>*
const annotations = (yyvsp[-1].annotations);
2357 if (annotations !=
nullptr) {
2358 (yyval.annotation) = Annotation::FunctionCallWithArguments(
2359 (yyvsp[-3].string_value), std::move(*annotations));
2362 (yyval.annotation) = Annotation::FunctionCall((yyvsp[-3].string_value));
2365#line 2370 "./ortools/flatzinc/parser.tab.cc"
2369#line 628 "./ortools/flatzinc/parser.yy"
2372 (yyvsp[-3].string_value)))
2373 <<
"Unknown identifier: " << (yyvsp[-3].string_value);
2374 (yyval.annotation) = Annotation::Variable(
Lookup(
2376 (yyvsp[-1].integer_value)));
2378#line 2381 "./ortools/flatzinc/parser.tab.cc"
2382#line 634 "./ortools/flatzinc/parser.yy"
2384 std::vector<Annotation>*
const annotations = (yyvsp[-1].annotations);
2385 if (annotations !=
nullptr) {
2386 (yyval.annotation) =
2387 Annotation::AnnotationList(std::move(*annotations));
2390 (yyval.annotation) = Annotation::Empty();
2393#line 2395 "./ortools/flatzinc/parser.tab.cc"
2397#line 649 "./ortools/flatzinc/parser.yy"
2399 if ((yyvsp[-1].annotations) !=
nullptr) {
2400 model->Satisfy(std::move(*(yyvsp[-1].annotations)));
2401 delete (yyvsp[-1].annotations);
2403 model->Satisfy(std::vector<Annotation>());
2406#line 2408 "./ortools/flatzinc/parser.tab.cc"
2410#line 657 "./ortools/flatzinc/parser.yy"
2413 (yyvsp[0].arg).type == Argument::INT_VAR_REF
2414 ? (yyvsp[0].arg).Var()
2415 :
model->AddConstant((yyvsp[0].arg).Value());
2416 if ((yyvsp[-2].annotations) !=
nullptr) {
2417 model->Minimize(obj_var, std::move(*(yyvsp[-2].annotations)));
2418 delete (yyvsp[-2].annotations);
2420 model->Minimize(obj_var, std::vector<Annotation>());
2423#line 2424 "./ortools/flatzinc/parser.tab.cc"
2427#line 668 "./ortools/flatzinc/parser.yy"
2430 (yyvsp[0].arg).type == Argument::INT_VAR_REF
2431 ? (yyvsp[0].arg).Var()
2432 :
model->AddConstant((yyvsp[0].arg).Value());
2433 if ((yyvsp[-2].annotations) !=
nullptr) {
2434 model->Maximize(obj_var, std::move(*(yyvsp[-2].annotations)));
2435 delete (yyvsp[-2].annotations);
2437 model->Maximize(obj_var, std::vector<Annotation>());
2440#line 2440 "./ortools/flatzinc/parser.tab.cc"
2443#line 2444 "./ortools/flatzinc/parser.tab.cc"
2472 const int yyi =
yypgoto[yylhs] + *yyssp;
2473 yystate = (0 <= yyi && yyi <=
YYLAST &&
yycheck[yyi] == *yyssp
2492 char const* yymsgp =
YY_(
"syntax error");
2493 int yysyntax_error_status;
2494 yysyntax_error_status =
yysyntax_error(&yymsg_alloc, &yymsg, &yyctx);
2495 if (yysyntax_error_status == 0)
2497 else if (yysyntax_error_status == -1) {
2501 yysyntax_error_status =
yysyntax_error(&yymsg_alloc, &yymsg, &yyctx);
2505 yymsg_alloc =
sizeof yymsgbuf;
2510 if (yysyntax_error_status ==
YYENOMEM)
goto yyexhaustedlab;
2514 if (yyerrstatus == 3) {
2518 if (yychar <= ORFZ_EOF) {
2520 if (yychar == ORFZ_EOF)
YYABORT;
2524 yychar = ORFZ_EMPTY;
2569 model, ok, scanner);
2613 if (yychar != ORFZ_EMPTY) {
2618 model, ok, scanner);
2624 while (yyssp != yyss) {
2626 model, ok, scanner);
2636#line 680 "./ortools/flatzinc/parser.yy"
#define CHECK_EQ(val1, val2)
SharedBoundsManager * bounds
GurobiMPCallbackContext * context
const Collection::value_type::second_type & FindOrDie(const Collection &collection, const typename Collection::value_type::first_type &key)
bool ContainsKey(const Collection &collection, const Key &key)
int64 ConvertAsIntegerOrDie(double d)
bool ContainsId(std::vector< Annotation > *annotations, const std::string &id)
const T & Lookup(const std::vector< T > &v, int index)
bool AllDomainsHaveOneValue(const std::vector< Domain > &domains)
std::function< int64(const Model &)> Value(IntegerVariable v)
static const char * yysymbol_name(yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED
static YYPTRDIFF_T yystrlen(const char *yystr)
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
static void yydestruct(const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep, operations_research::fz::ParserContext *context, operations_research::fz::Model *model, bool *ok, void *scanner)
static const yytype_int8 yytranslate[]
@ YYSYMBOL_const_literals
@ YYSYMBOL_optional_var_or_value_array
@ YYSYMBOL_var_or_value_array
@ YYSYMBOL_variable_or_constant_declarations
@ YYSYMBOL_predicate_arguments
@ YYSYMBOL_variable_or_constant_declaration
@ YYSYMBOL_optional_var_or_value
@ YYSYMBOL_predicate_array_argument
@ YYSYMBOL_annotation_arguments
@ YYSYMBOL_predicate_argument
@ YYSYMBOL_predicate_ints
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
static const yytype_int8 yydefact[]
#define YY_IGNORE_USELESS_CAST_END
static const yytype_int16 yyrline[]
#define YY_REDUCE_PRINT(Rule)
#define YY_CAST(Type, Val)
static const yytype_int16 yypact[]
static const yytype_uint8 yydefgoto[]
static void yy_symbol_print(FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const *const yyvaluep, operations_research::fz::ParserContext *context, operations_research::fz::Model *model, bool *ok, void *scanner)
#define YY_ACCESSING_SYMBOL(State)
Accessing symbol of state STATE.
#define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
static const yytype_int16 yypgoto[]
#define YY_INITIAL_VALUE(Value)
static void yy_symbol_value_print(FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const *const yyvaluep, operations_research::fz::ParserContext *context, operations_research::fz::Model *model, bool *ok, void *scanner)
static YYPTRDIFF_T yytnamerr(char *yyres, const char *yystr)
unsigned char yytype_uint8
#define YY_STACK_PRINT(Bottom, Top)
#define YYSTACK_ALLOC_MAXIMUM
#define YY_IGNORE_USELESS_CAST_BEGIN
static const yytype_int8 yyr2[]
static const yytype_int16 yytable[]
#define yytable_value_is_error(Yyn)
static const yytype_int8 yystos[]
#define YY_ATTRIBUTE_UNUSED
static const char *const yytname[]
static int yypcontext_expected_tokens(const yypcontext_t *yyctx, yysymbol_kind_t yyarg[], int yyargn)
static const yytype_int8 yyr1[]
static char * yystpcpy(char *yydest, const char *yysrc)
unsigned short yytype_uint16
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
#define yypact_value_is_default(Yyn)
static int yy_syntax_error_arguments(const yypcontext_t *yyctx, yysymbol_kind_t yyarg[], int yyargn)
static void yy_reduce_print(yy_state_t *yyssp, YYSTYPE *yyvsp, int yyrule, operations_research::fz::ParserContext *context, operations_research::fz::Model *model, bool *ok, void *scanner)
static void yy_stack_print(yy_state_t *yybottom, yy_state_t *yytop)
static const yytype_int16 yycheck[]
static int yysyntax_error(YYPTRDIFF_T *yymsg_alloc, char **yymsg, const yypcontext_t *yyctx)
bool IsFunctionCallWithIdentifier(const std::string &identifier) const
std::vector< Annotation > annotations
bool Contains(int64 value) const
std::vector< int64 > values
std::vector< IntegerVariable * > variables
std::vector< int64 > values
IntegerVariable * variable