64 #define YYBISON_VERSION "3.5.1"
67 #define YYSKELETON_NAME "yacc.c"
79 #define YYSTYPE ORFZ_STYPE
81 #define yyparse orfz_parse
82 #define yylex orfz_lex
83 #define yyerror orfz_error
84 #define yydebug orfz_debug
85 #define yynerrs orfz_nerrs
89 #define YY_CAST(Type, Val) static_cast<Type>(Val)
90 #define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type>(Val)
92 #define YY_CAST(Type, Val) ((Type)(Val))
93 #define YY_REINTERPRET_CAST(Type, Val) ((Type)(Val))
97 #if defined __cplusplus
98 #if 201103L <= __cplusplus
99 #define YY_NULLPTR nullptr
104 #define YY_NULLPTR ((void*)0)
109 #ifdef YYERROR_VERBOSE
110 #undef YYERROR_VERBOSE
111 #define YYERROR_VERBOSE 1
113 #define YYERROR_VERBOSE 1
118 #ifndef YY_ORFZ_ORTOOLS_FLATZINC_PARSER_TAB_HH_INCLUDED
119 #define YY_ORFZ_ORTOOLS_FLATZINC_PARSER_TAB_HH_INCLUDED
136 #line 19 "./ortools/flatzinc/parser.yy"
138 #if !defined(OR_TOOLS_FLATZINC_FLATZINC_TAB_HH_)
139 #define OR_TOOLS_FLATZINC_FLATZINC_TAB_HH_
140 #include "absl/strings/match.h"
141 #include "absl/strings/str_format.h"
148 #define YYLEX_PARAM scanner
150 #endif // OR_TOOLS_FLATZINC_FLATZINC_TAB_HH_
152 #line 141 "./ortools/flatzinc/parser.tab.cc"
155 #ifndef ORFZ_TOKENTYPE
156 #define ORFZ_TOKENTYPE
188 #line 36 "./ortools/flatzinc/parser.yy"
190 #include "absl/strings/match.h"
191 #include "absl/strings/str_format.h"
207 #line 199 "./ortools/flatzinc/parser.tab.cc"
217 #ifndef __PTRDIFF_MAX__
219 #if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
230 #ifdef __INT_LEAST8_MAX__
232 #elif defined YY_STDINT_H
238 #ifdef __INT_LEAST16_MAX__
240 #elif defined YY_STDINT_H
246 #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
248 #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H && \
249 UINT_LEAST8_MAX <= INT_MAX)
251 #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
257 #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
259 #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H && \
260 UINT_LEAST16_MAX <= INT_MAX)
262 #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
269 #if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
270 #define YYPTRDIFF_T __PTRDIFF_TYPE__
271 #define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
272 #elif defined PTRDIFF_MAX
276 #define YYPTRDIFF_T ptrdiff_t
277 #define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
279 #define YYPTRDIFF_T long
280 #define YYPTRDIFF_MAXIMUM LONG_MAX
286 #define YYSIZE_T __SIZE_TYPE__
288 #define YYSIZE_T size_t
289 #elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
291 #define YYSIZE_T size_t
293 #define YYSIZE_T unsigned
297 #define YYSIZE_MAXIMUM \
298 YY_CAST(YYPTRDIFF_T, \
299 (YYPTRDIFF_MAXIMUM < YY_CAST(YYSIZE_T, -1) ? YYPTRDIFF_MAXIMUM \
300 : YY_CAST(YYSIZE_T, -1)))
302 #define YYSIZEOF(X) YY_CAST(YYPTRDIFF_T, sizeof(X))
311 #if defined YYENABLE_NLS && YYENABLE_NLS
314 #define YY_(Msgid) dgettext("bison-runtime", Msgid)
318 #define YY_(Msgid) Msgid
322 #ifndef YY_ATTRIBUTE_PURE
323 #if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
324 #define YY_ATTRIBUTE_PURE __attribute__((__pure__))
326 #define YY_ATTRIBUTE_PURE
330 #ifndef YY_ATTRIBUTE_UNUSED
331 #if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
332 #define YY_ATTRIBUTE_UNUSED __attribute__((__unused__))
334 #define YY_ATTRIBUTE_UNUSED
339 #if !defined lint || defined __GNUC__
340 #define YYUSE(E) ((void)(E))
345 #if defined __GNUC__ && !defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
347 #define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
348 _Pragma("GCC diagnostic push") \
349 _Pragma("GCC diagnostic ignored \"-Wuninitialized\"") \
350 _Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
351 #define YY_IGNORE_MAYBE_UNINITIALIZED_END _Pragma("GCC diagnostic pop")
353 #define YY_INITIAL_VALUE(Value) Value
355 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
356 #define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
357 #define YY_IGNORE_MAYBE_UNINITIALIZED_END
359 #ifndef YY_INITIAL_VALUE
360 #define YY_INITIAL_VALUE(Value)
363 #if defined __cplusplus && defined __GNUC__ && !defined __ICC && 6 <= __GNUC__
364 #define YY_IGNORE_USELESS_CAST_BEGIN \
365 _Pragma("GCC diagnostic push") \
366 _Pragma("GCC diagnostic ignored \"-Wuseless-cast\"")
367 #define YY_IGNORE_USELESS_CAST_END _Pragma("GCC diagnostic pop")
369 #ifndef YY_IGNORE_USELESS_CAST_BEGIN
370 #define YY_IGNORE_USELESS_CAST_BEGIN
371 #define YY_IGNORE_USELESS_CAST_END
374 #define YY_ASSERT(E) ((void)(0 && (E)))
376 #if !defined yyoverflow || YYERROR_VERBOSE
380 #ifdef YYSTACK_USE_ALLOCA
381 #if YYSTACK_USE_ALLOCA
383 #define YYSTACK_ALLOC __builtin_alloca
384 #elif defined __BUILTIN_VA_ARG_INCR
387 #define YYSTACK_ALLOC __alloca
388 #elif defined _MSC_VER
390 #define alloca _alloca
392 #define YYSTACK_ALLOC alloca
393 #if !defined _ALLOCA_H && !defined EXIT_SUCCESS
397 #define EXIT_SUCCESS 0
406 #define YYSTACK_FREE(Ptr) \
410 #ifndef YYSTACK_ALLOC_MAXIMUM
415 #define YYSTACK_ALLOC_MAXIMUM 4032
418 #define YYSTACK_ALLOC YYMALLOC
419 #define YYSTACK_FREE YYFREE
420 #ifndef YYSTACK_ALLOC_MAXIMUM
421 #define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
423 #if (defined __cplusplus && !defined EXIT_SUCCESS && \
424 !((defined YYMALLOC || defined malloc) && \
425 (defined YYFREE || defined free)))
428 #define EXIT_SUCCESS 0
432 #define YYMALLOC malloc
433 #if !defined malloc && !defined EXIT_SUCCESS
439 #if !defined free && !defined EXIT_SUCCESS
446 #if (!defined yyoverflow && \
447 (!defined __cplusplus || \
448 (defined ORFZ_STYPE_IS_TRIVIAL && ORFZ_STYPE_IS_TRIVIAL)))
457 #define YYSTACK_GAP_MAXIMUM (YYSIZEOF(union yyalloc) - 1)
461 #define YYSTACK_BYTES(N) \
462 ((N) * (YYSIZEOF(yy_state_t) + YYSIZEOF(YYSTYPE)) + YYSTACK_GAP_MAXIMUM)
464 #define YYCOPY_NEEDED 1
471 #define YYSTACK_RELOCATE(Stack_alloc, Stack) \
473 YYPTRDIFF_T yynewbytes; \
474 YYCOPY(&yyptr->Stack_alloc, Stack, yysize); \
475 Stack = &yyptr->Stack_alloc; \
476 yynewbytes = yystacksize * YYSIZEOF(*Stack) + YYSTACK_GAP_MAXIMUM; \
477 yyptr += yynewbytes / YYSIZEOF(*yyptr); \
482 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
486 #if defined __GNUC__ && 1 < __GNUC__
487 #define YYCOPY(Dst, Src, Count) \
488 __builtin_memcpy(Dst, Src, YY_CAST(YYSIZE_T, (Count)) * sizeof(*(Src)))
490 #define YYCOPY(Dst, Src, Count) \
493 for (yyi = 0; yyi < (Count); yyi++) (Dst)[yyi] = (Src)[yyi]; \
511 #define YYNSTATES 223
514 #define YYMAXUTOK 276
518 #define YYTRANSLATE(YYX) \
519 (0 <= (YYX) && (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
524 0, 2, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2,
526 23, 24, 2, 2, 25, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 26, 22,
527 2, 29, 2, 2, 2, 2, 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, 27, 2, 28, 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, 30, 2, 31, 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, 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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
536 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
537 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21};
542 0, 103, 103, 110, 114, 115, 120, 123, 124, 127, 128, 129, 130, 133,
543 134, 137, 138, 145, 146, 149, 168, 183, 194, 209, 220, 246, 279, 349,
544 350, 353, 354, 355, 358, 362, 368, 369, 382, 400, 401, 402, 403, 410,
545 411, 412, 413, 420, 421, 428, 429, 430, 433, 434, 437, 438, 439, 444,
546 445, 448, 449, 450, 455, 456, 457, 462, 463, 467, 468, 474, 478, 484,
547 485, 488, 500, 501, 504, 505, 506, 507, 508, 513, 544, 561, 586, 595,
548 599, 602, 603, 606, 607, 608, 609, 619, 628, 634, 649, 657, 666};
551 #if ORFZ_DEBUG || YYERROR_VERBOSE || 1
590 "predicate_arguments",
591 "predicate_argument",
592 "predicate_array_argument",
594 "variable_or_constant_declarations",
595 "variable_or_constant_declaration",
596 "optional_var_or_value",
597 "optional_var_or_value_array",
598 "var_or_value_array",
615 "annotation_arguments",
624 static const yytype_int16 yytoknum[] = {0, 256, 257, 258, 259, 260, 261, 262,
625 263, 264, 265, 266, 267, 268, 269, 270,
626 271, 272, 273, 274, 275, 276, 59, 40,
627 41, 44, 58, 91, 93, 61, 123, 125};
630 #define YYPACT_NINF (-182)
632 #define yypact_value_is_default(Yyn) ((Yyn) == YYPACT_NINF)
634 #define YYTABLE_NINF (-19)
636 #define yytable_value_is_error(Yyn) 0
641 -182, 49, 7, -182, -15, 67, 114, 20, -182, 95, -182, 99,
642 -182, -182, -182, 136, 76, 122, 141, 11, 154, -182, -182, -182,
643 143, 130, 40, 157, 12, 151, 160, 158, -182, 155, 118, -182,
644 -182, 161, 163, -182, 162, 164, 165, 76, 156, 166, 159, 171,
645 -182, -182, 172, 11, 169, -182, -182, 175, 11, -182, -182, 167,
646 125, -182, -182, 27, 168, -182, 40, 176, 177, 179, 120, -182,
647 170, -182, 22, 80, 80, 80, -182, 121, 174, 184, 173, -182,
648 182, -182, -182, 178, -182, -182, 59, -182, 75, 187, -182, 180,
649 -182, 93, 11, 131, -182, -182, -182, 188, -182, 96, 121, -182,
650 198, 190, 199, -182, 200, 150, -182, 195, 185, -182, 34, -182,
651 196, 197, -182, 186, -182, 31, -182, 128, -182, 80, 201, 121,
652 202, 84, -182, -182, -182, 56, 60, -182, 203, 204, -182, 129,
653 -182, 189, 205, 150, -182, -182, 207, -182, -182, 147, 206, 121,
654 -182, 76, 192, 76, 209, 210, 211, -182, 212, -182, -182, 213,
655 -182, -182, -182, -182, 216, 208, 217, 218, 219, 224, -182, -182,
656 225, -182, 226, -182, -182, -182, -182, -182, 74, 85, 87, 91,
657 220, 221, 222, 223, -182, 97, 75, 64, 104, -182, 133, -182,
658 137, 227, -182, -182, 138, -182, -182, 139, -182, 75, -182, 214,
659 153, -182, -182, -182, 228, -182, -182};
665 5, 0, 0, 1, 0, 0, 0, 70, 4, 0, 3, 0, 37, 45, 38, 0, 0, 0, 0,
666 0, 0, 47, 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, 52, 53, 0, 51, 17, 0,
667 0, 84, 0, 0, 0, 0, 0, 8, 0, 0, 41, 42, 0, 0, 0, 39, 46, 0, 0,
668 40, 84, 0, 0, 69, 2, 0, 0, 6, 0, 0, 0, 0, 0, 84, 0, 50, 0, 0,
669 0, 0, 94, 0, 16, 0, 0, 13, 0, 7, 9, 0, 43, 44, 28, 54, 0, 74, 76,
670 79, 75, 0, 0, 0, 73, 96, 95, 88, 89, 90, 0, 83, 0, 0, 0, 10, 0, 0,
671 25, 60, 65, 64, 0, 19, 0, 0, 34, 35, 82, 0, 33, 0, 84, 0, 0, 0, 0,
672 0, 86, 15, 14, 0, 0, 27, 0, 0, 63, 0, 77, 0, 0, 0, 81, 78, 71, 72,
673 87, 0, 0, 0, 93, 0, 0, 0, 0, 0, 0, 61, 0, 62, 80, 0, 32, 91, 92,
674 85, 0, 0, 0, 0, 0, 0, 66, 36, 0, 11, 0, 84, 84, 84, 12, 84, 0, 0,
675 0, 31, 0, 0, 0, 0, 26, 0, 0, 0, 0, 21, 0, 68, 0, 58, 57, 23, 0,
676 56, 30, 0, 20, 0, 24, 0, 0, 22, 29, 67, 0, 55, 59};
680 -182, -182, -182, -182, 191, -182, -182, 108, -182, -182, -182,
681 -182, 25, -107, 88, 89, 92, -7, -50, 215, -182, 13,
682 -181, -182, -182, -182, -182, -72, -56, 100, -76, -182};
686 -1, 1, 2, 6, 44, 45, 82, 83, 7, 20, 114, 196, 125, 126, 21, 22,
687 23, 46, 34, 35, 208, 209, 119, 204, 25, 40, 99, 100, 60, 133, 134, 41};
693 24, 70, 74, 107, 101, 102, 139, 8, 4, 29, -18, -18, -18, -18, -18,
694 90, 48, 203, 5, 49, -18, -18, -18, 11, 12, -18, 13, 14, -18, 32,
695 50, 33, 219, 15, 80, 16, 64, -18, 17, 79, 168, 18, 51, 42, 12,
696 81, 13, 14, 127, 3, 19, 92, 32, 15, 33, 43, 147, 151, 17, 148,
697 12, 18, 13, 14, 12, 142, 13, 14, 143, 15, 19, 157, 150, 15, 17,
698 159, 79, 18, 17, 171, 12, 18, 13, 14, 205, 206, 19, 9, 113, 15,
699 19, 79, 207, 115, 17, 116, 117, 18, 93, 94, 95, 96, 79, 192, 79,
700 118, 19, 97, 79, 155, 98, 122, 156, 123, 193, 32, 194, 33, 26, 131,
701 195, 124, 122, 132, 123, 201, 27, 188, 189, 190, 158, 191, 210, 76, 77,
702 38, 10, 78, 30, 103, 104, 105, 79, 56, 39, 56, 28, 202, 106, 57,
703 172, 89, 174, 56, 56, 128, 129, 31, 56, 149, 165, 212, 213, 216, 147,
704 214, 217, 218, 122, 37, 123, 169, 155, 205, 206, 47, 36, 52, 53, 54,
705 65, 58, 55, 59, 61, 67, 62, 68, 69, 71, 75, 66, 63, 72, 84,
706 87, 86, 88, 91, 108, 109, 110, 111, 120, 130, 80, 112, 121, 136, 137,
707 138, 140, 141, 146, 144, 145, 135, 166, 173, 152, 154, 163, 164, 167, 79,
708 211, 160, 161, 181, 221, 162, 153, 220, 0, 170, 175, 176, 177, 183, 184,
709 178, 179, 180, 182, 185, 186, 187, 197, 198, 199, 200, 0, 0, 0, 215,
710 0, 222, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
714 7, 51, 58, 79, 76, 77, 113, 22, 1, 16, 3, 4, 5, 6, 7, 71,
715 4, 198, 11, 7, 13, 14, 15, 3, 4, 18, 6, 7, 21, 18, 18, 20,
716 213, 13, 7, 15, 43, 30, 18, 17, 147, 21, 30, 3, 4, 18, 6, 7,
717 98, 0, 30, 29, 18, 13, 20, 15, 25, 129, 18, 28, 4, 21, 6, 7,
718 4, 31, 6, 7, 118, 13, 30, 15, 128, 13, 18, 15, 17, 21, 18, 155,
719 4, 21, 6, 7, 20, 21, 30, 20, 29, 13, 30, 17, 28, 18, 18, 20,
720 21, 21, 18, 19, 20, 21, 17, 29, 17, 30, 30, 27, 17, 25, 30, 18,
721 28, 20, 29, 18, 29, 20, 23, 23, 29, 28, 18, 27, 20, 28, 27, 183,
722 184, 185, 137, 187, 28, 8, 9, 5, 22, 12, 16, 18, 19, 20, 17, 25,
723 14, 25, 10, 197, 27, 31, 157, 31, 159, 25, 25, 24, 25, 16, 25, 31,
724 31, 28, 25, 25, 25, 28, 28, 28, 18, 26, 20, 24, 25, 20, 21, 18,
725 22, 26, 18, 21, 24, 20, 27, 20, 22, 26, 22, 16, 16, 20, 23, 25,
726 27, 18, 26, 18, 20, 18, 28, 25, 16, 28, 20, 16, 16, 7, 28, 27,
727 18, 10, 10, 16, 27, 27, 18, 18, 108, 28, 26, 18, 18, 18, 18, 18,
728 17, 200, 138, 138, 20, 216, 138, 131, 18, -1, 28, 26, 26, 26, 20, 20,
729 28, 28, 26, 26, 20, 20, 20, 27, 27, 27, 27, -1, -1, -1, 27, -1,
730 28, 66, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 56};
735 0, 33, 34, 0, 1, 11, 35, 40, 22, 20, 22, 3, 4, 6, 7, 13, 15, 18, 21,
736 30, 41, 46, 47, 48, 49, 56, 23, 27, 10, 49, 16, 16, 18, 20, 50, 51, 22, 26,
737 5, 14, 57, 63, 3, 15, 36, 37, 49, 18, 4, 7, 18, 30, 26, 18, 21, 27, 25,
738 31, 20, 20, 60, 22, 22, 27, 49, 24, 25, 26, 16, 16, 50, 20, 18, 51, 60, 23,
739 8, 9, 12, 17, 7, 18, 38, 39, 26, 36, 20, 18, 18, 31, 60, 28, 29, 18, 19,
740 20, 21, 27, 30, 58, 59, 59, 59, 18, 19, 20, 27, 62, 25, 16, 28, 20, 28, 29,
741 42, 18, 20, 21, 30, 54, 16, 27, 18, 20, 28, 44, 45, 50, 24, 25, 16, 23, 27,
742 61, 62, 39, 18, 10, 10, 45, 16, 27, 31, 50, 18, 18, 27, 25, 28, 31, 60, 59,
743 18, 61, 18, 25, 28, 15, 49, 15, 46, 47, 48, 18, 18, 31, 28, 18, 45, 24, 28,
744 62, 49, 26, 49, 26, 26, 26, 28, 28, 26, 20, 26, 20, 20, 20, 20, 20, 60, 60,
745 60, 60, 29, 29, 29, 29, 43, 27, 27, 27, 27, 28, 50, 54, 55, 20, 21, 28, 52,
746 53, 28, 44, 28, 25, 28, 27, 25, 28, 28, 54, 18, 53, 28};
750 0, 32, 33, 34, 34, 34, 35, 36, 36, 37, 37, 37, 37, 38, 38, 39, 39,
751 40, 40, 41, 41, 41, 41, 41, 41, 41, 41, 42, 42, 43, 43, 43, 44, 44,
752 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 47, 48, 48, 49, 49, 49, 50,
753 50, 51, 51, 51, 52, 52, 53, 53, 53, 54, 54, 54, 54, 54, 54, 54, 55,
754 55, 56, 56, 57, 58, 58, 59, 59, 59, 59, 59, 59, 59, 59, 59, 60, 60,
755 61, 61, 62, 62, 62, 62, 62, 62, 62, 63, 63, 63};
759 0, 2, 5, 3, 3, 0, 5, 3, 1, 3, 4, 8, 9, 1, 3, 3, 1, 3, 0, 6,
760 15, 14, 15, 14, 15, 6, 13, 2, 0, 4, 3, 0, 3, 1, 1, 1, 4, 1, 1, 3,
761 3, 3, 3, 5, 5, 1, 3, 1, 1, 1, 3, 1, 1, 1, 4, 3, 1, 1, 1, 4,
762 1, 3, 3, 2, 1, 1, 4, 3, 1, 3, 0, 6, 3, 1, 1, 1, 1, 3, 3, 1,
763 4, 3, 2, 3, 0, 3, 1, 3, 1, 1, 1, 4, 4, 3, 3, 4, 4};
765 #define yyerrok (yyerrstatus = 0)
766 #define yyclearin (yychar = YYEMPTY)
770 #define YYACCEPT goto yyacceptlab
771 #define YYABORT goto yyabortlab
772 #define YYERROR goto yyerrorlab
774 #define YYRECOVERING() (!!yyerrstatus)
776 #define YYBACKUP(Token, Value) \
778 if (yychar == YYEMPTY) { \
785 yyerror(context, model, ok, scanner, \
786 YY_("syntax error: cannot back up")); \
793 #define YYERRCODE 256
800 #define YYFPRINTF fprintf
803 #define YYDPRINTF(Args) \
805 if (yydebug) YYFPRINTF Args; \
809 #ifndef YY_LOCATION_PRINT
810 #define YY_LOCATION_PRINT(File, Loc) ((void)0)
813 #define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
816 YYFPRINTF(stderr, "%s ", Title); \
817 yy_symbol_print(stderr, Type, Value, context, model, ok, scanner); \
818 YYFPRINTF(stderr, "\n"); \
827 FILE* yyo,
int yytype,
YYSTYPE const*
const yyvaluep,
830 FILE* yyoutput = yyo;
836 if (!yyvaluep)
return;
838 if (yytype <
YYNTOKENS) YYPRINT(yyo, yytoknum[yytype], *yyvaluep);
868 for (; yybottom <= yytop; yybottom++) {
869 int yybot = *yybottom;
875 #define YY_STACK_PRINT(Bottom, Top) \
877 if (yydebug) yy_stack_print((Bottom), (Top)); \
889 int yynrhs =
yyr2[yyrule];
891 YYFPRINTF(stderr,
"Reducing stack by rule %d (line %d):\n", yyrule - 1,
894 for (yyi = 0; yyi < yynrhs; yyi++) {
897 &yyvsp[(yyi + 1) - (yynrhs)],
context,
model, ok, scanner);
902 #define YY_REDUCE_PRINT(Rule) \
905 yy_reduce_print(yyssp, yyvsp, Rule, context, model, ok, scanner); \
912 #define YYDPRINTF(Args)
913 #define YY_SYMBOL_PRINT(Title, Type, Value, Location)
914 #define YY_STACK_PRINT(Bottom, Top)
915 #define YY_REDUCE_PRINT(Rule)
920 #define YYINITDEPTH 200
931 #define YYMAXDEPTH 10000
937 #if defined __GLIBC__ && defined _STRING_H
938 #define yystrlen(S) (YY_CAST(YYPTRDIFF_T, strlen(S)))
943 for (yylen = 0; yystr[yylen]; yylen++)
continue;
950 #if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
951 #define yystpcpy stpcpy
955 static char*
yystpcpy(
char* yydest,
const char* yysrc) {
957 const char* yys = yysrc;
959 while ((*yyd++ = *yys++) !=
'\0')
continue;
977 char const* yyp = yystr;
979 for (;;)
switch (*++yyp) {
982 goto do_not_strip_quotes;
986 goto do_not_strip_quotes;
992 if (yyres) yyres[yyn] = *yyp;
997 if (yyres) yyres[yyn] =
'\0';
1000 do_not_strip_quotes:;
1004 return yystpcpy(yyres, yystr) - yyres;
1020 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1025 char const* yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1055 int yyn =
yypact[+*yyssp];
1058 yyarg[yycount++] =
yytname[yytoken];
1063 int yyxbegin = yyn < 0 ? -yyn : 0;
1065 int yychecklim =
YYLAST - yyn + 1;
1069 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1072 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) {
1077 yyarg[yycount++] =
yytname[yyx];
1090 #define YYCASE_(N, S) \
1096 YYCASE_(1,
YY_(
"syntax error, unexpected %s"));
1097 YYCASE_(2,
YY_(
"syntax error, unexpected %s, expecting %s"));
1098 YYCASE_(3,
YY_(
"syntax error, unexpected %s, expecting %s or %s"));
1099 YYCASE_(4,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s"));
1102 YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1116 if (*yymsg_alloc < yysize) {
1117 *yymsg_alloc = 2 * yysize;
1129 while ((*yyp = *yyformat) !=
'\0')
1130 if (*yyp ==
'%' && yyformat[1] ==
's' && yyi < yycount) {
1155 if (!yymsg) yymsg =
"Deleting";
1215 char* yymsg = yymsgbuf;
1219 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1225 yyssp = yyss = yyssa;
1226 yyvsp = yyvs = yyvsa;
1229 YYDPRINTF((stderr,
"Starting parse\n"));
1249 YYDPRINTF((stderr,
"Entering state %d\n", yystate));
1255 if (yyss + yystacksize - 1 <= yyssp)
1256 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1257 goto yyexhaustedlab;
1263 #if defined yyoverflow
1275 yyoverflow(
YY_(
"memory exhausted"), &yyss1, yysize *
YYSIZEOF(*yyssp),
1276 &yyvs1, yysize *
YYSIZEOF(*yyvsp), &yystacksize);
1282 if (
YYMAXDEPTH <= yystacksize)
goto yyexhaustedlab;
1291 if (!yyptr)
goto yyexhaustedlab;
1294 #undef YYSTACK_RELOCATE
1299 yyssp = yyss + yysize - 1;
1300 yyvsp = yyvs + yysize - 1;
1304 (stderr,
"Stack size increased to %ld\n",
YY_CAST(
long, yystacksize)));
1307 if (yyss + yystacksize - 1 <= yyssp)
YYABORT;
1330 YYDPRINTF((stderr,
"Reading a token: "));
1334 if (yychar <=
YYEOF) {
1335 yychar = yytoken =
YYEOF;
1336 YYDPRINTF((stderr,
"Now at end of input.\n"));
1345 if (yyn < 0 ||
YYLAST < yyn ||
yycheck[yyn] != yytoken)
goto yydefault;
1355 if (yyerrstatus) yyerrstatus--;
1373 if (yyn == 0)
goto yyerrlab;
1391 yyval = yyvsp[1 - yylen];
1396 #line 114 "./ortools/flatzinc/parser.yy"
1400 #line 1528 "./ortools/flatzinc/parser.tab.cc"
1404 #line 149 "./ortools/flatzinc/parser.yy"
1408 const Domain& domain = (yyvsp[-5].domain);
1409 const std::string& identifier = (yyvsp[-3].string_value);
1410 const Domain& assignment = (yyvsp[0].domain);
1411 std::vector<Annotation>*
const annotations = (yyvsp[-2].annotations);
1415 context->domain_map[identifier] = assignment;
1423 #line 1552 "./ortools/flatzinc/parser.tab.cc"
1427 #line 169 "./ortools/flatzinc/parser.yy"
1429 std::vector<Annotation>*
const annotations = (yyvsp[-4].annotations);
1431 CHECK_EQ((yyvsp[-12].integer_value), 1)
1432 <<
"Only [1..n] array are supported here.";
1433 const int64 num_constants = (yyvsp[-10].integer_value);
1434 const std::string& identifier = (yyvsp[-5].string_value);
1435 const std::vector<int64>*
const assignments = (yyvsp[-1].integers);
1436 CHECK(assignments !=
nullptr);
1437 CHECK_EQ(num_constants, assignments->size());
1439 context->integer_array_map[identifier] = *assignments;
1443 #line 1571 "./ortools/flatzinc/parser.tab.cc"
1447 #line 184 "./ortools/flatzinc/parser.yy"
1449 std::vector<Annotation>*
const annotations = (yyvsp[-3].annotations);
1451 CHECK_EQ((yyvsp[-11].integer_value), 1)
1452 <<
"Only [1..n] array are supported here.";
1453 const int64 num_constants = (yyvsp[-9].integer_value);
1454 CHECK_EQ(num_constants, 0) <<
"Empty arrays should have a size of 0";
1455 const std::string& identifier = (yyvsp[-4].string_value);
1456 context->integer_array_map[identifier] = std::vector<int64>();
1459 #line 1586 "./ortools/flatzinc/parser.tab.cc"
1463 #line 195 "./ortools/flatzinc/parser.yy"
1465 std::vector<Annotation>*
const annotations = (yyvsp[-4].annotations);
1467 CHECK_EQ((yyvsp[-12].integer_value), 1)
1468 <<
"Only [1..n] array are supported here.";
1469 const int64 num_constants = (yyvsp[-10].integer_value);
1470 const std::string& identifier = (yyvsp[-5].string_value);
1471 const std::vector<double>*
const assignments = (yyvsp[-1].doubles);
1472 CHECK(assignments !=
nullptr);
1473 CHECK_EQ(num_constants, assignments->size());
1475 context->float_array_map[identifier] = *assignments;
1479 #line 1605 "./ortools/flatzinc/parser.tab.cc"
1483 #line 210 "./ortools/flatzinc/parser.yy"
1485 std::vector<Annotation>*
const annotations = (yyvsp[-3].annotations);
1487 CHECK_EQ((yyvsp[-11].integer_value), 1)
1488 <<
"Only [1..n] array are supported here.";
1489 const int64 num_constants = (yyvsp[-9].integer_value);
1490 CHECK_EQ(num_constants, 0) <<
"Empty arrays should have a size of 0";
1491 const std::string& identifier = (yyvsp[-4].string_value);
1492 context->float_array_map[identifier] = std::vector<double>();
1495 #line 1620 "./ortools/flatzinc/parser.tab.cc"
1499 #line 221 "./ortools/flatzinc/parser.yy"
1502 CHECK_EQ((yyvsp[-12].integer_value), 1)
1503 <<
"Only [1..n] array are supported here.";
1504 const int64 num_constants = (yyvsp[-10].integer_value);
1505 const Domain& domain = (yyvsp[-7].domain);
1506 const std::string& identifier = (yyvsp[-5].string_value);
1507 const std::vector<Domain>*
const assignments = (yyvsp[-1].domains);
1508 const std::vector<Annotation>*
const annotations =
1509 (yyvsp[-4].annotations);
1510 CHECK(assignments !=
nullptr);
1511 CHECK_EQ(num_constants, assignments->size());
1514 context->domain_array_map[identifier] = *assignments;
1517 std::vector<int64> values(num_constants);
1518 for (
int i = 0; i < num_constants; ++i) {
1519 values[i] = (*assignments)[i].values.front();
1522 context->integer_array_map[identifier] = values;
1527 #line 1650 "./ortools/flatzinc/parser.tab.cc"
1531 #line 246 "./ortools/flatzinc/parser.yy"
1537 const Domain& domain = (yyvsp[-4].domain);
1538 const std::string& identifier = (yyvsp[-2].string_value);
1539 std::vector<Annotation>*
const annotations = (yyvsp[-1].annotations);
1541 const bool introduced =
ContainsId(annotations,
"var_is_introduced") ||
1542 absl::StartsWith(identifier,
"X_INTRODUCED");
1545 var =
model->AddVariable(identifier, domain, introduced);
1546 }
else if (assignment.
variable ==
nullptr) {
1549 identifier, Domain::IntegerValue(assignment.
value), introduced);
1552 var->Merge(identifier, domain, introduced);
1559 model->AddOutput(SolutionOutputSpecs::SingleVariable(
1564 #line 1688 "./ortools/flatzinc/parser.tab.cc"
1568 #line 280 "./ortools/flatzinc/parser.yy"
1573 CHECK_EQ((yyvsp[-10].integer_value), 1);
1574 const int64 num_vars = (yyvsp[-8].integer_value);
1575 const Domain& domain = (yyvsp[-4].domain);
1576 const std::string& identifier = (yyvsp[-2].string_value);
1577 std::vector<Annotation>*
const annotations = (yyvsp[-1].annotations);
1579 (yyvsp[0].var_or_value_array);
1580 CHECK(assignments ==
nullptr ||
1581 assignments->
variables.size() == num_vars);
1582 CHECK(assignments ==
nullptr || assignments->
values.size() == num_vars);
1583 const bool introduced =
ContainsId(annotations,
"var_is_introduced") ||
1584 absl::StartsWith(identifier,
"X_INTRODUCED");
1586 std::vector<IntegerVariable*> vars(num_vars,
nullptr);
1588 for (
int i = 0; i < num_vars; ++i) {
1589 const std::string var_name =
1590 absl::StrFormat(
"%s[%d]", identifier, i + 1);
1591 if (assignments ==
nullptr) {
1592 vars[i] =
model->AddVariable(var_name, domain, introduced);
1593 }
else if (assignments->
variables[i] ==
nullptr) {
1597 vars[i] =
model->AddVariable(var_name, Domain::IntegerValue(
value),
1601 CHECK(
var !=
nullptr);
1603 vars[i]->Merge(var_name, domain, introduced);
1609 context->variable_array_map[identifier] = vars;
1614 if (annotations !=
nullptr) {
1615 for (
int i = 0; i < annotations->size(); ++i) {
1620 CHECK_EQ(Annotation::ANNOTATION_LIST, ann.
annotations.back().type);
1623 std::vector<SolutionOutputSpecs::Bounds>
bounds;
1626 CHECK_EQ(Annotation::INTERVAL,
bound.type);
1627 bounds.emplace_back(SolutionOutputSpecs::Bounds(
1631 model->AddOutput(SolutionOutputSpecs::MultiDimensionalArray(
1638 #line 1760 "./ortools/flatzinc/parser.tab.cc"
1642 #line 349 "./ortools/flatzinc/parser.yy"
1646 #line 1766 "./ortools/flatzinc/parser.tab.cc"
1650 #line 350 "./ortools/flatzinc/parser.yy"
1652 (yyval.
var_or_value) = VariableRefOrValue::Undefined();
1654 #line 1772 "./ortools/flatzinc/parser.tab.cc"
1658 #line 353 "./ortools/flatzinc/parser.yy"
1662 #line 1778 "./ortools/flatzinc/parser.tab.cc"
1666 #line 354 "./ortools/flatzinc/parser.yy"
1670 #line 1784 "./ortools/flatzinc/parser.tab.cc"
1674 #line 355 "./ortools/flatzinc/parser.yy"
1678 #line 1790 "./ortools/flatzinc/parser.tab.cc"
1682 #line 358 "./ortools/flatzinc/parser.yy"
1687 #line 1799 "./ortools/flatzinc/parser.tab.cc"
1691 #line 362 "./ortools/flatzinc/parser.yy"
1696 #line 1808 "./ortools/flatzinc/parser.tab.cc"
1700 #line 368 "./ortools/flatzinc/parser.yy"
1705 #line 1814 "./ortools/flatzinc/parser.tab.cc"
1709 #line 369 "./ortools/flatzinc/parser.yy"
1712 const std::string&
id = (yyvsp[0].string_value);
1717 (yyval.
var_or_value) = VariableRefOrValue::VariableRef(
1720 LOG(ERROR) <<
"Unknown symbol " << id;
1721 (yyval.
var_or_value) = VariableRefOrValue::Undefined();
1725 #line 1832 "./ortools/flatzinc/parser.tab.cc"
1729 #line 382 "./ortools/flatzinc/parser.yy"
1732 const std::string&
id = (yyvsp[-3].string_value);
1733 const int64 value = (yyvsp[-1].integer_value);
1738 (yyval.
var_or_value) = VariableRefOrValue::VariableRef(
1741 LOG(ERROR) <<
"Unknown symbol " << id;
1742 (yyval.
var_or_value) = VariableRefOrValue::Undefined();
1746 #line 1853 "./ortools/flatzinc/parser.tab.cc"
1750 #line 400 "./ortools/flatzinc/parser.yy"
1752 (yyval.
domain) = Domain::Boolean();
1754 #line 1859 "./ortools/flatzinc/parser.tab.cc"
1758 #line 401 "./ortools/flatzinc/parser.yy"
1760 (yyval.
domain) = Domain::AllInt64();
1762 #line 1865 "./ortools/flatzinc/parser.tab.cc"
1766 #line 402 "./ortools/flatzinc/parser.yy"
1769 Domain::Interval((yyvsp[-2].integer_value), (yyvsp[0].integer_value));
1771 #line 1871 "./ortools/flatzinc/parser.tab.cc"
1775 #line 403 "./ortools/flatzinc/parser.yy"
1777 CHECK((yyvsp[-1].integers) !=
nullptr);
1778 (yyval.
domain) = Domain::IntegerList(std::move(*(yyvsp[-1].integers)));
1779 delete (yyvsp[-1].integers);
1781 #line 1881 "./ortools/flatzinc/parser.tab.cc"
1785 #line 410 "./ortools/flatzinc/parser.yy"
1787 (yyval.
domain) = Domain::SetOfBoolean();
1789 #line 1887 "./ortools/flatzinc/parser.tab.cc"
1793 #line 411 "./ortools/flatzinc/parser.yy"
1795 (yyval.
domain) = Domain::SetOfAllInt64();
1797 #line 1893 "./ortools/flatzinc/parser.tab.cc"
1801 #line 412 "./ortools/flatzinc/parser.yy"
1803 (yyval.
domain) = Domain::SetOfInterval((yyvsp[-2].integer_value),
1804 (yyvsp[0].integer_value));
1806 #line 1899 "./ortools/flatzinc/parser.tab.cc"
1810 #line 413 "./ortools/flatzinc/parser.yy"
1812 CHECK((yyvsp[-1].integers) !=
nullptr);
1814 Domain::SetOfIntegerList(std::move(*(yyvsp[-1].integers)));
1815 delete (yyvsp[-1].integers);
1817 #line 1909 "./ortools/flatzinc/parser.tab.cc"
1821 #line 420 "./ortools/flatzinc/parser.yy"
1823 (yyval.
domain) = Domain::AllInt64();
1825 #line 1915 "./ortools/flatzinc/parser.tab.cc"
1829 #line 421 "./ortools/flatzinc/parser.yy"
1833 (yyval.
domain) = Domain::Interval(lb, ub);
1835 #line 1925 "./ortools/flatzinc/parser.tab.cc"
1839 #line 428 "./ortools/flatzinc/parser.yy"
1841 (yyval.
domain) = (yyvsp[0].domain);
1843 #line 1931 "./ortools/flatzinc/parser.tab.cc"
1847 #line 429 "./ortools/flatzinc/parser.yy"
1849 (yyval.
domain) = (yyvsp[0].domain);
1851 #line 1937 "./ortools/flatzinc/parser.tab.cc"
1855 #line 430 "./ortools/flatzinc/parser.yy"
1857 (yyval.
domain) = (yyvsp[0].domain);
1859 #line 1943 "./ortools/flatzinc/parser.tab.cc"
1863 #line 433 "./ortools/flatzinc/parser.yy"
1865 (yyval.
integers) = (yyvsp[-2].integers);
1866 (yyval.
integers)->emplace_back((yyvsp[0].integer_value));
1868 #line 1949 "./ortools/flatzinc/parser.tab.cc"
1872 #line 434 "./ortools/flatzinc/parser.yy"
1874 (yyval.
integers) =
new std::vector<int64>();
1875 (yyval.
integers)->emplace_back((yyvsp[0].integer_value));
1877 #line 1955 "./ortools/flatzinc/parser.tab.cc"
1881 #line 437 "./ortools/flatzinc/parser.yy"
1885 #line 1961 "./ortools/flatzinc/parser.tab.cc"
1889 #line 438 "./ortools/flatzinc/parser.yy"
1894 #line 1967 "./ortools/flatzinc/parser.tab.cc"
1898 #line 439 "./ortools/flatzinc/parser.yy"
1902 (yyvsp[-1].integer_value));
1904 #line 1975 "./ortools/flatzinc/parser.tab.cc"
1908 #line 444 "./ortools/flatzinc/parser.yy"
1910 (yyval.
doubles) = (yyvsp[-2].doubles);
1911 (yyval.
doubles)->emplace_back((yyvsp[0].double_value));
1913 #line 1981 "./ortools/flatzinc/parser.tab.cc"
1917 #line 445 "./ortools/flatzinc/parser.yy"
1919 (yyval.
doubles) =
new std::vector<double>();
1920 (yyval.
doubles)->emplace_back((yyvsp[0].double_value));
1922 #line 1987 "./ortools/flatzinc/parser.tab.cc"
1926 #line 448 "./ortools/flatzinc/parser.yy"
1930 #line 1993 "./ortools/flatzinc/parser.tab.cc"
1934 #line 449 "./ortools/flatzinc/parser.yy"
1939 #line 1999 "./ortools/flatzinc/parser.tab.cc"
1943 #line 450 "./ortools/flatzinc/parser.yy"
1947 (yyvsp[-1].integer_value));
1949 #line 2007 "./ortools/flatzinc/parser.tab.cc"
1953 #line 455 "./ortools/flatzinc/parser.yy"
1955 (yyval.
domain) = Domain::IntegerValue((yyvsp[0].integer_value));
1957 #line 2013 "./ortools/flatzinc/parser.tab.cc"
1961 #line 456 "./ortools/flatzinc/parser.yy"
1964 Domain::Interval((yyvsp[-2].integer_value), (yyvsp[0].integer_value));
1966 #line 2019 "./ortools/flatzinc/parser.tab.cc"
1970 #line 457 "./ortools/flatzinc/parser.yy"
1972 CHECK((yyvsp[-1].integers) !=
nullptr);
1973 (yyval.
domain) = Domain::IntegerList(std::move(*(yyvsp[-1].integers)));
1974 delete (yyvsp[-1].integers);
1976 #line 2029 "./ortools/flatzinc/parser.tab.cc"
1980 #line 462 "./ortools/flatzinc/parser.yy"
1982 (yyval.
domain) = Domain::EmptyDomain();
1984 #line 2035 "./ortools/flatzinc/parser.tab.cc"
1988 #line 463 "./ortools/flatzinc/parser.yy"
1990 CHECK_EQ(std::round((yyvsp[0].double_value)), (yyvsp[0].double_value));
1992 Domain::IntegerValue(
static_cast<int64>((yyvsp[0].double_value)));
1994 #line 2044 "./ortools/flatzinc/parser.tab.cc"
1998 #line 467 "./ortools/flatzinc/parser.yy"
2000 (yyval.
domain) = Domain::IntegerValue(
2003 #line 2050 "./ortools/flatzinc/parser.tab.cc"
2007 #line 468 "./ortools/flatzinc/parser.yy"
2011 (yyvsp[-1].integer_value)));
2013 #line 2059 "./ortools/flatzinc/parser.tab.cc"
2017 #line 474 "./ortools/flatzinc/parser.yy"
2019 (yyval.
domains) = (yyvsp[-2].domains);
2020 (yyval.
domains)->emplace_back((yyvsp[0].domain));
2022 #line 2068 "./ortools/flatzinc/parser.tab.cc"
2026 #line 478 "./ortools/flatzinc/parser.yy"
2028 (yyval.
domains) =
new std::vector<Domain>();
2029 (yyval.
domains)->emplace_back((yyvsp[0].domain));
2031 #line 2074 "./ortools/flatzinc/parser.tab.cc"
2035 #line 488 "./ortools/flatzinc/parser.yy"
2037 const std::string& identifier = (yyvsp[-4].string_value);
2038 CHECK((yyvsp[-2].args) !=
nullptr) <<
"Missing argument in constraint";
2039 const std::vector<Argument>& arguments = *(yyvsp[-2].args);
2040 std::vector<Annotation>*
const annotations = (yyvsp[0].annotations);
2042 model->AddConstraint(identifier, arguments,
2045 delete (yyvsp[-2].args);
2047 #line 2089 "./ortools/flatzinc/parser.tab.cc"
2051 #line 500 "./ortools/flatzinc/parser.yy"
2053 (yyval.
args) = (yyvsp[-2].args);
2054 (yyval.
args)->emplace_back((yyvsp[0].arg));
2056 #line 2095 "./ortools/flatzinc/parser.tab.cc"
2060 #line 501 "./ortools/flatzinc/parser.yy"
2062 (yyval.
args) =
new std::vector<Argument>();
2063 (yyval.
args)->emplace_back((yyvsp[0].arg));
2065 #line 2101 "./ortools/flatzinc/parser.tab.cc"
2069 #line 504 "./ortools/flatzinc/parser.yy"
2071 (yyval.
arg) = Argument::IntegerValue((yyvsp[0].integer_value));
2073 #line 2107 "./ortools/flatzinc/parser.tab.cc"
2077 #line 505 "./ortools/flatzinc/parser.yy"
2079 (yyval.
arg) = Argument::IntegerValue(
2082 #line 2113 "./ortools/flatzinc/parser.tab.cc"
2086 #line 506 "./ortools/flatzinc/parser.yy"
2088 (yyval.
arg) = Argument::VoidArgument();
2090 #line 2119 "./ortools/flatzinc/parser.tab.cc"
2094 #line 507 "./ortools/flatzinc/parser.yy"
2096 (yyval.
arg) = Argument::Interval((yyvsp[-2].integer_value),
2097 (yyvsp[0].integer_value));
2099 #line 2125 "./ortools/flatzinc/parser.tab.cc"
2103 #line 508 "./ortools/flatzinc/parser.yy"
2105 CHECK((yyvsp[-1].integers) !=
nullptr);
2106 (yyval.
arg) = Argument::IntegerList(std::move(*(yyvsp[-1].integers)));
2107 delete (yyvsp[-1].integers);
2109 #line 2135 "./ortools/flatzinc/parser.tab.cc"
2113 #line 513 "./ortools/flatzinc/parser.yy"
2115 const std::string&
id = (yyvsp[0].string_value);
2120 (yyval.
arg) = Argument::IntegerList(
2126 const auto& double_values =
2128 std::vector<int64> integer_values;
2129 for (
const double d : double_values) {
2131 integer_values.push_back(i);
2133 (yyval.
arg) = Argument::IntegerList(std::move(integer_values));
2138 (yyval.
arg) = Argument::IntVarRefArray(
2142 (yyval.
arg) = Argument::FromDomain(d);
2145 <<
"Unknown identifier: " << id;
2146 const std::vector<Domain>& d =
2148 (yyval.
arg) = Argument::DomainList(d);
2151 #line 2171 "./ortools/flatzinc/parser.tab.cc"
2155 #line 544 "./ortools/flatzinc/parser.yy"
2157 const std::string&
id = (yyvsp[-3].string_value);
2158 const int64 index = (yyvsp[-1].integer_value);
2160 (yyval.
arg) = Argument::IntegerValue(
2163 (yyval.
arg) = Argument::IntVarRef(
2167 <<
"Unknown identifier: " << id;
2170 (yyval.
arg) = Argument::FromDomain(d);
2173 #line 2193 "./ortools/flatzinc/parser.tab.cc"
2177 #line 561 "./ortools/flatzinc/parser.yy"
2180 CHECK(arguments !=
nullptr);
2181 bool has_variables =
false;
2182 for (
int i = 0; i < arguments->
Size(); ++i) {
2183 if (arguments->
variables[i] !=
nullptr) {
2184 has_variables =
true;
2188 if (has_variables) {
2189 (yyval.
arg) = Argument::IntVarRefArray(std::vector<IntegerVariable*>());
2190 (yyval.
arg).variables.reserve(arguments->
Size());
2191 for (
int i = 0; i < arguments->
Size(); ++i) {
2192 if (arguments->
variables[i] !=
nullptr) {
2193 (yyval.
arg).variables.emplace_back(arguments->
variables[i]);
2195 (yyval.
arg).variables.emplace_back(
2200 (yyval.
arg) = Argument::IntegerList(arguments->
values);
2204 #line 2223 "./ortools/flatzinc/parser.tab.cc"
2208 #line 586 "./ortools/flatzinc/parser.yy"
2210 (yyval.
arg) = Argument::VoidArgument();
2212 #line 2231 "./ortools/flatzinc/parser.tab.cc"
2216 #line 595 "./ortools/flatzinc/parser.yy"
2218 (yyval.
annotations) = (yyvsp[-2].annotations) !=
nullptr
2219 ? (yyvsp[-2].annotations)
2220 :
new std::vector<Annotation>();
2221 (yyval.
annotations)->emplace_back((yyvsp[0].annotation));
2223 #line 2240 "./ortools/flatzinc/parser.tab.cc"
2227 #line 599 "./ortools/flatzinc/parser.yy"
2231 #line 2246 "./ortools/flatzinc/parser.tab.cc"
2235 #line 602 "./ortools/flatzinc/parser.yy"
2238 (yyval.
annotations)->emplace_back((yyvsp[0].annotation));
2240 #line 2252 "./ortools/flatzinc/parser.tab.cc"
2244 #line 603 "./ortools/flatzinc/parser.yy"
2246 (yyval.
annotations) =
new std::vector<Annotation>();
2247 (yyval.
annotations)->emplace_back((yyvsp[0].annotation));
2249 #line 2258 "./ortools/flatzinc/parser.tab.cc"
2253 #line 606 "./ortools/flatzinc/parser.yy"
2255 (yyval.
annotation) = Annotation::Interval((yyvsp[-2].integer_value),
2256 (yyvsp[0].integer_value));
2258 #line 2264 "./ortools/flatzinc/parser.tab.cc"
2262 #line 607 "./ortools/flatzinc/parser.yy"
2264 (yyval.
annotation) = Annotation::IntegerValue((yyvsp[0].integer_value));
2266 #line 2270 "./ortools/flatzinc/parser.tab.cc"
2270 #line 608 "./ortools/flatzinc/parser.yy"
2272 (yyval.
annotation) = Annotation::String((yyvsp[0].string_value));
2274 #line 2276 "./ortools/flatzinc/parser.tab.cc"
2278 #line 609 "./ortools/flatzinc/parser.yy"
2280 const std::string&
id = (yyvsp[0].string_value);
2285 (yyval.
annotation) = Annotation::VariableList(
2288 (yyval.
annotation) = Annotation::Identifier(
id);
2291 #line 2291 "./ortools/flatzinc/parser.tab.cc"
2295 #line 619 "./ortools/flatzinc/parser.yy"
2297 std::vector<Annotation>*
const annotations = (yyvsp[-1].annotations);
2298 if (annotations !=
nullptr) {
2299 (yyval.
annotation) = Annotation::FunctionCallWithArguments(
2300 (yyvsp[-3].string_value), std::move(*annotations));
2303 (yyval.
annotation) = Annotation::FunctionCall((yyvsp[-3].string_value));
2306 #line 2305 "./ortools/flatzinc/parser.tab.cc"
2310 #line 628 "./ortools/flatzinc/parser.yy"
2313 (yyvsp[-3].string_value)))
2314 <<
"Unknown identifier: " << (yyvsp[-3].string_value);
2317 (yyvsp[-1].integer_value)));
2319 #line 2316 "./ortools/flatzinc/parser.tab.cc"
2323 #line 634 "./ortools/flatzinc/parser.yy"
2325 std::vector<Annotation>*
const annotations = (yyvsp[-1].annotations);
2326 if (annotations !=
nullptr) {
2328 Annotation::AnnotationList(std::move(*annotations));
2334 #line 2330 "./ortools/flatzinc/parser.tab.cc"
2338 #line 649 "./ortools/flatzinc/parser.yy"
2340 if ((yyvsp[-1].annotations) !=
nullptr) {
2341 model->Satisfy(std::move(*(yyvsp[-1].annotations)));
2342 delete (yyvsp[-1].annotations);
2344 model->Satisfy(std::vector<Annotation>());
2347 #line 2343 "./ortools/flatzinc/parser.tab.cc"
2351 #line 657 "./ortools/flatzinc/parser.yy"
2353 CHECK_EQ(Argument::INT_VAR_REF, (yyvsp[0].arg).type);
2354 if ((yyvsp[-2].annotations) !=
nullptr) {
2355 model->Minimize((yyvsp[0].arg).Var(),
2356 std::move(*(yyvsp[-2].annotations)));
2357 delete (yyvsp[-2].annotations);
2359 model->Minimize((yyvsp[0].arg).Var(), std::vector<Annotation>());
2362 #line 2357 "./ortools/flatzinc/parser.tab.cc"
2366 #line 666 "./ortools/flatzinc/parser.yy"
2368 CHECK_EQ(Argument::INT_VAR_REF, (yyvsp[0].arg).type);
2369 if ((yyvsp[-2].annotations) !=
nullptr) {
2370 model->Maximize((yyvsp[0].arg).Var(),
2371 std::move(*(yyvsp[-2].annotations)));
2372 delete (yyvsp[-2].annotations);
2374 model->Maximize((yyvsp[0].arg).Var(), std::vector<Annotation>());
2377 #line 2371 "./ortools/flatzinc/parser.tab.cc"
2380 #line 2375 "./ortools/flatzinc/parser.tab.cc"
2409 const int yyi =
yypgoto[yylhs] + *yyssp;
2410 yystate = (0 <= yyi && yyi <=
YYLAST &&
yycheck[yyi] == *yyssp
2428 #if !YYERROR_VERBOSE
2431 #define YYSYNTAX_ERROR yysyntax_error(&yymsg_alloc, &yymsg, yyssp, yytoken)
2433 char const* yymsgp =
YY_(
"syntax error");
2434 int yysyntax_error_status;
2436 if (yysyntax_error_status == 0)
2438 else if (yysyntax_error_status == 1) {
2443 yymsg_alloc =
sizeof yymsgbuf;
2444 yysyntax_error_status = 2;
2451 if (yysyntax_error_status == 2)
goto yyexhaustedlab;
2453 #undef YYSYNTAX_ERROR
2457 if (yyerrstatus == 3) {
2461 if (yychar <=
YYEOF) {
2541 #if !defined yyoverflow || YYERROR_VERBOSE
2560 model, ok, scanner);
2566 while (yyssp != yyss) {
2579 #line 676 "./ortools/flatzinc/parser.yy"