Quellcode durchsuchen

基本应用内置类

SongZihuan vor 5 Jahren
Ursprung
Commit
c010698779
5 geänderte Dateien mit 514 neuen und 293 gelöschten Zeilen
  1. BIN
      gwarf
  2. 4 1
      gwarf_interpreter/interprete.h
  3. 262 90
      gwarf_interpreter/interpreter.c
  4. 39 16
      paser/gwarf_yacc.y
  5. 209 186
      paser/y.tab.c

BIN
gwarf


+ 4 - 1
gwarf_interpreter/interprete.h

@@ -10,7 +10,7 @@ typedef enum{
     INT_value,  // INT 类型[只允许系统使用]
     INT_value,  // INT 类型[只允许系统使用]
     BOOL_value,  // bool : true or false [只允许系统使用]
     BOOL_value,  // bool : true or false [只允许系统使用]
     STRING_value,  // char * [只允许系统使用]
     STRING_value,  // char * [只允许系统使用]
-    NULL_value,  // 无值类型 [只允许系统使用]
+    NULL_value,  // 无值类型
     FUNC_value,  // 函数
     FUNC_value,  // 函数
     CLASS_value,  // 对象
     CLASS_value,  // 对象
     OBJECT_value,  // 实例
     OBJECT_value,  // 实例
@@ -350,11 +350,14 @@ void append_parameter_name(char *, parameter *);
 parameter *make_parameter_value(statement *);
 parameter *make_parameter_value(statement *);
 void append_parameter_value(statement *, parameter *);
 void append_parameter_value(statement *, parameter *);
 parameter *add_parameter_value(statement *, parameter *);
 parameter *add_parameter_value(statement *, parameter *);
+
 parameter *pack_value_parameter(GWARF_value);
 parameter *pack_value_parameter(GWARF_value);
+statement *pack_call_name(char *, statement *);
 
 
 // main
 // main
 inter *global_inter;
 inter *global_inter;
 statement_list *statement_base;
 statement_list *statement_base;
+GWARF_value to_object(GWARF_value, var_list *);
 
 
 void login_official_func(int type, int is_class, var_list *the_var, char *name, GWARF_result (*paser)(func *, parameter *, var_list *, GWARF_result, var_list *));
 void login_official_func(int type, int is_class, var_list *the_var, char *name, GWARF_result (*paser)(func *, parameter *, var_list *, GWARF_result, var_list *));
 void login_official(var_list *the_var, GWARF_result (*paser)(func *, parameter *, var_list *, GWARF_result, var_list *));
 void login_official(var_list *the_var, GWARF_result (*paser)(func *, parameter *, var_list *, GWARF_result, var_list *));

+ 262 - 90
gwarf_interpreter/interpreter.c

@@ -132,6 +132,14 @@ parameter *pack_value_parameter(GWARF_value value){  // 把value封装成参数
     return tmp;
     return tmp;
 }
 }
 
 
+statement *pack_call_name(char *name, statement *from){  // 快速生成call back函数的the_statment
+    statement *tmp = make_statement();
+    tmp->type = base_var;
+    tmp->code.base_var.var_name = name;
+    tmp->code.base_var.from = from;
+    return tmp;
+}
+
 // ---- var func
 // ---- var func
 
 
 var *make_var(){  // make var with base
 var *make_var(){  // make var with base
@@ -247,6 +255,9 @@ void append_default_var_base(char *name ,int from, default_var *base_default_var
 
 
 int get_default(char *name, default_var *base_default_var){  // get the address
 int get_default(char *name, default_var *base_default_var){  // get the address
     default_var *tmp = base_default_var;  // iter var
     default_var *tmp = base_default_var;  // iter var
+    if(tmp == NULL){
+        return 0;
+    }
     while(1){
     while(1){
         if (!strcmp(tmp->name, name)){  // if tmp->name == name , strcmp will return 0, if not strcmp return not 0
         if (!strcmp(tmp->name, name)){  // if tmp->name == name , strcmp will return 0, if not strcmp return not 0
             return tmp->from;
             return tmp->from;
@@ -349,7 +360,7 @@ var *find_var(var_list *var_base,int from, char *name){  // find var by func get
         }
         }
         start = start->next;
         start = start->next;
     }
     }
-    printf("----var find address = %d----\n", start);
+    // printf("name = %s, from = %d, address = %x\n", name, from, start->var_base);
     while (1)
     while (1)
     {
     {
         return_var = get_var(name, start->var_base);
         return_var = get_var(name, start->var_base);
@@ -360,6 +371,7 @@ var *find_var(var_list *var_base,int from, char *name){  // find var by func get
             start = start->next;
             start = start->next;
             continue;
             continue;
         }
         }
+        // printf("find on name = %s, from = %d, address = %x\n", name, from, start->var_base);
         return return_var;  //get var success can or can't next
         return return_var;  //get var success can or can't next
     }
     }
 }
 }
@@ -374,7 +386,7 @@ void add_var(var_list *var_base,int from, char *name, GWARF_value value){  // ad
         }
         }
         start = start->next;
         start = start->next;
     }
     }
-    printf("----var add address = %d----\n", start);
+    // printf("----var add address = %d----\n", start);
     append_var(name, value, start->var_base);
     append_var(name, value, start->var_base);
 }
 }
 
 
@@ -474,8 +486,8 @@ GWARF_result read_statement(statement *the_statement, var_list *the_var, var_lis
     }
     }
     GWARF_result return_value;
     GWARF_result return_value;
     return_value.u = statement_end;  // 正常设置[正常语句结束]
     return_value.u = statement_end;  // 正常设置[正常语句结束]
-    return_value.value.type = NUMBER_value;  // 默认设置
-    return_value.value.value.double_value = 0;  // 默认设置
+    return_value.value.type = NULL_value;  // 默认设置
+    return_value.value.value.int_value = 0;  // 默认设置
     switch (the_statement->type)
     switch (the_statement->type)
     {
     {
         case operation:  // 表达式运算
         case operation:  // 表达式运算
@@ -502,8 +514,8 @@ GWARF_result read_statement(statement *the_statement, var_list *the_var, var_lis
                 printf("operation value = %s\n", return_value.value.value.string);
                 printf("operation value = %s\n", return_value.value.value.string);
             }
             }
             else{
             else{
-                    printf("var value = other\n");
-                }
+                printf("operation value = other[%d]\n", return_value.value.type);
+            }
             puts("----stop code----");
             puts("----stop code----");
             break;
             break;
         case call:
         case call:
@@ -513,16 +525,28 @@ GWARF_result read_statement(statement *the_statement, var_list *the_var, var_lis
             puts("----while code----");
             puts("----while code----");
             return_value = while_func(the_statement, the_var);
             return_value = while_func(the_statement, the_var);
             puts("----stop while code----");
             puts("----stop while code----");
+            if(return_value.u == return_def){  // while循环不需要返回值[避免GWARF_value 进入 the_var]
+                return_value.value.type = NULL_value;
+                return_value.value.value.int_value = 0;
+            }
             break;
             break;
         case for_cycle:
         case for_cycle:
             puts("----for code----");
             puts("----for code----");
             return_value = for_func(the_statement, the_var);
             return_value = for_func(the_statement, the_var);
             puts("----for while code----");
             puts("----for while code----");
+            if(return_value.u == return_def){  // while循环不需要返回值[避免GWARF_value 进入 the_var]
+                return_value.value.type = NULL_value;
+                return_value.value.value.int_value = 0;
+            }
             break;
             break;
         case if_branch:
         case if_branch:
             puts("----if code----");
             puts("----if code----");
             return_value = if_func(the_statement->code.if_branch.done, the_var);
             return_value = if_func(the_statement->code.if_branch.done, the_var);
             puts("----stop if code----");
             puts("----stop if code----");
+            if(return_value.u == return_def){  // while循环不需要返回值[避免GWARF_value 进入 the_var]
+                return_value.value.type = NULL_value;
+                return_value.value.value.int_value = 0;
+            }
             break;
             break;
         case base_value:  // get value[所有字面量均为这个表达式]
         case base_value:  // get value[所有字面量均为这个表达式]
             return_value.value = (the_statement->code).base_value.value;  // code
             return_value.value = (the_statement->code).base_value.value;  // code
@@ -539,16 +563,27 @@ GWARF_result read_statement(statement *the_statement, var_list *the_var, var_lis
                 printf("get value = %s\n", return_value.value.value.string);
                 printf("get value = %s\n", return_value.value.value.string);
             }
             }
             else{
             else{
-                printf("get value = other\n");
+                printf("get value = other[%d]\n", return_value.value.type);
             }
             }
+            // base_value返回字面量 -> 主要返回object类型,还会返回GWARF_value的其他类型供生成object类型
             break;
             break;
         case base_var:{    // because the var tmp, we should ues a {} to make a block[name space] for the tmp var;
         case base_var:{    // because the var tmp, we should ues a {} to make a block[name space] for the tmp var;
             int from = 0;
             int from = 0;
-            if((the_statement->code).base_var.from == NULL){
+            if(the_statement->code.base_var.from == NULL){
                 from = 0;
                 from = 0;
             }
             }
             else{
             else{
-                from = (int)traverse((the_statement->code).base_var.from, the_var, false).value.value.double_value;
+                GWARF_result tmp_result, tmp_object = traverse(the_statement->code.base_var.from, the_var, false);
+                tmp_result = get__value__(&(tmp_object.value), the_var);  // 从object中提取value
+                if(tmp_result.value.type == INT_value){
+                    from = tmp_result.value.value.int_value;
+                }
+                else if(tmp_result.value.type == NUMBER_value){
+                    from = (int)tmp_result.value.value.double_value;
+                }
+                else{
+                    from = 0;
+                }
             }
             }
             var *tmp = find_var(the_var, from, (the_statement->code).base_var.var_name);
             var *tmp = find_var(the_var, from, (the_statement->code).base_var.var_name);
             if(tmp == NULL){
             if(tmp == NULL){
@@ -587,10 +622,14 @@ GWARF_result read_statement(statement *the_statement, var_list *the_var, var_lis
                 puts("func: point");
                 puts("func: point");
                 return_value = traverse((the_statement->code).point.child_var, base_the_var.value.object_value->the_var, false);
                 return_value = traverse((the_statement->code).point.child_var, base_the_var.value.object_value->the_var, false);
             }
             }
+            else{  // 其他类型
+                goto the_break;
+            }
             return_value.father = malloc(sizeof(return_value.father));  // 记录father的值
             return_value.father = malloc(sizeof(return_value.father));  // 记录father的值
             *(return_value.father) = base_the_var;
             *(return_value.father) = base_the_var;
             puts("----stop point----");
             puts("----stop point----");
-            break;
+            return_value.value = to_object(return_value.value, the_var);
+            the_break: break;
         }
         }
         case def:{
         case def:{
             GWARF_result func_value;
             GWARF_result func_value;
@@ -611,6 +650,7 @@ GWARF_result read_statement(statement *the_statement, var_list *the_var, var_lis
             func_value.value.value.func_value = func_tmp;
             func_value.value.value.func_value = func_tmp;
 
 
             assigment_func(the_statement->code.def.name, func_value, login_var, 0);  // 注册函数到指定的位置
             assigment_func(the_statement->code.def.name, func_value, login_var, 0);  // 注册函数到指定的位置
+            // 无返回值
             break;
             break;
         }
         }
         case set_class:{
         case set_class:{
@@ -635,6 +675,7 @@ GWARF_result read_statement(statement *the_statement, var_list *the_var, var_lis
 
 
             assigment_func(the_statement->code.set_class.name, class_value, login_var, 0);  // 注册class 的 位置
             assigment_func(the_statement->code.set_class.name, class_value, login_var, 0);  // 注册class 的 位置
             puts("----stop set class----");
             puts("----stop set class----");
+            // 无返回值
             break;
             break;
         }
         }
         case break_cycle:
         case break_cycle:
@@ -645,13 +686,17 @@ GWARF_result read_statement(statement *the_statement, var_list *the_var, var_lis
             }
             }
             else{
             else{
                 int int_tmp;
                 int int_tmp;
-                GWARF_result tmp_result = traverse(the_statement->code.break_cycle.times, the_var, false);
+                GWARF_result tmp_result, tmp_object = traverse(the_statement->code.break_cycle.times, the_var, false);
+                tmp_result = get__value__(&(tmp_object.value), the_var);  // 从object中提取value
                 if(tmp_result.value.type == INT_value){
                 if(tmp_result.value.type == INT_value){
                     int_tmp = tmp_result.value.value.int_value;
                     int_tmp = tmp_result.value.value.int_value;
                 }
                 }
-                else{
+                else if(tmp_result.value.type == NUMBER_value){
                     int_tmp = (int)tmp_result.value.value.double_value;
                     int_tmp = (int)tmp_result.value.value.double_value;
                 }
                 }
+                else{
+                    int_tmp = 0;
+                }
                 return_value.value.value.int_value = int_tmp;
                 return_value.value.value.int_value = int_tmp;
             }
             }
             break;
             break;
@@ -662,14 +707,18 @@ GWARF_result read_statement(statement *the_statement, var_list *the_var, var_lis
                 return_value.value.value.int_value = 0;
                 return_value.value.value.int_value = 0;
             }
             }
             else{
             else{
-                GWARF_result tmp_result = traverse(the_statement->code.broken.times, the_var, false);
                 int int_tmp;
                 int int_tmp;
+                GWARF_result tmp_result, tmp_object = traverse(the_statement->code.broken.times, the_var, false);
+                tmp_result = get__value__(&(tmp_object.value), the_var);  // 从object中提取value
                 if(tmp_result.value.type == INT_value){
                 if(tmp_result.value.type == INT_value){
                     int_tmp = tmp_result.value.value.int_value;
                     int_tmp = tmp_result.value.value.int_value;
                 }
                 }
-                else{
+                else if(tmp_result.value.type == NUMBER_value){
                     int_tmp = (int)tmp_result.value.value.double_value;
                     int_tmp = (int)tmp_result.value.value.double_value;
                 }
                 }
+                else{
+                    int_tmp = 0;
+                }
                 return_value.value.value.int_value = int_tmp;
                 return_value.value.value.int_value = int_tmp;
             }
             }
             break;
             break;
@@ -680,14 +729,18 @@ GWARF_result read_statement(statement *the_statement, var_list *the_var, var_lis
                 return_value.value.value.int_value = 0;
                 return_value.value.value.int_value = 0;
             }
             }
             else{
             else{
-                GWARF_result tmp_result = traverse(the_statement->code.continue_cycle.times, the_var, false);
                 int int_tmp;
                 int int_tmp;
+                GWARF_result tmp_result, tmp_object = traverse(the_statement->code.continue_cycle.times, the_var, false);
+                tmp_result = get__value__(&(tmp_object.value), the_var);  // 从object中提取value
                 if(tmp_result.value.type == INT_value){
                 if(tmp_result.value.type == INT_value){
                     int_tmp = tmp_result.value.value.int_value;
                     int_tmp = tmp_result.value.value.int_value;
                 }
                 }
-                else{
+                else if(tmp_result.value.type == NUMBER_value){
                     int_tmp = (int)tmp_result.value.value.double_value;
                     int_tmp = (int)tmp_result.value.value.double_value;
                 }
                 }
+                else{
+                    int_tmp = 0;
+                }
                 return_value.value.value.int_value = int_tmp;
                 return_value.value.value.int_value = int_tmp;
             }
             }
             break;
             break;
@@ -698,14 +751,18 @@ GWARF_result read_statement(statement *the_statement, var_list *the_var, var_lis
                 return_value.value.value.int_value = 0;
                 return_value.value.value.int_value = 0;
             }
             }
             else{
             else{
-                GWARF_result tmp_result = traverse(the_statement->code.continued.times, the_var, false);
                 int int_tmp;
                 int int_tmp;
+                GWARF_result tmp_result, tmp_object = traverse(the_statement->code.continued.times, the_var, false);
+                tmp_result = get__value__(&(tmp_object.value), the_var);  // 从object中提取value
                 if(tmp_result.value.type == INT_value){
                 if(tmp_result.value.type == INT_value){
                     int_tmp = tmp_result.value.value.int_value;
                     int_tmp = tmp_result.value.value.int_value;
                 }
                 }
-                else{
+                else if(tmp_result.value.type == NUMBER_value){
                     int_tmp = (int)tmp_result.value.value.double_value;
                     int_tmp = (int)tmp_result.value.value.double_value;
                 }
                 }
+                else{
+                    int_tmp = 0;
+                }
                 return_value.value.value.int_value = int_tmp;
                 return_value.value.value.int_value = int_tmp;
             }
             }
             break;
             break;
