Browse Source

实现rego和rewent语句已经变量和局部变量系统

SongZihuan 5 years ago
parent
commit
14fa221b67
9 changed files with 623 additions and 409 deletions
  1. 2 1
      .vscode/settings.json
  2. BIN
      gwarf
  3. 11 0
      gwarf_interpreter/interprete.h
  4. 135 41
      gwarf_interpreter/interpreter.c
  5. 6 1
      paser/gwarf_lex.l
  6. 23 2
      paser/gwarf_yacc.y
  7. 176 151
      paser/lex.yy.c
  8. 260 211
      paser/y.tab.c
  9. 10 2
      paser/y.tab.h

+ 2 - 1
.vscode/settings.json

@@ -29,6 +29,7 @@
         "optional": "c",
         "fstream": "c",
         "streambuf": "c",
-        "interprete.h": "c"
+        "interprete.h": "c",
+        "mutex": "c"
     }
 }

BIN
gwarf


+ 11 - 0
gwarf_interpreter/interprete.h

@@ -43,6 +43,8 @@ typedef struct statement{
         continued,
         restart,
         restarted,
+        rego,
+        rewent,
     } type;  // the statement type
 
     union
@@ -76,6 +78,7 @@ typedef struct statement{
 
         struct{
             char *var_name;  // return var
+            struct statement *from;  // from where [double->int]
         } base_var;
 
         struct{
@@ -106,6 +109,12 @@ typedef struct statement{
             struct statement *times;  // 层数
         } restarted;
 
+        struct{
+        } rego;
+
+        struct{
+        } rewent;
+
     } code;
     struct statement *next;
 } statement;
@@ -123,6 +132,8 @@ typedef struct GWARF_result{
         code_continued,
         cycle_restart,
         code_restarted,
+        code_rego,
+        code_rewent,
         name_no_found,
     } u;  // the result type[from where]
 } GWARF_result;

+ 135 - 41
gwarf_interpreter/interpreter.c

@@ -10,7 +10,7 @@ GWARF_result add_func(GWARF_result, GWARF_result, var_list *);
 GWARF_result sub_func(GWARF_result, GWARF_result, var_list *);
 GWARF_result mul_func(GWARF_result, GWARF_result, var_list *);
 GWARF_result div_func(GWARF_result, GWARF_result, var_list *);
-GWARF_result assigment_func(char *, GWARF_result, var_list *);
+GWARF_result assigment_func(char *, GWARF_result, var_list *, int);
 GWARF_result equal_func(GWARF_result, GWARF_result, var_list *, int);
 GWARF_result if_func(if_list *, var_list *);
 
@@ -125,7 +125,7 @@ var_list *make_var_list(){  // make a empty var_list node
     return tmp;
 }
 
