--- parser3/src/main/compile.tab.C 2005/11/22 15:56:02 1.108 +++ parser3/src/main/compile.tab.C 2005/12/21 13:54:43 1.112 @@ -1,7 +1,7 @@ -/* A Bison parser, made by GNU Bison 1.875d. */ +/* A Bison parser, made by GNU Bison 1.875b. */ /* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -37,7 +37,7 @@ #define YYBISON 1 /* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" +#define YYSKELETON_NAME "/../../../cygdrive/y/parser3project/win32/tools/yacc.c" /* Pure parsers. */ #define YYPURE 1 @@ -131,6 +131,8 @@ Copyright (c) 2001-2005 ArtLebedev Group (http://www.artlebedev.com) Author: Alexander Petrosyan (http://design.ru/paf) + + $Id: compile.tab.C,v 1.112 2005/12/21 13:54:43 paf Exp $ */ /** @@ -211,29 +213,22 @@ typedef int YYSTYPE; /* Line 214 of yacc.c. */ -#line 215 "compile.tab.C" +#line 217 "compile.tab.C" #if ! defined (yyoverflow) || YYERROR_VERBOSE -# ifndef YYFREE -# define YYFREE free -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# endif - /* The parser invokes alloca or malloc; define the necessary symbols. */ -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# define YYSTACK_ALLOC alloca -# endif +# if YYSTACK_USE_ALLOCA +# define YYSTACK_ALLOC alloca # else -# if defined (alloca) || defined (_ALLOCA_H) -# define YYSTACK_ALLOC alloca -# else -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca +# ifndef YYSTACK_USE_ALLOCA +# if defined (alloca) || defined (_ALLOCA_H) +# define YYSTACK_ALLOC alloca +# else +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# endif # endif # endif # endif @@ -246,20 +241,20 @@ typedef int YYSTYPE; # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE +# define YYSTACK_ALLOC malloc +# define YYSTACK_FREE free # endif #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ #if (! defined (yyoverflow) \ && (! defined (__cplusplus) \ - || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) + || (YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { - short int yyss; + short yyss; YYSTYPE yyvs; }; @@ -269,13 +264,13 @@ union yyalloc /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ + ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY -# if defined (__GNUC__) && 1 < __GNUC__ +# if 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else @@ -311,7 +306,7 @@ union yyalloc #if defined (__STDC__) || defined (__cplusplus) typedef signed char yysigned_char; #else - typedef short int yysigned_char; + typedef short yysigned_char; #endif /* YYFINAL -- State number of the termination state. */ @@ -372,7 +367,7 @@ static const unsigned char yytranslate[] #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ -static const unsigned short int yyprhs[] = +static const unsigned short yyprhs[] = { 0, 0, 3, 5, 7, 9, 12, 14, 16, 18, 23, 25, 27, 29, 32, 35, 37, 39, 40, 49, @@ -395,7 +390,7 @@ static const unsigned short int yyprhs[] }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const short int yyrhs[] = +static const short yyrhs[] = { 63, 0, -1, 65, -1, 64, -1, 66, -1, 64, 66, -1, 79, -1, 67, -1, 72, -1, 47, 4, @@ -448,26 +443,26 @@ static const short int yyrhs[] = }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const unsigned short int yyrline[] = +static const unsigned short yyrline[] = { - 0, 126, 126, 133, 135, 135, 136, 138, 138, 140, - 212, 212, 213, 213, 214, 215, 215, 217, 217, 257, - 257, 258, 259, 259, 260, 260, 262, 262, 266, 266, - 268, 268, 269, 269, 270, 270, 270, 274, 281, 282, - 282, 283, 285, 286, 287, 309, 310, 310, 314, 319, - 320, 321, 322, 339, 344, 347, 348, 349, 351, 354, - 351, 362, 370, 377, 378, 379, 381, 387, 388, 388, - 392, 398, 401, 398, 417, 419, 419, 421, 422, 423, - 425, 428, 425, 431, 432, 434, 435, 438, 439, 442, - 443, 445, 449, 464, 469, 470, 471, 476, 476, 478, - 478, 479, 480, 488, 493, 496, 497, 498, 499, 501, - 505, 514, 517, 514, 525, 530, 530, 531, 537, 538, - 540, 552, 564, 566, 567, 568, 569, 570, 571, 572, - 573, 575, 576, 577, 578, 579, 580, 581, 582, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, - 605, 606, 607, 608, 609, 610, 613, 618, 627, 632, - 633, 634, 636 + 0, 128, 128, 135, 137, 137, 138, 140, 140, 142, + 214, 214, 215, 215, 216, 217, 217, 219, 219, 259, + 259, 260, 261, 261, 262, 262, 264, 264, 268, 268, + 270, 270, 271, 271, 272, 272, 272, 276, 283, 284, + 284, 285, 287, 288, 289, 311, 312, 312, 316, 321, + 322, 323, 324, 341, 346, 349, 350, 351, 353, 356, + 353, 364, 372, 379, 380, 381, 383, 389, 390, 390, + 394, 400, 403, 400, 419, 421, 421, 423, 424, 425, + 427, 430, 427, 433, 434, 436, 437, 440, 441, 444, + 445, 447, 451, 466, 471, 472, 473, 478, 478, 480, + 480, 481, 482, 490, 495, 498, 499, 500, 501, 503, + 507, 516, 519, 516, 527, 532, 532, 533, 539, 540, + 542, 554, 566, 568, 569, 570, 571, 572, 573, 574, + 575, 577, 578, 579, 580, 581, 582, 583, 584, 586, + 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, + 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, + 607, 608, 609, 610, 611, 612, 615, 620, 629, 634, + 635, 636, 638 }; #endif @@ -476,40 +471,40 @@ static const unsigned short int yyrline[ First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { - "$end", "error", "$undefined", "EON", "STRING", "BOGUS", - "BAD_STRING_COMPARISON_OPERATOR", "BAD_HEX_LITERAL", - "BAD_METHOD_DECL_START", "BAD_METHOD_PARAMETER_NAME_CHARACTER", - "BAD_NONWHITESPACE_CHARACTER_IN_EXPLICIT_RESULT_MODE", "\"&&\"", - "\"||\"", "\"!||\"", "\"!|\"", "\"<=\"", "\">=\"", "\"==\"", "\"!=\"", - "\"<<\"", "\">>\"", "\"lt\"", "\"gt\"", "\"le\"", "\"ge\"", "\"eq\"", - "\"ne\"", "\"def\"", "\"in\"", "\"-f\"", "\"-d\"", "\"is\"", "\"true\"", - "\"false\"", "'<'", "'>'", "'|'", "'&'", "'+'", "'-'", "'*'", "'/'", - "'\\\\'", "'%'", "NUNARY", "'~'", "'!'", "'@'", "'\\n'", "'['", "']'", - "';'", "'$'", "'{'", "'}'", "'.'", "'('", "')'", "'^'", "':'", "'\"'", - "'''", "$accept", "all", "methods", "one_big_piece", "method", - "control_method", "maybe_control_strings", "control_strings", - "control_string", "maybe_string", "code_method", "@1", - "maybe_bracketed_strings", "bracketed_maybe_strings", "maybe_strings", - "strings", "maybe_comment", "maybe_codes", "codes", "code", "action", - "get", "get_value", "get_name_value", "name_in_curly_rdive", - "name_without_curly_rdive", "name_without_curly_rdive_read", - "name_without_curly_rdive_class", "name_without_curly_rdive_code", "put", - "name_expr_wdive", "name_expr_wdive_root", "name_expr_wdive_write", - "name_expr_wdive_class", "construct", "construct_square", "@2", "@3", - "construct_round", "construct_curly", "any_constructor_code_value", - "constructor_code_value", "constructor_code", - "codes__excluding_sole_str_literal", "call", "call_value", "@4", "@5", - "call_name", "store_params", "store_param", "store_square_param", "@6", - "@7", "store_round_param", "store_curly_param", "store_code_param_parts", - "store_expr_param_parts", "store_curly_param_parts", - "store_code_param_part", "store_expr_param_part", - "store_curly_param_part", "code_param_value", "name_expr_dive_code", - "name_path", "name_step", "name_advance1", "name_advance2", - "name_expr_value", "name_expr_subvar_value", - "name_expr_with_subvar_value", "name_square_code_value", "@8", "@9", - "subvar_ref_name_rdive", "subvar_get_writes", "subvar__get_write", - "class_prefix", "class_static_prefix", "class_constructor_prefix", - "expr_value", "expr", "double_or_STRING", "string_inside_quotes_value", + "$end", "error", "$undefined", "EON", "STRING", "BOGUS", + "BAD_STRING_COMPARISON_OPERATOR", "BAD_HEX_LITERAL", + "BAD_METHOD_DECL_START", "BAD_METHOD_PARAMETER_NAME_CHARACTER", + "BAD_NONWHITESPACE_CHARACTER_IN_EXPLICIT_RESULT_MODE", "\"&&\"", + "\"||\"", "\"!||\"", "\"!|\"", "\"<=\"", "\">=\"", "\"==\"", "\"!=\"", + "\"<<\"", "\">>\"", "\"lt\"", "\"gt\"", "\"le\"", "\"ge\"", "\"eq\"", + "\"ne\"", "\"def\"", "\"in\"", "\"-f\"", "\"-d\"", "\"is\"", "\"true\"", + "\"false\"", "'<'", "'>'", "'|'", "'&'", "'+'", "'-'", "'*'", "'/'", + "'\\\\'", "'%'", "NUNARY", "'~'", "'!'", "'@'", "'\\n'", "'['", "']'", + "';'", "'$'", "'{'", "'}'", "'.'", "'('", "')'", "'^'", "':'", "'\"'", + "'''", "$accept", "all", "methods", "one_big_piece", "method", + "control_method", "maybe_control_strings", "control_strings", + "control_string", "maybe_string", "code_method", "@1", + "maybe_bracketed_strings", "bracketed_maybe_strings", "maybe_strings", + "strings", "maybe_comment", "maybe_codes", "codes", "code", "action", + "get", "get_value", "get_name_value", "name_in_curly_rdive", + "name_without_curly_rdive", "name_without_curly_rdive_read", + "name_without_curly_rdive_class", "name_without_curly_rdive_code", + "put", "name_expr_wdive", "name_expr_wdive_root", + "name_expr_wdive_write", "name_expr_wdive_class", "construct", + "construct_square", "@2", "@3", "construct_round", "construct_curly", + "any_constructor_code_value", "constructor_code_value", + "constructor_code", "codes__excluding_sole_str_literal", "call", + "call_value", "@4", "@5", "call_name", "store_params", "store_param", + "store_square_param", "@6", "@7", "store_round_param", + "store_curly_param", "store_code_param_parts", "store_expr_param_parts", + "store_curly_param_parts", "store_code_param_part", + "store_expr_param_part", "store_curly_param_part", "code_param_value", + "name_expr_dive_code", "name_path", "name_step", "name_advance1", + "name_advance2", "name_expr_value", "name_expr_subvar_value", + "name_expr_with_subvar_value", "name_square_code_value", "@8", "@9", + "subvar_ref_name_rdive", "subvar_get_writes", "subvar__get_write", + "class_prefix", "class_static_prefix", "class_constructor_prefix", + "expr_value", "expr", "double_or_STRING", "string_inside_quotes_value", "write_string", "void_value", "true_value", "false_value", "empty", 0 }; #endif @@ -517,7 +512,7 @@ static const char *const yytname[] = # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ -static const unsigned short int yytoknum[] = +static const unsigned short yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, @@ -610,7 +605,7 @@ static const unsigned char yydefact[] = }; /* YYDEFGOTO[NTERM-NUM]. */ -static const short int yydefgoto[] = +static const short yydefgoto[] = { -1, 5, 6, 7, 8, 9, 92, 93, 94, 95, 10, 244, 101, 56, 98, 99, 140, 161, 12, 13, @@ -626,7 +621,7 @@ static const short int yydefgoto[] = /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -107 -static const short int yypact[] = +static const short yypact[] = { 14, -107, 13, 45, -107, 28, -15, -107, -107, -107, -107, -107, 21, -107, -107, -107, -107, -107, -107, -107, @@ -658,7 +653,7 @@ static const short int yypact[] = }; /* YYPGOTO[NTERM-NUM]. */ -static const short int yypgoto[] = +static const short yypgoto[] = { -107, -107, -107, -107, 206, -107, -107, -107, 124, -107, -107, -107, -107, 170, -107, -107, -107, 1, -58, -7, @@ -676,7 +671,7 @@ static const short int yypgoto[] = number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -173 -static const short int yytable[] = +static const short yytable[] = { 16, 11, 19, 145, 106, 53, 43, 39, -103, 70, 23, 111, 16, 91, 19, 74, 83, 22, 1, 75, @@ -728,7 +723,7 @@ static const short int yytable[] = 191 }; -static const short int yycheck[] = +static const short yycheck[] = { 0, 0, 0, 109, 62, 12, 3, 3, 3, 27, 4, 4, 12, 4, 12, 49, 39, 4, 4, 53, @@ -836,7 +831,7 @@ static const unsigned char yystos[] = #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab +#define YYERROR goto yyerrlab1 /* Like YYERROR except do call yyerror. This remains here temporarily @@ -871,11 +866,11 @@ while (0) are run). */ #ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - ((Current).first_line = (Rhs)[1].first_line, \ - (Current).first_column = (Rhs)[1].first_column, \ - (Current).last_line = (Rhs)[N].last_line, \ - (Current).last_column = (Rhs)[N].last_column) +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + Current.first_line = Rhs[1].first_line; \ + Current.first_column = Rhs[1].first_column; \ + Current.last_line = Rhs[N].last_line; \ + Current.last_column = Rhs[N].last_column; #endif /* YYLEX -- calling `yylex' with the right arguments. */ @@ -919,17 +914,17 @@ do { \ /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | +| TOP (cinluded). | `------------------------------------------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void -yy_stack_print (short int *bottom, short int *top) +yy_stack_print (short *bottom, short *top) #else static void yy_stack_print (bottom, top) - short int *bottom; - short int *top; + short *bottom; + short *top; #endif { YYFPRINTF (stderr, "Stack now"); @@ -998,7 +993,7 @@ int yydebug; SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ -#if defined (YYMAXDEPTH) && YYMAXDEPTH == 0 +#if YYMAXDEPTH == 0 # undef YYMAXDEPTH #endif @@ -1196,9 +1191,9 @@ int yynerrs; to reallocate them elsewhere. */ /* The state stack. */ - short int yyssa[YYINITDEPTH]; - short int *yyss = yyssa; - register short int *yyssp; + short yyssa[YYINITDEPTH]; + short *yyss = yyssa; + register short *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; @@ -1235,7 +1230,6 @@ int yynerrs; yyssp = yyss; yyvsp = yyvs; - goto yysetstate; /*------------------------------------------------------------. @@ -1261,7 +1255,7 @@ int yynerrs; these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; - short int *yyss1 = yyss; + short *yyss1 = yyss; /* Each stack pointer address is followed by the size of the @@ -1289,7 +1283,7 @@ int yynerrs; yystacksize = YYMAXDEPTH; { - short int *yyss1 = yyss; + short *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) @@ -1422,7 +1416,7 @@ yyreduce: switch (yyn) { case 2: -#line 126 "compile.y" +#line 128 "compile.y" { Method& method=*new Method(Method::CT_ANY, 0, 0, /*min, max numbered_params_count*/ @@ -1433,7 +1427,7 @@ yyreduce: break; case 9: -#line 141 "compile.y" +#line 143 "compile.y" { const String& command=*LA2S(*yyvsp[-2]); YYSTYPE strings_code=yyvsp[0]; @@ -1508,12 +1502,12 @@ yyreduce: break; case 13: -#line 213 "compile.y" +#line 215 "compile.y" { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;} break; case 17: -#line 217 "compile.y" +#line 219 "compile.y" { PC.explicit_result=false; const String& name=*LA2S(*yyvsp[-4]); @@ -1553,7 +1547,7 @@ yyreduce: break; case 18: -#line 252 "compile.y" +#line 254 "compile.y" { // fill in the code reinterpret_cast(yyvsp[-1])->parser_code=yyvsp[0]; @@ -1561,22 +1555,22 @@ yyreduce: break; case 21: -#line 258 "compile.y" +#line 260 "compile.y" {yyval=yyvsp[-1];} break; case 25: -#line 260 "compile.y" +#line 262 "compile.y" { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]) ;} break; case 31: -#line 268 "compile.y" +#line 270 "compile.y" { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;} break; case 37: -#line 274 "compile.y" +#line 276 "compile.y" { yyval=yyvsp[0]; /* stack: resulting value */ changetail_or_append(*yyval, @@ -1587,17 +1581,17 @@ yyreduce: break; case 38: -#line 281 "compile.y" +#line 283 "compile.y" { yyval=yyvsp[0] ;} break; case 41: -#line 283 "compile.y" +#line 285 "compile.y" { yyval=yyvsp[-1] ;} break; case 44: -#line 287 "compile.y" +#line 289 "compile.y" { yyval=N(); ArrayOperation* diving_code=yyvsp[0]; @@ -1623,17 +1617,17 @@ yyreduce: break; case 45: -#line 309 "compile.y" +#line 311 "compile.y" { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;} break; case 47: -#line 310 "compile.y" +#line 312 "compile.y" { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;} break; case 48: -#line 314 "compile.y" +#line 316 "compile.y" { yyval=yyvsp[-1]; /* stack: context,name */ P(*yyval, *yyvsp[0]); /* stack: context,name,constructor_value */ @@ -1641,7 +1635,7 @@ yyreduce: break; case 52: -#line 322 "compile.y" +#line 324 "compile.y" { yyval=N(); ArrayOperation* diving_code=yyvsp[0]; @@ -1662,7 +1656,7 @@ yyreduce: break; case 53: -#line 339 "compile.y" +#line 341 "compile.y" { yyval=N(); O(*yyval, OP_WITH_WRITE); /* stack: starting context */ @@ -1671,12 +1665,12 @@ yyreduce: break; case 54: -#line 344 "compile.y" +#line 346 "compile.y" { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;} break; case 58: -#line 351 "compile.y" +#line 353 "compile.y" { // allow $result_or_other_variable[ letters here any time ] *reinterpret_cast(&yyval)=PC.explicit_result; PC.explicit_result=false; @@ -1684,14 +1678,14 @@ yyreduce: break; case 59: -#line 354 "compile.y" +#line 356 "compile.y" { PC.explicit_result=*reinterpret_cast(&yyvsp[-1]); ;} break; case 60: -#line 356 "compile.y" +#line 358 "compile.y" { // stack: context, name yyval=yyvsp[-2]; // stack: context, name, value @@ -1700,7 +1694,7 @@ yyreduce: break; case 61: -#line 362 "compile.y" +#line 364 "compile.y" { yyval=N(); O(*yyval, OP_PREPARE_TO_EXPRESSION); @@ -1711,7 +1705,7 @@ yyreduce: break; case 62: -#line 370 "compile.y" +#line 372 "compile.y" { // stack: context, name yyval=N(); @@ -1720,7 +1714,7 @@ yyreduce: break; case 66: -#line 381 "compile.y" +#line 383 "compile.y" { yyval=N(); OA(*yyval, OP_OBJECT_POOL, yyvsp[0]); /* stack: empty write context */ @@ -1730,12 +1724,12 @@ yyreduce: break; case 69: -#line 388 "compile.y" +#line 390 "compile.y" { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;} break; case 70: -#line 392 "compile.y" +#line 394 "compile.y" { yyval=yyvsp[0]; /* stack: value */ changetail_or_append(*yyval, @@ -1745,28 +1739,28 @@ yyreduce: break; case 71: -#line 398 "compile.y" +#line 400 "compile.y" { PC.in_call_value=true; ;} break; case 72: -#line 401 "compile.y" +#line 403 "compile.y" { PC.in_call_value=false; ;} break; case 73: -#line 404 "compile.y" +#line 406 "compile.y" { /* ^field.$method{vasya} */ yyval=yyvsp[-3]; /* with_xxx,diving code; stack: context,method_junction */ YYSTYPE params_code=yyvsp[-1]; if(params_code->count()==4) { // probably [] case. [OP_VALUE+origin+Void+STORE_PARAM] if(Value* value=LA2V(*params_code)) // it is OP_VALUE+origin+value? - if(!value->is_defined()) // value is VVoid? + if(value->is_void()) // value is VVoid? params_code=0; // ^zzz[] case. don't append lone empty param. } /* stack: context, method_junction */ @@ -1775,12 +1769,12 @@ yyreduce: break; case 76: -#line 419 "compile.y" +#line 421 "compile.y" { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;} break; case 80: -#line 425 "compile.y" +#line 427 "compile.y" { // allow ^call[ letters here any time ] *reinterpret_cast(&yyval)=PC.explicit_result; PC.explicit_result=false; @@ -1788,44 +1782,44 @@ yyreduce: break; case 81: -#line 428 "compile.y" +#line 430 "compile.y" { PC.explicit_result=*reinterpret_cast(&yyvsp[-1]); ;} break; case 82: -#line 430 "compile.y" +#line 432 "compile.y" {yyval=yyvsp[-2];} break; case 83: -#line 431 "compile.y" +#line 433 "compile.y" {yyval=yyvsp[-1];} break; case 84: -#line 432 "compile.y" +#line 434 "compile.y" {yyval=yyvsp[-1];} break; case 86: -#line 435 "compile.y" +#line 437 "compile.y" { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]) ;} break; case 88: -#line 439 "compile.y" +#line 441 "compile.y" { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]) ;} break; case 90: -#line 443 "compile.y" +#line 445 "compile.y" { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]) ;} break; case 91: -#line 445 "compile.y" +#line 447 "compile.y" { yyval=yyvsp[0]; O(*yyval, OP_STORE_PARAM); @@ -1833,7 +1827,7 @@ yyreduce: break; case 92: -#line 449 "compile.y" +#line 451 "compile.y" { YYSTYPE expr_code=yyvsp[0]; if(expr_code->count()==3 @@ -1852,7 +1846,7 @@ yyreduce: break; case 93: -#line 464 "compile.y" +#line 466 "compile.y" { yyval=N(); OA(*yyval, OP_CURLY_CODE__STORE_PARAM, yyvsp[0]); @@ -1860,17 +1854,17 @@ yyreduce: break; case 98: -#line 476 "compile.y" +#line 478 "compile.y" { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;} break; case 100: -#line 478 "compile.y" +#line 480 "compile.y" { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;} break; case 102: -#line 480 "compile.y" +#line 482 "compile.y" { // 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 @@ -1882,7 +1876,7 @@ yyreduce: break; case 103: -#line 488 "compile.y" +#line 490 "compile.y" { /* stack: context */ yyval=yyvsp[0]; /* stack: context,name */ @@ -1891,7 +1885,7 @@ yyreduce: break; case 109: -#line 501 "compile.y" +#line 503 "compile.y" { yyval=yyvsp[0]; O(*yyval, OP_GET_ELEMENT); @@ -1899,7 +1893,7 @@ yyreduce: break; case 110: -#line 505 "compile.y" +#line 507 "compile.y" { ArrayOperation* code; { @@ -1912,7 +1906,7 @@ yyreduce: break; case 111: -#line 514 "compile.y" +#line 516 "compile.y" { // allow $result_or_other_variable[ letters here any time ] *reinterpret_cast(&yyval)=PC.explicit_result; PC.explicit_result=false; @@ -1920,14 +1914,14 @@ yyreduce: break; case 112: -#line 517 "compile.y" +#line 519 "compile.y" { PC.explicit_result=*reinterpret_cast(&yyvsp[-1]); ;} break; case 113: -#line 519 "compile.y" +#line 521 "compile.y" { yyval=N(); OA(*yyval, OP_OBJECT_POOL, yyvsp[-2]); /* stack: empty write context */ @@ -1937,7 +1931,7 @@ yyreduce: break; case 114: -#line 525 "compile.y" +#line 527 "compile.y" { yyval=N(); O(*yyval, OP_WITH_READ); @@ -1946,12 +1940,12 @@ yyreduce: break; case 116: -#line 530 "compile.y" +#line 532 "compile.y" { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;} break; case 117: -#line 531 "compile.y" +#line 533 "compile.y" { yyval=yyvsp[0]; O(*yyval, OP_GET_ELEMENT__WRITE); @@ -1959,7 +1953,7 @@ yyreduce: break; case 120: -#line 540 "compile.y" +#line 542 "compile.y" { yyval=yyvsp[-1]; // stack: class name string if(*LA2S(*yyval) == BASE_NAME) { // pseudo BASE class @@ -1975,7 +1969,7 @@ yyreduce: break; case 121: -#line 552 "compile.y" +#line 554 "compile.y" { yyval=yyvsp[-1]; if(!PC.in_call_value) { @@ -1987,197 +1981,197 @@ yyreduce: break; case 128: -#line 571 "compile.y" +#line 573 "compile.y" { yyval = yyvsp[-1] ;} break; case 129: -#line 572 "compile.y" +#line 574 "compile.y" { yyval = yyvsp[-1] ;} break; case 130: -#line 573 "compile.y" +#line 575 "compile.y" { yyval = yyvsp[-1]; ;} break; case 131: -#line 575 "compile.y" +#line 577 "compile.y" { yyval=yyvsp[0]; O(*yyval, OP_NEG) ;} break; case 132: -#line 576 "compile.y" +#line 578 "compile.y" { yyval=yyvsp[0] ;} break; case 133: -#line 577 "compile.y" +#line 579 "compile.y" { yyval=yyvsp[0]; O(*yyval, OP_INV) ;} break; case 134: -#line 578 "compile.y" +#line 580 "compile.y" { yyval=yyvsp[0]; O(*yyval, OP_NOT) ;} break; case 135: -#line 579 "compile.y" +#line 581 "compile.y" { yyval=yyvsp[0]; O(*yyval, OP_DEF) ;} break; case 136: -#line 580 "compile.y" +#line 582 "compile.y" { yyval=yyvsp[0]; O(*yyval, OP_IN) ;} break; case 137: -#line 581 "compile.y" +#line 583 "compile.y" { yyval=yyvsp[0]; O(*yyval, OP_FEXISTS) ;} break; case 138: -#line 582 "compile.y" +#line 584 "compile.y" { yyval=yyvsp[0]; O(*yyval, OP_DEXISTS) ;} break; case 139: -#line 584 "compile.y" +#line 586 "compile.y" { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP_SUB) ;} break; case 140: -#line 585 "compile.y" +#line 587 "compile.y" { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP_ADD) ;} break; case 141: -#line 586 "compile.y" +#line 588 "compile.y" { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP_MUL) ;} break; case 142: -#line 587 "compile.y" +#line 589 "compile.y" { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP_DIV) ;} break; case 143: -#line 588 "compile.y" +#line 590 "compile.y" { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP_MOD) ;} break; case 144: -#line 589 "compile.y" +#line 591 "compile.y" { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP_INTDIV) ;} break; case 145: -#line 590 "compile.y" +#line 592 "compile.y" { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP_BIN_SL) ;} break; case 146: -#line 591 "compile.y" +#line 593 "compile.y" { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP_BIN_SR) ;} break; case 147: -#line 592 "compile.y" +#line 594 "compile.y" { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP_BIN_AND) ;} break; case 148: -#line 593 "compile.y" +#line 595 "compile.y" { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP_BIN_OR) ;} break; case 149: -#line 594 "compile.y" +#line 596 "compile.y" { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP_BIN_XOR) ;} break; case 150: -#line 595 "compile.y" +#line 597 "compile.y" { yyval=yyvsp[-2]; OA(*yyval, OP_NESTED_CODE, yyvsp[0]); O(*yyval, OP_LOG_AND) ;} break; case 151: -#line 596 "compile.y" +#line 598 "compile.y" { yyval=yyvsp[-2]; OA(*yyval, OP_NESTED_CODE, yyvsp[0]); O(*yyval, OP_LOG_OR) ;} break; case 152: -#line 597 "compile.y" +#line 599 "compile.y" { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP_LOG_XOR) ;} break; case 153: -#line 598 "compile.y" +#line 600 "compile.y" { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP_NUM_LT) ;} break; case 154: -#line 599 "compile.y" +#line 601 "compile.y" { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP_NUM_GT) ;} break; case 155: -#line 600 "compile.y" +#line 602 "compile.y" { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP_NUM_LE) ;} break; case 156: -#line 601 "compile.y" +#line 603 "compile.y" { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP_NUM_GE) ;} break; case 157: -#line 602 "compile.y" +#line 604 "compile.y" { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP_NUM_EQ) ;} break; case 158: -#line 603 "compile.y" +#line 605 "compile.y" { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP_NUM_NE) ;} break; case 159: -#line 604 "compile.y" +#line 606 "compile.y" { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP_STR_LT) ;} break; case 160: -#line 605 "compile.y" +#line 607 "compile.y" { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP_STR_GT) ;} break; case 161: -#line 606 "compile.y" +#line 608 "compile.y" { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP_STR_LE) ;} break; case 162: -#line 607 "compile.y" +#line 609 "compile.y" { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP_STR_GE) ;} break; case 163: -#line 608 "compile.y" +#line 610 "compile.y" { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP_STR_EQ) ;} break; case 164: -#line 609 "compile.y" +#line 611 "compile.y" { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP_STR_NE) ;} break; case 165: -#line 610 "compile.y" +#line 612 "compile.y" { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP_IS) ;} break; case 166: -#line 613 "compile.y" +#line 615 "compile.y" { // optimized from OP_STRING->OP_VALUE for doubles maybe_change_string_literal_to_double_literal(*(yyval=yyvsp[0])); @@ -2185,7 +2179,7 @@ yyreduce: break; case 167: -#line 618 "compile.y" +#line 620 "compile.y" { yyval=N(); OA(*yyval, OP_STRING_POOL, yyvsp[0]); /* stack: empty write context */ @@ -2195,7 +2189,7 @@ yyreduce: break; case 168: -#line 627 "compile.y" +#line 629 "compile.y" { // optimized from OP_STRING+OP_WRITE_VALUE to OP_STRING__WRITE change_string_literal_to_write_string_literal(*(yyval=yyvsp[0])) @@ -2203,30 +2197,30 @@ yyreduce: break; case 169: -#line 632 "compile.y" +#line 634 "compile.y" { yyval=VL(/*we know that we will not change it*/const_cast(&vvoid), 0, 0, 0) ;} break; case 170: -#line 633 "compile.y" +#line 635 "compile.y" { yyval = VL(/*we know that we will not change it*/const_cast(&vtrue), 0, 0, 0) ;} break; case 171: -#line 634 "compile.y" +#line 636 "compile.y" { yyval = VL(/*we know that we will not change it*/const_cast(&vfalse), 0, 0, 0) ;} break; case 172: -#line 636 "compile.y" +#line 638 "compile.y" { yyval=N() ;} break; } -/* Line 1010 of yacc.c. */ -#line 2230 "compile.tab.C" +/* Line 999 of yacc.c. */ +#line 2224 "compile.tab.C" yyvsp -= yylen; yyssp -= yylen; @@ -2329,27 +2323,25 @@ yyerrlab: /* If just tried and failed to reuse lookahead token after an error, discard it. */ - if (yychar <= YYEOF) + /* Return failure if at end of input. */ + if (yychar == YYEOF) { - /* If at end of input, pop the error token, - then the rest of the stack, then return failure. */ - if (yychar == YYEOF) - for (;;) - { - YYPOPSTACK; - if (yyssp == yyss) - YYABORT; - YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); - yydestruct (yystos[*yyssp], yyvsp); - } + /* Pop the error token. */ + YYPOPSTACK; + /* Pop the rest of the stack. */ + while (yyss < yyssp) + { + YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); + yydestruct (yystos[*yyssp], yyvsp); + YYPOPSTACK; + } + YYABORT; } - else - { - YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); - yydestruct (yytoken, &yylval); - yychar = YYEMPTY; - } + YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); + yydestruct (yytoken, &yylval); + yychar = YYEMPTY; + } /* Else will try to reuse lookahead token after shifting the error @@ -2357,27 +2349,9 @@ yyerrlab: goto yyerrlab1; -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - -#ifdef __GNUC__ - /* Pacify GCC when the user code never invokes YYERROR and the label - yyerrorlab therefore never appears in user code. */ - if (0) - goto yyerrorlab; -#endif - - yyvsp -= yylen; - yyssp -= yylen; - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ +/*----------------------------------------------------. +| yyerrlab1 -- error raised explicitly by an action. | +`----------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ @@ -2401,8 +2375,9 @@ yyerrlab1: YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); yydestruct (yystos[yystate], yyvsp); - YYPOPSTACK; - yystate = *yyssp; + yyvsp--; + yystate = *--yyssp; + YY_STACK_PRINT (yyss, yyssp); } @@ -2451,7 +2426,7 @@ yyreturn: } -#line 638 "compile.y" +#line 640 "compile.y" #endif @@ -2573,9 +2548,9 @@ default: } // #HH ? if(pc.source[0]=='#' && pc.source[1] && pc.source[2]) { - char c= + char c=(char)( hex_value[(unsigned char)pc.source[1]]*0x10+ - hex_value[(unsigned char)pc.source[2]]; + hex_value[(unsigned char)pc.source[2]]); if(c==0) { result=BAD_HEX_LITERAL; goto break2; // wrong hex value[no ^#00 chars allowed]: bail out