@@ -716,14 +773,18 @@ GWARF_result read_statement(statement *the_statement, var_list *the_var, var_lis
                 return_value.value.value.int_value = 0;
                 return_value.value.value.int_value = 0;
             }
             }
             else{
             else{
-                GWARF_result tmp_result = traverse(the_statement->code.restart.times, the_var, false);
                 int int_tmp;
                 int int_tmp;
+                GWARF_result tmp_result, tmp_object = traverse(the_statement->code.restart.times, the_var, false);
+                tmp_result = get__value__(&(tmp_object.value), the_var);  // 从object中提取value
                 if(tmp_result.value.type == INT_value){
                 if(tmp_result.value.type == INT_value){
                     int_tmp = tmp_result.value.value.int_value;
                     int_tmp = tmp_result.value.value.int_value;
                 }
                 }
-                else{
+                else if(tmp_result.value.type == NUMBER_value){
                     int_tmp = (int)tmp_result.value.value.double_value;
                     int_tmp = (int)tmp_result.value.value.double_value;
                 }
                 }
+                else{
+                    int_tmp = 0;
+                }
                 return_value.value.value.int_value = int_tmp;
                 return_value.value.value.int_value = int_tmp;
             }
             }
             break;
             break;
@@ -734,14 +795,18 @@ GWARF_result read_statement(statement *the_statement, var_list *the_var, var_lis
                 return_value.value.value.int_value = 0;
                 return_value.value.value.int_value = 0;
             }
             }
             else{
             else{
-                GWARF_result tmp_result = traverse(the_statement->code.restarted.times, the_var, false);
                 int int_tmp;
                 int int_tmp;
+                GWARF_result tmp_result, tmp_object = traverse(the_statement->code.restarted.times, the_var, false);
+                tmp_result = get__value__(&(tmp_object.value), the_var);  // 从object中提取value
                 if(tmp_result.value.type == INT_value){
                 if(tmp_result.value.type == INT_value){
                     int_tmp = tmp_result.value.value.int_value;
                     int_tmp = tmp_result.value.value.int_value;
                 }
                 }
-                else{
+                else if(tmp_result.value.type == NUMBER_value){
                     int_tmp = (int)tmp_result.value.value.double_value;
                     int_tmp = (int)tmp_result.value.value.double_value;
                 }
                 }
+                else{
+                    int_tmp = 0;
+                }
                 return_value.value.value.int_value = int_tmp;
                 return_value.value.value.int_value = int_tmp;
             }
             }
             break;
             break;