-var_list *make_var_base(var *gloabl_var){
+var_list *make_var_base(var *gloabl_var){  // make the base for global_var
     var_list *tmp = make_var_list();
     tmp->var_base = gloabl_var;
     return tmp;
@@ -139,15 +139,26 @@ var_list *append_var_list(var *var_base, var_list *var_list_base){  // make var_
     return tmp;
 }
 
+var_list *free_var_list(var_list *var_list_base){  // free one var_list[FILO]
+    var_list *tmp = var_list_base->next;
+    if(tmp==NULL){
+        return var_list_base;
+    }
+    free(var_list_base);
+    return tmp;
+}
+
 var *find_var(var_list *var_base,int from, char *name){  // find var by func get_var in var_list[iter to find]
     var_list *start = var_base;
     var *return_var;
     for(int i = 0;i < from;i+= 1){
-        if(start->next = NULL){
+        printf("the start = %d\n", start);
+        if(start->next == NULL){
             break;
         }
         start = start->next;
     }
+    printf("----find address = %d----\n", start);
     while (1)
     {
         return_var = get_var(name, start->var_base);
@@ -165,12 +176,13 @@ var *find_var(var_list *var_base,int from, char *name){  // find var by func get
 void add_var(var_list *var_base,int from, char *name, GWARF_value value){  // add var by func append_var in var_list[iter to find]
     var_list *start = var_base;
     var *return_var;
-    for(int i = 0;i < 100;i+= 1){
+    for(int i = 0;i < from;i+= 1){
         if(start->next == NULL){
             break;
         }
         start = start->next;
     }
+    printf("----add address = %d----\n", start);
     append_var(name, value, start->var_base);
 }
 
@@ -276,17 +288,6 @@ GWARF_result read_statement_list(statement *the_statement, var_list *the_var){
         case if_branch:
             puts("----if code----");
             return_value = if_func(the_statement->code.if_branch.done, the_var);
-            if(return_value.u == cycle_break){
-                printf("cycle_break %f\n", return_value.value.value.double_value);
-            }
-            if(return_value.u == code_broken){
-                printf("broken %f\n", return_value.value.value.double_value);
-                return_value.value.value.double_value -= 1;
-                if(return_value.value.value.double_value < 0){
-                    return_value.u = statement_end;  // 正常设置[正常语句结束]
-                }
-            }
-            printf("if type = %d\n", return_value.u);
             printf("if operation value = %f\n", return_value.value.value.double_value);
             puts("----stop if code----");
             break;
@@ -295,7 +296,16 @@ GWARF_result read_statement_list(statement *the_statement, var_list *the_var){
             printf("get value = %f\n", return_value.value.value.double_value);
             break;
         case base_var:{    // because the var tmp, we should ues a {} to make a block[name space] for the tmp var;
-            var *tmp = find_var(the_var, 0, (the_statement->code).base_var.var_name);
+            int from = 0;
+            if((the_statement->code).base_var.from == NULL){
+                from = 0;
+            }
+            else{
+                from = (int)traverse((the_statement->code).base_var.from, the_var, false).value.value.double_value;
+            }
+            printf("the_var = %d\n", the_var);
+            printf("from = %d\n", from);
+            var *tmp = find_var(the_var, from, (the_statement->code).base_var.var_name);
             if(tmp == NULL){
                 return_value.u = name_no_found;  // nameerror
             }
@@ -366,6 +376,12 @@ GWARF_result read_statement_list(statement *the_statement, var_list *the_var){
             }
             printf("restarted num = %f\n", return_value.value.value.double_value);
             break;
+        case rewent:
+            return_value.u = code_rewent;  // rego but not now
+            break;
+        case rego:
+            return_value.u = code_rego;  // rego now
+            break;
         default:
             puts("default");
             break;
@@ -379,12 +395,15 @@ GWARF_result if_func(if_list *if_base, var_list *the_var){  // read the statemen
     GWARF_result value;
     if_list *start;
     again: start = if_base;
+    bool rego = false;  // switch...case...
     while(1){
         if(start->condition  == NULL){  // else
             else_restart:
             puts("----else----");
-            value = traverse(start->done, the_var, false);
+            value = traverse(start->done, the_var, true);
             puts("----stop else----");
+            
+            // restarted
             if(value.u == code_restarted){
                 if(value.value.value.double_value <= 0){
                     puts("----restarted real----");
@@ -396,16 +415,38 @@ GWARF_result if_func(if_list *if_base, var_list *the_var){  // read the statemen
                     break;
                 }
             }
-            break;
+
+            if(value.u == code_continued){
+                if(value.value.value.double_value <= 0){
+                    puts("----if continue real----");
+                    value.u = statement_end;
+                    goto again;
+                }
+                else{
+                    value.value.value.double_value -= 1;
+                }
+                break;
+            }
+            if(value.u == code_broken){
+                value.value.value.double_value -= 1;
+                if(value.value.value.double_value < 0){
+                    value.u = statement_end;  // 正常设置[正常语句结束]
+                }
+                break;
+            }
+
+            break;  // else not next and don't need rego
         }
         else{  // not else
             GWARF_result condition;
             condition = traverse(start->condition, the_var, false);
-            if(condition.value.value.double_value){  // condition run success
+            if(rego || (condition.value.value.double_value)){  // condition run success or rego(condition won't do) bug rewent can
                 if_restart:
                 puts("----if----");
-                value = traverse(start->done, the_var, false);
+                value = traverse(start->done, the_var, true);
                 puts("----stop if----");
+
+                // restarted
                 if(value.u == code_restarted){
                     if(value.value.value.double_value <= 0){
                         puts("----restarted real----");
@@ -417,7 +458,35 @@ GWARF_result if_func(if_list *if_base, var_list *the_var){  // read the statemen
                         break;
                     }
                 }
-                break;
+                
+                // 设在在rewent和rego前面
+                if(value.u == code_continued){
+                    if(value.value.value.double_value <= 0){
+                        puts("----if continue real----");
+                        value.u = statement_end;
+                        goto again;
+                    }
+                    else{
+                        value.value.value.double_value -= 1;
+                    }
+                    break;
+                }
+                if(value.u == code_broken){
+                    value.value.value.double_value -= 1;
+                    if(value.value.value.double_value < 0){
+                        value.u = statement_end;  // 正常设置[正常语句结束]
+                    }
+                    break;
+                }
+
+                if((value.u == code_rewent) || (value.u == code_rego)){
+                    rego = true;
+                }
+
+                // not restarted -> if is rego
+                if(!rego){
+                    break;  // don't rego
+                }
             }
         }
         if(start->next  == NULL){  // not next
@@ -425,19 +494,9 @@ GWARF_result if_func(if_list *if_base, var_list *the_var){  // read the statemen
         }
         start = start->next;
     }
-    if((value.u == cycle_continue) || (value.u == cycle_restart)){  // if不处理也不计入层次 同break一样
+    if((value.u == cycle_continue) || (value.u == cycle_restart) || (value.u == cycle_break)){  // if不处理也不计入层次 同break一样
         ;
     }
-    if(value.u == code_continued){
-        if(value.value.value.double_value <= 0){
-            puts("----if continue real----");
-            value.u = statement_end;
-            goto again;
-        }
-        else{
-            value.value.value.double_value -= 1;
-        }
-    }
     return value;
 }
 
@@ -453,7 +512,7 @@ GWARF_result while_func(statement *the_statement, var_list *the_var){  // read t
         }
         restart_again: 
         puts("----while----");
-        value = traverse((*the_statement).code.operation.right_exp, the_var, false);
+        value = traverse((*the_statement).code.operation.right_exp, the_var, true);
         puts("----stop while----");
         if((value.u == cycle_break) || (value.u == code_broken)){  // break the while
             break;
@@ -508,7 +567,14 @@ GWARF_result operation_func(statement *the_statement, var_list *the_var){  // re
             break;
         case ASSIGMENT_func:{  // because the var char, we should ues a {} to make a block[name space] for the tmp var;
             char *left = (the_statement->code.operation.left_exp)->code.base_var.var_name;  // get var name but not value
-            value = assigment_func(left, right_result, the_var);
+            int from = 0;
+            if((the_statement->code).base_var.from == NULL){
+                from = 0;
+            }
+            else{
+                from = (int)traverse((the_statement->code).base_var.from, the_var, false).value.value.double_value;
+            }
+            value = assigment_func(left, right_result, the_var, from);
             break;
         }
         case EQUAL_func:
@@ -581,8 +647,8 @@ GWARF_result div_func(GWARF_result left_result, GWARF_result right_result, var_l
 }
 
 // ---------  ASSIGMENT
-GWARF_result assigment_func(char *left, GWARF_result right_result, var_list *the_var){  // the func for assigment and call from read_statement_list
-    add_var(the_var, 0, left, right_result.value);
+GWARF_result assigment_func(char *left, GWARF_result right_result, var_list *the_var, int from){  // the func for assigment and call from read_statement_list
+    add_var(the_var, from, left, right_result.value);
     return right_result;
 }
 
@@ -619,22 +685,50 @@ GWARF_result equal_func(GWARF_result left_result, GWARF_result right_result, var
 // --------- traverse[iter]
 GWARF_result traverse(statement *the_statement, var_list *the_var, bool new){  // traverse the statement
     statement *tmp = the_statement;
-    GWARF_result result;
+    GWARF_result result, result2;
+    bool lock = false;
+    if(new){  // need to make new var
+        printf("----address = %d----\n", the_var);
+        var *tmp = make_var();  // base_var
+        the_var = append_var_list(tmp, the_var);
+        printf("----new address = %d----\n", the_var);
+    }
     while(1){
         if(tmp == NULL){
             break;  // off
         }
-        result = read_statement_list(tmp, the_var);
-        if((result.u == cycle_break) || (result.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]
+        result2 = read_statement_list(tmp, the_var);
+
+        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----");
+            result = result2;
             break;
-        }
-        if((result.u == cycle_continue) || (result.u == code_continued) || (result.u == cycle_restart) || (result.u == code_restarted)){
+            }
+        if((result2.u == cycle_continue) || (result2.u == code_continued) || (result.u == cycle_restart) || (result.u == code_restarted)){
             puts("----continue/continued or restart/restarted----");
+            result = result2;
             break;
         }
+
+        if(result2.u == code_rego){
+            puts("----rego----");  // rego now
+            result = result2;
+            break;
+        }
+
+        if(result2.u == code_rewent){
+            lock = true;  // keep the result is rewent for return
+            result = result2;
+        }
+
+        if(!lock){
+            result = result2;
+        }
         tmp = tmp->next;
     }
+    if(new){  // need to make new var
+        the_var = free_var_list(the_var);  // free the new var
+    }
     return result;
 }
 

+ 6 - 1
paser/gwarf_lex.l

@@ -14,6 +14,9 @@
 <INITIAL>"restart" {return RESTART;}
 <INITIAL>"restarted" {return RESTARTED;}
 <INITIAL>"continued" {return CONTINUED;}
+<INITIAL>"rego" {return REGO;}
+<INITIAL>"rewent" {return REWENT;}
+
 
 <INITIAL>"(" {return LB;}
 <INITIAL>")" {return RB;}
@@ -32,6 +35,8 @@
 <INITIAL>"*" {return MUL;}
 <INITIAL>"/" {return DIV;}
 <INITIAL>"^" {return POW;}
+<INITIAL>"[" {return LI;}
+<INITIAL>"]" {return RI;}
 
 <INITIAL>"#" {BEGIN COMMENT;}
 <INITIAL>' {BEGIN STRING_TEXT;}
@@ -46,7 +51,7 @@
     }
 
 <INITIAL>" " ;
-<INITIAL>\n {return STOP;}
+<INITIAL>;?\n {return STOP;}
 <INITIAL>";" {return STOP;}
 <INITIAL>. {printf("text = [%s];\n", yytext);}
 

+ 23 - 2
paser/gwarf_yacc.y

@@ -14,8 +14,8 @@
 }
 %token <double_value> NUMBER
 %token <string_value> STRING VAR
-%token ADD SUB DIV MUL EQ LESS MORE RB LB RP LP WHILE STOP POW EQUAL MOREEQ LESSEQ NOTEQ BREAK IF ELSE ELIF BROKEN CONTINUE CONTINUED RESTART RESTARTED
-%type <statement_value> base_number base_var_ element second_number first_number top_exp command third_number while_block while_exp break_exp if_block if_exp broken_exp break_token broken_token continue_token continue_exp
+%token ADD SUB DIV MUL EQ LESS MORE RB LB RP LP WHILE STOP POW EQUAL MOREEQ LESSEQ NOTEQ BREAK IF ELSE ELIF BROKEN CONTINUE CONTINUED RESTART RESTARTED REGO REWENT RI LI
+%type <statement_value> base_number base_var_token base_var_ element second_number first_number top_exp command third_number while_block while_exp break_exp if_block if_exp broken_exp break_token broken_token continue_token continue_exp
 %type <statement_value> continued_exp continued_token restart_exp restart_token restarted_exp restarted_token
 %type <if_list_base> elif_exp
 %%
@@ -88,6 +88,18 @@ command
     {
         $$ = $1;
     }
+    | REGO STOP
+    {
+        statement *code_tmp =  make_statement();
+        code_tmp->type = rego;
+        $$ = code_tmp;
+    }
+    | REWENT STOP
+    {
+        statement *code_tmp =  make_statement();
+        code_tmp->type = rewent;
+        $$ = code_tmp;
+    }
     ;
 
 top_exp
@@ -229,6 +241,15 @@ base_number
     ;
 
 base_var_
+    : base_var_token
+    | LI element RI base_var_token
+    {
+        $4->code.base_var.from = $2;
+        $$ = $4;
+    }
+    ;
+
+base_var_token
     : VAR
     {
         statement *code_tmp =  make_statement();

+ 176 - 151
paser/lex.yy.c

@@ -351,8 +351,8 @@ static void yynoreturn yy_fatal_error ( const char* msg  );
 	(yy_hold_char) = *yy_cp; \
 	*yy_cp = '\0'; \
 	(yy_c_buf_p) = yy_cp;
-#define YY_NUM_RULES 43
-#define YY_END_OF_BUFFER 44
+#define YY_NUM_RULES 47
+#define YY_END_OF_BUFFER 48
 /* This struct is not used in this scanner,
    but its presence is necessary. */
 struct yy_trans_info
@@ -360,19 +360,20 @@ struct yy_trans_info
 	flex_int32_t yy_verify;
 	flex_int32_t yy_nxt;
 	};
-static const flex_int16_t yy_accept[98] =
+static const flex_int16_t yy_accept[107] =
     {   0,
-        0,    0,    0,    0,    0,    0,   44,   35,   33,   32,
-       35,   29,   27,   28,   11,   12,   24,   22,   23,   25,
-       30,   30,   34,   19,   21,   18,   31,   26,   31,   31,
-       31,   31,   31,   31,   13,   14,   38,   36,   37,   42,
-       41,   40,   39,    0,    0,   13,   17,    0,   30,   16,
-       20,   15,   31,   31,   31,   31,    2,   31,   31,   13,
-        0,   30,   31,   31,   31,   31,   31,   31,   31,    0,
-        0,   31,   31,   31,    3,    4,   31,   31,    3,    4,
-        5,   31,   31,    0,   31,    1,    6,   31,    4,   31,
-       31,    8,    7,   31,   10,    9,    0
-
+        0,    0,    0,    0,    0,    0,   48,   39,   37,   36,
+       39,   33,   31,   32,   13,   14,   26,   24,   25,   27,
+       34,   34,   38,   21,   23,   20,   35,   29,   30,   28,
+       35,   35,   35,   35,   35,   35,   15,   16,   42,   40,
+       41,   46,   45,   44,   43,    0,    0,   15,   19,    0,
+       34,   37,   18,   22,   17,   35,   35,   35,   35,    2,
+       35,   35,   15,    0,   34,   35,   35,   35,   35,   35,
+       35,   35,   35,   35,    0,    0,   35,   35,   35,    3,
+        4,   11,   35,   35,   35,    3,    4,    5,   35,   35,
+        0,   35,   35,    1,    6,   35,    4,   35,   12,   35,
+
+        8,    7,   35,   10,    9,    0
     } ;
 
 static const YY_CHAR yy_ec[256] =
@@ -386,11 +387,11 @@ static const YY_CHAR yy_ec[256] =
        19,   20,    1,    1,   21,   21,   21,   21,   21,   21,
        21,   21,   21,   21,   21,   21,   21,   21,   21,   21,
        21,   21,   21,   21,   21,   21,   21,   21,   21,   21,
-        1,    1,    1,   22,   21,    1,   23,   24,   25,   26,
+       22,    1,   23,   24,   21,    1,   25,   26,   27,   28,
 
-       27,   28,   21,   29,   30,   21,   31,   32,   21,   33,
-       34,   21,   21,   35,   36,   37,   38,   21,   39,   21,
-       21,   21,   40,    1,   41,    1,    1,    1,    1,    1,
+       29,   30,   31,   32,   33,   21,   34,   35,   21,   36,
+       37,   21,   21,   38,   39,   40,   41,   21,   42,   21,
+       21,   21,   43,    1,   44,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
@@ -407,87 +408,91 @@ static const YY_CHAR yy_ec[256] =
         1,    1,    1,    1,    1
     } ;
 
-static const YY_CHAR yy_meta[42] =
+static const YY_CHAR yy_meta[45] =
     {   0,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    2,    2,    1,    1,    1,    1,
-        2,    1,    2,    2,    2,    2,    2,    2,    2,    2,
-        2,    2,    2,    2,    2,    2,    2,    2,    2,    1,
-        1
+        2,    1,    1,    1,    2,    2,    2,    2,    2,    2,
+        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
+        2,    2,    1,    1
     } ;
 
-static const flex_int16_t yy_base[101] =
+static const flex_int16_t yy_base[110] =
     {   0,
-        0,    0,   40,   41,   43,   47,  122,  123,   42,  123,
-      102,  123,  123,  123,  123,  123,  123,  123,  123,  123,
-      123,   40,  123,  101,  100,   99,    0,  123,   82,   82,
-       83,   86,   86,   83,  109,  123,  123,  123,  123,  123,
-      123,  123,  123,   49,   78,  107,  123,   42,   46,  123,
-      123,  123,    0,   33,   75,   34,    0,   71,   76,  103,
-       35,   57,   81,   72,   65,   73,   73,   62,   66,   69,
-       69,   64,   67,   58,    0,   79,   63,   58,  123,   76,
-        0,   50,   48,   71,   44,    0,    0,   40,  123,   40,
-       48,   47,   42,   40,    0,    0,  123,   89,   91,   61
-
+        0,    0,   43,   44,   46,   50,  132,  133,   45,  133,
+      112,  133,  133,  133,  133,  133,  133,  133,  133,  133,
+      133,   43,  128,  110,  109,  108,    0,  133,  133,  133,
+       88,   88,   89,   93,   93,   89,  118,  133,  133,  133,
+      133,  133,  133,  133,  133,   52,   84,  116,  133,   45,
+       49,  133,  133,  133,  133,    0,   34,   81,   33,    0,
+       36,   83,  113,   37,   53,   89,   79,   72,   81,   81,
+       72,   68,   78,   71,   75,   75,   69,   73,   68,    0,
+       92,    0,   69,   57,   63,  133,   83,    0,   54,   53,
+       78,   48,   45,    0,    0,   43,  133,   43,    0,   53,
+
+       51,   51,   49,    0,    0,  133,   95,   97,   71
     } ;
 
-static const flex_int16_t yy_def[101] =
+static const flex_int16_t yy_def[110] =
     {   0,
-       97,    1,   98,   98,   99,   99,   97,   97,   97,   97,
-       97,   97,   97,   97,   97,   97,   97,   97,   97,   97,
-       97,   97,   97,   97,   97,   97,  100,   97,  100,  100,
-      100,  100,  100,  100,   97,   97,   97,   97,   97,   97,
-       97,   97,   97,   97,   97,   97,   97,   97,   97,   97,
-       97,   97,  100,  100,  100,  100,  100,  100,  100,   97,
-       97,   97,  100,  100,  100,  100,  100,  100,  100,   97,
-       97,  100,  100,  100,  100,  100,  100,  100,   97,   97,
-      100,  100,  100,   97,  100,  100,  100,  100,   97,  100,
-      100,  100,  100,  100,  100,  100,    0,   97,   97,   97
-
+      106,    1,  107,  107,  108,  108,  106,  106,  106,  106,
+      106,  106,  106,  106,  106,  106,  106,  106,  106,  106,
+      106,  106,  106,  106,  106,  106,  109,  106,  106,  106,
+      109,  109,  109,  109,  109,  109,  106,  106,  106,  106,
+      106,  106,  106,  106,  106,  106,  106,  106,  106,  106,
+      106,  106,  106,  106,  106,  109,  109,  109,  109,  109,
+      109,  109,  106,  106,  106,  109,  109,  109,  109,  109,
+      109,  109,  109,  109,  106,  106,  109,  109,  109,  109,
+      109,  109,  109,  109,  109,  106,  106,  109,  109,  109,
+      106,  109,  109,  109,  109,  109,  106,  109,  109,  109,
+
+      109,  109,  109,  109,  109,    0,  106,  106,  106
     } ;
 
-static const flex_int16_t yy_nxt[165] =
+static const flex_int16_t yy_nxt[178] =
     {   0,
         8,    9,   10,   11,   12,   13,   14,   15,   16,   17,
        18,   19,    8,   20,   21,   22,   23,   24,   25,   26,
-       27,   28,   27,   29,   30,   27,   31,   27,   27,   32,
-       27,   27,   27,   27,   33,   27,   27,   27,   34,   35,
-       36,   38,   38,   44,   41,   39,   39,   42,   41,   43,
-       44,   42,   48,   43,   49,   49,   62,   62,   48,   63,
-       49,   49,   53,   66,   70,   96,   64,   95,   45,   67,
-       71,   62,   62,   94,   93,   45,   92,   91,   90,   89,
-       88,   46,   87,   84,   86,   85,   84,   83,   46,   37,
-       37,   40,   40,   82,   81,   80,   79,   78,   77,   76,
-
-       75,   74,   73,   72,   60,   69,   68,   65,   60,   61,
-       60,   59,   58,   57,   56,   55,   54,   52,   51,   50,
-       47,   97,    7,   97,   97,   97,   97,   97,   97,   97,
-       97,   97,   97,   97,   97,   97,   97,   97,   97,   97,
-       97,   97,   97,   97,   97,   97,   97,   97,   97,   97,
-       97,   97,   97,   97,   97,   97,   97,   97,   97,   97,
-       97,   97,   97,   97
+       27,   28,   29,   30,   27,   31,   32,   27,   33,   27,
+       27,   27,   34,   27,   27,   27,   27,   35,   27,   27,
+       27,   36,   37,   38,   40,   40,   46,   43,   41,   41,
+       44,   43,   45,   46,   44,   50,   45,   51,   51,   65,
+       65,   50,   66,   51,   51,   69,   71,   65,   65,   75,
+       67,   70,   56,   47,   72,   76,  105,   73,  104,  103,
+       47,  102,  101,  100,   99,   98,   97,   48,   96,   95,
+       91,   94,   93,   92,   48,   39,   39,   42,   42,   91,
+
+       90,   89,   88,   87,   86,   85,   84,   83,   82,   81,
+       80,   79,   78,   77,   63,   74,   68,   63,   64,   63,
+       62,   61,   60,   59,   58,   57,   55,   54,   53,   52,
+       49,  106,    7,  106,  106,  106,  106,  106,  106,  106,
+      106,  106,  106,  106,  106,  106,  106,  106,  106,  106,
+      106,  106,  106,  106,  106,  106,  106,  106,  106,  106,
+      106,  106,  106,  106,  106,  106,  106,  106,  106,  106,
+      106,  106,  106,  106,  106,  106,  106
     } ;
 
-static const flex_int16_t yy_chk[165] =
+static const flex_int16_t yy_chk[178] =
     {   0,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    3,    4,    9,    5,    3,    4,    5,    6,    5,
-       44,    6,   22,    6,   22,   22,   48,   48,   49,   54,
-       49,   49,  100,   56,   61,   94,   54,   93,    9,   56,
-       61,   62,   62,   92,   91,   44,   90,   88,   85,   84,
-       83,    9,   82,   80,   78,   77,   76,   74,   44,   98,
-       98,   99,   99,   73,   72,   71,   70,   69,   68,   67,
-
-       66,   65,   64,   63,   60,   59,   58,   55,   46,   45,
-       35,   34,   33,   32,   31,   30,   29,   26,   25,   24,
-       11,    7,   97,   97,   97,   97,   97,   97,   97,   97,
-       97,   97,   97,   97,   97,   97,   97,   97,   97,   97,
-       97,   97,   97,   97,   97,   97,   97,   97,   97,   97,
-       97,   97,   97,   97,   97,   97,   97,   97,   97,   97,
-       97,   97,   97,   97
+        1,    1,    1,    1,    3,    4,    9,    5,    3,    4,
+        5,    6,    5,   46,    6,   22,    6,   22,   22,   50,
+       50,   51,   57,   51,   51,   59,   61,   65,   65,   64,
+       57,   59,  109,    9,   61,   64,  103,   61,  102,  101,
+       46,  100,   98,   96,   93,   92,   91,    9,   90,   89,
+       87,   85,   84,   83,   46,  107,  107,  108,  108,   81,
+
+       79,   78,   77,   76,   75,   74,   73,   72,   71,   70,
+       69,   68,   67,   66,   63,   62,   58,   48,   47,   37,
+       36,   35,   34,   33,   32,   31,   26,   25,   24,   23,
+       11,    7,  106,  106,  106,  106,  106,  106,  106,  106,
+      106,  106,  106,  106,  106,  106,  106,  106,  106,  106,
+      106,  106,  106,  106,  106,  106,  106,  106,  106,  106,
+      106,  106,  106,  106,  106,  106,  106,  106,  106,  106,
+      106,  106,  106,  106,  106,  106,  106
     } ;
 
 static yy_state_type yy_last_accepting_state;
@@ -508,9 +513,9 @@ char *yytext;
 #line 2 "gwarf_lex.l"
     #include<stdio.h>
     #include"y.tab.h"
-#line 511 "lex.yy.c"
+#line 516 "lex.yy.c"
 
-#line 513 "lex.yy.c"
+#line 518 "lex.yy.c"
 
 #define INITIAL 0
 #define COMMENT 1
@@ -731,7 +736,7 @@ YY_DECL
 	{
 #line 6 "gwarf_lex.l"
 
-#line 734 "lex.yy.c"
+#line 739 "lex.yy.c"
 
 	while ( /*CONSTCOND*/1 )		/* loops until end-of-file is reached */
 		{
@@ -758,13 +763,13 @@ yy_match:
 			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 				{
 				yy_current_state = (int) yy_def[yy_current_state];
-				if ( yy_current_state >= 98 )
+				if ( yy_current_state >= 107 )
 					yy_c = yy_meta[yy_c];
 				}
 			yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
 			++yy_cp;
 			}
-		while ( yy_base[yy_current_state] != 123 );
+		while ( yy_base[yy_current_state] != 133 );
 
 yy_find_action:
 		yy_act = yy_accept[yy_current_state];
@@ -842,186 +847,206 @@ YY_RULE_SETUP
 	YY_BREAK
 case 11:
 YY_RULE_SETUP
-#line 18 "gwarf_lex.l"
-{return LB;}
+#line 17 "gwarf_lex.l"
+{return REGO;}
 	YY_BREAK
 case 12:
 YY_RULE_SETUP
-#line 19 "gwarf_lex.l"
-{return RB;}
+#line 18 "gwarf_lex.l"
+{return REWENT;}
 	YY_BREAK
 case 13:
-/* rule 13 can match eol */
 YY_RULE_SETUP
-#line 20 "gwarf_lex.l"
-{return LP;}
+#line 21 "gwarf_lex.l"
+{return LB;}
 	YY_BREAK
 case 14:
 YY_RULE_SETUP
-#line 21 "gwarf_lex.l"
-{return RP;}
+#line 22 "gwarf_lex.l"
+{return RB;}
 	YY_BREAK
 case 15:
+/* rule 15 can match eol */
 YY_RULE_SETUP
 #line 23 "gwarf_lex.l"
-{return MOREEQ;}
+{return LP;}
 	YY_BREAK
 case 16:
 YY_RULE_SETUP
 #line 24 "gwarf_lex.l"
-{return LESSEQ;}
+{return RP;}
 	YY_BREAK
 case 17:
 YY_RULE_SETUP
-#line 25 "gwarf_lex.l"
-{return NOTEQ;}
+#line 26 "gwarf_lex.l"
+{return MOREEQ;}
 	YY_BREAK
 case 18:
 YY_RULE_SETUP
-#line 26 "gwarf_lex.l"
-{return MORE;}
+#line 27 "gwarf_lex.l"
+{return LESSEQ;}
 	YY_BREAK
 case 19:
 YY_RULE_SETUP
-#line 27 "gwarf_lex.l"
-{return LESS;}
+#line 28 "gwarf_lex.l"
+{return NOTEQ;}
 	YY_BREAK
 case 20:
 YY_RULE_SETUP
-#line 28 "gwarf_lex.l"
-{return EQUAL;}
+#line 29 "gwarf_lex.l"
+{return MORE;}
 	YY_BREAK
 case 21:
 YY_RULE_SETUP
-#line 29 "gwarf_lex.l"
-{return EQ;}
+#line 30 "gwarf_lex.l"
+{return LESS;}
 	YY_BREAK
 case 22:
 YY_RULE_SETUP
-#line 30 "gwarf_lex.l"
-{return ADD;}
+#line 31 "gwarf_lex.l"
+{return EQUAL;}
 	YY_BREAK
 case 23:
 YY_RULE_SETUP
-#line 31 "gwarf_lex.l"
-{return SUB;}
+#line 32 "gwarf_lex.l"
+{return EQ;}
 	YY_BREAK
 case 24:
 YY_RULE_SETUP
-#line 32 "gwarf_lex.l"
-{return MUL;}
+#line 33 "gwarf_lex.l"
+{return ADD;}
 	YY_BREAK
 case 25:
 YY_RULE_SETUP
-#line 33 "gwarf_lex.l"
-{return DIV;}
+#line 34 "gwarf_lex.l"
+{return SUB;}
 	YY_BREAK
 case 26:
 YY_RULE_SETUP
-#line 34 "gwarf_lex.l"
-{return POW;}
+#line 35 "gwarf_lex.l"
+{return MUL;}
 	YY_BREAK
 case 27:
 YY_RULE_SETUP
 #line 36 "gwarf_lex.l"
-{BEGIN COMMENT;}
+{return DIV;}
 	YY_BREAK
 case 28:
 YY_RULE_SETUP
 #line 37 "gwarf_lex.l"
-{BEGIN STRING_TEXT;}
+{return POW;}
 	YY_BREAK
 case 29:
 YY_RULE_SETUP
 #line 38 "gwarf_lex.l"
-{BEGIN STRING_TEXT;}
+{return LI;}
 	YY_BREAK
 case 30:
 YY_RULE_SETUP
 #line 39 "gwarf_lex.l"
-{
-    yylval.double_value = atof(yytext);
-    return NUMBER;
-    }
+{return RI;}
 	YY_BREAK
 case 31:
 YY_RULE_SETUP
-#line 43 "gwarf_lex.l"
-{
-    yylval.string_value = yytext;
-    return VAR;
-    }
+#line 41 "gwarf_lex.l"
+{BEGIN COMMENT;}
 	YY_BREAK
 case 32:
 YY_RULE_SETUP
-#line 48 "gwarf_lex.l"
-;
+#line 42 "gwarf_lex.l"
+{BEGIN STRING_TEXT;}
 	YY_BREAK
 case 33:
-/* rule 33 can match eol */
 YY_RULE_SETUP
-#line 49 "gwarf_lex.l"
-{return STOP;}
+#line 43 "gwarf_lex.l"
+{BEGIN STRING_TEXT;}
 	YY_BREAK
 case 34:
 YY_RULE_SETUP
-#line 50 "gwarf_lex.l"
-{return STOP;}
+#line 44 "gwarf_lex.l"
+{
+    yylval.double_value = atof(yytext);
+    return NUMBER;
+    }
 	YY_BREAK
 case 35:
 YY_RULE_SETUP
-#line 51 "gwarf_lex.l"
-{printf("text = [%s];\n", yytext);}
+#line 48 "gwarf_lex.l"
+{
+    yylval.string_value = yytext;
+    return VAR;
+    }
 	YY_BREAK
 case 36:
-/* rule 36 can match eol */
 YY_RULE_SETUP
 #line 53 "gwarf_lex.l"
-{BEGIN INITIAL;}
+;
 	YY_BREAK
 case 37:
+/* rule 37 can match eol */
 YY_RULE_SETUP
 #line 54 "gwarf_lex.l"
-{BEGIN INITIAL;}
+{return STOP;}
 	YY_BREAK
 case 38:
 YY_RULE_SETUP
 #line 55 "gwarf_lex.l"
-;
+{return STOP;}
 	YY_BREAK
 case 39:
 YY_RULE_SETUP
-#line 57 "gwarf_lex.l"
-{BEGIN INITIAL;}
+#line 56 "gwarf_lex.l"
+{printf("text = [%s];\n", yytext);}
 	YY_BREAK
 case 40:
+/* rule 40 can match eol */
 YY_RULE_SETUP
 #line 58 "gwarf_lex.l"
 {BEGIN INITIAL;}
 	YY_BREAK
 case 41:
-/* rule 41 can match eol */
 YY_RULE_SETUP
 #line 59 "gwarf_lex.l"
+{BEGIN INITIAL;}
+	YY_BREAK
+case 42:
+YY_RULE_SETUP
+#line 60 "gwarf_lex.l"
+;
+	YY_BREAK
+case 43:
+YY_RULE_SETUP
+#line 62 "gwarf_lex.l"
+{BEGIN INITIAL;}
+	YY_BREAK
+case 44:
+YY_RULE_SETUP
+#line 63 "gwarf_lex.l"
+{BEGIN INITIAL;}
+	YY_BREAK
+case 45:
+/* rule 45 can match eol */
+YY_RULE_SETUP
+#line 64 "gwarf_lex.l"
 {
     yylval.string_value = yytext;
     return STRING;
     }
 	YY_BREAK
-case 42:
+case 46:
 YY_RULE_SETUP
-#line 63 "gwarf_lex.l"
+#line 68 "gwarf_lex.l"
 {
     yylval.string_value = yytext;
     return STRING;
     }
 	YY_BREAK
-case 43:
+case 47:
 YY_RULE_SETUP
-#line 67 "gwarf_lex.l"
+#line 72 "gwarf_lex.l"
 ECHO;
 	YY_BREAK
-#line 1024 "lex.yy.c"
+#line 1049 "lex.yy.c"
 case YY_STATE_EOF(INITIAL):
 case YY_STATE_EOF(COMMENT):
 case YY_STATE_EOF(STRING_TEXT):
@@ -1320,7 +1345,7 @@ static int yy_get_next_buffer (void)
 		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 			{
 			yy_current_state = (int) yy_def[yy_current_state];
-			if ( yy_current_state >= 98 )
+			if ( yy_current_state >= 107 )
 				yy_c = yy_meta[yy_c];
 			}
 		yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
@@ -1348,11 +1373,11 @@ static int yy_get_next_buffer (void)
 	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 		{
 		yy_current_state = (int) yy_def[yy_current_state];
-		if ( yy_current_state >= 98 )
+		if ( yy_current_state >= 107 )
 			yy_c = yy_meta[yy_c];
 		}
 	yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
-	yy_is_jam = (yy_current_state == 97);
+	yy_is_jam = (yy_current_state == 106);
 
 		return yy_is_jam ? 0 : yy_current_state;
 }
@@ -2028,7 +2053,7 @@ void yyfree (void * ptr )
 
 #define YYTABLES_NAME "yytables"
 
-#line 67 "gwarf_lex.l"
+#line 72 "gwarf_lex.l"
 
 int yywrap(void) {
     return 1;

+ 260 - 211
paser/y.tab.c

@@ -150,7 +150,11 @@ extern int yydebug;
     CONTINUE = 284,
     CONTINUED = 285,
     RESTART = 286,
-    RESTARTED = 287
+    RESTARTED = 287,
+    REGO = 288,
+    REWENT = 289,
+    RI = 290,
+    LI = 291
   };
 #endif
 /* Tokens.  */
@@ -184,6 +188,10 @@ extern int yydebug;
 #define CONTINUED 285
 #define RESTART 286
 #define RESTARTED 287
+#define REGO 288
+#define REWENT 289
+#define RI 290
+#define LI 291
 
 /* Value type.  */
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
@@ -197,7 +205,7 @@ union YYSTYPE
     struct statement *statement_value;
     struct if_list *if_list_base;
 
-#line 201 "y.tab.c"
+#line 209 "y.tab.c"
 
 };
 typedef union YYSTYPE YYSTYPE;
@@ -514,21 +522,21 @@ union yyalloc
 #endif /* !YYCOPY_NEEDED */
 
 /* YYFINAL -- State number of the termination state.  */
-#define YYFINAL  42
+#define YYFINAL  50
 /* YYLAST -- Last index in YYTABLE.  */
-#define YYLAST   102
+#define YYLAST   147
 
 /* YYNTOKENS -- Number of terminals.  */
-#define YYNTOKENS  33
+#define YYNTOKENS  37
 /* YYNNTS -- Number of nonterminals.  */
-#define YYNNTS  29
+#define YYNNTS  30
 /* YYNRULES -- Number of rules.  */
-#define YYNRULES  61
+#define YYNRULES  65
 /* YYNSTATES -- Number of states.  */
-#define YYNSTATES  100
+#define YYNSTATES  109
 
 #define YYUNDEFTOK  2
-#define YYMAXUTOK   287
+#define YYMAXUTOK   291
 
 
 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
@@ -568,7 +576,8 @@ static const yytype_int8 yytranslate[] =
        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
-      25,    26,    27,    28,    29,    30,    31,    32
+      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
+      35,    36
 };
 
 #if YYDEBUG
@@ -576,12 +585,12 @@ static const yytype_int8 yytranslate[] =
 static const yytype_int16 yyrline[] =
 {
        0,    23,    23,    27,    34,    41,    51,    55,    59,    63,
-      67,    71,    75,    79,    83,    87,    94,    98,   110,   111,
-     120,   129,   138,   147,   156,   168,   169,   178,   190,   191,
-     200,   212,   213,   214,   221,   232,   244,   249,   258,   264,
-     273,   284,   291,   303,   307,   308,   316,   326,   327,   335,
-     345,   346,   354,   364,   365,   373,   383,   384,   392,   402,
-     403,   410
+      67,    71,    75,    79,    83,    87,    91,    97,   106,   110,
+     122,   123,   132,   141,   150,   159,   168,   180,   181,   190,
+     202,   203,   212,   224,   225,   226,   233,   244,   245,   253,
+     265,   270,   279,   285,   294,   305,   312,   324,   328,   329,
+     337,   347,   348,   356,   366,   367,   375,   385,   386,   394,
+     404,   405,   413,   423,   424,   431
 };
 #endif
 
@@ -594,13 +603,13 @@ static const char *const yytname[] =
   "DIV", "MUL", "EQ", "LESS", "MORE", "RB", "LB", "RP", "LP", "WHILE",
   "STOP", "POW", "EQUAL", "MOREEQ", "LESSEQ", "NOTEQ", "BREAK", "IF",
   "ELSE", "ELIF", "BROKEN", "CONTINUE", "CONTINUED", "RESTART",
-  "RESTARTED", "$accept", "command_block", "command_list", "command",
-  "top_exp", "third_number", "second_number", "first_number", "element",
-  "base_number", "base_var_", "if_block", "elif_exp", "if_exp",
-  "while_block", "while_exp", "block", "restarted_exp", "restarted_token",
-  "restart_exp", "restart_token", "continued_exp", "continued_token",
-  "continue_exp", "continue_token", "break_exp", "break_token",
-  "broken_exp", "broken_token", YY_NULLPTR
+  "RESTARTED", "REGO", "REWENT", "RI", "LI", "$accept", "command_block",
+  "command_list", "command", "top_exp", "third_number", "second_number",
+  "first_number", "element", "base_number", "base_var_", "base_var_token",
+  "if_block", "elif_exp", "if_exp", "while_block", "while_exp", "block",
+  "restarted_exp", "restarted_token", "restart_exp", "restart_token",
+  "continued_exp", "continued_token", "continue_exp", "continue_token",
+  "break_exp", "break_token", "broken_exp", "broken_token", YY_NULLPTR
 };
 #endif
 
@@ -612,11 +621,11 @@ static const yytype_int16 yytoknum[] =
        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
      275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
-     285,   286,   287
+     285,   286,   287,   288,   289,   290,   291
 };
 # endif
 
-#define YYPACT_NINF (-19)
+#define YYPACT_NINF (-28)
 
 #define yypact_value_is_default(Yyn) \
   ((Yyn) == YYPACT_NINF)
@@ -630,16 +639,17 @@ static const yytype_int16 yytoknum[] =
      STATE-NUM.  */
 static const yytype_int8 yypact[] =
 {
-      41,   -19,   -19,    46,    -8,   -19,   -19,    -3,   -19,   -19,
-     -19,   -19,   -19,    15,    41,   -19,     7,     1,     3,    39,
-     -19,   -19,     8,    10,    13,    17,    13,    25,    46,    27,
-      46,    32,    46,    34,    46,    35,    46,    44,    46,    54,
-      46,    46,   -19,   -19,    17,   -19,    46,    46,    46,    46,
-      46,    46,    46,    46,    46,    46,    46,   -19,   -19,    43,
-      13,    41,   -19,   -19,   -19,   -19,   -19,   -19,   -19,   -19,
-     -19,   -19,   -19,   -19,   -19,   -19,   -19,   -19,   -19,    55,
-      61,     3,     3,     3,     3,     3,     3,    39,    39,   -19,
-     -19,   -19,    46,   -19,     2,   -19,   -19,    63,   -19,   -19
+     111,   -28,   -28,     4,    -4,   -28,   -28,    -1,   -28,   -28,
+     -28,   -28,   -28,     3,     7,     4,    16,   111,   -28,     9,
+      27,     5,    11,   -28,   -28,    13,   -28,   -12,    15,    17,
+      15,    18,     4,    19,     4,    23,     4,    33,     4,    36,
+       4,    43,     4,    50,     4,     4,   -28,   -28,    -6,   -28,
+     -28,   -28,    17,   -28,     4,     4,     4,     4,     4,     4,
+       4,     4,     4,     4,     4,   -28,   -28,    51,    15,   111,
+     -28,   -28,   -28,   -28,   -28,   -28,   -28,   -28,   -28,   -28,
+     -28,   -28,   -28,   -28,   -28,   -28,    53,    54,    63,     5,
+       5,     5,     5,     5,     5,    11,    11,   -28,   -28,   -28,
+       4,   -28,    79,   -28,   -28,   -28,    57,   -28,   -28
 };
 
   /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
@@ -647,32 +657,33 @@ static const yytype_int8 yypact[] =
      means the default is an error.  */
 static const yytype_int8 yydefact[] =
 {
-       0,    34,    35,     0,     0,     6,    58,     0,    61,    55,
-      52,    49,    46,     0,     2,     3,     0,    16,    18,    25,
-      28,    31,    32,     0,     0,     5,     0,     0,    44,     0,
-      47,     0,    50,     0,    53,     0,    56,     0,    59,     0,
-       0,     0,     1,     4,     0,     7,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     9,    39,     0,
-       0,     0,    36,     8,    41,    15,    45,    32,    14,    48,
-      13,    51,    12,    54,    10,    57,    11,    60,    33,     0,
-       0,    21,    20,    19,    22,    23,    24,    26,    27,    30,
-      29,    17,     0,    37,     0,    42,    40,     0,    43,    38
+       0,    36,    39,     0,     0,     6,    62,     0,    65,    59,
+      56,    53,    50,     0,     0,     0,     0,     2,     3,     0,
+      18,    20,    27,    30,    33,    34,    37,     0,     0,     5,
+       0,     0,    48,     0,    51,     0,    54,     0,    57,     0,
+      60,     0,    63,     0,     0,     0,    16,    17,     0,    34,
+       1,     4,     0,     7,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     9,    43,     0,     0,     0,
+      40,     8,    45,    15,    49,    14,    52,    13,    55,    12,
+      58,    10,    61,    11,    64,    35,     0,     0,     0,    23,
+      22,    21,    24,    25,    26,    28,    29,    32,    31,    19,
+       0,    41,     0,    46,    44,    38,     0,    47,    42
 };
 
   /* YYPGOTO[NTERM-NUM].  */
 static const yytype_int8 yypgoto[] =
 {
-     -19,   -19,    19,   -12,    -2,   -19,    49,    11,    47,   -19,
-       0,   -19,   -19,   -19,   -10,   -19,   -18,   -19,   -19,   -19,
-     -19,   -19,   -19,   -19,   -19,   -19,   -19,   -19,   -19
+     -28,   -28,     2,   -15,    -2,   -28,     1,   -27,   -10,   -28,
+       0,   -16,   -28,   -28,   -28,   -13,   -28,   -22,   -28,   -28,
+     -28,   -28,   -28,   -28,   -28,   -28,   -28,   -28,   -28,   -28
 };
 
   /* YYDEFGOTO[NTERM-NUM].  */
 static const yytype_int8 yydefgoto[] =
 {
-      -1,    13,    14,    15,    16,    17,    18,    19,    20,    21,
-      67,    23,    60,    24,    25,    26,    62,    27,    28,    29,
-      30,    31,    32,    33,    34,    35,    36,    37,    38
+      -1,    16,    17,    18,    19,    20,    21,    22,    23,    24,
+      49,    26,    27,    68,    28,    29,    30,    70,    31,    32,
+      33,    34,    35,    36,    37,    38,    39,    40,    41,    42
 };
 
   /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
@@ -680,32 +691,40 @@ static const yytype_int8 yydefgoto[] =
      number is the opposite.  If YYTABLE_NINF, syntax error.  */
 static const yytype_int8 yytable[] =
 {
-      22,    39,    43,    22,    44,     1,    40,     2,    64,    52,
-      53,    41,    46,    47,    22,    42,     3,    98,    56,     4,
-       5,    48,    49,    50,    51,    45,     6,     7,    57,    61,
-       8,     9,    10,    11,    12,    63,    58,    59,    79,    80,
-      22,    22,    93,    65,     1,    68,     2,    54,    55,     1,
-      70,     2,    72,    74,    91,     3,    22,    92,     4,     5,
-       3,    22,    76,    87,    88,     6,     7,    78,    95,     8,
-       9,    10,    11,    12,    96,    66,    99,    69,     0,    71,
-      94,    73,    43,    75,    44,    77,     0,     0,     0,     0,
-      97,     0,    22,     0,    22,    81,    82,    83,    84,    85,
-      86,    89,    90
+      25,    43,    51,    25,    52,    48,    65,     1,    72,     2,
+      44,    60,    61,    45,    66,    67,    50,    25,     3,    62,
+      63,    46,    74,    64,    76,    47,    78,    53,    80,    88,
+      82,    69,    84,    95,    96,    71,    73,    75,    54,    55,
+      15,    77,    86,    87,    25,    25,   101,    56,    57,    58,
+      59,    79,    97,    98,    81,    89,    90,    91,    92,    93,
+      94,    83,    99,    85,    25,   100,   103,   104,     2,    25,
+     108,   102,   105,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     1,     0,     2,     0,     0,    51,     0,    52,
+       0,     0,     0,     3,   107,     0,     4,     5,   106,     0,
+      25,     0,    25,     6,     7,     0,     0,     8,     9,    10,
+      11,    12,    13,    14,     1,    15,     2,     0,     0,     0,
+       0,     0,     0,     0,     0,     3,     0,     0,     4,     5,
+       0,     0,     0,     0,     0,     6,     7,     0,     0,     8,
+       9,    10,    11,    12,    13,    14,     0,    15
 };
 
 static const yytype_int8 yycheck[] =
 {
-       0,     3,    14,     3,    14,     3,    14,     5,    26,     6,
-       7,    14,    11,    12,    14,     0,    14,    15,    10,    17,
-      18,    20,    21,    22,    23,    18,    24,    25,    18,    16,
-      28,    29,    30,    31,    32,    18,    26,    27,    40,    41,
-      40,    41,    60,    18,     3,    18,     5,     8,     9,     3,
-      18,     5,    18,    18,    56,    14,    56,    14,    17,    18,
-      14,    61,    18,    52,    53,    24,    25,    13,    13,    28,
-      29,    30,    31,    32,    13,    28,    13,    30,    -1,    32,
-      61,    34,    94,    36,    94,    38,    -1,    -1,    -1,    -1,
-      92,    -1,    92,    -1,    94,    46,    47,    48,    49,    50,
-      51,    54,    55
+       0,     3,    17,     3,    17,    15,    18,     3,    30,     5,
+      14,     6,     7,    14,    26,    27,     0,    17,    14,     8,
+       9,    18,    32,    10,    34,    18,    36,    18,    38,    35,
+      40,    16,    42,    60,    61,    18,    18,    18,    11,    12,
+      36,    18,    44,    45,    44,    45,    68,    20,    21,    22,
+      23,    18,    62,    63,    18,    54,    55,    56,    57,    58,
+      59,    18,    64,    13,    64,    14,    13,    13,     5,    69,
+      13,    69,    88,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,     3,    -1,     5,    -1,    -1,   102,    -1,   102,
+      -1,    -1,    -1,    14,    15,    -1,    17,    18,   100,    -1,
+     100,    -1,   102,    24,    25,    -1,    -1,    28,    29,    30,
+      31,    32,    33,    34,     3,    36,     5,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    14,    -1,    -1,    17,    18,
+      -1,    -1,    -1,    -1,    -1,    24,    25,    -1,    -1,    28,
+      29,    30,    31,    32,    33,    34,    -1,    36
 };
 
   /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
@@ -713,39 +732,40 @@ static const yytype_int8 yycheck[] =
 static const yytype_int8 yystos[] =
 {
        0,     3,     5,    14,    17,    18,    24,    25,    28,    29,
-      30,    31,    32,    34,    35,    36,    37,    38,    39,    40,
-      41,    42,    43,    44,    46,    47,    48,    50,    51,    52,
-      53,    54,    55,    56,    57,    58,    59,    60,    61,    37,
-      14,    14,     0,    36,    47,    18,    11,    12,    20,    21,
-      22,    23,     6,     7,     8,     9,    10,    18,    26,    27,
-      45,    16,    49,    18,    49,    18,    41,    43,    18,    41,
-      18,    41,    18,    41,    18,    41,    18,    41,    13,    37,
-      37,    39,    39,    39,    39,    39,    39,    40,    40,    41,
-      41,    37,    14,    49,    35,    13,    13,    37,    15,    13
+      30,    31,    32,    33,    34,    36,    38,    39,    40,    41,
+      42,    43,    44,    45,    46,    47,    48,    49,    51,    52,
+      53,    55,    56,    57,    58,    59,    60,    61,    62,    63,
+      64,    65,    66,    41,    14,    14,    18,    18,    45,    47,
+       0,    40,    52,    18,    11,    12,    20,    21,    22,    23,
+       6,     7,     8,     9,    10,    18,    26,    27,    50,    16,
+      54,    18,    54,    18,    45,    18,    45,    18,    45,    18,
+      45,    18,    45,    18,    45,    13,    41,    41,    35,    43,
+      43,    43,    43,    43,    43,    44,    44,    45,    45,    41,
+      14,    54,    39,    13,    13,    48,    41,    15,    13
 };
 
   /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
 static const yytype_int8 yyr1[] =
 {
-       0,    33,    34,    35,    35,    35,    36,    36,    36,    36,
-      36,    36,    36,    36,    36,    36,    37,    37,    38,    38,
-      38,    38,    38,    38,    38,    39,    39,    39,    40,    40,
-      40,    41,    41,    41,    42,    43,    44,    44,    45,    45,
-      46,    47,    48,    49,    50,    50,    51,    52,    52,    53,
-      54,    54,    55,    56,    56,    57,    58,    58,    59,    60,
-      60,    61
+       0,    37,    38,    39,    39,    39,    40,    40,    40,    40,
+      40,    40,    40,    40,    40,    40,    40,    40,    41,    41,
+      42,    42,    42,    42,    42,    42,    42,    43,    43,    43,
+      44,    44,    44,    45,    45,    45,    46,    47,    47,    48,
+      49,    49,    50,    50,    51,    52,    53,    54,    55,    55,
+      56,    57,    57,    58,    59,    59,    60,    61,    61,    62,
+      63,    63,    64,    65,    65,    66
 };
 
   /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
 static const yytype_int8 yyr2[] =
 {
        0,     2,     1,     1,     2,     1,     1,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     1,     3,     1,     3,
-       3,     3,     3,     3,     3,     1,     3,     3,     1,     3,
-       3,     1,     1,     3,     1,     1,     2,     3,     4,     1,
-       4,     2,     4,     3,     1,     2,     1,     1,     2,     1,
-       1,     2,     1,     1,     2,     1,     1,     2,     1,     1,
-       2,     1
+       2,     2,     2,     2,     2,     2,     2,     2,     1,     3,
+       1,     3,     3,     3,     3,     3,     3,     1,     3,     3,
+       1,     3,     3,     1,     1,     3,     1,     1,     4,     1,
+       2,     3,     4,     1,     4,     2,     4,     3,     1,     2,
+       1,     1,     2,     1,     1,     2,     1,     1,     2,     1,
+       1,     2,     1,     1,     2,     1
 };
 
 
@@ -1448,7 +1468,7 @@ yyreduce:
             append_statement(tmp, (yyvsp[0].statement_value));
         }
     }
-#line 1452 "y.tab.c"
+#line 1472 "y.tab.c"
     break;
 
   case 4:
@@ -1459,7 +1479,7 @@ yyreduce:
             append_statement(tmp, (yyvsp[0].statement_value));
         }
     }
-#line 1463 "y.tab.c"
+#line 1483 "y.tab.c"
     break;
 
   case 5:
@@ -1470,7 +1490,7 @@ yyreduce:
             append_statement(tmp, (yyvsp[0].statement_value));
         }
     }
-#line 1474 "y.tab.c"
+#line 1494 "y.tab.c"
     break;
 
   case 6:
@@ -1478,7 +1498,7 @@ yyreduce:
     {
         (yyval.statement_value) = NULL;
     }
-#line 1482 "y.tab.c"
+#line 1502 "y.tab.c"
     break;
 
   case 7:
@@ -1486,7 +1506,7 @@ yyreduce:
     {
         (yyval.statement_value) = (yyvsp[-1].statement_value);
     }
-#line 1490 "y.tab.c"
+#line 1510 "y.tab.c"
     break;
 
   case 8:
@@ -1494,7 +1514,7 @@ yyreduce:
     {   
         (yyval.statement_value) = (yyvsp[-1].statement_value);
     }
-#line 1498 "y.tab.c"
+#line 1518 "y.tab.c"
     break;
 
   case 9:
@@ -1502,7 +1522,7 @@ yyreduce:
     {
         (yyval.statement_value) = (yyvsp[-1].statement_value);
     }
-#line 1506 "y.tab.c"
+#line 1526 "y.tab.c"
     break;
 
   case 10:
@@ -1510,7 +1530,7 @@ yyreduce:
     {
         (yyval.statement_value) = (yyvsp[-1].statement_value);
     }
-#line 1514 "y.tab.c"
+#line 1534 "y.tab.c"
     break;
 
   case 11:
@@ -1518,7 +1538,7 @@ yyreduce:
     {
         (yyval.statement_value) = (yyvsp[-1].statement_value);
     }
-#line 1522 "y.tab.c"
+#line 1542 "y.tab.c"
     break;
 
   case 12:
@@ -1526,7 +1546,7 @@ yyreduce:
     {
         (yyval.statement_value) = (yyvsp[-1].statement_value);
     }
-#line 1530 "y.tab.c"
+#line 1550 "y.tab.c"
     break;
 
   case 13:
@@ -1534,7 +1554,7 @@ yyreduce:
     {
         (yyval.statement_value) = (yyvsp[-1].statement_value);
     }
-#line 1538 "y.tab.c"
+#line 1558 "y.tab.c"
     break;
 
   case 14:
@@ -1542,7 +1562,7 @@ yyreduce:
     {
         (yyval.statement_value) = (yyvsp[-1].statement_value);
     }
-#line 1546 "y.tab.c"
+#line 1566 "y.tab.c"
     break;
 
   case 15:
@@ -1550,19 +1570,39 @@ yyreduce:
     {
         (yyval.statement_value) = (yyvsp[-1].statement_value);
     }
-#line 1554 "y.tab.c"
+#line 1574 "y.tab.c"
     break;
 
   case 16:
-#line 95 "gwarf_yacc.y"
+#line 92 "gwarf_yacc.y"
     {
-        (yyval.statement_value) = (yyvsp[0].statement_value);
+        statement *code_tmp =  make_statement();
+        code_tmp->type = rego;
+        (yyval.statement_value) = code_tmp;
     }
-#line 1562 "y.tab.c"
+#line 1584 "y.tab.c"
     break;
 
   case 17:
-#line 99 "gwarf_yacc.y"
+#line 98 "gwarf_yacc.y"
+    {
+        statement *code_tmp =  make_statement();
+        code_tmp->type = rewent;
+        (yyval.statement_value) = code_tmp;
+    }
+#line 1594 "y.tab.c"
+    break;
+
+  case 18:
+#line 107 "gwarf_yacc.y"
+    {
+        (yyval.statement_value) = (yyvsp[0].statement_value);
+    }
+#line 1602 "y.tab.c"
+    break;
+
+  case 19:
+#line 111 "gwarf_yacc.y"
     {
         statement *code_tmp =  make_statement();
         code_tmp->type = operation;
@@ -1571,11 +1611,11 @@ yyreduce:
         code_tmp->code.operation.right_exp = (yyvsp[0].statement_value);
         (yyval.statement_value) = code_tmp;
     }
-#line 1575 "y.tab.c"
+#line 1615 "y.tab.c"
     break;
 
-  case 19:
-#line 112 "gwarf_yacc.y"
+  case 21:
+#line 124 "gwarf_yacc.y"
     {
         statement *code_tmp =  make_statement();
         code_tmp->type = operation;
@@ -1584,11 +1624,11 @@ yyreduce:
         code_tmp->code.operation.right_exp = (yyvsp[0].statement_value);
         (yyval.statement_value) = code_tmp;
     }
-#line 1588 "y.tab.c"
+#line 1628 "y.tab.c"
     break;
 
-  case 20:
-#line 121 "gwarf_yacc.y"
+  case 22:
+#line 133 "gwarf_yacc.y"
     {
         statement *code_tmp =  make_statement();
         code_tmp->type = operation;
@@ -1597,11 +1637,11 @@ yyreduce:
         code_tmp->code.operation.right_exp = (yyvsp[0].statement_value);
         (yyval.statement_value) = code_tmp;
     }
-#line 1601 "y.tab.c"
+#line 1641 "y.tab.c"
     break;
 
-  case 21:
-#line 130 "gwarf_yacc.y"
+  case 23:
+#line 142 "gwarf_yacc.y"
     {
         statement *code_tmp =  make_statement();
         code_tmp->type = operation;
@@ -1610,11 +1650,11 @@ yyreduce:
         code_tmp->code.operation.right_exp = (yyvsp[0].statement_value);
         (yyval.statement_value) = code_tmp;
     }
-#line 1614 "y.tab.c"
+#line 1654 "y.tab.c"
     break;
 
-  case 22:
-#line 139 "gwarf_yacc.y"
+  case 24:
+#line 151 "gwarf_yacc.y"
         {
         statement *code_tmp =  make_statement();
         code_tmp->type = operation;
@@ -1623,11 +1663,11 @@ yyreduce:
         code_tmp->code.operation.right_exp = (yyvsp[0].statement_value);
         (yyval.statement_value) = code_tmp;
     }
-#line 1627 "y.tab.c"
+#line 1667 "y.tab.c"
     break;
 
-  case 23:
-#line 148 "gwarf_yacc.y"
+  case 25:
+#line 160 "gwarf_yacc.y"
     {
         statement *code_tmp =  make_statement();
         code_tmp->type = operation;
@@ -1636,11 +1676,11 @@ yyreduce:
         code_tmp->code.operation.right_exp = (yyvsp[0].statement_value);
         (yyval.statement_value) = code_tmp;
     }
-#line 1640 "y.tab.c"
+#line 1680 "y.tab.c"
     break;
 
-  case 24:
-#line 157 "gwarf_yacc.y"
+  case 26:
+#line 169 "gwarf_yacc.y"
     {
         statement *code_tmp =  make_statement();
         code_tmp->type = operation;
@@ -1649,11 +1689,11 @@ yyreduce:
         code_tmp->code.operation.right_exp = (yyvsp[0].statement_value);
         (yyval.statement_value) = code_tmp;
     }
-#line 1653 "y.tab.c"
+#line 1693 "y.tab.c"
     break;
 
-  case 26:
-#line 170 "gwarf_yacc.y"
+  case 28:
+#line 182 "gwarf_yacc.y"
     {
         statement *code_tmp =  make_statement();
         code_tmp->type = operation;
@@ -1662,11 +1702,11 @@ yyreduce:
         code_tmp->code.operation.right_exp = (yyvsp[0].statement_value);
         (yyval.statement_value) = code_tmp;
     }
-#line 1666 "y.tab.c"
+#line 1706 "y.tab.c"
     break;
 
-  case 27:
-#line 179 "gwarf_yacc.y"
+  case 29:
+#line 191 "gwarf_yacc.y"
     {
         statement *code_tmp =  make_statement();
         code_tmp->type = operation;
@@ -1675,11 +1715,11 @@ yyreduce:
         code_tmp->code.operation.right_exp = (yyvsp[0].statement_value);
         (yyval.statement_value) = code_tmp;
     }
-#line 1679 "y.tab.c"
+#line 1719 "y.tab.c"
     break;
 
-  case 29:
-#line 192 "gwarf_yacc.y"
+  case 31:
+#line 204 "gwarf_yacc.y"
     {
         statement *code_tmp =  make_statement();
         code_tmp->type = operation;
@@ -1688,11 +1728,11 @@ yyreduce:
         code_tmp->code.operation.right_exp = (yyvsp[0].statement_value);
         (yyval.statement_value) = code_tmp;
     }
-#line 1692 "y.tab.c"
+#line 1732 "y.tab.c"
     break;
 
-  case 30:
-#line 201 "gwarf_yacc.y"
+  case 32:
+#line 213 "gwarf_yacc.y"
     {
         statement *code_tmp =  make_statement();
         code_tmp->type = operation;
@@ -1701,19 +1741,19 @@ yyreduce:
         code_tmp->code.operation.right_exp = (yyvsp[0].statement_value);
         (yyval.statement_value) = code_tmp;
     }
-#line 1705 "y.tab.c"
+#line 1745 "y.tab.c"
     break;
 
-  case 33:
-#line 215 "gwarf_yacc.y"
+  case 35:
+#line 227 "gwarf_yacc.y"
     {
         (yyval.statement_value) = (yyvsp[-1].statement_value);
     }
-#line 1713 "y.tab.c"
+#line 1753 "y.tab.c"
     break;
 
-  case 34:
-#line 222 "gwarf_yacc.y"
+  case 36:
+#line 234 "gwarf_yacc.y"
     {
         statement *code_tmp =  make_statement();
         code_tmp->type = base_value;
@@ -1721,11 +1761,20 @@ yyreduce:
         code_tmp->code.base_value.value.value.double_value = (yyvsp[0].double_value);
         (yyval.statement_value) = code_tmp;
     }
-#line 1725 "y.tab.c"
+#line 1765 "y.tab.c"
     break;
 
-  case 35:
-#line 233 "gwarf_yacc.y"
+  case 38:
+#line 246 "gwarf_yacc.y"
+    {
+        (yyvsp[0].statement_value)->code.base_var.from = (yyvsp[-2].statement_value);
+        (yyval.statement_value) = (yyvsp[0].statement_value);
+    }
+#line 1774 "y.tab.c"
+    break;
+
+  case 39:
+#line 254 "gwarf_yacc.y"
     {
         statement *code_tmp =  make_statement();
         code_tmp->code.base_var.var_name = malloc(sizeof((yyvsp[0].string_value)));
@@ -1734,50 +1783,50 @@ yyreduce:
         strcpy(name_tmp, (yyvsp[0].string_value));
         (yyval.statement_value) = code_tmp;
     }
-#line 1738 "y.tab.c"
+#line 1787 "y.tab.c"
     break;
 
-  case 36:
-#line 245 "gwarf_yacc.y"
+  case 40:
+#line 266 "gwarf_yacc.y"
     {
         statement_base = free_statement_list(statement_base);  // new statement_base (FILO)
         (yyval.statement_value) = (yyvsp[-1].statement_value);
     }
-#line 1747 "y.tab.c"
+#line 1796 "y.tab.c"
     break;
 
-  case 37:
-#line 250 "gwarf_yacc.y"
+  case 41:
+#line 271 "gwarf_yacc.y"
     {
         append_elif((yyvsp[-1].if_list_base), (yyvsp[-2].statement_value)->code.if_branch.done);
         (yyval.statement_value) = (yyvsp[-2].statement_value);
         statement_base = free_statement_list(statement_base);  // new statement_base (FILO)
     }
-#line 1757 "y.tab.c"
+#line 1806 "y.tab.c"
     break;
 
-  case 38:
-#line 259 "gwarf_yacc.y"
+  case 42:
+#line 280 "gwarf_yacc.y"
     {
         statement *done_tmp =  make_statement();
         (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)
     }
-#line 1767 "y.tab.c"
+#line 1816 "y.tab.c"
     break;
 
-  case 39:
-#line 265 "gwarf_yacc.y"
+  case 43:
+#line 286 "gwarf_yacc.y"
     {
         statement *done_tmp =  make_statement();
         (yyval.if_list_base) = make_if(NULL, done_tmp);
         statement_base = append_statement_list(done_tmp, statement_base);  // new statement_base (FILO)
     }
-#line 1777 "y.tab.c"
+#line 1826 "y.tab.c"
     break;
 
-  case 40:
-#line 274 "gwarf_yacc.y"
+  case 44:
+#line 295 "gwarf_yacc.y"
     {
         statement *if_tmp =  make_statement(), *done_tmp =  make_statement();
         if_tmp->type = if_branch;
@@ -1785,19 +1834,19 @@ yyreduce:
         statement_base = append_statement_list(done_tmp, statement_base);  // new statement_base (FILO)
         (yyval.statement_value) = if_tmp;
     }
-#line 1789 "y.tab.c"
+#line 1838 "y.tab.c"
     break;
 
-  case 41:
-#line 285 "gwarf_yacc.y"
+  case 45:
+#line 306 "gwarf_yacc.y"
     {
         statement_base = free_statement_list(statement_base);  // new statement_base (FILO)
     }
-#line 1797 "y.tab.c"
+#line 1846 "y.tab.c"
     break;
 
-  case 42:
-#line 292 "gwarf_yacc.y"
+  case 46:
+#line 313 "gwarf_yacc.y"
     {
         statement *while_tmp =  make_statement();
         while_tmp->type = while_cycle;
@@ -1806,131 +1855,131 @@ yyreduce:
         statement_base = append_statement_list(while_tmp->code.while_cycle.done, statement_base);  // new statement_base (FILO)
         (yyval.statement_value) = while_tmp;
     }
-#line 1810 "y.tab.c"
+#line 1859 "y.tab.c"
     break;
 
-  case 45:
-#line 309 "gwarf_yacc.y"
+  case 49:
+#line 330 "gwarf_yacc.y"
     {
         (yyvsp[-1].statement_value)->code.restarted.times = (yyvsp[0].statement_value);
         (yyval.statement_value) = (yyvsp[-1].statement_value);
     }
-#line 1819 "y.tab.c"
+#line 1868 "y.tab.c"
     break;
 
-  case 46:
-#line 317 "gwarf_yacc.y"
+  case 50:
+#line 338 "gwarf_yacc.y"
     {
         statement *code_tmp =  make_statement();
         code_tmp->type = restarted;
         code_tmp->code.restarted.times = NULL;
         (yyval.statement_value) = code_tmp;
     }
-#line 1830 "y.tab.c"
+#line 1879 "y.tab.c"
     break;
 
-  case 48:
-#line 328 "gwarf_yacc.y"
+  case 52:
+#line 349 "gwarf_yacc.y"
     {
         (yyvsp[-1].statement_value)->code.restart.times = (yyvsp[0].statement_value);
         (yyval.statement_value) = (yyvsp[-1].statement_value);
     }
-#line 1839 "y.tab.c"
+#line 1888 "y.tab.c"
     break;
 
-  case 49:
-#line 336 "gwarf_yacc.y"
+  case 53:
+#line 357 "gwarf_yacc.y"
     {
         statement *code_tmp =  make_statement();
         code_tmp->type = restart;
         code_tmp->code.restart.times = NULL;
         (yyval.statement_value) = code_tmp;
     }
-#line 1850 "y.tab.c"
+#line 1899 "y.tab.c"
     break;
 
-  case 51:
-#line 347 "gwarf_yacc.y"
+  case 55:
+#line 368 "gwarf_yacc.y"
     {
         (yyvsp[-1].statement_value)->code.continued.times = (yyvsp[0].statement_value);
         (yyval.statement_value) = (yyvsp[-1].statement_value);
     }
-#line 1859 "y.tab.c"
+#line 1908 "y.tab.c"
     break;
 
-  case 52:
-#line 355 "gwarf_yacc.y"
+  case 56:
+#line 376 "gwarf_yacc.y"
     {
         statement *code_tmp =  make_statement();
         code_tmp->type = continued;
         code_tmp->code.continued.times = NULL;
         (yyval.statement_value) = code_tmp;
     }
-#line 1870 "y.tab.c"
+#line 1919 "y.tab.c"
     break;
 
-  case 54:
-#line 366 "gwarf_yacc.y"
+  case 58:
+#line 387 "gwarf_yacc.y"
     {
         (yyvsp[-1].statement_value)->code.continue_cycle.times = (yyvsp[0].statement_value);
         (yyval.statement_value) = (yyvsp[-1].statement_value);
     }
-#line 1879 "y.tab.c"
+#line 1928 "y.tab.c"
     break;
 
-  case 55:
-#line 374 "gwarf_yacc.y"
+  case 59:
+#line 395 "gwarf_yacc.y"
     {
         statement *code_tmp =  make_statement();
         code_tmp->type = continue_cycle;
         code_tmp->code.continue_cycle.times = NULL;
         (yyval.statement_value) = code_tmp;
     }
-#line 1890 "y.tab.c"
+#line 1939 "y.tab.c"
     break;
 
-  case 57:
-#line 385 "gwarf_yacc.y"
+  case 61:
+#line 406 "gwarf_yacc.y"
     {
         (yyvsp[-1].statement_value)->code.break_cycle.times = (yyvsp[0].statement_value);
         (yyval.statement_value) = (yyvsp[-1].statement_value);
     }
-#line 1899 "y.tab.c"
+#line 1948 "y.tab.c"
     break;
 
-  case 58:
-#line 393 "gwarf_yacc.y"
+  case 62:
+#line 414 "gwarf_yacc.y"
     {
         statement *code_tmp =  make_statement();
         code_tmp->type = break_cycle;
         code_tmp->code.break_cycle.times = NULL;
         (yyval.statement_value) = code_tmp;
     }
-#line 1910 "y.tab.c"
+#line 1959 "y.tab.c"
     break;
 
-  case 60:
-#line 404 "gwarf_yacc.y"
+  case 64:
+#line 425 "gwarf_yacc.y"
     {
         (yyvsp[-1].statement_value)->code.broken.times = (yyvsp[0].statement_value);
         (yyval.statement_value) = (yyvsp[-1].statement_value);
     }
-#line 1919 "y.tab.c"
+#line 1968 "y.tab.c"
     break;
 
-  case 61:
-#line 411 "gwarf_yacc.y"
+  case 65:
+#line 432 "gwarf_yacc.y"
     {
         statement *code_tmp =  make_statement();
         code_tmp->type = broken;
         code_tmp->code.broken.times = NULL;
         (yyval.statement_value) = code_tmp;
     }
-#line 1930 "y.tab.c"
+#line 1979 "y.tab.c"
     break;
 
 
-#line 1934 "y.tab.c"
+#line 1983 "y.tab.c"
 
       default: break;
     }
@@ -2162,7 +2211,7 @@ yyreturn:
 #endif
   return yyresult;
 }
-#line 419 "gwarf_yacc.y"
+#line 440 "gwarf_yacc.y"
 
 int yyerror(char const *str)
 {

+ 10 - 2
paser/y.tab.h

@@ -78,7 +78,11 @@ extern int yydebug;
     CONTINUE = 284,
     CONTINUED = 285,
     RESTART = 286,
-    RESTARTED = 287
+    RESTARTED = 287,
+    REGO = 288,
+    REWENT = 289,
+    RI = 290,
+    LI = 291
   };
 #endif
 /* Tokens.  */
@@ -112,6 +116,10 @@ extern int yydebug;
 #define CONTINUED 285
 #define RESTART 286
 #define RESTARTED 287
+#define REGO 288
+#define REWENT 289
+#define RI 290
+#define LI 291
 
 /* Value type.  */
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
@@ -125,7 +133,7 @@ union YYSTYPE
     struct statement *statement_value;
     struct if_list *if_list_base;
 
-#line 129 "y.tab.h"
+#line 137 "y.tab.h"
 
 };
 typedef union YYSTYPE YYSTYPE;