|
|
| version 1.165, 2015/10/21 21:47:14 | version 1.183, 2023/09/26 20:49:09 |
|---|---|
| Line 1 | Line 1 |
| /* A Bison parser, made by GNU Bison 3.0.2. */ | /* A Bison parser, made by GNU Bison 3.3.2. */ |
| /* Bison implementation for Yacc-like parsers in C | /* Bison implementation for Yacc-like parsers in C |
| Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. | Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 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 | it under the terms of the GNU General Public License as published by |
| Line 40 | Line 41 |
| define necessary library symbols; they are noted "INFRINGES ON | define necessary library symbols; they are noted "INFRINGES ON |
| USER NAME SPACE" below. */ | USER NAME SPACE" below. */ |
| /* Undocumented macros, especially those whose name start with YY_, | |
| are private implementation details. Do not rely on them. */ | |
| /* Identify Bison output. */ | /* Identify Bison output. */ |
| #define YYBISON 1 | #define YYBISON 1 |
| /* Bison version. */ | /* Bison version. */ |
| #define YYBISON_VERSION "3.0.2" | #define YYBISON_VERSION "3.3.2" |
| /* Skeleton name. */ | /* Skeleton name. */ |
| #define YYSKELETON_NAME "yacc.c" | #define YYSKELETON_NAME "yacc.c" |
| Line 61 | Line 65 |
| /* Copy the first part of user declarations. */ | /* First part of user prologue. */ |
| #line 1 "compile.y" /* yacc.c:339 */ | #line 1 "compile.y" /* yacc.c:337 */ |
| /** @file | /** @file |
| Parser: compiler(lexical parser and grammar). | Parser: compiler(lexical parser and grammar). |
| Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) | Copyright (c) 2001-2023 Art. Lebedev Studio (http://www.artlebedev.com) |
| Author: Alexander Petrosyan <paf@design.ru> (http://design.ru/paf) | Authors: Konstantin Morshnev <moko@design.ru>, Alexandr Petrosian <paf@design.ru> |
| */ | */ |
| Line 106 volatile const char * IDENT_COMPILE_Y = | Line 110 volatile const char * IDENT_COMPILE_Y = |
| // defines | // defines |
| #define CLASS_NAME "CLASS" | |
| #define USE_CONTROL_METHOD_NAME "USE" | #define USE_CONTROL_METHOD_NAME "USE" |
| #define OPTIONS_CONTROL_METHOD_NAME "OPTIONS" | #define OPTIONS_CONTROL_METHOD_NAME "OPTIONS" |
| #define OPTION_ALL_VARS_LOCAL_NAME "locals" | |
| #define OPTION_PARTIAL_CLASS "partial" | |
| #define REM_OPERATOR_NAME "rem" | |
| // forwards | // forwards |
| Line 129 static const VString vempty; | Line 131 static const VString vempty; |
| #define POOL (*PC.pool) | #define POOL (*PC.pool) |
| #ifndef DOXYGEN | #ifndef DOXYGEN |
| #define CLASS_ADD if(PC.class_add()){ \ | #define CLASS_ADD if(PC.class_add()){ \ |
| strncpy(PC.error, PC.cclass->name().cstr(), MAX_STRING/2); \ | PC.error=pa_strcat(PC.cclass->type(), " - class is already defined"); \ |
| strcat(PC.error, " - class is already defined"); \ | YYERROR; \ |
| YYERROR; \ | |
| } | } |
| #define YYERROR3(header, value, footer) { \ | |
| PC.error=pa_strcat(header, value, footer); \ | |
| YYERROR; \ | |
| } | |
| #line 140 "compile.tab.C" /* yacc.c:339 */ | #define YYERROR1(value) { \ |
| PC.error=value; \ | |
| YYERROR; \ | |
| } | |
| #line 151 "compile.tab.C" /* yacc.c:337 */ | |
| # ifndef YY_NULLPTR | # ifndef YY_NULLPTR |
| # if defined __cplusplus && 201103L <= __cplusplus | # if defined __cplusplus |
| # define YY_NULLPTR nullptr | # if 201103L <= __cplusplus |
| # define YY_NULLPTR nullptr | |
| # else | |
| # define YY_NULLPTR 0 | |
| # endif | |
| # else | # else |
| # define YY_NULLPTR 0 | # define YY_NULLPTR ((void*)0) |
| # endif | # endif |
| # endif | # endif |
| Line 175 extern int yydebug; | Line 189 extern int yydebug; |
| BAD_HEX_LITERAL = 262, | BAD_HEX_LITERAL = 262, |
| BAD_METHOD_DECL_START = 263, | BAD_METHOD_DECL_START = 263, |
| BAD_METHOD_PARAMETER_NAME_CHARACTER = 264, | BAD_METHOD_PARAMETER_NAME_CHARACTER = 264, |
| BAD_NONWHITESPACE_CHARACTER_IN_EXPLICIT_RESULT_MODE = 265, | LAND = 265, |
| LAND = 266, | LOR = 266, |
| LOR = 267, | LXOR = 267, |
| LXOR = 268, | NXOR = 268, |
| NXOR = 269, | NLE = 269, |
| NLE = 270, | NGE = 270, |
| NGE = 271, | NEQ = 271, |
| NEQ = 272, | NNE = 272, |
| NNE = 273, | NSL = 273, |
| NSL = 274, | NSR = 274, |
| NSR = 275, | SLT = 275, |
| SLT = 276, | SGT = 276, |
| SGT = 277, | SLE = 277, |
| SLE = 278, | SGE = 278, |
| SGE = 279, | SEQ = 279, |
| SEQ = 280, | SNE = 280, |
| SNE = 281, | DEF = 281, |
| DEF = 282, | IN = 282, |
| IN = 283, | FEXISTS = 283, |
| FEXISTS = 284, | DEXISTS = 284, |
| DEXISTS = 285, | IS = 285, |
| IS = 286, | LITERAL_TRUE = 286, |
| LITERAL_TRUE = 287, | LITERAL_FALSE = 287, |
| LITERAL_FALSE = 288, | NUNARY = 288 |
| NUNARY = 289 | |
| }; | }; |
| #endif | #endif |
| Line 216 int yyparse (Parse_control* pc); | Line 229 int yyparse (Parse_control* pc); |
| /* Copy the second part of user declarations. */ | |
| #line 222 "compile.tab.C" /* yacc.c:358 */ | |
| #ifdef short | #ifdef short |
| # undef short | # undef short |
| Line 239 typedef signed char yytype_int8; | Line 250 typedef signed char yytype_int8; |
| #ifdef YYTYPE_UINT16 | #ifdef YYTYPE_UINT16 |
| typedef YYTYPE_UINT16 yytype_uint16; | typedef YYTYPE_UINT16 yytype_uint16; |
| #else | #else |
| typedef unsigned short int yytype_uint16; | typedef unsigned short yytype_uint16; |
| #endif | #endif |
| #ifdef YYTYPE_INT16 | #ifdef YYTYPE_INT16 |
| typedef YYTYPE_INT16 yytype_int16; | typedef YYTYPE_INT16 yytype_int16; |
| #else | #else |
| typedef short int yytype_int16; | typedef short yytype_int16; |
| #endif | #endif |
| #ifndef YYSIZE_T | #ifndef YYSIZE_T |
| Line 257 typedef short int yytype_int16; | Line 268 typedef short int yytype_int16; |
| # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ | # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ |
| # define YYSIZE_T size_t | # define YYSIZE_T size_t |
| # else | # else |
| # define YYSIZE_T unsigned int | # define YYSIZE_T unsigned |
| # endif | # endif |
| #endif | #endif |
| Line 293 typedef short int yytype_int16; | Line 304 typedef short int yytype_int16; |
| # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) | # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) |
| #endif | #endif |
| #if !defined _Noreturn \ | |
| && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) | |
| # if defined _MSC_VER && 1200 <= _MSC_VER | |
| # define _Noreturn __declspec (noreturn) | |
| # else | |
| # define _Noreturn YY_ATTRIBUTE ((__noreturn__)) | |
| # endif | |
| #endif | |
| /* Suppress unused-variable warnings by "using" E. */ | /* Suppress unused-variable warnings by "using" E. */ |
| #if ! defined lint || defined __GNUC__ | #if ! defined lint || defined __GNUC__ |
| # define YYUSE(E) ((void) (E)) | # define YYUSE(E) ((void) (E)) |
| Line 309 typedef short int yytype_int16; | Line 311 typedef short int yytype_int16; |
| # define YYUSE(E) /* empty */ | # define YYUSE(E) /* empty */ |
| #endif | #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. */ | /* Suppress an incorrect diagnostic about yylval being uninitialized. */ |
| # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ | # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ |
| _Pragma ("GCC diagnostic push") \ | _Pragma ("GCC diagnostic push") \ |
| Line 460 union yyalloc | Line 462 union yyalloc |
| /* YYFINAL -- State number of the termination state. */ | /* YYFINAL -- State number of the termination state. */ |
| #define YYFINAL 51 | #define YYFINAL 51 |
| /* YYLAST -- Last index in YYTABLE. */ | /* YYLAST -- Last index in YYTABLE. */ |
| #define YYLAST 470 | #define YYLAST 473 |
| /* YYNTOKENS -- Number of terminals. */ | /* YYNTOKENS -- Number of terminals. */ |
| #define YYNTOKENS 62 | #define YYNTOKENS 61 |
| /* YYNNTS -- Number of nonterminals. */ | /* YYNNTS -- Number of nonterminals. */ |
| #define YYNNTS 89 | #define YYNNTS 89 |
| /* YYNRULES -- Number of rules. */ | /* YYNRULES -- Number of rules. */ |
| Line 471 union yyalloc | Line 473 union yyalloc |
| /* YYNSTATES -- Number of states. */ | /* YYNSTATES -- Number of states. */ |
| #define YYNSTATES 263 | #define YYNSTATES 263 |
| /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned | |
| by yylex, with out-of-bounds checking. */ | |
| #define YYUNDEFTOK 2 | #define YYUNDEFTOK 2 |
| #define YYMAXUTOK 289 | #define YYMAXUTOK 288 |
| /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM | |
| as returned by yylex, with out-of-bounds checking. */ | |
| #define YYTRANSLATE(YYX) \ | #define YYTRANSLATE(YYX) \ |
| ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) | ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) |
| /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM | /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM |
| as returned by yylex, without out-of-bounds checking. */ | as returned by yylex. */ |
| static const yytype_uint8 yytranslate[] = | static const yytype_uint8 yytranslate[] = |
| { | { |
| 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, | 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 48, 2, 2, 2, 2, 2, 2, 2, 2, 2, | 47, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 2, 2, 2, 46, 60, 2, 52, 43, 37, 61, | 2, 2, 2, 45, 59, 2, 51, 42, 36, 60, |
| 56, 57, 40, 38, 2, 39, 55, 41, 2, 2, | 55, 56, 39, 37, 2, 38, 54, 40, 2, 2, |
| 2, 2, 2, 2, 2, 2, 2, 2, 59, 51, | 2, 2, 2, 2, 2, 2, 2, 2, 58, 50, |
| 34, 2, 35, 2, 47, 2, 2, 2, 2, 2, | 33, 2, 34, 2, 46, 2, 2, 2, 2, 2, |
| 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 2, 49, 42, 50, 58, 2, 2, 2, 2, 2, | 2, 48, 41, 49, 57, 2, 2, 2, 2, 2, |
| 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 2, 2, 2, 53, 36, 54, 45, 2, 2, 2, | 2, 2, 2, 52, 35, 53, 44, 2, 2, 2, |
| 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| Line 511 static const yytype_uint8 yytranslate[] | Line 513 static const yytype_uint8 yytranslate[] |
| 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, | 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, |
| 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, | 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, |
| 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, | 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, |
| 25, 26, 27, 28, 29, 30, 31, 32, 33, 44 | 25, 26, 27, 28, 29, 30, 31, 32, 43 |
| }; | }; |
| #if YYDEBUG | #if YYDEBUG |
| /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ | /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ |
| static const yytype_uint16 yyrline[] = | static const yytype_uint16 yyrline[] = |
| { | { |
| 0, 142, 142, 149, 151, 151, 152, 154, 154, 156, | 0, 148, 148, 152, 154, 154, 155, 157, 157, 159, |
| 268, 268, 269, 269, 270, 271, 271, 273, 273, 321, | 230, 230, 231, 231, 232, 233, 233, 235, 235, 282, |
| 321, 322, 323, 323, 324, 324, 326, 326, 330, 330, | 282, 283, 284, 284, 285, 285, 287, 287, 291, 291, |
| 332, 332, 333, 333, 334, 334, 334, 338, 386, 387, | 293, 293, 294, 294, 295, 295, 295, 299, 330, 331, |
| 387, 388, 390, 391, 392, 445, 446, 446, 450, 463, | 331, 332, 334, 335, 336, 385, 386, 386, 390, 403, |
| 464, 465, 466, 492, 497, 500, 501, 502, 504, 507, | 404, 405, 406, 428, 433, 436, 437, 438, 440, 443, |
| 504, 515, 523, 530, 531, 532, 534, 540, 541, 541, | 440, 451, 458, 465, 466, 467, 469, 475, 476, 476, |
| 545, 558, 561, 558, 610, 626, 626, 628, 629, 630, | 480, 491, 494, 491, 543, 559, 559, 561, 562, 563, |
| 632, 635, 632, 638, 639, 641, 642, 645, 646, 649, | 565, 568, 565, 571, 572, 574, 575, 578, 579, 582, |
| 650, 652, 655, 669, 674, 675, 676, 681, 681, 683, | 583, 585, 588, 601, 606, 607, 608, 613, 613, 615, |
| 683, 684, 685, 697, 706, 709, 710, 711, 712, 714, | 615, 616, 617, 629, 638, 641, 642, 643, 644, 646, |
| 718, 727, 730, 727, 743, 748, 748, 749, 755, 756, | 650, 659, 662, 659, 675, 680, 680, 681, 687, 688, |
| 758, 771, 783, 785, 786, 787, 788, 789, 790, 791, | 690, 709, 719, 721, 722, 723, 724, 725, 726, 727, |
| 792, 794, 795, 796, 797, 798, 799, 800, 801, 803, | 728, 730, 731, 732, 733, 734, 735, 736, 737, 739, |
| 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, | 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, |
| 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, | 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, |
| 824, 825, 826, 827, 828, 829, 832, 837, 858, 863, | 760, 761, 762, 763, 764, 765, 768, 773, 794, 799, |
| 864, 865, 867 | 800, 801, 803 |
| }; | }; |
| #endif | #endif |
| Line 546 static const char *const yytname[] = | Line 548 static const char *const yytname[] = |
| { | { |
| "$end", "error", "$undefined", "EON", "STRING", "BOGUS", | "$end", "error", "$undefined", "EON", "STRING", "BOGUS", |
| "BAD_STRING_COMPARISON_OPERATOR", "BAD_HEX_LITERAL", | "BAD_STRING_COMPARISON_OPERATOR", "BAD_HEX_LITERAL", |
| "BAD_METHOD_DECL_START", "BAD_METHOD_PARAMETER_NAME_CHARACTER", | "BAD_METHOD_DECL_START", "BAD_METHOD_PARAMETER_NAME_CHARACTER", "\"&&\"", |
| "BAD_NONWHITESPACE_CHARACTER_IN_EXPLICIT_RESULT_MODE", "\"&&\"", | |
| "\"||\"", "\"!||\"", "\"!|\"", "\"<=\"", "\">=\"", "\"==\"", "\"!=\"", | "\"||\"", "\"!||\"", "\"!|\"", "\"<=\"", "\">=\"", "\"==\"", "\"!=\"", |
| "\"<<\"", "\">>\"", "\"lt\"", "\"gt\"", "\"le\"", "\"ge\"", "\"eq\"", | "\"<<\"", "\">>\"", "\"lt\"", "\"gt\"", "\"le\"", "\"ge\"", "\"eq\"", |
| "\"ne\"", "\"def\"", "\"in\"", "\"-f\"", "\"-d\"", "\"is\"", "\"true\"", | "\"ne\"", "\"def\"", "\"in\"", "\"-f\"", "\"-d\"", "\"is\"", "\"true\"", |
| Line 590 static const yytype_uint16 yytoknum[] = | Line 591 static const yytype_uint16 yytoknum[] = |
| 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, | 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, |
| 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, | 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, |
| 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, | 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, |
| 285, 286, 287, 288, 60, 62, 124, 38, 43, 45, | 285, 286, 287, 60, 62, 124, 38, 43, 45, 42, |
| 42, 47, 92, 37, 289, 126, 33, 64, 10, 91, | 47, 92, 37, 288, 126, 33, 64, 10, 91, 93, |
| 93, 59, 36, 123, 125, 46, 40, 41, 94, 58, | 59, 36, 123, 125, 46, 40, 41, 94, 58, 34, |
| 34, 39 | 39 |
| }; | }; |
| # endif | # endif |
| Line 611 static const yytype_uint16 yytoknum[] = | Line 612 static const yytype_uint16 yytoknum[] = |
| STATE-NUM. */ | STATE-NUM. */ |
| static const yytype_int16 yypact[] = | static const yytype_int16 yypact[] = |
| { | { |
| 14, -107, 13, 45, -107, 28, -15, -107, -107, -107, | 12, -107, 9, 41, -107, 23, -21, -107, -107, -107, |
| -107, -107, 21, -107, -107, -107, -107, -107, -107, -107, | -107, -107, 27, -107, -107, -107, -107, -107, -107, -107, |
| -107, -107, 73, 19, -107, 50, 6, 44, -107, -107, | -107, -107, 34, 10, -107, 37, 106, 108, -107, -107, |
| 87, -107, -107, -107, -34, -107, -107, -107, -107, 65, | 24, -107, -107, -107, -31, -107, -107, -107, -107, 110, |
| -107, 48, -107, 5, -107, -107, -107, 65, 24, -107, | -107, -6, -107, 16, -107, -107, -107, 110, 42, -107, |
| 6, -107, -107, -107, 88, 109, 74, -107, 50, -107, | 106, -107, -107, -107, 63, 103, 65, -107, 37, -107, |
| 76, -107, 21, -107, -107, 86, 65, 101, 65, 76, | 77, -107, 27, -107, -107, 88, 110, 76, 110, 77, |
| -107, 44, 101, -107, -107, 21, 7, -107, -107, -107, | -107, 108, 76, -107, -107, 27, 28, -107, -107, -107, |
| -107, 18, -107, -107, 5, -107, -107, -107, -107, -107, | -107, 29, -107, -107, 16, -107, -107, -107, -107, -107, |
| -107, -107, -107, 9, -107, 94, 99, -107, 93, 112, | -107, -107, -107, 4, -107, 96, 100, -107, 104, 102, |
| -107, 146, -107, -107, -107, -107, 21, -107, 101, 29, | -107, 141, -107, -107, -107, -107, 27, -107, 76, 39, |
| 110, -107, 7, 7, 7, 7, -107, -107, 7, 7, | 109, -107, 28, 28, 28, 28, -107, -107, 28, 28, |
| 7, 7, 52, 7, 21, 21, -107, -107, 113, 323, | 28, 28, 67, 28, 27, 27, -107, -107, 120, 324, |
| -107, -107, -107, 92, -107, -107, -107, -107, 165, -107, | -107, -107, -107, -26, -107, -107, -107, -107, 151, -107, |
| 144, -107, 147, 149, 21, 80, -107, -107, -107, -107, | 130, -107, 129, 132, 27, 82, -107, -107, -107, -107, |
| -107, -107, 96, 96, 96, 96, -107, -107, -107, -107, | -107, -107, 425, 425, 425, 425, -107, -107, -107, -107, |
| 276, -107, 138, 139, -107, 7, 7, 7, 7, 7, | 277, -107, 123, 119, -107, 28, 28, 28, 28, 28, |
| 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, | 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, |
| 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, | 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, |
| 7, 7, -107, 21, 7, 35, -107, -107, -107, -107, | 28, 28, -107, 27, 28, 46, -107, -107, -107, -107, |
| -107, -107, -107, 21, 154, -107, -107, -107, 419, 389, | -107, -107, -107, 27, 148, -107, -107, -107, 387, 150, |
| 356, 284, 135, 135, 148, 148, 191, 191, 135, 135, | 357, 98, 417, 417, 290, 290, 192, 192, 417, 417, |
| 135, 135, 148, 148, 96, 135, 135, 182, 427, 140, | 417, 417, 290, 290, 425, 417, 417, 183, 431, 81, |
| 140, -107, -107, -107, -107, 37, -107, 31, -107, -30, | 81, -107, -107, -107, -107, 40, -107, -14, -107, -10, |
| -107, -107, -107, -107, 21, -107, 108, -107, 155, -107, | -107, -107, -107, -107, 27, -107, 99, -107, 149, -107, |
| -107, -107, 21, -107, 7, -107, -107, 37, 161, -107, | -107, -107, 27, -107, 28, -107, -107, 40, 155, -107, |
| -107, -107, -107 | -107, -107, -107 |
| }; | }; |
| Line 677 static const yytype_uint8 yydefact[] = | Line 678 static const yytype_uint8 yydefact[] = |
| /* YYPGOTO[NTERM-NUM]. */ | /* YYPGOTO[NTERM-NUM]. */ |
| static const yytype_int16 yypgoto[] = | static const yytype_int16 yypgoto[] = |
| { | { |
| -107, -107, -107, -107, 206, -107, -107, -107, 124, -107, | -107, -107, -107, -107, 194, -107, -107, -107, 105, -107, |
| -107, -107, -107, 170, -107, -107, -107, 1, -58, -7, | -107, -107, -107, 156, -107, -107, -107, 1, -58, -7, |
| -106, -107, 0, -107, -107, -6, -107, -107, -21, -107, | -106, -107, 0, -107, -107, -15, -107, -107, -40, -107, |
| -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, | -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, |
| -107, 118, -107, -107, -107, 2, -107, -107, -107, -107, | -107, 97, -107, -107, -107, 2, -107, -107, -107, -107, |
| 43, -107, -107, -107, -107, -107, -107, -107, -107, -17, | 22, -107, -107, -107, -107, -107, -107, -107, -107, -46, |
| -13, -16, -107, -18, 4, 41, -107, -23, 3, -107, | -28, -25, -107, -9, 6, -19, -107, -29, 3, -107, |
| -107, -107, -107, -107, 181, -107, 183, 239, -107, -107, | -107, -107, -107, -107, 178, -107, 179, 235, -107, -107, |
| 171, 95, -107, 123, -107, 142, -107, -107, 64 | 164, 95, -107, 116, -107, 133, -107, -107, 49 |
| }; | }; |
| /* YYDEFGOTO[NTERM-NUM]. */ | /* YYDEFGOTO[NTERM-NUM]. */ |
| Line 707 static const yytype_int16 yydefgoto[] = | Line 708 static const yytype_int16 yydefgoto[] = |
| number is the opposite. If YYTABLE_NINF, syntax error. */ | number is the opposite. If YYTABLE_NINF, syntax error. */ |
| static const yytype_int16 yytable[] = | static const yytype_int16 yytable[] = |
| { | { |
| 16, 11, 19, 145, 106, 53, 43, 39, -103, 70, | 16, 11, 19, 145, 106, 53, 43, 86, 91, 39, |
| 23, 111, 16, 91, 19, 74, 83, 22, 1, 75, | 83, 65, 16, 22, 19, 57, 1, 74, 70, -103, |
| 65, 254, 76, 57, 57, 1, 86, 255, 51, 87, | 82, 75, 192, 51, 76, 2, 193, 73, 86, 194, |
| 72, 71, 2, 143, 112, 113, 114, 115, 242, 116, | 72, 1, 111, 71, 57, 89, 252, 83, 87, 253, |
| 117, 246, 84, 83, 89, 118, 119, 86, 69, 23, | 254, 63, 84, 143, 246, 23, 255, 82, 85, 242, |
| 43, 39, 120, 121, 63, 24, 23, -172, 25, 122, | 43, -172, 82, 39, 112, 113, 114, 115, 2, 116, |
| -102, 2, 16, 123, 19, 4, 3, 124, 125, 81, | 117, 58, 16, 3, 19, 118, 119, 91, 59, 4, |
| 58, 58, 4, 3, 108, 16, 110, 19, 59, 4, | -102, 23, 120, 121, 108, 16, 110, 19, 3, 122, |
| 82, 3, 252, 88, 192, 253, 203, 4, 193, 3, | 58, 54, 55, 123, 4, 4, 203, 124, 125, 24, |
| 73, 194, 91, 24, 24, 4, 25, 25, 26, 53, | 3, 3, 25, 26, 192, 27, 4, 4, 193, 53, |
| 27, 24, 144, 85, 25, 26, 16, 82, 19, 16, | 88, 194, 144, 96, 100, 103, 16, 97, 19, 16, |
| 168, 19, 82, 97, 24, 173, 174, 25, 96, 100, | 23, 19, 69, 55, 81, 24, 173, 174, 25, 26, |
| 103, 54, 55, 55, 16, 16, 19, 19, 58, 145, | 188, 189, 190, 191, 16, 16, 19, 19, 58, 145, |
| -68, -68, 184, 185, 186, 187, 188, 189, 190, 191, | -102, -68, -68, 184, 185, 186, 187, 188, 189, 190, |
| 107, 192, 136, 137, 16, 193, 19, -15, 194, 168, | 191, 107, 135, 136, 16, 139, 19, -15, -95, -95, |
| 139, 145, 171, 172, 173, 174, -102, 135, -95, -95, | 141, 145, 138, 137, 24, 200, 24, 25, 24, 25, |
| 179, 180, 168, 138, 151, 141, 181, 173, 174, 200, | 165, 25, 151, 168, 169, 170, 171, 172, 173, 174, |
| 164, 184, 185, 186, 187, 188, 189, 190, 191, 181, | 175, 176, 177, 178, 179, 180, 164, 201, 202, 207, |
| 188, 189, 190, 191, 184, 185, 186, 187, 188, 189, | 181, -64, 206, 182, 183, 184, 185, 186, 187, 188, |
| 190, 191, 201, 16, 236, 19, 53, 202, 206, -64, | 189, 190, 191, 16, 236, 19, 53, 245, 134, 257, |
| 207, 173, 174, 16, 245, 19, 257, 152, 153, 154, | 52, 173, 174, 16, 262, 19, 147, 152, 153, 154, |
| 155, 262, 52, 156, 157, 158, 159, 134, 160, 185, | 155, 261, 102, 156, 157, 158, 159, 243, 160, 185, |
| 186, 187, 188, 189, 190, 191, 102, 147, 144, 186, | 186, 187, 188, 189, 190, 191, 260, 259, 144, 186, |
| 187, 188, 189, 190, 191, 16, 259, 19, 243, 104, | 187, 188, 189, 190, 191, 16, 104, 19, 47, 105, |
| 261, 260, 47, 105, 16, 256, 19, 128, 163, 0, | 128, 163, 150, 0, 16, 256, 19, 0, 0, 0, |
| 144, 150, 16, 236, 19, 0, 0, 16, 0, 19, | 144, 0, 16, 236, 19, 0, 0, 16, 0, 19, |
| 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, | 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, |
| 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, | 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, |
| 228, 229, 230, 231, 232, 233, 234, 165, 166, 167, | 228, 229, 230, 231, 232, 233, 234, 165, 166, 167, |
| 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, | 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, |
| 178, 179, 180, 173, 174, 0, 0, 181, 0, 0, | 178, 179, 180, 168, 0, 0, 0, 181, 173, 174, |
| 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, | 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, |
| 184, 185, 186, 187, 188, 189, 190, 191, 0, 0, | 181, 0, 0, 0, 0, 184, 185, 186, 187, 188, |
| 0, 0, 0, 205, 165, 166, 167, 168, 169, 170, | 189, 190, 191, 205, 165, 166, 167, 168, 169, 170, |
| 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, | 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, |
| 0, 0, 0, 0, 181, 0, 0, 182, 183, 184, | 0, 0, 0, 0, 181, 0, 0, 182, 183, 184, |
| 185, 186, 187, 188, 189, 190, 191, 165, 166, 0, | 185, 186, 187, 188, 189, 190, 191, 165, 166, 0, |
| 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, | 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, |
| 178, 179, 180, 0, 0, 0, 0, 181, 0, 0, | 178, 179, 180, 0, 0, 0, 0, 181, 0, 0, |
| 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, | 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, |
| 165, 0, 0, 168, 169, 170, 171, 172, 173, 174, | 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, |
| 175, 176, 177, 178, 179, 180, 0, 0, 0, 0, | 178, 179, 180, 0, 0, 0, 0, 181, 0, 0, |
| 181, 0, 0, 182, 183, 184, 185, 186, 187, 188, | 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, |
| 189, 190, 191, 168, 169, 170, 171, 172, 173, 174, | 168, 0, 0, 171, 172, 173, 174, 0, 168, 0, |
| 175, 176, 177, 178, 179, 180, 173, 174, 0, 0, | 0, 179, 180, 173, 174, 0, 0, 181, 0, 173, |
| 181, 0, 0, 182, 183, 184, 185, 186, 187, 188, | 174, 0, 184, 185, 186, 187, 188, 189, 190, 191, |
| 189, 190, 191, 0, 0, 186, 187, 188, 189, 190, | 184, 185, 186, 187, 188, 189, 190, 191, 186, 187, |
| 191 | 188, 189, 190, 191 |
| }; | }; |
| static const yytype_int16 yycheck[] = | static const yytype_int16 yycheck[] = |
| { | { |
| 0, 0, 0, 109, 62, 12, 3, 3, 3, 27, | 0, 0, 0, 109, 62, 12, 3, 47, 4, 3, |
| 4, 4, 12, 4, 12, 49, 39, 4, 4, 53, | 39, 26, 12, 4, 12, 5, 4, 48, 27, 3, |
| 26, 51, 56, 5, 5, 4, 47, 57, 0, 47, | 39, 52, 48, 0, 55, 46, 52, 3, 68, 55, |
| 27, 27, 47, 4, 27, 28, 29, 30, 3, 32, | 27, 4, 4, 27, 5, 50, 50, 66, 47, 53, |
| 33, 4, 39, 66, 50, 38, 39, 68, 4, 4, | 50, 4, 39, 4, 4, 4, 56, 66, 54, 3, |
| 47, 47, 45, 46, 4, 49, 4, 48, 52, 52, | 47, 47, 71, 47, 26, 27, 28, 29, 46, 31, |
| 55, 47, 62, 56, 62, 58, 52, 60, 61, 4, | 32, 51, 62, 51, 62, 37, 38, 4, 58, 57, |
| 52, 52, 58, 52, 71, 75, 75, 75, 59, 58, | 54, 4, 44, 45, 71, 75, 75, 75, 51, 51, |
| 39, 52, 51, 59, 49, 54, 144, 58, 53, 52, | 51, 47, 48, 55, 57, 57, 144, 59, 60, 48, |
| 3, 56, 4, 49, 49, 58, 52, 52, 53, 106, | 51, 51, 51, 52, 48, 54, 57, 57, 52, 106, |
| 55, 49, 109, 55, 52, 53, 106, 66, 106, 109, | 58, 55, 109, 54, 55, 56, 106, 4, 106, 109, |
| 14, 109, 71, 4, 49, 19, 20, 52, 54, 55, | 4, 109, 4, 48, 4, 48, 18, 19, 51, 52, |
| 56, 48, 49, 49, 124, 125, 124, 125, 52, 235, | 39, 40, 41, 42, 124, 125, 124, 125, 51, 235, |
| 50, 51, 36, 37, 38, 39, 40, 41, 42, 43, | 54, 49, 50, 35, 36, 37, 38, 39, 40, 41, |
| 54, 49, 48, 50, 144, 53, 144, 48, 56, 14, | 42, 53, 93, 47, 144, 4, 144, 47, 49, 50, |
| 4, 257, 17, 18, 19, 20, 55, 93, 50, 51, | 101, 257, 50, 49, 48, 4, 48, 51, 48, 51, |
| 25, 26, 14, 51, 54, 101, 31, 19, 20, 4, | 10, 51, 53, 13, 14, 15, 16, 17, 18, 19, |
| 57, 36, 37, 38, 39, 40, 41, 42, 43, 31, | 20, 21, 22, 23, 24, 25, 56, 47, 49, 60, |
| 40, 41, 42, 43, 36, 37, 38, 39, 40, 41, | 30, 49, 59, 33, 34, 35, 36, 37, 38, 39, |
| 42, 43, 48, 193, 193, 193, 203, 50, 60, 50, | 40, 41, 42, 193, 193, 193, 203, 49, 93, 50, |
| 61, 19, 20, 203, 50, 203, 51, 112, 113, 114, | 6, 18, 19, 203, 49, 203, 109, 112, 113, 114, |
| 115, 50, 6, 118, 119, 120, 121, 93, 123, 37, | 115, 257, 56, 118, 119, 120, 121, 195, 123, 36, |
| 38, 39, 40, 41, 42, 43, 56, 109, 235, 38, | 37, 38, 39, 40, 41, 42, 254, 252, 235, 37, |
| 39, 40, 41, 42, 43, 235, 252, 235, 195, 58, | 38, 39, 40, 41, 42, 235, 58, 235, 3, 60, |
| 257, 254, 3, 60, 244, 244, 244, 76, 125, -1, | 76, 125, 109, -1, 244, 244, 244, -1, -1, -1, |
| 257, 109, 252, 252, 252, -1, -1, 257, -1, 257, | 257, -1, 252, 252, 252, -1, -1, 257, -1, 257, |
| 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, | 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, |
| 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, | 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, |
| 185, 186, 187, 188, 189, 190, 191, 11, 12, 13, | 185, 186, 187, 188, 189, 190, 191, 10, 11, 12, |
| 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, | 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, |
| 24, 25, 26, 19, 20, -1, -1, 31, -1, -1, | 23, 24, 25, 13, -1, -1, -1, 30, 18, 19, |
| 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, | 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, |
| 36, 37, 38, 39, 40, 41, 42, 43, -1, -1, | 30, -1, -1, -1, -1, 35, 36, 37, 38, 39, |
| -1, -1, -1, 57, 11, 12, 13, 14, 15, 16, | 40, 41, 42, 56, 10, 11, 12, 13, 14, 15, |
| 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, | 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, |
| -1, -1, -1, -1, 31, -1, -1, 34, 35, 36, | -1, -1, -1, -1, 30, -1, -1, 33, 34, 35, |
| 37, 38, 39, 40, 41, 42, 43, 11, 12, -1, | 36, 37, 38, 39, 40, 41, 42, 10, 11, -1, |
| 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, | 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, |
| 24, 25, 26, -1, -1, -1, -1, 31, -1, -1, | 23, 24, 25, -1, -1, -1, -1, 30, -1, -1, |
| 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, | 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, |
| 11, -1, -1, 14, 15, 16, 17, 18, 19, 20, | 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, |
| 21, 22, 23, 24, 25, 26, -1, -1, -1, -1, | 23, 24, 25, -1, -1, -1, -1, 30, -1, -1, |
| 31, -1, -1, 34, 35, 36, 37, 38, 39, 40, | 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, |
| 41, 42, 43, 14, 15, 16, 17, 18, 19, 20, | 13, -1, -1, 16, 17, 18, 19, -1, 13, -1, |
| 21, 22, 23, 24, 25, 26, 19, 20, -1, -1, | -1, 24, 25, 18, 19, -1, -1, 30, -1, 18, |
| 31, -1, -1, 34, 35, 36, 37, 38, 39, 40, | 19, -1, 35, 36, 37, 38, 39, 40, 41, 42, |
| 41, 42, 43, -1, -1, 38, 39, 40, 41, 42, | 35, 36, 37, 38, 39, 40, 41, 42, 37, 38, |
| 43 | 39, 40, 41, 42 |
| }; | }; |
| /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing | /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing |
| symbol of state STATE-NUM. */ | symbol of state STATE-NUM. */ |
| static const yytype_uint8 yystos[] = | static const yytype_uint8 yystos[] = |
| { | { |
| 0, 4, 47, 52, 58, 63, 64, 65, 66, 67, | 0, 4, 46, 51, 57, 62, 63, 64, 65, 66, |
| 72, 79, 80, 81, 82, 83, 84, 91, 106, 107, | 71, 78, 79, 80, 81, 82, 83, 90, 105, 106, |
| 146, 150, 4, 4, 49, 52, 53, 55, 85, 86, | 145, 149, 4, 4, 48, 51, 52, 54, 84, 85, |
| 87, 88, 89, 90, 92, 93, 94, 95, 125, 126, | 86, 87, 88, 89, 91, 92, 93, 94, 124, 125, |
| 127, 128, 129, 130, 131, 132, 133, 139, 140, 141, | 126, 127, 128, 129, 130, 131, 132, 138, 139, 140, |
| 108, 0, 66, 81, 48, 49, 75, 5, 52, 59, | 107, 0, 65, 80, 47, 48, 74, 5, 51, 58, |
| 137, 138, 134, 4, 136, 87, 126, 130, 139, 4, | 136, 137, 133, 4, 135, 86, 125, 129, 138, 4, |
| 125, 126, 130, 3, 49, 53, 56, 96, 97, 100, | 124, 125, 129, 3, 48, 52, 55, 95, 96, 99, |
| 101, 4, 127, 129, 130, 55, 90, 125, 59, 87, | 100, 4, 126, 128, 129, 54, 89, 124, 58, 86, |
| 110, 4, 68, 69, 70, 71, 150, 4, 76, 77, | 109, 4, 67, 68, 69, 70, 149, 4, 75, 76, |
| 150, 74, 75, 150, 136, 138, 80, 54, 130, 98, | 149, 73, 74, 149, 135, 137, 79, 53, 129, 97, |
| 79, 4, 27, 28, 29, 30, 32, 33, 38, 39, | 78, 4, 26, 27, 28, 29, 31, 32, 37, 38, |
| 45, 46, 52, 56, 60, 61, 84, 107, 142, 143, | 44, 45, 51, 55, 59, 60, 83, 106, 141, 142, |
| 144, 148, 149, 109, 70, 150, 48, 50, 51, 4, | 143, 147, 148, 108, 69, 149, 47, 49, 50, 4, |
| 78, 150, 135, 4, 81, 82, 102, 103, 104, 105, | 77, 149, 134, 4, 80, 81, 101, 102, 103, 104, |
| 147, 54, 143, 143, 143, 143, 143, 143, 143, 143, | 146, 53, 142, 142, 142, 142, 142, 142, 142, 142, |
| 143, 79, 145, 145, 57, 11, 12, 13, 14, 15, | 142, 78, 144, 144, 56, 10, 11, 12, 13, 14, |
| 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, | 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, |
| 26, 31, 34, 35, 36, 37, 38, 39, 40, 41, | 25, 30, 33, 34, 35, 36, 37, 38, 39, 40, |
| 42, 43, 49, 53, 56, 111, 112, 113, 116, 117, | 41, 42, 48, 52, 55, 110, 111, 112, 115, 116, |
| 4, 48, 50, 80, 99, 57, 60, 61, 143, 143, | 4, 47, 49, 79, 98, 56, 59, 60, 142, 142, |
| 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, | 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, |
| 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, | 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, |
| 143, 143, 143, 143, 143, 114, 79, 120, 123, 119, | 142, 142, 142, 142, 142, 113, 78, 119, 122, 118, |
| 122, 142, 3, 112, 73, 50, 4, 103, 118, 121, | 121, 141, 3, 111, 72, 49, 4, 102, 117, 120, |
| 124, 147, 51, 54, 51, 57, 79, 51, 115, 123, | 123, 146, 50, 53, 50, 56, 78, 50, 114, 122, |
| 122, 121, 50 | 121, 120, 49 |
| }; | }; |
| /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ | /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ |
| static const yytype_uint8 yyr1[] = | static const yytype_uint8 yyr1[] = |
| { | { |
| 0, 62, 63, 63, 64, 64, 65, 66, 66, 67, | 0, 61, 62, 62, 63, 63, 64, 65, 65, 66, |
| 68, 68, 69, 69, 70, 71, 71, 73, 72, 74, | 67, 67, 68, 68, 69, 70, 70, 72, 71, 73, |
| 74, 75, 76, 76, 77, 77, 78, 78, 79, 79, | 73, 74, 75, 75, 76, 76, 77, 77, 78, 78, |
| 80, 80, 81, 81, 82, 82, 82, 83, 84, 85, | 79, 79, 80, 80, 81, 81, 81, 82, 83, 84, |
| 85, 86, 87, 87, 88, 89, 90, 90, 91, 92, | 84, 85, 86, 86, 87, 88, 89, 89, 90, 91, |
| 92, 92, 93, 94, 95, 96, 96, 96, 98, 99, | 91, 91, 92, 93, 94, 95, 95, 95, 97, 98, |
| 97, 100, 101, 102, 102, 102, 103, 104, 105, 105, | 96, 99, 100, 101, 101, 101, 102, 103, 104, 104, |
| 106, 108, 109, 107, 110, 111, 111, 112, 112, 112, | 105, 107, 108, 106, 109, 110, 110, 111, 111, 111, |
| 114, 115, 113, 116, 117, 118, 118, 119, 119, 120, | 113, 114, 112, 115, 116, 117, 117, 118, 118, 119, |
| 120, 121, 122, 123, 124, 124, 124, 125, 125, 126, | 119, 120, 121, 122, 123, 123, 123, 124, 124, 125, |
| 126, 127, 128, 129, 129, 130, 130, 130, 130, 131, | 125, 126, 127, 128, 128, 129, 129, 129, 129, 130, |
| 132, 134, 135, 133, 136, 137, 137, 138, 139, 139, | 131, 133, 134, 132, 135, 136, 136, 137, 138, 138, |
| 140, 141, 142, 143, 143, 143, 143, 143, 143, 143, | 139, 140, 141, 142, 142, 142, 142, 142, 142, 142, |
| 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, | 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, |
| 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, | 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, |
| 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, | 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, |
| 143, 143, 143, 143, 143, 143, 144, 145, 146, 147, | 142, 142, 142, 142, 142, 142, 143, 144, 145, 146, |
| 148, 149, 150 | 147, 148, 149 |
| }; | }; |
| /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ | /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ |
| Line 901 static const yytype_uint8 yyr2[] = | Line 902 static const yytype_uint8 yyr2[] = |
| #define YYRECOVERING() (!!yyerrstatus) | #define YYRECOVERING() (!!yyerrstatus) |
| #define YYBACKUP(Token, Value) \ | #define YYBACKUP(Token, Value) \ |
| do \ | do \ |
| if (yychar == YYEMPTY) \ | if (yychar == YYEMPTY) \ |
| { \ | { \ |
| yychar = (Token); \ | yychar = (Token); \ |
| yylval = (Value); \ | yylval = (Value); \ |
| YYPOPSTACK (yylen); \ | YYPOPSTACK (yylen); \ |
| yystate = *yyssp; \ | yystate = *yyssp; \ |
| goto yybackup; \ | goto yybackup; \ |
| } \ | } \ |
| else \ | else \ |
| { \ | { \ |
| yyerror (pc, YY_("syntax error: cannot back up")); \ | yyerror (pc, YY_("syntax error: cannot back up")); \ |
| YYERROR; \ | YYERROR; \ |
| } \ | } \ |
| while (0) | while (0) |
| /* Error token number */ | /* Error token number */ |
| #define YYTERROR 1 | #define YYTERROR 1 |
| Line 956 do { | Line 957 do { |
| } while (0) | } while (0) |
| /*----------------------------------------. | /*-----------------------------------. |
| | Print this symbol's value on YYOUTPUT. | | | Print this symbol's value on YYO. | |
| `----------------------------------------*/ | `-----------------------------------*/ |
| static void | static void |
| yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, Parse_control* pc) | yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, Parse_control* pc) |
| { | { |
| FILE *yyo = yyoutput; | FILE *yyoutput = yyo; |
| YYUSE (yyo); | YYUSE (yyoutput); |
| YYUSE (pc); | YYUSE (pc); |
| if (!yyvaluep) | if (!yyvaluep) |
| return; | return; |
| # ifdef YYPRINT | # ifdef YYPRINT |
| if (yytype < YYNTOKENS) | if (yytype < YYNTOKENS) |
| YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); | YYPRINT (yyo, yytoknum[yytype], *yyvaluep); |
| # endif | # endif |
| YYUSE (yytype); | YYUSE (yytype); |
| } | } |
| /*--------------------------------. | /*---------------------------. |
| | Print this symbol on YYOUTPUT. | | | Print this symbol on YYO. | |
| `--------------------------------*/ | `---------------------------*/ |
| static void | static void |
| yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, Parse_control* pc) | yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, Parse_control* pc) |
| { | { |
| YYFPRINTF (yyoutput, "%s %s (", | YYFPRINTF (yyo, "%s %s (", |
| yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); | yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); |
| yy_symbol_value_print (yyoutput, yytype, yyvaluep, pc); | yy_symbol_value_print (yyo, yytype, yyvaluep, pc); |
| YYFPRINTF (yyoutput, ")"); | YYFPRINTF (yyo, ")"); |
| } | } |
| /*------------------------------------------------------------------. | /*------------------------------------------------------------------. |
| Line 1021 do { | Line 1022 do { |
| static void | static void |
| yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, Parse_control* pc) | yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, Parse_control* pc) |
| { | { |
| unsigned long int yylno = yyrline[yyrule]; | unsigned long yylno = yyrline[yyrule]; |
| int yynrhs = yyr2[yyrule]; | int yynrhs = yyr2[yyrule]; |
| int yyi; | int yyi; |
| YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", | YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", |
| Line 1032 yy_reduce_print (yytype_int16 *yyssp, YY | Line 1033 yy_reduce_print (yytype_int16 *yyssp, YY |
| YYFPRINTF (stderr, " $%d = ", yyi + 1); | YYFPRINTF (stderr, " $%d = ", yyi + 1); |
| yy_symbol_print (stderr, | yy_symbol_print (stderr, |
| yystos[yyssp[yyi + 1 - yynrhs]], | yystos[yyssp[yyi + 1 - yynrhs]], |
| &(yyvsp[(yyi + 1) - (yynrhs)]) | &yyvsp[(yyi + 1) - (yynrhs)] |
| , pc); | , pc); |
| YYFPRINTF (stderr, "\n"); | YYFPRINTF (stderr, "\n"); |
| } | } |
| Line 1136 yytnamerr (char *yyres, const char *yyst | Line 1137 yytnamerr (char *yyres, const char *yyst |
| case '\\': | case '\\': |
| if (*++yyp != '\\') | if (*++yyp != '\\') |
| goto do_not_strip_quotes; | goto do_not_strip_quotes; |
| /* Fall through. */ | else |
| goto append; | |
| append: | |
| default: | default: |
| if (yyres) | if (yyres) |
| yyres[yyn] = *yyp; | yyres[yyn] = *yyp; |
| Line 1154 yytnamerr (char *yyres, const char *yyst | Line 1158 yytnamerr (char *yyres, const char *yyst |
| if (! yyres) | if (! yyres) |
| return yystrlen (yystr); | return yystrlen (yystr); |
| return yystpcpy (yyres, yystr) - yyres; | return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres); |
| } | } |
| # endif | # endif |
| Line 1232 yysyntax_error (YYSIZE_T *yymsg_alloc, c | Line 1236 yysyntax_error (YYSIZE_T *yymsg_alloc, c |
| yyarg[yycount++] = yytname[yyx]; | yyarg[yycount++] = yytname[yyx]; |
| { | { |
| YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); | YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); |
| if (! (yysize <= yysize1 | if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) |
| && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) | yysize = yysize1; |
| else | |
| return 2; | return 2; |
| yysize = yysize1; | |
| } | } |
| } | } |
| } | } |
| Line 1247 yysyntax_error (YYSIZE_T *yymsg_alloc, c | Line 1251 yysyntax_error (YYSIZE_T *yymsg_alloc, c |
| case N: \ | case N: \ |
| yyformat = S; \ | yyformat = S; \ |
| break | break |
| default: /* Avoid compiler warnings. */ | |
| YYCASE_(0, YY_("syntax error")); | YYCASE_(0, YY_("syntax error")); |
| YYCASE_(1, YY_("syntax error, unexpected %s")); | YYCASE_(1, YY_("syntax error, unexpected %s")); |
| YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); | YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); |
| Line 1258 yysyntax_error (YYSIZE_T *yymsg_alloc, c | Line 1263 yysyntax_error (YYSIZE_T *yymsg_alloc, c |
| { | { |
| YYSIZE_T yysize1 = yysize + yystrlen (yyformat); | YYSIZE_T yysize1 = yysize + yystrlen (yyformat); |
| if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) | if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) |
| yysize = yysize1; | |
| else | |
| return 2; | return 2; |
| yysize = yysize1; | |
| } | } |
| if (*yymsg_alloc < yysize) | if (*yymsg_alloc < yysize) |
| Line 1391 YYSTYPE yylval YY_INITIAL_VALUE (= yyval | Line 1397 YYSTYPE yylval YY_INITIAL_VALUE (= yyval |
| yychar = YYEMPTY; /* Cause a token to be read. */ | yychar = YYEMPTY; /* Cause a token to be read. */ |
| goto yysetstate; | 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 | /* In all cases, when you get here, the value and location stacks |
| have just been pushed. So pushing a state here evens the stacks. */ | have just been pushed. So pushing a state here evens the stacks. */ |
| yyssp++; | yyssp++; |
| yysetstate: | |
| *yyssp = yystate; | /*--------------------------------------------------------------------. |
| | yynewstate -- set current state (the top of the stack) to yystate. | | |
| `--------------------------------------------------------------------*/ | |
| yysetstate: | |
| *yyssp = (yytype_int16) yystate; | |
| if (yyss + yystacksize - 1 <= 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. */ | /* Get the current used size of the three stacks, in elements. */ |
| YYSIZE_T yysize = yyssp - yyss + 1; | YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1); |
| #ifdef yyoverflow | # if defined yyoverflow |
| { | { |
| /* Give user a chance to reallocate the stack. Use copies of | /* Give user a chance to reallocate the stack. Use copies of |
| these so that the &'s don't force the real ones into | these so that the &'s don't force the real ones into |
| Line 1423 YYSTYPE yylval YY_INITIAL_VALUE (= yyval | Line 1437 YYSTYPE yylval YY_INITIAL_VALUE (= yyval |
| &yyss1, yysize * sizeof (*yyssp), | &yyss1, yysize * sizeof (*yyssp), |
| &yyvs1, yysize * sizeof (*yyvsp), | &yyvs1, yysize * sizeof (*yyvsp), |
| &yystacksize); | &yystacksize); |
| yyss = yyss1; | yyss = yyss1; |
| yyvs = yyvs1; | yyvs = yyvs1; |
| } | } |
| #else /* no yyoverflow */ | # else /* defined YYSTACK_RELOCATE */ |
| # ifndef YYSTACK_RELOCATE | |
| goto yyexhaustedlab; | |
| # else | |
| /* Extend the stack our own way. */ | /* Extend the stack our own way. */ |
| if (YYMAXDEPTH <= yystacksize) | if (YYMAXDEPTH <= yystacksize) |
| goto yyexhaustedlab; | goto yyexhaustedlab; |
| Line 1446 YYSTYPE yylval YY_INITIAL_VALUE (= yyval | Line 1456 YYSTYPE yylval YY_INITIAL_VALUE (= yyval |
| goto yyexhaustedlab; | goto yyexhaustedlab; |
| YYSTACK_RELOCATE (yyss_alloc, yyss); | YYSTACK_RELOCATE (yyss_alloc, yyss); |
| YYSTACK_RELOCATE (yyvs_alloc, yyvs); | YYSTACK_RELOCATE (yyvs_alloc, yyvs); |
| # undef YYSTACK_RELOCATE | # undef YYSTACK_RELOCATE |
| if (yyss1 != yyssa) | if (yyss1 != yyssa) |
| YYSTACK_FREE (yyss1); | YYSTACK_FREE (yyss1); |
| } | } |
| # endif | # endif |
| #endif /* no yyoverflow */ | |
| yyssp = yyss + yysize - 1; | yyssp = yyss + yysize - 1; |
| yyvsp = yyvs + yysize - 1; | yyvsp = yyvs + yysize - 1; |
| YYDPRINTF ((stderr, "Stack size increased to %lu\n", | YYDPRINTF ((stderr, "Stack size increased to %lu\n", |
| (unsigned long int) yystacksize)); | (unsigned long) yystacksize)); |
| if (yyss + yystacksize - 1 <= yyssp) | if (yyss + yystacksize - 1 <= yyssp) |
| YYABORT; | YYABORT; |
| } | } |
| #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ | |
| YYDPRINTF ((stderr, "Entering state %d\n", yystate)); | YYDPRINTF ((stderr, "Entering state %d\n", yystate)); |
| Line 1470 YYSTYPE yylval YY_INITIAL_VALUE (= yyval | Line 1480 YYSTYPE yylval YY_INITIAL_VALUE (= yyval |
| goto yybackup; | goto yybackup; |
| /*-----------. | /*-----------. |
| | yybackup. | | | yybackup. | |
| `-----------*/ | `-----------*/ |
| yybackup: | yybackup: |
| /* Do appropriate processing given the current state. Read a | /* Do appropriate processing given the current state. Read a |
| lookahead token if we need one and don't already have one. */ | lookahead token if we need one and don't already have one. */ |
| Line 1547 yydefault: | Line 1557 yydefault: |
| /*-----------------------------. | /*-----------------------------. |
| | yyreduce -- Do a reduction. | | | yyreduce -- do a reduction. | |
| `-----------------------------*/ | `-----------------------------*/ |
| yyreduce: | yyreduce: |
| /* yyn is the number of a rule to reduce with. */ | /* yyn is the number of a rule to reduce with. */ |
| Line 1568 yyreduce: | Line 1578 yyreduce: |
| switch (yyn) | switch (yyn) |
| { | { |
| case 2: | case 2: |
| #line 142 "compile.y" /* yacc.c:1646 */ | #line 148 "compile.y" /* yacc.c:1652 */ |
| { | { |
| Method* method=new Method(Method::CT_ANY, | Method* method=new Method(Method::CT_ANY, 0, 0 /*min, max numbered_params_count*/, 0 /*param_names*/, 0 /*local_names*/, yyvsp[0] /*parser_code*/, 0 /*native_code*/, PC.cclass->is_vars_local()); |
| 0, 0, /*min, max numbered_params_count*/ | |
| 0/*param_names*/, 0/*local_names*/, | |
| (yyvsp[0])/*parser_code*/, 0/*native_code*/); | |
| PC.cclass->set_method(PC.alias_method(main_method_name), method); | PC.cclass->set_method(PC.alias_method(main_method_name), method); |
| } | } |
| #line 1580 "compile.tab.C" /* yacc.c:1646 */ | #line 1587 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 9: | case 9: |
| #line 157 "compile.y" /* yacc.c:1646 */ | #line 160 "compile.y" /* yacc.c:1652 */ |
| { | { |
| const String& command=LA2S(*(yyvsp[-2]))->trim(String::TRIM_END); | const String& command=LA2S(*yyvsp[-2])->trim(String::TRIM_END); |
| YYSTYPE strings_code=(yyvsp[0]); | YYSTYPE strings_code=yyvsp[0]; |
| if(strings_code->count()<1*OPERATIONS_PER_OPVALUE) { | if(strings_code->count()<1*OPERATIONS_PER_OPVALUE) |
| strcpy(PC.error, "@"); | YYERROR3("@", command.cstr(), " is empty"); |
| strcat(PC.error, command.cstr()); | |
| strcat(PC.error, " is empty"); | |
| YYERROR; | |
| } | |
| if(command==CLASS_NAME) { | if(command==CLASS_NAME) { |
| if(strings_code->count()==1*OPERATIONS_PER_OPVALUE) { | if(strings_code->count()==1*OPERATIONS_PER_OPVALUE) { |
| CLASS_ADD; | CLASS_ADD; |
| // new class' name | // new class' name |
| const String& name=LA2S(*strings_code)->trim(String::TRIM_END); | const String& name=LA2S(*strings_code)->trim(String::TRIM_END); |
| // creating the class | // creating the class |
| VStateless_class* cclass=new VClass; | VStateless_class* cclass=new VClass(name.cstr(), PC.request.get_used_filespec(PC.file_no)); |
| PC.cclass_new=cclass; | PC.cclass_new=cclass; |
| PC.cclass_new->set_name(name); | |
| PC.append=false; | PC.append=false; |
| } else { | } else { |
| strcpy(PC.error, "@" CLASS_NAME " must contain only one line with class name (contains more then one)"); | YYERROR1("@" CLASS_NAME " must contain only one line with class name (contains more then one)"); |
| YYERROR; | |
| } | } |
| } else if(command==USE_CONTROL_METHOD_NAME) { | } else if(command==USE_CONTROL_METHOD_NAME) { |
| CLASS_ADD; | CLASS_ADD; |
| for(size_t i=0; i<strings_code->count(); i+=OPERATIONS_PER_OPVALUE){ | for(size_t i=0; i<strings_code->count(); i+=OPERATIONS_PER_OPVALUE){ |
| PC.request.use_file(PC.request.main_class, LA2S(*strings_code, i)->trim(String::TRIM_END), | PC.request.use_file(LA2S(*strings_code, i)->trim(String::TRIM_END), PC.request.get_used_filespec(PC.file_no), strings_code->get(i+1).origin); |
| PC.request.get_used_filename(PC.file_no), strings_code->get(i+1).origin); | |
| } | } |
| } else if(command==BASE_NAME) { | } else if(command==BASE_NAME) { |
| if(PC.append){ | if(PC.append) |
| strcpy(PC.error, "can't set base while appending methods to class '"); | YYERROR3("can't set base while appending methods to class '", PC.cclass->type(), "'"); |
| strncat(PC.error, PC.cclass->name().cstr(), MAX_STRING/2); | |
| strcat(PC.error, "'"); | |
| YYERROR; | |
| } | |
| CLASS_ADD; | CLASS_ADD; |
| if(PC.cclass->base_class()) { // already changed from default? | if(PC.cclass->base_class()) // already changed from default? |
| strcpy(PC.error, "class already have a base '"); | YYERROR3("class already have a base '", PC.cclass->base_class()->type(), "'"); |
| strncat(PC.error, PC.cclass->base_class()->name().cstr(), MAX_STRING/2); | |
| strcat(PC.error, "'"); | |
| YYERROR; | |
| } | |
| if(strings_code->count()==1*OPERATIONS_PER_OPVALUE) { | if(strings_code->count()==1*OPERATIONS_PER_OPVALUE) { |
| const String& base_name=LA2S(*strings_code)->trim(String::TRIM_END); | const String& base_name=LA2S(*strings_code)->trim(String::TRIM_END); |
| if(Value* base_class_value=PC.request.get_class(base_name)) { | if(VStateless_class *base_class=PC.request.get_class(base_name)) { |
| // @CLASS == @BASE sanity check | // @CLASS == @BASE sanity check |
| if(VStateless_class *base_class=base_class_value->get_class()) { | if(PC.cclass==base_class) |
| if(PC.cclass==base_class) { | YYERROR1("@" CLASS_NAME " equals @" BASE_NAME); |
| strcpy(PC.error, "@" CLASS_NAME " equals @" BASE_NAME); | PC.cclass->get_class()->set_base(base_class); |
| YYERROR; | |
| } | |
| PC.cclass->get_class()->set_base(base_class); | |
| } else { // they asked to derive from a class without methods ['env' & co] | |
| strcpy(PC.error, base_name.cstr()); | |
| strcat(PC.error, ": you can not derive from this class in @" BASE_NAME); | |
| YYERROR; | |
| } | |
| } else { | } else { |
| strcpy(PC.error, base_name.cstr()); | YYERROR3("'", base_name.cstr(), "': undefined class in @" BASE_NAME); |
| strcat(PC.error, ": undefined class in @" BASE_NAME); | |
| YYERROR; | |
| } | } |
| } else { | } else { |
| strcpy(PC.error, "@" BASE_NAME " must contain sole name"); | YYERROR1("@" BASE_NAME " must contain sole name"); |
| YYERROR; | |
| } | } |
| } else if(command==OPTIONS_CONTROL_METHOD_NAME) { | } else if(command==OPTIONS_CONTROL_METHOD_NAME) { |
| for(size_t i=0; i<strings_code->count(); i+=OPERATIONS_PER_OPVALUE) { | for(size_t i=0; i<strings_code->count(); i+=OPERATIONS_PER_OPVALUE) { |
| const String& option=LA2S(*strings_code, i)->trim(String::TRIM_END); | const String& option=LA2S(*strings_code, i)->trim(String::TRIM_END); |
| if(option==OPTION_ALL_VARS_LOCAL_NAME){ | if(option==Symbols::LOCALS_SYMBOL){ |
| PC.set_all_vars_local(); | PC.set_all_vars_local(); |
| } else if(option==OPTION_PARTIAL_CLASS){ | } else if(option==Symbols::PARTIAL_SYMBOL){ |
| if(PC.cclass_new){ | if(PC.cclass_new){ |
| if(VStateless_class* existed=PC.get_existed_class(PC.cclass_new)){ | if(VStateless_class* existed=PC.get_existed_class(PC.cclass_new)){ |
| if(!PC.reuse_existed_class(existed)){ | if(!PC.reuse_existed_class(existed)) |
| strcpy(PC.error, "can't append methods to '"); | YYERROR3("can't append methods to '", PC.cclass_new->type(), "' - the class wasn't marked as partial"); |
| strncat(PC.error, PC.cclass_new->name().cstr(), MAX_STRING/2); | |
| strcat(PC.error, "' - the class wasn't marked as partial"); | |
| YYERROR; | |
| } | |
| } else { | } else { |
| // marks the new class as partial. we will be able to add methods here later. | // marks the new class as partial. we will be able to add methods here later. |
| PC.cclass_new->set_partial(); | PC.cclass_new->set_partial(); |
| } | } |
| } else { | } else { |
| strcpy(PC.error, "'" OPTION_PARTIAL_CLASS "' option should be used straight after @" CLASS_NAME); | YYERROR1("'partial' option should be used straight after @" CLASS_NAME); |
| YYERROR; | |
| } | } |
| } else if(option==method_call_type_static){ | } else if(option==Symbols::STATIC_SYMBOL){ |
| PC.set_methods_call_type(Method::CT_STATIC); | PC.set_methods_call_type(Method::CT_STATIC); |
| } else if(option==method_call_type_dynamic){ | } else if(option==Symbols::DYNAMIC_SYMBOL){ |
| PC.set_methods_call_type(Method::CT_DYNAMIC); | PC.set_methods_call_type(Method::CT_DYNAMIC); |
| } else { | } else { |
| strcpy(PC.error, "'"); | YYERROR3("'", option.cstr(), "' invalid option. valid options are 'partial', 'locals', 'static' and 'dynamic'"); |
| strncat(PC.error, option.cstr(), MAX_STRING/2); | |
| strcat(PC.error, "' invalid option. valid options are " | |
| "'" OPTION_PARTIAL_CLASS "', '" OPTION_ALL_VARS_LOCAL_NAME "'" | |
| ", '" METHOD_CALL_TYPE_STATIC "' and '" METHOD_CALL_TYPE_DYNAMIC "'" | |
| ); | |
| YYERROR; | |
| } | } |
| } | } |
| } else { | } else { |
| strcpy(PC.error, "'"); | YYERROR3("'", command.cstr(), "' invalid special name. valid names are '" CLASS_NAME "', '" USE_CONTROL_METHOD_NAME "', '" BASE_NAME "' and '" OPTIONS_CONTROL_METHOD_NAME "'."); |
| strncat(PC.error, command.cstr(), MAX_STRING/2); | |
| strcat(PC.error, "' invalid special name. valid names are " | |
| "'" CLASS_NAME "', '" USE_CONTROL_METHOD_NAME "', '" BASE_NAME "' and '" OPTIONS_CONTROL_METHOD_NAME "'."); | |
| YYERROR; | |
| } | } |
| } | } |
| #line 1696 "compile.tab.C" /* yacc.c:1646 */ | #line 1662 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 13: | case 13: |
| #line 269 "compile.y" /* yacc.c:1646 */ | #line 231 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-1]); P(*(yyval), *(yyvsp[0])); } | { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]); } |
| #line 1702 "compile.tab.C" /* yacc.c:1646 */ | #line 1668 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 17: | case 17: |
| #line 273 "compile.y" /* yacc.c:1646 */ | #line 235 "compile.y" /* yacc.c:1652 */ |
| { | { |
| CLASS_ADD; | CLASS_ADD; |
| PC.explicit_result=false; | PC.explicit_result=false; |
| YYSTYPE params_names_code=(yyvsp[-3]); | YYSTYPE params_names_code=yyvsp[-3]; |
| ArrayString* params_names=0; | ArrayString* params_names=0; |
| if(int size=params_names_code->count()) { | if(int size=params_names_code->count()) { |
| params_names=new ArrayString; | params_names=new ArrayString; |
| Line 1715 yyreduce: | Line 1681 yyreduce: |
| *params_names+=LA2S(*params_names_code, i); | *params_names+=LA2S(*params_names_code, i); |
| } | } |
| YYSTYPE locals_names_code=(yyvsp[-2]); | YYSTYPE locals_names_code=yyvsp[-2]; |
| ArrayString* locals_names=0; | ArrayString* locals_names=0; |
| bool all_vars_local=false; | bool all_vars_local=PC.cclass->is_vars_local(); |
| if(int size=locals_names_code->count()) { | if(int size=locals_names_code->count()) { |
| locals_names=new ArrayString; | locals_names=new ArrayString; |
| for(int i=0; i<size; i+=OPERATIONS_PER_OPVALUE) { | for(int i=0; i<size; i+=OPERATIONS_PER_OPVALUE) { |
| const String* local_name=LA2S(*locals_names_code, i); | const String* local_name=LA2S(*locals_names_code, i); |
| if(*local_name==RESULT_VAR_NAME) | if(SYMBOLS_EQ(*local_name,RESULT_SYMBOL)) |
| PC.explicit_result=true; | PC.explicit_result=true; |
| else if(*local_name==OPTION_ALL_VARS_LOCAL_NAME) | else if(SYMBOLS_EQ(*local_name,LOCALS_SYMBOL)) |
| all_vars_local=true; | all_vars_local=true; |
| else | else |
| *locals_names+=local_name; | *locals_names+=local_name; |
| } | } |
| } | } |
| if(!all_vars_local && PC.cclass && PC.cclass->is_vars_local()) | |
| all_vars_local=true; | |
| Method* method=new Method( | Method* method=new Method( |
| //name, | //name, |
| GetMethodCallType(PC, *(yyvsp[-4])), | GetMethodCallType(PC, *yyvsp[-4]), |
| 0, 0/*min,max numbered_params_count*/, | 0, 0/*min,max numbered_params_count*/, |
| params_names, locals_names, | params_names, locals_names, |
| 0/*to be filled later in next {} */, 0, all_vars_local); | 0/*to be filled later in next {} */, 0, all_vars_local); |
| *reinterpret_cast<Method**>(&(yyval))=method; | *reinterpret_cast<Method**>(&yyval)=method; |
| } | } |
| #line 1746 "compile.tab.C" /* yacc.c:1646 */ | #line 1711 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 18: | case 18: |
| #line 311 "compile.y" /* yacc.c:1646 */ | #line 272 "compile.y" /* yacc.c:1652 */ |
| { | { |
| Method* method=reinterpret_cast<Method*>((yyvsp[-1])); | Method* method=reinterpret_cast<Method*>(yyvsp[-1]); |
| // fill in the code | // fill in the code |
| method->parser_code=(yyvsp[0]); | method->parser_code=yyvsp[0]; |
| // register in class | // register in class |
| const String& name=*LA2S(*(yyvsp[-6])); | const String& name=*LA2S(*yyvsp[-6]); |
| PC.cclass->set_method(PC.alias_method(name), method); | PC.cclass->set_method(PC.alias_method(name), method); |
| } | } |
| #line 1760 "compile.tab.C" /* yacc.c:1646 */ | #line 1725 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 21: | case 21: |
| #line 322 "compile.y" /* yacc.c:1646 */ | #line 283 "compile.y" /* yacc.c:1652 */ |
| {(yyval)=(yyvsp[-1]);} | {yyval=yyvsp[-1];} |
| #line 1766 "compile.tab.C" /* yacc.c:1646 */ | #line 1731 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 25: | case 25: |
| #line 324 "compile.y" /* yacc.c:1646 */ | #line 285 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-2]); P(*(yyval), *(yyvsp[0])); } | { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); } |
| #line 1772 "compile.tab.C" /* yacc.c:1646 */ | #line 1737 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 31: | case 31: |
| #line 332 "compile.y" /* yacc.c:1646 */ | #line 293 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-1]); P(*(yyval), *(yyvsp[0])); } | { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]); } |
| #line 1778 "compile.tab.C" /* yacc.c:1646 */ | #line 1743 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 37: | case 37: |
| #line 338 "compile.y" /* yacc.c:1646 */ | #line 299 "compile.y" /* yacc.c:1652 */ |
| { | { |
| (yyval)=N(); | yyval=N(); |
| YYSTYPE code=(yyvsp[0]); | YYSTYPE code=yyvsp[0]; |
| size_t count=code->count(); | size_t count=code->count(); |
| #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT | #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT |
| if( | if(count!=3 || !change_first(*code, OP::OP_VALUE__GET_ELEMENT, /*=>*/OP::OP_VALUE__GET_ELEMENT__WRITE) ) |
| count!=3 | |
| || !change_first(*code, OP::OP_VALUE__GET_ELEMENT, /*=>*/OP::OP_VALUE__GET_ELEMENT__WRITE) | |
| ) | |
| #endif | #endif |
| #ifdef OPTIMIZE_BYTECODE_GET_SELF_ELEMENT | #ifdef OPTIMIZE_BYTECODE_GET_SELF_ELEMENT |
| if( | if(count!=3 || !change_first(*code, OP::OP_WITH_SELF__VALUE__GET_ELEMENT, /*=>*/OP::OP_WITH_SELF__VALUE__GET_ELEMENT__WRITE) ) |
| count!=3 | |
| || !change_first(*code, OP::OP_WITH_SELF__VALUE__GET_ELEMENT, /*=>*/OP::OP_WITH_SELF__VALUE__GET_ELEMENT__WRITE) | |
| ) | |
| #endif | #endif |
| #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT | #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT |
| if( | if(count!=5 || !change_first(*code, OP::OP_GET_OBJECT_ELEMENT, /*=>*/OP::OP_GET_OBJECT_ELEMENT__WRITE) ) |
| count!=5 | |
| || !change_first(*code, OP::OP_GET_OBJECT_ELEMENT, /*=>*/OP::OP_GET_OBJECT_ELEMENT__WRITE) | |
| ) | |
| #endif | #endif |
| #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT | #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT |
| if( | if(count!=5 || !change_first(*code, OP::OP_GET_OBJECT_VAR_ELEMENT, /*=>*/OP::OP_GET_OBJECT_VAR_ELEMENT__WRITE) ) |
| count!=5 | |
| || !change_first(*code, OP::OP_GET_OBJECT_VAR_ELEMENT, /*=>*/OP::OP_GET_OBJECT_VAR_ELEMENT__WRITE) | |
| ) | |
| #endif | #endif |
| #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL | #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL |
| if( | if(!change(*code, count-1/* last */, OP::OP_GET_ELEMENT__SPECIAL, /*=>*/OP::OP_GET_ELEMENT__SPECIAL__WRITE) ) |
| !change(*code, count-1/* last */, OP::OP_GET_ELEMENT__SPECIAL, /*=>*/OP::OP_GET_ELEMENT__SPECIAL__WRITE) | |
| ) | |
| #endif | #endif |
| { | { |
| change_or_append(*code, count-1 /* last */, | change_or_append(*code, count-1 /* last */, OP::OP_GET_ELEMENT, /*=>*/OP::OP_GET_ELEMENT__WRITE, /*or */OP::OP_WRITE_VALUE ); /* value=pop; wcontext.write(value) */ |
| OP::OP_GET_ELEMENT, /*=>*/OP::OP_GET_ELEMENT__WRITE, | |
| /*or */OP::OP_WRITE_VALUE | |
| ); /* value=pop; wcontext.write(value) */ | |
| } | } |
| P(*(yyval), *code); | P(*yyval, *code); |
| } | } |
| #line 1831 "compile.tab.C" /* yacc.c:1646 */ | #line 1779 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 38: | case 38: |
| #line 386 "compile.y" /* yacc.c:1646 */ | #line 330 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[0]); } | { yyval=yyvsp[0]; } |
| #line 1837 "compile.tab.C" /* yacc.c:1646 */ | #line 1785 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 41: | case 41: |
| #line 388 "compile.y" /* yacc.c:1646 */ | #line 332 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-1]); } | { yyval=yyvsp[-1]; } |
| #line 1843 "compile.tab.C" /* yacc.c:1646 */ | #line 1791 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 44: | case 44: |
| #line 392 "compile.y" /* yacc.c:1646 */ | #line 336 "compile.y" /* yacc.c:1652 */ |
| { | { |
| (yyval)=N(); | yyval=N(); |
| YYSTYPE diving_code=(yyvsp[0]); | YYSTYPE diving_code=yyvsp[0]; |
| size_t count=diving_code->count(); | size_t count=diving_code->count(); |
| if(maybe_make_self(*(yyval), *diving_code, count)) { | if(maybe_make_self(*yyval, *diving_code, count)) { |
| // $self. | // $self. |
| } else | } else |
| #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT | #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT |
| if(maybe_make_get_object_element(*(yyval), *diving_code, count)){ | if(maybe_make_get_object_element(*yyval, *diving_code, count)){ |
| // optimization for $object.field + ^object.method[ | // optimization for $object.field + ^object.method[ |
| } else | } else |
| #endif | #endif |
| #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT | #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT |
| if(maybe_make_get_object_var_element(*(yyval), *diving_code, count)){ | if(maybe_make_get_object_var_element(*yyval, *diving_code, count)){ |
| // optimization for $object.$var | // optimization for $object.$var |
| } else | } else |
| #endif | #endif |
| #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT | #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT |
| if( | if(count>=4 && (*diving_code)[0].code==OP::OP_VALUE && (*diving_code)[3].code==OP::OP_GET_ELEMENT ){ |
| count>=4 | |
| && (*diving_code)[0].code==OP::OP_VALUE | |
| && (*diving_code)[3].code==OP::OP_GET_ELEMENT | |
| ){ | |
| // optimization | // optimization |
| O(*(yyval), | O(*yyval, |
| (PC.in_call_value && count==4) | (PC.in_call_value && count==4) |
| ? OP::OP_VALUE__GET_ELEMENT_OR_OPERATOR // ^object[ : OP_VALUE+origin+string+OP_GET_ELEMENT => OP_VALUE__GET_ELEMENT_OR_OPERATOR+origin+string | ? OP::OP_VALUE__GET_ELEMENT_OR_OPERATOR // ^object[ : OP_VALUE+origin+string+OP_GET_ELEMENT => OP_VALUE__GET_ELEMENT_OR_OPERATOR+origin+string |
| : OP::OP_VALUE__GET_ELEMENT // $object : OP_VALUE+origin+string+OP_GET_ELEMENT => OP_VALUE__GET_ELEMENT+origin+string | : OP::OP_VALUE__GET_ELEMENT // $object : OP_VALUE+origin+string+OP_GET_ELEMENT => OP_VALUE__GET_ELEMENT+origin+string |
| ); | ); |
| P(*(yyval), *diving_code, 1/*offset*/, 2/*limit*/); // copy origin+value | P(*yyval, *diving_code, 1/*offset*/, 2/*limit*/); // copy origin+value |
| if(count>4) | if(count>4) |
| P(*(yyval), *diving_code, 4); // copy tail | P(*yyval, *diving_code, 4); // copy tail |
| } else { | } else { |
| O(*(yyval), OP::OP_WITH_READ); /* stack: starting context */ | O(*yyval, OP::OP_WITH_READ); /* stack: starting context */ |
| P(*(yyval), *diving_code); | P(*yyval, *diving_code); |
| } | } |
| #else | #else |
| { | { |
| O(*(yyval), OP::OP_WITH_READ); /* stack: starting context */ | O(*yyval, OP::OP_WITH_READ); /* stack: starting context */ |
| // ^if OP_ELEMENT => ^if OP_ELEMENT_OR_OPERATOR | // ^if OP_ELEMENT => ^if OP_ELEMENT_OR_OPERATOR |
| // optimized OP_VALUE+origin+string+OP_GET_ELEMENT. => OP_VALUE+origin+string+OP_GET_ELEMENT_OR_OPERATOR. | // optimized OP_VALUE+origin+string+OP_GET_ELEMENT. => OP_VALUE+origin+string+OP_GET_ELEMENT_OR_OPERATOR. |
| if(PC.in_call_value && count==4) | if(PC.in_call_value && count==4) |
| diving_code->put(count-1, OP::OP_GET_ELEMENT_OR_OPERATOR); | diving_code->put(count-1, OP::OP_GET_ELEMENT_OR_OPERATOR); |
| P(*(yyval), *diving_code); | P(*yyval, *diving_code); |
| } | } |
| #endif | #endif |
| /* diving code; stack: current context */ | /* diving code; stack: current context */ |
| } | } |
| #line 1901 "compile.tab.C" /* yacc.c:1646 */ | #line 1845 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 45: | case 45: |
| #line 445 "compile.y" /* yacc.c:1646 */ | #line 385 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-1]); P(*(yyval), *(yyvsp[0])); } | { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]); } |
| #line 1907 "compile.tab.C" /* yacc.c:1646 */ | #line 1851 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 47: | case 47: |
| #line 446 "compile.y" /* yacc.c:1646 */ | #line 386 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-1]); P(*(yyval), *(yyvsp[0])); } | { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]); } |
| #line 1913 "compile.tab.C" /* yacc.c:1646 */ | #line 1857 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 48: | case 48: |
| #line 450 "compile.y" /* yacc.c:1646 */ | #line 390 "compile.y" /* yacc.c:1652 */ |
| { | { |
| (yyval)=N(); | yyval=N(); |
| #ifdef OPTIMIZE_BYTECODE_CONSTRUCT | #ifdef OPTIMIZE_BYTECODE_CONSTRUCT |
| if(maybe_optimize_construct(*(yyval), *(yyvsp[-1]), *(yyvsp[0]))){ | if(maybe_optimize_construct(*yyval, *yyvsp[-1], *yyvsp[0])){ |
| // $a(expr), $.a(expr), $a[value], $.a[value], $self.a[value], $self.a(expr) | // $a(expr), $.a(expr), $a[value], $.a[value], $self.a[value], $self.a(expr) |
| } else | } else |
| #endif | #endif |
| { | { |
| P(*(yyval), *(yyvsp[-1])); /* stack: context,name */ | P(*yyval, *yyvsp[-1]); /* stack: context,name */ |
| P(*(yyval), *(yyvsp[0])); /* stack: context,name,constructor_value */ | P(*yyval, *yyvsp[0]); /* stack: context,name,constructor_value */ |
| } | } |
| } | } |
| #line 1930 "compile.tab.C" /* yacc.c:1646 */ | #line 1874 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 52: | case 52: |
| #line 466 "compile.y" /* yacc.c:1646 */ | #line 406 "compile.y" /* yacc.c:1652 */ |
| { | { |
| (yyval)=N(); | yyval=N(); |
| YYSTYPE diving_code=(yyvsp[0]); | YYSTYPE diving_code=yyvsp[0]; |
| size_t count=diving_code->count(); | size_t count=diving_code->count(); |
| if(maybe_make_self(*(yyval), *diving_code, count)) { | if(maybe_make_self(*yyval, *diving_code, count)) { |
| // $self. | // $self. |
| } else | } else |
| #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT | #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT |
| if( | if(count>=4 && (*diving_code)[0].code==OP::OP_VALUE && (*diving_code)[3].code==OP::OP_GET_ELEMENT ){ |
| count>=4 | O(*yyval, OP::OP_WITH_ROOT__VALUE__GET_ELEMENT); |
| && (*diving_code)[0].code==OP::OP_VALUE | P(*yyval, *diving_code, 1/*offset*/, 2/*limit*/); // copy origin+value |
| && (*diving_code)[3].code==OP::OP_GET_ELEMENT | |
| ){ | |
| O(*(yyval), OP::OP_WITH_ROOT__VALUE__GET_ELEMENT); | |
| P(*(yyval), *diving_code, 1/*offset*/, 2/*limit*/); // copy origin+value | |
| if(count>4) | if(count>4) |
| P(*(yyval), *diving_code, 4); // tail | P(*yyval, *diving_code, 4); // tail |
| } else | } else |
| #endif | #endif |
| { | { |
| O(*(yyval), OP::OP_WITH_ROOT); /* stack: starting context */ | O(*yyval, OP::OP_WITH_ROOT); /* stack: starting context */ |
| P(*(yyval), *diving_code); | P(*yyval, *diving_code); |
| } | } |
| /* diving code; stack: current context */ | /* diving code; stack: current context */ |
| } | } |
| #line 1961 "compile.tab.C" /* yacc.c:1646 */ | #line 1901 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 53: | case 53: |
| #line 492 "compile.y" /* yacc.c:1646 */ | #line 428 "compile.y" /* yacc.c:1652 */ |
| { | { |
| (yyval)=N(); | yyval=N(); |
| O(*(yyval), OP::OP_WITH_WRITE); /* stack: starting context */ | O(*yyval, OP::OP_WITH_WRITE); /* stack: starting context */ |
| P(*(yyval), *(yyvsp[0])); /* diving code; stack: context,name */ | P(*yyval, *yyvsp[0]); /* diving code; stack: context,name */ |
| } | } |
| #line 1971 "compile.tab.C" /* yacc.c:1646 */ | #line 1911 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 54: | case 54: |
| #line 497 "compile.y" /* yacc.c:1646 */ | #line 433 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-1]); P(*(yyval), *(yyvsp[0])); } | { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]); } |
| #line 1977 "compile.tab.C" /* yacc.c:1646 */ | #line 1917 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 58: | case 58: |
| #line 504 "compile.y" /* yacc.c:1646 */ | #line 440 "compile.y" /* yacc.c:1652 */ |
| { | { |
| // allow $result_or_other_variable[ letters here any time ] | // allow $result_or_other_variable[ letters here any time ] |
| *reinterpret_cast<bool*>(&(yyval))=PC.explicit_result; PC.explicit_result=false; | *reinterpret_cast<bool*>(&yyval)=PC.explicit_result; PC.explicit_result=false; |
| } | } |
| #line 1986 "compile.tab.C" /* yacc.c:1646 */ | #line 1926 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 59: | case 59: |
| #line 507 "compile.y" /* yacc.c:1646 */ | #line 443 "compile.y" /* yacc.c:1652 */ |
| { | { |
| PC.explicit_result=*reinterpret_cast<bool*>(&(yyvsp[-1])); | PC.explicit_result=*reinterpret_cast<bool*>(&yyvsp[-1]); |
| } | } |
| #line 1994 "compile.tab.C" /* yacc.c:1646 */ | #line 1934 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 60: | case 60: |
| #line 509 "compile.y" /* yacc.c:1646 */ | #line 445 "compile.y" /* yacc.c:1652 */ |
| { | { |
| // stack: context, name | // stack: context, name |
| (yyval)=(yyvsp[-2]); // stack: context, name, value | yyval=yyvsp[-2]; // stack: context, name, value |
| O(*(yyval), OP::OP_CONSTRUCT_VALUE); /* value=pop; name=pop; context=pop; construct(context,name,value) */ | O(*yyval, OP::OP_CONSTRUCT_VALUE); /* value=pop; name=pop; context=pop; construct(context,name,value) */ |
| } | } |
| #line 2004 "compile.tab.C" /* yacc.c:1646 */ | #line 1944 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 61: | case 61: |
| #line 515 "compile.y" /* yacc.c:1646 */ | #line 451 "compile.y" /* yacc.c:1652 */ |
| { | { |
| (yyval)=N(); | yyval=N(); |
| O(*(yyval), OP::OP_PREPARE_TO_EXPRESSION); | |
| // stack: context, name | // stack: context, name |
| P(*(yyval), *(yyvsp[-1])); // stack: context, name, value | P(*yyval, *yyvsp[-1]); // stack: context, name, value |
| O(*(yyval), OP::OP_CONSTRUCT_EXPR); /* value=pop->as_expr_result; name=pop; context=pop; construct(context,name,value) */ | O(*yyval, OP::OP_CONSTRUCT_EXPR); /* value=pop->as_expr_result; name=pop; context=pop; construct(context,name,value) */ |
| } | } |
| #line 2016 "compile.tab.C" /* yacc.c:1646 */ | #line 1955 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 62: | case 62: |
| #line 523 "compile.y" /* yacc.c:1646 */ | #line 458 "compile.y" /* yacc.c:1652 */ |
| { | { |
| // stack: context, name | // stack: context, name |
| (yyval)=N(); | yyval=N(); |
| OA(*(yyval), OP::OP_CURLY_CODE__CONSTRUCT, (yyvsp[-1])); /* code=pop; name=pop; context=pop; construct(context,name,junction(code)) */ | OA(*yyval, OP::OP_CURLY_CODE__CONSTRUCT, yyvsp[-1]); /* code=pop; name=pop; context=pop; construct(context,name,junction(code)) */ |
| } | } |
| #line 2026 "compile.tab.C" /* yacc.c:1646 */ | #line 1965 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 66: | case 66: |
| #line 534 "compile.y" /* yacc.c:1646 */ | #line 469 "compile.y" /* yacc.c:1652 */ |
| { | { |
| (yyval)=N(); | yyval=N(); |
| OA(*(yyval), OP::OP_OBJECT_POOL, (yyvsp[0])); /* stack: empty write context */ | OA(*yyval, OP::OP_OBJECT_POOL, yyvsp[0]); /* stack: empty write context */ |
| /* some code that writes to that context */ | /* some code that writes to that context */ |
| /* context=pop; stack: context.value() */ | /* context=pop; stack: context.value() */ |
| } | } |
| #line 2037 "compile.tab.C" /* yacc.c:1646 */ | #line 1976 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 69: | case 69: |
| #line 541 "compile.y" /* yacc.c:1646 */ | #line 476 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-1]); P(*(yyval), *(yyvsp[0])); } | { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]); } |
| #line 2043 "compile.tab.C" /* yacc.c:1646 */ | #line 1982 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 70: | case 70: |
| #line 545 "compile.y" /* yacc.c:1646 */ | #line 480 "compile.y" /* yacc.c:1652 */ |
| { | { |
| size_t count=(yyvsp[0])->count(); | size_t count=yyvsp[0]->count(); |
| #ifdef OPTIMIZE_BYTECODE_CUT_REM_OPERATOR | #ifdef OPTIMIZE_BYTECODE_CUT_REM_OPERATOR |
| if(count) | if(count) |
| #endif | #endif |
| { | { |
| (yyval)=(yyvsp[0]); /* stack: value */ | yyval=yyvsp[0]; /* stack: value */ |
| if(!change_first(*(yyval), OP::OP_CONSTRUCT_OBJECT, /*=>*/OP::OP_CONSTRUCT_OBJECT__WRITE)) | if(!change_first(*yyval, OP::OP_CONSTRUCT_OBJECT, /*=>*/ OP::OP_CONSTRUCT_OBJECT__WRITE)) |
| change_or_append(*(yyval), count-2 /* second last */, | change_or_append(*yyval, count-2 /* second last */, OP::OP_CALL, /*=>*/ OP::OP_CALL__WRITE, /*or */ OP::OP_WRITE_VALUE); /* value=pop; wcontext.write(value) */ |
| OP::OP_CALL, /*=>*/ OP::OP_CALL__WRITE, | |
| /*or */OP::OP_WRITE_VALUE); /* value=pop; wcontext.write(value) */ | |
| } | } |
| } | } |
| #line 2061 "compile.tab.C" /* yacc.c:1646 */ | #line 1998 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 71: | case 71: |
| #line 558 "compile.y" /* yacc.c:1646 */ | #line 491 "compile.y" /* yacc.c:1652 */ |
| { | { |
| PC.in_call_value=true; | PC.in_call_value=true; |
| } | } |
| #line 2069 "compile.tab.C" /* yacc.c:1646 */ | #line 2006 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 72: | case 72: |
| #line 561 "compile.y" /* yacc.c:1646 */ | #line 494 "compile.y" /* yacc.c:1652 */ |
| { | { |
| PC.in_call_value=false; | PC.in_call_value=false; |
| } | } |
| #line 2077 "compile.tab.C" /* yacc.c:1646 */ | #line 2014 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 73: | case 73: |
| #line 564 "compile.y" /* yacc.c:1646 */ | #line 497 "compile.y" /* yacc.c:1652 */ |
| { /* ^field.$method{vasya} */ | { /* ^field.$method{vasya} */ |
| #ifdef OPTIMIZE_BYTECODE_CUT_REM_OPERATOR | #ifdef OPTIMIZE_BYTECODE_CUT_REM_OPERATOR |
| #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT | #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT |
| const String* operator_name=LA2S(*(yyvsp[-3]), 0, OP::OP_VALUE__GET_ELEMENT_OR_OPERATOR); | const String* operator_name=LA2S(*yyvsp[-3], 0, OP::OP_VALUE__GET_ELEMENT_OR_OPERATOR); |
| #else | #else |
| const String* operator_name=LA2S(*(yyvsp[-3]), 1); | const String* operator_name=LA2S(*yyvsp[-3], 1); |
| #endif | #endif |
| if(operator_name && *operator_name==REM_OPERATOR_NAME){ | if(operator_name && SYMBOLS_EQ(*operator_name,REM_SYMBOL)){ |
| (yyval)=N(); | yyval=N(); |
| } else | } else |
| #endif | #endif |
| { | { |
| YYSTYPE params_code=(yyvsp[-1]); | YYSTYPE params_code=yyvsp[-1]; |
| if(params_code->count()==3) { // probably [] case. [OP::OP_VALUE+origin+Void] | if(params_code->count()==3) { // probably [] case. [OP::OP_VALUE+origin+Void] |
| if(Value* value=LA2V(*params_code)) // it is OP_VALUE+origin+value? | if(Value* value=LA2V(*params_code)) // it is OP_VALUE+origin+value? |
| if(const String * string=value->get_string()) | if(const String * string=value->get_string()) |
| Line 2099 yyreduce: | Line 2036 yyreduce: |
| } | } |
| /* stack: context, method_junction */ | /* stack: context, method_junction */ |
| YYSTYPE var_code=(yyvsp[-3]); | YYSTYPE var_code=yyvsp[-3]; |
| if( | if( |
| var_code->count()==8 | var_code->count()==8 |
| && (*var_code)[0].code==OP::OP_VALUE__GET_CLASS | && ( (*var_code)[0].code==OP::OP_VALUE__GET_CLASS || (*var_code)[0].code==OP::OP_VALUE__GET_BASE_CLASS ) |
| && (*var_code)[3].code==OP::OP_PREPARE_TO_CONSTRUCT_OBJECT | && (*var_code)[3].code==OP::OP_PREPARE_TO_CONSTRUCT_OBJECT |
| && (*var_code)[4].code==OP::OP_VALUE | && (*var_code)[4].code==OP::OP_VALUE |
| #ifdef FEATURE_GET_ELEMENT4CALL | #ifdef FEATURE_GET_ELEMENT4CALL |
| Line 2111 yyreduce: | Line 2048 yyreduce: |
| && (*var_code)[7].code==OP::OP_GET_ELEMENT | && (*var_code)[7].code==OP::OP_GET_ELEMENT |
| #endif | #endif |
| ){ | ){ |
| (yyval)=N(); | yyval=N(); |
| O(*(yyval), OP::OP_CONSTRUCT_OBJECT); | O(*yyval, OP::OP_CONSTRUCT_OBJECT); |
| P(*(yyval), *var_code, 1/*offset*/, 2/*limit*/); // class name | P(*yyval, *var_code, 1/*offset*/, 2/*limit*/); // class name |
| P(*(yyval), *var_code, 5/*offset*/, 2/*limit*/); // constructor name | P(*yyval, *var_code, 5/*offset*/, 2/*limit*/); // constructor name |
| OA(*(yyval), params_code); | OA(*yyval, params_code); |
| } else | } else |
| { | { |
| (yyval)=var_code; /* with_xxx,diving code; stack: context,method_junction */ | yyval=var_code; /* with_xxx,diving code; stack: context,method_junction */ |
| OA(*(yyval), OP::OP_CALL, params_code); // method_frame=make frame(pop junction); ncontext=pop; call(ncontext,method_frame) stack: value | OA(*yyval, OP::OP_CALL, params_code); // method_frame=make frame(pop junction); ncontext=pop; call(ncontext,method_frame) stack: value |
| } | } |
| } | } |
| } | } |
| #line 2127 "compile.tab.C" /* yacc.c:1646 */ | #line 2064 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 74: | case 74: |
| #line 610 "compile.y" /* yacc.c:1646 */ | #line 543 "compile.y" /* yacc.c:1652 */ |
| { | { |
| #ifdef FEATURE_GET_ELEMENT4CALL | #ifdef FEATURE_GET_ELEMENT4CALL |
| size_t count=(yyvsp[0])->count(); | size_t count=yyvsp[0]->count(); |
| if(count){ | if(count){ |
| (yyval)=(yyvsp[0]); | yyval=yyvsp[0]; |
| #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT | #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT |
| !(count==5 && change_first(*(yyval), OP::OP_GET_OBJECT_ELEMENT, OP::OP_GET_OBJECT_ELEMENT4CALL)) && | !(count==5 && change_first(*yyval, OP::OP_GET_OBJECT_ELEMENT, OP::OP_GET_OBJECT_ELEMENT4CALL)) && |
| #endif | #endif |
| #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT | #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT |
| !(count==5 && change_first(*(yyval), OP::OP_GET_OBJECT_VAR_ELEMENT, OP::OP_GET_OBJECT_VAR_ELEMENT4CALL)) && | !(count==5 && change_first(*yyval, OP::OP_GET_OBJECT_VAR_ELEMENT, OP::OP_GET_OBJECT_VAR_ELEMENT4CALL)) && |
| #endif | #endif |
| !change(*(yyval), count-1, OP::OP_GET_ELEMENT, OP::OP_GET_ELEMENT4CALL); | !change(*yyval, count-1, OP::OP_GET_ELEMENT, OP::OP_GET_ELEMENT4CALL); |
| } | } |
| #endif | #endif |
| } | } |
| #line 2147 "compile.tab.C" /* yacc.c:1646 */ | #line 2084 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 76: | case 76: |
| #line 626 "compile.y" /* yacc.c:1646 */ | #line 559 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-1]); P(*(yyval), *(yyvsp[0])); } | { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]); } |
| #line 2153 "compile.tab.C" /* yacc.c:1646 */ | #line 2090 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 80: | case 80: |
| #line 632 "compile.y" /* yacc.c:1646 */ | #line 565 "compile.y" /* yacc.c:1652 */ |
| { | { |
| // allow ^call[ letters here any time ] | // allow ^call[ letters here any time ] |
| *reinterpret_cast<bool*>(&(yyval))=PC.explicit_result; PC.explicit_result=false; | *reinterpret_cast<bool*>(&yyval)=PC.explicit_result; PC.explicit_result=false; |
| } | } |
| #line 2162 "compile.tab.C" /* yacc.c:1646 */ | #line 2099 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 81: | case 81: |
| #line 635 "compile.y" /* yacc.c:1646 */ | #line 568 "compile.y" /* yacc.c:1652 */ |
| { | { |
| PC.explicit_result=*reinterpret_cast<bool*>(&(yyvsp[-1])); | PC.explicit_result=*reinterpret_cast<bool*>(&yyvsp[-1]); |
| } | } |
| #line 2170 "compile.tab.C" /* yacc.c:1646 */ | #line 2107 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 82: | case 82: |
| #line 637 "compile.y" /* yacc.c:1646 */ | #line 570 "compile.y" /* yacc.c:1652 */ |
| {(yyval)=(yyvsp[-2]);} | {yyval=yyvsp[-2];} |
| #line 2176 "compile.tab.C" /* yacc.c:1646 */ | #line 2113 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 83: | case 83: |
| #line 638 "compile.y" /* yacc.c:1646 */ | #line 571 "compile.y" /* yacc.c:1652 */ |
| {(yyval)=(yyvsp[-1]);} | {yyval=yyvsp[-1];} |
| #line 2182 "compile.tab.C" /* yacc.c:1646 */ | #line 2119 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 84: | case 84: |
| #line 639 "compile.y" /* yacc.c:1646 */ | #line 572 "compile.y" /* yacc.c:1652 */ |
| {(yyval)=(yyvsp[-1]);} | {yyval=yyvsp[-1];} |
| #line 2188 "compile.tab.C" /* yacc.c:1646 */ | #line 2125 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 86: | case 86: |
| #line 642 "compile.y" /* yacc.c:1646 */ | #line 575 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-2]); P(*(yyval), *(yyvsp[0])); } | { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); } |
| #line 2194 "compile.tab.C" /* yacc.c:1646 */ | #line 2131 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 88: | case 88: |
| #line 646 "compile.y" /* yacc.c:1646 */ | #line 579 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-2]); P(*(yyval), *(yyvsp[0])); } | { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); } |
| #line 2200 "compile.tab.C" /* yacc.c:1646 */ | #line 2137 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 90: | case 90: |
| #line 650 "compile.y" /* yacc.c:1646 */ | #line 583 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-2]); P(*(yyval), *(yyvsp[0])); } | { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); } |
| #line 2206 "compile.tab.C" /* yacc.c:1646 */ | #line 2143 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 91: | case 91: |
| #line 652 "compile.y" /* yacc.c:1646 */ | #line 585 "compile.y" /* yacc.c:1652 */ |
| { | { |
| (yyval)=(yyvsp[0]); | yyval=yyvsp[0]; |
| } | } |
| #line 2214 "compile.tab.C" /* yacc.c:1646 */ | #line 2151 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 92: | case 92: |
| #line 655 "compile.y" /* yacc.c:1646 */ | #line 588 "compile.y" /* yacc.c:1652 */ |
| { | { |
| YYSTYPE expr_code=(yyvsp[0]); | YYSTYPE expr_code=yyvsp[0]; |
| if(expr_code->count()==3 | if(expr_code->count()==3 |
| && (*expr_code)[0].code==OP::OP_VALUE) { // optimizing (double/bool/incidently 'string' too) case. [OP::OP_VALUE+origin+Double]. no evaluating | && (*expr_code)[0].code==OP::OP_VALUE) { // optimizing (double/bool/incidently 'string' too) case. [OP::OP_VALUE+origin+Double]. no evaluating |
| (yyval)=expr_code; | yyval=expr_code; |
| } else { | } else { |
| YYSTYPE code=N(); | YYSTYPE code=N(); |
| O(*code, OP::OP_PREPARE_TO_EXPRESSION); | |
| P(*code, *expr_code); | P(*code, *expr_code); |
| O(*code, OP::OP_WRITE_EXPR_RESULT); | O(*code, OP::OP_WRITE_EXPR_RESULT); |
| (yyval)=N(); | yyval=N(); |
| OA(*(yyval), OP::OP_EXPR_CODE__STORE_PARAM, code); | OA(*yyval, OP::OP_EXPR_CODE__STORE_PARAM, code); |
| } | } |
| } | } |
| #line 2233 "compile.tab.C" /* yacc.c:1646 */ | #line 2169 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 93: | case 93: |
| #line 669 "compile.y" /* yacc.c:1646 */ | #line 601 "compile.y" /* yacc.c:1652 */ |
| { | { |
| (yyval)=N(); | yyval=N(); |
| OA(*(yyval), OP::OP_CURLY_CODE__STORE_PARAM, (yyvsp[0])); | OA(*yyval, OP::OP_CURLY_CODE__STORE_PARAM, yyvsp[0]); |
| } | } |
| #line 2242 "compile.tab.C" /* yacc.c:1646 */ | #line 2178 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 98: | case 98: |
| #line 681 "compile.y" /* yacc.c:1646 */ | #line 613 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-1]); P(*(yyval), *(yyvsp[0])); } | { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]); } |
| #line 2248 "compile.tab.C" /* yacc.c:1646 */ | #line 2184 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 100: | case 100: |
| #line 683 "compile.y" /* yacc.c:1646 */ | #line 615 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-1]); P(*(yyval), *(yyvsp[0])); } | { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]); } |
| #line 2254 "compile.tab.C" /* yacc.c:1646 */ | #line 2190 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 102: | case 102: |
| #line 685 "compile.y" /* yacc.c:1646 */ | #line 617 "compile.y" /* yacc.c:1652 */ |
| { | { |
| // we know that name_advance1 not called from ^xxx context | // we know that name_advance1 not called from ^xxx context |
| // so we'll not check for operator call possibility as we do in name_advance2 | // so we'll not check for operator call possibility as we do in name_advance2 |
| /* stack: context */ | /* stack: context */ |
| (yyval)=(yyvsp[0]); /* stack: context,name */ | yyval=yyvsp[0]; /* stack: context,name */ |
| #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL | #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL |
| O(*(yyval), is_special_element(*(yyval)) ? OP::OP_GET_ELEMENT__SPECIAL : OP::OP_GET_ELEMENT); | O(*yyval, is_special_element(*yyval) ? OP::OP_GET_ELEMENT__SPECIAL : OP::OP_GET_ELEMENT); |
| #else | #else |
| O(*(yyval), OP::OP_GET_ELEMENT); /* name=pop; context=pop; stack: context.get_element(name) */ | O(*yyval, OP::OP_GET_ELEMENT); /* name=pop; context=pop; stack: context.get_element(name) */ |
| #endif | #endif |
| } | } |
| #line 2271 "compile.tab.C" /* yacc.c:1646 */ | #line 2207 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 103: | case 103: |
| #line 697 "compile.y" /* yacc.c:1646 */ | #line 629 "compile.y" /* yacc.c:1652 */ |
| { | { |
| /* stack: context */ | /* stack: context */ |
| (yyval)=(yyvsp[0]); /* stack: context,name */ | yyval=yyvsp[0]; /* stack: context,name */ |
| #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL | #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL |
| O(*(yyval), is_special_element(*(yyval)) ? OP::OP_GET_ELEMENT__SPECIAL : OP::OP_GET_ELEMENT); | O(*yyval, is_special_element(*yyval) ? OP::OP_GET_ELEMENT__SPECIAL : OP::OP_GET_ELEMENT); |
| #else | #else |
| O(*(yyval), OP::OP_GET_ELEMENT); /* name=pop; context=pop; stack: context.get_element(name) */ | O(*yyval, OP::OP_GET_ELEMENT); /* name=pop; context=pop; stack: context.get_element(name) */ |
| #endif | #endif |
| } | } |
| #line 2285 "compile.tab.C" /* yacc.c:1646 */ | #line 2221 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 109: | case 109: |
| #line 714 "compile.y" /* yacc.c:1646 */ | #line 646 "compile.y" /* yacc.c:1652 */ |
| { | { |
| (yyval)=(yyvsp[0]); | yyval=yyvsp[0]; |
| O(*(yyval), OP::OP_GET_ELEMENT); | O(*yyval, OP::OP_GET_ELEMENT); |
| } | } |
| #line 2294 "compile.tab.C" /* yacc.c:1646 */ | #line 2230 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 110: | case 110: |
| #line 718 "compile.y" /* yacc.c:1646 */ | #line 650 "compile.y" /* yacc.c:1652 */ |
| { | { |
| YYSTYPE code; | YYSTYPE code; |
| { | { |
| change_string_literal_to_write_string_literal(*(code=(yyvsp[-1]))); | change_string_literal_to_write_string_literal(*(code=yyvsp[-1])); |
| P(*code, *(yyvsp[0])); | P(*code, *yyvsp[0]); |
| } | } |
| (yyval)=N(); | yyval=N(); |
| OA(*(yyval), OP::OP_STRING_POOL, code); | OA(*yyval, OP::OP_STRING_POOL, code); |
| } | } |
| #line 2308 "compile.tab.C" /* yacc.c:1646 */ | #line 2244 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 111: | case 111: |
| #line 727 "compile.y" /* yacc.c:1646 */ | #line 659 "compile.y" /* yacc.c:1652 */ |
| { | { |
| // allow $result_or_other_variable[ letters here any time ] | // allow $result_or_other_variable[ letters here any time ] |
| *reinterpret_cast<bool*>(&(yyval))=PC.explicit_result; PC.explicit_result=false; | *reinterpret_cast<bool*>(&yyval)=PC.explicit_result; PC.explicit_result=false; |
| } | } |
| #line 2317 "compile.tab.C" /* yacc.c:1646 */ | #line 2253 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 112: | case 112: |
| #line 730 "compile.y" /* yacc.c:1646 */ | #line 662 "compile.y" /* yacc.c:1652 */ |
| { | { |
| PC.explicit_result=*reinterpret_cast<bool*>(&(yyvsp[-1])); | PC.explicit_result=*reinterpret_cast<bool*>(&yyvsp[-1]); |
| } | } |
| #line 2325 "compile.tab.C" /* yacc.c:1646 */ | #line 2261 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 113: | case 113: |
| #line 732 "compile.y" /* yacc.c:1646 */ | #line 664 "compile.y" /* yacc.c:1652 */ |
| { | { |
| (yyval)=N(); | yyval=N(); |
| #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL | #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL |
| if(!maybe_append_simple_diving_code(*(yyval), *(yyvsp[-2]))) | if(!maybe_append_simple_diving_code(*yyval, *yyvsp[-2])) |
| #endif | #endif |
| { | { |
| OA(*(yyval), OP::OP_OBJECT_POOL, (yyvsp[-2])); /* stack: empty write context */ | OA(*yyval, OP::OP_OBJECT_POOL, yyvsp[-2]); /* stack: empty write context */ |
| /* some code that writes to that context */ | /* some code that writes to that context */ |
| /* context=pop; stack: context.value() */ | /* context=pop; stack: context.value() */ |
| } | } |
| } | } |
| #line 2341 "compile.tab.C" /* yacc.c:1646 */ | #line 2277 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 114: | case 114: |
| #line 743 "compile.y" /* yacc.c:1646 */ | #line 675 "compile.y" /* yacc.c:1652 */ |
| { | { |
| (yyval)=N(); | yyval=N(); |
| O(*(yyval), OP::OP_WITH_READ); | O(*yyval, OP::OP_WITH_READ); |
| P(*(yyval), *(yyvsp[0])); | P(*yyval, *yyvsp[0]); |
| } | } |
| #line 2351 "compile.tab.C" /* yacc.c:1646 */ | #line 2287 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 116: | case 116: |
| #line 748 "compile.y" /* yacc.c:1646 */ | #line 680 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-1]); P(*(yyval), *(yyvsp[0])); } | { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]); } |
| #line 2357 "compile.tab.C" /* yacc.c:1646 */ | #line 2293 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 117: | case 117: |
| #line 749 "compile.y" /* yacc.c:1646 */ | #line 681 "compile.y" /* yacc.c:1652 */ |
| { | { |
| (yyval)=(yyvsp[0]); | yyval=yyvsp[0]; |
| O(*(yyval), OP::OP_GET_ELEMENT__WRITE); | O(*yyval, OP::OP_GET_ELEMENT__WRITE); |
| } | } |
| #line 2366 "compile.tab.C" /* yacc.c:1646 */ | #line 2302 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 120: | case 120: |
| #line 758 "compile.y" /* yacc.c:1646 */ | #line 690 "compile.y" /* yacc.c:1652 */ |
| { | { |
| (yyval)=(yyvsp[-1]); // stack: class name string | yyval=yyvsp[-1]; // stack: class name string |
| if(*LA2S(*(yyval)) == BASE_NAME) { // pseudo BASE class | OP::OPCODE code = OP::OP_VALUE__GET_CLASS; |
| if(*LA2S(*yyval) == BASE_NAME) { // pseudo BASE class | |
| if(VStateless_class* base=PC.cclass->base_class()) { | if(VStateless_class* base=PC.cclass->base_class()) { |
| change_string_literal_value(*(yyval), base->name()); | change_string_literal_value(*yyval, *new String(base->type())); |
| } else { | } else { |
| strcpy(PC.error, "no base class declared"); | YYERROR1("no base class declared"); |
| YYERROR; | |
| } | } |
| code = OP::OP_VALUE__GET_BASE_CLASS; | |
| } else { | |
| // can't use get_class because it will call @autouse[] if the class wasn't loaded | |
| VStateless_class* base=PC.request.classes().get(*LA2S(*yyval)); | |
| if(base && PC.cclass->derived_from(*base)) | |
| code = OP::OP_VALUE__GET_BASE_CLASS; | |
| } | } |
| // optimized OP_VALUE+origin+string+OP_GET_CLASS => OP_VALUE__GET_CLASS+origin+string | // optimized OP_VALUE+origin+string+OP_GET_CLASS => OP_VALUE__GET_CLASS+origin+string |
| change_first(*(yyval), OP::OP_VALUE, OP::OP_VALUE__GET_CLASS); | change_first(*yyval, OP::OP_VALUE, code); |
| } | } |
| #line 2384 "compile.tab.C" /* yacc.c:1646 */ | #line 2326 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 121: | case 121: |
| #line 771 "compile.y" /* yacc.c:1646 */ | #line 709 "compile.y" /* yacc.c:1652 */ |
| { | { |
| (yyval)=(yyvsp[-1]); | yyval=yyvsp[-1]; |
| if(!PC.in_call_value) { | if(!PC.in_call_value) |
| strcpy(PC.error, ":: not allowed here"); | YYERROR1(":: not allowed here"); |
| YYERROR; | O(*yyval, OP::OP_PREPARE_TO_CONSTRUCT_OBJECT); |
| } | |
| O(*(yyval), OP::OP_PREPARE_TO_CONSTRUCT_OBJECT); | |
| } | } |
| #line 2397 "compile.tab.C" /* yacc.c:1646 */ | #line 2337 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 128: | case 128: |
| #line 790 "compile.y" /* yacc.c:1646 */ | #line 726 "compile.y" /* yacc.c:1652 */ |
| { (yyval) = (yyvsp[-1]); } | { yyval = yyvsp[-1]; } |
| #line 2403 "compile.tab.C" /* yacc.c:1646 */ | #line 2343 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 129: | case 129: |
| #line 791 "compile.y" /* yacc.c:1646 */ | #line 727 "compile.y" /* yacc.c:1652 */ |
| { (yyval) = (yyvsp[-1]); } | { yyval = yyvsp[-1]; } |
| #line 2409 "compile.tab.C" /* yacc.c:1646 */ | #line 2349 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 130: | case 130: |
| #line 792 "compile.y" /* yacc.c:1646 */ | #line 728 "compile.y" /* yacc.c:1652 */ |
| { (yyval) = (yyvsp[-1]); } | { yyval = yyvsp[-1]; } |
| #line 2415 "compile.tab.C" /* yacc.c:1646 */ | #line 2355 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 131: | case 131: |
| #line 794 "compile.y" /* yacc.c:1646 */ | #line 730 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[0]); O(*(yyval), OP::OP_NEG); } | { yyval=yyvsp[0]; O(*yyval, OP::OP_NEG); } |
| #line 2421 "compile.tab.C" /* yacc.c:1646 */ | #line 2361 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 132: | case 132: |
| #line 795 "compile.y" /* yacc.c:1646 */ | #line 731 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[0]); } | { yyval=yyvsp[0]; } |
| #line 2427 "compile.tab.C" /* yacc.c:1646 */ | #line 2367 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 133: | case 133: |
| #line 796 "compile.y" /* yacc.c:1646 */ | #line 732 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[0]); O(*(yyval), OP::OP_INV); } | { yyval=yyvsp[0]; O(*yyval, OP::OP_INV); } |
| #line 2433 "compile.tab.C" /* yacc.c:1646 */ | #line 2373 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 134: | case 134: |
| #line 797 "compile.y" /* yacc.c:1646 */ | #line 733 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[0]); O(*(yyval), OP::OP_NOT); } | { yyval=yyvsp[0]; O(*yyval, OP::OP_NOT); } |
| #line 2439 "compile.tab.C" /* yacc.c:1646 */ | #line 2379 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 135: | case 135: |
| #line 798 "compile.y" /* yacc.c:1646 */ | #line 734 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[0]); O(*(yyval), OP::OP_DEF); } | { yyval=yyvsp[0]; O(*yyval, OP::OP_DEF); } |
| #line 2445 "compile.tab.C" /* yacc.c:1646 */ | #line 2385 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 136: | case 136: |
| #line 799 "compile.y" /* yacc.c:1646 */ | #line 735 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[0]); O(*(yyval), OP::OP_IN); } | { yyval=yyvsp[0]; O(*yyval, OP::OP_IN); } |
| #line 2451 "compile.tab.C" /* yacc.c:1646 */ | #line 2391 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 137: | case 137: |
| #line 800 "compile.y" /* yacc.c:1646 */ | #line 736 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[0]); O(*(yyval), OP::OP_FEXISTS); } | { yyval=yyvsp[0]; O(*yyval, OP::OP_FEXISTS); } |
| #line 2457 "compile.tab.C" /* yacc.c:1646 */ | #line 2397 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 138: | case 138: |
| #line 801 "compile.y" /* yacc.c:1646 */ | #line 737 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[0]); O(*(yyval), OP::OP_DEXISTS); } | { yyval=yyvsp[0]; O(*yyval, OP::OP_DEXISTS); } |
| #line 2463 "compile.tab.C" /* yacc.c:1646 */ | #line 2403 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 139: | case 139: |
| #line 803 "compile.y" /* yacc.c:1646 */ | #line 739 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-2]); P(*(yyval), *(yyvsp[0])); O(*(yyval), OP::OP_SUB); } | { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_SUB); } |
| #line 2469 "compile.tab.C" /* yacc.c:1646 */ | #line 2409 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 140: | case 140: |
| #line 804 "compile.y" /* yacc.c:1646 */ | #line 740 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-2]); P(*(yyval), *(yyvsp[0])); O(*(yyval), OP::OP_ADD); } | { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_ADD); } |
| #line 2475 "compile.tab.C" /* yacc.c:1646 */ | #line 2415 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 141: | case 141: |
| #line 805 "compile.y" /* yacc.c:1646 */ | #line 741 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-2]); P(*(yyval), *(yyvsp[0])); O(*(yyval), OP::OP_MUL); } | { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_MUL); } |
| #line 2481 "compile.tab.C" /* yacc.c:1646 */ | #line 2421 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 142: | case 142: |
| #line 806 "compile.y" /* yacc.c:1646 */ | #line 742 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-2]); P(*(yyval), *(yyvsp[0])); O(*(yyval), OP::OP_DIV); } | { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_DIV); } |
| #line 2487 "compile.tab.C" /* yacc.c:1646 */ | #line 2427 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 143: | case 143: |
| #line 807 "compile.y" /* yacc.c:1646 */ | #line 743 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-2]); P(*(yyval), *(yyvsp[0])); O(*(yyval), OP::OP_MOD); } | { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_MOD); } |
| #line 2493 "compile.tab.C" /* yacc.c:1646 */ | #line 2433 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 144: | case 144: |
| #line 808 "compile.y" /* yacc.c:1646 */ | #line 744 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-2]); P(*(yyval), *(yyvsp[0])); O(*(yyval), OP::OP_INTDIV); } | { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_INTDIV); } |
| #line 2499 "compile.tab.C" /* yacc.c:1646 */ | #line 2439 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 145: | case 145: |
| #line 809 "compile.y" /* yacc.c:1646 */ | #line 745 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-2]); P(*(yyval), *(yyvsp[0])); O(*(yyval), OP::OP_BIN_SL); } | { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_BIN_SL); } |
| #line 2505 "compile.tab.C" /* yacc.c:1646 */ | #line 2445 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 146: | case 146: |
| #line 810 "compile.y" /* yacc.c:1646 */ | #line 746 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-2]); P(*(yyval), *(yyvsp[0])); O(*(yyval), OP::OP_BIN_SR); } | { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_BIN_SR); } |
| #line 2511 "compile.tab.C" /* yacc.c:1646 */ | #line 2451 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 147: | case 147: |
| #line 811 "compile.y" /* yacc.c:1646 */ | #line 747 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-2]); P(*(yyval), *(yyvsp[0])); O(*(yyval), OP::OP_BIN_AND); } | { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_BIN_AND); } |
| #line 2517 "compile.tab.C" /* yacc.c:1646 */ | #line 2457 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 148: | case 148: |
| #line 812 "compile.y" /* yacc.c:1646 */ | #line 748 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-2]); P(*(yyval), *(yyvsp[0])); O(*(yyval), OP::OP_BIN_OR); } | { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_BIN_OR); } |
| #line 2523 "compile.tab.C" /* yacc.c:1646 */ | #line 2463 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 149: | case 149: |
| #line 813 "compile.y" /* yacc.c:1646 */ | #line 749 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-2]); P(*(yyval), *(yyvsp[0])); O(*(yyval), OP::OP_BIN_XOR); } | { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_BIN_XOR); } |
| #line 2529 "compile.tab.C" /* yacc.c:1646 */ | #line 2469 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 150: | case 150: |
| #line 814 "compile.y" /* yacc.c:1646 */ | #line 750 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-2]); OA(*(yyval), OP::OP_NESTED_CODE, (yyvsp[0])); O(*(yyval), OP::OP_LOG_AND); } | { yyval=yyvsp[-2]; OA(*yyval, OP::OP_NESTED_CODE, yyvsp[0]); O(*yyval, OP::OP_LOG_AND); } |
| #line 2535 "compile.tab.C" /* yacc.c:1646 */ | #line 2475 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 151: | case 151: |
| #line 815 "compile.y" /* yacc.c:1646 */ | #line 751 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-2]); OA(*(yyval), OP::OP_NESTED_CODE, (yyvsp[0])); O(*(yyval), OP::OP_LOG_OR); } | { yyval=yyvsp[-2]; OA(*yyval, OP::OP_NESTED_CODE, yyvsp[0]); O(*yyval, OP::OP_LOG_OR); } |
| #line 2541 "compile.tab.C" /* yacc.c:1646 */ | #line 2481 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 152: | case 152: |
| #line 816 "compile.y" /* yacc.c:1646 */ | #line 752 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-2]); P(*(yyval), *(yyvsp[0])); O(*(yyval), OP::OP_LOG_XOR); } | { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_LOG_XOR); } |
| #line 2547 "compile.tab.C" /* yacc.c:1646 */ | #line 2487 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 153: | case 153: |
| #line 817 "compile.y" /* yacc.c:1646 */ | #line 753 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-2]); P(*(yyval), *(yyvsp[0])); O(*(yyval), OP::OP_NUM_LT); } | { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_NUM_LT); } |
| #line 2553 "compile.tab.C" /* yacc.c:1646 */ | #line 2493 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 154: | case 154: |
| #line 818 "compile.y" /* yacc.c:1646 */ | #line 754 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-2]); P(*(yyval), *(yyvsp[0])); O(*(yyval), OP::OP_NUM_GT); } | { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_NUM_GT); } |
| #line 2559 "compile.tab.C" /* yacc.c:1646 */ | #line 2499 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 155: | case 155: |
| #line 819 "compile.y" /* yacc.c:1646 */ | #line 755 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-2]); P(*(yyval), *(yyvsp[0])); O(*(yyval), OP::OP_NUM_LE); } | { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_NUM_LE); } |
| #line 2565 "compile.tab.C" /* yacc.c:1646 */ | #line 2505 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 156: | case 156: |
| #line 820 "compile.y" /* yacc.c:1646 */ | #line 756 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-2]); P(*(yyval), *(yyvsp[0])); O(*(yyval), OP::OP_NUM_GE); } | { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_NUM_GE); } |
| #line 2571 "compile.tab.C" /* yacc.c:1646 */ | #line 2511 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 157: | case 157: |
| #line 821 "compile.y" /* yacc.c:1646 */ | #line 757 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-2]); P(*(yyval), *(yyvsp[0])); O(*(yyval), OP::OP_NUM_EQ); } | { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_NUM_EQ); } |
| #line 2577 "compile.tab.C" /* yacc.c:1646 */ | #line 2517 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 158: | case 158: |
| #line 822 "compile.y" /* yacc.c:1646 */ | #line 758 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-2]); P(*(yyval), *(yyvsp[0])); O(*(yyval), OP::OP_NUM_NE); } | { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_NUM_NE); } |
| #line 2583 "compile.tab.C" /* yacc.c:1646 */ | #line 2523 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 159: | case 159: |
| #line 823 "compile.y" /* yacc.c:1646 */ | #line 759 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-2]); P(*(yyval), *(yyvsp[0])); O(*(yyval), OP::OP_STR_LT); } | { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_STR_LT); } |
| #line 2589 "compile.tab.C" /* yacc.c:1646 */ | #line 2529 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 160: | case 160: |
| #line 824 "compile.y" /* yacc.c:1646 */ | #line 760 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-2]); P(*(yyval), *(yyvsp[0])); O(*(yyval), OP::OP_STR_GT); } | { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_STR_GT); } |
| #line 2595 "compile.tab.C" /* yacc.c:1646 */ | #line 2535 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 161: | case 161: |
| #line 825 "compile.y" /* yacc.c:1646 */ | #line 761 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-2]); P(*(yyval), *(yyvsp[0])); O(*(yyval), OP::OP_STR_LE); } | { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_STR_LE); } |
| #line 2601 "compile.tab.C" /* yacc.c:1646 */ | #line 2541 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 162: | case 162: |
| #line 826 "compile.y" /* yacc.c:1646 */ | #line 762 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-2]); P(*(yyval), *(yyvsp[0])); O(*(yyval), OP::OP_STR_GE); } | { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_STR_GE); } |
| #line 2607 "compile.tab.C" /* yacc.c:1646 */ | #line 2547 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 163: | case 163: |
| #line 827 "compile.y" /* yacc.c:1646 */ | #line 763 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-2]); P(*(yyval), *(yyvsp[0])); O(*(yyval), OP::OP_STR_EQ); } | { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_STR_EQ); } |
| #line 2613 "compile.tab.C" /* yacc.c:1646 */ | #line 2553 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 164: | case 164: |
| #line 828 "compile.y" /* yacc.c:1646 */ | #line 764 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-2]); P(*(yyval), *(yyvsp[0])); O(*(yyval), OP::OP_STR_NE); } | { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_STR_NE); } |
| #line 2619 "compile.tab.C" /* yacc.c:1646 */ | #line 2559 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 165: | case 165: |
| #line 829 "compile.y" /* yacc.c:1646 */ | #line 765 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=(yyvsp[-2]); P(*(yyval), *(yyvsp[0])); O(*(yyval), OP::OP_IS); } | { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_IS); } |
| #line 2625 "compile.tab.C" /* yacc.c:1646 */ | #line 2565 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 166: | case 166: |
| #line 832 "compile.y" /* yacc.c:1646 */ | #line 768 "compile.y" /* yacc.c:1652 */ |
| { | { |
| // optimized OP_STRING => OP_VALUE for doubles | // optimized OP_STRING => OP_VALUE for doubles |
| maybe_change_string_literal_to_double_literal(*((yyval)=(yyvsp[0]))); | maybe_change_string_literal_to_double_literal(*(yyval=yyvsp[0])); |
| } | } |
| #line 2634 "compile.tab.C" /* yacc.c:1646 */ | #line 2574 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 167: | case 167: |
| #line 837 "compile.y" /* yacc.c:1646 */ | #line 773 "compile.y" /* yacc.c:1652 */ |
| { | { |
| #ifdef OPTIMIZE_BYTECODE_STRING_POOL | #ifdef OPTIMIZE_BYTECODE_STRING_POOL |
| // it brakes ^if(" 09 "){...} | // it brakes ^if(" 09 "){...} |
| YYSTYPE code=(yyvsp[0]); | YYSTYPE code=yyvsp[0]; |
| (yyval)=N(); | yyval=N(); |
| if(code->count()==3 && change_first(*code, OP::OP_STRING__WRITE, OP::OP_VALUE)){ | if(code->count()==3 && change_first(*code, OP::OP_STRING__WRITE, OP::OP_VALUE)){ |
| // optimized OP_STRING__WRITE+origin+value => OP_VALUE+origin+value without starting OP_STRING_POOL | // optimized OP_STRING__WRITE+origin+value => OP_VALUE+origin+value without starting OP_STRING_POOL |
| P(*(yyval), *code); | P(*yyval, *code); |
| } else { | } else { |
| OA(*(yyval), OP::OP_STRING_POOL, code); /* stack: empty write context */ | OA(*yyval, OP::OP_STRING_POOL, code); /* stack: empty write context */ |
| } | } |
| #else | #else |
| (yyval)=N(); | yyval=N(); |
| OA(*(yyval), OP::OP_STRING_POOL, (yyvsp[0])); /* stack: empty write context */ | OA(*yyval, OP::OP_STRING_POOL, yyvsp[0]); /* stack: empty write context */ |
| #endif | #endif |
| /* some code that writes to that context */ | /* some code that writes to that context */ |
| /* context=pop; stack: context.get_string() */ | /* context=pop; stack: context.get_string() */ |
| } | } |
| #line 2657 "compile.tab.C" /* yacc.c:1646 */ | #line 2597 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 168: | case 168: |
| #line 858 "compile.y" /* yacc.c:1646 */ | #line 794 "compile.y" /* yacc.c:1652 */ |
| { | { |
| // optimized OP_STRING+OP_WRITE_VALUE => OP_STRING__WRITE | // optimized OP_STRING+OP_WRITE_VALUE => OP_STRING__WRITE |
| change_string_literal_to_write_string_literal(*((yyval)=(yyvsp[0]))); | change_string_literal_to_write_string_literal(*(yyval=yyvsp[0])); |
| } | } |
| #line 2666 "compile.tab.C" /* yacc.c:1646 */ | #line 2606 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 169: | case 169: |
| #line 863 "compile.y" /* yacc.c:1646 */ | #line 799 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=VL(/*we know that we will not change it*/const_cast<VString*>(&vempty), 0, 0, 0); } | { yyval=VL(/*we know that we will not change it*/const_cast<VString*>(&vempty), 0, 0, 0); } |
| #line 2672 "compile.tab.C" /* yacc.c:1646 */ | #line 2612 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 170: | case 170: |
| #line 864 "compile.y" /* yacc.c:1646 */ | #line 800 "compile.y" /* yacc.c:1652 */ |
| { (yyval) = VL(/*we know that we will not change it*/const_cast<VBool*>(&vtrue), 0, 0, 0); } | { yyval = VL(/*we know that we will not change it*/const_cast<VBool*>(&vtrue), 0, 0, 0); } |
| #line 2678 "compile.tab.C" /* yacc.c:1646 */ | #line 2618 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 171: | case 171: |
| #line 865 "compile.y" /* yacc.c:1646 */ | #line 801 "compile.y" /* yacc.c:1652 */ |
| { (yyval) = VL(/*we know that we will not change it*/const_cast<VBool*>(&vfalse), 0, 0, 0); } | { yyval = VL(/*we know that we will not change it*/const_cast<VBool*>(&vfalse), 0, 0, 0); } |
| #line 2684 "compile.tab.C" /* yacc.c:1646 */ | #line 2624 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| case 172: | case 172: |
| #line 867 "compile.y" /* yacc.c:1646 */ | #line 803 "compile.y" /* yacc.c:1652 */ |
| { (yyval)=N(); } | { yyval=N(); } |
| #line 2690 "compile.tab.C" /* yacc.c:1646 */ | #line 2630 "compile.tab.C" /* yacc.c:1652 */ |
| break; | break; |
| #line 2694 "compile.tab.C" /* yacc.c:1646 */ | #line 2634 "compile.tab.C" /* yacc.c:1652 */ |
| default: break; | default: break; |
| } | } |
| /* User semantic actions sometimes alter yychar, and that requires | /* User semantic actions sometimes alter yychar, and that requires |
| Line 2715 yyreduce: | Line 2655 yyreduce: |
| /* Now 'shift' the result of the reduction. Determine what state | /* Now 'shift' the result of the reduction. Determine what state |
| that goes to, based on the state we popped back to and the rule | that goes to, based on the state we popped back to and the rule |
| number reduced by. */ | number reduced by. */ |
| { | |
| yyn = yyr1[yyn]; | const int yylhs = yyr1[yyn] - YYNTOKENS; |
| const int yyi = yypgoto[yylhs] + *yyssp; | |
| yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; | yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp |
| if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) | ? yytable[yyi] |
| yystate = yytable[yystate]; | : yydefgoto[yylhs]); |
| else | } |
| yystate = yydefgoto[yyn - YYNTOKENS]; | |
| goto yynewstate; | goto yynewstate; |
| Line 2805 yyerrlab: | Line 2744 yyerrlab: |
| | yyerrorlab -- error raised explicitly by YYERROR. | | | yyerrorlab -- error raised explicitly by YYERROR. | |
| `---------------------------------------------------*/ | `---------------------------------------------------*/ |
| yyerrorlab: | yyerrorlab: |
| /* Pacify compilers when the user code never invokes YYERROR and the | |
| /* Pacify compilers like GCC when the user code never invokes | label yyerrorlab therefore never appears in user code. */ |
| YYERROR and the label yyerrorlab therefore never appears in user | if (0) |
| code. */ | YYERROR; |
| if (/*CONSTCOND*/ 0) | |
| goto yyerrorlab; | |
| /* Do not reclaim the symbols of the rule whose action triggered | /* Do not reclaim the symbols of the rule whose action triggered |
| this YYERROR. */ | this YYERROR. */ |
| Line 2872 yyacceptlab: | Line 2809 yyacceptlab: |
| yyresult = 0; | yyresult = 0; |
| goto yyreturn; | goto yyreturn; |
| /*-----------------------------------. | /*-----------------------------------. |
| | yyabortlab -- YYABORT comes here. | | | yyabortlab -- YYABORT comes here. | |
| `-----------------------------------*/ | `-----------------------------------*/ |
| Line 2879 yyabortlab: | Line 2817 yyabortlab: |
| yyresult = 1; | yyresult = 1; |
| goto yyreturn; | goto yyreturn; |
| #if !defined yyoverflow || YYERROR_VERBOSE | #if !defined yyoverflow || YYERROR_VERBOSE |
| /*-------------------------------------------------. | /*-------------------------------------------------. |
| | yyexhaustedlab -- memory exhaustion comes here. | | | yyexhaustedlab -- memory exhaustion comes here. | |
| Line 2889 yyexhaustedlab: | Line 2828 yyexhaustedlab: |
| /* Fall through. */ | /* Fall through. */ |
| #endif | #endif |
| /*-----------------------------------------------------. | |
| | yyreturn -- parsing is finished, return the result. | | |
| `-----------------------------------------------------*/ | |
| yyreturn: | yyreturn: |
| if (yychar != YYEMPTY) | if (yychar != YYEMPTY) |
| { | { |
| Line 2918 yyreturn: | Line 2861 yyreturn: |
| #endif | #endif |
| return yyresult; | return yyresult; |
| } | } |
| #line 869 "compile.y" /* yacc.c:1906 */ | #line 805 "compile.y" /* yacc.c:1918 */ |
| #endif | #endif |
| Line 3117 default: | Line 3060 default: |
| } | } |
| if(pc.explicit_result && c) | if(pc.explicit_result && c) |
| switch(c) { | switch(c) { |
| default: | |
| pc.string.append(c); | |
| case '\n': case ' ': case '\t': | case '\n': case ' ': case '\t': |
| begin=pc.source; | begin=pc.source; |
| begin_pos=pc.pos; | begin_pos=pc.pos; |
| continue; // skip it | continue; |
| default: | |
| result=BAD_NONWHITESPACE_CHARACTER_IN_EXPLICIT_RESULT_MODE; | |
| goto break2; | |
| } | } |
| break; | break; |
| Line 3650 default: | Line 3592 default: |
| } | } |
| if(pc.explicit_result && c) | if(pc.explicit_result && c) |
| switch(c) { | switch(c) { |
| default: | |
| pc.string.append(c); | |
| case '\n': case ' ': case '\t': | case '\n': case ' ': case '\t': |
| begin=pc.source; | begin=pc.source; |
| begin_pos=pc.pos; | begin_pos=pc.pos; |
| continue; // skip it | continue; |
| default: | |
| result=BAD_NONWHITESPACE_CHARACTER_IN_EXPLICIT_RESULT_MODE; | |
| goto break2; | |
| } | } |
| break; | break; |
| Line 3665 default: | Line 3606 default: |
| pc.ls=LS_METHOD_SQUARE; | pc.ls=LS_METHOD_SQUARE; |
| lexical_brackets_nestage=1; | lexical_brackets_nestage=1; |
| RC; | RC; |
| } | } |
| if(c=='{') {/* ]{ }{ ){ */ | if(c=='{') {/* ]{ }{ ){ */ |
| pc.ls=LS_METHOD_CURLY; | pc.ls=LS_METHOD_CURLY; |
| lexical_brackets_nestage=1; | lexical_brackets_nestage=1; |
| RC; | RC; |
| } | } |
| if(c=='(') {/* ]( }( )( */ | if(c=='(') {/* ]( }( )( */ |
| pc.ls=LS_METHOD_ROUND; | pc.ls=LS_METHOD_ROUND; |
| lexical_brackets_nestage=1; | lexical_brackets_nestage=1; |
| RC; | RC; |
| } | } |
| pop_LS(pc); | pop_LS(pc); |
| pc.ungetc(); | pc.ungetc(); |
| result=EON; | result=EON; |
| Line 3701 break2: | Line 3642 break2: |
| } | } |
| if(!pc.string.is_empty()) { // something accumulated? | if(!pc.string.is_empty()) { // something accumulated? |
| // create STRING value: array of OP_VALUE+origin+vstring | // create STRING value: array of OP_VALUE+origin+vstring |
| *lvalp=VL( | #ifdef SYMBOLS_CACHING |
| new VString(*new String(pc.string, String::L_CLEAN)), | Value *lookup=symbols->get(pc.string); |
| pc.file_no, pc.string_start.line, pc.string_start.col); | #else |
| Value *lookup=0; | |
| #endif | |
| *lvalp=VL(lookup ? lookup : new VString(*new String(pc.string, String::L_CLEAN)), pc.file_no, pc.string_start.line, pc.string_start.col); | |
| // new pieces storage | // new pieces storage |
| pc.string.clear(); | pc.string.clear(); |
| pc.string_start.clear(); | pc.string_start.clear(); |
| Line 3717 break2: | Line 3661 break2: |
| } | } |
| static int real_yyerror(Parse_control *pc, const char *s) { // Called by yyparse on error | static int real_yyerror(Parse_control *pc, const char *s) { // Called by yyparse on error |
| strncpy(PC.error, s, MAX_STRING); | PC.error=pa_strdup(s); |
| return 1; | return 1; |
| } | } |
| static void yyprint(FILE *file, int type, YYSTYPE value) { | static void yyprint(FILE *file, int type, YYSTYPE value) { |