OR-Tools  8.0
parser.tab.cc
Go to the documentation of this file.
1 // Copyright 2010-2018 Google LLC
2 // Licensed under the Apache License, Version 2.0 (the "License");
3 // you may not use this file except in compliance with the License.
4 // You may obtain a copy of the License at
5 //
6 // http://www.apache.org/licenses/LICENSE-2.0
7 //
8 // Unless required by applicable law or agreed to in writing, software
9 // distributed under the License is distributed on an "AS IS" BASIS,
10 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 // See the License for the specific language governing permissions and
12 // limitations under the License.
13 
14 /* A Bison parser, made by GNU Bison 3.5.1. */
15 
16 /* Bison implementation for Yacc-like parsers in C
17 
18  Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation,
19  Inc.
20 
21  This program is free software: you can redistribute it and/or modify
22  it under the terms of the GNU General Public License as published by
23  the Free Software Foundation, either version 3 of the License, or
24  (at your option) any later version.
25 
26  This program is distributed in the hope that it will be useful,
27  but WITHOUT ANY WARRANTY; without even the implied warranty of
28  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29  GNU General Public License for more details.
30 
31  You should have received a copy of the GNU General Public License
32  along with this program. If not, see <http://www.gnu.org/licenses/>. */
33 
34 /* As a special exception, you may create a larger work that contains
35  part or all of the Bison parser skeleton and distribute that work
36  under terms of your choice, so long as that work isn't itself a
37  parser generator using the skeleton or a modified version thereof
38  as a parser skeleton. Alternatively, if you modify or redistribute
39  the parser skeleton itself, you may (at your option) remove this
40  special exception, which will cause the skeleton and the resulting
41  Bison output files to be licensed under the GNU General Public
42  License without this special exception.
43 
44  This special exception was added by the Free Software Foundation in
45  version 2.2 of Bison. */
46 
47 /* C LALR(1) parser skeleton written by Richard Stallman, by
48  simplifying the original so-called "semantic" parser. */
49 
50 /* All symbols defined below should begin with yy or YY, to avoid
51  infringing on user name space. This should be done even for local
52  variables, as they might otherwise be expanded by user macros.
53  There are some unavoidable exceptions within include files to
54  define necessary library symbols; they are noted "INFRINGES ON
55  USER NAME SPACE" below. */
56 
57 /* Undocumented macros, especially those whose name start with YY_,
58  are private implementation details. Do not rely on them. */
59 
60 /* Identify Bison output. */
61 #define YYBISON 1
62 
63 /* Bison version. */
64 #define YYBISON_VERSION "3.5.1"
65 
66 /* Skeleton name. */
67 #define YYSKELETON_NAME "yacc.c"
68 
69 /* Pure parsers. */
70 #define YYPURE 2
71 
72 /* Push parsers. */
73 #define YYPUSH 0
74 
75 /* Pull parsers. */
76 #define YYPULL 1
77 
78 /* Substitute the type names. */
79 #define YYSTYPE ORFZ_STYPE
80 /* Substitute the variable and function names. */
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
86 
87 #ifndef YY_CAST
88 #ifdef __cplusplus
89 #define YY_CAST(Type, Val) static_cast<Type>(Val)
90 #define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type>(Val)
91 #else
92 #define YY_CAST(Type, Val) ((Type)(Val))
93 #define YY_REINTERPRET_CAST(Type, Val) ((Type)(Val))
94 #endif
95 #endif
96 #ifndef YY_NULLPTR
97 #if defined __cplusplus
98 #if 201103L <= __cplusplus
99 #define YY_NULLPTR nullptr
100 #else
101 #define YY_NULLPTR 0
102 #endif
103 #else
104 #define YY_NULLPTR ((void*)0)
105 #endif
106 #endif
107 
108 /* Enabling verbose error messages. */
109 #ifdef YYERROR_VERBOSE
110 #undef YYERROR_VERBOSE
111 #define YYERROR_VERBOSE 1
112 #else
113 #define YYERROR_VERBOSE 1
114 #endif
115 
116 /* Use api.header.include to #include this header
117  instead of duplicating it here. */
118 #ifndef YY_ORFZ_ORTOOLS_FLATZINC_PARSER_TAB_HH_INCLUDED
119 #define YY_ORFZ_ORTOOLS_FLATZINC_PARSER_TAB_HH_INCLUDED
120 /* Debug traces. */
121 #ifndef ORFZ_DEBUG
122 #if defined YYDEBUG
123 #if YYDEBUG
124 #define ORFZ_DEBUG 1
125 #else
126 #define ORFZ_DEBUG 0
127 #endif
128 #else /* ! defined YYDEBUG */
129 #define ORFZ_DEBUG 1
130 #endif /* ! defined YYDEBUG */
131 #endif /* ! defined ORFZ_DEBUG */
132 #if ORFZ_DEBUG
133 extern int orfz_debug;
134 #endif
135 /* "%code requires" blocks. */
136 #line 19 "./ortools/flatzinc/parser.yy"
137 
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"
143 
144 // Tells flex to use the LexerInfo class to communicate with the bison parser.
146 
147 // Defines the parameter to the orfz_lex() call from the orfz_parse() method.
148 #define YYLEX_PARAM scanner
149 
150 #endif // OR_TOOLS_FLATZINC_FLATZINC_TAB_HH_
151 
152 #line 141 "./ortools/flatzinc/parser.tab.cc"
153 
154 /* Token type. */
155 #ifndef ORFZ_TOKENTYPE
156 #define ORFZ_TOKENTYPE
158  ARRAY = 258,
159  TOKEN_BOOL = 259,
160  CONSTRAINT = 260,
161  TOKEN_FLOAT = 261,
162  TOKEN_INT = 262,
163  MAXIMIZE = 263,
164  MINIMIZE = 264,
165  OF = 265,
166  PREDICATE = 266,
167  SATISFY = 267,
168  SET = 268,
169  SOLVE = 269,
170  VAR = 270,
171  DOTDOT = 271,
172  COLONCOLON = 272,
173  IVALUE = 273,
174  SVALUE = 274,
175  IDENTIFIER = 275,
176  DVALUE = 276
177 };
178 #endif
179 
180 /* Value type. */
181 
183  operations_research::fz::Model* model, bool* ok, void* scanner);
184 
185 #endif /* !YY_ORFZ_ORTOOLS_FLATZINC_PARSER_TAB_HH_INCLUDED */
186 
187 /* Unqualified %code blocks. */
188 #line 36 "./ortools/flatzinc/parser.yy"
189 
190 #include "absl/strings/match.h"
191 #include "absl/strings/str_format.h"
193 
206 
207 #line 199 "./ortools/flatzinc/parser.tab.cc"
208 
209 #ifdef short
210 #undef short
211 #endif
212 
213 /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
214  <limits.h> and (if available) <stdint.h> are included
215  so that the code can choose integer types of a good width. */
216 
217 #ifndef __PTRDIFF_MAX__
218 #include <limits.h> /* INFRINGES ON USER NAME SPACE */
219 #if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
220 #include <stdint.h> /* INFRINGES ON USER NAME SPACE */
221 #define YY_STDINT_H
222 #endif
223 #endif
224 
225 /* Narrow types that promote to a signed type and that can represent a
226  signed or unsigned integer of at least N bits. In tables they can
227  save space and decrease cache pressure. Promoting to a signed type
228  helps avoid bugs in integer arithmetic. */
229 
230 #ifdef __INT_LEAST8_MAX__
231 typedef __INT_LEAST8_TYPE__ yytype_int8;
232 #elif defined YY_STDINT_H
233 typedef int_least8_t yytype_int8;
234 #else
235 typedef signed char yytype_int8;
236 #endif
237 
238 #ifdef __INT_LEAST16_MAX__
239 typedef __INT_LEAST16_TYPE__ yytype_int16;
240 #elif defined YY_STDINT_H
241 typedef int_least16_t yytype_int16;
242 #else
243 typedef short yytype_int16;
244 #endif
245 
246 #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
247 typedef __UINT_LEAST8_TYPE__ yytype_uint8;
248 #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H && \
249  UINT_LEAST8_MAX <= INT_MAX)
250 typedef uint_least8_t yytype_uint8;
251 #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
252 typedef unsigned char yytype_uint8;
253 #else
254 typedef short yytype_uint8;
255 #endif
256 
257 #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
258 typedef __UINT_LEAST16_TYPE__ yytype_uint16;
259 #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H && \
260  UINT_LEAST16_MAX <= INT_MAX)
261 typedef uint_least16_t yytype_uint16;
262 #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
263 typedef unsigned short yytype_uint16;
264 #else
265 typedef int yytype_uint16;
266 #endif
267 
268 #ifndef YYPTRDIFF_T
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
273 #ifndef ptrdiff_t
274 #include <stddef.h> /* INFRINGES ON USER NAME SPACE */
275 #endif
276 #define YYPTRDIFF_T ptrdiff_t
277 #define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
278 #else
279 #define YYPTRDIFF_T long
280 #define YYPTRDIFF_MAXIMUM LONG_MAX
281 #endif
282 #endif
283 
284 #ifndef YYSIZE_T
285 #ifdef __SIZE_TYPE__
286 #define YYSIZE_T __SIZE_TYPE__
287 #elif defined size_t
288 #define YYSIZE_T size_t
289 #elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
290 #include <stddef.h> /* INFRINGES ON USER NAME SPACE */
291 #define YYSIZE_T size_t
292 #else
293 #define YYSIZE_T unsigned
294 #endif
295 #endif
296 
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)))
301 
302 #define YYSIZEOF(X) YY_CAST(YYPTRDIFF_T, sizeof(X))
303 
304 /* Stored state numbers (used for stacks). */
306 
307 /* State numbers in computations. */
308 typedef int yy_state_fast_t;
309 
310 #ifndef YY_
311 #if defined YYENABLE_NLS && YYENABLE_NLS
312 #if ENABLE_NLS
313 #include <libintl.h> /* INFRINGES ON USER NAME SPACE */
314 #define YY_(Msgid) dgettext("bison-runtime", Msgid)
315 #endif
316 #endif
317 #ifndef YY_
318 #define YY_(Msgid) Msgid
319 #endif
320 #endif
321 
322 #ifndef YY_ATTRIBUTE_PURE
323 #if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
324 #define YY_ATTRIBUTE_PURE __attribute__((__pure__))
325 #else
326 #define YY_ATTRIBUTE_PURE
327 #endif
328 #endif
329 
330 #ifndef YY_ATTRIBUTE_UNUSED
331 #if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
332 #define YY_ATTRIBUTE_UNUSED __attribute__((__unused__))
333 #else
334 #define YY_ATTRIBUTE_UNUSED
335 #endif
336 #endif
337 
338 /* Suppress unused-variable warnings by "using" E. */
339 #if !defined lint || defined __GNUC__
340 #define YYUSE(E) ((void)(E))
341 #else
342 #define YYUSE(E) /* empty */
343 #endif
344 
345 #if defined __GNUC__ && !defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
346 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
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")
352 #else
353 #define YY_INITIAL_VALUE(Value) Value
354 #endif
355 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
356 #define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
357 #define YY_IGNORE_MAYBE_UNINITIALIZED_END
358 #endif
359 #ifndef YY_INITIAL_VALUE
360 #define YY_INITIAL_VALUE(Value) /* Nothing. */
361 #endif
362 
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")
368 #endif
369 #ifndef YY_IGNORE_USELESS_CAST_BEGIN
370 #define YY_IGNORE_USELESS_CAST_BEGIN
371 #define YY_IGNORE_USELESS_CAST_END
372 #endif
373 
374 #define YY_ASSERT(E) ((void)(0 && (E)))
375 
376 #if !defined yyoverflow || YYERROR_VERBOSE
377 
378 /* The parser invokes alloca or malloc; define the necessary symbols. */
379 
380 #ifdef YYSTACK_USE_ALLOCA
381 #if YYSTACK_USE_ALLOCA
382 #ifdef __GNUC__
383 #define YYSTACK_ALLOC __builtin_alloca
384 #elif defined __BUILTIN_VA_ARG_INCR
385 #include <alloca.h> /* INFRINGES ON USER NAME SPACE */
386 #elif defined _AIX
387 #define YYSTACK_ALLOC __alloca
388 #elif defined _MSC_VER
389 #include <malloc.h> /* INFRINGES ON USER NAME SPACE */
390 #define alloca _alloca
391 #else
392 #define YYSTACK_ALLOC alloca
393 #if !defined _ALLOCA_H && !defined EXIT_SUCCESS
394 #include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
395 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
396 #ifndef EXIT_SUCCESS
397 #define EXIT_SUCCESS 0
398 #endif
399 #endif
400 #endif
401 #endif
402 #endif
403 
404 #ifdef YYSTACK_ALLOC
405 /* Pacify GCC's 'empty if-body' warning. */
406 #define YYSTACK_FREE(Ptr) \
407  do { /* empty */ \
408  ; \
409  } while (0)
410 #ifndef YYSTACK_ALLOC_MAXIMUM
411 /* The OS might guarantee only one guard page at the bottom of the stack,
412  and a page size can be as small as 4096 bytes. So we cannot safely
413  invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
414  to allow for a few compiler-allocated temporary stack slots. */
415 #define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
416 #endif
417 #else
418 #define YYSTACK_ALLOC YYMALLOC
419 #define YYSTACK_FREE YYFREE
420 #ifndef YYSTACK_ALLOC_MAXIMUM
421 #define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
422 #endif
423 #if (defined __cplusplus && !defined EXIT_SUCCESS && \
424  !((defined YYMALLOC || defined malloc) && \
425  (defined YYFREE || defined free)))
426 #include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
427 #ifndef EXIT_SUCCESS
428 #define EXIT_SUCCESS 0
429 #endif
430 #endif
431 #ifndef YYMALLOC
432 #define YYMALLOC malloc
433 #if !defined malloc && !defined EXIT_SUCCESS
434 void* malloc(YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
435 #endif
436 #endif
437 #ifndef YYFREE
438 #define YYFREE free
439 #if !defined free && !defined EXIT_SUCCESS
440 void free(void*); /* INFRINGES ON USER NAME SPACE */
441 #endif
442 #endif
443 #endif
444 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
445 
446 #if (!defined yyoverflow && \
447  (!defined __cplusplus || \
448  (defined ORFZ_STYPE_IS_TRIVIAL && ORFZ_STYPE_IS_TRIVIAL)))
449 
450 /* A type that is properly aligned for any stack member. */
451 union yyalloc {
454 };
455 
456 /* The size of the maximum gap between one aligned stack and the next. */
457 #define YYSTACK_GAP_MAXIMUM (YYSIZEOF(union yyalloc) - 1)
458 
459 /* The size of an array large to enough to hold all stacks, each with
460  N elements. */
461 #define YYSTACK_BYTES(N) \
462  ((N) * (YYSIZEOF(yy_state_t) + YYSIZEOF(YYSTYPE)) + YYSTACK_GAP_MAXIMUM)
463 
464 #define YYCOPY_NEEDED 1
465 
466 /* Relocate STACK from its old location to the new one. The
467  local variables YYSIZE and YYSTACKSIZE give the old and new number of
468  elements in the stack, and YYPTR gives the new location of the
469  stack. Advance YYPTR to a properly aligned location for the next
470  stack. */
471 #define YYSTACK_RELOCATE(Stack_alloc, Stack) \
472  do { \
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); \
478  } while (0)
479 
480 #endif
481 
482 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
483 /* Copy COUNT objects from SRC to DST. The source and destination do
484  not overlap. */
485 #ifndef YYCOPY
486 #if defined __GNUC__ && 1 < __GNUC__
487 #define YYCOPY(Dst, Src, Count) \
488  __builtin_memcpy(Dst, Src, YY_CAST(YYSIZE_T, (Count)) * sizeof(*(Src)))
489 #else
490 #define YYCOPY(Dst, Src, Count) \
491  do { \
492  YYPTRDIFF_T yyi; \
493  for (yyi = 0; yyi < (Count); yyi++) (Dst)[yyi] = (Src)[yyi]; \
494  } while (0)
495 #endif
496 #endif
497 #endif /* !YYCOPY_NEEDED */
498 
499 /* YYFINAL -- State number of the termination state. */
500 #define YYFINAL 3
501 /* YYLAST -- Last index in YYTABLE. */
502 #define YYLAST 271
503 
504 /* YYNTOKENS -- Number of terminals. */
505 #define YYNTOKENS 32
506 /* YYNNTS -- Number of nonterminals. */
507 #define YYNNTS 32
508 /* YYNRULES -- Number of rules. */
509 #define YYNRULES 96
510 /* YYNSTATES -- Number of states. */
511 #define YYNSTATES 223
512 
513 #define YYUNDEFTOK 2
514 #define YYMAXUTOK 276
515 
516 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
517  as returned by yylex, with out-of-bounds checking. */
518 #define YYTRANSLATE(YYX) \
519  (0 <= (YYX) && (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
520 
521 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
522  as returned by yylex. */
523 static const yytype_int8 yytranslate[] = {
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};
538 
539 #if ORFZ_DEBUG
540 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
541 static const yytype_int16 yyrline[] = {
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};
549 #endif
550 
551 #if ORFZ_DEBUG || YYERROR_VERBOSE || 1
552 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
553  First, the terminals, then, starting at YYNTOKENS, nonterminals. */
554 static const char* const yytname[] = {"$end",
555  "error",
556  "$undefined",
557  "ARRAY",
558  "TOKEN_BOOL",
559  "CONSTRAINT",
560  "TOKEN_FLOAT",
561  "TOKEN_INT",
562  "MAXIMIZE",
563  "MINIMIZE",
564  "OF",
565  "PREDICATE",
566  "SATISFY",
567  "SET",
568  "SOLVE",
569  "VAR",
570  "DOTDOT",
571  "COLONCOLON",
572  "IVALUE",
573  "SVALUE",
574  "IDENTIFIER",
575  "DVALUE",
576  "';'",
577  "'('",
578  "')'",
579  "','",
580  "':'",
581  "'['",
582  "']'",
583  "'='",
584  "'{'",
585  "'}'",
586  "$accept",
587  "model",
588  "predicates",
589  "predicate",
590  "predicate_arguments",
591  "predicate_argument",
592  "predicate_array_argument",
593  "predicate_ints",
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",
599  "var_or_value",
600  "int_domain",
601  "set_domain",
602  "float_domain",
603  "domain",
604  "integers",
605  "integer",
606  "floats",
607  "float",
608  "const_literal",
609  "const_literals",
610  "constraints",
611  "constraint",
612  "arguments",
613  "argument",
614  "annotations",
615  "annotation_arguments",
616  "annotation",
617  "solve",
618  YY_NULLPTR};
619 #endif
620 
621 #ifdef YYPRINT
622 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
623  (internal) symbol number NUM (which must be that of a token). */
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};
628 #endif
629 
630 #define YYPACT_NINF (-182)
631 
632 #define yypact_value_is_default(Yyn) ((Yyn) == YYPACT_NINF)
633 
634 #define YYTABLE_NINF (-19)
635 
636 #define yytable_value_is_error(Yyn) 0
637 
638 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
639  STATE-NUM. */
640 static const yytype_int16 yypact[] = {
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};
660 
661 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
662  Performed when YYTABLE does not specify something else to do. Zero
663  means the default is an error. */
664 static const yytype_int8 yydefact[] = {
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};
677 
678 /* YYPGOTO[NTERM-NUM]. */
679 static const yytype_int16 yypgoto[] = {
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};
683 
684 /* YYDEFGOTO[NTERM-NUM]. */
685 static const yytype_int16 yydefgoto[] = {
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};
688 
689 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
690  positive, shift that token. If negative, reduce the rule whose
691  number is the opposite. If YYTABLE_NINF, syntax error. */
692 static const yytype_int16 yytable[] = {
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,
711  0, 73};
712 
713 static const yytype_int16 yycheck[] = {
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};
731 
732 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
733  symbol of state STATE-NUM. */
734 static const yytype_int8 yystos[] = {
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};
747 
748 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
749 static const yytype_int8 yyr1[] = {
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};
756 
757 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
758 static const yytype_int8 yyr2[] = {
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};
764 
765 #define yyerrok (yyerrstatus = 0)
766 #define yyclearin (yychar = YYEMPTY)
767 #define YYEMPTY (-2)
768 #define YYEOF 0
769 
770 #define YYACCEPT goto yyacceptlab
771 #define YYABORT goto yyabortlab
772 #define YYERROR goto yyerrorlab
773 
774 #define YYRECOVERING() (!!yyerrstatus)
775 
776 #define YYBACKUP(Token, Value) \
777  do \
778  if (yychar == YYEMPTY) { \
779  yychar = (Token); \
780  yylval = (Value); \
781  YYPOPSTACK(yylen); \
782  yystate = *yyssp; \
783  goto yybackup; \
784  } else { \
785  yyerror(context, model, ok, scanner, \
786  YY_("syntax error: cannot back up")); \
787  YYERROR; \
788  } \
789  while (0)
790 
791 /* Error token number */
792 #define YYTERROR 1
793 #define YYERRCODE 256
794 
795 /* Enable debugging if requested. */
796 #if ORFZ_DEBUG
797 
798 #ifndef YYFPRINTF
799 #include <stdio.h> /* INFRINGES ON USER NAME SPACE */
800 #define YYFPRINTF fprintf
801 #endif
802 
803 #define YYDPRINTF(Args) \
804  do { \
805  if (yydebug) YYFPRINTF Args; \
806  } while (0)
807 
808 /* This macro is provided for backward compatibility. */
809 #ifndef YY_LOCATION_PRINT
810 #define YY_LOCATION_PRINT(File, Loc) ((void)0)
811 #endif
812 
813 #define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
814  do { \
815  if (yydebug) { \
816  YYFPRINTF(stderr, "%s ", Title); \
817  yy_symbol_print(stderr, Type, Value, context, model, ok, scanner); \
818  YYFPRINTF(stderr, "\n"); \
819  } \
820  } while (0)
821 
822 /*-----------------------------------.
823 | Print this symbol's value on YYO. |
824 `-----------------------------------*/
825 
827  FILE* yyo, int yytype, YYSTYPE const* const yyvaluep,
829  operations_research::fz::Model* model, bool* ok, void* scanner) {
830  FILE* yyoutput = yyo;
831  YYUSE(yyoutput);
832  YYUSE(context);
833  YYUSE(model);
834  YYUSE(ok);
835  YYUSE(scanner);
836  if (!yyvaluep) return;
837 #ifdef YYPRINT
838  if (yytype < YYNTOKENS) YYPRINT(yyo, yytoknum[yytype], *yyvaluep);
839 #endif
841  YYUSE(yytype);
843 }
844 
845 /*---------------------------.
846 | Print this symbol on YYO. |
847 `---------------------------*/
848 
849 static void yy_symbol_print(FILE* yyo, int yytype,
850  YYSTYPE const* const yyvaluep,
853  void* scanner) {
854  YYFPRINTF(yyo, "%s %s (", yytype < YYNTOKENS ? "token" : "nterm",
855  yytname[yytype]);
856 
857  yy_symbol_value_print(yyo, yytype, yyvaluep, context, model, ok, scanner);
858  YYFPRINTF(yyo, ")");
859 }
860 
861 /*------------------------------------------------------------------.
862 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
863 | TOP (included). |
864 `------------------------------------------------------------------*/
865 
866 static void yy_stack_print(yy_state_t* yybottom, yy_state_t* yytop) {
867  YYFPRINTF(stderr, "Stack now");
868  for (; yybottom <= yytop; yybottom++) {
869  int yybot = *yybottom;
870  YYFPRINTF(stderr, " %d", yybot);
871  }
872  YYFPRINTF(stderr, "\n");
873 }
874 
875 #define YY_STACK_PRINT(Bottom, Top) \
876  do { \
877  if (yydebug) yy_stack_print((Bottom), (Top)); \
878  } while (0)
879 
880 /*------------------------------------------------.
881 | Report that the YYRULE is going to be reduced. |
882 `------------------------------------------------*/
883 
884 static void yy_reduce_print(yy_state_t* yyssp, YYSTYPE* yyvsp, int yyrule,
887  void* scanner) {
888  int yylno = yyrline[yyrule];
889  int yynrhs = yyr2[yyrule];
890  int yyi;
891  YYFPRINTF(stderr, "Reducing stack by rule %d (line %d):\n", yyrule - 1,
892  yylno);
893  /* The symbols being reduced. */
894  for (yyi = 0; yyi < yynrhs; yyi++) {
895  YYFPRINTF(stderr, " $%d = ", yyi + 1);
896  yy_symbol_print(stderr, yystos[+yyssp[yyi + 1 - yynrhs]],
897  &yyvsp[(yyi + 1) - (yynrhs)], context, model, ok, scanner);
898  YYFPRINTF(stderr, "\n");
899  }
900 }
901 
902 #define YY_REDUCE_PRINT(Rule) \
903  do { \
904  if (yydebug) \
905  yy_reduce_print(yyssp, yyvsp, Rule, context, model, ok, scanner); \
906  } while (0)
907 
908 /* Nonzero means print parse trace. It is left uninitialized so that
909  multiple parsers can coexist. */
911 #else /* !ORFZ_DEBUG */
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)
916 #endif /* !ORFZ_DEBUG */
917 
918 /* YYINITDEPTH -- initial size of the parser's stacks. */
919 #ifndef YYINITDEPTH
920 #define YYINITDEPTH 200
921 #endif
922 
923 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
924  if the built-in stack extension method is used).
925 
926  Do not make this value too large; the results are undefined if
927  YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
928  evaluated with infinite-precision integer arithmetic. */
929 
930 #ifndef YYMAXDEPTH
931 #define YYMAXDEPTH 10000
932 #endif
933 
934 #if YYERROR_VERBOSE
935 
936 #ifndef yystrlen
937 #if defined __GLIBC__ && defined _STRING_H
938 #define yystrlen(S) (YY_CAST(YYPTRDIFF_T, strlen(S)))
939 #else
940 /* Return the length of YYSTR. */
941 static YYPTRDIFF_T yystrlen(const char* yystr) {
942  YYPTRDIFF_T yylen;
943  for (yylen = 0; yystr[yylen]; yylen++) continue;
944  return yylen;
945 }
946 #endif
947 #endif
948 
949 #ifndef yystpcpy
950 #if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
951 #define yystpcpy stpcpy
952 #else
953 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
954  YYDEST. */
955 static char* yystpcpy(char* yydest, const char* yysrc) {
956  char* yyd = yydest;
957  const char* yys = yysrc;
958 
959  while ((*yyd++ = *yys++) != '\0') continue;
960 
961  return yyd - 1;
962 }
963 #endif
964 #endif
965 
966 #ifndef yytnamerr
967 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
968  quotes and backslashes, so that it's suitable for yyerror. The
969  heuristic is that double-quoting is unnecessary unless the string
970  contains an apostrophe, a comma, or backslash (other than
971  backslash-backslash). YYSTR is taken from yytname. If YYRES is
972  null, do not copy; instead, return the length of what the result
973  would have been. */
974 static YYPTRDIFF_T yytnamerr(char* yyres, const char* yystr) {
975  if (*yystr == '"') {
976  YYPTRDIFF_T yyn = 0;
977  char const* yyp = yystr;
978 
979  for (;;) switch (*++yyp) {
980  case '\'':
981  case ',':
982  goto do_not_strip_quotes;
983 
984  case '\\':
985  if (*++yyp != '\\')
986  goto do_not_strip_quotes;
987  else
988  goto append;
989 
990  append:
991  default:
992  if (yyres) yyres[yyn] = *yyp;
993  yyn++;
994  break;
995 
996  case '"':
997  if (yyres) yyres[yyn] = '\0';
998  return yyn;
999  }
1000  do_not_strip_quotes:;
1001  }
1002 
1003  if (yyres)
1004  return yystpcpy(yyres, yystr) - yyres;
1005  else
1006  return yystrlen(yystr);
1007 }
1008 #endif
1009 
1010 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1011  about the unexpected token YYTOKEN for the state stack whose top is
1012  YYSSP.
1013 
1014  Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1015  not large enough to hold the message. In that case, also set
1016  *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1017  required number of bytes is too large to store. */
1018 static int yysyntax_error(YYPTRDIFF_T* yymsg_alloc, char** yymsg,
1019  yy_state_t* yyssp, int yytoken) {
1020  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1021  /* Internationalized format string. */
1022  const char* yyformat = YY_NULLPTR;
1023  /* Arguments of yyformat: reported tokens (one for the "unexpected",
1024  one per "expected"). */
1025  char const* yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1026  /* Actual size of YYARG. */
1027  int yycount = 0;
1028  /* Cumulated lengths of YYARG. */
1029  YYPTRDIFF_T yysize = 0;
1030 
1031  /* There are many possibilities here to consider:
1032  - If this state is a consistent state with a default action, then
1033  the only way this function was invoked is if the default action
1034  is an error action. In that case, don't check for expected
1035  tokens because there are none.
1036  - The only way there can be no lookahead present (in yychar) is if
1037  this state is a consistent state with a default action. Thus,
1038  detecting the absence of a lookahead is sufficient to determine
1039  that there is no unexpected or expected token to report. In that
1040  case, just report a simple "syntax error".
1041  - Don't assume there isn't a lookahead just because this state is a
1042  consistent state with a default action. There might have been a
1043  previous inconsistent state, consistent state with a non-default
1044  action, or user semantic action that manipulated yychar.
1045  - Of course, the expected token list depends on states to have
1046  correct lookahead information, and it depends on the parser not
1047  to perform extra reductions after fetching a lookahead from the
1048  scanner and before detecting a syntax error. Thus, state merging
1049  (from LALR or IELR) and default reductions corrupt the expected
1050  token list. However, the list is correct for canonical LR with
1051  one exception: it will still contain any token that will not be
1052  accepted due to an error action in a later state.
1053  */
1054  if (yytoken != YYEMPTY) {
1055  int yyn = yypact[+*yyssp];
1056  YYPTRDIFF_T yysize0 = yytnamerr(YY_NULLPTR, yytname[yytoken]);
1057  yysize = yysize0;
1058  yyarg[yycount++] = yytname[yytoken];
1059  if (!yypact_value_is_default(yyn)) {
1060  /* Start YYX at -YYN if negative to avoid negative indexes in
1061  YYCHECK. In other words, skip the first -YYN actions for
1062  this state because they are default actions. */
1063  int yyxbegin = yyn < 0 ? -yyn : 0;
1064  /* Stay within bounds of both yycheck and yytname. */
1065  int yychecklim = YYLAST - yyn + 1;
1066  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1067  int yyx;
1068 
1069  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1070  if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR &&
1071  !yytable_value_is_error(yytable[yyx + yyn])) {
1072  if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) {
1073  yycount = 1;
1074  yysize = yysize0;
1075  break;
1076  }
1077  yyarg[yycount++] = yytname[yyx];
1078  {
1079  YYPTRDIFF_T yysize1 = yysize + yytnamerr(YY_NULLPTR, yytname[yyx]);
1080  if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
1081  yysize = yysize1;
1082  else
1083  return 2;
1084  }
1085  }
1086  }
1087  }
1088 
1089  switch (yycount) {
1090 #define YYCASE_(N, S) \
1091  case N: \
1092  yyformat = S; \
1093  break
1094  default: /* Avoid compiler warnings. */
1095  YYCASE_(0, YY_("syntax error"));
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"));
1100  YYCASE_(
1101  5,
1102  YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1103 #undef YYCASE_
1104  }
1105 
1106  {
1107  /* Don't count the "%s"s in the final size, but reserve room for
1108  the terminator. */
1109  YYPTRDIFF_T yysize1 = yysize + (yystrlen(yyformat) - 2 * yycount) + 1;
1110  if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
1111  yysize = yysize1;
1112  else
1113  return 2;
1114  }
1115 
1116  if (*yymsg_alloc < yysize) {
1117  *yymsg_alloc = 2 * yysize;
1118  if (!(yysize <= *yymsg_alloc && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1119  *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1120  return 1;
1121  }
1122 
1123  /* Avoid sprintf, as that infringes on the user's name space.
1124  Don't have undefined behavior even if the translation
1125  produced a string with the wrong number of "%s"s. */
1126  {
1127  char* yyp = *yymsg;
1128  int yyi = 0;
1129  while ((*yyp = *yyformat) != '\0')
1130  if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) {
1131  yyp += yytnamerr(yyp, yyarg[yyi++]);
1132  yyformat += 2;
1133  } else {
1134  ++yyp;
1135  ++yyformat;
1136  }
1137  }
1138  return 0;
1139 }
1140 #endif /* YYERROR_VERBOSE */
1141 
1142 /*-----------------------------------------------.
1143 | Release the memory associated to this symbol. |
1144 `-----------------------------------------------*/
1145 
1146 static void yydestruct(const char* yymsg, int yytype, YYSTYPE* yyvaluep,
1149  void* scanner) {
1150  YYUSE(yyvaluep);
1151  YYUSE(context);
1152  YYUSE(model);
1153  YYUSE(ok);
1154  YYUSE(scanner);
1155  if (!yymsg) yymsg = "Deleting";
1156  YY_SYMBOL_PRINT(yymsg, yytype, yyvaluep, yylocationp);
1157 
1159  YYUSE(yytype);
1161 }
1162 
1163 /*----------.
1164 | yyparse. |
1165 `----------*/
1166 
1168  operations_research::fz::Model* model, bool* ok, void* scanner) {
1169  /* The lookahead symbol. */
1170  int yychar;
1171 
1172  /* The semantic value of the lookahead symbol. */
1173  /* Default value used for initialization, for pacifying older GCCs
1174  or non-GCC compilers. */
1175  YY_INITIAL_VALUE(static YYSTYPE yyval_default;)
1176  YYSTYPE yylval YY_INITIAL_VALUE(= yyval_default);
1177 
1178  /* Number of syntax errors so far. */
1179  int yynerrs;
1180 
1181  yy_state_fast_t yystate;
1182  /* Number of tokens to shift before error messages enabled. */
1183  int yyerrstatus;
1184 
1185  /* The stacks and their tools:
1186  'yyss': related to states.
1187  'yyvs': related to semantic values.
1188 
1189  Refer to the stacks through separate pointers, to allow yyoverflow
1190  to reallocate them elsewhere. */
1191 
1192  /* The state stack. */
1193  yy_state_t yyssa[YYINITDEPTH];
1194  yy_state_t* yyss;
1195  yy_state_t* yyssp;
1196 
1197  /* The semantic value stack. */
1198  YYSTYPE yyvsa[YYINITDEPTH];
1199  YYSTYPE* yyvs;
1200  YYSTYPE* yyvsp;
1201 
1202  YYPTRDIFF_T yystacksize;
1203 
1204  int yyn;
1205  int yyresult;
1206  /* Lookahead token as an internal (translated) token number. */
1207  int yytoken = 0;
1208  /* The variables used to return semantic value and location from the
1209  action routines. */
1210  YYSTYPE yyval;
1211 
1212 #if YYERROR_VERBOSE
1213  /* Buffer for error messages, and its allocated size. */
1214  char yymsgbuf[128];
1215  char* yymsg = yymsgbuf;
1216  YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
1217 #endif
1218 
1219 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1220 
1221  /* The number of symbols on the RHS of the reduced rule.
1222  Keep to zero when no symbol should be popped. */
1223  int yylen = 0;
1224 
1225  yyssp = yyss = yyssa;
1226  yyvsp = yyvs = yyvsa;
1227  yystacksize = YYINITDEPTH;
1228 
1229  YYDPRINTF((stderr, "Starting parse\n"));
1230 
1231  yystate = 0;
1232  yyerrstatus = 0;
1233  yynerrs = 0;
1234  yychar = YYEMPTY; /* Cause a token to be read. */
1235  goto yysetstate;
1236 
1237 /*------------------------------------------------------------.
1238 | yynewstate -- push a new state, which is found in yystate. |
1239 `------------------------------------------------------------*/
1240 yynewstate:
1241  /* In all cases, when you get here, the value and location stacks
1242  have just been pushed. So pushing a state here evens the stacks. */
1243  yyssp++;
1244 
1245 /*--------------------------------------------------------------------.
1246 | yysetstate -- set current state (the top of the stack) to yystate. |
1247 `--------------------------------------------------------------------*/
1248 yysetstate:
1249  YYDPRINTF((stderr, "Entering state %d\n", yystate));
1250  YY_ASSERT(0 <= yystate && yystate < YYNSTATES);
1252  *yyssp = YY_CAST(yy_state_t, yystate);
1254 
1255  if (yyss + yystacksize - 1 <= yyssp)
1256 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1257  goto yyexhaustedlab;
1258 #else
1259  {
1260  /* Get the current used size of the three stacks, in elements. */
1261  YYPTRDIFF_T yysize = yyssp - yyss + 1;
1262 
1263 #if defined yyoverflow
1264  {
1265  /* Give user a chance to reallocate the stack. Use copies of
1266  these so that the &'s don't force the real ones into
1267  memory. */
1268  yy_state_t* yyss1 = yyss;
1269  YYSTYPE* yyvs1 = yyvs;
1270 
1271  /* Each stack pointer address is followed by the size of the
1272  data in use in that stack, in bytes. This used to be a
1273  conditional around just the two extra args, but that might
1274  be undefined if yyoverflow is a macro. */
1275  yyoverflow(YY_("memory exhausted"), &yyss1, yysize * YYSIZEOF(*yyssp),
1276  &yyvs1, yysize * YYSIZEOF(*yyvsp), &yystacksize);
1277  yyss = yyss1;
1278  yyvs = yyvs1;
1279  }
1280 #else /* defined YYSTACK_RELOCATE */
1281  /* Extend the stack our own way. */
1282  if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab;
1283  yystacksize *= 2;
1284  if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH;
1285 
1286  {
1287  yy_state_t* yyss1 = yyss;
1288  union yyalloc* yyptr =
1289  YY_CAST(union yyalloc*,
1290  YYSTACK_ALLOC(YY_CAST(YYSIZE_T, YYSTACK_BYTES(yystacksize))));
1291  if (!yyptr) goto yyexhaustedlab;
1294 #undef YYSTACK_RELOCATE
1295  if (yyss1 != yyssa) YYSTACK_FREE(yyss1);
1296  }
1297 #endif
1298 
1299  yyssp = yyss + yysize - 1;
1300  yyvsp = yyvs + yysize - 1;
1301 
1303  YYDPRINTF(
1304  (stderr, "Stack size increased to %ld\n", YY_CAST(long, yystacksize)));
1306 
1307  if (yyss + yystacksize - 1 <= yyssp) YYABORT;
1308  }
1309 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1310 
1311  if (yystate == YYFINAL) YYACCEPT;
1312 
1313  goto yybackup;
1314 
1315 /*-----------.
1316 | yybackup. |
1317 `-----------*/
1318 yybackup:
1319  /* Do appropriate processing given the current state. Read a
1320  lookahead token if we need one and don't already have one. */
1321 
1322  /* First try to decide what to do without reference to lookahead token. */
1323  yyn = yypact[yystate];
1324  if (yypact_value_is_default(yyn)) goto yydefault;
1325 
1326  /* Not known => get a lookahead token if don't already have one. */
1327 
1328  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1329  if (yychar == YYEMPTY) {
1330  YYDPRINTF((stderr, "Reading a token: "));
1331  yychar = yylex(&yylval, scanner);
1332  }
1333 
1334  if (yychar <= YYEOF) {
1335  yychar = yytoken = YYEOF;
1336  YYDPRINTF((stderr, "Now at end of input.\n"));
1337  } else {
1338  yytoken = YYTRANSLATE(yychar);
1339  YY_SYMBOL_PRINT("Next token is", yytoken, &yylval, &yylloc);
1340  }
1341 
1342  /* If the proper action on seeing token YYTOKEN is to reduce or to
1343  detect an error, take that action. */
1344  yyn += yytoken;
1345  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault;
1346  yyn = yytable[yyn];
1347  if (yyn <= 0) {
1348  if (yytable_value_is_error(yyn)) goto yyerrlab;
1349  yyn = -yyn;
1350  goto yyreduce;
1351  }
1352 
1353  /* Count tokens shifted since error; after three, turn off error
1354  status. */
1355  if (yyerrstatus) yyerrstatus--;
1356 
1357  /* Shift the lookahead token. */
1358  YY_SYMBOL_PRINT("Shifting", yytoken, &yylval, &yylloc);
1359  yystate = yyn;
1361  *++yyvsp = yylval;
1363 
1364  /* Discard the shifted token. */
1365  yychar = YYEMPTY;
1366  goto yynewstate;
1367 
1368 /*-----------------------------------------------------------.
1369 | yydefault -- do the default action for the current state. |
1370 `-----------------------------------------------------------*/
1371 yydefault:
1372  yyn = yydefact[yystate];
1373  if (yyn == 0) goto yyerrlab;
1374  goto yyreduce;
1375 
1376 /*-----------------------------.
1377 | yyreduce -- do a reduction. |
1378 `-----------------------------*/
1379 yyreduce:
1380  /* yyn is the number of a rule to reduce with. */
1381  yylen = yyr2[yyn];
1382 
1383  /* If YYLEN is nonzero, implement the default value of the action:
1384  '$$ = $1'.
1385 
1386  Otherwise, the following line sets YYVAL to garbage.
1387  This behavior is undocumented and Bison
1388  users should not rely upon it. Assigning to YYVAL
1389  unconditionally makes the parser a bit smaller, and it avoids a
1390  GCC warning that YYVAL may be used uninitialized. */
1391  yyval = yyvsp[1 - yylen];
1392 
1393  YY_REDUCE_PRINT(yyn);
1394  switch (yyn) {
1395  case 4:
1396 #line 114 "./ortools/flatzinc/parser.yy"
1397  {
1398  yyerrok;
1399  }
1400 #line 1528 "./ortools/flatzinc/parser.tab.cc"
1401  break;
1402 
1403  case 19:
1404 #line 149 "./ortools/flatzinc/parser.yy"
1405  {
1406  // Declaration of a (named) constant: we simply register it in the
1407  // parser's context, and don't store it in the model.
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);
1412 
1413  if (!assignment.HasOneValue()) {
1414  // TODO(lperron): Check that the assignment is included in the domain.
1415  context->domain_map[identifier] = assignment;
1416  } else {
1417  const int64 value = assignment.values.front();
1418  CHECK(domain.Contains(value));
1419  context->integer_map[identifier] = value;
1420  }
1421  delete annotations;
1422  }
1423 #line 1552 "./ortools/flatzinc/parser.tab.cc"
1424  break;
1425 
1426  case 20:
1427 #line 169 "./ortools/flatzinc/parser.yy"
1428  {
1429  std::vector<Annotation>* const annotations = (yyvsp[-4].annotations);
1430  // Declaration of a (named) constant array. See rule right above.
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());
1438  // TODO(lperron): CHECK all values within domain.
1439  context->integer_array_map[identifier] = *assignments;
1440  delete assignments;
1441  delete annotations;
1442  }
1443 #line 1571 "./ortools/flatzinc/parser.tab.cc"
1444  break;
1445 
1446  case 21:
1447 #line 184 "./ortools/flatzinc/parser.yy"
1448  {
1449  std::vector<Annotation>* const annotations = (yyvsp[-3].annotations);
1450  // Declaration of a (named) constant array. See rule right above.
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>();
1457  delete annotations;
1458  }
1459 #line 1586 "./ortools/flatzinc/parser.tab.cc"
1460  break;
1461 
1462  case 22:
1463 #line 195 "./ortools/flatzinc/parser.yy"
1464  {
1465  std::vector<Annotation>* const annotations = (yyvsp[-4].annotations);
1466  // Declaration of a (named) constant array. See rule right above.
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());
1474  // TODO(lperron): CHECK all values within domain.
1475  context->float_array_map[identifier] = *assignments;
1476  delete assignments;
1477  delete annotations;
1478  }
1479 #line 1605 "./ortools/flatzinc/parser.tab.cc"
1480  break;
1481 
1482  case 23:
1483 #line 210 "./ortools/flatzinc/parser.yy"
1484  {
1485  std::vector<Annotation>* const annotations = (yyvsp[-3].annotations);
1486  // Declaration of a (named) constant array. See rule right above.
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>();
1493  delete annotations;
1494  }
1495 #line 1620 "./ortools/flatzinc/parser.tab.cc"
1496  break;
1497 
1498  case 24:
1499 #line 221 "./ortools/flatzinc/parser.yy"
1500  {
1501  // Declaration of a (named) constant array: See rule above.
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());
1512 
1513  if (!AllDomainsHaveOneValue(*assignments)) {
1514  context->domain_array_map[identifier] = *assignments;
1515  // TODO(lperron): check that all assignments are included in the domain.
1516  } else {
1517  std::vector<int64> values(num_constants);
1518  for (int i = 0; i < num_constants; ++i) {
1519  values[i] = (*assignments)[i].values.front();
1520  CHECK(domain.Contains(values[i]));
1521  }
1522  context->integer_array_map[identifier] = values;
1523  }
1524  delete assignments;
1525  delete annotations;
1526  }
1527 #line 1650 "./ortools/flatzinc/parser.tab.cc"
1528  break;
1529 
1530  case 25:
1531 #line 246 "./ortools/flatzinc/parser.yy"
1532  {
1533  // Declaration of a variable. If it's unassigned or assigned to a
1534  // constant, we'll create a new var stored in the model. If it's
1535  // assigned to another variable x then we simply adjust that
1536  // existing variable x according to the current (re-)declaration.
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);
1540  const VariableRefOrValue& assignment = (yyvsp[0].var_or_value);
1541  const bool introduced = ContainsId(annotations, "var_is_introduced") ||
1542  absl::StartsWith(identifier, "X_INTRODUCED");
1543  IntegerVariable* var = nullptr;
1544  if (!assignment.defined) {
1545  var = model->AddVariable(identifier, domain, introduced);
1546  } else if (assignment.variable == nullptr) { // just an integer constant.
1547  CHECK(domain.Contains(assignment.value));
1548  var = model->AddVariable(
1549  identifier, Domain::IntegerValue(assignment.value), introduced);
1550  } else { // a variable.
1551  var = assignment.variable;
1552  var->Merge(identifier, domain, introduced);
1553  }
1554 
1555  // We also register the variable in the parser's context, and add some
1556  // output to the model if needed.
1557  context->variable_map[identifier] = var;
1558  if (ContainsId(annotations, "output_var")) {
1559  model->AddOutput(SolutionOutputSpecs::SingleVariable(
1560  identifier, var, domain.display_as_boolean));
1561  }
1562  delete annotations;
1563  }
1564 #line 1688 "./ortools/flatzinc/parser.tab.cc"
1565  break;
1566 
1567  case 26:
1568 #line 280 "./ortools/flatzinc/parser.yy"
1569  {
1570  // Declaration of a "variable array": these is exactly like N simple
1571  // variable declarations, where the identifier for declaration #i is
1572  // IDENTIFIER[i] (1-based index).
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);
1578  VariableRefOrValueArray* const assignments =
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");
1585 
1586  std::vector<IntegerVariable*> vars(num_vars, nullptr);
1587 
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) {
1594  // Assigned to an integer constant.
1595  const int64 value = assignments->values[i];
1596  CHECK(domain.Contains(value));
1597  vars[i] = model->AddVariable(var_name, Domain::IntegerValue(value),
1598  introduced);
1599  } else {
1600  IntegerVariable* const var = assignments->variables[i];
1601  CHECK(var != nullptr);
1602  vars[i] = var;
1603  vars[i]->Merge(var_name, domain, introduced);
1604  }
1605  }
1606  delete assignments;
1607 
1608  // Register the variable array on the context.
1609  context->variable_array_map[identifier] = vars;
1610 
1611  // We parse the annotations to build an output object if
1612  // needed. It's a bit more convoluted than the simple variable
1613  // output.
1614  if (annotations != nullptr) {
1615  for (int i = 0; i < annotations->size(); ++i) {
1616  const Annotation& ann = (*annotations)[i];
1617  if (ann.IsFunctionCallWithIdentifier("output_array")) {
1618  // We have found an output annotation.
1619  CHECK_EQ(1, ann.annotations.size());
1620  CHECK_EQ(Annotation::ANNOTATION_LIST, ann.annotations.back().type);
1621  const Annotation& list = ann.annotations.back();
1622  // Let's build the vector of bounds.
1623  std::vector<SolutionOutputSpecs::Bounds> bounds;
1624  for (int a = 0; a < list.annotations.size(); ++a) {
1625  const Annotation& bound = list.annotations[a];
1626  CHECK_EQ(Annotation::INTERVAL, bound.type);
1627  bounds.emplace_back(SolutionOutputSpecs::Bounds(
1628  bound.interval_min, bound.interval_max));
1629  }
1630  // We add the output information.
1631  model->AddOutput(SolutionOutputSpecs::MultiDimensionalArray(
1632  identifier, bounds, vars, domain.display_as_boolean));
1633  }
1634  }
1635  delete annotations;
1636  }
1637  }
1638 #line 1760 "./ortools/flatzinc/parser.tab.cc"
1639  break;
1640 
1641  case 27:
1642 #line 349 "./ortools/flatzinc/parser.yy"
1643  {
1644  (yyval.var_or_value) = (yyvsp[0].var_or_value);
1645  }
1646 #line 1766 "./ortools/flatzinc/parser.tab.cc"
1647  break;
1648 
1649  case 28:
1650 #line 350 "./ortools/flatzinc/parser.yy"
1651  {
1652  (yyval.var_or_value) = VariableRefOrValue::Undefined();
1653  }
1654 #line 1772 "./ortools/flatzinc/parser.tab.cc"
1655  break;
1656 
1657  case 29:
1658 #line 353 "./ortools/flatzinc/parser.yy"
1659  {
1660  (yyval.var_or_value_array) = (yyvsp[-1].var_or_value_array);
1661  }
1662 #line 1778 "./ortools/flatzinc/parser.tab.cc"
1663  break;
1664 
1665  case 30:
1666 #line 354 "./ortools/flatzinc/parser.yy"
1667  {
1668  (yyval.var_or_value_array) = nullptr;
1669  }
1670 #line 1784 "./ortools/flatzinc/parser.tab.cc"
1671  break;
1672 
1673  case 31:
1674 #line 355 "./ortools/flatzinc/parser.yy"
1675  {
1676  (yyval.var_or_value_array) = nullptr;
1677  }
1678 #line 1790 "./ortools/flatzinc/parser.tab.cc"
1679  break;
1680 
1681  case 32:
1682 #line 358 "./ortools/flatzinc/parser.yy"
1683  {
1684  (yyval.var_or_value_array) = (yyvsp[-2].var_or_value_array);
1685  (yyval.var_or_value_array)->PushBack((yyvsp[0].var_or_value));
1686  }
1687 #line 1799 "./ortools/flatzinc/parser.tab.cc"
1688  break;
1689 
1690  case 33:
1691 #line 362 "./ortools/flatzinc/parser.yy"
1692  {
1694  (yyval.var_or_value_array)->PushBack((yyvsp[0].var_or_value));
1695  }
1696 #line 1808 "./ortools/flatzinc/parser.tab.cc"
1697  break;
1698 
1699  case 34:
1700 #line 368 "./ortools/flatzinc/parser.yy"
1701  {
1702  (yyval.var_or_value) =
1703  VariableRefOrValue::Value((yyvsp[0].integer_value));
1704  }
1705 #line 1814 "./ortools/flatzinc/parser.tab.cc"
1706  break;
1707 
1708  case 35:
1709 #line 369 "./ortools/flatzinc/parser.yy"
1710  {
1711  // A reference to an existing integer constant or variable.
1712  const std::string& id = (yyvsp[0].string_value);
1713  if (gtl::ContainsKey(context->integer_map, id)) {
1714  (yyval.var_or_value) =
1716  } else if (gtl::ContainsKey(context->variable_map, id)) {
1717  (yyval.var_or_value) = VariableRefOrValue::VariableRef(
1718  gtl::FindOrDie(context->variable_map, id));
1719  } else {
1720  LOG(ERROR) << "Unknown symbol " << id;
1721  (yyval.var_or_value) = VariableRefOrValue::Undefined();
1722  *ok = false;
1723  }
1724  }
1725 #line 1832 "./ortools/flatzinc/parser.tab.cc"
1726  break;
1727 
1728  case 36:
1729 #line 382 "./ortools/flatzinc/parser.yy"
1730  {
1731  // A given element of an existing constant array or variable array.
1732  const std::string& id = (yyvsp[-3].string_value);
1733  const int64 value = (yyvsp[-1].integer_value);
1734  if (gtl::ContainsKey(context->integer_array_map, id)) {
1736  Lookup(gtl::FindOrDie(context->integer_array_map, id), value));
1737  } else if (gtl::ContainsKey(context->variable_array_map, id)) {
1738  (yyval.var_or_value) = VariableRefOrValue::VariableRef(
1739  Lookup(gtl::FindOrDie(context->variable_array_map, id), value));
1740  } else {
1741  LOG(ERROR) << "Unknown symbol " << id;
1742  (yyval.var_or_value) = VariableRefOrValue::Undefined();
1743  *ok = false;
1744  }
1745  }
1746 #line 1853 "./ortools/flatzinc/parser.tab.cc"
1747  break;
1748 
1749  case 37:
1750 #line 400 "./ortools/flatzinc/parser.yy"
1751  {
1752  (yyval.domain) = Domain::Boolean();
1753  }
1754 #line 1859 "./ortools/flatzinc/parser.tab.cc"
1755  break;
1756 
1757  case 38:
1758 #line 401 "./ortools/flatzinc/parser.yy"
1759  {
1760  (yyval.domain) = Domain::AllInt64();
1761  }
1762 #line 1865 "./ortools/flatzinc/parser.tab.cc"
1763  break;
1764 
1765  case 39:
1766 #line 402 "./ortools/flatzinc/parser.yy"
1767  {
1768  (yyval.domain) =
1769  Domain::Interval((yyvsp[-2].integer_value), (yyvsp[0].integer_value));
1770  }
1771 #line 1871 "./ortools/flatzinc/parser.tab.cc"
1772  break;
1773 
1774  case 40:
1775 #line 403 "./ortools/flatzinc/parser.yy"
1776  {
1777  CHECK((yyvsp[-1].integers) != nullptr);
1778  (yyval.domain) = Domain::IntegerList(std::move(*(yyvsp[-1].integers)));
1779  delete (yyvsp[-1].integers);
1780  }
1781 #line 1881 "./ortools/flatzinc/parser.tab.cc"
1782  break;
1783 
1784  case 41:
1785 #line 410 "./ortools/flatzinc/parser.yy"
1786  {
1787  (yyval.domain) = Domain::SetOfBoolean();
1788  }
1789 #line 1887 "./ortools/flatzinc/parser.tab.cc"
1790  break;
1791 
1792  case 42:
1793 #line 411 "./ortools/flatzinc/parser.yy"
1794  {
1795  (yyval.domain) = Domain::SetOfAllInt64();
1796  }
1797 #line 1893 "./ortools/flatzinc/parser.tab.cc"
1798  break;
1799 
1800  case 43:
1801 #line 412 "./ortools/flatzinc/parser.yy"
1802  {
1803  (yyval.domain) = Domain::SetOfInterval((yyvsp[-2].integer_value),
1804  (yyvsp[0].integer_value));
1805  }
1806 #line 1899 "./ortools/flatzinc/parser.tab.cc"
1807  break;
1808 
1809  case 44:
1810 #line 413 "./ortools/flatzinc/parser.yy"
1811  {
1812  CHECK((yyvsp[-1].integers) != nullptr);
1813  (yyval.domain) =
1814  Domain::SetOfIntegerList(std::move(*(yyvsp[-1].integers)));
1815  delete (yyvsp[-1].integers);
1816  }
1817 #line 1909 "./ortools/flatzinc/parser.tab.cc"
1818  break;
1819 
1820  case 45:
1821 #line 420 "./ortools/flatzinc/parser.yy"
1822  {
1823  (yyval.domain) = Domain::AllInt64();
1824  }
1825 #line 1915 "./ortools/flatzinc/parser.tab.cc"
1826  break;
1827 
1828  case 46:
1829 #line 421 "./ortools/flatzinc/parser.yy"
1830  {
1831  const int64 lb = ConvertAsIntegerOrDie((yyvsp[-2].double_value));
1832  const int64 ub = ConvertAsIntegerOrDie((yyvsp[0].double_value));
1833  (yyval.domain) = Domain::Interval(lb, ub);
1834  }
1835 #line 1925 "./ortools/flatzinc/parser.tab.cc"
1836  break;
1837 
1838  case 47:
1839 #line 428 "./ortools/flatzinc/parser.yy"
1840  {
1841  (yyval.domain) = (yyvsp[0].domain);
1842  }
1843 #line 1931 "./ortools/flatzinc/parser.tab.cc"
1844  break;
1845 
1846  case 48:
1847 #line 429 "./ortools/flatzinc/parser.yy"
1848  {
1849  (yyval.domain) = (yyvsp[0].domain);
1850  }
1851 #line 1937 "./ortools/flatzinc/parser.tab.cc"
1852  break;
1853 
1854  case 49:
1855 #line 430 "./ortools/flatzinc/parser.yy"
1856  {
1857  (yyval.domain) = (yyvsp[0].domain);
1858  }
1859 #line 1943 "./ortools/flatzinc/parser.tab.cc"
1860  break;
1861 
1862  case 50:
1863 #line 433 "./ortools/flatzinc/parser.yy"
1864  {
1865  (yyval.integers) = (yyvsp[-2].integers);
1866  (yyval.integers)->emplace_back((yyvsp[0].integer_value));
1867  }
1868 #line 1949 "./ortools/flatzinc/parser.tab.cc"
1869  break;
1870 
1871  case 51:
1872 #line 434 "./ortools/flatzinc/parser.yy"
1873  {
1874  (yyval.integers) = new std::vector<int64>();
1875  (yyval.integers)->emplace_back((yyvsp[0].integer_value));
1876  }
1877 #line 1955 "./ortools/flatzinc/parser.tab.cc"
1878  break;
1879 
1880  case 52:
1881 #line 437 "./ortools/flatzinc/parser.yy"
1882  {
1883  (yyval.integer_value) = (yyvsp[0].integer_value);
1884  }
1885 #line 1961 "./ortools/flatzinc/parser.tab.cc"
1886  break;
1887 
1888  case 53:
1889 #line 438 "./ortools/flatzinc/parser.yy"
1890  {
1891  (yyval.integer_value) =
1892  gtl::FindOrDie(context->integer_map, (yyvsp[0].string_value));
1893  }
1894 #line 1967 "./ortools/flatzinc/parser.tab.cc"
1895  break;
1896 
1897  case 54:
1898 #line 439 "./ortools/flatzinc/parser.yy"
1899  {
1900  (yyval.integer_value) = Lookup(
1901  gtl::FindOrDie(context->integer_array_map, (yyvsp[-3].string_value)),
1902  (yyvsp[-1].integer_value));
1903  }
1904 #line 1975 "./ortools/flatzinc/parser.tab.cc"
1905  break;
1906 
1907  case 55:
1908 #line 444 "./ortools/flatzinc/parser.yy"
1909  {
1910  (yyval.doubles) = (yyvsp[-2].doubles);
1911  (yyval.doubles)->emplace_back((yyvsp[0].double_value));
1912  }
1913 #line 1981 "./ortools/flatzinc/parser.tab.cc"
1914  break;
1915 
1916  case 56:
1917 #line 445 "./ortools/flatzinc/parser.yy"
1918  {
1919  (yyval.doubles) = new std::vector<double>();
1920  (yyval.doubles)->emplace_back((yyvsp[0].double_value));
1921  }
1922 #line 1987 "./ortools/flatzinc/parser.tab.cc"
1923  break;
1924 
1925  case 57:
1926 #line 448 "./ortools/flatzinc/parser.yy"
1927  {
1928  (yyval.double_value) = (yyvsp[0].double_value);
1929  }
1930 #line 1993 "./ortools/flatzinc/parser.tab.cc"
1931  break;
1932 
1933  case 58:
1934 #line 449 "./ortools/flatzinc/parser.yy"
1935  {
1936  (yyval.double_value) =
1937  gtl::FindOrDie(context->float_map, (yyvsp[0].string_value));
1938  }
1939 #line 1999 "./ortools/flatzinc/parser.tab.cc"
1940  break;
1941 
1942  case 59:
1943 #line 450 "./ortools/flatzinc/parser.yy"
1944  {
1945  (yyval.double_value) = Lookup(
1946  gtl::FindOrDie(context->float_array_map, (yyvsp[-3].string_value)),
1947  (yyvsp[-1].integer_value));
1948  }
1949 #line 2007 "./ortools/flatzinc/parser.tab.cc"
1950  break;
1951 
1952  case 60:
1953 #line 455 "./ortools/flatzinc/parser.yy"
1954  {
1955  (yyval.domain) = Domain::IntegerValue((yyvsp[0].integer_value));
1956  }
1957 #line 2013 "./ortools/flatzinc/parser.tab.cc"
1958  break;
1959 
1960  case 61:
1961 #line 456 "./ortools/flatzinc/parser.yy"
1962  {
1963  (yyval.domain) =
1964  Domain::Interval((yyvsp[-2].integer_value), (yyvsp[0].integer_value));
1965  }
1966 #line 2019 "./ortools/flatzinc/parser.tab.cc"
1967  break;
1968 
1969  case 62:
1970 #line 457 "./ortools/flatzinc/parser.yy"
1971  {
1972  CHECK((yyvsp[-1].integers) != nullptr);
1973  (yyval.domain) = Domain::IntegerList(std::move(*(yyvsp[-1].integers)));
1974  delete (yyvsp[-1].integers);
1975  }
1976 #line 2029 "./ortools/flatzinc/parser.tab.cc"
1977  break;
1978 
1979  case 63:
1980 #line 462 "./ortools/flatzinc/parser.yy"
1981  {
1982  (yyval.domain) = Domain::EmptyDomain();
1983  }
1984 #line 2035 "./ortools/flatzinc/parser.tab.cc"
1985  break;
1986 
1987  case 64:
1988 #line 463 "./ortools/flatzinc/parser.yy"
1989  {
1990  CHECK_EQ(std::round((yyvsp[0].double_value)), (yyvsp[0].double_value));
1991  (yyval.domain) =
1992  Domain::IntegerValue(static_cast<int64>((yyvsp[0].double_value)));
1993  }
1994 #line 2044 "./ortools/flatzinc/parser.tab.cc"
1995  break;
1996 
1997  case 65:
1998 #line 467 "./ortools/flatzinc/parser.yy"
1999  {
2000  (yyval.domain) = Domain::IntegerValue(
2001  gtl::FindOrDie(context->integer_map, (yyvsp[0].string_value)));
2002  }
2003 #line 2050 "./ortools/flatzinc/parser.tab.cc"
2004  break;
2005 
2006  case 66:
2007 #line 468 "./ortools/flatzinc/parser.yy"
2008  {
2009  (yyval.domain) = Domain::IntegerValue(Lookup(
2010  gtl::FindOrDie(context->integer_array_map, (yyvsp[-3].string_value)),
2011  (yyvsp[-1].integer_value)));
2012  }
2013 #line 2059 "./ortools/flatzinc/parser.tab.cc"
2014  break;
2015 
2016  case 67:
2017 #line 474 "./ortools/flatzinc/parser.yy"
2018  {
2019  (yyval.domains) = (yyvsp[-2].domains);
2020  (yyval.domains)->emplace_back((yyvsp[0].domain));
2021  }
2022 #line 2068 "./ortools/flatzinc/parser.tab.cc"
2023  break;
2024 
2025  case 68:
2026 #line 478 "./ortools/flatzinc/parser.yy"
2027  {
2028  (yyval.domains) = new std::vector<Domain>();
2029  (yyval.domains)->emplace_back((yyvsp[0].domain));
2030  }
2031 #line 2074 "./ortools/flatzinc/parser.tab.cc"
2032  break;
2033 
2034  case 71:
2035 #line 488 "./ortools/flatzinc/parser.yy"
2036  {
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);
2041 
2042  model->AddConstraint(identifier, arguments,
2043  ContainsId(annotations, "domain"));
2044  delete annotations;
2045  delete (yyvsp[-2].args);
2046  }
2047 #line 2089 "./ortools/flatzinc/parser.tab.cc"
2048  break;
2049 
2050  case 72:
2051 #line 500 "./ortools/flatzinc/parser.yy"
2052  {
2053  (yyval.args) = (yyvsp[-2].args);
2054  (yyval.args)->emplace_back((yyvsp[0].arg));
2055  }
2056 #line 2095 "./ortools/flatzinc/parser.tab.cc"
2057  break;
2058 
2059  case 73:
2060 #line 501 "./ortools/flatzinc/parser.yy"
2061  {
2062  (yyval.args) = new std::vector<Argument>();
2063  (yyval.args)->emplace_back((yyvsp[0].arg));
2064  }
2065 #line 2101 "./ortools/flatzinc/parser.tab.cc"
2066  break;
2067 
2068  case 74:
2069 #line 504 "./ortools/flatzinc/parser.yy"
2070  {
2071  (yyval.arg) = Argument::IntegerValue((yyvsp[0].integer_value));
2072  }
2073 #line 2107 "./ortools/flatzinc/parser.tab.cc"
2074  break;
2075 
2076  case 75:
2077 #line 505 "./ortools/flatzinc/parser.yy"
2078  {
2079  (yyval.arg) = Argument::IntegerValue(
2080  ConvertAsIntegerOrDie((yyvsp[0].double_value)));
2081  }
2082 #line 2113 "./ortools/flatzinc/parser.tab.cc"
2083  break;
2084 
2085  case 76:
2086 #line 506 "./ortools/flatzinc/parser.yy"
2087  {
2088  (yyval.arg) = Argument::VoidArgument();
2089  }
2090 #line 2119 "./ortools/flatzinc/parser.tab.cc"
2091  break;
2092 
2093  case 77:
2094 #line 507 "./ortools/flatzinc/parser.yy"
2095  {
2096  (yyval.arg) = Argument::Interval((yyvsp[-2].integer_value),
2097  (yyvsp[0].integer_value));
2098  }
2099 #line 2125 "./ortools/flatzinc/parser.tab.cc"
2100  break;
2101 
2102  case 78:
2103 #line 508 "./ortools/flatzinc/parser.yy"
2104  {
2105  CHECK((yyvsp[-1].integers) != nullptr);
2106  (yyval.arg) = Argument::IntegerList(std::move(*(yyvsp[-1].integers)));
2107  delete (yyvsp[-1].integers);
2108  }
2109 #line 2135 "./ortools/flatzinc/parser.tab.cc"
2110  break;
2111 
2112  case 79:
2113 #line 513 "./ortools/flatzinc/parser.yy"
2114  {
2115  const std::string& id = (yyvsp[0].string_value);
2116  if (gtl::ContainsKey(context->integer_map, id)) {
2117  (yyval.arg) =
2118  Argument::IntegerValue(gtl::FindOrDie(context->integer_map, id));
2119  } else if (gtl::ContainsKey(context->integer_array_map, id)) {
2120  (yyval.arg) = Argument::IntegerList(
2121  gtl::FindOrDie(context->integer_array_map, id));
2122  } else if (gtl::ContainsKey(context->float_map, id)) {
2123  const double d = gtl::FindOrDie(context->float_map, id);
2124  (yyval.arg) = Argument::IntegerValue(ConvertAsIntegerOrDie(d));
2125  } else if (gtl::ContainsKey(context->float_array_map, id)) {
2126  const auto& double_values =
2127  gtl::FindOrDie(context->float_array_map, id);
2128  std::vector<int64> integer_values;
2129  for (const double d : double_values) {
2130  const int64 i = ConvertAsIntegerOrDie(d);
2131  integer_values.push_back(i);
2132  }
2133  (yyval.arg) = Argument::IntegerList(std::move(integer_values));
2134  } else if (gtl::ContainsKey(context->variable_map, id)) {
2135  (yyval.arg) =
2136  Argument::IntVarRef(gtl::FindOrDie(context->variable_map, id));
2137  } else if (gtl::ContainsKey(context->variable_array_map, id)) {
2138  (yyval.arg) = Argument::IntVarRefArray(
2139  gtl::FindOrDie(context->variable_array_map, id));
2140  } else if (gtl::ContainsKey(context->domain_map, id)) {
2141  const Domain& d = gtl::FindOrDie(context->domain_map, id);
2142  (yyval.arg) = Argument::FromDomain(d);
2143  } else {
2144  CHECK(gtl::ContainsKey(context->domain_array_map, id))
2145  << "Unknown identifier: " << id;
2146  const std::vector<Domain>& d =
2147  gtl::FindOrDie(context->domain_array_map, id);
2148  (yyval.arg) = Argument::DomainList(d);
2149  }
2150  }
2151 #line 2171 "./ortools/flatzinc/parser.tab.cc"
2152  break;
2153 
2154  case 80:
2155 #line 544 "./ortools/flatzinc/parser.yy"
2156  {
2157  const std::string& id = (yyvsp[-3].string_value);
2158  const int64 index = (yyvsp[-1].integer_value);
2159  if (gtl::ContainsKey(context->integer_array_map, id)) {
2160  (yyval.arg) = Argument::IntegerValue(
2161  Lookup(gtl::FindOrDie(context->integer_array_map, id), index));
2162  } else if (gtl::ContainsKey(context->variable_array_map, id)) {
2163  (yyval.arg) = Argument::IntVarRef(
2164  Lookup(gtl::FindOrDie(context->variable_array_map, id), index));
2165  } else {
2166  CHECK(gtl::ContainsKey(context->domain_array_map, id))
2167  << "Unknown identifier: " << id;
2168  const Domain& d =
2169  Lookup(gtl::FindOrDie(context->domain_array_map, id), index);
2170  (yyval.arg) = Argument::FromDomain(d);
2171  }
2172  }
2173 #line 2193 "./ortools/flatzinc/parser.tab.cc"
2174  break;
2175 
2176  case 81:
2177 #line 561 "./ortools/flatzinc/parser.yy"
2178  {
2179  VariableRefOrValueArray* const arguments = (yyvsp[-1].var_or_value_array);
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;
2185  break;
2186  }
2187  }
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]);
2194  } else {
2195  (yyval.arg).variables.emplace_back(
2196  model->AddConstant(arguments->values[i]));
2197  }
2198  }
2199  } else {
2200  (yyval.arg) = Argument::IntegerList(arguments->values);
2201  }
2202  delete arguments;
2203  }
2204 #line 2223 "./ortools/flatzinc/parser.tab.cc"
2205  break;
2206 
2207  case 82:
2208 #line 586 "./ortools/flatzinc/parser.yy"
2209  {
2210  (yyval.arg) = Argument::VoidArgument();
2211  }
2212 #line 2231 "./ortools/flatzinc/parser.tab.cc"
2213  break;
2214 
2215  case 83:
2216 #line 595 "./ortools/flatzinc/parser.yy"
2217  {
2218  (yyval.annotations) = (yyvsp[-2].annotations) != nullptr
2219  ? (yyvsp[-2].annotations)
2220  : new std::vector<Annotation>();
2221  (yyval.annotations)->emplace_back((yyvsp[0].annotation));
2222  }
2223 #line 2240 "./ortools/flatzinc/parser.tab.cc"
2224  break;
2225 
2226  case 84:
2227 #line 599 "./ortools/flatzinc/parser.yy"
2228  {
2229  (yyval.annotations) = nullptr;
2230  }
2231 #line 2246 "./ortools/flatzinc/parser.tab.cc"
2232  break;
2233 
2234  case 85:
2235 #line 602 "./ortools/flatzinc/parser.yy"
2236  {
2237  (yyval.annotations) = (yyvsp[-2].annotations);
2238  (yyval.annotations)->emplace_back((yyvsp[0].annotation));
2239  }
2240 #line 2252 "./ortools/flatzinc/parser.tab.cc"
2241  break;
2242 
2243  case 86:
2244 #line 603 "./ortools/flatzinc/parser.yy"
2245  {
2246  (yyval.annotations) = new std::vector<Annotation>();
2247  (yyval.annotations)->emplace_back((yyvsp[0].annotation));
2248  }
2249 #line 2258 "./ortools/flatzinc/parser.tab.cc"
2250  break;
2251 
2252  case 87:
2253 #line 606 "./ortools/flatzinc/parser.yy"
2254  {
2255  (yyval.annotation) = Annotation::Interval((yyvsp[-2].integer_value),
2256  (yyvsp[0].integer_value));
2257  }
2258 #line 2264 "./ortools/flatzinc/parser.tab.cc"
2259  break;
2260 
2261  case 88:
2262 #line 607 "./ortools/flatzinc/parser.yy"
2263  {
2264  (yyval.annotation) = Annotation::IntegerValue((yyvsp[0].integer_value));
2265  }
2266 #line 2270 "./ortools/flatzinc/parser.tab.cc"
2267  break;
2268 
2269  case 89:
2270 #line 608 "./ortools/flatzinc/parser.yy"
2271  {
2272  (yyval.annotation) = Annotation::String((yyvsp[0].string_value));
2273  }
2274 #line 2276 "./ortools/flatzinc/parser.tab.cc"
2275  break;
2276 
2277  case 90:
2278 #line 609 "./ortools/flatzinc/parser.yy"
2279  {
2280  const std::string& id = (yyvsp[0].string_value);
2281  if (gtl::ContainsKey(context->variable_map, id)) {
2282  (yyval.annotation) =
2283  Annotation::Variable(gtl::FindOrDie(context->variable_map, id));
2284  } else if (gtl::ContainsKey(context->variable_array_map, id)) {
2285  (yyval.annotation) = Annotation::VariableList(
2286  gtl::FindOrDie(context->variable_array_map, id));
2287  } else {
2288  (yyval.annotation) = Annotation::Identifier(id);
2289  }
2290  }
2291 #line 2291 "./ortools/flatzinc/parser.tab.cc"
2292  break;
2293 
2294  case 91:
2295 #line 619 "./ortools/flatzinc/parser.yy"
2296  {
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));
2301  delete annotations;
2302  } else {
2303  (yyval.annotation) = Annotation::FunctionCall((yyvsp[-3].string_value));
2304  }
2305  }
2306 #line 2305 "./ortools/flatzinc/parser.tab.cc"
2307  break;
2308 
2309  case 92:
2310 #line 628 "./ortools/flatzinc/parser.yy"
2311  {
2312  CHECK(gtl::ContainsKey(context->variable_array_map,
2313  (yyvsp[-3].string_value)))
2314  << "Unknown identifier: " << (yyvsp[-3].string_value);
2315  (yyval.annotation) = Annotation::Variable(Lookup(
2316  gtl::FindOrDie(context->variable_array_map, (yyvsp[-3].string_value)),
2317  (yyvsp[-1].integer_value)));
2318  }
2319 #line 2316 "./ortools/flatzinc/parser.tab.cc"
2320  break;
2321 
2322  case 93:
2323 #line 634 "./ortools/flatzinc/parser.yy"
2324  {
2325  std::vector<Annotation>* const annotations = (yyvsp[-1].annotations);
2326  if (annotations != nullptr) {
2327  (yyval.annotation) =
2328  Annotation::AnnotationList(std::move(*annotations));
2329  delete annotations;
2330  } else {
2331  (yyval.annotation) = Annotation::Empty();
2332  }
2333  }
2334 #line 2330 "./ortools/flatzinc/parser.tab.cc"
2335  break;
2336 
2337  case 94:
2338 #line 649 "./ortools/flatzinc/parser.yy"
2339  {
2340  if ((yyvsp[-1].annotations) != nullptr) {
2341  model->Satisfy(std::move(*(yyvsp[-1].annotations)));
2342  delete (yyvsp[-1].annotations);
2343  } else {
2344  model->Satisfy(std::vector<Annotation>());
2345  }
2346  }
2347 #line 2343 "./ortools/flatzinc/parser.tab.cc"
2348  break;
2349 
2350  case 95:
2351 #line 657 "./ortools/flatzinc/parser.yy"
2352  {
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);
2358  } else {
2359  model->Minimize((yyvsp[0].arg).Var(), std::vector<Annotation>());
2360  }
2361  }
2362 #line 2357 "./ortools/flatzinc/parser.tab.cc"
2363  break;
2364 
2365  case 96:
2366 #line 666 "./ortools/flatzinc/parser.yy"
2367  {
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);
2373  } else {
2374  model->Maximize((yyvsp[0].arg).Var(), std::vector<Annotation>());
2375  }
2376  }
2377 #line 2371 "./ortools/flatzinc/parser.tab.cc"
2378  break;
2379 
2380 #line 2375 "./ortools/flatzinc/parser.tab.cc"
2381 
2382  default:
2383  break;
2384  }
2385  /* User semantic actions sometimes alter yychar, and that requires
2386  that yytoken be updated with the new translation. We take the
2387  approach of translating immediately before every use of yytoken.
2388  One alternative is translating here after every semantic action,
2389  but that translation would be missed if the semantic action invokes
2390  YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2391  if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2392  incorrect destructor might then be invoked immediately. In the
2393  case of YYERROR or YYBACKUP, subsequent parser actions might lead
2394  to an incorrect destructor call or verbose syntax error message
2395  before the lookahead is translated. */
2396  YY_SYMBOL_PRINT("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2397 
2398  YYPOPSTACK(yylen);
2399  yylen = 0;
2400  YY_STACK_PRINT(yyss, yyssp);
2401 
2402  *++yyvsp = yyval;
2403 
2404  /* Now 'shift' the result of the reduction. Determine what state
2405  that goes to, based on the state we popped back to and the rule
2406  number reduced by. */
2407  {
2408  const int yylhs = yyr1[yyn] - YYNTOKENS;
2409  const int yyi = yypgoto[yylhs] + *yyssp;
2410  yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
2411  ? yytable[yyi]
2412  : yydefgoto[yylhs]);
2413  }
2414 
2415  goto yynewstate;
2416 
2417 /*--------------------------------------.
2418 | yyerrlab -- here on detecting error. |
2419 `--------------------------------------*/
2420 yyerrlab:
2421  /* Make sure we have latest lookahead translation. See comments at
2422  user semantic actions for why this is necessary. */
2423  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE(yychar);
2424 
2425  /* If not already recovering from an error, report this error. */
2426  if (!yyerrstatus) {
2427  ++yynerrs;
2428 #if !YYERROR_VERBOSE
2429  yyerror(context, model, ok, scanner, YY_("syntax error"));
2430 #else
2431 #define YYSYNTAX_ERROR yysyntax_error(&yymsg_alloc, &yymsg, yyssp, yytoken)
2432  {
2433  char const* yymsgp = YY_("syntax error");
2434  int yysyntax_error_status;
2435  yysyntax_error_status = YYSYNTAX_ERROR;
2436  if (yysyntax_error_status == 0)
2437  yymsgp = yymsg;
2438  else if (yysyntax_error_status == 1) {
2439  if (yymsg != yymsgbuf) YYSTACK_FREE(yymsg);
2440  yymsg = YY_CAST(char*, YYSTACK_ALLOC(YY_CAST(YYSIZE_T, yymsg_alloc)));
2441  if (!yymsg) {
2442  yymsg = yymsgbuf;
2443  yymsg_alloc = sizeof yymsgbuf;
2444  yysyntax_error_status = 2;
2445  } else {
2446  yysyntax_error_status = YYSYNTAX_ERROR;
2447  yymsgp = yymsg;
2448  }
2449  }
2450  yyerror(context, model, ok, scanner, yymsgp);
2451  if (yysyntax_error_status == 2) goto yyexhaustedlab;
2452  }
2453 #undef YYSYNTAX_ERROR
2454 #endif
2455  }
2456 
2457  if (yyerrstatus == 3) {
2458  /* If just tried and failed to reuse lookahead token after an
2459  error, discard it. */
2460 
2461  if (yychar <= YYEOF) {
2462  /* Return failure if at end of input. */
2463  if (yychar == YYEOF) YYABORT;
2464  } else {
2465  yydestruct("Error: discarding", yytoken, &yylval, context, model, ok,
2466  scanner);
2467  yychar = YYEMPTY;
2468  }
2469  }
2470 
2471  /* Else will try to reuse lookahead token after shifting the error
2472  token. */
2473  goto yyerrlab1;
2474 
2475 /*---------------------------------------------------.
2476 | yyerrorlab -- error raised explicitly by YYERROR. |
2477 `---------------------------------------------------*/
2478 yyerrorlab:
2479  /* Pacify compilers when the user code never invokes YYERROR and the
2480  label yyerrorlab therefore never appears in user code. */
2481  if (0) YYERROR;
2482 
2483  /* Do not reclaim the symbols of the rule whose action triggered
2484  this YYERROR. */
2485  YYPOPSTACK(yylen);
2486  yylen = 0;
2487  YY_STACK_PRINT(yyss, yyssp);
2488  yystate = *yyssp;
2489  goto yyerrlab1;
2490 
2491 /*-------------------------------------------------------------.
2492 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2493 `-------------------------------------------------------------*/
2494 yyerrlab1:
2495  yyerrstatus = 3; /* Each real token shifted decrements this. */
2496 
2497  for (;;) {
2498  yyn = yypact[yystate];
2499  if (!yypact_value_is_default(yyn)) {
2500  yyn += YYTERROR;
2501  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) {
2502  yyn = yytable[yyn];
2503  if (0 < yyn) break;
2504  }
2505  }
2506 
2507  /* Pop the current state because it cannot handle the error token. */
2508  if (yyssp == yyss) YYABORT;
2509 
2510  yydestruct("Error: popping", yystos[yystate], yyvsp, context, model, ok,
2511  scanner);
2512  YYPOPSTACK(1);
2513  yystate = *yyssp;
2514  YY_STACK_PRINT(yyss, yyssp);
2515  }
2516 
2518  *++yyvsp = yylval;
2520 
2521  /* Shift the error token. */
2522  YY_SYMBOL_PRINT("Shifting", yystos[yyn], yyvsp, yylsp);
2523 
2524  yystate = yyn;
2525  goto yynewstate;
2526 
2527 /*-------------------------------------.
2528 | yyacceptlab -- YYACCEPT comes here. |
2529 `-------------------------------------*/
2530 yyacceptlab:
2531  yyresult = 0;
2532  goto yyreturn;
2533 
2534 /*-----------------------------------.
2535 | yyabortlab -- YYABORT comes here. |
2536 `-----------------------------------*/
2537 yyabortlab:
2538  yyresult = 1;
2539  goto yyreturn;
2540 
2541 #if !defined yyoverflow || YYERROR_VERBOSE
2542 /*-------------------------------------------------.
2543 | yyexhaustedlab -- memory exhaustion comes here. |
2544 `-------------------------------------------------*/
2545 yyexhaustedlab:
2546  yyerror(context, model, ok, scanner, YY_("memory exhausted"));
2547  yyresult = 2;
2548  /* Fall through. */
2549 #endif
2550 
2551 /*-----------------------------------------------------.
2552 | yyreturn -- parsing is finished, return the result. |
2553 `-----------------------------------------------------*/
2554 yyreturn:
2555  if (yychar != YYEMPTY) {
2556  /* Make sure we have latest lookahead translation. See comments at
2557  user semantic actions for why this is necessary. */
2558  yytoken = YYTRANSLATE(yychar);
2559  yydestruct("Cleanup: discarding lookahead", yytoken, &yylval, context,
2560  model, ok, scanner);
2561  }
2562  /* Do not reclaim the symbols of the rule whose action triggered
2563  this YYABORT or YYACCEPT. */
2564  YYPOPSTACK(yylen);
2565  YY_STACK_PRINT(yyss, yyssp);
2566  while (yyssp != yyss) {
2567  yydestruct("Cleanup: popping", yystos[+*yyssp], yyvsp, context, model, ok,
2568  scanner);
2569  YYPOPSTACK(1);
2570  }
2571 #ifndef yyoverflow
2572  if (yyss != yyssa) YYSTACK_FREE(yyss);
2573 #endif
2574 #if YYERROR_VERBOSE
2575  if (yymsg != yymsgbuf) YYSTACK_FREE(yymsg);
2576 #endif
2577  return yyresult;
2578 }
2579 #line 676 "./ortools/flatzinc/parser.yy"
yyr1
static const yytype_int8 yyr1[]
Definition: parser.tab.cc:749
MAXIMIZE
@ MAXIMIZE
Definition: parser.tab.cc:163
DOTDOT
@ DOTDOT
Definition: parser.tab.cc:171
yydestruct
static void yydestruct(const char *yymsg, int yytype, YYSTYPE *yyvaluep, operations_research::fz::ParserContext *context, operations_research::fz::Model *model, bool *ok, void *scanner)
Definition: parser.tab.cc:1146
var
IntVar * var
Definition: expr_array.cc:1858
YYSTACK_ALLOC_MAXIMUM
#define YYSTACK_ALLOC_MAXIMUM
Definition: parser.tab.cc:421
YYDPRINTF
#define YYDPRINTF(Args)
Definition: parser.tab.cc:803
YY_STACK_PRINT
#define YY_STACK_PRINT(Bottom, Top)
Definition: parser.tab.cc:875
YYFINAL
#define YYFINAL
Definition: parser.tab.cc:500
yytnamerr
static YYPTRDIFF_T yytnamerr(char *yyres, const char *yystr)
Definition: parser.tab.cc:974
yytype_int16
short yytype_int16
Definition: parser.tab.cc:243
YYNSTATES
#define YYNSTATES
Definition: parser.tab.cc:511
operations_research::fz::VariableRefOrValueArray::variables
std::vector< IntegerVariable * > variables
Definition: parser_util.h:73
yydefact
static const yytype_int8 yydefact[]
Definition: parser.tab.cc:664
YYERROR
#define YYERROR
Definition: parser.tab.cc:772
YYSTACK_BYTES
#define YYSTACK_BYTES(N)
Definition: parser.tab.cc:461
yylval
yylval
Definition: parser.yy.cc:963
operations_research::fz::Annotation::IsFunctionCallWithIdentifier
bool IsFunctionCallWithIdentifier(const std::string &identifier) const
Definition: flatzinc/model.h:263
operations_research::fz::ConvertAsIntegerOrDie
int64 ConvertAsIntegerOrDie(double d)
Definition: parser_util.cc:65
bound
int64 bound
Definition: routing_search.cc:972
YYSTACK_ALLOC
#define YYSTACK_ALLOC
Definition: parser.tab.cc:418
orfz_debug
int orfz_debug
yyr2
static const yytype_int8 yyr2[]
Definition: parser.tab.cc:758
operations_research::fz::Annotation
Definition: flatzinc/model.h:238
YYTRANSLATE
#define YYTRANSLATE(YYX)
Definition: parser.tab.cc:518
operations_research::fz::LexerInfo
Definition: parser_util.h:87
YYLAST
#define YYLAST
Definition: parser.tab.cc:502
yynerrs
#define yynerrs
Definition: parser.tab.cc:85
YY_
#define YY_(Msgid)
Definition: parser.tab.cc:318
yytname
static const char *const yytname[]
Definition: parser.tab.cc:554
YYINITDEPTH
#define YYINITDEPTH
Definition: parser.tab.cc:920
operations_research::fz::Lookup
const T & Lookup(const std::vector< T > &v, int index)
Definition: parser_util.cc:75
operations_research::fz::VariableRefOrValue::value
int64 value
Definition: parser_util.h:68
YYACCEPT
#define YYACCEPT
Definition: parser.tab.cc:770
YYABORT
#define YYABORT
Definition: parser.tab.cc:771
PREDICATE
@ PREDICATE
Definition: parser.tab.cc:166
yyparse
#define yyparse
Definition: parser.tab.cc:81
value
int64 value
Definition: demon_profiler.cc:43
SET
@ SET
Definition: parser.tab.cc:168
bounds
SharedBoundsManager * bounds
Definition: cp_model_solver.cc:2026
SVALUE
@ SVALUE
Definition: parser.tab.cc:174
IVALUE
@ IVALUE
Definition: parser.tab.cc:173
operations_research::fz::Domain::Contains
bool Contains(int64 value) const
Definition: model.cc:265
malloc
void * malloc(YYSIZE_T)
int64
int64_t int64
Definition: integral_types.h:34
YY_INITIAL_VALUE
#define YY_INITIAL_VALUE(Value)
Definition: parser.tab.cc:353
yypact_value_is_default
#define yypact_value_is_default(Yyn)
Definition: parser.tab.cc:632
YYSTYPE
#define YYSTYPE
Definition: parser.tab.cc:79
index
int index
Definition: pack.cc:508
yy_stack_print
static void yy_stack_print(yy_state_t *yybottom, yy_state_t *yytop)
Definition: parser.tab.cc:866
OF
@ OF
Definition: parser.tab.cc:165
context
GurobiMPCallbackContext * context
Definition: gurobi_interface.cc:439
YYUSE
#define YYUSE(E)
Definition: parser.tab.cc:340
YY_IGNORE_USELESS_CAST_END
#define YY_IGNORE_USELESS_CAST_END
Definition: parser.tab.cc:371
operations_research::fz::Argument
Definition: flatzinc/model.h:143
gtl::FindOrDie
const Collection::value_type::second_type & FindOrDie(const Collection &collection, const typename Collection::value_type::first_type &key)
Definition: map_util.h:176
yyalloc::yyss_alloc
yy_state_t yyss_alloc
Definition: parser.tab.cc:452
YY_IGNORE_MAYBE_UNINITIALIZED_END
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
Definition: parser.tab.cc:357
DVALUE
@ DVALUE
Definition: parser.tab.cc:176
yytype_int8
signed char yytype_int8
Definition: parser.tab.cc:235
yy_state_t
yytype_uint8 yy_state_t
Definition: parser.tab.cc:305
yypgoto
static const yytype_int16 yypgoto[]
Definition: parser.tab.cc:679
a
int64 a
Definition: constraint_solver/table.cc:42
yy_state_fast_t
int yy_state_fast_t
Definition: parser.tab.cc:308
operations_research::fz::LexerInfo::domains
std::vector< Domain > * domains
Definition: parser_util.h:92
operations_research::fz::LexerInfo::domain
Domain domain
Definition: parser_util.h:91
operations_research::fz::VariableRefOrValueArray::values
std::vector< int64 > values
Definition: parser_util.h:74
operations_research::fz::LexerInfo::annotation
Annotation annotation
Definition: parser_util.h:97
YYSTACK_RELOCATE
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
Definition: parser.tab.cc:471
operations_research::fz::LexerInfo::double_value
double double_value
Definition: parser_util.h:89
YYSTACK_FREE
#define YYSTACK_FREE
Definition: parser.tab.cc:419
operations_research::fz::LexerInfo::args
std::vector< Argument > * args
Definition: parser_util.h:96
YY_REDUCE_PRINT
#define YY_REDUCE_PRINT(Rule)
Definition: parser.tab.cc:902
yystrlen
static YYPTRDIFF_T yystrlen(const char *yystr)
Definition: parser.tab.cc:941
yytype_uint8
unsigned char yytype_uint8
Definition: parser.tab.cc:252
yy_symbol_value_print
static void yy_symbol_value_print(FILE *yyo, int yytype, YYSTYPE const *const yyvaluep, operations_research::fz::ParserContext *context, operations_research::fz::Model *model, bool *ok, void *scanner)
Definition: parser.tab.cc:826
yytable_value_is_error
#define yytable_value_is_error(Yyn)
Definition: parser.tab.cc:636
operations_research::fz::AllDomainsHaveOneValue
bool AllDomainsHaveOneValue(const std::vector< Domain > &domains)
Definition: parser_util.cc:56
free
void free(void *)
operations_research::fz::Constraint
Definition: flatzinc/model.h:196
YYFPRINTF
#define YYFPRINTF
Definition: parser.tab.cc:800
yyalloc::yyvs_alloc
YYSTYPE yyvs_alloc
Definition: parser.tab.cc:453
YYPTRDIFF_T
#define YYPTRDIFF_T
Definition: parser.tab.cc:279
yyrline
static const yytype_int16 yyrline[]
Definition: parser.tab.cc:541
yytype_uint16
unsigned short yytype_uint16
Definition: parser.tab.cc:263
operations_research::fz::Domain
Definition: flatzinc/model.h:48
operations_research::fz::IntegerVariable
Definition: flatzinc/model.h:107
operations_research::fz::LexerInfo::integer_value
int64 integer_value
Definition: parser_util.h:88
IDENTIFIER
@ IDENTIFIER
Definition: parser.tab.cc:175
COLONCOLON
@ COLONCOLON
Definition: parser.tab.cc:172
YY_ASSERT
#define YY_ASSERT(E)
Definition: parser.tab.cc:374
yystos
static const yytype_int8 yystos[]
Definition: parser.tab.cc:734
operations_research::sat::Value
std::function< int64(const Model &)> Value(IntegerVariable v)
Definition: integer.h:1396
operations_research::fz::LexerInfo::annotations
std::vector< Annotation > * annotations
Definition: parser_util.h:98
YYSIZE_T
#define YYSIZE_T
Definition: parser.tab.cc:293
operations_research::fz::VariableRefOrValue::variable
IntegerVariable * variable
Definition: parser_util.h:67
operations_research::fz::VariableRefOrValue
Definition: parser_util.h:44
parser_util.cc
operations_research::fz::LexerInfo::var_or_value_array
VariableRefOrValueArray * var_or_value_array
Definition: parser_util.h:100
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Definition: parser.tab.cc:356
operations_research::fz::SolutionOutputSpecs
Definition: flatzinc/model.h:282
operations_research::fz::ContainsId
bool ContainsId(std::vector< Annotation > *annotations, const std::string &id)
Definition: parser_util.cc:43
YYTERROR
#define YYTERROR
Definition: parser.tab.cc:792
orfz_parse
int orfz_parse(operations_research::fz::ParserContext *context, operations_research::fz::Model *model, bool *ok, void *scanner)
SATISFY
@ SATISFY
Definition: parser.tab.cc:167
yydebug
#define yydebug
Definition: parser.tab.cc:84
operations_research::fz::LexerInfo::arg
Argument arg
Definition: parser_util.h:95
model
GRBmodel * model
Definition: gurobi_interface.cc:195
parser_util.h
yystpcpy
static char * yystpcpy(char *yydest, const char *yysrc)
Definition: parser.tab.cc:955
yycheck
static const yytype_int16 yycheck[]
Definition: parser.tab.cc:713
YYSYNTAX_ERROR
#define YYSYNTAX_ERROR
yy_reduce_print
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)
Definition: parser.tab.cc:884
MINIMIZE
@ MINIMIZE
Definition: parser.tab.cc:164
operations_research::fz::Model
Definition: flatzinc/model.h:315
YY_IGNORE_USELESS_CAST_BEGIN
#define YY_IGNORE_USELESS_CAST_BEGIN
Definition: parser.tab.cc:370
YYMAXDEPTH
#define YYMAXDEPTH
Definition: parser.tab.cc:931
orfz_tokentype
orfz_tokentype
Definition: parser.tab.cc:157
operations_research::fz::VariableRefOrValueArray
Definition: parser_util.h:72
yypact
static const yytype_int16 yypact[]
Definition: parser.tab.cc:640
operations_research::fz::Annotation::annotations
std::vector< Annotation > annotations
Definition: flatzinc/model.h:275
yyerrok
#define yyerrok
Definition: parser.tab.cc:765
yytranslate
static const yytype_int8 yytranslate[]
Definition: parser.tab.cc:523
operations_research::fz::LexerInfo::doubles
std::vector< double > * doubles
Definition: parser_util.h:94
yyalloc
Definition: parser.tab.cc:451
operations_research::fz::Domain::display_as_boolean
bool display_as_boolean
Definition: flatzinc/model.h:99
yyerror
#define yyerror
Definition: parser.tab.cc:83
operations_research::fz::VariableRefOrValue::defined
bool defined
Definition: parser_util.h:69
YYPOPSTACK
#define YYPOPSTACK(N)
YY_NULLPTR
#define YY_NULLPTR
Definition: parser.tab.cc:104
operations_research::fz::LexerInfo::integers
std::vector< int64 > * integers
Definition: parser_util.h:93
operations_research::fz::Domain::values
std::vector< int64 > values
Definition: flatzinc/model.h:97
YYEMPTY
#define YYEMPTY
Definition: parser.tab.cc:767
YY_SYMBOL_PRINT
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
Definition: parser.tab.cc:813
yysyntax_error
static int yysyntax_error(YYPTRDIFF_T *yymsg_alloc, char **yymsg, yy_state_t *yyssp, int yytoken)
Definition: parser.tab.cc:1018
YYCASE_
#define YYCASE_(N, S)
TOKEN_INT
@ TOKEN_INT
Definition: parser.tab.cc:162
yytable
static const yytype_int16 yytable[]
Definition: parser.tab.cc:692
YYEOF
#define YYEOF
Definition: parser.tab.cc:768
CONSTRAINT
@ CONSTRAINT
Definition: parser.tab.cc:160
operations_research::fz::ParserContext
Definition: parser_util.h:29
TOKEN_FLOAT
@ TOKEN_FLOAT
Definition: parser.tab.cc:161
YYNTOKENS
#define YYNTOKENS
Definition: parser.tab.cc:505
VAR
@ VAR
Definition: parser.tab.cc:170
TOKEN_BOOL
@ TOKEN_BOOL
Definition: parser.tab.cc:159
yydefgoto
static const yytype_int16 yydefgoto[]
Definition: parser.tab.cc:685
operations_research::fz::LexerInfo::var_or_value
VariableRefOrValue var_or_value
Definition: parser_util.h:99
operations_research::fz::VariableRefOrValueArray::Size
int Size() const
Definition: parser_util.h:82
YYSIZEOF
#define YYSIZEOF(X)
Definition: parser.tab.cc:302
YY_CAST
#define YY_CAST(Type, Val)
Definition: parser.tab.cc:92
SOLVE
@ SOLVE
Definition: parser.tab.cc:169
ARRAY
@ ARRAY
Definition: parser.tab.cc:158
yylex
#define yylex
Definition: parser.tab.cc:82
yy_symbol_print
static void yy_symbol_print(FILE *yyo, int yytype, YYSTYPE const *const yyvaluep, operations_research::fz::ParserContext *context, operations_research::fz::Model *model, bool *ok, void *scanner)
Definition: parser.tab.cc:849
operations_research::fz::Domain::HasOneValue
bool HasOneValue() const
Definition: model.cc:236
gtl::ContainsKey
bool ContainsKey(const Collection &collection, const Key &key)
Definition: map_util.h:170