diff --git a/software/mza/lib/cached/md5_cached.cmake b/software/mza/lib/cached/md5_cached.cmake
index 266a01c..0fb3afa 100644
--- a/software/mza/lib/cached/md5_cached.cmake
+++ b/software/mza/lib/cached/md5_cached.cmake
@@ -1,6 +1,6 @@
set(lexer_lxx_md5_cached "4df2e64a04ae95de46bf3d1211997e4d")
-set(parser_yxx_md5_cached "a9a25941f551b77a67b042c87fe799e5")
+set(parser_yxx_md5_cached "fd6255424f75e259f5b8a2c51a2c375d")
set(regex_lexer_lxx_md5_cached "e1a1ab28ed8f0bf77b83431b404333e8")
-set(regex_parser_yxx_md5_cached "f3b553ce5b80f4fbe086a6b12f3106df")
-set(mza_lexer_lxx_md5_cached "c3f7cb498c4eb1e87cbd83b2156b0eff")
-set(mza_parser_yxx_md5_cached "db69253732ef601b549b2ef15b444bb8")
\ No newline at end of file
+set(regex_parser_yxx_md5_cached "01499f2c4bd0bcb0364b117b8e10a34e")
+set(mza_lexer_lxx_md5_cached "50b781fe1af7ca319cb3e35c1653c72b")
+set(mza_parser_yxx_md5_cached "18d4d6b5e5a2b4eac0c0b835e388b479")
\ No newline at end of file
diff --git a/software/mza/lib/cached/minizinc/parser.tab.hh b/software/mza/lib/cached/minizinc/parser.tab.hh
index b353dac..65225c7 100644
--- a/software/mza/lib/cached/minizinc/parser.tab.hh
+++ b/software/mza/lib/cached/minizinc/parser.tab.hh
@@ -1,14 +1,14 @@
-/* A Bison parser, made by GNU Bison 2.3. */
+/* A Bison parser, made by GNU Bison 3.7.6. */
-/* Skeleton interface for Bison's Yacc-like parsers in C
+/* Bison interface for Yacc-like parsers in C
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
- Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
+ Inc.
- This program is free software; you can redistribute it and/or modify
+ This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -16,9 +16,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
+ along with this program. If not, see . */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@@ -33,283 +31,167 @@
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
-/* Tokens. */
+/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
+ especially those whose name start with YY_ or yy_. They are
+ private implementation details that can be changed or removed. */
+
+#ifndef YY_MZN_YY_USERS_DEKKER1_CODE_GITHUB_COM_MINIZINC_LIBMINIZINC_BYTE_BUILD_INCLUDE_MINIZINC_PARSER_TAB_HH_INCLUDED
+# define YY_MZN_YY_USERS_DEKKER1_CODE_GITHUB_COM_MINIZINC_LIBMINIZINC_BYTE_BUILD_INCLUDE_MINIZINC_PARSER_TAB_HH_INCLUDED
+/* Debug traces. */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+#if YYDEBUG
+extern int mzn_yydebug;
+#endif
+
+/* Token kinds. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
- /* Put the tokens into the symbol table, so that GDB and other debuggers
- know about them. */
- enum yytokentype {
- END = 0,
- MZN_INTEGER_LITERAL = 258,
- MZN_BOOL_LITERAL = 259,
- MZN_FLOAT_LITERAL = 260,
- MZN_IDENTIFIER = 261,
- MZN_QUOTED_IDENTIFIER = 262,
- MZN_STRING_LITERAL = 263,
- MZN_STRING_QUOTE_START = 264,
- MZN_STRING_QUOTE_MID = 265,
- MZN_STRING_QUOTE_END = 266,
- MZN_TI_IDENTIFIER = 267,
- MZN_TI_ENUM_IDENTIFIER = 268,
- MZN_DOC_COMMENT = 269,
- MZN_DOC_FILE_COMMENT = 270,
- MZN_VAR = 271,
- MZN_PAR = 272,
- MZN_ABSENT = 273,
- MZN_ANN = 274,
- MZN_ANNOTATION = 275,
- MZN_ANY = 276,
- MZN_ARRAY = 277,
- MZN_BOOL = 278,
- MZN_CASE = 279,
- MZN_CONSTRAINT = 280,
- MZN_DEFAULT = 281,
- MZN_ELSE = 282,
- MZN_ELSEIF = 283,
- MZN_ENDIF = 284,
- MZN_ENUM = 285,
- MZN_FLOAT = 286,
- MZN_FUNCTION = 287,
- MZN_IF = 288,
- MZN_INCLUDE = 289,
- MZN_INFINITY = 290,
- MZN_INT = 291,
- MZN_LET = 292,
- MZN_LIST = 293,
- MZN_MAXIMIZE = 294,
- MZN_MINIMIZE = 295,
- MZN_OF = 296,
- MZN_OPT = 297,
- MZN_SATISFY = 298,
- MZN_OUTPUT = 299,
- MZN_PREDICATE = 300,
- MZN_RECORD = 301,
- MZN_SET = 302,
- MZN_SOLVE = 303,
- MZN_STRING = 304,
- MZN_TEST = 305,
- MZN_THEN = 306,
- MZN_TUPLE = 307,
- MZN_TYPE = 308,
- MZN_UNDERSCORE = 309,
- MZN_VARIANT_RECORD = 310,
- MZN_WHERE = 311,
- MZN_LEFT_BRACKET = 312,
- MZN_LEFT_2D_BRACKET = 313,
- MZN_RIGHT_BRACKET = 314,
- MZN_RIGHT_2D_BRACKET = 315,
- FLATZINC_IDENTIFIER = 316,
- MZN_INVALID_INTEGER_LITERAL = 317,
- MZN_INVALID_FLOAT_LITERAL = 318,
- MZN_UNTERMINATED_STRING = 319,
- MZN_END_OF_LINE_IN_STRING = 320,
- MZN_INVALID_NULL = 321,
- MZN_EQUIV = 322,
- MZN_IMPL = 323,
- MZN_RIMPL = 324,
- MZN_OR = 325,
- MZN_XOR = 326,
- MZN_AND = 327,
- MZN_LE = 328,
- MZN_GR = 329,
- MZN_LQ = 330,
- MZN_GQ = 331,
- MZN_EQ = 332,
- MZN_NQ = 333,
- MZN_WEAK_EQ = 334,
- MZN_IN = 335,
- MZN_SUBSET = 336,
- MZN_SUPERSET = 337,
- MZN_UNION = 338,
- MZN_DIFF = 339,
- MZN_SYMDIFF = 340,
- MZN_DOTDOT = 341,
- MZN_PLUS = 342,
- MZN_MINUS = 343,
- MZN_WEAK_PLUS = 344,
- MZN_WEAK_MINUS = 345,
- MZN_MULT = 346,
- MZN_DIV = 347,
- MZN_IDIV = 348,
- MZN_MOD = 349,
- MZN_INTERSECT = 350,
- MZN_WEAK_MULT = 351,
- MZN_POW = 352,
- MZN_NOT = 353,
- MZN_PLUSPLUS = 354,
- MZN_COLONCOLON = 355,
- PREC_ANNO = 356,
- MZN_EQUIV_QUOTED = 357,
- MZN_IMPL_QUOTED = 358,
- MZN_RIMPL_QUOTED = 359,
- MZN_OR_QUOTED = 360,
- MZN_XOR_QUOTED = 361,
- MZN_AND_QUOTED = 362,
- MZN_LE_QUOTED = 363,
- MZN_GR_QUOTED = 364,
- MZN_LQ_QUOTED = 365,
- MZN_GQ_QUOTED = 366,
- MZN_EQ_QUOTED = 367,
- MZN_NQ_QUOTED = 368,
- MZN_IN_QUOTED = 369,
- MZN_SUBSET_QUOTED = 370,
- MZN_SUPERSET_QUOTED = 371,
- MZN_UNION_QUOTED = 372,
- MZN_DIFF_QUOTED = 373,
- MZN_SYMDIFF_QUOTED = 374,
- MZN_DOTDOT_QUOTED = 375,
- MZN_PLUS_QUOTED = 376,
- MZN_MINUS_QUOTED = 377,
- MZN_MULT_QUOTED = 378,
- MZN_DIV_QUOTED = 379,
- MZN_IDIV_QUOTED = 380,
- MZN_MOD_QUOTED = 381,
- MZN_INTERSECT_QUOTED = 382,
- MZN_POW_QUOTED = 383,
- MZN_NOT_QUOTED = 384,
- MZN_COLONCOLON_QUOTED = 385,
- MZN_PLUSPLUS_QUOTED = 386
- };
+ enum yytokentype
+ {
+ YYEMPTY = -2,
+ END = 0, /* "end of file" */
+ YYerror = 256, /* error */
+ YYUNDEF = 257, /* "invalid token" */
+ MZN_INTEGER_LITERAL = 258, /* "integer literal" */
+ MZN_BOOL_LITERAL = 259, /* "bool literal" */
+ MZN_FLOAT_LITERAL = 260, /* "float literal" */
+ MZN_IDENTIFIER = 261, /* "identifier" */
+ MZN_QUOTED_IDENTIFIER = 262, /* "quoted identifier" */
+ MZN_STRING_LITERAL = 263, /* "string literal" */
+ MZN_STRING_QUOTE_START = 264, /* "interpolated string start" */
+ MZN_STRING_QUOTE_MID = 265, /* "interpolated string middle" */
+ MZN_STRING_QUOTE_END = 266, /* "interpolated string end" */
+ MZN_TI_IDENTIFIER = 267, /* "type-inst identifier" */
+ MZN_TI_ENUM_IDENTIFIER = 268, /* "type-inst enum identifier" */
+ MZN_DOC_COMMENT = 269, /* "documentation comment" */
+ MZN_DOC_FILE_COMMENT = 270, /* "file-level documentation comment" */
+ MZN_VAR = 271, /* "var" */
+ MZN_PAR = 272, /* "par" */
+ MZN_ABSENT = 273, /* "<>" */
+ MZN_ANN = 274, /* "ann" */
+ MZN_ANNOTATION = 275, /* "annotation" */
+ MZN_ANY = 276, /* "any" */
+ MZN_ARRAY = 277, /* "array" */
+ MZN_BOOL = 278, /* "bool" */
+ MZN_CASE = 279, /* "case" */
+ MZN_CONSTRAINT = 280, /* "constraint" */
+ MZN_DEFAULT = 281, /* "default" */
+ MZN_ELSE = 282, /* "else" */
+ MZN_ELSEIF = 283, /* "elseif" */
+ MZN_ENDIF = 284, /* "endif" */
+ MZN_ENUM = 285, /* "enum" */
+ MZN_FLOAT = 286, /* "float" */
+ MZN_FUNCTION = 287, /* "function" */
+ MZN_IF = 288, /* "if" */
+ MZN_INCLUDE = 289, /* "include" */
+ MZN_INFINITY = 290, /* "infinity" */
+ MZN_INT = 291, /* "int" */
+ MZN_LET = 292, /* "let" */
+ MZN_LIST = 293, /* "list" */
+ MZN_MAXIMIZE = 294, /* "maximize" */
+ MZN_MINIMIZE = 295, /* "minimize" */
+ MZN_OF = 296, /* "of" */
+ MZN_OPT = 297, /* "opt" */
+ MZN_SATISFY = 298, /* "satisfy" */
+ MZN_OUTPUT = 299, /* "output" */
+ MZN_PREDICATE = 300, /* "predicate" */
+ MZN_RECORD = 301, /* "record" */
+ MZN_SET = 302, /* "set" */
+ MZN_SOLVE = 303, /* "solve" */
+ MZN_STRING = 304, /* "string" */
+ MZN_TEST = 305, /* "test" */
+ MZN_THEN = 306, /* "then" */
+ MZN_TUPLE = 307, /* "tuple" */
+ MZN_TYPE = 308, /* "type" */
+ MZN_UNDERSCORE = 309, /* "_" */
+ MZN_VARIANT_RECORD = 310, /* "variant_record" */
+ MZN_WHERE = 311, /* "where" */
+ MZN_LEFT_BRACKET = 312, /* "[" */
+ MZN_LEFT_2D_BRACKET = 313, /* "[|" */
+ MZN_RIGHT_BRACKET = 314, /* "]" */
+ MZN_RIGHT_2D_BRACKET = 315, /* "|]" */
+ FLATZINC_IDENTIFIER = 316, /* FLATZINC_IDENTIFIER */
+ MZN_INVALID_INTEGER_LITERAL = 317, /* "invalid integer literal" */
+ MZN_INVALID_FLOAT_LITERAL = 318, /* "invalid float literal" */
+ MZN_UNTERMINATED_STRING = 319, /* "unterminated string" */
+ MZN_END_OF_LINE_IN_STRING = 320, /* "end of line inside string literal" */
+ MZN_INVALID_NULL = 321, /* "null character" */
+ MZN_EQUIV = 322, /* "<->" */
+ MZN_IMPL = 323, /* "->" */
+ MZN_RIMPL = 324, /* "<-" */
+ MZN_OR = 325, /* "\\/" */
+ MZN_XOR = 326, /* "xor" */
+ MZN_AND = 327, /* "/\\" */
+ MZN_LE = 328, /* "<" */
+ MZN_GR = 329, /* ">" */
+ MZN_LQ = 330, /* "<=" */
+ MZN_GQ = 331, /* ">=" */
+ MZN_EQ = 332, /* "=" */
+ MZN_NQ = 333, /* "!=" */
+ MZN_WEAK_EQ = 334, /* "~=" */
+ MZN_IN = 335, /* "in" */
+ MZN_SUBSET = 336, /* "subset" */
+ MZN_SUPERSET = 337, /* "superset" */
+ MZN_UNION = 338, /* "union" */
+ MZN_DIFF = 339, /* "diff" */
+ MZN_SYMDIFF = 340, /* "symdiff" */
+ MZN_DOTDOT = 341, /* ".." */
+ MZN_PLUS = 342, /* "+" */
+ MZN_MINUS = 343, /* "-" */
+ MZN_WEAK_PLUS = 344, /* "~+" */
+ MZN_WEAK_MINUS = 345, /* "~-" */
+ MZN_MULT = 346, /* "*" */
+ MZN_DIV = 347, /* "/" */
+ MZN_IDIV = 348, /* "div" */
+ MZN_MOD = 349, /* "mod" */
+ MZN_INTERSECT = 350, /* "intersect" */
+ MZN_WEAK_MULT = 351, /* "~*" */
+ MZN_POW = 352, /* "^" */
+ MZN_NOT = 353, /* "not" */
+ MZN_PLUSPLUS = 354, /* "++" */
+ MZN_COLONCOLON = 355, /* "::" */
+ PREC_ANNO = 356, /* PREC_ANNO */
+ MZN_EQUIV_QUOTED = 357, /* "'<->'" */
+ MZN_IMPL_QUOTED = 358, /* "'->'" */
+ MZN_RIMPL_QUOTED = 359, /* "'<-'" */
+ MZN_OR_QUOTED = 360, /* "'\\/'" */
+ MZN_XOR_QUOTED = 361, /* "'xor'" */
+ MZN_AND_QUOTED = 362, /* "'/\\'" */
+ MZN_LE_QUOTED = 363, /* "'<'" */
+ MZN_GR_QUOTED = 364, /* "'>'" */
+ MZN_LQ_QUOTED = 365, /* "'<='" */
+ MZN_GQ_QUOTED = 366, /* "'>='" */
+ MZN_EQ_QUOTED = 367, /* "'='" */
+ MZN_NQ_QUOTED = 368, /* "'!='" */
+ MZN_IN_QUOTED = 369, /* "'in'" */
+ MZN_SUBSET_QUOTED = 370, /* "'subset'" */
+ MZN_SUPERSET_QUOTED = 371, /* "'superset'" */
+ MZN_UNION_QUOTED = 372, /* "'union'" */
+ MZN_DIFF_QUOTED = 373, /* "'diff'" */
+ MZN_SYMDIFF_QUOTED = 374, /* "'symdiff'" */
+ MZN_DOTDOT_QUOTED = 375, /* "'..'" */
+ MZN_PLUS_QUOTED = 376, /* "'+'" */
+ MZN_MINUS_QUOTED = 377, /* "'-'" */
+ MZN_MULT_QUOTED = 378, /* "'*'" */
+ MZN_DIV_QUOTED = 379, /* "'/'" */
+ MZN_IDIV_QUOTED = 380, /* "'div'" */
+ MZN_MOD_QUOTED = 381, /* "'mod'" */
+ MZN_INTERSECT_QUOTED = 382, /* "'intersect'" */
+ MZN_POW_QUOTED = 383, /* "'^'" */
+ MZN_NOT_QUOTED = 384, /* "'not'" */
+ MZN_COLONCOLON_QUOTED = 385, /* "'::'" */
+ MZN_PLUSPLUS_QUOTED = 386 /* "'++'" */
+ };
+ typedef enum yytokentype yytoken_kind_t;
#endif
-/* Tokens. */
-#define END 0
-#define MZN_INTEGER_LITERAL 258
-#define MZN_BOOL_LITERAL 259
-#define MZN_FLOAT_LITERAL 260
-#define MZN_IDENTIFIER 261
-#define MZN_QUOTED_IDENTIFIER 262
-#define MZN_STRING_LITERAL 263
-#define MZN_STRING_QUOTE_START 264
-#define MZN_STRING_QUOTE_MID 265
-#define MZN_STRING_QUOTE_END 266
-#define MZN_TI_IDENTIFIER 267
-#define MZN_TI_ENUM_IDENTIFIER 268
-#define MZN_DOC_COMMENT 269
-#define MZN_DOC_FILE_COMMENT 270
-#define MZN_VAR 271
-#define MZN_PAR 272
-#define MZN_ABSENT 273
-#define MZN_ANN 274
-#define MZN_ANNOTATION 275
-#define MZN_ANY 276
-#define MZN_ARRAY 277
-#define MZN_BOOL 278
-#define MZN_CASE 279
-#define MZN_CONSTRAINT 280
-#define MZN_DEFAULT 281
-#define MZN_ELSE 282
-#define MZN_ELSEIF 283
-#define MZN_ENDIF 284
-#define MZN_ENUM 285
-#define MZN_FLOAT 286
-#define MZN_FUNCTION 287
-#define MZN_IF 288
-#define MZN_INCLUDE 289
-#define MZN_INFINITY 290
-#define MZN_INT 291
-#define MZN_LET 292
-#define MZN_LIST 293
-#define MZN_MAXIMIZE 294
-#define MZN_MINIMIZE 295
-#define MZN_OF 296
-#define MZN_OPT 297
-#define MZN_SATISFY 298
-#define MZN_OUTPUT 299
-#define MZN_PREDICATE 300
-#define MZN_RECORD 301
-#define MZN_SET 302
-#define MZN_SOLVE 303
-#define MZN_STRING 304
-#define MZN_TEST 305
-#define MZN_THEN 306
-#define MZN_TUPLE 307
-#define MZN_TYPE 308
-#define MZN_UNDERSCORE 309
-#define MZN_VARIANT_RECORD 310
-#define MZN_WHERE 311
-#define MZN_LEFT_BRACKET 312
-#define MZN_LEFT_2D_BRACKET 313
-#define MZN_RIGHT_BRACKET 314
-#define MZN_RIGHT_2D_BRACKET 315
-#define FLATZINC_IDENTIFIER 316
-#define MZN_INVALID_INTEGER_LITERAL 317
-#define MZN_INVALID_FLOAT_LITERAL 318
-#define MZN_UNTERMINATED_STRING 319
-#define MZN_END_OF_LINE_IN_STRING 320
-#define MZN_INVALID_NULL 321
-#define MZN_EQUIV 322
-#define MZN_IMPL 323
-#define MZN_RIMPL 324
-#define MZN_OR 325
-#define MZN_XOR 326
-#define MZN_AND 327
-#define MZN_LE 328
-#define MZN_GR 329
-#define MZN_LQ 330
-#define MZN_GQ 331
-#define MZN_EQ 332
-#define MZN_NQ 333
-#define MZN_WEAK_EQ 334
-#define MZN_IN 335
-#define MZN_SUBSET 336
-#define MZN_SUPERSET 337
-#define MZN_UNION 338
-#define MZN_DIFF 339
-#define MZN_SYMDIFF 340
-#define MZN_DOTDOT 341
-#define MZN_PLUS 342
-#define MZN_MINUS 343
-#define MZN_WEAK_PLUS 344
-#define MZN_WEAK_MINUS 345
-#define MZN_MULT 346
-#define MZN_DIV 347
-#define MZN_IDIV 348
-#define MZN_MOD 349
-#define MZN_INTERSECT 350
-#define MZN_WEAK_MULT 351
-#define MZN_POW 352
-#define MZN_NOT 353
-#define MZN_PLUSPLUS 354
-#define MZN_COLONCOLON 355
-#define PREC_ANNO 356
-#define MZN_EQUIV_QUOTED 357
-#define MZN_IMPL_QUOTED 358
-#define MZN_RIMPL_QUOTED 359
-#define MZN_OR_QUOTED 360
-#define MZN_XOR_QUOTED 361
-#define MZN_AND_QUOTED 362
-#define MZN_LE_QUOTED 363
-#define MZN_GR_QUOTED 364
-#define MZN_LQ_QUOTED 365
-#define MZN_GQ_QUOTED 366
-#define MZN_EQ_QUOTED 367
-#define MZN_NQ_QUOTED 368
-#define MZN_IN_QUOTED 369
-#define MZN_SUBSET_QUOTED 370
-#define MZN_SUPERSET_QUOTED 371
-#define MZN_UNION_QUOTED 372
-#define MZN_DIFF_QUOTED 373
-#define MZN_SYMDIFF_QUOTED 374
-#define MZN_DOTDOT_QUOTED 375
-#define MZN_PLUS_QUOTED 376
-#define MZN_MINUS_QUOTED 377
-#define MZN_MULT_QUOTED 378
-#define MZN_DIV_QUOTED 379
-#define MZN_IDIV_QUOTED 380
-#define MZN_MOD_QUOTED 381
-#define MZN_INTERSECT_QUOTED 382
-#define MZN_POW_QUOTED 383
-#define MZN_NOT_QUOTED 384
-#define MZN_COLONCOLON_QUOTED 385
-#define MZN_PLUSPLUS_QUOTED 386
-
-
-
+/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE
-
-{ long long int iValue; char* sValue; bool bValue; double dValue;
+union YYSTYPE
+{
+ long long int iValue; char* sValue; bool bValue; double dValue;
MiniZinc::Item* item;
MiniZinc::VarDecl* vardeclexpr;
std::vector* vardeclexpr_v;
@@ -324,28 +206,31 @@ typedef union YYSTYPE
std::vector* string_v;
std::vector >* expression_p;
MiniZinc::Generators* generators;
- }
-/* Line 1529 of yacc.c. */
+
- YYSTYPE;
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
+
+};
+typedef union YYSTYPE YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
+# define YYSTYPE_IS_DECLARED 1
#endif
-
-
+/* Location type. */
#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
-typedef struct YYLTYPE
+typedef struct YYLTYPE YYLTYPE;
+struct YYLTYPE
{
int first_line;
int first_column;
int last_line;
int last_column;
-} YYLTYPE;
-# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
+};
# define YYLTYPE_IS_DECLARED 1
# define YYLTYPE_IS_TRIVIAL 1
#endif
+
+int mzn_yyparse (void *parm);
+
+#endif /* !YY_MZN_YY_USERS_DEKKER1_CODE_GITHUB_COM_MINIZINC_LIBMINIZINC_BYTE_BUILD_INCLUDE_MINIZINC_PARSER_TAB_HH_INCLUDED */
diff --git a/software/mza/lib/cached/minizinc/support/mza_parser.tab.hh b/software/mza/lib/cached/minizinc/support/mza_parser.tab.hh
index 41e37fc..da5bd1f 100644
--- a/software/mza/lib/cached/minizinc/support/mza_parser.tab.hh
+++ b/software/mza/lib/cached/minizinc/support/mza_parser.tab.hh
@@ -1,8 +1,9 @@
-/* A Bison parser, made by GNU Bison 3.0.4. */
+/* A Bison parser, made by GNU Bison 3.7.6. */
/* Bison interface for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
+ Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -15,7 +16,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program. If not, see . */
+ along with this program. If not, see . */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@@ -30,8 +31,12 @@
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
-#ifndef YY_MZA_YY_HOME_JDEKKER_BUILD_PKG_MINIZINC_INCLUDE_MINIZINC_SUPPORT_MZA_PARSER_TAB_HH_INCLUDED
-# define YY_MZA_YY_HOME_JDEKKER_BUILD_PKG_MINIZINC_INCLUDE_MINIZINC_SUPPORT_MZA_PARSER_TAB_HH_INCLUDED
+/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
+ especially those whose name start with YY_ or yy_. They are
+ private implementation details that can be changed or removed. */
+
+#ifndef YY_MZA_YY_USERS_DEKKER1_CODE_GITHUB_COM_MINIZINC_LIBMINIZINC_BYTE_BUILD_INCLUDE_MINIZINC_SUPPORT_MZA_PARSER_TAB_HH_INCLUDED
+# define YY_MZA_YY_USERS_DEKKER1_CODE_GITHUB_COM_MINIZINC_LIBMINIZINC_BYTE_BUILD_INCLUDE_MINIZINC_SUPPORT_MZA_PARSER_TAB_HH_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
@@ -40,88 +45,113 @@
extern int mza_yydebug;
#endif
-/* Token type. */
+/* Token kinds. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
enum yytokentype
{
- MZA_INT = 258,
- MZA_REG = 259,
- MZA_MODE = 260,
- MZA_CTX = 261,
- MZA_ID = 262,
- MZA_COLON = 263,
- MZA_DELAY = 264,
- MZA_ADDI = 265,
- MZA_SUBI = 266,
- MZA_MULI = 267,
- MZA_DIVI = 268,
- MZA_MODI = 269,
- MZA_INCI = 270,
- MZA_DECI = 271,
- MZA_IMMI = 272,
- MZA_LOAD_GLOBAL = 273,
- MZA_STORE_GLOBAL = 274,
- MZA_MOV = 275,
- MZA_JMP = 276,
- MZA_JMPIF = 277,
- MZA_JMPIFNOT = 278,
- MZA_EQI = 279,
- MZA_LTI = 280,
- MZA_LEI = 281,
- MZA_AND = 282,
- MZA_OR = 283,
- MZA_NOT = 284,
- MZA_XOR = 285,
- MZA_ISPAR = 286,
- MZA_ISEMPTY = 287,
- MZA_LENGTH = 288,
- MZA_GET_VEC = 289,
- MZA_LB = 290,
- MZA_UB = 291,
- MZA_DOM = 292,
- MZA_MAKE_SET = 293,
- MZA_INTERSECTION = 294,
- MZA_UNION = 295,
- MZA_INTERSECT_DOMAIN = 296,
- MZA_OPEN_AGGREGATION = 297,
- MZA_CLOSE_AGGREGATION = 298,
- MZA_SIMPLIFY_LIN = 299,
- MZA_PUSH = 300,
- MZA_POP = 301,
- MZA_POST = 302,
- MZA_RET = 303,
- MZA_CALL = 304,
- MZA_BUILTIN = 305,
- MZA_TCALL = 306,
- MZA_TRACE = 307,
- MZA_ABORT = 308
+ YYEMPTY = -2,
+ YYEOF = 0, /* "end of file" */
+ YYerror = 256, /* error */
+ YYUNDEF = 257, /* "invalid token" */
+ MZA_INT = 258, /* MZA_INT */
+ MZA_REG = 259, /* MZA_REG */
+ MZA_MODE = 260, /* MZA_MODE */
+ MZA_CTX = 261, /* MZA_CTX */
+ MZA_ID = 262, /* MZA_ID */
+ MZA_COLON = 263, /* ":" */
+ MZA_DELAY = 264, /* "D" */
+ MZA_GLOBAL = 265, /* "GLOBAL" */
+ MZA_ADDI = 266, /* MZA_ADDI */
+ MZA_SUBI = 267, /* MZA_SUBI */
+ MZA_MULI = 268, /* MZA_MULI */
+ MZA_DIVI = 269, /* MZA_DIVI */
+ MZA_MODI = 270, /* MZA_MODI */
+ MZA_INCI = 271, /* MZA_INCI */
+ MZA_DECI = 272, /* MZA_DECI */
+ MZA_IMMI = 273, /* MZA_IMMI */
+ MZA_CLEAR = 274, /* MZA_CLEAR */
+ MZA_LOAD_GLOBAL = 275, /* MZA_LOAD_GLOBAL */
+ MZA_STORE_GLOBAL = 276, /* MZA_STORE_GLOBAL */
+ MZA_MOV = 277, /* MZA_MOV */
+ MZA_JMP = 278, /* MZA_JMP */
+ MZA_JMPIF = 279, /* MZA_JMPIF */
+ MZA_JMPIFNOT = 280, /* MZA_JMPIFNOT */
+ MZA_EQI = 281, /* MZA_EQI */
+ MZA_LTI = 282, /* MZA_LTI */
+ MZA_LEI = 283, /* MZA_LEI */
+ MZA_AND = 284, /* MZA_AND */
+ MZA_OR = 285, /* MZA_OR */
+ MZA_NOT = 286, /* MZA_NOT */
+ MZA_XOR = 287, /* MZA_XOR */
+ MZA_ISPAR = 288, /* MZA_ISPAR */
+ MZA_ISEMPTY = 289, /* MZA_ISEMPTY */
+ MZA_LENGTH = 290, /* MZA_LENGTH */
+ MZA_GET_VEC = 291, /* MZA_GET_VEC */
+ MZA_GET_ARRAY = 292, /* MZA_GET_ARRAY */
+ MZA_LB = 293, /* MZA_LB */
+ MZA_UB = 294, /* MZA_UB */
+ MZA_DOM = 295, /* MZA_DOM */
+ MZA_MAKE_SET = 296, /* MZA_MAKE_SET */
+ MZA_DIFF = 297, /* MZA_DIFF */
+ MZA_INTERSECTION = 298, /* MZA_INTERSECTION */
+ MZA_UNION = 299, /* MZA_UNION */
+ MZA_INTERSECT_DOMAIN = 300, /* MZA_INTERSECT_DOMAIN */
+ MZA_OPEN_AGGREGATION = 301, /* MZA_OPEN_AGGREGATION */
+ MZA_CLOSE_AGGREGATION = 302, /* MZA_CLOSE_AGGREGATION */
+ MZA_SIMPLIFY_LIN = 303, /* MZA_SIMPLIFY_LIN */
+ MZA_PUSH = 304, /* MZA_PUSH */
+ MZA_POP = 305, /* MZA_POP */
+ MZA_POST = 306, /* MZA_POST */
+ MZA_RET = 307, /* MZA_RET */
+ MZA_CALL = 308, /* MZA_CALL */
+ MZA_BUILTIN = 309, /* MZA_BUILTIN */
+ MZA_TCALL = 310, /* MZA_TCALL */
+ MZA_ITER_ARRAY = 311, /* MZA_ITER_ARRAY */
+ MZA_ITER_VEC = 312, /* MZA_ITER_VEC */
+ MZA_ITER_RANGE = 313, /* MZA_ITER_RANGE */
+ MZA_ITER_NEXT = 314, /* MZA_ITER_NEXT */
+ MZA_ITER_BREAK = 315, /* MZA_ITER_BREAK */
+ MZA_TRACE = 316, /* MZA_TRACE */
+ MZA_ABORT = 317 /* MZA_ABORT */
};
+ typedef enum yytokentype yytoken_kind_t;
#endif
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-
union YYSTYPE
{
-
int iValue;
char* sValue;
MiniZinc::BytecodeStream::Instr bValue;
std::list* liValue;
+ std::list* sliValue;
};
-
typedef union YYSTYPE YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
#endif
+/* Location type. */
+#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
+typedef struct YYLTYPE YYLTYPE;
+struct YYLTYPE
+{
+ int first_line;
+ int first_column;
+ int last_line;
+ int last_column;
+};
+# define YYLTYPE_IS_DECLARED 1
+# define YYLTYPE_IS_TRIVIAL 1
+#endif
+
-extern YYSTYPE mza_yylval;
int mza_yyparse (MZAContext& ctx);
-#endif /* !YY_MZA_YY_HOME_JDEKKER_BUILD_PKG_MINIZINC_INCLUDE_MINIZINC_SUPPORT_MZA_PARSER_TAB_HH_INCLUDED */
+#endif /* !YY_MZA_YY_USERS_DEKKER1_CODE_GITHUB_COM_MINIZINC_LIBMINIZINC_BYTE_BUILD_INCLUDE_MINIZINC_SUPPORT_MZA_PARSER_TAB_HH_INCLUDED */
diff --git a/software/mza/lib/cached/minizinc/support/regex_parser.tab.hh b/software/mza/lib/cached/minizinc/support/regex_parser.tab.hh
index 2b6234b..ac2fff3 100644
--- a/software/mza/lib/cached/minizinc/support/regex_parser.tab.hh
+++ b/software/mza/lib/cached/minizinc/support/regex_parser.tab.hh
@@ -1,8 +1,9 @@
-/* A Bison parser, made by GNU Bison 3.0.5. */
+/* A Bison parser, made by GNU Bison 3.7.6. */
/* Bison interface for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2015, 2018 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
+ Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -15,7 +16,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program. If not, see . */
+ along with this program. If not, see . */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@@ -30,8 +31,12 @@
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
-#ifndef YY_REGEX_YY_USERS_JDEK0001_REPOSITORIES_MINIZINC_MINIZINC_BUILD_RELEASE_INCLUDE_MINIZINC_SUPPORT_REGEX_PARSER_TAB_HH_INCLUDED
-# define YY_REGEX_YY_USERS_JDEK0001_REPOSITORIES_MINIZINC_MINIZINC_BUILD_RELEASE_INCLUDE_MINIZINC_SUPPORT_REGEX_PARSER_TAB_HH_INCLUDED
+/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
+ especially those whose name start with YY_ or yy_. They are
+ private implementation details that can be changed or removed. */
+
+#ifndef YY_REGEX_YY_USERS_DEKKER1_CODE_GITHUB_COM_MINIZINC_LIBMINIZINC_BYTE_BUILD_INCLUDE_MINIZINC_SUPPORT_REGEX_PARSER_TAB_HH_INCLUDED
+# define YY_REGEX_YY_USERS_DEKKER1_CODE_GITHUB_COM_MINIZINC_LIBMINIZINC_BYTE_BUILD_INCLUDE_MINIZINC_SUPPORT_REGEX_PARSER_TAB_HH_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
@@ -40,37 +45,40 @@
extern int regex_yydebug;
#endif
-/* Token type. */
+/* Token kinds. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
enum yytokentype
{
- R_INTEGER = 258,
- R_GROUP_OPEN = 259,
- R_GROUP_CLOSE = 260,
- R_STAR = 261,
- R_PLUS = 262,
- R_ANY = 263,
- R_UNION = 264,
- R_OPTIONAL = 265,
- R_QUANT_OPEN = 266,
- R_QUANT_CLOSE = 267,
- R_COMMA = 268,
- R_CLASS_OPEN = 269,
- R_CLASS_CLOSE = 270,
- R_CLASS_RANGE = 271,
- R_CLASS_NEG = 272,
- R_IDENTIFIER = 273
+ YYEMPTY = -2,
+ YYEOF = 0, /* "end of file" */
+ YYerror = 256, /* error */
+ YYUNDEF = 257, /* "invalid token" */
+ R_INTEGER = 258, /* R_INTEGER */
+ R_GROUP_OPEN = 259, /* "(" */
+ R_GROUP_CLOSE = 260, /* ")" */
+ R_STAR = 261, /* "*" */
+ R_PLUS = 262, /* "+" */
+ R_ANY = 263, /* "." */
+ R_UNION = 264, /* "|" */
+ R_OPTIONAL = 265, /* "?" */
+ R_QUANT_OPEN = 266, /* "{" */
+ R_QUANT_CLOSE = 267, /* "}" */
+ R_COMMA = 268, /* "," */
+ R_CLASS_OPEN = 269, /* "[" */
+ R_CLASS_CLOSE = 270, /* "]" */
+ R_CLASS_RANGE = 271, /* "-" */
+ R_CLASS_NEG = 272, /* "^" */
+ R_IDENTIFIER = 273 /* R_IDENTIFIER */
};
+ typedef enum yytokentype yytoken_kind_t;
#endif
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-
union YYSTYPE
{
-
int iValue;
char* sValue;
std::unordered_set* setValue;
@@ -78,7 +86,6 @@ union YYSTYPE
};
-
typedef union YYSTYPE YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
@@ -89,4 +96,4 @@ extern YYSTYPE regex_yylval;
int regex_yyparse (REContext& ctx);
-#endif /* !YY_REGEX_YY_USERS_JDEK0001_REPOSITORIES_MINIZINC_MINIZINC_BUILD_RELEASE_INCLUDE_MINIZINC_SUPPORT_REGEX_PARSER_TAB_HH_INCLUDED */
+#endif /* !YY_REGEX_YY_USERS_DEKKER1_CODE_GITHUB_COM_MINIZINC_LIBMINIZINC_BYTE_BUILD_INCLUDE_MINIZINC_SUPPORT_REGEX_PARSER_TAB_HH_INCLUDED */
diff --git a/software/mza/lib/cached/mza_lexer.yy.cpp b/software/mza/lib/cached/mza_lexer.yy.cpp
index ea1d844..531da28 100644
--- a/software/mza/lib/cached/mza_lexer.yy.cpp
+++ b/software/mza/lib/cached/mza_lexer.yy.cpp
@@ -216,6 +216,30 @@
#define yywrap mza_yywrap
#endif
+#ifdef yyget_lval
+#define mza_yyget_lval_ALREADY_DEFINED
+#else
+#define yyget_lval mza_yyget_lval
+#endif
+
+#ifdef yyset_lval
+#define mza_yyset_lval_ALREADY_DEFINED
+#else
+#define yyset_lval mza_yyset_lval
+#endif
+
+#ifdef yyget_lloc
+#define mza_yyget_lloc_ALREADY_DEFINED
+#else
+#define yyget_lloc mza_yyget_lloc
+#endif
+
+#ifdef yyset_lloc
+#define mza_yyset_lloc_ALREADY_DEFINED
+#else
+#define yyset_lloc mza_yyset_lloc
+#endif
+
#ifdef yyalloc
#define mza_yyalloc_ALREADY_DEFINED
#else
@@ -611,8 +635,8 @@ static void yynoreturn yy_fatal_error ( const char* msg );
(yy_hold_char) = *yy_cp; \
*yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp;
-#define YY_NUM_RULES 63
-#define YY_END_OF_BUFFER 64
+#define YY_NUM_RULES 72
+#define YY_END_OF_BUFFER 73
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
@@ -620,36 +644,41 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static const flex_int16_t yy_accept[257] =
+static const flex_int16_t yy_accept[296] =
{ 0,
- 0, 0, 64, 62, 1, 1, 2, 62, 62, 3,
- 5, 60, 60, 60, 6, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 6, 60, 2, 0, 61, 3, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 32, 60, 60, 60, 60,
- 60, 60, 60, 60, 25, 60, 60, 60, 4, 60,
- 60, 60, 60, 60, 60, 60, 60, 33, 60, 60,
- 60, 60, 60, 24, 60, 60, 60, 60, 60, 34,
- 21, 56, 60, 60, 58, 60, 60, 60, 60, 18,
+ 0, 0, 73, 71, 2, 1, 3, 71, 71, 4,
+ 6, 69, 69, 69, 7, 69, 69, 69, 69, 69,
+ 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
+ 69, 69, 7, 69, 3, 0, 70, 4, 69, 69,
+ 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
+ 69, 69, 69, 69, 69, 69, 69, 36, 69, 69,
+ 69, 69, 69, 69, 69, 69, 28, 69, 69, 69,
+ 5, 69, 69, 69, 69, 69, 69, 69, 37, 69,
+ 69, 69, 69, 69, 27, 69, 69, 69, 69, 69,
+ 69, 69, 38, 24, 65, 69, 69, 69, 67, 69,
- 23, 60, 60, 22, 60, 60, 17, 60, 26, 60,
- 60, 43, 60, 60, 53, 45, 60, 60, 60, 60,
- 60, 60, 60, 51, 27, 60, 7, 60, 46, 60,
- 13, 10, 60, 60, 14, 60, 12, 60, 60, 60,
- 60, 60, 60, 60, 11, 9, 60, 60, 44, 42,
- 54, 60, 60, 8, 60, 60, 60, 50, 60, 60,
- 60, 60, 60, 60, 60, 28, 19, 60, 60, 60,
- 60, 52, 60, 60, 60, 48, 49, 37, 60, 60,
- 60, 60, 60, 60, 60, 60, 30, 60, 60, 60,
- 60, 60, 60, 47, 60, 57, 31, 59, 60, 29,
+ 69, 69, 69, 69, 21, 26, 69, 69, 25, 69,
+ 69, 20, 69, 29, 69, 69, 48, 69, 69, 50,
+ 69, 69, 69, 69, 69, 69, 69, 61, 30, 69,
+ 9, 69, 51, 69, 69, 15, 40, 12, 69, 69,
+ 69, 16, 69, 14, 69, 69, 69, 69, 69, 69,
+ 69, 69, 13, 11, 69, 69, 49, 47, 63, 69,
+ 69, 10, 69, 69, 69, 60, 69, 17, 69, 69,
+ 69, 69, 69, 69, 69, 69, 31, 69, 22, 69,
+ 69, 69, 69, 62, 69, 69, 69, 53, 59, 42,
+ 69, 69, 69, 69, 69, 8, 69, 69, 69, 69,
+
+ 69, 69, 69, 69, 69, 33, 69, 69, 69, 69,
+ 69, 69, 52, 69, 66, 69, 34, 68, 69, 32,
+ 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
+ 69, 69, 69, 69, 69, 69, 69, 69, 69, 55,
+ 23, 69, 39, 69, 64, 69, 69, 69, 35, 69,
+ 69, 69, 57, 69, 69, 69, 69, 69, 69, 69,
+ 69, 54, 58, 56, 69, 69, 69, 69, 69, 69,
+ 69, 18, 69, 69, 69, 69, 41, 69, 69, 46,
+ 19, 69, 69, 69, 69, 69, 69, 69, 69, 69,
+ 69, 43, 44, 45, 0
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 20,
- 60, 35, 60, 55, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 15, 60, 60, 60, 60, 36, 60, 60,
- 41, 16, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 38, 39, 40, 0
} ;
static const YY_CHAR yy_ec[256] =
@@ -662,12 +691,12 @@ static const YY_CHAR yy_ec[256] =
8, 8, 8, 8, 8, 8, 8, 9, 1, 1,
1, 1, 1, 1, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
- 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
- 1, 4, 1, 1, 36, 1, 35, 35, 35, 37,
+ 26, 27, 28, 29, 30, 31, 32, 33, 34, 32,
+ 1, 4, 1, 1, 35, 1, 32, 32, 32, 36,
- 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
- 35, 35, 35, 38, 35, 35, 35, 35, 35, 35,
- 35, 35, 1, 1, 1, 1, 1, 1, 1, 1,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 37, 32, 32, 32, 32, 32, 32,
+ 32, 32, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -684,152 +713,170 @@ static const YY_CHAR yy_ec[256] =
1, 1, 1, 1, 1
} ;
-static const YY_CHAR yy_meta[39] =
+static const YY_CHAR yy_meta[38] =
{ 0,
1, 1, 2, 3, 1, 1, 1, 4, 1, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4
+ 4, 4, 4, 4, 4, 4, 4
} ;
-static const flex_int16_t yy_base[260] =
+static const flex_int16_t yy_base[299] =
{ 0,
- 0, 0, 268, 269, 269, 269, 0, 261, 258, 257,
- 269, 28, 234, 32, 26, 237, 232, 247, 0, 24,
- 238, 34, 44, 235, 30, 19, 52, 43, 44, 54,
- 244, 233, 0, 248, 0, 249, 269, 246, 0, 229,
- 239, 238, 232, 228, 224, 235, 215, 223, 226, 220,
- 213, 42, 57, 56, 216, 0, 57, 230, 221, 218,
- 65, 216, 207, 221, 0, 217, 54, 205, 224, 199,
- 201, 205, 206, 203, 215, 215, 214, 0, 205, 210,
- 194, 193, 201, 0, 197, 196, 188, 197, 196, 0,
- 0, 177, 176, 193, 174, 191, 194, 185, 196, 187,
+ 0, 0, 306, 307, 307, 307, 0, 299, 296, 295,
+ 307, 27, 272, 31, 25, 275, 270, 30, 0, 25,
+ 277, 31, 46, 274, 32, 34, 54, 45, 53, 56,
+ 283, 272, 0, 287, 0, 288, 307, 285, 0, 268,
+ 278, 277, 271, 267, 57, 275, 51, 264, 267, 261,
+ 254, 258, 47, 61, 63, 267, 255, 0, 66, 269,
+ 260, 257, 70, 255, 246, 260, 0, 256, 66, 244,
+ 263, 241, 245, 246, 243, 255, 255, 254, 0, 245,
+ 250, 234, 233, 241, 0, 237, 236, 246, 227, 236,
+ 238, 234, 0, 0, 216, 215, 238, 230, 212, 228,
- 0, 188, 190, 0, 188, 183, 0, 182, 0, 176,
- 184, 0, 168, 179, 0, 0, 166, 169, 166, 174,
- 170, 178, 165, 0, 0, 159, 0, 158, 0, 172,
- 0, 0, 162, 153, 0, 160, 0, 155, 156, 153,
- 164, 149, 141, 140, 0, 0, 139, 147, 0, 0,
- 137, 151, 157, 0, 149, 155, 145, 0, 149, 130,
- 151, 150, 149, 134, 132, 0, 137, 142, 142, 129,
- 146, 0, 132, 136, 117, 0, 0, 0, 129, 141,
- 134, 137, 132, 133, 112, 121, 0, 123, 129, 126,
- 127, 125, 123, 0, 122, 0, 0, 0, 125, 0,
+ 231, 222, 233, 215, 223, 0, 224, 226, 0, 224,
+ 219, 0, 218, 0, 212, 220, 0, 204, 215, 0,
+ 202, 205, 202, 210, 206, 214, 201, 0, 0, 195,
+ 0, 194, 0, 195, 207, 0, 0, 0, 197, 75,
+ 209, 0, 195, 0, 190, 191, 188, 179, 198, 183,
+ 176, 175, 0, 0, 174, 181, 0, 0, 172, 185,
+ 191, 0, 183, 189, 179, 0, 183, 0, 165, 185,
+ 171, 183, 175, 181, 166, 164, 0, 76, 169, 174,
+ 174, 161, 178, 0, 164, 168, 150, 0, 0, 0,
+ 161, 173, 166, 154, 168, 0, 163, 164, 143, 149,
+
+ 148, 160, 163, 158, 147, 0, 149, 155, 152, 153,
+ 151, 149, 0, 148, 0, 153, 0, 0, 150, 0,
+ 134, 146, 126, 135, 145, 127, 131, 125, 137, 136,
+ 117, 129, 133, 114, 118, 136, 135, 115, 127, 0,
+ 0, 131, 0, 114, 0, 105, 115, 111, 0, 74,
+ 103, 116, 0, 121, 124, 119, 111, 120, 116, 105,
+ 115, 0, 0, 0, 106, 110, 107, 114, 107, 99,
+ 97, 0, 110, 96, 97, 106, 0, 93, 82, 0,
+ 0, 79, 95, 86, 84, 82, 74, 73, 73, 72,
+ 70, 0, 0, 0, 307, 109, 113, 42
- 107, 111, 105, 117, 116, 97, 109, 113, 99, 0,
- 116, 0, 99, 0, 89, 100, 96, 65, 112, 107,
- 99, 108, 104, 93, 103, 94, 98, 95, 102, 95,
- 87, 84, 0, 97, 80, 79, 89, 0, 76, 68,
- 0, 0, 66, 84, 75, 74, 73, 66, 65, 65,
- 64, 62, 0, 0, 0, 269, 101, 105, 80
} ;
-static const flex_int16_t yy_def[260] =
+static const flex_int16_t yy_def[299] =
{ 0,
- 256, 1, 256, 256, 256, 256, 257, 258, 256, 256,
- 256, 259, 259, 259, 259, 259, 259, 259, 259, 259,
- 259, 259, 259, 259, 259, 259, 259, 259, 259, 259,
- 259, 259, 259, 259, 257, 258, 256, 256, 259, 259,
- 259, 259, 259, 259, 259, 259, 259, 259, 259, 259,
- 259, 259, 259, 259, 259, 259, 259, 259, 259, 259,
- 259, 259, 259, 259, 259, 259, 259, 259, 259, 259,
- 259, 259, 259, 259, 259, 259, 259, 259, 259, 259,
- 259, 259, 259, 259, 259, 259, 259, 259, 259, 259,
- 259, 259, 259, 259, 259, 259, 259, 259, 259, 259,
+ 295, 1, 295, 295, 295, 295, 296, 297, 295, 295,
+ 295, 298, 298, 298, 298, 298, 298, 298, 298, 298,
+ 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
+ 298, 298, 298, 298, 296, 297, 295, 295, 298, 298,
+ 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
+ 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
+ 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
+ 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
+ 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
+ 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
- 259, 259, 259, 259, 259, 259, 259, 259, 259, 259,
- 259, 259, 259, 259, 259, 259, 259, 259, 259, 259,
- 259, 259, 259, 259, 259, 259, 259, 259, 259, 259,
- 259, 259, 259, 259, 259, 259, 259, 259, 259, 259,
- 259, 259, 259, 259, 259, 259, 259, 259, 259, 259,
- 259, 259, 259, 259, 259, 259, 259, 259, 259, 259,
- 259, 259, 259, 259, 259, 259, 259, 259, 259, 259,
- 259, 259, 259, 259, 259, 259, 259, 259, 259, 259,
- 259, 259, 259, 259, 259, 259, 259, 259, 259, 259,
- 259, 259, 259, 259, 259, 259, 259, 259, 259, 259,
+ 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
+ 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
+ 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
+ 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
+ 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
+ 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
+ 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
+ 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
+ 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
+ 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
+
+ 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
+ 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
+ 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
+ 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
+ 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
+ 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
+ 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
+ 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
+ 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
+ 298, 298, 298, 298, 0, 295, 295, 295
- 259, 259, 259, 259, 259, 259, 259, 259, 259, 259,
- 259, 259, 259, 259, 259, 259, 259, 259, 259, 259,
- 259, 259, 259, 259, 259, 259, 259, 259, 259, 259,
- 259, 259, 259, 259, 259, 259, 259, 259, 259, 259,
- 259, 259, 259, 259, 259, 259, 259, 259, 259, 259,
- 259, 259, 259, 259, 259, 0, 256, 256, 256
} ;
-static const flex_int16_t yy_nxt[308] =
+static const flex_int16_t yy_nxt[345] =
{ 0,
4, 5, 6, 4, 7, 8, 9, 10, 11, 12,
13, 14, 15, 16, 17, 18, 19, 20, 21, 19,
22, 23, 24, 25, 26, 19, 27, 28, 29, 30,
- 31, 19, 32, 19, 19, 4, 33, 34, 40, 46,
- 41, 44, 67, 47, 56, 52, 53, 57, 68, 48,
- 42, 54, 45, 60, 64, 76, 65, 58, 66, 69,
- 73, 70, 59, 94, 78, 71, 95, 61, 96, 98,
- 77, 74, 75, 62, 101, 72, 79, 106, 112, 102,
- 99, 113, 224, 39, 255, 97, 254, 253, 252, 251,
- 250, 249, 248, 247, 246, 107, 245, 244, 243, 242,
+ 31, 19, 32, 19, 4, 33, 34, 40, 46, 41,
+ 44, 58, 47, 51, 59, 39, 53, 54, 48, 42,
+ 52, 45, 55, 56, 60, 62, 66, 69, 67, 61,
+ 68, 71, 74, 70, 77, 91, 79, 72, 98, 63,
+ 88, 99, 100, 75, 76, 64, 102, 73, 80, 78,
+ 89, 92, 111, 106, 171, 200, 201, 103, 107, 101,
+ 117, 260, 294, 118, 293, 292, 291, 290, 202, 289,
- 225, 35, 241, 35, 35, 36, 240, 239, 36, 238,
- 237, 236, 235, 234, 233, 232, 231, 230, 229, 228,
- 227, 226, 223, 222, 221, 220, 219, 218, 217, 216,
- 215, 214, 213, 212, 211, 210, 209, 208, 207, 206,
- 205, 204, 203, 202, 201, 200, 199, 198, 197, 196,
- 195, 194, 193, 192, 191, 190, 189, 188, 187, 186,
- 185, 184, 183, 182, 181, 180, 179, 178, 177, 176,
- 175, 174, 173, 172, 171, 170, 169, 168, 167, 166,
- 165, 164, 163, 162, 161, 160, 159, 158, 157, 156,
- 155, 154, 153, 152, 151, 150, 149, 148, 147, 146,
+ 112, 288, 203, 287, 286, 172, 204, 285, 261, 35,
+ 284, 35, 35, 36, 283, 282, 36, 281, 280, 279,
+ 278, 277, 276, 275, 274, 273, 272, 271, 270, 269,
+ 268, 267, 266, 265, 264, 263, 262, 259, 258, 257,
+ 256, 255, 254, 253, 252, 251, 250, 249, 248, 247,
+ 246, 245, 244, 243, 242, 241, 240, 239, 238, 237,
+ 236, 235, 234, 233, 232, 231, 230, 229, 228, 227,
+ 226, 225, 224, 223, 222, 221, 220, 219, 218, 217,
+ 216, 215, 214, 213, 212, 211, 210, 209, 208, 207,
+ 206, 205, 199, 198, 197, 196, 195, 194, 193, 192,
- 145, 144, 143, 142, 141, 140, 139, 138, 137, 136,
- 135, 134, 133, 132, 131, 130, 129, 128, 127, 126,
- 125, 124, 123, 122, 121, 120, 119, 118, 117, 116,
- 115, 69, 114, 111, 110, 109, 108, 105, 104, 103,
- 100, 93, 92, 91, 90, 89, 88, 87, 86, 85,
- 84, 83, 82, 38, 37, 69, 81, 80, 63, 55,
- 51, 50, 49, 43, 38, 38, 37, 256, 3, 256,
- 256, 256, 256, 256, 256, 256, 256, 256, 256, 256,
- 256, 256, 256, 256, 256, 256, 256, 256, 256, 256,
- 256, 256, 256, 256, 256, 256, 256, 256, 256, 256,
+ 191, 190, 189, 188, 187, 186, 185, 184, 183, 182,
+ 181, 180, 179, 178, 177, 176, 175, 174, 173, 170,
+ 169, 168, 167, 166, 165, 164, 163, 162, 161, 160,
+ 159, 158, 157, 156, 155, 154, 153, 152, 151, 150,
+ 149, 148, 147, 146, 145, 144, 143, 142, 141, 140,
+ 139, 138, 137, 136, 135, 134, 133, 132, 131, 130,
+ 129, 128, 127, 126, 125, 124, 123, 122, 121, 120,
+ 71, 119, 116, 115, 114, 113, 110, 109, 108, 105,
+ 104, 97, 96, 95, 94, 93, 90, 87, 86, 85,
+ 84, 83, 38, 37, 71, 82, 81, 65, 57, 50,
- 256, 256, 256, 256, 256, 256, 256
+ 49, 43, 38, 38, 37, 295, 3, 295, 295, 295,
+ 295, 295, 295, 295, 295, 295, 295, 295, 295, 295,
+ 295, 295, 295, 295, 295, 295, 295, 295, 295, 295,
+ 295, 295, 295, 295, 295, 295, 295, 295, 295, 295,
+ 295, 295, 295, 295
} ;
-static const flex_int16_t yy_chk[308] =
+static const flex_int16_t yy_chk[345] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 12, 15,
- 12, 14, 26, 15, 22, 20, 20, 22, 26, 15,
- 12, 20, 14, 23, 25, 29, 25, 22, 25, 27,
- 28, 27, 22, 52, 30, 27, 52, 23, 53, 54,
- 29, 28, 28, 23, 57, 27, 30, 61, 67, 57,
- 54, 67, 218, 259, 252, 53, 251, 250, 249, 248,
- 247, 246, 245, 244, 243, 61, 240, 239, 237, 236,
+ 1, 1, 1, 1, 1, 1, 1, 12, 15, 12,
+ 14, 22, 15, 18, 22, 298, 20, 20, 15, 12,
+ 18, 14, 20, 20, 22, 23, 25, 26, 25, 22,
+ 25, 27, 28, 26, 29, 47, 30, 27, 53, 23,
+ 45, 53, 54, 28, 28, 23, 55, 27, 30, 29,
+ 45, 47, 63, 59, 140, 178, 178, 55, 59, 54,
+ 69, 250, 291, 69, 290, 289, 288, 287, 178, 286,
- 218, 257, 235, 257, 257, 258, 234, 232, 258, 231,
- 230, 229, 228, 227, 226, 225, 224, 223, 222, 221,
- 220, 219, 217, 216, 215, 213, 211, 209, 208, 207,
- 206, 205, 204, 203, 202, 201, 199, 195, 193, 192,
- 191, 190, 189, 188, 186, 185, 184, 183, 182, 181,
- 180, 179, 175, 174, 173, 171, 170, 169, 168, 167,
- 165, 164, 163, 162, 161, 160, 159, 157, 156, 155,
- 153, 152, 151, 148, 147, 144, 143, 142, 141, 140,
- 139, 138, 136, 134, 133, 130, 128, 126, 123, 122,
- 121, 120, 119, 118, 117, 114, 113, 111, 110, 108,
+ 63, 285, 178, 284, 283, 140, 178, 282, 250, 296,
+ 279, 296, 296, 297, 278, 276, 297, 275, 274, 273,
+ 271, 270, 269, 268, 267, 266, 265, 261, 260, 259,
+ 258, 257, 256, 255, 254, 252, 251, 248, 247, 246,
+ 244, 242, 239, 238, 237, 236, 235, 234, 233, 232,
+ 231, 230, 229, 228, 227, 226, 225, 224, 223, 222,
+ 221, 219, 216, 214, 212, 211, 210, 209, 208, 207,
+ 205, 204, 203, 202, 201, 200, 199, 198, 197, 195,
+ 194, 193, 192, 191, 187, 186, 185, 183, 182, 181,
+ 180, 179, 176, 175, 174, 173, 172, 171, 170, 169,
- 106, 105, 103, 102, 100, 99, 98, 97, 96, 95,
- 94, 93, 92, 89, 88, 87, 86, 85, 83, 82,
- 81, 80, 79, 77, 76, 75, 74, 73, 72, 71,
- 70, 69, 68, 66, 64, 63, 62, 60, 59, 58,
- 55, 51, 50, 49, 48, 47, 46, 45, 44, 43,
- 42, 41, 40, 38, 36, 34, 32, 31, 24, 21,
- 18, 17, 16, 13, 10, 9, 8, 3, 256, 256,
- 256, 256, 256, 256, 256, 256, 256, 256, 256, 256,
- 256, 256, 256, 256, 256, 256, 256, 256, 256, 256,
- 256, 256, 256, 256, 256, 256, 256, 256, 256, 256,
+ 167, 165, 164, 163, 161, 160, 159, 156, 155, 152,
+ 151, 150, 149, 148, 147, 146, 145, 143, 141, 139,
+ 135, 134, 132, 130, 127, 126, 125, 124, 123, 122,
+ 121, 119, 118, 116, 115, 113, 111, 110, 108, 107,
+ 105, 104, 103, 102, 101, 100, 99, 98, 97, 96,
+ 95, 92, 91, 90, 89, 88, 87, 86, 84, 83,
+ 82, 81, 80, 78, 77, 76, 75, 74, 73, 72,
+ 71, 70, 68, 66, 65, 64, 62, 61, 60, 57,
+ 56, 52, 51, 50, 49, 48, 46, 44, 43, 42,
+ 41, 40, 38, 36, 34, 32, 31, 24, 21, 17,
- 256, 256, 256, 256, 256, 256, 256
+ 16, 13, 10, 9, 8, 3, 295, 295, 295, 295,
+ 295, 295, 295, 295, 295, 295, 295, 295, 295, 295,
+ 295, 295, 295, 295, 295, 295, 295, 295, 295, 295,
+ 295, 295, 295, 295, 295, 295, 295, 295, 295, 295,
+ 295, 295, 295, 295
} ;
static yy_state_type yy_last_accepting_state;
@@ -855,12 +902,12 @@ char *yytext;
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include
-
-#define YY_DECL int yylex()
-
#include
+
using namespace MiniZinc;
+#define YY_USER_ACTION { yylloc->first_line = yylineno; }
+
#define INITIAL 0
#ifndef YY_NO_UNISTD_H
@@ -906,6 +953,14 @@ int yyget_lineno ( void );
void yyset_lineno ( int _line_number );
+YYSTYPE * yyget_lval ( void );
+
+void yyset_lval ( YYSTYPE * yylval_param );
+
+ YYLTYPE *yyget_lloc ( void );
+
+ void yyset_lloc ( YYLTYPE * yylloc_param );
+
/* Macros after this point can all be overridden by user definitions in
* section 1.
*/
@@ -1021,9 +1076,11 @@ static int input ( void );
#ifndef YY_DECL
#define YY_DECL_IS_OURS 1
-extern int yylex (void);
+extern int yylex \
+ (YYSTYPE * yylval_param, YYLTYPE * yylloc_param );
-#define YY_DECL int yylex (void)
+#define YY_DECL int yylex \
+ (YYSTYPE * yylval_param, YYLTYPE * yylloc_param )
#endif /* !YY_DECL */
/* Code executed at the beginning of each rule, after yytext and yyleng
@@ -1049,6 +1106,14 @@ YY_DECL
char *yy_cp, *yy_bp;
int yy_act;
+ YYSTYPE * yylval;
+
+ YYLTYPE * yylloc;
+
+ yylval = yylval_param;
+
+ yylloc = yylloc_param;
+
if ( !(yy_init) )
{
(yy_init) = 1;
@@ -1102,13 +1167,13 @@ yy_match:
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 257 )
+ if ( yy_current_state >= 296 )
yy_c = yy_meta[yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
++yy_cp;
}
- while ( yy_base[yy_current_state] != 269 );
+ while ( yy_base[yy_current_state] != 307 );
yy_find_action:
yy_act = yy_accept[yy_current_state];
@@ -1135,257 +1200,293 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
/* rule 1 can match eol */
YY_RULE_SETUP
-{ /* ignore white space */ }
+{ yylineno++; }
YY_BREAK
case 2:
YY_RULE_SETUP
-{ /* ignore comments */ }
+{ /* ignore white space */ }
YY_BREAK
case 3:
YY_RULE_SETUP
-{ mza_yylval.iValue = std::atoi(mza_yytext); return MZA_INT; }
+{ /* ignore comments */ }
YY_BREAK
case 4:
YY_RULE_SETUP
-{ mza_yylval.iValue = std::atoi(mza_yytext+1); return MZA_REG; }
+{ yylval->iValue = std::atoi(yytext); return MZA_INT; }
YY_BREAK
case 5:
YY_RULE_SETUP
-{ return MZA_COLON; }
+{ yylval->iValue = std::atoi(yytext+1); return MZA_REG; }
YY_BREAK
case 6:
YY_RULE_SETUP
-{ return MZA_DELAY; }
+{ return MZA_COLON; }
YY_BREAK
case 7:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::ADDI; return MZA_ADDI; }
+{ return MZA_DELAY; }
YY_BREAK
case 8:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::SUBI; return MZA_SUBI; }
+{ return MZA_GLOBAL; }
YY_BREAK
case 9:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::MULI; return MZA_MULI; }
+{ yylval->bValue = BytecodeStream::ADDI; return MZA_ADDI; }
YY_BREAK
case 10:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::DIVI; return MZA_DIVI; }
+{ yylval->bValue = BytecodeStream::SUBI; return MZA_SUBI; }
YY_BREAK
case 11:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::MODI; return MZA_MODI; }
+{ yylval->bValue = BytecodeStream::MULI; return MZA_MULI; }
YY_BREAK
case 12:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::INCI; return MZA_INCI; }
+{ yylval->bValue = BytecodeStream::DIVI; return MZA_DIVI; }
YY_BREAK
case 13:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::DECI; return MZA_DECI; }
+{ yylval->bValue = BytecodeStream::MODI; return MZA_MODI; }
YY_BREAK
case 14:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::IMMI; return MZA_IMMI; }
+{ yylval->bValue = BytecodeStream::INCI; return MZA_INCI; }
YY_BREAK
case 15:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::LOAD_GLOBAL; return MZA_LOAD_GLOBAL; }
+{ yylval->bValue = BytecodeStream::DECI; return MZA_DECI; }
YY_BREAK
case 16:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::STORE_GLOBAL; return MZA_STORE_GLOBAL; }
+{ yylval->bValue = BytecodeStream::IMMI; return MZA_IMMI; }
YY_BREAK
case 17:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::MOV; return MZA_MOV; }
+{ yylval->bValue = BytecodeStream::CLEAR; return MZA_CLEAR; }
YY_BREAK
case 18:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::JMP; return MZA_JMP; }
+{ yylval->bValue = BytecodeStream::LOAD_GLOBAL; return MZA_LOAD_GLOBAL; }
YY_BREAK
case 19:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::JMPIF; return MZA_JMPIF; }
+{ yylval->bValue = BytecodeStream::STORE_GLOBAL; return MZA_STORE_GLOBAL; }
YY_BREAK
case 20:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::JMPIFNOT; return MZA_JMPIFNOT; }
+{ yylval->bValue = BytecodeStream::MOV; return MZA_MOV; }
YY_BREAK
case 21:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::EQI; return MZA_EQI; }
+{ yylval->bValue = BytecodeStream::JMP; return MZA_JMP; }
YY_BREAK
case 22:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::LTI; return MZA_LTI; }
+{ yylval->bValue = BytecodeStream::JMPIF; return MZA_JMPIF; }
YY_BREAK
case 23:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::LEI; return MZA_LEI; }
+{ yylval->bValue = BytecodeStream::JMPIFNOT; return MZA_JMPIFNOT; }
YY_BREAK
case 24:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::AND; return MZA_AND; }
+{ yylval->bValue = BytecodeStream::EQI; return MZA_EQI; }
YY_BREAK
case 25:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::OR; return MZA_OR; }
+{ yylval->bValue = BytecodeStream::LTI; return MZA_LTI; }
YY_BREAK
case 26:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::NOT; return MZA_NOT; }
+{ yylval->bValue = BytecodeStream::LEI; return MZA_LEI; }
YY_BREAK
case 27:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::XOR; return MZA_XOR; }
+{ yylval->bValue = BytecodeStream::AND; return MZA_AND; }
YY_BREAK
case 28:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::ISPAR; return MZA_ISPAR; }
+{ yylval->bValue = BytecodeStream::OR; return MZA_OR; }
YY_BREAK
case 29:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::ISEMPTY; return MZA_ISEMPTY; }
+{ yylval->bValue = BytecodeStream::NOT; return MZA_NOT; }
YY_BREAK
case 30:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::LENGTH; return MZA_LENGTH; }
+{ yylval->bValue = BytecodeStream::XOR; return MZA_XOR; }
YY_BREAK
case 31:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::GET_VEC; return MZA_GET_VEC; }
+{ yylval->bValue = BytecodeStream::ISPAR; return MZA_ISPAR; }
YY_BREAK
case 32:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::LB; return MZA_LB; }
+{ yylval->bValue = BytecodeStream::ISEMPTY; return MZA_ISEMPTY; }
YY_BREAK
case 33:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::UB; return MZA_UB; }
+{ yylval->bValue = BytecodeStream::LENGTH; return MZA_LENGTH; }
YY_BREAK
case 34:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::DOM; return MZA_DOM; }
+{ yylval->bValue = BytecodeStream::GET_VEC; return MZA_GET_VEC; }
YY_BREAK
case 35:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::MAKE_SET; return MZA_MAKE_SET; }
+{ yylval->bValue = BytecodeStream::GET_ARRAY; return MZA_GET_ARRAY; }
YY_BREAK
case 36:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::INTERSECTION; return MZA_INTERSECTION; }
+{ yylval->bValue = BytecodeStream::LB; return MZA_LB; }
YY_BREAK
case 37:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::UNION; return MZA_UNION; }
+{ yylval->bValue = BytecodeStream::UB; return MZA_UB; }
YY_BREAK
case 38:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::INTERSECT_DOMAIN; return MZA_INTERSECT_DOMAIN; }
+{ yylval->bValue = BytecodeStream::DOM; return MZA_DOM; }
YY_BREAK
case 39:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::OPEN_AGGREGATION; return MZA_OPEN_AGGREGATION; }
+{ yylval->bValue = BytecodeStream::MAKE_SET; return MZA_MAKE_SET; }
YY_BREAK
case 40:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::CLOSE_AGGREGATION; return MZA_CLOSE_AGGREGATION; }
+{ yylval->bValue = BytecodeStream::DIFF; return MZA_DIFF; }
YY_BREAK
case 41:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::SIMPLIFY_LIN; return MZA_SIMPLIFY_LIN; }
+{ yylval->bValue = BytecodeStream::INTERSECTION; return MZA_INTERSECTION; }
YY_BREAK
case 42:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::PUSH; return MZA_PUSH; }
+{ yylval->bValue = BytecodeStream::UNION; return MZA_UNION; }
YY_BREAK
case 43:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::POP; return MZA_POP; }
+{ yylval->bValue = BytecodeStream::INTERSECT_DOMAIN; return MZA_INTERSECT_DOMAIN; }
YY_BREAK
case 44:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::POST; return MZA_POST; }
+{ yylval->bValue = BytecodeStream::OPEN_AGGREGATION; return MZA_OPEN_AGGREGATION; }
YY_BREAK
case 45:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::RET; return MZA_RET; }
+{ yylval->bValue = BytecodeStream::CLOSE_AGGREGATION; return MZA_CLOSE_AGGREGATION; }
YY_BREAK
case 46:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::CALL; return MZA_CALL; }
+{ yylval->bValue = BytecodeStream::SIMPLIFY_LIN; return MZA_SIMPLIFY_LIN; }
YY_BREAK
case 47:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::BUILTIN; return MZA_BUILTIN; }
+{ yylval->bValue = BytecodeStream::PUSH; return MZA_PUSH; }
YY_BREAK
case 48:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::TCALL; return MZA_TCALL; }
+{ yylval->bValue = BytecodeStream::POP; return MZA_POP; }
YY_BREAK
case 49:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::TRACE; return MZA_TRACE; }
+{ yylval->bValue = BytecodeStream::POST; return MZA_POST; }
YY_BREAK
case 50:
YY_RULE_SETUP
-{ mza_yylval.bValue = BytecodeStream::ABORT; return MZA_ABORT; }
+{ yylval->bValue = BytecodeStream::RET; return MZA_RET; }
YY_BREAK
case 51:
YY_RULE_SETUP
-{ mza_yylval.iValue = AggregationCtx::VCTX_VEC; return MZA_CTX; }
+{ yylval->bValue = BytecodeStream::CALL; return MZA_CALL; }
YY_BREAK
case 52:
YY_RULE_SETUP
-{ mza_yylval.iValue = AggregationCtx::VCTX_OTHER; return MZA_CTX; }
+{ yylval->bValue = BytecodeStream::BUILTIN; return MZA_BUILTIN; }
YY_BREAK
case 53:
YY_RULE_SETUP
-{ mza_yylval.iValue = BytecodeProc::RAW; return MZA_MODE; }
+{ yylval->bValue = BytecodeStream::TCALL; return MZA_TCALL; }
YY_BREAK
case 54:
YY_RULE_SETUP
-{ mza_yylval.iValue = BytecodeProc::ROOT; return MZA_MODE; }
+{ yylval->bValue = BytecodeStream::ITER_ARRAY; return MZA_ITER_ARRAY; }
YY_BREAK
case 55:
YY_RULE_SETUP
-{ mza_yylval.iValue = BytecodeProc::ROOT_NEG; return MZA_MODE; }
+{ yylval->bValue = BytecodeStream::ITER_VEC; return MZA_ITER_VEC; }
YY_BREAK
case 56:
YY_RULE_SETUP
-{ mza_yylval.iValue = BytecodeProc::FUN; return MZA_MODE; }
+{ yylval->bValue = BytecodeStream::ITER_RANGE; return MZA_ITER_RANGE; }
YY_BREAK
case 57:
YY_RULE_SETUP
-{ mza_yylval.iValue = BytecodeProc::FUN_NEG; return MZA_MODE; }
+{ yylval->bValue = BytecodeStream::ITER_NEXT; return MZA_ITER_NEXT; }
YY_BREAK
case 58:
YY_RULE_SETUP
-{ mza_yylval.iValue = BytecodeProc::IMP; return MZA_MODE; }
+{ yylval->bValue = BytecodeStream::ITER_BREAK; return MZA_ITER_BREAK; }
YY_BREAK
case 59:
YY_RULE_SETUP
-{ mza_yylval.iValue = BytecodeProc::IMP_NEG; return MZA_MODE; }
+{ yylval->bValue = BytecodeStream::TRACE; return MZA_TRACE; }
YY_BREAK
case 60:
YY_RULE_SETUP
-{ mza_yylval.sValue = strdup(yytext); return MZA_ID; }
+{ yylval->bValue = BytecodeStream::ABORT; return MZA_ABORT; }
YY_BREAK
case 61:
YY_RULE_SETUP
-{ mza_yylval.sValue = strdup(yytext); return MZA_ID; }
+{ yylval->iValue = AggregationCtx::VCTX_VEC; return MZA_CTX; }
YY_BREAK
case 62:
YY_RULE_SETUP
-{
- /* Catch all */
- throw std::runtime_error("Illegal token in regular expression: '" + std::string(mza_yytext) + "'");
-}
+{ yylval->iValue = AggregationCtx::VCTX_OTHER; return MZA_CTX; }
YY_BREAK
case 63:
YY_RULE_SETUP
+{ yylval->iValue = BytecodeProc::ROOT; return MZA_MODE; }
+ YY_BREAK
+case 64:
+YY_RULE_SETUP
+{ yylval->iValue = BytecodeProc::ROOT_NEG; return MZA_MODE; }
+ YY_BREAK
+case 65:
+YY_RULE_SETUP
+{ yylval->iValue = BytecodeProc::FUN; return MZA_MODE; }
+ YY_BREAK
+case 66:
+YY_RULE_SETUP
+{ yylval->iValue = BytecodeProc::FUN_NEG; return MZA_MODE; }
+ YY_BREAK
+case 67:
+YY_RULE_SETUP
+{ yylval->iValue = BytecodeProc::IMP; return MZA_MODE; }
+ YY_BREAK
+case 68:
+YY_RULE_SETUP
+{ yylval->iValue = BytecodeProc::IMP_NEG; return MZA_MODE; }
+ YY_BREAK
+case 69:
+YY_RULE_SETUP
+{ yylval->sValue = strdup(yytext); return MZA_ID; }
+ YY_BREAK
+case 70:
+YY_RULE_SETUP
+{ yylval->sValue = strdup(yytext); return MZA_ID; }
+ YY_BREAK
+case 71:
+YY_RULE_SETUP
+{
+ /* Catch all */
+ throw std::runtime_error("Illegal token in regular expression: '" + std::string(yytext) + "'");
+}
+ YY_BREAK
+case 72:
+YY_RULE_SETUP
ECHO;
YY_BREAK
case YY_STATE_EOF(INITIAL):
@@ -1684,7 +1785,7 @@ static int yy_get_next_buffer (void)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 257 )
+ if ( yy_current_state >= 296 )
yy_c = yy_meta[yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
@@ -1712,11 +1813,11 @@ static int yy_get_next_buffer (void)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 257 )
+ if ( yy_current_state >= 296 )
yy_c = yy_meta[yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
- yy_is_jam = (yy_current_state == 256);
+ yy_is_jam = (yy_current_state == 295);
return yy_is_jam ? 0 : yy_current_state;
}
diff --git a/software/mza/lib/cached/mza_parser.tab.cpp b/software/mza/lib/cached/mza_parser.tab.cpp
index 51392a0..35422ce 100644
--- a/software/mza/lib/cached/mza_parser.tab.cpp
+++ b/software/mza/lib/cached/mza_parser.tab.cpp
@@ -1,8 +1,9 @@
-/* A Bison parser, made by GNU Bison 3.0.4. */
+/* A Bison parser, made by GNU Bison 3.7.6. */
/* Bison implementation for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
+ Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -15,7 +16,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program. If not, see . */
+ along with this program. If not, see . */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@@ -33,6 +34,10 @@
/* C LALR(1) parser skeleton written by Richard Stallman, by
simplifying the original so-called "semantic" parser. */
+/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
+ especially those whose name start with YY_ or yy_. They are
+ private implementation details that can be changed or removed. */
+
/* All symbols defined below should begin with yy or YY, to avoid
infringing on user name space. This should be done even for local
variables, as they might otherwise be expanded by user macros.
@@ -40,17 +45,17 @@
define necessary library symbols; they are noted "INFRINGES ON
USER NAME SPACE" below. */
-/* Identify Bison output. */
-#define YYBISON 1
+/* Identify Bison output, and Bison version. */
+#define YYBISON 30706
-/* Bison version. */
-#define YYBISON_VERSION "3.0.4"
+/* Bison version string. */
+#define YYBISON_VERSION "3.7.6"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
/* Pure parsers. */
-#define YYPURE 0
+#define YYPURE 1
/* Push parsers. */
#define YYPUSH 0
@@ -66,22 +71,23 @@
#define yydebug mza_yydebug
#define yynerrs mza_yynerrs
-#define yylval mza_yylval
-#define yychar mza_yychar
-
-/* Copy the first part of user declarations. */
-
+/* First part of user prologue. */
#include
#include
-#include
+#include
+
+//Anonymous struct for when yyparse is exported
+typedef struct MZAContext MZAContext;
+#include
+
using namespace MiniZinc;
typedef struct yy_buffer_state *YY_BUFFER_STATE;
YY_BUFFER_STATE mza_yy_scan_string ( const char* yy_str );
-extern int yylex();
+extern int yylex(YYSTYPE*, YYLTYPE*);
extern FILE* yyin;
struct ProcPatch {
@@ -95,6 +101,7 @@ struct ProcPatch {
typedef struct MZAContext {
std::vector& procs;
std::unordered_map& proc_map;
+ int& max_glob;
std::vector to_patch;
BytecodeStream proc_body;
std::unordered_map labels;
@@ -102,125 +109,122 @@ typedef struct MZAContext {
std::vector>> patch_procs;
} MZAContext;
-void yyerror(MZAContext& ctx, const char* s);
+void yyerror(YYLTYPE* location, MZAContext& ctx, const char* s);
-
-# ifndef YY_NULLPTR
-# if defined __cplusplus && 201103L <= __cplusplus
-# define YY_NULLPTR nullptr
+# ifndef YY_CAST
+# ifdef __cplusplus
+# define YY_CAST(Type, Val) static_cast (Val)
+# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val)
# else
-# define YY_NULLPTR 0
+# define YY_CAST(Type, Val) ((Type) (Val))
+# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
+# endif
+# endif
+# ifndef YY_NULLPTR
+# if defined __cplusplus
+# if 201103L <= __cplusplus
+# define YY_NULLPTR nullptr
+# else
+# define YY_NULLPTR 0
+# endif
+# else
+# define YY_NULLPTR ((void*)0)
# endif
# endif
-/* Enabling verbose error messages. */
-#ifdef YYERROR_VERBOSE
-# undef YYERROR_VERBOSE
-# define YYERROR_VERBOSE 1
-#else
-# define YYERROR_VERBOSE 1
-#endif
-
-/* In a future release of Bison, this section will be replaced
- by #include "mza_parser.tab.hh". */
-#ifndef YY_MZA_YY_HOME_JDEKKER_BUILD_PKG_MINIZINC_INCLUDE_MINIZINC_SUPPORT_MZA_PARSER_TAB_HH_INCLUDED
-# define YY_MZA_YY_HOME_JDEKKER_BUILD_PKG_MINIZINC_INCLUDE_MINIZINC_SUPPORT_MZA_PARSER_TAB_HH_INCLUDED
-/* Debug traces. */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
-#if YYDEBUG
-extern int mza_yydebug;
-#endif
-
-/* Token type. */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
- enum yytokentype
- {
- MZA_INT = 258,
- MZA_REG = 259,
- MZA_MODE = 260,
- MZA_CTX = 261,
- MZA_ID = 262,
- MZA_COLON = 263,
- MZA_DELAY = 264,
- MZA_ADDI = 265,
- MZA_SUBI = 266,
- MZA_MULI = 267,
- MZA_DIVI = 268,
- MZA_MODI = 269,
- MZA_INCI = 270,
- MZA_DECI = 271,
- MZA_IMMI = 272,
- MZA_LOAD_GLOBAL = 273,
- MZA_STORE_GLOBAL = 274,
- MZA_MOV = 275,
- MZA_JMP = 276,
- MZA_JMPIF = 277,
- MZA_JMPIFNOT = 278,
- MZA_EQI = 279,
- MZA_LTI = 280,
- MZA_LEI = 281,
- MZA_AND = 282,
- MZA_OR = 283,
- MZA_NOT = 284,
- MZA_XOR = 285,
- MZA_ISPAR = 286,
- MZA_ISEMPTY = 287,
- MZA_LENGTH = 288,
- MZA_GET_VEC = 289,
- MZA_LB = 290,
- MZA_UB = 291,
- MZA_DOM = 292,
- MZA_MAKE_SET = 293,
- MZA_INTERSECTION = 294,
- MZA_UNION = 295,
- MZA_INTERSECT_DOMAIN = 296,
- MZA_OPEN_AGGREGATION = 297,
- MZA_CLOSE_AGGREGATION = 298,
- MZA_SIMPLIFY_LIN = 299,
- MZA_PUSH = 300,
- MZA_POP = 301,
- MZA_POST = 302,
- MZA_RET = 303,
- MZA_CALL = 304,
- MZA_BUILTIN = 305,
- MZA_TCALL = 306,
- MZA_TRACE = 307,
- MZA_ABORT = 308
- };
-#endif
-
-/* Value type. */
-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-
-union YYSTYPE
+#include
+/* Symbol kind. */
+enum yysymbol_kind_t
{
-
-
- int iValue;
- char* sValue;
- MiniZinc::BytecodeStream::Instr bValue;
- std::list* liValue;
-
-
+ YYSYMBOL_YYEMPTY = -2,
+ YYSYMBOL_YYEOF = 0, /* "end of file" */
+ YYSYMBOL_YYerror = 1, /* error */
+ YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
+ YYSYMBOL_MZA_INT = 3, /* MZA_INT */
+ YYSYMBOL_MZA_REG = 4, /* MZA_REG */
+ YYSYMBOL_MZA_MODE = 5, /* MZA_MODE */
+ YYSYMBOL_MZA_CTX = 6, /* MZA_CTX */
+ YYSYMBOL_MZA_ID = 7, /* MZA_ID */
+ YYSYMBOL_MZA_COLON = 8, /* ":" */
+ YYSYMBOL_MZA_DELAY = 9, /* "D" */
+ YYSYMBOL_MZA_GLOBAL = 10, /* "GLOBAL" */
+ YYSYMBOL_MZA_ADDI = 11, /* MZA_ADDI */
+ YYSYMBOL_MZA_SUBI = 12, /* MZA_SUBI */
+ YYSYMBOL_MZA_MULI = 13, /* MZA_MULI */
+ YYSYMBOL_MZA_DIVI = 14, /* MZA_DIVI */
+ YYSYMBOL_MZA_MODI = 15, /* MZA_MODI */
+ YYSYMBOL_MZA_INCI = 16, /* MZA_INCI */
+ YYSYMBOL_MZA_DECI = 17, /* MZA_DECI */
+ YYSYMBOL_MZA_IMMI = 18, /* MZA_IMMI */
+ YYSYMBOL_MZA_CLEAR = 19, /* MZA_CLEAR */
+ YYSYMBOL_MZA_LOAD_GLOBAL = 20, /* MZA_LOAD_GLOBAL */
+ YYSYMBOL_MZA_STORE_GLOBAL = 21, /* MZA_STORE_GLOBAL */
+ YYSYMBOL_MZA_MOV = 22, /* MZA_MOV */
+ YYSYMBOL_MZA_JMP = 23, /* MZA_JMP */
+ YYSYMBOL_MZA_JMPIF = 24, /* MZA_JMPIF */
+ YYSYMBOL_MZA_JMPIFNOT = 25, /* MZA_JMPIFNOT */
+ YYSYMBOL_MZA_EQI = 26, /* MZA_EQI */
+ YYSYMBOL_MZA_LTI = 27, /* MZA_LTI */
+ YYSYMBOL_MZA_LEI = 28, /* MZA_LEI */
+ YYSYMBOL_MZA_AND = 29, /* MZA_AND */
+ YYSYMBOL_MZA_OR = 30, /* MZA_OR */
+ YYSYMBOL_MZA_NOT = 31, /* MZA_NOT */
+ YYSYMBOL_MZA_XOR = 32, /* MZA_XOR */
+ YYSYMBOL_MZA_ISPAR = 33, /* MZA_ISPAR */
+ YYSYMBOL_MZA_ISEMPTY = 34, /* MZA_ISEMPTY */
+ YYSYMBOL_MZA_LENGTH = 35, /* MZA_LENGTH */
+ YYSYMBOL_MZA_GET_VEC = 36, /* MZA_GET_VEC */
+ YYSYMBOL_MZA_GET_ARRAY = 37, /* MZA_GET_ARRAY */
+ YYSYMBOL_MZA_LB = 38, /* MZA_LB */
+ YYSYMBOL_MZA_UB = 39, /* MZA_UB */
+ YYSYMBOL_MZA_DOM = 40, /* MZA_DOM */
+ YYSYMBOL_MZA_MAKE_SET = 41, /* MZA_MAKE_SET */
+ YYSYMBOL_MZA_DIFF = 42, /* MZA_DIFF */
+ YYSYMBOL_MZA_INTERSECTION = 43, /* MZA_INTERSECTION */
+ YYSYMBOL_MZA_UNION = 44, /* MZA_UNION */
+ YYSYMBOL_MZA_INTERSECT_DOMAIN = 45, /* MZA_INTERSECT_DOMAIN */
+ YYSYMBOL_MZA_OPEN_AGGREGATION = 46, /* MZA_OPEN_AGGREGATION */
+ YYSYMBOL_MZA_CLOSE_AGGREGATION = 47, /* MZA_CLOSE_AGGREGATION */
+ YYSYMBOL_MZA_SIMPLIFY_LIN = 48, /* MZA_SIMPLIFY_LIN */
+ YYSYMBOL_MZA_PUSH = 49, /* MZA_PUSH */
+ YYSYMBOL_MZA_POP = 50, /* MZA_POP */
+ YYSYMBOL_MZA_POST = 51, /* MZA_POST */
+ YYSYMBOL_MZA_RET = 52, /* MZA_RET */
+ YYSYMBOL_MZA_CALL = 53, /* MZA_CALL */
+ YYSYMBOL_MZA_BUILTIN = 54, /* MZA_BUILTIN */
+ YYSYMBOL_MZA_TCALL = 55, /* MZA_TCALL */
+ YYSYMBOL_MZA_ITER_ARRAY = 56, /* MZA_ITER_ARRAY */
+ YYSYMBOL_MZA_ITER_VEC = 57, /* MZA_ITER_VEC */
+ YYSYMBOL_MZA_ITER_RANGE = 58, /* MZA_ITER_RANGE */
+ YYSYMBOL_MZA_ITER_NEXT = 59, /* MZA_ITER_NEXT */
+ YYSYMBOL_MZA_ITER_BREAK = 60, /* MZA_ITER_BREAK */
+ YYSYMBOL_MZA_TRACE = 61, /* MZA_TRACE */
+ YYSYMBOL_MZA_ABORT = 62, /* MZA_ABORT */
+ YYSYMBOL_YYACCEPT = 63, /* $accept */
+ YYSYMBOL_procedures = 64, /* procedures */
+ YYSYMBOL_procedure = 65, /* procedure */
+ YYSYMBOL_mode = 66, /* mode */
+ YYSYMBOL_delay = 67, /* delay */
+ YYSYMBOL_instructions = 68, /* instructions */
+ YYSYMBOL_labeled_instr = 69, /* labeled_instr */
+ YYSYMBOL_labels = 70, /* labels */
+ YYSYMBOL_label = 71, /* label */
+ YYSYMBOL_instruction = 72, /* instruction */
+ YYSYMBOL_instrIR = 73, /* instrIR */
+ YYSYMBOL_instrI = 74, /* instrI */
+ YYSYMBOL_instrR = 75, /* instrR */
+ YYSYMBOL_instrRR = 76, /* instrRR */
+ YYSYMBOL_instrRS = 77, /* instrRS */
+ YYSYMBOL_instrRRR = 78, /* instrRRR */
+ YYSYMBOL_instrRRS = 79, /* instrRRS */
+ YYSYMBOL_instrRRIRRR = 80, /* instrRRIRRR */
+ YYSYMBOL_instrS = 81, /* instrS */
+ YYSYMBOL_instr = 82, /* instr */
+ YYSYMBOL_registers = 83 /* registers */
};
+typedef enum yysymbol_kind_t yysymbol_kind_t;
-typedef union YYSTYPE YYSTYPE;
-# define YYSTYPE_IS_TRIVIAL 1
-# define YYSTYPE_IS_DECLARED 1
-#endif
-
-
-extern YYSTYPE mza_yylval;
-
-int mza_yyparse (MZAContext& ctx);
-
-#endif /* !YY_MZA_YY_HOME_JDEKKER_BUILD_PKG_MINIZINC_INCLUDE_MINIZINC_SUPPORT_MZA_PARSER_TAB_HH_INCLUDED */
-
-/* Copy the second part of user declarations. */
@@ -228,28 +232,87 @@ int mza_yyparse (MZAContext& ctx);
# undef short
#endif
-#ifdef YYTYPE_UINT8
-typedef YYTYPE_UINT8 yytype_uint8;
-#else
-typedef unsigned char yytype_uint8;
+/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
+ and (if available) are included
+ so that the code can choose integer types of a good width. */
+
+#ifndef __PTRDIFF_MAX__
+# include /* INFRINGES ON USER NAME SPACE */
+# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
+# include /* INFRINGES ON USER NAME SPACE */
+# define YY_STDINT_H
+# endif
#endif
-#ifdef YYTYPE_INT8
-typedef YYTYPE_INT8 yytype_int8;
+/* Narrow types that promote to a signed type and that can represent a
+ signed or unsigned integer of at least N bits. In tables they can
+ save space and decrease cache pressure. Promoting to a signed type
+ helps avoid bugs in integer arithmetic. */
+
+#ifdef __INT_LEAST8_MAX__
+typedef __INT_LEAST8_TYPE__ yytype_int8;
+#elif defined YY_STDINT_H
+typedef int_least8_t yytype_int8;
#else
typedef signed char yytype_int8;
#endif
-#ifdef YYTYPE_UINT16
-typedef YYTYPE_UINT16 yytype_uint16;
+#ifdef __INT_LEAST16_MAX__
+typedef __INT_LEAST16_TYPE__ yytype_int16;
+#elif defined YY_STDINT_H
+typedef int_least16_t yytype_int16;
#else
-typedef unsigned short int yytype_uint16;
+typedef short yytype_int16;
#endif
-#ifdef YYTYPE_INT16
-typedef YYTYPE_INT16 yytype_int16;
+/* Work around bug in HP-UX 11.23, which defines these macros
+ incorrectly for preprocessor constants. This workaround can likely
+ be removed in 2023, as HPE has promised support for HP-UX 11.23
+ (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
+ . */
+#ifdef __hpux
+# undef UINT_LEAST8_MAX
+# undef UINT_LEAST16_MAX
+# define UINT_LEAST8_MAX 255
+# define UINT_LEAST16_MAX 65535
+#endif
+
+#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
+typedef __UINT_LEAST8_TYPE__ yytype_uint8;
+#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
+ && UINT_LEAST8_MAX <= INT_MAX)
+typedef uint_least8_t yytype_uint8;
+#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
+typedef unsigned char yytype_uint8;
#else
-typedef short int yytype_int16;
+typedef short yytype_uint8;
+#endif
+
+#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
+typedef __UINT_LEAST16_TYPE__ yytype_uint16;
+#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
+ && UINT_LEAST16_MAX <= INT_MAX)
+typedef uint_least16_t yytype_uint16;
+#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
+typedef unsigned short yytype_uint16;
+#else
+typedef int yytype_uint16;
+#endif
+
+#ifndef YYPTRDIFF_T
+# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
+# define YYPTRDIFF_T __PTRDIFF_TYPE__
+# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
+# elif defined PTRDIFF_MAX
+# ifndef ptrdiff_t
+# include /* INFRINGES ON USER NAME SPACE */
+# endif
+# define YYPTRDIFF_T ptrdiff_t
+# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
+# else
+# define YYPTRDIFF_T long
+# define YYPTRDIFF_MAXIMUM LONG_MAX
+# endif
#endif
#ifndef YYSIZE_T
@@ -257,15 +320,28 @@ typedef short int yytype_int16;
# define YYSIZE_T __SIZE_TYPE__
# elif defined size_t
# define YYSIZE_T size_t
-# elif ! defined YYSIZE_T
+# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
# include /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t
# else
-# define YYSIZE_T unsigned int
+# define YYSIZE_T unsigned
# endif
#endif
-#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
+#define YYSIZE_MAXIMUM \
+ YY_CAST (YYPTRDIFF_T, \
+ (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
+ ? YYPTRDIFF_MAXIMUM \
+ : YY_CAST (YYSIZE_T, -1)))
+
+#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
+
+
+/* Stored state numbers (used for stacks). */
+typedef yytype_int8 yy_state_t;
+
+/* State numbers in computations. */
+typedef int yy_state_fast_t;
#ifndef YY_
# if defined YYENABLE_NLS && YYENABLE_NLS
@@ -279,47 +355,37 @@ typedef short int yytype_int16;
# endif
#endif
-#ifndef YY_ATTRIBUTE
-# if (defined __GNUC__ \
- && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
- || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
-# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
+
+#ifndef YY_ATTRIBUTE_PURE
+# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
+# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
# else
-# define YY_ATTRIBUTE(Spec) /* empty */
+# define YY_ATTRIBUTE_PURE
# endif
#endif
-#ifndef YY_ATTRIBUTE_PURE
-# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
-#endif
-
#ifndef YY_ATTRIBUTE_UNUSED
-# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
-#endif
-
-#if !defined _Noreturn \
- && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
-# if defined _MSC_VER && 1200 <= _MSC_VER
-# define _Noreturn __declspec (noreturn)
+# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
+# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
# else
-# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
+# define YY_ATTRIBUTE_UNUSED
# endif
#endif
/* Suppress unused-variable warnings by "using" E. */
#if ! defined lint || defined __GNUC__
-# define YYUSE(E) ((void) (E))
+# define YY_USE(E) ((void) (E))
#else
-# define YYUSE(E) /* empty */
+# define YY_USE(E) /* empty */
#endif
-#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
+#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
/* Suppress an incorrect diagnostic about yylval being uninitialized. */
-# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
- _Pragma ("GCC diagnostic push") \
- _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
_Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
-# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
_Pragma ("GCC diagnostic pop")
#else
# define YY_INITIAL_VALUE(Value) Value
@@ -332,8 +398,22 @@ typedef short int yytype_int16;
# define YY_INITIAL_VALUE(Value) /* Nothing. */
#endif
+#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
+# define YY_IGNORE_USELESS_CAST_BEGIN \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
+# define YY_IGNORE_USELESS_CAST_END \
+ _Pragma ("GCC diagnostic pop")
+#endif
+#ifndef YY_IGNORE_USELESS_CAST_BEGIN
+# define YY_IGNORE_USELESS_CAST_BEGIN
+# define YY_IGNORE_USELESS_CAST_END
+#endif
-#if ! defined yyoverflow || YYERROR_VERBOSE
+
+#define YY_ASSERT(E) ((void) (0 && (E)))
+
+#if 1
/* The parser invokes alloca or malloc; define the necessary symbols. */
@@ -398,28 +478,30 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
# endif
-#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
-
+#endif /* 1 */
#if (! defined yyoverflow \
&& (! defined __cplusplus \
- || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
+ || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
+ && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
/* A type that is properly aligned for any stack member. */
union yyalloc
{
- yytype_int16 yyss_alloc;
+ yy_state_t yyss_alloc;
YYSTYPE yyvs_alloc;
+ YYLTYPE yyls_alloc;
};
/* The size of the maximum gap between one aligned stack and the next. */
-# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
+# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
/* The size of an array large to enough to hold all stacks, each with
N elements. */
# define YYSTACK_BYTES(N) \
- ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
- + YYSTACK_GAP_MAXIMUM)
+ ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \
+ + YYSIZEOF (YYLTYPE)) \
+ + 2 * YYSTACK_GAP_MAXIMUM)
# define YYCOPY_NEEDED 1
@@ -431,11 +513,11 @@ union yyalloc
# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
do \
{ \
- YYSIZE_T yynewbytes; \
+ YYPTRDIFF_T yynewbytes; \
YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
Stack = &yyptr->Stack_alloc; \
- yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
- yyptr += yynewbytes / sizeof (*yyptr); \
+ yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
+ yyptr += yynewbytes / YYSIZEOF (*yyptr); \
} \
while (0)
@@ -447,12 +529,12 @@ union yyalloc
# ifndef YYCOPY
# if defined __GNUC__ && 1 < __GNUC__
# define YYCOPY(Dst, Src, Count) \
- __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
+ __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
# else
# define YYCOPY(Dst, Src, Count) \
do \
{ \
- YYSIZE_T yyi; \
+ YYPTRDIFF_T yyi; \
for (yyi = 0; yyi < (Count); yyi++) \
(Dst)[yyi] = (Src)[yyi]; \
} \
@@ -464,28 +546,31 @@ union yyalloc
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 2
/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 124
+#define YYLAST 105
/* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS 54
+#define YYNTOKENS 63
/* YYNNTS -- Number of nonterminals. */
-#define YYNNTS 18
+#define YYNNTS 21
/* YYNRULES -- Number of rules. */
-#define YYNRULES 68
+#define YYNRULES 80
/* YYNSTATES -- Number of states. */
-#define YYNSTATES 98
+#define YYNSTATES 121
-/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
- by yylex, with out-of-bounds checking. */
-#define YYUNDEFTOK 2
-#define YYMAXUTOK 308
+/* YYMAXUTOK -- Last valid token kind. */
+#define YYMAXUTOK 317
-#define YYTRANSLATE(YYX) \
- ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+
+/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
+ as returned by yylex, with out-of-bounds checking. */
+#define YYTRANSLATE(YYX) \
+ (0 <= (YYX) && (YYX) <= YYMAXUTOK \
+ ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
+ : YYSYMBOL_YYUNDEF)
/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
- as returned by yylex, without out-of-bounds checking. */
-static const yytype_uint8 yytranslate[] =
+ as returned by yylex. */
+static const yytype_int8 yytranslate[] =
{
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -517,198 +602,229 @@ static const yytype_uint8 yytranslate[] =
15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
- 45, 46, 47, 48, 49, 50, 51, 52, 53
+ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
+ 55, 56, 57, 58, 59, 60, 61, 62
};
#if YYDEBUG
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
-static const yytype_uint16 yyrline[] =
+static const yytype_int16 yyrline[] =
{
- 0, 130, 130, 132, 135, 179, 180, 183, 184, 186,
- 188, 191, 192, 198, 201, 206, 213, 219, 226, 234,
- 242, 251, 258, 270, 278, 285, 291, 298, 305, 314,
- 317, 318, 319, 320, 321, 322, 325, 326, 327, 328,
- 329, 330, 331, 332, 333, 336, 337, 340, 341, 342,
- 343, 344, 345, 346, 347, 348, 349, 350, 351, 352,
- 353, 354, 357, 360, 363, 364, 365, 369, 370
+ 0, 154, 154, 156, 159, 205, 206, 209, 210, 212,
+ 214, 217, 226, 227, 230, 233, 238, 244, 251, 257,
+ 264, 272, 281, 289, 300, 307, 320, 331, 340, 347,
+ 353, 360, 368, 376, 388, 391, 394, 395, 396, 397,
+ 398, 399, 400, 403, 404, 405, 406, 407, 408, 409,
+ 410, 411, 412, 415, 416, 417, 418, 421, 422, 423,
+ 424, 425, 426, 427, 428, 429, 430, 431, 432, 433,
+ 434, 435, 436, 439, 442, 445, 448, 449, 450, 454,
+ 455
};
#endif
-#if YYDEBUG || YYERROR_VERBOSE || 1
+/** Accessing symbol of state STATE. */
+#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
+
+#if 1
+/* The user-facing name of the symbol whose (internal) number is
+ YYSYMBOL. No bounds checking. */
+static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
+
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
{
- "$end", "error", "$undefined", "MZA_INT", "MZA_REG", "MZA_MODE",
- "MZA_CTX", "MZA_ID", "\":\"", "\"D\"", "MZA_ADDI", "MZA_SUBI",
- "MZA_MULI", "MZA_DIVI", "MZA_MODI", "MZA_INCI", "MZA_DECI", "MZA_IMMI",
- "MZA_LOAD_GLOBAL", "MZA_STORE_GLOBAL", "MZA_MOV", "MZA_JMP", "MZA_JMPIF",
- "MZA_JMPIFNOT", "MZA_EQI", "MZA_LTI", "MZA_LEI", "MZA_AND", "MZA_OR",
- "MZA_NOT", "MZA_XOR", "MZA_ISPAR", "MZA_ISEMPTY", "MZA_LENGTH",
- "MZA_GET_VEC", "MZA_LB", "MZA_UB", "MZA_DOM", "MZA_MAKE_SET",
- "MZA_INTERSECTION", "MZA_UNION", "MZA_INTERSECT_DOMAIN",
+ "\"end of file\"", "error", "\"invalid token\"", "MZA_INT", "MZA_REG",
+ "MZA_MODE", "MZA_CTX", "MZA_ID", "\":\"", "\"D\"", "\"GLOBAL\"",
+ "MZA_ADDI", "MZA_SUBI", "MZA_MULI", "MZA_DIVI", "MZA_MODI", "MZA_INCI",
+ "MZA_DECI", "MZA_IMMI", "MZA_CLEAR", "MZA_LOAD_GLOBAL",
+ "MZA_STORE_GLOBAL", "MZA_MOV", "MZA_JMP", "MZA_JMPIF", "MZA_JMPIFNOT",
+ "MZA_EQI", "MZA_LTI", "MZA_LEI", "MZA_AND", "MZA_OR", "MZA_NOT",
+ "MZA_XOR", "MZA_ISPAR", "MZA_ISEMPTY", "MZA_LENGTH", "MZA_GET_VEC",
+ "MZA_GET_ARRAY", "MZA_LB", "MZA_UB", "MZA_DOM", "MZA_MAKE_SET",
+ "MZA_DIFF", "MZA_INTERSECTION", "MZA_UNION", "MZA_INTERSECT_DOMAIN",
"MZA_OPEN_AGGREGATION", "MZA_CLOSE_AGGREGATION", "MZA_SIMPLIFY_LIN",
"MZA_PUSH", "MZA_POP", "MZA_POST", "MZA_RET", "MZA_CALL", "MZA_BUILTIN",
- "MZA_TCALL", "MZA_TRACE", "MZA_ABORT", "$accept", "procedures",
- "procedure", "mode", "delay", "instructions", "labeled_instr", "label",
- "instruction", "instrIR", "instrR", "instrRR", "instrRS", "instrRRR",
- "instrRRRR", "instrS", "instr", "registers", YY_NULLPTR
+ "MZA_TCALL", "MZA_ITER_ARRAY", "MZA_ITER_VEC", "MZA_ITER_RANGE",
+ "MZA_ITER_NEXT", "MZA_ITER_BREAK", "MZA_TRACE", "MZA_ABORT", "$accept",
+ "procedures", "procedure", "mode", "delay", "instructions",
+ "labeled_instr", "labels", "label", "instruction", "instrIR", "instrI",
+ "instrR", "instrRR", "instrRS", "instrRRR", "instrRRS", "instrRRIRRR",
+ "instrS", "instr", "registers", YY_NULLPTR
};
+
+static const char *
+yysymbol_name (yysymbol_kind_t yysymbol)
+{
+ return yytname[yysymbol];
+}
#endif
-# ifdef YYPRINT
+#ifdef YYPRINT
/* YYTOKNUM[NUM] -- (External) token number corresponding to the
(internal) symbol number NUM (which must be that of a token). */
-static const yytype_uint16 yytoknum[] =
+static const yytype_int16 yytoknum[] =
{
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
- 305, 306, 307, 308
+ 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
+ 315, 316, 317
};
-# endif
+#endif
-#define YYPACT_NINF -8
+#define YYPACT_NINF (-32)
-#define yypact_value_is_default(Yystate) \
- (!!((Yystate) == (-8)))
+#define yypact_value_is_default(Yyn) \
+ ((Yyn) == YYPACT_NINF)
-#define YYTABLE_NINF -1
+#define YYTABLE_NINF (-5)
-#define yytable_value_is_error(Yytable_value) \
+#define yytable_value_is_error(Yyn) \
0
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */
static const yytype_int8 yypact[] =
{
- -8, 91, -8, -6, -8, 35, -3, -8, 89, 84,
- -8, -8, -7, 86, -8, -8, -8, -8, -8, -8,
- -8, -8, 92, 93, -8, -8, -8, -8, -8, -8,
- -8, -8, -8, -8, -8, -8, -8, -8, -8, -8,
- -8, -8, -8, -8, -8, -8, 81, -8, -8, -8,
- -8, -8, -8, 95, 96, -8, -8, -8, 37, -8,
- 99, 94, 100, 101, 102, 103, 104, -8, -8, 106,
- 109, -8, -8, -8, 107, 108, -8, 112, -8, 113,
- 111, 115, 116, -8, -8, -8, -8, -8, -8, -8,
- -8, 117, 118, 119, -8, 120, -8, -8
+ -32, 58, -32, -6, -32, -5, -3, -32, 57, 52,
+ -32, -32, 59, -32, -7, 54, -32, -32, -32, -32,
+ -32, -32, -32, -32, -32, 60, 61, -32, -32, -32,
+ -32, -32, -32, -32, -32, -32, -32, -32, -32, -32,
+ -32, -32, 65, -32, -32, -32, -32, -32, -32, -32,
+ -32, 50, -32, -32, -32, -32, -32, -32, 64, 63,
+ 66, -32, -32, -32, -32, -32, -32, -32, -32, -32,
+ 69, 70, 71, 72, 73, 74, 78, 79, 67, -32,
+ -32, 80, 82, -32, -32, -32, -32, 81, -32, 83,
+ 85, -32, -32, 87, 86, 88, 90, 91, -32, -32,
+ -32, 92, 84, 92, 94, -32, -32, -32, 95, 93,
+ 98, -32, -32, -32, -32, -32, 99, 92, 100, 101,
+ -32
};
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
Performed when YYTABLE does not specify something else to do. Zero
means the default is an error. */
-static const yytype_uint8 yydefact[] =
+static const yytype_int8 yydefact[] =
{
2, 0, 1, 0, 3, 0, 5, 6, 0, 7,
- 8, 9, 4, 0, 47, 48, 49, 50, 51, 30,
- 31, 29, 0, 0, 36, 63, 45, 46, 52, 53,
- 54, 55, 56, 37, 57, 38, 39, 40, 58, 43,
- 42, 44, 41, 59, 60, 61, 0, 65, 62, 32,
- 33, 34, 64, 0, 0, 35, 66, 10, 0, 11,
- 0, 0, 0, 0, 0, 0, 0, 14, 13, 0,
- 0, 24, 25, 26, 0, 0, 12, 0, 16, 0,
- 0, 0, 0, 21, 27, 28, 67, 23, 15, 17,
- 18, 0, 0, 22, 19, 0, 68, 20
+ 8, 9, 12, 10, 0, 0, 57, 58, 59, 60,
+ 61, 36, 37, 34, 52, 0, 0, 43, 75, 53,
+ 54, 62, 63, 64, 65, 66, 44, 67, 45, 46,
+ 47, 68, 0, 50, 49, 51, 48, 69, 70, 71,
+ 72, 0, 77, 74, 38, 39, 40, 76, 0, 0,
+ 0, 55, 56, 73, 41, 35, 42, 78, 13, 11,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 15,
+ 14, 0, 0, 79, 28, 29, 30, 0, 79, 0,
+ 0, 16, 18, 0, 0, 0, 0, 0, 24, 31,
+ 32, 33, 0, 26, 0, 17, 19, 20, 0, 0,
+ 0, 80, 79, 27, 22, 21, 0, 25, 0, 0,
+ 23
};
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int8 yypgoto[] =
{
- -8, -8, -8, -8, -8, -8, -8, -8, 38, -8,
- -8, -8, -8, -8, -8, -8, -8, -8
+ -32, -32, -32, -32, -32, -32, -32, -32, -32, -32,
+ -32, -32, -32, -32, -32, -32, -32, -32, -32, -32,
+ -31
};
/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int8 yydefgoto[] =
{
- -1, 1, 4, 8, 11, 12, 57, 58, 59, 60,
- 61, 62, 63, 64, 65, 66, 67, 93
+ 0, 1, 4, 8, 11, 12, 13, 14, 68, 69,
+ 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
+ 101
};
/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule whose
number is the opposite. If YYTABLE_NINF, syntax error. */
-static const yytype_uint8 yytable[] =
+static const yytype_int8 yytable[] =
{
- 13, 5, 7, 14, 15, 16, 17, 18, 19, 20,
- 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
- 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
- 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
- 51, 52, 53, 6, 54, 55, 56, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
- 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
- 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
- 47, 48, 49, 50, 51, 52, 53, 71, 54, 55,
- 56, 2, 9, 10, 68, 69, 76, 70, 78, 3,
- 74, 75, 77, 0, 79, 80, 81, 82, 72, 73,
- 84, 83, 85, 0, 86, 87, 88, 89, 90, 91,
- 92, 94, 95, 96, 97
+ 15, 5, 7, 6, 16, 17, 18, 19, 20, 21,
+ 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+ 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
+ 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
+ 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
+ 62, 63, 64, 65, 66, 67, 84, 103, 2, -4,
+ 9, 10, 80, 81, 0, 82, 3, -4, 83, 87,
+ 88, 89, 90, 91, 98, 92, 93, 94, 95, 85,
+ 86, 117, 96, 97, 99, 100, 0, 112, 102, 105,
+ 104, 106, 108, 107, 109, 110, 111, 113, 0, 114,
+ 115, 116, 0, 118, 119, 120
};
static const yytype_int8 yycheck[] =
{
- 7, 7, 5, 10, 11, 12, 13, 14, 15, 16,
+ 7, 7, 5, 8, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
- 47, 48, 49, 8, 51, 52, 53, 10, 11, 12,
- 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
- 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
- 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
- 43, 44, 45, 46, 47, 48, 49, 6, 51, 52,
- 53, 0, 3, 9, 8, 3, 58, 4, 4, 8,
- 5, 5, 3, -1, 4, 4, 4, 4, 27, 28,
- 4, 7, 3, -1, 7, 7, 4, 4, 7, 4,
- 4, 4, 4, 4, 4
+ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
+ 57, 58, 59, 60, 61, 62, 6, 88, 0, 0,
+ 3, 9, 8, 3, -1, 4, 8, 8, 3, 5,
+ 7, 5, 3, 3, 7, 4, 4, 4, 4, 29,
+ 30, 112, 4, 4, 4, 3, -1, 3, 7, 4,
+ 7, 4, 4, 7, 4, 4, 4, 3, -1, 4,
+ 7, 3, -1, 4, 4, 4
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */
-static const yytype_uint8 yystos[] =
+static const yytype_int8 yystos[] =
{
- 0, 55, 0, 8, 56, 7, 8, 5, 57, 3,
- 9, 58, 59, 7, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
- 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
- 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
- 46, 47, 48, 49, 51, 52, 53, 60, 61, 62,
- 63, 64, 65, 66, 67, 68, 69, 70, 8, 3,
- 4, 6, 27, 28, 5, 5, 62, 3, 4, 4,
- 4, 4, 4, 7, 4, 3, 7, 7, 4, 4,
- 7, 4, 4, 71, 4, 4, 4, 4
+ 0, 64, 0, 8, 65, 7, 8, 5, 66, 3,
+ 9, 67, 68, 69, 70, 7, 11, 12, 13, 14,
+ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
+ 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
+ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
+ 55, 56, 57, 58, 59, 60, 61, 62, 71, 72,
+ 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
+ 8, 3, 4, 3, 6, 29, 30, 5, 7, 5,
+ 3, 3, 4, 4, 4, 4, 4, 4, 7, 4,
+ 3, 83, 7, 83, 7, 4, 4, 7, 4, 4,
+ 4, 4, 3, 3, 4, 7, 3, 83, 4, 4,
+ 4
};
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
-static const yytype_uint8 yyr1[] =
+static const yytype_int8 yyr1[] =
{
- 0, 54, 55, 55, 56, 57, 57, 58, 58, 59,
- 59, 60, 60, 61, 62, 62, 62, 62, 62, 62,
- 62, 62, 62, 62, 62, 62, 62, 62, 62, 63,
- 64, 64, 64, 64, 64, 64, 65, 65, 65, 65,
- 65, 65, 65, 65, 65, 66, 66, 67, 67, 67,
- 67, 67, 67, 67, 67, 67, 67, 67, 67, 67,
- 67, 67, 68, 69, 70, 70, 70, 71, 71
+ 0, 63, 64, 64, 65, 66, 66, 67, 67, 68,
+ 68, 69, 70, 70, 71, 72, 72, 72, 72, 72,
+ 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
+ 72, 72, 72, 72, 73, 74, 75, 75, 75, 75,
+ 75, 75, 75, 76, 76, 76, 76, 76, 76, 76,
+ 76, 76, 76, 77, 77, 77, 77, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 79, 80, 81, 82, 82, 82, 83,
+ 83
};
/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
-static const yytype_uint8 yyr2[] =
+static const yytype_int8 yyr2[] =
{
0, 2, 0, 2, 7, 0, 1, 0, 1, 0,
- 2, 1, 2, 2, 1, 3, 2, 3, 3, 4,
- 5, 2, 4, 3, 2, 2, 2, 3, 3, 1,
+ 2, 2, 0, 2, 2, 1, 2, 3, 2, 3,
+ 3, 4, 4, 7, 2, 5, 3, 4, 2, 2,
+ 2, 3, 3, 3, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 0, 2
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
+ 2
};
+enum { YYENOMEM = -2 };
+
#define yyerrok (yyerrstatus = 0)
#define yyclearin (yychar = YYEMPTY)
-#define YYEMPTY (-2)
-#define YYEOF 0
#define YYACCEPT goto yyacceptlab
#define YYABORT goto yyabortlab
@@ -717,27 +833,52 @@ static const yytype_uint8 yyr2[] =
#define YYRECOVERING() (!!yyerrstatus)
-#define YYBACKUP(Token, Value) \
-do \
- if (yychar == YYEMPTY) \
- { \
- yychar = (Token); \
- yylval = (Value); \
- YYPOPSTACK (yylen); \
- yystate = *yyssp; \
- goto yybackup; \
- } \
- else \
- { \
- yyerror (ctx, YY_("syntax error: cannot back up")); \
- YYERROR; \
- } \
-while (0)
+#define YYBACKUP(Token, Value) \
+ do \
+ if (yychar == YYEMPTY) \
+ { \
+ yychar = (Token); \
+ yylval = (Value); \
+ YYPOPSTACK (yylen); \
+ yystate = *yyssp; \
+ goto yybackup; \
+ } \
+ else \
+ { \
+ yyerror (&yylloc, ctx, YY_("syntax error: cannot back up")); \
+ YYERROR; \
+ } \
+ while (0)
-/* Error token number */
-#define YYTERROR 1
-#define YYERRCODE 256
+/* Backward compatibility with an undocumented macro.
+ Use YYerror or YYUNDEF. */
+#define YYERRCODE YYUNDEF
+/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
+ If N is 0, then set CURRENT to the empty location which ends
+ the previous symbol: RHS[0] (always defined). */
+
+#ifndef YYLLOC_DEFAULT
+# define YYLLOC_DEFAULT(Current, Rhs, N) \
+ do \
+ if (N) \
+ { \
+ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
+ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
+ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
+ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
+ } \
+ else \
+ { \
+ (Current).first_line = (Current).last_line = \
+ YYRHSLOC (Rhs, 0).last_line; \
+ (Current).first_column = (Current).last_column = \
+ YYRHSLOC (Rhs, 0).last_column; \
+ } \
+ while (0)
+#endif
+
+#define YYRHSLOC(Rhs, K) ((Rhs)[K])
/* Enable debugging if requested. */
@@ -754,56 +895,102 @@ do { \
YYFPRINTF Args; \
} while (0)
-/* This macro is provided for backward compatibility. */
-#ifndef YY_LOCATION_PRINT
-# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
-#endif
+
+/* YY_LOCATION_PRINT -- Print the location on the stream.
+ This macro was not mandated originally: define only if we know
+ we won't break user code: when these are the locations we know. */
+
+# ifndef YY_LOCATION_PRINT
+# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
+
+/* Print *YYLOCP on YYO. Private, do not rely on its existence. */
+
+YY_ATTRIBUTE_UNUSED
+static int
+yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
+{
+ int res = 0;
+ int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
+ if (0 <= yylocp->first_line)
+ {
+ res += YYFPRINTF (yyo, "%d", yylocp->first_line);
+ if (0 <= yylocp->first_column)
+ res += YYFPRINTF (yyo, ".%d", yylocp->first_column);
+ }
+ if (0 <= yylocp->last_line)
+ {
+ if (yylocp->first_line < yylocp->last_line)
+ {
+ res += YYFPRINTF (yyo, "-%d", yylocp->last_line);
+ if (0 <= end_col)
+ res += YYFPRINTF (yyo, ".%d", end_col);
+ }
+ else if (0 <= end_col && yylocp->first_column < end_col)
+ res += YYFPRINTF (yyo, "-%d", end_col);
+ }
+ return res;
+ }
+
+# define YY_LOCATION_PRINT(File, Loc) \
+ yy_location_print_ (File, &(Loc))
+
+# else
+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+# endif
+# endif /* !defined YY_LOCATION_PRINT */
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
+# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
do { \
if (yydebug) \
{ \
YYFPRINTF (stderr, "%s ", Title); \
yy_symbol_print (stderr, \
- Type, Value, ctx); \
+ Kind, Value, Location, ctx); \
YYFPRINTF (stderr, "\n"); \
} \
} while (0)
-/*----------------------------------------.
-| Print this symbol's value on YYOUTPUT. |
-`----------------------------------------*/
+/*-----------------------------------.
+| Print this symbol's value on YYO. |
+`-----------------------------------*/
static void
-yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, MZAContext& ctx)
+yy_symbol_value_print (FILE *yyo,
+ yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, MZAContext& ctx)
{
- FILE *yyo = yyoutput;
- YYUSE (yyo);
- YYUSE (ctx);
+ FILE *yyoutput = yyo;
+ YY_USE (yyoutput);
+ YY_USE (yylocationp);
+ YY_USE (ctx);
if (!yyvaluep)
return;
# ifdef YYPRINT
- if (yytype < YYNTOKENS)
- YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+ if (yykind < YYNTOKENS)
+ YYPRINT (yyo, yytoknum[yykind], *yyvaluep);
# endif
- YYUSE (yytype);
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+ YY_USE (yykind);
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
}
-/*--------------------------------.
-| Print this symbol on YYOUTPUT. |
-`--------------------------------*/
+/*---------------------------.
+| Print this symbol on YYO. |
+`---------------------------*/
static void
-yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, MZAContext& ctx)
+yy_symbol_print (FILE *yyo,
+ yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, MZAContext& ctx)
{
- YYFPRINTF (yyoutput, "%s %s (",
- yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
+ YYFPRINTF (yyo, "%s %s (",
+ yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
- yy_symbol_value_print (yyoutput, yytype, yyvaluep, ctx);
- YYFPRINTF (yyoutput, ")");
+ YY_LOCATION_PRINT (yyo, *yylocationp);
+ YYFPRINTF (yyo, ": ");
+ yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp, ctx);
+ YYFPRINTF (yyo, ")");
}
/*------------------------------------------------------------------.
@@ -812,7 +999,7 @@ yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, MZA
`------------------------------------------------------------------*/
static void
-yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
+yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
{
YYFPRINTF (stderr, "Stack now");
for (; yybottom <= yytop; yybottom++)
@@ -835,21 +1022,22 @@ do { \
`------------------------------------------------*/
static void
-yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, MZAContext& ctx)
+yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp,
+ int yyrule, MZAContext& ctx)
{
- unsigned long int yylno = yyrline[yyrule];
+ int yylno = yyrline[yyrule];
int yynrhs = yyr2[yyrule];
int yyi;
- YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
+ YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
yyrule - 1, yylno);
/* The symbols being reduced. */
for (yyi = 0; yyi < yynrhs; yyi++)
{
YYFPRINTF (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr,
- yystos[yyssp[yyi + 1 - yynrhs]],
- &(yyvsp[(yyi + 1) - (yynrhs)])
- , ctx);
+ YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
+ &yyvsp[(yyi + 1) - (yynrhs)],
+ &(yylsp[(yyi + 1) - (yynrhs)]), ctx);
YYFPRINTF (stderr, "\n");
}
}
@@ -857,15 +1045,15 @@ yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, MZAContext& ct
# define YY_REDUCE_PRINT(Rule) \
do { \
if (yydebug) \
- yy_reduce_print (yyssp, yyvsp, Rule, ctx); \
+ yy_reduce_print (yyssp, yyvsp, yylsp, Rule, ctx); \
} while (0)
/* Nonzero means print parse trace. It is left uninitialized so that
multiple parsers can coexist. */
int yydebug;
#else /* !YYDEBUG */
-# define YYDPRINTF(Args)
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
+# define YYDPRINTF(Args) ((void) 0)
+# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
# define YY_STACK_PRINT(Bottom, Top)
# define YY_REDUCE_PRINT(Rule)
#endif /* !YYDEBUG */
@@ -888,28 +1076,77 @@ int yydebug;
#endif
-#if YYERROR_VERBOSE
+/* Context of a parse error. */
+typedef struct
+{
+ yy_state_t *yyssp;
+ yysymbol_kind_t yytoken;
+ YYLTYPE *yylloc;
+} yypcontext_t;
-# ifndef yystrlen
-# if defined __GLIBC__ && defined _STRING_H
-# define yystrlen strlen
-# else
+/* Put in YYARG at most YYARGN of the expected tokens given the
+ current YYCTX, and return the number of tokens stored in YYARG. If
+ YYARG is null, return the number of expected tokens (guaranteed to
+ be less than YYNTOKENS). Return YYENOMEM on memory exhaustion.
+ Return 0 if there are more than YYARGN expected tokens, yet fill
+ YYARG up to YYARGN. */
+static int
+yypcontext_expected_tokens (const yypcontext_t *yyctx,
+ yysymbol_kind_t yyarg[], int yyargn)
+{
+ /* Actual size of YYARG. */
+ int yycount = 0;
+ int yyn = yypact[+*yyctx->yyssp];
+ if (!yypact_value_is_default (yyn))
+ {
+ /* Start YYX at -YYN if negative to avoid negative indexes in
+ YYCHECK. In other words, skip the first -YYN actions for
+ this state because they are default actions. */
+ int yyxbegin = yyn < 0 ? -yyn : 0;
+ /* Stay within bounds of both yycheck and yytname. */
+ int yychecklim = YYLAST - yyn + 1;
+ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+ int yyx;
+ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+ if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror
+ && !yytable_value_is_error (yytable[yyx + yyn]))
+ {
+ if (!yyarg)
+ ++yycount;
+ else if (yycount == yyargn)
+ return 0;
+ else
+ yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx);
+ }
+ }
+ if (yyarg && yycount == 0 && 0 < yyargn)
+ yyarg[0] = YYSYMBOL_YYEMPTY;
+ return yycount;
+}
+
+
+
+
+#ifndef yystrlen
+# if defined __GLIBC__ && defined _STRING_H
+# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
+# else
/* Return the length of YYSTR. */
-static YYSIZE_T
+static YYPTRDIFF_T
yystrlen (const char *yystr)
{
- YYSIZE_T yylen;
+ YYPTRDIFF_T yylen;
for (yylen = 0; yystr[yylen]; yylen++)
continue;
return yylen;
}
-# endif
# endif
+#endif
-# ifndef yystpcpy
-# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
-# define yystpcpy stpcpy
-# else
+#ifndef yystpcpy
+# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
+# define yystpcpy stpcpy
+# else
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
YYDEST. */
static char *
@@ -923,10 +1160,10 @@ yystpcpy (char *yydest, const char *yysrc)
return yyd - 1;
}
-# endif
# endif
+#endif
-# ifndef yytnamerr
+#ifndef yytnamerr
/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
quotes and backslashes, so that it's suitable for yyerror. The
heuristic is that double-quoting is unnecessary unless the string
@@ -934,14 +1171,13 @@ yystpcpy (char *yydest, const char *yysrc)
backslash-backslash). YYSTR is taken from yytname. If YYRES is
null, do not copy; instead, return the length of what the result
would have been. */
-static YYSIZE_T
+static YYPTRDIFF_T
yytnamerr (char *yyres, const char *yystr)
{
if (*yystr == '"')
{
- YYSIZE_T yyn = 0;
+ YYPTRDIFF_T yyn = 0;
char const *yyp = yystr;
-
for (;;)
switch (*++yyp)
{
@@ -952,7 +1188,10 @@ yytnamerr (char *yyres, const char *yystr)
case '\\':
if (*++yyp != '\\')
goto do_not_strip_quotes;
- /* Fall through. */
+ else
+ goto append;
+
+ append:
default:
if (yyres)
yyres[yyn] = *yyp;
@@ -967,36 +1206,20 @@ yytnamerr (char *yyres, const char *yystr)
do_not_strip_quotes: ;
}
- if (! yyres)
+ if (yyres)
+ return yystpcpy (yyres, yystr) - yyres;
+ else
return yystrlen (yystr);
-
- return yystpcpy (yyres, yystr) - yyres;
}
-# endif
+#endif
-/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
- about the unexpected token YYTOKEN for the state stack whose top is
- YYSSP.
- Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
- not large enough to hold the message. In that case, also set
- *YYMSG_ALLOC to the required number of bytes. Return 2 if the
- required number of bytes is too large to store. */
static int
-yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
- yytype_int16 *yyssp, int yytoken)
+yy_syntax_error_arguments (const yypcontext_t *yyctx,
+ yysymbol_kind_t yyarg[], int yyargn)
{
- YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
- YYSIZE_T yysize = yysize0;
- enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
- /* Internationalized format string. */
- const char *yyformat = YY_NULLPTR;
- /* Arguments of yyformat. */
- char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
- /* Number of reported tokens (one for the "unexpected", one per
- "expected"). */
+ /* Actual size of YYARG. */
int yycount = 0;
-
/* There are many possibilities here to consider:
- If this state is a consistent state with a default action, then
the only way this function was invoked is if the default action
@@ -1020,63 +1243,78 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
one exception: it will still contain any token that will not be
accepted due to an error action in a later state.
*/
- if (yytoken != YYEMPTY)
+ if (yyctx->yytoken != YYSYMBOL_YYEMPTY)
{
- int yyn = yypact[*yyssp];
- yyarg[yycount++] = yytname[yytoken];
- if (!yypact_value_is_default (yyn))
- {
- /* Start YYX at -YYN if negative to avoid negative indexes in
- YYCHECK. In other words, skip the first -YYN actions for
- this state because they are default actions. */
- int yyxbegin = yyn < 0 ? -yyn : 0;
- /* Stay within bounds of both yycheck and yytname. */
- int yychecklim = YYLAST - yyn + 1;
- int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
- int yyx;
-
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
- && !yytable_value_is_error (yytable[yyx + yyn]))
- {
- if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
- {
- yycount = 1;
- yysize = yysize0;
- break;
- }
- yyarg[yycount++] = yytname[yyx];
- {
- YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
- if (! (yysize <= yysize1
- && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
- return 2;
- yysize = yysize1;
- }
- }
- }
+ int yyn;
+ if (yyarg)
+ yyarg[yycount] = yyctx->yytoken;
+ ++yycount;
+ yyn = yypcontext_expected_tokens (yyctx,
+ yyarg ? yyarg + 1 : yyarg, yyargn - 1);
+ if (yyn == YYENOMEM)
+ return YYENOMEM;
+ else
+ yycount += yyn;
}
+ return yycount;
+}
+
+/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
+ about the unexpected token YYTOKEN for the state stack whose top is
+ YYSSP.
+
+ Return 0 if *YYMSG was successfully written. Return -1 if *YYMSG is
+ not large enough to hold the message. In that case, also set
+ *YYMSG_ALLOC to the required number of bytes. Return YYENOMEM if the
+ required number of bytes is too large to store. */
+static int
+yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
+ const yypcontext_t *yyctx)
+{
+ enum { YYARGS_MAX = 5 };
+ /* Internationalized format string. */
+ const char *yyformat = YY_NULLPTR;
+ /* Arguments of yyformat: reported tokens (one for the "unexpected",
+ one per "expected"). */
+ yysymbol_kind_t yyarg[YYARGS_MAX];
+ /* Cumulated lengths of YYARG. */
+ YYPTRDIFF_T yysize = 0;
+
+ /* Actual size of YYARG. */
+ int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX);
+ if (yycount == YYENOMEM)
+ return YYENOMEM;
switch (yycount)
{
-# define YYCASE_(N, S) \
+#define YYCASE_(N, S) \
case N: \
yyformat = S; \
- break
+ break
+ default: /* Avoid compiler warnings. */
YYCASE_(0, YY_("syntax error"));
YYCASE_(1, YY_("syntax error, unexpected %s"));
YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
-# undef YYCASE_
+#undef YYCASE_
}
+ /* Compute error message size. Don't count the "%s"s, but reserve
+ room for the terminator. */
+ yysize = yystrlen (yyformat) - 2 * yycount + 1;
{
- YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
- if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
- return 2;
- yysize = yysize1;
+ int yyi;
+ for (yyi = 0; yyi < yycount; ++yyi)
+ {
+ YYPTRDIFF_T yysize1
+ = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]);
+ if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
+ yysize = yysize1;
+ else
+ return YYENOMEM;
+ }
}
if (*yymsg_alloc < yysize)
@@ -1085,7 +1323,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
if (! (yysize <= *yymsg_alloc
&& *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
*yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
- return 1;
+ return -1;
}
/* Avoid sprintf, as that infringes on the user's name space.
@@ -1097,47 +1335,42 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
while ((*yyp = *yyformat) != '\0')
if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
{
- yyp += yytnamerr (yyp, yyarg[yyi++]);
+ yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]);
yyformat += 2;
}
else
{
- yyp++;
- yyformat++;
+ ++yyp;
+ ++yyformat;
}
}
return 0;
}
-#endif /* YYERROR_VERBOSE */
+
/*-----------------------------------------------.
| Release the memory associated to this symbol. |
`-----------------------------------------------*/
static void
-yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, MZAContext& ctx)
+yydestruct (const char *yymsg,
+ yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, MZAContext& ctx)
{
- YYUSE (yyvaluep);
- YYUSE (ctx);
+ YY_USE (yyvaluep);
+ YY_USE (yylocationp);
+ YY_USE (ctx);
if (!yymsg)
yymsg = "Deleting";
- YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
+ YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
- YYUSE (yytype);
+ YY_USE (yykind);
YY_IGNORE_MAYBE_UNINITIALIZED_END
}
-/* The lookahead symbol. */
-int yychar;
-
-/* The semantic value of the lookahead symbol. */
-YYSTYPE yylval;
-/* Number of syntax errors so far. */
-int yynerrs;
/*----------.
@@ -1147,102 +1380,134 @@ int yynerrs;
int
yyparse (MZAContext& ctx)
{
- int yystate;
+/* Lookahead token kind. */
+int yychar;
+
+
+/* The semantic value of the lookahead symbol. */
+/* Default value used for initialization, for pacifying older GCCs
+ or non-GCC compilers. */
+YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
+YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
+
+/* Location data for the lookahead symbol. */
+static YYLTYPE yyloc_default
+# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
+ = { 1, 1, 1, 1 }
+# endif
+;
+YYLTYPE yylloc = yyloc_default;
+
+ /* Number of syntax errors so far. */
+ int yynerrs = 0;
+
+ yy_state_fast_t yystate = 0;
/* Number of tokens to shift before error messages enabled. */
- int yyerrstatus;
+ int yyerrstatus = 0;
- /* The stacks and their tools:
- 'yyss': related to states.
- 'yyvs': related to semantic values.
-
- Refer to the stacks through separate pointers, to allow yyoverflow
+ /* Refer to the stacks through separate pointers, to allow yyoverflow
to reallocate them elsewhere. */
- /* The state stack. */
- yytype_int16 yyssa[YYINITDEPTH];
- yytype_int16 *yyss;
- yytype_int16 *yyssp;
+ /* Their size. */
+ YYPTRDIFF_T yystacksize = YYINITDEPTH;
- /* The semantic value stack. */
+ /* The state stack: array, bottom, top. */
+ yy_state_t yyssa[YYINITDEPTH];
+ yy_state_t *yyss = yyssa;
+ yy_state_t *yyssp = yyss;
+
+ /* The semantic value stack: array, bottom, top. */
YYSTYPE yyvsa[YYINITDEPTH];
- YYSTYPE *yyvs;
- YYSTYPE *yyvsp;
+ YYSTYPE *yyvs = yyvsa;
+ YYSTYPE *yyvsp = yyvs;
- YYSIZE_T yystacksize;
+ /* The location stack: array, bottom, top. */
+ YYLTYPE yylsa[YYINITDEPTH];
+ YYLTYPE *yyls = yylsa;
+ YYLTYPE *yylsp = yyls;
int yyn;
+ /* The return value of yyparse. */
int yyresult;
- /* Lookahead token as an internal (translated) token number. */
- int yytoken = 0;
+ /* Lookahead symbol kind. */
+ yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
/* The variables used to return semantic value and location from the
action routines. */
YYSTYPE yyval;
+ YYLTYPE yyloc;
+
+ /* The locations where the error started and ended. */
+ YYLTYPE yyerror_range[3];
-#if YYERROR_VERBOSE
/* Buffer for error messages, and its allocated size. */
char yymsgbuf[128];
char *yymsg = yymsgbuf;
- YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
-#endif
+ YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
-#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
+#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
/* The number of symbols on the RHS of the reduced rule.
Keep to zero when no symbol should be popped. */
int yylen = 0;
- yyssp = yyss = yyssa;
- yyvsp = yyvs = yyvsa;
- yystacksize = YYINITDEPTH;
-
YYDPRINTF ((stderr, "Starting parse\n"));
- yystate = 0;
- yyerrstatus = 0;
- yynerrs = 0;
yychar = YYEMPTY; /* Cause a token to be read. */
+ yylsp[0] = yylloc;
goto yysetstate;
+
/*------------------------------------------------------------.
-| yynewstate -- Push a new state, which is found in yystate. |
+| yynewstate -- push a new state, which is found in yystate. |
`------------------------------------------------------------*/
- yynewstate:
+yynewstate:
/* In all cases, when you get here, the value and location stacks
have just been pushed. So pushing a state here evens the stacks. */
yyssp++;
- yysetstate:
- *yyssp = yystate;
+
+/*--------------------------------------------------------------------.
+| yysetstate -- set current state (the top of the stack) to yystate. |
+`--------------------------------------------------------------------*/
+yysetstate:
+ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+ YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
+ YY_IGNORE_USELESS_CAST_BEGIN
+ *yyssp = YY_CAST (yy_state_t, yystate);
+ YY_IGNORE_USELESS_CAST_END
+ YY_STACK_PRINT (yyss, yyssp);
if (yyss + yystacksize - 1 <= yyssp)
+#if !defined yyoverflow && !defined YYSTACK_RELOCATE
+ goto yyexhaustedlab;
+#else
{
/* Get the current used size of the three stacks, in elements. */
- YYSIZE_T yysize = yyssp - yyss + 1;
+ YYPTRDIFF_T yysize = yyssp - yyss + 1;
-#ifdef yyoverflow
+# if defined yyoverflow
{
/* Give user a chance to reallocate the stack. Use copies of
these so that the &'s don't force the real ones into
memory. */
+ yy_state_t *yyss1 = yyss;
YYSTYPE *yyvs1 = yyvs;
- yytype_int16 *yyss1 = yyss;
+ YYLTYPE *yyls1 = yyls;
/* Each stack pointer address is followed by the size of the
data in use in that stack, in bytes. This used to be a
conditional around just the two extra args, but that might
be undefined if yyoverflow is a macro. */
yyoverflow (YY_("memory exhausted"),
- &yyss1, yysize * sizeof (*yyssp),
- &yyvs1, yysize * sizeof (*yyvsp),
+ &yyss1, yysize * YYSIZEOF (*yyssp),
+ &yyvs1, yysize * YYSIZEOF (*yyvsp),
+ &yyls1, yysize * YYSIZEOF (*yylsp),
&yystacksize);
-
yyss = yyss1;
yyvs = yyvs1;
+ yyls = yyls1;
}
-#else /* no yyoverflow */
-# ifndef YYSTACK_RELOCATE
- goto yyexhaustedlab;
-# else
+# else /* defined YYSTACK_RELOCATE */
/* Extend the stack our own way. */
if (YYMAXDEPTH <= yystacksize)
goto yyexhaustedlab;
@@ -1251,42 +1516,45 @@ yyparse (MZAContext& ctx)
yystacksize = YYMAXDEPTH;
{
- yytype_int16 *yyss1 = yyss;
+ yy_state_t *yyss1 = yyss;
union yyalloc *yyptr =
- (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+ YY_CAST (union yyalloc *,
+ YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
if (! yyptr)
goto yyexhaustedlab;
YYSTACK_RELOCATE (yyss_alloc, yyss);
YYSTACK_RELOCATE (yyvs_alloc, yyvs);
+ YYSTACK_RELOCATE (yyls_alloc, yyls);
# undef YYSTACK_RELOCATE
if (yyss1 != yyssa)
YYSTACK_FREE (yyss1);
}
# endif
-#endif /* no yyoverflow */
yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1;
+ yylsp = yyls + yysize - 1;
- YYDPRINTF ((stderr, "Stack size increased to %lu\n",
- (unsigned long int) yystacksize));
+ YY_IGNORE_USELESS_CAST_BEGIN
+ YYDPRINTF ((stderr, "Stack size increased to %ld\n",
+ YY_CAST (long, yystacksize)));
+ YY_IGNORE_USELESS_CAST_END
if (yyss + yystacksize - 1 <= yyssp)
YYABORT;
}
-
- YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
if (yystate == YYFINAL)
YYACCEPT;
goto yybackup;
+
/*-----------.
| yybackup. |
`-----------*/
yybackup:
-
/* Do appropriate processing given the current state. Read a
lookahead token if we need one and don't already have one. */
@@ -1297,18 +1565,30 @@ yybackup:
/* Not known => get a lookahead token if don't already have one. */
- /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
+ /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
if (yychar == YYEMPTY)
{
- YYDPRINTF ((stderr, "Reading a token: "));
- yychar = yylex ();
+ YYDPRINTF ((stderr, "Reading a token\n"));
+ yychar = yylex (&yylval, &yylloc);
}
if (yychar <= YYEOF)
{
- yychar = yytoken = YYEOF;
+ yychar = YYEOF;
+ yytoken = YYSYMBOL_YYEOF;
YYDPRINTF ((stderr, "Now at end of input.\n"));
}
+ else if (yychar == YYerror)
+ {
+ /* The scanner already issued an error message, process directly
+ to error recovery. But do not keep the error token as
+ lookahead, it is too special and may lead us to an endless
+ loop in error recovery. */
+ yychar = YYUNDEF;
+ yytoken = YYSYMBOL_YYerror;
+ yyerror_range[1] = yylloc;
+ goto yyerrlab1;
+ }
else
{
yytoken = YYTRANSLATE (yychar);
@@ -1336,15 +1616,14 @@ yybackup:
/* Shift the lookahead token. */
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
-
- /* Discard the shifted token. */
- yychar = YYEMPTY;
-
yystate = yyn;
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
*++yyvsp = yylval;
YY_IGNORE_MAYBE_UNINITIALIZED_END
+ *++yylsp = yylloc;
+ /* Discard the shifted token. */
+ yychar = YYEMPTY;
goto yynewstate;
@@ -1359,7 +1638,7 @@ yydefault:
/*-----------------------------.
-| yyreduce -- Do a reduction. |
+| yyreduce -- do a reduction. |
`-----------------------------*/
yyreduce:
/* yyn is the number of a rule to reduce with. */
@@ -1375,12 +1654,13 @@ yyreduce:
GCC warning that YYVAL may be used uninitialized. */
yyval = yyvsp[1-yylen];
-
+ /* Default location. */
+ YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
+ yyerror_range[1] = yyloc;
YY_REDUCE_PRINT (yyn);
switch (yyn)
{
- case 4:
-
+ case 4: /* procedure: ":" MZA_ID ":" mode MZA_INT delay instructions */
{
// Patch jumps with recorded labels
for (auto& cl : ctx.patch_labels) {
@@ -1392,6 +1672,8 @@ yyreduce:
ctx.labels.clear();
ctx.patch_labels.clear();
+ ctx.proc_body.setNArgs((yyvsp[-2].iValue));
+
// Add ABORT instruction for error management
if (ctx.proc_body.size() > 0) {
ctx.proc_body.addInstr(BytecodeStream::ABORT);
@@ -1422,78 +1704,79 @@ yyreduce:
ctx.proc_body = BytecodeStream();
ctx.patch_procs.clear();
}
-
break;
- case 5:
-
- { (yyval.iValue) = BytecodeProc::FUN; }
-
+ case 5: /* mode: %empty */
+ { (yyval.iValue) = BytecodeProc::FUN; }
break;
- case 7:
-
- { (yyval.iValue) = 0; }
-
+ case 7: /* delay: %empty */
+ { (yyval.iValue) = 0; }
break;
- case 8:
-
- { (yyval.iValue) = 1; }
-
+ case 8: /* delay: "D" */
+ { (yyval.iValue) = 1; }
break;
- case 12:
-
+ case 11: /* labeled_instr: labels instruction */
{
- ctx.labels.emplace((yyvsp[-1].sValue), (yyvsp[0].iValue));
+ for (auto l : *(yyvsp[-1].sliValue)) {
+ ctx.labels.emplace(l, (yyvsp[0].iValue));
+ }
+ delete (yyvsp[-1].sliValue);
}
-
break;
- case 14:
+ case 12: /* labels: %empty */
+ { (yyval.sliValue) = new std::list(); }
+ break;
+ case 13: /* labels: labels label */
+ { (yyvsp[-1].sliValue)->push_back((yyvsp[0].sValue)); (yyval.sliValue) = (yyvsp[-1].sliValue); }
+ break;
+
+ case 15: /* instruction: instr */
{
(yyval.iValue) = ctx.proc_body.size();
ctx.proc_body.addInstr((yyvsp[0].bValue));
}
-
break;
- case 15:
+ case 16: /* instruction: instrI MZA_INT */
+ {
+ (yyval.iValue) = ctx.proc_body.size();
+ ctx.proc_body.addInstr((yyvsp[-1].bValue));
+ ctx.proc_body.addIntVal((yyvsp[0].iValue));
+ }
+ break;
+ case 17: /* instruction: instrIR MZA_INT MZA_REG */
{
(yyval.iValue) = ctx.proc_body.size();
ctx.proc_body.addInstr((yyvsp[-2].bValue));
ctx.proc_body.addIntVal((yyvsp[-1].iValue));
ctx.proc_body.addReg((yyvsp[0].iValue));
}
-
break;
- case 16:
-
+ case 18: /* instruction: instrR MZA_REG */
{
(yyval.iValue) = ctx.proc_body.size();
ctx.proc_body.addInstr((yyvsp[-1].bValue));
ctx.proc_body.addReg((yyvsp[0].iValue));
}
-
break;
- case 17:
-
+ case 19: /* instruction: instrRR MZA_REG MZA_REG */
{
(yyval.iValue) = ctx.proc_body.size();
ctx.proc_body.addInstr((yyvsp[-2].bValue));
ctx.proc_body.addReg((yyvsp[-1].iValue));
ctx.proc_body.addReg((yyvsp[0].iValue));
}
-
break;
- case 18:
-
+ case 20: /* instruction: instrRS MZA_REG MZA_ID */
{
(yyval.iValue) = ctx.proc_body.size();
ctx.proc_body.addInstr((yyvsp[-2].bValue));
@@ -1501,11 +1784,20 @@ yyreduce:
ctx.patch_labels.emplace_back(ctx.proc_body.size(), (yyvsp[0].sValue));
ctx.proc_body.addSmallInt(0);
}
-
break;
- case 19:
+ case 21: /* instruction: instrRRS MZA_REG MZA_REG MZA_ID */
+ {
+ (yyval.iValue) = ctx.proc_body.size();
+ ctx.proc_body.addInstr((yyvsp[-3].bValue));
+ ctx.proc_body.addReg((yyvsp[-2].iValue));
+ ctx.proc_body.addReg((yyvsp[-1].iValue));
+ ctx.patch_labels.emplace_back(ctx.proc_body.size(), (yyvsp[0].sValue));
+ ctx.proc_body.addSmallInt(0);
+ }
+ break;
+ case 22: /* instruction: instrRRR MZA_REG MZA_REG MZA_REG */
{
(yyval.iValue) = ctx.proc_body.size();
ctx.proc_body.addInstr((yyvsp[-3].bValue));
@@ -1513,39 +1805,49 @@ yyreduce:
ctx.proc_body.addReg((yyvsp[-1].iValue));
ctx.proc_body.addReg((yyvsp[0].iValue));
}
-
break;
- case 20:
+ case 23: /* instruction: instrRRIRRR MZA_REG MZA_REG MZA_INT MZA_REG MZA_REG MZA_REG */
+ {
+ (yyval.iValue) = ctx.proc_body.size();
+ ctx.proc_body.addInstr((yyvsp[-6].bValue));
+ ctx.proc_body.addReg((yyvsp[-5].iValue));
+ ctx.proc_body.addReg((yyvsp[-4].iValue));
+ ctx.proc_body.addIntVal((yyvsp[-3].iValue));
+ ctx.proc_body.addReg((yyvsp[-2].iValue));
+ ctx.proc_body.addReg((yyvsp[-1].iValue));
+ ctx.proc_body.addReg((yyvsp[0].iValue));
+ }
+ break;
+ case 24: /* instruction: instrS MZA_ID */
+ {
+ (yyval.iValue) = ctx.proc_body.size();
+ ctx.proc_body.addInstr((yyvsp[-1].bValue));
+ ctx.patch_labels.emplace_back(ctx.proc_body.size(), (yyvsp[0].sValue));
+ ctx.proc_body.addSmallInt(0);
+ }
+ break;
+
+ case 25: /* instruction: MZA_CALL MZA_MODE MZA_ID MZA_INT registers */
{
(yyval.iValue) = ctx.proc_body.size();
ctx.proc_body.addInstr((yyvsp[-4].bValue));
- ctx.proc_body.addReg((yyvsp[-3].iValue));
- ctx.proc_body.addReg((yyvsp[-2].iValue));
- ctx.proc_body.addReg((yyvsp[-1].iValue));
- ctx.proc_body.addReg((yyvsp[0].iValue));
- }
-
- break;
-
- case 21:
-
- {
- (yyval.iValue) = ctx.proc_body.size();
- ctx.proc_body.addInstr((yyvsp[-1].bValue));
- ctx.patch_labels.emplace_back(ctx.proc_body.size(), (yyvsp[0].sValue));
+ ctx.proc_body.addCharVal((yyvsp[-3].iValue));
+ ctx.patch_procs.emplace_back(ctx.proc_body.size(), std::make_pair((yyvsp[-2].sValue), (yyvsp[0].liValue)->size()));
ctx.proc_body.addSmallInt(0);
+ ctx.proc_body.addCharVal((yyvsp[-1].iValue));
+ for (auto arg : *(yyvsp[0].liValue)) {
+ ctx.proc_body.addReg(arg);
+ }
+ delete (yyvsp[0].liValue);
}
-
break;
- case 22:
-
+ case 26: /* instruction: MZA_BUILTIN MZA_ID registers */
{
(yyval.iValue) = ctx.proc_body.size();
- ctx.proc_body.addInstr((yyvsp[-3].bValue));
- ctx.proc_body.addCharVal((yyvsp[-2].iValue));
+ ctx.proc_body.addInstr((yyvsp[-2].bValue));
ctx.patch_procs.emplace_back(ctx.proc_body.size(), std::make_pair((yyvsp[-1].sValue), (yyvsp[0].liValue)->size()));
ctx.proc_body.addSmallInt(0);
for (auto arg : *(yyvsp[0].liValue)) {
@@ -1553,83 +1855,81 @@ yyreduce:
}
delete (yyvsp[0].liValue);
}
-
break;
- case 23:
-
+ case 27: /* instruction: MZA_TCALL MZA_MODE MZA_ID MZA_INT */
{
(yyval.iValue) = ctx.proc_body.size();
- ctx.proc_body.addInstr((yyvsp[-2].bValue));
- ctx.proc_body.addCharVal((yyvsp[-1].iValue));
- ctx.patch_procs.emplace_back(ctx.proc_body.size(), std::make_pair((yyvsp[0].sValue), -1));
+ ctx.proc_body.addInstr((yyvsp[-3].bValue));
+ ctx.proc_body.addCharVal((yyvsp[-2].iValue));
+ ctx.patch_procs.emplace_back(ctx.proc_body.size(), std::make_pair((yyvsp[-1].sValue), -1));
ctx.proc_body.addSmallInt(0);
+ ctx.proc_body.addCharVal((yyvsp[0].iValue));
}
-
break;
- case 24:
-
+ case 28: /* instruction: MZA_OPEN_AGGREGATION MZA_CTX */
{
(yyval.iValue) = ctx.proc_body.size();
ctx.proc_body.addInstr((yyvsp[-1].bValue));
ctx.proc_body.addCharVal((yyvsp[0].iValue));
}
-
break;
- case 25:
-
+ case 29: /* instruction: MZA_OPEN_AGGREGATION MZA_AND */
{
(yyval.iValue) = ctx.proc_body.size();
ctx.proc_body.addInstr((yyvsp[-1].bValue));
ctx.proc_body.addCharVal(AggregationCtx::VCTX_AND);
}
-
break;
- case 26:
-
+ case 30: /* instruction: MZA_OPEN_AGGREGATION MZA_OR */
{
(yyval.iValue) = ctx.proc_body.size();
ctx.proc_body.addInstr((yyvsp[-1].bValue));
ctx.proc_body.addCharVal(AggregationCtx::VCTX_OR);
}
-
break;
- case 27:
+ case 31: /* instruction: MZA_LOAD_GLOBAL MZA_INT MZA_REG */
+ {
+ (yyval.iValue) = ctx.proc_body.size();
+ ctx.proc_body.addInstr((yyvsp[-2].bValue));
+ ctx.proc_body.addReg((yyvsp[-1].iValue), true);
+ ctx.max_glob = std::max(ctx.max_glob, (yyvsp[-1].iValue));
+ ctx.proc_body.addReg((yyvsp[0].iValue));
+ }
+ break;
+ case 32: /* instruction: MZA_STORE_GLOBAL MZA_REG MZA_INT */
{
(yyval.iValue) = ctx.proc_body.size();
ctx.proc_body.addInstr((yyvsp[-2].bValue));
ctx.proc_body.addReg((yyvsp[-1].iValue));
- ctx.proc_body.addReg((yyvsp[0].iValue));
+ ctx.proc_body.addReg((yyvsp[0].iValue), true);
+ ctx.max_glob = std::max(ctx.max_glob, (yyvsp[0].iValue));
}
-
break;
- case 28:
-
+ case 33: /* instruction: MZA_GET_ARRAY MZA_INT registers */
{
(yyval.iValue) = ctx.proc_body.size();
ctx.proc_body.addInstr((yyvsp[-2].bValue));
- ctx.proc_body.addReg((yyvsp[-1].iValue));
- ctx.proc_body.addReg((yyvsp[0].iValue));
+ ctx.proc_body.addIntVal((yyvsp[-1].iValue));
+ for (auto arg : *(yyvsp[0].liValue)) {
+ ctx.proc_body.addReg(arg);
+ }
+ delete (yyvsp[0].liValue);
}
-
break;
- case 67:
-
- { (yyval.liValue) = new std::list(); }
-
+ case 79: /* registers: %empty */
+ { (yyval.liValue) = new std::list(); }
break;
- case 68:
-
- { (yyvsp[-1].liValue)->push_back((yyvsp[0].iValue)); (yyval.liValue) = (yyvsp[-1].liValue); }
-
+ case 80: /* registers: registers MZA_REG */
+ { (yyvsp[-1].liValue)->push_back((yyvsp[0].iValue)); (yyval.liValue) = (yyvsp[-1].liValue); }
break;
@@ -1647,25 +1947,24 @@ yyreduce:
case of YYERROR or YYBACKUP, subsequent parser actions might lead
to an incorrect destructor call or verbose syntax error message
before the lookahead is translated. */
- YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
+ YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
YYPOPSTACK (yylen);
yylen = 0;
- YY_STACK_PRINT (yyss, yyssp);
*++yyvsp = yyval;
+ *++yylsp = yyloc;
/* Now 'shift' the result of the reduction. Determine what state
that goes to, based on the state we popped back to and the rule
number reduced by. */
-
- yyn = yyr1[yyn];
-
- yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
- if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
- yystate = yytable[yystate];
- else
- yystate = yydefgoto[yyn - YYNTOKENS];
+ {
+ const int yylhs = yyr1[yyn] - YYNTOKENS;
+ const int yyi = yypgoto[yylhs] + *yyssp;
+ yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
+ ? yytable[yyi]
+ : yydefgoto[yylhs]);
+ }
goto yynewstate;
@@ -1676,50 +1975,45 @@ yyreduce:
yyerrlab:
/* Make sure we have latest lookahead translation. See comments at
user semantic actions for why this is necessary. */
- yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
-
+ yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
/* If not already recovering from an error, report this error. */
if (!yyerrstatus)
{
++yynerrs;
-#if ! YYERROR_VERBOSE
- yyerror (ctx, YY_("syntax error"));
-#else
-# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
- yyssp, yytoken)
{
+ yypcontext_t yyctx
+ = {yyssp, yytoken, &yylloc};
char const *yymsgp = YY_("syntax error");
int yysyntax_error_status;
- yysyntax_error_status = YYSYNTAX_ERROR;
+ yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx);
if (yysyntax_error_status == 0)
yymsgp = yymsg;
- else if (yysyntax_error_status == 1)
+ else if (yysyntax_error_status == -1)
{
if (yymsg != yymsgbuf)
YYSTACK_FREE (yymsg);
- yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
- if (!yymsg)
+ yymsg = YY_CAST (char *,
+ YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc)));
+ if (yymsg)
{
- yymsg = yymsgbuf;
- yymsg_alloc = sizeof yymsgbuf;
- yysyntax_error_status = 2;
+ yysyntax_error_status
+ = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx);
+ yymsgp = yymsg;
}
else
{
- yysyntax_error_status = YYSYNTAX_ERROR;
- yymsgp = yymsg;
+ yymsg = yymsgbuf;
+ yymsg_alloc = sizeof yymsgbuf;
+ yysyntax_error_status = YYENOMEM;
}
}
- yyerror (ctx, yymsgp);
- if (yysyntax_error_status == 2)
+ yyerror (&yylloc, ctx, yymsgp);
+ if (yysyntax_error_status == YYENOMEM)
goto yyexhaustedlab;
}
-# undef YYSYNTAX_ERROR
-#endif
}
-
-
+ yyerror_range[1] = yylloc;
if (yyerrstatus == 3)
{
/* If just tried and failed to reuse lookahead token after an
@@ -1734,7 +2028,7 @@ yyerrlab:
else
{
yydestruct ("Error: discarding",
- yytoken, &yylval, ctx);
+ yytoken, &yylval, &yylloc, ctx);
yychar = YYEMPTY;
}
}
@@ -1748,12 +2042,10 @@ yyerrlab:
| yyerrorlab -- error raised explicitly by YYERROR. |
`---------------------------------------------------*/
yyerrorlab:
-
- /* Pacify compilers like GCC when the user code never invokes
- YYERROR and the label yyerrorlab therefore never appears in user
- code. */
- if (/*CONSTCOND*/ 0)
- goto yyerrorlab;
+ /* Pacify compilers when the user code never invokes YYERROR and the
+ label yyerrorlab therefore never appears in user code. */
+ if (0)
+ YYERROR;
/* Do not reclaim the symbols of the rule whose action triggered
this YYERROR. */
@@ -1770,13 +2062,14 @@ yyerrorlab:
yyerrlab1:
yyerrstatus = 3; /* Each real token shifted decrements this. */
+ /* Pop stack until we find a state that shifts the error token. */
for (;;)
{
yyn = yypact[yystate];
if (!yypact_value_is_default (yyn))
{
- yyn += YYTERROR;
- if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+ yyn += YYSYMBOL_YYerror;
+ if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
{
yyn = yytable[yyn];
if (0 < yyn)
@@ -1788,9 +2081,9 @@ yyerrlab1:
if (yyssp == yyss)
YYABORT;
-
+ yyerror_range[1] = *yylsp;
yydestruct ("Error: popping",
- yystos[yystate], yyvsp, ctx);
+ YY_ACCESSING_SYMBOL (yystate), yyvsp, yylsp, ctx);
YYPOPSTACK (1);
yystate = *yyssp;
YY_STACK_PRINT (yyss, yyssp);
@@ -1800,9 +2093,12 @@ yyerrlab1:
*++yyvsp = yylval;
YY_IGNORE_MAYBE_UNINITIALIZED_END
+ yyerror_range[2] = yylloc;
+ ++yylsp;
+ YYLLOC_DEFAULT (*yylsp, yyerror_range, 2);
/* Shift the error token. */
- YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
+ YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
yystate = yyn;
goto yynewstate;
@@ -1815,6 +2111,7 @@ yyacceptlab:
yyresult = 0;
goto yyreturn;
+
/*-----------------------------------.
| yyabortlab -- YYABORT comes here. |
`-----------------------------------*/
@@ -1822,16 +2119,21 @@ yyabortlab:
yyresult = 1;
goto yyreturn;
-#if !defined yyoverflow || YYERROR_VERBOSE
+
+#if 1
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/
yyexhaustedlab:
- yyerror (ctx, YY_("memory exhausted"));
+ yyerror (&yylloc, ctx, YY_("memory exhausted"));
yyresult = 2;
- /* Fall through. */
+ goto yyreturn;
#endif
+
+/*-------------------------------------------------------.
+| yyreturn -- parsing is finished, clean up and return. |
+`-------------------------------------------------------*/
yyreturn:
if (yychar != YYEMPTY)
{
@@ -1839,7 +2141,7 @@ yyreturn:
user semantic actions for why this is necessary. */
yytoken = YYTRANSLATE (yychar);
yydestruct ("Cleanup: discarding lookahead",
- yytoken, &yylval, ctx);
+ yytoken, &yylval, &yylloc, ctx);
}
/* Do not reclaim the symbols of the rule whose action triggered
this YYABORT or YYACCEPT. */
@@ -1848,32 +2150,33 @@ yyreturn:
while (yyssp != yyss)
{
yydestruct ("Cleanup: popping",
- yystos[*yyssp], yyvsp, ctx);
+ YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp, ctx);
YYPOPSTACK (1);
}
#ifndef yyoverflow
if (yyss != yyssa)
YYSTACK_FREE (yyss);
#endif
-#if YYERROR_VERBOSE
if (yymsg != yymsgbuf)
YYSTACK_FREE (yymsg);
-#endif
return yyresult;
}
-#include
+#include
+#include
-void yyerror(MZAContext& ctx, const char* s) {
- // TODO: Add error location
- throw std::runtime_error("Cannot parse MiniZinc assembly: " + std::string(s));
+void yyerror(YYLTYPE* location, MZAContext& ctx, const char* s) {
+ std::ostringstream oss;
+ oss << "Cannot parse MiniZinc assembly in line " << location->first_line << ": " << std::string(s);
+ throw Error(oss.str());
}
-std::vector parse_mza(const std::string& assembly_str) {
+std::pair> parse_mza(const std::string& assembly_str) {
std::vector procs;
std::unordered_map proc_map;
+ int max_glob;
// Initialise first slots with
for (PrimitiveMap::Primitive* p : primitiveMap()) {
BytecodeProc bcp;
@@ -1884,7 +2187,7 @@ std::vector parse_mza(const std::string& assembly_str) {
proc_map.emplace(bcp.name, p->ident());
}
mza_yy_scan_string(assembly_str.c_str());
- MZAContext ctx = MZAContext{procs, proc_map};
+ MZAContext ctx = MZAContext{procs, proc_map, max_glob};
int err = yyparse(ctx);
if (err != 0) {
throw std::runtime_error("Cannot parse MiniZinc assembly: " + std::to_string(err));
@@ -1903,5 +2206,5 @@ std::vector parse_mza(const std::string& assembly_str) {
procs[code].mode[mode].patchAddress(patch.first, proc_map[patch.second.first]);
}
}
- return procs;
+ return {max_glob, procs};
}
diff --git a/software/mza/lib/cached/parser.tab.cpp b/software/mza/lib/cached/parser.tab.cpp
index 7469a8a..3b7dc76 100644
--- a/software/mza/lib/cached/parser.tab.cpp
+++ b/software/mza/lib/cached/parser.tab.cpp
@@ -1,14 +1,14 @@
-/* A Bison parser, made by GNU Bison 2.3. */
+/* A Bison parser, made by GNU Bison 3.7.6. */
-/* Skeleton implementation for Bison's Yacc-like parsers in C
+/* Bison implementation for Yacc-like parsers in C
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
- Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
+ Inc.
- This program is free software; you can redistribute it and/or modify
+ This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -16,9 +16,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
+ along with this program. If not, see . */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@@ -36,6 +34,10 @@
/* C LALR(1) parser skeleton written by Richard Stallman, by
simplifying the original so-called "semantic" parser. */
+/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
+ especially those whose name start with YY_ or yy_. They are
+ private implementation details that can be changed or removed. */
+
/* All symbols defined below should begin with yy or YY, to avoid
infringing on user name space. This should be done even for local
variables, as they might otherwise be expanded by user macros.
@@ -43,11 +45,11 @@
define necessary library symbols; they are noted "INFRINGES ON
USER NAME SPACE" below. */
-/* Identify Bison output. */
-#define YYBISON 1
+/* Identify Bison output, and Bison version. */
+#define YYBISON 30706
-/* Bison version. */
-#define YYBISON_VERSION "2.3"
+/* Bison version string. */
+#define YYBISON_VERSION "3.7.6"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -55,294 +57,21 @@
/* Pure parsers. */
#define YYPURE 1
-/* Using locations. */
-#define YYLSP_NEEDED 1
+/* Push parsers. */
+#define YYPUSH 0
+
+/* Pull parsers. */
+#define YYPULL 1
+
/* Substitute the variable and function names. */
-#define yyparse mzn_yyparse
-#define yylex mzn_yylex
-#define yyerror mzn_yyerror
-#define yylval mzn_yylval
-#define yychar mzn_yychar
-#define yydebug mzn_yydebug
-#define yynerrs mzn_yynerrs
-#define yylloc mzn_yylloc
-
-/* Tokens. */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
- /* Put the tokens into the symbol table, so that GDB and other debuggers
- know about them. */
- enum yytokentype {
- END = 0,
- MZN_INTEGER_LITERAL = 258,
- MZN_BOOL_LITERAL = 259,
- MZN_FLOAT_LITERAL = 260,
- MZN_IDENTIFIER = 261,
- MZN_QUOTED_IDENTIFIER = 262,
- MZN_STRING_LITERAL = 263,
- MZN_STRING_QUOTE_START = 264,
- MZN_STRING_QUOTE_MID = 265,
- MZN_STRING_QUOTE_END = 266,
- MZN_TI_IDENTIFIER = 267,
- MZN_TI_ENUM_IDENTIFIER = 268,
- MZN_DOC_COMMENT = 269,
- MZN_DOC_FILE_COMMENT = 270,
- MZN_VAR = 271,
- MZN_PAR = 272,
- MZN_ABSENT = 273,
- MZN_ANN = 274,
- MZN_ANNOTATION = 275,
- MZN_ANY = 276,
- MZN_ARRAY = 277,
- MZN_BOOL = 278,
- MZN_CASE = 279,
- MZN_CONSTRAINT = 280,
- MZN_DEFAULT = 281,
- MZN_ELSE = 282,
- MZN_ELSEIF = 283,
- MZN_ENDIF = 284,
- MZN_ENUM = 285,
- MZN_FLOAT = 286,
- MZN_FUNCTION = 287,
- MZN_IF = 288,
- MZN_INCLUDE = 289,
- MZN_INFINITY = 290,
- MZN_INT = 291,
- MZN_LET = 292,
- MZN_LIST = 293,
- MZN_MAXIMIZE = 294,
- MZN_MINIMIZE = 295,
- MZN_OF = 296,
- MZN_OPT = 297,
- MZN_SATISFY = 298,
- MZN_OUTPUT = 299,
- MZN_PREDICATE = 300,
- MZN_RECORD = 301,
- MZN_SET = 302,
- MZN_SOLVE = 303,
- MZN_STRING = 304,
- MZN_TEST = 305,
- MZN_THEN = 306,
- MZN_TUPLE = 307,
- MZN_TYPE = 308,
- MZN_UNDERSCORE = 309,
- MZN_VARIANT_RECORD = 310,
- MZN_WHERE = 311,
- MZN_LEFT_BRACKET = 312,
- MZN_LEFT_2D_BRACKET = 313,
- MZN_RIGHT_BRACKET = 314,
- MZN_RIGHT_2D_BRACKET = 315,
- FLATZINC_IDENTIFIER = 316,
- MZN_INVALID_INTEGER_LITERAL = 317,
- MZN_INVALID_FLOAT_LITERAL = 318,
- MZN_UNTERMINATED_STRING = 319,
- MZN_END_OF_LINE_IN_STRING = 320,
- MZN_INVALID_NULL = 321,
- MZN_EQUIV = 322,
- MZN_IMPL = 323,
- MZN_RIMPL = 324,
- MZN_OR = 325,
- MZN_XOR = 326,
- MZN_AND = 327,
- MZN_LE = 328,
- MZN_GR = 329,
- MZN_LQ = 330,
- MZN_GQ = 331,
- MZN_EQ = 332,
- MZN_NQ = 333,
- MZN_WEAK_EQ = 334,
- MZN_IN = 335,
- MZN_SUBSET = 336,
- MZN_SUPERSET = 337,
- MZN_UNION = 338,
- MZN_DIFF = 339,
- MZN_SYMDIFF = 340,
- MZN_DOTDOT = 341,
- MZN_PLUS = 342,
- MZN_MINUS = 343,
- MZN_WEAK_PLUS = 344,
- MZN_WEAK_MINUS = 345,
- MZN_MULT = 346,
- MZN_DIV = 347,
- MZN_IDIV = 348,
- MZN_MOD = 349,
- MZN_INTERSECT = 350,
- MZN_WEAK_MULT = 351,
- MZN_POW = 352,
- MZN_NOT = 353,
- MZN_PLUSPLUS = 354,
- MZN_COLONCOLON = 355,
- PREC_ANNO = 356,
- MZN_EQUIV_QUOTED = 357,
- MZN_IMPL_QUOTED = 358,
- MZN_RIMPL_QUOTED = 359,
- MZN_OR_QUOTED = 360,
- MZN_XOR_QUOTED = 361,
- MZN_AND_QUOTED = 362,
- MZN_LE_QUOTED = 363,
- MZN_GR_QUOTED = 364,
- MZN_LQ_QUOTED = 365,
- MZN_GQ_QUOTED = 366,
- MZN_EQ_QUOTED = 367,
- MZN_NQ_QUOTED = 368,
- MZN_IN_QUOTED = 369,
- MZN_SUBSET_QUOTED = 370,
- MZN_SUPERSET_QUOTED = 371,
- MZN_UNION_QUOTED = 372,
- MZN_DIFF_QUOTED = 373,
- MZN_SYMDIFF_QUOTED = 374,
- MZN_DOTDOT_QUOTED = 375,
- MZN_PLUS_QUOTED = 376,
- MZN_MINUS_QUOTED = 377,
- MZN_MULT_QUOTED = 378,
- MZN_DIV_QUOTED = 379,
- MZN_IDIV_QUOTED = 380,
- MZN_MOD_QUOTED = 381,
- MZN_INTERSECT_QUOTED = 382,
- MZN_POW_QUOTED = 383,
- MZN_NOT_QUOTED = 384,
- MZN_COLONCOLON_QUOTED = 385,
- MZN_PLUSPLUS_QUOTED = 386
- };
-#endif
-/* Tokens. */
-#define END 0
-#define MZN_INTEGER_LITERAL 258
-#define MZN_BOOL_LITERAL 259
-#define MZN_FLOAT_LITERAL 260
-#define MZN_IDENTIFIER 261
-#define MZN_QUOTED_IDENTIFIER 262
-#define MZN_STRING_LITERAL 263
-#define MZN_STRING_QUOTE_START 264
-#define MZN_STRING_QUOTE_MID 265
-#define MZN_STRING_QUOTE_END 266
-#define MZN_TI_IDENTIFIER 267
-#define MZN_TI_ENUM_IDENTIFIER 268
-#define MZN_DOC_COMMENT 269
-#define MZN_DOC_FILE_COMMENT 270
-#define MZN_VAR 271
-#define MZN_PAR 272
-#define MZN_ABSENT 273
-#define MZN_ANN 274
-#define MZN_ANNOTATION 275
-#define MZN_ANY 276
-#define MZN_ARRAY 277
-#define MZN_BOOL 278
-#define MZN_CASE 279
-#define MZN_CONSTRAINT 280
-#define MZN_DEFAULT 281
-#define MZN_ELSE 282
-#define MZN_ELSEIF 283
-#define MZN_ENDIF 284
-#define MZN_ENUM 285
-#define MZN_FLOAT 286
-#define MZN_FUNCTION 287
-#define MZN_IF 288
-#define MZN_INCLUDE 289
-#define MZN_INFINITY 290
-#define MZN_INT 291
-#define MZN_LET 292
-#define MZN_LIST 293
-#define MZN_MAXIMIZE 294
-#define MZN_MINIMIZE 295
-#define MZN_OF 296
-#define MZN_OPT 297
-#define MZN_SATISFY 298
-#define MZN_OUTPUT 299
-#define MZN_PREDICATE 300
-#define MZN_RECORD 301
-#define MZN_SET 302
-#define MZN_SOLVE 303
-#define MZN_STRING 304
-#define MZN_TEST 305
-#define MZN_THEN 306
-#define MZN_TUPLE 307
-#define MZN_TYPE 308
-#define MZN_UNDERSCORE 309
-#define MZN_VARIANT_RECORD 310
-#define MZN_WHERE 311
-#define MZN_LEFT_BRACKET 312
-#define MZN_LEFT_2D_BRACKET 313
-#define MZN_RIGHT_BRACKET 314
-#define MZN_RIGHT_2D_BRACKET 315
-#define FLATZINC_IDENTIFIER 316
-#define MZN_INVALID_INTEGER_LITERAL 317
-#define MZN_INVALID_FLOAT_LITERAL 318
-#define MZN_UNTERMINATED_STRING 319
-#define MZN_END_OF_LINE_IN_STRING 320
-#define MZN_INVALID_NULL 321
-#define MZN_EQUIV 322
-#define MZN_IMPL 323
-#define MZN_RIMPL 324
-#define MZN_OR 325
-#define MZN_XOR 326
-#define MZN_AND 327
-#define MZN_LE 328
-#define MZN_GR 329
-#define MZN_LQ 330
-#define MZN_GQ 331
-#define MZN_EQ 332
-#define MZN_NQ 333
-#define MZN_WEAK_EQ 334
-#define MZN_IN 335
-#define MZN_SUBSET 336
-#define MZN_SUPERSET 337
-#define MZN_UNION 338
-#define MZN_DIFF 339
-#define MZN_SYMDIFF 340
-#define MZN_DOTDOT 341
-#define MZN_PLUS 342
-#define MZN_MINUS 343
-#define MZN_WEAK_PLUS 344
-#define MZN_WEAK_MINUS 345
-#define MZN_MULT 346
-#define MZN_DIV 347
-#define MZN_IDIV 348
-#define MZN_MOD 349
-#define MZN_INTERSECT 350
-#define MZN_WEAK_MULT 351
-#define MZN_POW 352
-#define MZN_NOT 353
-#define MZN_PLUSPLUS 354
-#define MZN_COLONCOLON 355
-#define PREC_ANNO 356
-#define MZN_EQUIV_QUOTED 357
-#define MZN_IMPL_QUOTED 358
-#define MZN_RIMPL_QUOTED 359
-#define MZN_OR_QUOTED 360
-#define MZN_XOR_QUOTED 361
-#define MZN_AND_QUOTED 362
-#define MZN_LE_QUOTED 363
-#define MZN_GR_QUOTED 364
-#define MZN_LQ_QUOTED 365
-#define MZN_GQ_QUOTED 366
-#define MZN_EQ_QUOTED 367
-#define MZN_NQ_QUOTED 368
-#define MZN_IN_QUOTED 369
-#define MZN_SUBSET_QUOTED 370
-#define MZN_SUPERSET_QUOTED 371
-#define MZN_UNION_QUOTED 372
-#define MZN_DIFF_QUOTED 373
-#define MZN_SYMDIFF_QUOTED 374
-#define MZN_DOTDOT_QUOTED 375
-#define MZN_PLUS_QUOTED 376
-#define MZN_MINUS_QUOTED 377
-#define MZN_MULT_QUOTED 378
-#define MZN_DIV_QUOTED 379
-#define MZN_IDIV_QUOTED 380
-#define MZN_MOD_QUOTED 381
-#define MZN_INTERSECT_QUOTED 382
-#define MZN_POW_QUOTED 383
-#define MZN_NOT_QUOTED 384
-#define MZN_COLONCOLON_QUOTED 385
-#define MZN_PLUSPLUS_QUOTED 386
-
-
-
-
-/* Copy the first part of user declarations. */
+#define yyparse mzn_yyparse
+#define yylex mzn_yylex
+#define yyerror mzn_yyerror
+#define yydebug mzn_yydebug
+#define yynerrs mzn_yynerrs
+/* First part of user prologue. */
#define SCANNER static_cast(parm)->yyscanner
#include
@@ -365,11 +94,11 @@ using namespace std;
using namespace MiniZinc;
#define YYLLOC_DEFAULT(Current, Rhs, N) \
- Current.filename(Rhs[1].filename()); \
- Current.first_line(Rhs[1].first_line()); \
- Current.first_column(Rhs[1].first_column()); \
- Current.last_line(Rhs[N].last_line()); \
- Current.last_column(Rhs[N].last_column());
+ (Current).filename(Rhs[1].filename()); \
+ (Current).first_line(Rhs[1].first_line()); \
+ (Current).first_column(Rhs[1].first_column()); \
+ (Current).last_line(Rhs[N].last_line()); \
+ (Current).last_column(Rhs[N].last_column());
int mzn_yyparse(void*);
int mzn_yylex(YYSTYPE*, YYLTYPE*, void* scanner);
@@ -423,100 +152,337 @@ Expression* createArrayAccess(const ParserLocation& loc, Expression* e, std::vec
-/* Enabling traces. */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
+# ifndef YY_CAST
+# ifdef __cplusplus
+# define YY_CAST(Type, Val) static_cast (Val)
+# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val)
+# else
+# define YY_CAST(Type, Val) ((Type) (Val))
+# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
+# endif
+# endif
+# ifndef YY_NULLPTR
+# if defined __cplusplus
+# if 201103L <= __cplusplus
+# define YY_NULLPTR nullptr
+# else
+# define YY_NULLPTR 0
+# endif
+# else
+# define YY_NULLPTR ((void*)0)
+# endif
+# endif
-/* Enabling verbose error messages. */
-#ifdef YYERROR_VERBOSE
-# undef YYERROR_VERBOSE
-# define YYERROR_VERBOSE 1
-#else
-# define YYERROR_VERBOSE 1
-#endif
-
-/* Enabling the token table. */
-#ifndef YYTOKEN_TABLE
-# define YYTOKEN_TABLE 0
-#endif
-
-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE
-
-{ long long int iValue; char* sValue; bool bValue; double dValue;
- MiniZinc::Item* item;
- MiniZinc::VarDecl* vardeclexpr;
- std::vector* vardeclexpr_v;
- MiniZinc::TypeInst* tiexpr;
- std::vector* tiexpr_v;
- MiniZinc::Expression* expression;
- std::vector* expression_v;
- std::vector >* expression_vv;
- std::vector > >* expression_vvv;
- MiniZinc::Generator* generator;
- std::vector* generator_v;
- std::vector* string_v;
- std::vector >* expression_p;
- MiniZinc::Generators* generators;
- }
-/* Line 193 of yacc.c. */
-
- YYSTYPE;
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
-#endif
-
-#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
-typedef struct YYLTYPE
+#include
+/* Symbol kind. */
+enum yysymbol_kind_t
{
- int first_line;
- int first_column;
- int last_line;
- int last_column;
-} YYLTYPE;
-# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
-# define YYLTYPE_IS_DECLARED 1
-# define YYLTYPE_IS_TRIVIAL 1
-#endif
+ YYSYMBOL_YYEMPTY = -2,
+ YYSYMBOL_YYEOF = 0, /* "end of file" */
+ YYSYMBOL_YYerror = 1, /* error */
+ YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
+ YYSYMBOL_MZN_INTEGER_LITERAL = 3, /* "integer literal" */
+ YYSYMBOL_MZN_BOOL_LITERAL = 4, /* "bool literal" */
+ YYSYMBOL_MZN_FLOAT_LITERAL = 5, /* "float literal" */
+ YYSYMBOL_MZN_IDENTIFIER = 6, /* "identifier" */
+ YYSYMBOL_MZN_QUOTED_IDENTIFIER = 7, /* "quoted identifier" */
+ YYSYMBOL_MZN_STRING_LITERAL = 8, /* "string literal" */
+ YYSYMBOL_MZN_STRING_QUOTE_START = 9, /* "interpolated string start" */
+ YYSYMBOL_MZN_STRING_QUOTE_MID = 10, /* "interpolated string middle" */
+ YYSYMBOL_MZN_STRING_QUOTE_END = 11, /* "interpolated string end" */
+ YYSYMBOL_MZN_TI_IDENTIFIER = 12, /* "type-inst identifier" */
+ YYSYMBOL_MZN_TI_ENUM_IDENTIFIER = 13, /* "type-inst enum identifier" */
+ YYSYMBOL_MZN_DOC_COMMENT = 14, /* "documentation comment" */
+ YYSYMBOL_MZN_DOC_FILE_COMMENT = 15, /* "file-level documentation comment" */
+ YYSYMBOL_MZN_VAR = 16, /* "var" */
+ YYSYMBOL_MZN_PAR = 17, /* "par" */
+ YYSYMBOL_MZN_ABSENT = 18, /* "<>" */
+ YYSYMBOL_MZN_ANN = 19, /* "ann" */
+ YYSYMBOL_MZN_ANNOTATION = 20, /* "annotation" */
+ YYSYMBOL_MZN_ANY = 21, /* "any" */
+ YYSYMBOL_MZN_ARRAY = 22, /* "array" */
+ YYSYMBOL_MZN_BOOL = 23, /* "bool" */
+ YYSYMBOL_MZN_CASE = 24, /* "case" */
+ YYSYMBOL_MZN_CONSTRAINT = 25, /* "constraint" */
+ YYSYMBOL_MZN_DEFAULT = 26, /* "default" */
+ YYSYMBOL_MZN_ELSE = 27, /* "else" */
+ YYSYMBOL_MZN_ELSEIF = 28, /* "elseif" */
+ YYSYMBOL_MZN_ENDIF = 29, /* "endif" */
+ YYSYMBOL_MZN_ENUM = 30, /* "enum" */
+ YYSYMBOL_MZN_FLOAT = 31, /* "float" */
+ YYSYMBOL_MZN_FUNCTION = 32, /* "function" */
+ YYSYMBOL_MZN_IF = 33, /* "if" */
+ YYSYMBOL_MZN_INCLUDE = 34, /* "include" */
+ YYSYMBOL_MZN_INFINITY = 35, /* "infinity" */
+ YYSYMBOL_MZN_INT = 36, /* "int" */
+ YYSYMBOL_MZN_LET = 37, /* "let" */
+ YYSYMBOL_MZN_LIST = 38, /* "list" */
+ YYSYMBOL_MZN_MAXIMIZE = 39, /* "maximize" */
+ YYSYMBOL_MZN_MINIMIZE = 40, /* "minimize" */
+ YYSYMBOL_MZN_OF = 41, /* "of" */
+ YYSYMBOL_MZN_OPT = 42, /* "opt" */
+ YYSYMBOL_MZN_SATISFY = 43, /* "satisfy" */
+ YYSYMBOL_MZN_OUTPUT = 44, /* "output" */
+ YYSYMBOL_MZN_PREDICATE = 45, /* "predicate" */
+ YYSYMBOL_MZN_RECORD = 46, /* "record" */
+ YYSYMBOL_MZN_SET = 47, /* "set" */
+ YYSYMBOL_MZN_SOLVE = 48, /* "solve" */
+ YYSYMBOL_MZN_STRING = 49, /* "string" */
+ YYSYMBOL_MZN_TEST = 50, /* "test" */
+ YYSYMBOL_MZN_THEN = 51, /* "then" */
+ YYSYMBOL_MZN_TUPLE = 52, /* "tuple" */
+ YYSYMBOL_MZN_TYPE = 53, /* "type" */
+ YYSYMBOL_MZN_UNDERSCORE = 54, /* "_" */
+ YYSYMBOL_MZN_VARIANT_RECORD = 55, /* "variant_record" */
+ YYSYMBOL_MZN_WHERE = 56, /* "where" */
+ YYSYMBOL_MZN_LEFT_BRACKET = 57, /* "[" */
+ YYSYMBOL_MZN_LEFT_2D_BRACKET = 58, /* "[|" */
+ YYSYMBOL_MZN_RIGHT_BRACKET = 59, /* "]" */
+ YYSYMBOL_MZN_RIGHT_2D_BRACKET = 60, /* "|]" */
+ YYSYMBOL_FLATZINC_IDENTIFIER = 61, /* FLATZINC_IDENTIFIER */
+ YYSYMBOL_MZN_INVALID_INTEGER_LITERAL = 62, /* "invalid integer literal" */
+ YYSYMBOL_MZN_INVALID_FLOAT_LITERAL = 63, /* "invalid float literal" */
+ YYSYMBOL_MZN_UNTERMINATED_STRING = 64, /* "unterminated string" */
+ YYSYMBOL_MZN_END_OF_LINE_IN_STRING = 65, /* "end of line inside string literal" */
+ YYSYMBOL_MZN_INVALID_NULL = 66, /* "null character" */
+ YYSYMBOL_MZN_EQUIV = 67, /* "<->" */
+ YYSYMBOL_MZN_IMPL = 68, /* "->" */
+ YYSYMBOL_MZN_RIMPL = 69, /* "<-" */
+ YYSYMBOL_MZN_OR = 70, /* "\\/" */
+ YYSYMBOL_MZN_XOR = 71, /* "xor" */
+ YYSYMBOL_MZN_AND = 72, /* "/\\" */
+ YYSYMBOL_MZN_LE = 73, /* "<" */
+ YYSYMBOL_MZN_GR = 74, /* ">" */
+ YYSYMBOL_MZN_LQ = 75, /* "<=" */
+ YYSYMBOL_MZN_GQ = 76, /* ">=" */
+ YYSYMBOL_MZN_EQ = 77, /* "=" */
+ YYSYMBOL_MZN_NQ = 78, /* "!=" */
+ YYSYMBOL_MZN_WEAK_EQ = 79, /* "~=" */
+ YYSYMBOL_MZN_IN = 80, /* "in" */
+ YYSYMBOL_MZN_SUBSET = 81, /* "subset" */
+ YYSYMBOL_MZN_SUPERSET = 82, /* "superset" */
+ YYSYMBOL_MZN_UNION = 83, /* "union" */
+ YYSYMBOL_MZN_DIFF = 84, /* "diff" */
+ YYSYMBOL_MZN_SYMDIFF = 85, /* "symdiff" */
+ YYSYMBOL_MZN_DOTDOT = 86, /* ".." */
+ YYSYMBOL_MZN_PLUS = 87, /* "+" */
+ YYSYMBOL_MZN_MINUS = 88, /* "-" */
+ YYSYMBOL_MZN_WEAK_PLUS = 89, /* "~+" */
+ YYSYMBOL_MZN_WEAK_MINUS = 90, /* "~-" */
+ YYSYMBOL_MZN_MULT = 91, /* "*" */
+ YYSYMBOL_MZN_DIV = 92, /* "/" */
+ YYSYMBOL_MZN_IDIV = 93, /* "div" */
+ YYSYMBOL_MZN_MOD = 94, /* "mod" */
+ YYSYMBOL_MZN_INTERSECT = 95, /* "intersect" */
+ YYSYMBOL_MZN_WEAK_MULT = 96, /* "~*" */
+ YYSYMBOL_MZN_POW = 97, /* "^" */
+ YYSYMBOL_MZN_NOT = 98, /* "not" */
+ YYSYMBOL_MZN_PLUSPLUS = 99, /* "++" */
+ YYSYMBOL_MZN_COLONCOLON = 100, /* "::" */
+ YYSYMBOL_PREC_ANNO = 101, /* PREC_ANNO */
+ YYSYMBOL_MZN_EQUIV_QUOTED = 102, /* "'<->'" */
+ YYSYMBOL_MZN_IMPL_QUOTED = 103, /* "'->'" */
+ YYSYMBOL_MZN_RIMPL_QUOTED = 104, /* "'<-'" */
+ YYSYMBOL_MZN_OR_QUOTED = 105, /* "'\\/'" */
+ YYSYMBOL_MZN_XOR_QUOTED = 106, /* "'xor'" */
+ YYSYMBOL_MZN_AND_QUOTED = 107, /* "'/\\'" */
+ YYSYMBOL_MZN_LE_QUOTED = 108, /* "'<'" */
+ YYSYMBOL_MZN_GR_QUOTED = 109, /* "'>'" */
+ YYSYMBOL_MZN_LQ_QUOTED = 110, /* "'<='" */
+ YYSYMBOL_MZN_GQ_QUOTED = 111, /* "'>='" */
+ YYSYMBOL_MZN_EQ_QUOTED = 112, /* "'='" */
+ YYSYMBOL_MZN_NQ_QUOTED = 113, /* "'!='" */
+ YYSYMBOL_MZN_IN_QUOTED = 114, /* "'in'" */
+ YYSYMBOL_MZN_SUBSET_QUOTED = 115, /* "'subset'" */
+ YYSYMBOL_MZN_SUPERSET_QUOTED = 116, /* "'superset'" */
+ YYSYMBOL_MZN_UNION_QUOTED = 117, /* "'union'" */
+ YYSYMBOL_MZN_DIFF_QUOTED = 118, /* "'diff'" */
+ YYSYMBOL_MZN_SYMDIFF_QUOTED = 119, /* "'symdiff'" */
+ YYSYMBOL_MZN_DOTDOT_QUOTED = 120, /* "'..'" */
+ YYSYMBOL_MZN_PLUS_QUOTED = 121, /* "'+'" */
+ YYSYMBOL_MZN_MINUS_QUOTED = 122, /* "'-'" */
+ YYSYMBOL_MZN_MULT_QUOTED = 123, /* "'*'" */
+ YYSYMBOL_MZN_DIV_QUOTED = 124, /* "'/'" */
+ YYSYMBOL_MZN_IDIV_QUOTED = 125, /* "'div'" */
+ YYSYMBOL_MZN_MOD_QUOTED = 126, /* "'mod'" */
+ YYSYMBOL_MZN_INTERSECT_QUOTED = 127, /* "'intersect'" */
+ YYSYMBOL_MZN_POW_QUOTED = 128, /* "'^'" */
+ YYSYMBOL_MZN_NOT_QUOTED = 129, /* "'not'" */
+ YYSYMBOL_MZN_COLONCOLON_QUOTED = 130, /* "'::'" */
+ YYSYMBOL_MZN_PLUSPLUS_QUOTED = 131, /* "'++'" */
+ YYSYMBOL_132_ = 132, /* ';' */
+ YYSYMBOL_133_ = 133, /* '{' */
+ YYSYMBOL_134_ = 134, /* '}' */
+ YYSYMBOL_135_ = 135, /* '(' */
+ YYSYMBOL_136_ = 136, /* ')' */
+ YYSYMBOL_137_ = 137, /* ',' */
+ YYSYMBOL_138_ = 138, /* ':' */
+ YYSYMBOL_139_ = 139, /* '|' */
+ YYSYMBOL_YYACCEPT = 140, /* $accept */
+ YYSYMBOL_model = 141, /* model */
+ YYSYMBOL_item_list = 142, /* item_list */
+ YYSYMBOL_item_list_head = 143, /* item_list_head */
+ YYSYMBOL_doc_file_comments = 144, /* doc_file_comments */
+ YYSYMBOL_semi_or_none = 145, /* semi_or_none */
+ YYSYMBOL_item = 146, /* item */
+ YYSYMBOL_item_tail = 147, /* item_tail */
+ YYSYMBOL_error_item_start = 148, /* error_item_start */
+ YYSYMBOL_include_item = 149, /* include_item */
+ YYSYMBOL_vardecl_item = 150, /* vardecl_item */
+ YYSYMBOL_string_lit_list = 151, /* string_lit_list */
+ YYSYMBOL_enum_id_list = 152, /* enum_id_list */
+ YYSYMBOL_assign_item = 153, /* assign_item */
+ YYSYMBOL_constraint_item = 154, /* constraint_item */
+ YYSYMBOL_solve_item = 155, /* solve_item */
+ YYSYMBOL_output_item = 156, /* output_item */
+ YYSYMBOL_predicate_item = 157, /* predicate_item */
+ YYSYMBOL_function_item = 158, /* function_item */
+ YYSYMBOL_annotation_item = 159, /* annotation_item */
+ YYSYMBOL_operation_item_tail = 160, /* operation_item_tail */
+ YYSYMBOL_params = 161, /* params */
+ YYSYMBOL_params_list = 162, /* params_list */
+ YYSYMBOL_params_list_head = 163, /* params_list_head */
+ YYSYMBOL_comma_or_none = 164, /* comma_or_none */
+ YYSYMBOL_ti_expr_and_id_or_anon = 165, /* ti_expr_and_id_or_anon */
+ YYSYMBOL_ti_expr_and_id = 166, /* ti_expr_and_id */
+ YYSYMBOL_ti_expr_list = 167, /* ti_expr_list */
+ YYSYMBOL_ti_expr_list_head = 168, /* ti_expr_list_head */
+ YYSYMBOL_ti_expr = 169, /* ti_expr */
+ YYSYMBOL_base_ti_expr = 170, /* base_ti_expr */
+ YYSYMBOL_opt_opt = 171, /* opt_opt */
+ YYSYMBOL_base_ti_expr_tail = 172, /* base_ti_expr_tail */
+ YYSYMBOL_array_access_expr_list = 173, /* array_access_expr_list */
+ YYSYMBOL_array_access_expr_list_head = 174, /* array_access_expr_list_head */
+ YYSYMBOL_array_access_expr = 175, /* array_access_expr */
+ YYSYMBOL_expr_list = 176, /* expr_list */
+ YYSYMBOL_expr_list_head = 177, /* expr_list_head */
+ YYSYMBOL_set_expr = 178, /* set_expr */
+ YYSYMBOL_expr = 179, /* expr */
+ YYSYMBOL_expr_atom_head = 180, /* expr_atom_head */
+ YYSYMBOL_expr_atom_head_nonstring = 181, /* expr_atom_head_nonstring */
+ YYSYMBOL_string_expr = 182, /* string_expr */
+ YYSYMBOL_string_quote_rest = 183, /* string_quote_rest */
+ YYSYMBOL_array_access_tail = 184, /* array_access_tail */
+ YYSYMBOL_set_literal = 185, /* set_literal */
+ YYSYMBOL_set_comp = 186, /* set_comp */
+ YYSYMBOL_comp_tail = 187, /* comp_tail */
+ YYSYMBOL_generator_list = 188, /* generator_list */
+ YYSYMBOL_generator_list_head = 189, /* generator_list_head */
+ YYSYMBOL_generator = 190, /* generator */
+ YYSYMBOL_generator_eq = 191, /* generator_eq */
+ YYSYMBOL_id_list = 192, /* id_list */
+ YYSYMBOL_id_list_head = 193, /* id_list_head */
+ YYSYMBOL_simple_array_literal = 194, /* simple_array_literal */
+ YYSYMBOL_simple_array_literal_2d = 195, /* simple_array_literal_2d */
+ YYSYMBOL_simple_array_literal_3d_list = 196, /* simple_array_literal_3d_list */
+ YYSYMBOL_simple_array_literal_2d_list = 197, /* simple_array_literal_2d_list */
+ YYSYMBOL_simple_array_comp = 198, /* simple_array_comp */
+ YYSYMBOL_if_then_else_expr = 199, /* if_then_else_expr */
+ YYSYMBOL_elseif_list = 200, /* elseif_list */
+ YYSYMBOL_quoted_op = 201, /* quoted_op */
+ YYSYMBOL_quoted_op_call = 202, /* quoted_op_call */
+ YYSYMBOL_call_expr = 203, /* call_expr */
+ YYSYMBOL_comp_or_expr = 204, /* comp_or_expr */
+ YYSYMBOL_comp_or_expr_head = 205, /* comp_or_expr_head */
+ YYSYMBOL_let_expr = 206, /* let_expr */
+ YYSYMBOL_let_vardecl_item_list = 207, /* let_vardecl_item_list */
+ YYSYMBOL_comma_or_semi = 208, /* comma_or_semi */
+ YYSYMBOL_let_vardecl_item = 209, /* let_vardecl_item */
+ YYSYMBOL_annotations = 210, /* annotations */
+ YYSYMBOL_annotation_expr = 211, /* annotation_expr */
+ YYSYMBOL_ne_annotations = 212, /* ne_annotations */
+ YYSYMBOL_id_or_quoted_op = 213 /* id_or_quoted_op */
+};
+typedef enum yysymbol_kind_t yysymbol_kind_t;
-/* Copy the second part of user declarations. */
-
-
-/* Line 216 of yacc.c. */
#ifdef short
# undef short
#endif
-#ifdef YYTYPE_UINT8
-typedef YYTYPE_UINT8 yytype_uint8;
-#else
-typedef unsigned char yytype_uint8;
+/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
+ and (if available) are included
+ so that the code can choose integer types of a good width. */
+
+#ifndef __PTRDIFF_MAX__
+# include /* INFRINGES ON USER NAME SPACE */
+# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
+# include /* INFRINGES ON USER NAME SPACE */
+# define YY_STDINT_H
+# endif
#endif
-#ifdef YYTYPE_INT8
-typedef YYTYPE_INT8 yytype_int8;
-#elif (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
+/* Narrow types that promote to a signed type and that can represent a
+ signed or unsigned integer of at least N bits. In tables they can
+ save space and decrease cache pressure. Promoting to a signed type
+ helps avoid bugs in integer arithmetic. */
+
+#ifdef __INT_LEAST8_MAX__
+typedef __INT_LEAST8_TYPE__ yytype_int8;
+#elif defined YY_STDINT_H
+typedef int_least8_t yytype_int8;
+#else
typedef signed char yytype_int8;
-#else
-typedef short int yytype_int8;
#endif
-#ifdef YYTYPE_UINT16
-typedef YYTYPE_UINT16 yytype_uint16;
+#ifdef __INT_LEAST16_MAX__
+typedef __INT_LEAST16_TYPE__ yytype_int16;
+#elif defined YY_STDINT_H
+typedef int_least16_t yytype_int16;
#else
-typedef unsigned short int yytype_uint16;
+typedef short yytype_int16;
#endif
-#ifdef YYTYPE_INT16
-typedef YYTYPE_INT16 yytype_int16;
+/* Work around bug in HP-UX 11.23, which defines these macros
+ incorrectly for preprocessor constants. This workaround can likely
+ be removed in 2023, as HPE has promised support for HP-UX 11.23
+ (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
+ . */
+#ifdef __hpux
+# undef UINT_LEAST8_MAX
+# undef UINT_LEAST16_MAX
+# define UINT_LEAST8_MAX 255
+# define UINT_LEAST16_MAX 65535
+#endif
+
+#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
+typedef __UINT_LEAST8_TYPE__ yytype_uint8;
+#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
+ && UINT_LEAST8_MAX <= INT_MAX)
+typedef uint_least8_t yytype_uint8;
+#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
+typedef unsigned char yytype_uint8;
#else
-typedef short int yytype_int16;
+typedef short yytype_uint8;
+#endif
+
+#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
+typedef __UINT_LEAST16_TYPE__ yytype_uint16;
+#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
+ && UINT_LEAST16_MAX <= INT_MAX)
+typedef uint_least16_t yytype_uint16;
+#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
+typedef unsigned short yytype_uint16;
+#else
+typedef int yytype_uint16;
+#endif
+
+#ifndef YYPTRDIFF_T
+# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
+# define YYPTRDIFF_T __PTRDIFF_TYPE__
+# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
+# elif defined PTRDIFF_MAX
+# ifndef ptrdiff_t
+# include /* INFRINGES ON USER NAME SPACE */
+# endif
+# define YYPTRDIFF_T ptrdiff_t
+# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
+# else
+# define YYPTRDIFF_T long
+# define YYPTRDIFF_MAXIMUM LONG_MAX
+# endif
#endif
#ifndef YYSIZE_T
@@ -524,55 +490,100 @@ typedef short int yytype_int16;
# define YYSIZE_T __SIZE_TYPE__
# elif defined size_t
# define YYSIZE_T size_t
-# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
+# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
# include /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t
# else
-# define YYSIZE_T unsigned int
+# define YYSIZE_T unsigned
# endif
#endif
-#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
+#define YYSIZE_MAXIMUM \
+ YY_CAST (YYPTRDIFF_T, \
+ (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
+ ? YYPTRDIFF_MAXIMUM \
+ : YY_CAST (YYSIZE_T, -1)))
+
+#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
+
+
+/* Stored state numbers (used for stacks). */
+typedef yytype_int16 yy_state_t;
+
+/* State numbers in computations. */
+typedef int yy_state_fast_t;
#ifndef YY_
# if defined YYENABLE_NLS && YYENABLE_NLS
# if ENABLE_NLS
# include /* INFRINGES ON USER NAME SPACE */
-# define YY_(msgid) dgettext ("bison-runtime", msgid)
+# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
# endif
# endif
# ifndef YY_
-# define YY_(msgid) msgid
+# define YY_(Msgid) Msgid
+# endif
+#endif
+
+
+#ifndef YY_ATTRIBUTE_PURE
+# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
+# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
+# else
+# define YY_ATTRIBUTE_PURE
+# endif
+#endif
+
+#ifndef YY_ATTRIBUTE_UNUSED
+# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
+# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
+# else
+# define YY_ATTRIBUTE_UNUSED
# endif
#endif
/* Suppress unused-variable warnings by "using" E. */
#if ! defined lint || defined __GNUC__
-# define YYUSE(e) ((void) (e))
+# define YY_USE(E) ((void) (E))
#else
-# define YYUSE(e) /* empty */
+# define YY_USE(E) /* empty */
#endif
-/* Identity function, used to suppress warnings about constant conditions. */
-#ifndef lint
-# define YYID(n) (n)
+#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
+/* Suppress an incorrect diagnostic about yylval being uninitialized. */
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
+ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
+ _Pragma ("GCC diagnostic pop")
#else
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static int
-YYID (int i)
-#else
-static int
-YYID (i)
- int i;
+# define YY_INITIAL_VALUE(Value) Value
#endif
-{
- return i;
-}
+#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END
+#endif
+#ifndef YY_INITIAL_VALUE
+# define YY_INITIAL_VALUE(Value) /* Nothing. */
#endif
-#if ! defined yyoverflow || YYERROR_VERBOSE
+#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
+# define YY_IGNORE_USELESS_CAST_BEGIN \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
+# define YY_IGNORE_USELESS_CAST_END \
+ _Pragma ("GCC diagnostic pop")
+#endif
+#ifndef YY_IGNORE_USELESS_CAST_BEGIN
+# define YY_IGNORE_USELESS_CAST_BEGIN
+# define YY_IGNORE_USELESS_CAST_END
+#endif
+
+
+#define YY_ASSERT(E) ((void) (0 && (E)))
+
+#if 1
/* The parser invokes alloca or malloc; define the necessary symbols. */
@@ -589,11 +600,11 @@ YYID (i)
# define alloca _alloca
# else
# define YYSTACK_ALLOC alloca
-# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
+# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
# include /* INFRINGES ON USER NAME SPACE */
-# ifndef _STDLIB_H
-# define _STDLIB_H 1
+ /* Use EXIT_SUCCESS as a witness for stdlib.h. */
+# ifndef EXIT_SUCCESS
+# define EXIT_SUCCESS 0
# endif
# endif
# endif
@@ -601,8 +612,8 @@ YYID (i)
# endif
# ifdef YYSTACK_ALLOC
- /* Pacify GCC's `empty if-body' warning. */
-# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
+ /* Pacify GCC's 'empty if-body' warning. */
+# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
# ifndef YYSTACK_ALLOC_MAXIMUM
/* The OS might guarantee only one guard page at the bottom of the stack,
and a page size can be as small as 4096 bytes. So we cannot safely
@@ -616,90 +627,92 @@ YYID (i)
# ifndef YYSTACK_ALLOC_MAXIMUM
# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
# endif
-# if (defined __cplusplus && ! defined _STDLIB_H \
+# if (defined __cplusplus && ! defined EXIT_SUCCESS \
&& ! ((defined YYMALLOC || defined malloc) \
- && (defined YYFREE || defined free)))
+ && (defined YYFREE || defined free)))
# include /* INFRINGES ON USER NAME SPACE */
-# ifndef _STDLIB_H
-# define _STDLIB_H 1
+# ifndef EXIT_SUCCESS
+# define EXIT_SUCCESS 0
# endif
# endif
# ifndef YYMALLOC
# define YYMALLOC malloc
-# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
+# if ! defined malloc && ! defined EXIT_SUCCESS
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
# ifndef YYFREE
# define YYFREE free
-# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
+# if ! defined free && ! defined EXIT_SUCCESS
void free (void *); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
# endif
-#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
-
+#endif /* 1 */
#if (! defined yyoverflow \
&& (! defined __cplusplus \
- || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
- && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
+ || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
+ && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
/* A type that is properly aligned for any stack member. */
union yyalloc
{
- yytype_int16 yyss;
- YYSTYPE yyvs;
- YYLTYPE yyls;
+ yy_state_t yyss_alloc;
+ YYSTYPE yyvs_alloc;
+ YYLTYPE yyls_alloc;
};
/* The size of the maximum gap between one aligned stack and the next. */
-# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
+# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
/* The size of an array large to enough to hold all stacks, each with
N elements. */
# define YYSTACK_BYTES(N) \
- ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
+ ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \
+ + YYSIZEOF (YYLTYPE)) \
+ 2 * YYSTACK_GAP_MAXIMUM)
-/* Copy COUNT objects from FROM to TO. The source and destination do
- not overlap. */
-# ifndef YYCOPY
-# if defined __GNUC__ && 1 < __GNUC__
-# define YYCOPY(To, From, Count) \
- __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
-# else
-# define YYCOPY(To, From, Count) \
- do \
- { \
- YYSIZE_T yyi; \
- for (yyi = 0; yyi < (Count); yyi++) \
- (To)[yyi] = (From)[yyi]; \
- } \
- while (YYID (0))
-# endif
-# endif
+# define YYCOPY_NEEDED 1
/* Relocate STACK from its old location to the new one. The
local variables YYSIZE and YYSTACKSIZE give the old and new number of
elements in the stack, and YYPTR gives the new location of the
stack. Advance YYPTR to a properly aligned location for the next
stack. */
-# define YYSTACK_RELOCATE(Stack) \
- do \
- { \
- YYSIZE_T yynewbytes; \
- YYCOPY (&yyptr->Stack, Stack, yysize); \
- Stack = &yyptr->Stack; \
- yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
- yyptr += yynewbytes / sizeof (*yyptr); \
- } \
- while (YYID (0))
+# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
+ do \
+ { \
+ YYPTRDIFF_T yynewbytes; \
+ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
+ Stack = &yyptr->Stack_alloc; \
+ yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
+ yyptr += yynewbytes / YYSIZEOF (*yyptr); \
+ } \
+ while (0)
#endif
+#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
+/* Copy COUNT objects from SRC to DST. The source and destination do
+ not overlap. */
+# ifndef YYCOPY
+# if defined __GNUC__ && 1 < __GNUC__
+# define YYCOPY(Dst, Src, Count) \
+ __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
+# else
+# define YYCOPY(Dst, Src, Count) \
+ do \
+ { \
+ YYPTRDIFF_T yyi; \
+ for (yyi = 0; yyi < (Count); yyi++) \
+ (Dst)[yyi] = (Src)[yyi]; \
+ } \
+ while (0)
+# endif
+# endif
+#endif /* !YYCOPY_NEEDED */
+
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 157
/* YYLAST -- Last index in YYTABLE. */
@@ -711,17 +724,22 @@ union yyalloc
#define YYNNTS 74
/* YYNRULES -- Number of rules. */
#define YYNRULES 321
-/* YYNRULES -- Number of states. */
+/* YYNSTATES -- Number of states. */
#define YYNSTATES 540
-/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
-#define YYUNDEFTOK 2
+/* YYMAXUTOK -- Last valid token kind. */
#define YYMAXUTOK 386
-#define YYTRANSLATE(YYX) \
- ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
-/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
+/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
+ as returned by yylex, with out-of-bounds checking. */
+#define YYTRANSLATE(YYX) \
+ (0 <= (YYX) && (YYX) <= YYMAXUTOK \
+ ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
+ : YYSYMBOL_YYUNDEF)
+
+/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
+ as returned by yylex. */
static const yytype_uint8 yytranslate[] =
{
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -766,197 +784,58 @@ static const yytype_uint8 yytranslate[] =
};
#if YYDEBUG
-/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
- YYRHS. */
-static const yytype_uint16 yyprhs[] =
+ /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
+static const yytype_int16 yyrline[] =
{
- 0, 0, 3, 5, 6, 9, 11, 14, 18, 23,
- 26, 30, 32, 35, 36, 38, 41, 43, 45, 47,
- 49, 51, 53, 55, 57, 59, 61, 63, 65, 67,
- 69, 71, 73, 75, 77, 79, 82, 85, 90, 93,
- 100, 107, 115, 116, 118, 122, 123, 125, 129, 133,
- 136, 141, 145, 150, 155, 158, 164, 170, 178, 187,
- 191, 197, 198, 201, 202, 206, 210, 211, 214, 216,
- 220, 221, 223, 225, 227, 231, 234, 236, 240, 242,
- 249, 253, 255, 258, 262, 266, 271, 277, 283, 284,
- 286, 288, 290, 292, 294, 296, 298, 300, 302, 305,
- 307, 311, 313, 315, 318, 321, 324, 326, 330, 332,
- 336, 340, 344, 348, 352, 359, 363, 367, 371, 375,
- 379, 383, 387, 391, 395, 399, 403, 407, 411, 415,
- 418, 421, 423, 427, 431, 435, 439, 443, 447, 451,
- 455, 459, 463, 467, 471, 475, 479, 483, 487, 491,
- 495, 499, 503, 510, 514, 518, 522, 526, 530, 534,
- 538, 542, 546, 550, 554, 558, 562, 566, 569, 572,
- 575, 577, 579, 583, 588, 590, 593, 595, 598, 600,
- 602, 604, 606, 608, 610, 613, 615, 618, 620, 623,
- 625, 628, 630, 633, 635, 638, 640, 642, 645, 647,
- 650, 653, 657, 661, 666, 669, 673, 679, 681, 684,
- 686, 688, 692, 696, 700, 706, 710, 716, 720, 723,
- 725, 729, 732, 736, 739, 743, 748, 752, 755, 759,
- 765, 767, 771, 777, 783, 792, 793, 799, 801, 803,
- 805, 807, 809, 811, 813, 815, 817, 819, 821, 823,
- 825, 827, 829, 831, 833, 835, 837, 839, 841, 843,
- 845, 847, 849, 851, 853, 855, 862, 867, 871, 873,
- 878, 886, 889, 891, 895, 899, 905, 912, 920, 922,
- 924, 928, 932, 934, 936, 939, 944, 945, 947, 949,
- 951, 954, 958, 960, 962, 964, 966, 968, 970, 972,
- 974, 976, 978, 980, 982, 984, 986, 988, 990, 992,
- 994, 996, 998, 1000, 1002, 1004, 1006, 1008, 1010, 1012,
- 1014, 1016
-};
-
-/* YYRHS -- A `-1'-separated list of the rules' RHS. */
-static const yytype_int16 yyrhs[] =
-{
- 141, 0, -1, 142, -1, -1, 143, 145, -1, 146,
- -1, 144, 146, -1, 143, 132, 146, -1, 143, 132,
- 144, 146, -1, 146, 148, -1, 1, 132, 146, -1,
- 15, -1, 144, 15, -1, -1, 132, -1, 14, 147,
- -1, 147, -1, 149, -1, 150, -1, 153, -1, 154,
- -1, 155, -1, 156, -1, 157, -1, 158, -1, 159,
- -1, 34, -1, 30, -1, 44, -1, 25, -1, 48,
- -1, 45, -1, 32, -1, 50, -1, 20, -1, 34,
- 8, -1, 166, 210, -1, 166, 210, 77, 179, -1,
- 30, 6, -1, 30, 6, 77, 133, 152, 134, -1,
- 30, 6, 77, 57, 151, 59, -1, 30, 6, 77,
- 6, 135, 179, 136, -1, -1, 8, -1, 151, 137,
- 8, -1, -1, 6, -1, 152, 137, 6, -1, 6,
- 77, 179, -1, 25, 179, -1, 25, 100, 182, 179,
- -1, 48, 210, 43, -1, 48, 210, 40, 179, -1,
- 48, 210, 39, 179, -1, 44, 179, -1, 45, 6,
- 161, 210, 160, -1, 50, 6, 161, 210, 160, -1,
- 32, 169, 138, 213, 161, 210, 160, -1, 169, 138,
- 6, 135, 162, 136, 210, 160, -1, 20, 6, 161,
- -1, 20, 6, 161, 77, 179, -1, -1, 77, 179,
- -1, -1, 135, 162, 136, -1, 135, 1, 136, -1,
- -1, 163, 164, -1, 165, -1, 163, 137, 165, -1,
- -1, 137, -1, 166, -1, 169, -1, 169, 138, 6,
- -1, 168, 164, -1, 169, -1, 168, 137, 169, -1,
- 170, -1, 22, 57, 167, 59, 41, 170, -1, 38,
- 41, 170, -1, 172, -1, 42, 172, -1, 17, 171,
- 172, -1, 16, 171, 172, -1, 171, 47, 41, 172,
- -1, 17, 171, 47, 41, 172, -1, 16, 171, 47,
- 41, 172, -1, -1, 42, -1, 36, -1, 23, -1,
- 31, -1, 49, -1, 19, -1, 178, -1, 12, -1,
- 13, -1, 174, 164, -1, 175, -1, 174, 137, 175,
- -1, 179, -1, 86, -1, 86, 179, -1, 179, 86,
- -1, 177, 164, -1, 179, -1, 177, 137, 179, -1,
- 180, -1, 178, 100, 211, -1, 178, 83, 178, -1,
- 178, 84, 178, -1, 178, 85, 178, -1, 178, 86,
- 178, -1, 120, 135, 179, 137, 179, 136, -1, 178,
- 95, 178, -1, 178, 99, 178, -1, 178, 87, 178,
- -1, 178, 88, 178, -1, 178, 91, 178, -1, 178,
- 92, 178, -1, 178, 93, 178, -1, 178, 94, 178,
- -1, 178, 97, 178, -1, 178, 89, 178, -1, 178,
- 90, 178, -1, 178, 96, 178, -1, 178, 79, 178,
- -1, 178, 7, 178, -1, 87, 178, -1, 88, 178,
- -1, 180, -1, 179, 100, 211, -1, 179, 67, 179,
- -1, 179, 68, 179, -1, 179, 69, 179, -1, 179,
- 70, 179, -1, 179, 71, 179, -1, 179, 72, 179,
- -1, 179, 73, 179, -1, 179, 74, 179, -1, 179,
- 75, 179, -1, 179, 76, 179, -1, 179, 77, 179,
- -1, 179, 78, 179, -1, 179, 80, 179, -1, 179,
- 81, 179, -1, 179, 82, 179, -1, 179, 83, 179,
- -1, 179, 84, 179, -1, 179, 85, 179, -1, 179,
- 86, 179, -1, 120, 135, 179, 137, 179, 136, -1,
- 179, 95, 179, -1, 179, 99, 179, -1, 179, 87,
- 179, -1, 179, 88, 179, -1, 179, 91, 179, -1,
- 179, 92, 179, -1, 179, 93, 179, -1, 179, 94,
- 179, -1, 179, 97, 179, -1, 179, 89, 179, -1,
- 179, 90, 179, -1, 179, 96, 179, -1, 179, 79,
- 179, -1, 179, 7, 179, -1, 98, 179, -1, 87,
- 179, -1, 88, 179, -1, 181, -1, 182, -1, 135,
- 179, 136, -1, 135, 179, 136, 184, -1, 6, -1,
- 6, 184, -1, 54, -1, 54, 184, -1, 4, -1,
- 3, -1, 35, -1, 5, -1, 18, -1, 185, -1,
- 185, 184, -1, 186, -1, 186, 184, -1, 194, -1,
- 194, 184, -1, 195, -1, 195, 184, -1, 198, -1,
- 198, 184, -1, 199, -1, 199, 184, -1, 206, -1,
- 203, -1, 203, 184, -1, 8, -1, 9, 183, -1,
- 177, 11, -1, 177, 10, 183, -1, 57, 173, 59,
- -1, 184, 57, 173, 59, -1, 133, 134, -1, 133,
- 176, 134, -1, 133, 179, 139, 187, 134, -1, 188,
- -1, 189, 164, -1, 190, -1, 191, -1, 191, 56,
- 179, -1, 189, 137, 190, -1, 189, 137, 191, -1,
- 189, 137, 191, 56, 179, -1, 192, 80, 179, -1,
- 192, 80, 179, 56, 179, -1, 6, 77, 179, -1,
- 193, 164, -1, 6, -1, 193, 137, 6, -1, 57,
- 59, -1, 57, 176, 59, -1, 58, 60, -1, 58,
- 197, 60, -1, 58, 197, 139, 60, -1, 58, 196,
- 60, -1, 139, 139, -1, 139, 197, 139, -1, 196,
- 137, 139, 197, 139, -1, 176, -1, 197, 139, 176,
- -1, 57, 179, 139, 187, 59, -1, 33, 179, 51,
- 179, 29, -1, 33, 179, 51, 179, 200, 27, 179,
- 29, -1, -1, 200, 28, 179, 51, 179, -1, 102,
- -1, 103, -1, 104, -1, 105, -1, 106, -1, 107,
- -1, 108, -1, 109, -1, 110, -1, 111, -1, 112,
- -1, 113, -1, 114, -1, 115, -1, 116, -1, 117,
- -1, 118, -1, 119, -1, 121, -1, 122, -1, 123,
- -1, 128, -1, 124, -1, 125, -1, 126, -1, 127,
- -1, 131, -1, 129, -1, 201, 135, 179, 137, 179,
- 136, -1, 201, 135, 179, 136, -1, 6, 135, 136,
- -1, 202, -1, 6, 135, 204, 136, -1, 6, 135,
- 204, 136, 135, 179, 136, -1, 205, 164, -1, 179,
- -1, 179, 56, 179, -1, 205, 137, 179, -1, 205,
- 137, 179, 56, 179, -1, 37, 133, 207, 134, 80,
- 179, -1, 37, 133, 207, 208, 134, 80, 179, -1,
- 209, -1, 154, -1, 207, 208, 209, -1, 207, 208,
- 154, -1, 137, -1, 132, -1, 166, 210, -1, 166,
- 210, 77, 179, -1, -1, 212, -1, 181, -1, 182,
- -1, 100, 211, -1, 212, 100, 211, -1, 6, -1,
- 102, -1, 103, -1, 104, -1, 105, -1, 106, -1,
- 107, -1, 108, -1, 109, -1, 110, -1, 111, -1,
- 112, -1, 113, -1, 114, -1, 115, -1, 116, -1,
- 117, -1, 118, -1, 119, -1, 120, -1, 121, -1,
- 122, -1, 123, -1, 128, -1, 124, -1, 125, -1,
- 126, -1, 127, -1, 129, -1, 131, -1
-};
-
-/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
-static const yytype_uint16 yyrline[] =
-{
- 0, 269, 269, 271, 273, 276, 285, 294, 303, 312,
- 314, 317, 325, 334, 334, 336, 352, 356, 358, 360,
- 361, 363, 365, 367, 369, 371, 374, 374, 374, 375,
- 375, 375, 375, 375, 376, 379, 403, 409, 416, 424,
- 434, 446, 461, 462, 466, 474, 475, 479, 483, 489,
- 491, 498, 503, 508, 515, 519, 527, 537, 544, 553,
- 565, 573, 574, 579, 580, 582, 587, 588, 592, 596,
- 601, 601, 604, 606, 610, 615, 619, 621, 625, 626,
- 632, 641, 644, 652, 660, 669, 678, 687, 700, 701,
- 705, 707, 709, 711, 713, 715, 717, 722, 728, 731,
- 733, 737, 739, 741, 750, 761, 764, 766, 772, 773,
- 775, 777, 779, 781, 790, 799, 801, 803, 805, 807,
- 809, 811, 813, 815, 817, 822, 827, 832, 837, 843,
- 845, 858, 859, 861, 863, 865, 867, 869, 871, 873,
- 875, 877, 879, 881, 883, 885, 887, 889, 891, 893,
- 895, 897, 906, 915, 917, 919, 921, 923, 925, 927,
- 929, 931, 933, 938, 943, 948, 953, 959, 961, 968,
- 980, 982, 986, 988, 990, 992, 995, 997, 1000, 1002,
- 1004, 1006, 1008, 1010, 1011, 1014, 1015, 1018, 1019, 1022,
- 1023, 1026, 1027, 1030, 1031, 1034, 1035, 1036, 1041, 1043,
- 1049, 1054, 1062, 1069, 1078, 1080, 1085, 1091, 1094, 1097,
- 1099, 1101, 1107, 1109, 1111, 1119, 1121, 1124, 1127, 1130,
- 1132, 1136, 1138, 1142, 1144, 1155, 1166, 1206, 1209, 1214,
- 1221, 1226, 1230, 1236, 1243, 1259, 1260, 1264, 1266, 1268,
- 1270, 1272, 1274, 1276, 1278, 1280, 1282, 1284, 1286, 1288,
- 1290, 1292, 1294, 1296, 1298, 1300, 1302, 1304, 1306, 1308,
- 1310, 1312, 1314, 1316, 1318, 1322, 1330, 1362, 1364, 1365,
- 1385, 1440, 1443, 1449, 1455, 1457, 1461, 1468, 1477, 1479,
- 1487, 1489, 1498, 1498, 1501, 1507, 1518, 1519, 1522, 1524,
- 1528, 1532, 1536, 1538, 1540, 1542, 1544, 1546, 1548, 1550,
- 1552, 1554, 1556, 1558, 1560, 1562, 1564, 1566, 1568, 1570,
- 1572, 1574, 1576, 1578, 1580, 1582, 1584, 1586, 1588, 1590,
- 1592, 1594
+ 0, 273, 273, 275, 277, 280, 289, 298, 307, 316,
+ 318, 321, 329, 338, 338, 340, 356, 360, 362, 364,
+ 365, 367, 369, 371, 373, 375, 378, 378, 378, 379,
+ 379, 379, 379, 379, 380, 383, 407, 413, 420, 428,
+ 438, 450, 465, 466, 470, 478, 479, 483, 487, 493,
+ 495, 502, 507, 512, 519, 523, 531, 541, 548, 557,
+ 569, 577, 578, 583, 584, 586, 591, 592, 596, 600,
+ 605, 605, 608, 610, 614, 619, 623, 625, 629, 630,
+ 636, 645, 648, 656, 664, 673, 682, 691, 704, 705,
+ 709, 711, 713, 715, 717, 719, 721, 726, 732, 735,
+ 737, 741, 743, 745, 754, 765, 768, 770, 776, 777,
+ 779, 781, 783, 785, 794, 803, 805, 807, 809, 811,
+ 813, 815, 817, 819, 821, 826, 831, 836, 841, 847,
+ 849, 862, 863, 865, 867, 869, 871, 873, 875, 877,
+ 879, 881, 883, 885, 887, 889, 891, 893, 895, 897,
+ 899, 901, 910, 919, 921, 923, 925, 927, 929, 931,
+ 933, 935, 937, 942, 947, 952, 957, 963, 965, 972,
+ 984, 986, 990, 992, 994, 996, 999, 1001, 1004, 1006,
+ 1008, 1010, 1012, 1014, 1015, 1018, 1019, 1022, 1023, 1026,
+ 1027, 1030, 1031, 1034, 1035, 1038, 1039, 1040, 1045, 1047,
+ 1053, 1058, 1066, 1073, 1082, 1084, 1089, 1095, 1098, 1101,
+ 1103, 1105, 1111, 1113, 1115, 1123, 1125, 1128, 1131, 1134,
+ 1136, 1140, 1142, 1146, 1148, 1159, 1170, 1210, 1213, 1218,
+ 1225, 1230, 1234, 1240, 1247, 1263, 1264, 1268, 1270, 1272,
+ 1274, 1276, 1278, 1280, 1282, 1284, 1286, 1288, 1290, 1292,
+ 1294, 1296, 1298, 1300, 1302, 1304, 1306, 1308, 1310, 1312,
+ 1314, 1316, 1318, 1320, 1322, 1326, 1334, 1366, 1368, 1369,
+ 1389, 1444, 1447, 1453, 1459, 1461, 1465, 1472, 1481, 1483,
+ 1491, 1493, 1502, 1502, 1505, 1511, 1522, 1523, 1526, 1528,
+ 1532, 1536, 1540, 1542, 1544, 1546, 1548, 1550, 1552, 1554,
+ 1556, 1558, 1560, 1562, 1564, 1566, 1568, 1570, 1572, 1574,
+ 1576, 1578, 1580, 1582, 1584, 1586, 1588, 1590, 1592, 1594,
+ 1596, 1598
};
#endif
-#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
+/** Accessing symbol of state STATE. */
+#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
+
+#if 1
+/* The user-facing name of the symbol whose (internal) number is
+ YYSYMBOL. No bounds checking. */
+static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
+
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
{
- "\"end of file\"", "error", "$undefined", "\"integer literal\"",
+ "\"end of file\"", "error", "\"invalid token\"", "\"integer literal\"",
"\"bool literal\"", "\"float literal\"", "\"identifier\"",
"\"quoted identifier\"", "\"string literal\"",
"\"interpolated string start\"", "\"interpolated string middle\"",
@@ -1006,14 +885,20 @@ static const char *const yytname[] =
"elseif_list", "quoted_op", "quoted_op_call", "call_expr",
"comp_or_expr", "comp_or_expr_head", "let_expr", "let_vardecl_item_list",
"comma_or_semi", "let_vardecl_item", "annotations", "annotation_expr",
- "ne_annotations", "id_or_quoted_op", 0
+ "ne_annotations", "id_or_quoted_op", YY_NULLPTR
};
+
+static const char *
+yysymbol_name (yysymbol_kind_t yysymbol)
+{
+ return yytname[yysymbol];
+}
#endif
-# ifdef YYPRINT
-/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
- token YYLEX-NUM. */
-static const yytype_uint16 yytoknum[] =
+#ifdef YYPRINT
+/* YYTOKNUM[NUM] -- (External) token number corresponding to the
+ (internal) symbol number NUM (which must be that of a token). */
+static const yytype_int16 yytoknum[] =
{
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
@@ -1030,161 +915,20 @@ static const yytype_uint16 yytoknum[] =
375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
385, 386, 59, 123, 125, 40, 41, 44, 58, 124
};
-# endif
+#endif
-/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
-static const yytype_uint8 yyr1[] =
-{
- 0, 140, 141, 142, 142, 143, 143, 143, 143, 143,
- 143, 144, 144, 145, 145, 146, 146, 147, 147, 147,
- 147, 147, 147, 147, 147, 147, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 149, 150, 150, 150, 150,
- 150, 150, 151, 151, 151, 152, 152, 152, 153, 154,
- 154, 155, 155, 155, 156, 157, 157, 158, 158, 159,
- 159, 160, 160, 161, 161, 161, 162, 162, 163, 163,
- 164, 164, 165, 165, 166, 167, 168, 168, 169, 169,
- 169, 170, 170, 170, 170, 170, 170, 170, 171, 171,
- 172, 172, 172, 172, 172, 172, 172, 172, 173, 174,
- 174, 175, 175, 175, 175, 176, 177, 177, 178, 178,
- 178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
- 178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
- 178, 179, 179, 179, 179, 179, 179, 179, 179, 179,
- 179, 179, 179, 179, 179, 179, 179, 179, 179, 179,
- 179, 179, 179, 179, 179, 179, 179, 179, 179, 179,
- 179, 179, 179, 179, 179, 179, 179, 179, 179, 179,
- 180, 180, 181, 181, 181, 181, 181, 181, 181, 181,
- 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
- 181, 181, 181, 181, 181, 181, 181, 181, 182, 182,
- 183, 183, 184, 184, 185, 185, 186, 187, 188, 189,
- 189, 189, 189, 189, 189, 190, 190, 191, 192, 193,
- 193, 194, 194, 195, 195, 195, 195, 196, 196, 196,
- 197, 197, 198, 199, 199, 200, 200, 201, 201, 201,
- 201, 201, 201, 201, 201, 201, 201, 201, 201, 201,
- 201, 201, 201, 201, 201, 201, 201, 201, 201, 201,
- 201, 201, 201, 201, 201, 202, 202, 203, 203, 203,
- 203, 204, 205, 205, 205, 205, 206, 206, 207, 207,
- 207, 207, 208, 208, 209, 209, 210, 210, 211, 211,
- 212, 212, 213, 213, 213, 213, 213, 213, 213, 213,
- 213, 213, 213, 213, 213, 213, 213, 213, 213, 213,
- 213, 213, 213, 213, 213, 213, 213, 213, 213, 213,
- 213, 213
-};
+#define YYPACT_NINF (-402)
-/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
-static const yytype_uint8 yyr2[] =
-{
- 0, 2, 1, 0, 2, 1, 2, 3, 4, 2,
- 3, 1, 2, 0, 1, 2, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 2, 2, 4, 2, 6,
- 6, 7, 0, 1, 3, 0, 1, 3, 3, 2,
- 4, 3, 4, 4, 2, 5, 5, 7, 8, 3,
- 5, 0, 2, 0, 3, 3, 0, 2, 1, 3,
- 0, 1, 1, 1, 3, 2, 1, 3, 1, 6,
- 3, 1, 2, 3, 3, 4, 5, 5, 0, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 2, 1,
- 3, 1, 1, 2, 2, 2, 1, 3, 1, 3,
- 3, 3, 3, 3, 6, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 2,
- 2, 1, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 6, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 2, 2, 2,
- 1, 1, 3, 4, 1, 2, 1, 2, 1, 1,
- 1, 1, 1, 1, 2, 1, 2, 1, 2, 1,
- 2, 1, 2, 1, 2, 1, 1, 2, 1, 2,
- 2, 3, 3, 4, 2, 3, 5, 1, 2, 1,
- 1, 3, 3, 3, 5, 3, 5, 3, 2, 1,
- 3, 2, 3, 2, 3, 4, 3, 2, 3, 5,
- 1, 3, 5, 5, 8, 0, 5, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 6, 4, 3, 1, 4,
- 7, 2, 1, 3, 3, 5, 6, 7, 1, 1,
- 3, 3, 1, 1, 2, 4, 0, 1, 1, 1,
- 2, 3, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1
-};
+#define yypact_value_is_default(Yyn) \
+ ((Yyn) == YYPACT_NINF)
-/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
- STATE-NUM when YYTABLE doesn't specify something else to do. Zero
- means the default is an error. */
-static const yytype_uint16 yydefact[] =
-{
- 0, 0, 179, 178, 181, 174, 198, 0, 96, 97,
- 88, 11, 88, 88, 182, 94, 0, 0, 91, 0,
- 0, 92, 88, 0, 0, 180, 90, 0, 0, 89,
- 0, 0, 286, 93, 0, 176, 0, 0, 0, 0,
- 237, 238, 239, 240, 241, 242, 243, 244, 245, 246,
- 247, 248, 249, 250, 251, 252, 253, 254, 0, 255,
- 256, 257, 259, 260, 261, 262, 258, 264, 263, 0,
- 0, 0, 2, 13, 88, 5, 16, 17, 18, 19,
- 20, 21, 22, 23, 24, 25, 286, 0, 78, 0,
- 81, 95, 108, 170, 171, 183, 185, 187, 189, 191,
- 193, 0, 268, 196, 195, 88, 0, 0, 0, 175,
- 174, 0, 0, 0, 0, 0, 106, 131, 199, 15,
- 89, 0, 0, 63, 88, 0, 49, 38, 0, 0,
- 35, 88, 88, 82, 54, 63, 0, 0, 287, 63,
- 177, 221, 0, 70, 106, 223, 0, 230, 0, 0,
- 129, 130, 0, 204, 0, 106, 0, 1, 14, 4,
- 12, 6, 34, 29, 27, 32, 26, 28, 31, 30,
- 33, 9, 36, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 184, 186, 188, 190, 192, 194,
- 0, 197, 10, 102, 0, 70, 99, 101, 48, 267,
- 272, 0, 70, 0, 168, 169, 167, 0, 0, 200,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 84, 0, 83, 0,
- 59, 0, 70, 76, 0, 0, 0, 0, 279, 286,
- 0, 0, 278, 80, 286, 288, 289, 290, 0, 0,
- 51, 0, 286, 222, 71, 105, 0, 227, 0, 226,
- 0, 224, 0, 0, 205, 0, 172, 88, 7, 0,
- 74, 0, 128, 127, 110, 111, 112, 113, 117, 118,
- 124, 125, 119, 120, 121, 122, 115, 126, 123, 116,
- 109, 0, 103, 202, 71, 98, 104, 0, 269, 71,
- 271, 0, 0, 201, 107, 166, 133, 134, 135, 136,
- 137, 138, 139, 140, 141, 142, 143, 144, 165, 145,
- 146, 147, 148, 149, 150, 151, 155, 156, 162, 163,
- 157, 158, 159, 160, 153, 164, 161, 154, 132, 0,
- 0, 0, 0, 70, 68, 72, 73, 0, 0, 71,
- 75, 50, 0, 42, 45, 292, 293, 294, 295, 296,
- 297, 298, 299, 300, 301, 302, 303, 304, 305, 306,
- 307, 308, 309, 310, 311, 312, 313, 314, 316, 317,
- 318, 319, 315, 320, 321, 63, 235, 284, 0, 283,
- 0, 282, 88, 61, 53, 52, 291, 61, 219, 0,
- 207, 70, 209, 210, 0, 70, 228, 0, 225, 231,
- 0, 0, 173, 8, 37, 66, 85, 266, 0, 100,
- 273, 0, 274, 203, 0, 87, 86, 65, 64, 71,
- 67, 60, 88, 77, 0, 43, 0, 46, 0, 286,
- 233, 0, 0, 74, 0, 0, 281, 280, 0, 55,
- 56, 0, 232, 71, 208, 0, 0, 71, 218, 0,
- 0, 206, 0, 0, 0, 0, 0, 69, 79, 0,
- 40, 0, 39, 0, 61, 0, 0, 285, 276, 0,
- 62, 217, 212, 213, 211, 215, 220, 229, 114, 286,
- 265, 270, 275, 152, 41, 44, 47, 57, 0, 0,
- 277, 0, 0, 61, 234, 0, 214, 216, 58, 236
-};
+#define YYTABLE_NINF (-89)
-/* YYDEFGOTO[NTERM-NUM]. */
-static const yytype_int16 yydefgoto[] =
-{
- -1, 71, 72, 73, 74, 159, 75, 76, 171, 77,
- 78, 466, 468, 79, 80, 81, 82, 83, 84, 85,
- 479, 260, 372, 373, 285, 374, 86, 261, 262, 87,
- 88, 89, 90, 204, 205, 206, 147, 143, 91, 116,
- 117, 93, 94, 118, 109, 95, 96, 429, 430, 431,
- 432, 433, 434, 435, 97, 98, 148, 149, 99, 100,
- 471, 101, 102, 103, 211, 212, 104, 271, 422, 272,
- 137, 277, 138, 415
-};
+#define yytable_value_is_error(Yyn) \
+ ((Yyn) == YYTABLE_NINF)
-/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
- STATE-NUM. */
-#define YYPACT_NINF -402
+ /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+ STATE-NUM. */
static const yytype_int16 yypact[] =
{
823, -103, -402, -402, -402, -8, -402, 3485, -402, -402,
@@ -1243,7 +987,68 @@ static const yytype_int16 yypact[] =
4739, 3485, 3485, 166, -402, 3485, 4739, 4739, -402, 4739
};
-/* YYPGOTO[NTERM-NUM]. */
+ /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
+ Performed when YYTABLE does not specify something else to do. Zero
+ means the default is an error. */
+static const yytype_int16 yydefact[] =
+{
+ 0, 0, 179, 178, 181, 174, 198, 0, 96, 97,
+ 88, 11, 88, 88, 182, 94, 0, 0, 91, 0,
+ 0, 92, 88, 0, 0, 180, 90, 0, 0, 89,
+ 0, 0, 286, 93, 0, 176, 0, 0, 0, 0,
+ 237, 238, 239, 240, 241, 242, 243, 244, 245, 246,
+ 247, 248, 249, 250, 251, 252, 253, 254, 0, 255,
+ 256, 257, 259, 260, 261, 262, 258, 264, 263, 0,
+ 0, 0, 2, 13, 88, 5, 16, 17, 18, 19,
+ 20, 21, 22, 23, 24, 25, 286, 0, 78, 0,
+ 81, 95, 108, 170, 171, 183, 185, 187, 189, 191,
+ 193, 0, 268, 196, 195, 88, 0, 0, 0, 175,
+ 174, 0, 0, 0, 0, 0, 106, 131, 199, 15,
+ 89, 0, 0, 63, 88, 0, 49, 38, 0, 0,
+ 35, 88, 88, 82, 54, 63, 0, 0, 287, 63,
+ 177, 221, 0, 70, 106, 223, 0, 230, 0, 0,
+ 129, 130, 0, 204, 0, 106, 0, 1, 14, 4,
+ 12, 6, 34, 29, 27, 32, 26, 28, 31, 30,
+ 33, 9, 36, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 184, 186, 188, 190, 192, 194,
+ 0, 197, 10, 102, 0, 70, 99, 101, 48, 267,
+ 272, 0, 70, 0, 168, 169, 167, 0, 0, 200,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 84, 0, 83, 0,
+ 59, 0, 70, 76, 0, 0, 0, 0, 279, 286,
+ 0, 0, 278, 80, 286, 288, 289, 290, 0, 0,
+ 51, 0, 286, 222, 71, 105, 0, 227, 0, 226,
+ 0, 224, 0, 0, 205, 0, 172, 88, 7, 0,
+ 74, 0, 128, 127, 110, 111, 112, 113, 117, 118,
+ 124, 125, 119, 120, 121, 122, 115, 126, 123, 116,
+ 109, 0, 103, 202, 71, 98, 104, 0, 269, 71,
+ 271, 0, 0, 201, 107, 166, 133, 134, 135, 136,
+ 137, 138, 139, 140, 141, 142, 143, 144, 165, 145,
+ 146, 147, 148, 149, 150, 151, 155, 156, 162, 163,
+ 157, 158, 159, 160, 153, 164, 161, 154, 132, 0,
+ 0, 0, 0, 70, 68, 72, 73, 0, 0, 71,
+ 75, 50, 0, 42, 45, 292, 293, 294, 295, 296,
+ 297, 298, 299, 300, 301, 302, 303, 304, 305, 306,
+ 307, 308, 309, 310, 311, 312, 313, 314, 316, 317,
+ 318, 319, 315, 320, 321, 63, 235, 284, 0, 283,
+ 0, 282, 88, 61, 53, 52, 291, 61, 219, 0,
+ 207, 70, 209, 210, 0, 70, 228, 0, 225, 231,
+ 0, 0, 173, 8, 37, 66, 85, 266, 0, 100,
+ 273, 0, 274, 203, 0, 87, 86, 65, 64, 71,
+ 67, 60, 88, 77, 0, 43, 0, 46, 0, 286,
+ 233, 0, 0, 74, 0, 0, 281, 280, 0, 55,
+ 56, 0, 232, 71, 208, 0, 0, 71, 218, 0,
+ 0, 206, 0, 0, 0, 0, 0, 69, 79, 0,
+ 40, 0, 39, 0, 61, 0, 0, 285, 276, 0,
+ 62, 217, 212, 213, 211, 215, 220, 229, 114, 286,
+ 265, 270, 275, 152, 41, 44, 47, 57, 0, 0,
+ 277, 0, 0, 61, 234, 0, 214, 216, 58, 236
+};
+
+ /* YYPGOTO[NTERM-NUM]. */
static const yytype_int16 yypgoto[] =
{
-402, -402, -402, -402, 117, -402, -62, 267, -402, -402,
@@ -1256,11 +1061,22 @@ static const yytype_int16 yypgoto[] =
-83, -170, -402, -402
};
-/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
- positive, shift that token. If negative, reduce the rule which
- number is the opposite. If zero, do what YYDEFACT says.
- If YYTABLE_NINF, syntax error. */
-#define YYTABLE_NINF -89
+ /* YYDEFGOTO[NTERM-NUM]. */
+static const yytype_int16 yydefgoto[] =
+{
+ 0, 71, 72, 73, 74, 159, 75, 76, 171, 77,
+ 78, 466, 468, 79, 80, 81, 82, 83, 84, 85,
+ 479, 260, 372, 373, 285, 374, 86, 261, 262, 87,
+ 88, 89, 90, 204, 205, 206, 147, 143, 91, 116,
+ 117, 93, 94, 118, 109, 95, 96, 429, 430, 431,
+ 432, 433, 434, 435, 97, 98, 148, 149, 99, 100,
+ 471, 101, 102, 103, 211, 212, 104, 271, 422, 272,
+ 137, 277, 138, 415
+};
+
+ /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
+ positive, shift that token. If negative, reduce the rule whose
+ number is the opposite. If YYTABLE_NINF, syntax error. */
static const yytype_int16 yytable[] =
{
126, 142, 273, 172, 129, 128, 269, 133, 268, 288,
@@ -2281,8 +2097,8 @@ static const yytype_int16 yycheck[] =
92, 93, 94, 95, 96, 97, -1, 99, 100
};
-/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
- symbol of state STATE-NUM. */
+ /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+ symbol of state STATE-NUM. */
static const yytype_uint8 yystos[] =
{
0, 1, 3, 4, 5, 6, 8, 9, 12, 13,
@@ -2341,95 +2157,142 @@ static const yytype_uint8 yystos[] =
179, 56, 56, 210, 29, 51, 179, 179, 160, 179
};
-#define yyerrok (yyerrstatus = 0)
-#define yyclearin (yychar = YYEMPTY)
-#define YYEMPTY (-2)
-#define YYEOF 0
+ /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
+static const yytype_uint8 yyr1[] =
+{
+ 0, 140, 141, 142, 142, 143, 143, 143, 143, 143,
+ 143, 144, 144, 145, 145, 146, 146, 147, 147, 147,
+ 147, 147, 147, 147, 147, 147, 148, 148, 148, 148,
+ 148, 148, 148, 148, 148, 149, 150, 150, 150, 150,
+ 150, 150, 151, 151, 151, 152, 152, 152, 153, 154,
+ 154, 155, 155, 155, 156, 157, 157, 158, 158, 159,
+ 159, 160, 160, 161, 161, 161, 162, 162, 163, 163,
+ 164, 164, 165, 165, 166, 167, 168, 168, 169, 169,
+ 169, 170, 170, 170, 170, 170, 170, 170, 171, 171,
+ 172, 172, 172, 172, 172, 172, 172, 172, 173, 174,
+ 174, 175, 175, 175, 175, 176, 177, 177, 178, 178,
+ 178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
+ 178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
+ 178, 179, 179, 179, 179, 179, 179, 179, 179, 179,
+ 179, 179, 179, 179, 179, 179, 179, 179, 179, 179,
+ 179, 179, 179, 179, 179, 179, 179, 179, 179, 179,
+ 179, 179, 179, 179, 179, 179, 179, 179, 179, 179,
+ 180, 180, 181, 181, 181, 181, 181, 181, 181, 181,
+ 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
+ 181, 181, 181, 181, 181, 181, 181, 181, 182, 182,
+ 183, 183, 184, 184, 185, 185, 186, 187, 188, 189,
+ 189, 189, 189, 189, 189, 190, 190, 191, 192, 193,
+ 193, 194, 194, 195, 195, 195, 195, 196, 196, 196,
+ 197, 197, 198, 199, 199, 200, 200, 201, 201, 201,
+ 201, 201, 201, 201, 201, 201, 201, 201, 201, 201,
+ 201, 201, 201, 201, 201, 201, 201, 201, 201, 201,
+ 201, 201, 201, 201, 201, 202, 202, 203, 203, 203,
+ 203, 204, 205, 205, 205, 205, 206, 206, 207, 207,
+ 207, 207, 208, 208, 209, 209, 210, 210, 211, 211,
+ 212, 212, 213, 213, 213, 213, 213, 213, 213, 213,
+ 213, 213, 213, 213, 213, 213, 213, 213, 213, 213,
+ 213, 213, 213, 213, 213, 213, 213, 213, 213, 213,
+ 213, 213
+};
-#define YYACCEPT goto yyacceptlab
-#define YYABORT goto yyabortlab
-#define YYERROR goto yyerrorlab
+ /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
+static const yytype_int8 yyr2[] =
+{
+ 0, 2, 1, 0, 2, 1, 2, 3, 4, 2,
+ 3, 1, 2, 0, 1, 2, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 2, 2, 4, 2, 6,
+ 6, 7, 0, 1, 3, 0, 1, 3, 3, 2,
+ 4, 3, 4, 4, 2, 5, 5, 7, 8, 3,
+ 5, 0, 2, 0, 3, 3, 0, 2, 1, 3,
+ 0, 1, 1, 1, 3, 2, 1, 3, 1, 6,
+ 3, 1, 2, 3, 3, 4, 5, 5, 0, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 2, 1,
+ 3, 1, 1, 2, 2, 2, 1, 3, 1, 3,
+ 3, 3, 3, 3, 6, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 2,
+ 2, 1, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 6, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 2, 2, 2,
+ 1, 1, 3, 4, 1, 2, 1, 2, 1, 1,
+ 1, 1, 1, 1, 2, 1, 2, 1, 2, 1,
+ 2, 1, 2, 1, 2, 1, 1, 2, 1, 2,
+ 2, 3, 3, 4, 2, 3, 5, 1, 2, 1,
+ 1, 3, 3, 3, 5, 3, 5, 3, 2, 1,
+ 3, 2, 3, 2, 3, 4, 3, 2, 3, 5,
+ 1, 3, 5, 5, 8, 0, 5, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 6, 4, 3, 1, 4,
+ 7, 2, 1, 3, 3, 5, 6, 7, 1, 1,
+ 3, 3, 1, 1, 2, 4, 0, 1, 1, 1,
+ 2, 3, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1
+};
-/* Like YYERROR except do call yyerror. This remains here temporarily
- to ease the transition to the new meaning of YYERROR, for GCC.
- Once GCC version 2 has supplanted version 1, this can go. */
+enum { YYENOMEM = -2 };
+
+#define yyerrok (yyerrstatus = 0)
+#define yyclearin (yychar = YYEMPTY)
+
+#define YYACCEPT goto yyacceptlab
+#define YYABORT goto yyabortlab
+#define YYERROR goto yyerrorlab
-#define YYFAIL goto yyerrlab
#define YYRECOVERING() (!!yyerrstatus)
-#define YYBACKUP(Token, Value) \
-do \
- if (yychar == YYEMPTY && yylen == 1) \
- { \
- yychar = (Token); \
- yylval = (Value); \
- yytoken = YYTRANSLATE (yychar); \
- YYPOPSTACK (1); \
- goto yybackup; \
- } \
- else \
- { \
- yyerror (&yylloc, parm, YY_("syntax error: cannot back up")); \
- YYERROR; \
- } \
-while (YYID (0))
-
-
-#define YYTERROR 1
-#define YYERRCODE 256
+#define YYBACKUP(Token, Value) \
+ do \
+ if (yychar == YYEMPTY) \
+ { \
+ yychar = (Token); \
+ yylval = (Value); \
+ YYPOPSTACK (yylen); \
+ yystate = *yyssp; \
+ goto yybackup; \
+ } \
+ else \
+ { \
+ yyerror (&yylloc, parm, YY_("syntax error: cannot back up")); \
+ YYERROR; \
+ } \
+ while (0)
+/* Backward compatibility with an undocumented macro.
+ Use YYerror or YYUNDEF. */
+#define YYERRCODE YYUNDEF
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
If N is 0, then set CURRENT to the empty location which ends
the previous symbol: RHS[0] (always defined). */
-#define YYRHSLOC(Rhs, K) ((Rhs)[K])
#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N) \
- do \
- if (YYID (N)) \
- { \
- (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
- (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
- (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
- (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
- } \
- else \
- { \
- (Current).first_line = (Current).last_line = \
- YYRHSLOC (Rhs, 0).last_line; \
- (Current).first_column = (Current).last_column = \
- YYRHSLOC (Rhs, 0).last_column; \
- } \
- while (YYID (0))
+# define YYLLOC_DEFAULT(Current, Rhs, N) \
+ do \
+ if (N) \
+ { \
+ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
+ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
+ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
+ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
+ } \
+ else \
+ { \
+ (Current).first_line = (Current).last_line = \
+ YYRHSLOC (Rhs, 0).last_line; \
+ (Current).first_column = (Current).last_column = \
+ YYRHSLOC (Rhs, 0).last_column; \
+ } \
+ while (0)
#endif
+#define YYRHSLOC(Rhs, K) ((Rhs)[K])
-/* YY_LOCATION_PRINT -- Print the location on the stream.
- This macro was not mandated originally: define only if we know
- we won't break user code: when these are the locations we know. */
-
-#ifndef YY_LOCATION_PRINT
-# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
-# define YY_LOCATION_PRINT(File, Loc) \
- fprintf (File, "%d.%d-%d.%d", \
- (Loc).first_line, (Loc).first_column, \
- (Loc).last_line, (Loc).last_column)
-# else
-# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
-# endif
-#endif
-
-
-/* YYLEX -- calling `yylex' with the right arguments. */
-
-#ifdef YYLEX_PARAM
-# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
-#else
-# define YYLEX yylex (&yylval, &yylloc, SCANNER)
-#endif
/* Enable debugging if requested. */
#if YYDEBUG
@@ -2439,88 +2302,108 @@ while (YYID (0))
# define YYFPRINTF fprintf
# endif
-# define YYDPRINTF(Args) \
-do { \
- if (yydebug) \
- YYFPRINTF Args; \
-} while (YYID (0))
-
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
-do { \
- if (yydebug) \
- { \
- YYFPRINTF (stderr, "%s ", Title); \
- yy_symbol_print (stderr, \
- Type, Value, Location, parm); \
- YYFPRINTF (stderr, "\n"); \
- } \
-} while (YYID (0))
+# define YYDPRINTF(Args) \
+do { \
+ if (yydebug) \
+ YYFPRINTF Args; \
+} while (0)
-/*--------------------------------.
-| Print this symbol on YYOUTPUT. |
-`--------------------------------*/
+/* YY_LOCATION_PRINT -- Print the location on the stream.
+ This macro was not mandated originally: define only if we know
+ we won't break user code: when these are the locations we know. */
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static void
-yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, void *parm)
-#else
-static void
-yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, parm)
- FILE *yyoutput;
- int yytype;
- YYSTYPE const * const yyvaluep;
- YYLTYPE const * const yylocationp;
- void *parm;
-#endif
+# ifndef YY_LOCATION_PRINT
+# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
+
+/* Print *YYLOCP on YYO. Private, do not rely on its existence. */
+
+YY_ATTRIBUTE_UNUSED
+static int
+yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
{
+ int res = 0;
+ int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
+ if (0 <= yylocp->first_line)
+ {
+ res += YYFPRINTF (yyo, "%d", yylocp->first_line);
+ if (0 <= yylocp->first_column)
+ res += YYFPRINTF (yyo, ".%d", yylocp->first_column);
+ }
+ if (0 <= yylocp->last_line)
+ {
+ if (yylocp->first_line < yylocp->last_line)
+ {
+ res += YYFPRINTF (yyo, "-%d", yylocp->last_line);
+ if (0 <= end_col)
+ res += YYFPRINTF (yyo, ".%d", end_col);
+ }
+ else if (0 <= end_col && yylocp->first_column < end_col)
+ res += YYFPRINTF (yyo, "-%d", end_col);
+ }
+ return res;
+ }
+
+# define YY_LOCATION_PRINT(File, Loc) \
+ yy_location_print_ (File, &(Loc))
+
+# else
+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+# endif
+# endif /* !defined YY_LOCATION_PRINT */
+
+
+# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
+do { \
+ if (yydebug) \
+ { \
+ YYFPRINTF (stderr, "%s ", Title); \
+ yy_symbol_print (stderr, \
+ Kind, Value, Location, parm); \
+ YYFPRINTF (stderr, "\n"); \
+ } \
+} while (0)
+
+
+/*-----------------------------------.
+| Print this symbol's value on YYO. |
+`-----------------------------------*/
+
+static void
+yy_symbol_value_print (FILE *yyo,
+ yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, void *parm)
+{
+ FILE *yyoutput = yyo;
+ YY_USE (yyoutput);
+ YY_USE (yylocationp);
+ YY_USE (parm);
if (!yyvaluep)
return;
- YYUSE (yylocationp);
- YYUSE (parm);
# ifdef YYPRINT
- if (yytype < YYNTOKENS)
- YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# else
- YYUSE (yyoutput);
+ if (yykind < YYNTOKENS)
+ YYPRINT (yyo, yytoknum[yykind], *yyvaluep);
# endif
- switch (yytype)
- {
- default:
- break;
- }
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+ YY_USE (yykind);
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
}
-/*--------------------------------.
-| Print this symbol on YYOUTPUT. |
-`--------------------------------*/
+/*---------------------------.
+| Print this symbol on YYO. |
+`---------------------------*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
static void
-yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, void *parm)
-#else
-static void
-yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, parm)
- FILE *yyoutput;
- int yytype;
- YYSTYPE const * const yyvaluep;
- YYLTYPE const * const yylocationp;
- void *parm;
-#endif
+yy_symbol_print (FILE *yyo,
+ yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, void *parm)
{
- if (yytype < YYNTOKENS)
- YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
- else
- YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+ YYFPRINTF (yyo, "%s %s (",
+ yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
- YY_LOCATION_PRINT (yyoutput, *yylocationp);
- YYFPRINTF (yyoutput, ": ");
- yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, parm);
- YYFPRINTF (yyoutput, ")");
+ YY_LOCATION_PRINT (yyo, *yylocationp);
+ YYFPRINTF (yyo, ": ");
+ yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp, parm);
+ YYFPRINTF (yyo, ")");
}
/*------------------------------------------------------------------.
@@ -2528,82 +2411,69 @@ yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, parm)
| TOP (included). |
`------------------------------------------------------------------*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
static void
-yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
-#else
-static void
-yy_stack_print (bottom, top)
- yytype_int16 *bottom;
- yytype_int16 *top;
-#endif
+yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
{
YYFPRINTF (stderr, "Stack now");
- for (; bottom <= top; ++bottom)
- YYFPRINTF (stderr, " %d", *bottom);
+ for (; yybottom <= yytop; yybottom++)
+ {
+ int yybot = *yybottom;
+ YYFPRINTF (stderr, " %d", yybot);
+ }
YYFPRINTF (stderr, "\n");
}
-# define YY_STACK_PRINT(Bottom, Top) \
-do { \
- if (yydebug) \
- yy_stack_print ((Bottom), (Top)); \
-} while (YYID (0))
+# define YY_STACK_PRINT(Bottom, Top) \
+do { \
+ if (yydebug) \
+ yy_stack_print ((Bottom), (Top)); \
+} while (0)
/*------------------------------------------------.
| Report that the YYRULE is going to be reduced. |
`------------------------------------------------*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
static void
-yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, void *parm)
-#else
-static void
-yy_reduce_print (yyvsp, yylsp, yyrule, parm)
- YYSTYPE *yyvsp;
- YYLTYPE *yylsp;
- int yyrule;
- void *parm;
-#endif
+yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp,
+ int yyrule, void *parm)
{
+ int yylno = yyrline[yyrule];
int yynrhs = yyr2[yyrule];
int yyi;
- unsigned long int yylno = yyrline[yyrule];
- YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
- yyrule - 1, yylno);
+ YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
+ yyrule - 1, yylno);
/* The symbols being reduced. */
for (yyi = 0; yyi < yynrhs; yyi++)
{
- fprintf (stderr, " $%d = ", yyi + 1);
- yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
- &(yyvsp[(yyi + 1) - (yynrhs)])
- , &(yylsp[(yyi + 1) - (yynrhs)]) , parm);
- fprintf (stderr, "\n");
+ YYFPRINTF (stderr, " $%d = ", yyi + 1);
+ yy_symbol_print (stderr,
+ YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
+ &yyvsp[(yyi + 1) - (yynrhs)],
+ &(yylsp[(yyi + 1) - (yynrhs)]), parm);
+ YYFPRINTF (stderr, "\n");
}
}
-# define YY_REDUCE_PRINT(Rule) \
-do { \
- if (yydebug) \
- yy_reduce_print (yyvsp, yylsp, Rule, parm); \
-} while (YYID (0))
+# define YY_REDUCE_PRINT(Rule) \
+do { \
+ if (yydebug) \
+ yy_reduce_print (yyssp, yyvsp, yylsp, Rule, parm); \
+} while (0)
/* Nonzero means print parse trace. It is left uninitialized so that
multiple parsers can coexist. */
int yydebug;
#else /* !YYDEBUG */
-# define YYDPRINTF(Args)
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
+# define YYDPRINTF(Args) ((void) 0)
+# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
# define YY_STACK_PRINT(Bottom, Top)
# define YY_REDUCE_PRINT(Rule)
#endif /* !YYDEBUG */
/* YYINITDEPTH -- initial size of the parser's stacks. */
-#ifndef YYINITDEPTH
+#ifndef YYINITDEPTH
# define YYINITDEPTH 200
#endif
@@ -2618,49 +2488,82 @@ int yydebug;
# define YYMAXDEPTH 10000
#endif
-
-#if YYERROR_VERBOSE
-
-# ifndef yystrlen
-# if defined __GLIBC__ && defined _STRING_H
-# define yystrlen strlen
-# else
-/* Return the length of YYSTR. */
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static YYSIZE_T
-yystrlen (const char *yystr)
-#else
-static YYSIZE_T
-yystrlen (yystr)
- const char *yystr;
-#endif
+/* Context of a parse error. */
+typedef struct
{
- YYSIZE_T yylen;
+ yy_state_t *yyssp;
+ yysymbol_kind_t yytoken;
+ YYLTYPE *yylloc;
+} yypcontext_t;
+
+/* Put in YYARG at most YYARGN of the expected tokens given the
+ current YYCTX, and return the number of tokens stored in YYARG. If
+ YYARG is null, return the number of expected tokens (guaranteed to
+ be less than YYNTOKENS). Return YYENOMEM on memory exhaustion.
+ Return 0 if there are more than YYARGN expected tokens, yet fill
+ YYARG up to YYARGN. */
+static int
+yypcontext_expected_tokens (const yypcontext_t *yyctx,
+ yysymbol_kind_t yyarg[], int yyargn)
+{
+ /* Actual size of YYARG. */
+ int yycount = 0;
+ int yyn = yypact[+*yyctx->yyssp];
+ if (!yypact_value_is_default (yyn))
+ {
+ /* Start YYX at -YYN if negative to avoid negative indexes in
+ YYCHECK. In other words, skip the first -YYN actions for
+ this state because they are default actions. */
+ int yyxbegin = yyn < 0 ? -yyn : 0;
+ /* Stay within bounds of both yycheck and yytname. */
+ int yychecklim = YYLAST - yyn + 1;
+ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+ int yyx;
+ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+ if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror
+ && !yytable_value_is_error (yytable[yyx + yyn]))
+ {
+ if (!yyarg)
+ ++yycount;
+ else if (yycount == yyargn)
+ return 0;
+ else
+ yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx);
+ }
+ }
+ if (yyarg && yycount == 0 && 0 < yyargn)
+ yyarg[0] = YYSYMBOL_YYEMPTY;
+ return yycount;
+}
+
+
+
+
+#ifndef yystrlen
+# if defined __GLIBC__ && defined _STRING_H
+# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
+# else
+/* Return the length of YYSTR. */
+static YYPTRDIFF_T
+yystrlen (const char *yystr)
+{
+ YYPTRDIFF_T yylen;
for (yylen = 0; yystr[yylen]; yylen++)
continue;
return yylen;
}
-# endif
# endif
+#endif
-# ifndef yystpcpy
-# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
-# define yystpcpy stpcpy
-# else
+#ifndef yystpcpy
+# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
+# define yystpcpy stpcpy
+# else
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
YYDEST. */
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
static char *
yystpcpy (char *yydest, const char *yysrc)
-#else
-static char *
-yystpcpy (yydest, yysrc)
- char *yydest;
- const char *yysrc;
-#endif
{
char *yyd = yydest;
const char *yys = yysrc;
@@ -2670,10 +2573,10 @@ yystpcpy (yydest, yysrc)
return yyd - 1;
}
-# endif
# endif
+#endif
-# ifndef yytnamerr
+#ifndef yytnamerr
/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
quotes and backslashes, so that it's suitable for yyerror. The
heuristic is that double-quoting is unnecessary unless the string
@@ -2681,207 +2584,202 @@ yystpcpy (yydest, yysrc)
backslash-backslash). YYSTR is taken from yytname. If YYRES is
null, do not copy; instead, return the length of what the result
would have been. */
-static YYSIZE_T
+static YYPTRDIFF_T
yytnamerr (char *yyres, const char *yystr)
{
if (*yystr == '"')
{
- YYSIZE_T yyn = 0;
+ YYPTRDIFF_T yyn = 0;
char const *yyp = yystr;
-
for (;;)
- switch (*++yyp)
- {
- case '\'':
- case ',':
- goto do_not_strip_quotes;
+ switch (*++yyp)
+ {
+ case '\'':
+ case ',':
+ goto do_not_strip_quotes;
- case '\\':
- if (*++yyp != '\\')
- goto do_not_strip_quotes;
- /* Fall through. */
- default:
- if (yyres)
- yyres[yyn] = *yyp;
- yyn++;
- break;
+ case '\\':
+ if (*++yyp != '\\')
+ goto do_not_strip_quotes;
+ else
+ goto append;
- case '"':
- if (yyres)
- yyres[yyn] = '\0';
- return yyn;
- }
+ append:
+ default:
+ if (yyres)
+ yyres[yyn] = *yyp;
+ yyn++;
+ break;
+
+ case '"':
+ if (yyres)
+ yyres[yyn] = '\0';
+ return yyn;
+ }
do_not_strip_quotes: ;
}
- if (! yyres)
- return yystrlen (yystr);
-
- return yystpcpy (yyres, yystr) - yyres;
-}
-# endif
-
-/* Copy into YYRESULT an error message about the unexpected token
- YYCHAR while in state YYSTATE. Return the number of bytes copied,
- including the terminating null byte. If YYRESULT is null, do not
- copy anything; just return the number of bytes that would be
- copied. As a special case, return 0 if an ordinary "syntax error"
- message will do. Return YYSIZE_MAXIMUM if overflow occurs during
- size calculation. */
-static YYSIZE_T
-yysyntax_error (char *yyresult, int yystate, int yychar)
-{
- int yyn = yypact[yystate];
-
- if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
- return 0;
+ if (yyres)
+ return yystpcpy (yyres, yystr) - yyres;
else
- {
- int yytype = YYTRANSLATE (yychar);
- YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
- YYSIZE_T yysize = yysize0;
- YYSIZE_T yysize1;
- int yysize_overflow = 0;
- enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
- char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
- int yyx;
-
-# if 0
- /* This is so xgettext sees the translatable formats that are
- constructed on the fly. */
- YY_("syntax error, unexpected %s");
- YY_("syntax error, unexpected %s, expecting %s");
- YY_("syntax error, unexpected %s, expecting %s or %s");
- YY_("syntax error, unexpected %s, expecting %s or %s or %s");
- YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
-# endif
- char *yyfmt;
- char const *yyf;
- static char const yyunexpected[] = "syntax error, unexpected %s";
- static char const yyexpecting[] = ", expecting %s";
- static char const yyor[] = " or %s";
- char yyformat[sizeof yyunexpected
- + sizeof yyexpecting - 1
- + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
- * (sizeof yyor - 1))];
- char const *yyprefix = yyexpecting;
-
- /* Start YYX at -YYN if negative to avoid negative indexes in
- YYCHECK. */
- int yyxbegin = yyn < 0 ? -yyn : 0;
-
- /* Stay within bounds of both yycheck and yytname. */
- int yychecklim = YYLAST - yyn + 1;
- int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
- int yycount = 1;
-
- yyarg[0] = yytname[yytype];
- yyfmt = yystpcpy (yyformat, yyunexpected);
-
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
- {
- if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
- {
- yycount = 1;
- yysize = yysize0;
- yyformat[sizeof yyunexpected - 1] = '\0';
- break;
- }
- yyarg[yycount++] = yytname[yyx];
- yysize1 = yysize + yytnamerr (0, yytname[yyx]);
- yysize_overflow |= (yysize1 < yysize);
- yysize = yysize1;
- yyfmt = yystpcpy (yyfmt, yyprefix);
- yyprefix = yyor;
- }
-
- yyf = YY_(yyformat);
- yysize1 = yysize + yystrlen (yyf);
- yysize_overflow |= (yysize1 < yysize);
- yysize = yysize1;
-
- if (yysize_overflow)
- return YYSIZE_MAXIMUM;
-
- if (yyresult)
- {
- /* Avoid sprintf, as that infringes on the user's name space.
- Don't have undefined behavior even if the translation
- produced a string with the wrong number of "%s"s. */
- char *yyp = yyresult;
- int yyi = 0;
- while ((*yyp = *yyf) != '\0')
- {
- if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
- {
- yyp += yytnamerr (yyp, yyarg[yyi++]);
- yyf += 2;
- }
- else
- {
- yyp++;
- yyf++;
- }
- }
- }
- return yysize;
- }
+ return yystrlen (yystr);
}
-#endif /* YYERROR_VERBOSE */
-
+#endif
+
+
+static int
+yy_syntax_error_arguments (const yypcontext_t *yyctx,
+ yysymbol_kind_t yyarg[], int yyargn)
+{
+ /* Actual size of YYARG. */
+ int yycount = 0;
+ /* There are many possibilities here to consider:
+ - If this state is a consistent state with a default action, then
+ the only way this function was invoked is if the default action
+ is an error action. In that case, don't check for expected
+ tokens because there are none.
+ - The only way there can be no lookahead present (in yychar) is if
+ this state is a consistent state with a default action. Thus,
+ detecting the absence of a lookahead is sufficient to determine
+ that there is no unexpected or expected token to report. In that
+ case, just report a simple "syntax error".
+ - Don't assume there isn't a lookahead just because this state is a
+ consistent state with a default action. There might have been a
+ previous inconsistent state, consistent state with a non-default
+ action, or user semantic action that manipulated yychar.
+ - Of course, the expected token list depends on states to have
+ correct lookahead information, and it depends on the parser not
+ to perform extra reductions after fetching a lookahead from the
+ scanner and before detecting a syntax error. Thus, state merging
+ (from LALR or IELR) and default reductions corrupt the expected
+ token list. However, the list is correct for canonical LR with
+ one exception: it will still contain any token that will not be
+ accepted due to an error action in a later state.
+ */
+ if (yyctx->yytoken != YYSYMBOL_YYEMPTY)
+ {
+ int yyn;
+ if (yyarg)
+ yyarg[yycount] = yyctx->yytoken;
+ ++yycount;
+ yyn = yypcontext_expected_tokens (yyctx,
+ yyarg ? yyarg + 1 : yyarg, yyargn - 1);
+ if (yyn == YYENOMEM)
+ return YYENOMEM;
+ else
+ yycount += yyn;
+ }
+ return yycount;
+}
+
+/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
+ about the unexpected token YYTOKEN for the state stack whose top is
+ YYSSP.
+
+ Return 0 if *YYMSG was successfully written. Return -1 if *YYMSG is
+ not large enough to hold the message. In that case, also set
+ *YYMSG_ALLOC to the required number of bytes. Return YYENOMEM if the
+ required number of bytes is too large to store. */
+static int
+yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
+ const yypcontext_t *yyctx)
+{
+ enum { YYARGS_MAX = 5 };
+ /* Internationalized format string. */
+ const char *yyformat = YY_NULLPTR;
+ /* Arguments of yyformat: reported tokens (one for the "unexpected",
+ one per "expected"). */
+ yysymbol_kind_t yyarg[YYARGS_MAX];
+ /* Cumulated lengths of YYARG. */
+ YYPTRDIFF_T yysize = 0;
+
+ /* Actual size of YYARG. */
+ int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX);
+ if (yycount == YYENOMEM)
+ return YYENOMEM;
+
+ switch (yycount)
+ {
+#define YYCASE_(N, S) \
+ case N: \
+ yyformat = S; \
+ break
+ default: /* Avoid compiler warnings. */
+ YYCASE_(0, YY_("syntax error"));
+ YYCASE_(1, YY_("syntax error, unexpected %s"));
+ YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
+ YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
+ YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
+ YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
+#undef YYCASE_
+ }
+
+ /* Compute error message size. Don't count the "%s"s, but reserve
+ room for the terminator. */
+ yysize = yystrlen (yyformat) - 2 * yycount + 1;
+ {
+ int yyi;
+ for (yyi = 0; yyi < yycount; ++yyi)
+ {
+ YYPTRDIFF_T yysize1
+ = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]);
+ if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
+ yysize = yysize1;
+ else
+ return YYENOMEM;
+ }
+ }
+
+ if (*yymsg_alloc < yysize)
+ {
+ *yymsg_alloc = 2 * yysize;
+ if (! (yysize <= *yymsg_alloc
+ && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
+ *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
+ return -1;
+ }
+
+ /* Avoid sprintf, as that infringes on the user's name space.
+ Don't have undefined behavior even if the translation
+ produced a string with the wrong number of "%s"s. */
+ {
+ char *yyp = *yymsg;
+ int yyi = 0;
+ while ((*yyp = *yyformat) != '\0')
+ if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
+ {
+ yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]);
+ yyformat += 2;
+ }
+ else
+ {
+ ++yyp;
+ ++yyformat;
+ }
+ }
+ return 0;
+}
+
/*-----------------------------------------------.
| Release the memory associated to this symbol. |
`-----------------------------------------------*/
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
static void
-yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, void *parm)
-#else
-static void
-yydestruct (yymsg, yytype, yyvaluep, yylocationp, parm)
- const char *yymsg;
- int yytype;
- YYSTYPE *yyvaluep;
- YYLTYPE *yylocationp;
- void *parm;
-#endif
+yydestruct (const char *yymsg,
+ yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, void *parm)
{
- YYUSE (yyvaluep);
- YYUSE (yylocationp);
- YYUSE (parm);
-
+ YY_USE (yyvaluep);
+ YY_USE (yylocationp);
+ YY_USE (parm);
if (!yymsg)
yymsg = "Deleting";
- YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
+ YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
- switch (yytype)
- {
-
- default:
- break;
- }
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+ YY_USE (yykind);
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
}
-
-
-/* Prevent warnings from -Wmissing-prototypes. */
-
-#ifdef YYPARSE_PARAM
-#if defined __STDC__ || defined __cplusplus
-int yyparse (void *YYPARSE_PARAM);
-#else
-int yyparse ();
-#endif
-#else /* ! YYPARSE_PARAM */
-#if defined __STDC__ || defined __cplusplus
-int yyparse (void *parm);
-#else
-int yyparse ();
-#endif
-#endif /* ! YYPARSE_PARAM */
@@ -2892,231 +2790,226 @@ int yyparse ();
| yyparse. |
`----------*/
-#ifdef YYPARSE_PARAM
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-int
-yyparse (void *YYPARSE_PARAM)
-#else
-int
-yyparse (YYPARSE_PARAM)
- void *YYPARSE_PARAM;
-#endif
-#else /* ! YYPARSE_PARAM */
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
int
yyparse (void *parm)
-#else
-int
-yyparse (parm)
- void *parm;
-#endif
-#endif
{
- /* The look-ahead symbol. */
+/* Lookahead token kind. */
int yychar;
-/* The semantic value of the look-ahead symbol. */
-YYSTYPE yylval;
-/* Number of syntax errors so far. */
-int yynerrs;
-/* Location data for the look-ahead symbol. */
-YYLTYPE yylloc;
+/* The semantic value of the lookahead symbol. */
+/* Default value used for initialization, for pacifying older GCCs
+ or non-GCC compilers. */
+YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
+YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
+
+/* Location data for the lookahead symbol. */
+static YYLTYPE yyloc_default
+# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
+ = { 1, 1, 1, 1 }
+# endif
+;
+YYLTYPE yylloc = yyloc_default;
+
+ /* Number of syntax errors so far. */
+ int yynerrs = 0;
+
+ yy_state_fast_t yystate = 0;
+ /* Number of tokens to shift before error messages enabled. */
+ int yyerrstatus = 0;
+
+ /* Refer to the stacks through separate pointers, to allow yyoverflow
+ to reallocate them elsewhere. */
+
+ /* Their size. */
+ YYPTRDIFF_T yystacksize = YYINITDEPTH;
+
+ /* The state stack: array, bottom, top. */
+ yy_state_t yyssa[YYINITDEPTH];
+ yy_state_t *yyss = yyssa;
+ yy_state_t *yyssp = yyss;
+
+ /* The semantic value stack: array, bottom, top. */
+ YYSTYPE yyvsa[YYINITDEPTH];
+ YYSTYPE *yyvs = yyvsa;
+ YYSTYPE *yyvsp = yyvs;
+
+ /* The location stack: array, bottom, top. */
+ YYLTYPE yylsa[YYINITDEPTH];
+ YYLTYPE *yyls = yylsa;
+ YYLTYPE *yylsp = yyls;
- int yystate;
int yyn;
+ /* The return value of yyparse. */
int yyresult;
- /* Number of tokens to shift before error messages enabled. */
- int yyerrstatus;
- /* Look-ahead token as an internal (translated) token number. */
- int yytoken = 0;
-#if YYERROR_VERBOSE
- /* Buffer for error messages, and its allocated size. */
- char yymsgbuf[128];
- char *yymsg = yymsgbuf;
- YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
-#endif
-
- /* Three stacks and their tools:
- `yyss': related to states,
- `yyvs': related to semantic values,
- `yyls': related to locations.
-
- Refer to the stacks thru separate pointers, to allow yyoverflow
- to reallocate them elsewhere. */
-
- /* The state stack. */
- yytype_int16 yyssa[YYINITDEPTH];
- yytype_int16 *yyss = yyssa;
- yytype_int16 *yyssp;
-
- /* The semantic value stack. */
- YYSTYPE yyvsa[YYINITDEPTH];
- YYSTYPE *yyvs = yyvsa;
- YYSTYPE *yyvsp;
-
- /* The location stack. */
- YYLTYPE yylsa[YYINITDEPTH];
- YYLTYPE *yyls = yylsa;
- YYLTYPE *yylsp;
- /* The locations where the error started and ended. */
- YYLTYPE yyerror_range[2];
-
-#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
-
- YYSIZE_T yystacksize = YYINITDEPTH;
-
+ /* Lookahead symbol kind. */
+ yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
/* The variables used to return semantic value and location from the
action routines. */
YYSTYPE yyval;
YYLTYPE yyloc;
+ /* The locations where the error started and ended. */
+ YYLTYPE yyerror_range[3];
+
+ /* Buffer for error messages, and its allocated size. */
+ char yymsgbuf[128];
+ char *yymsg = yymsgbuf;
+ YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
+
+#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
+
/* The number of symbols on the RHS of the reduced rule.
Keep to zero when no symbol should be popped. */
int yylen = 0;
YYDPRINTF ((stderr, "Starting parse\n"));
- yystate = 0;
- yyerrstatus = 0;
- yynerrs = 0;
- yychar = YYEMPTY; /* Cause a token to be read. */
-
- /* Initialize stack pointers.
- Waste one element of value and location stack
- so that they stay on the same level as the state stack.
- The wasted elements are never initialized. */
-
- yyssp = yyss;
- yyvsp = yyvs;
- yylsp = yyls;
-#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
- /* Initialize the default location before parsing starts. */
- yylloc.first_line = yylloc.last_line = 1;
- yylloc.first_column = yylloc.last_column = 0;
-#endif
-
-
- /* User initialization code. */
+ yychar = YYEMPTY; /* Cause a token to be read. */
+/* User initialization code. */
{
GCLock lock;
yylloc.filename(ASTString(static_cast(parm)->filename));
}
-/* Line 1078 of yacc.c. */
+
yylsp[0] = yylloc;
goto yysetstate;
+
/*------------------------------------------------------------.
-| yynewstate -- Push a new state, which is found in yystate. |
+| yynewstate -- push a new state, which is found in yystate. |
`------------------------------------------------------------*/
- yynewstate:
+yynewstate:
/* In all cases, when you get here, the value and location stacks
have just been pushed. So pushing a state here evens the stacks. */
yyssp++;
- yysetstate:
- *yyssp = yystate;
+
+/*--------------------------------------------------------------------.
+| yysetstate -- set current state (the top of the stack) to yystate. |
+`--------------------------------------------------------------------*/
+yysetstate:
+ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+ YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
+ YY_IGNORE_USELESS_CAST_BEGIN
+ *yyssp = YY_CAST (yy_state_t, yystate);
+ YY_IGNORE_USELESS_CAST_END
+ YY_STACK_PRINT (yyss, yyssp);
if (yyss + yystacksize - 1 <= yyssp)
+#if !defined yyoverflow && !defined YYSTACK_RELOCATE
+ goto yyexhaustedlab;
+#else
{
/* Get the current used size of the three stacks, in elements. */
- YYSIZE_T yysize = yyssp - yyss + 1;
+ YYPTRDIFF_T yysize = yyssp - yyss + 1;
-#ifdef yyoverflow
+# if defined yyoverflow
{
- /* Give user a chance to reallocate the stack. Use copies of
- these so that the &'s don't force the real ones into
- memory. */
- YYSTYPE *yyvs1 = yyvs;
- yytype_int16 *yyss1 = yyss;
- YYLTYPE *yyls1 = yyls;
+ /* Give user a chance to reallocate the stack. Use copies of
+ these so that the &'s don't force the real ones into
+ memory. */
+ yy_state_t *yyss1 = yyss;
+ YYSTYPE *yyvs1 = yyvs;
+ YYLTYPE *yyls1 = yyls;
- /* Each stack pointer address is followed by the size of the
- data in use in that stack, in bytes. This used to be a
- conditional around just the two extra args, but that might
- be undefined if yyoverflow is a macro. */
- yyoverflow (YY_("memory exhausted"),
- &yyss1, yysize * sizeof (*yyssp),
- &yyvs1, yysize * sizeof (*yyvsp),
- &yyls1, yysize * sizeof (*yylsp),
- &yystacksize);
- yyls = yyls1;
- yyss = yyss1;
- yyvs = yyvs1;
+ /* Each stack pointer address is followed by the size of the
+ data in use in that stack, in bytes. This used to be a
+ conditional around just the two extra args, but that might
+ be undefined if yyoverflow is a macro. */
+ yyoverflow (YY_("memory exhausted"),
+ &yyss1, yysize * YYSIZEOF (*yyssp),
+ &yyvs1, yysize * YYSIZEOF (*yyvsp),
+ &yyls1, yysize * YYSIZEOF (*yylsp),
+ &yystacksize);
+ yyss = yyss1;
+ yyvs = yyvs1;
+ yyls = yyls1;
}
-#else /* no yyoverflow */
-# ifndef YYSTACK_RELOCATE
- goto yyexhaustedlab;
-# else
+# else /* defined YYSTACK_RELOCATE */
/* Extend the stack our own way. */
if (YYMAXDEPTH <= yystacksize)
- goto yyexhaustedlab;
+ goto yyexhaustedlab;
yystacksize *= 2;
if (YYMAXDEPTH < yystacksize)
- yystacksize = YYMAXDEPTH;
+ yystacksize = YYMAXDEPTH;
{
- yytype_int16 *yyss1 = yyss;
- union yyalloc *yyptr =
- (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
- if (! yyptr)
- goto yyexhaustedlab;
- YYSTACK_RELOCATE (yyss);
- YYSTACK_RELOCATE (yyvs);
- YYSTACK_RELOCATE (yyls);
+ yy_state_t *yyss1 = yyss;
+ union yyalloc *yyptr =
+ YY_CAST (union yyalloc *,
+ YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
+ if (! yyptr)
+ goto yyexhaustedlab;
+ YYSTACK_RELOCATE (yyss_alloc, yyss);
+ YYSTACK_RELOCATE (yyvs_alloc, yyvs);
+ YYSTACK_RELOCATE (yyls_alloc, yyls);
# undef YYSTACK_RELOCATE
- if (yyss1 != yyssa)
- YYSTACK_FREE (yyss1);
+ if (yyss1 != yyssa)
+ YYSTACK_FREE (yyss1);
}
# endif
-#endif /* no yyoverflow */
yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1;
yylsp = yyls + yysize - 1;
- YYDPRINTF ((stderr, "Stack size increased to %lu\n",
- (unsigned long int) yystacksize));
+ YY_IGNORE_USELESS_CAST_BEGIN
+ YYDPRINTF ((stderr, "Stack size increased to %ld\n",
+ YY_CAST (long, yystacksize)));
+ YY_IGNORE_USELESS_CAST_END
if (yyss + yystacksize - 1 <= yyssp)
- YYABORT;
+ YYABORT;
}
+#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
- YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+ if (yystate == YYFINAL)
+ YYACCEPT;
goto yybackup;
+
/*-----------.
| yybackup. |
`-----------*/
yybackup:
-
/* Do appropriate processing given the current state. Read a
- look-ahead token if we need one and don't already have one. */
+ lookahead token if we need one and don't already have one. */
- /* First try to decide what to do without reference to look-ahead token. */
+ /* First try to decide what to do without reference to lookahead token. */
yyn = yypact[yystate];
- if (yyn == YYPACT_NINF)
+ if (yypact_value_is_default (yyn))
goto yydefault;
- /* Not known => get a look-ahead token if don't already have one. */
+ /* Not known => get a lookahead token if don't already have one. */
- /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
+ /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
if (yychar == YYEMPTY)
{
- YYDPRINTF ((stderr, "Reading a token: "));
- yychar = YYLEX;
+ YYDPRINTF ((stderr, "Reading a token\n"));
+ yychar = yylex (&yylval, &yylloc, SCANNER);
}
- if (yychar <= YYEOF)
+ if (yychar <= END)
{
- yychar = yytoken = YYEOF;
+ yychar = END;
+ yytoken = YYSYMBOL_YYEOF;
YYDPRINTF ((stderr, "Now at end of input.\n"));
}
+ else if (yychar == YYerror)
+ {
+ /* The scanner already issued an error message, process directly
+ to error recovery. But do not keep the error token as
+ lookahead, it is too special and may lead us to an endless
+ loop in error recovery. */
+ yychar = YYUNDEF;
+ yytoken = YYSYMBOL_YYerror;
+ yyerror_range[1] = yylloc;
+ goto yyerrlab1;
+ }
else
{
yytoken = YYTRANSLATE (yychar);
@@ -3131,30 +3024,27 @@ yybackup:
yyn = yytable[yyn];
if (yyn <= 0)
{
- if (yyn == 0 || yyn == YYTABLE_NINF)
- goto yyerrlab;
+ if (yytable_value_is_error (yyn))
+ goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
- if (yyn == YYFINAL)
- YYACCEPT;
-
/* Count tokens shifted since error; after three, turn off error
status. */
if (yyerrstatus)
yyerrstatus--;
- /* Shift the look-ahead token. */
+ /* Shift the lookahead token. */
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
-
- /* Discard the shifted token unless it is eof. */
- if (yychar != YYEOF)
- yychar = YYEMPTY;
-
yystate = yyn;
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
*++yyvsp = yylval;
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
*++yylsp = yylloc;
+
+ /* Discard the shifted token. */
+ yychar = YYEMPTY;
goto yynewstate;
@@ -3169,14 +3059,14 @@ yydefault:
/*-----------------------------.
-| yyreduce -- Do a reduction. |
+| yyreduce -- do a reduction. |
`-----------------------------*/
yyreduce:
/* yyn is the number of a rule to reduce with. */
yylen = yyr2[yyn];
/* If YYLEN is nonzero, implement the default value of the action:
- `$$ = $1'.
+ '$$ = $1'.
Otherwise, the following line sets YYVAL to garbage.
This behavior is undocumented and Bison
@@ -3185,1627 +3075,1396 @@ yyreduce:
GCC warning that YYVAL may be used uninitialized. */
yyval = yyvsp[1-yylen];
- /* Default location. */
+ /* Default location. */
YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
+ yyerror_range[1] = yyloc;
YY_REDUCE_PRINT (yyn);
switch (yyn)
{
- case 5:
-
- {
+ case 5: /* item_list_head: item */
+ {
ParserState* pp = static_cast(parm);
- if ((yyvsp[(1) - (1)].item)) {
- pp->model->addItem((yyvsp[(1) - (1)].item));
+ if ((yyvsp[0].item)) {
+ pp->model->addItem((yyvsp[0].item));
GC::unlock();
GC::lock();
}
- ;}
+ }
break;
- case 6:
-
- {
+ case 6: /* item_list_head: doc_file_comments item */
+ {
ParserState* pp = static_cast(parm);
- if ((yyvsp[(2) - (2)].item)) {
- pp->model->addItem((yyvsp[(2) - (2)].item));
+ if ((yyvsp[0].item)) {
+ pp->model->addItem((yyvsp[0].item));
GC::unlock();
GC::lock();
}
- ;}
+ }
break;
- case 7:
-
- {
+ case 7: /* item_list_head: item_list_head ';' item */
+ {
ParserState* pp = static_cast(parm);
- if ((yyvsp[(3) - (3)].item)) {
- pp->model->addItem((yyvsp[(3) - (3)].item));
+ if ((yyvsp[0].item)) {
+ pp->model->addItem((yyvsp[0].item));
GC::unlock();
GC::lock();
}
- ;}
+ }
break;
- case 8:
-
- {
+ case 8: /* item_list_head: item_list_head ';' doc_file_comments item */
+ {
ParserState* pp = static_cast(parm);
- if ((yyvsp[(4) - (4)].item)) {
- pp->model->addItem((yyvsp[(4) - (4)].item));
+ if ((yyvsp[0].item)) {
+ pp->model->addItem((yyvsp[0].item));
GC::unlock();
GC::lock();
}
- ;}
+ }
break;
- case 9:
-
- { yyerror(&(yylsp[(2) - (2)]), parm, "unexpected item, expecting ';' or end of file"); YYERROR; ;}
+ case 9: /* item_list_head: item error_item_start */
+{ yyerror(&(yylsp[0]), parm, "unexpected item, expecting ';' or end of file"); YYERROR; }
break;
- case 11:
-
- {
+ case 11: /* doc_file_comments: "file-level documentation comment" */
+ {
ParserState* pp = static_cast(parm);
- if (pp->parseDocComments && (yyvsp[(1) - (1)].sValue)) {
- pp->model->addDocComment((yyvsp[(1) - (1)].sValue));
+ if (pp->parseDocComments && (yyvsp[0].sValue)) {
+ pp->model->addDocComment((yyvsp[0].sValue));
}
- free((yyvsp[(1) - (1)].sValue));
- ;}
+ free((yyvsp[0].sValue));
+ }
break;
- case 12:
-
- {
+ case 12: /* doc_file_comments: doc_file_comments "file-level documentation comment" */
+ {
ParserState* pp = static_cast(parm);
- if (pp->parseDocComments && (yyvsp[(2) - (2)].sValue)) {
- pp->model->addDocComment((yyvsp[(2) - (2)].sValue));
+ if (pp->parseDocComments && (yyvsp[0].sValue)) {
+ pp->model->addDocComment((yyvsp[0].sValue));
}
- free((yyvsp[(2) - (2)].sValue));
- ;}
+ free((yyvsp[0].sValue));
+ }
break;
- case 15:
-
- { (yyval.item) = (yyvsp[(2) - (2)].item);
+ case 15: /* item: "documentation comment" item_tail */
+ { (yyval.item) = (yyvsp[0].item);
ParserState* pp = static_cast(parm);
if (FunctionI* fi = Item::dyn_cast((yyval.item))) {
if (pp->parseDocComments) {
- fi->ann().add(createDocComment((yylsp[(1) - (2)]),(yyvsp[(1) - (2)].sValue)));
+ fi->ann().add(createDocComment((yylsp[-1]),(yyvsp[-1].sValue)));
}
} else if (VarDeclI* vdi = Item::dyn_cast((yyval.item))) {
if (pp->parseDocComments) {
- vdi->e()->addAnnotation(createDocComment((yylsp[(1) - (2)]),(yyvsp[(1) - (2)].sValue)));
+ vdi->e()->addAnnotation(createDocComment((yylsp[-1]),(yyvsp[-1].sValue)));
}
} else {
- yyerror(&(yylsp[(2) - (2)]), parm, "documentation comments are only supported for function, predicate and variable declarations");
+ yyerror(&(yylsp[0]), parm, "documentation comments are only supported for function, predicate and variable declarations");
}
- free((yyvsp[(1) - (2)].sValue));
- ;}
+ free((yyvsp[-1].sValue));
+ }
break;
- case 16:
-
- { (yyval.item) = (yyvsp[(1) - (1)].item); ;}
+ case 16: /* item: item_tail */
+ { (yyval.item) = (yyvsp[0].item); }
break;
- case 17:
-
- { (yyval.item)=notInDatafile(&(yyloc),parm,"include") ? (yyvsp[(1) - (1)].item) : NULL; ;}
+ case 17: /* item_tail: include_item */
+ { (yyval.item)=notInDatafile(&(yyloc),parm,"include") ? (yyvsp[0].item) : NULL; }
break;
- case 18:
-
- { (yyval.item)=notInDatafile(&(yyloc),parm,"variable declaration") ? (yyvsp[(1) - (1)].item) : NULL; ;}
+ case 18: /* item_tail: vardecl_item */
+ { (yyval.item)=notInDatafile(&(yyloc),parm,"variable declaration") ? (yyvsp[0].item) : NULL; }
break;
- case 20:
-
- { (yyval.item)=notInDatafile(&(yyloc),parm,"constraint") ? (yyvsp[(1) - (1)].item) : NULL; ;}
+ case 20: /* item_tail: constraint_item */
+ { (yyval.item)=notInDatafile(&(yyloc),parm,"constraint") ? (yyvsp[0].item) : NULL; }
break;
- case 21:
-
- { (yyval.item)=notInDatafile(&(yyloc),parm,"solve") ? (yyvsp[(1) - (1)].item) : NULL; ;}
+ case 21: /* item_tail: solve_item */
+ { (yyval.item)=notInDatafile(&(yyloc),parm,"solve") ? (yyvsp[0].item) : NULL; }
break;
- case 22:
-
- { (yyval.item)=notInDatafile(&(yyloc),parm,"output") ? (yyvsp[(1) - (1)].item) : NULL; ;}
+ case 22: /* item_tail: output_item */
+ { (yyval.item)=notInDatafile(&(yyloc),parm,"output") ? (yyvsp[0].item) : NULL; }
break;
- case 23:
-
- { (yyval.item)=notInDatafile(&(yyloc),parm,"predicate") ? (yyvsp[(1) - (1)].item) : NULL; ;}
+ case 23: /* item_tail: predicate_item */
+ { (yyval.item)=notInDatafile(&(yyloc),parm,"predicate") ? (yyvsp[0].item) : NULL; }
break;
- case 24:
-
- { (yyval.item)=notInDatafile(&(yyloc),parm,"predicate") ? (yyvsp[(1) - (1)].item) : NULL; ;}
+ case 24: /* item_tail: function_item */
+ { (yyval.item)=notInDatafile(&(yyloc),parm,"predicate") ? (yyvsp[0].item) : NULL; }
break;
- case 25:
-
- { (yyval.item)=notInDatafile(&(yyloc),parm,"annotation") ? (yyvsp[(1) - (1)].item) : NULL; ;}
+ case 25: /* item_tail: annotation_item */
+ { (yyval.item)=notInDatafile(&(yyloc),parm,"annotation") ? (yyvsp[0].item) : NULL; }
break;
- case 35:
-
- { ParserState* pp = static_cast(parm);
- map::iterator ret = pp->seenModels.find((yyvsp[(2) - (2)].sValue));
- IncludeI* ii = new IncludeI((yyloc),ASTString((yyvsp[(2) - (2)].sValue)));
+ case 35: /* include_item: "include" "string literal" */
+ { ParserState* pp = static_cast(parm);
+ map::iterator ret = pp->seenModels.find((yyvsp[0].sValue));
+ IncludeI* ii = new IncludeI((yyloc),ASTString((yyvsp[0].sValue)));
(yyval.item) = ii;
if (ret == pp->seenModels.end()) {
Model* im = new Model;
im->setParent(pp->model);
- im->setFilename((yyvsp[(2) - (2)].sValue));
+ im->setFilename((yyvsp[0].sValue));
string fpath = FileUtils::dir_name(pp->filename);
string fbase = FileUtils::base_name(pp->filename);
if (fpath=="")
fpath="./";
- ParseWorkItem pm(im, ii, fpath, (yyvsp[(2) - (2)].sValue));
+ ParseWorkItem pm(im, ii, fpath, (yyvsp[0].sValue));
pp->files.push_back(pm);
ii->m(im);
- pp->seenModels.insert(pair((yyvsp[(2) - (2)].sValue),im));
+ pp->seenModels.insert(pair((yyvsp[0].sValue),im));
} else {
ii->m(ret->second, false);
}
- free((yyvsp[(2) - (2)].sValue));
- ;}
+ free((yyvsp[0].sValue));
+ }
break;
- case 36:
-
- { if ((yyvsp[(1) - (2)].vardeclexpr) && (yyvsp[(2) - (2)].expression_v)) (yyvsp[(1) - (2)].vardeclexpr)->addAnnotations(*(yyvsp[(2) - (2)].expression_v));
- if ((yyvsp[(1) - (2)].vardeclexpr))
- (yyval.item) = new VarDeclI((yyloc),(yyvsp[(1) - (2)].vardeclexpr));
- delete (yyvsp[(2) - (2)].expression_v);
- ;}
+ case 36: /* vardecl_item: ti_expr_and_id annotations */
+ { if ((yyvsp[-1].vardeclexpr) && (yyvsp[0].expression_v)) (yyvsp[-1].vardeclexpr)->addAnnotations(*(yyvsp[0].expression_v));
+ if ((yyvsp[-1].vardeclexpr))
+ (yyval.item) = new VarDeclI((yyloc),(yyvsp[-1].vardeclexpr));
+ delete (yyvsp[0].expression_v);
+ }
break;
- case 37:
-
- { if ((yyvsp[(1) - (4)].vardeclexpr)) (yyvsp[(1) - (4)].vardeclexpr)->e((yyvsp[(4) - (4)].expression));
- if ((yyvsp[(1) - (4)].vardeclexpr) && (yyvsp[(2) - (4)].expression_v)) (yyvsp[(1) - (4)].vardeclexpr)->addAnnotations(*(yyvsp[(2) - (4)].expression_v));
- if ((yyvsp[(1) - (4)].vardeclexpr))
- (yyval.item) = new VarDeclI((yyloc),(yyvsp[(1) - (4)].vardeclexpr));
- delete (yyvsp[(2) - (4)].expression_v);
- ;}
+ case 37: /* vardecl_item: ti_expr_and_id annotations "=" expr */
+ { if ((yyvsp[-3].vardeclexpr)) (yyvsp[-3].vardeclexpr)->e((yyvsp[0].expression));
+ if ((yyvsp[-3].vardeclexpr) && (yyvsp[-2].expression_v)) (yyvsp[-3].vardeclexpr)->addAnnotations(*(yyvsp[-2].expression_v));
+ if ((yyvsp[-3].vardeclexpr))
+ (yyval.item) = new VarDeclI((yyloc),(yyvsp[-3].vardeclexpr));
+ delete (yyvsp[-2].expression_v);
+ }
break;
- case 38:
-
- {
+ case 38: /* vardecl_item: "enum" "identifier" */
+ {
TypeInst* ti = new TypeInst((yyloc),Type::parsetint());
ti->setIsEnum(true);
- VarDecl* vd = new VarDecl((yyloc),ti,(yyvsp[(2) - (2)].sValue));
- free((yyvsp[(2) - (2)].sValue));
+ VarDecl* vd = new VarDecl((yyloc),ti,(yyvsp[0].sValue));
+ free((yyvsp[0].sValue));
(yyval.item) = new VarDeclI((yyloc),vd);
- ;}
+ }
break;
- case 39:
-
- {
+ case 39: /* vardecl_item: "enum" "identifier" "=" '{' enum_id_list '}' */
+ {
TypeInst* ti = new TypeInst((yyloc),Type::parsetint());
ti->setIsEnum(true);
- SetLit* sl = new SetLit((yyloc), *(yyvsp[(5) - (6)].expression_v));
- VarDecl* vd = new VarDecl((yyloc),ti,(yyvsp[(2) - (6)].sValue),sl);
- free((yyvsp[(2) - (6)].sValue));
- delete (yyvsp[(5) - (6)].expression_v);
+ SetLit* sl = new SetLit((yyloc), *(yyvsp[-1].expression_v));
+ VarDecl* vd = new VarDecl((yyloc),ti,(yyvsp[-4].sValue),sl);
+ free((yyvsp[-4].sValue));
+ delete (yyvsp[-1].expression_v);
(yyval.item) = new VarDeclI((yyloc),vd);
- ;}
+ }
break;
- case 40:
-
- {
+ case 40: /* vardecl_item: "enum" "identifier" "=" "[" string_lit_list "]" */
+ {
TypeInst* ti = new TypeInst((yyloc),Type::parsetint());
ti->setIsEnum(true);
vector args;
- args.push_back(new ArrayLit((yyloc),*(yyvsp[(5) - (6)].expression_v)));
+ args.push_back(new ArrayLit((yyloc),*(yyvsp[-1].expression_v)));
Call* sl = new Call((yyloc), constants().ids.anonEnumFromStrings, args);
- VarDecl* vd = new VarDecl((yyloc),ti,(yyvsp[(2) - (6)].sValue),sl);
- free((yyvsp[(2) - (6)].sValue));
- delete (yyvsp[(5) - (6)].expression_v);
+ VarDecl* vd = new VarDecl((yyloc),ti,(yyvsp[-4].sValue),sl);
+ free((yyvsp[-4].sValue));
+ delete (yyvsp[-1].expression_v);
(yyval.item) = new VarDeclI((yyloc),vd);
- ;}
+ }
break;
- case 41:
-
- {
+ case 41: /* vardecl_item: "enum" "identifier" "=" "identifier" '(' expr ')' */
+ {
TypeInst* ti = new TypeInst((yyloc),Type::parsetint());
ti->setIsEnum(true);
vector args;
- args.push_back((yyvsp[(6) - (7)].expression));
- Call* sl = new Call((yyloc), ASTString((yyvsp[(4) - (7)].sValue)), args);
- VarDecl* vd = new VarDecl((yyloc),ti,(yyvsp[(2) - (7)].sValue),sl);
- free((yyvsp[(2) - (7)].sValue));
- free((yyvsp[(4) - (7)].sValue));
+ args.push_back((yyvsp[-1].expression));
+ Call* sl = new Call((yyloc), ASTString((yyvsp[-3].sValue)), args);
+ VarDecl* vd = new VarDecl((yyloc),ti,(yyvsp[-5].sValue),sl);
+ free((yyvsp[-5].sValue));
+ free((yyvsp[-3].sValue));
(yyval.item) = new VarDeclI((yyloc),vd);
- ;}
+ }
break;
- case 42:
-
- { (yyval.expression_v) = new std::vector(); ;}
+ case 42: /* string_lit_list: %empty */
+ { (yyval.expression_v) = new std::vector(); }
break;
- case 43:
-
- { (yyval.expression_v) = new std::vector();
- (yyval.expression_v)->push_back(new StringLit((yyloc), (yyvsp[(1) - (1)].sValue))); free((yyvsp[(1) - (1)].sValue));
- ;}
+ case 43: /* string_lit_list: "string literal" */
+ { (yyval.expression_v) = new std::vector();
+ (yyval.expression_v)->push_back(new StringLit((yyloc), (yyvsp[0].sValue))); free((yyvsp[0].sValue));
+ }
break;
- case 44:
-
- { (yyval.expression_v) = (yyvsp[(1) - (3)].expression_v);
- if ((yyval.expression_v)) (yyval.expression_v)->push_back(new StringLit((yyloc), (yyvsp[(3) - (3)].sValue)));
- free((yyvsp[(3) - (3)].sValue));
- ;}
+ case 44: /* string_lit_list: string_lit_list ',' "string literal" */
+ { (yyval.expression_v) = (yyvsp[-2].expression_v);
+ if ((yyval.expression_v)) (yyval.expression_v)->push_back(new StringLit((yyloc), (yyvsp[0].sValue)));
+ free((yyvsp[0].sValue));
+ }
break;
- case 45:
-
- { (yyval.expression_v) = new std::vector(); ;}
+ case 45: /* enum_id_list: %empty */
+ { (yyval.expression_v) = new std::vector(); }
break;
- case 46:
-
- { (yyval.expression_v) = new std::vector();
- (yyval.expression_v)->push_back(new Id((yyloc),(yyvsp[(1) - (1)].sValue),NULL)); free((yyvsp[(1) - (1)].sValue));
- ;}
+ case 46: /* enum_id_list: "identifier" */
+ { (yyval.expression_v) = new std::vector();
+ (yyval.expression_v)->push_back(new Id((yyloc),(yyvsp[0].sValue),NULL)); free((yyvsp[0].sValue));
+ }
break;
- case 47:
-
- { (yyval.expression_v) = (yyvsp[(1) - (3)].expression_v); if ((yyval.expression_v)) (yyval.expression_v)->push_back(new Id((yyloc),(yyvsp[(3) - (3)].sValue),NULL)); free((yyvsp[(3) - (3)].sValue)); ;}
+ case 47: /* enum_id_list: enum_id_list ',' "identifier" */
+ { (yyval.expression_v) = (yyvsp[-2].expression_v); if ((yyval.expression_v)) (yyval.expression_v)->push_back(new Id((yyloc),(yyvsp[0].sValue),NULL)); free((yyvsp[0].sValue)); }
break;
- case 48:
-
- { (yyval.item) = new AssignI((yyloc),(yyvsp[(1) - (3)].sValue),(yyvsp[(3) - (3)].expression));
- free((yyvsp[(1) - (3)].sValue));
- ;}
+ case 48: /* assign_item: "identifier" "=" expr */
+ { (yyval.item) = new AssignI((yyloc),(yyvsp[-2].sValue),(yyvsp[0].expression));
+ free((yyvsp[-2].sValue));
+ }
break;
- case 49:
-
- { (yyval.item) = new ConstraintI((yyloc),(yyvsp[(2) - (2)].expression));;}
+ case 49: /* constraint_item: "constraint" expr */
+ { (yyval.item) = new ConstraintI((yyloc),(yyvsp[0].expression));}
break;
- case 50:
-
- { (yyval.item) = new ConstraintI((yyloc),(yyvsp[(4) - (4)].expression));
- if ((yyvsp[(4) - (4)].expression) && (yyvsp[(3) - (4)].expression))
- (yyval.item)->cast()->e()->ann().add(new Call((yylsp[(2) - (4)]), ASTString("mzn_constraint_name"), {(yyvsp[(3) - (4)].expression)}));
- ;}
+ case 50: /* constraint_item: "constraint" "::" string_expr expr */
+ { (yyval.item) = new ConstraintI((yyloc),(yyvsp[0].expression));
+ if ((yyvsp[0].expression) && (yyvsp[-1].expression))
+ (yyval.item)->cast()->e()->ann().add(new Call((yylsp[-2]), ASTString("mzn_constraint_name"), {(yyvsp[-1].expression)}));
+ }
break;
- case 51:
-
- { (yyval.item) = SolveI::sat((yyloc));
- if ((yyval.item) && (yyvsp[(2) - (3)].expression_v)) (yyval.item)->cast()->ann().add(*(yyvsp[(2) - (3)].expression_v));
- delete (yyvsp[(2) - (3)].expression_v);
- ;}
+ case 51: /* solve_item: "solve" annotations "satisfy" */
+ { (yyval.item) = SolveI::sat((yyloc));
+ if ((yyval.item) && (yyvsp[-1].expression_v)) (yyval.item)->cast()->ann().add(*(yyvsp[-1].expression_v));
+ delete (yyvsp[-1].expression_v);
+ }
break;
- case 52:
-
- { (yyval.item) = SolveI::min((yyloc),(yyvsp[(4) - (4)].expression));
- if ((yyval.item) && (yyvsp[(2) - (4)].expression_v)) (yyval.item)->cast()->ann().add(*(yyvsp[(2) - (4)].expression_v));
- delete (yyvsp[(2) - (4)].expression_v);
- ;}
+ case 52: /* solve_item: "solve" annotations "minimize" expr */
+ { (yyval.item) = SolveI::min((yyloc),(yyvsp[0].expression));
+ if ((yyval.item) && (yyvsp[-2].expression_v)) (yyval.item)->cast()->ann().add(*(yyvsp[-2].expression_v));
+ delete (yyvsp[-2].expression_v);
+ }
break;
- case 53:
-
- { (yyval.item) = SolveI::max((yyloc),(yyvsp[(4) - (4)].expression));
- if ((yyval.item) && (yyvsp[(2) - (4)].expression_v)) (yyval.item)->cast()->ann().add(*(yyvsp[(2) - (4)].expression_v));
- delete (yyvsp[(2) - (4)].expression_v);
- ;}
+ case 53: /* solve_item: "solve" annotations "maximize" expr */
+ { (yyval.item) = SolveI::max((yyloc),(yyvsp[0].expression));
+ if ((yyval.item) && (yyvsp[-2].expression_v)) (yyval.item)->cast()->ann().add(*(yyvsp[-2].expression_v));
+ delete (yyvsp[-2].expression_v);
+ }
break;
- case 54:
-
- { (yyval.item) = new OutputI((yyloc),(yyvsp[(2) - (2)].expression));;}
+ case 54: /* output_item: "output" expr */
+ { (yyval.item) = new OutputI((yyloc),(yyvsp[0].expression));}
break;
- case 55:
-
- { if ((yyvsp[(3) - (5)].vardeclexpr_v)) (yyval.item) = new FunctionI((yyloc),(yyvsp[(2) - (5)].sValue),new TypeInst((yyloc),
- Type::varbool()),*(yyvsp[(3) - (5)].vardeclexpr_v),(yyvsp[(5) - (5)].expression));
- if ((yyval.item) && (yyvsp[(4) - (5)].expression_v)) (yyval.item)->cast()->ann().add(*(yyvsp[(4) - (5)].expression_v));
- free((yyvsp[(2) - (5)].sValue));
- delete (yyvsp[(3) - (5)].vardeclexpr_v);
- delete (yyvsp[(4) - (5)].expression_v);
- ;}
+ case 55: /* predicate_item: "predicate" "identifier" params annotations operation_item_tail */
+ { if ((yyvsp[-2].vardeclexpr_v)) (yyval.item) = new FunctionI((yyloc),(yyvsp[-3].sValue),new TypeInst((yyloc),
+ Type::varbool()),*(yyvsp[-2].vardeclexpr_v),(yyvsp[0].expression));
+ if ((yyval.item) && (yyvsp[-1].expression_v)) (yyval.item)->cast()->ann().add(*(yyvsp[-1].expression_v));
+ free((yyvsp[-3].sValue));
+ delete (yyvsp[-2].vardeclexpr_v);
+ delete (yyvsp[-1].expression_v);
+ }
break;
- case 56:
-
- { if ((yyvsp[(3) - (5)].vardeclexpr_v)) (yyval.item) = new FunctionI((yyloc),(yyvsp[(2) - (5)].sValue),new TypeInst((yyloc),
- Type::parbool()),*(yyvsp[(3) - (5)].vardeclexpr_v),(yyvsp[(5) - (5)].expression));
- if ((yyval.item) && (yyvsp[(4) - (5)].expression_v)) (yyval.item)->cast()->ann().add(*(yyvsp[(4) - (5)].expression_v));
- free((yyvsp[(2) - (5)].sValue));
- delete (yyvsp[(3) - (5)].vardeclexpr_v);
- delete (yyvsp[(4) - (5)].expression_v);
- ;}
+ case 56: /* predicate_item: "test" "identifier" params annotations operation_item_tail */
+ { if ((yyvsp[-2].vardeclexpr_v)) (yyval.item) = new FunctionI((yyloc),(yyvsp[-3].sValue),new TypeInst((yyloc),
+ Type::parbool()),*(yyvsp[-2].vardeclexpr_v),(yyvsp[0].expression));
+ if ((yyval.item) && (yyvsp[-1].expression_v)) (yyval.item)->cast()->ann().add(*(yyvsp[-1].expression_v));
+ free((yyvsp[-3].sValue));
+ delete (yyvsp[-2].vardeclexpr_v);
+ delete (yyvsp[-1].expression_v);
+ }
break;
- case 57:
-
- { if ((yyvsp[(5) - (7)].vardeclexpr_v)) (yyval.item) = new FunctionI((yyloc),(yyvsp[(4) - (7)].sValue),(yyvsp[(2) - (7)].tiexpr),*(yyvsp[(5) - (7)].vardeclexpr_v),(yyvsp[(7) - (7)].expression));
- if ((yyval.item) && (yyvsp[(6) - (7)].expression_v)) (yyval.item)->cast()->ann().add(*(yyvsp[(6) - (7)].expression_v));
- free((yyvsp[(4) - (7)].sValue));
- delete (yyvsp[(5) - (7)].vardeclexpr_v);
- delete (yyvsp[(6) - (7)].expression_v);
- ;}
+ case 57: /* function_item: "function" ti_expr ':' id_or_quoted_op params annotations operation_item_tail */
+ { if ((yyvsp[-2].vardeclexpr_v)) (yyval.item) = new FunctionI((yyloc),(yyvsp[-3].sValue),(yyvsp[-5].tiexpr),*(yyvsp[-2].vardeclexpr_v),(yyvsp[0].expression));
+ if ((yyval.item) && (yyvsp[-1].expression_v)) (yyval.item)->cast()->ann().add(*(yyvsp[-1].expression_v));
+ free((yyvsp[-3].sValue));
+ delete (yyvsp[-2].vardeclexpr_v);
+ delete (yyvsp[-1].expression_v);
+ }
break;
- case 58:
-
- { if ((yyvsp[(5) - (8)].vardeclexpr_v)) (yyval.item) = new FunctionI((yyloc),(yyvsp[(3) - (8)].sValue),(yyvsp[(1) - (8)].tiexpr),*(yyvsp[(5) - (8)].vardeclexpr_v),(yyvsp[(8) - (8)].expression));
- if ((yyval.item) && (yyvsp[(7) - (8)].expression_v)) (yyval.item)->cast()->ann().add(*(yyvsp[(7) - (8)].expression_v));
- free((yyvsp[(3) - (8)].sValue));
- delete (yyvsp[(5) - (8)].vardeclexpr_v);
- delete (yyvsp[(7) - (8)].expression_v);
- ;}
+ case 58: /* function_item: ti_expr ':' "identifier" '(' params_list ')' annotations operation_item_tail */
+ { if ((yyvsp[-3].vardeclexpr_v)) (yyval.item) = new FunctionI((yyloc),(yyvsp[-5].sValue),(yyvsp[-7].tiexpr),*(yyvsp[-3].vardeclexpr_v),(yyvsp[0].expression));
+ if ((yyval.item) && (yyvsp[-1].expression_v)) (yyval.item)->cast()->ann().add(*(yyvsp[-1].expression_v));
+ free((yyvsp[-5].sValue));
+ delete (yyvsp[-3].vardeclexpr_v);
+ delete (yyvsp[-1].expression_v);
+ }
break;
- case 59:
-
- {
- TypeInst* ti=new TypeInst((yylsp[(1) - (3)]),Type::ann());
- if ((yyvsp[(3) - (3)].vardeclexpr_v)==NULL || (yyvsp[(3) - (3)].vardeclexpr_v)->empty()) {
- VarDecl* vd = new VarDecl((yyloc),ti,(yyvsp[(2) - (3)].sValue));
+ case 59: /* annotation_item: "annotation" "identifier" params */
+ {
+ TypeInst* ti=new TypeInst((yylsp[-2]),Type::ann());
+ if ((yyvsp[0].vardeclexpr_v)==NULL || (yyvsp[0].vardeclexpr_v)->empty()) {
+ VarDecl* vd = new VarDecl((yyloc),ti,(yyvsp[-1].sValue));
(yyval.item) = new VarDeclI((yyloc),vd);
} else {
- (yyval.item) = new FunctionI((yyloc),(yyvsp[(2) - (3)].sValue),ti,*(yyvsp[(3) - (3)].vardeclexpr_v),NULL);
+ (yyval.item) = new FunctionI((yyloc),(yyvsp[-1].sValue),ti,*(yyvsp[0].vardeclexpr_v),NULL);
}
- free((yyvsp[(2) - (3)].sValue));
- delete (yyvsp[(3) - (3)].vardeclexpr_v);
- ;}
+ free((yyvsp[-1].sValue));
+ delete (yyvsp[0].vardeclexpr_v);
+ }
break;
- case 60:
-
- { TypeInst* ti=new TypeInst((yylsp[(1) - (5)]),Type::ann());
- if ((yyvsp[(3) - (5)].vardeclexpr_v)) (yyval.item) = new FunctionI((yyloc),(yyvsp[(2) - (5)].sValue),ti,*(yyvsp[(3) - (5)].vardeclexpr_v),(yyvsp[(5) - (5)].expression));
- delete (yyvsp[(3) - (5)].vardeclexpr_v);
- ;}
+ case 60: /* annotation_item: "annotation" "identifier" params "=" expr */
+ { TypeInst* ti=new TypeInst((yylsp[-4]),Type::ann());
+ if ((yyvsp[-2].vardeclexpr_v)) (yyval.item) = new FunctionI((yyloc),(yyvsp[-3].sValue),ti,*(yyvsp[-2].vardeclexpr_v),(yyvsp[0].expression));
+ delete (yyvsp[-2].vardeclexpr_v);
+ }
break;
- case 61:
-
- { (yyval.expression)=NULL; ;}
+ case 61: /* operation_item_tail: %empty */
+ { (yyval.expression)=NULL; }
break;
- case 62:
-
- { (yyval.expression)=(yyvsp[(2) - (2)].expression); ;}
+ case 62: /* operation_item_tail: "=" expr */
+ { (yyval.expression)=(yyvsp[0].expression); }
break;
- case 63:
-
- { (yyval.vardeclexpr_v)=new vector(); ;}
+ case 63: /* params: %empty */
+ { (yyval.vardeclexpr_v)=new vector(); }
break;
- case 64:
-
- { (yyval.vardeclexpr_v)=(yyvsp[(2) - (3)].vardeclexpr_v); ;}
+ case 64: /* params: '(' params_list ')' */
+ { (yyval.vardeclexpr_v)=(yyvsp[-1].vardeclexpr_v); }
break;
- case 65:
-
- { (yyval.vardeclexpr_v)=new vector(); ;}
+ case 65: /* params: '(' error ')' */
+ { (yyval.vardeclexpr_v)=new vector(); }
break;
- case 66:
-
- { (yyval.vardeclexpr_v)=new vector(); ;}
+ case 66: /* params_list: %empty */
+ { (yyval.vardeclexpr_v)=new vector(); }
break;
- case 67:
-
- { (yyval.vardeclexpr_v)=(yyvsp[(1) - (2)].vardeclexpr_v); ;}
+ case 67: /* params_list: params_list_head comma_or_none */
+ { (yyval.vardeclexpr_v)=(yyvsp[-1].vardeclexpr_v); }
break;
- case 68:
-
- { (yyval.vardeclexpr_v)=new vector();
- if ((yyvsp[(1) - (1)].vardeclexpr)) (yyvsp[(1) - (1)].vardeclexpr)->toplevel(false);
- if ((yyvsp[(1) - (1)].vardeclexpr)) (yyval.vardeclexpr_v)->push_back((yyvsp[(1) - (1)].vardeclexpr)); ;}
+ case 68: /* params_list_head: ti_expr_and_id_or_anon */
+ { (yyval.vardeclexpr_v)=new vector();
+ if ((yyvsp[0].vardeclexpr)) (yyvsp[0].vardeclexpr)->toplevel(false);
+ if ((yyvsp[0].vardeclexpr)) (yyval.vardeclexpr_v)->push_back((yyvsp[0].vardeclexpr)); }
break;
- case 69:
-
- { (yyval.vardeclexpr_v)=(yyvsp[(1) - (3)].vardeclexpr_v);
- if ((yyvsp[(3) - (3)].vardeclexpr)) (yyvsp[(3) - (3)].vardeclexpr)->toplevel(false);
- if ((yyvsp[(1) - (3)].vardeclexpr_v) && (yyvsp[(3) - (3)].vardeclexpr)) (yyvsp[(1) - (3)].vardeclexpr_v)->push_back((yyvsp[(3) - (3)].vardeclexpr)); ;}
+ case 69: /* params_list_head: params_list_head ',' ti_expr_and_id_or_anon */
+ { (yyval.vardeclexpr_v)=(yyvsp[-2].vardeclexpr_v);
+ if ((yyvsp[0].vardeclexpr)) (yyvsp[0].vardeclexpr)->toplevel(false);
+ if ((yyvsp[-2].vardeclexpr_v) && (yyvsp[0].vardeclexpr)) (yyvsp[-2].vardeclexpr_v)->push_back((yyvsp[0].vardeclexpr)); }
break;
- case 72:
-
- { (yyval.vardeclexpr)=(yyvsp[(1) - (1)].vardeclexpr); ;}
+ case 72: /* ti_expr_and_id_or_anon: ti_expr_and_id */
+ { (yyval.vardeclexpr)=(yyvsp[0].vardeclexpr); }
break;
- case 73:
-
- { if ((yyvsp[(1) - (1)].tiexpr)) (yyval.vardeclexpr)=new VarDecl((yyloc), (yyvsp[(1) - (1)].tiexpr), ""); ;}
+ case 73: /* ti_expr_and_id_or_anon: ti_expr */
+ { if ((yyvsp[0].tiexpr)) (yyval.vardeclexpr)=new VarDecl((yyloc), (yyvsp[0].tiexpr), ""); }
break;
- case 74:
-
- { if ((yyvsp[(1) - (3)].tiexpr) && (yyvsp[(3) - (3)].sValue)) (yyval.vardeclexpr) = new VarDecl((yyloc), (yyvsp[(1) - (3)].tiexpr), (yyvsp[(3) - (3)].sValue));
- free((yyvsp[(3) - (3)].sValue));
- ;}
+ case 74: /* ti_expr_and_id: ti_expr ':' "identifier" */
+ { if ((yyvsp[-2].tiexpr) && (yyvsp[0].sValue)) (yyval.vardeclexpr) = new VarDecl((yyloc), (yyvsp[-2].tiexpr), (yyvsp[0].sValue));
+ free((yyvsp[0].sValue));
+ }
break;
- case 75:
-
- { (yyval.tiexpr_v)=(yyvsp[(1) - (2)].tiexpr_v); ;}
+ case 75: /* ti_expr_list: ti_expr_list_head comma_or_none */
+ { (yyval.tiexpr_v)=(yyvsp[-1].tiexpr_v); }
break;
- case 76:
-
- { (yyval.tiexpr_v)=new vector(); (yyval.tiexpr_v)->push_back((yyvsp[(1) - (1)].tiexpr)); ;}
+ case 76: /* ti_expr_list_head: ti_expr */
+ { (yyval.tiexpr_v)=new vector(); (yyval.tiexpr_v)->push_back((yyvsp[0].tiexpr)); }
break;
- case 77:
-
- { (yyval.tiexpr_v)=(yyvsp[(1) - (3)].tiexpr_v); if ((yyvsp[(1) - (3)].tiexpr_v) && (yyvsp[(3) - (3)].tiexpr)) (yyvsp[(1) - (3)].tiexpr_v)->push_back((yyvsp[(3) - (3)].tiexpr)); ;}
+ case 77: /* ti_expr_list_head: ti_expr_list_head ',' ti_expr */
+ { (yyval.tiexpr_v)=(yyvsp[-2].tiexpr_v); if ((yyvsp[-2].tiexpr_v) && (yyvsp[0].tiexpr)) (yyvsp[-2].tiexpr_v)->push_back((yyvsp[0].tiexpr)); }
break;
- case 79:
-
- {
- (yyval.tiexpr) = (yyvsp[(6) - (6)].tiexpr);
- if ((yyval.tiexpr) && (yyvsp[(3) - (6)].tiexpr_v)) (yyval.tiexpr)->setRanges(*(yyvsp[(3) - (6)].tiexpr_v));
- delete (yyvsp[(3) - (6)].tiexpr_v);
- ;}
+ case 79: /* ti_expr: "array" "[" ti_expr_list "]" "of" base_ti_expr */
+ {
+ (yyval.tiexpr) = (yyvsp[0].tiexpr);
+ if ((yyval.tiexpr) && (yyvsp[-3].tiexpr_v)) (yyval.tiexpr)->setRanges(*(yyvsp[-3].tiexpr_v));
+ delete (yyvsp[-3].tiexpr_v);
+ }
break;
- case 80:
-
- {
- (yyval.tiexpr) = (yyvsp[(3) - (3)].tiexpr);
+ case 80: /* ti_expr: "list" "of" base_ti_expr */
+ {
+ (yyval.tiexpr) = (yyvsp[0].tiexpr);
std::vector ti(1);
ti[0] = new TypeInst((yyloc),Type::parint());
if ((yyval.tiexpr)) (yyval.tiexpr)->setRanges(ti);
- ;}
+ }
break;
- case 81:
-
- { (yyval.tiexpr) = (yyvsp[(1) - (1)].tiexpr);
- ;}
+ case 81: /* base_ti_expr: base_ti_expr_tail */
+ { (yyval.tiexpr) = (yyvsp[0].tiexpr);
+ }
break;
- case 82:
-
- { (yyval.tiexpr) = (yyvsp[(2) - (2)].tiexpr);
+ case 82: /* base_ti_expr: "opt" base_ti_expr_tail */
+ { (yyval.tiexpr) = (yyvsp[0].tiexpr);
if ((yyval.tiexpr)) {
Type tt = (yyval.tiexpr)->type();
tt.ot(Type::OT_OPTIONAL);
(yyval.tiexpr)->type(tt);
}
- ;}
+ }
break;
- case 83:
-
- { (yyval.tiexpr) = (yyvsp[(3) - (3)].tiexpr);
- if ((yyval.tiexpr) && (yyvsp[(2) - (3)].bValue)) {
+ case 83: /* base_ti_expr: "par" opt_opt base_ti_expr_tail */
+ { (yyval.tiexpr) = (yyvsp[0].tiexpr);
+ if ((yyval.tiexpr) && (yyvsp[-1].bValue)) {
Type tt = (yyval.tiexpr)->type();
tt.ot(Type::OT_OPTIONAL);
(yyval.tiexpr)->type(tt);
}
- ;}
+ }
break;
- case 84:
-
- { (yyval.tiexpr) = (yyvsp[(3) - (3)].tiexpr);
+ case 84: /* base_ti_expr: "var" opt_opt base_ti_expr_tail */
+ { (yyval.tiexpr) = (yyvsp[0].tiexpr);
if ((yyval.tiexpr)) {
Type tt = (yyval.tiexpr)->type();
tt.ti(Type::TI_VAR);
- if ((yyvsp[(2) - (3)].bValue)) tt.ot(Type::OT_OPTIONAL);
+ if ((yyvsp[-1].bValue)) tt.ot(Type::OT_OPTIONAL);
(yyval.tiexpr)->type(tt);
}
- ;}
+ }
break;
- case 85:
-
- { (yyval.tiexpr) = (yyvsp[(4) - (4)].tiexpr);
+ case 85: /* base_ti_expr: opt_opt "set" "of" base_ti_expr_tail */
+ { (yyval.tiexpr) = (yyvsp[0].tiexpr);
if ((yyval.tiexpr)) {
Type tt = (yyval.tiexpr)->type();
tt.st(Type::ST_SET);
- if ((yyvsp[(1) - (4)].bValue)) tt.ot(Type::OT_OPTIONAL);
+ if ((yyvsp[-3].bValue)) tt.ot(Type::OT_OPTIONAL);
(yyval.tiexpr)->type(tt);
}
- ;}
+ }
break;
- case 86:
-
- { (yyval.tiexpr) = (yyvsp[(5) - (5)].tiexpr);
+ case 86: /* base_ti_expr: "par" opt_opt "set" "of" base_ti_expr_tail */
+ { (yyval.tiexpr) = (yyvsp[0].tiexpr);
if ((yyval.tiexpr)) {
Type tt = (yyval.tiexpr)->type();
tt.st(Type::ST_SET);
- if ((yyvsp[(2) - (5)].bValue)) tt.ot(Type::OT_OPTIONAL);
+ if ((yyvsp[-3].bValue)) tt.ot(Type::OT_OPTIONAL);
(yyval.tiexpr)->type(tt);
}
- ;}
+ }
break;
- case 87:
-
- { (yyval.tiexpr) = (yyvsp[(5) - (5)].tiexpr);
+ case 87: /* base_ti_expr: "var" opt_opt "set" "of" base_ti_expr_tail */
+ { (yyval.tiexpr) = (yyvsp[0].tiexpr);
if ((yyval.tiexpr)) {
Type tt = (yyval.tiexpr)->type();
tt.ti(Type::TI_VAR);
tt.st(Type::ST_SET);
- if ((yyvsp[(2) - (5)].bValue)) tt.ot(Type::OT_OPTIONAL);
+ if ((yyvsp[-3].bValue)) tt.ot(Type::OT_OPTIONAL);
(yyval.tiexpr)->type(tt);
}
- ;}
+ }
break;
- case 88:
-
- { (yyval.bValue) = false; ;}
+ case 88: /* opt_opt: %empty */
+ { (yyval.bValue) = false; }
break;
- case 89:
-
- { (yyval.bValue) = true; ;}
+ case 89: /* opt_opt: "opt" */
+ { (yyval.bValue) = true; }
break;
- case 90:
-
- { (yyval.tiexpr) = new TypeInst((yyloc),Type::parint()); ;}
+ case 90: /* base_ti_expr_tail: "int" */
+ { (yyval.tiexpr) = new TypeInst((yyloc),Type::parint()); }
break;
- case 91:
-
- { (yyval.tiexpr) = new TypeInst((yyloc),Type::parbool()); ;}
+ case 91: /* base_ti_expr_tail: "bool" */
+ { (yyval.tiexpr) = new TypeInst((yyloc),Type::parbool()); }
break;
- case 92:
-
- { (yyval.tiexpr) = new TypeInst((yyloc),Type::parfloat()); ;}
+ case 92: /* base_ti_expr_tail: "float" */
+ { (yyval.tiexpr) = new TypeInst((yyloc),Type::parfloat()); }
break;
- case 93:
-
- { (yyval.tiexpr) = new TypeInst((yyloc),Type::parstring()); ;}
+ case 93: /* base_ti_expr_tail: "string" */
+ { (yyval.tiexpr) = new TypeInst((yyloc),Type::parstring()); }
break;
- case 94:
-
- { (yyval.tiexpr) = new TypeInst((yyloc),Type::ann()); ;}
+ case 94: /* base_ti_expr_tail: "ann" */
+ { (yyval.tiexpr) = new TypeInst((yyloc),Type::ann()); }
break;
- case 95:
-
- { if ((yyvsp[(1) - (1)].expression)) (yyval.tiexpr) = new TypeInst((yyloc),Type(),(yyvsp[(1) - (1)].expression)); ;}
+ case 95: /* base_ti_expr_tail: set_expr */
+ { if ((yyvsp[0].expression)) (yyval.tiexpr) = new TypeInst((yyloc),Type(),(yyvsp[0].expression)); }
break;
- case 96:
-
- { (yyval.tiexpr) = new TypeInst((yyloc),Type::top(),
- new TIId((yyloc), (yyvsp[(1) - (1)].sValue)));
- free((yyvsp[(1) - (1)].sValue));
- ;}
+ case 96: /* base_ti_expr_tail: "type-inst identifier" */
+ { (yyval.tiexpr) = new TypeInst((yyloc),Type::top(),
+ new TIId((yyloc), (yyvsp[0].sValue)));
+ free((yyvsp[0].sValue));
+ }
break;
- case 97:
-
- { (yyval.tiexpr) = new TypeInst((yyloc),Type::parint(),
- new TIId((yyloc), (yyvsp[(1) - (1)].sValue)));
- free((yyvsp[(1) - (1)].sValue));
- ;}
+ case 97: /* base_ti_expr_tail: "type-inst enum identifier" */
+ { (yyval.tiexpr) = new TypeInst((yyloc),Type::parint(),
+ new TIId((yyloc), (yyvsp[0].sValue)));
+ free((yyvsp[0].sValue));
+ }
break;
- case 99:
-
- { (yyval.expression_v)=new std::vector; (yyval.expression_v)->push_back((yyvsp[(1) - (1)].expression)); ;}
+ case 99: /* array_access_expr_list_head: array_access_expr */
+ { (yyval.expression_v)=new std::vector; (yyval.expression_v)->push_back((yyvsp[0].expression)); }
break;
- case 100:
-
- { (yyval.expression_v)=(yyvsp[(1) - (3)].expression_v); if ((yyval.expression_v) && (yyvsp[(3) - (3)].expression)) (yyval.expression_v)->push_back((yyvsp[(3) - (3)].expression)); ;}
+ case 100: /* array_access_expr_list_head: array_access_expr_list_head ',' array_access_expr */
+ { (yyval.expression_v)=(yyvsp[-2].expression_v); if ((yyval.expression_v) && (yyvsp[0].expression)) (yyval.expression_v)->push_back((yyvsp[0].expression)); }
break;
- case 101:
-
- { (yyval.expression) = (yyvsp[(1) - (1)].expression); ;}
+ case 101: /* array_access_expr: expr */
+ { (yyval.expression) = (yyvsp[0].expression); }
break;
- case 102:
-
- { (yyval.expression)=new SetLit((yyloc), IntSetVal::a(-IntVal::infinity(),IntVal::infinity())); ;}
+ case 102: /* array_access_expr: ".." */
+ { (yyval.expression)=new SetLit((yyloc), IntSetVal::a(-IntVal::infinity(),IntVal::infinity())); }
break;
- case 103:
-
- { if ((yyvsp[(2) - (2)].expression)==NULL) {
+ case 103: /* array_access_expr: ".." expr */
+ { if ((yyvsp[0].expression)==NULL) {
(yyval.expression) = NULL;
- } else if ((yyvsp[(2) - (2)].expression)->isa()) {
- (yyval.expression)=new SetLit((yyloc), IntSetVal::a(-IntVal::infinity(),(yyvsp[(2) - (2)].expression)->cast()->v()));
+ } else if ((yyvsp[0].expression)->isa()) {
+ (yyval.expression)=new SetLit((yyloc), IntSetVal::a(-IntVal::infinity(),(yyvsp[0].expression)->cast()->v()));
} else {
- (yyval.expression)=new BinOp((yyloc), IntLit::a(-IntVal::infinity()), BOT_DOTDOT, (yyvsp[(2) - (2)].expression));
+ (yyval.expression)=new BinOp((yyloc), IntLit::a(-IntVal::infinity()), BOT_DOTDOT, (yyvsp[0].expression));
}
- ;}
+ }
break;
- case 104:
-
- { if ((yyvsp[(1) - (2)].expression)==NULL) {
+ case 104: /* array_access_expr: expr ".." */
+ { if ((yyvsp[-1].expression)==NULL) {
(yyval.expression) = NULL;
- } else if ((yyvsp[(1) - (2)].expression)->isa()) {
- (yyval.expression)=new SetLit((yyloc), IntSetVal::a((yyvsp[(1) - (2)].expression)->cast()->v(),IntVal::infinity()));
+ } else if ((yyvsp[-1].expression)->isa()) {
+ (yyval.expression)=new SetLit((yyloc), IntSetVal::a((yyvsp[-1].expression)->cast()->v(),IntVal::infinity()));
} else {
- (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (2)].expression), BOT_DOTDOT, IntLit::a(IntVal::infinity()));
+ (yyval.expression)=new BinOp((yyloc), (yyvsp[-1].expression), BOT_DOTDOT, IntLit::a(IntVal::infinity()));
}
- ;}
+ }
break;
- case 106:
-
- { (yyval.expression_v)=new std::vector; (yyval.expression_v)->push_back((yyvsp[(1) - (1)].expression)); ;}
+ case 106: /* expr_list_head: expr */
+ { (yyval.expression_v)=new std::vector; (yyval.expression_v)->push_back((yyvsp[0].expression)); }
break;
- case 107:
-
- { (yyval.expression_v)=(yyvsp[(1) - (3)].expression_v); if ((yyval.expression_v) && (yyvsp[(3) - (3)].expression)) (yyval.expression_v)->push_back((yyvsp[(3) - (3)].expression)); ;}
+ case 107: /* expr_list_head: expr_list_head ',' expr */
+ { (yyval.expression_v)=(yyvsp[-2].expression_v); if ((yyval.expression_v) && (yyvsp[0].expression)) (yyval.expression_v)->push_back((yyvsp[0].expression)); }
break;
- case 109:
-
- { if ((yyvsp[(1) - (3)].expression) && (yyvsp[(3) - (3)].expression)) (yyvsp[(1) - (3)].expression)->addAnnotation((yyvsp[(3) - (3)].expression)); (yyval.expression)=(yyvsp[(1) - (3)].expression); ;}
+ case 109: /* set_expr: set_expr "::" annotation_expr */
+ { if ((yyvsp[-2].expression) && (yyvsp[0].expression)) (yyvsp[-2].expression)->addAnnotation((yyvsp[0].expression)); (yyval.expression)=(yyvsp[-2].expression); }
break;
- case 110:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_UNION, (yyvsp[(3) - (3)].expression)); ;}
+ case 110: /* set_expr: set_expr "union" set_expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_UNION, (yyvsp[0].expression)); }
break;
- case 111:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_DIFF, (yyvsp[(3) - (3)].expression)); ;}
+ case 111: /* set_expr: set_expr "diff" set_expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_DIFF, (yyvsp[0].expression)); }
break;
- case 112:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_SYMDIFF, (yyvsp[(3) - (3)].expression)); ;}
+ case 112: /* set_expr: set_expr "symdiff" set_expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_SYMDIFF, (yyvsp[0].expression)); }
break;
- case 113:
-
- { if ((yyvsp[(1) - (3)].expression)==NULL || (yyvsp[(3) - (3)].expression)==NULL) {
+ case 113: /* set_expr: set_expr ".." set_expr */
+ { if ((yyvsp[-2].expression)==NULL || (yyvsp[0].expression)==NULL) {
(yyval.expression) = NULL;
- } else if ((yyvsp[(1) - (3)].expression)->isa() && (yyvsp[(3) - (3)].expression)->isa()) {
- (yyval.expression)=new SetLit((yyloc), IntSetVal::a((yyvsp[(1) - (3)].expression)->cast()->v(),(yyvsp[(3) - (3)].expression)->cast()->v()));
+ } else if ((yyvsp[-2].expression)->isa() && (yyvsp[0].expression)->isa()) {
+ (yyval.expression)=new SetLit((yyloc), IntSetVal::a((yyvsp[-2].expression)->cast()->v(),(yyvsp[0].expression)->cast()->v()));
} else {
- (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_DOTDOT, (yyvsp[(3) - (3)].expression));
+ (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_DOTDOT, (yyvsp[0].expression));
}
- ;}
+ }
break;
- case 114:
-
- { if ((yyvsp[(3) - (6)].expression)==NULL || (yyvsp[(5) - (6)].expression)==NULL) {
+ case 114: /* set_expr: "'..'" '(' expr ',' expr ')' */
+ { if ((yyvsp[-3].expression)==NULL || (yyvsp[-1].expression)==NULL) {
(yyval.expression) = NULL;
- } else if ((yyvsp[(3) - (6)].expression)->isa() && (yyvsp[(5) - (6)].expression)->isa()) {
- (yyval.expression)=new SetLit((yyloc), IntSetVal::a((yyvsp[(3) - (6)].expression)->cast()->v(),(yyvsp[(5) - (6)].expression)->cast()->v()));
+ } else if ((yyvsp[-3].expression)->isa() && (yyvsp[-1].expression)->isa()) {
+ (yyval.expression)=new SetLit((yyloc), IntSetVal::a((yyvsp[-3].expression)->cast()->v(),(yyvsp[-1].expression)->cast()->v()));
} else {
- (yyval.expression)=new BinOp((yyloc), (yyvsp[(3) - (6)].expression), BOT_DOTDOT, (yyvsp[(5) - (6)].expression));
+ (yyval.expression)=new BinOp((yyloc), (yyvsp[-3].expression), BOT_DOTDOT, (yyvsp[-1].expression));
}
- ;}
+ }
break;
- case 115:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_INTERSECT, (yyvsp[(3) - (3)].expression)); ;}
+ case 115: /* set_expr: set_expr "intersect" set_expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_INTERSECT, (yyvsp[0].expression)); }
break;
- case 116:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_PLUSPLUS, (yyvsp[(3) - (3)].expression)); ;}
+ case 116: /* set_expr: set_expr "++" set_expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_PLUSPLUS, (yyvsp[0].expression)); }
break;
- case 117:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_PLUS, (yyvsp[(3) - (3)].expression)); ;}
+ case 117: /* set_expr: set_expr "+" set_expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_PLUS, (yyvsp[0].expression)); }
break;
- case 118:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_MINUS, (yyvsp[(3) - (3)].expression)); ;}
+ case 118: /* set_expr: set_expr "-" set_expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_MINUS, (yyvsp[0].expression)); }
break;
- case 119:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_MULT, (yyvsp[(3) - (3)].expression)); ;}
+ case 119: /* set_expr: set_expr "*" set_expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_MULT, (yyvsp[0].expression)); }
break;
- case 120:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_DIV, (yyvsp[(3) - (3)].expression)); ;}
+ case 120: /* set_expr: set_expr "/" set_expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_DIV, (yyvsp[0].expression)); }
break;
- case 121:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_IDIV, (yyvsp[(3) - (3)].expression)); ;}
+ case 121: /* set_expr: set_expr "div" set_expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_IDIV, (yyvsp[0].expression)); }
break;
- case 122:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_MOD, (yyvsp[(3) - (3)].expression)); ;}
+ case 122: /* set_expr: set_expr "mod" set_expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_MOD, (yyvsp[0].expression)); }
break;
- case 123:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_POW, (yyvsp[(3) - (3)].expression)); ;}
+ case 123: /* set_expr: set_expr "^" set_expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_POW, (yyvsp[0].expression)); }
break;
- case 124:
-
- { vector args;
- args.push_back((yyvsp[(1) - (3)].expression)); args.push_back((yyvsp[(3) - (3)].expression));
+ case 124: /* set_expr: set_expr "~+" set_expr */
+ { vector args;
+ args.push_back((yyvsp[-2].expression)); args.push_back((yyvsp[0].expression));
(yyval.expression)=new Call((yyloc), ASTString("~+"), args);
- ;}
+ }
break;
- case 125:
-
- { vector args;
- args.push_back((yyvsp[(1) - (3)].expression)); args.push_back((yyvsp[(3) - (3)].expression));
+ case 125: /* set_expr: set_expr "~-" set_expr */
+ { vector args;
+ args.push_back((yyvsp[-2].expression)); args.push_back((yyvsp[0].expression));
(yyval.expression)=new Call((yyloc), ASTString("~-"), args);
- ;}
+ }
break;
- case 126:
-
- { vector args;
- args.push_back((yyvsp[(1) - (3)].expression)); args.push_back((yyvsp[(3) - (3)].expression));
+ case 126: /* set_expr: set_expr "~*" set_expr */
+ { vector args;
+ args.push_back((yyvsp[-2].expression)); args.push_back((yyvsp[0].expression));
(yyval.expression)=new Call((yyloc), ASTString("~*"), args);
- ;}
+ }
break;
- case 127:
-
- { vector args;
- args.push_back((yyvsp[(1) - (3)].expression)); args.push_back((yyvsp[(3) - (3)].expression));
+ case 127: /* set_expr: set_expr "~=" set_expr */
+ { vector args;
+ args.push_back((yyvsp[-2].expression)); args.push_back((yyvsp[0].expression));
(yyval.expression)=new Call((yyloc), ASTString("~="), args);
- ;}
+ }
break;
- case 128:
-
- { vector args;
- args.push_back((yyvsp[(1) - (3)].expression)); args.push_back((yyvsp[(3) - (3)].expression));
- (yyval.expression)=new Call((yyloc), (yyvsp[(2) - (3)].sValue), args);
- free((yyvsp[(2) - (3)].sValue));
- ;}
+ case 128: /* set_expr: set_expr "quoted identifier" set_expr */
+ { vector args;
+ args.push_back((yyvsp[-2].expression)); args.push_back((yyvsp[0].expression));
+ (yyval.expression)=new Call((yyloc), (yyvsp[-1].sValue), args);
+ free((yyvsp[-1].sValue));
+ }
break;
- case 129:
-
- { (yyval.expression)=new UnOp((yyloc), UOT_PLUS, (yyvsp[(2) - (2)].expression)); ;}
+ case 129: /* set_expr: "+" set_expr */
+ { (yyval.expression)=new UnOp((yyloc), UOT_PLUS, (yyvsp[0].expression)); }
break;
- case 130:
-
- { if ((yyvsp[(2) - (2)].expression) && (yyvsp[(2) - (2)].expression)->isa()) {
- (yyval.expression) = IntLit::a(-(yyvsp[(2) - (2)].expression)->cast()->v());
- } else if ((yyvsp[(2) - (2)].expression) && (yyvsp[(2) - (2)].expression)->isa()) {
- (yyval.expression) = FloatLit::a(-(yyvsp[(2) - (2)].expression)->cast()->v());
+ case 130: /* set_expr: "-" set_expr */
+ { if ((yyvsp[0].expression) && (yyvsp[0].expression)->isa()) {
+ (yyval.expression) = IntLit::a(-(yyvsp[0].expression)->cast()->v());
+ } else if ((yyvsp[0].expression) && (yyvsp[0].expression)->isa()) {
+ (yyval.expression) = FloatLit::a(-(yyvsp[0].expression)->cast()->v());
} else {
- (yyval.expression)=new UnOp((yyloc), UOT_MINUS, (yyvsp[(2) - (2)].expression));
+ (yyval.expression)=new UnOp((yyloc), UOT_MINUS, (yyvsp[0].expression));
}
- ;}
+ }
break;
- case 132:
-
- { if ((yyvsp[(1) - (3)].expression) && (yyvsp[(3) - (3)].expression)) (yyvsp[(1) - (3)].expression)->addAnnotation((yyvsp[(3) - (3)].expression)); (yyval.expression)=(yyvsp[(1) - (3)].expression); ;}
+ case 132: /* expr: expr "::" annotation_expr */
+ { if ((yyvsp[-2].expression) && (yyvsp[0].expression)) (yyvsp[-2].expression)->addAnnotation((yyvsp[0].expression)); (yyval.expression)=(yyvsp[-2].expression); }
break;
- case 133:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_EQUIV, (yyvsp[(3) - (3)].expression)); ;}
+ case 133: /* expr: expr "<->" expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_EQUIV, (yyvsp[0].expression)); }
break;
- case 134:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_IMPL, (yyvsp[(3) - (3)].expression)); ;}
+ case 134: /* expr: expr "->" expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_IMPL, (yyvsp[0].expression)); }
break;
- case 135:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_RIMPL, (yyvsp[(3) - (3)].expression)); ;}
+ case 135: /* expr: expr "<-" expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_RIMPL, (yyvsp[0].expression)); }
break;
- case 136:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_OR, (yyvsp[(3) - (3)].expression)); ;}
+ case 136: /* expr: expr "\\/" expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_OR, (yyvsp[0].expression)); }
break;
- case 137:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_XOR, (yyvsp[(3) - (3)].expression)); ;}
+ case 137: /* expr: expr "xor" expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_XOR, (yyvsp[0].expression)); }
break;
- case 138:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_AND, (yyvsp[(3) - (3)].expression)); ;}
+ case 138: /* expr: expr "/\\" expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_AND, (yyvsp[0].expression)); }
break;
- case 139:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_LE, (yyvsp[(3) - (3)].expression)); ;}
+ case 139: /* expr: expr "<" expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_LE, (yyvsp[0].expression)); }
break;
- case 140:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_GR, (yyvsp[(3) - (3)].expression)); ;}
+ case 140: /* expr: expr ">" expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_GR, (yyvsp[0].expression)); }
break;
- case 141:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_LQ, (yyvsp[(3) - (3)].expression)); ;}
+ case 141: /* expr: expr "<=" expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_LQ, (yyvsp[0].expression)); }
break;
- case 142:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_GQ, (yyvsp[(3) - (3)].expression)); ;}
+ case 142: /* expr: expr ">=" expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_GQ, (yyvsp[0].expression)); }
break;
- case 143:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_EQ, (yyvsp[(3) - (3)].expression)); ;}
+ case 143: /* expr: expr "=" expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_EQ, (yyvsp[0].expression)); }
break;
- case 144:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_NQ, (yyvsp[(3) - (3)].expression)); ;}
+ case 144: /* expr: expr "!=" expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_NQ, (yyvsp[0].expression)); }
break;
- case 145:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_IN, (yyvsp[(3) - (3)].expression)); ;}
+ case 145: /* expr: expr "in" expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_IN, (yyvsp[0].expression)); }
break;
- case 146:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_SUBSET, (yyvsp[(3) - (3)].expression)); ;}
+ case 146: /* expr: expr "subset" expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_SUBSET, (yyvsp[0].expression)); }
break;
- case 147:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_SUPERSET, (yyvsp[(3) - (3)].expression)); ;}
+ case 147: /* expr: expr "superset" expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_SUPERSET, (yyvsp[0].expression)); }
break;
- case 148:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_UNION, (yyvsp[(3) - (3)].expression)); ;}
+ case 148: /* expr: expr "union" expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_UNION, (yyvsp[0].expression)); }
break;
- case 149:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_DIFF, (yyvsp[(3) - (3)].expression)); ;}
+ case 149: /* expr: expr "diff" expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_DIFF, (yyvsp[0].expression)); }
break;
- case 150:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_SYMDIFF, (yyvsp[(3) - (3)].expression)); ;}
+ case 150: /* expr: expr "symdiff" expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_SYMDIFF, (yyvsp[0].expression)); }
break;
- case 151:
-
- { if ((yyvsp[(1) - (3)].expression)==NULL || (yyvsp[(3) - (3)].expression)==NULL) {
+ case 151: /* expr: expr ".." expr */
+ { if ((yyvsp[-2].expression)==NULL || (yyvsp[0].expression)==NULL) {
(yyval.expression) = NULL;
- } else if ((yyvsp[(1) - (3)].expression)->isa() && (yyvsp[(3) - (3)].expression)->isa()) {
- (yyval.expression)=new SetLit((yyloc), IntSetVal::a((yyvsp[(1) - (3)].expression)->cast()->v(),(yyvsp[(3) - (3)].expression)->cast()->v()));
+ } else if ((yyvsp[-2].expression)->isa() && (yyvsp[0].expression)->isa()) {
+ (yyval.expression)=new SetLit((yyloc), IntSetVal::a((yyvsp[-2].expression)->cast()->v(),(yyvsp[0].expression)->cast()->v()));
} else {
- (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_DOTDOT, (yyvsp[(3) - (3)].expression));
+ (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_DOTDOT, (yyvsp[0].expression));
}
- ;}
+ }
break;
- case 152:
-
- { if ((yyvsp[(3) - (6)].expression)==NULL || (yyvsp[(5) - (6)].expression)==NULL) {
+ case 152: /* expr: "'..'" '(' expr ',' expr ')' */
+ { if ((yyvsp[-3].expression)==NULL || (yyvsp[-1].expression)==NULL) {
(yyval.expression) = NULL;
- } else if ((yyvsp[(3) - (6)].expression)->isa() && (yyvsp[(5) - (6)].expression)->isa()) {
- (yyval.expression)=new SetLit((yyloc), IntSetVal::a((yyvsp[(3) - (6)].expression)->cast()->v(),(yyvsp[(5) - (6)].expression)->cast()->v()));
+ } else if ((yyvsp[-3].expression)->isa() && (yyvsp[-1].expression)->isa()) {
+ (yyval.expression)=new SetLit((yyloc), IntSetVal::a((yyvsp[-3].expression)->cast()->v(),(yyvsp[-1].expression)->cast()->v()));
} else {
- (yyval.expression)=new BinOp((yyloc), (yyvsp[(3) - (6)].expression), BOT_DOTDOT, (yyvsp[(5) - (6)].expression));
+ (yyval.expression)=new BinOp((yyloc), (yyvsp[-3].expression), BOT_DOTDOT, (yyvsp[-1].expression));
}
- ;}
+ }
break;
- case 153:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_INTERSECT, (yyvsp[(3) - (3)].expression)); ;}
+ case 153: /* expr: expr "intersect" expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_INTERSECT, (yyvsp[0].expression)); }
break;
- case 154:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_PLUSPLUS, (yyvsp[(3) - (3)].expression)); ;}
+ case 154: /* expr: expr "++" expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_PLUSPLUS, (yyvsp[0].expression)); }
break;
- case 155:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_PLUS, (yyvsp[(3) - (3)].expression)); ;}
+ case 155: /* expr: expr "+" expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_PLUS, (yyvsp[0].expression)); }
break;
- case 156:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_MINUS, (yyvsp[(3) - (3)].expression)); ;}
+ case 156: /* expr: expr "-" expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_MINUS, (yyvsp[0].expression)); }
break;
- case 157:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_MULT, (yyvsp[(3) - (3)].expression)); ;}
+ case 157: /* expr: expr "*" expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_MULT, (yyvsp[0].expression)); }
break;
- case 158:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_DIV, (yyvsp[(3) - (3)].expression)); ;}
+ case 158: /* expr: expr "/" expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_DIV, (yyvsp[0].expression)); }
break;
- case 159:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_IDIV, (yyvsp[(3) - (3)].expression)); ;}
+ case 159: /* expr: expr "div" expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_IDIV, (yyvsp[0].expression)); }
break;
- case 160:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_MOD, (yyvsp[(3) - (3)].expression)); ;}
+ case 160: /* expr: expr "mod" expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_MOD, (yyvsp[0].expression)); }
break;
- case 161:
-
- { (yyval.expression)=new BinOp((yyloc), (yyvsp[(1) - (3)].expression), BOT_POW, (yyvsp[(3) - (3)].expression)); ;}
+ case 161: /* expr: expr "^" expr */
+ { (yyval.expression)=new BinOp((yyloc), (yyvsp[-2].expression), BOT_POW, (yyvsp[0].expression)); }
break;
- case 162:
-
- { vector args;
- args.push_back((yyvsp[(1) - (3)].expression)); args.push_back((yyvsp[(3) - (3)].expression));
+ case 162: /* expr: expr "~+" expr */
+ { vector args;
+ args.push_back((yyvsp[-2].expression)); args.push_back((yyvsp[0].expression));
(yyval.expression)=new Call((yyloc), ASTString("~+"), args);
- ;}
+ }
break;
- case 163:
-
- { vector args;
- args.push_back((yyvsp[(1) - (3)].expression)); args.push_back((yyvsp[(3) - (3)].expression));
+ case 163: /* expr: expr "~-" expr */
+ { vector args;
+ args.push_back((yyvsp[-2].expression)); args.push_back((yyvsp[0].expression));
(yyval.expression)=new Call((yyloc), ASTString("~-"), args);
- ;}
+ }
break;
- case 164:
-
- { vector args;
- args.push_back((yyvsp[(1) - (3)].expression)); args.push_back((yyvsp[(3) - (3)].expression));
+ case 164: /* expr: expr "~*" expr */
+ { vector args;
+ args.push_back((yyvsp[-2].expression)); args.push_back((yyvsp[0].expression));
(yyval.expression)=new Call((yyloc), ASTString("~*"), args);
- ;}
+ }
break;
- case 165:
-
- { vector args;
- args.push_back((yyvsp[(1) - (3)].expression)); args.push_back((yyvsp[(3) - (3)].expression));
+ case 165: /* expr: expr "~=" expr */
+ { vector args;
+ args.push_back((yyvsp[-2].expression)); args.push_back((yyvsp[0].expression));
(yyval.expression)=new Call((yyloc), ASTString("~="), args);
- ;}
+ }
break;
- case 166:
-
- { vector args;
- args.push_back((yyvsp[(1) - (3)].expression)); args.push_back((yyvsp[(3) - (3)].expression));
- (yyval.expression)=new Call((yyloc), (yyvsp[(2) - (3)].sValue), args);
- free((yyvsp[(2) - (3)].sValue));
- ;}
+ case 166: /* expr: expr "quoted identifier" expr */
+ { vector args;
+ args.push_back((yyvsp[-2].expression)); args.push_back((yyvsp[0].expression));
+ (yyval.expression)=new Call((yyloc), (yyvsp[-1].sValue), args);
+ free((yyvsp[-1].sValue));
+ }
break;
- case 167:
-
- { (yyval.expression)=new UnOp((yyloc), UOT_NOT, (yyvsp[(2) - (2)].expression)); ;}
+ case 167: /* expr: "not" expr */
+ { (yyval.expression)=new UnOp((yyloc), UOT_NOT, (yyvsp[0].expression)); }
break;
- case 168:
-
- { if (((yyvsp[(2) - (2)].expression) && (yyvsp[(2) - (2)].expression)->isa()) || ((yyvsp[(2) - (2)].expression) && (yyvsp[(2) - (2)].expression)->isa())) {
- (yyval.expression) = (yyvsp[(2) - (2)].expression);
+ case 168: /* expr: "+" expr */
+ { if (((yyvsp[0].expression) && (yyvsp[0].expression)->isa()) || ((yyvsp[0].expression) && (yyvsp[0].expression)->isa())) {
+ (yyval.expression) = (yyvsp[0].expression);
} else {
- (yyval.expression)=new UnOp((yyloc), UOT_PLUS, (yyvsp[(2) - (2)].expression));
+ (yyval.expression)=new UnOp((yyloc), UOT_PLUS, (yyvsp[0].expression));
}
- ;}
+ }
break;
- case 169:
-
- { if ((yyvsp[(2) - (2)].expression) && (yyvsp[(2) - (2)].expression)->isa()) {
- (yyval.expression) = IntLit::a(-(yyvsp[(2) - (2)].expression)->cast()->v());
- } else if ((yyvsp[(2) - (2)].expression) && (yyvsp[(2) - (2)].expression)->isa()) {
- (yyval.expression) = FloatLit::a(-(yyvsp[(2) - (2)].expression)->cast()->v());
+ case 169: /* expr: "-" expr */
+ { if ((yyvsp[0].expression) && (yyvsp[0].expression)->isa()) {
+ (yyval.expression) = IntLit::a(-(yyvsp[0].expression)->cast()->v());
+ } else if ((yyvsp[0].expression) && (yyvsp[0].expression)->isa()) {
+ (yyval.expression) = FloatLit::a(-(yyvsp[0].expression)->cast()->v());
} else {
- (yyval.expression)=new UnOp((yyloc), UOT_MINUS, (yyvsp[(2) - (2)].expression));
+ (yyval.expression)=new UnOp((yyloc), UOT_MINUS, (yyvsp[0].expression));
}
- ;}
+ }
break;
- case 170:
-
- { (yyval.expression)=(yyvsp[(1) - (1)].expression); ;}
+ case 170: /* expr_atom_head: expr_atom_head_nonstring */
+ { (yyval.expression)=(yyvsp[0].expression); }
break;
- case 171:
-
- { (yyval.expression)=(yyvsp[(1) - (1)].expression); ;}
+ case 171: /* expr_atom_head: string_expr */
+ { (yyval.expression)=(yyvsp[0].expression); }
break;
- case 172:
-
- { (yyval.expression)=(yyvsp[(2) - (3)].expression); ;}
+ case 172: /* expr_atom_head_nonstring: '(' expr ')' */
+ { (yyval.expression)=(yyvsp[-1].expression); }
break;
- case 173:
-
- { if ((yyvsp[(4) - (4)].expression_vv)) (yyval.expression)=createArrayAccess((yyloc), (yyvsp[(2) - (4)].expression), *(yyvsp[(4) - (4)].expression_vv)); delete (yyvsp[(4) - (4)].expression_vv); ;}
+ case 173: /* expr_atom_head_nonstring: '(' expr ')' array_access_tail */
+ { if ((yyvsp[0].expression_vv)) (yyval.expression)=createArrayAccess((yyloc), (yyvsp[-2].expression), *(yyvsp[0].expression_vv)); delete (yyvsp[0].expression_vv); }
break;
- case 174:
-
- { (yyval.expression)=new Id((yyloc), (yyvsp[(1) - (1)].sValue), NULL); free((yyvsp[(1) - (1)].sValue)); ;}
+ case 174: /* expr_atom_head_nonstring: "identifier" */
+ { (yyval.expression)=new Id((yyloc), (yyvsp[0].sValue), NULL); free((yyvsp[0].sValue)); }
break;
- case 175:
-
- { if ((yyvsp[(2) - (2)].expression_vv)) (yyval.expression)=createArrayAccess((yyloc), new Id((yylsp[(1) - (2)]),(yyvsp[(1) - (2)].sValue),NULL), *(yyvsp[(2) - (2)].expression_vv));
- free((yyvsp[(1) - (2)].sValue)); delete (yyvsp[(2) - (2)].expression_vv); ;}
+ case 175: /* expr_atom_head_nonstring: "identifier" array_access_tail */
+ { if ((yyvsp[0].expression_vv)) (yyval.expression)=createArrayAccess((yyloc), new Id((yylsp[-1]),(yyvsp[-1].sValue),NULL), *(yyvsp[0].expression_vv));
+ free((yyvsp[-1].sValue)); delete (yyvsp[0].expression_vv); }
break;
- case 176:
-
- { (yyval.expression)=new AnonVar((yyloc)); ;}
+ case 176: /* expr_atom_head_nonstring: "_" */
+ { (yyval.expression)=new AnonVar((yyloc)); }
break;
- case 177:
-
- { if ((yyvsp[(2) - (2)].expression_vv)) (yyval.expression)=createArrayAccess((yyloc), new AnonVar((yyloc)), *(yyvsp[(2) - (2)].expression_vv));
- delete (yyvsp[(2) - (2)].expression_vv); ;}
+ case 177: /* expr_atom_head_nonstring: "_" array_access_tail */
+ { if ((yyvsp[0].expression_vv)) (yyval.expression)=createArrayAccess((yyloc), new AnonVar((yyloc)), *(yyvsp[0].expression_vv));
+ delete (yyvsp[0].expression_vv); }
break;
- case 178:
-
- { (yyval.expression)=constants().boollit(((yyvsp[(1) - (1)].iValue)!=0)); ;}
+ case 178: /* expr_atom_head_nonstring: "bool literal" */
+ { (yyval.expression)=constants().boollit(((yyvsp[0].iValue)!=0)); }
break;
- case 179:
-
- { (yyval.expression)=IntLit::a((yyvsp[(1) - (1)].iValue)); ;}
+ case 179: /* expr_atom_head_nonstring: "integer literal" */
+ { (yyval.expression)=IntLit::a((yyvsp[0].iValue)); }
break;
- case 180:
-
- { (yyval.expression)=IntLit::a(IntVal::infinity()); ;}
+ case 180: /* expr_atom_head_nonstring: "infinity" */
+ { (yyval.expression)=IntLit::a(IntVal::infinity()); }
break;
- case 181:
-
- { (yyval.expression)=FloatLit::a((yyvsp[(1) - (1)].dValue)); ;}
+ case 181: /* expr_atom_head_nonstring: "float literal" */
+ { (yyval.expression)=FloatLit::a((yyvsp[0].dValue)); }
break;
- case 182:
-
- { (yyval.expression)=constants().absent; ;}
+ case 182: /* expr_atom_head_nonstring: "<>" */
+ { (yyval.expression)=constants().absent; }
break;
- case 184:
-
- { if ((yyvsp[(2) - (2)].expression_vv)) (yyval.expression)=createArrayAccess((yyloc), (yyvsp[(1) - (2)].expression), *(yyvsp[(2) - (2)].expression_vv));
- delete (yyvsp[(2) - (2)].expression_vv); ;}
+ case 184: /* expr_atom_head_nonstring: set_literal array_access_tail */
+ { if ((yyvsp[0].expression_vv)) (yyval.expression)=createArrayAccess((yyloc), (yyvsp[-1].expression), *(yyvsp[0].expression_vv));
+ delete (yyvsp[0].expression_vv); }
break;
- case 186:
-
- { if ((yyvsp[(2) - (2)].expression_vv)) (yyval.expression)=createArrayAccess((yyloc), (yyvsp[(1) - (2)].expression), *(yyvsp[(2) - (2)].expression_vv));
- delete (yyvsp[(2) - (2)].expression_vv); ;}
+ case 186: /* expr_atom_head_nonstring: set_comp array_access_tail */
+ { if ((yyvsp[0].expression_vv)) (yyval.expression)=createArrayAccess((yyloc), (yyvsp[-1].expression), *(yyvsp[0].expression_vv));
+ delete (yyvsp[0].expression_vv); }
break;
- case 188:
-
- { if ((yyvsp[(2) - (2)].expression_vv)) (yyval.expression)=createArrayAccess((yyloc), (yyvsp[(1) - (2)].expression), *(yyvsp[(2) - (2)].expression_vv));
- delete (yyvsp[(2) - (2)].expression_vv); ;}
+ case 188: /* expr_atom_head_nonstring: simple_array_literal array_access_tail */
+ { if ((yyvsp[0].expression_vv)) (yyval.expression)=createArrayAccess((yyloc), (yyvsp[-1].expression), *(yyvsp[0].expression_vv));
+ delete (yyvsp[0].expression_vv); }
break;
- case 190:
-
- { if ((yyvsp[(2) - (2)].expression_vv)) (yyval.expression)=createArrayAccess((yyloc), (yyvsp[(1) - (2)].expression), *(yyvsp[(2) - (2)].expression_vv));
- delete (yyvsp[(2) - (2)].expression_vv); ;}
+ case 190: /* expr_atom_head_nonstring: simple_array_literal_2d array_access_tail */
+ { if ((yyvsp[0].expression_vv)) (yyval.expression)=createArrayAccess((yyloc), (yyvsp[-1].expression), *(yyvsp[0].expression_vv));
+ delete (yyvsp[0].expression_vv); }
break;
- case 192:
-
- { if ((yyvsp[(2) - (2)].expression_vv)) (yyval.expression)=createArrayAccess((yyloc), (yyvsp[(1) - (2)].expression), *(yyvsp[(2) - (2)].expression_vv));
- delete (yyvsp[(2) - (2)].expression_vv); ;}
+ case 192: /* expr_atom_head_nonstring: simple_array_comp array_access_tail */
+ { if ((yyvsp[0].expression_vv)) (yyval.expression)=createArrayAccess((yyloc), (yyvsp[-1].expression), *(yyvsp[0].expression_vv));
+ delete (yyvsp[0].expression_vv); }
break;
- case 194:
-
- { if ((yyvsp[(2) - (2)].expression_vv)) (yyval.expression)=createArrayAccess((yyloc), (yyvsp[(1) - (2)].expression), *(yyvsp[(2) - (2)].expression_vv));
- delete (yyvsp[(2) - (2)].expression_vv); ;}
+ case 194: /* expr_atom_head_nonstring: if_then_else_expr array_access_tail */
+ { if ((yyvsp[0].expression_vv)) (yyval.expression)=createArrayAccess((yyloc), (yyvsp[-1].expression), *(yyvsp[0].expression_vv));
+ delete (yyvsp[0].expression_vv); }
break;
- case 197:
-
- { if ((yyvsp[(2) - (2)].expression_vv)) (yyval.expression)=createArrayAccess((yyloc), (yyvsp[(1) - (2)].expression), *(yyvsp[(2) - (2)].expression_vv));
- delete (yyvsp[(2) - (2)].expression_vv); ;}
+ case 197: /* expr_atom_head_nonstring: call_expr array_access_tail */
+ { if ((yyvsp[0].expression_vv)) (yyval.expression)=createArrayAccess((yyloc), (yyvsp[-1].expression), *(yyvsp[0].expression_vv));
+ delete (yyvsp[0].expression_vv); }
break;
- case 198:
-
- { (yyval.expression)=new StringLit((yyloc), (yyvsp[(1) - (1)].sValue)); free((yyvsp[(1) - (1)].sValue)); ;}
+ case 198: /* string_expr: "string literal" */
+ { (yyval.expression)=new StringLit((yyloc), (yyvsp[0].sValue)); free((yyvsp[0].sValue)); }
break;
- case 199:
-
- { (yyval.expression)=new BinOp((yyloc), new StringLit((yyloc), (yyvsp[(1) - (2)].sValue)), BOT_PLUSPLUS, (yyvsp[(2) - (2)].expression));
- free((yyvsp[(1) - (2)].sValue));
- ;}
+ case 199: /* string_expr: "interpolated string start" string_quote_rest */
+ { (yyval.expression)=new BinOp((yyloc), new StringLit((yyloc), (yyvsp[-1].sValue)), BOT_PLUSPLUS, (yyvsp[0].expression));
+ free((yyvsp[-1].sValue));
+ }
break;
- case 200:
-
- { if ((yyvsp[(1) - (2)].expression_v)) (yyval.expression)=new BinOp((yyloc), new Call((yyloc), ASTString("format"), *(yyvsp[(1) - (2)].expression_v)), BOT_PLUSPLUS, new StringLit((yyloc),(yyvsp[(2) - (2)].sValue)));
- free((yyvsp[(2) - (2)].sValue));
- delete (yyvsp[(1) - (2)].expression_v);
- ;}
+ case 200: /* string_quote_rest: expr_list_head "interpolated string end" */
+ { if ((yyvsp[-1].expression_v)) (yyval.expression)=new BinOp((yyloc), new Call((yyloc), ASTString("format"), *(yyvsp[-1].expression_v)), BOT_PLUSPLUS, new StringLit((yyloc),(yyvsp[0].sValue)));
+ free((yyvsp[0].sValue));
+ delete (yyvsp[-1].expression_v);
+ }
break;
- case 201:
-
- { if ((yyvsp[(1) - (3)].expression_v)) (yyval.expression)=new BinOp((yyloc), new Call((yyloc), ASTString("format"), *(yyvsp[(1) - (3)].expression_v)), BOT_PLUSPLUS,
- new BinOp((yyloc), new StringLit((yyloc),(yyvsp[(2) - (3)].sValue)), BOT_PLUSPLUS, (yyvsp[(3) - (3)].expression)));
- free((yyvsp[(2) - (3)].sValue));
- delete (yyvsp[(1) - (3)].expression_v);
- ;}
+ case 201: /* string_quote_rest: expr_list_head "interpolated string middle" string_quote_rest */
+ { if ((yyvsp[-2].expression_v)) (yyval.expression)=new BinOp((yyloc), new Call((yyloc), ASTString("format"), *(yyvsp[-2].expression_v)), BOT_PLUSPLUS,
+ new BinOp((yyloc), new StringLit((yyloc),(yyvsp[-1].sValue)), BOT_PLUSPLUS, (yyvsp[0].expression)));
+ free((yyvsp[-1].sValue));
+ delete (yyvsp[-2].expression_v);
+ }
break;
- case 202:
-
- { (yyval.expression_vv)=new std::vector >();
- if ((yyvsp[(2) - (3)].expression_v)) {
- (yyval.expression_vv)->push_back(*(yyvsp[(2) - (3)].expression_v));
- delete (yyvsp[(2) - (3)].expression_v);
+ case 202: /* array_access_tail: "[" array_access_expr_list "]" */
+ { (yyval.expression_vv)=new std::vector >();
+ if ((yyvsp[-1].expression_v)) {
+ (yyval.expression_vv)->push_back(*(yyvsp[-1].expression_v));
+ delete (yyvsp[-1].expression_v);
}
- ;}
+ }
break;
- case 203:
-
- { (yyval.expression_vv)=(yyvsp[(1) - (4)].expression_vv);
- if ((yyval.expression_vv) && (yyvsp[(3) - (4)].expression_v)) {
- (yyval.expression_vv)->push_back(*(yyvsp[(3) - (4)].expression_v));
- delete (yyvsp[(3) - (4)].expression_v);
+ case 203: /* array_access_tail: array_access_tail "[" array_access_expr_list "]" */
+ { (yyval.expression_vv)=(yyvsp[-3].expression_vv);
+ if ((yyval.expression_vv) && (yyvsp[-1].expression_v)) {
+ (yyval.expression_vv)->push_back(*(yyvsp[-1].expression_v));
+ delete (yyvsp[-1].expression_v);
}
- ;}
+ }
break;
- case 204:
-
- { (yyval.expression) = new SetLit((yyloc), std::vector()); ;}
+ case 204: /* set_literal: '{' '}' */
+ { (yyval.expression) = new SetLit((yyloc), std::vector()); }
break;
- case 205:
-
- { if ((yyvsp[(2) - (3)].expression_v)) (yyval.expression) = new SetLit((yyloc), *(yyvsp[(2) - (3)].expression_v));
- delete (yyvsp[(2) - (3)].expression_v); ;}
+ case 205: /* set_literal: '{' expr_list '}' */
+ { if ((yyvsp[-1].expression_v)) (yyval.expression) = new SetLit((yyloc), *(yyvsp[-1].expression_v));
+ delete (yyvsp[-1].expression_v); }
break;
- case 206:
-
- { if ((yyvsp[(4) - (5)].generators)) (yyval.expression) = new Comprehension((yyloc), (yyvsp[(2) - (5)].expression), *(yyvsp[(4) - (5)].generators), true);
- delete (yyvsp[(4) - (5)].generators);
- ;}
+ case 206: /* set_comp: '{' expr '|' comp_tail '}' */
+ { if ((yyvsp[-1].generators)) (yyval.expression) = new Comprehension((yyloc), (yyvsp[-3].expression), *(yyvsp[-1].generators), true);
+ delete (yyvsp[-1].generators);
+ }
break;
- case 207:
-
- { if ((yyvsp[(1) - (1)].generator_v)) (yyval.generators)=new Generators; (yyval.generators)->_g = *(yyvsp[(1) - (1)].generator_v); delete (yyvsp[(1) - (1)].generator_v); ;}
+ case 207: /* comp_tail: generator_list */
+ { if ((yyvsp[0].generator_v)) (yyval.generators)=new Generators; (yyval.generators)->_g = *(yyvsp[0].generator_v); delete (yyvsp[0].generator_v); }
break;
- case 209:
-
- { (yyval.generator_v)=new std::vector; if ((yyvsp[(1) - (1)].generator)) (yyval.generator_v)->push_back(*(yyvsp[(1) - (1)].generator)); delete (yyvsp[(1) - (1)].generator); ;}
+ case 209: /* generator_list_head: generator */
+ { (yyval.generator_v)=new std::vector; if ((yyvsp[0].generator)) (yyval.generator_v)->push_back(*(yyvsp[0].generator)); delete (yyvsp[0].generator); }
break;
- case 210:
-
- { (yyval.generator_v)=new std::vector; if ((yyvsp[(1) - (1)].generator)) (yyval.generator_v)->push_back(*(yyvsp[(1) - (1)].generator)); delete (yyvsp[(1) - (1)].generator); ;}
+ case 210: /* generator_list_head: generator_eq */
+ { (yyval.generator_v)=new std::vector; if ((yyvsp[0].generator)) (yyval.generator_v)->push_back(*(yyvsp[0].generator)); delete (yyvsp[0].generator); }
break;
- case 211:
-
- { (yyval.generator_v)=new std::vector;
- if ((yyvsp[(1) - (3)].generator)) (yyval.generator_v)->push_back(*(yyvsp[(1) - (3)].generator));
- if ((yyvsp[(1) - (3)].generator) && (yyvsp[(3) - (3)].expression)) (yyval.generator_v)->push_back(Generator((yyval.generator_v)->size(),(yyvsp[(3) - (3)].expression)));
- delete (yyvsp[(1) - (3)].generator);
- ;}
+ case 211: /* generator_list_head: generator_eq "where" expr */
+ { (yyval.generator_v)=new std::vector;
+ if ((yyvsp[-2].generator)) (yyval.generator_v)->push_back(*(yyvsp[-2].generator));
+ if ((yyvsp[-2].generator) && (yyvsp[0].expression)) (yyval.generator_v)->push_back(Generator((yyval.generator_v)->size(),(yyvsp[0].expression)));
+ delete (yyvsp[-2].generator);
+ }
break;
- case 212:
-
- { (yyval.generator_v)=(yyvsp[(1) - (3)].generator_v); if ((yyval.generator_v) && (yyvsp[(3) - (3)].generator)) (yyval.generator_v)->push_back(*(yyvsp[(3) - (3)].generator)); delete (yyvsp[(3) - (3)].generator); ;}
+ case 212: /* generator_list_head: generator_list_head ',' generator */
+ { (yyval.generator_v)=(yyvsp[-2].generator_v); if ((yyval.generator_v) && (yyvsp[0].generator)) (yyval.generator_v)->push_back(*(yyvsp[0].generator)); delete (yyvsp[0].generator); }
break;
- case 213:
-
- { (yyval.generator_v)=(yyvsp[(1) - (3)].generator_v); if ((yyval.generator_v) && (yyvsp[(3) - (3)].generator)) (yyval.generator_v)->push_back(*(yyvsp[(3) - (3)].generator)); delete (yyvsp[(3) - (3)].generator); ;}
+ case 213: /* generator_list_head: generator_list_head ',' generator_eq */
+ { (yyval.generator_v)=(yyvsp[-2].generator_v); if ((yyval.generator_v) && (yyvsp[0].generator)) (yyval.generator_v)->push_back(*(yyvsp[0].generator)); delete (yyvsp[0].generator); }
break;
- case 214:
-
- { (yyval.generator_v)=(yyvsp[(1) - (5)].generator_v);
- if ((yyval.generator_v) && (yyvsp[(3) - (5)].generator)) (yyval.generator_v)->push_back(*(yyvsp[(3) - (5)].generator));
- if ((yyval.generator_v) && (yyvsp[(3) - (5)].generator) && (yyvsp[(5) - (5)].expression)) (yyval.generator_v)->push_back(Generator((yyval.generator_v)->size(),(yyvsp[(5) - (5)].expression)));
- delete (yyvsp[(3) - (5)].generator);
- ;}
+ case 214: /* generator_list_head: generator_list_head ',' generator_eq "where" expr */
+ { (yyval.generator_v)=(yyvsp[-4].generator_v);
+ if ((yyval.generator_v) && (yyvsp[-2].generator)) (yyval.generator_v)->push_back(*(yyvsp[-2].generator));
+ if ((yyval.generator_v) && (yyvsp[-2].generator) && (yyvsp[0].expression)) (yyval.generator_v)->push_back(Generator((yyval.generator_v)->size(),(yyvsp[0].expression)));
+ delete (yyvsp[-2].generator);
+ }
break;
- case 215:
-
- { if ((yyvsp[(1) - (3)].string_v) && (yyvsp[(3) - (3)].expression)) (yyval.generator)=new Generator(*(yyvsp[(1) - (3)].string_v),(yyvsp[(3) - (3)].expression),NULL); else (yyval.generator)=NULL; delete (yyvsp[(1) - (3)].string_v); ;}
+ case 215: /* generator: id_list "in" expr */
+ { if ((yyvsp[-2].string_v) && (yyvsp[0].expression)) (yyval.generator)=new Generator(*(yyvsp[-2].string_v),(yyvsp[0].expression),NULL); else (yyval.generator)=NULL; delete (yyvsp[-2].string_v); }
break;
- case 216:
-
- { if ((yyvsp[(1) - (5)].string_v) && (yyvsp[(3) - (5)].expression)) (yyval.generator)=new Generator(*(yyvsp[(1) - (5)].string_v),(yyvsp[(3) - (5)].expression),(yyvsp[(5) - (5)].expression)); else (yyval.generator)=NULL; delete (yyvsp[(1) - (5)].string_v); ;}
+ case 216: /* generator: id_list "in" expr "where" expr */
+ { if ((yyvsp[-4].string_v) && (yyvsp[-2].expression)) (yyval.generator)=new Generator(*(yyvsp[-4].string_v),(yyvsp[-2].expression),(yyvsp[0].expression)); else (yyval.generator)=NULL; delete (yyvsp[-4].string_v); }
break;
- case 217:
-
- { if ((yyvsp[(3) - (3)].expression)) (yyval.generator)=new Generator({(yyvsp[(1) - (3)].sValue)},NULL,(yyvsp[(3) - (3)].expression)); else (yyval.generator)=NULL; free((yyvsp[(1) - (3)].sValue)); ;}
+ case 217: /* generator_eq: "identifier" "=" expr */
+ { if ((yyvsp[0].expression)) (yyval.generator)=new Generator({(yyvsp[-2].sValue)},NULL,(yyvsp[0].expression)); else (yyval.generator)=NULL; free((yyvsp[-2].sValue)); }
break;
- case 219:
-
- { (yyval.string_v)=new std::vector; (yyval.string_v)->push_back((yyvsp[(1) - (1)].sValue)); free((yyvsp[(1) - (1)].sValue)); ;}
+ case 219: /* id_list_head: "identifier" */
+ { (yyval.string_v)=new std::vector; (yyval.string_v)->push_back((yyvsp[0].sValue)); free((yyvsp[0].sValue)); }
break;
- case 220:
-
- { (yyval.string_v)=(yyvsp[(1) - (3)].string_v); if ((yyval.string_v) && (yyvsp[(3) - (3)].sValue)) (yyval.string_v)->push_back((yyvsp[(3) - (3)].sValue)); free((yyvsp[(3) - (3)].sValue)); ;}
+ case 220: /* id_list_head: id_list_head ',' "identifier" */
+ { (yyval.string_v)=(yyvsp[-2].string_v); if ((yyval.string_v) && (yyvsp[0].sValue)) (yyval.string_v)->push_back((yyvsp[0].sValue)); free((yyvsp[0].sValue)); }
break;
- case 221:
-
- { (yyval.expression)=new ArrayLit((yyloc), std::vector()); ;}
+ case 221: /* simple_array_literal: "[" "]" */
+ { (yyval.expression)=new ArrayLit((yyloc), std::vector()); }
break;
- case 222:
-
- { if ((yyvsp[(2) - (3)].expression_v)) (yyval.expression)=new ArrayLit((yyloc), *(yyvsp[(2) - (3)].expression_v)); delete (yyvsp[(2) - (3)].expression_v); ;}
+ case 222: /* simple_array_literal: "[" expr_list "]" */
+ { if ((yyvsp[-1].expression_v)) (yyval.expression)=new ArrayLit((yyloc), *(yyvsp[-1].expression_v)); delete (yyvsp[-1].expression_v); }
break;
- case 223:
-
- { (yyval.expression)=new ArrayLit((yyloc), std::vector >()); ;}
+ case 223: /* simple_array_literal_2d: "[|" "|]" */
+ { (yyval.expression)=new ArrayLit((yyloc), std::vector >()); }
break;
- case 224:
-
- { if ((yyvsp[(2) - (3)].expression_vv)) {
- (yyval.expression)=new ArrayLit((yyloc), *(yyvsp[(2) - (3)].expression_vv));
- for (unsigned int i=1; i<(yyvsp[(2) - (3)].expression_vv)->size(); i++)
- if ((*(yyvsp[(2) - (3)].expression_vv))[i].size() != (*(yyvsp[(2) - (3)].expression_vv))[i-1].size())
- yyerror(&(yylsp[(2) - (3)]), parm, "syntax error, all sub-arrays of 2d array literal must have the same length");
- delete (yyvsp[(2) - (3)].expression_vv);
+ case 224: /* simple_array_literal_2d: "[|" simple_array_literal_2d_list "|]" */
+ { if ((yyvsp[-1].expression_vv)) {
+ (yyval.expression)=new ArrayLit((yyloc), *(yyvsp[-1].expression_vv));
+ for (unsigned int i=1; i<(yyvsp[-1].expression_vv)->size(); i++)
+ if ((*(yyvsp[-1].expression_vv))[i].size() != (*(yyvsp[-1].expression_vv))[i-1].size())
+ yyerror(&(yylsp[-1]), parm, "syntax error, all sub-arrays of 2d array literal must have the same length");
+ delete (yyvsp[-1].expression_vv);
} else {
(yyval.expression) = NULL;
}
- ;}
+ }
break;
- case 225:
-
- { if ((yyvsp[(2) - (4)].expression_vv)) {
- (yyval.expression)=new ArrayLit((yyloc), *(yyvsp[(2) - (4)].expression_vv));
- for (unsigned int i=1; i<(yyvsp[(2) - (4)].expression_vv)->size(); i++)
- if ((*(yyvsp[(2) - (4)].expression_vv))[i].size() != (*(yyvsp[(2) - (4)].expression_vv))[i-1].size())
- yyerror(&(yylsp[(2) - (4)]), parm, "syntax error, all sub-arrays of 2d array literal must have the same length");
- delete (yyvsp[(2) - (4)].expression_vv);
+ case 225: /* simple_array_literal_2d: "[|" simple_array_literal_2d_list '|' "|]" */
+ { if ((yyvsp[-2].expression_vv)) {
+ (yyval.expression)=new ArrayLit((yyloc), *(yyvsp[-2].expression_vv));
+ for (unsigned int i=1; i<(yyvsp[-2].expression_vv)->size(); i++)
+ if ((*(yyvsp[-2].expression_vv))[i].size() != (*(yyvsp[-2].expression_vv))[i-1].size())
+ yyerror(&(yylsp[-2]), parm, "syntax error, all sub-arrays of 2d array literal must have the same length");
+ delete (yyvsp[-2].expression_vv);
} else {
(yyval.expression) = NULL;
}
- ;}
+ }
break;
- case 226:
-
+ case 226: /* simple_array_literal_2d: "[|" simple_array_literal_3d_list "|]" */
{
- if ((yyvsp[(2) - (3)].expression_vvv)) {
+ if ((yyvsp[-1].expression_vvv)) {
std::vector > dims(3);
- dims[0] = std::pair(1,static_cast((yyvsp[(2) - (3)].expression_vvv)->size()));
- if ((yyvsp[(2) - (3)].expression_vvv)->size()==0) {
+ dims[0] = std::pair(1,static_cast((yyvsp[-1].expression_vvv)->size()));
+ if ((yyvsp[-1].expression_vvv)->size()==0) {
dims[1] = std::pair(1,0);
dims[2] = std::pair(1,0);
} else {
- dims[1] = std::pair(1,static_cast((*(yyvsp[(2) - (3)].expression_vvv))[0].size()));
- if ((*(yyvsp[(2) - (3)].expression_vvv))[0].size()==0) {
+ dims[1] = std::pair(1,static_cast((*(yyvsp[-1].expression_vvv))[0].size()));
+ if ((*(yyvsp[-1].expression_vvv))[0].size()==0) {
dims[2] = std::pair(1,0);
} else {
- dims[2] = std::pair(1,static_cast((*(yyvsp[(2) - (3)].expression_vvv))[0][0].size()));
+ dims[2] = std::pair(1,static_cast((*(yyvsp[-1].expression_vvv))[0][0].size()));
}
}
std::vector a;
for (int i=0; i > >;
- ;}
+ case 227: /* simple_array_literal_3d_list: '|' '|' */
+ { (yyval.expression_vvv)=new std::vector > >;
+ }
break;
- case 228:
-
- { (yyval.expression_vvv)=new std::vector > >;
- if ((yyvsp[(2) - (3)].expression_vv)) (yyval.expression_vvv)->push_back(*(yyvsp[(2) - (3)].expression_vv));
- delete (yyvsp[(2) - (3)].expression_vv);
- ;}
+ case 228: /* simple_array_literal_3d_list: '|' simple_array_literal_2d_list '|' */
+ { (yyval.expression_vvv)=new std::vector > >;
+ if ((yyvsp[-1].expression_vv)) (yyval.expression_vvv)->push_back(*(yyvsp[-1].expression_vv));
+ delete (yyvsp[-1].expression_vv);
+ }
break;
- case 229:
-
- { (yyval.expression_vvv)=(yyvsp[(1) - (5)].expression_vvv);
- if ((yyval.expression_vvv) && (yyvsp[(4) - (5)].expression_vv)) (yyval.expression_vvv)->push_back(*(yyvsp[(4) - (5)].expression_vv));
- delete (yyvsp[(4) - (5)].expression_vv);
- ;}
+ case 229: /* simple_array_literal_3d_list: simple_array_literal_3d_list ',' '|' simple_array_literal_2d_list '|' */
+ { (yyval.expression_vvv)=(yyvsp[-4].expression_vvv);
+ if ((yyval.expression_vvv) && (yyvsp[-1].expression_vv)) (yyval.expression_vvv)->push_back(*(yyvsp[-1].expression_vv));
+ delete (yyvsp[-1].expression_vv);
+ }
break;
- case 230:
-
- { (yyval.expression_vv)=new std::vector >;
- if ((yyvsp[(1) - (1)].expression_v)) (yyval.expression_vv)->push_back(*(yyvsp[(1) - (1)].expression_v));
- delete (yyvsp[(1) - (1)].expression_v);
- ;}
+ case 230: /* simple_array_literal_2d_list: expr_list */
+ { (yyval.expression_vv)=new std::vector >;
+ if ((yyvsp[0].expression_v)) (yyval.expression_vv)->push_back(*(yyvsp[0].expression_v));
+ delete (yyvsp[0].expression_v);
+ }
break;
- case 231:
-
- { (yyval.expression_vv)=(yyvsp[(1) - (3)].expression_vv); if ((yyval.expression_vv) && (yyvsp[(3) - (3)].expression_v)) (yyval.expression_vv)->push_back(*(yyvsp[(3) - (3)].expression_v)); delete (yyvsp[(3) - (3)].expression_v); ;}
+ case 231: /* simple_array_literal_2d_list: simple_array_literal_2d_list '|' expr_list */
+ { (yyval.expression_vv)=(yyvsp[-2].expression_vv); if ((yyval.expression_vv) && (yyvsp[0].expression_v)) (yyval.expression_vv)->push_back(*(yyvsp[0].expression_v)); delete (yyvsp[0].expression_v); }
break;
- case 232:
-
- { if ((yyvsp[(4) - (5)].generators)) (yyval.expression)=new Comprehension((yyloc), (yyvsp[(2) - (5)].expression), *(yyvsp[(4) - (5)].generators), false);
- delete (yyvsp[(4) - (5)].generators);
- ;}
+ case 232: /* simple_array_comp: "[" expr '|' comp_tail "]" */
+ { if ((yyvsp[-1].generators)) (yyval.expression)=new Comprehension((yyloc), (yyvsp[-3].expression), *(yyvsp[-1].generators), false);
+ delete (yyvsp[-1].generators);
+ }
break;
- case 233:
-
- {
+ case 233: /* if_then_else_expr: "if" expr "then" expr "endif" */
+ {
std::vector iexps;
- iexps.push_back((yyvsp[(2) - (5)].expression));
- iexps.push_back((yyvsp[(4) - (5)].expression));
+ iexps.push_back((yyvsp[-3].expression));
+ iexps.push_back((yyvsp[-1].expression));
(yyval.expression)=new ITE((yyloc), iexps, NULL);
- ;}
+ }
break;
- case 234:
-
- {
+ case 234: /* if_then_else_expr: "if" expr "then" expr elseif_list "else" expr "endif" */
+ {
std::vector iexps;
- iexps.push_back((yyvsp[(2) - (8)].expression));
- iexps.push_back((yyvsp[(4) - (8)].expression));
- if ((yyvsp[(5) - (8)].expression_v)) {
- for (unsigned int i=0; i<(yyvsp[(5) - (8)].expression_v)->size(); i+=2) {
- iexps.push_back((*(yyvsp[(5) - (8)].expression_v))[i]);
- iexps.push_back((*(yyvsp[(5) - (8)].expression_v))[i+1]);
+ iexps.push_back((yyvsp[-6].expression));
+ iexps.push_back((yyvsp[-4].expression));
+ if ((yyvsp[-3].expression_v)) {
+ for (unsigned int i=0; i<(yyvsp[-3].expression_v)->size(); i+=2) {
+ iexps.push_back((*(yyvsp[-3].expression_v))[i]);
+ iexps.push_back((*(yyvsp[-3].expression_v))[i+1]);
}
}
- (yyval.expression)=new ITE((yyloc), iexps,(yyvsp[(7) - (8)].expression));
- delete (yyvsp[(5) - (8)].expression_v);
- ;}
+ (yyval.expression)=new ITE((yyloc), iexps,(yyvsp[-1].expression));
+ delete (yyvsp[-3].expression_v);
+ }
break;
- case 235:
-
- { (yyval.expression_v)=new std::vector; ;}
+ case 235: /* elseif_list: %empty */
+ { (yyval.expression_v)=new std::vector; }
break;
- case 236:
-
- { (yyval.expression_v)=(yyvsp[(1) - (5)].expression_v); if ((yyval.expression_v) && (yyvsp[(3) - (5)].expression) && (yyvsp[(5) - (5)].expression)) { (yyval.expression_v)->push_back((yyvsp[(3) - (5)].expression)); (yyval.expression_v)->push_back((yyvsp[(5) - (5)].expression)); } ;}
+ case 236: /* elseif_list: elseif_list "elseif" expr "then" expr */
+ { (yyval.expression_v)=(yyvsp[-4].expression_v); if ((yyval.expression_v) && (yyvsp[-2].expression) && (yyvsp[0].expression)) { (yyval.expression_v)->push_back((yyvsp[-2].expression)); (yyval.expression_v)->push_back((yyvsp[0].expression)); } }
break;
- case 237:
-
- { (yyval.iValue)=BOT_EQUIV; ;}
+ case 237: /* quoted_op: "'<->'" */
+ { (yyval.iValue)=BOT_EQUIV; }
break;
- case 238:
-
- { (yyval.iValue)=BOT_IMPL; ;}
+ case 238: /* quoted_op: "'->'" */
+ { (yyval.iValue)=BOT_IMPL; }
break;
- case 239:
-
- { (yyval.iValue)=BOT_RIMPL; ;}
+ case 239: /* quoted_op: "'<-'" */
+ { (yyval.iValue)=BOT_RIMPL; }
break;
- case 240:
-
- { (yyval.iValue)=BOT_OR; ;}
+ case 240: /* quoted_op: "'\\/'" */
+ { (yyval.iValue)=BOT_OR; }
break;
- case 241:
-
- { (yyval.iValue)=BOT_XOR; ;}
+ case 241: /* quoted_op: "'xor'" */
+ { (yyval.iValue)=BOT_XOR; }
break;
- case 242:
-
- { (yyval.iValue)=BOT_AND; ;}
+ case 242: /* quoted_op: "'/\\'" */
+ { (yyval.iValue)=BOT_AND; }
break;
- case 243:
-
- { (yyval.iValue)=BOT_LE; ;}
+ case 243: /* quoted_op: "'<'" */
+ { (yyval.iValue)=BOT_LE; }
break;
- case 244:
-
- { (yyval.iValue)=BOT_GR; ;}
+ case 244: /* quoted_op: "'>'" */
+ { (yyval.iValue)=BOT_GR; }
break;
- case 245:
-
- { (yyval.iValue)=BOT_LQ; ;}
+ case 245: /* quoted_op: "'<='" */
+ { (yyval.iValue)=BOT_LQ; }
break;
- case 246:
-
- { (yyval.iValue)=BOT_GQ; ;}
+ case 246: /* quoted_op: "'>='" */
+ { (yyval.iValue)=BOT_GQ; }
break;
- case 247:
-
- { (yyval.iValue)=BOT_EQ; ;}
+ case 247: /* quoted_op: "'='" */
+ { (yyval.iValue)=BOT_EQ; }
break;
- case 248:
-
- { (yyval.iValue)=BOT_NQ; ;}
+ case 248: /* quoted_op: "'!='" */
+ { (yyval.iValue)=BOT_NQ; }
break;
- case 249:
-
- { (yyval.iValue)=BOT_IN; ;}
+ case 249: /* quoted_op: "'in'" */
+ { (yyval.iValue)=BOT_IN; }
break;
- case 250:
-
- { (yyval.iValue)=BOT_SUBSET; ;}
+ case 250: /* quoted_op: "'subset'" */
+ { (yyval.iValue)=BOT_SUBSET; }
break;
- case 251:
-
- { (yyval.iValue)=BOT_SUPERSET; ;}
+ case 251: /* quoted_op: "'superset'" */
+ { (yyval.iValue)=BOT_SUPERSET; }
break;
- case 252:
-
- { (yyval.iValue)=BOT_UNION; ;}
+ case 252: /* quoted_op: "'union'" */
+ { (yyval.iValue)=BOT_UNION; }
break;
- case 253:
-
- { (yyval.iValue)=BOT_DIFF; ;}
+ case 253: /* quoted_op: "'diff'" */
+ { (yyval.iValue)=BOT_DIFF; }
break;
- case 254:
-
- { (yyval.iValue)=BOT_SYMDIFF; ;}
+ case 254: /* quoted_op: "'symdiff'" */
+ { (yyval.iValue)=BOT_SYMDIFF; }
break;
- case 255:
-
- { (yyval.iValue)=BOT_PLUS; ;}
+ case 255: /* quoted_op: "'+'" */
+ { (yyval.iValue)=BOT_PLUS; }
break;
- case 256:
-
- { (yyval.iValue)=BOT_MINUS; ;}
+ case 256: /* quoted_op: "'-'" */
+ { (yyval.iValue)=BOT_MINUS; }
break;
- case 257:
-
- { (yyval.iValue)=BOT_MULT; ;}
+ case 257: /* quoted_op: "'*'" */
+ { (yyval.iValue)=BOT_MULT; }
break;
- case 258:
-
- { (yyval.iValue)=BOT_POW; ;}
+ case 258: /* quoted_op: "'^'" */
+ { (yyval.iValue)=BOT_POW; }
break;
- case 259:
-
- { (yyval.iValue)=BOT_DIV; ;}
+ case 259: /* quoted_op: "'/'" */
+ { (yyval.iValue)=BOT_DIV; }
break;
- case 260:
-
- { (yyval.iValue)=BOT_IDIV; ;}
+ case 260: /* quoted_op: "'div'" */
+ { (yyval.iValue)=BOT_IDIV; }
break;
- case 261:
-
- { (yyval.iValue)=BOT_MOD; ;}
+ case 261: /* quoted_op: "'mod'" */
+ { (yyval.iValue)=BOT_MOD; }
break;
- case 262:
-
- { (yyval.iValue)=BOT_INTERSECT; ;}
+ case 262: /* quoted_op: "'intersect'" */
+ { (yyval.iValue)=BOT_INTERSECT; }
break;
- case 263:
-
- { (yyval.iValue)=BOT_PLUSPLUS; ;}
+ case 263: /* quoted_op: "'++'" */
+ { (yyval.iValue)=BOT_PLUSPLUS; }
break;
- case 264:
-
- { (yyval.iValue)=-1; ;}
+ case 264: /* quoted_op: "'not'" */
+ { (yyval.iValue)=-1; }
break;
- case 265:
-
- { if ((yyvsp[(1) - (6)].iValue)==-1) {
+ case 265: /* quoted_op_call: quoted_op '(' expr ',' expr ')' */
+ { if ((yyvsp[-5].iValue)==-1) {
(yyval.expression)=NULL;
- yyerror(&(yylsp[(3) - (6)]), parm, "syntax error, unary operator with two arguments");
+ yyerror(&(yylsp[-3]), parm, "syntax error, unary operator with two arguments");
} else {
- (yyval.expression)=new BinOp((yyloc), (yyvsp[(3) - (6)].expression),static_cast((yyvsp[(1) - (6)].iValue)),(yyvsp[(5) - (6)].expression));
+ (yyval.expression)=new BinOp((yyloc), (yyvsp[-3].expression),static_cast((yyvsp[-5].iValue)),(yyvsp[-1].expression));
}
- ;}
+ }
break;
- case 266:
-
- { int uot=-1;
- switch ((yyvsp[(1) - (4)].iValue)) {
+ case 266: /* quoted_op_call: quoted_op '(' expr ')' */
+ { int uot=-1;
+ switch ((yyvsp[-3].iValue)) {
case -1:
uot = UOT_NOT;
break;
@@ -4816,483 +4475,439 @@ yyreduce:
uot = UOT_PLUS;
break;
default:
- yyerror(&(yylsp[(3) - (4)]), parm, "syntax error, binary operator with unary argument list");
+ yyerror(&(yylsp[-1]), parm, "syntax error, binary operator with unary argument list");
break;
}
if (uot==-1)
(yyval.expression)=NULL;
else {
- if (uot==UOT_PLUS && (yyvsp[(3) - (4)].expression) && ((yyvsp[(3) - (4)].expression)->isa() || (yyvsp[(3) - (4)].expression)->isa())) {
- (yyval.expression) = (yyvsp[(3) - (4)].expression);
- } else if (uot==UOT_MINUS && (yyvsp[(3) - (4)].expression) && (yyvsp[(3) - (4)].expression)->isa()) {
- (yyval.expression) = IntLit::a(-(yyvsp[(3) - (4)].expression)->cast()->v());
- } else if (uot==UOT_MINUS && (yyvsp[(3) - (4)].expression) && (yyvsp[(3) - (4)].expression)->isa()) {
- (yyval.expression) = FloatLit::a(-(yyvsp[(3) - (4)].expression)->cast()->v());
+ if (uot==UOT_PLUS && (yyvsp[-1].expression) && ((yyvsp[-1].expression)->isa() || (yyvsp[-1].expression)->isa())) {
+ (yyval.expression) = (yyvsp[-1].expression);
+ } else if (uot==UOT_MINUS && (yyvsp[-1].expression) && (yyvsp[-1].expression)->isa