@@ -751,14 +816,18 @@ GWARF_result read_statement(statement *the_statement, var_list *the_var, var_lis
                 return_value.return_times = 0;
                 return_value.return_times = 0;
             }
             }
             else{
             else{
-                GWARF_result tmp_result = traverse(the_statement->code.return_code.times, the_var, false);
                 int int_tmp;
                 int int_tmp;
+                GWARF_result tmp_result, tmp_object = traverse(the_statement->code.return_code.times, the_var, false);
+                tmp_result = get__value__(&(tmp_object.value), the_var);  // 从object中提取value
                 if(tmp_result.value.type == INT_value){
                 if(tmp_result.value.type == INT_value){
                     int_tmp = tmp_result.value.value.int_value;
                     int_tmp = tmp_result.value.value.int_value;
                 }
                 }
-                else{
+                else if(tmp_result.value.type == NUMBER_value){
                     int_tmp = (int)tmp_result.value.value.double_value;
                     int_tmp = (int)tmp_result.value.value.double_value;
                 }
                 }
+                else{
+                    int_tmp = 0;
+                }
                 return_value.return_times = int_tmp;
                 return_value.return_times = int_tmp;
             }
             }
             if(the_statement->code.return_code.value == NULL){  // return NULL
             if(the_statement->code.return_code.value == NULL){  // return NULL
@@ -766,7 +835,7 @@ GWARF_result read_statement(statement *the_statement, var_list *the_var, var_lis
                 return_value.value.value.double_value = 0;
                 return_value.value.value.double_value = 0;
             }
             }
             else{
             else{
-                return_value.value = traverse(the_statement->code.return_code.value, the_var, false).value;
+                return_value.value = to_object(traverse(the_statement->code.return_code.value, the_var, false).value, the_var);
             }
             }
             break;
             break;
         case rewent:
         case rewent:
@@ -777,14 +846,19 @@ GWARF_result read_statement(statement *the_statement, var_list *the_var, var_lis
             break;
             break;
         case set_default:{
         case set_default:{
             char *name = the_statement->code.set_default.name;
             char *name = the_statement->code.set_default.name;
-            GWARF_result tmp_result = traverse(the_statement->code.set_default.times, the_var, false);
-            int base_from;
+            int base_from = 0;
+            GWARF_result tmp_result, tmp_object = traverse(the_statement->code.set_default.times, the_var, false);
+            tmp_result = get__value__(&(tmp_object.value), the_var);  // 从object中提取value
             if(tmp_result.value.type == INT_value){
             if(tmp_result.value.type == INT_value){
                 base_from = tmp_result.value.value.int_value;
                 base_from = tmp_result.value.value.int_value;
             }
             }
-            else{
+            else if(tmp_result.value.type == NUMBER_value){
                 base_from = (int)tmp_result.value.value.double_value;
                 base_from = (int)tmp_result.value.value.double_value;
             }
             }
+            else{
+                base_from = 0;
+            }
+
             append_default_var_base(name, base_from, the_var->default_list);
             append_default_var_base(name, base_from, the_var->default_list);
             printf("set_default for %s\n", name);
             printf("set_default for %s\n", name);
             break;
             break;
@@ -829,6 +903,7 @@ GWARF_result if_func(if_list *if_base, var_list *the_var){  // read the statemen
             puts("----stop else----");
             puts("----stop else----");
             
             
             // restarted操作
             // restarted操作
+            // TODO::可以检查值类型,如果不正确则是解释器错误
             if(value.u == code_restarted){
             if(value.u == code_restarted){
                 if(value.value.value.int_value <= 0){
                 if(value.value.value.int_value <= 0){
                     puts("----restarted real----");
                     puts("----restarted real----");
@@ -941,10 +1016,10 @@ GWARF_result if_func(if_list *if_base, var_list *the_var){  // read the statemen
 // -----------------for func
 // -----------------for func
 GWARF_result for_func(statement *the_statement, var_list *the_var){  // read the statement list with case to run by func
 GWARF_result for_func(statement *the_statement, var_list *the_var){  // read the statement list with case to run by func
     GWARF_result value;
     GWARF_result value;
-    printf("----address = %d----\n", the_var);
+    // printf("----address = %d----\n", the_var);
     var *tmp = make_var();  // base_var
     var *tmp = make_var();  // base_var
     the_var = append_var_list(tmp, the_var);
     the_var = append_var_list(tmp, the_var);
-    printf("----new address = %d----\n", the_var);
+    // printf("----new address = %d----\n", the_var);
     bool condition;
     bool condition;
     if(the_statement->code.for_cycle.first != NULL){
     if(the_statement->code.for_cycle.first != NULL){
         traverse(the_statement->code.for_cycle.first, the_var, false); // first to do
         traverse(the_statement->code.for_cycle.first, the_var, false); // first to do
@@ -964,10 +1039,12 @@ GWARF_result for_func(statement *the_statement, var_list *the_var){  // read the
         //break操作
         //break操作
         if((value.u == cycle_break) || (value.u == code_broken)){
         if((value.u == cycle_break) || (value.u == code_broken)){
             printf("cycle_break(broken) %f\n", value.value.value.int_value);
             printf("cycle_break(broken) %f\n", value.value.value.int_value);
-            value.value.value.int_value -= 1;
-            if(value.value.value.int_value < 0){
+            if(value.value.value.int_value <= 0){
                 value.u = statement_end;  // 正常设置[正常语句结束]
                 value.u = statement_end;  // 正常设置[正常语句结束]
             }
             }
+            else{
+                value.value.value.int_value -= 1;
+            }
             break;  // break don't need after do
             break;  // break don't need after do
         }
         }
         puts("----stop for----");
         puts("----stop for----");
@@ -1030,7 +1107,7 @@ GWARF_result block_func(statement *the_statement, var_list *the_var){  // read t
     // continued操作
     // continued操作
     if(value.u == code_continued){
     if(value.u == code_continued){
         if(value.value.value.int_value <= 0){
         if(value.value.value.int_value <= 0){
-            puts("----if continue real----");
+            puts("----block continue real----");
             value.u = statement_end;
             value.u = statement_end;
             goto again;
             goto again;
         }
         }
@@ -1041,10 +1118,12 @@ GWARF_result block_func(statement *the_statement, var_list *the_var){  // read t
 
 
     // broken操作
     // broken操作
     if(value.u == code_broken){
     if(value.u == code_broken){
-        value.value.value.int_value -= 1;
-        if(value.value.value.int_value < 0){
+        if(value.value.value.int_value <= 0){
             value.u = statement_end;  // 正常设置[正常语句结束]
             value.u = statement_end;  // 正常设置[正常语句结束]
         }
         }
+        else{
+            value.value.value.int_value -= 1;
+        }
     }
     }
     return value;
     return value;
 }
 }
@@ -1053,10 +1132,10 @@ GWARF_result block_func(statement *the_statement, var_list *the_var){  // read t
 
 
 GWARF_result while_func(statement *the_statement, var_list *the_var){  // read the statement list with case to run by func
 GWARF_result while_func(statement *the_statement, var_list *the_var){  // read the statement list with case to run by func
     GWARF_result value;
     GWARF_result value;
-    printf("----address = %d----\n", the_var);
+    // printf("----address = %d----\n", the_var);
     var *tmp = make_var();  // base_var
     var *tmp = make_var();  // base_var
     the_var = append_var_list(tmp, the_var);
     the_var = append_var_list(tmp, the_var);
-    printf("----new address = %d----\n", the_var);
+    // printf("----new address = %d----\n", the_var);
     bool condition;
     bool condition;
     while (1){
     while (1){
         condition = to_bool(traverse(the_statement->code.while_cycle.condition, the_var, false).value);
         condition = to_bool(traverse(the_statement->code.while_cycle.condition, the_var, false).value);
@@ -1072,10 +1151,13 @@ GWARF_result while_func(statement *the_statement, var_list *the_var){  // read t
         // break的操作
         // break的操作
         if((value.u == cycle_break) || (value.u == code_broken)){
         if((value.u == cycle_break) || (value.u == code_broken)){
             printf("cycle_break(broken) %f\n", value.value.value.int_value);
             printf("cycle_break(broken) %f\n", value.value.value.int_value);
-            value.value.value.int_value -= 1;
-            if(value.value.value.int_value < 0){
+            if(value.value.value.int_value <= 0){
                 value.u = statement_end;  // 正常设置[正常语句结束]
                 value.u = statement_end;  // 正常设置[正常语句结束]
             }
             }
+            else{
+                value.value.value.int_value -= 1;
+            }
+            break;
         }
         }
 
 
         // continue的操作
         // continue的操作
@@ -1121,6 +1203,7 @@ GWARF_result operation_func(statement *the_statement, var_list *the_var, var_lis
     {
     {
         case ADD_func:
         case ADD_func:
             value = add_func(left_result, right_result, the_var);
             value = add_func(left_result, right_result, the_var);
+            printf("value.value.type = %d\n", value.value.type);
             break;
             break;
         case SUB_func:
         case SUB_func:
             value = sub_func(left_result, right_result, the_var);
             value = sub_func(left_result, right_result, the_var);
@@ -1142,19 +1225,24 @@ GWARF_result operation_func(statement *the_statement, var_list *the_var, var_lis
                     from = 0;
                     from = 0;
                 }
                 }
                 else{
                 else{
-                    GWARF_result tmp_result = traverse((the_statement->code.operation.left_exp)->code.base_var.from, the_var, false);
-                    if(tmp_result.value.type = INT_value){
+                    GWARF_result tmp_result, tmp_object = traverse((the_statement->code.operation.left_exp)->code.base_var.from, the_var, false);
+                    tmp_result = get__value__(&(tmp_object.value), the_var);  // 从object中提取value
+                    if(tmp_result.value.type == INT_value){
                         from = tmp_result.value.value.int_value;
                         from = tmp_result.value.value.int_value;
                     }
                     }
-                    else{
+                    else if(tmp_result.value.type == NUMBER_value){
                         from = (int)tmp_result.value.value.double_value;
                         from = (int)tmp_result.value.value.double_value;
                     }
                     }
+                    else{
+                        from = 0;
+                    }
                 }
                 }
+
                 value = assigment_func(left, right_result, login_var, from);
                 value = assigment_func(left, right_result, login_var, from);
             }
             }
             else if((the_statement->code.operation.left_exp)->type == point){  // 通过point赋值
             else if((the_statement->code.operation.left_exp)->type == point){  // 通过point赋值
                 printf("(the_statement->code).point.base_var = %u\n", (the_statement->code.operation.left_exp)->code.point.base_var);
                 printf("(the_statement->code).point.base_var = %u\n", (the_statement->code.operation.left_exp)->code.point.base_var);
-                GWARF_value base_the_var = traverse((the_statement->code.operation.left_exp)->code.point.base_var, the_var, false).value;
+                GWARF_value base_the_var = traverse((the_statement->code.operation.left_exp)->code.point.base_var, the_var, false).value;  // 不用取value
                 if(((the_statement->code.operation.left_exp)->code.point.child_var)->type == base_var){
                 if(((the_statement->code.operation.left_exp)->code.point.child_var)->type == base_var){
                     char *left = ((the_statement->code.operation.left_exp)->code.point.child_var)->code.base_var.var_name;
                     char *left = ((the_statement->code.operation.left_exp)->code.point.child_var)->code.base_var.var_name;
                     int from = 0;
                     int from = 0;
@@ -1162,25 +1250,26 @@ GWARF_result operation_func(statement *the_statement, var_list *the_var, var_lis
                         from = 0;
                         from = 0;
                     }
                     }
                     else{
                     else{
-                        GWARF_result tmp_result = traverse(((the_statement->code.operation.left_exp)->code.point.child_var)->code.base_var.from, the_var, false);
-                        if(tmp_result.value.type = INT_value){
+                        GWARF_result tmp_result, tmp_object = traverse(((the_statement->code.operation.left_exp)->code.point.child_var)->code.base_var.from, the_var, false);
+                        tmp_result = get__value__(&(tmp_object.value), the_var);  // 从object中提取value
+                        if(tmp_result.value.type == INT_value){
                             from = tmp_result.value.value.int_value;
                             from = tmp_result.value.value.int_value;
                         }
                         }
-                        else{
+                        else if(tmp_result.value.type == NUMBER_value){
                             from = (int)tmp_result.value.value.double_value;
                             from = (int)tmp_result.value.value.double_value;
                         }
                         }
+                        else{
+                            from = 0;
+                        }
                     }
                     }
                     value = assigment_func(left, right_result, base_the_var.value.object_value->the_var, from);
                     value = assigment_func(left, right_result, base_the_var.value.object_value->the_var, from);
                 }
                 }
                 else{
                 else{
-                    puts("Bad assigment");
                     goto the_else;
                     goto the_else;
                 }
                 }
             }
             }
-            else{  // 若不是变量[或者切片、成员访问]则当作==处理 ...... 这种处理不是期望的
-                the_else: 
-                left_result = traverse((*the_statement).code.operation.left_exp, the_var, false);
-                value = equal_func(left_result, right_result, the_var, 0);
+            else{ 
+                the_else: puts("Bad Assigment");
             }
             }
             break;
             break;
         }
         }
@@ -1215,12 +1304,15 @@ GWARF_result operation_func(statement *the_statement, var_list *the_var, var_lis
             break;
             break;
     }
     }
     value.u = statement_end;  // 正常设置[正常语句结束]
     value.u = statement_end;  // 正常设置[正常语句结束]
+    value.value = to_object(value.value, the_var);  // 返回类型是object[不下放到add func等]
     return value;
     return value;
 }
 }
 
 
 GWARF_result call_back(statement *the_statement, var_list *the_var){  // the func for add and call from read_statement_list
 GWARF_result call_back(statement *the_statement, var_list *the_var){  // the func for add and call from read_statement_list
-    GWARF_result get = traverse(the_statement->code.call.func, the_var, false);
-    return call_back_core(get, the_var, the_statement->code.call.parameter_list);
+    GWARF_result get = traverse(the_statement->code.call.func, the_var, false), tmp_x, result;
+    tmp_x = call_back_core(get, the_var, the_statement->code.call.parameter_list);
+    result.value = to_object(tmp_x.value, the_var);  // 返回类型是object
+    return result;
 }
 }
 
 
 GWARF_result call_back_core(GWARF_result get, var_list *the_var, parameter *tmp_s){  // the func for add and call from read_statement_list
 GWARF_result call_back_core(GWARF_result get, var_list *the_var, parameter *tmp_s){  // the func for add and call from read_statement_list
@@ -1232,10 +1324,10 @@ GWARF_result call_back_core(GWARF_result get, var_list *the_var, parameter *tmp_
         the_var = func_->the_var;
         the_var = func_->the_var;
         // tmp_x:形参,tmp_s:实参
         // tmp_x:形参,tmp_s:实参
 
 
-        printf("----address = %d----\n", the_var);
+        // printf("----address = %d----\n", the_var);
         var *tmp = make_var();  // base_var
         var *tmp = make_var();  // base_var
         the_var = append_var_list(tmp, the_var);
         the_var = append_var_list(tmp, the_var);
-        printf("----new address = %d----\n", the_var);
+        // printf("----new address = %d----\n", the_var);
 
 
         if(func_->type == customize){  // 用户定义的方法
         if(func_->type == customize){  // 用户定义的方法
             if(tmp_x == NULL){
             if(tmp_x == NULL){
@@ -1294,10 +1386,10 @@ GWARF_result call_back_core(GWARF_result get, var_list *the_var, parameter *tmp_
             the_var = func_->the_var;
             the_var = func_->the_var;
             // tmp_x:形参,tmp_s:实参
             // tmp_x:形参,tmp_s:实参
 
 
-            printf("----address = %d----\n", the_var);
+            // // printf("----address = %d----\n", the_var);
             var *tmp = make_var();  // base_var
             var *tmp = make_var();  // base_var
             the_var = append_var_list(tmp, the_var);
             the_var = append_var_list(tmp, the_var);
-            printf("----new address = %d----\n", the_var);
+            // // printf("----new address = %d----\n", the_var);
 
 
             if(func_->type == customize){  // 用户定义的方法
             if(func_->type == customize){  // 用户定义的方法
                 if(tmp_x == NULL){
                 if(tmp_x == NULL){
@@ -1349,15 +1441,23 @@ GWARF_result call_back_core(GWARF_result get, var_list *the_var, parameter *tmp_
 // ---------  ADD
 // ---------  ADD
 GWARF_result add_func(GWARF_result left_result, GWARF_result right_result, var_list *the_var){  // the func for add and call from read_statement_list
 GWARF_result add_func(GWARF_result left_result, GWARF_result right_result, var_list *the_var){  // the func for add and call from read_statement_list
     GWARF_result return_value;  // the result by call read_statement_list with left and right; value is the result for add
     GWARF_result return_value;  // the result by call read_statement_list with left and right; value is the result for add
-    if((left_result.value.type == OBJECT_value) && (right_result.value.type == OBJECT_value)){  // 调用add方法
+    if(left_result.value.type == OBJECT_value){  // 调用add方法
         GWARF_result get;
         GWARF_result get;
         GWARF_value base_the_var = left_result.value;  // 只有一个参数
         GWARF_value base_the_var = left_result.value;  // 只有一个参数
         var_list *call_var = base_the_var.value.object_value->the_var;
         var_list *call_var = base_the_var.value.object_value->the_var;
-
         get.value = find_var(call_var, 0, "__add__")->value;
         get.value = find_var(call_var, 0, "__add__")->value;
         get.father = &base_the_var;  // 设置father
         get.father = &base_the_var;  // 设置father
         return_value = call_back_core(get, the_var, pack_value_parameter(right_result.value));
         return_value = call_back_core(get, the_var, pack_value_parameter(right_result.value));
     }
     }
+    else if(right_result.value.type == OBJECT_value){  // 调用右add方法
+        GWARF_result get;
+        GWARF_value base_the_var = right_result.value;  // 只有一个参数
+        var_list *call_var = base_the_var.value.object_value->the_var;
+
+        get.value = find_var(call_var, 0, "__add__")->value;
+        get.father = &base_the_var;  // 设置father
+        return_value = call_back_core(get, the_var, pack_value_parameter(left_result.value));
+    }
     else{
     else{
         // 理论上用户是不可以直接调用下面的基类的,计算过程中万物皆类
         // 理论上用户是不可以直接调用下面的基类的,计算过程中万物皆类
         if(left_result.value.type == NULL_value){
         if(left_result.value.type == NULL_value){
@@ -1395,6 +1495,7 @@ GWARF_result add_func(GWARF_result left_result, GWARF_result right_result, var_l
             strcpy(return_value.value.value.string, l);  // 复制字符串
             strcpy(return_value.value.value.string, l);  // 复制字符串
             strcat(return_value.value.value.string, r);  // 追加字符串
             strcat(return_value.value.value.string, r);  // 追加字符串
         }
         }
+        
     }
     }
     return return_value;
     return return_value;
 }
 }
@@ -1402,7 +1503,7 @@ GWARF_result add_func(GWARF_result left_result, GWARF_result right_result, var_l
 // ---------  SUB
 // ---------  SUB
 GWARF_result sub_func(GWARF_result left_result, GWARF_result right_result, var_list *the_var){  // the func for sub and call from read_statement_list
 GWARF_result sub_func(GWARF_result left_result, GWARF_result right_result, var_list *the_var){  // the func for sub and call from read_statement_list
     GWARF_result return_value;  // the result by call read_statement_list with left and right; value is the result for sub
     GWARF_result return_value;  // the result by call read_statement_list with left and right; value is the result for sub
-    if((left_result.value.type == OBJECT_value) && (right_result.value.type == OBJECT_value)){  // 调用sub方法
+    if(left_result.value.type == OBJECT_value){  // 调用sub方法
         GWARF_result get;
         GWARF_result get;
         GWARF_value base_the_var = left_result.value;  // 只有一个参数
         GWARF_value base_the_var = left_result.value;  // 只有一个参数
         var_list *call_var = base_the_var.value.object_value->the_var;
         var_list *call_var = base_the_var.value.object_value->the_var;
@@ -1411,6 +1512,15 @@ GWARF_result sub_func(GWARF_result left_result, GWARF_result right_result, var_l
         get.father = &base_the_var;  // 设置father
         get.father = &base_the_var;  // 设置father
         return_value = call_back_core(get, the_var, pack_value_parameter(right_result.value));
         return_value = call_back_core(get, the_var, pack_value_parameter(right_result.value));
     }
     }
+    else if(right_result.value.type == OBJECT_value){  // 调用右sub方法
+        GWARF_result get;
+        GWARF_value base_the_var = right_result.value;  // 只有一个参数
+        var_list *call_var = base_the_var.value.object_value->the_var;
+
+        get.value = find_var(call_var, 0, "__sub__")->value;
+        get.father = &base_the_var;  // 设置father
+        return_value = call_back_core(get, the_var, pack_value_parameter(left_result.value));
+    }
     else{
     else{
         if(left_result.value.type == NULL_value){
         if(left_result.value.type == NULL_value){
             return negative_func(right_result, the_var);  // NULL减法相当于0
             return negative_func(right_result, the_var);  // NULL减法相当于0
@@ -1488,7 +1598,7 @@ GWARF_result negative_func(GWARF_result right_result, var_list *the_var){  // th
 // ---------  MUL
 // ---------  MUL
 GWARF_result mul_func(GWARF_result left_result, GWARF_result right_result, var_list *the_var){  // the func for mul and call from read_statement_list
 GWARF_result mul_func(GWARF_result left_result, GWARF_result right_result, var_list *the_var){  // the func for mul and call from read_statement_list
     GWARF_result return_value;  // the result by call read_statement_list with left and right; value is the result for mul
     GWARF_result return_value;  // the result by call read_statement_list with left and right; value is the result for mul
-    if((left_result.value.type == OBJECT_value) && (right_result.value.type == OBJECT_value)){  // 调用add方法
+    if(left_result.value.type == OBJECT_value){  // 调用左mul方法
         GWARF_result get;
         GWARF_result get;
         GWARF_value base_the_var = left_result.value;  // 只有一个参数
         GWARF_value base_the_var = left_result.value;  // 只有一个参数
         var_list *call_var = base_the_var.value.object_value->the_var;
         var_list *call_var = base_the_var.value.object_value->the_var;
@@ -1497,6 +1607,15 @@ GWARF_result mul_func(GWARF_result left_result, GWARF_result right_result, var_l
         get.father = &base_the_var;  // 设置father
         get.father = &base_the_var;  // 设置father
         return_value = call_back_core(get, the_var, pack_value_parameter(right_result.value));
         return_value = call_back_core(get, the_var, pack_value_parameter(right_result.value));
     }
     }
+    else if(right_result.value.type == OBJECT_value){  // 调用右mul方法
+        GWARF_result get;
+        GWARF_value base_the_var = right_result.value;  // 只有一个参数
+        var_list *call_var = base_the_var.value.object_value->the_var;
+
+        get.value = find_var(call_var, 0, "__mul__")->value;
+        get.father = &base_the_var;  // 设置father
+        return_value = call_back_core(get, the_var, pack_value_parameter(left_result.value));
+    }
     else{
     else{
         if(left_result.value.type == NULL_value){
         if(left_result.value.type == NULL_value){
             return_value.value = right_result.value;  // NULL乘法相当于1
             return_value.value = right_result.value;  // NULL乘法相当于1
@@ -1590,7 +1709,7 @@ GWARF_result mul_func(GWARF_result left_result, GWARF_result right_result, var_l
 // ---------  DIV
 // ---------  DIV
 GWARF_result div_func(GWARF_result left_result, GWARF_result right_result, var_list *the_var){  // the func for div and call from read_statement_list
 GWARF_result div_func(GWARF_result left_result, GWARF_result right_result, var_list *the_var){  // the func for div and call from read_statement_list
     GWARF_result return_value;  // the result by call read_statement_list with left and right; value is the result for div
     GWARF_result return_value;  // the result by call read_statement_list with left and right; value is the result for div
-    if((left_result.value.type == OBJECT_value) && (right_result.value.type == OBJECT_value)){  // 调用add方法
+    if(left_result.value.type == OBJECT_value){  // 调用左div方法
         GWARF_result get;
         GWARF_result get;
         GWARF_value base_the_var = left_result.value;  // 只有一个参数
         GWARF_value base_the_var = left_result.value;  // 只有一个参数
         var_list *call_var = base_the_var.value.object_value->the_var;
         var_list *call_var = base_the_var.value.object_value->the_var;
@@ -1599,6 +1718,15 @@ GWARF_result div_func(GWARF_result left_result, GWARF_result right_result, var_l
         get.father = &base_the_var;  // 设置father
         get.father = &base_the_var;  // 设置father
         return_value = call_back_core(get, the_var, pack_value_parameter(right_result.value));
         return_value = call_back_core(get, the_var, pack_value_parameter(right_result.value));
     }
     }
+    else if(right_result.value.type == OBJECT_value){  // 调用右div方法
+        GWARF_result get;
+        GWARF_value base_the_var = right_result.value;  // 只有一个参数
+        var_list *call_var = base_the_var.value.object_value->the_var;
+
+        get.value = find_var(call_var, 0, "__div__")->value;
+        get.father = &base_the_var;  // 设置father
+        return_value = call_back_core(get, the_var, pack_value_parameter(left_result.value));
+    }
     else{
     else{
         if(left_result.value.type == NULL_value){
         if(left_result.value.type == NULL_value){
             left_result.value.type = INT_value;
             left_result.value.type = INT_value;
@@ -1850,10 +1978,10 @@ GWARF_result traverse(statement *the_statement, var_list *the_var, bool new){  /
     }
     }
     bool lock = false;
     bool lock = false;
     if(new){  // need to make new var
     if(new){  // need to make new var
-        printf("----address = %d----\n", the_var);
+        // printf("----address = %d----\n", the_var);
         var *tmp = make_var();  // base_var
         var *tmp = make_var();  // base_var
         the_var = append_var_list(tmp, the_var);
         the_var = append_var_list(tmp, the_var);
-        printf("----new address = %d----\n", the_var);
+        // printf("----new address = %d----\n", the_var);
     }
     }
     while(1){
     while(1){
         if(tmp == NULL){
         if(tmp == NULL){
@@ -1861,6 +1989,12 @@ GWARF_result traverse(statement *the_statement, var_list *the_var, bool new){  /
         }
         }
         result2 = read_statement_list(tmp, the_var);
         result2 = read_statement_list(tmp, the_var);
 
 
+        // 错误停止
+        if(result2.u == name_no_found){
+            puts("STOP:: Name No Found!");
+            exit(1);  // 停止运行
+        }
+
         if((result2.u == cycle_break) || (result2.u == code_broken)){  // don't next the statement and return the result [the while_func[or for func] will get the result and stop cycle]
         if((result2.u == cycle_break) || (result2.u == code_broken)){  // don't next the statement and return the result [the while_func[or for func] will get the result and stop cycle]
             puts("----break or broken----");
             puts("----break or broken----");
             result = result2;
             result = result2;
@@ -2010,6 +2144,7 @@ GWARF_result official_func(func *the_func, parameter *tmp_s, var_list *the_var,
     return_result: return return_value;
     return_result: return return_value;
 }
 }
 
 
+// TODO:: __add__等方法对于输入参数需要辨别是否为NUMBER_value而非CLASS_value[更佳的做法是调用__add__时使用to_object]
 void int_login_official(var_list *the_var, GWARF_result (*paser)(func *, parameter *, var_list *, GWARF_result, var_list *)){
 void int_login_official(var_list *the_var, GWARF_result (*paser)(func *, parameter *, var_list *, GWARF_result, var_list *)){
     // 创建对象[空对象]
     // 创建对象[空对象]
     puts("----set class----");
     puts("----set class----");
@@ -2065,7 +2200,7 @@ GWARF_result int_official_func(func *the_func, parameter *tmp_s, var_list *the_v
             GWARF_value base_the_var = traverse(tmp_s->u.value, out_var, false).value;  // 只有一个参数
             GWARF_value base_the_var = traverse(tmp_s->u.value, out_var, false).value;  // 只有一个参数
             reight_tmp = get__value__(&base_the_var, the_var);
             reight_tmp = get__value__(&base_the_var, the_var);
             left_tmp.value = find_var(login_var, 0, "value")->value;
             left_tmp.value = find_var(login_var, 0, "value")->value;
-            return_value = add_func(left_tmp, reight_tmp, the_var);
+            return_value = add_func(left_tmp, reight_tmp, out_var);
             break;
             break;
         }
         }
         case __sub__func:{
         case __sub__func:{
@@ -2073,7 +2208,7 @@ GWARF_result int_official_func(func *the_func, parameter *tmp_s, var_list *the_v
             GWARF_value base_the_var = traverse(tmp_s->u.value, out_var, false).value;  // 只有一个参数
             GWARF_value base_the_var = traverse(tmp_s->u.value, out_var, false).value;  // 只有一个参数
             reight_tmp = get__value__(&base_the_var, the_var);
             reight_tmp = get__value__(&base_the_var, the_var);
             left_tmp.value = find_var(login_var, 0, "value")->value;
             left_tmp.value = find_var(login_var, 0, "value")->value;
-            return_value = sub_func(left_tmp, reight_tmp, the_var);
+            return_value = sub_func(left_tmp, reight_tmp, out_var);
             break;
             break;
         }
         }
         case __mul__func:{
         case __mul__func:{
@@ -2081,7 +2216,7 @@ GWARF_result int_official_func(func *the_func, parameter *tmp_s, var_list *the_v
             GWARF_value base_the_var = traverse(tmp_s->u.value, out_var, false).value;  // 只有一个参数
             GWARF_value base_the_var = traverse(tmp_s->u.value, out_var, false).value;  // 只有一个参数
             reight_tmp = get__value__(&base_the_var, the_var);
             reight_tmp = get__value__(&base_the_var, the_var);
             left_tmp.value = find_var(login_var, 0, "value")->value;
             left_tmp.value = find_var(login_var, 0, "value")->value;
-            return_value = mul_func(left_tmp, reight_tmp, the_var);
+            return_value = mul_func(left_tmp, reight_tmp, out_var);
             break;
             break;
         }
         }
         case __div__func:{
         case __div__func:{
@@ -2089,7 +2224,7 @@ GWARF_result int_official_func(func *the_func, parameter *tmp_s, var_list *the_v
             GWARF_value base_the_var = traverse(tmp_s->u.value, out_var, false).value;  // 只有一个参数
             GWARF_value base_the_var = traverse(tmp_s->u.value, out_var, false).value;  // 只有一个参数
             reight_tmp = get__value__(&base_the_var, the_var);
             reight_tmp = get__value__(&base_the_var, the_var);
             left_tmp.value = find_var(login_var, 0, "value")->value;
             left_tmp.value = find_var(login_var, 0, "value")->value;
-            return_value = div_func(left_tmp, reight_tmp, the_var);
+            return_value = div_func(left_tmp, reight_tmp, out_var);
             break;
             break;
         }
         }
         default:
         default:
@@ -2183,7 +2318,8 @@ GWARF_result double_official_func(func *the_func, parameter *tmp_s, var_list *th
             GWARF_value base_the_var = traverse(tmp_s->u.value, out_var, false).value;  // 只有一个参数
             GWARF_value base_the_var = traverse(tmp_s->u.value, out_var, false).value;  // 只有一个参数
             reight_tmp = get__value__(&base_the_var, the_var);
             reight_tmp = get__value__(&base_the_var, the_var);
             left_tmp.value = find_var(login_var, 0, "value")->value;
             left_tmp.value = find_var(login_var, 0, "value")->value;
-            return_value = add_func(left_tmp, reight_tmp, the_var);
+            // printf("add_func:: out_var = %x\n", out_var);
+            return_value = add_func(left_tmp, reight_tmp, out_var);
             break;
             break;
         }
         }
         case __sub__func:{
         case __sub__func:{
@@ -2191,7 +2327,7 @@ GWARF_result double_official_func(func *the_func, parameter *tmp_s, var_list *th
             GWARF_value base_the_var = traverse(tmp_s->u.value, out_var, false).value;  // 只有一个参数
             GWARF_value base_the_var = traverse(tmp_s->u.value, out_var, false).value;  // 只有一个参数
             reight_tmp = get__value__(&base_the_var, the_var);
             reight_tmp = get__value__(&base_the_var, the_var);
             left_tmp.value = find_var(login_var, 0, "value")->value;
             left_tmp.value = find_var(login_var, 0, "value")->value;
-            return_value = sub_func(left_tmp, reight_tmp, the_var);
+            return_value = sub_func(left_tmp, reight_tmp, out_var);
             break;
             break;
         }
         }
         case __mul__func:{
         case __mul__func:{
@@ -2199,7 +2335,7 @@ GWARF_result double_official_func(func *the_func, parameter *tmp_s, var_list *th
             GWARF_value base_the_var = traverse(tmp_s->u.value, out_var, false).value;  // 只有一个参数
             GWARF_value base_the_var = traverse(tmp_s->u.value, out_var, false).value;  // 只有一个参数
             reight_tmp = get__value__(&base_the_var, the_var);
             reight_tmp = get__value__(&base_the_var, the_var);
             left_tmp.value = find_var(login_var, 0, "value")->value;
             left_tmp.value = find_var(login_var, 0, "value")->value;
-            return_value = mul_func(left_tmp, reight_tmp, the_var);
+            return_value = mul_func(left_tmp, reight_tmp, out_var);
             break;
             break;
         }
         }
         case __div__func:{
         case __div__func:{
@@ -2207,7 +2343,7 @@ GWARF_result double_official_func(func *the_func, parameter *tmp_s, var_list *th
             GWARF_value base_the_var = traverse(tmp_s->u.value, out_var, false).value;  // 只有一个参数
             GWARF_value base_the_var = traverse(tmp_s->u.value, out_var, false).value;  // 只有一个参数
             reight_tmp = get__value__(&base_the_var, the_var);
             reight_tmp = get__value__(&base_the_var, the_var);
             left_tmp.value = find_var(login_var, 0, "value")->value;
             left_tmp.value = find_var(login_var, 0, "value")->value;
-            return_value = div_func(left_tmp, reight_tmp, the_var);
+            return_value = div_func(left_tmp, reight_tmp, out_var);
             break;
             break;
         }
         }
         default:
         default:
@@ -2300,7 +2436,7 @@ GWARF_result str_official_func(func *the_func, parameter *tmp_s, var_list *the_v
             GWARF_value base_the_var = traverse(tmp_s->u.value, out_var, false).value;  // 只有一个参数
             GWARF_value base_the_var = traverse(tmp_s->u.value, out_var, false).value;  // 只有一个参数
             reight_tmp = get__value__(&base_the_var, the_var);
             reight_tmp = get__value__(&base_the_var, the_var);
             left_tmp.value = find_var(login_var, 0, "value")->value;
             left_tmp.value = find_var(login_var, 0, "value")->value;
-            return_value = add_func(left_tmp, reight_tmp, the_var);
+            return_value = add_func(left_tmp, reight_tmp, out_var);
             break;
             break;
         }
         }
         case __sub__func:{
         case __sub__func:{
@@ -2308,7 +2444,7 @@ GWARF_result str_official_func(func *the_func, parameter *tmp_s, var_list *the_v
             GWARF_value base_the_var = traverse(tmp_s->u.value, out_var, false).value;  // 只有一个参数
             GWARF_value base_the_var = traverse(tmp_s->u.value, out_var, false).value;  // 只有一个参数
             reight_tmp = get__value__(&base_the_var, the_var);
             reight_tmp = get__value__(&base_the_var, the_var);
             left_tmp.value = find_var(login_var, 0, "value")->value;
             left_tmp.value = find_var(login_var, 0, "value")->value;
-            return_value = sub_func(left_tmp, reight_tmp, the_var);
+            return_value = sub_func(left_tmp, reight_tmp, out_var);
             break;
             break;
         }
         }
         case __mul__func:{
         case __mul__func:{
@@ -2316,7 +2452,7 @@ GWARF_result str_official_func(func *the_func, parameter *tmp_s, var_list *the_v
             GWARF_value base_the_var = traverse(tmp_s->u.value, out_var, false).value;  // 只有一个参数
             GWARF_value base_the_var = traverse(tmp_s->u.value, out_var, false).value;  // 只有一个参数
             reight_tmp = get__value__(&base_the_var, the_var);
             reight_tmp = get__value__(&base_the_var, the_var);
             left_tmp.value = find_var(login_var, 0, "value")->value;
             left_tmp.value = find_var(login_var, 0, "value")->value;
-            return_value = mul_func(left_tmp, reight_tmp, the_var);
+            return_value = mul_func(left_tmp, reight_tmp, out_var);
             break;
             break;
         }
         }
         case __div__func:{
         case __div__func:{
@@ -2324,7 +2460,7 @@ GWARF_result str_official_func(func *the_func, parameter *tmp_s, var_list *the_v
             GWARF_value base_the_var = traverse(tmp_s->u.value, out_var, false).value;  // 只有一个参数
             GWARF_value base_the_var = traverse(tmp_s->u.value, out_var, false).value;  // 只有一个参数
             reight_tmp = get__value__(&base_the_var, the_var);
             reight_tmp = get__value__(&base_the_var, the_var);
             left_tmp.value = find_var(login_var, 0, "value")->value;
             left_tmp.value = find_var(login_var, 0, "value")->value;
-            return_value = div_func(left_tmp, reight_tmp, the_var);
+            return_value = div_func(left_tmp, reight_tmp, out_var);
             break;
             break;
         }
         }
         default:
         default:
@@ -2408,7 +2544,7 @@ void bool_login_official(var_list *the_var, GWARF_result (*paser)(func *, parame
     }
     }
 }
 }
 
 
-GWARF_result bool_official_func(func *the_func, parameter *tmp_s, var_list *the_var, GWARF_result father, var_list *out_var){  // out_var是外部环境
+GWARF_result bool_official_func(func *the_func, parameter *tmp_s, var_list *the_var, GWARF_result father, var_list *out_var){  // out_var是外部环境, the_var是self内部环境
     GWARF_result return_value;
     GWARF_result return_value;
     var_list *login_var;
     var_list *login_var;
     return_value.u = return_def;
     return_value.u = return_def;
@@ -2439,7 +2575,7 @@ GWARF_result bool_official_func(func *the_func, parameter *tmp_s, var_list *the_
             GWARF_value base_the_var = traverse(tmp_s->u.value, out_var, false).value;  // 只有一个参数
             GWARF_value base_the_var = traverse(tmp_s->u.value, out_var, false).value;  // 只有一个参数
             reight_tmp = get__value__(&base_the_var, the_var);
             reight_tmp = get__value__(&base_the_var, the_var);
             left_tmp.value = find_var(login_var, 0, "value")->value;
             left_tmp.value = find_var(login_var, 0, "value")->value;
-            return_value = add_func(left_tmp, reight_tmp, the_var);
+            return_value = add_func(left_tmp, reight_tmp, out_var);
             break;
             break;
         }
         }
         case __sub__func:{
         case __sub__func:{
@@ -2447,7 +2583,7 @@ GWARF_result bool_official_func(func *the_func, parameter *tmp_s, var_list *the_
             GWARF_value base_the_var = traverse(tmp_s->u.value, out_var, false).value;  // 只有一个参数
             GWARF_value base_the_var = traverse(tmp_s->u.value, out_var, false).value;  // 只有一个参数
             reight_tmp = get__value__(&base_the_var, the_var);
             reight_tmp = get__value__(&base_the_var, the_var);
             left_tmp.value = find_var(login_var, 0, "value")->value;
             left_tmp.value = find_var(login_var, 0, "value")->value;
-            return_value = sub_func(left_tmp, reight_tmp, the_var);
+            return_value = sub_func(left_tmp, reight_tmp, out_var);
             break;
             break;
         }
         }
         case __mul__func:{
         case __mul__func:{
@@ -2455,7 +2591,7 @@ GWARF_result bool_official_func(func *the_func, parameter *tmp_s, var_list *the_
             GWARF_value base_the_var = traverse(tmp_s->u.value, out_var, false).value;  // 只有一个参数
             GWARF_value base_the_var = traverse(tmp_s->u.value, out_var, false).value;  // 只有一个参数
             reight_tmp = get__value__(&base_the_var, the_var);
             reight_tmp = get__value__(&base_the_var, the_var);
             left_tmp.value = find_var(login_var, 0, "value")->value;
             left_tmp.value = find_var(login_var, 0, "value")->value;
-            return_value = mul_func(left_tmp, reight_tmp, the_var);
+            return_value = mul_func(left_tmp, reight_tmp, out_var);
             break;
             break;
         }
         }
         case __div__func:{
         case __div__func:{
@@ -2463,7 +2599,7 @@ GWARF_result bool_official_func(func *the_func, parameter *tmp_s, var_list *the_
             GWARF_value base_the_var = traverse(tmp_s->u.value, out_var, false).value;  // 只有一个参数
             GWARF_value base_the_var = traverse(tmp_s->u.value, out_var, false).value;  // 只有一个参数
             reight_tmp = get__value__(&base_the_var, the_var);
             reight_tmp = get__value__(&base_the_var, the_var);
             left_tmp.value = find_var(login_var, 0, "value")->value;
             left_tmp.value = find_var(login_var, 0, "value")->value;
-            return_value = div_func(left_tmp, reight_tmp, the_var);
+            return_value = div_func(left_tmp, reight_tmp, out_var);
             break;
             break;
         }
         }
         default:
         default:
@@ -2493,18 +2629,52 @@ GWARF_value to_bool_(GWARF_value value, var_list *the_var){
 GWARF_result get__value__(GWARF_value *base_the_var, var_list *the_var){  // 用于计算的get__value__统一核心
 GWARF_result get__value__(GWARF_value *base_the_var, var_list *the_var){  // 用于计算的get__value__统一核心
     GWARF_result reight_tmp, get;
     GWARF_result reight_tmp, get;
     var_list *call_var;
     var_list *call_var;
-    if(base_the_var->type == CLASS_value){  // is class so that can use "."
-        call_var = base_the_var->value.class_value->the_var;
+    while(1){
+        if(base_the_var->type == CLASS_value){  // is class so that can use "."
+            call_var = base_the_var->value.class_value->the_var;
+        }
+        else if(base_the_var->type == OBJECT_value){
+            call_var = base_the_var->value.object_value->the_var;
+        }
+        else{
+            reight_tmp.u = return_def;
+            reight_tmp.value = *base_the_var;
+            goto return_result;  // 如果类型不是object或者class
+        }
+        get.value = find_var(call_var, 0, "__value__")->value;  // TODO:: 需要检查__value__是否存在
+        get.father = base_the_var;  // 设置father
+        reight_tmp = call_back_core(get, the_var, NULL);
+
+        base_the_var = &(reight_tmp.value);  // 重复获取__value__[直到类型不是object或class]
+    }
+    return_result: return reight_tmp;
+}
+
+GWARF_value to_object(GWARF_value value, var_list *the_var){  // 用于计算的get__value__统一核心
+    GWARF_result return_value;
+    if((value.type == CLASS_value) || (value.type == OBJECT_value) || (value.type == FUNC_value) || (value.type == NULL_value)){  // 可以直接返回
+        return value;
+    }
+    GWARF_result func_result;
+    if(value.type == NUMBER_value){
+        func_result.value = find_var(the_var, 0, "double")->value;
+    }
+    else if(value.type == INT_value){
+        func_result.value = find_var(the_var, 0, "int")->value;
     }
     }
-    else if(base_the_var->type == OBJECT_value){
-        call_var = base_the_var->value.object_value->the_var;
+    else if(value.type == BOOL_value){
+        func_result.value = find_var(the_var, 0, "bool")->value;
     }
     }
-    get.value = find_var(call_var, 0, "__value__")->value;  // TODO:: 需要检查__value__是否存在
-    get.father = base_the_var;  // 设置father
-    reight_tmp = call_back_core(get, the_var, NULL);
-    return reight_tmp;
+    else if(value.type == STRING_value){
+        func_result.value = find_var(the_var, 0, "str")->value;
+    }
+    else{
+        return value;
+    }
+    return call_back_core(func_result, the_var, pack_value_parameter(value)).value;
 }
 }
 
 
+
 int len_int(int num){
 int len_int(int num){
     int count = 1;  // 默认得有1位
     int count = 1;  // 默认得有1位
     while(1){
     while(1){
@@ -2546,4 +2716,6 @@ int len_intx(unsigned int num){  // 16进制
         count += 1;
         count += 1;
     }
     }
     return count;
     return count;
-}
+}
+
+// TODO::增加类型检查[break、broken],设置func和NULL均为object,设置object无__add___等方法时的操作

+ 39 - 16
paser/gwarf_yacc.y

@@ -332,46 +332,68 @@ element
 base_value
 base_value
     : NUMBER
     : NUMBER
     {
     {
+        // 调用double内置类的构造函数
+        GWARF_value tmp_value;
+        tmp_value.type = NUMBER_value;
+        tmp_value.value.double_value = (double)$1;
+
         statement *code_tmp =  make_statement();
         statement *code_tmp =  make_statement();
-        code_tmp->type = base_value;
-        code_tmp->code.base_value.value.type = NUMBER_value;
-        code_tmp->code.base_value.value.value.double_value = (double)$1;
+        code_tmp->type = call;
+        code_tmp->code.call.func = pack_call_name("double", NULL);
+        code_tmp->code.call.parameter_list = pack_value_parameter(tmp_value);
         $$ = code_tmp;
         $$ = code_tmp;
     }
     }
     | INT
     | INT
     {
     {
+        GWARF_value tmp_value;
+        tmp_value.type = INT_value;
+        tmp_value.value.int_value = (int)$1;
+
         statement *code_tmp =  make_statement();
         statement *code_tmp =  make_statement();
-        code_tmp->type = base_value;
-        code_tmp->code.base_value.value.type = INT_value;
-        code_tmp->code.base_value.value.value.int_value = (int)$1;
+        code_tmp->type = call;
+        code_tmp->code.call.func = pack_call_name("int", NULL);
+        code_tmp->code.call.parameter_list = pack_value_parameter(tmp_value);
         $$ = code_tmp;
         $$ = code_tmp;
     }
     }
     | base_string
     | base_string
     {
     {
+        GWARF_value tmp_value;
+        tmp_value.type = STRING_value;
+        tmp_value.value.string = $1;  // base_string已经动态生成内存了
+
         statement *code_tmp =  make_statement();
         statement *code_tmp =  make_statement();
-        code_tmp->type = base_value;
-        code_tmp->code.base_value.value.type = STRING_value;
-        code_tmp->code.base_value.value.value.string = $1;
+        code_tmp->type = call;
+        code_tmp->code.call.func = pack_call_name("str", NULL);
+        code_tmp->code.call.parameter_list = pack_value_parameter(tmp_value);
         $$ = code_tmp;
         $$ = code_tmp;
     }
     }
     | TRUE
     | TRUE
     {
     {
+        GWARF_value tmp_value;
+        tmp_value.type = BOOL_value;
+        tmp_value.value.bool_value = true;
+
         statement *code_tmp =  make_statement();
         statement *code_tmp =  make_statement();
-        code_tmp->type = base_value;
-        code_tmp->code.base_value.value.type = BOOL_value;
-        code_tmp->code.base_value.value.value.bool_value = true;
+        code_tmp->type = call;
+        code_tmp->code.call.func = pack_call_name("bool", NULL);
+        code_tmp->code.call.parameter_list = pack_value_parameter(tmp_value);
         $$ = code_tmp;
         $$ = code_tmp;
     }
     }
     | FALSE
     | FALSE
     {
     {
+        GWARF_value tmp_value;
+        tmp_value.type = BOOL_value;
+        tmp_value.value.bool_value = false;
+
         statement *code_tmp =  make_statement();
         statement *code_tmp =  make_statement();
-        code_tmp->type = base_value;
-        code_tmp->code.base_value.value.type = BOOL_value;
-        code_tmp->code.base_value.value.value.bool_value = false;
+        code_tmp->type = call;
+        code_tmp->code.call.func = pack_call_name("bool", NULL);
+        code_tmp->code.call.parameter_list = pack_value_parameter(tmp_value);
         $$ = code_tmp;
         $$ = code_tmp;
     }
     }
     | NULL_token
     | NULL_token
     {
     {
+        // NULL代表空值,是GWARF_value
         statement *code_tmp =  make_statement();
         statement *code_tmp =  make_statement();
         code_tmp->type = base_value;
         code_tmp->type = base_value;
         code_tmp->code.base_value.value.type = NULL_value;
         code_tmp->code.base_value.value.type = NULL_value;
@@ -382,8 +404,9 @@ base_value
 
 
 base_var_
 base_var_
     : base_var_token
     : base_var_token
-    | LI element RI base_var_token
+    | LI top_exp RI base_var_token
     {
     {
+        printf("$2 = %x\n", $2);
         $4->code.base_var.from = $2;
         $4->code.base_var.from = $2;
         $$ = $4;
         $$ = $4;
     }
     }

+ 209 - 186
paser/y.tab.c

@@ -629,13 +629,13 @@ static const yytype_int16 yyrline[] =
      115,   119,   123,   127,   134,   141,   142,   154,   155,   164,
      115,   119,   123,   127,   134,   141,   142,   154,   155,   164,
      173,   182,   191,   200,   212,   213,   222,   234,   235,   244,
      173,   182,   191,   200,   212,   213,   222,   234,   235,   244,
      256,   257,   266,   275,   287,   288,   296,   307,   308,   309,
      256,   257,   266,   275,   287,   288,   296,   307,   308,   309,
-     318,   326,   333,   341,   349,   357,   365,   373,   384,   385,
-     393,   406,   413,   422,   436,   450,   465,   470,   479,   485,
-     494,   505,   512,   523,   530,   541,   552,   563,   574,   585,
-     596,   607,   621,   628,   640,   647,   667,   674,   692,   712,
-     718,   725,   729,   736,   740,   741,   746,   755,   766,   767,
-     775,   785,   786,   794,   804,   805,   813,   823,   824,   832,
-     842,   843,   851,   861,   862,   869,   879,   880,   881,   882
+     318,   326,   333,   346,   358,   370,   382,   394,   406,   407,
+     416,   429,   436,   445,   459,   473,   488,   493,   502,   508,
+     517,   528,   535,   546,   553,   564,   575,   586,   597,   608,
+     619,   630,   644,   651,   663,   670,   690,   697,   715,   735,
+     741,   748,   752,   759,   763,   764,   769,   778,   789,   790,
+     798,   808,   809,   817,   827,   828,   836,   846,   847,   855,
+     865,   866,   874,   884,   885,   892,   902,   903,   904,   905
 };
 };
 #endif
 #endif
 
 
@@ -679,7 +679,7 @@ static const yytype_int16 yytoknum[] =
 };
 };
 # endif
 # endif
 
 
-#define YYPACT_NINF (-43)
+#define YYPACT_NINF (-71)
 
 
 #define yypact_value_is_default(Yyn) \
 #define yypact_value_is_default(Yyn) \
   ((Yyn) == YYPACT_NINF)
   ((Yyn) == YYPACT_NINF)
@@ -693,27 +693,27 @@ static const yytype_int16 yytoknum[] =
      STATE-NUM.  */
      STATE-NUM.  */
 static const yytype_int16 yypact[] =
 static const yytype_int16 yypact[] =
 {
 {
-     223,   -43,   -43,   -43,   -43,   346,   346,    -4,   -43,    20,
-     -43,   -43,   -43,   -43,   -43,   -22,   -22,   346,    31,    36,
-      31,    31,   -43,   -43,   -43,   -43,    22,   -43,    22,    46,
-     223,   -43,   -22,    68,    83,    79,    80,    13,   -43,   -10,
-     -43,   -43,   -43,    70,   -22,   -22,   -22,     2,    71,   -22,
-      71,   -22,    71,   -22,    71,   -22,    71,   -22,    71,   -22,
-     346,   -22,   346,   -22,   346,   -22,   346,   -22,   346,   -22,
-     346,   -22,   346,    27,    86,   346,   346,   -43,   -43,    64,
-      64,   -12,   346,    14,   -43,   -43,    78,    89,   -43,   -43,
+     223,   -71,   -71,   -71,   -71,   346,   346,    27,   -71,    31,
+     -71,   -71,   -71,   -71,   -71,    20,    20,   346,    21,    36,
+      21,    21,   -71,   -71,   -71,   -71,    22,   -71,    22,    37,
+     223,   -71,    20,    24,    83,    79,    80,     4,   -71,   -10,
+     -71,   -71,   -71,    62,    20,    20,    20,     2,    58,    20,
+      58,    20,    58,    20,    58,    20,    58,    20,    58,    20,
+     346,    20,   346,    20,   346,    20,   346,    20,   346,    20,
+     346,    20,   346,    34,    65,   346,   346,   -71,   -71,    64,
+      64,    44,   346,    14,   -71,   -71,    78,    85,   -71,   -71,
       64,   346,   346,   346,   346,   346,   346,   346,   346,   346,
       64,   346,   346,   346,   346,   346,   346,   346,   346,   346,
-     346,   346,   346,   346,   346,    35,   346,   -43,    64,    64,
-      64,   -43,    98,    71,    64,   223,   -43,    64,   -43,    64,
-     -43,    64,   -43,    64,   -43,    64,   -43,    64,   346,    64,
-      27,    64,    27,    64,    27,    64,    27,    64,    27,    64,
-      27,   -43,   101,   109,   -43,   -43,    31,    27,    53,    93,
-       7,   110,    83,    79,    79,    79,    79,    79,    79,    80,
-      80,    13,    13,   -43,   -43,   -43,   -43,   -43,    -5,    27,
-     346,   -43,   172,    27,   -43,   -43,   -43,   229,    95,   277,
-     -43,   -43,    12,   -43,   -43,   346,   116,   -43,   -43,   126,
-     283,   296,   105,   -43,    22,   -43,   -43,   -43,   -43,   134,
-     -43,   136,   333,   -43,   -43,   -43,   -43,   138,   -43
+     346,   346,   346,   346,   346,    35,   346,   -71,    64,    64,
+      64,   -71,    89,    58,    64,   223,   -71,    64,   -71,    64,
+     -71,    64,   -71,    64,   -71,    64,   -71,    64,   346,    64,
+      34,    64,    34,    64,    34,    64,    34,    64,    34,    64,
+      34,   -71,    99,   101,   -71,   -71,    21,    34,    53,    56,
+       7,   116,    83,    79,    79,    79,    79,    79,    79,    80,
+      80,     4,     4,   -71,   -71,   -71,   -71,   -71,    -5,    34,
+     346,   -71,   172,    34,   -71,   -71,   -71,   229,    93,   277,
+     -71,   -71,    12,   -71,   -71,   346,   122,   -71,   -71,   126,
+     283,   296,   105,   -71,    22,   -71,   -71,   -71,   -71,   134,
+     -71,   136,   333,   -71,   -71,   -71,   -71,   138,   -71
 };
 };
 
 
   /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
   /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
@@ -747,11 +747,11 @@ static const yytype_int8 yydefact[] =
   /* YYPGOTO[NTERM-NUM].  */
   /* YYPGOTO[NTERM-NUM].  */
 static const yytype_int8 yypgoto[] =
 static const yytype_int8 yypgoto[] =
 {
 {
-     -43,   -43,   -18,   -28,    -6,   -43,    65,    25,    56,    11,
-     -37,    10,   -43,   -25,   -14,   -43,   -43,   -43,   -43,   -43,
-     -43,   -43,   -43,   -43,   -43,   -43,   -43,   -43,   -43,   -43,
-     -43,   -43,   -43,   -43,   -42,   -43,   -43,   -43,   -43,   -43,
-     -43,   -43,   -43,   -43,   -43,   -43,   -43,   -43,   -43,    82
+     -71,   -71,    39,   -28,    -6,   -71,    66,    25,    13,    23,
+     -70,    10,   -71,   -25,   -14,   -71,   -71,   -71,   -71,   -71,
+     -71,   -71,   -71,   -71,   -71,   -71,   -71,   -71,   -71,   -71,
+     -71,   -71,   -71,   -71,   -42,   -71,   -71,   -71,   -71,   -71,
+     -71,   -71,   -71,   -71,   -71,   -71,   -71,   -71,   -71,    82
 };
 };
 
 
   /* YYDEFGOTO[NTERM-NUM].  */
   /* YYDEFGOTO[NTERM-NUM].  */
@@ -770,21 +770,21 @@ static const yytype_int16 yydefgoto[] =
 static const yytype_uint8 yytable[] =
 static const yytype_uint8 yytable[] =
 {
 {
       74,    86,    89,    87,    82,   105,    84,    85,   118,   184,
       74,    86,    89,    87,    82,   105,    84,    85,   118,   184,
-     120,    75,   122,     4,   124,    73,   126,     1,     2,     3,
-       4,   180,     5,    77,    78,   146,   193,    81,     4,     6,
-     111,   112,   102,   103,   104,    76,   185,     4,     1,     2,
-       3,     4,   106,     5,   106,    17,    88,    77,    78,   166,
+     120,    81,   122,     4,   124,    73,   126,     1,     2,     3,
+       4,   180,     5,   102,   103,   104,   193,     4,     4,     6,
+     111,   112,   163,   164,   165,    91,   185,    88,     1,     2,
+       3,     4,    75,     5,   106,    17,    76,    77,    78,   166,
        6,    83,    17,   194,   128,   148,     1,     2,     3,     4,
        6,    83,    17,   194,   128,   148,     1,     2,     3,     4,
-      17,     5,    23,    24,    25,   163,   164,   165,     6,   142,
-     143,   171,   130,    17,   132,   107,   134,   149,   136,    91,
-     138,   106,   140,    23,    24,    25,    98,    99,   115,   100,
-     101,    17,   147,   150,   177,    92,    93,   172,    80,   167,
-     141,    23,    24,    25,   151,    94,    95,    96,    97,   144,
-     145,   161,   162,   170,    90,   174,   169,   153,   154,   155,
-     156,   157,   158,   175,   183,   181,   108,   109,   110,   114,
-     196,   117,   176,   119,   179,   121,   190,   123,   173,   125,
+      17,     5,    23,    24,    25,    77,    78,   107,     6,   142,
+     143,   171,   130,    17,   132,   115,   134,   149,   136,   141,
+     138,   146,   140,    23,    24,    25,    98,    99,   106,   100,
+     101,    17,   147,   150,   177,    92,    93,   179,    80,   167,
+     151,    23,    24,    25,   170,    94,    95,    96,    97,   144,
+     145,   159,   160,   174,    90,   175,   169,   153,   154,   155,
+     156,   157,   158,   161,   162,   181,   108,   109,   110,   114,
+     183,   117,   176,   119,   190,   121,   196,   123,   173,   125,
      197,   127,   178,   129,    89,   131,   202,   133,   204,   135,
      197,   127,   178,   129,    89,   131,   202,   133,   204,   135,
-     205,   137,   208,   139,   159,   160,   152,     0,     0,     0,
+     205,   137,   208,   139,   172,     0,     0,   152,     0,     0,
        0,     0,     0,     0,   186,     0,     0,     0,     0,   203,
        0,     0,     0,     0,   186,     0,     0,     0,     0,   203,
        0,   189,     0,   192,     0,     1,     2,     3,     4,   195,
        0,   189,     0,   192,     0,     1,     2,     3,     4,   195,
        5,     0,     0,     0,   199,   201,     0,     6,   187,     0,
        5,     0,     0,     0,   199,   201,     0,     6,   187,     0,
@@ -814,21 +814,21 @@ static const yytype_uint8 yytable[] =
 static const yytype_int16 yycheck[] =
 static const yytype_int16 yycheck[] =
 {
 {
        6,    26,    30,    28,    18,    15,    20,    21,    50,    14,
        6,    26,    30,    28,    18,    15,    20,    21,    50,    14,
-      52,    15,    54,     6,    56,     5,    58,     3,     4,     5,
-       6,    14,     8,    45,    46,    37,    14,    17,     6,    15,
-      28,    29,    19,    20,    21,    15,    41,     6,     3,     4,
-       5,     6,    54,     8,    54,    38,     0,    45,    46,    14,
+      52,    17,    54,     6,    56,     5,    58,     3,     4,     5,
+       6,    14,     8,    19,    20,    21,    14,     6,     6,    15,
+      28,    29,   102,   103,   104,    11,    41,     0,     3,     4,
+       5,     6,    15,     8,    54,    38,    15,    45,    46,    14,
       15,    15,    38,    41,    60,    41,     3,     4,     5,     6,
       15,    15,    38,    41,    60,    41,     3,     4,     5,     6,
-      38,     8,    48,    49,    50,   102,   103,   104,    15,    75,
-      76,   113,    62,    38,    64,     5,    66,    83,    68,    11,
-      70,    54,    72,    48,    49,    50,     7,     8,    17,     9,
-      10,    38,    82,    15,    41,    12,    13,   115,    16,   105,
-      14,    48,    49,    50,    15,    22,    23,    24,    25,    45,
-      46,   100,   101,    15,    32,    14,   106,    92,    93,    94,
-      95,    96,    97,    14,    14,   150,    44,    45,    46,    47,
-      14,    49,   146,    51,    41,    53,    41,    55,   128,    57,
+      38,     8,    48,    49,    50,    45,    46,     5,    15,    75,
+      76,   113,    62,    38,    64,    17,    66,    83,    68,    14,
+      70,    37,    72,    48,    49,    50,     7,     8,    54,     9,
+      10,    38,    82,    15,    41,    12,    13,    41,    16,   105,
+      15,    48,    49,    50,    15,    22,    23,    24,    25,    45,
+      46,    98,    99,    14,    32,    14,   106,    92,    93,    94,
+      95,    96,    97,   100,   101,   150,    44,    45,    46,    47,
+      14,    49,   146,    51,    41,    53,    14,    55,   128,    57,
       14,    59,   148,    61,   172,    63,    41,    65,    14,    67,
       14,    59,   148,    61,   172,    63,    41,    65,    14,    67,
-      14,    69,    14,    71,    98,    99,    91,    -1,    -1,    -1,
+      14,    69,    14,    71,   115,    -1,    -1,    91,    -1,    -1,
       -1,    -1,    -1,    -1,   170,    -1,    -1,    -1,    -1,   194,
       -1,    -1,    -1,    -1,   170,    -1,    -1,    -1,    -1,   194,
       -1,   177,    -1,   179,    -1,     3,     4,     5,     6,   185,
       -1,   177,    -1,   179,    -1,     3,     4,     5,     6,   185,
        8,    -1,    -1,    -1,   190,   191,    -1,    15,    16,    -1,
        8,    -1,    -1,    -1,   190,   191,    -1,    15,    16,    -1,
@@ -867,7 +867,7 @@ static const yytype_int8 yystos[] =
       78,    79,    80,    81,    82,    83,    84,    85,    86,    90,
       78,    79,    80,    81,    82,    83,    84,    85,    86,    90,
       91,    92,    93,    94,    95,    96,    97,    98,    99,   100,
       91,    92,    93,    94,    95,    96,    97,    98,    99,   100,
      101,   102,   103,    66,    59,    15,    15,    45,    46,   104,
      101,   102,   103,    66,    59,    15,    15,    45,    46,   104,
-     104,    66,    69,    15,    69,    69,    68,    68,     0,    58,
+     104,    59,    69,    15,    69,    69,    68,    68,     0,    58,
      104,    11,    12,    13,    22,    23,    24,    25,     7,     8,
      104,    11,    12,    13,    22,    23,    24,    25,     7,     8,
        9,    10,    19,    20,    21,    15,    54,     5,   104,   104,
        9,    10,    19,    20,    21,    15,    54,     5,   104,   104,
      104,    28,    29,    75,   104,    17,    89,   104,    89,   104,
      104,    28,    29,    75,   104,    17,    89,   104,    89,   104,
@@ -2036,86 +2036,109 @@ yyreduce:
   case 52:
   case 52:
 #line 334 "gwarf_yacc.y"
 #line 334 "gwarf_yacc.y"
     {
     {
+        // 调用double内置类的构造函数
+        GWARF_value tmp_value;
+        tmp_value.type = NUMBER_value;
+        tmp_value.value.double_value = (double)(yyvsp[0].double_value);
+
         statement *code_tmp =  make_statement();
         statement *code_tmp =  make_statement();
-        code_tmp->type = base_value;
-        code_tmp->code.base_value.value.type = NUMBER_value;
-        code_tmp->code.base_value.value.value.double_value = (double)(yyvsp[0].double_value);
+        code_tmp->type = call;
+        code_tmp->code.call.func = pack_call_name("double", NULL);
+        code_tmp->code.call.parameter_list = pack_value_parameter(tmp_value);
         (yyval.statement_value) = code_tmp;
         (yyval.statement_value) = code_tmp;
     }
     }
-#line 2046 "y.tab.c"
+#line 2051 "y.tab.c"
     break;
     break;
 
 
   case 53:
   case 53:
-#line 342 "gwarf_yacc.y"
+#line 347 "gwarf_yacc.y"
     {
     {
+        GWARF_value tmp_value;
+        tmp_value.type = INT_value;
+        tmp_value.value.int_value = (int)(yyvsp[0].double_value);
+
         statement *code_tmp =  make_statement();
         statement *code_tmp =  make_statement();
-        code_tmp->type = base_value;
-        code_tmp->code.base_value.value.type = INT_value;
-        code_tmp->code.base_value.value.value.int_value = (int)(yyvsp[0].double_value);
+        code_tmp->type = call;
+        code_tmp->code.call.func = pack_call_name("int", NULL);
+        code_tmp->code.call.parameter_list = pack_value_parameter(tmp_value);
         (yyval.statement_value) = code_tmp;
         (yyval.statement_value) = code_tmp;
     }
     }
-#line 2058 "y.tab.c"
+#line 2067 "y.tab.c"
     break;
     break;
 
 
   case 54:
   case 54:
-#line 350 "gwarf_yacc.y"
+#line 359 "gwarf_yacc.y"
     {
     {
+        GWARF_value tmp_value;
+        tmp_value.type = STRING_value;
+        tmp_value.value.string = (yyvsp[0].string_value);  // base_string已经动态生成内存了
+
         statement *code_tmp =  make_statement();
         statement *code_tmp =  make_statement();
-        code_tmp->type = base_value;
-        code_tmp->code.base_value.value.type = STRING_value;
-        code_tmp->code.base_value.value.value.string = (yyvsp[0].string_value);
+        code_tmp->type = call;
+        code_tmp->code.call.func = pack_call_name("str", NULL);
+        code_tmp->code.call.parameter_list = pack_value_parameter(tmp_value);
         (yyval.statement_value) = code_tmp;
         (yyval.statement_value) = code_tmp;
     }
     }
-#line 2070 "y.tab.c"
+#line 2083 "y.tab.c"
     break;
     break;
 
 
   case 55:
   case 55:
-#line 358 "gwarf_yacc.y"
+#line 371 "gwarf_yacc.y"
     {
     {
+        GWARF_value tmp_value;
+        tmp_value.type = BOOL_value;
+        tmp_value.value.bool_value = true;
+
         statement *code_tmp =  make_statement();
         statement *code_tmp =  make_statement();
-        code_tmp->type = base_value;
-        code_tmp->code.base_value.value.type = BOOL_value;
-        code_tmp->code.base_value.value.value.bool_value = true;
+        code_tmp->type = call;
+        code_tmp->code.call.func = pack_call_name("bool", NULL);
+        code_tmp->code.call.parameter_list = pack_value_parameter(tmp_value);
         (yyval.statement_value) = code_tmp;
         (yyval.statement_value) = code_tmp;
     }
     }
-#line 2082 "y.tab.c"
+#line 2099 "y.tab.c"
     break;
     break;
 
 
   case 56:
   case 56:
-#line 366 "gwarf_yacc.y"
+#line 383 "gwarf_yacc.y"
     {
     {
+        GWARF_value tmp_value;
+        tmp_value.type = BOOL_value;
+        tmp_value.value.bool_value = false;
+
         statement *code_tmp =  make_statement();
         statement *code_tmp =  make_statement();
-        code_tmp->type = base_value;
-        code_tmp->code.base_value.value.type = BOOL_value;
-        code_tmp->code.base_value.value.value.bool_value = false;
+        code_tmp->type = call;
+        code_tmp->code.call.func = pack_call_name("bool", NULL);
+        code_tmp->code.call.parameter_list = pack_value_parameter(tmp_value);
         (yyval.statement_value) = code_tmp;
         (yyval.statement_value) = code_tmp;
     }
     }
-#line 2094 "y.tab.c"
+#line 2115 "y.tab.c"
     break;
     break;
 
 
   case 57:
   case 57:
-#line 374 "gwarf_yacc.y"
+#line 395 "gwarf_yacc.y"
     {
     {
+        // NULL代表空值,是GWARF_value
         statement *code_tmp =  make_statement();
         statement *code_tmp =  make_statement();
         code_tmp->type = base_value;
         code_tmp->type = base_value;
         code_tmp->code.base_value.value.type = NULL_value;
         code_tmp->code.base_value.value.type = NULL_value;
         code_tmp->code.base_value.value.value.int_value = 0;
         code_tmp->code.base_value.value.value.int_value = 0;
         (yyval.statement_value) = code_tmp;
         (yyval.statement_value) = code_tmp;
     }
     }
-#line 2106 "y.tab.c"
+#line 2128 "y.tab.c"
     break;
     break;
 
 
   case 59:
   case 59:
-#line 386 "gwarf_yacc.y"
+#line 408 "gwarf_yacc.y"
     {
     {
+        printf("$2 = %x\n", (yyvsp[-2].statement_value));
         (yyvsp[0].statement_value)->code.base_var.from = (yyvsp[-2].statement_value);
         (yyvsp[0].statement_value)->code.base_var.from = (yyvsp[-2].statement_value);
         (yyval.statement_value) = (yyvsp[0].statement_value);
         (yyval.statement_value) = (yyvsp[0].statement_value);
     }
     }
-#line 2115 "y.tab.c"
+#line 2138 "y.tab.c"
     break;
     break;
 
 
   case 60:
   case 60:
-#line 394 "gwarf_yacc.y"
+#line 417 "gwarf_yacc.y"
     {
     {
         statement *code_tmp =  make_statement();
         statement *code_tmp =  make_statement();
         code_tmp->code.base_var.var_name = malloc(sizeof((yyvsp[0].string_value)));
         code_tmp->code.base_var.var_name = malloc(sizeof((yyvsp[0].string_value)));
@@ -2125,32 +2148,32 @@ yyreduce:
         strcpy(name_tmp, (yyvsp[0].string_value));
         strcpy(name_tmp, (yyvsp[0].string_value));
         (yyval.statement_value) = code_tmp;
         (yyval.statement_value) = code_tmp;
     }
     }
-#line 2129 "y.tab.c"
+#line 2152 "y.tab.c"
     break;
     break;
 
 
   case 61:
   case 61:
-#line 407 "gwarf_yacc.y"
+#line 430 "gwarf_yacc.y"
     {
     {
         // STRING is char * which the len is 1
         // STRING is char * which the len is 1
         char *tmp = malloc(sizeof((yyvsp[0].string_value)));
         char *tmp = malloc(sizeof((yyvsp[0].string_value)));
         strcpy(tmp, (yyvsp[0].string_value));
         strcpy(tmp, (yyvsp[0].string_value));
         (yyval.string_value) = tmp;
         (yyval.string_value) = tmp;
     }
     }
-#line 2140 "y.tab.c"
+#line 2163 "y.tab.c"
     break;
     break;
 
 
   case 62:
   case 62:
-#line 414 "gwarf_yacc.y"
+#line 437 "gwarf_yacc.y"
     {
     {
         char *tmp = realloc((yyvsp[-1].string_value), strlen((yyvsp[-1].string_value)) + strlen((yyvsp[0].string_value)));  // get address
         char *tmp = realloc((yyvsp[-1].string_value), strlen((yyvsp[-1].string_value)) + strlen((yyvsp[0].string_value)));  // get address
         strcat(tmp, (yyvsp[0].string_value));
         strcat(tmp, (yyvsp[0].string_value));
         (yyval.string_value) = tmp;
         (yyval.string_value) = tmp;
     }
     }
-#line 2150 "y.tab.c"
+#line 2173 "y.tab.c"
     break;
     break;
 
 
   case 63:
   case 63:
-#line 423 "gwarf_yacc.y"
+#line 446 "gwarf_yacc.y"
     {
     {
         statement *code_tmp =  make_statement();
         statement *code_tmp =  make_statement();
         code_tmp->type = set_nonlocal;
         code_tmp->type = set_nonlocal;
@@ -2161,11 +2184,11 @@ yyreduce:
         free((yyvsp[0].statement_value));
         free((yyvsp[0].statement_value));
         (yyval.statement_value) = code_tmp;
         (yyval.statement_value) = code_tmp;
     }
     }
-#line 2165 "y.tab.c"
+#line 2188 "y.tab.c"
     break;
     break;
 
 
   case 64:
   case 64:
-#line 437 "gwarf_yacc.y"
+#line 460 "gwarf_yacc.y"
     {
     {
         statement *code_tmp =  make_statement();
         statement *code_tmp =  make_statement();
         code_tmp->type = set_global;
         code_tmp->type = set_global;
@@ -2176,11 +2199,11 @@ yyreduce:
         free((yyvsp[0].statement_value));
         free((yyvsp[0].statement_value));
         (yyval.statement_value) = code_tmp;
         (yyval.statement_value) = code_tmp;
     }
     }
-#line 2180 "y.tab.c"
+#line 2203 "y.tab.c"
     break;
     break;
 
 
   case 65:
   case 65:
-#line 451 "gwarf_yacc.y"
+#line 474 "gwarf_yacc.y"
     {
     {
         statement *code_tmp =  make_statement();
         statement *code_tmp =  make_statement();
         code_tmp->type = set_default;
         code_tmp->type = set_default;
@@ -2192,50 +2215,50 @@ yyreduce:
         free((yyvsp[-1].statement_value));
         free((yyvsp[-1].statement_value));
         (yyval.statement_value) = code_tmp;
         (yyval.statement_value) = code_tmp;
     }
     }
-#line 2196 "y.tab.c"
+#line 2219 "y.tab.c"
     break;
     break;
 
 
   case 66:
   case 66:
-#line 466 "gwarf_yacc.y"
+#line 489 "gwarf_yacc.y"
     {
     {
         statement_base = free_statement_list(statement_base);  // new statement_base (FILO)
         statement_base = free_statement_list(statement_base);  // new statement_base (FILO)
         (yyval.statement_value) = (yyvsp[-1].statement_value);
         (yyval.statement_value) = (yyvsp[-1].statement_value);
     }
     }
-#line 2205 "y.tab.c"
+#line 2228 "y.tab.c"
     break;
     break;
 
 
   case 67:
   case 67:
-#line 471 "gwarf_yacc.y"
+#line 494 "gwarf_yacc.y"
     {
     {
         append_elif((yyvsp[-1].if_list_base), (yyvsp[-2].statement_value)->code.if_branch.done);
         append_elif((yyvsp[-1].if_list_base), (yyvsp[-2].statement_value)->code.if_branch.done);
         (yyval.statement_value) = (yyvsp[-2].statement_value);
         (yyval.statement_value) = (yyvsp[-2].statement_value);
         statement_base = free_statement_list(statement_base);  // new statement_base (FILO)
         statement_base = free_statement_list(statement_base);  // new statement_base (FILO)
     }
     }
-#line 2215 "y.tab.c"
+#line 2238 "y.tab.c"
     break;
     break;
 
 
   case 68:
   case 68:
-#line 480 "gwarf_yacc.y"
+#line 503 "gwarf_yacc.y"
     {
     {
         statement *done_tmp =  make_statement();
         statement *done_tmp =  make_statement();
         (yyval.if_list_base) = make_if((yyvsp[-1].statement_value), done_tmp);
         (yyval.if_list_base) = make_if((yyvsp[-1].statement_value), done_tmp);
         statement_base = append_statement_list(done_tmp, statement_base);  // new statement_base (FILO)
         statement_base = append_statement_list(done_tmp, statement_base);  // new statement_base (FILO)
     }
     }
-#line 2225 "y.tab.c"
+#line 2248 "y.tab.c"
     break;
     break;
 
 
   case 69:
   case 69:
-#line 486 "gwarf_yacc.y"
+#line 509 "gwarf_yacc.y"
     {
     {
         statement *done_tmp =  make_statement();
         statement *done_tmp =  make_statement();
         (yyval.if_list_base) = make_if(NULL, done_tmp);
         (yyval.if_list_base) = make_if(NULL, done_tmp);
         statement_base = append_statement_list(done_tmp, statement_base);  // new statement_base (FILO)
         statement_base = append_statement_list(done_tmp, statement_base);  // new statement_base (FILO)
     }
     }
-#line 2235 "y.tab.c"
+#line 2258 "y.tab.c"
     break;
     break;
 
 
   case 70:
   case 70:
-#line 495 "gwarf_yacc.y"
+#line 518 "gwarf_yacc.y"
     {
     {
         statement *if_tmp =  make_statement(), *done_tmp =  make_statement();
         statement *if_tmp =  make_statement(), *done_tmp =  make_statement();
         if_tmp->type = if_branch;
         if_tmp->type = if_branch;
@@ -2243,19 +2266,19 @@ yyreduce:
         statement_base = append_statement_list(done_tmp, statement_base);  // new statement_base (FILO)
         statement_base = append_statement_list(done_tmp, statement_base);  // new statement_base (FILO)
         (yyval.statement_value) = if_tmp;
         (yyval.statement_value) = if_tmp;
     }
     }
-#line 2247 "y.tab.c"
+#line 2270 "y.tab.c"
     break;
     break;
 
 
   case 71:
   case 71:
-#line 506 "gwarf_yacc.y"
+#line 529 "gwarf_yacc.y"
     {
     {
         statement_base = free_statement_list(statement_base);  // new statement_base (FILO)
         statement_base = free_statement_list(statement_base);  // new statement_base (FILO)
     }
     }
-#line 2255 "y.tab.c"
+#line 2278 "y.tab.c"
     break;
     break;
 
 
   case 72:
   case 72:
-#line 513 "gwarf_yacc.y"
+#line 536 "gwarf_yacc.y"
     {
     {
         statement *block_tmp =  make_statement();
         statement *block_tmp =  make_statement();
         block_tmp->type = code_block;
         block_tmp->type = code_block;
@@ -2263,19 +2286,19 @@ yyreduce:
         statement_base = append_statement_list(block_tmp->code.code_block.done, statement_base);  // new statement_base (FILO)
         statement_base = append_statement_list(block_tmp->code.code_block.done, statement_base);  // new statement_base (FILO)
         (yyval.statement_value) = block_tmp;
         (yyval.statement_value) = block_tmp;
     }
     }
-#line 2267 "y.tab.c"
+#line 2290 "y.tab.c"
     break;
     break;
 
 
   case 73:
   case 73:
-#line 524 "gwarf_yacc.y"
+#line 547 "gwarf_yacc.y"
     {
     {
         statement_base = free_statement_list(statement_base);  // new statement_base (FILO)
         statement_base = free_statement_list(statement_base);  // new statement_base (FILO)
     }
     }
-#line 2275 "y.tab.c"
+#line 2298 "y.tab.c"
     break;
     break;
 
 
   case 74:
   case 74:
-#line 531 "gwarf_yacc.y"
+#line 554 "gwarf_yacc.y"
     {
     {
         statement *for_tmp =  make_statement();
         statement *for_tmp =  make_statement();
         for_tmp->type = for_cycle;
         for_tmp->type = for_cycle;
@@ -2286,11 +2309,11 @@ yyreduce:
         statement_base = append_statement_list(for_tmp->code.for_cycle.done, statement_base);  // new statement_base (FILO)
         statement_base = append_statement_list(for_tmp->code.for_cycle.done, statement_base);  // new statement_base (FILO)
         (yyval.statement_value) = for_tmp;
         (yyval.statement_value) = for_tmp;
     }
     }
-#line 2290 "y.tab.c"
+#line 2313 "y.tab.c"
     break;
     break;
 
 
   case 75:
   case 75:
-#line 542 "gwarf_yacc.y"
+#line 565 "gwarf_yacc.y"
     {
     {
         statement *for_tmp =  make_statement();
         statement *for_tmp =  make_statement();
         for_tmp->type = for_cycle;
         for_tmp->type = for_cycle;
@@ -2301,11 +2324,11 @@ yyreduce:
         statement_base = append_statement_list(for_tmp->code.for_cycle.done, statement_base);  // new statement_base (FILO)
         statement_base = append_statement_list(for_tmp->code.for_cycle.done, statement_base);  // new statement_base (FILO)
         (yyval.statement_value) = for_tmp;
         (yyval.statement_value) = for_tmp;
     }
     }
-#line 2305 "y.tab.c"
+#line 2328 "y.tab.c"
     break;
     break;
 
 
   case 76:
   case 76:
-#line 553 "gwarf_yacc.y"
+#line 576 "gwarf_yacc.y"
     {
     {
         statement *for_tmp =  make_statement();
         statement *for_tmp =  make_statement();
         for_tmp->type = for_cycle;
         for_tmp->type = for_cycle;
@@ -2316,11 +2339,11 @@ yyreduce:
         statement_base = append_statement_list(for_tmp->code.for_cycle.done, statement_base);  // new statement_base (FILO)
         statement_base = append_statement_list(for_tmp->code.for_cycle.done, statement_base);  // new statement_base (FILO)
         (yyval.statement_value) = for_tmp;
         (yyval.statement_value) = for_tmp;
     }
     }
-#line 2320 "y.tab.c"
+#line 2343 "y.tab.c"
     break;
     break;
 
 
   case 77:
   case 77:
-#line 564 "gwarf_yacc.y"
+#line 587 "gwarf_yacc.y"
     {
     {
         statement *for_tmp =  make_statement();
         statement *for_tmp =  make_statement();
         for_tmp->type = for_cycle;
         for_tmp->type = for_cycle;
@@ -2331,11 +2354,11 @@ yyreduce:
         statement_base = append_statement_list(for_tmp->code.for_cycle.done, statement_base);  // new statement_base (FILO)
         statement_base = append_statement_list(for_tmp->code.for_cycle.done, statement_base);  // new statement_base (FILO)
         (yyval.statement_value) = for_tmp;
         (yyval.statement_value) = for_tmp;
     }
     }
-#line 2335 "y.tab.c"
+#line 2358 "y.tab.c"
     break;
     break;
 
 
   case 78:
   case 78:
-#line 575 "gwarf_yacc.y"
+#line 598 "gwarf_yacc.y"
     {
     {
         statement *for_tmp =  make_statement();
         statement *for_tmp =  make_statement();
         for_tmp->type = for_cycle;
         for_tmp->type = for_cycle;
@@ -2346,11 +2369,11 @@ yyreduce:
         statement_base = append_statement_list(for_tmp->code.for_cycle.done, statement_base);  // new statement_base (FILO)
         statement_base = append_statement_list(for_tmp->code.for_cycle.done, statement_base);  // new statement_base (FILO)
         (yyval.statement_value) = for_tmp;
         (yyval.statement_value) = for_tmp;
     }
     }
-#line 2350 "y.tab.c"
+#line 2373 "y.tab.c"
     break;
     break;
 
 
   case 79:
   case 79:
-#line 586 "gwarf_yacc.y"
+#line 609 "gwarf_yacc.y"
     {
     {
         statement *for_tmp =  make_statement();
         statement *for_tmp =  make_statement();
         for_tmp->type = for_cycle;
         for_tmp->type = for_cycle;
@@ -2361,11 +2384,11 @@ yyreduce:
         statement_base = append_statement_list(for_tmp->code.for_cycle.done, statement_base);  // new statement_base (FILO)
         statement_base = append_statement_list(for_tmp->code.for_cycle.done, statement_base);  // new statement_base (FILO)
         (yyval.statement_value) = for_tmp;
         (yyval.statement_value) = for_tmp;
     }
     }
-#line 2365 "y.tab.c"
+#line 2388 "y.tab.c"
     break;
     break;
 
 
   case 80:
   case 80:
-#line 597 "gwarf_yacc.y"
+#line 620 "gwarf_yacc.y"
     {
     {
         statement *for_tmp =  make_statement();
         statement *for_tmp =  make_statement();
         for_tmp->type = for_cycle;
         for_tmp->type = for_cycle;
@@ -2376,11 +2399,11 @@ yyreduce:
         statement_base = append_statement_list(for_tmp->code.for_cycle.done, statement_base);  // new statement_base (FILO)
         statement_base = append_statement_list(for_tmp->code.for_cycle.done, statement_base);  // new statement_base (FILO)
         (yyval.statement_value) = for_tmp;
         (yyval.statement_value) = for_tmp;
     }
     }
-#line 2380 "y.tab.c"
+#line 2403 "y.tab.c"
     break;
     break;
 
 
   case 81:
   case 81:
-#line 608 "gwarf_yacc.y"
+#line 631 "gwarf_yacc.y"
     {
     {
         statement *for_tmp =  make_statement();
         statement *for_tmp =  make_statement();
         for_tmp->type = for_cycle;
         for_tmp->type = for_cycle;
@@ -2391,19 +2414,19 @@ yyreduce:
         statement_base = append_statement_list(for_tmp->code.for_cycle.done, statement_base);  // new statement_base (FILO)
         statement_base = append_statement_list(for_tmp->code.for_cycle.done, statement_base);  // new statement_base (FILO)
         (yyval.statement_value) = for_tmp;
         (yyval.statement_value) = for_tmp;
     }
     }
-#line 2395 "y.tab.c"
+#line 2418 "y.tab.c"
     break;
     break;
 
 
   case 82:
   case 82:
-#line 622 "gwarf_yacc.y"
+#line 645 "gwarf_yacc.y"
     {
     {
         statement_base = free_statement_list(statement_base);  // new statement_base (FILO)
         statement_base = free_statement_list(statement_base);  // new statement_base (FILO)
     }
     }
-#line 2403 "y.tab.c"
+#line 2426 "y.tab.c"
     break;
     break;
 
 
   case 83:
   case 83:
-#line 629 "gwarf_yacc.y"
+#line 652 "gwarf_yacc.y"
     {
     {
         statement *while_tmp =  make_statement();
         statement *while_tmp =  make_statement();
         while_tmp->type = while_cycle;
         while_tmp->type = while_cycle;
@@ -2412,19 +2435,19 @@ yyreduce:
         statement_base = append_statement_list(while_tmp->code.while_cycle.done, statement_base);  // new statement_base (FILO)
         statement_base = append_statement_list(while_tmp->code.while_cycle.done, statement_base);  // new statement_base (FILO)
         (yyval.statement_value) = while_tmp;
         (yyval.statement_value) = while_tmp;
     }
     }
-#line 2416 "y.tab.c"
+#line 2439 "y.tab.c"
     break;
     break;
 
 
   case 84:
   case 84:
-#line 641 "gwarf_yacc.y"
+#line 664 "gwarf_yacc.y"
     {
     {
         statement_base = free_statement_list(statement_base);  // new statement_base (FILO)
         statement_base = free_statement_list(statement_base);  // new statement_base (FILO)
     }
     }
-#line 2424 "y.tab.c"
+#line 2447 "y.tab.c"
     break;
     break;
 
 
   case 85:
   case 85:
-#line 648 "gwarf_yacc.y"
+#line 671 "gwarf_yacc.y"
     {   
     {   
         //无参数方法
         //无参数方法
         statement *class_tmp =  make_statement();
         statement *class_tmp =  make_statement();
@@ -2441,19 +2464,19 @@ yyreduce:
         free((yyvsp[-2].statement_value));
         free((yyvsp[-2].statement_value));
         (yyval.statement_value) = class_tmp;
         (yyval.statement_value) = class_tmp;
     }
     }
-#line 2445 "y.tab.c"
+#line 2468 "y.tab.c"
     break;
     break;
 
 
   case 86:
   case 86:
-#line 668 "gwarf_yacc.y"
+#line 691 "gwarf_yacc.y"
     {
     {
         statement_base = free_statement_list(statement_base);  // new statement_base (FILO)
         statement_base = free_statement_list(statement_base);  // new statement_base (FILO)
     }
     }
-#line 2453 "y.tab.c"
+#line 2476 "y.tab.c"
     break;
     break;
 
 
   case 87:
   case 87:
-#line 675 "gwarf_yacc.y"
+#line 698 "gwarf_yacc.y"
     {   
     {   
         //无参数方法
         //无参数方法
         statement *def_tmp =  make_statement();
         statement *def_tmp =  make_statement();
@@ -2471,11 +2494,11 @@ yyreduce:
         free((yyvsp[-2].statement_value));
         free((yyvsp[-2].statement_value));
         (yyval.statement_value) = def_tmp;
         (yyval.statement_value) = def_tmp;
     }
     }
-#line 2475 "y.tab.c"
+#line 2498 "y.tab.c"
     break;
     break;
 
 
   case 88:
   case 88:
-#line 693 "gwarf_yacc.y"
+#line 716 "gwarf_yacc.y"
     {   
     {   
         statement *def_tmp =  make_statement();
         statement *def_tmp =  make_statement();
         def_tmp->type = def;
         def_tmp->type = def;
@@ -2492,66 +2515,66 @@ yyreduce:
         free((yyvsp[-3].statement_value));
         free((yyvsp[-3].statement_value));
         (yyval.statement_value) = def_tmp;
         (yyval.statement_value) = def_tmp;
     }
     }
-#line 2496 "y.tab.c"
+#line 2519 "y.tab.c"
     break;
     break;
 
 
   case 89:
   case 89:
-#line 713 "gwarf_yacc.y"
+#line 736 "gwarf_yacc.y"
     {
     {
         (yyval.parameter_list) = make_parameter_name((yyvsp[0].statement_value)->code.base_var.var_name);
         (yyval.parameter_list) = make_parameter_name((yyvsp[0].statement_value)->code.base_var.var_name);
         free((yyvsp[0].statement_value)->code.base_var.var_name);
         free((yyvsp[0].statement_value)->code.base_var.var_name);
         free((yyvsp[0].statement_value));
         free((yyvsp[0].statement_value));
     }
     }
-#line 2506 "y.tab.c"
+#line 2529 "y.tab.c"
     break;
     break;
 
 
   case 90:
   case 90:
-#line 719 "gwarf_yacc.y"
+#line 742 "gwarf_yacc.y"
     {
     {
         append_parameter_name((yyvsp[0].statement_value)->code.base_var.var_name, (yyvsp[-2].parameter_list));
         append_parameter_name((yyvsp[0].statement_value)->code.base_var.var_name, (yyvsp[-2].parameter_list));
         (yyval.parameter_list) = (yyvsp[-2].parameter_list);
         (yyval.parameter_list) = (yyvsp[-2].parameter_list);
     }
     }
-#line 2515 "y.tab.c"
+#line 2538 "y.tab.c"
     break;
     break;
 
 
   case 91:
   case 91:
-#line 726 "gwarf_yacc.y"
+#line 749 "gwarf_yacc.y"
     {
     {
         (yyval.parameter_list) = make_parameter_value((yyvsp[0].statement_value));
         (yyval.parameter_list) = make_parameter_value((yyvsp[0].statement_value));
     }
     }
-#line 2523 "y.tab.c"
+#line 2546 "y.tab.c"
     break;
     break;
 
 
   case 92:
   case 92:
-#line 730 "gwarf_yacc.y"
+#line 753 "gwarf_yacc.y"
     {
     {
         append_parameter_value((yyvsp[0].statement_value), (yyvsp[-2].parameter_list));
         append_parameter_value((yyvsp[0].statement_value), (yyvsp[-2].parameter_list));
         (yyval.parameter_list) = (yyvsp[-2].parameter_list);
         (yyval.parameter_list) = (yyvsp[-2].parameter_list);
     }
     }
-#line 2532 "y.tab.c"
+#line 2555 "y.tab.c"
     break;
     break;
 
 
   case 95:
   case 95:
-#line 742 "gwarf_yacc.y"
+#line 765 "gwarf_yacc.y"
     {
     {
         (yyvsp[-1].statement_value)->code.return_code.value = (yyvsp[0].statement_value);
         (yyvsp[-1].statement_value)->code.return_code.value = (yyvsp[0].statement_value);
         (yyval.statement_value) = (yyvsp[-1].statement_value);
         (yyval.statement_value) = (yyvsp[-1].statement_value);
     }
     }
-#line 2541 "y.tab.c"
+#line 2564 "y.tab.c"
     break;
     break;
 
 
   case 96:
   case 96:
-#line 747 "gwarf_yacc.y"
+#line 770 "gwarf_yacc.y"
     {
     {
         (yyvsp[-2].statement_value)->code.return_code.value = (yyvsp[-1].statement_value);
         (yyvsp[-2].statement_value)->code.return_code.value = (yyvsp[-1].statement_value);
         (yyvsp[-2].statement_value)->code.return_code.times = (yyvsp[0].statement_value);
         (yyvsp[-2].statement_value)->code.return_code.times = (yyvsp[0].statement_value);
         (yyval.statement_value) = (yyvsp[-2].statement_value);
         (yyval.statement_value) = (yyvsp[-2].statement_value);
     }
     }
-#line 2551 "y.tab.c"
+#line 2574 "y.tab.c"
     break;
     break;
 
 
   case 97:
   case 97:
-#line 756 "gwarf_yacc.y"
+#line 779 "gwarf_yacc.y"
     {
     {
         statement *code_tmp =  make_statement();
         statement *code_tmp =  make_statement();
         code_tmp->type = return_code;
         code_tmp->type = return_code;
@@ -2559,131 +2582,131 @@ yyreduce:
         code_tmp->code.return_code.value = NULL;
         code_tmp->code.return_code.value = NULL;
         (yyval.statement_value) = code_tmp;
         (yyval.statement_value) = code_tmp;
     }
     }
-#line 2563 "y.tab.c"
+#line 2586 "y.tab.c"
     break;
     break;
 
 
   case 99:
   case 99:
-#line 768 "gwarf_yacc.y"
+#line 791 "gwarf_yacc.y"
     {
     {
         (yyvsp[-1].statement_value)->code.restarted.times = (yyvsp[0].statement_value);
         (yyvsp[-1].statement_value)->code.restarted.times = (yyvsp[0].statement_value);
         (yyval.statement_value) = (yyvsp[-1].statement_value);
         (yyval.statement_value) = (yyvsp[-1].statement_value);
     }
     }
-#line 2572 "y.tab.c"
+#line 2595 "y.tab.c"
     break;
     break;
 
 
   case 100:
   case 100:
-#line 776 "gwarf_yacc.y"
+#line 799 "gwarf_yacc.y"
     {
     {
         statement *code_tmp =  make_statement();
         statement *code_tmp =  make_statement();
         code_tmp->type = restarted;
         code_tmp->type = restarted;
         code_tmp->code.restarted.times = NULL;
         code_tmp->code.restarted.times = NULL;
         (yyval.statement_value) = code_tmp;
         (yyval.statement_value) = code_tmp;
     }
     }
-#line 2583 "y.tab.c"
+#line 2606 "y.tab.c"
     break;
     break;
 
 
   case 102:
   case 102:
-#line 787 "gwarf_yacc.y"
+#line 810 "gwarf_yacc.y"
     {
     {
         (yyvsp[-1].statement_value)->code.restart.times = (yyvsp[0].statement_value);
         (yyvsp[-1].statement_value)->code.restart.times = (yyvsp[0].statement_value);
         (yyval.statement_value) = (yyvsp[-1].statement_value);
         (yyval.statement_value) = (yyvsp[-1].statement_value);
     }
     }
-#line 2592 "y.tab.c"
+#line 2615 "y.tab.c"
     break;
     break;
 
 
   case 103:
   case 103:
-#line 795 "gwarf_yacc.y"
+#line 818 "gwarf_yacc.y"
     {
     {
         statement *code_tmp =  make_statement();
         statement *code_tmp =  make_statement();
         code_tmp->type = restart;
         code_tmp->type = restart;
         code_tmp->code.restart.times = NULL;
         code_tmp->code.restart.times = NULL;
         (yyval.statement_value) = code_tmp;
         (yyval.statement_value) = code_tmp;
     }
     }
-#line 2603 "y.tab.c"
+#line 2626 "y.tab.c"
     break;
     break;
 
 
   case 105:
   case 105:
-#line 806 "gwarf_yacc.y"
+#line 829 "gwarf_yacc.y"
     {
     {
         (yyvsp[-1].statement_value)->code.continued.times = (yyvsp[0].statement_value);
         (yyvsp[-1].statement_value)->code.continued.times = (yyvsp[0].statement_value);
         (yyval.statement_value) = (yyvsp[-1].statement_value);
         (yyval.statement_value) = (yyvsp[-1].statement_value);
     }
     }
-#line 2612 "y.tab.c"
+#line 2635 "y.tab.c"
     break;
     break;
 
 
   case 106:
   case 106:
-#line 814 "gwarf_yacc.y"
+#line 837 "gwarf_yacc.y"
     {
     {
         statement *code_tmp =  make_statement();
         statement *code_tmp =  make_statement();
         code_tmp->type = continued;
         code_tmp->type = continued;
         code_tmp->code.continued.times = NULL;
         code_tmp->code.continued.times = NULL;
         (yyval.statement_value) = code_tmp;
         (yyval.statement_value) = code_tmp;
     }
     }
-#line 2623 "y.tab.c"
+#line 2646 "y.tab.c"
     break;
     break;
 
 
   case 108:
   case 108:
-#line 825 "gwarf_yacc.y"
+#line 848 "gwarf_yacc.y"
     {
     {
         (yyvsp[-1].statement_value)->code.continue_cycle.times = (yyvsp[0].statement_value);
         (yyvsp[-1].statement_value)->code.continue_cycle.times = (yyvsp[0].statement_value);
         (yyval.statement_value) = (yyvsp[-1].statement_value);
         (yyval.statement_value) = (yyvsp[-1].statement_value);
     }
     }
-#line 2632 "y.tab.c"
+#line 2655 "y.tab.c"
     break;
     break;
 
 
   case 109:
   case 109:
-#line 833 "gwarf_yacc.y"
+#line 856 "gwarf_yacc.y"
     {
     {
         statement *code_tmp =  make_statement();
         statement *code_tmp =  make_statement();
         code_tmp->type = continue_cycle;
         code_tmp->type = continue_cycle;
         code_tmp->code.continue_cycle.times = NULL;
         code_tmp->code.continue_cycle.times = NULL;
         (yyval.statement_value) = code_tmp;
         (yyval.statement_value) = code_tmp;
     }
     }
-#line 2643 "y.tab.c"
+#line 2666 "y.tab.c"
     break;
     break;
 
 
   case 111:
   case 111:
-#line 844 "gwarf_yacc.y"
+#line 867 "gwarf_yacc.y"
     {
     {
         (yyvsp[-1].statement_value)->code.break_cycle.times = (yyvsp[0].statement_value);
         (yyvsp[-1].statement_value)->code.break_cycle.times = (yyvsp[0].statement_value);
         (yyval.statement_value) = (yyvsp[-1].statement_value);
         (yyval.statement_value) = (yyvsp[-1].statement_value);
     }
     }
-#line 2652 "y.tab.c"
+#line 2675 "y.tab.c"
     break;
     break;
 
 
   case 112:
   case 112:
-#line 852 "gwarf_yacc.y"
+#line 875 "gwarf_yacc.y"
     {
     {
         statement *code_tmp =  make_statement();
         statement *code_tmp =  make_statement();
         code_tmp->type = break_cycle;
         code_tmp->type = break_cycle;
         code_tmp->code.break_cycle.times = NULL;
         code_tmp->code.break_cycle.times = NULL;
         (yyval.statement_value) = code_tmp;
         (yyval.statement_value) = code_tmp;
     }
     }
-#line 2663 "y.tab.c"
+#line 2686 "y.tab.c"
     break;
     break;
 
 
   case 114:
   case 114:
-#line 863 "gwarf_yacc.y"
+#line 886 "gwarf_yacc.y"
     {
     {
         (yyvsp[-1].statement_value)->code.broken.times = (yyvsp[0].statement_value);
         (yyvsp[-1].statement_value)->code.broken.times = (yyvsp[0].statement_value);
         (yyval.statement_value) = (yyvsp[-1].statement_value);
         (yyval.statement_value) = (yyvsp[-1].statement_value);
     }
     }
-#line 2672 "y.tab.c"
+#line 2695 "y.tab.c"
     break;
     break;
 
 
   case 115:
   case 115:
-#line 870 "gwarf_yacc.y"
+#line 893 "gwarf_yacc.y"
     {
     {
         statement *code_tmp =  make_statement();
         statement *code_tmp =  make_statement();
         code_tmp->type = broken;
         code_tmp->type = broken;
         code_tmp->code.broken.times = NULL;
         code_tmp->code.broken.times = NULL;
         (yyval.statement_value) = code_tmp;
         (yyval.statement_value) = code_tmp;
     }
     }
-#line 2683 "y.tab.c"
+#line 2706 "y.tab.c"
     break;
     break;
 
 
 
 
-#line 2687 "y.tab.c"
+#line 2710 "y.tab.c"
 
 
       default: break;
       default: break;
     }
     }
@@ -2915,7 +2938,7 @@ yyreturn:
 #endif
 #endif
   return yyresult;
   return yyresult;
 }
 }
-#line 885 "gwarf_yacc.y"
+#line 908 "gwarf_yacc.y"
 
 
 int yyerror(char const *str)
 int yyerror(char const *str)
 {
 {