65 #define YYBISON_VERSION "3.7.2"
68 #define YYSKELETON_NAME "yacc.c"
80 #define YYSTYPE ORFZ_STYPE
82 #define yyparse orfz_parse
83 #define yylex orfz_lex
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
241 #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
243 #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H && \
244 UINT_LEAST8_MAX <= INT_MAX)
246 #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
252 #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
254 #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H && \
255 UINT_LEAST16_MAX <= INT_MAX)
257 #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
264 #if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
265 #define YYPTRDIFF_T __PTRDIFF_TYPE__
266 #define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
267 #elif defined PTRDIFF_MAX
271 #define YYPTRDIFF_T ptrdiff_t
272 #define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
274 #define YYPTRDIFF_T long
275 #define YYPTRDIFF_MAXIMUM LONG_MAX
281 #define YYSIZE_T __SIZE_TYPE__
283 #define YYSIZE_T size_t
284 #elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
286 #define YYSIZE_T size_t
288 #define YYSIZE_T unsigned
292 #define YYSIZE_MAXIMUM \
293 YY_CAST(YYPTRDIFF_T, \
294 (YYPTRDIFF_MAXIMUM < YY_CAST(YYSIZE_T, -1) ? YYPTRDIFF_MAXIMUM \
295 : YY_CAST(YYSIZE_T, -1)))
297 #define YYSIZEOF(X) YY_CAST(YYPTRDIFF_T, sizeof(X))
306 #if defined YYENABLE_NLS && YYENABLE_NLS
309 #define YY_(Msgid) dgettext("bison-runtime", Msgid)
313 #define YY_(Msgid) Msgid
317 #ifndef YY_ATTRIBUTE_PURE
318 #if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
319 #define YY_ATTRIBUTE_PURE __attribute__((__pure__))
321 #define YY_ATTRIBUTE_PURE
325 #ifndef YY_ATTRIBUTE_UNUSED
326 #if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
327 #define YY_ATTRIBUTE_UNUSED __attribute__((__unused__))
329 #define YY_ATTRIBUTE_UNUSED
334 #if !defined lint || defined __GNUC__
335 #define YYUSE(E) ((void)(E))
340 #if defined __GNUC__ && !defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
342 #define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
343 _Pragma("GCC diagnostic push") \
344 _Pragma("GCC diagnostic ignored \"-Wuninitialized\"") \
345 _Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
346 #define YY_IGNORE_MAYBE_UNINITIALIZED_END _Pragma("GCC diagnostic pop")
348 #define YY_INITIAL_VALUE(Value) Value
350 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
351 #define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
352 #define YY_IGNORE_MAYBE_UNINITIALIZED_END
354 #ifndef YY_INITIAL_VALUE
355 #define YY_INITIAL_VALUE(Value)
358 #if defined __cplusplus && defined __GNUC__ && !defined __ICC && 6 <= __GNUC__
359 #define YY_IGNORE_USELESS_CAST_BEGIN \
360 _Pragma("GCC diagnostic push") \
361 _Pragma("GCC diagnostic ignored \"-Wuseless-cast\"")
362 #define YY_IGNORE_USELESS_CAST_END _Pragma("GCC diagnostic pop")
364 #ifndef YY_IGNORE_USELESS_CAST_BEGIN
365 #define YY_IGNORE_USELESS_CAST_BEGIN
366 #define YY_IGNORE_USELESS_CAST_END
369 #define YY_ASSERT(E) ((void)(0 && (E)))
375 #ifdef YYSTACK_USE_ALLOCA
376 #if YYSTACK_USE_ALLOCA
378 #define YYSTACK_ALLOC __builtin_alloca
379 #elif defined __BUILTIN_VA_ARG_INCR
382 #define YYSTACK_ALLOC __alloca
383 #elif defined _MSC_VER
385 #define alloca _alloca
387 #define YYSTACK_ALLOC alloca
388 #if !defined _ALLOCA_H && !defined EXIT_SUCCESS
392 #define EXIT_SUCCESS 0
401 #define YYSTACK_FREE(Ptr) \
405 #ifndef YYSTACK_ALLOC_MAXIMUM
410 #define YYSTACK_ALLOC_MAXIMUM 4032
413 #define YYSTACK_ALLOC YYMALLOC
414 #define YYSTACK_FREE YYFREE
415 #ifndef YYSTACK_ALLOC_MAXIMUM
416 #define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
418 #if (defined __cplusplus && !defined EXIT_SUCCESS && \
419 !((defined YYMALLOC || defined malloc) && \
420 (defined YYFREE || defined free)))
423 #define EXIT_SUCCESS 0
427 #define YYMALLOC malloc
428 #if !defined malloc && !defined EXIT_SUCCESS
434 #if !defined free && !defined EXIT_SUCCESS
441 #if (!defined yyoverflow && \
442 (!defined __cplusplus || \
443 (defined ORFZ_STYPE_IS_TRIVIAL && ORFZ_STYPE_IS_TRIVIAL)))
452 #define YYSTACK_GAP_MAXIMUM (YYSIZEOF(union yyalloc) - 1)
456 #define YYSTACK_BYTES(N) \
457 ((N) * (YYSIZEOF(yy_state_t) + YYSIZEOF(YYSTYPE)) + YYSTACK_GAP_MAXIMUM)
459 #define YYCOPY_NEEDED 1
466 #define YYSTACK_RELOCATE(Stack_alloc, Stack) \
468 YYPTRDIFF_T yynewbytes; \
469 YYCOPY(&yyptr->Stack_alloc, Stack, yysize); \
470 Stack = &yyptr->Stack_alloc; \
471 yynewbytes = yystacksize * YYSIZEOF(*Stack) + YYSTACK_GAP_MAXIMUM; \
472 yyptr += yynewbytes / YYSIZEOF(*yyptr); \
477 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
481 #if defined __GNUC__ && 1 < __GNUC__
482 #define YYCOPY(Dst, Src, Count) \
483 __builtin_memcpy(Dst, Src, YY_CAST(YYSIZE_T, (Count)) * sizeof(*(Src)))
485 #define YYCOPY(Dst, Src, Count) \
488 for (yyi = 0; yyi < (Count); yyi++) (Dst)[yyi] = (Src)[yyi]; \
506 #define YYNSTATES 223
509 #define YYMAXUTOK 276
513 #define YYTRANSLATE(YYX) \
514 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
515 ? YY_CAST(yysymbol_kind_t, yytranslate[YYX]) \
521 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
522 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
523 23, 24, 2, 2, 25, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 26, 22,
524 2, 29, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
525 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 27, 2, 28, 2, 2, 2, 2, 2, 2,
526 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
527 2, 2, 2, 30, 2, 31, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
528 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
529 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
530 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
531 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
532 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
533 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
534 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21};
539 0, 103, 103, 110, 114, 115, 120, 123, 124, 127, 128, 129, 130, 133,
540 134, 137, 138, 145, 146, 149, 168, 183, 194, 209, 220, 246, 279, 349,
541 350, 353, 354, 355, 358, 362, 368, 369, 382, 400, 401, 402, 403, 410,
542 411, 412, 413, 420, 421, 428, 429, 430, 433, 434, 437, 438, 439, 444,
543 445, 448, 449, 450, 455, 456, 457, 462, 463, 467, 468, 474, 478, 484,
544 485, 488, 500, 501, 504, 505, 506, 507, 508, 513, 544, 561, 586, 595,
545 599, 602, 603, 606, 607, 608, 609, 619, 628, 634, 649, 657, 666};
549 #define YY_ACCESSING_SYMBOL(State) YY_CAST(yysymbol_kind_t, yystos[State])
558 static const char*
const yytname[] = {
"\"end of file\"",
594 "predicate_arguments",
595 "predicate_argument",
596 "predicate_array_argument",
598 "variable_or_constant_declarations",
599 "variable_or_constant_declaration",
600 "optional_var_or_value",
601 "optional_var_or_value_array",
602 "var_or_value_array",
619 "annotation_arguments",
632 static const yytype_int16 yytoknum[] = {0, 256, 257, 258, 259, 260, 261, 262,
633 263, 264, 265, 266, 267, 268, 269, 270,
634 271, 272, 273, 274, 275, 276, 59, 40,
635 41, 44, 58, 91, 93, 61, 123, 125};
638 #define YYPACT_NINF (-182)
640 #define yypact_value_is_default(Yyn) ((Yyn) == YYPACT_NINF)
642 #define YYTABLE_NINF (-19)
644 #define yytable_value_is_error(Yyn) 0
649 -182, 49, 7, -182, -15, 67, 114, 20, -182, 95, -182, 99,
650 -182, -182, -182, 136, 76, 122, 141, 11, 154, -182, -182, -182,
651 143, 130, 40, 157, 12, 151, 160, 158, -182, 155, 118, -182,
652 -182, 161, 163, -182, 162, 164, 165, 76, 156, 166, 159, 171,
653 -182, -182, 172, 11, 169, -182, -182, 175, 11, -182, -182, 167,
654 125, -182, -182, 27, 168, -182, 40, 176, 177, 179, 120, -182,
655 170, -182, 22, 80, 80, 80, -182, 121, 174, 184, 173, -182,
656 182, -182, -182, 178, -182, -182, 59, -182, 75, 187, -182, 180,
657 -182, 93, 11, 131, -182, -182, -182, 188, -182, 96, 121, -182,
658 198, 190, 199, -182, 200, 150, -182, 195, 185, -182, 34, -182,
659 196, 197, -182, 186, -182, 31, -182, 128, -182, 80, 201, 121,
660 202, 84, -182, -182, -182, 56, 60, -182, 203, 204, -182, 129,
661 -182, 189, 205, 150, -182, -182, 207, -182, -182, 147, 206, 121,
662 -182, 76, 192, 76, 209, 210, 211, -182, 212, -182, -182, 213,
663 -182, -182, -182, -182, 216, 208, 217, 218, 219, 224, -182, -182,
664 225, -182, 226, -182, -182, -182, -182, -182, 74, 85, 87, 91,
665 220, 221, 222, 223, -182, 97, 75, 64, 104, -182, 133, -182,
666 137, 227, -182, -182, 138, -182, -182, 139, -182, 75, -182, 214,
667 153, -182, -182, -182, 228, -182, -182};
673 5, 0, 0, 1, 0, 0, 0, 70, 4, 0, 3, 0, 37, 45, 38, 0, 0, 0, 0,
674 0, 0, 47, 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, 52, 53, 0, 51, 17, 0,
675 0, 84, 0, 0, 0, 0, 0, 8, 0, 0, 41, 42, 0, 0, 0, 39, 46, 0, 0,
676 40, 84, 0, 0, 69, 2, 0, 0, 6, 0, 0, 0, 0, 0, 84, 0, 50, 0, 0,
677 0, 0, 94, 0, 16, 0, 0, 13, 0, 7, 9, 0, 43, 44, 28, 54, 0, 74, 76,
678 79, 75, 0, 0, 0, 73, 96, 95, 88, 89, 90, 0, 83, 0, 0, 0, 10, 0, 0,
679 25, 60, 65, 64, 0, 19, 0, 0, 34, 35, 82, 0, 33, 0, 84, 0, 0, 0, 0,
680 0, 86, 15, 14, 0, 0, 27, 0, 0, 63, 0, 77, 0, 0, 0, 81, 78, 71, 72,
681 87, 0, 0, 0, 93, 0, 0, 0, 0, 0, 0, 61, 0, 62, 80, 0, 32, 91, 92,
682 85, 0, 0, 0, 0, 0, 0, 66, 36, 0, 11, 0, 84, 84, 84, 12, 84, 0, 0,
683 0, 31, 0, 0, 0, 0, 26, 0, 0, 0, 0, 21, 0, 68, 0, 58, 57, 23, 0,
684 56, 30, 0, 20, 0, 24, 0, 0, 22, 29, 67, 0, 55, 59};
688 -182, -182, -182, -182, 191, -182, -182, 108, -182, -182, -182,
689 -182, 25, -107, 88, 89, 92, -7, -50, 215, -182, 13,
690 -181, -182, -182, -182, -182, -72, -56, 100, -76, -182};
694 -1, 1, 2, 6, 44, 45, 82, 83, 7, 20, 114, 196, 125, 126, 21, 22,
695 23, 46, 34, 35, 208, 209, 119, 204, 25, 40, 99, 100, 60, 133, 134, 41};
701 24, 70, 74, 107, 101, 102, 139, 8, 4, 29, -18, -18, -18, -18, -18,
702 90, 48, 203, 5, 49, -18, -18, -18, 11, 12, -18, 13, 14, -18, 32,
703 50, 33, 219, 15, 80, 16, 64, -18, 17, 79, 168, 18, 51, 42, 12,
704 81, 13, 14, 127, 3, 19, 92, 32, 15, 33, 43, 147, 151, 17, 148,
705 12, 18, 13, 14, 12, 142, 13, 14, 143, 15, 19, 157, 150, 15, 17,
706 159, 79, 18, 17, 171, 12, 18, 13, 14, 205, 206, 19, 9, 113, 15,
707 19, 79, 207, 115, 17, 116, 117, 18, 93, 94, 95, 96, 79, 192, 79,
708 118, 19, 97, 79, 155, 98, 122, 156, 123, 193, 32, 194, 33, 26, 131,
709 195, 124, 122, 132, 123, 201, 27, 188, 189, 190, 158, 191, 210, 76, 77,
710 38, 10, 78, 30, 103, 104, 105, 79, 56, 39, 56, 28, 202, 106, 57,
711 172, 89, 174, 56, 56, 128, 129, 31, 56, 149, 165, 212, 213, 216, 147,
712 214, 217, 218, 122, 37, 123, 169, 155, 205, 206, 47, 36, 52, 53, 54,
713 65, 58, 55, 59, 61, 67, 62, 68, 69, 71, 75, 66, 63, 72, 84,
714 87, 86, 88, 91, 108, 109, 110, 111, 120, 130, 80, 112, 121, 136, 137,
715 138, 140, 141, 146, 144, 145, 135, 166, 173, 152, 154, 163, 164, 167, 79,
716 211, 160, 161, 181, 221, 162, 153, 220, 0, 170, 175, 176, 177, 183, 184,
717 178, 179, 180, 182, 185, 186, 187, 197, 198, 199, 200, 0, 0, 0, 215,
718 0, 222, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
722 7, 51, 58, 79, 76, 77, 113, 22, 1, 16, 3, 4, 5, 6, 7, 71,
723 4, 198, 11, 7, 13, 14, 15, 3, 4, 18, 6, 7, 21, 18, 18, 20,
724 213, 13, 7, 15, 43, 30, 18, 17, 147, 21, 30, 3, 4, 18, 6, 7,
725 98, 0, 30, 29, 18, 13, 20, 15, 25, 129, 18, 28, 4, 21, 6, 7,
726 4, 31, 6, 7, 118, 13, 30, 15, 128, 13, 18, 15, 17, 21, 18, 155,
727 4, 21, 6, 7, 20, 21, 30, 20, 29, 13, 30, 17, 28, 18, 18, 20,
728 21, 21, 18, 19, 20, 21, 17, 29, 17, 30, 30, 27, 17, 25, 30, 18,
729 28, 20, 29, 18, 29, 20, 23, 23, 29, 28, 18, 27, 20, 28, 27, 183,
730 184, 185, 137, 187, 28, 8, 9, 5, 22, 12, 16, 18, 19, 20, 17, 25,
731 14, 25, 10, 197, 27, 31, 157, 31, 159, 25, 25, 24, 25, 16, 25, 31,
732 31, 28, 25, 25, 25, 28, 28, 28, 18, 26, 20, 24, 25, 20, 21, 18,
733 22, 26, 18, 21, 24, 20, 27, 20, 22, 26, 22, 16, 16, 20, 23, 25,
734 27, 18, 26, 18, 20, 18, 28, 25, 16, 28, 20, 16, 16, 7, 28, 27,
735 18, 10, 10, 16, 27, 27, 18, 18, 108, 28, 26, 18, 18, 18, 18, 18,
736 17, 200, 138, 138, 20, 216, 138, 131, 18, -1, 28, 26, 26, 26, 20, 20,
737 28, 28, 26, 26, 20, 20, 20, 27, 27, 27, 27, -1, -1, -1, 27, -1,
738 28, 66, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 56};
743 0, 33, 34, 0, 1, 11, 35, 40, 22, 20, 22, 3, 4, 6, 7, 13, 15, 18, 21,
744 30, 41, 46, 47, 48, 49, 56, 23, 27, 10, 49, 16, 16, 18, 20, 50, 51, 22, 26,
745 5, 14, 57, 63, 3, 15, 36, 37, 49, 18, 4, 7, 18, 30, 26, 18, 21, 27, 25,
746 31, 20, 20, 60, 22, 22, 27, 49, 24, 25, 26, 16, 16, 50, 20, 18, 51, 60, 23,
747 8, 9, 12, 17, 7, 18, 38, 39, 26, 36, 20, 18, 18, 31, 60, 28, 29, 18, 19,
748 20, 21, 27, 30, 58, 59, 59, 59, 18, 19, 20, 27, 62, 25, 16, 28, 20, 28, 29,
749 42, 18, 20, 21, 30, 54, 16, 27, 18, 20, 28, 44, 45, 50, 24, 25, 16, 23, 27,
750 61, 62, 39, 18, 10, 10, 45, 16, 27, 31, 50, 18, 18, 27, 25, 28, 31, 60, 59,
751 18, 61, 18, 25, 28, 15, 49, 15, 46, 47, 48, 18, 18, 31, 28, 18, 45, 24, 28,
752 62, 49, 26, 49, 26, 26, 26, 28, 28, 26, 20, 26, 20, 20, 20, 20, 20, 60, 60,
753 60, 60, 29, 29, 29, 29, 43, 27, 27, 27, 27, 28, 50, 54, 55, 20, 21, 28, 52,
754 53, 28, 44, 28, 25, 28, 27, 25, 28, 28, 54, 18, 53, 28};
758 0, 32, 33, 34, 34, 34, 35, 36, 36, 37, 37, 37, 37, 38, 38, 39, 39,
759 40, 40, 41, 41, 41, 41, 41, 41, 41, 41, 42, 42, 43, 43, 43, 44, 44,
760 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 47, 48, 48, 49, 49, 49, 50,
761 50, 51, 51, 51, 52, 52, 53, 53, 53, 54, 54, 54, 54, 54, 54, 54, 55,
762 55, 56, 56, 57, 58, 58, 59, 59, 59, 59, 59, 59, 59, 59, 59, 60, 60,
763 61, 61, 62, 62, 62, 62, 62, 62, 62, 63, 63, 63};
767 0, 2, 5, 3, 3, 0, 5, 3, 1, 3, 4, 8, 9, 1, 3, 3, 1, 3, 0, 6,
768 15, 14, 15, 14, 15, 6, 13, 2, 0, 4, 3, 0, 3, 1, 1, 1, 4, 1, 1, 3,
769 3, 3, 3, 5, 5, 1, 3, 1, 1, 1, 3, 1, 1, 1, 4, 3, 1, 1, 1, 4,
770 1, 3, 3, 2, 1, 1, 4, 3, 1, 3, 0, 6, 3, 1, 1, 1, 1, 3, 3, 1,
771 4, 3, 2, 3, 0, 3, 1, 3, 1, 1, 1, 4, 4, 3, 3, 4, 4};
775 #define yyerrok (yyerrstatus = 0)
776 #define yyclearin (yychar = ORFZ_EMPTY)
778 #define YYACCEPT goto yyacceptlab
779 #define YYABORT goto yyabortlab
780 #define YYERROR goto yyerrorlab
782 #define YYRECOVERING() (!!yyerrstatus)
784 #define YYBACKUP(Token, Value) \
786 if (yychar == ORFZ_EMPTY) { \
793 yyerror(context, model, ok, scanner, \
794 YY_("syntax error: cannot back up")); \
801 #define YYERRCODE ORFZ_UNDEF
808 #define YYFPRINTF fprintf
811 #define YYDPRINTF(Args) \
813 if (yydebug) YYFPRINTF Args; \
817 #ifndef YY_LOCATION_PRINT
818 #define YY_LOCATION_PRINT(File, Loc) ((void)0)
821 #define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
824 YYFPRINTF(stderr, "%s ", Title); \
825 yy_symbol_print(stderr, Kind, Value, context, model, ok, scanner); \
826 YYFPRINTF(stderr, "\n"); \
838 FILE* yyoutput = yyo;
844 if (!yyvaluep)
return;
846 if (yykind <
YYNTOKENS) YYPRINT(yyo, yytoknum[yykind], *yyvaluep);
876 for (; yybottom <= yytop; yybottom++) {
877 int yybot = *yybottom;
883 #define YY_STACK_PRINT(Bottom, Top) \
885 if (yydebug) yy_stack_print((Bottom), (Top)); \
897 int yynrhs =
yyr2[yyrule];
899 YYFPRINTF(stderr,
"Reducing stack by rule %d (line %d):\n", yyrule - 1,
902 for (yyi = 0; yyi < yynrhs; yyi++) {
905 &yyvsp[(yyi + 1) - (yynrhs)],
context,
model, ok, scanner);
910 #define YY_REDUCE_PRINT(Rule) \
913 yy_reduce_print(yyssp, yyvsp, Rule, context, model, ok, scanner); \
920 #define YYDPRINTF(Args) ((void)0)
921 #define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
922 #define YY_STACK_PRINT(Bottom, Top)
923 #define YY_REDUCE_PRINT(Rule)
928 #define YYINITDEPTH 200
939 #define YYMAXDEPTH 10000
963 int yyxbegin = yyn < 0 ? -yyn : 0;
965 int yychecklim =
YYLAST - yyn + 1;
968 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
973 else if (yycount == yyargn)
984 #if defined __GLIBC__ && defined _STRING_H
985 #define yystrlen(S) (YY_CAST(YYPTRDIFF_T, strlen(S)))
990 for (yylen = 0; yystr[yylen]; yylen++)
continue;
997 #if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
998 #define yystpcpy stpcpy
1002 static char*
yystpcpy(
char* yydest,
const char* yysrc) {
1004 const char* yys = yysrc;
1006 while ((*yyd++ = *yys++) !=
'\0')
continue;
1022 if (*yystr ==
'"') {
1024 char const* yyp = yystr;
1025 for (;;)
switch (*++yyp) {
1028 goto do_not_strip_quotes;
1032 goto do_not_strip_quotes;
1038 if (yyres) yyres[yyn] = *yyp;
1043 if (yyres) yyres[yyn] =
'\0';
1046 do_not_strip_quotes:;
1050 return yystpcpy(yyres, yystr) - yyres;
1085 if (yyarg) yyarg[yycount] = yyctx->
yytoken;
1107 enum { YYARGS_MAX = 5 };
1121 #define YYCASE_(N, S) \
1127 YYCASE_(1,
YY_(
"syntax error, unexpected %s"));
1128 YYCASE_(2,
YY_(
"syntax error, unexpected %s, expecting %s"));
1129 YYCASE_(3,
YY_(
"syntax error, unexpected %s, expecting %s or %s"));
1130 YYCASE_(4,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s"));
1133 YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1139 yysize =
yystrlen(yyformat) - 2 * yycount + 1;
1142 for (yyi = 0; yyi < yycount; ++yyi) {
1151 if (*yymsg_alloc < yysize) {
1152 *yymsg_alloc = 2 * yysize;
1164 while ((*yyp = *yyformat) !=
'\0')
1165 if (*yyp ==
'%' && yyformat[1] ==
's' && yyi < yycount) {
1190 if (!yymsg) yymsg =
"Deleting";
1218 int yyerrstatus = 0;
1247 char* yymsg = yymsgbuf;
1250 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1256 YYDPRINTF((stderr,
"Starting parse\n"));
1258 yychar = ORFZ_EMPTY;
1273 YYDPRINTF((stderr,
"Entering state %d\n", yystate));
1280 if (yyss + yystacksize - 1 <= yyssp)
1281 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1282 goto yyexhaustedlab;
1288 #if defined yyoverflow
1300 yyoverflow(
YY_(
"memory exhausted"), &yyss1, yysize *
YYSIZEOF(*yyssp),
1301 &yyvs1, yysize *
YYSIZEOF(*yyvsp), &yystacksize);
1307 if (
YYMAXDEPTH <= yystacksize)
goto yyexhaustedlab;
1316 if (!yyptr)
goto yyexhaustedlab;
1319 #undef YYSTACK_RELOCATE
1324 yyssp = yyss + yysize - 1;
1325 yyvsp = yyvs + yysize - 1;
1329 (stderr,
"Stack size increased to %ld\n",
YY_CAST(
long, yystacksize)));
1332 if (yyss + yystacksize - 1 <= yyssp)
YYABORT;
1354 if (yychar == ORFZ_EMPTY) {
1355 YYDPRINTF((stderr,
"Reading a token\n"));
1359 if (yychar <= ORFZ_EOF) {
1362 YYDPRINTF((stderr,
"Now at end of input.\n"));
1363 }
else if (yychar == ORFZ_error) {
1368 yychar = ORFZ_UNDEF;
1379 if (yyn < 0 ||
YYLAST < yyn ||
yycheck[yyn] != yytoken)
goto yydefault;
1389 if (yyerrstatus) yyerrstatus--;
1399 yychar = ORFZ_EMPTY;
1407 if (yyn == 0)
goto yyerrlab;
1425 yyval = yyvsp[1 - yylen];
1430 #line 114 "./ortools/flatzinc/parser.yy"
1434 #line 1581 "./ortools/flatzinc/parser.tab.cc"
1439 #line 149 "./ortools/flatzinc/parser.yy"
1443 const Domain& domain = (yyvsp[-5].domain);
1444 const std::string& identifier = (yyvsp[-3].string_value);
1445 const Domain& assignment = (yyvsp[0].domain);
1446 std::vector<Annotation>*
const annotations = (yyvsp[-2].annotations);
1450 context->domain_map[identifier] = assignment;
1458 #line 1605 "./ortools/flatzinc/parser.tab.cc"
1464 #line 169 "./ortools/flatzinc/parser.yy"
1466 std::vector<Annotation>*
const annotations = (yyvsp[-4].annotations);
1468 CHECK_EQ((yyvsp[-12].integer_value), 1)
1469 <<
"Only [1..n] array are supported here.";
1470 const int64 num_constants = (yyvsp[-10].integer_value);
1471 const std::string& identifier = (yyvsp[-5].string_value);
1472 const std::vector<int64>*
const assignments = (yyvsp[-1].integers);
1473 CHECK(assignments !=
nullptr);
1474 CHECK_EQ(num_constants, assignments->size());
1476 context->integer_array_map[identifier] = *assignments;
1480 #line 1624 "./ortools/flatzinc/parser.tab.cc"
1485 #line 184 "./ortools/flatzinc/parser.yy"
1487 std::vector<Annotation>*
const annotations = (yyvsp[-3].annotations);
1489 CHECK_EQ((yyvsp[-11].integer_value), 1)
1490 <<
"Only [1..n] array are supported here.";
1491 const int64 num_constants = (yyvsp[-9].integer_value);
1492 CHECK_EQ(num_constants, 0) <<
"Empty arrays should have a size of 0";
1493 const std::string& identifier = (yyvsp[-4].string_value);
1494 context->integer_array_map[identifier] = std::vector<int64>();
1497 #line 1639 "./ortools/flatzinc/parser.tab.cc"
1503 #line 195 "./ortools/flatzinc/parser.yy"
1505 std::vector<Annotation>*
const annotations = (yyvsp[-4].annotations);
1507 CHECK_EQ((yyvsp[-12].integer_value), 1)
1508 <<
"Only [1..n] array are supported here.";
1509 const int64 num_constants = (yyvsp[-10].integer_value);
1510 const std::string& identifier = (yyvsp[-5].string_value);
1511 const std::vector<double>*
const assignments = (yyvsp[-1].doubles);
1512 CHECK(assignments !=
nullptr);
1513 CHECK_EQ(num_constants, assignments->size());
1515 context->float_array_map[identifier] = *assignments;
1519 #line 1658 "./ortools/flatzinc/parser.tab.cc"
1524 #line 210 "./ortools/flatzinc/parser.yy"
1526 std::vector<Annotation>*
const annotations = (yyvsp[-3].annotations);
1528 CHECK_EQ((yyvsp[-11].integer_value), 1)
1529 <<
"Only [1..n] array are supported here.";
1530 const int64 num_constants = (yyvsp[-9].integer_value);
1531 CHECK_EQ(num_constants, 0) <<
"Empty arrays should have a size of 0";
1532 const std::string& identifier = (yyvsp[-4].string_value);
1533 context->float_array_map[identifier] = std::vector<double>();
1536 #line 1673 "./ortools/flatzinc/parser.tab.cc"
1542 #line 221 "./ortools/flatzinc/parser.yy"
1545 CHECK_EQ((yyvsp[-12].integer_value), 1)
1546 <<
"Only [1..n] array are supported here.";
1547 const int64 num_constants = (yyvsp[-10].integer_value);
1548 const Domain& domain = (yyvsp[-7].domain);
1549 const std::string& identifier = (yyvsp[-5].string_value);
1550 const std::vector<Domain>*
const assignments = (yyvsp[-1].domains);
1551 const std::vector<Annotation>*
const annotations =
1552 (yyvsp[-4].annotations);
1553 CHECK(assignments !=
nullptr);
1554 CHECK_EQ(num_constants, assignments->size());
1557 context->domain_array_map[identifier] = *assignments;
1560 std::vector<int64> values(num_constants);
1561 for (
int i = 0; i < num_constants; ++i) {
1562 values[i] = (*assignments)[i].values.front();
1565 context->integer_array_map[identifier] = values;
1570 #line 1703 "./ortools/flatzinc/parser.tab.cc"
1575 #line 246 "./ortools/flatzinc/parser.yy"
1581 const Domain& domain = (yyvsp[-4].domain);
1582 const std::string& identifier = (yyvsp[-2].string_value);
1583 std::vector<Annotation>*
const annotations = (yyvsp[-1].annotations);
1585 const bool introduced =
ContainsId(annotations,
"var_is_introduced") ||
1586 absl::StartsWith(identifier,
"X_INTRODUCED");
1589 var =
model->AddVariable(identifier, domain, introduced);
1590 }
else if (assignment.
variable ==
nullptr) {
1593 identifier, Domain::IntegerValue(assignment.
value), introduced);
1596 var->Merge(identifier, domain, introduced);
1603 model->AddOutput(SolutionOutputSpecs::SingleVariable(
1608 #line 1741 "./ortools/flatzinc/parser.tab.cc"
1614 #line 280 "./ortools/flatzinc/parser.yy"
1619 CHECK_EQ((yyvsp[-10].integer_value), 1);
1620 const int64 num_vars = (yyvsp[-8].integer_value);
1621 const Domain& domain = (yyvsp[-4].domain);
1622 const std::string& identifier = (yyvsp[-2].string_value);
1623 std::vector<Annotation>*
const annotations = (yyvsp[-1].annotations);
1625 (yyvsp[0].var_or_value_array);
1626 CHECK(assignments ==
nullptr ||
1627 assignments->
variables.size() == num_vars);
1628 CHECK(assignments ==
nullptr || assignments->
values.size() == num_vars);
1629 const bool introduced =
ContainsId(annotations,
"var_is_introduced") ||
1630 absl::StartsWith(identifier,
"X_INTRODUCED");
1632 std::vector<IntegerVariable*> vars(num_vars,
nullptr);
1634 for (
int i = 0; i < num_vars; ++i) {
1635 const std::string var_name =
1636 absl::StrFormat(
"%s[%d]", identifier, i + 1);
1637 if (assignments ==
nullptr) {
1638 vars[i] =
model->AddVariable(var_name, domain, introduced);
1639 }
else if (assignments->
variables[i] ==
nullptr) {
1643 vars[i] =
model->AddVariable(var_name, Domain::IntegerValue(
value),
1649 vars[i]->Merge(var_name, domain, introduced);
1655 context->variable_array_map[identifier] = vars;
1660 if (annotations !=
nullptr) {
1661 for (
int i = 0; i < annotations->size(); ++i) {
1669 std::vector<SolutionOutputSpecs::Bounds>
bounds;
1673 bounds.emplace_back(SolutionOutputSpecs::Bounds(
1677 model->AddOutput(SolutionOutputSpecs::MultiDimensionalArray(
1684 #line 1813 "./ortools/flatzinc/parser.tab.cc"
1688 #line 349 "./ortools/flatzinc/parser.yy"
1690 (yyval.var_or_value) = (yyvsp[0].var_or_value);
1692 #line 1819 "./ortools/flatzinc/parser.tab.cc"
1696 #line 350 "./ortools/flatzinc/parser.yy"
1698 (yyval.var_or_value) = VariableRefOrValue::Undefined();
1700 #line 1825 "./ortools/flatzinc/parser.tab.cc"
1704 #line 353 "./ortools/flatzinc/parser.yy"
1706 (yyval.var_or_value_array) = (yyvsp[-1].var_or_value_array);
1708 #line 1831 "./ortools/flatzinc/parser.tab.cc"
1712 #line 354 "./ortools/flatzinc/parser.yy"
1714 (yyval.var_or_value_array) =
nullptr;
1716 #line 1837 "./ortools/flatzinc/parser.tab.cc"
1720 #line 355 "./ortools/flatzinc/parser.yy"
1722 (yyval.var_or_value_array) =
nullptr;
1724 #line 1843 "./ortools/flatzinc/parser.tab.cc"
1728 #line 358 "./ortools/flatzinc/parser.yy"
1730 (yyval.var_or_value_array) = (yyvsp[-2].var_or_value_array);
1731 (yyval.var_or_value_array)->PushBack((yyvsp[0].var_or_value));
1733 #line 1852 "./ortools/flatzinc/parser.tab.cc"
1737 #line 362 "./ortools/flatzinc/parser.yy"
1740 (yyval.var_or_value_array)->PushBack((yyvsp[0].var_or_value));
1742 #line 1861 "./ortools/flatzinc/parser.tab.cc"
1746 #line 368 "./ortools/flatzinc/parser.yy"
1748 (yyval.var_or_value) =
1751 #line 1867 "./ortools/flatzinc/parser.tab.cc"
1755 #line 369 "./ortools/flatzinc/parser.yy"
1758 const std::string&
id = (yyvsp[0].string_value);
1760 (yyval.var_or_value) =
1763 (yyval.var_or_value) = VariableRefOrValue::VariableRef(
1766 LOG(
ERROR) <<
"Unknown symbol " << id;
1767 (yyval.var_or_value) = VariableRefOrValue::Undefined();
1771 #line 1885 "./ortools/flatzinc/parser.tab.cc"
1775 #line 382 "./ortools/flatzinc/parser.yy"
1778 const std::string&
id = (yyvsp[-3].string_value);
1779 const int64 value = (yyvsp[-1].integer_value);
1784 (yyval.var_or_value) = VariableRefOrValue::VariableRef(
1787 LOG(
ERROR) <<
"Unknown symbol " << id;
1788 (yyval.var_or_value) = VariableRefOrValue::Undefined();
1792 #line 1906 "./ortools/flatzinc/parser.tab.cc"
1796 #line 400 "./ortools/flatzinc/parser.yy"
1798 (yyval.domain) = Domain::Boolean();
1800 #line 1912 "./ortools/flatzinc/parser.tab.cc"
1804 #line 401 "./ortools/flatzinc/parser.yy"
1806 (yyval.domain) = Domain::AllInt64();
1808 #line 1918 "./ortools/flatzinc/parser.tab.cc"
1812 #line 402 "./ortools/flatzinc/parser.yy"
1815 Domain::Interval((yyvsp[-2].integer_value), (yyvsp[0].integer_value));
1817 #line 1924 "./ortools/flatzinc/parser.tab.cc"
1821 #line 403 "./ortools/flatzinc/parser.yy"
1823 CHECK((yyvsp[-1].integers) !=
nullptr);
1824 (yyval.domain) = Domain::IntegerList(std::move(*(yyvsp[-1].integers)));
1825 delete (yyvsp[-1].integers);
1827 #line 1934 "./ortools/flatzinc/parser.tab.cc"
1831 #line 410 "./ortools/flatzinc/parser.yy"
1833 (yyval.domain) = Domain::SetOfBoolean();
1835 #line 1940 "./ortools/flatzinc/parser.tab.cc"
1839 #line 411 "./ortools/flatzinc/parser.yy"
1841 (yyval.domain) = Domain::SetOfAllInt64();
1843 #line 1946 "./ortools/flatzinc/parser.tab.cc"
1847 #line 412 "./ortools/flatzinc/parser.yy"
1849 (yyval.domain) = Domain::SetOfInterval((yyvsp[-2].integer_value),
1850 (yyvsp[0].integer_value));
1852 #line 1952 "./ortools/flatzinc/parser.tab.cc"
1856 #line 413 "./ortools/flatzinc/parser.yy"
1858 CHECK((yyvsp[-1].integers) !=
nullptr);
1860 Domain::SetOfIntegerList(std::move(*(yyvsp[-1].integers)));
1861 delete (yyvsp[-1].integers);
1863 #line 1962 "./ortools/flatzinc/parser.tab.cc"
1867 #line 420 "./ortools/flatzinc/parser.yy"
1869 (yyval.domain) = Domain::AllInt64();
1871 #line 1968 "./ortools/flatzinc/parser.tab.cc"
1875 #line 421 "./ortools/flatzinc/parser.yy"
1879 (yyval.domain) = Domain::Interval(lb, ub);
1881 #line 1978 "./ortools/flatzinc/parser.tab.cc"
1885 #line 428 "./ortools/flatzinc/parser.yy"
1887 (yyval.domain) = (yyvsp[0].domain);
1889 #line 1984 "./ortools/flatzinc/parser.tab.cc"
1893 #line 429 "./ortools/flatzinc/parser.yy"
1895 (yyval.domain) = (yyvsp[0].domain);
1897 #line 1990 "./ortools/flatzinc/parser.tab.cc"
1901 #line 430 "./ortools/flatzinc/parser.yy"
1903 (yyval.domain) = (yyvsp[0].domain);
1905 #line 1996 "./ortools/flatzinc/parser.tab.cc"
1909 #line 433 "./ortools/flatzinc/parser.yy"
1911 (yyval.integers) = (yyvsp[-2].integers);
1912 (yyval.integers)->emplace_back((yyvsp[0].integer_value));
1914 #line 2002 "./ortools/flatzinc/parser.tab.cc"
1918 #line 434 "./ortools/flatzinc/parser.yy"
1920 (yyval.integers) =
new std::vector<int64>();
1921 (yyval.integers)->emplace_back((yyvsp[0].integer_value));
1923 #line 2008 "./ortools/flatzinc/parser.tab.cc"
1927 #line 437 "./ortools/flatzinc/parser.yy"
1929 (yyval.integer_value) = (yyvsp[0].integer_value);
1931 #line 2014 "./ortools/flatzinc/parser.tab.cc"
1935 #line 438 "./ortools/flatzinc/parser.yy"
1937 (yyval.integer_value) =
1940 #line 2020 "./ortools/flatzinc/parser.tab.cc"
1944 #line 439 "./ortools/flatzinc/parser.yy"
1946 (yyval.integer_value) =
Lookup(
1948 (yyvsp[-1].integer_value));
1950 #line 2028 "./ortools/flatzinc/parser.tab.cc"
1954 #line 444 "./ortools/flatzinc/parser.yy"
1956 (yyval.doubles) = (yyvsp[-2].doubles);
1957 (yyval.doubles)->emplace_back((yyvsp[0].double_value));
1959 #line 2034 "./ortools/flatzinc/parser.tab.cc"
1963 #line 445 "./ortools/flatzinc/parser.yy"
1965 (yyval.doubles) =
new std::vector<double>();
1966 (yyval.doubles)->emplace_back((yyvsp[0].double_value));
1968 #line 2040 "./ortools/flatzinc/parser.tab.cc"
1972 #line 448 "./ortools/flatzinc/parser.yy"
1974 (yyval.double_value) = (yyvsp[0].double_value);
1976 #line 2046 "./ortools/flatzinc/parser.tab.cc"
1980 #line 449 "./ortools/flatzinc/parser.yy"
1982 (yyval.double_value) =
1985 #line 2052 "./ortools/flatzinc/parser.tab.cc"
1989 #line 450 "./ortools/flatzinc/parser.yy"
1991 (yyval.double_value) =
Lookup(
1993 (yyvsp[-1].integer_value));
1995 #line 2060 "./ortools/flatzinc/parser.tab.cc"
1999 #line 455 "./ortools/flatzinc/parser.yy"
2001 (yyval.domain) = Domain::IntegerValue((yyvsp[0].integer_value));
2003 #line 2066 "./ortools/flatzinc/parser.tab.cc"
2007 #line 456 "./ortools/flatzinc/parser.yy"
2010 Domain::Interval((yyvsp[-2].integer_value), (yyvsp[0].integer_value));
2012 #line 2072 "./ortools/flatzinc/parser.tab.cc"
2016 #line 457 "./ortools/flatzinc/parser.yy"
2018 CHECK((yyvsp[-1].integers) !=
nullptr);
2019 (yyval.domain) = Domain::IntegerList(std::move(*(yyvsp[-1].integers)));
2020 delete (yyvsp[-1].integers);
2022 #line 2082 "./ortools/flatzinc/parser.tab.cc"
2026 #line 462 "./ortools/flatzinc/parser.yy"
2028 (yyval.domain) = Domain::EmptyDomain();
2030 #line 2088 "./ortools/flatzinc/parser.tab.cc"
2034 #line 463 "./ortools/flatzinc/parser.yy"
2036 CHECK_EQ(std::round((yyvsp[0].double_value)), (yyvsp[0].double_value));
2038 Domain::IntegerValue(
static_cast<int64>((yyvsp[0].double_value)));
2040 #line 2097 "./ortools/flatzinc/parser.tab.cc"
2044 #line 467 "./ortools/flatzinc/parser.yy"
2046 (yyval.domain) = Domain::IntegerValue(
2049 #line 2103 "./ortools/flatzinc/parser.tab.cc"
2053 #line 468 "./ortools/flatzinc/parser.yy"
2055 (yyval.domain) = Domain::IntegerValue(
Lookup(
2057 (yyvsp[-1].integer_value)));
2059 #line 2112 "./ortools/flatzinc/parser.tab.cc"
2063 #line 474 "./ortools/flatzinc/parser.yy"
2065 (yyval.domains) = (yyvsp[-2].domains);
2066 (yyval.domains)->emplace_back((yyvsp[0].domain));
2068 #line 2121 "./ortools/flatzinc/parser.tab.cc"
2072 #line 478 "./ortools/flatzinc/parser.yy"
2074 (yyval.domains) =
new std::vector<Domain>();
2075 (yyval.domains)->emplace_back((yyvsp[0].domain));
2077 #line 2127 "./ortools/flatzinc/parser.tab.cc"
2082 #line 488 "./ortools/flatzinc/parser.yy"
2084 const std::string& identifier = (yyvsp[-4].string_value);
2085 CHECK((yyvsp[-2].args) !=
nullptr) <<
"Missing argument in constraint";
2086 const std::vector<Argument>& arguments = *(yyvsp[-2].args);
2087 std::vector<Annotation>*
const annotations = (yyvsp[0].annotations);
2089 model->AddConstraint(identifier, arguments,
2092 delete (yyvsp[-2].args);
2094 #line 2142 "./ortools/flatzinc/parser.tab.cc"
2098 #line 500 "./ortools/flatzinc/parser.yy"
2100 (yyval.args) = (yyvsp[-2].args);
2101 (yyval.args)->emplace_back((yyvsp[0].arg));
2103 #line 2148 "./ortools/flatzinc/parser.tab.cc"
2107 #line 501 "./ortools/flatzinc/parser.yy"
2109 (yyval.args) =
new std::vector<Argument>();
2110 (yyval.args)->emplace_back((yyvsp[0].arg));
2112 #line 2154 "./ortools/flatzinc/parser.tab.cc"
2116 #line 504 "./ortools/flatzinc/parser.yy"
2118 (yyval.arg) = Argument::IntegerValue((yyvsp[0].integer_value));
2120 #line 2160 "./ortools/flatzinc/parser.tab.cc"
2124 #line 505 "./ortools/flatzinc/parser.yy"
2126 (yyval.arg) = Argument::IntegerValue(
2129 #line 2166 "./ortools/flatzinc/parser.tab.cc"
2133 #line 506 "./ortools/flatzinc/parser.yy"
2135 (yyval.arg) = Argument::VoidArgument();
2137 #line 2172 "./ortools/flatzinc/parser.tab.cc"
2141 #line 507 "./ortools/flatzinc/parser.yy"
2143 (yyval.arg) = Argument::Interval((yyvsp[-2].integer_value),
2144 (yyvsp[0].integer_value));
2146 #line 2178 "./ortools/flatzinc/parser.tab.cc"
2150 #line 508 "./ortools/flatzinc/parser.yy"
2152 CHECK((yyvsp[-1].integers) !=
nullptr);
2153 (yyval.arg) = Argument::IntegerList(std::move(*(yyvsp[-1].integers)));
2154 delete (yyvsp[-1].integers);
2156 #line 2188 "./ortools/flatzinc/parser.tab.cc"
2160 #line 513 "./ortools/flatzinc/parser.yy"
2162 const std::string&
id = (yyvsp[0].string_value);
2167 (yyval.arg) = Argument::IntegerList(
2173 const auto& double_values =
2175 std::vector<int64> integer_values;
2176 for (
const double d : double_values) {
2178 integer_values.push_back(i);
2180 (yyval.arg) = Argument::IntegerList(std::move(integer_values));
2185 (yyval.arg) = Argument::IntVarRefArray(
2189 (yyval.arg) = Argument::FromDomain(d);
2192 <<
"Unknown identifier: " << id;
2193 const std::vector<Domain>& d =
2195 (yyval.arg) = Argument::DomainList(d);
2198 #line 2224 "./ortools/flatzinc/parser.tab.cc"
2202 #line 544 "./ortools/flatzinc/parser.yy"
2204 const std::string&
id = (yyvsp[-3].string_value);
2205 const int64 index = (yyvsp[-1].integer_value);
2207 (yyval.arg) = Argument::IntegerValue(
2210 (yyval.arg) = Argument::IntVarRef(
2214 <<
"Unknown identifier: " << id;
2217 (yyval.arg) = Argument::FromDomain(d);
2220 #line 2246 "./ortools/flatzinc/parser.tab.cc"
2224 #line 561 "./ortools/flatzinc/parser.yy"
2227 CHECK(arguments !=
nullptr);
2228 bool has_variables =
false;
2229 for (
int i = 0; i < arguments->
Size(); ++i) {
2230 if (arguments->
variables[i] !=
nullptr) {
2231 has_variables =
true;
2235 if (has_variables) {
2236 (yyval.arg) = Argument::IntVarRefArray(std::vector<IntegerVariable*>());
2237 (yyval.arg).variables.reserve(arguments->
Size());
2238 for (
int i = 0; i < arguments->
Size(); ++i) {
2239 if (arguments->
variables[i] !=
nullptr) {
2240 (yyval.arg).variables.emplace_back(arguments->
variables[i]);
2242 (yyval.arg).variables.emplace_back(
2247 (yyval.arg) = Argument::IntegerList(arguments->
values);
2251 #line 2276 "./ortools/flatzinc/parser.tab.cc"
2255 #line 586 "./ortools/flatzinc/parser.yy"
2257 (yyval.arg) = Argument::VoidArgument();
2259 #line 2284 "./ortools/flatzinc/parser.tab.cc"
2263 #line 595 "./ortools/flatzinc/parser.yy"
2265 (yyval.annotations) = (yyvsp[-2].annotations) !=
nullptr
2266 ? (yyvsp[-2].annotations)
2267 :
new std::vector<Annotation>();
2268 (yyval.annotations)->emplace_back((yyvsp[0].annotation));
2270 #line 2293 "./ortools/flatzinc/parser.tab.cc"
2274 #line 599 "./ortools/flatzinc/parser.yy"
2276 (yyval.annotations) =
nullptr;
2278 #line 2299 "./ortools/flatzinc/parser.tab.cc"
2282 #line 602 "./ortools/flatzinc/parser.yy"
2284 (yyval.annotations) = (yyvsp[-2].annotations);
2285 (yyval.annotations)->emplace_back((yyvsp[0].annotation));
2287 #line 2305 "./ortools/flatzinc/parser.tab.cc"
2291 #line 603 "./ortools/flatzinc/parser.yy"
2293 (yyval.annotations) =
new std::vector<Annotation>();
2294 (yyval.annotations)->emplace_back((yyvsp[0].annotation));
2296 #line 2311 "./ortools/flatzinc/parser.tab.cc"
2300 #line 606 "./ortools/flatzinc/parser.yy"
2302 (yyval.annotation) = Annotation::Interval((yyvsp[-2].integer_value),
2303 (yyvsp[0].integer_value));
2305 #line 2317 "./ortools/flatzinc/parser.tab.cc"
2309 #line 607 "./ortools/flatzinc/parser.yy"
2311 (yyval.annotation) = Annotation::IntegerValue((yyvsp[0].integer_value));
2313 #line 2323 "./ortools/flatzinc/parser.tab.cc"
2317 #line 608 "./ortools/flatzinc/parser.yy"
2319 (yyval.annotation) = Annotation::String((yyvsp[0].string_value));
2321 #line 2329 "./ortools/flatzinc/parser.tab.cc"
2325 #line 609 "./ortools/flatzinc/parser.yy"
2327 const std::string&
id = (yyvsp[0].string_value);
2329 (yyval.annotation) =
2332 (yyval.annotation) = Annotation::VariableList(
2335 (yyval.annotation) = Annotation::Identifier(
id);
2338 #line 2344 "./ortools/flatzinc/parser.tab.cc"
2342 #line 619 "./ortools/flatzinc/parser.yy"
2344 std::vector<Annotation>*
const annotations = (yyvsp[-1].annotations);
2345 if (annotations !=
nullptr) {
2346 (yyval.annotation) = Annotation::FunctionCallWithArguments(
2347 (yyvsp[-3].string_value), std::move(*annotations));
2350 (yyval.annotation) = Annotation::FunctionCall((yyvsp[-3].string_value));
2353 #line 2358 "./ortools/flatzinc/parser.tab.cc"
2357 #line 628 "./ortools/flatzinc/parser.yy"
2360 (yyvsp[-3].string_value)))
2361 <<
"Unknown identifier: " << (yyvsp[-3].string_value);
2362 (yyval.annotation) = Annotation::Variable(
Lookup(
2364 (yyvsp[-1].integer_value)));
2366 #line 2369 "./ortools/flatzinc/parser.tab.cc"
2370 #line 634 "./ortools/flatzinc/parser.yy"
2372 std::vector<Annotation>*
const annotations = (yyvsp[-1].annotations);
2373 if (annotations !=
nullptr) {
2374 (yyval.annotation) =
2375 Annotation::AnnotationList(std::move(*annotations));
2378 (yyval.annotation) = Annotation::Empty();
2381 #line 2383 "./ortools/flatzinc/parser.tab.cc"
2385 #line 649 "./ortools/flatzinc/parser.yy"
2387 if ((yyvsp[-1].annotations) !=
nullptr) {
2388 model->Satisfy(std::move(*(yyvsp[-1].annotations)));
2389 delete (yyvsp[-1].annotations);
2391 model->Satisfy(std::vector<Annotation>());
2394 #line 2396 "./ortools/flatzinc/parser.tab.cc"
2398 #line 657 "./ortools/flatzinc/parser.yy"
2400 CHECK_EQ(Argument::INT_VAR_REF, (yyvsp[0].arg).type);
2401 if ((yyvsp[-2].annotations) !=
nullptr) {
2402 model->Minimize((yyvsp[0].arg).Var(),
2403 std::move(*(yyvsp[-2].annotations)));
2404 delete (yyvsp[-2].annotations);
2406 model->Minimize((yyvsp[0].arg).Var(), std::vector<Annotation>());
2409 #line 2410 "./ortools/flatzinc/parser.tab.cc"
2413 #line 666 "./ortools/flatzinc/parser.yy"
2415 CHECK_EQ(Argument::INT_VAR_REF, (yyvsp[0].arg).type);
2416 if ((yyvsp[-2].annotations) !=
nullptr) {
2417 model->Maximize((yyvsp[0].arg).Var(),
2418 std::move(*(yyvsp[-2].annotations)));
2419 delete (yyvsp[-2].annotations);
2421 model->Maximize((yyvsp[0].arg).Var(), std::vector<Annotation>());
2424 #line 2424 "./ortools/flatzinc/parser.tab.cc"
2427 #line 2428 "./ortools/flatzinc/parser.tab.cc"
2456 const int yyi =
yypgoto[yylhs] + *yyssp;
2457 yystate = (0 <= yyi && yyi <=
YYLAST &&
yycheck[yyi] == *yyssp
2476 char const* yymsgp =
YY_(
"syntax error");
2477 int yysyntax_error_status;
2478 yysyntax_error_status =
yysyntax_error(&yymsg_alloc, &yymsg, &yyctx);
2479 if (yysyntax_error_status == 0)
2481 else if (yysyntax_error_status == -1) {
2485 yysyntax_error_status =
yysyntax_error(&yymsg_alloc, &yymsg, &yyctx);
2489 yymsg_alloc =
sizeof yymsgbuf;
2494 if (yysyntax_error_status ==
YYENOMEM)
goto yyexhaustedlab;
2498 if (yyerrstatus == 3) {
2502 if (yychar <= ORFZ_EOF) {
2504 if (yychar == ORFZ_EOF)
YYABORT;
2508 yychar = ORFZ_EMPTY;
2553 model, ok, scanner);
2597 if (yychar != ORFZ_EMPTY) {
2602 model, ok, scanner);
2608 while (yyssp != yyss) {
2610 model, ok, scanner);
2620 #line 676 "./ortools/flatzinc/parser.yy"