![]() |
Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
|
#include "absl/strings/match.h"#include "absl/strings/str_format.h"#include "ortools/flatzinc/parser_util.h"#include "ortools/flatzinc/parser_util.cc"#include <limits.h>Go to the source code of this file.
Classes | |
| union | yyalloc |
| struct | yypcontext_t |
| struct | Annotation |
| struct | Argument |
| struct | Constraint |
| struct | Domain |
| class | Model |
| struct | ParserContext |
| This is the context used during parsing. More... | |
| struct | SolutionOutputSpecs |
| struct | Variable |
| struct | VarRefOrValue |
Macros | |
| #define | YYBISON 30802 |
| #define | YYBISON_VERSION "3.8.2" |
| #define | YYSKELETON_NAME "yacc.c" |
| #define | YYPURE 2 |
| #define | YYPUSH 0 |
| #define | YYPULL 1 |
| #define | YYSTYPE ORFZ_STYPE |
| #define | yyparse orfz_parse |
| #define | yylex orfz_lex |
| #define | yyerror orfz_error |
| #define | yydebug orfz_debug |
| #define | yynerrs orfz_nerrs |
| #define | YY_CAST(Type, Val) |
| #define | YY_REINTERPRET_CAST(Type, Val) |
| #define | YY_NULLPTR ((void*)0) |
| #define | ORFZ_DEBUG 0 |
| #define | OR_TOOLS_FLATZINC_FLATZINC_TAB_HH_ |
| #define | YYLEX_PARAM scanner |
| Defines the parameter to the orfz_lex() call from the orfz_parse() method. | |
| #define | ORFZ_TOKENTYPE |
| #define | YYPTRDIFF_T long |
| #define | YYPTRDIFF_MAXIMUM LONG_MAX |
| #define | YYSIZE_T unsigned |
| #define | YYSIZE_MAXIMUM |
| #define | YYSIZEOF(X) |
| #define | YY_(Msgid) |
| #define | YY_ATTRIBUTE_PURE |
| #define | YY_ATTRIBUTE_UNUSED |
| #define | YY_USE(E) |
| #define | YY_INITIAL_VALUE(Value) |
| #define | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
| #define | YY_IGNORE_MAYBE_UNINITIALIZED_END |
| #define | YY_IGNORE_USELESS_CAST_BEGIN |
| #define | YY_IGNORE_USELESS_CAST_END |
| #define | YY_ASSERT(E) |
| #define | YYSTACK_ALLOC YYMALLOC |
| #define | YYSTACK_FREE YYFREE |
| #define | YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM |
| #define | YYMALLOC malloc |
| #define | YYFREE free |
| #define | YYSTACK_GAP_MAXIMUM (YYSIZEOF(union yyalloc) - 1) |
| #define | YYSTACK_BYTES(N) |
| #define | YYCOPY_NEEDED 1 |
| #define | YYSTACK_RELOCATE(Stack_alloc, Stack) |
| #define | YYFINAL 3 |
| #define | YYLAST 264 |
| #define | YYNTOKENS 32 |
| #define | YYNNTS 32 |
| #define | YYNRULES 98 |
| #define | YYNSTATES 225 |
| #define | YYMAXUTOK 276 |
| #define | YYTRANSLATE(YYX) |
| #define | YY_ACCESSING_SYMBOL(State) |
| #define | YYPACT_NINF (-184) |
| #define | yypact_value_is_default(Yyn) |
| #define | YYTABLE_NINF (-19) |
| #define | yytable_value_is_error(Yyn) |
| #define | yyerrok (yyerrstatus = 0) |
| #define | yyclearin (yychar = ORFZ_EMPTY) |
| #define | YYACCEPT goto yyacceptlab |
| #define | YYABORT goto yyabortlab |
| #define | YYERROR goto yyerrorlab |
| #define | YYNOMEM goto yyexhaustedlab |
| #define | YYRECOVERING() |
| #define | YYBACKUP(Token, Value) |
| #define | YYERRCODE ORFZ_UNDEF |
| #define | YYDPRINTF(Args) |
| #define | YY_SYMBOL_PRINT(Title, Kind, Value, Location) |
| #define | YY_STACK_PRINT(Bottom, Top) |
| #define | YY_REDUCE_PRINT(Rule) |
| #define | YYINITDEPTH 200 |
| #define | YYMAXDEPTH 10000 |
| #define | YYCASE_(N, S) |
| #define | YYPOPSTACK(N) |
Typedefs | |
| typedef operations_research::fz::LexerInfo | YYSTYPE |
| Tells flex to use the LexerInfo class to communicate with the bison parser. | |
| typedef enum orfz_tokentype | orfz_token_kind_t |
| typedef enum yysymbol_kind_t | yysymbol_kind_t |
| typedef signed char | yytype_int8 |
| typedef short | yytype_int16 |
| typedef unsigned char | yytype_uint8 |
| typedef unsigned short | yytype_uint16 |
| typedef yytype_uint8 | yy_state_t |
| typedef int | yy_state_fast_t |
Functions | |
| int | orfz_parse (operations_research::fz::ParserContext *context, operations_research::fz::Model *model, bool *ok, void *scanner) |
| void * | malloc (YYSIZE_T) |
| void | free (void *) |
| static const char * | yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED |
| static int | yypcontext_expected_tokens (const yypcontext_t *yyctx, yysymbol_kind_t yyarg[], int yyargn) |
| static YYPTRDIFF_T | yystrlen (const char *yystr) |
| static char * | yystpcpy (char *yydest, const char *yysrc) |
| static YYPTRDIFF_T | yytnamerr (char *yyres, const char *yystr) |
| static int | yy_syntax_error_arguments (const yypcontext_t *yyctx, yysymbol_kind_t yyarg[], int yyargn) |
| static int | yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, const yypcontext_t *yyctx) |
| static void | yydestruct (const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep, operations_research::fz::ParserContext *context, operations_research::fz::Model *model, bool *ok, void *scanner) |
| int | yyparse (operations_research::fz::ParserContext *context, operations_research::fz::Model *model, bool *ok, void *scanner) |
| int64_t | ConvertAsIntegerOrDie (double d) |
| If the argument is an integer, return it as int64_t. Otherwise, die. | |
| template<class T> | |
| const T & | Lookup (const std::vector< T > &v, int index) |
Variables | |
| static const yytype_int8 | yytranslate [] |
| static const char *const | yytname [] |
| static const yytype_int16 | yypact [] |
| static const yytype_int8 | yydefact [] |
| static const yytype_int16 | yypgoto [] |
| static const yytype_uint8 | yydefgoto [] |
| static const yytype_int16 | yytable [] |
| static const yytype_int16 | yycheck [] |
| static const yytype_int8 | yystos [] |
| static const yytype_int8 | yyr1 [] |
| static const yytype_int8 | yyr2 [] |
| #define OR_TOOLS_FLATZINC_FLATZINC_TAB_HH_ |
Definition at line 115 of file parser.tab.cc.
| #define ORFZ_DEBUG 0 |
Definition at line 105 of file parser.tab.cc.
| #define ORFZ_TOKENTYPE |
Definition at line 132 of file parser.tab.cc.
| #define YY_ | ( | Msgid | ) |
Definition at line 380 of file parser.tab.cc.
| #define YY_ACCESSING_SYMBOL | ( | State | ) |
| #define YY_ASSERT | ( | E | ) |
Definition at line 442 of file parser.tab.cc.
| #define YY_ATTRIBUTE_PURE |
Definition at line 388 of file parser.tab.cc.
| #define YY_ATTRIBUTE_UNUSED |
Definition at line 396 of file parser.tab.cc.
| #define YY_CAST | ( | Type, | |
| Val ) |
Definition at line 80 of file parser.tab.cc.
| #define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
Definition at line 424 of file parser.tab.cc.
| #define YY_IGNORE_MAYBE_UNINITIALIZED_END |
Definition at line 425 of file parser.tab.cc.
| #define YY_IGNORE_USELESS_CAST_BEGIN |
Definition at line 438 of file parser.tab.cc.
| #define YY_IGNORE_USELESS_CAST_END |
Definition at line 439 of file parser.tab.cc.
| #define YY_INITIAL_VALUE | ( | Value | ) |
Definition at line 421 of file parser.tab.cc.
| #define YY_NULLPTR ((void*)0) |
Definition at line 92 of file parser.tab.cc.
| #define YY_REDUCE_PRINT | ( | Rule | ) |
Definition at line 980 of file parser.tab.cc.
| #define YY_REINTERPRET_CAST | ( | Type, | |
| Val ) |
Definition at line 81 of file parser.tab.cc.
| #define YY_STACK_PRINT | ( | Bottom, | |
| Top ) |
Definition at line 979 of file parser.tab.cc.
| #define YY_SYMBOL_PRINT | ( | Title, | |
| Kind, | |||
| Value, | |||
| Location ) |
Definition at line 978 of file parser.tab.cc.
| #define YY_USE | ( | E | ) |
Definition at line 402 of file parser.tab.cc.
| #define YYABORT goto yyabortlab |
Definition at line 843 of file parser.tab.cc.
| #define YYACCEPT goto yyacceptlab |
Definition at line 842 of file parser.tab.cc.
| #define YYBACKUP | ( | Token, | |
| Value ) |
Definition at line 849 of file parser.tab.cc.
| #define YYBISON 30802 |
Definition at line 49 of file parser.tab.cc.
| #define YYBISON_VERSION "3.8.2" |
Definition at line 52 of file parser.tab.cc.
| #define YYCASE_ | ( | N, | |
| S ) |
| #define yyclearin (yychar = ORFZ_EMPTY) |
Definition at line 840 of file parser.tab.cc.
| #define YYCOPY_NEEDED 1 |
Definition at line 532 of file parser.tab.cc.
| #define yydebug orfz_debug |
Definition at line 72 of file parser.tab.cc.
| #define YYDPRINTF | ( | Args | ) |
Definition at line 977 of file parser.tab.cc.
| #define YYERRCODE ORFZ_UNDEF |
Definition at line 866 of file parser.tab.cc.
| #define yyerrok (yyerrstatus = 0) |
Definition at line 839 of file parser.tab.cc.
| #define YYERROR goto yyerrorlab |
Definition at line 844 of file parser.tab.cc.
| #define yyerror orfz_error |
Definition at line 71 of file parser.tab.cc.
| #define YYFINAL 3 |
Definition at line 568 of file parser.tab.cc.
| #define YYFREE free |
Definition at line 506 of file parser.tab.cc.
| #define YYINITDEPTH 200 |
Definition at line 985 of file parser.tab.cc.
| #define YYLAST 264 |
Definition at line 570 of file parser.tab.cc.
| #define yylex orfz_lex |
Definition at line 70 of file parser.tab.cc.
| #define YYLEX_PARAM scanner |
Defines the parameter to the orfz_lex() call from the orfz_parse() method.
Definition at line 124 of file parser.tab.cc.
| #define YYMALLOC malloc |
Definition at line 500 of file parser.tab.cc.
| #define YYMAXDEPTH 10000 |
Definition at line 996 of file parser.tab.cc.
| #define YYMAXUTOK 276 |
Definition at line 582 of file parser.tab.cc.
| #define yynerrs orfz_nerrs |
Definition at line 73 of file parser.tab.cc.
| #define YYNNTS 32 |
Definition at line 575 of file parser.tab.cc.
| #define YYNOMEM goto yyexhaustedlab |
Definition at line 845 of file parser.tab.cc.
| #define YYNRULES 98 |
Definition at line 577 of file parser.tab.cc.
| #define YYNSTATES 225 |
Definition at line 579 of file parser.tab.cc.
| #define YYNTOKENS 32 |
Definition at line 573 of file parser.tab.cc.
| #define YYPACT_NINF (-184) |
Definition at line 702 of file parser.tab.cc.
| #define yypact_value_is_default | ( | Yyn | ) |
Definition at line 704 of file parser.tab.cc.
| #define yyparse orfz_parse |
Definition at line 69 of file parser.tab.cc.
| #define YYPOPSTACK | ( | N | ) |
| #define YYPTRDIFF_MAXIMUM LONG_MAX |
Definition at line 342 of file parser.tab.cc.
| #define YYPTRDIFF_T long |
Definition at line 341 of file parser.tab.cc.
| #define YYPULL 1 |
Definition at line 64 of file parser.tab.cc.
| #define YYPURE 2 |
Definition at line 58 of file parser.tab.cc.
| #define YYPUSH 0 |
Definition at line 61 of file parser.tab.cc.
| #define YYRECOVERING | ( | ) |
Definition at line 847 of file parser.tab.cc.
| #define YYSIZE_MAXIMUM |
Definition at line 359 of file parser.tab.cc.
| #define YYSIZE_T unsigned |
Definition at line 355 of file parser.tab.cc.
| #define YYSIZEOF | ( | X | ) |
Definition at line 364 of file parser.tab.cc.
| #define YYSKELETON_NAME "yacc.c" |
Definition at line 55 of file parser.tab.cc.
| #define YYSTACK_ALLOC YYMALLOC |
Definition at line 486 of file parser.tab.cc.
| #define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM |
Definition at line 489 of file parser.tab.cc.
| #define YYSTACK_BYTES | ( | N | ) |
Definition at line 529 of file parser.tab.cc.
| #define YYSTACK_FREE YYFREE |
Definition at line 487 of file parser.tab.cc.
Definition at line 525 of file parser.tab.cc.
| #define YYSTACK_RELOCATE | ( | Stack_alloc, | |
| Stack ) |
Definition at line 539 of file parser.tab.cc.
| #define YYSTYPE ORFZ_STYPE |
Definition at line 67 of file parser.tab.cc.
| #define YYTABLE_NINF (-19) |
Definition at line 706 of file parser.tab.cc.
| #define yytable_value_is_error | ( | Yyn | ) |
Definition at line 708 of file parser.tab.cc.
| #define YYTRANSLATE | ( | YYX | ) |
Definition at line 586 of file parser.tab.cc.
| typedef enum orfz_tokentype orfz_token_kind_t |
Definition at line 158 of file parser.tab.cc.
| typedef int yy_state_fast_t |
Definition at line 370 of file parser.tab.cc.
| typedef yytype_uint8 yy_state_t |
Definition at line 367 of file parser.tab.cc.
Tells flex to use the LexerInfo class to communicate with the bison parser.
Definition at line 121 of file parser.tab.cc.
| typedef enum yysymbol_kind_t yysymbol_kind_t |
Definition at line 236 of file parser.tab.cc.
| typedef short yytype_int16 |
Definition at line 293 of file parser.tab.cc.
| typedef signed char yytype_int8 |
Definition at line 285 of file parser.tab.cc.
| typedef unsigned short yytype_uint16 |
Definition at line 325 of file parser.tab.cc.
| typedef unsigned char yytype_uint8 |
Definition at line 314 of file parser.tab.cc.
| anonymous enum |
| Enumerator | |
|---|---|
| YYENOMEM | |
Definition at line 837 of file parser.tab.cc.
| enum orfz_tokentype |
Definition at line 133 of file parser.tab.cc.
| enum yysymbol_kind_t |
Definition at line 167 of file parser.tab.cc.
| int64_t operations_research::fz::ConvertAsIntegerOrDie | ( | double | d | ) |
If the argument is an integer, return it as int64_t. Otherwise, die.
Definition at line 68 of file parser_util.cc.
| void free | ( | void * | ) |
| const T & operations_research::fz::Lookup | ( | const std::vector< T > & | v, |
| int | index ) |
Array in flatzinc are 1 based. We use this trivial wrapper for all flatzinc arrays.
Definition at line 78 of file parser_util.cc.
| void * malloc | ( | YYSIZE_T | ) |
| int orfz_parse | ( | operations_research::fz::ParserContext * | context, |
| operations_research::fz::Model * | model, | ||
| bool * | ok, | ||
| void * | scanner ) |
|
static |
Definition at line 1113 of file parser.tab.cc.
|
static |
Definition at line 1237 of file parser.tab.cc.
| int yyparse | ( | operations_research::fz::ParserContext * | context, |
| operations_research::fz::Model * | model, | ||
| bool * | ok, | ||
| void * | scanner ) |
Declaration of a (named) constant: we simply register it in the parser's context, and don't store it in the model.
Declaration of a (named) constant array. See rule right above.
Declaration of a (named) constant array. See rule right above.
Declaration of a (named) constant array. See rule right above.
Declaration of a (named) constant array. See rule right above.
Declaration of a (named) constant array: See rule above.
Declaration of a variable. If it's unassigned or assigned to a constant, we'll create a new var stored in the model. If it's assigned to another variable x then we simply adjust that existing variable x according to the current (re-)declaration.
We also register the variable in the parser's context, and add some output to the model if needed.
Declaration of a "variable array": these is exactly like N simple variable declarations, where the identifier for declaration #i is IDENTIFIER[i] (1-based index).
Assigned to an float constant.
CHECK(domain.Contains(value));
Assigned to an integer constant.
Register the variable array on the context.
We parse the annotations to build an output object if needed. It's a bit more convoluted than the simple variable output.
We have found an output annotation.
Let's build the vector of bounds.
We add the output information.
A reference to an existing integer constant or variable.
A given element of an existing constant array or variable array.
Definition at line 1259 of file parser.tab.cc.
|
static |
Definition at line 1011 of file parser.tab.cc.
|
static |
Definition at line 1059 of file parser.tab.cc.
|
static |
Definition at line 1045 of file parser.tab.cc.
|
static |
Definition at line 697 of file parser.tab.cc.
|
static |
Definition at line 1162 of file parser.tab.cc.
|
static |
Definition at line 1078 of file parser.tab.cc.
|
static |
Definition at line 784 of file parser.tab.cc.
|
static |
Definition at line 736 of file parser.tab.cc.
|
static |
Definition at line 757 of file parser.tab.cc.
|
static |
Definition at line 712 of file parser.tab.cc.
|
static |
Definition at line 751 of file parser.tab.cc.
|
static |
Definition at line 820 of file parser.tab.cc.
|
static |
Definition at line 830 of file parser.tab.cc.
|
static |
Definition at line 805 of file parser.tab.cc.
|
static |
Definition at line 764 of file parser.tab.cc.
|
static |
Definition at line 631 of file parser.tab.cc.
|
static |
Definition at line 593 of file parser.tab.cc.