From 3e8eeea97b2ca0f26660a74671ad239d514c1760 Mon Sep 17 00:00:00 2001 From: Ge Wang Date: Fri, 10 Nov 2023 22:28:54 -0800 Subject: [PATCH 01/20] parser support for constructors --- src/core/chuck.y | 16 +- src/core/chuck_absyn.cpp | 7 +- src/core/chuck_absyn.h | 11 +- src/core/chuck_emit.cpp | 2 +- src/core/chuck_instr.cpp | 2 +- src/core/chuck_type.cpp | 20 +- src/core/chuck_type.h | 15 +- src/core/chuck_yacc.c | 1239 ++++++++++++++++++++------------------ 8 files changed, 686 insertions(+), 626 deletions(-) diff --git a/src/core/chuck.y b/src/core/chuck.y index 53f757422..13525de57 100644 --- a/src/core/chuck.y +++ b/src/core/chuck.y @@ -434,9 +434,11 @@ var_decl_list ; var_decl - : ID { $$ = new_var_decl( $1, NULL, @1.first_line, @1.first_column ); } - | ID array_exp { $$ = new_var_decl( $1, $2, @1.first_line, @1.first_column ); } - | ID array_empty { $$ = new_var_decl( $1, $2, @1.first_line, @1.first_column ); } + : ID { $$ = new_var_decl( $1, NULL, NULL, @1.first_line, @1.first_column ); } + | ID array_exp { $$ = new_var_decl( $1, NULL, $2, @1.first_line, @1.first_column ); } + | ID array_empty { $$ = new_var_decl( $1, NULL, $2, @1.first_line, @1.first_column ); } + | ID LPAREN expression RPAREN { $$ = new_var_decl( $1, $3, NULL, @1.first_line, @1.first_column ); } // 1.5.1.9 (ge) added for constructors + | ID LPAREN expression RPAREN array_exp { $$ = new_var_decl( $1, $3, $5, @1.first_line, @1.first_column ); } // 1.5.1.9 (ge) added for constructors ; complex_exp @@ -587,9 +589,13 @@ unary_expression | SIZEOF unary_expression { $$ = new_exp_from_unary( ae_op_sizeof, $2, @1.first_line, @1.first_column ); } | NEW type_decl - { $$ = new_exp_from_unary2( ae_op_new, $2, NULL, @1.first_line, @1.first_column ); } + { $$ = new_exp_from_unary2( ae_op_new, $2, NULL, NULL, @1.first_line, @1.first_column ); } | NEW type_decl array_exp - { $$ = new_exp_from_unary2( ae_op_new, $2, $3, @1.first_line, @1.first_column ); } + { $$ = new_exp_from_unary2( ae_op_new, $2, NULL, $3, @1.first_line, @1.first_column ); } + | NEW type_decl LPAREN expression RPAREN // 1.5.1.9 (ge) added for constructors + { $$ = new_exp_from_unary2( ae_op_new, $2, $4, NULL, @1.first_line, @1.first_column ); } + | NEW type_decl LPAREN expression RPAREN array_exp // 1.5.1.9 (ge) added for constructors + { $$ = new_exp_from_unary2( ae_op_new, $2, $4, $6, @1.first_line, @1.first_column ); } // | SPORK TILDA code_segment // { $$ = new_exp_from_unary3( ae_op_spork, $3, @1.first_line, @1.first_column ); } ; diff --git a/src/core/chuck_absyn.cpp b/src/core/chuck_absyn.cpp index 66d90702a..94de84ffb 100644 --- a/src/core/chuck_absyn.cpp +++ b/src/core/chuck_absyn.cpp @@ -394,13 +394,15 @@ a_Exp new_exp_from_unary( ae_Operator oper, a_Exp exp, uint32_t lineNum, uint32_ } a_Exp new_exp_from_unary2( ae_Operator oper, a_Type_Decl type, - a_Array_Sub array, uint32_t lineNum, uint32_t posNum ) + a_Exp ctor_args, a_Array_Sub array, + uint32_t lineNum, uint32_t posNum ) { a_Exp a = (a_Exp)checked_malloc( sizeof( struct a_Exp_ ) ); a->s_type = ae_exp_unary; a->s_meta = ae_meta_value; a->unary.op = oper; a->unary.type = type; + a->unary.ctor_args = ctor_args; a->unary.array = array; a->line = lineNum; a->where = posNum; a->unary.line = lineNum; a->unary.where = posNum; @@ -712,10 +714,11 @@ a_Exp new_exp_from_nil( uint32_t lineNum, uint32_t posNum ) return a; } -a_Var_Decl new_var_decl( c_constr xid, a_Array_Sub array, uint32_t lineNum, uint32_t posNum ) +a_Var_Decl new_var_decl( c_constr xid, a_Exp ctor_args, a_Array_Sub array, uint32_t lineNum, uint32_t posNum ) { a_Var_Decl a = (a_Var_Decl)checked_malloc( sizeof( struct a_Var_Decl_ ) ); a->xid = insert_symbol(xid); + a->ctor_args = ctor_args; a->array = array; a->line = lineNum; a->where = posNum; diff --git a/src/core/chuck_absyn.h b/src/core/chuck_absyn.h index f4a99a26b..445e8ce6c 100644 --- a/src/core/chuck_absyn.h +++ b/src/core/chuck_absyn.h @@ -173,7 +173,7 @@ a_Stmt new_stmt_from_case( a_Exp exp, uint32_t line, uint32_t where ); a_Exp append_expression( a_Exp list, a_Exp exp, uint32_t line, uint32_t where ); a_Exp new_exp_from_binary( a_Exp lhs, ae_Operator oper, a_Exp rhs, uint32_t line, uint32_t where ); a_Exp new_exp_from_unary( ae_Operator oper, a_Exp exp, uint32_t line, uint32_t where ); -a_Exp new_exp_from_unary2( ae_Operator oper, a_Type_Decl type, a_Array_Sub array, uint32_t line, uint32_t where ); +a_Exp new_exp_from_unary2( ae_Operator oper, a_Type_Decl type, a_Exp ctor_args, a_Array_Sub array, uint32_t line, uint32_t where ); a_Exp new_exp_from_unary3( ae_Operator oper, a_Stmt code, uint32_t line, uint32_t where ); a_Exp new_exp_from_cast( a_Type_Decl type, a_Exp exp, uint32_t line, uint32_t where, uint32_t castPos ); a_Exp new_exp_from_array( a_Exp base, a_Array_Sub indices, uint32_t line, uint32_t where ); @@ -198,7 +198,7 @@ a_Exp new_exp_from_hack( a_Exp exp, uint32_t line, uint32_t where ); a_Exp new_exp_from_nil( uint32_t line, uint32_t where ); a_Var_Decl_List new_var_decl_list( a_Var_Decl var_decl, uint32_t line, uint32_t where ); a_Var_Decl_List prepend_var_decl_list( a_Var_Decl var_decl, a_Var_Decl_List list, uint32_t line, uint32_t where ); -a_Var_Decl new_var_decl( c_constr xid, a_Array_Sub array, uint32_t line, uint32_t where ); +a_Var_Decl new_var_decl( c_constr xid, a_Exp ctor_args, a_Array_Sub array, uint32_t line, uint32_t where ); a_Type_Decl new_type_decl( a_Id_List xid, int ref, uint32_t line, uint32_t where ); a_Type_Decl add_type_decl_array( a_Type_Decl type_decl, a_Array_Sub array, uint32_t line, uint32_t where ); a_Arg_List new_arg_list( a_Type_Decl type_decl, a_Var_Decl var_decl, uint32_t line, uint32_t where ); @@ -299,7 +299,7 @@ void delete_vec( a_Vec v ); //------------------------------------------------------------------------------ struct a_Exp_Binary_ { a_Exp lhs; ae_Operator op; a_Exp rhs; t_CKFUNC ck_func; t_CKFUNC ck_overload_func; uint32_t line; uint32_t where; a_Exp self; }; struct a_Exp_Cast_ { a_Type_Decl type; a_Exp exp; uint32_t line; uint32_t where; a_Exp self; }; -struct a_Exp_Unary_ { ae_Operator op; a_Exp exp; a_Type_Decl type; a_Array_Sub array; +struct a_Exp_Unary_ { ae_Operator op; a_Exp exp; a_Type_Decl type; a_Exp ctor_args; a_Array_Sub array; a_Stmt code; t_CKFUNC ck_overload_func; uint32_t line; uint32_t where; a_Exp self; }; struct a_Exp_Postfix_ { a_Exp exp; ae_Operator op; t_CKFUNC ck_overload_func; uint32_t line; uint32_t where; a_Exp self; }; struct a_Exp_Dur_ { a_Exp base; a_Exp unit; uint32_t line; uint32_t where; a_Exp self; }; @@ -313,8 +313,9 @@ struct a_Exp_Decl_ { a_Type_Decl type; a_Var_Decl_List var_decl_list; int num_va struct a_Exp_Hack_ { a_Exp exp; uint32_t line; uint32_t where; a_Exp self; }; struct a_Var_Decl_List_ { a_Var_Decl var_decl; a_Var_Decl_List next; uint32_t line; uint32_t where; a_Exp self; }; // 1.4.2.0 (ge) added ck_type and ref, to handle multiple array decl (e.g., int x, y[], z[1];) -struct a_Var_Decl_ { S_Symbol xid; a_Array_Sub array; t_CKVALUE value; void * addr; - t_CKTYPE ck_type; /* int is_auto; */ int ref; int force_ref; +struct a_Var_Decl_ { S_Symbol xid; a_Exp ctor_args; a_Array_Sub array; + t_CKVALUE value; void * addr; t_CKTYPE ck_type; + /* int is_auto; */ int ref; int force_ref; uint32_t line; uint32_t where; a_Exp self; }; struct a_Type_Decl_ { a_Id_List xid; a_Array_Sub array; int ref; uint32_t line; uint32_t where; /*a_Exp self;*/ }; struct a_Array_Sub_ { t_CKUINT depth; a_Exp exp_list; uint32_t line; uint32_t where; a_Exp self; diff --git a/src/core/chuck_emit.cpp b/src/core/chuck_emit.cpp index cf9e9b2ca..ac042d91b 100644 --- a/src/core/chuck_emit.cpp +++ b/src/core/chuck_emit.cpp @@ -4840,7 +4840,7 @@ t_CKBOOL emit_engine_pre_constructor( Chuck_Emitter * emit, Chuck_Type * type ) emit_engine_pre_constructor( emit, type->parent ); // pre constructor - if( type->has_constructor ) + if( type->has_pre_ctor ) { // make sure assert( type->info->pre_ctor != NULL ); diff --git a/src/core/chuck_instr.cpp b/src/core/chuck_instr.cpp index 05e904f07..5cff8846a 100644 --- a/src/core/chuck_instr.cpp +++ b/src/core/chuck_instr.cpp @@ -4048,7 +4048,7 @@ void call_all_parent_pre_constructors( Chuck_VM * vm, Chuck_VM_Shred * shred, call_all_parent_pre_constructors( vm, shred, type->parent, stack_offset ); } // now, call my ctor - if( type->has_constructor ) + if( type->has_pre_ctor ) { call_pre_constructor( vm, shred, type->info->pre_ctor, stack_offset ); } diff --git a/src/core/chuck_type.cpp b/src/core/chuck_type.cpp index 51651a498..af8e8ffd1 100644 --- a/src/core/chuck_type.cpp +++ b/src/core/chuck_type.cpp @@ -4884,7 +4884,7 @@ t_CKBOOL type_engine_check_class_def( Chuck_Env * env, a_Class_Def class_def ) { case ae_section_stmt: // flag as having a constructor - env->class_def->has_constructor |= (body->section->stmt_list->stmt != NULL); + env->class_def->has_pre_ctor |= (body->section->stmt_list->stmt != NULL); ret = type_engine_check_stmt_list( env, body->section->stmt_list ); break; @@ -6221,7 +6221,7 @@ Chuck_Type * type_engine_import_class_begin( Chuck_Env * env, Chuck_Type * type, if( pre_ctor != 0 ) { // flag it - type->has_constructor = TRUE; + type->has_pre_ctor = TRUE; // allocate vm code for (imported) pre_ctor type->info->pre_ctor = new Chuck_VM_Code; // add pre_ctor @@ -6654,7 +6654,7 @@ t_CKUINT type_engine_import_mvar( Chuck_Env * env, const char * type, type_decl->array->depth = array_depth; } // make var decl - a_Var_Decl var_decl = new_var_decl( (char *)name, NULL, 0, 0 ); + a_Var_Decl var_decl = new_var_decl( (char *)name, NULL, NULL, 0, 0 ); // 1.5.1.9 (ge) add ctor arglist // added 2013-10-22 - spencer // allow array-type mvars @@ -6727,7 +6727,7 @@ t_CKBOOL type_engine_import_svar( Chuck_Env * env, const char * type, // make type decl a_Type_Decl type_decl = new_type_decl( thePath, FALSE, 0, 0 ); // make var decl - a_Var_Decl var_decl = new_var_decl( (char *)name, NULL, 0, 0 ); + a_Var_Decl var_decl = new_var_decl( (char *)name, NULL, NULL, 0, 0 ); // 1.5.1.9 (ge) add ctor arglist // make var decl list a_Var_Decl_List var_decl_list = new_var_decl_list( var_decl, 0, 0 ); // make exp decl @@ -7677,7 +7677,8 @@ a_Arg_List partial_deep_copy_args( a_Arg_List list ) a_Var_Decl var_decl = NULL; // need name but not 'array' on var_decl - var_decl = new_var_decl( S_name(list->var_decl->xid), NULL, list->var_decl->line, list->var_decl->where ); + // 1.5.1.9 (ge) added ctor_args=NULL, also not needed from the callee's perspective + var_decl = new_var_decl( S_name(list->var_decl->xid), NULL, NULL, list->var_decl->line, list->var_decl->where ); // need var_decl by not type_decl copy = new_arg_list( NULL, var_decl, list->line, list->where ); // set type and add reference @@ -7793,7 +7794,9 @@ a_Arg_List make_dll_arg_list( Chuck_DL_Func * dl_fun ) array_sub = prepend_array_sub( array_sub, NULL, 0, 0 ); } - var_decl = new_var_decl( (char *)arg->name.c_str(), array_sub, 0, 0 ); + // make var decl + // 1.5.1.9 (ge) add ctor arglist (NULL); consider enable+refactor to support ctor + var_decl = new_var_decl( (char *)arg->name.c_str(), NULL, array_sub, 0, 0 ); // make new arg arg_list = prepend_arg_list( type_decl, var_decl, arg_list, 0, 0 ); @@ -8007,7 +8010,8 @@ t_CKBOOL type_engine_add_dll( Chuck_Env * env, Chuck_DLL * dll, const string & d // make type decl a_Type_Decl type_decl = new_type_decl( thePath2, FALSE, 0, 0 ); // make var decl - a_Var_Decl var_decl = new_var_decl( cl->svars[j]->name.c_str(), NULL, 0, 0 ); + // 1.5.1.9 (ge) add ctor arglist (NULL); consider enable+refactor to support ctor + a_Var_Decl var_decl = new_var_decl( cl->svars[j]->name.c_str(), NULL, NULL, 0, 0 ); // make var decl list a_Var_Decl_List var_decl_list = new_var_decl_list( var_decl, 0, 0 ); // make exp decl @@ -9007,7 +9011,7 @@ Chuck_Type::Chuck_Type( Chuck_Env * env, te_Type _id, const std::string & _n, is_copy = FALSE; ugen_info = NULL; is_complete = TRUE; - has_constructor = FALSE; + has_pre_ctor = FALSE; has_destructor = FALSE; allocator = NULL; diff --git a/src/core/chuck_type.h b/src/core/chuck_type.h index 367d7f373..7f25047bd 100644 --- a/src/core/chuck_type.h +++ b/src/core/chuck_type.h @@ -947,8 +947,8 @@ struct Chuck_Type : public Chuck_Object t_CKBOOL is_copy; // defined t_CKBOOL is_complete; - // has pre constructor - t_CKBOOL has_constructor; + // has pre-constructor + t_CKBOOL has_pre_ctor; // has destructor t_CKBOOL has_destructor; // custom allocator @@ -1142,6 +1142,14 @@ struct Chuck_Func : public Chuck_VM_Object // documentation std::string doc; +public: // constructors / destructor | 1.5.1.9 + // is this a constructor? + t_CKBOOL is_ctor; + // is this a default constructor? + t_CKBOOL is_default_ctor; + // is this a destructor? + t_CKBOOL is_dtor; + public: // pack c-style array of DL_Args into args cache t_CKBOOL pack_cache( Chuck_DL_Arg * dlargs, t_CKUINT numArgs ); @@ -1186,6 +1194,9 @@ struct Chuck_Func : public Chuck_VM_Object /*dl_code = NULL;*/ next = NULL; up = NULL; + is_ctor = FALSE; + is_default_ctor = FALSE; + is_dtor = FALSE; args_cache = NULL; args_cache_size = 0; invoker_mfun = NULL; diff --git a/src/core/chuck_yacc.c b/src/core/chuck_yacc.c index aaf99d909..5a1f372fd 100644 --- a/src/core/chuck_yacc.c +++ b/src/core/chuck_yacc.c @@ -649,16 +649,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 122 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1757 +#define YYLAST 1802 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 117 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 59 /* YYNRULES -- Number of rules. */ -#define YYNRULES 241 +#define YYNRULES 245 /* YYNRULES -- Number of states. */ -#define YYNSTATES 399 +#define YYNSTATES 407 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 @@ -725,21 +725,21 @@ static const yytype_uint16 yyprhs[] = 272, 279, 287, 295, 301, 309, 315, 318, 322, 324, 327, 329, 333, 335, 339, 341, 345, 349, 354, 359, 365, 368, 372, 374, 377, 381, 385, 389, 392, 396, - 398, 402, 404, 407, 410, 414, 418, 422, 424, 426, - 428, 430, 432, 434, 436, 438, 440, 442, 444, 446, - 448, 450, 452, 454, 456, 458, 460, 462, 464, 470, - 472, 476, 478, 482, 484, 488, 490, 494, 496, 500, - 502, 506, 510, 512, 516, 520, 524, 528, 530, 534, - 538, 540, 544, 548, 550, 554, 558, 562, 564, 568, - 570, 574, 576, 579, 582, 585, 588, 591, 594, 598, - 600, 602, 604, 606, 608, 611, 613, 615, 617, 619, - 621, 623, 625, 627, 629, 631, 633, 635, 637, 639, - 641, 643, 645, 647, 649, 651, 653, 655, 657, 659, - 661, 663, 665, 667, 669, 671, 673, 675, 677, 679, - 681, 683, 685, 687, 689, 691, 693, 695, 697, 699, - 701, 703, 705, 709, 711, 714, 718, 723, 727, 730, - 733, 735, 737, 739, 741, 743, 745, 747, 749, 751, - 755, 759 + 398, 402, 404, 407, 410, 415, 421, 425, 429, 433, + 435, 437, 439, 441, 443, 445, 447, 449, 451, 453, + 455, 457, 459, 461, 463, 465, 467, 469, 471, 473, + 475, 481, 483, 487, 489, 493, 495, 499, 501, 505, + 507, 511, 513, 517, 521, 523, 527, 531, 535, 539, + 541, 545, 549, 551, 555, 559, 561, 565, 569, 573, + 575, 579, 581, 585, 587, 590, 593, 596, 599, 602, + 605, 609, 615, 622, 624, 626, 628, 630, 632, 635, + 637, 639, 641, 643, 645, 647, 649, 651, 653, 655, + 657, 659, 661, 663, 665, 667, 669, 671, 673, 675, + 677, 679, 681, 683, 685, 687, 689, 691, 693, 695, + 697, 699, 701, 703, 705, 707, 709, 711, 713, 715, + 717, 719, 721, 723, 725, 727, 729, 733, 735, 738, + 742, 747, 751, 754, 757, 759, 761, 763, 765, 767, + 769, 771, 773, 775, 779, 783 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ @@ -786,42 +786,44 @@ static const yytype_int16 yyrhs[] = -1, 66, 134, 150, -1, 104, 134, 150, -1, 76, 150, -1, 104, 76, 150, -1, 151, -1, 151, 9, 150, -1, 3, -1, 3, 147, -1, 3, 148, -1, - 53, 144, 13, -1, 54, 144, 13, -1, 55, 144, - 13, -1, 90, -1, 93, -1, 77, -1, 78, -1, - 79, -1, 80, -1, 84, -1, 85, -1, 86, -1, - 95, -1, 96, -1, 81, -1, 82, -1, 83, -1, - 109, -1, 108, -1, 113, -1, 112, -1, 115, -1, - 114, -1, 158, -1, 158, 45, 144, 10, 157, -1, - 159, -1, 158, 31, 159, -1, 160, -1, 159, 30, - 160, -1, 161, -1, 160, 47, 161, -1, 162, -1, - 161, 49, 162, -1, 163, -1, 162, 48, 163, -1, - 164, -1, 163, 24, 164, -1, 163, 25, 164, -1, - 165, -1, 164, 26, 165, -1, 164, 28, 165, -1, - 164, 27, 165, -1, 164, 29, 165, -1, 166, -1, - 165, 88, 166, -1, 165, 87, 166, -1, 167, -1, - 166, 19, 167, -1, 166, 20, 167, -1, 168, -1, - 167, 21, 168, -1, 167, 22, 168, -1, 167, 23, - 168, -1, 169, -1, 168, 89, 169, -1, 170, -1, - 169, 52, 134, -1, 173, -1, 50, 170, -1, 51, - 170, -1, 171, 170, -1, 75, 170, -1, 74, 170, - -1, 73, 134, -1, 73, 134, 147, -1, 19, -1, - 20, -1, 89, -1, 46, -1, 21, -1, 107, 89, - -1, 90, -1, 19, -1, 20, -1, 21, -1, 22, - -1, 23, -1, 24, -1, 25, -1, 26, -1, 27, - -1, 28, -1, 29, -1, 30, -1, 31, -1, 32, - -1, 46, -1, 47, -1, 48, -1, 49, -1, 50, - -1, 51, -1, 52, -1, 72, -1, 77, -1, 78, - -1, 79, -1, 80, -1, 81, -1, 82, -1, 83, - -1, 84, -1, 85, -1, 86, -1, 87, -1, 88, - -1, 89, -1, 91, -1, 93, -1, 95, -1, 96, - -1, 108, -1, 109, -1, 112, -1, 113, -1, 114, - -1, 115, -1, 174, -1, 173, 91, 174, -1, 175, - -1, 174, 147, -1, 174, 12, 13, -1, 174, 12, - 144, 13, -1, 174, 18, 3, -1, 174, 50, -1, - 174, 51, -1, 3, -1, 6, -1, 7, -1, 4, - -1, 5, -1, 147, -1, 152, -1, 153, -1, 154, - -1, 110, 144, 111, -1, 12, 144, 13, -1, 12, - 13, -1 + 3, 12, 144, 13, -1, 3, 12, 144, 13, 147, + -1, 53, 144, 13, -1, 54, 144, 13, -1, 55, + 144, 13, -1, 90, -1, 93, -1, 77, -1, 78, + -1, 79, -1, 80, -1, 84, -1, 85, -1, 86, + -1, 95, -1, 96, -1, 81, -1, 82, -1, 83, + -1, 109, -1, 108, -1, 113, -1, 112, -1, 115, + -1, 114, -1, 158, -1, 158, 45, 144, 10, 157, + -1, 159, -1, 158, 31, 159, -1, 160, -1, 159, + 30, 160, -1, 161, -1, 160, 47, 161, -1, 162, + -1, 161, 49, 162, -1, 163, -1, 162, 48, 163, + -1, 164, -1, 163, 24, 164, -1, 163, 25, 164, + -1, 165, -1, 164, 26, 165, -1, 164, 28, 165, + -1, 164, 27, 165, -1, 164, 29, 165, -1, 166, + -1, 165, 88, 166, -1, 165, 87, 166, -1, 167, + -1, 166, 19, 167, -1, 166, 20, 167, -1, 168, + -1, 167, 21, 168, -1, 167, 22, 168, -1, 167, + 23, 168, -1, 169, -1, 168, 89, 169, -1, 170, + -1, 169, 52, 134, -1, 173, -1, 50, 170, -1, + 51, 170, -1, 171, 170, -1, 75, 170, -1, 74, + 170, -1, 73, 134, -1, 73, 134, 147, -1, 73, + 134, 12, 144, 13, -1, 73, 134, 12, 144, 13, + 147, -1, 19, -1, 20, -1, 89, -1, 46, -1, + 21, -1, 107, 89, -1, 90, -1, 19, -1, 20, + -1, 21, -1, 22, -1, 23, -1, 24, -1, 25, + -1, 26, -1, 27, -1, 28, -1, 29, -1, 30, + -1, 31, -1, 32, -1, 46, -1, 47, -1, 48, + -1, 49, -1, 50, -1, 51, -1, 52, -1, 72, + -1, 77, -1, 78, -1, 79, -1, 80, -1, 81, + -1, 82, -1, 83, -1, 84, -1, 85, -1, 86, + -1, 87, -1, 88, -1, 89, -1, 91, -1, 93, + -1, 95, -1, 96, -1, 108, -1, 109, -1, 112, + -1, 113, -1, 114, -1, 115, -1, 174, -1, 173, + 91, 174, -1, 175, -1, 174, 147, -1, 174, 12, + 13, -1, 174, 12, 144, 13, -1, 174, 18, 3, + -1, 174, 50, -1, 174, 51, -1, 3, -1, 6, + -1, 7, -1, 4, -1, 5, -1, 147, -1, 152, + -1, 153, -1, 154, -1, 110, 144, 111, -1, 12, + 144, 13, -1, 12, 13, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ @@ -837,21 +839,21 @@ static const yytype_uint16 yyrline[] = 366, 368, 370, 372, 374, 376, 381, 382, 386, 387, 391, 392, 396, 397, 402, 403, 408, 409, 410, 412, 417, 418, 422, 423, 424, 425, 426, 427, 428, 432, - 433, 437, 438, 439, 443, 448, 453, 458, 459, 460, + 433, 437, 438, 439, 440, 441, 445, 450, 455, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, - 471, 475, 476, 477, 478, 479, 480, 484, 485, 490, - 491, 496, 497, 502, 503, 508, 509, 514, 515, 520, - 521, 523, 528, 529, 531, 533, 535, 540, 541, 543, - 548, 549, 551, 556, 557, 559, 561, 566, 567, 572, - 573, 578, 579, 581, 583, 585, 587, 589, 591, 598, - 599, 600, 601, 602, 603, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, - 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, - 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, - 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, - 654, 658, 659, 664, 665, 667, 669, 671, 673, 675, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692 + 471, 472, 473, 477, 478, 479, 480, 481, 482, 486, + 487, 492, 493, 498, 499, 504, 505, 510, 511, 516, + 517, 522, 523, 525, 530, 531, 533, 535, 537, 542, + 543, 545, 550, 551, 553, 558, 559, 561, 563, 568, + 569, 574, 575, 580, 581, 583, 585, 587, 589, 591, + 593, 595, 597, 604, 605, 606, 607, 608, 609, 615, + 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, + 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, + 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, + 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, + 656, 657, 658, 659, 660, 664, 665, 670, 671, 673, + 675, 677, 679, 681, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698 }; #endif @@ -932,21 +934,21 @@ static const yytype_uint8 yyr1[] = 141, 141, 141, 141, 141, 141, 142, 142, 143, 143, 144, 144, 145, 145, 146, 146, 147, 147, 147, 147, 148, 148, 149, 149, 149, 149, 149, 149, 149, 150, - 150, 151, 151, 151, 152, 153, 154, 155, 155, 155, + 150, 151, 151, 151, 151, 151, 152, 153, 154, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, - 155, 156, 156, 156, 156, 156, 156, 157, 157, 158, - 158, 159, 159, 160, 160, 161, 161, 162, 162, 163, - 163, 163, 164, 164, 164, 164, 164, 165, 165, 165, - 166, 166, 166, 167, 167, 167, 167, 168, 168, 169, - 169, 170, 170, 170, 170, 170, 170, 170, 170, 171, - 171, 171, 171, 171, 171, 172, 172, 172, 172, 172, + 155, 155, 155, 156, 156, 156, 156, 156, 156, 157, + 157, 158, 158, 159, 159, 160, 160, 161, 161, 162, + 162, 163, 163, 163, 164, 164, 164, 164, 164, 165, + 165, 165, 166, 166, 166, 167, 167, 167, 167, 168, + 168, 169, 169, 170, 170, 170, 170, 170, 170, 170, + 170, 170, 170, 171, 171, 171, 171, 171, 171, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, - 172, 173, 173, 174, 174, 174, 174, 174, 174, 174, - 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, - 175, 175 + 172, 172, 172, 172, 172, 173, 173, 174, 174, 174, + 174, 174, 174, 174, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -962,21 +964,21 @@ static const yytype_uint8 yyr2[] = 6, 7, 7, 5, 7, 5, 2, 3, 1, 2, 1, 3, 1, 3, 1, 3, 3, 4, 4, 5, 2, 3, 1, 2, 3, 3, 3, 2, 3, 1, - 3, 1, 2, 2, 3, 3, 3, 1, 1, 1, + 3, 1, 2, 2, 4, 5, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, - 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, - 3, 3, 1, 3, 3, 3, 3, 1, 3, 3, - 1, 3, 3, 1, 3, 3, 3, 1, 3, 1, - 3, 1, 2, 2, 2, 2, 2, 2, 3, 1, - 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 5, 1, 3, 1, 3, 1, 3, 1, 3, 1, + 3, 1, 3, 3, 1, 3, 3, 3, 3, 1, + 3, 3, 1, 3, 3, 1, 3, 3, 3, 1, + 3, 1, 3, 1, 2, 2, 2, 2, 2, 2, + 3, 5, 6, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 3, 1, 2, 3, 4, 3, 2, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, - 3, 2 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 3, 1, 2, 3, + 4, 3, 2, 2, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 3, 3, 2 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -984,115 +986,117 @@ static const yytype_uint8 yyr2[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 37, 230, 233, 234, 231, 232, 78, 0, 0, 0, - 169, 170, 173, 0, 0, 0, 0, 0, 0, 0, - 0, 38, 0, 172, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 171, 39, 40, 41, + 37, 234, 237, 238, 235, 236, 78, 0, 0, 0, + 173, 174, 177, 0, 0, 0, 0, 0, 0, 0, + 0, 38, 0, 176, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 175, 39, 40, 41, 0, 0, 0, 37, 2, 6, 5, 0, 44, 49, 50, 0, 4, 55, 60, 59, 58, 61, 57, 0, - 80, 82, 235, 84, 236, 237, 238, 92, 127, 129, - 131, 133, 135, 137, 139, 142, 147, 150, 153, 157, - 159, 0, 161, 221, 223, 46, 241, 0, 0, 76, + 80, 82, 239, 84, 240, 241, 242, 92, 129, 131, + 133, 135, 137, 139, 141, 144, 149, 152, 155, 159, + 161, 0, 163, 225, 227, 46, 245, 0, 0, 76, 0, 25, 0, 0, 0, 0, 0, 0, 64, 65, - 62, 0, 230, 162, 163, 0, 0, 0, 0, 45, - 0, 0, 167, 166, 165, 101, 97, 99, 0, 0, - 174, 0, 1, 3, 0, 0, 42, 43, 0, 93, - 56, 0, 79, 109, 110, 111, 112, 118, 119, 120, - 113, 114, 115, 107, 108, 116, 117, 0, 122, 121, - 124, 123, 126, 125, 0, 0, 0, 0, 0, 0, + 62, 0, 234, 164, 165, 0, 0, 0, 0, 45, + 0, 0, 169, 168, 167, 101, 97, 99, 0, 0, + 178, 0, 1, 3, 0, 0, 42, 43, 0, 93, + 56, 0, 79, 111, 112, 113, 114, 120, 121, 122, + 115, 116, 117, 109, 110, 118, 119, 0, 124, 123, + 126, 125, 128, 127, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 166, 0, 0, 0, + 232, 233, 228, 244, 0, 86, 77, 0, 47, 0, + 0, 0, 0, 0, 0, 0, 63, 106, 107, 108, + 0, 94, 95, 0, 170, 0, 0, 102, 103, 0, + 98, 96, 243, 23, 0, 0, 51, 0, 81, 83, + 85, 132, 0, 134, 136, 138, 140, 142, 143, 145, + 147, 146, 148, 151, 150, 153, 154, 156, 157, 158, + 160, 162, 226, 229, 0, 231, 87, 88, 26, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 164, 0, 0, 0, - 228, 229, 224, 240, 0, 86, 77, 0, 47, 0, - 0, 0, 0, 0, 0, 0, 63, 104, 105, 106, - 0, 94, 95, 168, 0, 102, 103, 0, 98, 96, - 239, 23, 0, 0, 51, 0, 81, 83, 85, 130, - 0, 132, 134, 136, 138, 140, 141, 143, 145, 144, - 146, 149, 148, 151, 152, 154, 155, 156, 158, 160, - 222, 225, 0, 227, 87, 88, 26, 48, 0, 0, - 0, 0, 0, 0, 0, 0, 90, 0, 100, 0, - 37, 0, 0, 0, 37, 0, 0, 0, 52, 0, - 0, 0, 226, 89, 66, 68, 0, 0, 0, 0, - 0, 75, 73, 91, 24, 21, 0, 15, 37, 20, - 19, 13, 11, 37, 0, 22, 37, 0, 0, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 175, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 0, 128, 0, 70, 0, - 0, 0, 0, 7, 18, 0, 0, 0, 9, 0, - 0, 0, 0, 183, 0, 0, 0, 67, 71, 72, - 69, 74, 14, 12, 8, 10, 30, 28, 53, 0, - 0, 0, 0, 0, 29, 27, 0, 0, 0, 0, - 54, 0, 32, 0, 31, 0, 0, 34, 33 + 90, 0, 100, 0, 37, 0, 0, 0, 37, 0, + 0, 0, 52, 0, 0, 0, 230, 89, 66, 68, + 0, 0, 0, 0, 0, 75, 73, 171, 104, 91, + 24, 21, 0, 15, 37, 20, 19, 13, 11, 37, + 0, 22, 37, 0, 0, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 179, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 0, 130, 0, 70, 0, 0, 0, 0, 172, + 105, 7, 18, 0, 0, 0, 9, 0, 0, 0, + 0, 187, 0, 0, 0, 67, 71, 72, 69, 74, + 14, 12, 8, 10, 30, 28, 53, 0, 0, 0, + 0, 0, 29, 27, 0, 0, 0, 0, 54, 0, + 32, 0, 31, 0, 0, 34, 33 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 43, 44, 285, 263, 286, 287, 288, 266, 212, - 92, 289, 47, 48, 128, 49, 50, 51, 215, 362, - 290, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 206, 63, 116, 117, 64, 65, 66, 147, 154, + -1, 43, 44, 291, 267, 292, 293, 294, 270, 214, + 92, 295, 47, 48, 128, 49, 50, 51, 217, 370, + 296, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 208, 63, 116, 117, 64, 65, 66, 147, 154, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 345, 82, 83, 84 + 77, 78, 79, 80, 81, 351, 82, 83, 84 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -284 +#define YYPACT_NINF -279 static const yytype_int16 yypact[] = { - 542, 14, -284, -284, -284, -284, -284, 838, 1311, 621, - -284, -284, -284, 48, 53, 65, 75, 773, 85, 92, - 99, -284, 912, -284, 1376, 1376, 1311, 1311, 1311, 114, - 34, 34, 34, 1376, 1376, 144, -284, -29, -284, 129, - 26, 52, 1311, 276, -284, -284, -284, 137, 103, -284, - -284, 144, 773, -284, -284, -284, -284, -284, -284, 173, - 176, 97, -284, -284, -284, -284, -284, -284, 31, 120, - 106, 116, 125, 220, 204, 186, 265, 12, 113, 161, - -284, 1376, 90, 74, -284, -284, -284, 66, 17, -284, - 697, 223, 235, 1311, 1311, 986, -8, 1311, -284, -284, - -284, 229, -284, -284, -284, 107, 109, 110, 1311, 194, - 144, 144, 256, -284, -284, 261, -284, 268, 144, 144, - -284, 2, -284, -284, 283, 283, -284, -284, 34, -284, - -284, 1311, -284, -284, -284, -284, -284, -284, -284, -284, - -284, -284, -284, -284, -284, -284, -284, 1311, -284, -284, - -284, -284, -284, -284, 1311, 1376, 1311, 1376, 1376, 1376, - 1376, 1376, 1376, 1376, 1376, 1376, 1376, 1376, 1376, 1376, - 1376, 1376, 1376, 1376, 1376, 34, -284, 41, 1051, 286, - -284, -284, -284, -284, 1116, 256, -284, 48, 227, 135, - 153, 986, 32, 279, 289, 154, -284, -284, -284, -284, - 163, -284, -284, -284, 1181, -284, 293, 144, -284, -284, - -284, 299, 15, 0, 304, 5, 176, 97, -284, 120, - 284, 106, 116, 125, 220, 204, 204, 186, 186, 186, - 186, 265, 265, 12, 12, 113, 113, 113, 161, -284, - 74, -284, 170, -284, 256, -284, -284, -284, 773, 773, - 1246, 1311, 1311, 1311, 773, 773, -284, 306, -284, 283, - 384, 48, 283, 307, 384, 283, 312, 317, 293, 321, - 1447, 1376, -284, -284, 308, -284, 773, 205, 206, 215, - 216, -284, -284, -284, -284, -284, 322, -284, 463, -284, - 773, 234, 245, 384, 328, -284, 384, 58, 108, -284, - -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, - -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, - -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, - -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, - -284, -284, -284, -284, -284, 334, -284, 773, -284, 773, - 773, 336, 337, -284, -284, 283, 48, 338, -284, 339, - 56, 144, 341, 48, 344, 346, 34, -284, -284, -284, - -284, -284, -284, -284, -284, -284, -284, -284, 351, 101, - 1545, 349, 350, 34, -284, -284, 1642, 348, 34, 348, - -284, 353, -284, 354, -284, 348, 348, -284, -284 + 652, 15, -279, -279, -279, -279, -279, 948, 1421, 731, + -279, -279, -279, 13, 30, 54, 57, 883, 76, 20, + 69, -279, 1022, -279, 53, 53, 1421, 1421, 1421, 90, + 25, 25, 25, 53, 53, 61, -279, 81, -279, 101, + 19, 27, 1421, 415, -279, -279, -279, 162, 36, -279, + -279, 61, 883, -279, -279, -279, -279, -279, -279, 43, + 111, 68, -279, -279, -279, -279, -279, -279, 17, 93, + 85, 97, 106, 237, 205, 176, 248, 164, 60, 116, + -279, 53, 71, 107, -279, -279, -279, 125, 40, -279, + 807, 141, 180, 1421, 1421, 1096, 11, 1421, -279, -279, + -279, 52, -279, -279, -279, 139, 142, 152, 1421, 156, + 61, 61, 121, -279, -279, 244, -279, 226, 61, 61, + -279, 3, -279, -279, 245, 245, -279, -279, 25, -279, + -279, 1421, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, 1421, -279, -279, + -279, -279, -279, -279, 1421, 53, 1421, 53, 53, 53, + 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, + 53, 53, 53, 53, 53, 25, -279, 29, 1161, 254, + -279, -279, -279, -279, 1226, 251, -279, 13, 206, 161, + 196, 1096, 236, 268, 269, 201, -279, -279, -279, -279, + 202, -279, -279, 1421, -279, 1421, 1291, -279, 270, 61, + -279, -279, -279, 274, 1, -2, 271, 6, 111, 68, + -279, 93, 260, 85, 97, 106, 237, 205, 205, 176, + 176, 176, 176, 248, 248, 164, 164, 60, 60, 60, + 116, -279, 107, -279, 207, -279, 251, -279, -279, -279, + 883, 883, 1356, 1421, 1421, 1421, 883, 883, 208, 209, + -279, 272, -279, 245, 494, 13, 245, 273, 494, 245, + 275, 277, 270, 276, 1492, 53, -279, -279, 255, -279, + 883, 210, 215, 216, 217, -279, -279, 251, 251, -279, + -279, -279, 278, -279, 573, -279, 883, 186, 194, 494, + 279, -279, 494, 117, 299, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + -279, 282, -279, 883, -279, 883, 883, 286, 287, -279, + -279, -279, -279, 245, 13, 283, -279, 284, 113, 61, + 290, 13, 291, 292, 25, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, 297, 120, 1590, 295, + 296, 25, -279, -279, 1687, 294, 25, 294, -279, 298, + -279, 300, -279, 294, 294, -279, -279 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -284, -284, 319, 20, -284, -239, 80, -284, -284, -116, - -181, 27, -284, -284, -284, -284, -284, -30, -284, -283, - 21, -12, -284, -284, -284, -218, -83, -4, -118, 222, - -76, 156, 217, -37, 11, -284, -284, -284, -284, -284, - 102, -284, 219, 218, 224, 225, 221, 138, 140, 143, - 155, 79, 202, 25, -284, -279, -284, 208, -284 + -279, -279, 256, 46, -279, -187, 14, -279, -279, -119, + -180, 50, -279, -279, -279, -279, -279, -30, -279, -278, + 44, -14, -279, -279, -279, -231, -82, -3, -116, 165, + -75, 98, 163, -40, -54, -279, -279, -279, -279, -279, + 41, -279, 177, 178, 175, 179, 174, 110, 75, 108, + 109, 82, 166, -4, -279, -277, -279, 159, -279 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -1102,48 +1106,59 @@ static const yytype_int16 yypgoto[] = #define YYTABLE_NINF -46 static const yytype_int16 yytable[] = { - 110, 111, 112, 87, 88, 96, 246, 182, 269, 213, - 119, 131, 191, 216, 129, 364, 264, -45, 101, 365, - 45, 52, 105, 106, 107, 294, 184, 46, 193, 109, - 90, 260, 185, 171, 172, 173, 203, 109, 121, 205, - 130, 131, 251, 132, 102, 2, 3, 4, 5, 103, - 104, 91, 13, 7, 357, 8, 194, 359, 113, 114, - 13, 109, 155, 45, 52, 93, 216, 376, -35, -35, - 46, 360, 9, 201, 202, 131, 156, 94, 130, 183, - 291, 208, 209, 382, 13, 85, 178, 95, 8, 189, - 190, 192, 179, 195, 26, 27, 28, 97, 214, 265, - 390, 387, 118, 98, 200, 393, 176, 391, 250, 245, - 99, 109, 384, 210, 261, 262, 131, 9, 131, 131, - 197, 270, 198, 199, 180, 181, 108, 299, 300, 301, - 302, 303, 304, 305, 363, 307, 308, 309, 310, 311, - 312, 120, 377, 284, 131, 239, 292, 115, 248, 295, - 157, 42, 220, 158, 313, 314, 315, 316, 317, 318, - 319, 385, 131, 131, 182, 159, 249, 254, 273, 392, - 258, 394, 131, 160, 242, 373, 255, 397, 398, 131, - 320, 177, 131, 272, 132, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, - 88, 336, 174, 337, 338, 148, 149, 126, 127, 150, - 151, 152, 153, 175, 131, 131, 339, 340, 349, 350, - 341, 342, 343, 344, 131, 131, -36, -36, 351, 352, - 163, 164, 165, 166, 124, 125, 274, 275, 131, 372, - 196, 187, 281, 282, 161, 162, 277, 278, 279, 280, - 235, 236, 237, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 188, 348, 85, 143, 361, 361, 144, - 8, 145, 146, 167, 168, 204, 122, 207, 130, 1, - 2, 3, 4, 5, 169, 170, 211, 6, 7, 243, - 8, 252, 9, 131, 271, 10, 11, 12, 247, 225, - 226, 253, 13, 227, 228, 229, 230, 257, 259, 14, - 231, 232, 15, 16, 17, 18, 19, 20, 267, 21, - 22, 283, 23, 293, 233, 234, 24, 25, 296, 26, - 27, 28, 256, 297, 355, 367, 361, 368, 369, 353, - 29, 30, 31, 347, 356, 358, 366, 370, 371, 32, - 33, 34, 35, 361, 379, 374, 375, 380, 361, 381, - 383, 388, 123, 389, 9, 36, 395, 396, 354, 217, - 268, 218, 378, 346, 219, 221, 238, 37, 38, 39, - 40, 224, 222, 41, 223, 240, 42, 1, 2, 3, - 4, 5, 0, 0, 0, 6, 7, 0, 8, 0, - 9, -16, 0, 10, 11, 12, 0, 0, 0, 0, - 13, 0, 0, 0, 0, 0, 0, 14, 0, 0, + 110, 111, 112, 96, 87, 88, 215, 248, 182, 273, + 119, 129, 131, 191, 268, 218, 91, 264, -45, 101, + 103, 104, 109, 105, 106, 107, 372, 373, 109, 113, + 114, 98, 102, 2, 3, 4, 5, 204, 130, 121, + 207, 7, 93, 8, 52, 13, 45, 193, 155, 184, + 46, 13, 131, 90, 132, 185, 102, 2, 3, 4, + 5, 131, 156, 196, 115, 7, 94, 8, 218, 95, + 201, 202, 10, 11, 12, 194, 130, 176, 210, 211, + 99, 300, 26, 27, 28, 297, 85, 52, 97, 45, + 189, 190, 192, 46, 195, 118, 390, 269, 216, 23, + 265, 266, 108, 24, 25, 200, 26, 27, 28, 252, + 247, 395, 365, 398, 212, 367, 120, 399, 401, 178, + 109, 8, 274, 157, 384, 179, 32, 33, 34, 9, + 368, 392, 158, 203, 131, 8, 9, 385, 183, 42, + 126, 127, 36, 13, 290, 241, 159, 298, 131, 174, + 301, 131, 197, 222, 160, 198, 393, 180, 181, 187, + 41, 131, 177, 42, 400, 199, 402, 182, 175, 262, + 131, 277, 405, 406, 250, 244, 148, 149, -35, -35, + 150, 151, 152, 153, 381, 171, 172, 173, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, -36, -36, + 258, 143, 259, 88, 144, 131, 145, 146, 188, 251, + 131, 131, 359, 360, 256, 257, 131, 131, 131, 131, + 276, 287, 288, 355, 131, 131, 131, 85, 356, 357, + 358, 163, 164, 165, 166, 209, 278, 279, 229, 230, + 231, 232, 285, 286, 380, 131, 253, 132, 213, 281, + 282, 283, 284, 237, 238, 239, 205, 245, 206, 124, + 125, 161, 162, 167, 168, 8, 354, 169, 170, 131, + 275, 227, 228, 369, 369, 233, 234, 249, 235, 236, + 254, 255, 130, 263, 261, 271, 363, 289, 303, 299, + 353, 302, 260, 364, 374, 361, 366, 378, 379, 123, + 382, 383, 109, 387, 388, 389, 391, 396, 362, 397, + 9, 403, 219, 404, 272, 386, 352, 220, 305, 306, + 307, 308, 309, 310, 311, 371, 313, 314, 315, 316, + 317, 318, 221, 224, 226, 223, 242, 0, 225, 375, + 240, 376, 377, 0, 369, 319, 320, 321, 322, 323, + 324, 325, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 369, 0, 0, 0, 0, 369, 0, 0, 0, + 0, 326, 0, 0, 0, 0, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 0, 342, 0, 343, 344, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 345, 346, 0, + 0, 347, 348, 349, 350, 122, 0, 0, 1, 2, + 3, 4, 5, 0, 0, 0, 6, 7, 0, 8, + 0, 9, 0, 0, 10, 11, 12, 0, 0, 0, + 0, 13, 0, 0, 0, 0, 0, 0, 14, 0, + 0, 15, 16, 17, 18, 19, 20, 0, 21, 22, + 0, 23, 0, 0, 0, 24, 25, 0, 26, 27, + 28, 0, 0, 0, 0, 0, 0, 0, 0, 29, + 30, 31, 0, 0, 0, 0, 0, 0, 32, 33, + 34, 35, 0, 0, 0, 0, 0, 1, 2, 3, + 4, 5, 0, 0, 36, 6, 7, 0, 8, 0, + 9, -16, 0, 10, 11, 12, 37, 38, 39, 40, + 13, 0, 41, 0, 0, 42, 0, 14, 0, 0, 15, 16, 17, 18, 19, 20, 0, 21, 22, 0, 23, 0, 0, 0, 24, 25, 0, 26, 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, 29, 30, @@ -1208,26 +1223,26 @@ static const yytype_int16 yytable[] = 0, 0, 23, 0, 0, 0, 24, 25, 0, 26, 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 31, 0, 1, 2, 3, 4, 5, 32, - 33, 34, 35, 7, 241, 8, 0, 0, 0, 0, + 33, 34, 35, 7, 243, 8, 0, 0, 0, 0, 10, 11, 12, 0, 0, 36, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, 41, 0, 0, 42, 23, 0, 0, 0, 24, 25, 0, 26, 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 31, 0, 1, 2, 3, 4, 5, 32, 33, 34, 35, 7, 0, - 8, 244, 0, 0, 0, 10, 11, 12, 0, 0, + 8, 246, 0, 0, 0, 10, 11, 12, 0, 0, 36, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, 41, 0, 0, 42, 23, 0, 0, 0, 24, 25, 0, 26, 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 31, 0, 1, 2, 3, 4, 5, 32, - 33, 34, 35, 7, 0, 8, 256, 0, 0, 0, + 33, 34, 35, 7, 0, 8, 260, 0, 0, 0, 10, 11, 12, 0, 0, 36, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, 41, 0, 0, 42, 23, 0, 0, 0, 24, 25, 0, 26, 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 31, 0, 1, - 2, 3, 4, 5, 32, 33, 34, 35, 7, 276, + 2, 3, 4, 5, 32, 33, 34, 35, 7, 280, 8, 0, 0, 0, 0, 10, 11, 12, 0, 0, 36, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, 41, 0, @@ -1239,91 +1254,96 @@ static const yytype_int16 yytable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, 41, 0, 0, 42, 23, 0, 0, 0, 24, 25, 0, 26, 27, 28, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 30, 31, 0, 102, - 2, 3, 4, 5, 32, 33, 34, 35, 7, 0, - 8, 0, 0, 0, 0, 10, 11, 12, 0, 0, - 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 40, 0, 0, 41, 0, - 0, 42, 23, 0, 0, 0, 24, 25, 0, 26, - 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, - 33, 34, 0, 0, 0, 0, 0, 0, 0, 298, - 0, 0, 0, 0, 0, 36, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 0, 0, 0, 41, 0, 0, 42, 0, 0, 0, - 0, 0, 0, 313, 314, 315, 316, 317, 318, 319, + 0, 0, 0, 0, 0, 0, 30, 31, 0, 0, + 0, 0, 0, 0, 32, 33, 34, 35, 0, 0, + 0, 0, 0, 0, 304, 0, 0, 0, 0, 0, + 36, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 40, 0, 0, 41, 0, + 0, 42, 0, 0, 0, 0, 0, 0, 319, 320, + 321, 322, 323, 324, 325, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 320, - 0, 0, 0, 0, 321, 322, 323, 324, 325, 326, - 327, 328, 329, 330, 331, 332, 333, 334, 335, 0, - 336, 0, 337, 338, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 339, 340, 386, 0, 341, - 342, 343, 344, 0, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 0, 0, + 0, 0, 0, 0, 326, 0, 0, 0, 0, 327, + 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 0, 342, 0, 343, 344, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 313, 314, 315, 316, 317, 318, 319, 0, 0, + 345, 346, 394, 0, 347, 348, 349, 350, 0, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 319, 320, 321, 322, + 323, 324, 325, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 320, 0, 0, - 0, 0, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 0, 336, 0, - 337, 338, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 339, 340, 0, 0, 341, 342, 343, - 344, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 313, 314, - 315, 316, 317, 318, 319, 0, 0, 0, 0, 0, + 0, 0, 326, 0, 0, 0, 0, 327, 328, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, + 340, 341, 0, 342, 0, 343, 344, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 345, 346, + 0, 0, 347, 348, 349, 350, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 320, 0, 0, 0, 0, 321, - 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, - 332, 333, 334, 335, 0, 336, 0, 337, 338, 0, + 0, 0, 0, 319, 320, 321, 322, 323, 324, 325, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 339, 340, 0, 0, 341, 342, 343, 344 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 326, + 0, 0, 0, 0, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 0, + 342, 0, 343, 344, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 345, 346, 0, 0, 347, + 348, 349, 350 }; static const yytype_int16 yycheck[] = { - 30, 31, 32, 7, 8, 17, 187, 83, 3, 125, - 40, 9, 95, 131, 51, 298, 16, 3, 22, 298, - 0, 0, 26, 27, 28, 264, 9, 0, 36, 3, - 9, 16, 15, 21, 22, 23, 112, 3, 42, 115, - 52, 9, 10, 11, 3, 4, 5, 6, 7, 24, - 25, 3, 26, 12, 293, 14, 64, 296, 33, 34, - 26, 3, 31, 43, 43, 12, 184, 11, 97, 98, - 43, 13, 16, 110, 111, 9, 45, 12, 90, 13, - 261, 118, 119, 366, 26, 71, 12, 12, 14, 93, - 94, 95, 18, 97, 53, 54, 55, 12, 128, 99, - 383, 380, 76, 11, 108, 388, 81, 386, 191, 185, - 11, 3, 11, 111, 99, 100, 9, 16, 9, 9, - 13, 116, 13, 13, 50, 51, 12, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 89, 360, 259, 9, 175, 262, 3, 13, 265, - 30, 110, 156, 47, 46, 47, 48, 49, 50, 51, - 52, 379, 9, 9, 240, 49, 13, 13, 244, 387, - 207, 389, 9, 48, 178, 356, 13, 395, 396, 9, - 72, 91, 9, 13, 11, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 204, 93, 89, 95, 96, 108, 109, 104, 105, 112, - 113, 114, 115, 52, 9, 9, 108, 109, 13, 13, - 112, 113, 114, 115, 9, 9, 97, 98, 13, 13, - 26, 27, 28, 29, 97, 98, 248, 249, 9, 355, - 11, 18, 254, 255, 24, 25, 250, 251, 252, 253, - 171, 172, 173, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 28, 276, 71, 90, 297, 298, 93, - 14, 95, 96, 87, 88, 14, 0, 9, 290, 3, - 4, 5, 6, 7, 19, 20, 3, 11, 12, 3, - 14, 12, 16, 9, 10, 19, 20, 21, 71, 161, - 162, 12, 26, 163, 164, 165, 166, 14, 9, 33, - 167, 168, 36, 37, 38, 39, 40, 41, 14, 43, - 44, 15, 46, 16, 169, 170, 50, 51, 16, 53, - 54, 55, 15, 12, 100, 347, 366, 349, 350, 17, - 64, 65, 66, 35, 99, 17, 12, 11, 11, 73, - 74, 75, 76, 383, 13, 17, 17, 13, 388, 13, - 9, 12, 43, 13, 16, 89, 13, 13, 288, 147, - 214, 154, 361, 271, 155, 157, 174, 101, 102, 103, - 104, 160, 158, 107, 159, 177, 110, 3, 4, 5, - 6, 7, -1, -1, -1, 11, 12, -1, 14, -1, - 16, 17, -1, 19, 20, 21, -1, -1, -1, -1, - 26, -1, -1, -1, -1, -1, -1, 33, -1, -1, + 30, 31, 32, 17, 7, 8, 125, 187, 83, 3, + 40, 51, 9, 95, 16, 131, 3, 16, 3, 22, + 24, 25, 3, 26, 27, 28, 304, 304, 3, 33, + 34, 11, 3, 4, 5, 6, 7, 112, 52, 42, + 115, 12, 12, 14, 0, 26, 0, 36, 31, 9, + 0, 26, 9, 9, 11, 15, 3, 4, 5, 6, + 7, 9, 45, 11, 3, 12, 12, 14, 184, 12, + 110, 111, 19, 20, 21, 64, 90, 81, 118, 119, + 11, 268, 53, 54, 55, 265, 71, 43, 12, 43, + 93, 94, 95, 43, 97, 76, 374, 99, 128, 46, + 99, 100, 12, 50, 51, 108, 53, 54, 55, 191, + 185, 388, 299, 391, 111, 302, 89, 394, 396, 12, + 3, 14, 116, 30, 11, 18, 73, 74, 75, 16, + 13, 11, 47, 12, 9, 14, 16, 368, 13, 110, + 104, 105, 89, 26, 263, 175, 49, 266, 9, 89, + 269, 9, 13, 156, 48, 13, 387, 50, 51, 18, + 107, 9, 91, 110, 395, 13, 397, 242, 52, 209, + 9, 246, 403, 404, 13, 178, 108, 109, 97, 98, + 112, 113, 114, 115, 364, 21, 22, 23, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 97, 98, + 203, 90, 205, 206, 93, 9, 95, 96, 28, 13, + 9, 9, 287, 288, 13, 13, 9, 9, 9, 9, + 13, 13, 13, 13, 9, 9, 9, 71, 13, 13, + 13, 26, 27, 28, 29, 9, 250, 251, 163, 164, + 165, 166, 256, 257, 363, 9, 10, 11, 3, 252, + 253, 254, 255, 171, 172, 173, 12, 3, 14, 97, + 98, 24, 25, 87, 88, 14, 280, 19, 20, 9, + 10, 161, 162, 303, 304, 167, 168, 71, 169, 170, + 12, 12, 296, 9, 14, 14, 100, 15, 12, 16, + 35, 16, 15, 99, 12, 17, 17, 11, 11, 43, + 17, 17, 3, 13, 13, 13, 9, 12, 294, 13, + 16, 13, 147, 13, 216, 369, 275, 154, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 155, 158, 160, 157, 177, -1, 159, 353, + 174, 355, 356, -1, 374, 46, 47, 48, 49, 50, + 51, 52, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 391, -1, -1, -1, -1, 396, -1, -1, -1, + -1, 72, -1, -1, -1, -1, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, -1, 93, -1, 95, 96, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 108, 109, -1, + -1, 112, 113, 114, 115, 0, -1, -1, 3, 4, + 5, 6, 7, -1, -1, -1, 11, 12, -1, 14, + -1, 16, -1, -1, 19, 20, 21, -1, -1, -1, + -1, 26, -1, -1, -1, -1, -1, -1, 33, -1, + -1, 36, 37, 38, 39, 40, 41, -1, 43, 44, + -1, 46, -1, -1, -1, 50, 51, -1, 53, 54, + 55, -1, -1, -1, -1, -1, -1, -1, -1, 64, + 65, 66, -1, -1, -1, -1, -1, -1, 73, 74, + 75, 76, -1, -1, -1, -1, -1, 3, 4, 5, + 6, 7, -1, -1, 89, 11, 12, -1, 14, -1, + 16, 17, -1, 19, 20, 21, 101, 102, 103, 104, + 26, -1, 107, -1, -1, 110, -1, 33, -1, -1, 36, 37, 38, 39, 40, 41, -1, 43, 44, -1, 46, -1, -1, -1, 50, 51, -1, 53, 54, 55, -1, -1, -1, -1, -1, -1, -1, -1, 64, 65, @@ -1419,45 +1439,39 @@ static const yytype_int16 yycheck[] = -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 104, -1, -1, 107, -1, -1, 110, 46, -1, -1, -1, 50, 51, -1, 53, 54, 55, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 65, 66, -1, 3, - 4, 5, 6, 7, 73, 74, 75, 76, 12, -1, - 14, -1, -1, -1, -1, 19, 20, 21, -1, -1, - 89, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 104, -1, -1, 107, -1, - -1, 110, 46, -1, -1, -1, 50, 51, -1, 53, - 54, 55, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 73, - 74, 75, -1, -1, -1, -1, -1, -1, -1, 12, - -1, -1, -1, -1, -1, 89, 19, 20, 21, 22, + -1, -1, -1, -1, -1, -1, 65, 66, -1, -1, + -1, -1, -1, -1, 73, 74, 75, 76, -1, -1, + -1, -1, -1, -1, 12, -1, -1, -1, -1, -1, + 89, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 104, -1, -1, 107, -1, + -1, 110, -1, -1, -1, -1, -1, -1, 46, 47, + 48, 49, 50, 51, 52, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 72, -1, -1, -1, -1, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, -1, 93, -1, 95, 96, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 108, 109, 12, -1, 112, 113, 114, 115, -1, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 46, 47, 48, 49, + 50, 51, 52, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 72, -1, -1, -1, -1, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, -1, 93, -1, 95, 96, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 108, 109, + -1, -1, 112, 113, 114, 115, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - -1, -1, -1, 107, -1, -1, 110, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 46, 47, 48, 49, 50, 51, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 72, -1, -1, -1, -1, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, -1, 95, 96, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 108, 109, 12, -1, 112, - 113, 114, 115, -1, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 46, 47, 48, 49, 50, 51, 52, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 72, -1, -1, - -1, -1, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, -1, 93, -1, - 95, 96, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 108, 109, -1, -1, 112, 113, 114, - 115, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 46, 47, - 48, 49, 50, 51, 52, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 72, -1, -1, -1, -1, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, -1, 93, -1, 95, 96, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 108, 109, -1, -1, 112, 113, 114, 115 + -1, -1, -1, -1, -1, 108, 109, -1, -1, 112, + 113, 114, 115 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -1484,26 +1498,27 @@ static const yytype_uint8 yystos[] = 20, 21, 22, 23, 89, 52, 170, 91, 12, 18, 50, 51, 147, 13, 9, 15, 17, 18, 28, 144, 144, 143, 144, 36, 64, 144, 11, 13, 13, 13, - 144, 150, 150, 147, 14, 147, 148, 9, 150, 150, - 111, 3, 126, 126, 134, 135, 145, 146, 149, 159, - 144, 160, 161, 162, 163, 164, 164, 165, 165, 165, - 165, 166, 166, 167, 167, 168, 168, 168, 169, 134, - 174, 13, 144, 3, 15, 147, 127, 71, 13, 13, - 143, 10, 12, 12, 13, 13, 15, 14, 150, 9, - 16, 99, 100, 121, 16, 99, 125, 14, 148, 3, - 116, 10, 13, 147, 138, 138, 13, 144, 144, 144, - 144, 138, 138, 15, 126, 120, 122, 123, 124, 128, - 137, 127, 126, 16, 122, 126, 16, 12, 12, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 46, 47, 48, 49, 50, 51, 52, - 72, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 93, 95, 96, 108, - 109, 112, 113, 114, 115, 172, 157, 35, 138, 13, - 13, 13, 13, 17, 123, 100, 99, 122, 17, 122, - 13, 134, 136, 26, 136, 172, 12, 138, 138, 138, - 11, 11, 126, 127, 17, 17, 11, 142, 151, 13, - 13, 13, 136, 9, 11, 142, 12, 172, 12, 13, - 136, 172, 142, 136, 142, 13, 13, 142, 142 + 144, 150, 150, 12, 147, 12, 14, 147, 148, 9, + 150, 150, 111, 3, 126, 126, 134, 135, 145, 146, + 149, 159, 144, 160, 161, 162, 163, 164, 164, 165, + 165, 165, 165, 166, 166, 167, 167, 168, 168, 168, + 169, 134, 174, 13, 144, 3, 15, 147, 127, 71, + 13, 13, 143, 10, 12, 12, 13, 13, 144, 144, + 15, 14, 150, 9, 16, 99, 100, 121, 16, 99, + 125, 14, 148, 3, 116, 10, 13, 147, 138, 138, + 13, 144, 144, 144, 144, 138, 138, 13, 13, 15, + 126, 120, 122, 123, 124, 128, 137, 127, 126, 16, + 122, 126, 16, 12, 12, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 46, + 47, 48, 49, 50, 51, 52, 72, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 93, 95, 96, 108, 109, 112, 113, 114, + 115, 172, 157, 35, 138, 13, 13, 13, 13, 147, + 147, 17, 123, 100, 99, 122, 17, 122, 13, 134, + 136, 26, 136, 172, 12, 138, 138, 138, 11, 11, + 126, 127, 17, 17, 11, 142, 151, 13, 13, 13, + 136, 9, 11, 142, 12, 172, 12, 13, 136, 172, + 142, 136, 142, 13, 13, 142, 142 }; #define yyerrok (yyerrstatus = 0) @@ -2836,707 +2851,727 @@ yyparse () case 101: #line 437 "chuck.y" - { (yyval.var_decl) = new_var_decl( (yyvsp[(1) - (1)].sval), NULL, (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} + { (yyval.var_decl) = new_var_decl( (yyvsp[(1) - (1)].sval), NULL, NULL, (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; case 102: #line 438 "chuck.y" - { (yyval.var_decl) = new_var_decl( (yyvsp[(1) - (2)].sval), (yyvsp[(2) - (2)].array_sub), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} + { (yyval.var_decl) = new_var_decl( (yyvsp[(1) - (2)].sval), NULL, (yyvsp[(2) - (2)].array_sub), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 103: #line 439 "chuck.y" - { (yyval.var_decl) = new_var_decl( (yyvsp[(1) - (2)].sval), (yyvsp[(2) - (2)].array_sub), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} + { (yyval.var_decl) = new_var_decl( (yyvsp[(1) - (2)].sval), NULL, (yyvsp[(2) - (2)].array_sub), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 104: -#line 444 "chuck.y" - { (yyval.complex_exp) = new_complex( (yyvsp[(2) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} +#line 440 "chuck.y" + { (yyval.var_decl) = new_var_decl( (yyvsp[(1) - (4)].sval), (yyvsp[(3) - (4)].exp), NULL, (yylsp[(1) - (4)]).first_line, (yylsp[(1) - (4)]).first_column ); ;} break; case 105: -#line 449 "chuck.y" - { (yyval.polar_exp) = new_polar( (yyvsp[(2) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} +#line 441 "chuck.y" + { (yyval.var_decl) = new_var_decl( (yyvsp[(1) - (5)].sval), (yyvsp[(3) - (5)].exp), (yyvsp[(5) - (5)].array_sub), (yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column ); ;} break; case 106: -#line 454 "chuck.y" - { (yyval.vec_exp) = new_vec( (yyvsp[(2) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} +#line 446 "chuck.y" + { (yyval.complex_exp) = new_complex( (yyvsp[(2) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} break; case 107: -#line 458 "chuck.y" - { (yyval.ival) = ae_op_chuck; ;} +#line 451 "chuck.y" + { (yyval.polar_exp) = new_polar( (yyvsp[(2) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} break; case 108: -#line 459 "chuck.y" - { (yyval.ival) = ae_op_at_chuck; ;} +#line 456 "chuck.y" + { (yyval.vec_exp) = new_vec( (yyvsp[(2) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} break; case 109: #line 460 "chuck.y" - { (yyval.ival) = ae_op_plus_chuck; ;} + { (yyval.ival) = ae_op_chuck; ;} break; case 110: #line 461 "chuck.y" - { (yyval.ival) = ae_op_minus_chuck; ;} + { (yyval.ival) = ae_op_at_chuck; ;} break; case 111: #line 462 "chuck.y" - { (yyval.ival) = ae_op_times_chuck; ;} + { (yyval.ival) = ae_op_plus_chuck; ;} break; case 112: #line 463 "chuck.y" - { (yyval.ival) = ae_op_divide_chuck; ;} + { (yyval.ival) = ae_op_minus_chuck; ;} break; case 113: #line 464 "chuck.y" - { (yyval.ival) = ae_op_shift_right_chuck; ;} + { (yyval.ival) = ae_op_times_chuck; ;} break; case 114: #line 465 "chuck.y" - { (yyval.ival) = ae_op_shift_left_chuck; ;} + { (yyval.ival) = ae_op_divide_chuck; ;} break; case 115: #line 466 "chuck.y" - { (yyval.ival) = ae_op_percent_chuck; ;} + { (yyval.ival) = ae_op_shift_right_chuck; ;} break; case 116: #line 467 "chuck.y" - { (yyval.ival) = ae_op_unchuck; ;} + { (yyval.ival) = ae_op_shift_left_chuck; ;} break; case 117: #line 468 "chuck.y" - { (yyval.ival) = ae_op_upchuck; ;} + { (yyval.ival) = ae_op_percent_chuck; ;} break; case 118: #line 469 "chuck.y" - { (yyval.ival) = ae_op_s_and_chuck; ;} + { (yyval.ival) = ae_op_unchuck; ;} break; case 119: #line 470 "chuck.y" - { (yyval.ival) = ae_op_s_or_chuck; ;} + { (yyval.ival) = ae_op_upchuck; ;} break; case 120: #line 471 "chuck.y" - { (yyval.ival) = ae_op_s_xor_chuck; ;} + { (yyval.ival) = ae_op_s_and_chuck; ;} break; case 121: -#line 475 "chuck.y" - { (yyval.ival) = ae_op_arrow_left; ;} +#line 472 "chuck.y" + { (yyval.ival) = ae_op_s_or_chuck; ;} break; case 122: -#line 476 "chuck.y" - { (yyval.ival) = ae_op_arrow_right; ;} +#line 473 "chuck.y" + { (yyval.ival) = ae_op_s_xor_chuck; ;} break; case 123: #line 477 "chuck.y" - { (yyval.ival) = ae_op_gruck_left; ;} + { (yyval.ival) = ae_op_arrow_left; ;} break; case 124: #line 478 "chuck.y" - { (yyval.ival) = ae_op_gruck_right; ;} + { (yyval.ival) = ae_op_arrow_right; ;} break; case 125: #line 479 "chuck.y" - { (yyval.ival) = ae_op_ungruck_left; ;} + { (yyval.ival) = ae_op_gruck_left; ;} break; case 126: #line 480 "chuck.y" - { (yyval.ival) = ae_op_ungruck_right; ;} + { (yyval.ival) = ae_op_gruck_right; ;} break; case 127: -#line 484 "chuck.y" - { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} +#line 481 "chuck.y" + { (yyval.ival) = ae_op_ungruck_left; ;} break; case 128: -#line 486 "chuck.y" - { (yyval.exp) = new_exp_from_if( (yyvsp[(1) - (5)].exp), (yyvsp[(3) - (5)].exp), (yyvsp[(5) - (5)].exp), (yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column ); ;} +#line 482 "chuck.y" + { (yyval.ival) = ae_op_ungruck_right; ;} break; case 129: -#line 490 "chuck.y" +#line 486 "chuck.y" { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 130: -#line 492 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_or, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 488 "chuck.y" + { (yyval.exp) = new_exp_from_if( (yyvsp[(1) - (5)].exp), (yyvsp[(3) - (5)].exp), (yyvsp[(5) - (5)].exp), (yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column ); ;} break; case 131: -#line 496 "chuck.y" +#line 492 "chuck.y" { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 132: -#line 498 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_and, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 494 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_or, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 133: -#line 502 "chuck.y" +#line 498 "chuck.y" { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 134: -#line 504 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_s_or, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 500 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_and, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 135: -#line 508 "chuck.y" +#line 504 "chuck.y" { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 136: -#line 510 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_s_xor, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 506 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_s_or, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 137: -#line 514 "chuck.y" +#line 510 "chuck.y" { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 138: -#line 516 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_s_and, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 512 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_s_xor, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 139: -#line 520 "chuck.y" +#line 516 "chuck.y" { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 140: -#line 522 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_eq, (yyvsp[(3) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} +#line 518 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_s_and, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 141: -#line 524 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_neq, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 522 "chuck.y" + { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 142: -#line 528 "chuck.y" - { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} +#line 524 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_eq, (yyvsp[(3) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} break; case 143: -#line 530 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_lt, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 526 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_neq, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 144: -#line 532 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_gt, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 530 "chuck.y" + { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 145: -#line 534 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_le, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 532 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_lt, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 146: -#line 536 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_ge, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 534 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_gt, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 147: -#line 540 "chuck.y" - { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} +#line 536 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_le, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 148: -#line 542 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_shift_left, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 538 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_ge, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 149: -#line 544 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_shift_right, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 542 "chuck.y" + { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 150: -#line 548 "chuck.y" - { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} +#line 544 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_shift_left, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 151: -#line 550 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_plus, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 546 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_shift_right, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 152: -#line 552 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_minus, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 550 "chuck.y" + { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 153: -#line 556 "chuck.y" - { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} +#line 552 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_plus, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 154: -#line 558 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_times, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 554 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_minus, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 155: -#line 560 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_divide, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 558 "chuck.y" + { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 156: -#line 562 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_percent, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 560 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_times, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 157: -#line 566 "chuck.y" - { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} +#line 562 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_divide, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 158: -#line 568 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_tilda, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 564 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_percent, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 159: -#line 572 "chuck.y" +#line 568 "chuck.y" { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 160: -#line 574 "chuck.y" - { (yyval.exp) = new_exp_from_cast( (yyvsp[(3) - (3)].type_decl), (yyvsp[(1) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column, (yylsp[(2) - (3)]).first_column ); ;} +#line 570 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_tilda, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 161: -#line 578 "chuck.y" +#line 574 "chuck.y" { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 162: -#line 580 "chuck.y" - { (yyval.exp) = new_exp_from_unary( ae_op_plusplus, (yyvsp[(2) - (2)].exp), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} +#line 576 "chuck.y" + { (yyval.exp) = new_exp_from_cast( (yyvsp[(3) - (3)].type_decl), (yyvsp[(1) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column, (yylsp[(2) - (3)]).first_column ); ;} break; case 163: -#line 582 "chuck.y" - { (yyval.exp) = new_exp_from_unary( ae_op_minusminus, (yyvsp[(2) - (2)].exp), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} +#line 580 "chuck.y" + { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 164: -#line 584 "chuck.y" - { (yyval.exp) = new_exp_from_unary( (yyvsp[(1) - (2)].ival), (yyvsp[(2) - (2)].exp), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} +#line 582 "chuck.y" + { (yyval.exp) = new_exp_from_unary( ae_op_plusplus, (yyvsp[(2) - (2)].exp), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 165: -#line 586 "chuck.y" - { (yyval.exp) = new_exp_from_unary( ae_op_typeof, (yyvsp[(2) - (2)].exp), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} +#line 584 "chuck.y" + { (yyval.exp) = new_exp_from_unary( ae_op_minusminus, (yyvsp[(2) - (2)].exp), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 166: -#line 588 "chuck.y" - { (yyval.exp) = new_exp_from_unary( ae_op_sizeof, (yyvsp[(2) - (2)].exp), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} +#line 586 "chuck.y" + { (yyval.exp) = new_exp_from_unary( (yyvsp[(1) - (2)].ival), (yyvsp[(2) - (2)].exp), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 167: -#line 590 "chuck.y" - { (yyval.exp) = new_exp_from_unary2( ae_op_new, (yyvsp[(2) - (2)].type_decl), NULL, (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} +#line 588 "chuck.y" + { (yyval.exp) = new_exp_from_unary( ae_op_typeof, (yyvsp[(2) - (2)].exp), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 168: -#line 592 "chuck.y" - { (yyval.exp) = new_exp_from_unary2( ae_op_new, (yyvsp[(2) - (3)].type_decl), (yyvsp[(3) - (3)].array_sub), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} +#line 590 "chuck.y" + { (yyval.exp) = new_exp_from_unary( ae_op_sizeof, (yyvsp[(2) - (2)].exp), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 169: -#line 598 "chuck.y" - { (yyval.ival) = ae_op_plus; ;} +#line 592 "chuck.y" + { (yyval.exp) = new_exp_from_unary2( ae_op_new, (yyvsp[(2) - (2)].type_decl), NULL, NULL, (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 170: -#line 599 "chuck.y" - { (yyval.ival) = ae_op_minus; ;} +#line 594 "chuck.y" + { (yyval.exp) = new_exp_from_unary2( ae_op_new, (yyvsp[(2) - (3)].type_decl), NULL, (yyvsp[(3) - (3)].array_sub), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} break; case 171: -#line 600 "chuck.y" - { (yyval.ival) = ae_op_tilda; ;} +#line 596 "chuck.y" + { (yyval.exp) = new_exp_from_unary2( ae_op_new, (yyvsp[(2) - (5)].type_decl), (yyvsp[(4) - (5)].exp), NULL, (yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column ); ;} break; case 172: -#line 601 "chuck.y" - { (yyval.ival) = ae_op_exclamation; ;} +#line 598 "chuck.y" + { (yyval.exp) = new_exp_from_unary2( ae_op_new, (yyvsp[(2) - (6)].type_decl), (yyvsp[(4) - (6)].exp), (yyvsp[(6) - (6)].array_sub), (yylsp[(1) - (6)]).first_line, (yylsp[(1) - (6)]).first_column ); ;} break; case 173: -#line 602 "chuck.y" - { (yyval.ival) = ae_op_times; ;} +#line 604 "chuck.y" + { (yyval.ival) = ae_op_plus; ;} break; case 174: -#line 603 "chuck.y" - { (yyval.ival) = ae_op_spork; ;} +#line 605 "chuck.y" + { (yyval.ival) = ae_op_minus; ;} break; case 175: -#line 609 "chuck.y" - { (yyval.ival) = ae_op_chuck; ;} +#line 606 "chuck.y" + { (yyval.ival) = ae_op_tilda; ;} break; case 176: -#line 610 "chuck.y" - { (yyval.ival) = ae_op_plus; ;} +#line 607 "chuck.y" + { (yyval.ival) = ae_op_exclamation; ;} break; case 177: -#line 611 "chuck.y" - { (yyval.ival) = ae_op_minus; ;} +#line 608 "chuck.y" + { (yyval.ival) = ae_op_times; ;} break; case 178: -#line 612 "chuck.y" - { (yyval.ival) = ae_op_times; ;} +#line 609 "chuck.y" + { (yyval.ival) = ae_op_spork; ;} break; case 179: -#line 613 "chuck.y" - { (yyval.ival) = ae_op_divide; ;} +#line 615 "chuck.y" + { (yyval.ival) = ae_op_chuck; ;} break; case 180: -#line 614 "chuck.y" - { (yyval.ival) = ae_op_percent; ;} +#line 616 "chuck.y" + { (yyval.ival) = ae_op_plus; ;} break; case 181: -#line 615 "chuck.y" - { (yyval.ival) = ae_op_eq; ;} +#line 617 "chuck.y" + { (yyval.ival) = ae_op_minus; ;} break; case 182: -#line 616 "chuck.y" - { (yyval.ival) = ae_op_neq; ;} +#line 618 "chuck.y" + { (yyval.ival) = ae_op_times; ;} break; case 183: -#line 617 "chuck.y" - { (yyval.ival) = ae_op_lt; ;} +#line 619 "chuck.y" + { (yyval.ival) = ae_op_divide; ;} break; case 184: -#line 618 "chuck.y" - { (yyval.ival) = ae_op_le; ;} +#line 620 "chuck.y" + { (yyval.ival) = ae_op_percent; ;} break; case 185: -#line 619 "chuck.y" - { (yyval.ival) = ae_op_gt; ;} +#line 621 "chuck.y" + { (yyval.ival) = ae_op_eq; ;} break; case 186: -#line 620 "chuck.y" - { (yyval.ival) = ae_op_ge; ;} +#line 622 "chuck.y" + { (yyval.ival) = ae_op_neq; ;} break; case 187: -#line 621 "chuck.y" - { (yyval.ival) = ae_op_and; ;} +#line 623 "chuck.y" + { (yyval.ival) = ae_op_lt; ;} break; case 188: -#line 622 "chuck.y" - { (yyval.ival) = ae_op_or; ;} +#line 624 "chuck.y" + { (yyval.ival) = ae_op_le; ;} break; case 189: -#line 623 "chuck.y" - { (yyval.ival) = ae_op_assign; ;} +#line 625 "chuck.y" + { (yyval.ival) = ae_op_gt; ;} break; case 190: -#line 624 "chuck.y" - { (yyval.ival) = ae_op_exclamation; ;} +#line 626 "chuck.y" + { (yyval.ival) = ae_op_ge; ;} break; case 191: -#line 625 "chuck.y" - { (yyval.ival) = ae_op_s_or; ;} +#line 627 "chuck.y" + { (yyval.ival) = ae_op_and; ;} break; case 192: -#line 626 "chuck.y" - { (yyval.ival) = ae_op_s_and; ;} +#line 628 "chuck.y" + { (yyval.ival) = ae_op_or; ;} break; case 193: -#line 627 "chuck.y" - { (yyval.ival) = ae_op_s_xor; ;} +#line 629 "chuck.y" + { (yyval.ival) = ae_op_assign; ;} break; case 194: -#line 628 "chuck.y" - { (yyval.ival) = ae_op_plusplus; ;} +#line 630 "chuck.y" + { (yyval.ival) = ae_op_exclamation; ;} break; case 195: -#line 629 "chuck.y" - { (yyval.ival) = ae_op_minusminus; ;} +#line 631 "chuck.y" + { (yyval.ival) = ae_op_s_or; ;} break; case 196: -#line 630 "chuck.y" - { (yyval.ival) = ae_op_dollar; ;} +#line 632 "chuck.y" + { (yyval.ival) = ae_op_s_and; ;} break; case 197: -#line 631 "chuck.y" - { (yyval.ival) = ae_op_at_at; ;} +#line 633 "chuck.y" + { (yyval.ival) = ae_op_s_xor; ;} break; case 198: -#line 632 "chuck.y" - { (yyval.ival) = ae_op_plus_chuck; ;} +#line 634 "chuck.y" + { (yyval.ival) = ae_op_plusplus; ;} break; case 199: -#line 633 "chuck.y" - { (yyval.ival) = ae_op_minus_chuck; ;} +#line 635 "chuck.y" + { (yyval.ival) = ae_op_minusminus; ;} break; case 200: -#line 634 "chuck.y" - { (yyval.ival) = ae_op_times_chuck; ;} +#line 636 "chuck.y" + { (yyval.ival) = ae_op_dollar; ;} break; case 201: -#line 635 "chuck.y" - { (yyval.ival) = ae_op_divide_chuck; ;} +#line 637 "chuck.y" + { (yyval.ival) = ae_op_at_at; ;} break; case 202: -#line 636 "chuck.y" - { (yyval.ival) = ae_op_s_and_chuck; ;} +#line 638 "chuck.y" + { (yyval.ival) = ae_op_plus_chuck; ;} break; case 203: -#line 637 "chuck.y" - { (yyval.ival) = ae_op_s_or_chuck; ;} +#line 639 "chuck.y" + { (yyval.ival) = ae_op_minus_chuck; ;} break; case 204: -#line 638 "chuck.y" - { (yyval.ival) = ae_op_s_xor_chuck; ;} +#line 640 "chuck.y" + { (yyval.ival) = ae_op_times_chuck; ;} break; case 205: -#line 639 "chuck.y" - { (yyval.ival) = ae_op_shift_right_chuck; ;} +#line 641 "chuck.y" + { (yyval.ival) = ae_op_divide_chuck; ;} break; case 206: -#line 640 "chuck.y" - { (yyval.ival) = ae_op_shift_left_chuck; ;} +#line 642 "chuck.y" + { (yyval.ival) = ae_op_s_and_chuck; ;} break; case 207: -#line 641 "chuck.y" - { (yyval.ival) = ae_op_percent_chuck; ;} +#line 643 "chuck.y" + { (yyval.ival) = ae_op_s_or_chuck; ;} break; case 208: -#line 642 "chuck.y" - { (yyval.ival) = ae_op_shift_right; ;} +#line 644 "chuck.y" + { (yyval.ival) = ae_op_s_xor_chuck; ;} break; case 209: -#line 643 "chuck.y" - { (yyval.ival) = ae_op_shift_left; ;} +#line 645 "chuck.y" + { (yyval.ival) = ae_op_shift_right_chuck; ;} break; case 210: -#line 644 "chuck.y" - { (yyval.ival) = ae_op_tilda; ;} +#line 646 "chuck.y" + { (yyval.ival) = ae_op_shift_left_chuck; ;} break; case 211: -#line 645 "chuck.y" - { (yyval.ival) = ae_op_coloncolon; ;} +#line 647 "chuck.y" + { (yyval.ival) = ae_op_percent_chuck; ;} break; case 212: -#line 646 "chuck.y" - { (yyval.ival) = ae_op_at_chuck; ;} +#line 648 "chuck.y" + { (yyval.ival) = ae_op_shift_right; ;} break; case 213: -#line 647 "chuck.y" - { (yyval.ival) = ae_op_unchuck; ;} +#line 649 "chuck.y" + { (yyval.ival) = ae_op_shift_left; ;} break; case 214: -#line 648 "chuck.y" - { (yyval.ival) = ae_op_upchuck; ;} +#line 650 "chuck.y" + { (yyval.ival) = ae_op_tilda; ;} break; case 215: -#line 649 "chuck.y" - { (yyval.ival) = ae_op_arrow_right; ;} +#line 651 "chuck.y" + { (yyval.ival) = ae_op_coloncolon; ;} break; case 216: -#line 650 "chuck.y" - { (yyval.ival) = ae_op_arrow_left; ;} +#line 652 "chuck.y" + { (yyval.ival) = ae_op_at_chuck; ;} break; case 217: -#line 651 "chuck.y" - { (yyval.ival) = ae_op_gruck_right; ;} +#line 653 "chuck.y" + { (yyval.ival) = ae_op_unchuck; ;} break; case 218: -#line 652 "chuck.y" - { (yyval.ival) = ae_op_gruck_left; ;} +#line 654 "chuck.y" + { (yyval.ival) = ae_op_upchuck; ;} break; case 219: -#line 653 "chuck.y" - { (yyval.ival) = ae_op_ungruck_right; ;} +#line 655 "chuck.y" + { (yyval.ival) = ae_op_arrow_right; ;} break; case 220: -#line 654 "chuck.y" - { (yyval.ival) = ae_op_ungruck_left; ;} +#line 656 "chuck.y" + { (yyval.ival) = ae_op_arrow_left; ;} + break; + + case 221: +#line 657 "chuck.y" + { (yyval.ival) = ae_op_gruck_right; ;} break; case 222: -#line 660 "chuck.y" - { (yyval.exp) = new_exp_from_dur( (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} +#line 658 "chuck.y" + { (yyval.ival) = ae_op_gruck_left; ;} break; case 223: -#line 664 "chuck.y" - { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} +#line 659 "chuck.y" + { (yyval.ival) = ae_op_ungruck_right; ;} break; case 224: +#line 660 "chuck.y" + { (yyval.ival) = ae_op_ungruck_left; ;} + break; + + case 226: #line 666 "chuck.y" + { (yyval.exp) = new_exp_from_dur( (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} + break; + + case 227: +#line 670 "chuck.y" + { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} + break; + + case 228: +#line 672 "chuck.y" { (yyval.exp) = new_exp_from_array( (yyvsp[(1) - (2)].exp), (yyvsp[(2) - (2)].array_sub), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; - case 225: -#line 668 "chuck.y" + case 229: +#line 674 "chuck.y" { (yyval.exp) = new_exp_from_func_call( (yyvsp[(1) - (3)].exp), NULL, (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} break; - case 226: -#line 670 "chuck.y" + case 230: +#line 676 "chuck.y" { (yyval.exp) = new_exp_from_func_call( (yyvsp[(1) - (4)].exp), (yyvsp[(3) - (4)].exp), (yylsp[(1) - (4)]).first_line, (yylsp[(1) - (4)]).first_column ); ;} break; - case 227: -#line 672 "chuck.y" + case 231: +#line 678 "chuck.y" { (yyval.exp) = new_exp_from_member_dot( (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].sval), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column, (yylsp[(3) - (3)]).first_column ); ;} break; - case 228: -#line 674 "chuck.y" + case 232: +#line 680 "chuck.y" { (yyval.exp) = new_exp_from_postfix( (yyvsp[(1) - (2)].exp), ae_op_plusplus, (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; - case 229: -#line 676 "chuck.y" + case 233: +#line 682 "chuck.y" { (yyval.exp) = new_exp_from_postfix( (yyvsp[(1) - (2)].exp), ae_op_minusminus, (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; - case 230: -#line 681 "chuck.y" + case 234: +#line 687 "chuck.y" { (yyval.exp) = new_exp_from_id( (yyvsp[(1) - (1)].sval), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; - case 231: -#line 682 "chuck.y" + case 235: +#line 688 "chuck.y" { (yyval.exp) = new_exp_from_int( (yyvsp[(1) - (1)].ival), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; - case 232: -#line 683 "chuck.y" + case 236: +#line 689 "chuck.y" { (yyval.exp) = new_exp_from_float( (yyvsp[(1) - (1)].fval), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; - case 233: -#line 684 "chuck.y" + case 237: +#line 690 "chuck.y" { (yyval.exp) = new_exp_from_str( (yyvsp[(1) - (1)].sval), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; - case 234: -#line 685 "chuck.y" + case 238: +#line 691 "chuck.y" { (yyval.exp) = new_exp_from_char( (yyvsp[(1) - (1)].sval), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; - case 235: -#line 686 "chuck.y" + case 239: +#line 692 "chuck.y" { (yyval.exp) = new_exp_from_array_lit( (yyvsp[(1) - (1)].array_sub), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; - case 236: -#line 687 "chuck.y" + case 240: +#line 693 "chuck.y" { (yyval.exp) = new_exp_from_complex( (yyvsp[(1) - (1)].complex_exp), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; - case 237: -#line 688 "chuck.y" + case 241: +#line 694 "chuck.y" { (yyval.exp) = new_exp_from_polar( (yyvsp[(1) - (1)].polar_exp), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; - case 238: -#line 689 "chuck.y" + case 242: +#line 695 "chuck.y" { (yyval.exp) = new_exp_from_vec( (yyvsp[(1) - (1)].vec_exp), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; - case 239: -#line 690 "chuck.y" + case 243: +#line 696 "chuck.y" { (yyval.exp) = new_exp_from_hack( (yyvsp[(2) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} break; - case 240: -#line 691 "chuck.y" + case 244: +#line 697 "chuck.y" { (yyval.exp) = (yyvsp[(2) - (3)].exp); ;} break; - case 241: -#line 692 "chuck.y" + case 245: +#line 698 "chuck.y" { (yyval.exp) = new_exp_from_nil( (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; /* Line 1267 of yacc.c. */ -#line 3540 "chuck.tab.c" +#line 3575 "chuck.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); From 8a2947b60593cfa48131a8a6c6252b43c83405f7 Mon Sep 17 00:00:00 2001 From: Ge Wang Date: Sat, 11 Nov 2023 12:11:29 -0800 Subject: [PATCH 02/20] add parser support for invoking empty ctors --- src/core/chuck.y | 32 +- src/core/chuck_absyn.cpp | 10 +- src/core/chuck_absyn.h | 12 +- src/core/chuck_type.cpp | 10 +- src/core/chuck_yacc.c | 1551 +++++++++++++++++++------------------- 5 files changed, 831 insertions(+), 784 deletions(-) diff --git a/src/core/chuck.y b/src/core/chuck.y index 13525de57..cbccc24d2 100644 --- a/src/core/chuck.y +++ b/src/core/chuck.y @@ -434,11 +434,13 @@ var_decl_list ; var_decl - : ID { $$ = new_var_decl( $1, NULL, NULL, @1.first_line, @1.first_column ); } - | ID array_exp { $$ = new_var_decl( $1, NULL, $2, @1.first_line, @1.first_column ); } - | ID array_empty { $$ = new_var_decl( $1, NULL, $2, @1.first_line, @1.first_column ); } - | ID LPAREN expression RPAREN { $$ = new_var_decl( $1, $3, NULL, @1.first_line, @1.first_column ); } // 1.5.1.9 (ge) added for constructors - | ID LPAREN expression RPAREN array_exp { $$ = new_var_decl( $1, $3, $5, @1.first_line, @1.first_column ); } // 1.5.1.9 (ge) added for constructors + : ID { $$ = new_var_decl( $1, FALSE, NULL, NULL, @1.first_line, @1.first_column ); } + | ID array_exp { $$ = new_var_decl( $1, FALSE, NULL, $2, @1.first_line, @1.first_column ); } + | ID array_empty { $$ = new_var_decl( $1, FALSE, NULL, $2, @1.first_line, @1.first_column ); } + | ID LPAREN RPAREN { $$ = new_var_decl( $1, TRUE, NULL, NULL, @1.first_line, @1.first_column ); } // 1.5.1.9 (ge) added for constructors + | ID LPAREN expression RPAREN { $$ = new_var_decl( $1, TRUE, $3, NULL, @1.first_line, @1.first_column ); } // 1.5.1.9 (ge) added for constructors + | ID LPAREN RPAREN array_exp { $$ = new_var_decl( $1, TRUE, NULL, $4, @1.first_line, @1.first_column ); } // 1.5.1.9 (ge) added for constructors + | ID LPAREN expression RPAREN array_exp { $$ = new_var_decl( $1, TRUE, $3, $5, @1.first_line, @1.first_column ); } // 1.5.1.9 (ge) added for constructors ; complex_exp @@ -588,14 +590,18 @@ unary_expression { $$ = new_exp_from_unary( ae_op_typeof, $2, @1.first_line, @1.first_column ); } | SIZEOF unary_expression { $$ = new_exp_from_unary( ae_op_sizeof, $2, @1.first_line, @1.first_column ); } - | NEW type_decl - { $$ = new_exp_from_unary2( ae_op_new, $2, NULL, NULL, @1.first_line, @1.first_column ); } - | NEW type_decl array_exp - { $$ = new_exp_from_unary2( ae_op_new, $2, NULL, $3, @1.first_line, @1.first_column ); } - | NEW type_decl LPAREN expression RPAREN // 1.5.1.9 (ge) added for constructors - { $$ = new_exp_from_unary2( ae_op_new, $2, $4, NULL, @1.first_line, @1.first_column ); } - | NEW type_decl LPAREN expression RPAREN array_exp // 1.5.1.9 (ge) added for constructors - { $$ = new_exp_from_unary2( ae_op_new, $2, $4, $6, @1.first_line, @1.first_column ); } + | NEW type_decl // e.g., new Foo; + { $$ = new_exp_from_unary2( ae_op_new, $2, FALSE, NULL, NULL, @1.first_line, @1.first_column ); } + | NEW type_decl array_exp // e.g., new Foo[10]; + { $$ = new_exp_from_unary2( ae_op_new, $2, FALSE, NULL, $3, @1.first_line, @1.first_column ); } + | NEW type_decl LPAREN RPAREN // 1.5.1.9 (ge) added for constructors | e.g., new Foo(); + { $$ = new_exp_from_unary2( ae_op_new, $2, TRUE, NULL, NULL, @1.first_line, @1.first_column ); } + | NEW type_decl LPAREN expression RPAREN // 1.5.1.9 (ge) added for constructors | e.g., new Foo(1,2,3); + { $$ = new_exp_from_unary2( ae_op_new, $2, TRUE, $4, NULL, @1.first_line, @1.first_column ); } + | NEW type_decl LPAREN RPAREN array_exp // 1.5.1.9 (ge) added for constructors | e.g., new Foo()[10]; + { $$ = new_exp_from_unary2( ae_op_new, $2, TRUE, NULL, $5, @1.first_line, @1.first_column ); } + | NEW type_decl LPAREN expression RPAREN array_exp // 1.5.1.9 (ge) added for constructors | e.g., new Foo(1,2,3)[10]; + { $$ = new_exp_from_unary2( ae_op_new, $2, TRUE, $4, $6, @1.first_line, @1.first_column ); } // | SPORK TILDA code_segment // { $$ = new_exp_from_unary3( ae_op_spork, $3, @1.first_line, @1.first_column ); } ; diff --git a/src/core/chuck_absyn.cpp b/src/core/chuck_absyn.cpp index 94de84ffb..f148b8ff3 100644 --- a/src/core/chuck_absyn.cpp +++ b/src/core/chuck_absyn.cpp @@ -394,7 +394,7 @@ a_Exp new_exp_from_unary( ae_Operator oper, a_Exp exp, uint32_t lineNum, uint32_ } a_Exp new_exp_from_unary2( ae_Operator oper, a_Type_Decl type, - a_Exp ctor_args, a_Array_Sub array, + int ctor_invoked, a_Exp ctor_args, a_Array_Sub array, uint32_t lineNum, uint32_t posNum ) { a_Exp a = (a_Exp)checked_malloc( sizeof( struct a_Exp_ ) ); @@ -402,6 +402,7 @@ a_Exp new_exp_from_unary2( ae_Operator oper, a_Type_Decl type, a->s_meta = ae_meta_value; a->unary.op = oper; a->unary.type = type; + a->unary.ctor_invoked = ctor_invoked; a->unary.ctor_args = ctor_args; a->unary.array = array; a->line = lineNum; a->where = posNum; @@ -523,7 +524,7 @@ a_Exp new_exp_from_id( c_str xid, uint32_t lineNum, uint32_t posNum ) return a; } -a_Exp new_exp_from_int( long num, uint32_t lineNum, uint32_t posNum ) +a_Exp new_exp_from_int( t_CKINT num, uint32_t lineNum, uint32_t posNum ) { a_Exp a = (a_Exp)checked_malloc( sizeof( struct a_Exp_ ) ); a->s_type = ae_exp_primary; @@ -537,7 +538,7 @@ a_Exp new_exp_from_int( long num, uint32_t lineNum, uint32_t posNum ) return a; } -a_Exp new_exp_from_float( double num, uint32_t lineNum, uint32_t posNum ) +a_Exp new_exp_from_float( t_CKFLOAT num, uint32_t lineNum, uint32_t posNum ) { a_Exp a = (a_Exp)checked_malloc( sizeof( struct a_Exp_ ) ); a->s_type = ae_exp_primary; @@ -714,10 +715,11 @@ a_Exp new_exp_from_nil( uint32_t lineNum, uint32_t posNum ) return a; } -a_Var_Decl new_var_decl( c_constr xid, a_Exp ctor_args, a_Array_Sub array, uint32_t lineNum, uint32_t posNum ) +a_Var_Decl new_var_decl( c_constr xid, int ctor_invoked, a_Exp ctor_args, a_Array_Sub array, uint32_t lineNum, uint32_t posNum ) { a_Var_Decl a = (a_Var_Decl)checked_malloc( sizeof( struct a_Var_Decl_ ) ); a->xid = insert_symbol(xid); + a->ctor_invoked = ctor_invoked; a->ctor_args = ctor_args; a->array = array; a->line = lineNum; a->where = posNum; diff --git a/src/core/chuck_absyn.h b/src/core/chuck_absyn.h index 445e8ce6c..675c19123 100644 --- a/src/core/chuck_absyn.h +++ b/src/core/chuck_absyn.h @@ -173,7 +173,7 @@ a_Stmt new_stmt_from_case( a_Exp exp, uint32_t line, uint32_t where ); a_Exp append_expression( a_Exp list, a_Exp exp, uint32_t line, uint32_t where ); a_Exp new_exp_from_binary( a_Exp lhs, ae_Operator oper, a_Exp rhs, uint32_t line, uint32_t where ); a_Exp new_exp_from_unary( ae_Operator oper, a_Exp exp, uint32_t line, uint32_t where ); -a_Exp new_exp_from_unary2( ae_Operator oper, a_Type_Decl type, a_Exp ctor_args, a_Array_Sub array, uint32_t line, uint32_t where ); +a_Exp new_exp_from_unary2( ae_Operator oper, a_Type_Decl type, int ctor_invoked, a_Exp ctor_args, a_Array_Sub array, uint32_t line, uint32_t where ); a_Exp new_exp_from_unary3( ae_Operator oper, a_Stmt code, uint32_t line, uint32_t where ); a_Exp new_exp_from_cast( a_Type_Decl type, a_Exp exp, uint32_t line, uint32_t where, uint32_t castPos ); a_Exp new_exp_from_array( a_Exp base, a_Array_Sub indices, uint32_t line, uint32_t where ); @@ -183,8 +183,8 @@ a_Exp new_exp_from_member_dot( a_Exp base, c_str member, uint32_t line, uint32_t a_Exp new_exp_from_postfix( a_Exp base, ae_Operator op, uint32_t line, uint32_t where ); a_Exp new_exp_from_dur( a_Exp base, a_Exp unit, uint32_t line, uint32_t where ); a_Exp new_exp_from_id( c_str xid, uint32_t line, uint32_t where ); -a_Exp new_exp_from_int( long num, uint32_t line, uint32_t where ); -a_Exp new_exp_from_float( double num, uint32_t line, uint32_t where ); +a_Exp new_exp_from_int( t_CKINT num, uint32_t line, uint32_t where ); +a_Exp new_exp_from_float( t_CKFLOAT num, uint32_t line, uint32_t where ); a_Exp new_exp_from_str( c_str str, uint32_t line, uint32_t where ); a_Exp new_exp_from_char( c_str chr, uint32_t line, uint32_t where ); a_Exp new_exp_from_if( a_Exp cond, a_Exp lhs, a_Exp rhs, uint32_t line, uint32_t where ); @@ -198,7 +198,7 @@ a_Exp new_exp_from_hack( a_Exp exp, uint32_t line, uint32_t where ); a_Exp new_exp_from_nil( uint32_t line, uint32_t where ); a_Var_Decl_List new_var_decl_list( a_Var_Decl var_decl, uint32_t line, uint32_t where ); a_Var_Decl_List prepend_var_decl_list( a_Var_Decl var_decl, a_Var_Decl_List list, uint32_t line, uint32_t where ); -a_Var_Decl new_var_decl( c_constr xid, a_Exp ctor_args, a_Array_Sub array, uint32_t line, uint32_t where ); +a_Var_Decl new_var_decl( c_constr xid, int ctor_invoked, a_Exp ctor_args, a_Array_Sub array, uint32_t line, uint32_t where ); a_Type_Decl new_type_decl( a_Id_List xid, int ref, uint32_t line, uint32_t where ); a_Type_Decl add_type_decl_array( a_Type_Decl type_decl, a_Array_Sub array, uint32_t line, uint32_t where ); a_Arg_List new_arg_list( a_Type_Decl type_decl, a_Var_Decl var_decl, uint32_t line, uint32_t where ); @@ -299,7 +299,7 @@ void delete_vec( a_Vec v ); //------------------------------------------------------------------------------ struct a_Exp_Binary_ { a_Exp lhs; ae_Operator op; a_Exp rhs; t_CKFUNC ck_func; t_CKFUNC ck_overload_func; uint32_t line; uint32_t where; a_Exp self; }; struct a_Exp_Cast_ { a_Type_Decl type; a_Exp exp; uint32_t line; uint32_t where; a_Exp self; }; -struct a_Exp_Unary_ { ae_Operator op; a_Exp exp; a_Type_Decl type; a_Exp ctor_args; a_Array_Sub array; +struct a_Exp_Unary_ { ae_Operator op; a_Exp exp; a_Type_Decl type; int ctor_invoked; a_Exp ctor_args; a_Array_Sub array; a_Stmt code; t_CKFUNC ck_overload_func; uint32_t line; uint32_t where; a_Exp self; }; struct a_Exp_Postfix_ { a_Exp exp; ae_Operator op; t_CKFUNC ck_overload_func; uint32_t line; uint32_t where; a_Exp self; }; struct a_Exp_Dur_ { a_Exp base; a_Exp unit; uint32_t line; uint32_t where; a_Exp self; }; @@ -313,7 +313,7 @@ struct a_Exp_Decl_ { a_Type_Decl type; a_Var_Decl_List var_decl_list; int num_va struct a_Exp_Hack_ { a_Exp exp; uint32_t line; uint32_t where; a_Exp self; }; struct a_Var_Decl_List_ { a_Var_Decl var_decl; a_Var_Decl_List next; uint32_t line; uint32_t where; a_Exp self; }; // 1.4.2.0 (ge) added ck_type and ref, to handle multiple array decl (e.g., int x, y[], z[1];) -struct a_Var_Decl_ { S_Symbol xid; a_Exp ctor_args; a_Array_Sub array; +struct a_Var_Decl_ { S_Symbol xid; int ctor_invoked; a_Exp ctor_args; a_Array_Sub array; t_CKVALUE value; void * addr; t_CKTYPE ck_type; /* int is_auto; */ int ref; int force_ref; uint32_t line; uint32_t where; a_Exp self; }; diff --git a/src/core/chuck_type.cpp b/src/core/chuck_type.cpp index af8e8ffd1..e9b16e8f2 100644 --- a/src/core/chuck_type.cpp +++ b/src/core/chuck_type.cpp @@ -6654,7 +6654,7 @@ t_CKUINT type_engine_import_mvar( Chuck_Env * env, const char * type, type_decl->array->depth = array_depth; } // make var decl - a_Var_Decl var_decl = new_var_decl( (char *)name, NULL, NULL, 0, 0 ); // 1.5.1.9 (ge) add ctor arglist + a_Var_Decl var_decl = new_var_decl( (char *)name, FALSE, NULL, NULL, 0, 0 ); // 1.5.1.9 (ge) add ctor arglist // added 2013-10-22 - spencer // allow array-type mvars @@ -6727,7 +6727,7 @@ t_CKBOOL type_engine_import_svar( Chuck_Env * env, const char * type, // make type decl a_Type_Decl type_decl = new_type_decl( thePath, FALSE, 0, 0 ); // make var decl - a_Var_Decl var_decl = new_var_decl( (char *)name, NULL, NULL, 0, 0 ); // 1.5.1.9 (ge) add ctor arglist + a_Var_Decl var_decl = new_var_decl( (char *)name, FALSE, NULL, NULL, 0, 0 ); // 1.5.1.9 (ge) add ctor arglist // make var decl list a_Var_Decl_List var_decl_list = new_var_decl_list( var_decl, 0, 0 ); // make exp decl @@ -7678,7 +7678,7 @@ a_Arg_List partial_deep_copy_args( a_Arg_List list ) // need name but not 'array' on var_decl // 1.5.1.9 (ge) added ctor_args=NULL, also not needed from the callee's perspective - var_decl = new_var_decl( S_name(list->var_decl->xid), NULL, NULL, list->var_decl->line, list->var_decl->where ); + var_decl = new_var_decl( S_name(list->var_decl->xid), FALSE, NULL, NULL, list->var_decl->line, list->var_decl->where ); // need var_decl by not type_decl copy = new_arg_list( NULL, var_decl, list->line, list->where ); // set type and add reference @@ -7796,7 +7796,7 @@ a_Arg_List make_dll_arg_list( Chuck_DL_Func * dl_fun ) // make var decl // 1.5.1.9 (ge) add ctor arglist (NULL); consider enable+refactor to support ctor - var_decl = new_var_decl( (char *)arg->name.c_str(), NULL, array_sub, 0, 0 ); + var_decl = new_var_decl( (char *)arg->name.c_str(), FALSE, NULL, array_sub, 0, 0 ); // make new arg arg_list = prepend_arg_list( type_decl, var_decl, arg_list, 0, 0 ); @@ -8011,7 +8011,7 @@ t_CKBOOL type_engine_add_dll( Chuck_Env * env, Chuck_DLL * dll, const string & d a_Type_Decl type_decl = new_type_decl( thePath2, FALSE, 0, 0 ); // make var decl // 1.5.1.9 (ge) add ctor arglist (NULL); consider enable+refactor to support ctor - a_Var_Decl var_decl = new_var_decl( cl->svars[j]->name.c_str(), NULL, NULL, 0, 0 ); + a_Var_Decl var_decl = new_var_decl( cl->svars[j]->name.c_str(), FALSE, NULL, NULL, 0, 0 ); // make var decl list a_Var_Decl_List var_decl_list = new_var_decl_list( var_decl, 0, 0 ); // make exp decl diff --git a/src/core/chuck_yacc.c b/src/core/chuck_yacc.c index 5a1f372fd..71aa2df38 100644 --- a/src/core/chuck_yacc.c +++ b/src/core/chuck_yacc.c @@ -649,16 +649,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 122 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1802 +#define YYLAST 1871 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 117 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 59 /* YYNRULES -- Number of rules. */ -#define YYNRULES 245 +#define YYNRULES 249 /* YYNRULES -- Number of states. */ -#define YYNSTATES 407 +#define YYNSTATES 411 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 @@ -725,21 +725,21 @@ static const yytype_uint16 yyprhs[] = 272, 279, 287, 295, 301, 309, 315, 318, 322, 324, 327, 329, 333, 335, 339, 341, 345, 349, 354, 359, 365, 368, 372, 374, 377, 381, 385, 389, 392, 396, - 398, 402, 404, 407, 410, 415, 421, 425, 429, 433, - 435, 437, 439, 441, 443, 445, 447, 449, 451, 453, - 455, 457, 459, 461, 463, 465, 467, 469, 471, 473, - 475, 481, 483, 487, 489, 493, 495, 499, 501, 505, - 507, 511, 513, 517, 521, 523, 527, 531, 535, 539, - 541, 545, 549, 551, 555, 559, 561, 565, 569, 573, - 575, 579, 581, 585, 587, 590, 593, 596, 599, 602, - 605, 609, 615, 622, 624, 626, 628, 630, 632, 635, - 637, 639, 641, 643, 645, 647, 649, 651, 653, 655, - 657, 659, 661, 663, 665, 667, 669, 671, 673, 675, - 677, 679, 681, 683, 685, 687, 689, 691, 693, 695, - 697, 699, 701, 703, 705, 707, 709, 711, 713, 715, - 717, 719, 721, 723, 725, 727, 729, 733, 735, 738, - 742, 747, 751, 754, 757, 759, 761, 763, 765, 767, - 769, 771, 773, 775, 779, 783 + 398, 402, 404, 407, 410, 414, 419, 424, 430, 434, + 438, 442, 444, 446, 448, 450, 452, 454, 456, 458, + 460, 462, 464, 466, 468, 470, 472, 474, 476, 478, + 480, 482, 484, 490, 492, 496, 498, 502, 504, 508, + 510, 514, 516, 520, 522, 526, 530, 532, 536, 540, + 544, 548, 550, 554, 558, 560, 564, 568, 570, 574, + 578, 582, 584, 588, 590, 594, 596, 599, 602, 605, + 608, 611, 614, 618, 623, 629, 635, 642, 644, 646, + 648, 650, 652, 655, 657, 659, 661, 663, 665, 667, + 669, 671, 673, 675, 677, 679, 681, 683, 685, 687, + 689, 691, 693, 695, 697, 699, 701, 703, 705, 707, + 709, 711, 713, 715, 717, 719, 721, 723, 725, 727, + 729, 731, 733, 735, 737, 739, 741, 743, 745, 747, + 749, 753, 755, 758, 762, 767, 771, 774, 777, 779, + 781, 783, 785, 787, 789, 791, 793, 795, 799, 803 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ @@ -786,27 +786,29 @@ static const yytype_int16 yyrhs[] = -1, 66, 134, 150, -1, 104, 134, 150, -1, 76, 150, -1, 104, 76, 150, -1, 151, -1, 151, 9, 150, -1, 3, -1, 3, 147, -1, 3, 148, -1, - 3, 12, 144, 13, -1, 3, 12, 144, 13, 147, - -1, 53, 144, 13, -1, 54, 144, 13, -1, 55, - 144, 13, -1, 90, -1, 93, -1, 77, -1, 78, - -1, 79, -1, 80, -1, 84, -1, 85, -1, 86, - -1, 95, -1, 96, -1, 81, -1, 82, -1, 83, - -1, 109, -1, 108, -1, 113, -1, 112, -1, 115, - -1, 114, -1, 158, -1, 158, 45, 144, 10, 157, - -1, 159, -1, 158, 31, 159, -1, 160, -1, 159, - 30, 160, -1, 161, -1, 160, 47, 161, -1, 162, - -1, 161, 49, 162, -1, 163, -1, 162, 48, 163, - -1, 164, -1, 163, 24, 164, -1, 163, 25, 164, - -1, 165, -1, 164, 26, 165, -1, 164, 28, 165, - -1, 164, 27, 165, -1, 164, 29, 165, -1, 166, - -1, 165, 88, 166, -1, 165, 87, 166, -1, 167, - -1, 166, 19, 167, -1, 166, 20, 167, -1, 168, - -1, 167, 21, 168, -1, 167, 22, 168, -1, 167, - 23, 168, -1, 169, -1, 168, 89, 169, -1, 170, - -1, 169, 52, 134, -1, 173, -1, 50, 170, -1, - 51, 170, -1, 171, 170, -1, 75, 170, -1, 74, - 170, -1, 73, 134, -1, 73, 134, 147, -1, 73, - 134, 12, 144, 13, -1, 73, 134, 12, 144, 13, + 3, 12, 13, -1, 3, 12, 144, 13, -1, 3, + 12, 13, 147, -1, 3, 12, 144, 13, 147, -1, + 53, 144, 13, -1, 54, 144, 13, -1, 55, 144, + 13, -1, 90, -1, 93, -1, 77, -1, 78, -1, + 79, -1, 80, -1, 84, -1, 85, -1, 86, -1, + 95, -1, 96, -1, 81, -1, 82, -1, 83, -1, + 109, -1, 108, -1, 113, -1, 112, -1, 115, -1, + 114, -1, 158, -1, 158, 45, 144, 10, 157, -1, + 159, -1, 158, 31, 159, -1, 160, -1, 159, 30, + 160, -1, 161, -1, 160, 47, 161, -1, 162, -1, + 161, 49, 162, -1, 163, -1, 162, 48, 163, -1, + 164, -1, 163, 24, 164, -1, 163, 25, 164, -1, + 165, -1, 164, 26, 165, -1, 164, 28, 165, -1, + 164, 27, 165, -1, 164, 29, 165, -1, 166, -1, + 165, 88, 166, -1, 165, 87, 166, -1, 167, -1, + 166, 19, 167, -1, 166, 20, 167, -1, 168, -1, + 167, 21, 168, -1, 167, 22, 168, -1, 167, 23, + 168, -1, 169, -1, 168, 89, 169, -1, 170, -1, + 169, 52, 134, -1, 173, -1, 50, 170, -1, 51, + 170, -1, 171, 170, -1, 75, 170, -1, 74, 170, + -1, 73, 134, -1, 73, 134, 147, -1, 73, 134, + 12, 13, -1, 73, 134, 12, 144, 13, -1, 73, + 134, 12, 13, 147, -1, 73, 134, 12, 144, 13, 147, -1, 19, -1, 20, -1, 89, -1, 46, -1, 21, -1, 107, 89, -1, 90, -1, 19, -1, 20, -1, 21, -1, 22, -1, 23, -1, 24, -1, 25, @@ -839,21 +841,21 @@ static const yytype_uint16 yyrline[] = 366, 368, 370, 372, 374, 376, 381, 382, 386, 387, 391, 392, 396, 397, 402, 403, 408, 409, 410, 412, 417, 418, 422, 423, 424, 425, 426, 427, 428, 432, - 433, 437, 438, 439, 440, 441, 445, 450, 455, 460, - 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, - 471, 472, 473, 477, 478, 479, 480, 481, 482, 486, - 487, 492, 493, 498, 499, 504, 505, 510, 511, 516, - 517, 522, 523, 525, 530, 531, 533, 535, 537, 542, - 543, 545, 550, 551, 553, 558, 559, 561, 563, 568, - 569, 574, 575, 580, 581, 583, 585, 587, 589, 591, - 593, 595, 597, 604, 605, 606, 607, 608, 609, 615, - 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, - 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, - 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, - 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, - 656, 657, 658, 659, 660, 664, 665, 670, 671, 673, - 675, 677, 679, 681, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698 + 433, 437, 438, 439, 440, 441, 442, 443, 447, 452, + 457, 462, 463, 464, 465, 466, 467, 468, 469, 470, + 471, 472, 473, 474, 475, 479, 480, 481, 482, 483, + 484, 488, 489, 494, 495, 500, 501, 506, 507, 512, + 513, 518, 519, 524, 525, 527, 532, 533, 535, 537, + 539, 544, 545, 547, 552, 553, 555, 560, 561, 563, + 565, 570, 571, 576, 577, 582, 583, 585, 587, 589, + 591, 593, 595, 597, 599, 601, 603, 610, 611, 612, + 613, 614, 615, 621, 622, 623, 624, 625, 626, 627, + 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, + 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, + 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, + 658, 659, 660, 661, 662, 663, 664, 665, 666, 670, + 671, 676, 677, 679, 681, 683, 685, 687, 693, 694, + 695, 696, 697, 698, 699, 700, 701, 702, 703, 704 }; #endif @@ -934,21 +936,21 @@ static const yytype_uint8 yyr1[] = 141, 141, 141, 141, 141, 141, 142, 142, 143, 143, 144, 144, 145, 145, 146, 146, 147, 147, 147, 147, 148, 148, 149, 149, 149, 149, 149, 149, 149, 150, - 150, 151, 151, 151, 151, 151, 152, 153, 154, 155, - 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, - 155, 155, 155, 156, 156, 156, 156, 156, 156, 157, - 157, 158, 158, 159, 159, 160, 160, 161, 161, 162, - 162, 163, 163, 163, 164, 164, 164, 164, 164, 165, - 165, 165, 166, 166, 166, 167, 167, 167, 167, 168, - 168, 169, 169, 170, 170, 170, 170, 170, 170, 170, - 170, 170, 170, 171, 171, 171, 171, 171, 171, 172, + 150, 151, 151, 151, 151, 151, 151, 151, 152, 153, + 154, 155, 155, 155, 155, 155, 155, 155, 155, 155, + 155, 155, 155, 155, 155, 156, 156, 156, 156, 156, + 156, 157, 157, 158, 158, 159, 159, 160, 160, 161, + 161, 162, 162, 163, 163, 163, 164, 164, 164, 164, + 164, 165, 165, 165, 166, 166, 166, 167, 167, 167, + 167, 168, 168, 169, 169, 170, 170, 170, 170, 170, + 170, 170, 170, 170, 170, 170, 170, 171, 171, 171, + 171, 171, 171, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, - 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, - 172, 172, 172, 172, 172, 173, 173, 174, 174, 174, - 174, 174, 174, 174, 175, 175, 175, 175, 175, 175, - 175, 175, 175, 175, 175, 175 + 172, 172, 172, 172, 172, 172, 172, 172, 172, 173, + 173, 174, 174, 174, 174, 174, 174, 174, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -964,21 +966,21 @@ static const yytype_uint8 yyr2[] = 6, 7, 7, 5, 7, 5, 2, 3, 1, 2, 1, 3, 1, 3, 1, 3, 3, 4, 4, 5, 2, 3, 1, 2, 3, 3, 3, 2, 3, 1, - 3, 1, 2, 2, 4, 5, 3, 3, 3, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 3, 1, 2, 2, 3, 4, 4, 5, 3, 3, + 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 5, 1, 3, 1, 3, 1, 3, 1, 3, 1, - 3, 1, 3, 3, 1, 3, 3, 3, 3, 1, - 3, 3, 1, 3, 3, 1, 3, 3, 3, 1, - 3, 1, 3, 1, 2, 2, 2, 2, 2, 2, - 3, 5, 6, 1, 1, 1, 1, 1, 2, 1, + 1, 1, 5, 1, 3, 1, 3, 1, 3, 1, + 3, 1, 3, 1, 3, 3, 1, 3, 3, 3, + 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, + 3, 1, 3, 1, 3, 1, 2, 2, 2, 2, + 2, 2, 3, 4, 5, 5, 6, 1, 1, 1, + 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 3, 1, 2, 3, - 4, 3, 2, 2, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 3, 3, 2 + 3, 1, 2, 3, 4, 3, 2, 2, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 3, 3, 2 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -986,117 +988,119 @@ static const yytype_uint8 yyr2[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 37, 234, 237, 238, 235, 236, 78, 0, 0, 0, - 173, 174, 177, 0, 0, 0, 0, 0, 0, 0, - 0, 38, 0, 176, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 175, 39, 40, 41, + 37, 238, 241, 242, 239, 240, 78, 0, 0, 0, + 177, 178, 181, 0, 0, 0, 0, 0, 0, 0, + 0, 38, 0, 180, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 179, 39, 40, 41, 0, 0, 0, 37, 2, 6, 5, 0, 44, 49, 50, 0, 4, 55, 60, 59, 58, 61, 57, 0, - 80, 82, 239, 84, 240, 241, 242, 92, 129, 131, - 133, 135, 137, 139, 141, 144, 149, 152, 155, 159, - 161, 0, 163, 225, 227, 46, 245, 0, 0, 76, + 80, 82, 243, 84, 244, 245, 246, 92, 131, 133, + 135, 137, 139, 141, 143, 146, 151, 154, 157, 161, + 163, 0, 165, 229, 231, 46, 249, 0, 0, 76, 0, 25, 0, 0, 0, 0, 0, 0, 64, 65, - 62, 0, 234, 164, 165, 0, 0, 0, 0, 45, - 0, 0, 169, 168, 167, 101, 97, 99, 0, 0, - 178, 0, 1, 3, 0, 0, 42, 43, 0, 93, - 56, 0, 79, 111, 112, 113, 114, 120, 121, 122, - 115, 116, 117, 109, 110, 118, 119, 0, 124, 123, - 126, 125, 128, 127, 0, 0, 0, 0, 0, 0, + 62, 0, 238, 166, 167, 0, 0, 0, 0, 45, + 0, 0, 171, 170, 169, 101, 97, 99, 0, 0, + 182, 0, 1, 3, 0, 0, 42, 43, 0, 93, + 56, 0, 79, 113, 114, 115, 116, 122, 123, 124, + 117, 118, 119, 111, 112, 120, 121, 0, 126, 125, + 128, 127, 130, 129, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 166, 0, 0, 0, - 232, 233, 228, 244, 0, 86, 77, 0, 47, 0, - 0, 0, 0, 0, 0, 0, 63, 106, 107, 108, - 0, 94, 95, 0, 170, 0, 0, 102, 103, 0, - 98, 96, 243, 23, 0, 0, 51, 0, 81, 83, - 85, 132, 0, 134, 136, 138, 140, 142, 143, 145, - 147, 146, 148, 151, 150, 153, 154, 156, 157, 158, - 160, 162, 226, 229, 0, 231, 87, 88, 26, 48, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 90, 0, 100, 0, 37, 0, 0, 0, 37, 0, - 0, 0, 52, 0, 0, 0, 230, 89, 66, 68, - 0, 0, 0, 0, 0, 75, 73, 171, 104, 91, - 24, 21, 0, 15, 37, 20, 19, 13, 11, 37, - 0, 22, 37, 0, 0, 180, 181, 182, 183, 184, + 0, 0, 0, 0, 0, 0, 168, 0, 0, 0, + 236, 237, 232, 248, 0, 86, 77, 0, 47, 0, + 0, 0, 0, 0, 0, 0, 63, 108, 109, 110, + 0, 94, 95, 0, 172, 0, 0, 102, 103, 0, + 98, 96, 247, 23, 0, 0, 51, 0, 81, 83, + 85, 134, 0, 136, 138, 140, 142, 144, 145, 147, + 149, 148, 150, 153, 152, 155, 156, 158, 159, 160, + 162, 164, 230, 233, 0, 235, 87, 88, 26, 48, + 0, 0, 0, 0, 0, 0, 0, 0, 173, 0, + 104, 0, 90, 0, 100, 0, 37, 0, 0, 0, + 37, 0, 0, 0, 52, 0, 0, 0, 234, 89, + 66, 68, 0, 0, 0, 0, 0, 75, 73, 175, + 174, 106, 105, 91, 24, 21, 0, 15, 37, 20, + 19, 13, 11, 37, 0, 22, 37, 0, 0, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 179, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 0, 130, 0, 70, 0, 0, 0, 0, 172, - 105, 7, 18, 0, 0, 0, 9, 0, 0, 0, - 0, 187, 0, 0, 0, 67, 71, 72, 69, 74, - 14, 12, 8, 10, 30, 28, 53, 0, 0, 0, - 0, 0, 29, 27, 0, 0, 0, 0, 54, 0, - 32, 0, 31, 0, 0, 34, 33 + 215, 216, 217, 218, 183, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 0, 132, 0, 70, 0, + 0, 0, 0, 176, 107, 7, 18, 0, 0, 0, + 9, 0, 0, 0, 0, 191, 0, 0, 0, 67, + 71, 72, 69, 74, 14, 12, 8, 10, 30, 28, + 53, 0, 0, 0, 0, 0, 29, 27, 0, 0, + 0, 0, 54, 0, 32, 0, 31, 0, 0, 34, + 33 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 43, 44, 291, 267, 292, 293, 294, 270, 214, - 92, 295, 47, 48, 128, 49, 50, 51, 217, 370, - 296, 53, 54, 55, 56, 57, 58, 59, 60, 61, + -1, 43, 44, 295, 269, 296, 297, 298, 272, 214, + 92, 299, 47, 48, 128, 49, 50, 51, 217, 374, + 300, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 208, 63, 116, 117, 64, 65, 66, 147, 154, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 351, 82, 83, 84 + 77, 78, 79, 80, 81, 355, 82, 83, 84 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -279 +#define YYPACT_NINF -283 static const yytype_int16 yypact[] = { - 652, 15, -279, -279, -279, -279, -279, 948, 1421, 731, - -279, -279, -279, 13, 30, 54, 57, 883, 76, 20, - 69, -279, 1022, -279, 53, 53, 1421, 1421, 1421, 90, - 25, 25, 25, 53, 53, 61, -279, 81, -279, 101, - 19, 27, 1421, 415, -279, -279, -279, 162, 36, -279, - -279, 61, 883, -279, -279, -279, -279, -279, -279, 43, - 111, 68, -279, -279, -279, -279, -279, -279, 17, 93, - 85, 97, 106, 237, 205, 176, 248, 164, 60, 116, - -279, 53, 71, 107, -279, -279, -279, 125, 40, -279, - 807, 141, 180, 1421, 1421, 1096, 11, 1421, -279, -279, - -279, 52, -279, -279, -279, 139, 142, 152, 1421, 156, - 61, 61, 121, -279, -279, 244, -279, 226, 61, 61, - -279, 3, -279, -279, 245, 245, -279, -279, 25, -279, - -279, 1421, -279, -279, -279, -279, -279, -279, -279, -279, - -279, -279, -279, -279, -279, -279, -279, 1421, -279, -279, - -279, -279, -279, -279, 1421, 53, 1421, 53, 53, 53, + 656, 15, -283, -283, -283, -283, -283, 207, 1490, 735, + -283, -283, -283, 25, 32, 49, 76, 887, 90, 104, + 112, -283, 961, -283, 53, 53, 1490, 1490, 1490, 129, + 28, 28, 28, 53, 53, 145, -283, -17, -283, 137, + 19, 43, 1490, 419, -283, -283, -283, 157, 159, -283, + -283, 145, 887, -283, -283, -283, -283, -283, -283, 44, + 1539, 78, -283, -283, -283, -283, -283, -283, 17, 132, + 142, 119, 136, 241, 196, 182, 255, 184, 158, 127, + -283, 53, 105, 107, -283, -283, -283, 103, 54, -283, + 811, 191, 213, 1490, 1490, 1035, 11, 1490, -283, -283, + -283, 55, -283, -283, -283, 125, 131, 138, 1490, 200, + 145, 145, 121, -283, -283, 204, -283, 247, 145, 145, + -283, 3, -283, -283, 256, 256, -283, -283, 28, -283, + -283, 1490, -283, -283, -283, -283, -283, -283, -283, -283, + -283, -283, -283, -283, -283, -283, -283, 1490, -283, -283, + -283, -283, -283, -283, 1490, 53, 1490, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, - 53, 53, 53, 53, 53, 25, -279, 29, 1161, 254, - -279, -279, -279, -279, 1226, 251, -279, 13, 206, 161, - 196, 1096, 236, 268, 269, 201, -279, -279, -279, -279, - 202, -279, -279, 1421, -279, 1421, 1291, -279, 270, 61, - -279, -279, -279, 274, 1, -2, 271, 6, 111, 68, - -279, 93, 260, 85, 97, 106, 237, 205, 205, 176, - 176, 176, 176, 248, 248, 164, 164, 60, 60, 60, - 116, -279, 107, -279, 207, -279, 251, -279, -279, -279, - 883, 883, 1356, 1421, 1421, 1421, 883, 883, 208, 209, - -279, 272, -279, 245, 494, 13, 245, 273, 494, 245, - 275, 277, 270, 276, 1492, 53, -279, -279, 255, -279, - 883, 210, 215, 216, 217, -279, -279, 251, 251, -279, - -279, -279, 278, -279, 573, -279, 883, 186, 194, 494, - 279, -279, 494, 117, 299, -279, -279, -279, -279, -279, - -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, - -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, - -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, - -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, - -279, 282, -279, 883, -279, 883, 883, 286, 287, -279, - -279, -279, -279, 245, 13, 283, -279, 284, 113, 61, - 290, 13, 291, 292, 25, -279, -279, -279, -279, -279, - -279, -279, -279, -279, -279, -279, 297, 120, 1590, 295, - 296, 25, -279, -279, 1687, 294, 25, 294, -279, 298, - -279, 300, -279, 294, 294, -279, -279 + 53, 53, 53, 53, 53, 28, -283, 29, 1100, 264, + -283, -283, -283, -283, 1165, 262, -283, 25, 208, 141, + 146, 1035, 229, 279, 282, 152, -283, -283, -283, -283, + 161, -283, -283, 1230, -283, 1295, 1360, -283, 281, 145, + -283, -283, -283, 288, 1, -2, 284, 6, 1539, 78, + -283, 132, 275, 142, 119, 136, 241, 196, 196, 182, + 182, 182, 182, 255, 255, 184, 184, 158, 158, 158, + 127, -283, 107, -283, 167, -283, 262, -283, -283, -283, + 887, 887, 1425, 1490, 1490, 1490, 887, 887, 262, 168, + 262, 169, -283, 285, -283, 256, 498, 25, 256, 283, + 498, 256, 286, 289, 281, 291, 1561, 53, -283, -283, + 266, -283, 887, 185, 186, 188, 195, -283, -283, -283, + 262, -283, 262, -283, -283, -283, 290, -283, 577, -283, + 887, 205, 209, 498, 292, -283, 498, 117, 303, -283, + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + -283, -283, -283, -283, -283, 298, -283, 887, -283, 887, + 887, 301, 302, -283, -283, -283, -283, 256, 25, 299, + -283, 304, 113, 145, 305, 25, 306, 307, 28, -283, + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + 327, 120, 1659, 325, 326, 28, -283, -283, 1756, 322, + 28, 322, -283, 328, -283, 329, -283, 322, 322, -283, + -283 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -279, -279, 256, 46, -279, -187, 14, -279, -279, -119, - -180, 50, -279, -279, -279, -279, -279, -30, -279, -278, - 44, -14, -279, -279, -279, -231, -82, -3, -116, 165, - -75, 98, 163, -40, -54, -279, -279, -279, -279, -279, - 41, -279, 177, 178, 175, 179, 174, 110, 75, 108, - 109, 82, 166, -4, -279, -277, -279, 159, -279 + -283, -283, 272, 46, -283, -254, 58, -283, -283, -119, + -180, 50, -283, -283, -283, -283, -283, -30, -283, -282, + 42, -14, -283, -283, -283, -235, -82, -3, -116, 193, + -75, 128, 203, -40, -26, -283, -283, -283, -283, -283, + 81, -283, 206, 202, 210, 201, 211, 126, 66, 122, + 123, 73, 189, -4, -283, -281, -283, 187, -283 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -1106,372 +1110,386 @@ static const yytype_int16 yypgoto[] = #define YYTABLE_NINF -46 static const yytype_int16 yytable[] = { - 110, 111, 112, 96, 87, 88, 215, 248, 182, 273, - 119, 129, 131, 191, 268, 218, 91, 264, -45, 101, - 103, 104, 109, 105, 106, 107, 372, 373, 109, 113, - 114, 98, 102, 2, 3, 4, 5, 204, 130, 121, - 207, 7, 93, 8, 52, 13, 45, 193, 155, 184, - 46, 13, 131, 90, 132, 185, 102, 2, 3, 4, - 5, 131, 156, 196, 115, 7, 94, 8, 218, 95, + 110, 111, 112, 96, 87, 88, 215, 248, 182, 275, + 119, 129, 131, 191, 270, 218, 304, 266, -45, 101, + 103, 104, 109, 105, 106, 107, 376, 377, 91, 113, + 114, 109, 102, 2, 3, 4, 5, 204, 130, 121, + 207, 7, 52, 8, 93, 13, 45, 193, 155, 369, + 46, 90, 371, 131, 13, 132, 102, 2, 3, 4, + 5, 94, 156, 184, 131, 7, 196, 8, 218, 185, 201, 202, 10, 11, 12, 194, 130, 176, 210, 211, - 99, 300, 26, 27, 28, 297, 85, 52, 97, 45, - 189, 190, 192, 46, 195, 118, 390, 269, 216, 23, - 265, 266, 108, 24, 25, 200, 26, 27, 28, 252, - 247, 395, 365, 398, 212, 367, 120, 399, 401, 178, - 109, 8, 274, 157, 384, 179, 32, 33, 34, 9, - 368, 392, 158, 203, 131, 8, 9, 385, 183, 42, - 126, 127, 36, 13, 290, 241, 159, 298, 131, 174, - 301, 131, 197, 222, 160, 198, 393, 180, 181, 187, - 41, 131, 177, 42, 400, 199, 402, 182, 175, 262, - 131, 277, 405, 406, 250, 244, 148, 149, -35, -35, - 150, 151, 152, 153, 381, 171, 172, 173, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, -36, -36, - 258, 143, 259, 88, 144, 131, 145, 146, 188, 251, - 131, 131, 359, 360, 256, 257, 131, 131, 131, 131, - 276, 287, 288, 355, 131, 131, 131, 85, 356, 357, - 358, 163, 164, 165, 166, 209, 278, 279, 229, 230, - 231, 232, 285, 286, 380, 131, 253, 132, 213, 281, - 282, 283, 284, 237, 238, 239, 205, 245, 206, 124, - 125, 161, 162, 167, 168, 8, 354, 169, 170, 131, - 275, 227, 228, 369, 369, 233, 234, 249, 235, 236, - 254, 255, 130, 263, 261, 271, 363, 289, 303, 299, - 353, 302, 260, 364, 374, 361, 366, 378, 379, 123, - 382, 383, 109, 387, 388, 389, 391, 396, 362, 397, - 9, 403, 219, 404, 272, 386, 352, 220, 305, 306, - 307, 308, 309, 310, 311, 371, 313, 314, 315, 316, - 317, 318, 221, 224, 226, 223, 242, 0, 225, 375, - 240, 376, 377, 0, 369, 319, 320, 321, 322, 323, - 324, 325, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 369, 0, 0, 0, 0, 369, 0, 0, 0, - 0, 326, 0, 0, 0, 0, 327, 328, 329, 330, + -35, -35, 26, 27, 28, 52, 85, 301, 95, 45, + 189, 190, 192, 46, 195, 118, 394, 271, 216, 23, + 267, 268, 97, 24, 25, 200, 26, 27, 28, 252, + 247, 399, 131, 402, 212, 98, 183, 403, 405, 178, + 109, 8, 276, 99, 388, 179, 32, 33, 34, 9, + 372, 396, 120, 203, 131, 8, 9, 389, 197, 42, + 131, 108, 36, 13, 198, 241, 294, 131, 115, 302, + 131, 199, 305, 222, 250, 131, 397, 180, 181, 251, + 41, 131, 157, 42, 404, 256, 406, 182, 159, 264, + 131, 279, 409, 410, 257, 244, 131, 131, 131, 175, + 278, 290, 292, 289, 160, 291, 148, 149, 385, 158, + 150, 151, 152, 153, 131, 131, 177, 131, 359, 360, + 259, 361, 261, 88, 131, 171, 172, 173, 362, 187, + 1, 2, 3, 4, 5, 363, 205, 364, 206, 7, + 86, 8, 163, 164, 165, 166, 10, 11, 12, 229, + 230, 231, 232, 13, -36, -36, 280, 281, 131, 253, + 132, 188, 287, 288, 237, 238, 239, 174, 384, 283, + 284, 285, 286, 23, 124, 125, 209, 24, 25, 213, + 26, 27, 28, 126, 127, 161, 162, 245, 358, 167, + 168, 85, 30, 31, 169, 170, 8, 373, 373, 249, + 32, 33, 34, 35, 131, 277, 130, 227, 228, 233, + 234, 254, 235, 236, 255, 263, 36, 265, 273, 303, + 293, 357, 306, 307, 262, 367, 109, 365, 368, 370, + 378, 40, 382, 383, 41, 123, 386, 42, 391, 392, + 393, 387, 309, 310, 311, 312, 313, 314, 315, 375, + 317, 318, 319, 320, 321, 322, 395, 400, 9, 401, + 219, 407, 408, 379, 274, 380, 381, 390, 373, 323, + 324, 325, 326, 327, 328, 329, 366, 220, 356, 223, + 225, 221, 0, 240, 242, 373, 0, 0, 224, 0, + 373, 226, 0, 0, 0, 330, 0, 0, 0, 0, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, - 341, 0, 342, 0, 343, 344, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 345, 346, 0, - 0, 347, 348, 349, 350, 122, 0, 0, 1, 2, - 3, 4, 5, 0, 0, 0, 6, 7, 0, 8, - 0, 9, 0, 0, 10, 11, 12, 0, 0, 0, - 0, 13, 0, 0, 0, 0, 0, 0, 14, 0, - 0, 15, 16, 17, 18, 19, 20, 0, 21, 22, + 341, 342, 343, 344, 345, 0, 346, 0, 347, 348, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 349, 350, 0, 0, 351, 352, 353, 354, 122, + 0, 0, 1, 2, 3, 4, 5, 0, 0, 0, + 6, 7, 0, 8, 0, 9, 0, 0, 10, 11, + 12, 0, 0, 0, 0, 13, 0, 0, 0, 0, + 0, 0, 14, 0, 0, 15, 16, 17, 18, 19, + 20, 0, 21, 22, 0, 23, 0, 0, 0, 24, + 25, 0, 26, 27, 28, 0, 0, 0, 0, 0, + 0, 0, 0, 29, 30, 31, 0, 0, 0, 0, + 0, 0, 32, 33, 34, 35, 0, 0, 0, 0, + 0, 1, 2, 3, 4, 5, 0, 0, 36, 6, + 7, 0, 8, 0, 9, -16, 0, 10, 11, 12, + 37, 38, 39, 40, 13, 0, 41, 0, 0, 42, + 0, 14, 0, 0, 15, 16, 17, 18, 19, 20, + 0, 21, 22, 0, 23, 0, 0, 0, 24, 25, + 0, 26, 27, 28, 0, 0, 0, 0, 0, 0, + 0, 0, 29, 30, 31, 0, 0, 0, 0, 0, + 0, 32, 33, 34, 35, 0, 0, 0, 0, 0, + 1, 2, 3, 4, 5, 0, 0, 36, 6, 7, + 0, 8, 0, 9, -17, 0, 10, 11, 12, 37, + 38, 39, 40, 13, 0, 41, 0, 0, 42, 0, + 14, 0, 0, 15, 16, 17, 18, 19, 20, 0, + 21, 22, 0, 23, 0, 0, 0, 24, 25, 0, + 26, 27, 28, 0, 0, 0, 0, 0, 0, 0, + 0, 29, 30, 31, 0, 0, 0, 0, 0, 0, + 32, 33, 34, 35, 0, 0, 0, 0, 0, 1, + 2, 3, 4, 5, 0, 0, 36, 6, 7, 0, + 8, 0, 9, 0, 0, 10, 11, 12, 37, 38, + 39, 40, 13, 0, 41, 0, 0, 42, 0, 14, + 0, 0, 15, 16, 17, 18, 19, 20, 0, 21, + 22, 0, 23, 0, 0, 0, 24, 25, 0, 26, + 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, + 29, 30, 31, 0, 0, 0, 0, 0, 0, 32, + 33, 34, 35, 0, 0, 0, 0, 0, 1, 2, + 3, 4, 5, 0, 0, 36, 6, 7, 0, 8, + 0, 9, 89, 0, 10, 11, 12, 37, 38, 39, + 40, 13, 0, 41, 0, 0, 42, 0, 14, 0, + 0, 15, 16, 17, 18, 19, 20, 0, 0, 22, 0, 23, 0, 0, 0, 24, 25, 0, 26, 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, 29, 30, 31, 0, 0, 0, 0, 0, 0, 32, 33, - 34, 35, 0, 0, 0, 0, 0, 1, 2, 3, - 4, 5, 0, 0, 36, 6, 7, 0, 8, 0, - 9, -16, 0, 10, 11, 12, 37, 38, 39, 40, - 13, 0, 41, 0, 0, 42, 0, 14, 0, 0, - 15, 16, 17, 18, 19, 20, 0, 21, 22, 0, - 23, 0, 0, 0, 24, 25, 0, 26, 27, 28, - 0, 0, 0, 0, 0, 0, 0, 0, 29, 30, - 31, 0, 0, 0, 0, 0, 0, 32, 33, 34, - 35, 0, 0, 0, 0, 0, 1, 2, 3, 4, - 5, 0, 0, 36, 6, 7, 0, 8, 0, 9, - -17, 0, 10, 11, 12, 37, 38, 39, 40, 13, - 0, 41, 0, 0, 42, 0, 14, 0, 0, 15, - 16, 17, 18, 19, 20, 0, 21, 22, 0, 23, - 0, 0, 0, 24, 25, 0, 26, 27, 28, 0, - 0, 0, 0, 0, 0, 0, 0, 29, 30, 31, - 0, 0, 0, 0, 0, 0, 32, 33, 34, 35, - 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, - 0, 0, 36, 6, 7, 0, 8, 0, 9, 0, - 0, 10, 11, 12, 37, 38, 39, 40, 13, 0, - 41, 0, 0, 42, 0, 14, 0, 0, 15, 16, - 17, 18, 19, 20, 0, 21, 22, 0, 23, 0, - 0, 0, 24, 25, 0, 26, 27, 28, 0, 0, - 0, 0, 0, 0, 0, 0, 29, 30, 31, 0, - 0, 0, 0, 0, 0, 32, 33, 34, 35, 0, - 0, 0, 0, 0, 1, 2, 3, 4, 5, 0, - 0, 36, 6, 7, 0, 8, 0, 9, 89, 0, - 10, 11, 12, 37, 38, 39, 40, 13, 0, 41, - 0, 0, 42, 0, 14, 0, 0, 15, 16, 17, + 34, 35, 0, 0, 1, 2, 3, 4, 5, 0, + 0, 0, 6, 7, 36, 8, 0, 9, 186, 0, + 10, 11, 12, 0, 0, 0, 0, 13, 0, 40, + 0, 0, 41, 0, 14, 42, 0, 15, 16, 17, 18, 19, 20, 0, 0, 22, 0, 23, 0, 0, 0, 24, 25, 0, 26, 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, 29, 30, 31, 0, 0, 0, 0, 0, 0, 32, 33, 34, 35, 0, 0, 1, 2, 3, 4, 5, 0, 0, 0, 6, 7, - 36, 8, 0, 9, 186, 0, 10, 11, 12, 0, + 36, 8, 0, 9, 0, 0, 10, 11, 12, 0, 0, 0, 0, 13, 0, 40, 0, 0, 41, 0, 14, 42, 0, 15, 16, 17, 18, 19, 20, 0, 0, 22, 0, 23, 0, 0, 0, 24, 25, 0, 26, 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, 29, 30, 31, 0, 0, 0, 0, 0, 0, - 32, 33, 34, 35, 0, 0, 1, 2, 3, 4, - 5, 0, 0, 0, 6, 7, 36, 8, 0, 9, - 0, 0, 10, 11, 12, 0, 0, 0, 0, 13, - 0, 40, 0, 0, 41, 0, 14, 42, 0, 15, - 16, 17, 18, 19, 20, 0, 0, 22, 0, 23, - 0, 0, 0, 24, 25, 0, 26, 27, 28, 0, - 0, 0, 0, 0, 0, 0, 0, 29, 30, 31, - 0, 1, 2, 3, 4, 5, 32, 33, 34, 35, - 7, 86, 8, 0, 0, 0, 0, 10, 11, 12, - 0, 0, 36, 0, 13, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, - 41, 0, 0, 42, 23, 0, 0, 0, 24, 25, - 0, 26, 27, 28, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 30, 31, 0, 0, 0, 0, 0, - 0, 32, 33, 34, 35, 1, 2, 3, 4, 5, - 0, 0, 0, 100, 7, 0, 8, 36, 0, 0, - 0, 10, 11, 12, 0, 0, 0, 0, 13, 0, - 0, 0, 40, 0, 0, 41, 0, 0, 42, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, - 0, 0, 24, 25, 0, 26, 27, 28, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 30, 31, 0, - 0, 0, 0, 0, 0, 32, 33, 34, 35, 1, - 2, 3, 4, 5, 0, 0, 0, 6, 7, 0, - 8, 36, 0, 0, 0, 10, 11, 12, 0, 0, - 0, 0, 13, 0, 0, 0, 40, 0, 0, 41, - 0, 0, 42, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 23, 0, 0, 0, 24, 25, 0, 26, - 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 30, 31, 0, 1, 2, 3, 4, 5, 32, - 33, 34, 35, 7, 243, 8, 0, 0, 0, 0, - 10, 11, 12, 0, 0, 36, 0, 13, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 40, 0, 0, 41, 0, 0, 42, 23, 0, 0, - 0, 24, 25, 0, 26, 27, 28, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 30, 31, 0, 1, - 2, 3, 4, 5, 32, 33, 34, 35, 7, 0, - 8, 246, 0, 0, 0, 10, 11, 12, 0, 0, - 36, 0, 13, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 40, 0, 0, 41, 0, - 0, 42, 23, 0, 0, 0, 24, 25, 0, 26, - 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 30, 31, 0, 1, 2, 3, 4, 5, 32, - 33, 34, 35, 7, 0, 8, 260, 0, 0, 0, - 10, 11, 12, 0, 0, 36, 0, 13, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 40, 0, 0, 41, 0, 0, 42, 23, 0, 0, - 0, 24, 25, 0, 26, 27, 28, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 30, 31, 0, 1, - 2, 3, 4, 5, 32, 33, 34, 35, 7, 280, - 8, 0, 0, 0, 0, 10, 11, 12, 0, 0, - 36, 0, 13, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 40, 0, 0, 41, 0, - 0, 42, 23, 0, 0, 0, 24, 25, 0, 26, - 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 30, 31, 0, 1, 2, 3, 4, 5, 32, - 33, 34, 35, 7, 0, 8, 0, 0, 0, 0, - 10, 11, 12, 0, 0, 36, 0, 13, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 40, 0, 0, 41, 0, 0, 42, 23, 0, 0, + 32, 33, 34, 35, 1, 2, 3, 4, 5, 0, + 0, 0, 100, 7, 0, 8, 36, 0, 0, 0, + 10, 11, 12, 0, 0, 0, 0, 13, 0, 0, + 0, 40, 0, 0, 41, 0, 0, 42, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 24, 25, 0, 26, 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 31, 0, 0, - 0, 0, 0, 0, 32, 33, 34, 35, 0, 0, - 0, 0, 0, 0, 304, 0, 0, 0, 0, 0, - 36, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 40, 0, 0, 41, 0, - 0, 42, 0, 0, 0, 0, 0, 0, 319, 320, - 321, 322, 323, 324, 325, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 326, 0, 0, 0, 0, 327, - 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 0, 342, 0, 343, 344, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 345, 346, 394, 0, 347, 348, 349, 350, 0, 305, - 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 319, 320, 321, 322, - 323, 324, 325, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 326, 0, 0, 0, 0, 327, 328, 329, - 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, - 340, 341, 0, 342, 0, 343, 344, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 345, 346, - 0, 0, 347, 348, 349, 350, 305, 306, 307, 308, + 0, 0, 0, 0, 32, 33, 34, 35, 1, 2, + 3, 4, 5, 0, 0, 0, 6, 7, 0, 8, + 36, 0, 0, 0, 10, 11, 12, 0, 0, 0, + 0, 13, 0, 0, 0, 40, 0, 0, 41, 0, + 0, 42, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 23, 0, 0, 0, 24, 25, 0, 26, 27, + 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 30, 31, 0, 1, 2, 3, 4, 5, 32, 33, + 34, 35, 7, 243, 8, 0, 0, 0, 0, 10, + 11, 12, 0, 0, 36, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, + 0, 0, 41, 0, 0, 42, 23, 0, 0, 0, + 24, 25, 0, 26, 27, 28, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 30, 31, 0, 1, 2, + 3, 4, 5, 32, 33, 34, 35, 7, 0, 8, + 246, 0, 0, 0, 10, 11, 12, 0, 0, 36, + 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 40, 0, 0, 41, 0, 0, + 42, 23, 0, 0, 0, 24, 25, 0, 26, 27, + 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 30, 31, 0, 1, 2, 3, 4, 5, 32, 33, + 34, 35, 7, 258, 8, 0, 0, 0, 0, 10, + 11, 12, 0, 0, 36, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, + 0, 0, 41, 0, 0, 42, 23, 0, 0, 0, + 24, 25, 0, 26, 27, 28, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 30, 31, 0, 1, 2, + 3, 4, 5, 32, 33, 34, 35, 7, 260, 8, + 0, 0, 0, 0, 10, 11, 12, 0, 0, 36, + 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 40, 0, 0, 41, 0, 0, + 42, 23, 0, 0, 0, 24, 25, 0, 26, 27, + 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 30, 31, 0, 1, 2, 3, 4, 5, 32, 33, + 34, 35, 7, 0, 8, 262, 0, 0, 0, 10, + 11, 12, 0, 0, 36, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, + 0, 0, 41, 0, 0, 42, 23, 0, 0, 0, + 24, 25, 0, 26, 27, 28, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 30, 31, 0, 1, 2, + 3, 4, 5, 32, 33, 34, 35, 7, 282, 8, + 0, 0, 0, 0, 10, 11, 12, 0, 0, 36, + 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 40, 0, 0, 41, 0, 0, + 42, 23, 0, 0, 0, 24, 25, 0, 26, 27, + 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 30, 31, 0, 1, 2, 3, 4, 5, 32, 33, + 34, 35, 7, 0, 8, 0, 0, 0, 0, 10, + 11, 12, 0, 0, 36, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, + 0, 0, 41, 0, 0, 42, 23, 0, 0, 0, + 24, 25, 0, 26, 27, 28, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 30, 31, 0, 0, 0, + 0, 0, 0, 32, 33, 34, 35, 0, 0, 0, + 0, 0, 0, 308, 0, 0, 0, 0, 0, 36, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 40, 0, 0, 41, 0, 0, + 42, 0, 0, 0, 0, 0, 0, 323, 324, 325, + 326, 327, 328, 329, 0, 0, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 0, 0, 0, 143, + 0, 0, 144, 330, 145, 146, 0, 0, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, + 343, 344, 345, 0, 346, 0, 347, 348, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 349, + 350, 398, 0, 351, 352, 353, 354, 0, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 323, 324, 325, 326, 327, + 328, 329, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 319, 320, 321, 322, 323, 324, 325, + 0, 330, 0, 0, 0, 0, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 0, 346, 0, 347, 348, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 349, 350, 0, + 0, 351, 352, 353, 354, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 323, 324, 325, 326, 327, 328, 329, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 326, - 0, 0, 0, 0, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 0, - 342, 0, 343, 344, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 345, 346, 0, 0, 347, - 348, 349, 350 + 0, 0, 0, 0, 0, 0, 0, 0, 330, 0, + 0, 0, 0, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 0, 346, + 0, 347, 348, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 349, 350, 0, 0, 351, 352, + 353, 354 }; static const yytype_int16 yycheck[] = { 30, 31, 32, 17, 7, 8, 125, 187, 83, 3, - 40, 51, 9, 95, 16, 131, 3, 16, 3, 22, - 24, 25, 3, 26, 27, 28, 304, 304, 3, 33, - 34, 11, 3, 4, 5, 6, 7, 112, 52, 42, - 115, 12, 12, 14, 0, 26, 0, 36, 31, 9, - 0, 26, 9, 9, 11, 15, 3, 4, 5, 6, - 7, 9, 45, 11, 3, 12, 12, 14, 184, 12, + 40, 51, 9, 95, 16, 131, 270, 16, 3, 22, + 24, 25, 3, 26, 27, 28, 308, 308, 3, 33, + 34, 3, 3, 4, 5, 6, 7, 112, 52, 42, + 115, 12, 0, 14, 12, 26, 0, 36, 31, 303, + 0, 9, 306, 9, 26, 11, 3, 4, 5, 6, + 7, 12, 45, 9, 9, 12, 11, 14, 184, 15, 110, 111, 19, 20, 21, 64, 90, 81, 118, 119, - 11, 268, 53, 54, 55, 265, 71, 43, 12, 43, - 93, 94, 95, 43, 97, 76, 374, 99, 128, 46, + 97, 98, 53, 54, 55, 43, 71, 267, 12, 43, + 93, 94, 95, 43, 97, 76, 378, 99, 128, 46, 99, 100, 12, 50, 51, 108, 53, 54, 55, 191, - 185, 388, 299, 391, 111, 302, 89, 394, 396, 12, - 3, 14, 116, 30, 11, 18, 73, 74, 75, 16, - 13, 11, 47, 12, 9, 14, 16, 368, 13, 110, - 104, 105, 89, 26, 263, 175, 49, 266, 9, 89, - 269, 9, 13, 156, 48, 13, 387, 50, 51, 18, - 107, 9, 91, 110, 395, 13, 397, 242, 52, 209, - 9, 246, 403, 404, 13, 178, 108, 109, 97, 98, - 112, 113, 114, 115, 364, 21, 22, 23, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 97, 98, - 203, 90, 205, 206, 93, 9, 95, 96, 28, 13, - 9, 9, 287, 288, 13, 13, 9, 9, 9, 9, - 13, 13, 13, 13, 9, 9, 9, 71, 13, 13, - 13, 26, 27, 28, 29, 9, 250, 251, 163, 164, - 165, 166, 256, 257, 363, 9, 10, 11, 3, 252, - 253, 254, 255, 171, 172, 173, 12, 3, 14, 97, - 98, 24, 25, 87, 88, 14, 280, 19, 20, 9, - 10, 161, 162, 303, 304, 167, 168, 71, 169, 170, - 12, 12, 296, 9, 14, 14, 100, 15, 12, 16, - 35, 16, 15, 99, 12, 17, 17, 11, 11, 43, - 17, 17, 3, 13, 13, 13, 9, 12, 294, 13, - 16, 13, 147, 13, 216, 369, 275, 154, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 155, 158, 160, 157, 177, -1, 159, 353, - 174, 355, 356, -1, 374, 46, 47, 48, 49, 50, - 51, 52, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 391, -1, -1, -1, -1, 396, -1, -1, -1, - -1, 72, -1, -1, -1, -1, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, -1, 93, -1, 95, 96, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 108, 109, -1, - -1, 112, 113, 114, 115, 0, -1, -1, 3, 4, - 5, 6, 7, -1, -1, -1, 11, 12, -1, 14, - -1, 16, -1, -1, 19, 20, 21, -1, -1, -1, - -1, 26, -1, -1, -1, -1, -1, -1, 33, -1, - -1, 36, 37, 38, 39, 40, 41, -1, 43, 44, + 185, 392, 9, 395, 111, 11, 13, 398, 400, 12, + 3, 14, 116, 11, 11, 18, 73, 74, 75, 16, + 13, 11, 89, 12, 9, 14, 16, 372, 13, 110, + 9, 12, 89, 26, 13, 175, 265, 9, 3, 268, + 9, 13, 271, 156, 13, 9, 391, 50, 51, 13, + 107, 9, 30, 110, 399, 13, 401, 242, 49, 209, + 9, 246, 407, 408, 13, 178, 9, 9, 9, 52, + 13, 13, 13, 258, 48, 260, 108, 109, 368, 47, + 112, 113, 114, 115, 9, 9, 91, 9, 13, 13, + 203, 13, 205, 206, 9, 21, 22, 23, 13, 18, + 3, 4, 5, 6, 7, 290, 12, 292, 14, 12, + 13, 14, 26, 27, 28, 29, 19, 20, 21, 163, + 164, 165, 166, 26, 97, 98, 250, 251, 9, 10, + 11, 28, 256, 257, 171, 172, 173, 89, 367, 252, + 253, 254, 255, 46, 97, 98, 9, 50, 51, 3, + 53, 54, 55, 104, 105, 24, 25, 3, 282, 87, + 88, 71, 65, 66, 19, 20, 14, 307, 308, 71, + 73, 74, 75, 76, 9, 10, 300, 161, 162, 167, + 168, 12, 169, 170, 12, 14, 89, 9, 14, 16, + 15, 35, 16, 12, 15, 100, 3, 17, 99, 17, + 12, 104, 11, 11, 107, 43, 17, 110, 13, 13, + 13, 17, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 9, 12, 16, 13, + 147, 13, 13, 357, 216, 359, 360, 373, 378, 46, + 47, 48, 49, 50, 51, 52, 298, 154, 277, 157, + 159, 155, -1, 174, 177, 395, -1, -1, 158, -1, + 400, 160, -1, -1, -1, 72, -1, -1, -1, -1, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, -1, 93, -1, 95, 96, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 108, 109, -1, -1, 112, 113, 114, 115, 0, + -1, -1, 3, 4, 5, 6, 7, -1, -1, -1, + 11, 12, -1, 14, -1, 16, -1, -1, 19, 20, + 21, -1, -1, -1, -1, 26, -1, -1, -1, -1, + -1, -1, 33, -1, -1, 36, 37, 38, 39, 40, + 41, -1, 43, 44, -1, 46, -1, -1, -1, 50, + 51, -1, 53, 54, 55, -1, -1, -1, -1, -1, + -1, -1, -1, 64, 65, 66, -1, -1, -1, -1, + -1, -1, 73, 74, 75, 76, -1, -1, -1, -1, + -1, 3, 4, 5, 6, 7, -1, -1, 89, 11, + 12, -1, 14, -1, 16, 17, -1, 19, 20, 21, + 101, 102, 103, 104, 26, -1, 107, -1, -1, 110, + -1, 33, -1, -1, 36, 37, 38, 39, 40, 41, + -1, 43, 44, -1, 46, -1, -1, -1, 50, 51, + -1, 53, 54, 55, -1, -1, -1, -1, -1, -1, + -1, -1, 64, 65, 66, -1, -1, -1, -1, -1, + -1, 73, 74, 75, 76, -1, -1, -1, -1, -1, + 3, 4, 5, 6, 7, -1, -1, 89, 11, 12, + -1, 14, -1, 16, 17, -1, 19, 20, 21, 101, + 102, 103, 104, 26, -1, 107, -1, -1, 110, -1, + 33, -1, -1, 36, 37, 38, 39, 40, 41, -1, + 43, 44, -1, 46, -1, -1, -1, 50, 51, -1, + 53, 54, 55, -1, -1, -1, -1, -1, -1, -1, + -1, 64, 65, 66, -1, -1, -1, -1, -1, -1, + 73, 74, 75, 76, -1, -1, -1, -1, -1, 3, + 4, 5, 6, 7, -1, -1, 89, 11, 12, -1, + 14, -1, 16, -1, -1, 19, 20, 21, 101, 102, + 103, 104, 26, -1, 107, -1, -1, 110, -1, 33, + -1, -1, 36, 37, 38, 39, 40, 41, -1, 43, + 44, -1, 46, -1, -1, -1, 50, 51, -1, 53, + 54, 55, -1, -1, -1, -1, -1, -1, -1, -1, + 64, 65, 66, -1, -1, -1, -1, -1, -1, 73, + 74, 75, 76, -1, -1, -1, -1, -1, 3, 4, + 5, 6, 7, -1, -1, 89, 11, 12, -1, 14, + -1, 16, 17, -1, 19, 20, 21, 101, 102, 103, + 104, 26, -1, 107, -1, -1, 110, -1, 33, -1, + -1, 36, 37, 38, 39, 40, 41, -1, -1, 44, -1, 46, -1, -1, -1, 50, 51, -1, 53, 54, 55, -1, -1, -1, -1, -1, -1, -1, -1, 64, 65, 66, -1, -1, -1, -1, -1, -1, 73, 74, - 75, 76, -1, -1, -1, -1, -1, 3, 4, 5, - 6, 7, -1, -1, 89, 11, 12, -1, 14, -1, - 16, 17, -1, 19, 20, 21, 101, 102, 103, 104, - 26, -1, 107, -1, -1, 110, -1, 33, -1, -1, - 36, 37, 38, 39, 40, 41, -1, 43, 44, -1, - 46, -1, -1, -1, 50, 51, -1, 53, 54, 55, - -1, -1, -1, -1, -1, -1, -1, -1, 64, 65, - 66, -1, -1, -1, -1, -1, -1, 73, 74, 75, - 76, -1, -1, -1, -1, -1, 3, 4, 5, 6, - 7, -1, -1, 89, 11, 12, -1, 14, -1, 16, - 17, -1, 19, 20, 21, 101, 102, 103, 104, 26, - -1, 107, -1, -1, 110, -1, 33, -1, -1, 36, - 37, 38, 39, 40, 41, -1, 43, 44, -1, 46, - -1, -1, -1, 50, 51, -1, 53, 54, 55, -1, - -1, -1, -1, -1, -1, -1, -1, 64, 65, 66, - -1, -1, -1, -1, -1, -1, 73, 74, 75, 76, - -1, -1, -1, -1, -1, 3, 4, 5, 6, 7, - -1, -1, 89, 11, 12, -1, 14, -1, 16, -1, - -1, 19, 20, 21, 101, 102, 103, 104, 26, -1, - 107, -1, -1, 110, -1, 33, -1, -1, 36, 37, - 38, 39, 40, 41, -1, 43, 44, -1, 46, -1, - -1, -1, 50, 51, -1, 53, 54, 55, -1, -1, - -1, -1, -1, -1, -1, -1, 64, 65, 66, -1, - -1, -1, -1, -1, -1, 73, 74, 75, 76, -1, - -1, -1, -1, -1, 3, 4, 5, 6, 7, -1, - -1, 89, 11, 12, -1, 14, -1, 16, 17, -1, - 19, 20, 21, 101, 102, 103, 104, 26, -1, 107, - -1, -1, 110, -1, 33, -1, -1, 36, 37, 38, + 75, 76, -1, -1, 3, 4, 5, 6, 7, -1, + -1, -1, 11, 12, 89, 14, -1, 16, 17, -1, + 19, 20, 21, -1, -1, -1, -1, 26, -1, 104, + -1, -1, 107, -1, 33, 110, -1, 36, 37, 38, 39, 40, 41, -1, -1, 44, -1, 46, -1, -1, -1, 50, 51, -1, 53, 54, 55, -1, -1, -1, -1, -1, -1, -1, -1, 64, 65, 66, -1, -1, -1, -1, -1, -1, 73, 74, 75, 76, -1, -1, 3, 4, 5, 6, 7, -1, -1, -1, 11, 12, - 89, 14, -1, 16, 17, -1, 19, 20, 21, -1, + 89, 14, -1, 16, -1, -1, 19, 20, 21, -1, -1, -1, -1, 26, -1, 104, -1, -1, 107, -1, 33, 110, -1, 36, 37, 38, 39, 40, 41, -1, -1, 44, -1, 46, -1, -1, -1, 50, 51, -1, 53, 54, 55, -1, -1, -1, -1, -1, -1, -1, -1, 64, 65, 66, -1, -1, -1, -1, -1, -1, - 73, 74, 75, 76, -1, -1, 3, 4, 5, 6, - 7, -1, -1, -1, 11, 12, 89, 14, -1, 16, - -1, -1, 19, 20, 21, -1, -1, -1, -1, 26, - -1, 104, -1, -1, 107, -1, 33, 110, -1, 36, - 37, 38, 39, 40, 41, -1, -1, 44, -1, 46, - -1, -1, -1, 50, 51, -1, 53, 54, 55, -1, - -1, -1, -1, -1, -1, -1, -1, 64, 65, 66, - -1, 3, 4, 5, 6, 7, 73, 74, 75, 76, - 12, 13, 14, -1, -1, -1, -1, 19, 20, 21, - -1, -1, 89, -1, 26, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 104, -1, -1, - 107, -1, -1, 110, 46, -1, -1, -1, 50, 51, - -1, 53, 54, 55, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 65, 66, -1, -1, -1, -1, -1, - -1, 73, 74, 75, 76, 3, 4, 5, 6, 7, - -1, -1, -1, 11, 12, -1, 14, 89, -1, -1, - -1, 19, 20, 21, -1, -1, -1, -1, 26, -1, - -1, -1, 104, -1, -1, 107, -1, -1, 110, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 46, -1, - -1, -1, 50, 51, -1, 53, 54, 55, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 65, 66, -1, - -1, -1, -1, -1, -1, 73, 74, 75, 76, 3, - 4, 5, 6, 7, -1, -1, -1, 11, 12, -1, - 14, 89, -1, -1, -1, 19, 20, 21, -1, -1, - -1, -1, 26, -1, -1, -1, 104, -1, -1, 107, - -1, -1, 110, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 46, -1, -1, -1, 50, 51, -1, 53, - 54, 55, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 65, 66, -1, 3, 4, 5, 6, 7, 73, - 74, 75, 76, 12, 13, 14, -1, -1, -1, -1, - 19, 20, 21, -1, -1, 89, -1, 26, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 104, -1, -1, 107, -1, -1, 110, 46, -1, -1, - -1, 50, 51, -1, 53, 54, 55, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 65, 66, -1, 3, - 4, 5, 6, 7, 73, 74, 75, 76, 12, -1, - 14, 15, -1, -1, -1, 19, 20, 21, -1, -1, - 89, -1, 26, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 104, -1, -1, 107, -1, - -1, 110, 46, -1, -1, -1, 50, 51, -1, 53, - 54, 55, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 65, 66, -1, 3, 4, 5, 6, 7, 73, - 74, 75, 76, 12, -1, 14, 15, -1, -1, -1, - 19, 20, 21, -1, -1, 89, -1, 26, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 104, -1, -1, 107, -1, -1, 110, 46, -1, -1, - -1, 50, 51, -1, 53, 54, 55, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 65, 66, -1, 3, - 4, 5, 6, 7, 73, 74, 75, 76, 12, 13, - 14, -1, -1, -1, -1, 19, 20, 21, -1, -1, - 89, -1, 26, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 104, -1, -1, 107, -1, - -1, 110, 46, -1, -1, -1, 50, 51, -1, 53, - 54, 55, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 65, 66, -1, 3, 4, 5, 6, 7, 73, - 74, 75, 76, 12, -1, 14, -1, -1, -1, -1, - 19, 20, 21, -1, -1, 89, -1, 26, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 104, -1, -1, 107, -1, -1, 110, 46, -1, -1, + 73, 74, 75, 76, 3, 4, 5, 6, 7, -1, + -1, -1, 11, 12, -1, 14, 89, -1, -1, -1, + 19, 20, 21, -1, -1, -1, -1, 26, -1, -1, + -1, 104, -1, -1, 107, -1, -1, 110, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 46, -1, -1, -1, 50, 51, -1, 53, 54, 55, -1, -1, -1, -1, -1, -1, -1, -1, -1, 65, 66, -1, -1, - -1, -1, -1, -1, 73, 74, 75, 76, -1, -1, - -1, -1, -1, -1, 12, -1, -1, -1, -1, -1, - 89, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 104, -1, -1, 107, -1, - -1, 110, -1, -1, -1, -1, -1, -1, 46, 47, - 48, 49, 50, 51, 52, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 72, -1, -1, -1, -1, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, -1, 93, -1, 95, 96, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 108, 109, 12, -1, 112, 113, 114, 115, -1, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 46, 47, 48, 49, - 50, 51, 52, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 73, 74, 75, 76, 3, 4, + 5, 6, 7, -1, -1, -1, 11, 12, -1, 14, + 89, -1, -1, -1, 19, 20, 21, -1, -1, -1, + -1, 26, -1, -1, -1, 104, -1, -1, 107, -1, + -1, 110, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 46, -1, -1, -1, 50, 51, -1, 53, 54, + 55, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 65, 66, -1, 3, 4, 5, 6, 7, 73, 74, + 75, 76, 12, 13, 14, -1, -1, -1, -1, 19, + 20, 21, -1, -1, 89, -1, 26, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 104, + -1, -1, 107, -1, -1, 110, 46, -1, -1, -1, + 50, 51, -1, 53, 54, 55, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 65, 66, -1, 3, 4, + 5, 6, 7, 73, 74, 75, 76, 12, -1, 14, + 15, -1, -1, -1, 19, 20, 21, -1, -1, 89, + -1, 26, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 104, -1, -1, 107, -1, -1, + 110, 46, -1, -1, -1, 50, 51, -1, 53, 54, + 55, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 65, 66, -1, 3, 4, 5, 6, 7, 73, 74, + 75, 76, 12, 13, 14, -1, -1, -1, -1, 19, + 20, 21, -1, -1, 89, -1, 26, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 104, + -1, -1, 107, -1, -1, 110, 46, -1, -1, -1, + 50, 51, -1, 53, 54, 55, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 65, 66, -1, 3, 4, + 5, 6, 7, 73, 74, 75, 76, 12, 13, 14, + -1, -1, -1, -1, 19, 20, 21, -1, -1, 89, + -1, 26, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 104, -1, -1, 107, -1, -1, + 110, 46, -1, -1, -1, 50, 51, -1, 53, 54, + 55, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 65, 66, -1, 3, 4, 5, 6, 7, 73, 74, + 75, 76, 12, -1, 14, 15, -1, -1, -1, 19, + 20, 21, -1, -1, 89, -1, 26, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 104, + -1, -1, 107, -1, -1, 110, 46, -1, -1, -1, + 50, 51, -1, 53, 54, 55, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 65, 66, -1, 3, 4, + 5, 6, 7, 73, 74, 75, 76, 12, 13, 14, + -1, -1, -1, -1, 19, 20, 21, -1, -1, 89, + -1, 26, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 104, -1, -1, 107, -1, -1, + 110, 46, -1, -1, -1, 50, 51, -1, 53, 54, + 55, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 65, 66, -1, 3, 4, 5, 6, 7, 73, 74, + 75, 76, 12, -1, 14, -1, -1, -1, -1, 19, + 20, 21, -1, -1, 89, -1, 26, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 104, + -1, -1, 107, -1, -1, 110, 46, -1, -1, -1, + 50, 51, -1, 53, 54, 55, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 65, 66, -1, -1, -1, + -1, -1, -1, 73, 74, 75, 76, -1, -1, -1, + -1, -1, -1, 12, -1, -1, -1, -1, -1, 89, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 104, -1, -1, 107, -1, -1, + 110, -1, -1, -1, -1, -1, -1, 46, 47, 48, + 49, 50, 51, 52, -1, -1, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, -1, -1, -1, 90, + -1, -1, 93, 72, 95, 96, -1, -1, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, -1, 93, -1, 95, 96, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 108, + 109, 12, -1, 112, 113, 114, 115, -1, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 46, 47, 48, 49, 50, + 51, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 72, -1, -1, -1, -1, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, -1, 93, -1, 95, 96, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 108, 109, - -1, -1, 112, 113, 114, 115, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + -1, 72, -1, -1, -1, -1, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, -1, 93, -1, 95, 96, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 108, 109, -1, + -1, 112, 113, 114, 115, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 46, 47, 48, 49, 50, 51, 52, + -1, -1, 46, 47, 48, 49, 50, 51, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 72, - -1, -1, -1, -1, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, - 93, -1, 95, 96, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 108, 109, -1, -1, 112, - 113, 114, 115 + -1, -1, -1, -1, -1, -1, -1, -1, 72, -1, + -1, -1, -1, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, + -1, 95, 96, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 108, 109, -1, -1, 112, 113, + 114, 115 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -1503,22 +1521,23 @@ static const yytype_uint8 yystos[] = 149, 159, 144, 160, 161, 162, 163, 164, 164, 165, 165, 165, 165, 166, 166, 167, 167, 168, 168, 168, 169, 134, 174, 13, 144, 3, 15, 147, 127, 71, - 13, 13, 143, 10, 12, 12, 13, 13, 144, 144, - 15, 14, 150, 9, 16, 99, 100, 121, 16, 99, - 125, 14, 148, 3, 116, 10, 13, 147, 138, 138, - 13, 144, 144, 144, 144, 138, 138, 13, 13, 15, - 126, 120, 122, 123, 124, 128, 137, 127, 126, 16, - 122, 126, 16, 12, 12, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 46, - 47, 48, 49, 50, 51, 52, 72, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 93, 95, 96, 108, 109, 112, 113, 114, - 115, 172, 157, 35, 138, 13, 13, 13, 13, 147, - 147, 17, 123, 100, 99, 122, 17, 122, 13, 134, - 136, 26, 136, 172, 12, 138, 138, 138, 11, 11, - 126, 127, 17, 17, 11, 142, 151, 13, 13, 13, - 136, 9, 11, 142, 12, 172, 12, 13, 136, 172, - 142, 136, 142, 13, 13, 142, 142 + 13, 13, 143, 10, 12, 12, 13, 13, 13, 144, + 13, 144, 15, 14, 150, 9, 16, 99, 100, 121, + 16, 99, 125, 14, 148, 3, 116, 10, 13, 147, + 138, 138, 13, 144, 144, 144, 144, 138, 138, 147, + 13, 147, 13, 15, 126, 120, 122, 123, 124, 128, + 137, 127, 126, 16, 122, 126, 16, 12, 12, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 46, 47, 48, 49, 50, 51, 52, + 72, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 93, 95, 96, 108, + 109, 112, 113, 114, 115, 172, 157, 35, 138, 13, + 13, 13, 13, 147, 147, 17, 123, 100, 99, 122, + 17, 122, 13, 134, 136, 26, 136, 172, 12, 138, + 138, 138, 11, 11, 126, 127, 17, 17, 11, 142, + 151, 13, 13, 13, 136, 9, 11, 142, 12, 172, + 12, 13, 136, 172, 142, 136, 142, 13, 13, 142, + 142 }; #define yyerrok (yyerrstatus = 0) @@ -2851,727 +2870,747 @@ yyparse () case 101: #line 437 "chuck.y" - { (yyval.var_decl) = new_var_decl( (yyvsp[(1) - (1)].sval), NULL, NULL, (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} + { (yyval.var_decl) = new_var_decl( (yyvsp[(1) - (1)].sval), FALSE, NULL, NULL, (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; case 102: #line 438 "chuck.y" - { (yyval.var_decl) = new_var_decl( (yyvsp[(1) - (2)].sval), NULL, (yyvsp[(2) - (2)].array_sub), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} + { (yyval.var_decl) = new_var_decl( (yyvsp[(1) - (2)].sval), FALSE, NULL, (yyvsp[(2) - (2)].array_sub), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 103: #line 439 "chuck.y" - { (yyval.var_decl) = new_var_decl( (yyvsp[(1) - (2)].sval), NULL, (yyvsp[(2) - (2)].array_sub), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} + { (yyval.var_decl) = new_var_decl( (yyvsp[(1) - (2)].sval), FALSE, NULL, (yyvsp[(2) - (2)].array_sub), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 104: #line 440 "chuck.y" - { (yyval.var_decl) = new_var_decl( (yyvsp[(1) - (4)].sval), (yyvsp[(3) - (4)].exp), NULL, (yylsp[(1) - (4)]).first_line, (yylsp[(1) - (4)]).first_column ); ;} + { (yyval.var_decl) = new_var_decl( (yyvsp[(1) - (3)].sval), TRUE, NULL, NULL, (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} break; case 105: #line 441 "chuck.y" - { (yyval.var_decl) = new_var_decl( (yyvsp[(1) - (5)].sval), (yyvsp[(3) - (5)].exp), (yyvsp[(5) - (5)].array_sub), (yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column ); ;} + { (yyval.var_decl) = new_var_decl( (yyvsp[(1) - (4)].sval), TRUE, (yyvsp[(3) - (4)].exp), NULL, (yylsp[(1) - (4)]).first_line, (yylsp[(1) - (4)]).first_column ); ;} break; case 106: -#line 446 "chuck.y" - { (yyval.complex_exp) = new_complex( (yyvsp[(2) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} +#line 442 "chuck.y" + { (yyval.var_decl) = new_var_decl( (yyvsp[(1) - (4)].sval), TRUE, NULL, (yyvsp[(4) - (4)].array_sub), (yylsp[(1) - (4)]).first_line, (yylsp[(1) - (4)]).first_column ); ;} break; case 107: -#line 451 "chuck.y" - { (yyval.polar_exp) = new_polar( (yyvsp[(2) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} +#line 443 "chuck.y" + { (yyval.var_decl) = new_var_decl( (yyvsp[(1) - (5)].sval), TRUE, (yyvsp[(3) - (5)].exp), (yyvsp[(5) - (5)].array_sub), (yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column ); ;} break; case 108: -#line 456 "chuck.y" - { (yyval.vec_exp) = new_vec( (yyvsp[(2) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} +#line 448 "chuck.y" + { (yyval.complex_exp) = new_complex( (yyvsp[(2) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} break; case 109: -#line 460 "chuck.y" - { (yyval.ival) = ae_op_chuck; ;} +#line 453 "chuck.y" + { (yyval.polar_exp) = new_polar( (yyvsp[(2) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} break; case 110: -#line 461 "chuck.y" - { (yyval.ival) = ae_op_at_chuck; ;} +#line 458 "chuck.y" + { (yyval.vec_exp) = new_vec( (yyvsp[(2) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} break; case 111: #line 462 "chuck.y" - { (yyval.ival) = ae_op_plus_chuck; ;} + { (yyval.ival) = ae_op_chuck; ;} break; case 112: #line 463 "chuck.y" - { (yyval.ival) = ae_op_minus_chuck; ;} + { (yyval.ival) = ae_op_at_chuck; ;} break; case 113: #line 464 "chuck.y" - { (yyval.ival) = ae_op_times_chuck; ;} + { (yyval.ival) = ae_op_plus_chuck; ;} break; case 114: #line 465 "chuck.y" - { (yyval.ival) = ae_op_divide_chuck; ;} + { (yyval.ival) = ae_op_minus_chuck; ;} break; case 115: #line 466 "chuck.y" - { (yyval.ival) = ae_op_shift_right_chuck; ;} + { (yyval.ival) = ae_op_times_chuck; ;} break; case 116: #line 467 "chuck.y" - { (yyval.ival) = ae_op_shift_left_chuck; ;} + { (yyval.ival) = ae_op_divide_chuck; ;} break; case 117: #line 468 "chuck.y" - { (yyval.ival) = ae_op_percent_chuck; ;} + { (yyval.ival) = ae_op_shift_right_chuck; ;} break; case 118: #line 469 "chuck.y" - { (yyval.ival) = ae_op_unchuck; ;} + { (yyval.ival) = ae_op_shift_left_chuck; ;} break; case 119: #line 470 "chuck.y" - { (yyval.ival) = ae_op_upchuck; ;} + { (yyval.ival) = ae_op_percent_chuck; ;} break; case 120: #line 471 "chuck.y" - { (yyval.ival) = ae_op_s_and_chuck; ;} + { (yyval.ival) = ae_op_unchuck; ;} break; case 121: #line 472 "chuck.y" - { (yyval.ival) = ae_op_s_or_chuck; ;} + { (yyval.ival) = ae_op_upchuck; ;} break; case 122: #line 473 "chuck.y" - { (yyval.ival) = ae_op_s_xor_chuck; ;} + { (yyval.ival) = ae_op_s_and_chuck; ;} break; case 123: -#line 477 "chuck.y" - { (yyval.ival) = ae_op_arrow_left; ;} +#line 474 "chuck.y" + { (yyval.ival) = ae_op_s_or_chuck; ;} break; case 124: -#line 478 "chuck.y" - { (yyval.ival) = ae_op_arrow_right; ;} +#line 475 "chuck.y" + { (yyval.ival) = ae_op_s_xor_chuck; ;} break; case 125: #line 479 "chuck.y" - { (yyval.ival) = ae_op_gruck_left; ;} + { (yyval.ival) = ae_op_arrow_left; ;} break; case 126: #line 480 "chuck.y" - { (yyval.ival) = ae_op_gruck_right; ;} + { (yyval.ival) = ae_op_arrow_right; ;} break; case 127: #line 481 "chuck.y" - { (yyval.ival) = ae_op_ungruck_left; ;} + { (yyval.ival) = ae_op_gruck_left; ;} break; case 128: #line 482 "chuck.y" - { (yyval.ival) = ae_op_ungruck_right; ;} + { (yyval.ival) = ae_op_gruck_right; ;} break; case 129: -#line 486 "chuck.y" - { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} +#line 483 "chuck.y" + { (yyval.ival) = ae_op_ungruck_left; ;} break; case 130: -#line 488 "chuck.y" - { (yyval.exp) = new_exp_from_if( (yyvsp[(1) - (5)].exp), (yyvsp[(3) - (5)].exp), (yyvsp[(5) - (5)].exp), (yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column ); ;} +#line 484 "chuck.y" + { (yyval.ival) = ae_op_ungruck_right; ;} break; case 131: -#line 492 "chuck.y" +#line 488 "chuck.y" { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 132: -#line 494 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_or, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 490 "chuck.y" + { (yyval.exp) = new_exp_from_if( (yyvsp[(1) - (5)].exp), (yyvsp[(3) - (5)].exp), (yyvsp[(5) - (5)].exp), (yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column ); ;} break; case 133: -#line 498 "chuck.y" +#line 494 "chuck.y" { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 134: -#line 500 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_and, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 496 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_or, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 135: -#line 504 "chuck.y" +#line 500 "chuck.y" { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 136: -#line 506 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_s_or, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 502 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_and, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 137: -#line 510 "chuck.y" +#line 506 "chuck.y" { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 138: -#line 512 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_s_xor, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 508 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_s_or, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 139: -#line 516 "chuck.y" +#line 512 "chuck.y" { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 140: -#line 518 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_s_and, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 514 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_s_xor, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 141: -#line 522 "chuck.y" +#line 518 "chuck.y" { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 142: -#line 524 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_eq, (yyvsp[(3) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} +#line 520 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_s_and, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 143: -#line 526 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_neq, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 524 "chuck.y" + { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 144: -#line 530 "chuck.y" - { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} +#line 526 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_eq, (yyvsp[(3) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} break; case 145: -#line 532 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_lt, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 528 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_neq, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 146: -#line 534 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_gt, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 532 "chuck.y" + { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 147: -#line 536 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_le, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 534 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_lt, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 148: -#line 538 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_ge, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 536 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_gt, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 149: -#line 542 "chuck.y" - { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} +#line 538 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_le, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 150: -#line 544 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_shift_left, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 540 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_ge, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 151: -#line 546 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_shift_right, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 544 "chuck.y" + { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 152: -#line 550 "chuck.y" - { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} +#line 546 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_shift_left, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 153: -#line 552 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_plus, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 548 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_shift_right, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 154: -#line 554 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_minus, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 552 "chuck.y" + { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 155: -#line 558 "chuck.y" - { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} +#line 554 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_plus, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 156: -#line 560 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_times, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 556 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_minus, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 157: -#line 562 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_divide, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 560 "chuck.y" + { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 158: -#line 564 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_percent, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 562 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_times, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 159: -#line 568 "chuck.y" - { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} +#line 564 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_divide, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 160: -#line 570 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_tilda, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 566 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_percent, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 161: -#line 574 "chuck.y" +#line 570 "chuck.y" { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 162: -#line 576 "chuck.y" - { (yyval.exp) = new_exp_from_cast( (yyvsp[(3) - (3)].type_decl), (yyvsp[(1) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column, (yylsp[(2) - (3)]).first_column ); ;} +#line 572 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_tilda, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 163: -#line 580 "chuck.y" +#line 576 "chuck.y" { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 164: -#line 582 "chuck.y" - { (yyval.exp) = new_exp_from_unary( ae_op_plusplus, (yyvsp[(2) - (2)].exp), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} +#line 578 "chuck.y" + { (yyval.exp) = new_exp_from_cast( (yyvsp[(3) - (3)].type_decl), (yyvsp[(1) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column, (yylsp[(2) - (3)]).first_column ); ;} break; case 165: -#line 584 "chuck.y" - { (yyval.exp) = new_exp_from_unary( ae_op_minusminus, (yyvsp[(2) - (2)].exp), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} +#line 582 "chuck.y" + { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 166: -#line 586 "chuck.y" - { (yyval.exp) = new_exp_from_unary( (yyvsp[(1) - (2)].ival), (yyvsp[(2) - (2)].exp), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} +#line 584 "chuck.y" + { (yyval.exp) = new_exp_from_unary( ae_op_plusplus, (yyvsp[(2) - (2)].exp), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 167: -#line 588 "chuck.y" - { (yyval.exp) = new_exp_from_unary( ae_op_typeof, (yyvsp[(2) - (2)].exp), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} +#line 586 "chuck.y" + { (yyval.exp) = new_exp_from_unary( ae_op_minusminus, (yyvsp[(2) - (2)].exp), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 168: -#line 590 "chuck.y" - { (yyval.exp) = new_exp_from_unary( ae_op_sizeof, (yyvsp[(2) - (2)].exp), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} +#line 588 "chuck.y" + { (yyval.exp) = new_exp_from_unary( (yyvsp[(1) - (2)].ival), (yyvsp[(2) - (2)].exp), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 169: -#line 592 "chuck.y" - { (yyval.exp) = new_exp_from_unary2( ae_op_new, (yyvsp[(2) - (2)].type_decl), NULL, NULL, (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} +#line 590 "chuck.y" + { (yyval.exp) = new_exp_from_unary( ae_op_typeof, (yyvsp[(2) - (2)].exp), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 170: -#line 594 "chuck.y" - { (yyval.exp) = new_exp_from_unary2( ae_op_new, (yyvsp[(2) - (3)].type_decl), NULL, (yyvsp[(3) - (3)].array_sub), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} +#line 592 "chuck.y" + { (yyval.exp) = new_exp_from_unary( ae_op_sizeof, (yyvsp[(2) - (2)].exp), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 171: -#line 596 "chuck.y" - { (yyval.exp) = new_exp_from_unary2( ae_op_new, (yyvsp[(2) - (5)].type_decl), (yyvsp[(4) - (5)].exp), NULL, (yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column ); ;} +#line 594 "chuck.y" + { (yyval.exp) = new_exp_from_unary2( ae_op_new, (yyvsp[(2) - (2)].type_decl), FALSE, NULL, NULL, (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 172: -#line 598 "chuck.y" - { (yyval.exp) = new_exp_from_unary2( ae_op_new, (yyvsp[(2) - (6)].type_decl), (yyvsp[(4) - (6)].exp), (yyvsp[(6) - (6)].array_sub), (yylsp[(1) - (6)]).first_line, (yylsp[(1) - (6)]).first_column ); ;} +#line 596 "chuck.y" + { (yyval.exp) = new_exp_from_unary2( ae_op_new, (yyvsp[(2) - (3)].type_decl), FALSE, NULL, (yyvsp[(3) - (3)].array_sub), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} break; case 173: -#line 604 "chuck.y" - { (yyval.ival) = ae_op_plus; ;} +#line 598 "chuck.y" + { (yyval.exp) = new_exp_from_unary2( ae_op_new, (yyvsp[(2) - (4)].type_decl), TRUE, NULL, NULL, (yylsp[(1) - (4)]).first_line, (yylsp[(1) - (4)]).first_column ); ;} break; case 174: -#line 605 "chuck.y" - { (yyval.ival) = ae_op_minus; ;} +#line 600 "chuck.y" + { (yyval.exp) = new_exp_from_unary2( ae_op_new, (yyvsp[(2) - (5)].type_decl), TRUE, (yyvsp[(4) - (5)].exp), NULL, (yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column ); ;} break; case 175: -#line 606 "chuck.y" - { (yyval.ival) = ae_op_tilda; ;} +#line 602 "chuck.y" + { (yyval.exp) = new_exp_from_unary2( ae_op_new, (yyvsp[(2) - (5)].type_decl), TRUE, NULL, (yyvsp[(5) - (5)].array_sub), (yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column ); ;} break; case 176: -#line 607 "chuck.y" - { (yyval.ival) = ae_op_exclamation; ;} +#line 604 "chuck.y" + { (yyval.exp) = new_exp_from_unary2( ae_op_new, (yyvsp[(2) - (6)].type_decl), TRUE, (yyvsp[(4) - (6)].exp), (yyvsp[(6) - (6)].array_sub), (yylsp[(1) - (6)]).first_line, (yylsp[(1) - (6)]).first_column ); ;} break; case 177: -#line 608 "chuck.y" - { (yyval.ival) = ae_op_times; ;} +#line 610 "chuck.y" + { (yyval.ival) = ae_op_plus; ;} break; case 178: -#line 609 "chuck.y" - { (yyval.ival) = ae_op_spork; ;} +#line 611 "chuck.y" + { (yyval.ival) = ae_op_minus; ;} break; case 179: -#line 615 "chuck.y" - { (yyval.ival) = ae_op_chuck; ;} +#line 612 "chuck.y" + { (yyval.ival) = ae_op_tilda; ;} break; case 180: -#line 616 "chuck.y" - { (yyval.ival) = ae_op_plus; ;} +#line 613 "chuck.y" + { (yyval.ival) = ae_op_exclamation; ;} break; case 181: -#line 617 "chuck.y" - { (yyval.ival) = ae_op_minus; ;} +#line 614 "chuck.y" + { (yyval.ival) = ae_op_times; ;} break; case 182: -#line 618 "chuck.y" - { (yyval.ival) = ae_op_times; ;} +#line 615 "chuck.y" + { (yyval.ival) = ae_op_spork; ;} break; case 183: -#line 619 "chuck.y" - { (yyval.ival) = ae_op_divide; ;} +#line 621 "chuck.y" + { (yyval.ival) = ae_op_chuck; ;} break; case 184: -#line 620 "chuck.y" - { (yyval.ival) = ae_op_percent; ;} +#line 622 "chuck.y" + { (yyval.ival) = ae_op_plus; ;} break; case 185: -#line 621 "chuck.y" - { (yyval.ival) = ae_op_eq; ;} +#line 623 "chuck.y" + { (yyval.ival) = ae_op_minus; ;} break; case 186: -#line 622 "chuck.y" - { (yyval.ival) = ae_op_neq; ;} +#line 624 "chuck.y" + { (yyval.ival) = ae_op_times; ;} break; case 187: -#line 623 "chuck.y" - { (yyval.ival) = ae_op_lt; ;} +#line 625 "chuck.y" + { (yyval.ival) = ae_op_divide; ;} break; case 188: -#line 624 "chuck.y" - { (yyval.ival) = ae_op_le; ;} +#line 626 "chuck.y" + { (yyval.ival) = ae_op_percent; ;} break; case 189: -#line 625 "chuck.y" - { (yyval.ival) = ae_op_gt; ;} +#line 627 "chuck.y" + { (yyval.ival) = ae_op_eq; ;} break; case 190: -#line 626 "chuck.y" - { (yyval.ival) = ae_op_ge; ;} +#line 628 "chuck.y" + { (yyval.ival) = ae_op_neq; ;} break; case 191: -#line 627 "chuck.y" - { (yyval.ival) = ae_op_and; ;} +#line 629 "chuck.y" + { (yyval.ival) = ae_op_lt; ;} break; case 192: -#line 628 "chuck.y" - { (yyval.ival) = ae_op_or; ;} +#line 630 "chuck.y" + { (yyval.ival) = ae_op_le; ;} break; case 193: -#line 629 "chuck.y" - { (yyval.ival) = ae_op_assign; ;} +#line 631 "chuck.y" + { (yyval.ival) = ae_op_gt; ;} break; case 194: -#line 630 "chuck.y" - { (yyval.ival) = ae_op_exclamation; ;} +#line 632 "chuck.y" + { (yyval.ival) = ae_op_ge; ;} break; case 195: -#line 631 "chuck.y" - { (yyval.ival) = ae_op_s_or; ;} +#line 633 "chuck.y" + { (yyval.ival) = ae_op_and; ;} break; case 196: -#line 632 "chuck.y" - { (yyval.ival) = ae_op_s_and; ;} +#line 634 "chuck.y" + { (yyval.ival) = ae_op_or; ;} break; case 197: -#line 633 "chuck.y" - { (yyval.ival) = ae_op_s_xor; ;} +#line 635 "chuck.y" + { (yyval.ival) = ae_op_assign; ;} break; case 198: -#line 634 "chuck.y" - { (yyval.ival) = ae_op_plusplus; ;} +#line 636 "chuck.y" + { (yyval.ival) = ae_op_exclamation; ;} break; case 199: -#line 635 "chuck.y" - { (yyval.ival) = ae_op_minusminus; ;} +#line 637 "chuck.y" + { (yyval.ival) = ae_op_s_or; ;} break; case 200: -#line 636 "chuck.y" - { (yyval.ival) = ae_op_dollar; ;} +#line 638 "chuck.y" + { (yyval.ival) = ae_op_s_and; ;} break; case 201: -#line 637 "chuck.y" - { (yyval.ival) = ae_op_at_at; ;} +#line 639 "chuck.y" + { (yyval.ival) = ae_op_s_xor; ;} break; case 202: -#line 638 "chuck.y" - { (yyval.ival) = ae_op_plus_chuck; ;} +#line 640 "chuck.y" + { (yyval.ival) = ae_op_plusplus; ;} break; case 203: -#line 639 "chuck.y" - { (yyval.ival) = ae_op_minus_chuck; ;} +#line 641 "chuck.y" + { (yyval.ival) = ae_op_minusminus; ;} break; case 204: -#line 640 "chuck.y" - { (yyval.ival) = ae_op_times_chuck; ;} +#line 642 "chuck.y" + { (yyval.ival) = ae_op_dollar; ;} break; case 205: -#line 641 "chuck.y" - { (yyval.ival) = ae_op_divide_chuck; ;} +#line 643 "chuck.y" + { (yyval.ival) = ae_op_at_at; ;} break; case 206: -#line 642 "chuck.y" - { (yyval.ival) = ae_op_s_and_chuck; ;} +#line 644 "chuck.y" + { (yyval.ival) = ae_op_plus_chuck; ;} break; case 207: -#line 643 "chuck.y" - { (yyval.ival) = ae_op_s_or_chuck; ;} +#line 645 "chuck.y" + { (yyval.ival) = ae_op_minus_chuck; ;} break; case 208: -#line 644 "chuck.y" - { (yyval.ival) = ae_op_s_xor_chuck; ;} +#line 646 "chuck.y" + { (yyval.ival) = ae_op_times_chuck; ;} break; case 209: -#line 645 "chuck.y" - { (yyval.ival) = ae_op_shift_right_chuck; ;} +#line 647 "chuck.y" + { (yyval.ival) = ae_op_divide_chuck; ;} break; case 210: -#line 646 "chuck.y" - { (yyval.ival) = ae_op_shift_left_chuck; ;} +#line 648 "chuck.y" + { (yyval.ival) = ae_op_s_and_chuck; ;} break; case 211: -#line 647 "chuck.y" - { (yyval.ival) = ae_op_percent_chuck; ;} +#line 649 "chuck.y" + { (yyval.ival) = ae_op_s_or_chuck; ;} break; case 212: -#line 648 "chuck.y" - { (yyval.ival) = ae_op_shift_right; ;} +#line 650 "chuck.y" + { (yyval.ival) = ae_op_s_xor_chuck; ;} break; case 213: -#line 649 "chuck.y" - { (yyval.ival) = ae_op_shift_left; ;} +#line 651 "chuck.y" + { (yyval.ival) = ae_op_shift_right_chuck; ;} break; case 214: -#line 650 "chuck.y" - { (yyval.ival) = ae_op_tilda; ;} +#line 652 "chuck.y" + { (yyval.ival) = ae_op_shift_left_chuck; ;} break; case 215: -#line 651 "chuck.y" - { (yyval.ival) = ae_op_coloncolon; ;} +#line 653 "chuck.y" + { (yyval.ival) = ae_op_percent_chuck; ;} break; case 216: -#line 652 "chuck.y" - { (yyval.ival) = ae_op_at_chuck; ;} +#line 654 "chuck.y" + { (yyval.ival) = ae_op_shift_right; ;} break; case 217: -#line 653 "chuck.y" - { (yyval.ival) = ae_op_unchuck; ;} +#line 655 "chuck.y" + { (yyval.ival) = ae_op_shift_left; ;} break; case 218: -#line 654 "chuck.y" - { (yyval.ival) = ae_op_upchuck; ;} +#line 656 "chuck.y" + { (yyval.ival) = ae_op_tilda; ;} break; case 219: -#line 655 "chuck.y" - { (yyval.ival) = ae_op_arrow_right; ;} +#line 657 "chuck.y" + { (yyval.ival) = ae_op_coloncolon; ;} break; case 220: -#line 656 "chuck.y" - { (yyval.ival) = ae_op_arrow_left; ;} +#line 658 "chuck.y" + { (yyval.ival) = ae_op_at_chuck; ;} break; case 221: -#line 657 "chuck.y" - { (yyval.ival) = ae_op_gruck_right; ;} +#line 659 "chuck.y" + { (yyval.ival) = ae_op_unchuck; ;} break; case 222: -#line 658 "chuck.y" - { (yyval.ival) = ae_op_gruck_left; ;} +#line 660 "chuck.y" + { (yyval.ival) = ae_op_upchuck; ;} break; case 223: -#line 659 "chuck.y" - { (yyval.ival) = ae_op_ungruck_right; ;} +#line 661 "chuck.y" + { (yyval.ival) = ae_op_arrow_right; ;} break; case 224: -#line 660 "chuck.y" - { (yyval.ival) = ae_op_ungruck_left; ;} +#line 662 "chuck.y" + { (yyval.ival) = ae_op_arrow_left; ;} + break; + + case 225: +#line 663 "chuck.y" + { (yyval.ival) = ae_op_gruck_right; ;} break; case 226: -#line 666 "chuck.y" - { (yyval.exp) = new_exp_from_dur( (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} +#line 664 "chuck.y" + { (yyval.ival) = ae_op_gruck_left; ;} break; case 227: -#line 670 "chuck.y" - { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} +#line 665 "chuck.y" + { (yyval.ival) = ae_op_ungruck_right; ;} break; case 228: +#line 666 "chuck.y" + { (yyval.ival) = ae_op_ungruck_left; ;} + break; + + case 230: #line 672 "chuck.y" + { (yyval.exp) = new_exp_from_dur( (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} + break; + + case 231: +#line 676 "chuck.y" + { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} + break; + + case 232: +#line 678 "chuck.y" { (yyval.exp) = new_exp_from_array( (yyvsp[(1) - (2)].exp), (yyvsp[(2) - (2)].array_sub), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; - case 229: -#line 674 "chuck.y" + case 233: +#line 680 "chuck.y" { (yyval.exp) = new_exp_from_func_call( (yyvsp[(1) - (3)].exp), NULL, (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} break; - case 230: -#line 676 "chuck.y" + case 234: +#line 682 "chuck.y" { (yyval.exp) = new_exp_from_func_call( (yyvsp[(1) - (4)].exp), (yyvsp[(3) - (4)].exp), (yylsp[(1) - (4)]).first_line, (yylsp[(1) - (4)]).first_column ); ;} break; - case 231: -#line 678 "chuck.y" + case 235: +#line 684 "chuck.y" { (yyval.exp) = new_exp_from_member_dot( (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].sval), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column, (yylsp[(3) - (3)]).first_column ); ;} break; - case 232: -#line 680 "chuck.y" + case 236: +#line 686 "chuck.y" { (yyval.exp) = new_exp_from_postfix( (yyvsp[(1) - (2)].exp), ae_op_plusplus, (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; - case 233: -#line 682 "chuck.y" + case 237: +#line 688 "chuck.y" { (yyval.exp) = new_exp_from_postfix( (yyvsp[(1) - (2)].exp), ae_op_minusminus, (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; - case 234: -#line 687 "chuck.y" + case 238: +#line 693 "chuck.y" { (yyval.exp) = new_exp_from_id( (yyvsp[(1) - (1)].sval), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; - case 235: -#line 688 "chuck.y" + case 239: +#line 694 "chuck.y" { (yyval.exp) = new_exp_from_int( (yyvsp[(1) - (1)].ival), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; - case 236: -#line 689 "chuck.y" + case 240: +#line 695 "chuck.y" { (yyval.exp) = new_exp_from_float( (yyvsp[(1) - (1)].fval), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; - case 237: -#line 690 "chuck.y" + case 241: +#line 696 "chuck.y" { (yyval.exp) = new_exp_from_str( (yyvsp[(1) - (1)].sval), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; - case 238: -#line 691 "chuck.y" + case 242: +#line 697 "chuck.y" { (yyval.exp) = new_exp_from_char( (yyvsp[(1) - (1)].sval), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; - case 239: -#line 692 "chuck.y" + case 243: +#line 698 "chuck.y" { (yyval.exp) = new_exp_from_array_lit( (yyvsp[(1) - (1)].array_sub), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; - case 240: -#line 693 "chuck.y" + case 244: +#line 699 "chuck.y" { (yyval.exp) = new_exp_from_complex( (yyvsp[(1) - (1)].complex_exp), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; - case 241: -#line 694 "chuck.y" + case 245: +#line 700 "chuck.y" { (yyval.exp) = new_exp_from_polar( (yyvsp[(1) - (1)].polar_exp), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; - case 242: -#line 695 "chuck.y" + case 246: +#line 701 "chuck.y" { (yyval.exp) = new_exp_from_vec( (yyvsp[(1) - (1)].vec_exp), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; - case 243: -#line 696 "chuck.y" + case 247: +#line 702 "chuck.y" { (yyval.exp) = new_exp_from_hack( (yyvsp[(2) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} break; - case 244: -#line 697 "chuck.y" + case 248: +#line 703 "chuck.y" { (yyval.exp) = (yyvsp[(2) - (3)].exp); ;} break; - case 245: -#line 698 "chuck.y" + case 249: +#line 704 "chuck.y" { (yyval.exp) = new_exp_from_nil( (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; /* Line 1267 of yacc.c. */ -#line 3575 "chuck.tab.c" +#line 3614 "chuck.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); From ba23070f8ecc98728136c9dd46042e13cfb928d4 Mon Sep 17 00:00:00 2001 From: Ge Wang Date: Sat, 11 Nov 2023 12:40:16 -0800 Subject: [PATCH 03/20] add scanner support for ctor invoke --- src/core/chuck_scan.cpp | 18 +++++++++++++++++- src/core/chuck_type.cpp | 26 ++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/src/core/chuck_scan.cpp b/src/core/chuck_scan.cpp index 9665cd312..2647a33b4 100644 --- a/src/core/chuck_scan.cpp +++ b/src/core/chuck_scan.cpp @@ -1200,6 +1200,14 @@ t_CKBOOL type_engine_scan1_exp_decl( Chuck_Env * env, a_Exp_Decl decl ) // count decl->num_var_decls++; + // scan constructor args | 1.5.1.9 (ge) added + if( var_decl->ctor_args != NULL ) + { + // type check the exp + if( !type_engine_scan1_exp( env, var_decl->ctor_args ) ) + return FALSE; + } + // scan if array if( var_decl->array != NULL ) { @@ -2251,7 +2259,7 @@ t_CKBOOL type_engine_scan2_array_subscripts( Chuck_Env * env, a_Exp exp_list ) // name: type_engine_scan2_exp_decl_create() | 1.5.1.1 (ge) // *** adapted from type_engine_scan2_exp_decl() pre-1.5.0.8 // *** which became type_engine_check_exp_decl_part1() in 1.5.0.8 -// reason: 'auto' needs more context before it can processed | 1.5.0.8 (ge) +// reason: 'auto' needs more context before it can be processed | 1.5.0.8 (ge) // however, class variables are meant to be accessible out-of-order // and needs decl created in an earlier pass | 1.5.1.1 (ge) // desc: this can now be called either from type_scan if not 'auto' in order @@ -2359,6 +2367,14 @@ t_CKBOOL type_engine_scan2_exp_decl_create( Chuck_Env * env, a_Exp_Decl decl ) return FALSE; } + // check for constructor args | 1.5.1.9 (ge) added + if( var_decl->ctor_args != NULL ) + { + // type check the exp + if( !type_engine_scan2_exp( env, var_decl->ctor_args ) ) + return FALSE; + } + // check if array if( var_decl->array != NULL ) { diff --git a/src/core/chuck_type.cpp b/src/core/chuck_type.cpp index e9b16e8f2..5bcc67b22 100644 --- a/src/core/chuck_type.cpp +++ b/src/core/chuck_type.cpp @@ -3115,6 +3115,23 @@ t_CKTYPE type_engine_check_exp_unary( Chuck_Env * env, a_Exp_Unary unary ) env->class_def->depends.add( &t->depends ); } + // constructors | 1.5.1.9 (ge) added + if( unary->ctor_invoked ) + { + // type check any constructor args + if( unary->ctor_args ) + { + // check the argument list + if( !type_engine_check_exp( env, unary->ctor_args ) ) + return NULL; + } + + // -- must be an Object (with caveats for primitive types, later) + // -- must be able to find a constructor with matching args + // -- empty () is okay (will invoke default ctor if there is one) + // -- ctors are always incompatible with empty [] + } + // [] if( unary->array ) { @@ -4102,6 +4119,15 @@ t_CKTYPE type_engine_check_exp_decl_part2( Chuck_Env * env, a_Exp_Decl decl ) } } + // check for constructor args | 1.5.1.9 (ge) added + if( var_decl->ctor_args != NULL ) + { + // -- must be an Object (with caveats for primitive types, later) + // -- must be able to find a constructor with matching args + // -- empty () is okay (will invoke default ctor if there is one) + // -- ctors are always incompatible with empty [] + } + // if array, then check to see if empty [] if( var_decl->array && var_decl->array->exp_list != NULL ) { From e990aab68b22c23593f6cd350055ca5b82c7dd2f Mon Sep 17 00:00:00 2001 From: Ge Wang Date: Sun, 12 Nov 2023 23:04:34 -0800 Subject: [PATCH 04/20] add type checker support for constructors --- src/core/chuck_absyn.cpp | 8 +- src/core/chuck_absyn.h | 12 ++- src/core/chuck_emit.cpp | 6 +- src/core/chuck_parse.cpp | 4 +- src/core/chuck_parse.h | 2 +- src/core/chuck_scan.cpp | 38 ++++++-- src/core/chuck_type.cpp | 184 ++++++++++++++++++++++++++++++++++----- src/core/chuck_type.h | 11 +++ 8 files changed, 227 insertions(+), 38 deletions(-) diff --git a/src/core/chuck_absyn.cpp b/src/core/chuck_absyn.cpp index f148b8ff3..1aad622fb 100644 --- a/src/core/chuck_absyn.cpp +++ b/src/core/chuck_absyn.cpp @@ -402,8 +402,8 @@ a_Exp new_exp_from_unary2( ae_Operator oper, a_Type_Decl type, a->s_meta = ae_meta_value; a->unary.op = oper; a->unary.type = type; - a->unary.ctor_invoked = ctor_invoked; - a->unary.ctor_args = ctor_args; + a->unary.ctor.invoked = ctor_invoked; + a->unary.ctor.args = ctor_args; a->unary.array = array; a->line = lineNum; a->where = posNum; a->unary.line = lineNum; a->unary.where = posNum; @@ -719,8 +719,8 @@ a_Var_Decl new_var_decl( c_constr xid, int ctor_invoked, a_Exp ctor_args, a_Arra { a_Var_Decl a = (a_Var_Decl)checked_malloc( sizeof( struct a_Var_Decl_ ) ); a->xid = insert_symbol(xid); - a->ctor_invoked = ctor_invoked; - a->ctor_args = ctor_args; + a->ctor.invoked = ctor_invoked; + a->ctor.args = ctor_args; a->array = array; a->line = lineNum; a->where = posNum; diff --git a/src/core/chuck_absyn.h b/src/core/chuck_absyn.h index 675c19123..a42e6e856 100644 --- a/src/core/chuck_absyn.h +++ b/src/core/chuck_absyn.h @@ -130,6 +130,7 @@ typedef struct a_Id_List_ * a_Id_List; typedef struct a_Class_Ext_ * a_Class_Ext; typedef struct a_Class_Body_ * a_Class_Body; typedef struct a_Array_Sub_ * a_Array_Sub; +typedef struct a_Ctor_Call_ * a_Ctor_Call; // 1.5.1.9 (ge) added typedef struct a_Complex_ * a_Complex; typedef struct a_Polar_ * a_Polar; typedef struct a_Vec_ * a_Vec; // ge: added 1.3.5.3 @@ -294,12 +295,17 @@ void delete_vec( a_Vec v ); +//------------------------------------------------------------------------------ +// helper structs +//------------------------------------------------------------------------------ +// 1.5.1.9 (ge) added constructor support +struct a_Ctor_Call_ { int invoked; a_Exp args; t_CKFUNC func; int primitive; }; //------------------------------------------------------------------------------ // abstract syntax tree | structs //------------------------------------------------------------------------------ struct a_Exp_Binary_ { a_Exp lhs; ae_Operator op; a_Exp rhs; t_CKFUNC ck_func; t_CKFUNC ck_overload_func; uint32_t line; uint32_t where; a_Exp self; }; struct a_Exp_Cast_ { a_Type_Decl type; a_Exp exp; uint32_t line; uint32_t where; a_Exp self; }; -struct a_Exp_Unary_ { ae_Operator op; a_Exp exp; a_Type_Decl type; int ctor_invoked; a_Exp ctor_args; a_Array_Sub array; +struct a_Exp_Unary_ { ae_Operator op; a_Exp exp; a_Type_Decl type; struct a_Ctor_Call_ ctor; a_Array_Sub array; a_Stmt code; t_CKFUNC ck_overload_func; uint32_t line; uint32_t where; a_Exp self; }; struct a_Exp_Postfix_ { a_Exp exp; ae_Operator op; t_CKFUNC ck_overload_func; uint32_t line; uint32_t where; a_Exp self; }; struct a_Exp_Dur_ { a_Exp base; a_Exp unit; uint32_t line; uint32_t where; a_Exp self; }; @@ -313,8 +319,8 @@ struct a_Exp_Decl_ { a_Type_Decl type; a_Var_Decl_List var_decl_list; int num_va struct a_Exp_Hack_ { a_Exp exp; uint32_t line; uint32_t where; a_Exp self; }; struct a_Var_Decl_List_ { a_Var_Decl var_decl; a_Var_Decl_List next; uint32_t line; uint32_t where; a_Exp self; }; // 1.4.2.0 (ge) added ck_type and ref, to handle multiple array decl (e.g., int x, y[], z[1];) -struct a_Var_Decl_ { S_Symbol xid; int ctor_invoked; a_Exp ctor_args; a_Array_Sub array; - t_CKVALUE value; void * addr; t_CKTYPE ck_type; +struct a_Var_Decl_ { S_Symbol xid; struct a_Ctor_Call_ ctor; + a_Array_Sub array; t_CKVALUE value; void * addr; t_CKTYPE ck_type; /* int is_auto; */ int ref; int force_ref; uint32_t line; uint32_t where; a_Exp self; }; struct a_Type_Decl_ { a_Id_List xid; a_Array_Sub array; int ref; uint32_t line; uint32_t where; /*a_Exp self;*/ }; diff --git a/src/core/chuck_emit.cpp b/src/core/chuck_emit.cpp index ac042d91b..cd5ba1eba 100644 --- a/src/core/chuck_emit.cpp +++ b/src/core/chuck_emit.cpp @@ -4831,7 +4831,7 @@ t_CKBOOL emit_engine_emit_exp_if( Chuck_Emitter * emit, a_Exp_If exp_if ) //----------------------------------------------------------------------------- // name: emit_engine_pre_constructor() -// desc: ... +// desc: emit instructions for type pre-constructor, for Object instantiation //----------------------------------------------------------------------------- t_CKBOOL emit_engine_pre_constructor( Chuck_Emitter * emit, Chuck_Type * type ) { @@ -4857,7 +4857,7 @@ t_CKBOOL emit_engine_pre_constructor( Chuck_Emitter * emit, Chuck_Type * type ) //----------------------------------------------------------------------------- // name: emit_engine_pre_constructor_array() -// desc: ... +// desc: emit instruction for pre-constructing an array of Objects //----------------------------------------------------------------------------- t_CKBOOL emit_engine_pre_constructor_array( Chuck_Emitter * emit, Chuck_Type * type ) { @@ -4934,7 +4934,7 @@ t_CKBOOL emit_engine_instantiate_object( Chuck_Emitter * emit, Chuck_Type * type //----------------------------------------------------------------------------- // name: emit_engine_emit_exp_decl() -// desc: ... +// desc: emit instruction for variable declaration expression //----------------------------------------------------------------------------- t_CKBOOL emit_engine_emit_exp_decl( Chuck_Emitter * emit, a_Exp_Decl decl, t_CKBOOL first_exp ) diff --git a/src/core/chuck_parse.cpp b/src/core/chuck_parse.cpp index 0e42805b7..2c4fcc74b 100644 --- a/src/core/chuck_parse.cpp +++ b/src/core/chuck_parse.cpp @@ -409,9 +409,9 @@ string absyn_stmt2str( a_Stmt stmt ) // name: absyn2str() // desc: convert abstract syntax exp to string //----------------------------------------------------------------------------- -string absyn2str( a_Exp exp ) +string absyn2str( a_Exp exp, t_CKBOOL appendSemicolon ) { - return absyn_exp2str( exp ) + ";"; + return absyn_exp2str( exp ) + (appendSemicolon ? ";" : "" ); } diff --git a/src/core/chuck_parse.h b/src/core/chuck_parse.h index 96a3d1f9d..227f1a537 100644 --- a/src/core/chuck_parse.h +++ b/src/core/chuck_parse.h @@ -70,7 +70,7 @@ void fd2parse_set( FILE * fd, t_CKBOOL autoClose ); // convert abstract syntax stmt to string std::string absyn2str( a_Stmt stmt ); // convert abstract syntax expression to string -std::string absyn2str( a_Exp exp ); +std::string absyn2str( a_Exp exp, t_CKBOOL appendSemicolon = TRUE ); // syntax highlighting tools #include diff --git a/src/core/chuck_scan.cpp b/src/core/chuck_scan.cpp index 2647a33b4..7aa84dedb 100644 --- a/src/core/chuck_scan.cpp +++ b/src/core/chuck_scan.cpp @@ -1201,10 +1201,10 @@ t_CKBOOL type_engine_scan1_exp_decl( Chuck_Env * env, a_Exp_Decl decl ) decl->num_var_decls++; // scan constructor args | 1.5.1.9 (ge) added - if( var_decl->ctor_args != NULL ) + if( var_decl->ctor.args != NULL ) { // type check the exp - if( !type_engine_scan1_exp( env, var_decl->ctor_args ) ) + if( !type_engine_scan1_exp( env, var_decl->ctor.args ) ) return FALSE; } @@ -1392,12 +1392,13 @@ t_CKBOOL type_engine_scan1_class_def( Chuck_Env * env, a_Class_Def class_def ) //----------------------------------------------------------------------------- // name: type_engine_scan1_func_def() -// desc: ... +// desc: type check scan pass 1 for function definition //----------------------------------------------------------------------------- t_CKBOOL type_engine_scan1_func_def( Chuck_Env * env, a_Func_Def f ) { a_Arg_List arg_list = NULL; t_CKUINT count = 0; + t_CKBOOL isInCtor = isctor(env,f); // check if reserved if( type_engine_check_reserved( env, f->name, f->where ) ) @@ -1419,6 +1420,18 @@ t_CKBOOL type_engine_scan1_func_def( Chuck_Env * env, a_Func_Def f ) // add reference | 1.5.0.5 CK_SAFE_ADD_REF( f->ret_type ); + // check if we are in a constructor + if( isInCtor ) + { + // check return type (must be void) + if( !isa(f->ret_type, env->ckt_void) ) + { + EM_error2( f->where, "constructor for class '%s' must return void", + S_name(f->name) ); + goto error; + } + } + // check if array if( f->type_decl->array != NULL ) { @@ -2368,10 +2381,10 @@ t_CKBOOL type_engine_scan2_exp_decl_create( Chuck_Env * env, a_Exp_Decl decl ) } // check for constructor args | 1.5.1.9 (ge) added - if( var_decl->ctor_args != NULL ) + if( var_decl->ctor.args != NULL ) { // type check the exp - if( !type_engine_scan2_exp( env, var_decl->ctor_args ) ) + if( !type_engine_scan2_exp( env, var_decl->ctor.args ) ) return FALSE; } @@ -2737,6 +2750,8 @@ t_CKBOOL type_engine_scan2_func_def( Chuck_Env * env, a_Func_Def f ) Chuck_Func * overfunc = NULL; // t_CKBOOL has_code = FALSE; // use this for both user and imported t_CKBOOL op_overload = ( f->op2overload != ae_op_none ); + // is in constructor? | 1.5.1.9 + t_CKBOOL isInCtor = isctor(env,f); // see if we are already in a function definition if( env->func != NULL ) @@ -2815,6 +2830,19 @@ t_CKBOOL type_engine_scan2_func_def( Chuck_Env * env, a_Func_Def f ) // set the function pointer func->code->native_func = (t_CKUINT)func->def()->dl_func_ptr; } + // constructor | 1.5.1.9 (ge) added + if( isInCtor ) + { + // set constructor flag + func->is_ctor = TRUE; + // check if default constructor + func->is_default_ctor = (f->arg_list == NULL); + // set in class as constructor; if not NULL, then a ctor is already set, and this is an overloading + if( env->class_def->ctors == NULL ) + { + CK_SAFE_REF_ASSIGN( env->class_def->ctors, func ); + } + } // make a new type for the function type = env->context->new_Chuck_Type( env ); diff --git a/src/core/chuck_type.cpp b/src/core/chuck_type.cpp index 5bcc67b22..347ea2803 100644 --- a/src/core/chuck_type.cpp +++ b/src/core/chuck_type.cpp @@ -99,9 +99,12 @@ t_CKBOOL type_engine_check_class_def( Chuck_Env * env, a_Class_Def class_def ); // helpers Chuck_Value * type_engine_check_const( Chuck_Env * env, a_Exp exp ); +// convert dot member expression to string for printing string type_engine_print_exp_dot_member( Chuck_Env * env, a_Exp_Dot_Member member ); -a_Func_Def make_dll_as_fun( Chuck_DL_Func * dl_fun, t_CKBOOL is_static, - t_CKBOOL is_base_primtive ); +// type check constructor invocation | 1.5.1.9 (ge) added +Chuck_Func * type_engine_check_ctor_call( Chuck_Env * env, Chuck_Type * type, a_Ctor_Call ctor, a_Array_Sub array, uint32_t where ); +// make an chuck dll function into absyn function +a_Func_Def make_dll_as_fun( Chuck_DL_Func * dl_fun, t_CKBOOL is_static, t_CKBOOL is_base_primtive ); // make a partial deep copy, to separate type systems from AST a_Func_Def partial_deep_copy_fn( a_Func_Def f ); a_Arg_List partial_deep_copy_args( a_Arg_List args ); @@ -3116,20 +3119,21 @@ t_CKTYPE type_engine_check_exp_unary( Chuck_Env * env, a_Exp_Unary unary ) } // constructors | 1.5.1.9 (ge) added - if( unary->ctor_invoked ) + if( unary->ctor.invoked ) { // type check any constructor args - if( unary->ctor_args ) + if( unary->ctor.args ) { // check the argument list - if( !type_engine_check_exp( env, unary->ctor_args ) ) + if( !type_engine_check_exp( env, unary->ctor.args ) ) return NULL; } - // -- must be an Object (with caveats for primitive types, later) - // -- must be able to find a constructor with matching args - // -- empty () is okay (will invoke default ctor if there is one) - // -- ctors are always incompatible with empty [] + // type check and get constructor function + unary->ctor.func = type_engine_check_ctor_call( env, t, &unary->ctor, unary->array, unary->where ); + // check for error + if( !unary->ctor.func ) + return NULL; } // [] @@ -4120,12 +4124,14 @@ t_CKTYPE type_engine_check_exp_decl_part2( Chuck_Env * env, a_Exp_Decl decl ) } // check for constructor args | 1.5.1.9 (ge) added - if( var_decl->ctor_args != NULL ) + // NOTE empty () is handled elsewhere as default constructor + if( var_decl->ctor.args != NULL ) { - // -- must be an Object (with caveats for primitive types, later) - // -- must be able to find a constructor with matching args - // -- empty () is okay (will invoke default ctor if there is one) - // -- ctors are always incompatible with empty [] + // type check and get constructor function + var_decl->ctor.func = type_engine_check_ctor_call( env, type, &var_decl->ctor, var_decl->array, var_decl->where ); + // check for error + if( !var_decl->ctor.func ) + return NULL; } // if array, then check to see if empty [] @@ -4337,7 +4343,7 @@ Chuck_Func * find_func_match_actual( Chuck_Env * env, Chuck_Func * up, a_Exp arg //----------------------------------------------------------------------------- // name: find_func_match() -// desc: ... +// desc: match a function by arguments //----------------------------------------------------------------------------- Chuck_Func * find_func_match( Chuck_Env * env, Chuck_Func * up, a_Exp args ) { @@ -4367,7 +4373,8 @@ Chuck_Func * find_func_match( Chuck_Env * env, Chuck_Func * up, a_Exp args ) //----------------------------------------------------------------------------- // name: type_engine_check_exp_func_call() -// desc: ... +// desc: type check function call +// (RELATED: type_engine_check_ctor_call()) //----------------------------------------------------------------------------- t_CKTYPE type_engine_check_exp_func_call( Chuck_Env * env, a_Exp exp_func, a_Exp args, t_CKFUNC & ck_func, int linepos ) @@ -5021,8 +5028,9 @@ t_CKBOOL type_engine_check_func_def( Chuck_Env * env, a_Func_Def f ) if( theOverride ) { // make reference to parent - // TODO: ref count theFunc->up = theOverride; + // ref count | 1.5.1.9 (ge) added + CK_SAFE_ADD_REF( theFunc->up ); } // make sure return type is not NULL @@ -5750,6 +5758,133 @@ Chuck_Value * type_engine_check_const( Chuck_Env * env, a_Exp exp ) +//----------------------------------------------------------------------------- +// name: type_engine_lookup_ctor() | 1.5.1.9 (ge) added +// desc: look up constructor by type and argument list +//----------------------------------------------------------------------------- +Chuck_Func * type_engine_lookup_ctor( Chuck_Env * env, Chuck_Type * type, a_Exp args ) +{ + return NULL; +} + + + +//----------------------------------------------------------------------------- +// name: type_engine_lookup_dtor() | 1.5.1.9 (ge) added +// desc: look up destructor by type +//----------------------------------------------------------------------------- +Chuck_Func * type_engine_lookup_dtor( Chuck_Env * env, Chuck_Type * type ) +{ + return NULL; +} + + + + +//----------------------------------------------------------------------------- +// name: type_engine_check_ctor_call() | 1.5.1.9 (ge) added +// desc: type check constructor invocation; also see func_call() +// (RELATED: type_engine_check_func_call()) +// +// -- must be an Object (with caveats for primitive types, later), but not an array +// -- empty () is okay (will invoke default ctor if there is one) +// -- ctors are always incompatible with empty [] +// -- must be able to find a constructor with matching args +//----------------------------------------------------------------------------- +Chuck_Func * type_engine_check_ctor_call( Chuck_Env * env, Chuck_Type * type, a_Ctor_Call ctorInfo, + a_Array_Sub array, uint32_t where ) +{ + // is an Object? + t_CKBOOL is_obj = isobj( env, type ); + // is an array + t_CKBOOL is_array = isa( type, env->ckt_array ); + + // constructors can only be called on Objects + // TODO: handle primitive constructors + if( !is_obj ) + { + // error message + EM_error2( where, "cannot invoke constructor on non-Object type '%s'...", type->c_name() ); + return NULL; + } + + // constructors currently not allowed on array types + // (NOTE but array creation with constructors is possible) + if( is_array ) + { + // error message + EM_error2( where, "cannot invoke constructor on array types..." ); + return NULL; + } + + // check for empty array [] + if( array && !array->exp_list ) + { + // error message + EM_error2( where, "cannot invoke constructor on empty array [] declarations...", type->c_name() ); + return NULL; + } + + // check the arguments + if( ctorInfo->args ) + { + if( !type_engine_check_exp( env, ctorInfo->args ) ) + return NULL; + } + + // convert arg list expression to string + string args2str = ""; + // for iterating through args + a_Exp a = ctorInfo->args; + // construct args type string + while( a ) + { + // append + args2str += a->type->name(); + // next + a = a->next; + // check + if( a ) args2str += ","; + } + + // locate the constructor by type name + Chuck_Func * funcGroup = type->ctors; + // verify + if( !funcGroup ) + { + // internal error! + EM_error2( where, "no constructors defined for '%s'...", type->c_name() ); + // bail out + return NULL; + } + + // look for a match + Chuck_Func * theCtor = find_func_match( env, funcGroup, ctorInfo->args ); + // no func + if( !theCtor ) + { + // print error + EM_error2( where, "no matching constructor found for %s(%s)...", type->c_name(), args2str.c_str() ); + // bail out + return NULL; + } + + // verify + if( !isa( theCtor->type(), env->ckt_void ) ) + { + // internal error! + EM_error2( where, "(internal error) non-void return value for constructor %s(%s)", type->c_name(), args2str.c_str() ); + // bail out + return NULL; + } + + // return the function + return theCtor; +} + + + + //----------------------------------------------------------------------------- // name: type_engine_check_primitive() // desc: ... @@ -5793,6 +5928,8 @@ te_KindOf getkindof( Chuck_Env * env, Chuck_Type * type ) // added 1.3.1.0 // done return kind; } +t_CKBOOL isctor( Chuck_Env * env, a_Func_Def func_def ) // 1.5.1.9 (ge) added for constructors +{ return (env->class_def && S_name(func_def->name)==env->class_def->name()); } @@ -8562,18 +8699,23 @@ Chuck_Func::~Chuck_Func() // delete our partial deep copy funcdef_cleanup(); - // release reference | 1.5.1.0 (ge) added + // release code | 1.5.1.0 (ge) added CK_SAFE_RELEASE( this->code ); + // release value ref CK_SAFE_RELEASE( this->value_ref ); - // release args cache | 1.5.1.5 + // delete args cache | 1.5.1.5 CK_SAFE_DELETE_ARRAY( this->args_cache ); this->args_cache_size = 0; // release invoker(s) | 1.5.1.5 CK_SAFE_DELETE( this->invoker_mfun ); + // release next | 1.5.1.9 + CK_SAFE_RELEASE( this->next ); + // release up | 1.5.1.9 + CK_SAFE_RELEASE( this->up ); - // TODO: check if more references to release, e.g., up and next? + // TODO: check if more references to release? } @@ -9038,6 +9180,7 @@ Chuck_Type::Chuck_Type( Chuck_Env * env, te_Type _id, const std::string & _n, ugen_info = NULL; is_complete = TRUE; has_pre_ctor = FALSE; + ctors = NULL; has_destructor = FALSE; allocator = NULL; @@ -9084,6 +9227,7 @@ void Chuck_Type::reset() // release references CK_SAFE_RELEASE( info ); CK_SAFE_RELEASE( owner ); + CK_SAFE_RELEASE( ctors ); // 1.5.1.9 (ge) added // TODO: uncomment this, fix it to behave correctly // TODO: make it safe to do this, as there are multiple instances of ->parent assignments without add-refs diff --git a/src/core/chuck_type.h b/src/core/chuck_type.h index 7f25047bd..580f9d6eb 100644 --- a/src/core/chuck_type.h +++ b/src/core/chuck_type.h @@ -949,6 +949,8 @@ struct Chuck_Type : public Chuck_Object t_CKBOOL is_complete; // has pre-constructor t_CKBOOL has_pre_ctor; + // constructor(s), potentially overloaded | 1.5.1.9 (ge) added + Chuck_Func * ctors; // has destructor t_CKBOOL has_destructor; // custom allocator @@ -1254,6 +1256,9 @@ t_CKBOOL isvoid( Chuck_Env * env, Chuck_Type * type ); t_CKBOOL isnull( Chuck_Env * env, Chuck_Type * type ); t_CKBOOL iskindofint( Chuck_Env * env, Chuck_Type * type ); // added 1.3.1.0: this includes int + pointers te_KindOf getkindof( Chuck_Env * env, Chuck_Type * type ); // added 1.3.1.0: to get the kindof a type +t_CKBOOL isctor( Chuck_Env * env, a_Func_Def func_def ); // 1.5.1.9 (ge) added for constructors + + //----------------------------------------------------------------------------- @@ -1335,6 +1340,12 @@ t_CKBOOL type_engine_init_op_overload( Chuck_Env * env ); t_CKBOOL type_engine_scan_func_op_overload( Chuck_Env * env, a_Func_Def func_def ); // type-check an operator overload func def | 1.5.1.5 (ge) added t_CKBOOL type_engine_check_func_op_overload( Chuck_Env * env, a_Func_Def func_def ); +// constructors | 1.5.1.9 (ge) added +Chuck_Func * type_engine_lookup_ctor( Chuck_Env * env, Chuck_Type * type, a_Exp args ); +// destructor | 1.5.1.9 (ge) added +Chuck_Func * type_engine_lookup_dtor( Chuck_Env * env, Chuck_Type * type ); + + From d86304e437e50f121386b59d2548fc3f19363fc7 Mon Sep 17 00:00:00 2001 From: Ge Wang Date: Mon, 13 Nov 2023 03:30:13 -0800 Subject: [PATCH 05/20] basic emit support for constructors --- src/core/chuck.cpp | 4 +- src/core/chuck_absyn.h | 2 +- src/core/chuck_emit.cpp | 100 +++++++++++++++++++++++++++++---------- src/core/chuck_instr.cpp | 83 +++++++++++++++++++++++++++++--- src/core/chuck_instr.h | 48 ++++++++++++++++++- src/core/chuck_parse.cpp | 6 +++ src/core/chuck_scan.cpp | 20 ++++++-- src/core/chuck_type.cpp | 24 +++++++--- src/core/chuck_type.h | 2 + 9 files changed, 243 insertions(+), 46 deletions(-) diff --git a/src/core/chuck.cpp b/src/core/chuck.cpp index 081d8fecf..4dd27c399 100644 --- a/src/core/chuck.cpp +++ b/src/core/chuck.cpp @@ -764,8 +764,8 @@ t_CKBOOL ChucK::initChugins() compiler()->env()->op_registry.preserve(); // get the code code = compiler()->output(); - // name it - TODO? - // code->name = string(argv[i]); + // name it | 1.5.1.9 (ge) + code->name = string("pre-load ck file: ") + filename; // spork it shred = vm()->spork( code, NULL, TRUE ); diff --git a/src/core/chuck_absyn.h b/src/core/chuck_absyn.h index a42e6e856..3d836f441 100644 --- a/src/core/chuck_absyn.h +++ b/src/core/chuck_absyn.h @@ -299,7 +299,7 @@ void delete_vec( a_Vec v ); // helper structs //------------------------------------------------------------------------------ // 1.5.1.9 (ge) added constructor support -struct a_Ctor_Call_ { int invoked; a_Exp args; t_CKFUNC func; int primitive; }; +struct a_Ctor_Call_ { int invoked; a_Exp args; int args_bytes; t_CKFUNC func; int primitive; }; //------------------------------------------------------------------------------ // abstract syntax tree | structs //------------------------------------------------------------------------------ diff --git a/src/core/chuck_emit.cpp b/src/core/chuck_emit.cpp index cd5ba1eba..843ba2806 100644 --- a/src/core/chuck_emit.cpp +++ b/src/core/chuck_emit.cpp @@ -95,9 +95,9 @@ t_CKBOOL emit_engine_emit_code_segment( Chuck_Emitter * emit, a_Stmt_Code stmt, t_CKBOOL push = TRUE ); t_CKBOOL emit_engine_emit_func_def( Chuck_Emitter * emit, a_Func_Def func_def ); t_CKBOOL emit_engine_emit_class_def( Chuck_Emitter * emit, a_Class_Def class_def ); -t_CKBOOL emit_engine_pre_constructor( Chuck_Emitter * emit, Chuck_Type * type ); +t_CKBOOL emit_engine_pre_constructor( Chuck_Emitter * emit, Chuck_Type * type, a_Ctor_Call ctor_info ); t_CKBOOL emit_engine_instantiate_object( Chuck_Emitter * emit, Chuck_Type * type, - a_Array_Sub array, t_CKBOOL is_ref, + a_Ctor_Call ctor_info, a_Array_Sub array, t_CKBOOL is_ref, t_CKBOOL is_array_ref ); t_CKBOOL emit_engine_emit_spork( Chuck_Emitter * emit, a_Exp_Func_Call exp ); t_CKBOOL emit_engine_emit_cast( Chuck_Emitter * emit, Chuck_Type * to, Chuck_Type * from ); @@ -201,7 +201,6 @@ Chuck_VM_Code * emit_engine_emit_prog( Chuck_Emitter * emit, a_Program prog, // keep track of full path (added 1.3.0.0) emit->code->filename = emit->context->full_path; // name the code - // emit->code->name = "(main)"; emit->code->name = emit->code->filename != "" ? mini(emit->code->filename.c_str()) : "[anonymous]"; // push global scope (added 1.3.0.0) emit->push_scope(); @@ -3629,7 +3628,7 @@ t_CKBOOL emit_engine_emit_exp_unary( Chuck_Emitter * emit, a_Exp_Unary unary ) // should always be false; can't 'new int[]'... t_CKBOOL is_array_ref = FALSE; // instantiate object, including array - if( !emit_engine_instantiate_object( emit, t, unary->array, unary->type->ref, is_array_ref ) ) + if( !emit_engine_instantiate_object( emit, t, &unary->ctor, unary->array, unary->type->ref, is_array_ref ) ) return FALSE; // the new needs to be addref, and released (later at the end of the stmt that contains this) | 1.5.1.8 @@ -4264,7 +4263,7 @@ t_CKBOOL emit_engine_emit_exp_func_call( Chuck_Emitter * emit, // translate to code emit->append( new Chuck_Instr_Func_To_Code ); - // emit->append( new Chuck_Instr_Reg_Push_Imm( (t_CKUINT)func->code ) ); + // emit->append( new Chuck_Instr_Reg_Push_Code( func->code ) ); // push the local stack depth - local variables emit->append( new Chuck_Instr_Reg_Push_Imm( emit->code->frame->curr_offset ) ); @@ -4566,7 +4565,7 @@ t_CKBOOL emit_engine_emit_exp_dot_member_special( Chuck_Emitter * emit, } else // normal object { - // dup the base pointer (as 'this' argument -- special case primitive) + // dup the base pointer ('this' pointer as argument -- special case primitive) emit->append( new Chuck_Instr_Reg_Dup_Last ); } @@ -4645,7 +4644,7 @@ t_CKBOOL emit_engine_emit_exp_dot_member( Chuck_Emitter * emit, { // emit the base (TODO: return on error?) emit_engine_emit_exp( emit, member->base ); - // dup the base pointer (as 'this' argument) + // dup the base pointer ('this' pointer as argument) emit->append( new Chuck_Instr_Reg_Dup_Last ); // find the offset for virtual table offset = func->vt_index; @@ -4833,11 +4832,14 @@ t_CKBOOL emit_engine_emit_exp_if( Chuck_Emitter * emit, a_Exp_If exp_if ) // name: emit_engine_pre_constructor() // desc: emit instructions for type pre-constructor, for Object instantiation //----------------------------------------------------------------------------- -t_CKBOOL emit_engine_pre_constructor( Chuck_Emitter * emit, Chuck_Type * type ) +t_CKBOOL emit_engine_pre_constructor( Chuck_Emitter * emit, Chuck_Type * type, a_Ctor_Call ctor_info ) { // parent first pre constructor if( type->parent != NULL ) - emit_engine_pre_constructor( emit, type->parent ); + { + // first emit parent pre and base constructor + emit_engine_pre_constructor( emit, type->parent, NULL ); + } // pre constructor if( type->has_pre_ctor ) @@ -4849,6 +4851,43 @@ t_CKBOOL emit_engine_pre_constructor( Chuck_Emitter * emit, Chuck_Type * type ) emit->code->frame->curr_offset ) ); } + // constructors + if( ctor_info && ctor_info->func ) // if named + { + // verify + if( !ctor_info->func->code ) + { + EM_error3( "(internal error) missing VM code for constructor '%s'", + ctor_info->func->signature(FALSE,FALSE).c_str() ); + return FALSE; + } + + // dup the base pointer ('this' pointer as argument) + emit->append( new Chuck_Instr_Reg_Dup_Last ); + // emit arguments + emit_engine_emit_exp( emit, ctor_info->args ); + // push code + emit->append( new Chuck_Instr_Reg_Push_Code( ctor_info->func->code ) ); + // push arguments size in bytes + this pointer + emit->append( new Chuck_Instr_Reg_Push_Imm( ctor_info->args_bytes + sz_VOIDPTR ) ); + // push offset + emit->append( new Chuck_Instr_Func_Call( CK_FUNC_CALL_THIS_IN_FRONT ) ); + } + else if( type->ctor_default ) // emit base constructor, if there is one + { + // verify + if( !type->ctor_default->code ) + { + EM_error3( "(internal error) missing VM code for base constructor '%s'", + type->ctor_default->signature(FALSE,FALSE).c_str() ); + return FALSE; + } + + // emit + emit->append( new Chuck_Instr_Pre_Constructor( type->ctor_default->code, + emit->code->frame->curr_offset ) ); + } + return TRUE; } @@ -4859,7 +4898,7 @@ t_CKBOOL emit_engine_pre_constructor( Chuck_Emitter * emit, Chuck_Type * type ) // name: emit_engine_pre_constructor_array() // desc: emit instruction for pre-constructing an array of Objects //----------------------------------------------------------------------------- -t_CKBOOL emit_engine_pre_constructor_array( Chuck_Emitter * emit, Chuck_Type * type ) +t_CKBOOL emit_engine_pre_constructor_array( Chuck_Emitter * emit, Chuck_Type * type, a_Ctor_Call ctor_info ) { // alloc should have put all objects to made in linear list, on stack Chuck_Instr_Pre_Ctor_Array_Top * top = NULL; @@ -4869,7 +4908,7 @@ t_CKBOOL emit_engine_pre_constructor_array( Chuck_Emitter * emit, Chuck_Type * t // append first part of pre ctor emit->append( top = new Chuck_Instr_Pre_Ctor_Array_Top( type ) ); // call pre constructor - emit_engine_pre_constructor( emit, type ); + emit_engine_pre_constructor( emit, type, ctor_info ); // append second part of the pre ctor emit->append( bottom = new Chuck_Instr_Pre_Ctor_Array_Bottom ); // set the goto of the first one @@ -4889,7 +4928,7 @@ t_CKBOOL emit_engine_pre_constructor_array( Chuck_Emitter * emit, Chuck_Type * t // desc: emit instructions for instantiating object //----------------------------------------------------------------------------- t_CKBOOL emit_engine_instantiate_object( Chuck_Emitter * emit, Chuck_Type * type, - a_Array_Sub array, t_CKBOOL is_ref, + a_Ctor_Call ctor_info, a_Array_Sub array, t_CKBOOL is_ref, t_CKBOOL is_array_ref ) { // if array @@ -4913,7 +4952,7 @@ t_CKBOOL emit_engine_instantiate_object( Chuck_Emitter * emit, Chuck_Type * type if( isobj( emit->env, type->array_type ) && !is_ref ) { // call pre constructor for objects in array | TODO verify multi-dim array - emit_engine_pre_constructor_array( emit, type->array_type ); + emit_engine_pre_constructor_array( emit, type->array_type, ctor_info ); } } } @@ -4923,7 +4962,7 @@ t_CKBOOL emit_engine_instantiate_object( Chuck_Emitter * emit, Chuck_Type * type emit->append( new Chuck_Instr_Instantiate_Object( type ) ); // call pre constructor - emit_engine_pre_constructor( emit, type ); + emit_engine_pre_constructor( emit, type, ctor_info ); } return TRUE; @@ -5075,7 +5114,7 @@ t_CKBOOL emit_engine_emit_exp_decl( Chuck_Emitter * emit, a_Exp_Decl decl, // set is_init = TRUE; // instantiate object, including array - if( !emit_engine_instantiate_object( emit, type, var_decl->array, is_ref, is_array_ref ) ) + if( !emit_engine_instantiate_object( emit, type, &var_decl->ctor, var_decl->array, is_ref, is_array_ref ) ) return FALSE; } } @@ -5115,7 +5154,7 @@ t_CKBOOL emit_engine_emit_exp_decl( Chuck_Emitter * emit, a_Exp_Decl decl, // set is_init = TRUE; // instantiate object (not array) - if( !emit_engine_instantiate_object( emit, type, var_decl->array, is_ref, FALSE ) ) + if( !emit_engine_instantiate_object( emit, type, &var_decl->ctor, var_decl->array, is_ref, FALSE ) ) return FALSE; } } @@ -5387,7 +5426,7 @@ t_CKBOOL emit_engine_emit_code_segment( Chuck_Emitter * emit, //----------------------------------------------------------------------------- // name: emit_engine_emit_func_def() -// desc: ... +// desc: emit VM instructions for a function definition //----------------------------------------------------------------------------- t_CKBOOL emit_engine_emit_func_def( Chuck_Emitter * emit, a_Func_Def func_def ) { @@ -5410,12 +5449,24 @@ t_CKBOOL emit_engine_emit_func_def( Chuck_Emitter * emit, a_Func_Def func_def ) // return FALSE; //} + // make sure code is good to go | 1.5.1.9 + // NOTE now func->code is allocated earlier in scan2_func_def(), this allows + // the code reference to be available for emission potentially before its + // contents are emitted + if( func->code == NULL ) + { + EM_error2( func_def->where, + "(emit): internal error: function '%s' missing code shuttle...", + func->signature(FALSE,FALSE).c_str() ); + return FALSE; + } + // make sure the code is empty - if( func->code != NULL ) + if( func->code->num_instr ) // updated logic 1.5.1.9 was: if( func->code != NULL ) { EM_error2( func_def->where, - "(emit): function '%s' already emitted...", - S_name(func_def->name) ); + "(emit): internal error: function '%s' already emitted...", + func->signature(FALSE,FALSE).c_str() ); return FALSE; } @@ -5446,7 +5497,7 @@ t_CKBOOL emit_engine_emit_func_def( Chuck_Emitter * emit, a_Func_Def func_def ) // make a new one emit->code = new Chuck_Code; // name the code | 1.5.1.5 use signature() - emit->code->name += func->signature(); + emit->code->name += func->signature(FALSE,FALSE); // name the code (older code) // emit->code->name = emit->env->class_def ? emit->env->class_def->base_name + "." : ""; // emit->code->name += func->name + "(...)"; @@ -5565,10 +5616,9 @@ t_CKBOOL emit_engine_emit_func_def( Chuck_Emitter * emit, a_Func_Def func_def ) // emit return statement emit->append( new Chuck_Instr_Func_Return ); - // vm code - func->code = emit_to_code( emit->code, NULL, emit->dump ); - // add reference - CK_SAFE_ADD_REF( func->code ); + // vm code | 1.5.1.9 (ge) updated to pass in existing func->code + if( !emit_to_code( emit->code, func->code, emit->dump ) ) + return FALSE; // unset the func emit->env->func = NULL; diff --git a/src/core/chuck_instr.cpp b/src/core/chuck_instr.cpp index 5cff8846a..7d7abcdae 100644 --- a/src/core/chuck_instr.cpp +++ b/src/core/chuck_instr.cpp @@ -2304,6 +2304,35 @@ void Chuck_Instr_Reg_Push_Imm4::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) +//----------------------------------------------------------------------------- +// name: execute() +// desc: push Chuck_VM_Code * onto register stack +//----------------------------------------------------------------------------- +void Chuck_Instr_Reg_Push_Code::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) +{ + t_CKUINT *& reg_sp = (t_CKUINT *&)shred->reg->sp; + + // push val into reg stack + push_( reg_sp, (t_CKUINT)m_code ); +} + + + + +//----------------------------------------------------------------------------- +// name: params() +// desc: params for printing +//----------------------------------------------------------------------------- +const char * Chuck_Instr_Reg_Push_Code::params() const +{ + static char buffer[CK_PRINT_BUF_LENGTH]; + snprintf( buffer, CK_PRINT_BUF_LENGTH, "'%s'", m_code ? m_code->name.c_str() : "[null]" ); + return buffer; +} + + + + //----------------------------------------------------------------------------- // name: execute() // desc: ... @@ -4033,7 +4062,8 @@ void Chuck_Instr_Alloc_Member_Vec4::execute( Chuck_VM * vm, Chuck_VM_Shred * shr -inline void call_pre_constructor( Chuck_VM * vm, Chuck_VM_Shred * shred, +// function prototype +void call_pre_constructor( Chuck_VM * vm, Chuck_VM_Shred * shred, Chuck_VM_Code * pre_ctor, t_CKUINT stack_offset ); //----------------------------------------------------------------------------- // name: call_all_parent_pre_constructors() @@ -4181,7 +4211,7 @@ static Chuck_Instr_Func_Call g_func_call; static Chuck_Instr_Func_Call_Member g_func_call_member( 0, NULL ); //----------------------------------------------------------------------------- // name: call_pre_constructor() -// desc: ... +// desc: invoke class pre-constructor code //----------------------------------------------------------------------------- inline void call_pre_constructor( Chuck_VM * vm, Chuck_VM_Shred * shred, Chuck_VM_Code * pre_ctor, t_CKUINT stack_offset ) @@ -4224,6 +4254,20 @@ void Chuck_Instr_Pre_Constructor::execute( Chuck_VM * vm, Chuck_VM_Shred * shred +//----------------------------------------------------------------------------- +// name: params() +// desc: params for printing +//----------------------------------------------------------------------------- +const char * Chuck_Instr_Pre_Constructor::params() const +{ + static char buffer[CK_PRINT_BUF_LENGTH]; + snprintf( buffer, CK_PRINT_BUF_LENGTH, "ctor='%s', offset=%lu", pre_ctor ? pre_ctor->name.c_str() : "[null]", stack_offset ); + return buffer; +} + + + + //----------------------------------------------------------------------------- // name: instantiate_object() // desc: instantiate Object including data and virtual table @@ -5049,6 +5093,19 @@ t_CKBOOL func_release_args( Chuck_VM * vm, a_Arg_List args, t_CKBYTE * mem_sp ) +//----------------------------------------------------------------------------- +// for printing +//----------------------------------------------------------------------------- +const char * Chuck_Instr_Func_Call::params() const +{ + static char buffer[CK_PRINT_BUF_LENGTH]; + snprintf( buffer, CK_PRINT_BUF_LENGTH, "convention='%s'", m_arg_convention == CK_FUNC_CALL_THIS_IN_BACK ? "this:back" : "this:front" ); + return buffer; +} + + + + //----------------------------------------------------------------------------- // name: execute() // desc: ... @@ -5107,16 +5164,30 @@ void Chuck_Instr_Func_Call::execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) // need this if( func->need_this ) { - // copy this from end of arguments to the front - *mem_sp2++ = *(reg_sp2 + stack_depth_ints - 1); + // check convention | 1.5.1.9 (ge) added + if( m_arg_convention == CK_FUNC_CALL_THIS_IN_BACK ) + { + // copy this from end of arguments to the front + *mem_sp2++ = *(reg_sp2 + stack_depth_ints - 1); + } else { + // copy this from start of arguments + *mem_sp2++ = *reg_sp2++; + } // one less word to copy stack_depth_ints--; } // static inside class | 1.4.1.0 (ge) added else if( func->is_static ) { - // copy type from end of arguments to the front - *mem_sp2++ = *(reg_sp2 + stack_depth_ints - 1); + // check convention | 1.5.1.9 (ge) added + if( m_arg_convention == CK_FUNC_CALL_THIS_IN_BACK ) + { + // copy type from end of arguments to the front + *mem_sp2++ = *(reg_sp2 + stack_depth_ints - 1); + } else { + // copy type from start of arguments + *mem_sp2++ = *reg_sp2++; + } // one less word to copy stack_depth_ints--; } diff --git a/src/core/chuck_instr.h b/src/core/chuck_instr.h index 77556cb63..7f995b8e0 100644 --- a/src/core/chuck_instr.h +++ b/src/core/chuck_instr.h @@ -2213,6 +2213,29 @@ struct Chuck_Instr_Reg_Push_Imm4 : public Chuck_Instr_Unary_Op2 +//----------------------------------------------------------------------------- +// name: struct Chuck_Instr_Reg_Push_Code | 1.5.1.9 (ge) added +// desc: push Chuck_VM_Code * onto register stack +//----------------------------------------------------------------------------- +struct Chuck_Instr_Reg_Push_Code : public Chuck_Instr +{ +public: + virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); + +public: + // constructor + Chuck_Instr_Reg_Push_Code( Chuck_VM_Code * code ) : m_code(code) { } + // for printing + const char * params() const; + +public: + // code to push + Chuck_VM_Code * m_code; +}; + + + + //----------------------------------------------------------------------------- // name: struct Chuck_Instr_Reg_Push_Zero // desc: push immediate value 0 to reg stack with specific width @@ -2949,7 +2972,7 @@ struct Chuck_Instr_Pre_Constructor : public Chuck_Instr { pre_ctor = pre; this->stack_offset = offset; } virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); - // virtual const char * params() const; + virtual const char * params() const; public: Chuck_VM_Code * pre_ctor; @@ -3262,6 +3285,17 @@ struct Chuck_Instr_Func_To_Code : public Chuck_Instr +//----------------------------------------------------------------------------- +// name: enum ck_Func_Call_Arg_Convention | 1.5.1.9 +// desc: where to find this/type pointers in argument block +//----------------------------------------------------------------------------- +enum ck_Func_Call_Arg_Convention +{ + // 'this' (member) or 'type' (static) found in the back of arguments block + CK_FUNC_CALL_THIS_IN_BACK, + // 'this' (member) or 'type' (static) found in the back of arguments block + CK_FUNC_CALL_THIS_IN_FRONT +}; //----------------------------------------------------------------------------- // name: struct Chuck_Instr_Func_Call // desc: user-defined function call @@ -3269,7 +3303,19 @@ struct Chuck_Instr_Func_To_Code : public Chuck_Instr struct Chuck_Instr_Func_Call : public Chuck_Instr { public: + // for carrying out instruction virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); + // for printing + virtual const char * params() const; + +public: + // constructor + Chuck_Instr_Func_Call( ck_Func_Call_Arg_Convention arg_convention = CK_FUNC_CALL_THIS_IN_BACK ) + : m_arg_convention(arg_convention) { } + + // when applicable, this flag indicates whether this/type is at the + // beginning or at the end of the argument block on the reg stack + ck_Func_Call_Arg_Convention m_arg_convention; }; diff --git a/src/core/chuck_parse.cpp b/src/core/chuck_parse.cpp index 2c4fcc74b..b5fe4cb64 100644 --- a/src/core/chuck_parse.cpp +++ b/src/core/chuck_parse.cpp @@ -599,6 +599,7 @@ string absyn_unary2str( a_Exp_Unary unary ) { case ae_op_new: s = absyn_op2str(unary->op) + " " + unary->self->type->name(); + if( unary->ctor.invoked ) s += "(" + absyn_exp2str(unary->ctor.args) + ")"; break; default: s = absyn_op2str(unary->op) + " " + absyn_exp2str(unary->exp); @@ -773,6 +774,11 @@ string absyn_decl2str( a_Exp_Decl decl ) { // type str += list->var_decl->value->type->base_name + " " + (decl->type->ref ? "@ " : "") + list->var_decl->value->name; + // constructor? + if( list->var_decl->ctor.invoked ) + { + str += "(" + absyn_exp2str(list->var_decl->ctor.args) + ")"; + } // array? if( list->var_decl->array ) { diff --git a/src/core/chuck_scan.cpp b/src/core/chuck_scan.cpp index 7aa84dedb..00a69f91b 100644 --- a/src/core/chuck_scan.cpp +++ b/src/core/chuck_scan.cpp @@ -279,6 +279,8 @@ t_CKBOOL type_engine_scan0_class_def( Chuck_Env * env, a_Class_Def class_def ) // add code the_class->info->pre_ctor = new Chuck_VM_Code; CK_SAFE_ADD_REF( the_class->info->pre_ctor ); + // name | 1.5.1.9 (ge) added + the_class->info->pre_ctor->name = string("class ") + the_class->base_name; // add to env env->curr->type.add( the_class->base_name, the_class ); // URGENT: make this global // incomplete @@ -2818,11 +2820,15 @@ t_CKBOOL type_engine_scan2_func_def( Chuck_Env * env, a_Func_Def f ) // note whether the function is marked as static (in class) func->is_static = (f->static_decl == ae_key_static) && (env->class_def != NULL); + + // always create the code (will be filled in later on, depending on builtin vs in-language etc.) + // 1.5.1.9 (ge) moved up from ae_func_builtin + func->code = new Chuck_VM_Code; + // add reference + CK_SAFE_ADD_REF( func->code ); // copy the native code, for imported functions if( f->s_type == ae_func_builtin ) { - // we can emit code now - func->code = new Chuck_VM_Code; func->code->add_ref(); // whether the function needs 'this' func->code->need_this = func->is_member; // is static inside @@ -2830,18 +2836,24 @@ t_CKBOOL type_engine_scan2_func_def( Chuck_Env * env, a_Func_Def f ) // set the function pointer func->code->native_func = (t_CKUINT)func->def()->dl_func_ptr; } + // constructor | 1.5.1.9 (ge) added if( isInCtor ) { // set constructor flag func->is_ctor = TRUE; - // check if default constructor - func->is_default_ctor = (f->arg_list == NULL); // set in class as constructor; if not NULL, then a ctor is already set, and this is an overloading if( env->class_def->ctors == NULL ) { CK_SAFE_REF_ASSIGN( env->class_def->ctors, func ); } + // check if default constructor + func->is_default_ctor = (f->arg_list == NULL); + // if no arguments, then set as base constructor + if( func->is_default_ctor ) + { + CK_SAFE_REF_ASSIGN( env->class_def->ctor_default, func ); + } } // make a new type for the function diff --git a/src/core/chuck_type.cpp b/src/core/chuck_type.cpp index 347ea2803..3c2f58ec2 100644 --- a/src/core/chuck_type.cpp +++ b/src/core/chuck_type.cpp @@ -3127,13 +3127,13 @@ t_CKTYPE type_engine_check_exp_unary( Chuck_Env * env, a_Exp_Unary unary ) // check the argument list if( !type_engine_check_exp( env, unary->ctor.args ) ) return NULL; - } - // type check and get constructor function - unary->ctor.func = type_engine_check_ctor_call( env, t, &unary->ctor, unary->array, unary->where ); - // check for error - if( !unary->ctor.func ) - return NULL; + // type check and get constructor function + unary->ctor.func = type_engine_check_ctor_call( env, t, &unary->ctor, unary->array, unary->where ); + // check for error + if( !unary->ctor.func ) + return NULL; + } } // [] @@ -5836,9 +5836,13 @@ Chuck_Func * type_engine_check_ctor_call( Chuck_Env * env, Chuck_Type * type, a_ string args2str = ""; // for iterating through args a_Exp a = ctorInfo->args; - // construct args type string + // zero out + ctorInfo->args_bytes = 0; + // count args size + construct args type string while( a ) { + // accumulate size + ctorInfo->args_bytes += a->type->size; // append args2str += a->type->name(); // next @@ -6395,6 +6399,8 @@ Chuck_Type * type_engine_import_class_begin( Chuck_Env * env, Chuck_Type * type, type->info->pre_ctor->need_this = TRUE; // no arguments to preconstructor other than self type->info->pre_ctor->stack_depth = sizeof(t_CKUINT); + // add name | 1.5.1.9 (ge) added + type->info->pre_ctor->name = string("class ") + type->base_name; } // if destructor @@ -6412,6 +6418,8 @@ Chuck_Type * type_engine_import_class_begin( Chuck_Env * env, Chuck_Type * type, type->info->dtor->need_this = TRUE; // no arguments to destructor other than self type->info->dtor->stack_depth = sizeof(t_CKUINT); + // add name | 1.5.1.9 (ge) added + type->info->dtor->name = string("class ") + type->base_name + string(" (destructor)"); } // clear the object size @@ -9181,6 +9189,7 @@ Chuck_Type::Chuck_Type( Chuck_Env * env, te_Type _id, const std::string & _n, is_complete = TRUE; has_pre_ctor = FALSE; ctors = NULL; + ctor_default = NULL; has_destructor = FALSE; allocator = NULL; @@ -9228,6 +9237,7 @@ void Chuck_Type::reset() CK_SAFE_RELEASE( info ); CK_SAFE_RELEASE( owner ); CK_SAFE_RELEASE( ctors ); // 1.5.1.9 (ge) added + CK_SAFE_RELEASE( ctor_default ); // 1.5.1.9 (ge) added // TODO: uncomment this, fix it to behave correctly // TODO: make it safe to do this, as there are multiple instances of ->parent assignments without add-refs diff --git a/src/core/chuck_type.h b/src/core/chuck_type.h index 580f9d6eb..92e8de166 100644 --- a/src/core/chuck_type.h +++ b/src/core/chuck_type.h @@ -951,6 +951,8 @@ struct Chuck_Type : public Chuck_Object t_CKBOOL has_pre_ctor; // constructor(s), potentially overloaded | 1.5.1.9 (ge) added Chuck_Func * ctors; + // default constructor (no arguments) | 1.5.1.9 (ge) added + Chuck_Func * ctor_default; // has destructor t_CKBOOL has_destructor; // custom allocator From 6c34db1ecb392e828692576f5f77837235829a1e Mon Sep 17 00:00:00 2001 From: Ge Wang Date: Mon, 13 Nov 2023 21:23:26 -0800 Subject: [PATCH 06/20] add support for constructors within array decl --- src/core/chuck_type.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/core/chuck_type.cpp b/src/core/chuck_type.cpp index 3c2f58ec2..515438fa6 100644 --- a/src/core/chuck_type.cpp +++ b/src/core/chuck_type.cpp @@ -5798,30 +5798,32 @@ Chuck_Func * type_engine_check_ctor_call( Chuck_Env * env, Chuck_Type * type, a_ t_CKBOOL is_obj = isobj( env, type ); // is an array t_CKBOOL is_array = isa( type, env->ckt_array ); + // the array type + Chuck_Type * actualType = is_array ? type->array_type : type; // constructors can only be called on Objects // TODO: handle primitive constructors if( !is_obj ) { // error message - EM_error2( where, "cannot invoke constructor on non-Object type '%s'...", type->c_name() ); + EM_error2( where, "cannot invoke constructor on non-Object type '%s'...", actualType->c_name() ); return NULL; } // constructors currently not allowed on array types // (NOTE but array creation with constructors is possible) - if( is_array ) - { - // error message - EM_error2( where, "cannot invoke constructor on array types..." ); - return NULL; - } +// if( is_array ) +// { +// // error message +// EM_error2( where, "cannot invoke constructor on array types..." ); +// return NULL; +// } // check for empty array [] if( array && !array->exp_list ) { // error message - EM_error2( where, "cannot invoke constructor on empty array [] declarations...", type->c_name() ); + EM_error2( where, "cannot invoke constructor on empty array [] declarations...", actualType->c_name() ); return NULL; } @@ -5852,12 +5854,12 @@ Chuck_Func * type_engine_check_ctor_call( Chuck_Env * env, Chuck_Type * type, a_ } // locate the constructor by type name - Chuck_Func * funcGroup = type->ctors; + Chuck_Func * funcGroup = actualType->ctors; // verify if( !funcGroup ) { // internal error! - EM_error2( where, "no constructors defined for '%s'...", type->c_name() ); + EM_error2( where, "no constructors defined for '%s'...", actualType->c_name() ); // bail out return NULL; } @@ -5868,7 +5870,7 @@ Chuck_Func * type_engine_check_ctor_call( Chuck_Env * env, Chuck_Type * type, a_ if( !theCtor ) { // print error - EM_error2( where, "no matching constructor found for %s(%s)...", type->c_name(), args2str.c_str() ); + EM_error2( where, "no matching constructor found for %s(%s)...", actualType->c_name(), args2str.c_str() ); // bail out return NULL; } @@ -5877,7 +5879,7 @@ Chuck_Func * type_engine_check_ctor_call( Chuck_Env * env, Chuck_Type * type, a_ if( !isa( theCtor->type(), env->ckt_void ) ) { // internal error! - EM_error2( where, "(internal error) non-void return value for constructor %s(%s)", type->c_name(), args2str.c_str() ); + EM_error2( where, "(internal error) non-void return value for constructor %s(%s)", actualType->c_name(), args2str.c_str() ); // bail out return NULL; } From 44557dfb33407d6bdef012e78995aa9d071900ae Mon Sep 17 00:00:00 2001 From: Ge Wang Date: Tue, 14 Nov 2023 00:45:33 -0800 Subject: [PATCH 07/20] fix local frame offset for ctors; add example and tests --- examples/class/constructors.ck | 51 ++++++++++++++++++++++++++++++++++ src/core/chuck_absyn.h | 2 +- src/core/chuck_emit.cpp | 4 +-- src/core/chuck_type.cpp | 18 +++++------- 4 files changed, 61 insertions(+), 14 deletions(-) create mode 100644 examples/class/constructors.ck diff --git a/examples/class/constructors.ck b/examples/class/constructors.ck new file mode 100644 index 000000000..eebb571f2 --- /dev/null +++ b/examples/class/constructors.ck @@ -0,0 +1,51 @@ +// specifying and overloading class constructors +// requires chuck-1.5.2.0 or higher + +// a class +class Foo +{ + // a member variable (this will be initialized before + // any actual constructors, as Foo's "pre-constructor") + 1 => int num; + + // constructor 1 "default" + fun void Foo() + { + 13 => num; // set num to something + <<< "constructor 1:", num >>>; + } + + // constructor 2 + fun void Foo( int x ) + { + x => num; + <<< "constructor 2:", x >>>; + } + + // constructor 3 + fun void Foo( int x, int y ) + { + x*y => num; + <<< "constructor 3:", x, y >>>; + } +} + +// declare a Foo, invoke constructor 1 +Foo f1(); +// declare a Foo, invoke constructor 2 +Foo f2(15); +// instantiate a Foo, invoke constructor 3 +new Foo(8,9) @=> Foo @ f3; + +// print +<<< f1.num, f2.num, f3.num >>>; + +// can also invoke constructor for each element in array +Foo array1(2)[3]; +// print each element's num +for( auto f : array1 ) <<< f.num, "" >>>; + +// instantiate an array of Foo, invoking constructor for each +new Foo(6,5)[4] @=> Foo array2[]; +// print each element's num +for( auto f : array2 ) <<< f.num, "" >>>; diff --git a/src/core/chuck_absyn.h b/src/core/chuck_absyn.h index 3d836f441..a42e6e856 100644 --- a/src/core/chuck_absyn.h +++ b/src/core/chuck_absyn.h @@ -299,7 +299,7 @@ void delete_vec( a_Vec v ); // helper structs //------------------------------------------------------------------------------ // 1.5.1.9 (ge) added constructor support -struct a_Ctor_Call_ { int invoked; a_Exp args; int args_bytes; t_CKFUNC func; int primitive; }; +struct a_Ctor_Call_ { int invoked; a_Exp args; t_CKFUNC func; int primitive; }; //------------------------------------------------------------------------------ // abstract syntax tree | structs //------------------------------------------------------------------------------ diff --git a/src/core/chuck_emit.cpp b/src/core/chuck_emit.cpp index 843ba2806..e3cccf3e7 100644 --- a/src/core/chuck_emit.cpp +++ b/src/core/chuck_emit.cpp @@ -4868,8 +4868,8 @@ t_CKBOOL emit_engine_pre_constructor( Chuck_Emitter * emit, Chuck_Type * type, a emit_engine_emit_exp( emit, ctor_info->args ); // push code emit->append( new Chuck_Instr_Reg_Push_Code( ctor_info->func->code ) ); - // push arguments size in bytes + this pointer - emit->append( new Chuck_Instr_Reg_Push_Imm( ctor_info->args_bytes + sz_VOIDPTR ) ); + // push local stack depth corresponding to local variables + emit->append( new Chuck_Instr_Reg_Push_Imm( emit->code->frame->curr_offset ) ); // push offset emit->append( new Chuck_Instr_Func_Call( CK_FUNC_CALL_THIS_IN_FRONT ) ); } diff --git a/src/core/chuck_type.cpp b/src/core/chuck_type.cpp index 515438fa6..c499d795e 100644 --- a/src/core/chuck_type.cpp +++ b/src/core/chuck_type.cpp @@ -5812,12 +5812,12 @@ Chuck_Func * type_engine_check_ctor_call( Chuck_Env * env, Chuck_Type * type, a_ // constructors currently not allowed on array types // (NOTE but array creation with constructors is possible) -// if( is_array ) -// { -// // error message -// EM_error2( where, "cannot invoke constructor on array types..." ); -// return NULL; -// } + if( isa(actualType, env->ckt_array) ) + { + // error message + EM_error2( where, "cannot invoke constructor on array types '%s'..." , actualType->c_name() ); + return NULL; + } // check for empty array [] if( array && !array->exp_list ) @@ -5838,13 +5838,9 @@ Chuck_Func * type_engine_check_ctor_call( Chuck_Env * env, Chuck_Type * type, a_ string args2str = ""; // for iterating through args a_Exp a = ctorInfo->args; - // zero out - ctorInfo->args_bytes = 0; - // count args size + construct args type string + // construct args type string while( a ) { - // accumulate size - ctorInfo->args_bytes += a->type->size; // append args2str += a->type->name(); // next From 926bef2e2d48b6c235fa292ff559564345614985 Mon Sep 17 00:00:00 2001 From: Ge Wang Date: Tue, 14 Nov 2023 01:50:22 -0800 Subject: [PATCH 08/20] circumvent windows snprintf warning; provisions for optional 'void' fun return type --- examples/oper/oper_post_inc.ck | 11 ++++++----- src/core/chuck_absyn.cpp | 3 ++- src/core/chuck_instr.cpp | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/examples/oper/oper_post_inc.ck b/examples/oper/oper_post_inc.ck index 7114bc876..47b74103a 100644 --- a/examples/oper/oper_post_inc.ck +++ b/examples/oper/oper_post_inc.ck @@ -1,9 +1,10 @@ -// i++ - doesn't fully work yet (1.2.0.1) +// post increment operator +// starting value 4 => int i; +// assign, then increment i i++ => int j; -<<<"printing i, then j">>>; -<<>>; -<<>>; -if ( i == 5 && j == 4) <<<"success">>>; +// print (i should be 1 higher than j) +<<< i >>>; +<<< j >>>; diff --git a/src/core/chuck_absyn.cpp b/src/core/chuck_absyn.cpp index 1aad622fb..47af845ee 100644 --- a/src/core/chuck_absyn.cpp +++ b/src/core/chuck_absyn.cpp @@ -795,7 +795,8 @@ a_Func_Def new_func_def( ae_Keyword func_decl, ae_Keyword static_decl, sizeof( struct a_Func_Def_ ) ); a->func_decl = func_decl; a->static_decl = static_decl; - a->type_decl = type_decl; + // substitute if NULL | 1.5.1.9 (ge) for constructors + a->type_decl = type_decl ? type_decl : new_type_decl(new_id_list("void",0,0),0,0,0); a->name = insert_symbol( name ); a->arg_list = arg_list; a->s_type = ae_func_user; diff --git a/src/core/chuck_instr.cpp b/src/core/chuck_instr.cpp index 7d7abcdae..ec48d9b09 100644 --- a/src/core/chuck_instr.cpp +++ b/src/core/chuck_instr.cpp @@ -4261,7 +4261,7 @@ void Chuck_Instr_Pre_Constructor::execute( Chuck_VM * vm, Chuck_VM_Shred * shred const char * Chuck_Instr_Pre_Constructor::params() const { static char buffer[CK_PRINT_BUF_LENGTH]; - snprintf( buffer, CK_PRINT_BUF_LENGTH, "ctor='%s', offset=%lu", pre_ctor ? pre_ctor->name.c_str() : "[null]", stack_offset ); + snprintf( buffer, CK_PRINT_BUF_LENGTH, "ctor='%s', offset=%lu", pre_ctor ? pre_ctor->name.c_str() : "[null]", (unsigned long)stack_offset ); return buffer; } From 61ed89f0a2a82685c0e7c5aa2920a61e975446db Mon Sep 17 00:00:00 2001 From: Ge Wang Date: Tue, 14 Nov 2023 01:55:52 -0800 Subject: [PATCH 09/20] add error checking for global non-default ctors --- src/core/chuck_scan.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/chuck_scan.cpp b/src/core/chuck_scan.cpp index 00a69f91b..c37c9a631 100644 --- a/src/core/chuck_scan.cpp +++ b/src/core/chuck_scan.cpp @@ -1205,6 +1205,13 @@ t_CKBOOL type_engine_scan1_exp_decl( Chuck_Env * env, a_Exp_Decl decl ) // scan constructor args | 1.5.1.9 (ge) added if( var_decl->ctor.args != NULL ) { + // disallow non-default constructors for 'global' Object decls + if( decl->is_global ) + { + // resolve + EM_error2( var_decl->where, "'global' variables cannot invoke non-default constructors..." ); + return FALSE; + } // type check the exp if( !type_engine_scan1_exp( env, var_decl->ctor.args ) ) return FALSE; From 5379ff31fca61b1daea101f1c89fc4f29970f99b Mon Sep 17 00:00:00 2001 From: Ge Wang Date: Tue, 14 Nov 2023 09:16:02 -0800 Subject: [PATCH 10/20] partial groundwork for language destructors --- src/core/chuck.lex | 2 + src/core/chuck.y | 9 ++- src/core/chuck_absyn.h | 1 + src/core/chuck_oo.cpp | 22 ++++-- src/core/chuck_scan.cpp | 32 +++++++++ src/core/chuck_vm.cpp | 152 +++++++++++++++++++++++++++++++++++++++- src/core/chuck_vm.h | 31 ++++++++ 7 files changed, 241 insertions(+), 8 deletions(-) diff --git a/src/core/chuck.lex b/src/core/chuck.lex index 7efec7b8f..d78e7bb8a 100644 --- a/src/core/chuck.lex +++ b/src/core/chuck.lex @@ -368,6 +368,8 @@ global { adjust(); return GLOBAL; } "@" { adjust(); return AT_SYM; } "@@" { adjust(); return ATAT_SYM; } "@operator" { adjust(); return AT_OP; } +"@construct" { adjust(); return AT_CTOR; } +"@destruct" { adjust(); return AT_DTOR; } "->" { adjust(); return ARROW_RIGHT; } "<-" { adjust(); return ARROW_LEFT; } "-->" { adjust(); return GRUCK_RIGHT; } diff --git a/src/core/chuck.y b/src/core/chuck.y index cbccc24d2..2096a437b 100644 --- a/src/core/chuck.y +++ b/src/core/chuck.y @@ -134,7 +134,8 @@ a_Program g_program = NULL; UNCHUCK UPCHUCK CLASS INTERFACE EXTENDS IMPLEMENTS PUBLIC PROTECTED PRIVATE STATIC ABSTRACT CONST SPORK ARROW_RIGHT ARROW_LEFT L_HACK R_HACK - GRUCK_RIGHT GRUCK_LEFT UNGRUCK_RIGHT UNGRUCK_LEFT AT_OP + GRUCK_RIGHT GRUCK_LEFT UNGRUCK_RIGHT UNGRUCK_LEFT + AT_OP AT_CTOR AT_DTOR %type program @@ -266,6 +267,12 @@ function_definition { $$ = new_func_def( $1, $2, $3, $4, $6, $8, TRUE, @1.first_line, @1.first_column ); } | function_decl static_decl type_decl2 ID LPAREN RPAREN code_segment { $$ = new_func_def( $1, $2, $3, $4, NULL, $7, TRUE, @1.first_line, @1.first_column ); } +// | function_decl AT_CTOR LPAREN arg_list RPAREN code_segment // 1.5.1.9 (ge) added for constructors +// { $$ = new_func_def( $1, ae_key_instance, NULL, "@construct", $4, $6, TRUE, @1.first_line, @1.first_column ); } +// | function_decl AT_CTOR LPAREN RPAREN code_segment // 1.5.1.9 (ge) added for constructors +// { $$ = new_func_def( $1, ae_key_instance, NULL, "@construct", NULL, $5, TRUE, @1.first_line, @1.first_column ); } +// | function_decl AT_DTOR LPAREN RPAREN code_segment // 1.5.1.9 (ge) added for destructor +// { $$ = new_func_def( $1, ae_key_instance, NULL, "@destruct", NULL, $5, TRUE, @1.first_line, @1.first_column ); } | function_decl static_decl type_decl2 ID LPAREN arg_list RPAREN SEMICOLON { $$ = new_func_def( $1, $2, $3, $4, $6, NULL, TRUE, @1.first_line, @1.first_column ); } | function_decl static_decl type_decl2 ID LPAREN RPAREN SEMICOLON diff --git a/src/core/chuck_absyn.h b/src/core/chuck_absyn.h index a42e6e856..5901d3a13 100644 --- a/src/core/chuck_absyn.h +++ b/src/core/chuck_absyn.h @@ -81,6 +81,7 @@ typedef enum { ae_key_private, ae_key_static, ae_key_instance, ae_key_abstract } ae_Keyword; +// key diff --git a/src/core/chuck_oo.cpp b/src/core/chuck_oo.cpp index 0cb6f8856..20151f923 100644 --- a/src/core/chuck_oo.cpp +++ b/src/core/chuck_oo.cpp @@ -290,11 +290,23 @@ Chuck_Object::~Chuck_Object() // SPENCER TODO: HACK! is there a better way to call the dtor? if( type->info && type->has_destructor ) // 1.5.0.0 (ge) added type->info check { - // verify: for now, can only be native func - assert( type->info->dtor && type->info->dtor->native_func ); - // REFACTOR-2017: do we know which VM to pass in? (diff main/sub instance?) - // pass in type-associated vm and current shred | 1.5.1.8 - ((f_dtor)(type->info->dtor->native_func))( this, vm, shred, Chuck_DL_Api::instance() ); + // verify + assert( type->info->dtor ); + // check origin of dtor + if( type->info->dtor->native_func ) // defined in c++ + { + // REFACTOR-2017: do we know which VM to pass in? (diff main/sub instance?) + // pass in type-associated vm and current shred | 1.5.1.8 + ((f_dtor)(type->info->dtor->native_func))( this, vm, shred, Chuck_DL_Api::instance() ); + } + else // defined in chuck + { + // TODO: invoke dtor, if there is one + // should type already have dtorinvoker setup? + // pass in owner shred to invoke()? what about refs? + // what about UGen and GGen that shreds keep track of (and have refs to)? + // or should @destruct disallow accessing context-global variables? + } } // go up the inheritance type = type->parent; diff --git a/src/core/chuck_scan.cpp b/src/core/chuck_scan.cpp index c37c9a631..bafe4140b 100644 --- a/src/core/chuck_scan.cpp +++ b/src/core/chuck_scan.cpp @@ -1407,6 +1407,38 @@ t_CKBOOL type_engine_scan1_func_def( Chuck_Env * env, a_Func_Def f ) { a_Arg_List arg_list = NULL; t_CKUINT count = 0; + // substitute for @construct + if( S_name(f->name) == string("@construct") ) + { + // make sure we are in a class + if( !env->class_def ) + { + EM_error2( f->where, "@construct() can only be used within class definitions..." ); + return FALSE; + } + + // substitute class name + f->name = insert_symbol( env->class_def->base_name.c_str() ); + } + // verify @destruct + if( S_name(f->name) == string("@destruct") ) + { + // make sure we are in a class + if( !env->class_def ) + { + EM_error2( f->where, "@destruct() can only be used within class definitions..." ); + return FALSE; + } + // make sure there are no arguments + if( f->arg_list != NULL ) + { + EM_error2( f->where, "@destruct() does not accept arguments..." ); + return FALSE; + } + // substitute ~[class name] + f->name = insert_symbol( string("~"+env->class_def->base_name).c_str() ); + } + // check if constructor t_CKBOOL isInCtor = isctor(env,f); // check if reserved diff --git a/src/core/chuck_vm.cpp b/src/core/chuck_vm.cpp index cb224ff39..2e8dacec7 100644 --- a/src/core/chuck_vm.cpp +++ b/src/core/chuck_vm.cpp @@ -3307,8 +3307,10 @@ t_CKBOOL Chuck_VM_MFunInvoker::setup( Chuck_Func * func, t_CKUINT func_vt_offset instructions.push_back( new Chuck_Instr_Dot_Member_Func(func_vt_offset) ); // func to code instructions.push_back( new Chuck_Instr_Func_To_Code ); - // push stack depth (in bytes) - instructions.push_back( new Chuck_Instr_Reg_Push_Imm(args_size_bytes) ); + // frame offset; use 0 since we have no local variables + // was: push stack depth (in bytes) + // was: instructions.push_back( new Chuck_Instr_Reg_Push_Imm(args_size_bytes) ); + instructions.push_back( new Chuck_Instr_Reg_Push_Imm(0) ); // func call instructions.push_back( new Chuck_Instr_Func_Call()); @@ -3581,6 +3583,152 @@ void Chuck_VM_MFunInvoker::cleanup() +//----------------------------------------------------------------------------- +// name: Chuck_VM_DtorInvoker() +// desc: constructor +//----------------------------------------------------------------------------- +Chuck_VM_DtorInvoker::Chuck_VM_DtorInvoker() +{ + // zero + invoker_shred = NULL; + instr_pushThis = NULL; +} + + + + +//----------------------------------------------------------------------------- +// name: ~Chuck_VM_DtorInvoker() +// desc: destructor +//----------------------------------------------------------------------------- +Chuck_VM_DtorInvoker::~Chuck_VM_DtorInvoker() +{ + cleanup(); +} + + + + +//----------------------------------------------------------------------------- +// name: setup() +// desc: setup the invoker for use +//----------------------------------------------------------------------------- +t_CKBOOL Chuck_VM_DtorInvoker::setup( Chuck_Func * dtor, Chuck_VM * vm, Chuck_VM_Shred * caller ) +{ + // clean up first + if( invoker_shred ) cleanup(); + + // a vector of VM instructions + vector instructions; + + // push this (as func arg) -- will set later + instr_pushThis = new Chuck_Instr_Reg_Push_Imm( 0 ); + instructions.push_back( instr_pushThis ); + // push destructor VM code + instructions.push_back( new Chuck_Instr_Reg_Push_Code(dtor->code) ); + // push stack offset; 0 since this is a dedicated shred for invoking + instructions.push_back( new Chuck_Instr_Reg_Push_Imm(0) ); + // func call + instructions.push_back( new Chuck_Instr_Func_Call()); + // end of code + instructions.push_back( new Chuck_Instr_EOC); + + // create VM code + Chuck_VM_Code * code = new Chuck_VM_Code; + // allocate instruction array + code->instr = new Chuck_Instr*[instructions.size()]; + // number of instructions + code->num_instr = instructions.size(); + // copy instructions + for( t_CKUINT i = 0; i < instructions.size(); i++ ) code->instr[i] = instructions[i]; + // TODO: should this be > 0 + code->stack_depth = 0; + // TODO: should this be this true? + code->need_this = FALSE; + + // create dedicated shred + invoker_shred = new Chuck_VM_Shred; + // set the VM ref (needed by initialize) + invoker_shred->vm_ref = vm; + // initialize with code + allocate stacks + invoker_shred->initialize( code ); + // set name + invoker_shred->name = dtor->signature(FALSE,TRUE); + // enter immediate mode (will throw runtime exception on any time/event ops) + invoker_shred->setImmediateMode( TRUE ); + + // done + return TRUE; +} + + + + +//----------------------------------------------------------------------------- +// name: invoke() +// desc: invoke the dtor +//----------------------------------------------------------------------------- +void Chuck_VM_DtorInvoker::invoke( Chuck_Object * obj, Chuck_VM_Shred * parent_shred ) +{ + // no shred? + if( !invoker_shred ) return; + // verify + assert( instr_pushThis != NULL ); + + // set this pointer + instr_pushThis->set( (t_CKUINT)obj ); + // reset shred: program counter + invoker_shred->pc = 0; + // next pc + invoker_shred->next_pc = 1; + // set parent + invoker_shred->parent = parent_shred; + // commented out: parent if any should have been set in setup() + // invoker_shred->parent = obj->originShred(); + + // set parent base_ref; in case mfun is part of a non-public class + // that can access file-global variables outside the class definition + if( invoker_shred->parent ) invoker_shred->base_ref = invoker_shred->parent->base_ref; + else invoker_shred->base_ref = invoker_shred->mem; + + // shred in dump (all done) + invoker_shred->is_dumped = FALSE; + // shred done + invoker_shred->is_done = FALSE; + // shred running + invoker_shred->is_running = FALSE; + // shred abort + invoker_shred->is_abort = FALSE; + // set the instr + invoker_shred->instr = invoker_shred->code->instr; + // zero out the id (shred is in immediate mode and cannot be shreduled) + invoker_shred->xid = 0; + // inherit now from vm + invoker_shred->now = invoker_shred->vm_ref->now(); + // run shred on VM + invoker_shred->run( invoker_shred->vm_ref ); +} + + + + +//----------------------------------------------------------------------------- +// name: cleanup() +// desc: clean up +//----------------------------------------------------------------------------- +void Chuck_VM_DtorInvoker::cleanup() +{ + // release shred reference + // NB this should also cleanup the code and VM instruction we created in setup + CK_SAFE_RELEASE( invoker_shred ); + + // zero out + instr_pushThis = NULL; +} + + + + // begin CK_VM_DEBUG implementation //----------------------------------------------------------------------------- #if CK_VM_DEBUG_ENABLE diff --git a/src/core/chuck_vm.h b/src/core/chuck_vm.h index f5e98c178..af07dfc5b 100644 --- a/src/core/chuck_vm.h +++ b/src/core/chuck_vm.h @@ -862,6 +862,37 @@ struct Chuck_VM_MFunInvoker +//----------------------------------------------------------------------------- +// name: struct Chuck_VM_DtorInvoker | 1.5.1.9 (ge) +// desc: construct for calling chuck-defined @destruct from c++, +// typically called for Object cleanup +//----------------------------------------------------------------------------- +struct Chuck_VM_DtorInvoker +{ +public: + // constructor + Chuck_VM_DtorInvoker(); + // destructor + ~Chuck_VM_DtorInvoker(); + +public: + // set up the invoker; needed before invoke() + t_CKBOOL setup( Chuck_Func * func, Chuck_VM * vm, Chuck_VM_Shred * caller ); + // invoke the member function + void invoke( Chuck_Object * obj, Chuck_VM_Shred * parent_shred ); + // clean up + void cleanup(); + +public: + // dedicated shred to call the dtor on, since this could be running "outside of chuck time" + Chuck_VM_Shred * invoker_shred; + // instruction to update on invoke: pushing this pointer + Chuck_Instr_Reg_Push_Imm * instr_pushThis; +}; + + + + //----------------------------------------------------------------------------- // VM debug macros | 1.5.0.5 (ge) added // these are governed by the presence of __CHUCK_DEBUG__ (e.g., from makefile) From 21377377ca35cbffb071b667c2db31e2e2c78a35 Mon Sep 17 00:00:00 2001 From: Ge Wang Date: Wed, 15 Nov 2023 00:40:21 -0800 Subject: [PATCH 11/20] add support for destructor --- VERSIONS | 34 ++++++- src/core/chuck.y | 6 +- src/core/chuck_oo.cpp | 35 +++++--- src/core/chuck_scan.cpp | 83 +++++++++++------ src/core/chuck_type.cpp | 90 +++++++++++++++---- src/core/chuck_type.h | 23 +++-- src/core/chuck_vm.cpp | 10 +-- src/core/chuck_vm.h | 8 +- src/test/01-Basic/236-ctors-basic.ck | 41 +++++++++ src/test/01-Basic/236-ctors-basic.txt | 4 + src/test/01-Basic/237-ctor-arrays.ck | 46 ++++++++++ src/test/01-Basic/237-ctor-arrays.txt | 18 ++++ src/test/06-Errors/error-overload-class.txt | 2 +- src/test/06-Errors/error-overload-func.txt | 2 +- .../06-Errors/error-public-class-ext-var1.txt | 2 +- .../06-Errors/error-public-class-ext-var2.txt | 2 +- 16 files changed, 327 insertions(+), 79 deletions(-) create mode 100644 src/test/01-Basic/236-ctors-basic.ck create mode 100644 src/test/01-Basic/236-ctors-basic.txt create mode 100644 src/test/01-Basic/237-ctor-arrays.ck create mode 100644 src/test/01-Basic/237-ctor-arrays.txt diff --git a/VERSIONS b/VERSIONS index 9d222d464..6043848ec 100644 --- a/VERSIONS +++ b/VERSIONS @@ -2,8 +2,40 @@ ChucK VERSIONS log ------------------ -1.5.1.9 (November 2023) +1.5.1.9 (November 2023) "Better Late Than Never...constructors" ======= +- (added) language-level, overloadable class constructors +- (added) language-level class destructor +``` +class Foo +{ + // a member variable + 1 => int num; + + // constructor "default" + fun void Foo() { 2 => num; } + + // another constructor + fun void Foo( int x ) { x => num; } + + // yet another constructor + fun void Foo( int x, int y ) { x*y => num; } + + // destructor + fun @destruct() { <<< "bye:", this >>>; } +} + +// constructor "default" +Foo f1(); +// another constructor +Foo f2(15); +// yet another constructor +new Foo(8,9) @=> Foo @ f3; +// print +<<< f1.num, f2.num, f3.num >>>; +``` +- (added) examples/class/constructors.ck +- (added) examples/class/destructor.ck - (added) Shred.parent() and Shred.ancestor() - (added) chugins runtime API support for creating arrays from chugins - (fixed) Type.of("int[][]").isArray() now correctly returns true diff --git a/src/core/chuck.y b/src/core/chuck.y index 2096a437b..44203b4cf 100644 --- a/src/core/chuck.y +++ b/src/core/chuck.y @@ -271,8 +271,10 @@ function_definition // { $$ = new_func_def( $1, ae_key_instance, NULL, "@construct", $4, $6, TRUE, @1.first_line, @1.first_column ); } // | function_decl AT_CTOR LPAREN RPAREN code_segment // 1.5.1.9 (ge) added for constructors // { $$ = new_func_def( $1, ae_key_instance, NULL, "@construct", NULL, $5, TRUE, @1.first_line, @1.first_column ); } -// | function_decl AT_DTOR LPAREN RPAREN code_segment // 1.5.1.9 (ge) added for destructor -// { $$ = new_func_def( $1, ae_key_instance, NULL, "@destruct", NULL, $5, TRUE, @1.first_line, @1.first_column ); } + | function_decl AT_DTOR LPAREN RPAREN code_segment // 1.5.1.9 (ge) added for destructor + { $$ = new_func_def( $1, ae_key_instance, NULL, "@destruct", NULL, $5, TRUE, @1.first_line, @1.first_column ); } + | function_decl AT_DTOR LPAREN arg_list RPAREN code_segment // 1.5.1.9 (ge) added for constructors + { $$ = new_func_def( $1, ae_key_instance, NULL, "@destruct", $4, $6, TRUE, @1.first_line, @1.first_column ); } | function_decl static_decl type_decl2 ID LPAREN arg_list RPAREN SEMICOLON { $$ = new_func_def( $1, $2, $3, $4, $6, NULL, TRUE, @1.first_line, @1.first_column ); } | function_decl static_decl type_decl2 ID LPAREN RPAREN SEMICOLON diff --git a/src/core/chuck_oo.cpp b/src/core/chuck_oo.cpp index 20151f923..eb906b322 100644 --- a/src/core/chuck_oo.cpp +++ b/src/core/chuck_oo.cpp @@ -288,26 +288,39 @@ Chuck_Object::~Chuck_Object() while( type != NULL ) { // SPENCER TODO: HACK! is there a better way to call the dtor? - if( type->info && type->has_destructor ) // 1.5.0.0 (ge) added type->info check + if( type->info && type->info->pre_dtor ) // 1.5.0.0 (ge) added type->info check { - // verify - assert( type->info->dtor ); // check origin of dtor - if( type->info->dtor->native_func ) // defined in c++ + if( type->info->pre_dtor->native_func ) // c++-defined deconstructor { // REFACTOR-2017: do we know which VM to pass in? (diff main/sub instance?) // pass in type-associated vm and current shred | 1.5.1.8 - ((f_dtor)(type->info->dtor->native_func))( this, vm, shred, Chuck_DL_Api::instance() ); + ((f_dtor)(type->info->pre_dtor->native_func))( this, vm, shred, Chuck_DL_Api::instance() ); + } + else // chuck-defined deconstructor + { + // this shouldn't be possible + EM_error3( "(internal error) native_func dtor not found in class '%s'...", type->c_name() ); + // keep going for now... + } + } + + // chuck-defined destructor | 1.5.1.9 (ge) added + if( type->dtor ) + { + // verify + if( !type->dtor_invoker ) + { + EM_error3( "(internal error) dtor invoker not found in class '%s'...", type->c_name() ); } - else // defined in chuck + else { - // TODO: invoke dtor, if there is one - // should type already have dtorinvoker setup? - // pass in owner shred to invoke()? what about refs? - // what about UGen and GGen that shreds keep track of (and have refs to)? - // or should @destruct disallow accessing context-global variables? + // invoke the dtor + // NOTE @destruct disallows accessing context-global variables/functions + type->dtor_invoker->invoke( this, this->originShred() ); } } + // go up the inheritance type = type->parent; } diff --git a/src/core/chuck_scan.cpp b/src/core/chuck_scan.cpp index bafe4140b..3f2befcc1 100644 --- a/src/core/chuck_scan.cpp +++ b/src/core/chuck_scan.cpp @@ -1432,14 +1432,16 @@ t_CKBOOL type_engine_scan1_func_def( Chuck_Env * env, a_Func_Def f ) // make sure there are no arguments if( f->arg_list != NULL ) { - EM_error2( f->where, "@destruct() does not accept arguments..." ); + EM_error2( f->where, "@destruct() cannot accept arguments..." ); return FALSE; } // substitute ~[class name] - f->name = insert_symbol( string("~"+env->class_def->base_name).c_str() ); + // f->name = insert_symbol( string("~"+env->class_def->base_name).c_str() ); } // check if constructor t_CKBOOL isInCtor = isctor(env,f); + // check if destructor + t_CKBOOL isInDtor = isdtor(env,f); // check if reserved if( type_engine_check_reserved( env, f->name, f->where ) ) @@ -1467,12 +1469,22 @@ t_CKBOOL type_engine_scan1_func_def( Chuck_Env * env, a_Func_Def f ) // check return type (must be void) if( !isa(f->ret_type, env->ckt_void) ) { - EM_error2( f->where, "constructor for class '%s' must return void", + EM_error2( f->where, "constructor for class '%s' must return void...", S_name(f->name) ); goto error; } } + if( isInDtor ) + { + // check return type (must be void) + if( !isa(f->ret_type, env->ckt_void) ) + { + EM_error2( f->where, "destructor must return void..." ); + goto error; + } + } + // check if array if( f->type_decl->array != NULL ) { @@ -2768,7 +2780,7 @@ t_CKBOOL type_engine_scan2_class_def( Chuck_Env * env, a_Class_Def class_def ) //----------------------------------------------------------------------------- // name: type_engine_scan2_func_def() -// desc: ... +// desc: type scan 2 for function definition //----------------------------------------------------------------------------- t_CKBOOL type_engine_scan2_func_def( Chuck_Env * env, a_Func_Def f ) { @@ -2793,6 +2805,8 @@ t_CKBOOL type_engine_scan2_func_def( Chuck_Env * env, a_Func_Def f ) t_CKBOOL op_overload = ( f->op2overload != ae_op_none ); // is in constructor? | 1.5.1.9 t_CKBOOL isInCtor = isctor(env,f); + // is in destructor? | 1.5.1.9 + t_CKBOOL isInDtor = isdtor(env,f); // see if we are already in a function definition if( env->func != NULL ) @@ -2876,25 +2890,6 @@ t_CKBOOL type_engine_scan2_func_def( Chuck_Env * env, a_Func_Def f ) func->code->native_func = (t_CKUINT)func->def()->dl_func_ptr; } - // constructor | 1.5.1.9 (ge) added - if( isInCtor ) - { - // set constructor flag - func->is_ctor = TRUE; - // set in class as constructor; if not NULL, then a ctor is already set, and this is an overloading - if( env->class_def->ctors == NULL ) - { - CK_SAFE_REF_ASSIGN( env->class_def->ctors, func ); - } - // check if default constructor - func->is_default_ctor = (f->arg_list == NULL); - // if no arguments, then set as base constructor - if( func->is_default_ctor ) - { - CK_SAFE_REF_ASSIGN( env->class_def->ctor_default, func ); - } - } - // make a new type for the function type = env->context->new_Chuck_Type( env ); type->xid = te_function; @@ -3126,13 +3121,13 @@ t_CKBOOL type_engine_scan2_func_def( Chuck_Env * env, a_Func_Def f ) EM_error2( f->where, "cannot overload functions with identical arguments..." ); if( env->class_def ) { - EM_error3( " |- '%s %s.%s( %s )' already defined elsewhere", + EM_error3( " |- '%s %s.%s(%s)' already defined elsewhere", func->def()->ret_type->base_name.c_str(), env->class_def->c_name(), orig_name.c_str(), arglist2string(func->def()->arg_list).c_str() ); } else { - EM_error3( " |- '%s %s( %s )' already defined elsewhere", + EM_error3( " |- '%s %s(%s)' already defined elsewhere", func->def()->ret_type->base_name.c_str(), orig_name.c_str(), arglist2string(func->def()->arg_list).c_str() ); } goto error; @@ -3143,6 +3138,44 @@ t_CKBOOL type_engine_scan2_func_def( Chuck_Env * env, a_Func_Def f ) } } + // constructor | 1.5.1.9 (ge) added + if( isInCtor ) + { + // set constructor flag + func->is_ctor = TRUE; + // set in class as constructor; if not NULL, then a ctor is already set, and this is an overloading + if( env->class_def->ctors == NULL ) + { + CK_SAFE_REF_ASSIGN( env->class_def->ctors, func ); + } + // check if default constructor + func->is_default_ctor = (f->arg_list == NULL); + // if no arguments, then set as base constructor + if( func->is_default_ctor ) + { + CK_SAFE_REF_ASSIGN( env->class_def->ctor_default, func ); + } + } + + // destructor | 1.5.1.9 (ge) added + if( isInDtor ) + { + // verify + if( env->class_def->dtor != NULL ) + { + EM_error2( f->where, "(internal error): unexpected destructor found in '%s'...", env->class_def->c_name() ); + return FALSE; + } + // set destructor flag + func->is_dtor = TRUE; + // set in class as destructor + CK_SAFE_REF_ASSIGN( env->class_def->dtor, func ); + // set invoker + env->class_def->dtor_invoker = new Chuck_VM_DtorInvoker; + // init invoker + env->class_def->dtor_invoker->setup( func, env->vm() ); + } + // operator overload | 1.5.1.5 (ge) added if( op_overload ) { diff --git a/src/core/chuck_type.cpp b/src/core/chuck_type.cpp index c499d795e..4b766f6d1 100644 --- a/src/core/chuck_type.cpp +++ b/src/core/chuck_type.cpp @@ -3337,7 +3337,7 @@ t_CKTYPE type_engine_check_exp_primary( Chuck_Env * env, a_Exp_Primary exp ) v = type_engine_find_value( env, S_name(exp->var), TRUE, FALSE, exp->where ); // 1.5.0.8 (ge) added this check - // public classes cannot access variables that are: + // public classes cannot access values that are: // file-context-global-scope (v->is_context_global) // AND non-explictly-global !(v->is_global) variables if( v && v->is_context_global && !v->is_global @@ -3352,7 +3352,27 @@ t_CKTYPE type_engine_check_exp_primary( Chuck_Env * env, a_Exp_Primary exp ) else { EM_error2( exp->where, - "cannot use local variable '%s' from within a public class", S_name( exp->var ) ); + "cannot access local variable '%s' from within a public class", S_name( exp->var ) ); + } + return NULL; + } + + // 1.5.1.9 (ge) added this check + // @destruct() cannot access values that are: + // file-context-global-scope (v->is_context_global) + // AND non-explictly-global !(v->is_global) variables + if( v && v->is_context_global && !v->is_global + && env->class_def && env->func && isdtor(env, env->func->def()) ) + { + if( v->func_ref ) + { + EM_error2( exp->where, + "cannot call local function '%s' from within @destruct()", S_name( exp->var ) ); + } + else + { + EM_error2( exp->where, + "cannot access local variable '%s' from within @destruct()", S_name( exp->var ) ); } return NULL; } @@ -4970,7 +4990,7 @@ t_CKBOOL type_engine_check_class_def( Chuck_Env * env, a_Class_Def class_def ) //----------------------------------------------------------------------------- // name: type_engine_check_func_def() -// desc: ... +// desc: type check function definition //----------------------------------------------------------------------------- t_CKBOOL type_engine_check_func_def( Chuck_Env * env, a_Func_Def f ) { @@ -5277,6 +5297,39 @@ t_CKBOOL type_engine_check_func_def( Chuck_Env * env, a_Func_Def f ) +//----------------------------------------------------------------------------- +// name: Chuck_Namespace() +// desc: constructor +//----------------------------------------------------------------------------- +Chuck_Namespace::Chuck_Namespace() +{ + pre_ctor = NULL; + pre_dtor = NULL; + parent = NULL; + offset = 0; + class_data = NULL; + class_data_size = 0; +} + + + + +//----------------------------------------------------------------------------- +// name: ~Chuck_Namespace() +// desc: destructor +//----------------------------------------------------------------------------- +Chuck_Namespace::~Chuck_Namespace() +{ + // release references + CK_SAFE_RELEASE( pre_ctor ); + CK_SAFE_RELEASE( pre_dtor ); + // TODO: release ref + // CK_SAFE_RELEASE( this->parent ); +} + + + + //----------------------------------------------------------------------------- // name: lookup_value() // desc: lookup value in the env; climb means to climb the scope and... @@ -5932,6 +5985,8 @@ te_KindOf getkindof( Chuck_Env * env, Chuck_Type * type ) // added 1.3.1.0 } t_CKBOOL isctor( Chuck_Env * env, a_Func_Def func_def ) // 1.5.1.9 (ge) added for constructors { return (env->class_def && S_name(func_def->name)==env->class_def->name()); } +t_CKBOOL isdtor( Chuck_Env * env, a_Func_Def func_def ) // 1.5.1.9 (ge) added for constructors +{ return (env->class_def && S_name(func_def->name)==(string("@destruct"))); } @@ -6389,6 +6444,8 @@ Chuck_Type * type_engine_import_class_begin( Chuck_Env * env, Chuck_Type * type, type->has_pre_ctor = TRUE; // allocate vm code for (imported) pre_ctor type->info->pre_ctor = new Chuck_VM_Code; + // add ref | 1.5.1.9 (ge) added + CK_SAFE_ADD_REF( type->info->pre_ctor ); // add pre_ctor type->info->pre_ctor->native_func = (t_CKUINT)pre_ctor; // mark type as ctor @@ -6404,20 +6461,20 @@ Chuck_Type * type_engine_import_class_begin( Chuck_Env * env, Chuck_Type * type, // if destructor if( dtor != 0 ) { - // flag it - type->has_destructor = TRUE; // allocate vm code for dtor - type->info->dtor = new Chuck_VM_Code; + type->info->pre_dtor = new Chuck_VM_Code; + // add ref | 1.5.1.9 (ge) added + CK_SAFE_ADD_REF( type->info->pre_dtor ); // add dtor - type->info->dtor->native_func = (t_CKUINT)dtor; + type->info->pre_dtor->native_func = (t_CKUINT)dtor; // mark type as dtor - type->info->dtor->native_func_type = Chuck_VM_Code::NATIVE_DTOR; + type->info->pre_dtor->native_func_type = Chuck_VM_Code::NATIVE_DTOR; // specify that we need this - type->info->dtor->need_this = TRUE; + type->info->pre_dtor->need_this = TRUE; // no arguments to destructor other than self - type->info->dtor->stack_depth = sizeof(t_CKUINT); + type->info->pre_dtor->stack_depth = sizeof(t_CKUINT); // add name | 1.5.1.9 (ge) added - type->info->dtor->name = string("class ") + type->base_name + string(" (destructor)"); + type->info->pre_dtor->name = string("class ") + type->base_name + string(" (destructor)"); } // clear the object size @@ -8638,7 +8695,7 @@ t_CKBOOL same_arg_lists( a_Arg_List lhs, a_Arg_List rhs ) string arglist2string( a_Arg_List list ) { // return value - string s = ""; + string s = list ? " " : ""; // go down the list while( list ) @@ -8646,7 +8703,9 @@ string arglist2string( a_Arg_List list ) // concatenate s += list->type->base_name; // check - if( list->next ) s += ", "; + if( list->next ) s += ","; + // space + s += " "; // advance list = list->next; } @@ -9188,7 +9247,8 @@ Chuck_Type::Chuck_Type( Chuck_Env * env, te_Type _id, const std::string & _n, has_pre_ctor = FALSE; ctors = NULL; ctor_default = NULL; - has_destructor = FALSE; + dtor = NULL; + dtor_invoker = NULL; allocator = NULL; // default @@ -9226,7 +9286,6 @@ void Chuck_Type::reset() xid = te_void; size = array_depth = obj_size = 0; is_copy = FALSE; - has_destructor = FALSE; // free only if not locked: to prevent garbage collection after exit if( !this->m_locked ) @@ -9236,6 +9295,7 @@ void Chuck_Type::reset() CK_SAFE_RELEASE( owner ); CK_SAFE_RELEASE( ctors ); // 1.5.1.9 (ge) added CK_SAFE_RELEASE( ctor_default ); // 1.5.1.9 (ge) added + CK_SAFE_RELEASE( dtor ); // 1.5.1.9 (ge) added // TODO: uncomment this, fix it to behave correctly // TODO: make it safe to do this, as there are multiple instances of ->parent assignments without add-refs diff --git a/src/core/chuck_type.h b/src/core/chuck_type.h index 92e8de166..05c533ddc 100644 --- a/src/core/chuck_type.h +++ b/src/core/chuck_type.h @@ -290,6 +290,7 @@ struct Chuck_Multi; struct Chuck_VM; struct Chuck_VM_Code; struct Chuck_VM_MFunInvoker; +struct Chuck_VM_DtorInvoker; struct Chuck_DLL; // operator loading structs | 1.5.1.5 struct Chuck_Op_Registry; @@ -319,24 +320,19 @@ struct Chuck_Namespace : public Chuck_VM_Object // name std::string name; - // top-level code + // pre-constructor (either chuck or c++ defined) Chuck_VM_Code * pre_ctor; - // destructor - Chuck_VM_Code * dtor; + // pre-destructor + Chuck_VM_Code * pre_dtor; // type that contains this Chuck_Namespace * parent; // address offset t_CKUINT offset; // constructor - Chuck_Namespace() { pre_ctor = NULL; dtor = NULL; parent = NULL; offset = 0; - class_data = NULL; class_data_size = 0; } + Chuck_Namespace(); // destructor - virtual ~Chuck_Namespace() { - /* TODO: CK_SAFE_RELEASE( this->parent ); */ - /* TODO: CK_SAFE_DELETE( pre_ctor ); */ - /* TODO: CK_SAFE_DELETE( dtor ); */ - } + virtual ~Chuck_Namespace(); // look up value Chuck_Value * lookup_value( const std::string & name, t_CKINT climb = 1, t_CKBOOL stayWithinClassDef = FALSE ); @@ -953,8 +949,10 @@ struct Chuck_Type : public Chuck_Object Chuck_Func * ctors; // default constructor (no arguments) | 1.5.1.9 (ge) added Chuck_Func * ctor_default; - // has destructor - t_CKBOOL has_destructor; + // destructor (also see this->info->pre_dtor) | 1.5.1.9 (ge) added + Chuck_Func * dtor; + // destructor invoker (needed since dtor could run outside of chuck shreduling) | 1.5.1.9 + Chuck_VM_DtorInvoker * dtor_invoker; // custom allocator f_alloc allocator; // origin hint @@ -1259,6 +1257,7 @@ t_CKBOOL isnull( Chuck_Env * env, Chuck_Type * type ); t_CKBOOL iskindofint( Chuck_Env * env, Chuck_Type * type ); // added 1.3.1.0: this includes int + pointers te_KindOf getkindof( Chuck_Env * env, Chuck_Type * type ); // added 1.3.1.0: to get the kindof a type t_CKBOOL isctor( Chuck_Env * env, a_Func_Def func_def ); // 1.5.1.9 (ge) added for constructors +t_CKBOOL isdtor( Chuck_Env * env, a_Func_Def func_def ); // 1.5.1.9 (ge) added for destructors diff --git a/src/core/chuck_vm.cpp b/src/core/chuck_vm.cpp index 2e8dacec7..43c9868b8 100644 --- a/src/core/chuck_vm.cpp +++ b/src/core/chuck_vm.cpp @@ -3613,7 +3613,7 @@ Chuck_VM_DtorInvoker::~Chuck_VM_DtorInvoker() // name: setup() // desc: setup the invoker for use //----------------------------------------------------------------------------- -t_CKBOOL Chuck_VM_DtorInvoker::setup( Chuck_Func * dtor, Chuck_VM * vm, Chuck_VM_Shred * caller ) +t_CKBOOL Chuck_VM_DtorInvoker::setup( Chuck_Func * dtor, Chuck_VM * vm ) { // clean up first if( invoker_shred ) cleanup(); @@ -3683,13 +3683,13 @@ void Chuck_VM_DtorInvoker::invoke( Chuck_Object * obj, Chuck_VM_Shred * parent_s invoker_shred->next_pc = 1; // set parent invoker_shred->parent = parent_shred; - // commented out: parent if any should have been set in setup() - // invoker_shred->parent = obj->originShred(); // set parent base_ref; in case mfun is part of a non-public class // that can access file-global variables outside the class definition - if( invoker_shred->parent ) invoker_shred->base_ref = invoker_shred->parent->base_ref; - else invoker_shred->base_ref = invoker_shred->mem; + if( invoker_shred->parent ) + { invoker_shred->base_ref = invoker_shred->parent->base_ref; } + else + { invoker_shred->base_ref = invoker_shred->mem; } // shred in dump (all done) invoker_shred->is_dumped = FALSE; diff --git a/src/core/chuck_vm.h b/src/core/chuck_vm.h index af07dfc5b..56ca9c196 100644 --- a/src/core/chuck_vm.h +++ b/src/core/chuck_vm.h @@ -826,7 +826,7 @@ struct Chuck_Msg //----------------------------------------------------------------------------- // name: struct Chuck_VM_MFunInvoker | 1.5.1.5 (ge) -// desc: construct for calling chuck-defined member functions from c++, +// desc: aparatus for calling chuck-defined member functions from c++, // either from VM execution or outside the VM execution context //----------------------------------------------------------------------------- struct Chuck_VM_MFunInvoker @@ -864,7 +864,7 @@ struct Chuck_VM_MFunInvoker //----------------------------------------------------------------------------- // name: struct Chuck_VM_DtorInvoker | 1.5.1.9 (ge) -// desc: construct for calling chuck-defined @destruct from c++, +// desc: aparatus for calling chuck-defined @destruct from c++, // typically called for Object cleanup //----------------------------------------------------------------------------- struct Chuck_VM_DtorInvoker @@ -877,9 +877,9 @@ struct Chuck_VM_DtorInvoker public: // set up the invoker; needed before invoke() - t_CKBOOL setup( Chuck_Func * func, Chuck_VM * vm, Chuck_VM_Shred * caller ); + t_CKBOOL setup( Chuck_Func * func, Chuck_VM * vm ); // invoke the member function - void invoke( Chuck_Object * obj, Chuck_VM_Shred * parent_shred ); + void invoke( Chuck_Object * obj, Chuck_VM_Shred * parent_shred = NULL ); // clean up void cleanup(); diff --git a/src/test/01-Basic/236-ctors-basic.ck b/src/test/01-Basic/236-ctors-basic.ck new file mode 100644 index 000000000..197c0aca2 --- /dev/null +++ b/src/test/01-Basic/236-ctors-basic.ck @@ -0,0 +1,41 @@ +// specifying and overloading class constructors +// requires chuck-1.5.2.0 or higher + +// a class +class Foo +{ + // a member variable (this will be initialized before + // any actual constructors, as Foo's "pre-constructor") + 1 => int num; + + // constructor 1 "default" + fun void Foo() + { + 2 => num; + <<< "constructor 1:", num >>>; + } + + // constructor 2 + fun void Foo( int x ) + { + x => num; + <<< "constructor 2:", x >>>; + } + + // constructor 3 + fun void Foo( int x, int y ) + { + x*y => num; + <<< "constructor 3:", x, y >>>; + } +} + +// declare a Foo, invoke constructor 1 +Foo f1(); +// declare a Foo, invoke constructor 2 +Foo f2(15); +// instantiate a Foo, invoke constructor 3 +new Foo(8,9) @=> Foo @ f3; + +// print +<<< f1.num, f2.num, f3.num >>>; diff --git a/src/test/01-Basic/236-ctors-basic.txt b/src/test/01-Basic/236-ctors-basic.txt new file mode 100644 index 000000000..3152e7888 --- /dev/null +++ b/src/test/01-Basic/236-ctors-basic.txt @@ -0,0 +1,4 @@ +constructor 1: 2 +constructor 2: 15 +constructor 3: 8 9 +2 15 72 diff --git a/src/test/01-Basic/237-ctor-arrays.ck b/src/test/01-Basic/237-ctor-arrays.ck new file mode 100644 index 000000000..287d6b37f --- /dev/null +++ b/src/test/01-Basic/237-ctor-arrays.ck @@ -0,0 +1,46 @@ +// specifying and overloading class constructors within array decl + +// a class +class Foo +{ + // a member variable (this will be initialized before + // any actual constructors, as Foo's "pre-constructor") + 0 => int num; + + // constructor 1 "default" + fun void Foo() + { + 1 => num; + <<< "constructor 1:", num >>>; + } + + // constructor 2 + fun void Foo( int x ) + { + x => num; + <<< "constructor 2:", x >>>; + } + + // constructor 3 + fun void Foo( int x, int y ) + { + x*y => num; + <<< "constructor 3:", x, y >>>; + } +} + +// invoke constructor for each array elements in array decl +Foo array1()[2]; +// print each element's num +for( auto f : array1 ) <<< f.num, "" >>>; + + +// invoke constructor for each array elements in array decl +Foo array2(2)[3]; +// print each element's num +for( auto f : array2 ) <<< f.num, "" >>>; + +// instantiate an array of Foo, invoking constructor for each +new Foo(6,5)[4] @=> Foo array3[]; +// print each element's num +for( auto f : array3 ) <<< f.num, "" >>>; diff --git a/src/test/01-Basic/237-ctor-arrays.txt b/src/test/01-Basic/237-ctor-arrays.txt new file mode 100644 index 000000000..0ea97d0d2 --- /dev/null +++ b/src/test/01-Basic/237-ctor-arrays.txt @@ -0,0 +1,18 @@ +constructor 1: 1 +constructor 1: 1 +1 +1 +constructor 2: 2 +constructor 2: 2 +constructor 2: 2 +2 +2 +2 +constructor 3: 6 5 +constructor 3: 6 5 +constructor 3: 6 5 +constructor 3: 6 5 +30 +30 +30 +30 diff --git a/src/test/06-Errors/error-overload-class.txt b/src/test/06-Errors/error-overload-class.txt index ce7e74950..05cd2d141 100644 --- a/src/test/06-Errors/error-overload-class.txt +++ b/src/test/06-Errors/error-overload-class.txt @@ -1,4 +1,4 @@ error-overload-class.ck:9:5: error: cannot overload functions with identical arguments... [9] fun void bar() ^ - |- 'void Foo.bar( )' already defined elsewhere + |- 'void Foo.bar()' already defined elsewhere diff --git a/src/test/06-Errors/error-overload-func.txt b/src/test/06-Errors/error-overload-func.txt index 2e9aa3e07..4b4a2dab3 100644 --- a/src/test/06-Errors/error-overload-func.txt +++ b/src/test/06-Errors/error-overload-func.txt @@ -1,4 +1,4 @@ error-overload-func.ck:6:1: error: cannot overload functions with identical arguments... [6] fun void bar() ^ - |- 'void bar( )' already defined elsewhere + |- 'void bar()' already defined elsewhere diff --git a/src/test/06-Errors/error-public-class-ext-var1.txt b/src/test/06-Errors/error-public-class-ext-var1.txt index 624c5c9de..4e6063345 100644 --- a/src/test/06-Errors/error-public-class-ext-var1.txt +++ b/src/test/06-Errors/error-public-class-ext-var1.txt @@ -1,4 +1,4 @@ -error-public-class-ext-var1.ck:21:13: error: cannot use local variable 'foo' from within a public class +error-public-class-ext-var1.ck:21:13: error: cannot access local variable 'foo' from within a public class [21] <<< foo + 5 >>>; ^ error-public-class-ext-var1.ck: ...in function 'void X.go()' diff --git a/src/test/06-Errors/error-public-class-ext-var2.txt b/src/test/06-Errors/error-public-class-ext-var2.txt index 4d1ea2aba..0f87ff7c3 100644 --- a/src/test/06-Errors/error-public-class-ext-var2.txt +++ b/src/test/06-Errors/error-public-class-ext-var2.txt @@ -1,3 +1,3 @@ -error-public-class-ext-var2.ck:12:9: error: cannot use local variable 'foo' from within a public class +error-public-class-ext-var2.ck:12:9: error: cannot access local variable 'foo' from within a public class [12] <<< foo + 5 >>>; ^ From 4563e8f719027ff2b09e91a446f2599b1ac146be Mon Sep 17 00:00:00 2001 From: Ge Wang Date: Wed, 15 Nov 2023 12:38:36 -0800 Subject: [PATCH 12/20] enable @construct with additional overload error reporting --- VERSIONS | 13 +++++++++---- examples/class/constructors.ck | 12 +++++++----- examples/class/destructor.ck | 14 ++++++++++++++ src/core/chuck.y | 8 ++++---- src/core/chuck_scan.cpp | 11 +++++++++-- src/test/06-Errors/error-overload-class.txt | 2 +- src/test/06-Errors/error-overload-func.txt | 2 +- 7 files changed, 45 insertions(+), 17 deletions(-) create mode 100644 examples/class/destructor.ck diff --git a/VERSIONS b/VERSIONS index 6043848ec..dacf5206f 100644 --- a/VERSIONS +++ b/VERSIONS @@ -13,13 +13,16 @@ class Foo 1 => int num; // constructor "default" - fun void Foo() { 2 => num; } + fun @construct() { 2 => num; } // another constructor - fun void Foo( int x ) { x => num; } + fun @construct( int x ) { x => num; } // yet another constructor - fun void Foo( int x, int y ) { x*y => num; } + fun @construct( int x, int y ) { x*y => num; } + + // alternate way of define a constructor + fun void Foo( int x, int y, int z ) { x*y*z => num; } // destructor fun @destruct() { <<< "bye:", this >>>; } @@ -31,8 +34,10 @@ Foo f1(); Foo f2(15); // yet another constructor new Foo(8,9) @=> Foo @ f3; +// yet another constructor +new Foo(10,11,12) @=> Foo @ f4; // print -<<< f1.num, f2.num, f3.num >>>; +<<< f1.num, f2.num, f3.num, f4.num >>>; ``` - (added) examples/class/constructors.ck - (added) examples/class/destructor.ck diff --git a/examples/class/constructors.ck b/examples/class/constructors.ck index eebb571f2..168040ddc 100644 --- a/examples/class/constructors.ck +++ b/examples/class/constructors.ck @@ -9,20 +9,20 @@ class Foo 1 => int num; // constructor 1 "default" - fun void Foo() + fun @construct() { 13 => num; // set num to something <<< "constructor 1:", num >>>; } // constructor 2 - fun void Foo( int x ) + fun @construct( int x ) { x => num; <<< "constructor 2:", x >>>; } - // constructor 3 + // constructor 3 (alternate method to define) fun void Foo( int x, int y ) { x*y => num; @@ -31,14 +31,16 @@ class Foo } // declare a Foo, invoke constructor 1 -Foo f1(); +Foo f1; +// declare a Foo, invoke constructor 1 +Foo f1a(); // declare a Foo, invoke constructor 2 Foo f2(15); // instantiate a Foo, invoke constructor 3 new Foo(8,9) @=> Foo @ f3; // print -<<< f1.num, f2.num, f3.num >>>; +<<< f1.num, f1a.num, f2.num, f3.num >>>; // can also invoke constructor for each element in array Foo array1(2)[3]; diff --git a/examples/class/destructor.ck b/examples/class/destructor.ck new file mode 100644 index 000000000..7b44df638 --- /dev/null +++ b/examples/class/destructor.ck @@ -0,0 +1,14 @@ +// example of class destructor + +// a class +class Foo +{ + // class destructor + fun @destruct() + { + <<< "destructor called...", "" >>>; + } +} + +Foo foo; +// when `foo` goes out of scope, the destructor should be called... diff --git a/src/core/chuck.y b/src/core/chuck.y index 44203b4cf..b1cd36953 100644 --- a/src/core/chuck.y +++ b/src/core/chuck.y @@ -267,10 +267,10 @@ function_definition { $$ = new_func_def( $1, $2, $3, $4, $6, $8, TRUE, @1.first_line, @1.first_column ); } | function_decl static_decl type_decl2 ID LPAREN RPAREN code_segment { $$ = new_func_def( $1, $2, $3, $4, NULL, $7, TRUE, @1.first_line, @1.first_column ); } -// | function_decl AT_CTOR LPAREN arg_list RPAREN code_segment // 1.5.1.9 (ge) added for constructors -// { $$ = new_func_def( $1, ae_key_instance, NULL, "@construct", $4, $6, TRUE, @1.first_line, @1.first_column ); } -// | function_decl AT_CTOR LPAREN RPAREN code_segment // 1.5.1.9 (ge) added for constructors -// { $$ = new_func_def( $1, ae_key_instance, NULL, "@construct", NULL, $5, TRUE, @1.first_line, @1.first_column ); } + | function_decl AT_CTOR LPAREN arg_list RPAREN code_segment // 1.5.1.9 (ge) added for constructors + { $$ = new_func_def( $1, ae_key_instance, NULL, "@construct", $4, $6, TRUE, @1.first_line, @1.first_column ); } + | function_decl AT_CTOR LPAREN RPAREN code_segment // 1.5.1.9 (ge) added for constructors + { $$ = new_func_def( $1, ae_key_instance, NULL, "@construct", NULL, $5, TRUE, @1.first_line, @1.first_column ); } | function_decl AT_DTOR LPAREN RPAREN code_segment // 1.5.1.9 (ge) added for destructor { $$ = new_func_def( $1, ae_key_instance, NULL, "@destruct", NULL, $5, TRUE, @1.first_line, @1.first_column ); } | function_decl AT_DTOR LPAREN arg_list RPAREN code_segment // 1.5.1.9 (ge) added for constructors diff --git a/src/core/chuck_scan.cpp b/src/core/chuck_scan.cpp index 3f2befcc1..2c74badb5 100644 --- a/src/core/chuck_scan.cpp +++ b/src/core/chuck_scan.cpp @@ -3118,17 +3118,24 @@ t_CKBOOL type_engine_scan2_func_def( Chuck_Env * env, a_Func_Def f ) } } - EM_error2( f->where, "cannot overload functions with identical arguments..." ); + EM_error2( f->where, "cannot overload %s with identical arguments...", isInCtor ? "constructor" : "function" ); if( env->class_def ) { EM_error3( " |- '%s %s.%s(%s)' already defined elsewhere", func->def()->ret_type->base_name.c_str(), env->class_def->c_name(), orig_name.c_str(), arglist2string(func->def()->arg_list).c_str() ); + // if a constructor definition + if( isInCtor ) + { + EM_error3( " |- (hint: possibly as '@construct(%s)' in class '%s')", + arglist2string(func->def()->arg_list).c_str(), env->class_def->c_name() ); + } } else { EM_error3( " |- '%s %s(%s)' already defined elsewhere", - func->def()->ret_type->base_name.c_str(), orig_name.c_str(), arglist2string(func->def()->arg_list).c_str() ); + func->def()->ret_type->base_name.c_str(), orig_name.c_str(), + arglist2string(func->def()->arg_list).c_str() ); } goto error; } diff --git a/src/test/06-Errors/error-overload-class.txt b/src/test/06-Errors/error-overload-class.txt index 05cd2d141..71c27ebad 100644 --- a/src/test/06-Errors/error-overload-class.txt +++ b/src/test/06-Errors/error-overload-class.txt @@ -1,4 +1,4 @@ -error-overload-class.ck:9:5: error: cannot overload functions with identical arguments... +error-overload-class.ck:9:5: error: cannot overload function with identical arguments... [9] fun void bar() ^ |- 'void Foo.bar()' already defined elsewhere diff --git a/src/test/06-Errors/error-overload-func.txt b/src/test/06-Errors/error-overload-func.txt index 4b4a2dab3..223185980 100644 --- a/src/test/06-Errors/error-overload-func.txt +++ b/src/test/06-Errors/error-overload-func.txt @@ -1,4 +1,4 @@ -error-overload-func.ck:6:1: error: cannot overload functions with identical arguments... +error-overload-func.ck:6:1: error: cannot overload function with identical arguments... [6] fun void bar() ^ |- 'void bar()' already defined elsewhere From 1fa17158ede31d16b3fd7174e72fa6411d661df0 Mon Sep 17 00:00:00 2001 From: Ge Wang Date: Wed, 15 Nov 2023 12:55:33 -0800 Subject: [PATCH 13/20] add static check and error message for constructors --- src/core/chuck_scan.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/core/chuck_scan.cpp b/src/core/chuck_scan.cpp index 2c74badb5..5c90d759f 100644 --- a/src/core/chuck_scan.cpp +++ b/src/core/chuck_scan.cpp @@ -1407,6 +1407,8 @@ t_CKBOOL type_engine_scan1_func_def( Chuck_Env * env, a_Func_Def f ) { a_Arg_List arg_list = NULL; t_CKUINT count = 0; + t_CKBOOL is_static = (env->class_def != NULL) && (f->static_decl == ae_key_static); + // substitute for @construct if( S_name(f->name) == string("@construct") ) { @@ -1466,17 +1468,28 @@ t_CKBOOL type_engine_scan1_func_def( Chuck_Env * env, a_Func_Def f ) // check if we are in a constructor if( isInCtor ) { + // check static + if( is_static ) + { + EM_error2( f->where, "constructor cannot be declared as 'static'..." ); + goto error; + } // check return type (must be void) if( !isa(f->ret_type, env->ckt_void) ) { - EM_error2( f->where, "constructor for class '%s' must return void...", - S_name(f->name) ); + EM_error2( f->where, "constructor must return void..." ); goto error; } } if( isInDtor ) { + // check static + if( is_static ) + { + EM_error2( f->where, "destructor cannot be declared as 'static'..." ); + goto error; + } // check return type (must be void) if( !isa(f->ret_type, env->ckt_void) ) { From 81bd8aac59fd15de7197c354e22f84606b861195 Mon Sep 17 00:00:00 2001 From: Ge Wang Date: Thu, 16 Nov 2023 00:03:47 -0800 Subject: [PATCH 14/20] more constructor and destructor tests --- examples/class/basic.ck | 36 ++++++++++++++++++++++++ examples/class/constructors.ck | 6 ++-- src/test/01-Basic/236-ctors-basic.ck | 4 ++- src/test/01-Basic/236-ctors-basic.txt | 3 +- src/test/01-Basic/238-ctor-order.ck | 17 +++++++++++ src/test/01-Basic/239-dtor-basic.ck | 15 ++++++++++ src/test/01-Basic/239-dtor-basic.txt | 1 + src/test/06-Errors/error-ctor-global.ck | 11 ++++++++ src/test/06-Errors/error-ctor-global.txt | 3 ++ src/test/06-Errors/error-ctor-return.ck | 6 ++++ src/test/06-Errors/error-ctor-return.txt | 3 ++ src/test/06-Errors/error-ctor-static.ck | 6 ++++ src/test/06-Errors/error-ctor-static.txt | 3 ++ src/test/06-Errors/error-dtor-access.ck | 15 ++++++++++ src/test/06-Errors/error-dtor-access.txt | 4 +++ 15 files changed, 128 insertions(+), 5 deletions(-) create mode 100644 examples/class/basic.ck create mode 100644 src/test/01-Basic/238-ctor-order.ck create mode 100644 src/test/01-Basic/239-dtor-basic.ck create mode 100644 src/test/01-Basic/239-dtor-basic.txt create mode 100644 src/test/06-Errors/error-ctor-global.ck create mode 100644 src/test/06-Errors/error-ctor-global.txt create mode 100644 src/test/06-Errors/error-ctor-return.ck create mode 100644 src/test/06-Errors/error-ctor-return.txt create mode 100644 src/test/06-Errors/error-ctor-static.ck create mode 100644 src/test/06-Errors/error-ctor-static.txt create mode 100644 src/test/06-Errors/error-dtor-access.ck create mode 100644 src/test/06-Errors/error-dtor-access.txt diff --git a/examples/class/basic.ck b/examples/class/basic.ck new file mode 100644 index 000000000..1cb2a656f --- /dev/null +++ b/examples/class/basic.ck @@ -0,0 +1,36 @@ +// basic constructors + destructor definition + +// a class +class Foo +{ + // a member variable + 1 => int num; + + // constructor "default" + fun @construct() { 2 => num; } + + // another constructor + fun @construct( int x ) { x => num; } + + // yet another constructor + fun @construct( int x, int y ) { x*y => num; } + + // alternate way of define a constructor + fun void Foo( int x, int y, int z ) { x*y*z => num; } + + // destructor + fun @destruct() { <<< "destructor:", this.num >>>; } +} + +// constructor "default" +Foo f0; +// constructor "default" +Foo f1(); +// another constructor +Foo f2(15); +// yet another constructor +new Foo(8,9) @=> Foo @ f3; +// yet another constructor +new Foo(10,11,12) @=> Foo @ f4; +// print +<<< f0.num, f1.num, f2.num, f3.num, f4.num >>>; diff --git a/examples/class/constructors.ck b/examples/class/constructors.ck index 168040ddc..470e58b4f 100644 --- a/examples/class/constructors.ck +++ b/examples/class/constructors.ck @@ -31,16 +31,16 @@ class Foo } // declare a Foo, invoke constructor 1 -Foo f1; +Foo f0; // declare a Foo, invoke constructor 1 -Foo f1a(); +Foo f1(); // declare a Foo, invoke constructor 2 Foo f2(15); // instantiate a Foo, invoke constructor 3 new Foo(8,9) @=> Foo @ f3; // print -<<< f1.num, f1a.num, f2.num, f3.num >>>; +<<< f0.num, f1.num, f2.num, f3.num >>>; // can also invoke constructor for each element in array Foo array1(2)[3]; diff --git a/src/test/01-Basic/236-ctors-basic.ck b/src/test/01-Basic/236-ctors-basic.ck index 197c0aca2..ecbc94864 100644 --- a/src/test/01-Basic/236-ctors-basic.ck +++ b/src/test/01-Basic/236-ctors-basic.ck @@ -30,6 +30,8 @@ class Foo } } +// declare a Foo, invoke constructor 1 +Foo f0; // declare a Foo, invoke constructor 1 Foo f1(); // declare a Foo, invoke constructor 2 @@ -38,4 +40,4 @@ Foo f2(15); new Foo(8,9) @=> Foo @ f3; // print -<<< f1.num, f2.num, f3.num >>>; +<<< f0.num, f1.num, f2.num, f3.num >>>; diff --git a/src/test/01-Basic/236-ctors-basic.txt b/src/test/01-Basic/236-ctors-basic.txt index 3152e7888..1255d4e8c 100644 --- a/src/test/01-Basic/236-ctors-basic.txt +++ b/src/test/01-Basic/236-ctors-basic.txt @@ -1,4 +1,5 @@ constructor 1: 2 +constructor 1: 2 constructor 2: 15 constructor 3: 8 9 -2 15 72 +2 2 15 72 diff --git a/src/test/01-Basic/238-ctor-order.ck b/src/test/01-Basic/238-ctor-order.ck new file mode 100644 index 000000000..e3e4604d2 --- /dev/null +++ b/src/test/01-Basic/238-ctor-order.ck @@ -0,0 +1,17 @@ +// verify pre-ctor is invoked even when object is declared before +// class definition + +// declare before class def +Foo foo; +// check values +if( foo.x == 5 && foo.y == 2 ) <<< "success" >>>; + +// class def +class Foo +{ + 5 => int x; + 0 => int y; + + // constructor + fun @construct() { 2 => y; } +} \ No newline at end of file diff --git a/src/test/01-Basic/239-dtor-basic.ck b/src/test/01-Basic/239-dtor-basic.ck new file mode 100644 index 000000000..7d96f0e5b --- /dev/null +++ b/src/test/01-Basic/239-dtor-basic.ck @@ -0,0 +1,15 @@ +// verify destructo is called + +class Foo +{ + // destructor + fun @destruct() + { + <<< "destructor called...", "" >>>; + } +} + +// instance +Foo foo; + +// destructor should be called when foo goes out of scope diff --git a/src/test/01-Basic/239-dtor-basic.txt b/src/test/01-Basic/239-dtor-basic.txt new file mode 100644 index 000000000..640fe8e8d --- /dev/null +++ b/src/test/01-Basic/239-dtor-basic.txt @@ -0,0 +1 @@ +destructor called... diff --git a/src/test/06-Errors/error-ctor-global.ck b/src/test/06-Errors/error-ctor-global.ck new file mode 100644 index 000000000..ab079f022 --- /dev/null +++ b/src/test/06-Errors/error-ctor-global.ck @@ -0,0 +1,11 @@ +// error case: global Object cannot invoke non-default constructors +global Foo foo(6); + +// public class def +public class Foo +{ + fun void Foo( int x ) + { + <<< "constructor:", x >>>; + } +} \ No newline at end of file diff --git a/src/test/06-Errors/error-ctor-global.txt b/src/test/06-Errors/error-ctor-global.txt new file mode 100644 index 000000000..f3cd3a748 --- /dev/null +++ b/src/test/06-Errors/error-ctor-global.txt @@ -0,0 +1,3 @@ +error-ctor-global.ck:2:12: error: 'global' variables cannot invoke non-default constructors... +[2] global Foo foo(6); + ^ diff --git a/src/test/06-Errors/error-ctor-return.ck b/src/test/06-Errors/error-ctor-return.ck new file mode 100644 index 000000000..3df0051d5 --- /dev/null +++ b/src/test/06-Errors/error-ctor-return.ck @@ -0,0 +1,6 @@ +// error case: constructors cannot return values + +class Foo +{ + fun int Foo() { return 1; } +} diff --git a/src/test/06-Errors/error-ctor-return.txt b/src/test/06-Errors/error-ctor-return.txt new file mode 100644 index 000000000..2bbfe1bf5 --- /dev/null +++ b/src/test/06-Errors/error-ctor-return.txt @@ -0,0 +1,3 @@ +error-ctor-return.ck:5:5: error: constructor must return void... +[5] fun int Foo() { return 1; } + ^ diff --git a/src/test/06-Errors/error-ctor-static.ck b/src/test/06-Errors/error-ctor-static.ck new file mode 100644 index 000000000..a8110e20a --- /dev/null +++ b/src/test/06-Errors/error-ctor-static.ck @@ -0,0 +1,6 @@ +// error case: constructors cannot be declared as static + +class Foo +{ + fun static void Foo() { } +} diff --git a/src/test/06-Errors/error-ctor-static.txt b/src/test/06-Errors/error-ctor-static.txt new file mode 100644 index 000000000..be9f2b6cc --- /dev/null +++ b/src/test/06-Errors/error-ctor-static.txt @@ -0,0 +1,3 @@ +error-ctor-static.ck:5:5: error: constructor cannot be declared as 'static'... +[5] fun static void Foo() { } + ^ diff --git a/src/test/06-Errors/error-dtor-access.ck b/src/test/06-Errors/error-dtor-access.ck new file mode 100644 index 000000000..ce7072c81 --- /dev/null +++ b/src/test/06-Errors/error-dtor-access.ck @@ -0,0 +1,15 @@ +// error case: destructors cannot access values outside the class + +int y; + +class Foo +{ + 5 => int x; + + fun @destruct() + { + <<< "destructor called...", y >>>; + } +} + +Foo foo; \ No newline at end of file diff --git a/src/test/06-Errors/error-dtor-access.txt b/src/test/06-Errors/error-dtor-access.txt new file mode 100644 index 000000000..69b725dfe --- /dev/null +++ b/src/test/06-Errors/error-dtor-access.txt @@ -0,0 +1,4 @@ +error-dtor-access.ck:11:37: error: cannot access local variable 'y' from within @destruct() +[11] <<< "destructor called...", y >>>; + ^ +error-dtor-access.ck: ...in function 'void Foo.@destruct()' From 7bafa11121257f6faf66c5e9edd490e18721d254 Mon Sep 17 00:00:00 2001 From: Ge Wang Date: Thu, 16 Nov 2023 00:07:58 -0800 Subject: [PATCH 15/20] add ctor-default test --- src/test/01-Basic/239-ctor-default.ck | 24 +++++++++++++++++++ .../{239-dtor-basic.ck => 240-dtor-basic.ck} | 0 ...{239-dtor-basic.txt => 240-dtor-basic.txt} | 0 3 files changed, 24 insertions(+) create mode 100644 src/test/01-Basic/239-ctor-default.ck rename src/test/01-Basic/{239-dtor-basic.ck => 240-dtor-basic.ck} (100%) rename src/test/01-Basic/{239-dtor-basic.txt => 240-dtor-basic.txt} (100%) diff --git a/src/test/01-Basic/239-ctor-default.ck b/src/test/01-Basic/239-ctor-default.ck new file mode 100644 index 000000000..b7c5a56e6 --- /dev/null +++ b/src/test/01-Basic/239-ctor-default.ck @@ -0,0 +1,24 @@ +// verify that default constructor is invoked with or without () + +// a class +class Foo +{ + // a member var + int x; + + // default constructor + fun void Foo() + { + 5 => x; + } +} + +// instantiate with and without () +new Foo @=> Foo @ f1; +new Foo() @=> Foo @ f2; +Foo f3; +Foo f4(); + +// test +if( f1.x == 5 && f2.x == 5 && f3.x == 5 && f4.x == 5 ) + <<< "success" >>>; diff --git a/src/test/01-Basic/239-dtor-basic.ck b/src/test/01-Basic/240-dtor-basic.ck similarity index 100% rename from src/test/01-Basic/239-dtor-basic.ck rename to src/test/01-Basic/240-dtor-basic.ck diff --git a/src/test/01-Basic/239-dtor-basic.txt b/src/test/01-Basic/240-dtor-basic.txt similarity index 100% rename from src/test/01-Basic/239-dtor-basic.txt rename to src/test/01-Basic/240-dtor-basic.txt From e4f06ac76bc0eb2aa68963fcb495464fb1ecad25 Mon Sep 17 00:00:00 2001 From: Ge Wang Date: Thu, 16 Nov 2023 00:22:41 -0800 Subject: [PATCH 16/20] support option to omit fun return type --- src/core/chuck.y | 4 ++++ src/test/01-Basic/236-ctors-basic.ck | 15 ++++++++++++--- src/test/01-Basic/236-ctors-basic.txt | 3 ++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/core/chuck.y b/src/core/chuck.y index b1cd36953..bde650c2c 100644 --- a/src/core/chuck.y +++ b/src/core/chuck.y @@ -267,6 +267,10 @@ function_definition { $$ = new_func_def( $1, $2, $3, $4, $6, $8, TRUE, @1.first_line, @1.first_column ); } | function_decl static_decl type_decl2 ID LPAREN RPAREN code_segment { $$ = new_func_def( $1, $2, $3, $4, NULL, $7, TRUE, @1.first_line, @1.first_column ); } + | function_decl static_decl ID LPAREN arg_list RPAREN code_segment + { $$ = new_func_def( $1, $2, NULL, $3, $5, $7, TRUE, @1.first_line, @1.first_column ); } + | function_decl static_decl ID LPAREN RPAREN code_segment + { $$ = new_func_def( $1, $2, NULL, $3, NULL, $6, TRUE, @1.first_line, @1.first_column ); } | function_decl AT_CTOR LPAREN arg_list RPAREN code_segment // 1.5.1.9 (ge) added for constructors { $$ = new_func_def( $1, ae_key_instance, NULL, "@construct", $4, $6, TRUE, @1.first_line, @1.first_column ); } | function_decl AT_CTOR LPAREN RPAREN code_segment // 1.5.1.9 (ge) added for constructors diff --git a/src/test/01-Basic/236-ctors-basic.ck b/src/test/01-Basic/236-ctors-basic.ck index ecbc94864..d7679d06c 100644 --- a/src/test/01-Basic/236-ctors-basic.ck +++ b/src/test/01-Basic/236-ctors-basic.ck @@ -9,14 +9,14 @@ class Foo 1 => int num; // constructor 1 "default" - fun void Foo() + fun @construct() { 2 => num; <<< "constructor 1:", num >>>; } // constructor 2 - fun void Foo( int x ) + fun @construct( int x ) { x => num; <<< "constructor 2:", x >>>; @@ -28,6 +28,13 @@ class Foo x*y => num; <<< "constructor 3:", x, y >>>; } + + // constructor 4 (okay to omit void return type) + fun Foo( int x, int y, int z ) + { + x*y*z => num; + <<< "constructor 4:", x, y, z >>>; + } } // declare a Foo, invoke constructor 1 @@ -38,6 +45,8 @@ Foo f1(); Foo f2(15); // instantiate a Foo, invoke constructor 3 new Foo(8,9) @=> Foo @ f3; +// instantiate a Foo, invoke constructor 4 +new Foo(10,11,12) @=> Foo @ f4; // print -<<< f0.num, f1.num, f2.num, f3.num >>>; +<<< f0.num, f1.num, f2.num, f3.num, f4.num >>>; diff --git a/src/test/01-Basic/236-ctors-basic.txt b/src/test/01-Basic/236-ctors-basic.txt index 1255d4e8c..263e630fa 100644 --- a/src/test/01-Basic/236-ctors-basic.txt +++ b/src/test/01-Basic/236-ctors-basic.txt @@ -2,4 +2,5 @@ constructor 1: 2 constructor 1: 2 constructor 2: 15 constructor 3: 8 9 -2 2 15 72 +constructor 4: 10 11 12 +2 2 15 72 1320 From e063166a9b47fa0f87c48986d9608ae6950693ea Mon Sep 17 00:00:00 2001 From: Ge Wang Date: Thu, 16 Nov 2023 01:14:38 -0800 Subject: [PATCH 17/20] add ckdoc support for constructors --- examples/class/{basic.ck => ctors-dtor.ck} | 2 +- src/core/chuck_type.cpp | 85 +++++++++++--- src/core/chuck_type.h | 12 +- src/core/ulib_doc.cpp | 126 ++++++++++++++------- src/core/ulib_doc.h | 1 + src/scripts/ckdoc/test-class.ck | 23 +++- 6 files changed, 185 insertions(+), 64 deletions(-) rename examples/class/{basic.ck => ctors-dtor.ck} (92%) diff --git a/examples/class/basic.ck b/examples/class/ctors-dtor.ck similarity index 92% rename from examples/class/basic.ck rename to examples/class/ctors-dtor.ck index 1cb2a656f..65a4ee1b6 100644 --- a/examples/class/basic.ck +++ b/examples/class/ctors-dtor.ck @@ -1,4 +1,4 @@ -// basic constructors + destructor definition +// example: defining basic class constructors + destructor // a class class Foo diff --git a/src/core/chuck_type.cpp b/src/core/chuck_type.cpp index 4b766f6d1..b3b962e51 100644 --- a/src/core/chuck_type.cpp +++ b/src/core/chuck_type.cpp @@ -9517,22 +9517,28 @@ void Chuck_Type::apropos() //----------------------------------------------------------------------------- -// comparer +// comparers //----------------------------------------------------------------------------- -static bool comp_func( Chuck_Func * a, Chuck_Func * b ) +bool ck_comp_func( Chuck_Func * a, Chuck_Func * b ) { return a->name < b->name; } - -//----------------------------------------------------------------------------- -// comparer -//----------------------------------------------------------------------------- -static bool comp_value( Chuck_Value * a, Chuck_Value * b ) +bool ck_comp_func_args( Chuck_Func * a, Chuck_Func * b ) +{ + // if names not same + if( a->name != b->name ) return a->name < b->name; + // num args + t_CKUINT numA = 0, numB = 0; + // arguments + a_Arg_List argsA = a->def()->arg_list, argsB = b->def()->arg_list; + // count + while( argsA ) { numA++; argsA = argsA->next; } + while( argsB ) { numB++; argsB = argsB->next; } + // compare num args + return numA < numB; +} +bool ck_comp_value( Chuck_Value * a, Chuck_Value * b ) { - string lowerA = a->name;; - for( std::string::size_type i = 0; i < lowerA.length(); i++) - lowerA[i] = tolower(a->name[i]); - string lowerB = b->name;; - for( std::string::size_type i = 0; i < lowerB.length(); i++) - lowerB[i] = tolower(b->name[i]); + string lowerA = tolower( a->name ); + string lowerB = tolower( b->name ); // if not the same if( lowerA != lowerB ) return lowerA < lowerB; // if same, favor lower-case @@ -9705,10 +9711,14 @@ void Chuck_Type::apropos_funcs( std::string & output, // retrieve functions in this type this->info->get_funcs(funcs); + // constructors + vector ctors; // member functions vector mfuncs; // static functions vector sfuncs; + // destructor + Chuck_Func * dtor = NULL; // counter by name map func_names; @@ -9736,8 +9746,40 @@ void Chuck_Type::apropos_funcs( std::string & output, // append to static funcs list sfuncs.push_back( theFunc ); } else { + // append to constructors | 1.5.1.9 + if( theFunc->is_ctor ) ctors.push_back( theFunc ); + // set as destructor | 1.5.1.9 + else if( theFunc->is_dtor ) dtor = theFunc; // append to static funcs list - mfuncs.push_back( theFunc ); + else mfuncs.push_back( theFunc ); + } + } + + // have constructors? + if( ctors.size() > 0 ) + { + // type name + string theName = this->name() + " " + "constructors"; + // number of '-' + t_CKUINT n = theName.length(); t_CKUINT i; + // output + for( i = 0; i < n; i++ ) { sout << "-"; } + sout << endl << theName << endl; + for( i = 0; i < n; i++ ) { sout << "-"; } + sout << endl; + } + // sort + sort( ctors.begin(), ctors.end(), ck_comp_func_args ); + // output constructors | 1.5.1.9 + if( ctors.size() ) + { + // iterate over member functions + for( vector::iterator f = ctors.begin(); f != ctors.end(); f++ ) + { + // pointer to chuck func + Chuck_Func * theFunc = *f; + // output function content + apropos_func( sout, theFunc, PREFIX ); } } @@ -9756,8 +9798,8 @@ void Chuck_Type::apropos_funcs( std::string & output, } // sort - sort( mfuncs.begin(), mfuncs.end(), comp_func ); - sort( sfuncs.begin(), sfuncs.end(), comp_func ); + sort( mfuncs.begin(), mfuncs.end(), ck_comp_func ); + sort( sfuncs.begin(), sfuncs.end(), ck_comp_func ); // one or more member functions? if( mfuncs.size() ) @@ -9784,6 +9826,13 @@ void Chuck_Type::apropos_funcs( std::string & output, apropos_func( sout, theFunc, PREFIX ); } } + + // has destructor? | 1.5.1.9 + if( dtor ) + { + // output function content + // apropos_func( sout, dtor, PREFIX ); + } } // output to string @@ -9883,8 +9932,8 @@ void Chuck_Type::apropos_vars( std::string & output, const std::string & PREFIX, } // sort - sort( mvars.begin(), mvars.end(), comp_value ); - sort( svars.begin(), svars.end(), comp_value ); + sort( mvars.begin(), mvars.end(), ck_comp_value ); + sort( svars.begin(), svars.end(), ck_comp_value ); // one or more static vars? if( mvars.size() ) diff --git a/src/core/chuck_type.h b/src/core/chuck_type.h index 05c533ddc..3a2f73f38 100644 --- a/src/core/chuck_type.h +++ b/src/core/chuck_type.h @@ -1347,10 +1347,6 @@ Chuck_Func * type_engine_lookup_ctor( Chuck_Env * env, Chuck_Type * type, a_Exp Chuck_Func * type_engine_lookup_dtor( Chuck_Env * env, Chuck_Type * type ); - - - - //----------------------------------------------------------------------------- // spencer: added this into function to provide the same logic path // for type_engine_check_exp_decl() and ck_add_mvar() when they determine @@ -1388,6 +1384,14 @@ t_CKBOOL same_arg_lists( a_Arg_List lhs, a_Arg_List rhs ); std::string arglist2string( a_Arg_List list ); +//----------------------------------------------------------------------------- +// compare functions | 1.5.1.9 (ge) added +//----------------------------------------------------------------------------- +bool ck_comp_func( Chuck_Func * a, Chuck_Func * b ); +bool ck_comp_func_args( Chuck_Func * a, Chuck_Func * b ); +bool ck_comp_value( Chuck_Value * a, Chuck_Value * b ); + + #endif diff --git a/src/core/ulib_doc.cpp b/src/core/ulib_doc.cpp index b536c35ef..1c8072f2b 100644 --- a/src/core/ulib_doc.cpp +++ b/src/core/ulib_doc.cpp @@ -444,6 +444,16 @@ class CKDocHTMLOutput : public CKDocOutput m_outputStr += "\n"; } + void begin_ctors() // 1.5.1.9 + { + m_outputStr += "

constructors

\n
\n"; + } + + void begin_dtor() // 1.5.1.9 + { + m_outputStr += "

destructor

\n
\n"; + } + void begin_member_funcs() { m_outputStr += "

member functions

\n
\n"; @@ -975,17 +985,6 @@ string CKDoc::genCSS() -//----------------------------------------------------------------------------- -// compare functions -//----------------------------------------------------------------------------- -bool comp_func(Chuck_Func *a, Chuck_Func *b) -{ return a->name < b->name; } -bool comp_value(Chuck_Value *a, Chuck_Value *b) -{ return a->name < b->name; } - - - - //----------------------------------------------------------------------------- // name: genGroups() // desc: generate all added groups, return each in a separate entry @@ -1150,6 +1149,8 @@ string CKDoc::genType( Chuck_Type * type, t_CKBOOL clearOutput ) map func_names; // member and static functions and values + vector ctors; + Chuck_Func * dtor = NULL; vector mfuncs; vector sfuncs; vector mvars; @@ -1193,43 +1194,65 @@ string CKDoc::genType( Chuck_Type * type, t_CKBOOL clearOutput ) // first one func_names[func->name] = 1; // static or instance? - if(func->def()->static_decl == ae_key_static) sfuncs.push_back(func); - else mfuncs.push_back(func); + if( func->def()->static_decl == ae_key_static ) sfuncs.push_back(func); + else + { + // constructor? + if( func->is_ctor ) ctors.push_back(func); + // destructor? + else if( func->is_dtor ) dtor = func; + // other member function? + else mfuncs.push_back(func); + } } // sort - sort(svars.begin(), svars.end(), comp_value); - sort(mvars.begin(), mvars.end(), comp_value); - sort(sfuncs.begin(), sfuncs.end(), comp_func); - sort(mfuncs.begin(), mfuncs.end(), comp_func); - - // static functions - if( sfuncs.size() ) + sort( svars.begin(), svars.end(), ck_comp_value ); + sort( mvars.begin(), mvars.end(), ck_comp_value ); + sort( sfuncs.begin(), sfuncs.end(), ck_comp_func ); + sort( mfuncs.begin(), mfuncs.end(), ck_comp_func ); + sort( ctors.begin(), ctors.end(), ck_comp_func_args ); + + // constructors | 1.5.1.9 (ge) added + if( ctors.size() ) { - // begin static functions - output->begin_static_member_funcs(); + // begin member functions + output->begin_ctors(); // iterate - for( vector::iterator f = sfuncs.begin(); f != sfuncs.end(); f++ ) + for( vector::iterator f = ctors.begin(); f != ctors.end(); f++ ) { // the func Chuck_Func * func = *f; - // begin output - output->begin_static_member_func(func); + // begin the func + output->begin_member_func(func); // argument list a_Arg_List args = func->def()->arg_list; while(args != NULL) { // output argument - output->func_arg( args ); + output->func_arg(args); args = args->next; } - // end output - output->end_static_member_func(); + // end the func + output->end_member_func(); } - // end static functions - output->end_static_member_funcs(); + // end member functions + output->end_member_funcs(); } + // destructor | 1.5.1.9 (ge) added + // if( dtor ) + // { + // // begin member functions + // output->begin_dtor(); + // // begin the func | no args + // output->begin_member_func(dtor); + // // end the func + // output->end_member_func(); + // // end member functions + // output->end_member_funcs(); + // } + // member functions if( mfuncs.size() ) { @@ -1257,16 +1280,31 @@ string CKDoc::genType( Chuck_Type * type, t_CKBOOL clearOutput ) output->end_member_funcs(); } - // static vars - if( svars.size() ) + // static functions + if( sfuncs.size() ) { - // start output - output->begin_static_member_vars(); + // begin static functions + output->begin_static_member_funcs(); // iterate - for( vector::iterator v = svars.begin(); v != svars.end(); v++ ) - output->static_member_var(*v); - // end output - output->end_static_member_vars(); + for( vector::iterator f = sfuncs.begin(); f != sfuncs.end(); f++ ) + { + // the func + Chuck_Func * func = *f; + // begin output + output->begin_static_member_func(func); + // argument list + a_Arg_List args = func->def()->arg_list; + while(args != NULL) + { + // output argument + output->func_arg( args ); + args = args->next; + } + // end output + output->end_static_member_func(); + } + // end static functions + output->end_static_member_funcs(); } // member vars @@ -1280,6 +1318,18 @@ string CKDoc::genType( Chuck_Type * type, t_CKBOOL clearOutput ) // end output->end_member_vars(); } + + // static vars + if( svars.size() ) + { + // start output + output->begin_static_member_vars(); + // iterate + for( vector::iterator v = svars.begin(); v != svars.end(); v++ ) + output->static_member_var(*v); + // end output + output->end_static_member_vars(); + } } // end the type output->end_class(); diff --git a/src/core/ulib_doc.h b/src/core/ulib_doc.h index e800371c8..7fc9985b4 100644 --- a/src/core/ulib_doc.h +++ b/src/core/ulib_doc.h @@ -107,6 +107,7 @@ class CKDocOutput // class functions virtual void begin_static_member_funcs() = 0; virtual void end_static_member_funcs() = 0; + virtual void begin_ctors() = 0; virtual void begin_member_funcs() = 0; virtual void end_member_funcs() = 0; diff --git a/src/scripts/ckdoc/test-class.ck b/src/scripts/ckdoc/test-class.ck index e3cb63de8..f2d2f63b2 100644 --- a/src/scripts/ckdoc/test-class.ck +++ b/src/scripts/ckdoc/test-class.ck @@ -4,6 +4,20 @@ public class Foo int a; /** b is a float; nothing uses this either. */ float b; + /** a number, type integer */ + 1 => int num; + + /** constructor "default" */ + fun @construct() { 2 => num; } + + /** another constructor */ + fun @construct( int x ) { x => num; } + + /** yet another constructor */ + fun @construct( int x, int y ) { x*y => num; } + + /** alternate way of define a constructor */ + fun void Foo( int x, int y, int z ) { x*y*z => num; } /** this function does nothing. */ fun void bar( int x ) @@ -13,13 +27,16 @@ public class Foo //=> this function does nothing /*=> */ } + + /** destructor */ + fun @destruct() { <<< "destructor:", this.num >>>; } } +// get Type [ Foo.typeOf() ] @=> Type types[]; - +// doc generator CKDoc doc; - +// add group doc.addGroup( types, "my classes!", "my", "Will this work?" ); - // generate doc.outputToDir( ".", "My Class Library" ); From 2fd86001db91db8c9a0b3d3f7e24ead1e660c950 Mon Sep 17 00:00:00 2001 From: Ge Wang Date: Thu, 16 Nov 2023 01:19:52 -0800 Subject: [PATCH 18/20] update chuck_yacc --- src/core/chuck_yacc.c | 2896 +++++++++++++++++++++-------------------- src/core/chuck_yacc.h | 8 +- 2 files changed, 1501 insertions(+), 1403 deletions(-) diff --git a/src/core/chuck_yacc.c b/src/core/chuck_yacc.c index 71aa2df38..f0a1f3392 100644 --- a/src/core/chuck_yacc.c +++ b/src/core/chuck_yacc.c @@ -179,7 +179,9 @@ GRUCK_LEFT = 368, UNGRUCK_RIGHT = 369, UNGRUCK_LEFT = 370, - AT_OP = 371 + AT_OP = 371, + AT_CTOR = 372, + AT_DTOR = 373 }; #endif /* Tokens. */ @@ -297,6 +299,8 @@ #define UNGRUCK_RIGHT 369 #define UNGRUCK_LEFT 370 #define AT_OP 371 +#define AT_CTOR 372 +#define AT_DTOR 373 @@ -407,7 +411,7 @@ typedef union YYSTYPE a_Vec vec_exp; // ge: added 1.3.5.3 } /* Line 193 of yacc.c. */ -#line 411 "chuck.tab.c" +#line 415 "chuck.tab.c" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 @@ -432,7 +436,7 @@ typedef struct YYLTYPE /* Line 216 of yacc.c. */ -#line 436 "chuck.tab.c" +#line 440 "chuck.tab.c" #ifdef short # undef short @@ -649,20 +653,20 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 122 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1871 +#define YYLAST 1993 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 117 +#define YYNTOKENS 119 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 59 /* YYNRULES -- Number of rules. */ -#define YYNRULES 249 +#define YYNRULES 255 /* YYNRULES -- Number of states. */ -#define YYNSTATES 411 +#define YYNSTATES 432 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 371 +#define YYMAXUTOK 373 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -707,7 +711,7 @@ static const yytype_uint8 yytranslate[] = 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116 + 115, 116, 117, 118 }; #if YYDEBUG @@ -718,144 +722,150 @@ static const yytype_uint16 yyprhs[] = 0, 0, 3, 5, 8, 10, 12, 14, 21, 29, 36, 44, 47, 52, 55, 60, 62, 63, 65, 68, 70, 72, 74, 77, 79, 83, 85, 89, 98, 106, - 115, 123, 133, 143, 155, 167, 169, 171, 172, 174, - 176, 178, 180, 182, 184, 185, 187, 190, 194, 199, - 201, 203, 205, 208, 211, 216, 218, 221, 223, 225, - 227, 229, 231, 234, 238, 241, 244, 250, 258, 264, - 272, 279, 287, 295, 301, 309, 315, 318, 322, 324, - 327, 329, 333, 335, 339, 341, 345, 349, 354, 359, - 365, 368, 372, 374, 377, 381, 385, 389, 392, 396, - 398, 402, 404, 407, 410, 414, 419, 424, 430, 434, - 438, 442, 444, 446, 448, 450, 452, 454, 456, 458, - 460, 462, 464, 466, 468, 470, 472, 474, 476, 478, - 480, 482, 484, 490, 492, 496, 498, 502, 504, 508, - 510, 514, 516, 520, 522, 526, 530, 532, 536, 540, - 544, 548, 550, 554, 558, 560, 564, 568, 570, 574, - 578, 582, 584, 588, 590, 594, 596, 599, 602, 605, - 608, 611, 614, 618, 623, 629, 635, 642, 644, 646, - 648, 650, 652, 655, 657, 659, 661, 663, 665, 667, - 669, 671, 673, 675, 677, 679, 681, 683, 685, 687, - 689, 691, 693, 695, 697, 699, 701, 703, 705, 707, - 709, 711, 713, 715, 717, 719, 721, 723, 725, 727, - 729, 731, 733, 735, 737, 739, 741, 743, 745, 747, - 749, 753, 755, 758, 762, 767, 771, 774, 777, 779, - 781, 783, 785, 787, 789, 791, 793, 795, 799, 803 + 114, 121, 128, 134, 140, 147, 156, 164, 174, 184, + 196, 208, 210, 212, 213, 215, 217, 219, 221, 223, + 225, 226, 228, 231, 235, 240, 242, 244, 246, 249, + 252, 257, 259, 262, 264, 266, 268, 270, 272, 275, + 279, 282, 285, 291, 299, 305, 313, 320, 328, 336, + 342, 350, 356, 359, 363, 365, 368, 370, 374, 376, + 380, 382, 386, 390, 395, 400, 406, 409, 413, 415, + 418, 422, 426, 430, 433, 437, 439, 443, 445, 448, + 451, 455, 460, 465, 471, 475, 479, 483, 485, 487, + 489, 491, 493, 495, 497, 499, 501, 503, 505, 507, + 509, 511, 513, 515, 517, 519, 521, 523, 525, 531, + 533, 537, 539, 543, 545, 549, 551, 555, 557, 561, + 563, 567, 571, 573, 577, 581, 585, 589, 591, 595, + 599, 601, 605, 609, 611, 615, 619, 623, 625, 629, + 631, 635, 637, 640, 643, 646, 649, 652, 655, 659, + 664, 670, 676, 683, 685, 687, 689, 691, 693, 696, + 698, 700, 702, 704, 706, 708, 710, 712, 714, 716, + 718, 720, 722, 724, 726, 728, 730, 732, 734, 736, + 738, 740, 742, 744, 746, 748, 750, 752, 754, 756, + 758, 760, 762, 764, 766, 768, 770, 772, 774, 776, + 778, 780, 782, 784, 786, 788, 790, 794, 796, 799, + 803, 808, 812, 815, 818, 820, 822, 824, 826, 828, + 830, 832, 834, 836, 840, 844 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int16 yyrhs[] = { - 118, 0, -1, 119, -1, 118, 119, -1, 137, -1, - 128, -1, 120, -1, 129, 97, 126, 16, 122, 17, - -1, 129, 97, 126, 121, 16, 122, 17, -1, 129, - 98, 126, 16, 122, 17, -1, 129, 98, 126, 125, - 16, 122, 17, -1, 100, 126, -1, 100, 126, 99, - 127, -1, 99, 127, -1, 99, 127, 100, 126, -1, - 123, -1, -1, 124, -1, 124, 123, -1, 137, -1, - 128, -1, 120, -1, 99, 126, -1, 3, -1, 3, - 9, 126, -1, 3, -1, 3, 18, 127, -1, 130, - 131, 135, 3, 12, 136, 13, 142, -1, 130, 131, - 135, 3, 12, 13, 142, -1, 130, 131, 135, 3, - 12, 136, 13, 11, -1, 130, 131, 135, 3, 12, - 13, 11, -1, 130, 131, 135, 116, 172, 12, 136, - 13, 142, -1, 130, 131, 135, 116, 12, 136, 13, - 172, 142, -1, 130, 131, 135, 116, 12, 172, 13, - 12, 136, 13, 142, -1, 130, 131, 135, 116, 12, - 136, 13, 12, 172, 13, 142, -1, 101, -1, 103, - -1, -1, 43, -1, 101, -1, 102, -1, 103, -1, - 104, -1, 105, -1, -1, 3, -1, 3, 71, -1, - 26, 127, 28, -1, 26, 127, 28, 71, -1, 132, - -1, 133, -1, 134, -1, 134, 148, -1, 134, 151, - -1, 134, 151, 9, 136, -1, 138, -1, 137, 138, - -1, 143, -1, 141, -1, 140, -1, 139, -1, 142, - -1, 44, 11, -1, 44, 144, 11, -1, 40, 11, - -1, 41, 11, -1, 33, 12, 144, 13, 138, -1, - 33, 12, 144, 13, 138, 35, 138, -1, 36, 12, - 144, 13, 138, -1, 38, 138, 36, 12, 144, 13, - 11, -1, 37, 12, 143, 143, 13, 138, -1, 37, - 12, 143, 143, 144, 13, 138, -1, 37, 12, 144, - 10, 144, 13, 138, -1, 64, 12, 144, 13, 138, - -1, 38, 138, 64, 12, 144, 13, 11, -1, 39, - 12, 144, 13, 138, -1, 16, 17, -1, 16, 137, - 17, -1, 11, -1, 144, 11, -1, 145, -1, 144, - 9, 145, -1, 146, -1, 145, 155, 146, -1, 149, - -1, 146, 156, 149, -1, 14, 144, 15, -1, 14, - 144, 9, 15, -1, 14, 144, 15, 147, -1, 14, - 144, 9, 15, 147, -1, 14, 15, -1, 148, 14, - 15, -1, 157, -1, 134, 150, -1, 65, 134, 150, - -1, 66, 134, 150, -1, 104, 134, 150, -1, 76, - 150, -1, 104, 76, 150, -1, 151, -1, 151, 9, - 150, -1, 3, -1, 3, 147, -1, 3, 148, -1, - 3, 12, 13, -1, 3, 12, 144, 13, -1, 3, - 12, 13, 147, -1, 3, 12, 144, 13, 147, -1, - 53, 144, 13, -1, 54, 144, 13, -1, 55, 144, - 13, -1, 90, -1, 93, -1, 77, -1, 78, -1, - 79, -1, 80, -1, 84, -1, 85, -1, 86, -1, - 95, -1, 96, -1, 81, -1, 82, -1, 83, -1, - 109, -1, 108, -1, 113, -1, 112, -1, 115, -1, - 114, -1, 158, -1, 158, 45, 144, 10, 157, -1, - 159, -1, 158, 31, 159, -1, 160, -1, 159, 30, - 160, -1, 161, -1, 160, 47, 161, -1, 162, -1, - 161, 49, 162, -1, 163, -1, 162, 48, 163, -1, - 164, -1, 163, 24, 164, -1, 163, 25, 164, -1, - 165, -1, 164, 26, 165, -1, 164, 28, 165, -1, - 164, 27, 165, -1, 164, 29, 165, -1, 166, -1, - 165, 88, 166, -1, 165, 87, 166, -1, 167, -1, - 166, 19, 167, -1, 166, 20, 167, -1, 168, -1, - 167, 21, 168, -1, 167, 22, 168, -1, 167, 23, - 168, -1, 169, -1, 168, 89, 169, -1, 170, -1, - 169, 52, 134, -1, 173, -1, 50, 170, -1, 51, - 170, -1, 171, 170, -1, 75, 170, -1, 74, 170, - -1, 73, 134, -1, 73, 134, 147, -1, 73, 134, - 12, 13, -1, 73, 134, 12, 144, 13, -1, 73, - 134, 12, 13, 147, -1, 73, 134, 12, 144, 13, - 147, -1, 19, -1, 20, -1, 89, -1, 46, -1, - 21, -1, 107, 89, -1, 90, -1, 19, -1, 20, - -1, 21, -1, 22, -1, 23, -1, 24, -1, 25, - -1, 26, -1, 27, -1, 28, -1, 29, -1, 30, - -1, 31, -1, 32, -1, 46, -1, 47, -1, 48, - -1, 49, -1, 50, -1, 51, -1, 52, -1, 72, - -1, 77, -1, 78, -1, 79, -1, 80, -1, 81, - -1, 82, -1, 83, -1, 84, -1, 85, -1, 86, - -1, 87, -1, 88, -1, 89, -1, 91, -1, 93, - -1, 95, -1, 96, -1, 108, -1, 109, -1, 112, - -1, 113, -1, 114, -1, 115, -1, 174, -1, 173, - 91, 174, -1, 175, -1, 174, 147, -1, 174, 12, - 13, -1, 174, 12, 144, 13, -1, 174, 18, 3, - -1, 174, 50, -1, 174, 51, -1, 3, -1, 6, - -1, 7, -1, 4, -1, 5, -1, 147, -1, 152, - -1, 153, -1, 154, -1, 110, 144, 111, -1, 12, - 144, 13, -1, 12, 13, -1 + 120, 0, -1, 121, -1, 120, 121, -1, 139, -1, + 130, -1, 122, -1, 131, 97, 128, 16, 124, 17, + -1, 131, 97, 128, 123, 16, 124, 17, -1, 131, + 98, 128, 16, 124, 17, -1, 131, 98, 128, 127, + 16, 124, 17, -1, 100, 128, -1, 100, 128, 99, + 129, -1, 99, 129, -1, 99, 129, 100, 128, -1, + 125, -1, -1, 126, -1, 126, 125, -1, 139, -1, + 130, -1, 122, -1, 99, 128, -1, 3, -1, 3, + 9, 128, -1, 3, -1, 3, 18, 129, -1, 132, + 133, 137, 3, 12, 138, 13, 144, -1, 132, 133, + 137, 3, 12, 13, 144, -1, 132, 133, 3, 12, + 138, 13, 144, -1, 132, 133, 3, 12, 13, 144, + -1, 132, 117, 12, 138, 13, 144, -1, 132, 117, + 12, 13, 144, -1, 132, 118, 12, 13, 144, -1, + 132, 118, 12, 138, 13, 144, -1, 132, 133, 137, + 3, 12, 138, 13, 11, -1, 132, 133, 137, 3, + 12, 13, 11, -1, 132, 133, 137, 116, 174, 12, + 138, 13, 144, -1, 132, 133, 137, 116, 12, 138, + 13, 174, 144, -1, 132, 133, 137, 116, 12, 174, + 13, 12, 138, 13, 144, -1, 132, 133, 137, 116, + 12, 138, 13, 12, 174, 13, 144, -1, 101, -1, + 103, -1, -1, 43, -1, 101, -1, 102, -1, 103, + -1, 104, -1, 105, -1, -1, 3, -1, 3, 71, + -1, 26, 129, 28, -1, 26, 129, 28, 71, -1, + 134, -1, 135, -1, 136, -1, 136, 150, -1, 136, + 153, -1, 136, 153, 9, 138, -1, 140, -1, 139, + 140, -1, 145, -1, 143, -1, 142, -1, 141, -1, + 144, -1, 44, 11, -1, 44, 146, 11, -1, 40, + 11, -1, 41, 11, -1, 33, 12, 146, 13, 140, + -1, 33, 12, 146, 13, 140, 35, 140, -1, 36, + 12, 146, 13, 140, -1, 38, 140, 36, 12, 146, + 13, 11, -1, 37, 12, 145, 145, 13, 140, -1, + 37, 12, 145, 145, 146, 13, 140, -1, 37, 12, + 146, 10, 146, 13, 140, -1, 64, 12, 146, 13, + 140, -1, 38, 140, 64, 12, 146, 13, 11, -1, + 39, 12, 146, 13, 140, -1, 16, 17, -1, 16, + 139, 17, -1, 11, -1, 146, 11, -1, 147, -1, + 146, 9, 147, -1, 148, -1, 147, 157, 148, -1, + 151, -1, 148, 158, 151, -1, 14, 146, 15, -1, + 14, 146, 9, 15, -1, 14, 146, 15, 149, -1, + 14, 146, 9, 15, 149, -1, 14, 15, -1, 150, + 14, 15, -1, 159, -1, 136, 152, -1, 65, 136, + 152, -1, 66, 136, 152, -1, 104, 136, 152, -1, + 76, 152, -1, 104, 76, 152, -1, 153, -1, 153, + 9, 152, -1, 3, -1, 3, 149, -1, 3, 150, + -1, 3, 12, 13, -1, 3, 12, 146, 13, -1, + 3, 12, 13, 149, -1, 3, 12, 146, 13, 149, + -1, 53, 146, 13, -1, 54, 146, 13, -1, 55, + 146, 13, -1, 90, -1, 93, -1, 77, -1, 78, + -1, 79, -1, 80, -1, 84, -1, 85, -1, 86, + -1, 95, -1, 96, -1, 81, -1, 82, -1, 83, + -1, 109, -1, 108, -1, 113, -1, 112, -1, 115, + -1, 114, -1, 160, -1, 160, 45, 146, 10, 159, + -1, 161, -1, 160, 31, 161, -1, 162, -1, 161, + 30, 162, -1, 163, -1, 162, 47, 163, -1, 164, + -1, 163, 49, 164, -1, 165, -1, 164, 48, 165, + -1, 166, -1, 165, 24, 166, -1, 165, 25, 166, + -1, 167, -1, 166, 26, 167, -1, 166, 28, 167, + -1, 166, 27, 167, -1, 166, 29, 167, -1, 168, + -1, 167, 88, 168, -1, 167, 87, 168, -1, 169, + -1, 168, 19, 169, -1, 168, 20, 169, -1, 170, + -1, 169, 21, 170, -1, 169, 22, 170, -1, 169, + 23, 170, -1, 171, -1, 170, 89, 171, -1, 172, + -1, 171, 52, 136, -1, 175, -1, 50, 172, -1, + 51, 172, -1, 173, 172, -1, 75, 172, -1, 74, + 172, -1, 73, 136, -1, 73, 136, 149, -1, 73, + 136, 12, 13, -1, 73, 136, 12, 146, 13, -1, + 73, 136, 12, 13, 149, -1, 73, 136, 12, 146, + 13, 149, -1, 19, -1, 20, -1, 89, -1, 46, + -1, 21, -1, 107, 89, -1, 90, -1, 19, -1, + 20, -1, 21, -1, 22, -1, 23, -1, 24, -1, + 25, -1, 26, -1, 27, -1, 28, -1, 29, -1, + 30, -1, 31, -1, 32, -1, 46, -1, 47, -1, + 48, -1, 49, -1, 50, -1, 51, -1, 52, -1, + 72, -1, 77, -1, 78, -1, 79, -1, 80, -1, + 81, -1, 82, -1, 83, -1, 84, -1, 85, -1, + 86, -1, 87, -1, 88, -1, 89, -1, 91, -1, + 93, -1, 95, -1, 96, -1, 108, -1, 109, -1, + 112, -1, 113, -1, 114, -1, 115, -1, 176, -1, + 175, 91, 176, -1, 177, -1, 176, 149, -1, 176, + 12, 13, -1, 176, 12, 146, 13, -1, 176, 18, + 3, -1, 176, 50, -1, 176, 51, -1, 3, -1, + 6, -1, 7, -1, 4, -1, 5, -1, 149, -1, + 154, -1, 155, -1, 156, -1, 110, 146, 111, -1, + 12, 146, 13, -1, 12, 13, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 205, 205, 206, 210, 211, 212, 216, 218, 220, - 222, 227, 228, 229, 230, 234, 235, 239, 240, 245, - 246, 247, 251, 255, 256, 260, 261, 265, 267, 269, - 271, 273, 275, 277, 279, 284, 285, 286, 290, 291, - 292, 293, 297, 298, 299, 303, 304, 308, 309, 318, - 319, 324, 325, 329, 330, 334, 335, 339, 340, 341, - 342, 344, 348, 349, 350, 351, 355, 357, 362, 364, - 366, 368, 370, 372, 374, 376, 381, 382, 386, 387, - 391, 392, 396, 397, 402, 403, 408, 409, 410, 412, - 417, 418, 422, 423, 424, 425, 426, 427, 428, 432, - 433, 437, 438, 439, 440, 441, 442, 443, 447, 452, - 457, 462, 463, 464, 465, 466, 467, 468, 469, 470, - 471, 472, 473, 474, 475, 479, 480, 481, 482, 483, - 484, 488, 489, 494, 495, 500, 501, 506, 507, 512, - 513, 518, 519, 524, 525, 527, 532, 533, 535, 537, - 539, 544, 545, 547, 552, 553, 555, 560, 561, 563, - 565, 570, 571, 576, 577, 582, 583, 585, 587, 589, - 591, 593, 595, 597, 599, 601, 603, 610, 611, 612, - 613, 614, 615, 621, 622, 623, 624, 625, 626, 627, - 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, - 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, - 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, - 658, 659, 660, 661, 662, 663, 664, 665, 666, 670, - 671, 676, 677, 679, 681, 683, 685, 687, 693, 694, - 695, 696, 697, 698, 699, 700, 701, 702, 703, 704 + 0, 206, 206, 207, 211, 212, 213, 217, 219, 221, + 223, 228, 229, 230, 231, 235, 236, 240, 241, 246, + 247, 248, 252, 256, 257, 261, 262, 266, 268, 270, + 272, 274, 276, 278, 280, 282, 284, 286, 288, 290, + 292, 297, 298, 299, 303, 304, 305, 306, 310, 311, + 312, 316, 317, 321, 322, 331, 332, 337, 338, 342, + 343, 347, 348, 352, 353, 354, 355, 357, 361, 362, + 363, 364, 368, 370, 375, 377, 379, 381, 383, 385, + 387, 389, 394, 395, 399, 400, 404, 405, 409, 410, + 415, 416, 421, 422, 423, 425, 430, 431, 435, 436, + 437, 438, 439, 440, 441, 445, 446, 450, 451, 452, + 453, 454, 455, 456, 460, 465, 470, 475, 476, 477, + 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, + 488, 492, 493, 494, 495, 496, 497, 501, 502, 507, + 508, 513, 514, 519, 520, 525, 526, 531, 532, 537, + 538, 540, 545, 546, 548, 550, 552, 557, 558, 560, + 565, 566, 568, 573, 574, 576, 578, 583, 584, 589, + 590, 595, 596, 598, 600, 602, 604, 606, 608, 610, + 612, 614, 616, 623, 624, 625, 626, 627, 628, 634, + 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, + 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, + 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, + 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, + 675, 676, 677, 678, 679, 683, 684, 689, 690, 692, + 694, 696, 698, 700, 706, 707, 708, 709, 710, 711, + 712, 713, 714, 715, 716, 717 }; #endif @@ -882,14 +892,14 @@ static const char *const yytname[] = "UPCHUCK", "CLASS", "INTERFACE", "EXTENDS", "IMPLEMENTS", "PUBLIC", "PROTECTED", "PRIVATE", "STATIC", "ABSTRACT", "CONST", "SPORK", "ARROW_RIGHT", "ARROW_LEFT", "L_HACK", "R_HACK", "GRUCK_RIGHT", - "GRUCK_LEFT", "UNGRUCK_RIGHT", "UNGRUCK_LEFT", "AT_OP", "$accept", - "program", "program_section", "class_definition", "class_ext", - "class_body", "class_body2", "class_section", "iface_ext", "id_list", - "id_dot", "function_definition", "class_decl", "function_decl", - "static_decl", "type_decl_a", "type_decl_b", "type_decl", "type_decl2", - "arg_list", "statement_list", "statement", "jump_statement", - "selection_statement", "loop_statement", "code_segment", - "expression_statement", "expression", "chuck_expression", + "GRUCK_LEFT", "UNGRUCK_RIGHT", "UNGRUCK_LEFT", "AT_OP", "AT_CTOR", + "AT_DTOR", "$accept", "program", "program_section", "class_definition", + "class_ext", "class_body", "class_body2", "class_section", "iface_ext", + "id_list", "id_dot", "function_definition", "class_decl", + "function_decl", "static_decl", "type_decl_a", "type_decl_b", + "type_decl", "type_decl2", "arg_list", "statement_list", "statement", + "jump_statement", "selection_statement", "loop_statement", + "code_segment", "expression_statement", "expression", "chuck_expression", "arrow_expression", "array_exp", "array_empty", "decl_expression", "var_decl_list", "var_decl", "complex_exp", "polar_exp", "vec_exp", "chuck_operator", "arrow_operator", "conditional_expression", @@ -919,38 +929,39 @@ static const yytype_uint16 yytoknum[] = 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, - 365, 366, 367, 368, 369, 370, 371 + 365, 366, 367, 368, 369, 370, 371, 372, 373 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 117, 118, 118, 119, 119, 119, 120, 120, 120, - 120, 121, 121, 121, 121, 122, 122, 123, 123, 124, - 124, 124, 125, 126, 126, 127, 127, 128, 128, 128, - 128, 128, 128, 128, 128, 129, 129, 129, 130, 130, - 130, 130, 131, 131, 131, 132, 132, 133, 133, 134, - 134, 135, 135, 136, 136, 137, 137, 138, 138, 138, - 138, 138, 139, 139, 139, 139, 140, 140, 141, 141, - 141, 141, 141, 141, 141, 141, 142, 142, 143, 143, - 144, 144, 145, 145, 146, 146, 147, 147, 147, 147, - 148, 148, 149, 149, 149, 149, 149, 149, 149, 150, - 150, 151, 151, 151, 151, 151, 151, 151, 152, 153, - 154, 155, 155, 155, 155, 155, 155, 155, 155, 155, - 155, 155, 155, 155, 155, 156, 156, 156, 156, 156, - 156, 157, 157, 158, 158, 159, 159, 160, 160, 161, - 161, 162, 162, 163, 163, 163, 164, 164, 164, 164, - 164, 165, 165, 165, 166, 166, 166, 167, 167, 167, - 167, 168, 168, 169, 169, 170, 170, 170, 170, 170, - 170, 170, 170, 170, 170, 170, 170, 171, 171, 171, - 171, 171, 171, 172, 172, 172, 172, 172, 172, 172, - 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, - 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, - 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, - 172, 172, 172, 172, 172, 172, 172, 172, 172, 173, - 173, 174, 174, 174, 174, 174, 174, 174, 175, 175, - 175, 175, 175, 175, 175, 175, 175, 175, 175, 175 + 0, 119, 120, 120, 121, 121, 121, 122, 122, 122, + 122, 123, 123, 123, 123, 124, 124, 125, 125, 126, + 126, 126, 127, 128, 128, 129, 129, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 131, 131, 131, 132, 132, 132, 132, 133, 133, + 133, 134, 134, 135, 135, 136, 136, 137, 137, 138, + 138, 139, 139, 140, 140, 140, 140, 140, 141, 141, + 141, 141, 142, 142, 143, 143, 143, 143, 143, 143, + 143, 143, 144, 144, 145, 145, 146, 146, 147, 147, + 148, 148, 149, 149, 149, 149, 150, 150, 151, 151, + 151, 151, 151, 151, 151, 152, 152, 153, 153, 153, + 153, 153, 153, 153, 154, 155, 156, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 158, 158, 158, 158, 158, 158, 159, 159, 160, + 160, 161, 161, 162, 162, 163, 163, 164, 164, 165, + 165, 165, 166, 166, 166, 166, 166, 167, 167, 167, + 168, 168, 168, 169, 169, 169, 169, 170, 170, 171, + 171, 172, 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 173, 173, 173, 173, 173, 173, 174, + 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, + 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, + 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, + 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, + 174, 174, 174, 174, 174, 175, 175, 176, 176, 176, + 176, 176, 176, 176, 177, 177, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 177 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -958,29 +969,30 @@ static const yytype_uint8 yyr2[] = { 0, 2, 1, 2, 1, 1, 1, 6, 7, 6, 7, 2, 4, 2, 4, 1, 0, 1, 2, 1, - 1, 1, 2, 1, 3, 1, 3, 8, 7, 8, - 7, 9, 9, 11, 11, 1, 1, 0, 1, 1, - 1, 1, 1, 1, 0, 1, 2, 3, 4, 1, - 1, 1, 2, 2, 4, 1, 2, 1, 1, 1, - 1, 1, 2, 3, 2, 2, 5, 7, 5, 7, - 6, 7, 7, 5, 7, 5, 2, 3, 1, 2, - 1, 3, 1, 3, 1, 3, 3, 4, 4, 5, - 2, 3, 1, 2, 3, 3, 3, 2, 3, 1, - 3, 1, 2, 2, 3, 4, 4, 5, 3, 3, - 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 2, 1, 3, 1, 3, 8, 7, 7, + 6, 6, 5, 5, 6, 8, 7, 9, 9, 11, + 11, 1, 1, 0, 1, 1, 1, 1, 1, 1, + 0, 1, 2, 3, 4, 1, 1, 1, 2, 2, + 4, 1, 2, 1, 1, 1, 1, 1, 2, 3, + 2, 2, 5, 7, 5, 7, 6, 7, 7, 5, + 7, 5, 2, 3, 1, 2, 1, 3, 1, 3, + 1, 3, 3, 4, 4, 5, 2, 3, 1, 2, + 3, 3, 3, 2, 3, 1, 3, 1, 2, 2, + 3, 4, 4, 5, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 5, 1, 3, 1, 3, 1, 3, 1, - 3, 1, 3, 1, 3, 3, 1, 3, 3, 3, - 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, - 3, 1, 3, 1, 3, 1, 2, 2, 2, 2, - 2, 2, 3, 4, 5, 5, 6, 1, 1, 1, - 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, + 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, + 3, 3, 1, 3, 3, 3, 3, 1, 3, 3, + 1, 3, 3, 1, 3, 3, 3, 1, 3, 1, + 3, 1, 2, 2, 2, 2, 2, 2, 3, 4, + 5, 5, 6, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 3, 1, 2, 3, 4, 3, 2, 2, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 3, 3, 2 + 1, 1, 1, 1, 1, 1, 3, 1, 2, 3, + 4, 3, 2, 2, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 3, 3, 2 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -988,180 +1000,199 @@ static const yytype_uint8 yyr2[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 37, 238, 241, 242, 239, 240, 78, 0, 0, 0, - 177, 178, 181, 0, 0, 0, 0, 0, 0, 0, - 0, 38, 0, 180, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 179, 39, 40, 41, - 0, 0, 0, 37, 2, 6, 5, 0, 44, 49, - 50, 0, 4, 55, 60, 59, 58, 61, 57, 0, - 80, 82, 243, 84, 244, 245, 246, 92, 131, 133, - 135, 137, 139, 141, 143, 146, 151, 154, 157, 161, - 163, 0, 165, 229, 231, 46, 249, 0, 0, 76, - 0, 25, 0, 0, 0, 0, 0, 0, 64, 65, - 62, 0, 238, 166, 167, 0, 0, 0, 0, 45, - 0, 0, 171, 170, 169, 101, 97, 99, 0, 0, - 182, 0, 1, 3, 0, 0, 42, 43, 0, 93, - 56, 0, 79, 113, 114, 115, 116, 122, 123, 124, - 117, 118, 119, 111, 112, 120, 121, 0, 126, 125, - 128, 127, 130, 129, 0, 0, 0, 0, 0, 0, + 43, 244, 247, 248, 245, 246, 84, 0, 0, 0, + 183, 184, 187, 0, 0, 0, 0, 0, 0, 0, + 0, 44, 0, 186, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 185, 45, 46, 47, + 0, 0, 0, 43, 2, 6, 5, 0, 50, 55, + 56, 0, 4, 61, 66, 65, 64, 67, 63, 0, + 86, 88, 249, 90, 250, 251, 252, 98, 137, 139, + 141, 143, 145, 147, 149, 152, 157, 160, 163, 167, + 169, 0, 171, 235, 237, 52, 255, 0, 0, 82, + 0, 25, 0, 0, 0, 0, 0, 0, 70, 71, + 68, 0, 244, 172, 173, 0, 0, 0, 0, 51, + 0, 0, 177, 176, 175, 107, 103, 105, 0, 0, + 188, 0, 1, 3, 0, 0, 48, 49, 0, 0, + 0, 99, 62, 0, 85, 119, 120, 121, 122, 128, + 129, 130, 123, 124, 125, 117, 118, 126, 127, 0, + 132, 131, 134, 133, 136, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 168, 0, 0, 0, - 236, 237, 232, 248, 0, 86, 77, 0, 47, 0, - 0, 0, 0, 0, 0, 0, 63, 108, 109, 110, - 0, 94, 95, 0, 172, 0, 0, 102, 103, 0, - 98, 96, 247, 23, 0, 0, 51, 0, 81, 83, - 85, 134, 0, 136, 138, 140, 142, 144, 145, 147, - 149, 148, 150, 153, 152, 155, 156, 158, 159, 160, - 162, 164, 230, 233, 0, 235, 87, 88, 26, 48, - 0, 0, 0, 0, 0, 0, 0, 0, 173, 0, - 104, 0, 90, 0, 100, 0, 37, 0, 0, 0, - 37, 0, 0, 0, 52, 0, 0, 0, 234, 89, - 66, 68, 0, 0, 0, 0, 0, 75, 73, 175, - 174, 106, 105, 91, 24, 21, 0, 15, 37, 20, - 19, 13, 11, 37, 0, 22, 37, 0, 0, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 183, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 0, 132, 0, 70, 0, - 0, 0, 0, 176, 107, 7, 18, 0, 0, 0, - 9, 0, 0, 0, 0, 191, 0, 0, 0, 67, - 71, 72, 69, 74, 14, 12, 8, 10, 30, 28, - 53, 0, 0, 0, 0, 0, 29, 27, 0, 0, - 0, 0, 54, 0, 32, 0, 31, 0, 0, 34, - 33 + 0, 0, 0, 0, 0, 0, 0, 0, 174, 0, + 0, 0, 242, 243, 238, 254, 0, 92, 83, 0, + 53, 0, 0, 0, 0, 0, 0, 0, 69, 114, + 115, 116, 0, 100, 101, 0, 178, 0, 0, 108, + 109, 0, 104, 102, 253, 23, 0, 0, 0, 0, + 51, 57, 0, 87, 89, 91, 140, 0, 142, 144, + 146, 148, 150, 151, 153, 155, 154, 156, 159, 158, + 161, 162, 164, 165, 166, 168, 170, 236, 239, 0, + 241, 93, 94, 26, 54, 0, 0, 0, 0, 0, + 0, 0, 0, 179, 0, 110, 0, 96, 0, 106, + 0, 43, 0, 0, 0, 43, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 58, 0, 0, 0, 240, + 95, 72, 74, 0, 0, 0, 0, 0, 81, 79, + 181, 180, 112, 111, 97, 24, 21, 0, 15, 43, + 20, 19, 13, 11, 43, 0, 22, 43, 32, 59, + 0, 33, 0, 0, 0, 0, 0, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 189, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 0, 138, 0, 76, 0, 0, 0, + 0, 182, 113, 7, 18, 0, 0, 0, 9, 0, + 0, 31, 34, 30, 0, 0, 0, 197, 0, 0, + 0, 73, 77, 78, 75, 80, 14, 12, 8, 10, + 60, 29, 36, 28, 0, 0, 0, 0, 35, 27, + 0, 0, 0, 0, 0, 38, 0, 37, 0, 0, + 40, 39 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 43, 44, 295, 269, 296, 297, 298, 272, 214, - 92, 299, 47, 48, 128, 49, 50, 51, 217, 374, - 300, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 208, 63, 116, 117, 64, 65, 66, 147, 154, + -1, 43, 44, 306, 274, 307, 308, 309, 277, 216, + 92, 310, 47, 48, 130, 49, 50, 51, 222, 280, + 311, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 210, 63, 116, 117, 64, 65, 66, 149, 156, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 355, 82, 83, 84 + 77, 78, 79, 80, 81, 373, 82, 83, 84 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -283 +#define YYPACT_NINF -306 static const yytype_int16 yypact[] = { - 656, 15, -283, -283, -283, -283, -283, 207, 1490, 735, - -283, -283, -283, 25, 32, 49, 76, 887, 90, 104, - 112, -283, 961, -283, 53, 53, 1490, 1490, 1490, 129, - 28, 28, 28, 53, 53, 145, -283, -17, -283, 137, - 19, 43, 1490, 419, -283, -283, -283, 157, 159, -283, - -283, 145, 887, -283, -283, -283, -283, -283, -283, 44, - 1539, 78, -283, -283, -283, -283, -283, -283, 17, 132, - 142, 119, 136, 241, 196, 182, 255, 184, 158, 127, - -283, 53, 105, 107, -283, -283, -283, 103, 54, -283, - 811, 191, 213, 1490, 1490, 1035, 11, 1490, -283, -283, - -283, 55, -283, -283, -283, 125, 131, 138, 1490, 200, - 145, 145, 121, -283, -283, 204, -283, 247, 145, 145, - -283, 3, -283, -283, 256, 256, -283, -283, 28, -283, - -283, 1490, -283, -283, -283, -283, -283, -283, -283, -283, - -283, -283, -283, -283, -283, -283, -283, 1490, -283, -283, - -283, -283, -283, -283, 1490, 53, 1490, 53, 53, 53, - 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, - 53, 53, 53, 53, 53, 28, -283, 29, 1100, 264, - -283, -283, -283, -283, 1165, 262, -283, 25, 208, 141, - 146, 1035, 229, 279, 282, 152, -283, -283, -283, -283, - 161, -283, -283, 1230, -283, 1295, 1360, -283, 281, 145, - -283, -283, -283, 288, 1, -2, 284, 6, 1539, 78, - -283, 132, 275, 142, 119, 136, 241, 196, 196, 182, - 182, 182, 182, 255, 255, 184, 184, 158, 158, 158, - 127, -283, 107, -283, 167, -283, 262, -283, -283, -283, - 887, 887, 1425, 1490, 1490, 1490, 887, 887, 262, 168, - 262, 169, -283, 285, -283, 256, 498, 25, 256, 283, - 498, 256, 286, 289, 281, 291, 1561, 53, -283, -283, - 266, -283, 887, 185, 186, 188, 195, -283, -283, -283, - 262, -283, 262, -283, -283, -283, 290, -283, 577, -283, - 887, 205, 209, 498, 292, -283, 498, 117, 303, -283, - -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, - -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, - -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, - -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, - -283, -283, -283, -283, -283, 298, -283, 887, -283, 887, - 887, 301, 302, -283, -283, -283, -283, 256, 25, 299, - -283, 304, 113, 145, 305, 25, 306, 307, 28, -283, - -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, - 327, 120, 1659, 325, 326, 28, -283, -283, 1756, 322, - 28, 322, -283, 328, -283, 329, -283, 322, 322, -283, - -283 + 648, 14, -306, -306, -306, -306, -306, 944, 1547, 727, + -306, -306, -306, 39, 25, 102, 118, 879, 133, 59, + 125, -306, 1018, -306, 1612, 1612, 1547, 1547, 1547, 142, + 28, 28, 28, 1612, 1612, 181, -306, -68, -306, -49, + 20, 68, 1547, 411, -306, -306, -306, -10, 57, -306, + -306, 181, 879, -306, -306, -306, -306, -306, -306, 190, + 130, 26, -306, -306, -306, -306, -306, -306, 58, 141, + 113, 180, 198, 238, 207, 179, 249, 76, 101, 197, + -306, 1612, 163, 33, -306, -306, -306, 119, 24, -306, + 803, 242, 237, 1547, 1547, 1092, -1, 1547, -306, -306, + -306, 210, -306, -306, -306, 154, 156, 157, 1547, 205, + 181, 181, 55, -306, -306, 247, -306, 271, 181, 181, + -306, 7, -306, -306, 278, 278, -306, -306, 270, 272, + 79, -306, -306, 1547, -306, -306, -306, -306, -306, -306, + -306, -306, -306, -306, -306, -306, -306, -306, -306, 1547, + -306, -306, -306, -306, -306, -306, 1547, 1612, 1547, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 1612, 1612, 1612, 1612, 1612, 28, -306, 54, + 1157, 280, -306, -306, -306, -306, 1222, 273, -306, 39, + 214, 159, 168, 1092, 234, 274, 276, 170, -306, -306, + -306, -306, 173, -306, -306, 1287, -306, 1352, 1417, -306, + 275, 181, -306, -306, -306, 281, 2, 12, 91, 116, + 15, 277, 6, 130, 26, -306, 141, 261, 113, 180, + 198, 238, 207, 207, 179, 179, 179, 179, 249, 249, + 76, 76, 101, 101, 101, 197, -306, 33, -306, 178, + -306, 273, -306, -306, -306, 879, 879, 1482, 1547, 1547, + 1547, 879, 879, 273, 184, 273, 187, -306, 279, -306, + 278, 490, 39, 278, 283, 490, 278, 284, 285, 181, + 289, 285, 290, 120, 291, 275, 292, 1683, 1612, -306, + -306, 257, -306, 879, 189, 209, 215, 218, -306, -306, + -306, 273, -306, 273, -306, -306, -306, 288, -306, 569, + -306, 879, 193, 208, 490, 293, -306, 490, -306, 299, + 285, -306, 285, 285, 296, 124, 295, -306, -306, -306, + -306, -306, -306, -306, -306, -306, -306, -306, -306, -306, + -306, -306, -306, -306, -306, -306, -306, -306, -306, -306, + -306, -306, -306, -306, -306, -306, -306, -306, -306, -306, + -306, -306, -306, -306, -306, -306, -306, -306, -306, -306, + -306, -306, -306, 300, -306, 879, -306, 879, 879, 302, + 317, -306, -306, -306, -306, 278, 39, 294, -306, 312, + 28, -306, -306, -306, 285, 115, 318, 39, 319, 320, + 28, -306, -306, -306, -306, -306, -306, -306, -306, -306, + -306, -306, -306, -306, 132, 1781, 322, 323, -306, -306, + 1878, 285, 28, 285, 324, -306, 325, -306, 285, 285, + -306, -306 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -283, -283, 272, 46, -283, -254, 58, -283, -283, -119, - -180, 50, -283, -283, -283, -283, -283, -30, -283, -282, - 42, -14, -283, -283, -283, -235, -82, -3, -116, 193, - -75, 128, 203, -40, -26, -283, -283, -283, -283, -283, - 81, -283, 206, 202, 210, 201, 211, 126, 66, 122, - 123, 73, 189, -4, -283, -281, -283, 187, -283 + -306, -306, 287, 19, -306, -243, 30, -306, -306, -121, + -182, 36, -306, -306, -306, -306, -306, -30, -306, -205, + 34, -14, -306, -306, -306, -270, -80, -2, -111, 186, + -71, 127, 194, -38, 61, -306, -306, -306, -306, -306, + 63, -306, 192, 195, 196, 191, 200, 109, 72, 105, + 106, 77, 177, 31, -306, -305, -306, 176, -306 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -46 +#define YYTABLE_NINF -52 static const yytype_int16 yytable[] = { - 110, 111, 112, 96, 87, 88, 215, 248, 182, 275, - 119, 129, 131, 191, 270, 218, 304, 266, -45, 101, - 103, 104, 109, 105, 106, 107, 376, 377, 91, 113, - 114, 109, 102, 2, 3, 4, 5, 204, 130, 121, - 207, 7, 52, 8, 93, 13, 45, 193, 155, 369, - 46, 90, 371, 131, 13, 132, 102, 2, 3, 4, - 5, 94, 156, 184, 131, 7, 196, 8, 218, 185, - 201, 202, 10, 11, 12, 194, 130, 176, 210, 211, - -35, -35, 26, 27, 28, 52, 85, 301, 95, 45, - 189, 190, 192, 46, 195, 118, 394, 271, 216, 23, - 267, 268, 97, 24, 25, 200, 26, 27, 28, 252, - 247, 399, 131, 402, 212, 98, 183, 403, 405, 178, - 109, 8, 276, 99, 388, 179, 32, 33, 34, 9, - 372, 396, 120, 203, 131, 8, 9, 389, 197, 42, - 131, 108, 36, 13, 198, 241, 294, 131, 115, 302, - 131, 199, 305, 222, 250, 131, 397, 180, 181, 251, - 41, 131, 157, 42, 404, 256, 406, 182, 159, 264, - 131, 279, 409, 410, 257, 244, 131, 131, 131, 175, - 278, 290, 292, 289, 160, 291, 148, 149, 385, 158, - 150, 151, 152, 153, 131, 131, 177, 131, 359, 360, - 259, 361, 261, 88, 131, 171, 172, 173, 362, 187, - 1, 2, 3, 4, 5, 363, 205, 364, 206, 7, - 86, 8, 163, 164, 165, 166, 10, 11, 12, 229, - 230, 231, 232, 13, -36, -36, 280, 281, 131, 253, - 132, 188, 287, 288, 237, 238, 239, 174, 384, 283, - 284, 285, 286, 23, 124, 125, 209, 24, 25, 213, - 26, 27, 28, 126, 127, 161, 162, 245, 358, 167, - 168, 85, 30, 31, 169, 170, 8, 373, 373, 249, - 32, 33, 34, 35, 131, 277, 130, 227, 228, 233, - 234, 254, 235, 236, 255, 263, 36, 265, 273, 303, - 293, 357, 306, 307, 262, 367, 109, 365, 368, 370, - 378, 40, 382, 383, 41, 123, 386, 42, 391, 392, - 393, 387, 309, 310, 311, 312, 313, 314, 315, 375, - 317, 318, 319, 320, 321, 322, 395, 400, 9, 401, - 219, 407, 408, 379, 274, 380, 381, 390, 373, 323, - 324, 325, 326, 327, 328, 329, 366, 220, 356, 223, - 225, 221, 0, 240, 242, 373, 0, 0, 224, 0, - 373, 226, 0, 0, 0, 330, 0, 0, 0, 0, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, - 341, 342, 343, 344, 345, 0, 346, 0, 347, 348, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 349, 350, 0, 0, 351, 352, 353, 354, 122, - 0, 0, 1, 2, 3, 4, 5, 0, 0, 0, - 6, 7, 0, 8, 0, 9, 0, 0, 10, 11, - 12, 0, 0, 0, 0, 13, 0, 0, 0, 0, - 0, 0, 14, 0, 0, 15, 16, 17, 18, 19, + 110, 111, 112, 96, 217, 87, 88, 253, 318, 286, + 119, 321, 184, 131, 282, 193, 133, -51, 271, 45, + 101, 399, 223, 109, 105, 106, 107, 283, 275, -41, + -41, 109, 315, 186, 52, 195, 46, 93, 132, 187, + 121, 206, 91, 90, 209, 180, 13, 8, -42, -42, + 391, 181, 392, 393, 13, 103, 104, 102, 2, 3, + 4, 5, 45, 196, 113, 114, 7, 205, 8, 8, + 98, 387, 203, 204, 389, 223, 132, 52, 324, 46, + 212, 213, 220, 182, 183, 85, 85, 124, 125, 157, + 312, 191, 192, 194, 109, 197, 118, 173, 174, 175, + 221, 272, 273, 158, 278, 13, 202, 26, 27, 28, + 421, 276, 178, 257, 94, 424, 252, 13, 214, 109, + 396, 398, 287, 109, 411, 413, 412, 109, 133, 281, + 95, 9, 185, 323, 150, 151, 99, 395, 152, 153, + 154, 155, 13, 418, 419, 97, 13, 246, 9, 305, + 13, 425, 313, 427, 108, 316, 227, 120, 430, 431, + 160, 126, 127, 133, 42, 133, 133, 199, 133, 200, + 201, 159, 255, 269, 128, 129, 184, 133, 249, 133, + 290, 256, 133, 261, 115, 410, 262, 133, 279, 279, + 176, 289, 300, 133, 302, 417, 133, 301, 133, 133, + 303, 134, 377, 264, 407, 266, 88, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 426, 133, 133, + 145, 198, 378, 146, 133, 147, 148, 133, 379, 161, + 381, 380, 382, 165, 166, 167, 168, 234, 235, 236, + 237, 291, 292, 133, 258, 134, 162, 298, 299, 177, + 242, 243, 244, 279, 179, 294, 295, 296, 297, 207, + 189, 208, 163, 164, 406, 190, 169, 170, 171, 172, + 133, 288, 232, 233, 238, 239, 85, 240, 241, 376, + 211, 215, 218, 250, 219, 254, 259, 8, 260, 268, + 270, 284, 375, 385, 304, 279, 279, 132, 109, 314, + 317, 9, 320, 322, 325, 383, 267, 386, 390, 394, + 388, 408, 400, 404, 327, 328, 329, 330, 331, 332, + 333, 397, 335, 336, 337, 338, 339, 340, 405, 409, + 123, 414, 415, 416, 422, 224, 423, 428, 429, 384, + 319, 341, 342, 343, 344, 345, 346, 347, 285, 226, + 225, 374, 230, 245, 228, 247, 229, 0, 0, 0, + 279, 401, 231, 402, 403, 0, 0, 348, 0, 0, + 279, 0, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 0, 364, 0, + 365, 366, 279, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 367, 368, 0, 0, 369, 370, 371, + 372, 122, 0, 0, 1, 2, 3, 4, 5, 0, + 0, 0, 6, 7, 0, 8, 0, 9, 0, 0, + 10, 11, 12, 0, 0, 0, 0, 13, 0, 0, + 0, 0, 0, 0, 14, 0, 0, 15, 16, 17, + 18, 19, 20, 0, 21, 22, 0, 23, 0, 0, + 0, 24, 25, 0, 26, 27, 28, 0, 0, 0, + 0, 0, 0, 0, 0, 29, 30, 31, 0, 0, + 0, 0, 0, 0, 32, 33, 34, 35, 0, 0, + 0, 0, 0, 1, 2, 3, 4, 5, 0, 0, + 36, 6, 7, 0, 8, 0, 9, -16, 0, 10, + 11, 12, 37, 38, 39, 40, 13, 0, 41, 0, + 0, 42, 0, 14, 0, 0, 15, 16, 17, 18, + 19, 20, 0, 21, 22, 0, 23, 0, 0, 0, + 24, 25, 0, 26, 27, 28, 0, 0, 0, 0, + 0, 0, 0, 0, 29, 30, 31, 0, 0, 0, + 0, 0, 0, 32, 33, 34, 35, 0, 0, 0, + 0, 0, 1, 2, 3, 4, 5, 0, 0, 36, + 6, 7, 0, 8, 0, 9, -17, 0, 10, 11, + 12, 37, 38, 39, 40, 13, 0, 41, 0, 0, + 42, 0, 14, 0, 0, 15, 16, 17, 18, 19, 20, 0, 21, 22, 0, 23, 0, 0, 0, 24, 25, 0, 26, 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, 29, 30, 31, 0, 0, 0, 0, 0, 0, 32, 33, 34, 35, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 0, 0, 36, 6, - 7, 0, 8, 0, 9, -16, 0, 10, 11, 12, + 7, 0, 8, 0, 9, 0, 0, 10, 11, 12, 37, 38, 39, 40, 13, 0, 41, 0, 0, 42, 0, 14, 0, 0, 15, 16, 17, 18, 19, 20, 0, 21, 22, 0, 23, 0, 0, 0, 24, 25, @@ -1169,191 +1200,203 @@ static const yytype_int16 yytable[] = 0, 0, 29, 30, 31, 0, 0, 0, 0, 0, 0, 32, 33, 34, 35, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 0, 0, 36, 6, 7, - 0, 8, 0, 9, -17, 0, 10, 11, 12, 37, + 0, 8, 0, 9, 89, 0, 10, 11, 12, 37, 38, 39, 40, 13, 0, 41, 0, 0, 42, 0, 14, 0, 0, 15, 16, 17, 18, 19, 20, 0, - 21, 22, 0, 23, 0, 0, 0, 24, 25, 0, - 26, 27, 28, 0, 0, 0, 0, 0, 0, 0, - 0, 29, 30, 31, 0, 0, 0, 0, 0, 0, - 32, 33, 34, 35, 0, 0, 0, 0, 0, 1, - 2, 3, 4, 5, 0, 0, 36, 6, 7, 0, - 8, 0, 9, 0, 0, 10, 11, 12, 37, 38, - 39, 40, 13, 0, 41, 0, 0, 42, 0, 14, - 0, 0, 15, 16, 17, 18, 19, 20, 0, 21, - 22, 0, 23, 0, 0, 0, 24, 25, 0, 26, - 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, - 29, 30, 31, 0, 0, 0, 0, 0, 0, 32, - 33, 34, 35, 0, 0, 0, 0, 0, 1, 2, - 3, 4, 5, 0, 0, 36, 6, 7, 0, 8, - 0, 9, 89, 0, 10, 11, 12, 37, 38, 39, - 40, 13, 0, 41, 0, 0, 42, 0, 14, 0, - 0, 15, 16, 17, 18, 19, 20, 0, 0, 22, - 0, 23, 0, 0, 0, 24, 25, 0, 26, 27, - 28, 0, 0, 0, 0, 0, 0, 0, 0, 29, - 30, 31, 0, 0, 0, 0, 0, 0, 32, 33, - 34, 35, 0, 0, 1, 2, 3, 4, 5, 0, - 0, 0, 6, 7, 36, 8, 0, 9, 186, 0, - 10, 11, 12, 0, 0, 0, 0, 13, 0, 40, - 0, 0, 41, 0, 14, 42, 0, 15, 16, 17, - 18, 19, 20, 0, 0, 22, 0, 23, 0, 0, - 0, 24, 25, 0, 26, 27, 28, 0, 0, 0, - 0, 0, 0, 0, 0, 29, 30, 31, 0, 0, - 0, 0, 0, 0, 32, 33, 34, 35, 0, 0, - 1, 2, 3, 4, 5, 0, 0, 0, 6, 7, - 36, 8, 0, 9, 0, 0, 10, 11, 12, 0, - 0, 0, 0, 13, 0, 40, 0, 0, 41, 0, - 14, 42, 0, 15, 16, 17, 18, 19, 20, 0, 0, 22, 0, 23, 0, 0, 0, 24, 25, 0, 26, 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, 29, 30, 31, 0, 0, 0, 0, 0, 0, - 32, 33, 34, 35, 1, 2, 3, 4, 5, 0, - 0, 0, 100, 7, 0, 8, 36, 0, 0, 0, - 10, 11, 12, 0, 0, 0, 0, 13, 0, 0, - 0, 40, 0, 0, 41, 0, 0, 42, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, - 0, 24, 25, 0, 26, 27, 28, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 30, 31, 0, 0, - 0, 0, 0, 0, 32, 33, 34, 35, 1, 2, - 3, 4, 5, 0, 0, 0, 6, 7, 0, 8, - 36, 0, 0, 0, 10, 11, 12, 0, 0, 0, - 0, 13, 0, 0, 0, 40, 0, 0, 41, 0, - 0, 42, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 23, 0, 0, 0, 24, 25, 0, 26, 27, - 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 30, 31, 0, 1, 2, 3, 4, 5, 32, 33, - 34, 35, 7, 243, 8, 0, 0, 0, 0, 10, - 11, 12, 0, 0, 36, 0, 13, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, - 0, 0, 41, 0, 0, 42, 23, 0, 0, 0, - 24, 25, 0, 26, 27, 28, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 30, 31, 0, 1, 2, - 3, 4, 5, 32, 33, 34, 35, 7, 0, 8, - 246, 0, 0, 0, 10, 11, 12, 0, 0, 36, - 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 40, 0, 0, 41, 0, 0, - 42, 23, 0, 0, 0, 24, 25, 0, 26, 27, - 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 30, 31, 0, 1, 2, 3, 4, 5, 32, 33, - 34, 35, 7, 258, 8, 0, 0, 0, 0, 10, - 11, 12, 0, 0, 36, 0, 13, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, - 0, 0, 41, 0, 0, 42, 23, 0, 0, 0, - 24, 25, 0, 26, 27, 28, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 30, 31, 0, 1, 2, - 3, 4, 5, 32, 33, 34, 35, 7, 260, 8, - 0, 0, 0, 0, 10, 11, 12, 0, 0, 36, - 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 40, 0, 0, 41, 0, 0, - 42, 23, 0, 0, 0, 24, 25, 0, 26, 27, - 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 30, 31, 0, 1, 2, 3, 4, 5, 32, 33, - 34, 35, 7, 0, 8, 262, 0, 0, 0, 10, - 11, 12, 0, 0, 36, 0, 13, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, - 0, 0, 41, 0, 0, 42, 23, 0, 0, 0, - 24, 25, 0, 26, 27, 28, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 30, 31, 0, 1, 2, - 3, 4, 5, 32, 33, 34, 35, 7, 282, 8, - 0, 0, 0, 0, 10, 11, 12, 0, 0, 36, - 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 40, 0, 0, 41, 0, 0, - 42, 23, 0, 0, 0, 24, 25, 0, 26, 27, - 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 30, 31, 0, 1, 2, 3, 4, 5, 32, 33, - 34, 35, 7, 0, 8, 0, 0, 0, 0, 10, - 11, 12, 0, 0, 36, 0, 13, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, - 0, 0, 41, 0, 0, 42, 23, 0, 0, 0, - 24, 25, 0, 26, 27, 28, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 30, 31, 0, 0, 0, - 0, 0, 0, 32, 33, 34, 35, 0, 0, 0, - 0, 0, 0, 308, 0, 0, 0, 0, 0, 36, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 40, 0, 0, 41, 0, 0, - 42, 0, 0, 0, 0, 0, 0, 323, 324, 325, - 326, 327, 328, 329, 0, 0, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 0, 0, 0, 143, - 0, 0, 144, 330, 145, 146, 0, 0, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 0, 346, 0, 347, 348, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 349, - 350, 398, 0, 351, 352, 353, 354, 0, 309, 310, - 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 323, 324, 325, 326, 327, - 328, 329, 0, 0, 0, 0, 0, 0, 0, 0, + 32, 33, 34, 35, 0, 0, 1, 2, 3, 4, + 5, 0, 0, 0, 6, 7, 36, 8, 0, 9, + 188, 0, 10, 11, 12, 0, 0, 0, 0, 13, + 0, 40, 0, 0, 41, 0, 14, 42, 0, 15, + 16, 17, 18, 19, 20, 0, 0, 22, 0, 23, + 0, 0, 0, 24, 25, 0, 26, 27, 28, 0, + 0, 0, 0, 0, 0, 0, 0, 29, 30, 31, + 0, 0, 0, 0, 0, 0, 32, 33, 34, 35, + 0, 0, 1, 2, 3, 4, 5, 0, 0, 0, + 6, 7, 36, 8, 0, 9, 0, 0, 10, 11, + 12, 0, 0, 0, 0, 13, 0, 40, 0, 0, + 41, 0, 14, 42, 0, 15, 16, 17, 18, 19, + 20, 0, 0, 22, 0, 23, 0, 0, 0, 24, + 25, 0, 26, 27, 28, 0, 0, 0, 0, 0, + 0, 0, 0, 29, 30, 31, 0, 1, 2, 3, + 4, 5, 32, 33, 34, 35, 7, 86, 8, 0, + 0, 0, 0, 10, 11, 12, 0, 0, 36, 0, + 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 40, 0, 0, 41, 0, 0, 42, + 23, 0, 0, 0, 24, 25, 0, 26, 27, 28, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, + 31, 0, 0, 0, 0, 0, 0, 32, 33, 34, + 35, 1, 2, 3, 4, 5, 0, 0, 0, 100, + 7, 0, 8, 36, 0, 0, 0, 10, 11, 12, + 0, 0, 0, 0, 13, 0, 0, 0, 40, 0, + 0, 41, 0, 0, 42, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 23, 0, 0, 0, 24, 25, + 0, 26, 27, 28, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 30, 31, 0, 0, 0, 0, 0, + 0, 32, 33, 34, 35, 1, 2, 3, 4, 5, + 0, 0, 0, 6, 7, 0, 8, 36, 0, 0, + 0, 10, 11, 12, 0, 0, 0, 0, 13, 0, + 0, 0, 40, 0, 0, 41, 0, 0, 42, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, + 0, 0, 24, 25, 0, 26, 27, 28, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 30, 31, 0, + 1, 2, 3, 4, 5, 32, 33, 34, 35, 7, + 248, 8, 0, 0, 0, 0, 10, 11, 12, 0, + 0, 36, 0, 13, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 40, 0, 0, 41, + 0, 0, 42, 23, 0, 0, 0, 24, 25, 0, + 26, 27, 28, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 30, 31, 0, 1, 2, 3, 4, 5, + 32, 33, 34, 35, 7, 0, 8, 251, 0, 0, + 0, 10, 11, 12, 0, 0, 36, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 330, 0, 0, 0, 0, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 0, 346, 0, 347, 348, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 349, 350, 0, - 0, 351, 352, 353, 354, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 0, + 0, 40, 0, 0, 41, 0, 0, 42, 23, 0, + 0, 0, 24, 25, 0, 26, 27, 28, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 30, 31, 0, + 1, 2, 3, 4, 5, 32, 33, 34, 35, 7, + 263, 8, 0, 0, 0, 0, 10, 11, 12, 0, + 0, 36, 0, 13, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 40, 0, 0, 41, + 0, 0, 42, 23, 0, 0, 0, 24, 25, 0, + 26, 27, 28, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 30, 31, 0, 1, 2, 3, 4, 5, + 32, 33, 34, 35, 7, 265, 8, 0, 0, 0, + 0, 10, 11, 12, 0, 0, 36, 0, 13, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 40, 0, 0, 41, 0, 0, 42, 23, 0, + 0, 0, 24, 25, 0, 26, 27, 28, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 30, 31, 0, + 1, 2, 3, 4, 5, 32, 33, 34, 35, 7, + 0, 8, 267, 0, 0, 0, 10, 11, 12, 0, + 0, 36, 0, 13, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 40, 0, 0, 41, + 0, 0, 42, 23, 0, 0, 0, 24, 25, 0, + 26, 27, 28, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 30, 31, 0, 1, 2, 3, 4, 5, + 32, 33, 34, 35, 7, 293, 8, 0, 0, 0, + 0, 10, 11, 12, 0, 0, 36, 0, 13, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 40, 0, 0, 41, 0, 0, 42, 23, 0, + 0, 0, 24, 25, 0, 26, 27, 28, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 30, 31, 0, + 1, 2, 3, 4, 5, 32, 33, 34, 35, 7, + 0, 8, 0, 0, 0, 0, 10, 11, 12, 0, + 0, 36, 0, 13, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 40, 0, 0, 41, + 0, 0, 42, 23, 0, 0, 0, 24, 25, 0, + 26, 27, 28, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 30, 31, 0, 102, 2, 3, 4, 5, + 32, 33, 34, 35, 7, 0, 8, 0, 0, 0, + 0, 10, 11, 12, 0, 0, 36, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 40, 0, 0, 41, 0, 0, 42, 23, 0, + 0, 0, 24, 25, 0, 26, 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 323, 324, 325, 326, 327, 328, 329, 0, + 0, 0, 0, 0, 0, 32, 33, 34, 0, 0, + 0, 0, 0, 0, 0, 326, 0, 0, 0, 0, + 0, 36, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 0, 0, 0, 41, + 0, 0, 42, 0, 0, 0, 0, 0, 0, 341, + 342, 343, 344, 345, 346, 347, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 330, 0, - 0, 0, 0, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 0, 346, - 0, 347, 348, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 349, 350, 0, 0, 351, 352, - 353, 354 + 0, 0, 0, 0, 0, 348, 0, 0, 0, 0, + 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, + 359, 360, 361, 362, 363, 0, 364, 0, 365, 366, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 367, 368, 420, 0, 369, 370, 371, 372, 0, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, + 337, 338, 339, 340, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 341, 342, 343, + 344, 345, 346, 347, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 348, 0, 0, 0, 0, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + 361, 362, 363, 0, 364, 0, 365, 366, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 367, + 368, 0, 0, 369, 370, 371, 372, 327, 328, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, + 340, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 341, 342, 343, 344, 345, 346, + 347, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 348, 0, 0, 0, 0, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 0, 364, 0, 365, 366, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 367, 368, 0, 0, + 369, 370, 371, 372 }; static const yytype_int16 yycheck[] = { - 30, 31, 32, 17, 7, 8, 125, 187, 83, 3, - 40, 51, 9, 95, 16, 131, 270, 16, 3, 22, - 24, 25, 3, 26, 27, 28, 308, 308, 3, 33, - 34, 3, 3, 4, 5, 6, 7, 112, 52, 42, - 115, 12, 0, 14, 12, 26, 0, 36, 31, 303, - 0, 9, 306, 9, 26, 11, 3, 4, 5, 6, - 7, 12, 45, 9, 9, 12, 11, 14, 184, 15, - 110, 111, 19, 20, 21, 64, 90, 81, 118, 119, - 97, 98, 53, 54, 55, 43, 71, 267, 12, 43, - 93, 94, 95, 43, 97, 76, 378, 99, 128, 46, - 99, 100, 12, 50, 51, 108, 53, 54, 55, 191, - 185, 392, 9, 395, 111, 11, 13, 398, 400, 12, - 3, 14, 116, 11, 11, 18, 73, 74, 75, 16, - 13, 11, 89, 12, 9, 14, 16, 372, 13, 110, - 9, 12, 89, 26, 13, 175, 265, 9, 3, 268, - 9, 13, 271, 156, 13, 9, 391, 50, 51, 13, - 107, 9, 30, 110, 399, 13, 401, 242, 49, 209, - 9, 246, 407, 408, 13, 178, 9, 9, 9, 52, - 13, 13, 13, 258, 48, 260, 108, 109, 368, 47, - 112, 113, 114, 115, 9, 9, 91, 9, 13, 13, - 203, 13, 205, 206, 9, 21, 22, 23, 13, 18, - 3, 4, 5, 6, 7, 290, 12, 292, 14, 12, - 13, 14, 26, 27, 28, 29, 19, 20, 21, 163, - 164, 165, 166, 26, 97, 98, 250, 251, 9, 10, - 11, 28, 256, 257, 171, 172, 173, 89, 367, 252, - 253, 254, 255, 46, 97, 98, 9, 50, 51, 3, - 53, 54, 55, 104, 105, 24, 25, 3, 282, 87, - 88, 71, 65, 66, 19, 20, 14, 307, 308, 71, - 73, 74, 75, 76, 9, 10, 300, 161, 162, 167, - 168, 12, 169, 170, 12, 14, 89, 9, 14, 16, - 15, 35, 16, 12, 15, 100, 3, 17, 99, 17, - 12, 104, 11, 11, 107, 43, 17, 110, 13, 13, - 13, 17, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 9, 12, 16, 13, - 147, 13, 13, 357, 216, 359, 360, 373, 378, 46, - 47, 48, 49, 50, 51, 52, 298, 154, 277, 157, - 159, 155, -1, 174, 177, 395, -1, -1, 158, -1, - 400, 160, -1, -1, -1, 72, -1, -1, -1, -1, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, -1, 93, -1, 95, 96, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 108, 109, -1, -1, 112, 113, 114, 115, 0, - -1, -1, 3, 4, 5, 6, 7, -1, -1, -1, - 11, 12, -1, 14, -1, 16, -1, -1, 19, 20, - 21, -1, -1, -1, -1, 26, -1, -1, -1, -1, - -1, -1, 33, -1, -1, 36, 37, 38, 39, 40, + 30, 31, 32, 17, 125, 7, 8, 189, 278, 3, + 40, 281, 83, 51, 219, 95, 9, 3, 16, 0, + 22, 326, 133, 3, 26, 27, 28, 12, 16, 97, + 98, 3, 275, 9, 0, 36, 0, 12, 52, 15, + 42, 112, 3, 9, 115, 12, 26, 14, 97, 98, + 320, 18, 322, 323, 26, 24, 25, 3, 4, 5, + 6, 7, 43, 64, 33, 34, 12, 12, 14, 14, + 11, 314, 110, 111, 317, 186, 90, 43, 283, 43, + 118, 119, 3, 50, 51, 71, 71, 97, 98, 31, + 272, 93, 94, 95, 3, 97, 76, 21, 22, 23, + 130, 99, 100, 45, 13, 26, 108, 53, 54, 55, + 415, 99, 81, 193, 12, 420, 187, 26, 111, 3, + 325, 326, 116, 3, 394, 395, 11, 3, 9, 13, + 12, 16, 13, 13, 108, 109, 11, 13, 112, 113, + 114, 115, 26, 11, 414, 12, 26, 177, 16, 270, + 26, 421, 273, 423, 12, 276, 158, 89, 428, 429, + 47, 104, 105, 9, 110, 9, 9, 13, 9, 13, + 13, 30, 13, 211, 117, 118, 247, 9, 180, 9, + 251, 13, 9, 13, 3, 390, 13, 9, 218, 219, + 89, 13, 263, 9, 265, 400, 9, 13, 9, 9, + 13, 11, 13, 205, 386, 207, 208, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 422, 9, 9, + 90, 11, 13, 93, 9, 95, 96, 9, 13, 49, + 301, 13, 303, 26, 27, 28, 29, 165, 166, 167, + 168, 255, 256, 9, 10, 11, 48, 261, 262, 52, + 173, 174, 175, 283, 91, 257, 258, 259, 260, 12, + 18, 14, 24, 25, 385, 28, 87, 88, 19, 20, + 9, 10, 163, 164, 169, 170, 71, 171, 172, 293, + 9, 3, 12, 3, 12, 71, 12, 14, 12, 14, + 9, 14, 35, 100, 15, 325, 326, 311, 3, 16, + 16, 16, 13, 13, 12, 17, 15, 99, 9, 13, + 17, 17, 12, 11, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 11, 17, + 43, 13, 13, 13, 12, 149, 13, 13, 13, 309, + 279, 46, 47, 48, 49, 50, 51, 52, 221, 157, + 156, 288, 161, 176, 159, 179, 160, -1, -1, -1, + 390, 375, 162, 377, 378, -1, -1, 72, -1, -1, + 400, -1, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, -1, 93, -1, + 95, 96, 422, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 108, 109, -1, -1, 112, 113, 114, + 115, 0, -1, -1, 3, 4, 5, 6, 7, -1, + -1, -1, 11, 12, -1, 14, -1, 16, -1, -1, + 19, 20, 21, -1, -1, -1, -1, 26, -1, -1, + -1, -1, -1, -1, 33, -1, -1, 36, 37, 38, + 39, 40, 41, -1, 43, 44, -1, 46, -1, -1, + -1, 50, 51, -1, 53, 54, 55, -1, -1, -1, + -1, -1, -1, -1, -1, 64, 65, 66, -1, -1, + -1, -1, -1, -1, 73, 74, 75, 76, -1, -1, + -1, -1, -1, 3, 4, 5, 6, 7, -1, -1, + 89, 11, 12, -1, 14, -1, 16, 17, -1, 19, + 20, 21, 101, 102, 103, 104, 26, -1, 107, -1, + -1, 110, -1, 33, -1, -1, 36, 37, 38, 39, + 40, 41, -1, 43, 44, -1, 46, -1, -1, -1, + 50, 51, -1, 53, 54, 55, -1, -1, -1, -1, + -1, -1, -1, -1, 64, 65, 66, -1, -1, -1, + -1, -1, -1, 73, 74, 75, 76, -1, -1, -1, + -1, -1, 3, 4, 5, 6, 7, -1, -1, 89, + 11, 12, -1, 14, -1, 16, 17, -1, 19, 20, + 21, 101, 102, 103, 104, 26, -1, 107, -1, -1, + 110, -1, 33, -1, -1, 36, 37, 38, 39, 40, 41, -1, 43, 44, -1, 46, -1, -1, -1, 50, 51, -1, 53, 54, 55, -1, -1, -1, -1, -1, -1, -1, -1, 64, 65, 66, -1, -1, -1, -1, -1, -1, 73, 74, 75, 76, -1, -1, -1, -1, -1, 3, 4, 5, 6, 7, -1, -1, 89, 11, - 12, -1, 14, -1, 16, 17, -1, 19, 20, 21, + 12, -1, 14, -1, 16, -1, -1, 19, 20, 21, 101, 102, 103, 104, 26, -1, 107, -1, -1, 110, -1, 33, -1, -1, 36, 37, 38, 39, 40, 41, -1, 43, 44, -1, 46, -1, -1, -1, 50, 51, @@ -1364,132 +1407,129 @@ static const yytype_int16 yycheck[] = -1, 14, -1, 16, 17, -1, 19, 20, 21, 101, 102, 103, 104, 26, -1, 107, -1, -1, 110, -1, 33, -1, -1, 36, 37, 38, 39, 40, 41, -1, - 43, 44, -1, 46, -1, -1, -1, 50, 51, -1, - 53, 54, 55, -1, -1, -1, -1, -1, -1, -1, - -1, 64, 65, 66, -1, -1, -1, -1, -1, -1, - 73, 74, 75, 76, -1, -1, -1, -1, -1, 3, - 4, 5, 6, 7, -1, -1, 89, 11, 12, -1, - 14, -1, 16, -1, -1, 19, 20, 21, 101, 102, - 103, 104, 26, -1, 107, -1, -1, 110, -1, 33, - -1, -1, 36, 37, 38, 39, 40, 41, -1, 43, - 44, -1, 46, -1, -1, -1, 50, 51, -1, 53, - 54, 55, -1, -1, -1, -1, -1, -1, -1, -1, - 64, 65, 66, -1, -1, -1, -1, -1, -1, 73, - 74, 75, 76, -1, -1, -1, -1, -1, 3, 4, - 5, 6, 7, -1, -1, 89, 11, 12, -1, 14, - -1, 16, 17, -1, 19, 20, 21, 101, 102, 103, - 104, 26, -1, 107, -1, -1, 110, -1, 33, -1, - -1, 36, 37, 38, 39, 40, 41, -1, -1, 44, - -1, 46, -1, -1, -1, 50, 51, -1, 53, 54, - 55, -1, -1, -1, -1, -1, -1, -1, -1, 64, - 65, 66, -1, -1, -1, -1, -1, -1, 73, 74, - 75, 76, -1, -1, 3, 4, 5, 6, 7, -1, - -1, -1, 11, 12, 89, 14, -1, 16, 17, -1, - 19, 20, 21, -1, -1, -1, -1, 26, -1, 104, - -1, -1, 107, -1, 33, 110, -1, 36, 37, 38, - 39, 40, 41, -1, -1, 44, -1, 46, -1, -1, - -1, 50, 51, -1, 53, 54, 55, -1, -1, -1, - -1, -1, -1, -1, -1, 64, 65, 66, -1, -1, - -1, -1, -1, -1, 73, 74, 75, 76, -1, -1, - 3, 4, 5, 6, 7, -1, -1, -1, 11, 12, - 89, 14, -1, 16, -1, -1, 19, 20, 21, -1, - -1, -1, -1, 26, -1, 104, -1, -1, 107, -1, - 33, 110, -1, 36, 37, 38, 39, 40, 41, -1, -1, 44, -1, 46, -1, -1, -1, 50, 51, -1, 53, 54, 55, -1, -1, -1, -1, -1, -1, -1, -1, 64, 65, 66, -1, -1, -1, -1, -1, -1, - 73, 74, 75, 76, 3, 4, 5, 6, 7, -1, - -1, -1, 11, 12, -1, 14, 89, -1, -1, -1, - 19, 20, 21, -1, -1, -1, -1, 26, -1, -1, - -1, 104, -1, -1, 107, -1, -1, 110, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 46, -1, -1, - -1, 50, 51, -1, 53, 54, 55, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 65, 66, -1, -1, - -1, -1, -1, -1, 73, 74, 75, 76, 3, 4, - 5, 6, 7, -1, -1, -1, 11, 12, -1, 14, - 89, -1, -1, -1, 19, 20, 21, -1, -1, -1, - -1, 26, -1, -1, -1, 104, -1, -1, 107, -1, - -1, 110, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 46, -1, -1, -1, 50, 51, -1, 53, 54, - 55, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 65, 66, -1, 3, 4, 5, 6, 7, 73, 74, - 75, 76, 12, 13, 14, -1, -1, -1, -1, 19, - 20, 21, -1, -1, 89, -1, 26, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 104, - -1, -1, 107, -1, -1, 110, 46, -1, -1, -1, - 50, 51, -1, 53, 54, 55, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 65, 66, -1, 3, 4, - 5, 6, 7, 73, 74, 75, 76, 12, -1, 14, - 15, -1, -1, -1, 19, 20, 21, -1, -1, 89, - -1, 26, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 104, -1, -1, 107, -1, -1, - 110, 46, -1, -1, -1, 50, 51, -1, 53, 54, - 55, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 65, 66, -1, 3, 4, 5, 6, 7, 73, 74, - 75, 76, 12, 13, 14, -1, -1, -1, -1, 19, - 20, 21, -1, -1, 89, -1, 26, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 104, - -1, -1, 107, -1, -1, 110, 46, -1, -1, -1, - 50, 51, -1, 53, 54, 55, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 65, 66, -1, 3, 4, - 5, 6, 7, 73, 74, 75, 76, 12, 13, 14, - -1, -1, -1, -1, 19, 20, 21, -1, -1, 89, - -1, 26, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 104, -1, -1, 107, -1, -1, - 110, 46, -1, -1, -1, 50, 51, -1, 53, 54, - 55, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 65, 66, -1, 3, 4, 5, 6, 7, 73, 74, - 75, 76, 12, -1, 14, 15, -1, -1, -1, 19, - 20, 21, -1, -1, 89, -1, 26, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 104, - -1, -1, 107, -1, -1, 110, 46, -1, -1, -1, - 50, 51, -1, 53, 54, 55, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 65, 66, -1, 3, 4, - 5, 6, 7, 73, 74, 75, 76, 12, 13, 14, - -1, -1, -1, -1, 19, 20, 21, -1, -1, 89, - -1, 26, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 104, -1, -1, 107, -1, -1, - 110, 46, -1, -1, -1, 50, 51, -1, 53, 54, - 55, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 65, 66, -1, 3, 4, 5, 6, 7, 73, 74, - 75, 76, 12, -1, 14, -1, -1, -1, -1, 19, - 20, 21, -1, -1, 89, -1, 26, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 104, - -1, -1, 107, -1, -1, 110, 46, -1, -1, -1, - 50, 51, -1, 53, 54, 55, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 65, 66, -1, -1, -1, - -1, -1, -1, 73, 74, 75, 76, -1, -1, -1, - -1, -1, -1, 12, -1, -1, -1, -1, -1, 89, + 73, 74, 75, 76, -1, -1, 3, 4, 5, 6, + 7, -1, -1, -1, 11, 12, 89, 14, -1, 16, + 17, -1, 19, 20, 21, -1, -1, -1, -1, 26, + -1, 104, -1, -1, 107, -1, 33, 110, -1, 36, + 37, 38, 39, 40, 41, -1, -1, 44, -1, 46, + -1, -1, -1, 50, 51, -1, 53, 54, 55, -1, + -1, -1, -1, -1, -1, -1, -1, 64, 65, 66, + -1, -1, -1, -1, -1, -1, 73, 74, 75, 76, + -1, -1, 3, 4, 5, 6, 7, -1, -1, -1, + 11, 12, 89, 14, -1, 16, -1, -1, 19, 20, + 21, -1, -1, -1, -1, 26, -1, 104, -1, -1, + 107, -1, 33, 110, -1, 36, 37, 38, 39, 40, + 41, -1, -1, 44, -1, 46, -1, -1, -1, 50, + 51, -1, 53, 54, 55, -1, -1, -1, -1, -1, + -1, -1, -1, 64, 65, 66, -1, 3, 4, 5, + 6, 7, 73, 74, 75, 76, 12, 13, 14, -1, + -1, -1, -1, 19, 20, 21, -1, -1, 89, -1, + 26, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 104, -1, -1, 107, -1, -1, 110, + 46, -1, -1, -1, 50, 51, -1, 53, 54, 55, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 65, + 66, -1, -1, -1, -1, -1, -1, 73, 74, 75, + 76, 3, 4, 5, 6, 7, -1, -1, -1, 11, + 12, -1, 14, 89, -1, -1, -1, 19, 20, 21, + -1, -1, -1, -1, 26, -1, -1, -1, 104, -1, + -1, 107, -1, -1, 110, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 46, -1, -1, -1, 50, 51, + -1, 53, 54, 55, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 65, 66, -1, -1, -1, -1, -1, + -1, 73, 74, 75, 76, 3, 4, 5, 6, 7, + -1, -1, -1, 11, 12, -1, 14, 89, -1, -1, + -1, 19, 20, 21, -1, -1, -1, -1, 26, -1, + -1, -1, 104, -1, -1, 107, -1, -1, 110, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 46, -1, + -1, -1, 50, 51, -1, 53, 54, 55, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 65, 66, -1, + 3, 4, 5, 6, 7, 73, 74, 75, 76, 12, + 13, 14, -1, -1, -1, -1, 19, 20, 21, -1, + -1, 89, -1, 26, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 104, -1, -1, 107, + -1, -1, 110, 46, -1, -1, -1, 50, 51, -1, + 53, 54, 55, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 65, 66, -1, 3, 4, 5, 6, 7, + 73, 74, 75, 76, 12, -1, 14, 15, -1, -1, + -1, 19, 20, 21, -1, -1, 89, -1, 26, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 104, -1, -1, 107, -1, -1, 110, 46, -1, + -1, -1, 50, 51, -1, 53, 54, 55, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 65, 66, -1, + 3, 4, 5, 6, 7, 73, 74, 75, 76, 12, + 13, 14, -1, -1, -1, -1, 19, 20, 21, -1, + -1, 89, -1, 26, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 104, -1, -1, 107, + -1, -1, 110, 46, -1, -1, -1, 50, 51, -1, + 53, 54, 55, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 65, 66, -1, 3, 4, 5, 6, 7, + 73, 74, 75, 76, 12, 13, 14, -1, -1, -1, + -1, 19, 20, 21, -1, -1, 89, -1, 26, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 104, -1, -1, 107, -1, -1, 110, 46, -1, + -1, -1, 50, 51, -1, 53, 54, 55, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 65, 66, -1, + 3, 4, 5, 6, 7, 73, 74, 75, 76, 12, + -1, 14, 15, -1, -1, -1, 19, 20, 21, -1, + -1, 89, -1, 26, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 104, -1, -1, 107, + -1, -1, 110, 46, -1, -1, -1, 50, 51, -1, + 53, 54, 55, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 65, 66, -1, 3, 4, 5, 6, 7, + 73, 74, 75, 76, 12, 13, 14, -1, -1, -1, + -1, 19, 20, 21, -1, -1, 89, -1, 26, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 104, -1, -1, 107, -1, -1, 110, 46, -1, + -1, -1, 50, 51, -1, 53, 54, 55, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 65, 66, -1, + 3, 4, 5, 6, 7, 73, 74, 75, 76, 12, + -1, 14, -1, -1, -1, -1, 19, 20, 21, -1, + -1, 89, -1, 26, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 104, -1, -1, 107, + -1, -1, 110, 46, -1, -1, -1, 50, 51, -1, + 53, 54, 55, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 65, 66, -1, 3, 4, 5, 6, 7, + 73, 74, 75, 76, 12, -1, 14, -1, -1, -1, + -1, 19, 20, 21, -1, -1, 89, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 104, -1, -1, 107, -1, -1, 110, 46, -1, + -1, -1, 50, 51, -1, 53, 54, 55, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 73, 74, 75, -1, -1, + -1, -1, -1, -1, -1, 12, -1, -1, -1, -1, + -1, 89, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, -1, -1, -1, 107, + -1, -1, 110, -1, -1, -1, -1, -1, -1, 46, + 47, 48, 49, 50, 51, 52, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 72, -1, -1, -1, -1, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, -1, 93, -1, 95, 96, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 108, 109, 12, -1, 112, 113, 114, 115, -1, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 104, -1, -1, 107, -1, -1, - 110, -1, -1, -1, -1, -1, -1, 46, 47, 48, - 49, 50, 51, 52, -1, -1, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, -1, -1, -1, 90, - -1, -1, 93, 72, 95, 96, -1, -1, 77, 78, + 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 46, 47, 48, + 49, 50, 51, 52, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 72, -1, -1, -1, -1, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, -1, 95, 96, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 108, - 109, 12, -1, 112, 113, 114, 115, -1, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 46, 47, 48, 49, 50, - 51, 52, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 72, -1, -1, -1, -1, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, -1, 93, -1, 95, 96, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 108, 109, -1, - -1, 112, 113, 114, 115, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, + 109, -1, -1, 112, 113, 114, 115, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 46, 47, 48, 49, 50, 51, + 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 46, 47, 48, 49, 50, 51, 52, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 72, -1, - -1, -1, -1, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, - -1, 95, 96, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 108, 109, -1, -1, 112, 113, - 114, 115 + 72, -1, -1, -1, -1, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + -1, 93, -1, 95, 96, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 108, 109, -1, -1, + 112, 113, 114, 115 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -1500,44 +1540,46 @@ static const yytype_uint8 yystos[] = 19, 20, 21, 26, 33, 36, 37, 38, 39, 40, 41, 43, 44, 46, 50, 51, 53, 54, 55, 64, 65, 66, 73, 74, 75, 76, 89, 101, 102, 103, - 104, 107, 110, 118, 119, 120, 128, 129, 130, 132, - 133, 134, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 149, 152, 153, 154, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 173, 174, 175, 71, 13, 144, 144, 17, - 137, 3, 127, 12, 12, 12, 138, 12, 11, 11, - 11, 144, 3, 170, 170, 144, 144, 144, 12, 3, - 134, 134, 134, 170, 170, 3, 150, 151, 76, 134, - 89, 144, 0, 119, 97, 98, 104, 105, 131, 150, - 138, 9, 11, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 90, 93, 95, 96, 155, 108, 109, - 112, 113, 114, 115, 156, 31, 45, 30, 47, 49, - 48, 24, 25, 26, 27, 28, 29, 87, 88, 19, - 20, 21, 22, 23, 89, 52, 170, 91, 12, 18, - 50, 51, 147, 13, 9, 15, 17, 18, 28, 144, - 144, 143, 144, 36, 64, 144, 11, 13, 13, 13, - 144, 150, 150, 12, 147, 12, 14, 147, 148, 9, - 150, 150, 111, 3, 126, 126, 134, 135, 145, 146, - 149, 159, 144, 160, 161, 162, 163, 164, 164, 165, - 165, 165, 165, 166, 166, 167, 167, 168, 168, 168, - 169, 134, 174, 13, 144, 3, 15, 147, 127, 71, - 13, 13, 143, 10, 12, 12, 13, 13, 13, 144, - 13, 144, 15, 14, 150, 9, 16, 99, 100, 121, - 16, 99, 125, 14, 148, 3, 116, 10, 13, 147, - 138, 138, 13, 144, 144, 144, 144, 138, 138, 147, - 13, 147, 13, 15, 126, 120, 122, 123, 124, 128, - 137, 127, 126, 16, 122, 126, 16, 12, 12, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 46, 47, 48, 49, 50, 51, 52, - 72, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 93, 95, 96, 108, - 109, 112, 113, 114, 115, 172, 157, 35, 138, 13, - 13, 13, 13, 147, 147, 17, 123, 100, 99, 122, - 17, 122, 13, 134, 136, 26, 136, 172, 12, 138, - 138, 138, 11, 11, 126, 127, 17, 17, 11, 142, - 151, 13, 13, 13, 136, 9, 11, 142, 12, 172, - 12, 13, 136, 172, 142, 136, 142, 13, 13, 142, - 142 + 104, 107, 110, 120, 121, 122, 130, 131, 132, 134, + 135, 136, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 151, 154, 155, 156, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 175, 176, 177, 71, 13, 146, 146, 17, + 139, 3, 129, 12, 12, 12, 140, 12, 11, 11, + 11, 146, 3, 172, 172, 146, 146, 146, 12, 3, + 136, 136, 136, 172, 172, 3, 152, 153, 76, 136, + 89, 146, 0, 121, 97, 98, 104, 105, 117, 118, + 133, 152, 140, 9, 11, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 90, 93, 95, 96, 157, + 108, 109, 112, 113, 114, 115, 158, 31, 45, 30, + 47, 49, 48, 24, 25, 26, 27, 28, 29, 87, + 88, 19, 20, 21, 22, 23, 89, 52, 172, 91, + 12, 18, 50, 51, 149, 13, 9, 15, 17, 18, + 28, 146, 146, 145, 146, 36, 64, 146, 11, 13, + 13, 13, 146, 152, 152, 12, 149, 12, 14, 149, + 150, 9, 152, 152, 111, 3, 128, 128, 12, 12, + 3, 136, 137, 147, 148, 151, 161, 146, 162, 163, + 164, 165, 166, 166, 167, 167, 167, 167, 168, 168, + 169, 169, 170, 170, 170, 171, 136, 176, 13, 146, + 3, 15, 149, 129, 71, 13, 13, 145, 10, 12, + 12, 13, 13, 13, 146, 13, 146, 15, 14, 152, + 9, 16, 99, 100, 123, 16, 99, 127, 13, 136, + 138, 13, 138, 12, 14, 150, 3, 116, 10, 13, + 149, 140, 140, 13, 146, 146, 146, 146, 140, 140, + 149, 13, 149, 13, 15, 128, 122, 124, 125, 126, + 130, 139, 129, 128, 16, 124, 128, 16, 144, 153, + 13, 144, 13, 13, 138, 12, 12, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 46, 47, 48, 49, 50, 51, 52, 72, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 93, 95, 96, 108, 109, 112, + 113, 114, 115, 174, 159, 35, 140, 13, 13, 13, + 13, 149, 149, 17, 125, 100, 99, 124, 17, 124, + 9, 144, 144, 144, 13, 13, 138, 26, 138, 174, + 12, 140, 140, 140, 11, 11, 128, 129, 17, 17, + 138, 144, 11, 144, 13, 13, 13, 138, 11, 144, + 12, 174, 12, 13, 174, 144, 138, 144, 13, 13, + 144, 144 }; #define yyerrok (yyerrstatus = 0) @@ -2374,1243 +2416,1273 @@ yyparse () switch (yyn) { case 2: -#line 205 "chuck.y" +#line 206 "chuck.y" { (yyval.program) = g_program = new_program( (yyvsp[(1) - (1)].program_section), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; case 3: -#line 206 "chuck.y" +#line 207 "chuck.y" { (yyval.program) = g_program = append_program( (yyvsp[(1) - (2)].program), (yyvsp[(2) - (2)].program_section), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 4: -#line 210 "chuck.y" +#line 211 "chuck.y" { (yyval.program_section) = new_section_stmt( (yyvsp[(1) - (1)].stmt_list), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; case 5: -#line 211 "chuck.y" +#line 212 "chuck.y" { (yyval.program_section) = new_section_func_def( (yyvsp[(1) - (1)].func_def), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; case 6: -#line 212 "chuck.y" +#line 213 "chuck.y" { (yyval.program_section) = new_section_class_def( (yyvsp[(1) - (1)].class_def), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; case 7: -#line 217 "chuck.y" +#line 218 "chuck.y" { (yyval.class_def) = new_class_def( (yyvsp[(1) - (6)].ival), (yyvsp[(3) - (6)].id_list), NULL, (yyvsp[(5) - (6)].class_body), (yylsp[(1) - (6)]).first_line, (yylsp[(1) - (6)]).first_column ); ;} break; case 8: -#line 219 "chuck.y" +#line 220 "chuck.y" { (yyval.class_def) = new_class_def( (yyvsp[(1) - (7)].ival), (yyvsp[(3) - (7)].id_list), (yyvsp[(4) - (7)].class_ext), (yyvsp[(6) - (7)].class_body), (yylsp[(1) - (7)]).first_line, (yylsp[(1) - (7)]).first_column ); ;} break; case 9: -#line 221 "chuck.y" +#line 222 "chuck.y" { (yyval.class_def) = new_iface_def( (yyvsp[(1) - (6)].ival), (yyvsp[(3) - (6)].id_list), NULL, (yyvsp[(5) - (6)].class_body), (yylsp[(1) - (6)]).first_line, (yylsp[(1) - (6)]).first_column ); ;} break; case 10: -#line 223 "chuck.y" +#line 224 "chuck.y" { (yyval.class_def) = new_iface_def( (yyvsp[(1) - (7)].ival), (yyvsp[(3) - (7)].id_list), (yyvsp[(4) - (7)].class_ext), (yyvsp[(6) - (7)].class_body), (yylsp[(1) - (7)]).first_line, (yylsp[(1) - (7)]).first_column ); ;} break; case 11: -#line 227 "chuck.y" +#line 228 "chuck.y" { (yyval.class_ext) = new_class_ext( NULL, (yyvsp[(2) - (2)].id_list), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 12: -#line 228 "chuck.y" +#line 229 "chuck.y" { (yyval.class_ext) = new_class_ext( (yyvsp[(4) - (4)].id_list), (yyvsp[(2) - (4)].id_list), (yylsp[(1) - (4)]).first_line, (yylsp[(1) - (4)]).first_column ); ;} break; case 13: -#line 229 "chuck.y" +#line 230 "chuck.y" { (yyval.class_ext) = new_class_ext( (yyvsp[(2) - (2)].id_list), NULL, (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 14: -#line 230 "chuck.y" +#line 231 "chuck.y" { (yyval.class_ext) = new_class_ext( (yyvsp[(2) - (4)].id_list), (yyvsp[(4) - (4)].id_list), (yylsp[(1) - (4)]).first_line, (yylsp[(1) - (4)]).first_column ); ;} break; case 15: -#line 234 "chuck.y" +#line 235 "chuck.y" { (yyval.class_body) = (yyvsp[(1) - (1)].class_body); ;} break; case 16: -#line 235 "chuck.y" +#line 236 "chuck.y" { (yyval.class_body) = NULL; ;} break; case 17: -#line 239 "chuck.y" +#line 240 "chuck.y" { (yyval.class_body) = new_class_body( (yyvsp[(1) - (1)].program_section), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; case 18: -#line 240 "chuck.y" +#line 241 "chuck.y" { (yyval.class_body) = prepend_class_body( (yyvsp[(1) - (2)].program_section), (yyvsp[(2) - (2)].class_body), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 19: -#line 245 "chuck.y" +#line 246 "chuck.y" { (yyval.program_section) = new_section_stmt( (yyvsp[(1) - (1)].stmt_list), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; case 20: -#line 246 "chuck.y" +#line 247 "chuck.y" { (yyval.program_section) = new_section_func_def( (yyvsp[(1) - (1)].func_def), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; case 21: -#line 247 "chuck.y" +#line 248 "chuck.y" { (yyval.program_section) = new_section_class_def( (yyvsp[(1) - (1)].class_def), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; case 22: -#line 251 "chuck.y" +#line 252 "chuck.y" { (yyval.class_ext) = new_class_ext( NULL, (yyvsp[(2) - (2)].id_list), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 23: -#line 255 "chuck.y" +#line 256 "chuck.y" { (yyval.id_list) = new_id_list( (yyvsp[(1) - (1)].sval), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column /*, &@1 */ ); ;} break; case 24: -#line 256 "chuck.y" +#line 257 "chuck.y" { (yyval.id_list) = prepend_id_list( (yyvsp[(1) - (3)].sval), (yyvsp[(3) - (3)].id_list), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column /*, &@1 */ ); ;} break; case 25: -#line 260 "chuck.y" +#line 261 "chuck.y" { (yyval.id_list) = new_id_list( (yyvsp[(1) - (1)].sval), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column /*, &@1*/ ); ;} break; case 26: -#line 261 "chuck.y" +#line 262 "chuck.y" { (yyval.id_list) = prepend_id_list( (yyvsp[(1) - (3)].sval), (yyvsp[(3) - (3)].id_list), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column /*, &@1*/ ); ;} break; case 27: -#line 266 "chuck.y" +#line 267 "chuck.y" { (yyval.func_def) = new_func_def( (yyvsp[(1) - (8)].ival), (yyvsp[(2) - (8)].ival), (yyvsp[(3) - (8)].type_decl), (yyvsp[(4) - (8)].sval), (yyvsp[(6) - (8)].arg_list), (yyvsp[(8) - (8)].stmt), TRUE, (yylsp[(1) - (8)]).first_line, (yylsp[(1) - (8)]).first_column ); ;} break; case 28: -#line 268 "chuck.y" +#line 269 "chuck.y" { (yyval.func_def) = new_func_def( (yyvsp[(1) - (7)].ival), (yyvsp[(2) - (7)].ival), (yyvsp[(3) - (7)].type_decl), (yyvsp[(4) - (7)].sval), NULL, (yyvsp[(7) - (7)].stmt), TRUE, (yylsp[(1) - (7)]).first_line, (yylsp[(1) - (7)]).first_column ); ;} break; case 29: -#line 270 "chuck.y" - { (yyval.func_def) = new_func_def( (yyvsp[(1) - (8)].ival), (yyvsp[(2) - (8)].ival), (yyvsp[(3) - (8)].type_decl), (yyvsp[(4) - (8)].sval), (yyvsp[(6) - (8)].arg_list), NULL, TRUE, (yylsp[(1) - (8)]).first_line, (yylsp[(1) - (8)]).first_column ); ;} +#line 271 "chuck.y" + { (yyval.func_def) = new_func_def( (yyvsp[(1) - (7)].ival), (yyvsp[(2) - (7)].ival), NULL, (yyvsp[(3) - (7)].sval), (yyvsp[(5) - (7)].arg_list), (yyvsp[(7) - (7)].stmt), TRUE, (yylsp[(1) - (7)]).first_line, (yylsp[(1) - (7)]).first_column ); ;} break; case 30: -#line 272 "chuck.y" - { (yyval.func_def) = new_func_def( (yyvsp[(1) - (7)].ival), (yyvsp[(2) - (7)].ival), (yyvsp[(3) - (7)].type_decl), (yyvsp[(4) - (7)].sval), NULL, NULL, TRUE, (yylsp[(1) - (7)]).first_line, (yylsp[(1) - (7)]).first_column ); ;} +#line 273 "chuck.y" + { (yyval.func_def) = new_func_def( (yyvsp[(1) - (6)].ival), (yyvsp[(2) - (6)].ival), NULL, (yyvsp[(3) - (6)].sval), NULL, (yyvsp[(6) - (6)].stmt), TRUE, (yylsp[(1) - (6)]).first_line, (yylsp[(1) - (6)]).first_column ); ;} break; case 31: -#line 274 "chuck.y" - { (yyval.func_def) = new_op_overload( (yyvsp[(1) - (9)].ival), (yyvsp[(2) - (9)].ival), (yyvsp[(3) - (9)].type_decl), (yyvsp[(5) - (9)].ival), (yyvsp[(7) - (9)].arg_list), (yyvsp[(9) - (9)].stmt), TRUE, FALSE, (yylsp[(1) - (9)]).first_line, (yylsp[(1) - (9)]).first_column, (yylsp[(5) - (9)]).first_column ); ;} +#line 275 "chuck.y" + { (yyval.func_def) = new_func_def( (yyvsp[(1) - (6)].ival), ae_key_instance, NULL, "@construct", (yyvsp[(4) - (6)].arg_list), (yyvsp[(6) - (6)].stmt), TRUE, (yylsp[(1) - (6)]).first_line, (yylsp[(1) - (6)]).first_column ); ;} break; case 32: -#line 276 "chuck.y" - { (yyval.func_def) = new_op_overload( (yyvsp[(1) - (9)].ival), (yyvsp[(2) - (9)].ival), (yyvsp[(3) - (9)].type_decl), (yyvsp[(8) - (9)].ival), (yyvsp[(6) - (9)].arg_list), (yyvsp[(9) - (9)].stmt), TRUE, TRUE, (yylsp[(1) - (9)]).first_line, (yylsp[(1) - (9)]).first_column, (yylsp[(8) - (9)]).first_column ); ;} +#line 277 "chuck.y" + { (yyval.func_def) = new_func_def( (yyvsp[(1) - (5)].ival), ae_key_instance, NULL, "@construct", NULL, (yyvsp[(5) - (5)].stmt), TRUE, (yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column ); ;} break; case 33: -#line 278 "chuck.y" - { (yyval.func_def) = new_op_overload( (yyvsp[(1) - (11)].ival), (yyvsp[(2) - (11)].ival), (yyvsp[(3) - (11)].type_decl), (yyvsp[(6) - (11)].ival), (yyvsp[(9) - (11)].arg_list), (yyvsp[(11) - (11)].stmt), TRUE, FALSE, (yylsp[(1) - (11)]).first_line, (yylsp[(1) - (11)]).first_column, (yylsp[(5) - (11)]).first_column ); ;} +#line 279 "chuck.y" + { (yyval.func_def) = new_func_def( (yyvsp[(1) - (5)].ival), ae_key_instance, NULL, "@destruct", NULL, (yyvsp[(5) - (5)].stmt), TRUE, (yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column ); ;} break; case 34: -#line 280 "chuck.y" - { (yyval.func_def) = new_op_overload( (yyvsp[(1) - (11)].ival), (yyvsp[(2) - (11)].ival), (yyvsp[(3) - (11)].type_decl), (yyvsp[(9) - (11)].ival), (yyvsp[(6) - (11)].arg_list), (yyvsp[(11) - (11)].stmt), TRUE, TRUE, (yylsp[(1) - (11)]).first_line, (yylsp[(1) - (11)]).first_column, (yylsp[(8) - (11)]).first_column ); ;} +#line 281 "chuck.y" + { (yyval.func_def) = new_func_def( (yyvsp[(1) - (6)].ival), ae_key_instance, NULL, "@destruct", (yyvsp[(4) - (6)].arg_list), (yyvsp[(6) - (6)].stmt), TRUE, (yylsp[(1) - (6)]).first_line, (yylsp[(1) - (6)]).first_column ); ;} break; case 35: -#line 284 "chuck.y" - { (yyval.ival) = ae_key_public; ;} +#line 283 "chuck.y" + { (yyval.func_def) = new_func_def( (yyvsp[(1) - (8)].ival), (yyvsp[(2) - (8)].ival), (yyvsp[(3) - (8)].type_decl), (yyvsp[(4) - (8)].sval), (yyvsp[(6) - (8)].arg_list), NULL, TRUE, (yylsp[(1) - (8)]).first_line, (yylsp[(1) - (8)]).first_column ); ;} break; case 36: #line 285 "chuck.y" - { (yyval.ival) = ae_key_private; ;} + { (yyval.func_def) = new_func_def( (yyvsp[(1) - (7)].ival), (yyvsp[(2) - (7)].ival), (yyvsp[(3) - (7)].type_decl), (yyvsp[(4) - (7)].sval), NULL, NULL, TRUE, (yylsp[(1) - (7)]).first_line, (yylsp[(1) - (7)]).first_column ); ;} break; case 37: -#line 286 "chuck.y" - { (yyval.ival) = ae_key_private; ;} +#line 287 "chuck.y" + { (yyval.func_def) = new_op_overload( (yyvsp[(1) - (9)].ival), (yyvsp[(2) - (9)].ival), (yyvsp[(3) - (9)].type_decl), (yyvsp[(5) - (9)].ival), (yyvsp[(7) - (9)].arg_list), (yyvsp[(9) - (9)].stmt), TRUE, FALSE, (yylsp[(1) - (9)]).first_line, (yylsp[(1) - (9)]).first_column, (yylsp[(5) - (9)]).first_column ); ;} break; case 38: -#line 290 "chuck.y" - { (yyval.ival) = ae_key_func; ;} +#line 289 "chuck.y" + { (yyval.func_def) = new_op_overload( (yyvsp[(1) - (9)].ival), (yyvsp[(2) - (9)].ival), (yyvsp[(3) - (9)].type_decl), (yyvsp[(8) - (9)].ival), (yyvsp[(6) - (9)].arg_list), (yyvsp[(9) - (9)].stmt), TRUE, TRUE, (yylsp[(1) - (9)]).first_line, (yylsp[(1) - (9)]).first_column, (yylsp[(8) - (9)]).first_column ); ;} break; case 39: #line 291 "chuck.y" - { (yyval.ival) = ae_key_public; ;} + { (yyval.func_def) = new_op_overload( (yyvsp[(1) - (11)].ival), (yyvsp[(2) - (11)].ival), (yyvsp[(3) - (11)].type_decl), (yyvsp[(6) - (11)].ival), (yyvsp[(9) - (11)].arg_list), (yyvsp[(11) - (11)].stmt), TRUE, FALSE, (yylsp[(1) - (11)]).first_line, (yylsp[(1) - (11)]).first_column, (yylsp[(5) - (11)]).first_column ); ;} break; case 40: -#line 292 "chuck.y" - { (yyval.ival) = ae_key_protected; ;} +#line 293 "chuck.y" + { (yyval.func_def) = new_op_overload( (yyvsp[(1) - (11)].ival), (yyvsp[(2) - (11)].ival), (yyvsp[(3) - (11)].type_decl), (yyvsp[(9) - (11)].ival), (yyvsp[(6) - (11)].arg_list), (yyvsp[(11) - (11)].stmt), TRUE, TRUE, (yylsp[(1) - (11)]).first_line, (yylsp[(1) - (11)]).first_column, (yylsp[(8) - (11)]).first_column ); ;} break; case 41: -#line 293 "chuck.y" - { (yyval.ival) = ae_key_private; ;} +#line 297 "chuck.y" + { (yyval.ival) = ae_key_public; ;} break; case 42: -#line 297 "chuck.y" - { (yyval.ival) = ae_key_static; ;} +#line 298 "chuck.y" + { (yyval.ival) = ae_key_private; ;} break; case 43: -#line 298 "chuck.y" - { (yyval.ival) = ae_key_abstract; ;} +#line 299 "chuck.y" + { (yyval.ival) = ae_key_private; ;} break; case 44: -#line 299 "chuck.y" - { (yyval.ival) = ae_key_instance; ;} +#line 303 "chuck.y" + { (yyval.ival) = ae_key_func; ;} break; case 45: -#line 303 "chuck.y" - { (yyval.type_decl) = new_type_decl( new_id_list( (yyvsp[(1) - (1)].sval), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column /*, &@1*/ ), 0, (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} +#line 304 "chuck.y" + { (yyval.ival) = ae_key_public; ;} break; case 46: -#line 304 "chuck.y" - { (yyval.type_decl) = new_type_decl( new_id_list( (yyvsp[(1) - (2)].sval), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column /*, &@1*/ ), 1, (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} +#line 305 "chuck.y" + { (yyval.ival) = ae_key_protected; ;} break; case 47: -#line 308 "chuck.y" - { (yyval.type_decl) = new_type_decl( (yyvsp[(2) - (3)].id_list), 0, (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} +#line 306 "chuck.y" + { (yyval.ival) = ae_key_private; ;} break; case 48: -#line 309 "chuck.y" - { (yyval.type_decl) = new_type_decl( (yyvsp[(2) - (4)].id_list), 1, (yylsp[(1) - (4)]).first_line, (yylsp[(1) - (4)]).first_column ); ;} +#line 310 "chuck.y" + { (yyval.ival) = ae_key_static; ;} break; case 49: -#line 318 "chuck.y" - { (yyval.type_decl) = (yyvsp[(1) - (1)].type_decl); ;} +#line 311 "chuck.y" + { (yyval.ival) = ae_key_abstract; ;} break; case 50: -#line 319 "chuck.y" - { (yyval.type_decl) = (yyvsp[(1) - (1)].type_decl); ;} +#line 312 "chuck.y" + { (yyval.ival) = ae_key_instance; ;} break; case 51: -#line 324 "chuck.y" - { (yyval.type_decl) = (yyvsp[(1) - (1)].type_decl); ;} +#line 316 "chuck.y" + { (yyval.type_decl) = new_type_decl( new_id_list( (yyvsp[(1) - (1)].sval), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column /*, &@1*/ ), 0, (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; case 52: -#line 325 "chuck.y" - { (yyval.type_decl) = add_type_decl_array( (yyvsp[(1) - (2)].type_decl), (yyvsp[(2) - (2)].array_sub), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} +#line 317 "chuck.y" + { (yyval.type_decl) = new_type_decl( new_id_list( (yyvsp[(1) - (2)].sval), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column /*, &@1*/ ), 1, (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 53: -#line 329 "chuck.y" - { (yyval.arg_list) = new_arg_list( (yyvsp[(1) - (2)].type_decl), (yyvsp[(2) - (2)].var_decl), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} +#line 321 "chuck.y" + { (yyval.type_decl) = new_type_decl( (yyvsp[(2) - (3)].id_list), 0, (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} break; case 54: -#line 330 "chuck.y" - { (yyval.arg_list) = prepend_arg_list( (yyvsp[(1) - (4)].type_decl), (yyvsp[(2) - (4)].var_decl), (yyvsp[(4) - (4)].arg_list), (yylsp[(1) - (4)]).first_line, (yylsp[(1) - (4)]).first_column ); ;} +#line 322 "chuck.y" + { (yyval.type_decl) = new_type_decl( (yyvsp[(2) - (4)].id_list), 1, (yylsp[(1) - (4)]).first_line, (yylsp[(1) - (4)]).first_column ); ;} break; case 55: -#line 334 "chuck.y" - { (yyval.stmt_list) = new_stmt_list( (yyvsp[(1) - (1)].stmt), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} +#line 331 "chuck.y" + { (yyval.type_decl) = (yyvsp[(1) - (1)].type_decl); ;} break; case 56: -#line 335 "chuck.y" - { (yyval.stmt_list) = append_stmt_list( (yyvsp[(1) - (2)].stmt_list), (yyvsp[(2) - (2)].stmt), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} +#line 332 "chuck.y" + { (yyval.type_decl) = (yyvsp[(1) - (1)].type_decl); ;} break; case 57: -#line 339 "chuck.y" - { (yyval.stmt) = (yyvsp[(1) - (1)].stmt); ;} +#line 337 "chuck.y" + { (yyval.type_decl) = (yyvsp[(1) - (1)].type_decl); ;} break; case 58: -#line 340 "chuck.y" - { (yyval.stmt) = (yyvsp[(1) - (1)].stmt); ;} +#line 338 "chuck.y" + { (yyval.type_decl) = add_type_decl_array( (yyvsp[(1) - (2)].type_decl), (yyvsp[(2) - (2)].array_sub), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 59: -#line 341 "chuck.y" - { (yyval.stmt) = (yyvsp[(1) - (1)].stmt); ;} +#line 342 "chuck.y" + { (yyval.arg_list) = new_arg_list( (yyvsp[(1) - (2)].type_decl), (yyvsp[(2) - (2)].var_decl), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 60: -#line 342 "chuck.y" - { (yyval.stmt) = (yyvsp[(1) - (1)].stmt); ;} +#line 343 "chuck.y" + { (yyval.arg_list) = prepend_arg_list( (yyvsp[(1) - (4)].type_decl), (yyvsp[(2) - (4)].var_decl), (yyvsp[(4) - (4)].arg_list), (yylsp[(1) - (4)]).first_line, (yylsp[(1) - (4)]).first_column ); ;} break; case 61: -#line 344 "chuck.y" - { (yyval.stmt) = (yyvsp[(1) - (1)].stmt); ;} +#line 347 "chuck.y" + { (yyval.stmt_list) = new_stmt_list( (yyvsp[(1) - (1)].stmt), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; case 62: #line 348 "chuck.y" - { (yyval.stmt) = new_stmt_from_return( NULL, (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} + { (yyval.stmt_list) = append_stmt_list( (yyvsp[(1) - (2)].stmt_list), (yyvsp[(2) - (2)].stmt), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 63: -#line 349 "chuck.y" - { (yyval.stmt) = new_stmt_from_return( (yyvsp[(2) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} +#line 352 "chuck.y" + { (yyval.stmt) = (yyvsp[(1) - (1)].stmt); ;} break; case 64: -#line 350 "chuck.y" - { (yyval.stmt) = new_stmt_from_break( (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} +#line 353 "chuck.y" + { (yyval.stmt) = (yyvsp[(1) - (1)].stmt); ;} break; case 65: -#line 351 "chuck.y" - { (yyval.stmt) = new_stmt_from_continue( (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} +#line 354 "chuck.y" + { (yyval.stmt) = (yyvsp[(1) - (1)].stmt); ;} break; case 66: -#line 356 "chuck.y" - { (yyval.stmt) = new_stmt_from_if( (yyvsp[(3) - (5)].exp), (yyvsp[(5) - (5)].stmt), NULL, (yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column ); ;} +#line 355 "chuck.y" + { (yyval.stmt) = (yyvsp[(1) - (1)].stmt); ;} break; case 67: -#line 358 "chuck.y" - { (yyval.stmt) = new_stmt_from_if( (yyvsp[(3) - (7)].exp), (yyvsp[(5) - (7)].stmt), (yyvsp[(7) - (7)].stmt), (yylsp[(1) - (7)]).first_line, (yylsp[(1) - (7)]).first_column ); ;} +#line 357 "chuck.y" + { (yyval.stmt) = (yyvsp[(1) - (1)].stmt); ;} break; case 68: -#line 363 "chuck.y" - { (yyval.stmt) = new_stmt_from_while( (yyvsp[(3) - (5)].exp), (yyvsp[(5) - (5)].stmt), (yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column ); ;} +#line 361 "chuck.y" + { (yyval.stmt) = new_stmt_from_return( NULL, (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 69: -#line 365 "chuck.y" - { (yyval.stmt) = new_stmt_from_do_while( (yyvsp[(5) - (7)].exp), (yyvsp[(2) - (7)].stmt), (yylsp[(1) - (7)]).first_line, (yylsp[(1) - (7)]).first_column ); ;} +#line 362 "chuck.y" + { (yyval.stmt) = new_stmt_from_return( (yyvsp[(2) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} break; case 70: -#line 367 "chuck.y" - { (yyval.stmt) = new_stmt_from_for( (yyvsp[(3) - (6)].stmt), (yyvsp[(4) - (6)].stmt), NULL, (yyvsp[(6) - (6)].stmt), (yylsp[(1) - (6)]).first_line, (yylsp[(1) - (6)]).first_column ); ;} +#line 363 "chuck.y" + { (yyval.stmt) = new_stmt_from_break( (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 71: -#line 369 "chuck.y" - { (yyval.stmt) = new_stmt_from_for( (yyvsp[(3) - (7)].stmt), (yyvsp[(4) - (7)].stmt), (yyvsp[(5) - (7)].exp), (yyvsp[(7) - (7)].stmt), (yylsp[(1) - (7)]).first_line, (yylsp[(1) - (7)]).first_column ); ;} +#line 364 "chuck.y" + { (yyval.stmt) = new_stmt_from_continue( (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 72: -#line 371 "chuck.y" - { (yyval.stmt) = new_stmt_from_foreach( (yyvsp[(3) - (7)].exp), (yyvsp[(5) - (7)].exp), (yyvsp[(7) - (7)].stmt), (yylsp[(1) - (7)]).first_line, (yylsp[(1) - (7)]).first_column ); ;} +#line 369 "chuck.y" + { (yyval.stmt) = new_stmt_from_if( (yyvsp[(3) - (5)].exp), (yyvsp[(5) - (5)].stmt), NULL, (yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column ); ;} break; case 73: -#line 373 "chuck.y" - { (yyval.stmt) = new_stmt_from_until( (yyvsp[(3) - (5)].exp), (yyvsp[(5) - (5)].stmt), (yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column ); ;} +#line 371 "chuck.y" + { (yyval.stmt) = new_stmt_from_if( (yyvsp[(3) - (7)].exp), (yyvsp[(5) - (7)].stmt), (yyvsp[(7) - (7)].stmt), (yylsp[(1) - (7)]).first_line, (yylsp[(1) - (7)]).first_column ); ;} break; case 74: -#line 375 "chuck.y" - { (yyval.stmt) = new_stmt_from_do_until( (yyvsp[(5) - (7)].exp), (yyvsp[(2) - (7)].stmt), (yylsp[(1) - (7)]).first_line, (yylsp[(1) - (7)]).first_column ); ;} +#line 376 "chuck.y" + { (yyval.stmt) = new_stmt_from_while( (yyvsp[(3) - (5)].exp), (yyvsp[(5) - (5)].stmt), (yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column ); ;} break; case 75: -#line 377 "chuck.y" - { (yyval.stmt) = new_stmt_from_loop( (yyvsp[(3) - (5)].exp), (yyvsp[(5) - (5)].stmt), (yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column ); ;} +#line 378 "chuck.y" + { (yyval.stmt) = new_stmt_from_do_while( (yyvsp[(5) - (7)].exp), (yyvsp[(2) - (7)].stmt), (yylsp[(1) - (7)]).first_line, (yylsp[(1) - (7)]).first_column ); ;} break; case 76: -#line 381 "chuck.y" - { (yyval.stmt) = new_stmt_from_code( NULL, (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} +#line 380 "chuck.y" + { (yyval.stmt) = new_stmt_from_for( (yyvsp[(3) - (6)].stmt), (yyvsp[(4) - (6)].stmt), NULL, (yyvsp[(6) - (6)].stmt), (yylsp[(1) - (6)]).first_line, (yylsp[(1) - (6)]).first_column ); ;} break; case 77: #line 382 "chuck.y" - { (yyval.stmt) = new_stmt_from_code( (yyvsp[(2) - (3)].stmt_list), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} + { (yyval.stmt) = new_stmt_from_for( (yyvsp[(3) - (7)].stmt), (yyvsp[(4) - (7)].stmt), (yyvsp[(5) - (7)].exp), (yyvsp[(7) - (7)].stmt), (yylsp[(1) - (7)]).first_line, (yylsp[(1) - (7)]).first_column ); ;} break; case 78: -#line 386 "chuck.y" - { (yyval.stmt) = NULL; ;} +#line 384 "chuck.y" + { (yyval.stmt) = new_stmt_from_foreach( (yyvsp[(3) - (7)].exp), (yyvsp[(5) - (7)].exp), (yyvsp[(7) - (7)].stmt), (yylsp[(1) - (7)]).first_line, (yylsp[(1) - (7)]).first_column ); ;} break; case 79: -#line 387 "chuck.y" - { (yyval.stmt) = new_stmt_from_expression( (yyvsp[(1) - (2)].exp), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} +#line 386 "chuck.y" + { (yyval.stmt) = new_stmt_from_until( (yyvsp[(3) - (5)].exp), (yyvsp[(5) - (5)].stmt), (yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column ); ;} break; case 80: -#line 391 "chuck.y" - { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} +#line 388 "chuck.y" + { (yyval.stmt) = new_stmt_from_do_until( (yyvsp[(5) - (7)].exp), (yyvsp[(2) - (7)].stmt), (yylsp[(1) - (7)]).first_line, (yylsp[(1) - (7)]).first_column ); ;} break; case 81: -#line 392 "chuck.y" - { (yyval.exp) = append_expression( (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} +#line 390 "chuck.y" + { (yyval.stmt) = new_stmt_from_loop( (yyvsp[(3) - (5)].exp), (yyvsp[(5) - (5)].stmt), (yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column ); ;} break; case 82: -#line 396 "chuck.y" - { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} +#line 394 "chuck.y" + { (yyval.stmt) = new_stmt_from_code( NULL, (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 83: -#line 398 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 395 "chuck.y" + { (yyval.stmt) = new_stmt_from_code( (yyvsp[(2) - (3)].stmt_list), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} break; case 84: -#line 402 "chuck.y" - { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} +#line 399 "chuck.y" + { (yyval.stmt) = NULL; ;} break; case 85: -#line 404 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 400 "chuck.y" + { (yyval.stmt) = new_stmt_from_expression( (yyvsp[(1) - (2)].exp), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 86: -#line 408 "chuck.y" - { (yyval.array_sub) = new_array_sub( (yyvsp[(2) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} +#line 404 "chuck.y" + { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 87: -#line 409 "chuck.y" - { (yyval.array_sub) = new_array_sub( (yyvsp[(2) - (4)].exp), (yylsp[(1) - (4)]).first_line, (yylsp[(1) - (4)]).first_column ); ;} +#line 405 "chuck.y" + { (yyval.exp) = append_expression( (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} break; case 88: -#line 411 "chuck.y" - { (yyval.array_sub) = prepend_array_sub( (yyvsp[(4) - (4)].array_sub), (yyvsp[(2) - (4)].exp), (yylsp[(1) - (4)]).first_line, (yylsp[(1) - (4)]).first_column ); ;} +#line 409 "chuck.y" + { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 89: -#line 413 "chuck.y" - { (yyval.array_sub) = prepend_array_sub( (yyvsp[(5) - (5)].array_sub), (yyvsp[(2) - (5)].exp), (yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column ); ;} +#line 411 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 90: -#line 417 "chuck.y" - { (yyval.array_sub) = new_array_sub( NULL, (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} +#line 415 "chuck.y" + { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 91: -#line 418 "chuck.y" - { (yyval.array_sub) = prepend_array_sub( (yyvsp[(1) - (3)].array_sub), NULL, (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} +#line 417 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 92: -#line 422 "chuck.y" - { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} +#line 421 "chuck.y" + { (yyval.array_sub) = new_array_sub( (yyvsp[(2) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} break; case 93: -#line 423 "chuck.y" - { (yyval.exp) = new_exp_decl( (yyvsp[(1) - (2)].type_decl), (yyvsp[(2) - (2)].var_decl_list), 0, 0, (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} +#line 422 "chuck.y" + { (yyval.array_sub) = new_array_sub( (yyvsp[(2) - (4)].exp), (yylsp[(1) - (4)]).first_line, (yylsp[(1) - (4)]).first_column ); ;} break; case 94: #line 424 "chuck.y" - { (yyval.exp) = new_exp_decl_external( (yyvsp[(2) - (3)].type_decl), (yyvsp[(3) - (3)].var_decl_list), 0, 0, (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} + { (yyval.array_sub) = prepend_array_sub( (yyvsp[(4) - (4)].array_sub), (yyvsp[(2) - (4)].exp), (yylsp[(1) - (4)]).first_line, (yylsp[(1) - (4)]).first_column ); ;} break; case 95: -#line 425 "chuck.y" - { (yyval.exp) = new_exp_decl_global( (yyvsp[(2) - (3)].type_decl), (yyvsp[(3) - (3)].var_decl_list), 0, 0, (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} +#line 426 "chuck.y" + { (yyval.array_sub) = prepend_array_sub( (yyvsp[(5) - (5)].array_sub), (yyvsp[(2) - (5)].exp), (yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column ); ;} break; case 96: -#line 426 "chuck.y" - { (yyval.exp) = new_exp_decl( (yyvsp[(2) - (3)].type_decl), (yyvsp[(3) - (3)].var_decl_list), 1, 0, (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} +#line 430 "chuck.y" + { (yyval.array_sub) = new_array_sub( NULL, (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 97: -#line 427 "chuck.y" - { (yyval.exp) = new_exp_decl( NULL, (yyvsp[(2) - (2)].var_decl_list), 0, 0, (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} +#line 431 "chuck.y" + { (yyval.array_sub) = prepend_array_sub( (yyvsp[(1) - (3)].array_sub), NULL, (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} break; case 98: -#line 428 "chuck.y" - { (yyval.exp) = new_exp_decl( NULL, (yyvsp[(3) - (3)].var_decl_list), 1, 0, (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} +#line 435 "chuck.y" + { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 99: -#line 432 "chuck.y" - { (yyval.var_decl_list) = new_var_decl_list( (yyvsp[(1) - (1)].var_decl), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} +#line 436 "chuck.y" + { (yyval.exp) = new_exp_decl( (yyvsp[(1) - (2)].type_decl), (yyvsp[(2) - (2)].var_decl_list), 0, 0, (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 100: -#line 433 "chuck.y" - { (yyval.var_decl_list) = prepend_var_decl_list( (yyvsp[(1) - (3)].var_decl), (yyvsp[(3) - (3)].var_decl_list), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} +#line 437 "chuck.y" + { (yyval.exp) = new_exp_decl_external( (yyvsp[(2) - (3)].type_decl), (yyvsp[(3) - (3)].var_decl_list), 0, 0, (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} break; case 101: -#line 437 "chuck.y" - { (yyval.var_decl) = new_var_decl( (yyvsp[(1) - (1)].sval), FALSE, NULL, NULL, (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} +#line 438 "chuck.y" + { (yyval.exp) = new_exp_decl_global( (yyvsp[(2) - (3)].type_decl), (yyvsp[(3) - (3)].var_decl_list), 0, 0, (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} break; case 102: -#line 438 "chuck.y" - { (yyval.var_decl) = new_var_decl( (yyvsp[(1) - (2)].sval), FALSE, NULL, (yyvsp[(2) - (2)].array_sub), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} +#line 439 "chuck.y" + { (yyval.exp) = new_exp_decl( (yyvsp[(2) - (3)].type_decl), (yyvsp[(3) - (3)].var_decl_list), 1, 0, (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} break; case 103: -#line 439 "chuck.y" - { (yyval.var_decl) = new_var_decl( (yyvsp[(1) - (2)].sval), FALSE, NULL, (yyvsp[(2) - (2)].array_sub), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} +#line 440 "chuck.y" + { (yyval.exp) = new_exp_decl( NULL, (yyvsp[(2) - (2)].var_decl_list), 0, 0, (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 104: -#line 440 "chuck.y" - { (yyval.var_decl) = new_var_decl( (yyvsp[(1) - (3)].sval), TRUE, NULL, NULL, (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} +#line 441 "chuck.y" + { (yyval.exp) = new_exp_decl( NULL, (yyvsp[(3) - (3)].var_decl_list), 1, 0, (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} break; case 105: -#line 441 "chuck.y" - { (yyval.var_decl) = new_var_decl( (yyvsp[(1) - (4)].sval), TRUE, (yyvsp[(3) - (4)].exp), NULL, (yylsp[(1) - (4)]).first_line, (yylsp[(1) - (4)]).first_column ); ;} +#line 445 "chuck.y" + { (yyval.var_decl_list) = new_var_decl_list( (yyvsp[(1) - (1)].var_decl), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; case 106: -#line 442 "chuck.y" - { (yyval.var_decl) = new_var_decl( (yyvsp[(1) - (4)].sval), TRUE, NULL, (yyvsp[(4) - (4)].array_sub), (yylsp[(1) - (4)]).first_line, (yylsp[(1) - (4)]).first_column ); ;} +#line 446 "chuck.y" + { (yyval.var_decl_list) = prepend_var_decl_list( (yyvsp[(1) - (3)].var_decl), (yyvsp[(3) - (3)].var_decl_list), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} break; case 107: -#line 443 "chuck.y" - { (yyval.var_decl) = new_var_decl( (yyvsp[(1) - (5)].sval), TRUE, (yyvsp[(3) - (5)].exp), (yyvsp[(5) - (5)].array_sub), (yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column ); ;} +#line 450 "chuck.y" + { (yyval.var_decl) = new_var_decl( (yyvsp[(1) - (1)].sval), FALSE, NULL, NULL, (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; case 108: -#line 448 "chuck.y" - { (yyval.complex_exp) = new_complex( (yyvsp[(2) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} +#line 451 "chuck.y" + { (yyval.var_decl) = new_var_decl( (yyvsp[(1) - (2)].sval), FALSE, NULL, (yyvsp[(2) - (2)].array_sub), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 109: -#line 453 "chuck.y" - { (yyval.polar_exp) = new_polar( (yyvsp[(2) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} +#line 452 "chuck.y" + { (yyval.var_decl) = new_var_decl( (yyvsp[(1) - (2)].sval), FALSE, NULL, (yyvsp[(2) - (2)].array_sub), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 110: -#line 458 "chuck.y" - { (yyval.vec_exp) = new_vec( (yyvsp[(2) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} +#line 453 "chuck.y" + { (yyval.var_decl) = new_var_decl( (yyvsp[(1) - (3)].sval), TRUE, NULL, NULL, (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} break; case 111: -#line 462 "chuck.y" - { (yyval.ival) = ae_op_chuck; ;} +#line 454 "chuck.y" + { (yyval.var_decl) = new_var_decl( (yyvsp[(1) - (4)].sval), TRUE, (yyvsp[(3) - (4)].exp), NULL, (yylsp[(1) - (4)]).first_line, (yylsp[(1) - (4)]).first_column ); ;} break; case 112: -#line 463 "chuck.y" - { (yyval.ival) = ae_op_at_chuck; ;} +#line 455 "chuck.y" + { (yyval.var_decl) = new_var_decl( (yyvsp[(1) - (4)].sval), TRUE, NULL, (yyvsp[(4) - (4)].array_sub), (yylsp[(1) - (4)]).first_line, (yylsp[(1) - (4)]).first_column ); ;} break; case 113: -#line 464 "chuck.y" - { (yyval.ival) = ae_op_plus_chuck; ;} +#line 456 "chuck.y" + { (yyval.var_decl) = new_var_decl( (yyvsp[(1) - (5)].sval), TRUE, (yyvsp[(3) - (5)].exp), (yyvsp[(5) - (5)].array_sub), (yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column ); ;} break; case 114: -#line 465 "chuck.y" - { (yyval.ival) = ae_op_minus_chuck; ;} +#line 461 "chuck.y" + { (yyval.complex_exp) = new_complex( (yyvsp[(2) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} break; case 115: #line 466 "chuck.y" - { (yyval.ival) = ae_op_times_chuck; ;} + { (yyval.polar_exp) = new_polar( (yyvsp[(2) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} break; case 116: -#line 467 "chuck.y" - { (yyval.ival) = ae_op_divide_chuck; ;} +#line 471 "chuck.y" + { (yyval.vec_exp) = new_vec( (yyvsp[(2) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} break; case 117: -#line 468 "chuck.y" - { (yyval.ival) = ae_op_shift_right_chuck; ;} +#line 475 "chuck.y" + { (yyval.ival) = ae_op_chuck; ;} break; case 118: -#line 469 "chuck.y" - { (yyval.ival) = ae_op_shift_left_chuck; ;} +#line 476 "chuck.y" + { (yyval.ival) = ae_op_at_chuck; ;} break; case 119: -#line 470 "chuck.y" - { (yyval.ival) = ae_op_percent_chuck; ;} +#line 477 "chuck.y" + { (yyval.ival) = ae_op_plus_chuck; ;} break; case 120: -#line 471 "chuck.y" - { (yyval.ival) = ae_op_unchuck; ;} +#line 478 "chuck.y" + { (yyval.ival) = ae_op_minus_chuck; ;} break; case 121: -#line 472 "chuck.y" - { (yyval.ival) = ae_op_upchuck; ;} +#line 479 "chuck.y" + { (yyval.ival) = ae_op_times_chuck; ;} break; case 122: -#line 473 "chuck.y" - { (yyval.ival) = ae_op_s_and_chuck; ;} +#line 480 "chuck.y" + { (yyval.ival) = ae_op_divide_chuck; ;} break; case 123: -#line 474 "chuck.y" - { (yyval.ival) = ae_op_s_or_chuck; ;} +#line 481 "chuck.y" + { (yyval.ival) = ae_op_shift_right_chuck; ;} break; case 124: -#line 475 "chuck.y" - { (yyval.ival) = ae_op_s_xor_chuck; ;} +#line 482 "chuck.y" + { (yyval.ival) = ae_op_shift_left_chuck; ;} break; case 125: -#line 479 "chuck.y" - { (yyval.ival) = ae_op_arrow_left; ;} +#line 483 "chuck.y" + { (yyval.ival) = ae_op_percent_chuck; ;} break; case 126: -#line 480 "chuck.y" - { (yyval.ival) = ae_op_arrow_right; ;} +#line 484 "chuck.y" + { (yyval.ival) = ae_op_unchuck; ;} break; case 127: -#line 481 "chuck.y" - { (yyval.ival) = ae_op_gruck_left; ;} +#line 485 "chuck.y" + { (yyval.ival) = ae_op_upchuck; ;} break; case 128: -#line 482 "chuck.y" - { (yyval.ival) = ae_op_gruck_right; ;} +#line 486 "chuck.y" + { (yyval.ival) = ae_op_s_and_chuck; ;} break; case 129: -#line 483 "chuck.y" - { (yyval.ival) = ae_op_ungruck_left; ;} +#line 487 "chuck.y" + { (yyval.ival) = ae_op_s_or_chuck; ;} break; case 130: -#line 484 "chuck.y" - { (yyval.ival) = ae_op_ungruck_right; ;} +#line 488 "chuck.y" + { (yyval.ival) = ae_op_s_xor_chuck; ;} break; case 131: -#line 488 "chuck.y" - { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} +#line 492 "chuck.y" + { (yyval.ival) = ae_op_arrow_left; ;} break; case 132: -#line 490 "chuck.y" - { (yyval.exp) = new_exp_from_if( (yyvsp[(1) - (5)].exp), (yyvsp[(3) - (5)].exp), (yyvsp[(5) - (5)].exp), (yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column ); ;} +#line 493 "chuck.y" + { (yyval.ival) = ae_op_arrow_right; ;} break; case 133: #line 494 "chuck.y" - { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} + { (yyval.ival) = ae_op_gruck_left; ;} break; case 134: -#line 496 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_or, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 495 "chuck.y" + { (yyval.ival) = ae_op_gruck_right; ;} break; case 135: -#line 500 "chuck.y" - { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} +#line 496 "chuck.y" + { (yyval.ival) = ae_op_ungruck_left; ;} break; case 136: -#line 502 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_and, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 497 "chuck.y" + { (yyval.ival) = ae_op_ungruck_right; ;} break; case 137: -#line 506 "chuck.y" +#line 501 "chuck.y" { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 138: -#line 508 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_s_or, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 503 "chuck.y" + { (yyval.exp) = new_exp_from_if( (yyvsp[(1) - (5)].exp), (yyvsp[(3) - (5)].exp), (yyvsp[(5) - (5)].exp), (yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column ); ;} break; case 139: -#line 512 "chuck.y" +#line 507 "chuck.y" { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 140: -#line 514 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_s_xor, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 509 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_or, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 141: -#line 518 "chuck.y" +#line 513 "chuck.y" { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 142: -#line 520 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_s_and, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 515 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_and, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 143: -#line 524 "chuck.y" +#line 519 "chuck.y" { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 144: -#line 526 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_eq, (yyvsp[(3) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} +#line 521 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_s_or, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 145: -#line 528 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_neq, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 525 "chuck.y" + { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 146: -#line 532 "chuck.y" - { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} +#line 527 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_s_xor, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 147: -#line 534 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_lt, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 531 "chuck.y" + { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 148: -#line 536 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_gt, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 533 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_s_and, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 149: -#line 538 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_le, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 537 "chuck.y" + { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 150: -#line 540 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_ge, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 539 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_eq, (yyvsp[(3) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} break; case 151: -#line 544 "chuck.y" - { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} +#line 541 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_neq, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 152: -#line 546 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_shift_left, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 545 "chuck.y" + { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 153: -#line 548 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_shift_right, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 547 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_lt, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 154: -#line 552 "chuck.y" - { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} +#line 549 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_gt, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 155: -#line 554 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_plus, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 551 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_le, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 156: -#line 556 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_minus, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 553 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_ge, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 157: -#line 560 "chuck.y" +#line 557 "chuck.y" { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 158: -#line 562 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_times, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 559 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_shift_left, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 159: -#line 564 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_divide, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 561 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_shift_right, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 160: -#line 566 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_percent, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 565 "chuck.y" + { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 161: -#line 570 "chuck.y" - { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} +#line 567 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_plus, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 162: -#line 572 "chuck.y" - { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_tilda, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} +#line 569 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_minus, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 163: -#line 576 "chuck.y" +#line 573 "chuck.y" { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 164: -#line 578 "chuck.y" - { (yyval.exp) = new_exp_from_cast( (yyvsp[(3) - (3)].type_decl), (yyvsp[(1) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column, (yylsp[(2) - (3)]).first_column ); ;} +#line 575 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_times, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 165: -#line 582 "chuck.y" - { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} +#line 577 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_divide, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 166: -#line 584 "chuck.y" - { (yyval.exp) = new_exp_from_unary( ae_op_plusplus, (yyvsp[(2) - (2)].exp), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} +#line 579 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_percent, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 167: -#line 586 "chuck.y" - { (yyval.exp) = new_exp_from_unary( ae_op_minusminus, (yyvsp[(2) - (2)].exp), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} +#line 583 "chuck.y" + { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 168: -#line 588 "chuck.y" - { (yyval.exp) = new_exp_from_unary( (yyvsp[(1) - (2)].ival), (yyvsp[(2) - (2)].exp), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} +#line 585 "chuck.y" + { (yyval.exp) = new_exp_from_binary( (yyvsp[(1) - (3)].exp), ae_op_tilda, (yyvsp[(3) - (3)].exp), (yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column ); ;} break; case 169: -#line 590 "chuck.y" - { (yyval.exp) = new_exp_from_unary( ae_op_typeof, (yyvsp[(2) - (2)].exp), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} +#line 589 "chuck.y" + { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 170: -#line 592 "chuck.y" - { (yyval.exp) = new_exp_from_unary( ae_op_sizeof, (yyvsp[(2) - (2)].exp), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} +#line 591 "chuck.y" + { (yyval.exp) = new_exp_from_cast( (yyvsp[(3) - (3)].type_decl), (yyvsp[(1) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column, (yylsp[(2) - (3)]).first_column ); ;} break; case 171: -#line 594 "chuck.y" - { (yyval.exp) = new_exp_from_unary2( ae_op_new, (yyvsp[(2) - (2)].type_decl), FALSE, NULL, NULL, (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} +#line 595 "chuck.y" + { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; case 172: -#line 596 "chuck.y" - { (yyval.exp) = new_exp_from_unary2( ae_op_new, (yyvsp[(2) - (3)].type_decl), FALSE, NULL, (yyvsp[(3) - (3)].array_sub), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} +#line 597 "chuck.y" + { (yyval.exp) = new_exp_from_unary( ae_op_plusplus, (yyvsp[(2) - (2)].exp), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 173: -#line 598 "chuck.y" - { (yyval.exp) = new_exp_from_unary2( ae_op_new, (yyvsp[(2) - (4)].type_decl), TRUE, NULL, NULL, (yylsp[(1) - (4)]).first_line, (yylsp[(1) - (4)]).first_column ); ;} +#line 599 "chuck.y" + { (yyval.exp) = new_exp_from_unary( ae_op_minusminus, (yyvsp[(2) - (2)].exp), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 174: -#line 600 "chuck.y" - { (yyval.exp) = new_exp_from_unary2( ae_op_new, (yyvsp[(2) - (5)].type_decl), TRUE, (yyvsp[(4) - (5)].exp), NULL, (yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column ); ;} +#line 601 "chuck.y" + { (yyval.exp) = new_exp_from_unary( (yyvsp[(1) - (2)].ival), (yyvsp[(2) - (2)].exp), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 175: -#line 602 "chuck.y" - { (yyval.exp) = new_exp_from_unary2( ae_op_new, (yyvsp[(2) - (5)].type_decl), TRUE, NULL, (yyvsp[(5) - (5)].array_sub), (yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column ); ;} +#line 603 "chuck.y" + { (yyval.exp) = new_exp_from_unary( ae_op_typeof, (yyvsp[(2) - (2)].exp), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 176: -#line 604 "chuck.y" - { (yyval.exp) = new_exp_from_unary2( ae_op_new, (yyvsp[(2) - (6)].type_decl), TRUE, (yyvsp[(4) - (6)].exp), (yyvsp[(6) - (6)].array_sub), (yylsp[(1) - (6)]).first_line, (yylsp[(1) - (6)]).first_column ); ;} +#line 605 "chuck.y" + { (yyval.exp) = new_exp_from_unary( ae_op_sizeof, (yyvsp[(2) - (2)].exp), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 177: -#line 610 "chuck.y" - { (yyval.ival) = ae_op_plus; ;} +#line 607 "chuck.y" + { (yyval.exp) = new_exp_from_unary2( ae_op_new, (yyvsp[(2) - (2)].type_decl), FALSE, NULL, NULL, (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; case 178: -#line 611 "chuck.y" - { (yyval.ival) = ae_op_minus; ;} +#line 609 "chuck.y" + { (yyval.exp) = new_exp_from_unary2( ae_op_new, (yyvsp[(2) - (3)].type_decl), FALSE, NULL, (yyvsp[(3) - (3)].array_sub), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} break; case 179: -#line 612 "chuck.y" - { (yyval.ival) = ae_op_tilda; ;} +#line 611 "chuck.y" + { (yyval.exp) = new_exp_from_unary2( ae_op_new, (yyvsp[(2) - (4)].type_decl), TRUE, NULL, NULL, (yylsp[(1) - (4)]).first_line, (yylsp[(1) - (4)]).first_column ); ;} break; case 180: #line 613 "chuck.y" - { (yyval.ival) = ae_op_exclamation; ;} + { (yyval.exp) = new_exp_from_unary2( ae_op_new, (yyvsp[(2) - (5)].type_decl), TRUE, (yyvsp[(4) - (5)].exp), NULL, (yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column ); ;} break; case 181: -#line 614 "chuck.y" - { (yyval.ival) = ae_op_times; ;} +#line 615 "chuck.y" + { (yyval.exp) = new_exp_from_unary2( ae_op_new, (yyvsp[(2) - (5)].type_decl), TRUE, NULL, (yyvsp[(5) - (5)].array_sub), (yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column ); ;} break; case 182: -#line 615 "chuck.y" - { (yyval.ival) = ae_op_spork; ;} +#line 617 "chuck.y" + { (yyval.exp) = new_exp_from_unary2( ae_op_new, (yyvsp[(2) - (6)].type_decl), TRUE, (yyvsp[(4) - (6)].exp), (yyvsp[(6) - (6)].array_sub), (yylsp[(1) - (6)]).first_line, (yylsp[(1) - (6)]).first_column ); ;} break; case 183: -#line 621 "chuck.y" - { (yyval.ival) = ae_op_chuck; ;} +#line 623 "chuck.y" + { (yyval.ival) = ae_op_plus; ;} break; case 184: -#line 622 "chuck.y" +#line 624 "chuck.y" + { (yyval.ival) = ae_op_minus; ;} + break; + + case 185: +#line 625 "chuck.y" + { (yyval.ival) = ae_op_tilda; ;} + break; + + case 186: +#line 626 "chuck.y" + { (yyval.ival) = ae_op_exclamation; ;} + break; + + case 187: +#line 627 "chuck.y" + { (yyval.ival) = ae_op_times; ;} + break; + + case 188: +#line 628 "chuck.y" + { (yyval.ival) = ae_op_spork; ;} + break; + + case 189: +#line 634 "chuck.y" + { (yyval.ival) = ae_op_chuck; ;} + break; + + case 190: +#line 635 "chuck.y" { (yyval.ival) = ae_op_plus; ;} break; - case 185: -#line 623 "chuck.y" + case 191: +#line 636 "chuck.y" { (yyval.ival) = ae_op_minus; ;} break; - case 186: -#line 624 "chuck.y" + case 192: +#line 637 "chuck.y" { (yyval.ival) = ae_op_times; ;} break; - case 187: -#line 625 "chuck.y" + case 193: +#line 638 "chuck.y" { (yyval.ival) = ae_op_divide; ;} break; - case 188: -#line 626 "chuck.y" + case 194: +#line 639 "chuck.y" { (yyval.ival) = ae_op_percent; ;} break; - case 189: -#line 627 "chuck.y" + case 195: +#line 640 "chuck.y" { (yyval.ival) = ae_op_eq; ;} break; - case 190: -#line 628 "chuck.y" + case 196: +#line 641 "chuck.y" { (yyval.ival) = ae_op_neq; ;} break; - case 191: -#line 629 "chuck.y" + case 197: +#line 642 "chuck.y" { (yyval.ival) = ae_op_lt; ;} break; - case 192: -#line 630 "chuck.y" + case 198: +#line 643 "chuck.y" { (yyval.ival) = ae_op_le; ;} break; - case 193: -#line 631 "chuck.y" + case 199: +#line 644 "chuck.y" { (yyval.ival) = ae_op_gt; ;} break; - case 194: -#line 632 "chuck.y" + case 200: +#line 645 "chuck.y" { (yyval.ival) = ae_op_ge; ;} break; - case 195: -#line 633 "chuck.y" + case 201: +#line 646 "chuck.y" { (yyval.ival) = ae_op_and; ;} break; - case 196: -#line 634 "chuck.y" + case 202: +#line 647 "chuck.y" { (yyval.ival) = ae_op_or; ;} break; - case 197: -#line 635 "chuck.y" + case 203: +#line 648 "chuck.y" { (yyval.ival) = ae_op_assign; ;} break; - case 198: -#line 636 "chuck.y" + case 204: +#line 649 "chuck.y" { (yyval.ival) = ae_op_exclamation; ;} break; - case 199: -#line 637 "chuck.y" + case 205: +#line 650 "chuck.y" { (yyval.ival) = ae_op_s_or; ;} break; - case 200: -#line 638 "chuck.y" + case 206: +#line 651 "chuck.y" { (yyval.ival) = ae_op_s_and; ;} break; - case 201: -#line 639 "chuck.y" + case 207: +#line 652 "chuck.y" { (yyval.ival) = ae_op_s_xor; ;} break; - case 202: -#line 640 "chuck.y" + case 208: +#line 653 "chuck.y" { (yyval.ival) = ae_op_plusplus; ;} break; - case 203: -#line 641 "chuck.y" + case 209: +#line 654 "chuck.y" { (yyval.ival) = ae_op_minusminus; ;} break; - case 204: -#line 642 "chuck.y" + case 210: +#line 655 "chuck.y" { (yyval.ival) = ae_op_dollar; ;} break; - case 205: -#line 643 "chuck.y" + case 211: +#line 656 "chuck.y" { (yyval.ival) = ae_op_at_at; ;} break; - case 206: -#line 644 "chuck.y" + case 212: +#line 657 "chuck.y" { (yyval.ival) = ae_op_plus_chuck; ;} break; - case 207: -#line 645 "chuck.y" + case 213: +#line 658 "chuck.y" { (yyval.ival) = ae_op_minus_chuck; ;} break; - case 208: -#line 646 "chuck.y" + case 214: +#line 659 "chuck.y" { (yyval.ival) = ae_op_times_chuck; ;} break; - case 209: -#line 647 "chuck.y" + case 215: +#line 660 "chuck.y" { (yyval.ival) = ae_op_divide_chuck; ;} break; - case 210: -#line 648 "chuck.y" + case 216: +#line 661 "chuck.y" { (yyval.ival) = ae_op_s_and_chuck; ;} break; - case 211: -#line 649 "chuck.y" + case 217: +#line 662 "chuck.y" { (yyval.ival) = ae_op_s_or_chuck; ;} break; - case 212: -#line 650 "chuck.y" + case 218: +#line 663 "chuck.y" { (yyval.ival) = ae_op_s_xor_chuck; ;} break; - case 213: -#line 651 "chuck.y" + case 219: +#line 664 "chuck.y" { (yyval.ival) = ae_op_shift_right_chuck; ;} break; - case 214: -#line 652 "chuck.y" + case 220: +#line 665 "chuck.y" { (yyval.ival) = ae_op_shift_left_chuck; ;} break; - case 215: -#line 653 "chuck.y" + case 221: +#line 666 "chuck.y" { (yyval.ival) = ae_op_percent_chuck; ;} break; - case 216: -#line 654 "chuck.y" + case 222: +#line 667 "chuck.y" { (yyval.ival) = ae_op_shift_right; ;} break; - case 217: -#line 655 "chuck.y" + case 223: +#line 668 "chuck.y" { (yyval.ival) = ae_op_shift_left; ;} break; - case 218: -#line 656 "chuck.y" + case 224: +#line 669 "chuck.y" { (yyval.ival) = ae_op_tilda; ;} break; - case 219: -#line 657 "chuck.y" + case 225: +#line 670 "chuck.y" { (yyval.ival) = ae_op_coloncolon; ;} break; - case 220: -#line 658 "chuck.y" + case 226: +#line 671 "chuck.y" { (yyval.ival) = ae_op_at_chuck; ;} break; - case 221: -#line 659 "chuck.y" + case 227: +#line 672 "chuck.y" { (yyval.ival) = ae_op_unchuck; ;} break; - case 222: -#line 660 "chuck.y" + case 228: +#line 673 "chuck.y" { (yyval.ival) = ae_op_upchuck; ;} break; - case 223: -#line 661 "chuck.y" + case 229: +#line 674 "chuck.y" { (yyval.ival) = ae_op_arrow_right; ;} break; - case 224: -#line 662 "chuck.y" + case 230: +#line 675 "chuck.y" { (yyval.ival) = ae_op_arrow_left; ;} break; - case 225: -#line 663 "chuck.y" + case 231: +#line 676 "chuck.y" { (yyval.ival) = ae_op_gruck_right; ;} break; - case 226: -#line 664 "chuck.y" + case 232: +#line 677 "chuck.y" { (yyval.ival) = ae_op_gruck_left; ;} break; - case 227: -#line 665 "chuck.y" + case 233: +#line 678 "chuck.y" { (yyval.ival) = ae_op_ungruck_right; ;} break; - case 228: -#line 666 "chuck.y" + case 234: +#line 679 "chuck.y" { (yyval.ival) = ae_op_ungruck_left; ;} break; - case 230: -#line 672 "chuck.y" + case 236: +#line 685 "chuck.y" { (yyval.exp) = new_exp_from_dur( (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} break; - case 231: -#line 676 "chuck.y" + case 237: +#line 689 "chuck.y" { (yyval.exp) = (yyvsp[(1) - (1)].exp); ;} break; - case 232: -#line 678 "chuck.y" + case 238: +#line 691 "chuck.y" { (yyval.exp) = new_exp_from_array( (yyvsp[(1) - (2)].exp), (yyvsp[(2) - (2)].array_sub), (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; - case 233: -#line 680 "chuck.y" + case 239: +#line 693 "chuck.y" { (yyval.exp) = new_exp_from_func_call( (yyvsp[(1) - (3)].exp), NULL, (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} break; - case 234: -#line 682 "chuck.y" + case 240: +#line 695 "chuck.y" { (yyval.exp) = new_exp_from_func_call( (yyvsp[(1) - (4)].exp), (yyvsp[(3) - (4)].exp), (yylsp[(1) - (4)]).first_line, (yylsp[(1) - (4)]).first_column ); ;} break; - case 235: -#line 684 "chuck.y" + case 241: +#line 697 "chuck.y" { (yyval.exp) = new_exp_from_member_dot( (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].sval), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column, (yylsp[(3) - (3)]).first_column ); ;} break; - case 236: -#line 686 "chuck.y" + case 242: +#line 699 "chuck.y" { (yyval.exp) = new_exp_from_postfix( (yyvsp[(1) - (2)].exp), ae_op_plusplus, (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; - case 237: -#line 688 "chuck.y" + case 243: +#line 701 "chuck.y" { (yyval.exp) = new_exp_from_postfix( (yyvsp[(1) - (2)].exp), ae_op_minusminus, (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; - case 238: -#line 693 "chuck.y" + case 244: +#line 706 "chuck.y" { (yyval.exp) = new_exp_from_id( (yyvsp[(1) - (1)].sval), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; - case 239: -#line 694 "chuck.y" + case 245: +#line 707 "chuck.y" { (yyval.exp) = new_exp_from_int( (yyvsp[(1) - (1)].ival), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; - case 240: -#line 695 "chuck.y" + case 246: +#line 708 "chuck.y" { (yyval.exp) = new_exp_from_float( (yyvsp[(1) - (1)].fval), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; - case 241: -#line 696 "chuck.y" + case 247: +#line 709 "chuck.y" { (yyval.exp) = new_exp_from_str( (yyvsp[(1) - (1)].sval), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; - case 242: -#line 697 "chuck.y" + case 248: +#line 710 "chuck.y" { (yyval.exp) = new_exp_from_char( (yyvsp[(1) - (1)].sval), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; - case 243: -#line 698 "chuck.y" + case 249: +#line 711 "chuck.y" { (yyval.exp) = new_exp_from_array_lit( (yyvsp[(1) - (1)].array_sub), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; - case 244: -#line 699 "chuck.y" + case 250: +#line 712 "chuck.y" { (yyval.exp) = new_exp_from_complex( (yyvsp[(1) - (1)].complex_exp), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; - case 245: -#line 700 "chuck.y" + case 251: +#line 713 "chuck.y" { (yyval.exp) = new_exp_from_polar( (yyvsp[(1) - (1)].polar_exp), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; - case 246: -#line 701 "chuck.y" + case 252: +#line 714 "chuck.y" { (yyval.exp) = new_exp_from_vec( (yyvsp[(1) - (1)].vec_exp), (yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column ); ;} break; - case 247: -#line 702 "chuck.y" + case 253: +#line 715 "chuck.y" { (yyval.exp) = new_exp_from_hack( (yyvsp[(2) - (3)].exp), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column ); ;} break; - case 248: -#line 703 "chuck.y" + case 254: +#line 716 "chuck.y" { (yyval.exp) = (yyvsp[(2) - (3)].exp); ;} break; - case 249: -#line 704 "chuck.y" + case 255: +#line 717 "chuck.y" { (yyval.exp) = new_exp_from_nil( (yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column ); ;} break; /* Line 1267 of yacc.c. */ -#line 3614 "chuck.tab.c" +#line 3686 "chuck.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -4205,8 +4277,8 @@ static void yynoreturn yy_fatal_error ( const char* msg ); (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 111 -#define YY_END_OF_BUFFER 112 +#define YY_NUM_RULES 113 +#define YY_END_OF_BUFFER 114 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -4214,44 +4286,46 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static const flex_int16_t yy_accept[326] = +static const flex_int16_t yy_accept[343] = { 0, - 0, 0, 112, 110, 4, 6, 110, 3, 45, 110, - 20, 21, 19, 31, 110, 37, 38, 17, 15, 12, - 16, 14, 18, 101, 101, 13, 43, 25, 36, 26, - 44, 91, 100, 39, 40, 33, 110, 100, 100, 100, - 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, - 100, 41, 32, 42, 46, 5, 24, 0, 107, 0, + 0, 0, 114, 112, 4, 6, 112, 3, 45, 112, + 20, 21, 19, 31, 112, 37, 38, 17, 15, 12, + 16, 14, 18, 103, 103, 13, 43, 25, 36, 26, + 44, 91, 102, 39, 40, 33, 112, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, + 102, 41, 32, 42, 46, 5, 24, 0, 109, 0, 9, 10, 0, 29, 0, 0, 0, 0, 7, 0, - 8, 0, 94, 105, 2, 1, 0, 105, 101, 0, - 0, 101, 0, 22, 95, 35, 27, 77, 23, 76, - 79, 0, 28, 34, 11, 0, 92, 0, 100, 0, - - 0, 0, 108, 100, 100, 100, 55, 100, 100, 100, - 100, 100, 53, 100, 100, 100, 100, 100, 100, 100, - 100, 100, 100, 100, 0, 30, 78, 0, 0, 0, - 0, 90, 85, 109, 0, 0, 0, 0, 83, 81, - 98, 96, 82, 0, 105, 84, 102, 0, 104, 0, - 103, 97, 56, 0, 99, 0, 57, 80, 0, 87, - 0, 0, 0, 0, 100, 100, 100, 100, 100, 47, - 60, 100, 100, 100, 61, 100, 100, 100, 100, 100, - 100, 100, 100, 100, 100, 100, 86, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 105, 102, 104, 0, - - 0, 103, 0, 89, 88, 0, 0, 0, 0, 0, - 100, 100, 100, 100, 54, 100, 100, 100, 100, 100, - 100, 100, 100, 70, 100, 100, 100, 100, 100, 100, - 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 106, 0, 0, 0, 0, 0, 52, 62, 71, 100, - 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, - 100, 72, 100, 100, 49, 48, 0, 0, 0, 0, - 106, 0, 0, 0, 100, 100, 100, 100, 75, 100, - 100, 100, 100, 66, 50, 58, 69, 73, 0, 0, - 0, 0, 0, 0, 0, 100, 64, 100, 100, 100, - - 100, 68, 100, 0, 0, 0, 0, 51, 74, 59, - 100, 100, 100, 0, 0, 93, 0, 100, 63, 67, - 0, 0, 0, 65, 0 + 8, 0, 96, 107, 2, 1, 0, 107, 103, 0, + 0, 103, 0, 22, 97, 35, 27, 77, 23, 76, + 79, 0, 28, 34, 11, 0, 92, 0, 0, 0, + + 102, 0, 0, 0, 110, 102, 102, 102, 55, 102, + 102, 102, 102, 102, 53, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 0, 30, 78, 0, + 0, 0, 0, 90, 85, 111, 0, 0, 0, 0, + 83, 81, 100, 98, 82, 0, 107, 84, 104, 0, + 106, 0, 105, 99, 56, 0, 101, 0, 57, 80, + 0, 0, 0, 87, 0, 0, 0, 0, 102, 102, + 102, 102, 102, 47, 60, 102, 102, 102, 61, 102, + 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, + 86, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 107, 104, 106, 0, 0, 105, 0, 89, 88, 0, + 0, 0, 0, 0, 0, 0, 102, 102, 102, 102, + 54, 102, 102, 102, 102, 102, 102, 102, 102, 70, + 102, 102, 102, 102, 102, 102, 102, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 108, 0, 0, 0, + 0, 0, 0, 0, 52, 62, 71, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, 102, 72, + 102, 102, 49, 48, 0, 0, 0, 0, 108, 0, + 0, 0, 0, 0, 102, 102, 102, 102, 75, 102, + 102, 102, 102, 66, 50, 58, 69, 73, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 102, 64, 102, + 102, 102, 102, 68, 102, 0, 0, 0, 0, 0, + 0, 51, 74, 59, 102, 102, 102, 0, 0, 0, + 95, 93, 0, 102, 63, 67, 0, 0, 94, 0, + 65, 0 } ; static const YY_CHAR yy_ec[256] = @@ -4298,95 +4372,99 @@ static const YY_CHAR yy_meta[72] = 1 } ; -static const flex_int16_t yy_base[371] = +static const flex_int16_t yy_base[388] = { 0, - 0, 0, 607, 608, 608, 608, 603, 608, 578, 65, - 591, 608, 60, 63, 562, 608, 608, 575, 59, 608, - 61, 55, 65, 88, 79, 577, 608, 77, 56, 95, - 608, 78, 0, 608, 608, 573, 52, 539, 39, 540, - 59, 75, 542, 89, 547, 56, 546, 70, 527, 536, - 540, 608, 91, 608, 608, 608, 563, 123, 608, 119, - 608, 608, 562, 608, 561, 132, 127, 560, 608, 559, - 124, 558, 608, 147, 608, 608, 557, 155, 190, 134, - 185, 162, 565, 608, 565, 135, 608, 608, 608, 608, - 608, 564, 608, 144, 608, 553, 608, 521, 0, 551, - - 143, 193, 608, 529, 532, 519, 0, 514, 512, 513, - 515, 513, 0, 511, 507, 503, 121, 107, 133, 509, - 521, 506, 502, 510, 534, 608, 608, 213, 0, 0, - 0, 608, 608, 608, 221, 0, 0, 0, 608, 608, - 608, 608, 608, 228, 608, 608, 200, 243, 246, 0, - 239, 608, 608, 533, 608, 532, 608, 608, 510, 608, - 249, 0, 0, 0, 513, 496, 157, 507, 506, 0, - 507, 432, 422, 426, 0, 404, 405, 410, 412, 411, - 395, 378, 364, 376, 371, 368, 608, 265, 0, 300, - 0, 262, 0, 339, 0, 287, 303, 275, 608, 157, - - 193, 280, 360, 608, 608, 361, 333, 0, 369, 0, - 366, 351, 349, 356, 0, 167, 345, 360, 355, 339, - 353, 348, 343, 0, 334, 315, 315, 315, 309, 311, - 316, 240, 0, 0, 0, 248, 0, 0, 0, 306, - 372, 319, 196, 0, 0, 0, 0, 0, 0, 306, - 311, 300, 303, 297, 288, 292, 278, 289, 273, 257, - 260, 0, 268, 262, 0, 0, 0, 0, 0, 0, - 608, 243, 0, 0, 241, 239, 254, 239, 0, 239, - 234, 229, 211, 0, 0, 0, 0, 0, 0, 250, - 0, 273, 203, 0, 251, 199, 0, 186, 172, 142, - - 139, 0, 126, 0, 0, 103, 0, 0, 0, 0, - 97, 98, 83, 0, 0, 608, 0, 20, 0, 0, - 0, 0, 0, 0, 608, 427, 435, 439, 447, 454, - 461, 466, 471, 475, 477, 479, 481, 483, 485, 487, - 489, 491, 493, 495, 497, 499, 501, 503, 505, 507, - 509, 511, 513, 515, 517, 519, 521, 523, 525, 527, - 529, 531, 533, 535, 537, 539, 541, 543, 545, 547 + 0, 0, 624, 625, 625, 625, 620, 625, 595, 65, + 608, 625, 60, 63, 579, 625, 625, 592, 59, 625, + 61, 55, 65, 88, 79, 594, 625, 77, 56, 95, + 625, 117, 0, 625, 625, 590, 50, 556, 38, 557, + 42, 56, 559, 75, 564, 73, 563, 79, 544, 553, + 557, 625, 89, 625, 625, 625, 580, 98, 625, 124, + 625, 625, 579, 625, 578, 128, 128, 577, 625, 576, + 127, 575, 625, 149, 625, 625, 574, 174, 192, 135, + 158, 123, 582, 625, 582, 162, 625, 625, 625, 625, + 625, 581, 625, 165, 625, 570, 625, 539, 547, 536, + + 0, 566, 159, 180, 625, 544, 547, 534, 0, 529, + 527, 528, 530, 528, 0, 526, 522, 518, 115, 160, + 150, 524, 536, 521, 517, 525, 549, 625, 625, 210, + 0, 0, 0, 625, 625, 625, 215, 0, 0, 0, + 625, 625, 625, 625, 625, 217, 625, 625, 223, 227, + 241, 0, 234, 625, 625, 548, 625, 547, 625, 625, + 517, 512, 523, 625, 244, 0, 0, 0, 526, 509, + 160, 520, 519, 0, 520, 520, 510, 515, 0, 499, + 500, 506, 511, 510, 495, 497, 494, 506, 501, 498, + 625, 260, 0, 295, 0, 262, 0, 334, 0, 277, + + 298, 268, 625, 217, 220, 275, 355, 625, 625, 491, + 489, 490, 328, 0, 364, 0, 495, 412, 410, 417, + 0, 230, 401, 417, 411, 396, 410, 404, 380, 0, + 376, 360, 365, 365, 358, 360, 358, 111, 0, 0, + 0, 136, 0, 0, 0, 286, 367, 344, 344, 357, + 251, 0, 0, 0, 0, 0, 0, 343, 351, 337, + 340, 337, 335, 324, 308, 317, 316, 300, 304, 0, + 313, 309, 0, 0, 0, 0, 0, 0, 625, 298, + 291, 290, 0, 0, 288, 286, 294, 279, 0, 286, + 288, 276, 262, 0, 0, 0, 0, 0, 0, 219, + + 0, 193, 259, 267, 252, 0, 271, 256, 0, 239, + 223, 216, 222, 0, 219, 0, 0, 211, 190, 182, + 0, 0, 0, 0, 154, 135, 112, 0, 0, 67, + 625, 625, 0, 20, 0, 0, 0, 0, 625, 0, + 0, 625, 422, 430, 434, 442, 449, 456, 461, 466, + 470, 472, 474, 476, 478, 480, 482, 484, 486, 488, + 490, 492, 494, 496, 498, 500, 502, 504, 506, 508, + 510, 512, 514, 516, 518, 520, 522, 524, 526, 528, + 530, 532, 534, 536, 538, 540, 542 } ; -static const flex_int16_t yy_def[371] = +static const flex_int16_t yy_def[388] = { 0, - 325, 1, 325, 325, 325, 325, 325, 325, 325, 326, - 325, 325, 325, 325, 327, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 328, 325, 325, 325, 329, 328, 328, 328, - 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, - 328, 325, 325, 325, 325, 325, 325, 326, 325, 330, - 325, 325, 325, 325, 325, 327, 331, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 332, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 328, 325, - - 329, 333, 325, 328, 328, 328, 328, 328, 328, 328, - 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, - 328, 328, 328, 328, 325, 325, 325, 326, 334, 335, - 336, 325, 325, 325, 327, 337, 338, 339, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 340, - 332, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 329, 341, 342, 343, 328, 328, 328, 328, 328, 328, - 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, - 328, 328, 328, 328, 328, 328, 325, 326, 344, 326, - 345, 327, 346, 327, 347, 325, 325, 325, 325, 340, - - 340, 325, 325, 325, 325, 325, 329, 348, 329, 349, - 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, - 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, - 328, 326, 350, 190, 351, 327, 352, 194, 353, 325, - 325, 325, 329, 354, 209, 355, 328, 328, 328, 328, - 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, - 328, 328, 328, 328, 328, 328, 356, 357, 358, 359, - 325, 325, 360, 361, 328, 328, 328, 328, 328, 328, - 328, 328, 328, 328, 328, 328, 328, 328, 362, 326, - 363, 327, 325, 364, 329, 328, 328, 328, 328, 328, - - 328, 328, 328, 365, 366, 325, 367, 328, 328, 328, - 328, 328, 328, 368, 369, 325, 370, 328, 328, 328, - 357, 359, 361, 328, 0, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325 + 342, 1, 342, 342, 342, 342, 342, 342, 342, 343, + 342, 342, 342, 342, 344, 342, 342, 342, 342, 342, + 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, + 342, 342, 345, 342, 342, 342, 346, 345, 345, 345, + 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, + 345, 342, 342, 342, 342, 342, 342, 343, 342, 347, + 342, 342, 342, 342, 342, 344, 348, 342, 342, 342, + 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, + 342, 342, 349, 342, 342, 342, 342, 342, 342, 342, + 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, + + 345, 342, 346, 350, 342, 345, 345, 345, 345, 345, + 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, + 345, 345, 345, 345, 345, 345, 342, 342, 342, 343, + 351, 352, 353, 342, 342, 342, 344, 354, 355, 356, + 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, + 342, 357, 349, 342, 342, 342, 342, 342, 342, 342, + 342, 342, 342, 342, 346, 358, 359, 360, 345, 345, + 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, + 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, + 342, 343, 361, 343, 362, 344, 363, 344, 364, 342, + + 342, 342, 342, 357, 357, 342, 342, 342, 342, 342, + 342, 342, 346, 365, 346, 366, 345, 345, 345, 345, + 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, + 345, 345, 345, 345, 345, 345, 345, 343, 367, 194, + 368, 344, 369, 198, 370, 342, 342, 342, 342, 342, + 346, 371, 215, 372, 345, 345, 345, 345, 345, 345, + 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, + 345, 345, 345, 345, 373, 374, 375, 376, 342, 342, + 342, 342, 377, 378, 345, 345, 345, 345, 345, 345, + 345, 345, 345, 345, 345, 345, 345, 345, 379, 343, + + 380, 344, 342, 342, 342, 381, 346, 345, 345, 345, + 345, 345, 345, 345, 345, 382, 383, 342, 342, 342, + 384, 345, 345, 345, 345, 345, 345, 385, 386, 342, + 342, 342, 387, 345, 345, 345, 374, 376, 342, 378, + 345, 0, 342, 342, 342, 342, 342, 342, 342, 342, + 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, + 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, + 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, + 342, 342, 342, 342, 342, 342, 342 } ; -static const flex_int16_t yy_nxt[680] = +static const flex_int16_t yy_nxt[697] = { 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, @@ -4396,75 +4474,78 @@ static const flex_int16_t yy_nxt[680] = 43, 33, 44, 33, 33, 33, 45, 33, 46, 47, 48, 49, 50, 33, 51, 33, 33, 52, 53, 54, 55, 59, 62, 64, 69, 74, 74, 74, 71, 75, - 324, 88, 89, 90, 76, 70, 63, 72, 73, 65, - 95, 77, 102, 105, 85, 103, 106, 78, 91, 79, - - 79, 79, 86, 87, 96, 60, 78, 97, 79, 79, - 79, 81, 92, 108, 82, 117, 82, 125, 118, 80, - 81, 93, 94, 82, 109, 82, 83, 81, 120, 59, - 320, 121, 110, 82, 80, 98, 81, 111, 113, 128, - 128, 82, 82, 134, 114, 115, 319, 135, 135, 141, - 82, 142, 178, 83, 147, 147, 129, 130, 318, 126, - 153, 154, 316, 60, 136, 137, 179, 74, 74, 74, - 156, 157, 67, 176, 313, 74, 74, 74, 177, 144, - 145, 131, 145, 102, 130, 312, 103, 144, 145, 138, - 145, 180, 137, 203, 181, 144, 145, 82, 311, 82, - - 148, 145, 148, 144, 145, 149, 149, 149, 78, 145, - 79, 79, 79, 161, 161, 203, 82, 213, 214, 59, - 147, 147, 81, 251, 82, 82, 252, 82, 310, 203, - 162, 163, 134, 188, 188, 198, 102, 198, 81, 103, - 309, 192, 192, 196, 82, 196, 59, 308, 197, 197, - 197, 203, 82, 60, 198, 164, 59, 201, 163, 134, - 306, 67, 198, 149, 149, 149, 149, 149, 149, 207, - 207, 59, 303, 134, 202, 203, 202, 302, 301, 199, - 60, 199, 236, 236, 134, 232, 232, 300, 67, 102, - 60, 102, 103, 202, 103, 199, 299, 203, 298, 297, - - 199, 202, 67, 296, 293, 60, 59, 197, 197, 197, - 198, 288, 198, 67, 287, 202, 286, 202, 285, 284, - 234, 234, 234, 197, 197, 197, 241, 241, 241, 198, - 234, 234, 234, 234, 202, 283, 145, 198, 145, 282, - 60, 281, 202, 280, 234, 234, 234, 234, 234, 234, - 134, 279, 145, 243, 243, 278, 277, 145, 276, 238, - 238, 238, 275, 272, 266, 265, 264, 263, 262, 238, - 238, 238, 238, 102, 261, 240, 103, 240, 260, 67, - 241, 241, 241, 238, 238, 238, 238, 238, 238, 245, - 245, 245, 241, 241, 241, 259, 258, 257, 256, 245, - - 245, 245, 245, 255, 254, 271, 253, 271, 250, 102, - 249, 248, 103, 245, 245, 245, 245, 245, 245, 247, - 242, 271, 231, 230, 229, 228, 271, 58, 58, 58, - 58, 58, 58, 58, 58, 66, 66, 227, 66, 66, - 66, 66, 66, 99, 99, 99, 99, 101, 101, 101, - 101, 101, 101, 101, 101, 58, 58, 226, 58, 225, - 224, 58, 66, 66, 223, 66, 222, 221, 66, 151, - 151, 151, 101, 101, 220, 101, 219, 218, 101, 189, - 189, 190, 190, 191, 191, 193, 193, 194, 194, 195, - 195, 200, 200, 208, 208, 209, 209, 210, 210, 233, - - 233, 235, 235, 237, 237, 239, 239, 244, 244, 246, - 246, 267, 267, 268, 268, 269, 269, 270, 270, 273, - 273, 274, 274, 289, 289, 290, 290, 291, 291, 292, - 292, 294, 294, 295, 295, 304, 304, 305, 305, 307, - 307, 314, 314, 315, 315, 317, 317, 321, 321, 322, - 322, 323, 323, 217, 216, 215, 212, 211, 206, 205, - 204, 187, 186, 185, 184, 183, 182, 175, 174, 173, - 172, 171, 170, 169, 168, 167, 166, 165, 160, 159, - 158, 155, 152, 150, 146, 143, 140, 139, 133, 132, - 127, 124, 123, 122, 119, 116, 112, 107, 104, 100, - - 84, 68, 67, 61, 57, 56, 325, 3, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325 + 341, 88, 89, 90, 76, 70, 63, 72, 73, 65, + 104, 77, 107, 105, 85, 108, 110, 78, 91, 79, + + 79, 79, 86, 87, 59, 60, 78, 111, 79, 79, + 79, 81, 92, 112, 82, 127, 82, 59, 113, 80, + 81, 93, 94, 82, 115, 82, 83, 81, 339, 95, + 116, 117, 119, 82, 80, 120, 81, 122, 60, 136, + 123, 82, 82, 96, 130, 130, 97, 136, 137, 137, + 82, 60, 143, 83, 144, 149, 149, 128, 82, 336, + 82, 131, 132, 98, 99, 138, 139, 180, 67, 74, + 74, 74, 181, 150, 100, 150, 67, 82, 151, 151, + 151, 146, 147, 335, 147, 82, 133, 155, 156, 132, + 140, 158, 159, 139, 74, 74, 74, 146, 147, 104, + + 165, 165, 105, 147, 136, 182, 146, 147, 184, 147, + 78, 185, 79, 79, 79, 334, 59, 166, 167, 183, + 219, 220, 146, 147, 81, 59, 136, 82, 147, 82, + 192, 192, 200, 67, 200, 196, 196, 201, 201, 201, + 81, 332, 168, 149, 149, 167, 82, 151, 151, 151, + 60, 331, 205, 207, 82, 67, 207, 330, 202, 60, + 202, 151, 151, 151, 213, 213, 59, 327, 326, 206, + 207, 206, 325, 136, 203, 207, 203, 202, 207, 324, + 238, 238, 242, 242, 104, 202, 259, 105, 206, 260, + 203, 104, 207, 323, 105, 203, 206, 201, 201, 201, + + 60, 59, 67, 202, 322, 202, 247, 247, 247, 320, + 206, 104, 206, 319, 105, 240, 240, 240, 201, 201, + 201, 318, 202, 315, 314, 240, 240, 240, 240, 206, + 202, 147, 313, 147, 312, 60, 311, 206, 310, 240, + 240, 240, 240, 240, 240, 136, 309, 147, 251, 251, + 308, 305, 147, 304, 244, 244, 244, 303, 298, 297, + 296, 295, 294, 293, 244, 244, 244, 244, 104, 292, + 246, 105, 246, 291, 67, 247, 247, 247, 244, 244, + 244, 244, 244, 244, 253, 253, 253, 247, 247, 247, + 290, 289, 288, 287, 253, 253, 253, 253, 286, 285, + + 279, 282, 279, 281, 104, 280, 274, 105, 253, 253, + 253, 253, 253, 253, 273, 272, 279, 271, 270, 269, + 268, 279, 58, 58, 58, 58, 58, 58, 58, 58, + 66, 66, 267, 66, 66, 66, 66, 66, 101, 101, + 101, 101, 103, 103, 103, 103, 103, 103, 103, 103, + 58, 58, 266, 58, 265, 264, 58, 66, 66, 263, + 66, 262, 261, 66, 153, 153, 153, 103, 103, 258, + 103, 257, 256, 103, 193, 193, 194, 194, 195, 195, + 197, 197, 198, 198, 199, 199, 204, 204, 214, 214, + 215, 215, 216, 216, 239, 239, 241, 241, 243, 243, + + 245, 245, 252, 252, 254, 254, 275, 275, 276, 276, + 277, 277, 278, 278, 283, 283, 284, 284, 299, 299, + 300, 300, 301, 301, 302, 302, 306, 306, 307, 307, + 316, 316, 317, 317, 321, 321, 328, 328, 329, 329, + 333, 333, 337, 337, 338, 338, 340, 340, 255, 250, + 249, 248, 237, 236, 235, 234, 233, 232, 231, 230, + 229, 228, 227, 226, 225, 224, 223, 222, 221, 218, + 217, 212, 211, 210, 209, 208, 191, 190, 189, 188, + 187, 186, 179, 178, 177, 176, 175, 174, 173, 172, + 171, 170, 169, 164, 163, 162, 161, 160, 157, 154, + + 152, 148, 145, 142, 141, 135, 134, 129, 126, 125, + 124, 121, 118, 114, 109, 106, 102, 84, 68, 67, + 61, 57, 56, 342, 3, 342, 342, 342, 342, 342, + 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, + 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, + 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, + 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, + 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, + 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, + 342, 342, 342, 342, 342, 342 + } ; -static const flex_int16_t yy_chk[680] = +static const flex_int16_t yy_chk[697] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -4474,83 +4555,86 @@ static const flex_int16_t yy_chk[680] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 13, 14, 19, 22, 22, 22, 21, 23, - 318, 29, 29, 29, 23, 19, 13, 21, 21, 14, - 32, 23, 37, 39, 28, 37, 39, 25, 29, 25, - - 25, 25, 28, 28, 32, 10, 24, 32, 24, 24, - 24, 25, 30, 41, 25, 46, 25, 53, 46, 24, - 24, 30, 30, 24, 41, 24, 24, 25, 48, 58, - 313, 48, 42, 25, 24, 32, 24, 42, 44, 60, - 60, 25, 24, 66, 44, 44, 312, 67, 67, 71, - 24, 71, 118, 24, 80, 80, 60, 60, 311, 53, - 86, 86, 306, 58, 67, 67, 118, 74, 74, 74, - 94, 94, 66, 117, 303, 78, 78, 78, 117, 74, - 74, 60, 74, 101, 60, 301, 101, 78, 78, 67, - 78, 119, 67, 200, 119, 74, 74, 82, 300, 82, - - 81, 74, 81, 78, 78, 81, 81, 81, 79, 78, - 79, 79, 79, 102, 102, 200, 82, 167, 167, 128, - 147, 147, 79, 216, 82, 79, 216, 79, 299, 201, - 102, 102, 135, 128, 128, 147, 243, 147, 79, 243, - 298, 135, 135, 144, 79, 144, 232, 296, 144, 144, - 144, 201, 79, 128, 147, 102, 290, 151, 102, 236, - 293, 135, 147, 148, 148, 148, 149, 149, 149, 161, - 161, 188, 283, 192, 151, 151, 151, 282, 281, 149, - 232, 149, 192, 192, 292, 188, 188, 280, 236, 161, - 290, 295, 161, 151, 295, 149, 278, 151, 277, 276, - - 149, 151, 192, 275, 272, 188, 190, 196, 196, 196, - 198, 264, 198, 292, 263, 202, 261, 202, 260, 259, - 190, 190, 190, 197, 197, 197, 240, 240, 240, 198, - 190, 190, 190, 190, 202, 258, 197, 198, 197, 257, - 190, 256, 202, 255, 190, 190, 190, 190, 190, 190, - 194, 254, 197, 207, 207, 253, 252, 197, 251, 194, - 194, 194, 250, 242, 231, 230, 229, 228, 227, 194, - 194, 194, 194, 207, 226, 203, 207, 203, 225, 194, - 203, 203, 203, 194, 194, 194, 194, 194, 194, 209, - 209, 209, 241, 241, 241, 223, 222, 221, 220, 209, - - 209, 209, 209, 219, 218, 241, 217, 241, 214, 209, - 213, 212, 209, 209, 209, 209, 209, 209, 209, 211, - 206, 241, 186, 185, 184, 183, 241, 326, 326, 326, - 326, 326, 326, 326, 326, 327, 327, 182, 327, 327, - 327, 327, 327, 328, 328, 328, 328, 329, 329, 329, - 329, 329, 329, 329, 329, 330, 330, 181, 330, 180, - 179, 330, 331, 331, 178, 331, 177, 176, 331, 332, - 332, 332, 333, 333, 174, 333, 173, 172, 333, 334, - 334, 335, 335, 336, 336, 337, 337, 338, 338, 339, - 339, 340, 340, 341, 341, 342, 342, 343, 343, 344, - - 344, 345, 345, 346, 346, 347, 347, 348, 348, 349, - 349, 350, 350, 351, 351, 352, 352, 353, 353, 354, - 354, 355, 355, 356, 356, 357, 357, 358, 358, 359, - 359, 360, 360, 361, 361, 362, 362, 363, 363, 364, - 364, 365, 365, 366, 366, 367, 367, 368, 368, 369, - 369, 370, 370, 171, 169, 168, 166, 165, 159, 156, - 154, 125, 124, 123, 122, 121, 120, 116, 115, 114, - 112, 111, 110, 109, 108, 106, 105, 104, 100, 98, - 96, 92, 85, 83, 77, 72, 70, 68, 65, 63, - 57, 51, 50, 49, 47, 45, 43, 40, 38, 36, - - 26, 18, 15, 11, 9, 7, 3, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325 + 334, 29, 29, 29, 23, 19, 13, 21, 21, 14, + 37, 23, 39, 37, 28, 39, 41, 25, 29, 25, + + 25, 25, 28, 28, 58, 10, 24, 41, 24, 24, + 24, 25, 30, 42, 25, 53, 25, 238, 42, 24, + 24, 30, 30, 24, 44, 24, 24, 25, 330, 32, + 44, 44, 46, 25, 24, 46, 24, 48, 58, 66, + 48, 25, 24, 32, 60, 60, 32, 242, 67, 67, + 24, 238, 71, 24, 71, 80, 80, 53, 82, 327, + 82, 60, 60, 32, 32, 67, 67, 119, 66, 74, + 74, 74, 119, 81, 32, 81, 242, 82, 81, 81, + 81, 74, 74, 326, 74, 82, 60, 86, 86, 60, + 67, 94, 94, 67, 78, 78, 78, 74, 74, 103, + + 104, 104, 103, 74, 302, 120, 78, 78, 121, 78, + 79, 121, 79, 79, 79, 325, 130, 104, 104, 120, + 171, 171, 78, 78, 79, 300, 137, 79, 78, 79, + 130, 130, 146, 302, 146, 137, 137, 146, 146, 146, + 79, 320, 104, 149, 149, 104, 79, 150, 150, 150, + 130, 319, 153, 204, 79, 137, 205, 318, 149, 300, + 149, 151, 151, 151, 165, 165, 192, 315, 313, 153, + 153, 153, 312, 196, 151, 204, 151, 149, 205, 311, + 192, 192, 196, 196, 165, 149, 222, 165, 153, 222, + 151, 251, 153, 310, 251, 151, 153, 200, 200, 200, + + 192, 194, 196, 202, 308, 202, 246, 246, 246, 305, + 206, 307, 206, 304, 307, 194, 194, 194, 201, 201, + 201, 303, 202, 293, 292, 194, 194, 194, 194, 206, + 202, 201, 291, 201, 290, 194, 288, 206, 287, 194, + 194, 194, 194, 194, 194, 198, 286, 201, 213, 213, + 285, 282, 201, 281, 198, 198, 198, 280, 272, 271, + 269, 268, 267, 266, 198, 198, 198, 198, 213, 265, + 207, 213, 207, 264, 198, 207, 207, 207, 198, 198, + 198, 198, 198, 198, 215, 215, 215, 247, 247, 247, + 263, 262, 261, 260, 215, 215, 215, 215, 259, 258, + + 247, 250, 247, 249, 215, 248, 237, 215, 215, 215, + 215, 215, 215, 215, 236, 235, 247, 234, 233, 232, + 231, 247, 343, 343, 343, 343, 343, 343, 343, 343, + 344, 344, 229, 344, 344, 344, 344, 344, 345, 345, + 345, 345, 346, 346, 346, 346, 346, 346, 346, 346, + 347, 347, 228, 347, 227, 226, 347, 348, 348, 225, + 348, 224, 223, 348, 349, 349, 349, 350, 350, 220, + 350, 219, 218, 350, 351, 351, 352, 352, 353, 353, + 354, 354, 355, 355, 356, 356, 357, 357, 358, 358, + 359, 359, 360, 360, 361, 361, 362, 362, 363, 363, + + 364, 364, 365, 365, 366, 366, 367, 367, 368, 368, + 369, 369, 370, 370, 371, 371, 372, 372, 373, 373, + 374, 374, 375, 375, 376, 376, 377, 377, 378, 378, + 379, 379, 380, 380, 381, 381, 382, 382, 383, 383, + 384, 384, 385, 385, 386, 386, 387, 387, 217, 212, + 211, 210, 190, 189, 188, 187, 186, 185, 184, 183, + 182, 181, 180, 178, 177, 176, 175, 173, 172, 170, + 169, 163, 162, 161, 158, 156, 127, 126, 125, 124, + 123, 122, 118, 117, 116, 114, 113, 112, 111, 110, + 108, 107, 106, 102, 100, 99, 98, 96, 92, 85, + + 83, 77, 72, 70, 68, 65, 63, 57, 51, 50, + 49, 47, 45, 43, 40, 38, 36, 26, 18, 15, + 11, 9, 7, 3, 342, 342, 342, 342, 342, 342, + 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, + 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, + 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, + 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, + 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, + 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, + 342, 342, 342, 342, 342, 342 + } ; /* Table of booleans, true if rule could match eol. */ -static const flex_int32_t yy_rule_can_match_eol[112] = +static const flex_int32_t yy_rule_can_match_eol[114] = { 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, }; + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, }; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; @@ -4792,7 +4876,7 @@ long htol( c_str str ) yycolumn += yyleng; -#line 962 "chuck.yy.c" +#line 974 "chuck.yy.c" /* generate line number */ /* 1.5.0.7 (ge) added to remove dependecy on isatty() and unistd.h without the above option, flex/bison will check isatty() to determine @@ -4809,7 +4893,7 @@ long htol( c_str str ) /* universal character name */ /* thanks O'Reilly book for the above recipes for STRING_LIT / CHAR_LIT / FLOAT_VAL https://web.iitd.ac.in/~sumeet/flex__bison.pdf */ -#line 979 "chuck.yy.c" +#line 991 "chuck.yy.c" #define INITIAL 0 @@ -5032,7 +5116,7 @@ YY_DECL ---------------------------------------------------------------*/ /* "<--" { char c; adjust(); comment_hack; continue; } */ /* ------------------------------------------------------------ */ -#line 1202 "chuck.yy.c" +#line 1214 "chuck.yy.c" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { @@ -5059,13 +5143,13 @@ YY_DECL while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 326 ) + if ( yy_current_state >= 343 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; ++yy_cp; } - while ( yy_current_state != 325 ); + while ( yy_current_state != 342 ); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); @@ -5565,62 +5649,62 @@ YY_RULE_SETUP case 94: YY_RULE_SETUP #line 372 "chuck.lex" -{ adjust(); return ARROW_RIGHT; } +{ adjust(); return AT_CTOR; } YY_BREAK case 95: YY_RULE_SETUP #line 373 "chuck.lex" -{ adjust(); return ARROW_LEFT; } +{ adjust(); return AT_DTOR; } YY_BREAK case 96: YY_RULE_SETUP #line 374 "chuck.lex" -{ adjust(); return GRUCK_RIGHT; } +{ adjust(); return ARROW_RIGHT; } YY_BREAK case 97: YY_RULE_SETUP #line 375 "chuck.lex" -{ adjust(); return GRUCK_LEFT; } +{ adjust(); return ARROW_LEFT; } YY_BREAK case 98: YY_RULE_SETUP #line 376 "chuck.lex" -{ adjust(); return UNGRUCK_RIGHT; } +{ adjust(); return GRUCK_RIGHT; } YY_BREAK case 99: YY_RULE_SETUP #line 377 "chuck.lex" -{ adjust(); return UNGRUCK_LEFT; } +{ adjust(); return GRUCK_LEFT; } YY_BREAK case 100: YY_RULE_SETUP -#line 379 "chuck.lex" -{ adjust(); yylval.sval=alloc_str(yytext); return ID; } +#line 378 "chuck.lex" +{ adjust(); return UNGRUCK_RIGHT; } YY_BREAK case 101: YY_RULE_SETUP -#line 381 "chuck.lex" -{ adjust(); yylval.ival=atoi(yytext); return INT_VAL; } +#line 379 "chuck.lex" +{ adjust(); return UNGRUCK_LEFT; } YY_BREAK case 102: YY_RULE_SETUP -#line 382 "chuck.lex" -{ adjust(); yylval.ival=atoi(yytext); return INT_VAL; } +#line 381 "chuck.lex" +{ adjust(); yylval.sval=alloc_str(yytext); return ID; } YY_BREAK case 103: YY_RULE_SETUP #line 383 "chuck.lex" -{ adjust(); yylval.ival=htol(yytext); return INT_VAL; } +{ adjust(); yylval.ival=atoi(yytext); return INT_VAL; } YY_BREAK case 104: YY_RULE_SETUP -#line 385 "chuck.lex" -{ adjust(); yylval.fval=atof(yytext); return FLOAT_VAL; } +#line 384 "chuck.lex" +{ adjust(); yylval.ival=atoi(yytext); return INT_VAL; } YY_BREAK case 105: YY_RULE_SETUP -#line 386 "chuck.lex" -{ adjust(); yylval.fval=atof(yytext); return FLOAT_VAL; } +#line 385 "chuck.lex" +{ adjust(); yylval.ival=htol(yytext); return INT_VAL; } YY_BREAK case 106: YY_RULE_SETUP @@ -5628,34 +5712,44 @@ YY_RULE_SETUP { adjust(); yylval.fval=atof(yytext); return FLOAT_VAL; } YY_BREAK case 107: -/* rule 107 can match eol */ YY_RULE_SETUP -#line 389 "chuck.lex" -{ adjust(); yylval.sval=alloc_str(strip_lit(yytext)); return STRING_LIT; } +#line 388 "chuck.lex" +{ adjust(); yylval.fval=atof(yytext); return FLOAT_VAL; } YY_BREAK case 108: -/* rule 108 can match eol */ YY_RULE_SETUP -#line 390 "chuck.lex" -{ adjust(); yylval.sval=alloc_str(strip_lit(yytext)); return STRING_LIT; } +#line 389 "chuck.lex" +{ adjust(); yylval.fval=atof(yytext); return FLOAT_VAL; } YY_BREAK case 109: /* rule 109 can match eol */ YY_RULE_SETUP #line 391 "chuck.lex" -{ adjust(); yylval.sval=alloc_str(strip_lit(yytext)); return CHAR_LIT; } +{ adjust(); yylval.sval=alloc_str(strip_lit(yytext)); return STRING_LIT; } YY_BREAK case 110: +/* rule 110 can match eol */ YY_RULE_SETUP -#line 393 "chuck.lex" -{ adjust(); EM_error( EM_tokPos, "illegal token" ); } +#line 392 "chuck.lex" +{ adjust(); yylval.sval=alloc_str(strip_lit(yytext)); return STRING_LIT; } YY_BREAK case 111: +/* rule 111 can match eol */ +YY_RULE_SETUP +#line 393 "chuck.lex" +{ adjust(); yylval.sval=alloc_str(strip_lit(yytext)); return CHAR_LIT; } + YY_BREAK +case 112: YY_RULE_SETUP #line 395 "chuck.lex" +{ adjust(); EM_error( EM_tokPos, "illegal token" ); } + YY_BREAK +case 113: +YY_RULE_SETUP +#line 397 "chuck.lex" ECHO; YY_BREAK -#line 1825 "chuck.yy.c" +#line 1847 "chuck.yy.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -5953,7 +6047,7 @@ static int yy_get_next_buffer (void) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 326 ) + if ( yy_current_state >= 343 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; @@ -5981,11 +6075,11 @@ static int yy_get_next_buffer (void) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 326 ) + if ( yy_current_state >= 343 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - yy_is_jam = (yy_current_state == 325); + yy_is_jam = (yy_current_state == 342); return yy_is_jam ? 0 : yy_current_state; } @@ -6673,7 +6767,7 @@ void yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 395 "chuck.lex" +#line 397 "chuck.lex" // older diff --git a/src/core/chuck_yacc.h b/src/core/chuck_yacc.h index d355561cf..7aac7fb5d 100644 --- a/src/core/chuck_yacc.h +++ b/src/core/chuck_yacc.h @@ -152,7 +152,9 @@ GRUCK_LEFT = 368, UNGRUCK_RIGHT = 369, UNGRUCK_LEFT = 370, - AT_OP = 371 + AT_OP = 371, + AT_CTOR = 372, + AT_DTOR = 373 }; #endif /* Tokens. */ @@ -270,6 +272,8 @@ #define UNGRUCK_RIGHT 369 #define UNGRUCK_LEFT 370 #define AT_OP 371 +#define AT_CTOR 372 +#define AT_DTOR 373 @@ -303,7 +307,7 @@ typedef union YYSTYPE a_Vec vec_exp; // ge: added 1.3.5.3 } /* Line 1529 of yacc.c. */ -#line 307 "chuck.tab.h" +#line 311 "chuck.tab.h" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 From f3c1a27f042ec5451174dfa8bf16d6cdb862cd63 Mon Sep 17 00:00:00 2001 From: Ge Wang Date: Thu, 16 Nov 2023 02:19:41 -0800 Subject: [PATCH 19/20] fix issue with arrays incorrectly calling its base type dtors --- src/core/chuck_oo.cpp | 6 +++++- src/core/chuck_type.cpp | 3 +++ src/core/chuck_type.h | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/core/chuck_oo.cpp b/src/core/chuck_oo.cpp index eb906b322..e90343cc7 100644 --- a/src/core/chuck_oo.cpp +++ b/src/core/chuck_oo.cpp @@ -288,8 +288,12 @@ Chuck_Object::~Chuck_Object() while( type != NULL ) { // SPENCER TODO: HACK! is there a better way to call the dtor? - if( type->info && type->info->pre_dtor ) // 1.5.0.0 (ge) added type->info check + // has_pre-dtor: related to info->pre_dtor, but different since info is shared with arrays + // of this type (via new_array_type()), but this flag pertains to this type only + if( type->info && type->has_pre_dtor ) // 1.5.0.0 (ge) added type->info check { + // make sure + assert( type->info->pre_dtor ); // check origin of dtor if( type->info->pre_dtor->native_func ) // c++-defined deconstructor { diff --git a/src/core/chuck_type.cpp b/src/core/chuck_type.cpp index b3b962e51..e55371649 100644 --- a/src/core/chuck_type.cpp +++ b/src/core/chuck_type.cpp @@ -6461,6 +6461,8 @@ Chuck_Type * type_engine_import_class_begin( Chuck_Env * env, Chuck_Type * type, // if destructor if( dtor != 0 ) { + // flag it (needed since info could be shared with array types of this type, but this flag is only this type) + type->has_pre_dtor = TRUE; // allocate vm code for dtor type->info->pre_dtor = new Chuck_VM_Code; // add ref | 1.5.1.9 (ge) added @@ -9245,6 +9247,7 @@ Chuck_Type::Chuck_Type( Chuck_Env * env, te_Type _id, const std::string & _n, ugen_info = NULL; is_complete = TRUE; has_pre_ctor = FALSE; + has_pre_dtor = FALSE; ctors = NULL; ctor_default = NULL; dtor = NULL; diff --git a/src/core/chuck_type.h b/src/core/chuck_type.h index 3a2f73f38..879faa640 100644 --- a/src/core/chuck_type.h +++ b/src/core/chuck_type.h @@ -945,6 +945,9 @@ struct Chuck_Type : public Chuck_Object t_CKBOOL is_complete; // has pre-constructor t_CKBOOL has_pre_ctor; + // has pre-destructor; related to info->pre_dtor, but different since info is shared with arrays + // of this type (via new_array_type()), but this flag is this specific type only + t_CKBOOL has_pre_dtor; // constructor(s), potentially overloaded | 1.5.1.9 (ge) added Chuck_Func * ctors; // default constructor (no arguments) | 1.5.1.9 (ge) added From 448394a9351a630143e1ad3d354621e05bc5b19d Mon Sep 17 00:00:00 2001 From: Ge Wang Date: Thu, 16 Nov 2023 14:39:16 -0800 Subject: [PATCH 20/20] remove extra ctor/dtor function frame --- src/core/chuck_type.cpp | 23 ----------------------- src/core/chuck_type.h | 4 ---- 2 files changed, 27 deletions(-) diff --git a/src/core/chuck_type.cpp b/src/core/chuck_type.cpp index e55371649..ff00c7e82 100644 --- a/src/core/chuck_type.cpp +++ b/src/core/chuck_type.cpp @@ -5811,29 +5811,6 @@ Chuck_Value * type_engine_check_const( Chuck_Env * env, a_Exp exp ) -//----------------------------------------------------------------------------- -// name: type_engine_lookup_ctor() | 1.5.1.9 (ge) added -// desc: look up constructor by type and argument list -//----------------------------------------------------------------------------- -Chuck_Func * type_engine_lookup_ctor( Chuck_Env * env, Chuck_Type * type, a_Exp args ) -{ - return NULL; -} - - - -//----------------------------------------------------------------------------- -// name: type_engine_lookup_dtor() | 1.5.1.9 (ge) added -// desc: look up destructor by type -//----------------------------------------------------------------------------- -Chuck_Func * type_engine_lookup_dtor( Chuck_Env * env, Chuck_Type * type ) -{ - return NULL; -} - - - - //----------------------------------------------------------------------------- // name: type_engine_check_ctor_call() | 1.5.1.9 (ge) added // desc: type check constructor invocation; also see func_call() diff --git a/src/core/chuck_type.h b/src/core/chuck_type.h index 879faa640..3f7507691 100644 --- a/src/core/chuck_type.h +++ b/src/core/chuck_type.h @@ -1344,10 +1344,6 @@ t_CKBOOL type_engine_init_op_overload( Chuck_Env * env ); t_CKBOOL type_engine_scan_func_op_overload( Chuck_Env * env, a_Func_Def func_def ); // type-check an operator overload func def | 1.5.1.5 (ge) added t_CKBOOL type_engine_check_func_op_overload( Chuck_Env * env, a_Func_Def func_def ); -// constructors | 1.5.1.9 (ge) added -Chuck_Func * type_engine_lookup_ctor( Chuck_Env * env, Chuck_Type * type, a_Exp args ); -// destructor | 1.5.1.9 (ge) added -Chuck_Func * type_engine_lookup_dtor( Chuck_Env * env, Chuck_Type * type ); //-----------------------------------------------------------------------------