diff --git a/ast.h b/ast.h index 52f0d8c..dda9a7a 100644 --- a/ast.h +++ b/ast.h @@ -3,6 +3,8 @@ #include "sol.h" +#include + struct tag_expr_node; typedef struct tag_expr_node expr_node; @@ -13,7 +15,7 @@ typedef enum {LIT_INT, LIT_FLOAT, LIT_STRING} lit_t; typedef struct { lit_t type; union { - int ival; + long ival; double fval; char *str; }; @@ -126,12 +128,16 @@ typedef struct { stmt_node *loop; } iter_node; +typedef struct { + expr_node *ret; +} ret_node; + typedef struct tag_stmtlist_node { stmt_node *stmt; struct tag_stmtlist_node *next; } stmtlist_node; -typedef enum {ST_EXPR, ST_IFELSE, ST_LOOP, ST_ITER, ST_LIST} stmt_t; +typedef enum {ST_EXPR, ST_IFELSE, ST_LOOP, ST_ITER, ST_LIST, ST_RET, ST_CONT, ST_BREAK} stmt_t; typedef struct tag_stmt_node { stmt_t type; union { @@ -140,6 +146,7 @@ typedef struct tag_stmt_node { loop_node *loop; iter_node *iter; stmtlist_node *stmtlist; + ret_node *ret; }; } stmt_node; @@ -168,7 +175,24 @@ typedef struct tag_stmt_node { nd->binop->left->index->expr = obj; \ nd->binop->left->index->index = idx; \ nd->binop->right = val +#define BOOL_TO_INT(cond) ((cond)?1:0) sol_object_t *sol_new_func(sol_state_t *, identlist_node *, stmt_node *); -#endif \ No newline at end of file +// runtime.c + +stmt_node *sol_compile(const char *); +stmt_node *sol_compile_file(FILE *); +expr_node *sol_comp_as_expr(stmt_node *); +void sol_compile_free(stmt_node *); + +void st_free(stmt_node *); +void ex_free(expr_node *); + +void st_print(stmt_node *); +void ex_print(expr_node *); + +sol_object_t *sol_eval(sol_state_t *, expr_node *); +void sol_exec(sol_state_t *, stmt_node *); + +#endif diff --git a/astprint b/astprint deleted file mode 100755 index 4c5cd4a..0000000 Binary files a/astprint and /dev/null differ diff --git a/astprint.c b/astprint.c index 234b6f2..25e3e65 100644 --- a/astprint.c +++ b/astprint.c @@ -7,7 +7,7 @@ void prlev(int lev, const char *fmt, ...) { va_list vl; int i; - + for(i = 0; i < lev; i++) putchar(' '); va_start(vl, fmt); vprintf(fmt, vl); @@ -27,7 +27,7 @@ void prst(stmt_node *node, int lev) { prlev(lev, "Stmt:"); prex(node->expr, lev+1); break; - + case ST_IFELSE: prlev(lev, "Stmt:"); lev++; @@ -38,7 +38,7 @@ void prst(stmt_node *node, int lev) { prlev(lev, "IfFalse:"); prst(node->ifelse->iffalse, lev+1); break; - + case ST_LOOP: prlev(lev, "Stmt:"); lev++; @@ -47,7 +47,7 @@ void prst(stmt_node *node, int lev) { prlev(lev, "Loop:"); prst(node->loop->loop, lev+1); break; - + case ST_ITER: prlev(lev, "Stmt:"); lev++; @@ -57,7 +57,7 @@ void prst(stmt_node *node, int lev) { prlev(lev, "Loop:"); prst(node->iter->loop, lev+1); break; - + case ST_LIST: prlev(lev, "Stmt:"); stmtlist_node *cur = node->stmtlist; @@ -66,6 +66,19 @@ void prst(stmt_node *node, int lev) { cur = cur->next; } break; + + case ST_RET: + prlev(lev, "Stmt:"); + prex(node->ret->ret, lev+1); + break; + + case ST_CONT: + prlev(lev, "Stmt"); + break; + + case ST_BREAK: + prlev(lev, "Stmt"); + break; } } @@ -85,17 +98,17 @@ void prex(expr_node *node, int lev) { case LIT_INT: prlev(lev, "Int: %ld", node->lit->ival); break; - + case LIT_FLOAT: prlev(lev, "Float: %f", node->lit->fval); break; - + case LIT_STRING: prlev(lev, "String: %s", node->lit->str); break; } break; - + case EX_LISTGEN: prlev(lev, "ListGen:"); cure = node->listgen->list; @@ -104,7 +117,7 @@ void prex(expr_node *node, int lev) { cure = cure->next; } break; - + case EX_MAPGEN: prlev(lev, "MapGen:"); lev++; @@ -117,7 +130,7 @@ void prex(expr_node *node, int lev) { cura = cura->next; } break; - + case EX_BINOP: prlev(lev, "BinOp:"); lev++; @@ -125,59 +138,59 @@ void prex(expr_node *node, int lev) { case OP_ADD: prlev(lev, "Op: +"); break; - + case OP_SUB: prlev(lev, "Op: -"); break; - + case OP_MUL: prlev(lev, "Op: *"); break; - + case OP_DIV: prlev(lev, "Op: /"); break; - + case OP_POW: prlev(lev, "Op: **"); break; - + case OP_BAND: prlev(lev, "Op: &"); break; - + case OP_BOR: prlev(lev, "Op: |"); break; - + case OP_BXOR: prlev(lev, "Op: ^"); break; - + case OP_LAND: prlev(lev, "Op: &&"); break; - + case OP_LOR: prlev(lev, "Op: ||"); break; - + case OP_EQUAL: prlev(lev, "Op: =="); break; - + case OP_LESS: prlev(lev, "Op: <"); break; - + case OP_GREATER: prlev(lev, "Op: >"); break; - + case OP_LESSEQ: prlev(lev, "Op: <="); break; - + case OP_GREATEREQ: prlev(lev, "Op: >="); break; @@ -187,7 +200,7 @@ void prex(expr_node *node, int lev) { prlev(lev, "Right:"); prex(node->binop->right, lev+1); break; - + case EX_UNOP: prlev(lev, "UnOp:"); lev++; @@ -195,11 +208,11 @@ void prex(expr_node *node, int lev) { case OP_NEG: prlev(lev, "Op: -"); break; - + case OP_BNOT: prlev(lev, "Op: ~"); break; - + case OP_LNOT: prlev(lev, "Op: !"); break; @@ -207,7 +220,7 @@ void prex(expr_node *node, int lev) { prlev(lev, "Expr:"); prex(node->unop->expr, lev+1); break; - + case EX_INDEX: prlev(lev, "Index:"); lev++; @@ -216,7 +229,7 @@ void prex(expr_node *node, int lev) { prlev(lev, "Index:"); prex(node->index->index, lev+1); break; - + case EX_SETINDEX: prlev(lev, "SetIndex:"); lev++; @@ -227,7 +240,7 @@ void prex(expr_node *node, int lev) { prlev(lev, "Value:"); prex(node->setindex->value, lev+1); break; - + case EX_ASSIGN: prlev(lev, "Assign:"); lev++; @@ -235,11 +248,11 @@ void prex(expr_node *node, int lev) { prlev(lev, "Value:"); prex(node->assign->value, lev+1); break; - + case EX_REF: prlev(lev, "Ref: %s", node->ref->ident); break; - + case EX_CALL: prlev(lev, "Call:"); lev++; @@ -252,7 +265,7 @@ void prex(expr_node *node, int lev) { cure = cure->next; } break; - + case EX_FUNCDECL: prlev(lev, "FuncDecl:"); lev++; @@ -269,19 +282,27 @@ void prex(expr_node *node, int lev) { } } -int main(int argc, char **argv) { +void st_print(stmt_node *stmt) { + prst(stmt, 0); +} + +void ex_print(expr_node *expr) { + prex(expr, 0); +} + +/*int main(int argc, char **argv) { stmt_node *program = NULL; - + if(argc>1) yydebug = 1; - + if(yyparse(&program)) { printf("Syntax error (somewhere)\n"); printf("Partial tree:\n"); prst(program, 0); return 1; } - + prst(program, 0); return 0; -} +}*/ diff --git a/builtins.c b/builtins.c index 7b0e228..47a79c5 100644 --- a/builtins.c +++ b/builtins.c @@ -1,19 +1,21 @@ #include #include +#include +#include #include "sol.h" -// This is supposedly a C99 trick. +// XXX hardcoded buffer sizes static char *_itoa(int i) { - int n = sprintf(NULL, "%d", i) + 1; - char *s = malloc(n) + int n = 33; + char *s = malloc(n); snprintf(s, n, "%d", i); return s; } static char *_ftoa(double f) { - int n = sprintf(NULL, "%f", f) + 1; - char *s = malloc(n) + int n = 65; + char *s = malloc(n); snprintf(s, n, "%f", f); return s; } @@ -22,8 +24,17 @@ sol_object_t *sol_f_not_impl(sol_state_t *state, sol_object_t *args) { return sol_set_error_string(state, "Undefined method"); } -sol_object_t *sol_f_no_op(sol_state_t *state, sol_object *args) { - return sol_incref(state->None); +sol_object_t *sol_f_default_cmp(sol_state_t *state, sol_object_t *args) { + sol_object_t *a = sol_list_get_index(state, args, 0), *b = sol_list_get_index(state, args, 1); + sol_object_t *res = sol_new_int(state, a!=b); + sol_obj_free(a); + sol_obj_free(b); + return res; +} + +sol_object_t *sol_f_no_op(sol_state_t *state, sol_object_t *args) { + if(state) return sol_incref(state->None); + return NULL; } sol_object_t *sol_f_toint(sol_state_t *state, sol_object_t *args) { @@ -48,7 +59,7 @@ sol_object_t *sol_f_tostring(sol_state_t *state, sol_object_t *args) { } sol_object_t *sol_f_try(sol_state_t *state, sol_object_t *args) { - sol_object_t *func = sol_list_get_index(state, args, 0), fargs = sol_list_sublist(state, args, 1); + sol_object_t *func = sol_list_get_index(state, args, 0), *fargs = sol_list_sublist(state, args, 1); sol_object_t *ls = sol_new_list(state), *one = sol_new_int(state, 1); sol_object_t *res = func->ops->call(state, fargs); sol_obj_free(func); @@ -56,22 +67,103 @@ sol_object_t *sol_f_try(sol_state_t *state, sol_object_t *args) { if(sol_has_error(state)) { sol_object_t *err = sol_get_error(state); sol_object_t *zero = sol_new_int(state, 0); - sol_object_free(res); - sol_object_free(one); + sol_obj_free(res); + sol_obj_free(one); sol_clear_error(state); - sol_list_insert(state, ls, 0, err); + sol_list_insert(state, &ls, 0, err); sol_obj_free(err); - sol_list_insert(state, ls, 0, zero); + sol_list_insert(state, &ls, 0, zero); sol_obj_free(zero); return ls; } - sol_list_insert(state, ls, 0, res); + sol_list_insert(state, &ls, 0, res); sol_obj_free(res); - sol_list_insert(state, ls, 0, one); + sol_list_insert(state, &ls, 0, one); sol_obj_free(one); return ls; } +static char *sol_TypeNames[] = {"singlet", "integer", "float", "string", "list", "map", "function", "cfunction", "cdata"}; + +sol_object_t *sol_f_type(sol_state_t *state, sol_object_t *args) { + sol_object_t *obj = sol_list_get_index(state, args, 0); + sol_object_t *res = sol_new_string(state, sol_TypeNames[obj->type]); + sol_obj_free(obj); + return res; +} + +void ob_print(sol_object_t *obj) { + sol_object_t *cur; + switch(obj->type) { + case SOL_SINGLET: + printf(""); + break; + + case SOL_INTEGER: + printf("%ld", obj->ival); + break; + + case SOL_FLOAT: + printf("%f", obj->fval); + break; + + case SOL_STRING: + printf("\"%s\"", obj->str); + break; + + case SOL_LIST: + printf("["); + cur = obj; + while(cur) { + if(cur->lvalue) { + ob_print(cur->lvalue); + } + if(cur->lnext) { + printf(", "); + } + cur = cur->lnext; + } + printf("]"); + break; + + case SOL_MAP: + printf("{"); + cur = obj; + while(cur) { + if(cur->mkey) { + printf("["); + ob_print(cur->mkey); + printf("] = "); + ob_print(cur->mval); + } + if(cur->mnext) printf(", "); + cur = cur->mnext; + } + printf("}"); + break; + + case SOL_FUNCTION: + printf(""); + break; + + case SOL_CFUNCTION: + printf(""); + break; + + case SOL_CDATA: + printf(""); + break; + } +} + +sol_object_t *sol_f_prepr(sol_state_t *state, sol_object_t *args) { + sol_object_t *obj = sol_list_get_index(state, args, 0); + ob_print(obj); + printf("\n"); + sol_obj_free(obj); + return sol_incref(state->None); +} + sol_object_t *sol_f_int_add(sol_state_t *state, sol_object_t *args) { sol_object_t *a = sol_list_get_index(state, args, 0), *b = sol_cast_int(state, sol_list_get_index(state, args, 1)); sol_object_t *res = sol_new_int(state, a->ival + b->ival); @@ -108,6 +200,15 @@ sol_object_t *sol_f_int_div(sol_state_t *state, sol_object_t *args) { return res; } +sol_object_t *sol_f_int_pow(sol_state_t *state, sol_object_t *args) { + sol_object_t *a = sol_list_get_index(state, args, 0), *b = sol_cast_int(state, sol_list_get_index(state, args, 1)); + sol_object_t *res = sol_new_int(state, (long) pow((double) a->ival, b->ival)); + sol_obj_free(a); + sol_obj_free(b); + if(sol_has_error(state)) {sol_obj_free(res); return sol_incref(state->None);} + return res; +} + sol_object_t *sol_f_int_band(sol_state_t *state, sol_object_t *args) { sol_object_t *a = sol_list_get_index(state, args, 0), *b = sol_cast_int(state, sol_list_get_index(state, args, 1)); sol_object_t *res = sol_new_int(state, a->ival & b->ival); @@ -118,7 +219,7 @@ sol_object_t *sol_f_int_band(sol_state_t *state, sol_object_t *args) { } sol_object_t *sol_f_int_bor(sol_state_t *state, sol_object_t *args) { - sol_object_t *a = sol_list_get_index(state, args, 0), *b = sol_cast_int(state, sol_list_get_index(state, args, 1))); + sol_object_t *a = sol_list_get_index(state, args, 0), *b = sol_cast_int(state, sol_list_get_index(state, args, 1)); sol_object_t *res = sol_new_int(state, a->ival | b->ival); sol_obj_free(a); sol_obj_free(b); @@ -142,6 +243,14 @@ sol_object_t *sol_f_int_bnot(sol_state_t *state, sol_object_t *args) { return res; } +sol_object_t *sol_f_int_cmp(sol_state_t *state, sol_object_t *args) { + sol_object_t *a = sol_list_get_index(state, args, 0), *b = sol_cast_int(state, sol_list_get_index(state, args, 1)); + sol_object_t *res = sol_new_int(state, a->ival==b->ival? 0 : (a->ivalival? -1 : 1)); + sol_obj_free(a); + sol_obj_free(b); + return res; +} + sol_object_t *sol_f_int_toint(sol_state_t *state, sol_object_t *args) { return sol_list_get_index(state, args, 0); } @@ -181,7 +290,7 @@ sol_object_t *sol_f_float_sub(sol_state_t *state, sol_object_t *args) { } sol_object_t *sol_f_float_mul(sol_state_t *state, sol_object_t *args) { - sol_object_t *a = sol_list_get_index(state, args, 0), *b = sol_cast_float(state, sol_list_get_index(state, args, 1))); + sol_object_t *a = sol_list_get_index(state, args, 0), *b = sol_cast_float(state, sol_list_get_index(state, args, 1)); sol_object_t *res = sol_new_float(state, a->fval * b->fval); sol_obj_free(a); sol_obj_free(b); @@ -198,6 +307,23 @@ sol_object_t *sol_f_float_div(sol_state_t *state, sol_object_t *args) { return res; } +sol_object_t *sol_f_float_pow(sol_state_t *state, sol_object_t *args) { + sol_object_t *a = sol_list_get_index(state, args, 0), *b = sol_cast_float(state, sol_list_get_index(state, args, 1)); + sol_object_t *res = sol_new_float(state, pow(a->fval, b->fval)); + sol_obj_free(a); + sol_obj_free(b); + if(sol_has_error(state)) {sol_obj_free(res); return sol_incref(state->None);} + return res; +} + +sol_object_t *sol_f_float_cmp(sol_state_t *state, sol_object_t *args) { + sol_object_t *a = sol_list_get_index(state, args, 0), *b = sol_cast_float(state, sol_list_get_index(state, args, 1)); + sol_object_t *res = sol_new_int(state, a->fval==b->fval? 0 : (a->fvalfval? -1 : 1)); + sol_obj_free(a); + sol_obj_free(b); + return res; +} + sol_object_t *sol_f_float_toint(sol_state_t *state, sol_object_t *args) { sol_object_t *a = sol_list_get_index(state, args, 0); sol_object_t *res = sol_new_int(state, (int) a->fval); @@ -206,7 +332,7 @@ sol_object_t *sol_f_float_toint(sol_state_t *state, sol_object_t *args) { } sol_object_t *sol_f_float_tofloat(sol_state_t *state, sol_object_t *args) { - return sol_list_get_index(state, args, 0) + return sol_list_get_index(state, args, 0); } sol_object_t *sol_f_float_tostring(sol_state_t *state, sol_object_t *args) { @@ -219,10 +345,10 @@ sol_object_t *sol_f_float_tostring(sol_state_t *state, sol_object_t *args) { } sol_object_t *sol_f_str_add(sol_state_t *state, sol_object_t *args) { - sol_object_t *a = sol_list_get_index(state, args, 0), *b = sol_cast_string(state, sol_list_get_index(state, args, 1))); + sol_object_t *a = sol_list_get_index(state, args, 0), *b = sol_cast_string(state, sol_list_get_index(state, args, 1)); int n = strlen(a->str) + strlen(b->str) + 1; char *s = malloc(n); - sol_object_t *res = sol_new_string(state, strncat(strncpy(s, n, a->str), n, b->str)); + sol_object_t *res = sol_new_string(state, strncat(strncpy(s, a->str, n), b->str, n)); sol_obj_free(a); sol_obj_free(b); free(s); @@ -236,7 +362,7 @@ sol_object_t *sol_f_str_mul(sol_state_t *state, sol_object_t *args) { char *s = malloc(n); int i; s[0]='\0'; - for(i = 0; i < b->ival; i++) strncat(s, n, a->str); + for(i = 0; i < b->ival; i++) strncat(s, a->str, n); sol_object_t *res = sol_new_string(state, s); sol_obj_free(a); sol_obj_free(b); @@ -245,29 +371,37 @@ sol_object_t *sol_f_str_mul(sol_state_t *state, sol_object_t *args) { return res; } +sol_object_t *sol_f_str_cmp(sol_state_t *state, sol_object_t *args) { + sol_object_t *a = sol_list_get_index(state, args, 0), *b = sol_cast_string(state, sol_list_get_index(state, args, 1)); + sol_object_t *res = sol_new_int(state, strcmp(a->str, b->str)); + sol_obj_free(a); + sol_obj_free(b); + return res; +} + sol_object_t *sol_f_str_len(sol_state_t *state, sol_object_t *args) { sol_object_t *a = sol_list_get_index(state, args, 0); - sol_object_t *ret = sol_new_int(state, strlen(a->str)); + sol_object_t *res = sol_new_int(state, strlen(a->str)); sol_obj_free(a); return res; } sol_object_t *sol_f_str_toint(sol_state_t *state, sol_object_t *args) { sol_object_t *a = sol_list_get_index(state, args, 0); - sol_object_t *ret = sol_new_int(state, atoi(a->str)); + sol_object_t *res = sol_new_int(state, atoi(a->str)); sol_obj_free(a); return res; } sol_object_t *sol_f_str_tofloat(sol_state_t *state, sol_object_t *args) { sol_object_t *a = sol_list_get_index(state, args, 0); - sol_object_t *ret = sol_new_float(state, atof(a->str)); + sol_object_t *res = sol_new_float(state, atof(a->str)); sol_obj_free(a); return res; } sol_object_t *sol_f_str_tostring(sol_state_t *state, sol_object_t *args) { - return sol_list_get_index(state, args, 0) + return sol_list_get_index(state, args, 0); } sol_object_t *sol_f_list_add(sol_state_t *state, sol_object_t *args) { @@ -314,7 +448,7 @@ sol_object_t *sol_f_list_index(sol_state_t *state, sol_object_t *args) { sol_object_t *sol_f_list_setindex(sol_state_t *state, sol_object_t *args) { sol_object_t *ls = sol_list_get_index(state, args, 0), *b = sol_cast_int(state, sol_list_get_index(state, args ,1)); - sol_objcet_t *val = sol_list_get_index(state, args, 2); + sol_object_t *val = sol_list_get_index(state, args, 2); sol_list_set_index(state, ls, b->ival, val); sol_obj_free(ls); sol_obj_free(b); @@ -349,7 +483,7 @@ sol_object_t *sol_f_map_add(sol_state_t *state, sol_object_t *args) { sol_object_t *sol_f_map_index(sol_state_t *state, sol_object_t *args) { sol_object_t *map = sol_list_get_index(state, args, 0), *b = sol_list_get_index(state, args, 1); - sel_object_t *res = sol_map_get(state, map, b); + sol_object_t *res = sol_map_get(state, map, b); sol_obj_free(map); sol_obj_free(b); return res; @@ -366,7 +500,7 @@ sol_object_t *sol_f_map_setindex(sol_state_t *state, sol_object_t *args) { } sol_object_t *sol_f_map_len(sol_state_t *state, sol_object_t *args) { - sol_object_t *map = sol_list_get_index(sate, args, 0); + sol_object_t *map = sol_list_get_index(state, args, 0); sol_object_t *res = sol_new_int(state, sol_map_len(state, map)); sol_obj_free(map); return res; diff --git a/lex.yy.c b/lex.yy.c index 5d0d219..8db9870 100644 --- a/lex.yy.c +++ b/lex.yy.c @@ -8,7 +8,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_SUBMINOR_VERSION 39 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -161,7 +161,12 @@ typedef unsigned int flex_uint32_t; typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif -extern int yyleng; +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +extern yy_size_t yyleng; extern FILE *yyin, *yyout; @@ -170,6 +175,7 @@ extern FILE *yyin, *yyout; #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ @@ -187,11 +193,6 @@ extern FILE *yyin, *yyout; #define unput(c) yyunput( c, (yytext_ptr) ) -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -209,7 +210,7 @@ struct yy_buffer_state /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - int yy_n_chars; + yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -279,8 +280,8 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; -static int yy_n_chars; /* number of characters read into yy_ch_buf */ -int yyleng; +static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ +yy_size_t yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; @@ -308,7 +309,7 @@ static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); +YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); void *yyalloc (yy_size_t ); void *yyrealloc (void *,yy_size_t ); @@ -368,8 +369,8 @@ static void yy_fatal_error (yyconst char msg[] ); *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 52 -#define YY_END_OF_BUFFER 53 +#define YY_NUM_RULES 55 +#define YY_END_OF_BUFFER 56 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -377,17 +378,19 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[82] = +static yyconst flex_int16_t yy_accept[101] = { 0, - 0, 0, 53, 52, 51, 24, 52, 52, 18, 43, - 44, 15, 13, 48, 14, 45, 16, 2, 46, 47, - 35, 25, 36, 49, 41, 42, 20, 49, 49, 49, - 49, 49, 49, 39, 19, 40, 21, 51, 0, 3, - 0, 50, 22, 31, 17, 28, 26, 27, 29, 1, - 2, 37, 34, 38, 49, 33, 10, 49, 49, 49, - 49, 4, 9, 49, 49, 32, 23, 30, 1, 49, - 12, 8, 49, 49, 49, 6, 11, 5, 49, 7, - 0 + 0, 0, 56, 55, 54, 27, 55, 55, 21, 46, + 47, 18, 16, 51, 17, 48, 19, 2, 49, 50, + 38, 28, 39, 52, 44, 45, 23, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 42, 22, 43, 24, + 54, 0, 3, 0, 53, 25, 34, 20, 31, 29, + 30, 32, 1, 2, 40, 37, 41, 52, 36, 52, + 52, 10, 52, 52, 52, 52, 4, 9, 52, 52, + 52, 35, 26, 33, 1, 52, 52, 52, 15, 8, + 52, 52, 52, 52, 52, 52, 6, 11, 52, 5, + 52, 13, 52, 52, 7, 52, 12, 52, 14, 0 + } ; static yyconst flex_int32_t yy_ec[256] = @@ -401,11 +404,11 @@ static yyconst flex_int32_t yy_ec[256] = 20, 21, 1, 1, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 23, 1, 24, 25, 22, 1, 22, 22, 26, 27, + 23, 1, 24, 25, 22, 1, 26, 27, 28, 29, - 28, 29, 22, 30, 31, 22, 22, 32, 22, 33, - 34, 22, 22, 35, 36, 37, 38, 22, 39, 22, - 22, 22, 40, 41, 42, 43, 1, 1, 1, 1, + 30, 31, 22, 32, 33, 22, 34, 35, 22, 36, + 37, 22, 22, 38, 39, 40, 41, 22, 42, 22, + 22, 22, 43, 44, 45, 46, 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, @@ -422,79 +425,89 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[44] = +static yyconst flex_int32_t yy_meta[47] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, - 1, 1, 1 + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 1, 1, 1, 1 } ; -static yyconst flex_int16_t yy_base[85] = +static yyconst flex_int16_t yy_base[104] = { 0, - 0, 0, 97, 98, 42, 98, 91, 92, 39, 98, - 98, 37, 74, 98, 73, 98, 72, 34, 98, 98, - 71, 70, 69, 0, 98, 98, 68, 53, 19, 15, - 25, 56, 55, 98, 35, 98, 98, 58, 79, 98, - 80, 98, 98, 98, 62, 98, 98, 98, 98, 65, - 48, 98, 98, 98, 0, 98, 0, 39, 47, 38, - 39, 0, 0, 43, 39, 98, 98, 98, 53, 40, - 0, 0, 41, 33, 33, 0, 0, 0, 35, 0, - 98, 76, 78, 54 + 0, 0, 116, 117, 45, 117, 110, 111, 42, 117, + 117, 40, 93, 117, 92, 117, 91, 37, 117, 117, + 90, 89, 88, 0, 117, 117, 87, 68, 68, 67, + 19, 15, 27, 73, 70, 69, 117, 37, 117, 117, + 62, 95, 117, 96, 117, 117, 117, 78, 117, 117, + 117, 117, 81, 45, 117, 117, 117, 0, 117, 66, + 59, 0, 55, 64, 54, 55, 0, 0, 50, 59, + 55, 117, 117, 117, 71, 60, 40, 49, 0, 0, + 50, 36, 40, 40, 40, 40, 0, 0, 34, 0, + 41, 0, 34, 33, 0, 27, 0, 37, 0, 117, + + 81, 83, 64 } ; -static yyconst flex_int16_t yy_def[85] = +static yyconst flex_int16_t yy_def[104] = { 0, - 81, 1, 81, 81, 81, 81, 82, 83, 81, 81, - 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, - 81, 81, 81, 84, 81, 81, 81, 84, 84, 84, - 84, 84, 84, 81, 81, 81, 81, 81, 82, 81, - 83, 81, 81, 81, 81, 81, 81, 81, 81, 81, - 81, 81, 81, 81, 84, 81, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 81, 81, 81, 81, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 0, 81, 81, 81 + 100, 1, 100, 100, 100, 100, 101, 102, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 103, 100, 100, 100, 103, 103, 103, + 103, 103, 103, 103, 103, 103, 100, 100, 100, 100, + 100, 101, 100, 102, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 103, 100, 103, + 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, + 103, 100, 100, 100, 100, 103, 103, 103, 103, 103, + 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, + 103, 103, 103, 103, 103, 103, 103, 103, 103, 0, + + 100, 100, 100 } ; -static yyconst flex_int16_t yy_nxt[142] = +static yyconst flex_int16_t yy_nxt[164] = { 0, 4, 5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 24, 28, 29, 30, 24, - 31, 24, 24, 24, 24, 24, 32, 24, 33, 34, - 35, 36, 37, 38, 38, 43, 45, 50, 60, 51, - 58, 59, 61, 62, 66, 55, 46, 63, 44, 38, - 38, 50, 80, 51, 79, 78, 77, 76, 69, 75, - 74, 73, 72, 71, 70, 67, 39, 39, 41, 41, - 69, 68, 42, 40, 65, 64, 57, 56, 54, 53, - 52, 49, 48, 47, 42, 40, 81, 3, 81, 81, - - 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, - 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, - 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, - 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, - 81 + 23, 24, 25, 26, 27, 24, 28, 29, 30, 31, + 32, 24, 33, 24, 24, 24, 24, 34, 24, 35, + 24, 36, 37, 38, 39, 40, 41, 41, 46, 48, + 53, 65, 54, 63, 64, 66, 72, 67, 53, 49, + 54, 47, 68, 41, 41, 58, 99, 98, 97, 96, + 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, + 73, 42, 42, 44, 44, 85, 75, 84, 83, 82, + 81, 80, 79, 78, 77, 76, 75, 74, 45, 43, + + 71, 70, 69, 62, 61, 60, 59, 57, 56, 55, + 52, 51, 50, 45, 43, 100, 3, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100 } ; -static yyconst flex_int16_t yy_chk[142] = +static yyconst flex_int16_t yy_chk[164] = { 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, 1, 1, 5, 5, 9, 12, 18, 30, 18, - 29, 29, 30, 31, 35, 84, 12, 31, 9, 38, - 38, 51, 79, 51, 75, 74, 73, 70, 69, 65, - 64, 61, 60, 59, 58, 35, 82, 82, 83, 83, - 50, 45, 41, 39, 33, 32, 28, 27, 23, 22, - 21, 17, 15, 13, 8, 7, 3, 81, 81, 81, - - 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, - 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, - 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, - 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, - 81 + 1, 1, 1, 1, 1, 1, 5, 5, 9, 12, + 18, 32, 18, 31, 31, 32, 38, 33, 54, 12, + 54, 9, 33, 41, 41, 103, 98, 96, 94, 93, + 91, 89, 86, 85, 84, 83, 82, 81, 78, 77, + 38, 101, 101, 102, 102, 76, 75, 71, 70, 69, + 66, 65, 64, 63, 61, 60, 53, 48, 44, 42, + + 36, 35, 34, 30, 29, 28, 27, 23, 22, 21, + 17, 15, 13, 8, 7, 3, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100 } ; static yy_state_type yy_last_accepting_state; @@ -560,7 +573,7 @@ void str_putc(char c) { . { str_putc(*yytext); } */ -#line 564 "lex.yy.c" +#line 577 "lex.yy.c" #define INITIAL 0 @@ -599,7 +612,7 @@ FILE *yyget_out (void ); void yyset_out (FILE * out_str ); -int yyget_leng (void ); +yy_size_t yyget_leng (void ); char *yyget_text (void ); @@ -747,11 +760,6 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; -#line 57 "tokenizer.lex" - - -#line 754 "lex.yy.c" - if ( !(yy_init) ) { (yy_init) = 1; @@ -778,6 +786,12 @@ YY_DECL yy_load_buffer_state( ); } + { +#line 57 "tokenizer.lex" + + +#line 794 "lex.yy.c" + while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); @@ -794,7 +808,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -803,13 +817,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 >= 82 ) + if ( yy_current_state >= 101 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 98 ); + while ( yy_base[yy_current_state] != 117 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -892,211 +906,226 @@ YY_RULE_SETUP case 12: YY_RULE_SETUP #line 81 "tokenizer.lex" -{ return END; } +{ return RETURN; } YY_BREAK case 13: YY_RULE_SETUP #line 83 "tokenizer.lex" -{ return PLUS; } +{ return BREAK; } YY_BREAK case 14: YY_RULE_SETUP #line 85 "tokenizer.lex" -{ return MINUS; } +{ return CONTINUE; } YY_BREAK case 15: YY_RULE_SETUP #line 87 "tokenizer.lex" -{ return STAR; } +{ return END; } YY_BREAK case 16: YY_RULE_SETUP #line 89 "tokenizer.lex" -{ return SLASH; } +{ return PLUS; } YY_BREAK case 17: YY_RULE_SETUP #line 91 "tokenizer.lex" -{ return DSTAR; } +{ return MINUS; } YY_BREAK case 18: YY_RULE_SETUP #line 93 "tokenizer.lex" -{ return BAND; } +{ return STAR; } YY_BREAK case 19: YY_RULE_SETUP #line 95 "tokenizer.lex" -{ return BOR; } +{ return SLASH; } YY_BREAK case 20: YY_RULE_SETUP #line 97 "tokenizer.lex" -{ return BXOR; } +{ return DSTAR; } YY_BREAK case 21: YY_RULE_SETUP #line 99 "tokenizer.lex" -{ return BNOT; } +{ return BAND; } YY_BREAK case 22: YY_RULE_SETUP #line 101 "tokenizer.lex" -{ return LAND; } +{ return BOR; } YY_BREAK case 23: YY_RULE_SETUP #line 103 "tokenizer.lex" -{ return LOR; } +{ return BXOR; } YY_BREAK case 24: YY_RULE_SETUP #line 105 "tokenizer.lex" -{ return LNOT; } +{ return BNOT; } YY_BREAK case 25: YY_RULE_SETUP #line 107 "tokenizer.lex" -{ return ASSIGN; } +{ return LAND; } YY_BREAK case 26: YY_RULE_SETUP #line 109 "tokenizer.lex" -{ return ASSIGNPLUS; } +{ return LOR; } YY_BREAK case 27: YY_RULE_SETUP #line 111 "tokenizer.lex" -{ return ASSIGNMINUS; } +{ return LNOT; } YY_BREAK case 28: YY_RULE_SETUP #line 113 "tokenizer.lex" -{ return ASSIGNSTAR; } +{ return ASSIGN; } YY_BREAK case 29: YY_RULE_SETUP #line 115 "tokenizer.lex" -{ return ASSIGNSLASH; } +{ return ASSIGNPLUS; } YY_BREAK case 30: YY_RULE_SETUP #line 117 "tokenizer.lex" -{ return ASSIGNDSTAR; } +{ return ASSIGNMINUS; } YY_BREAK case 31: YY_RULE_SETUP #line 119 "tokenizer.lex" -{ return ASSIGNBAND; } +{ return ASSIGNSTAR; } YY_BREAK case 32: YY_RULE_SETUP #line 121 "tokenizer.lex" -{ return ASSIGNBOR; } +{ return ASSIGNSLASH; } YY_BREAK case 33: YY_RULE_SETUP #line 123 "tokenizer.lex" -{ return ASSIGNBXOR; } +{ return ASSIGNDSTAR; } YY_BREAK case 34: YY_RULE_SETUP #line 125 "tokenizer.lex" -{ return EQUAL; } +{ return ASSIGNBAND; } YY_BREAK case 35: YY_RULE_SETUP #line 127 "tokenizer.lex" -{ return LESS; } +{ return ASSIGNBOR; } YY_BREAK case 36: YY_RULE_SETUP #line 129 "tokenizer.lex" -{ return GREATER; } +{ return ASSIGNBXOR; } YY_BREAK case 37: YY_RULE_SETUP #line 131 "tokenizer.lex" -{ return LESSEQ; } +{ return EQUAL; } YY_BREAK case 38: YY_RULE_SETUP #line 133 "tokenizer.lex" -{ return GREATEREQ; } +{ return LESS; } YY_BREAK case 39: YY_RULE_SETUP #line 135 "tokenizer.lex" -{ return LBRACE; } +{ return GREATER; } YY_BREAK case 40: YY_RULE_SETUP #line 137 "tokenizer.lex" -{ return RBRACE; } +{ return LESSEQ; } YY_BREAK case 41: YY_RULE_SETUP #line 139 "tokenizer.lex" -{ return LBRACKET; } +{ return GREATEREQ; } YY_BREAK case 42: YY_RULE_SETUP #line 141 "tokenizer.lex" -{ return RBRACKET; } +{ return LBRACE; } YY_BREAK case 43: YY_RULE_SETUP #line 143 "tokenizer.lex" -{ return LPAREN; } +{ return RBRACE; } YY_BREAK case 44: YY_RULE_SETUP #line 145 "tokenizer.lex" -{ return RPAREN; } +{ return LBRACKET; } YY_BREAK case 45: YY_RULE_SETUP #line 147 "tokenizer.lex" -{ return DOT; } +{ return RBRACKET; } YY_BREAK case 46: YY_RULE_SETUP #line 149 "tokenizer.lex" -{ return COLON; } +{ return LPAREN; } YY_BREAK case 47: YY_RULE_SETUP #line 151 "tokenizer.lex" -{ return SEMICOLON; } +{ return RPAREN; } YY_BREAK case 48: YY_RULE_SETUP #line 153 "tokenizer.lex" -{ return COMMA; } +{ return DOT; } YY_BREAK case 49: YY_RULE_SETUP #line 155 "tokenizer.lex" -{ yylval = strdup(yytext); return IDENT; } +{ return COLON; } YY_BREAK case 50: -/* rule 50 can match eol */ YY_RULE_SETUP #line 157 "tokenizer.lex" -/* Skip comments */ +{ return SEMICOLON; } YY_BREAK case 51: -/* rule 51 can match eol */ YY_RULE_SETUP #line 159 "tokenizer.lex" -/* Skip whitespace */ +{ return COMMA; } YY_BREAK case 52: YY_RULE_SETUP #line 161 "tokenizer.lex" +{ yylval = strdup(yytext); return IDENT; } + YY_BREAK +case 53: +/* rule 53 can match eol */ +YY_RULE_SETUP +#line 163 "tokenizer.lex" +/* Skip comments */ + YY_BREAK +case 54: +/* rule 54 can match eol */ +YY_RULE_SETUP +#line 165 "tokenizer.lex" +/* Skip whitespace */ + YY_BREAK +case 55: +YY_RULE_SETUP +#line 167 "tokenizer.lex" ECHO; YY_BREAK -#line 1100 "lex.yy.c" +#line 1129 "lex.yy.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -1227,6 +1256,7 @@ case YY_STATE_EOF(INITIAL): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer @@ -1282,21 +1312,21 @@ static int yy_get_next_buffer (void) else { - int num_to_read = + yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { - int new_size = b->yy_buf_size * 2; + yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -1327,7 +1357,7 @@ static int yy_get_next_buffer (void) /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), (size_t) num_to_read ); + (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } @@ -1388,7 +1418,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 >= 82 ) + if ( yy_current_state >= 101 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1416,13 +1446,13 @@ 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 >= 82 ) + if ( yy_current_state >= 101 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 81); + yy_is_jam = (yy_current_state == 100); - return yy_is_jam ? 0 : yy_current_state; + return yy_is_jam ? 0 : yy_current_state; } static void yyunput (int c, register char * yy_bp ) @@ -1437,7 +1467,7 @@ static int yy_get_next_buffer (void) if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register int number_to_move = (yy_n_chars) + 2; + register yy_size_t number_to_move = (yy_n_chars) + 2; register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; register char *source = @@ -1486,7 +1516,7 @@ static int yy_get_next_buffer (void) else { /* need more input */ - int offset = (yy_c_buf_p) - (yytext_ptr); + yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) @@ -1646,10 +1676,6 @@ static void yy_load_buffer_state (void) yyfree((void *) b ); } -#ifndef __cplusplus -extern int isatty (int ); -#endif /* __cplusplus */ - /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. @@ -1762,7 +1788,7 @@ void yypop_buffer_state (void) */ static void yyensure_buffer_stack (void) { - int num_to_alloc; + yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { @@ -1859,12 +1885,12 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) +YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; - int i; + yy_size_t i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; @@ -1946,7 +1972,7 @@ FILE *yyget_out (void) /** Get the length of the current token. * */ -int yyget_leng (void) +yy_size_t yyget_leng (void) { return yyleng; } @@ -2094,7 +2120,7 @@ void yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 161 "tokenizer.lex" +#line 166 "tokenizer.lex" @@ -2105,3 +2131,21 @@ int yywrap(void) { void yyerror(char *s) { puts(s); } + +stmt_node *sol_compile(const char *prgstr) { + stmt_node *program = NULL; + YY_BUFFER_STATE buf = yy_scan_string(prgstr); + yyparse(&program); + yy_delete_buffer(buf); + return program; +} + +stmt_node *sol_compile_file(FILE *prgfile) { + stmt_node *program = NULL; + YY_BUFFER_STATE buf = yy_create_buffer(prgfile,YY_BUF_SIZE); + yy_switch_to_buffer(buf); + yyparse(&program); + yy_delete_buffer(buf); + return program; +} + diff --git a/object.c b/object.c index f4e7b92..77f7fb8 100644 --- a/object.c +++ b/object.c @@ -7,7 +7,7 @@ sol_object_t *sol_cast_int(sol_state_t *state, sol_object_t *obj) { sol_object_t *res, *ls; if(sol_is_int(obj)) return obj; ls = sol_new_list(state); - sol_list_insert(state, ls, 0, obj); + sol_list_insert(state, &ls, 0, obj); res = obj->ops->toint(state, ls); sol_obj_free(ls); sol_obj_free(obj); @@ -18,7 +18,7 @@ sol_object_t *sol_cast_float(sol_state_t *state, sol_object_t *obj) { sol_object_t *res, *ls; if(sol_is_float(obj)) return obj; ls = sol_new_list(state); - sol_list_insert(state, ls, 0, obj); + sol_list_insert(state, &ls, 0, obj); res = obj->ops->tofloat(state, ls); sol_obj_free(ls); sol_obj_free(obj); @@ -29,7 +29,7 @@ sol_object_t *sol_cast_string(sol_state_t *state, sol_object_t *obj) { sol_object_t *res, *ls; if(sol_is_string(obj)) return obj; ls = sol_new_list(state); - sol_list_insert(state, ls, 0, obj); + sol_list_insert(state, &ls, 0, obj); res = obj->ops->tostring(state, ls); sol_obj_free(ls); sol_obj_free(obj); @@ -62,17 +62,21 @@ sol_object_t *sol_alloc_object(sol_state_t *state) { } void sol_init_object(sol_state_t *state, sol_object_t *obj) { - obj->ops->init(state, obj); + if(obj->ops->init) obj->ops->init(state, obj); } void sol_obj_free(sol_object_t *obj) { if(sol_decref(obj) <= 0) { - obj->ops->free(NULL, obj); - free(obj); + sol_obj_release(obj); } } -sol_object_t *sol_new_int(sol_state_t *state, int i) { +void sol_obj_release(sol_object_t *obj) { + if(obj->ops->free) obj->ops->free(NULL, obj); + free(obj); +} + +sol_object_t *sol_new_int(sol_state_t *state, long i) { sol_object_t *res = sol_alloc_object(state); if(sol_has_error(state)) { sol_obj_free(res); @@ -139,7 +143,8 @@ int sol_list_len(sol_state_t *state, sol_object_t *list) { int i = 0; sol_object_t *cur = list; if(!sol_is_list(list)) { - return sol_set_error_string(state, "Compute length of non-list"); + sol_obj_free(sol_set_error_string(state, "Compute length of non-list")); + return -1; } while(cur && cur->lvalue) { i++; @@ -221,8 +226,8 @@ void sol_list_insert(sol_state_t *state, sol_object_t **list, int idx, sol_objec temp->type = SOL_LIST; temp->ops = &(state->ListOps); temp->lvalue = sol_incref(obj); - while(next && next->lvalue && i < idx) { - i++; + while(next && i < idx) { + if(next->lvalue) i++; prev = next; next = next->lnext; } @@ -231,39 +236,45 @@ void sol_list_insert(sol_state_t *state, sol_object_t **list, int idx, sol_objec if(prev) { prev->lnext = temp; } else { - sol_obj_free(*list); + free(*list); *list = temp; + temp->lnext = next; } } else { - sol_obj_free(temp->lvalue); - sol_obj_free(temp); - sol_obj_free(sol_set_error_string(state, "Out-of-bounds insert")); - return; + if(prev) { + prev->lnext = temp; + temp->lnext = NULL; + } else { + sol_obj_free(temp->lvalue); + sol_obj_free(temp); + sol_obj_free(sol_set_error_string(state, "Out-of-bounds insert")); + return; + } } } sol_object_t *sol_list_remove(sol_state_t *state, sol_object_t **list, int idx) { sol_object_t *next = *list, *prev = NULL, *res, *temp; int i = 0; - if(sol_has_error(state)) return; + if(sol_has_error(state)) return sol_incref(state->None); if(idx < 0) { return sol_set_error_string(state, "Remove from negative index"); } - while(next && next->lvalue && i < idx) { - i++; + while(next && i < idx) { + if(next->lvalue) i++; prev = next; next = next->lnext; } if(next) { if(prev) { - res = (*list)->lvalue; + res = next->lvalue; + prev->lnext = next->lnext; + free(next); + } else { + res = (*list)->lvalue; temp = *list; *list = (*list)->lnext; - sol_obj_free(temp); - } else { - res = next->lvalue; - prev->lnext = next->lnext; - sol_obj_free(next); + free(temp); } return res; } else { @@ -286,4 +297,224 @@ sol_object_t *sol_list_copy(sol_state_t *state, sol_object_t *list) { cur = cur->lnext; } return res; -} \ No newline at end of file +} + +void sol_list_append(sol_state_t *state, sol_object_t *dest, sol_object_t *src) { + sol_object_t *curd = dest, *curs = src; + while(curd->lnext) curd = curd->lnext; + while(curs && curs->lvalue) { + curd->lnext = sol_alloc_object(state); + if(sol_has_error(state)) return; + curd = curd->lnext; + curd->type = SOL_LIST; + curd->ops = &(state->ListOps); + curd->lvalue = sol_incref(curs->lvalue); + curs = curs->lnext; + } +} + +sol_object_t *sol_f_list_free(sol_state_t *state, sol_object_t *list) { + sol_object_t *cur = list, *prev; + while(cur) { + if(cur->lvalue) sol_obj_free(cur->lvalue); + prev = cur; + cur = cur->lnext; + if(prev!=list) free(prev); + } +} + +sol_object_t *sol_new_map(sol_state_t *state) { + sol_object_t *map = sol_alloc_object(state); + if(sol_has_error(state)) return sol_incref(state->None); + map->type = SOL_MAP; + map->ops = &(state->MapOps); + map->mkey = NULL; + map->mval = NULL; + map->mnext = NULL; +} + +int sol_map_len(sol_state_t *state, sol_object_t *map) { + int i = 0; + sol_object_t *cur = map; + while(cur) { + if(cur->mkey) i++; + cur = cur->mnext; + } + return i; +} + +sol_object_t *sol_map_submap(sol_state_t *state, sol_object_t *map, sol_object_t *key) { + sol_object_t *list = sol_new_list(state), *res = NULL, *cur = map, *cmp; + sol_list_insert(state, &list, 0, key); + while(cur) { + if(cur->mkey) { + sol_list_insert(state, &list, 1, cur->mkey); + cmp = sol_cast_int(state, key->ops->cmp(state, list)); + sol_obj_free(sol_list_remove(state, &list, 1)); + if(cmp->ival) { + res = cur; + break; + } + } + cur = cur->mnext; + } + if(res) { + return sol_incref(res); + } else { + return sol_incref(state->None); + } +} + +sol_object_t *sol_map_get(sol_state_t *state, sol_object_t *map, sol_object_t *key) { + sol_object_t *submap = sol_map_submap(state, map, key); + sol_object_t *res; + if(sol_is_map(submap)) { + res = sol_incref(submap->mval); + sol_obj_free(submap); + return res; + } else { + return sol_incref(state->None); + } +} + +void sol_map_set(sol_state_t *state, sol_object_t *map, sol_object_t *key, sol_object_t *val) { + sol_object_t *cur = map, *prev = NULL, *list = sol_new_list(state), *cmp; + sol_list_insert(state, &list, 0, key); + while(cur) { + if(cur->mkey) { + sol_list_insert(state, &list, 1, cur->mkey); + cmp = sol_cast_int(state, key->ops->cmp(state, list)); + sol_obj_free(sol_list_remove(state, &list, 1)); + if(cmp->ival) { + sol_obj_free(cur->mval); + if(sol_is_none(state, val)) { + if(prev) { + prev->mnext = cur->mnext; + sol_obj_free(cur->mkey); + sol_obj_free(cur->mval); + sol_obj_free(cur); + } else { + sol_obj_free(cur->mkey); + sol_obj_free(cur->mval); + cur->mkey = NULL; + cur->mval = NULL; + } + } + cur->mval = sol_incref(val); + return; + } + } + prev = cur; + cur = cur->mnext; + } + if(sol_is_none(state, val)) return; + prev->mnext = sol_alloc_object(state); + if(sol_has_error(state)) return; + cur = prev->mnext; + cur->type = SOL_MAP; + cur->ops = &(state->MapOps); + cur->mkey = sol_incref(key); + cur->mval = sol_incref(val); + cur->mnext = NULL; +} + +void sol_map_set_existing(sol_state_t *state, sol_object_t *map, sol_object_t *key, sol_object_t *val) { + sol_object_t *cur = map, *prev = NULL, *list = sol_new_list(state), *cmp; + sol_list_insert(state, &list, 0, key); + while(cur) { + if(cur->mkey) { + sol_list_insert(state, &list, 1, cur->mkey); + cmp = sol_cast_int(state, key->ops->cmp(state, list)); + sol_obj_free(sol_list_remove(state, &list, 1)); + if(cmp->ival) { + sol_obj_free(cur->mval); + if(sol_is_none(state, val)) { + if(prev) { + prev->mnext = cur->mnext; + sol_obj_free(cur->mkey); + sol_obj_free(cur->mval); + sol_obj_free(cur); + } else { + sol_obj_free(cur->mkey); + sol_obj_free(cur->mval); + cur->mkey = NULL; + cur->mval = NULL; + } + } + cur->mval = sol_incref(val); + return; + } + } + prev = cur; + cur = cur->mnext; + } +} + +sol_object_t *sol_map_copy(sol_state_t *state, sol_object_t *map) { + sol_object_t *newmap = sol_new_map(state), *newcur = newmap, *cur = map; + while(cur) { + if(cur->mkey) { + newcur->mkey = sol_incref(cur->mkey); + newcur->mval = sol_incref(cur->mval); + newcur->mnext = sol_alloc_object(state); + newcur = newcur->mnext; + newcur->type = SOL_MAP; + newcur->ops = &(state->MapOps); + newcur->mkey = NULL; + newcur->mval = NULL; + newcur->mnext = NULL; + } + cur = cur->mnext; + } + return newmap; +} + +void sol_map_merge(sol_state_t *state, sol_object_t *dest, sol_object_t *src) { + sol_object_t *cur = src; + while(cur) { + if(cur->mkey) { + sol_map_set(state, dest, cur->mkey, cur->mval); + } + cur = cur->mnext; + } +} + +void sol_map_merge_existing(sol_state_t *state, sol_object_t *dest, sol_object_t *src) { + sol_object_t *cur = src; + while(cur) { + if(cur->mkey) { + sol_map_set_existing(state, dest, cur->mkey, cur->mval); + } + cur = cur->mnext; + } +} + +sol_object_t *sol_f_map_free(sol_state_t *state, sol_object_t *map) { + sol_object_t *cur = map, *prev; + while(cur) { + if(cur->mkey) { + sol_obj_free(cur->mkey); + sol_obj_free(cur->mval); + } + prev = cur; + cur = cur->mnext; + if(prev!=map) free(prev); + } + return map; +} + +sol_object_t *sol_new_cfunc(sol_state_t *state, sol_cfunc_t cfunc) { + sol_object_t *res = sol_alloc_object(state); + res->type = SOL_CFUNCTION; + res->ops = &(state->CFuncOps); + res->cfunc = cfunc; + return res; +} + +sol_object_t *sol_new_cdata(sol_state_t *state, void *cdata, sol_ops_t *ops) { + sol_object_t *res = sol_alloc_object(state); + res->type = SOL_CDATA; + res->ops = ops; + res->cdata = cdata; + return res; +} diff --git a/parser.output b/parser.output index 9891d64..57b1eeb 100644 --- a/parser.output +++ b/parser.output @@ -1,56 +1,60 @@ Terminals unused in grammar - DOT COLON -State 11 conflicts: 2 shift/reduce -State 13 conflicts: 10 shift/reduce -State 16 conflicts: 13 shift/reduce -State 17 conflicts: 1 shift/reduce -State 26 conflicts: 1 shift/reduce +State 5 conflicts: 10 shift/reduce +State 14 conflicts: 2 shift/reduce +State 16 conflicts: 10 shift/reduce +State 19 conflicts: 16 shift/reduce +State 20 conflicts: 1 shift/reduce State 29 conflicts: 1 shift/reduce -State 37 conflicts: 1 shift/reduce -State 48 conflicts: 1 shift/reduce -State 55 conflicts: 1 shift/reduce -State 59 conflicts: 14 shift/reduce -State 60 conflicts: 14 shift/reduce -State 77 conflicts: 10 shift/reduce -State 82 conflicts: 1 shift/reduce -State 85 conflicts: 1 shift/reduce -State 86 conflicts: 1 shift/reduce -State 87 conflicts: 1 shift/reduce -State 88 conflicts: 1 shift/reduce -State 89 conflicts: 1 shift/reduce -State 90 conflicts: 1 shift/reduce -State 91 conflicts: 1 shift/reduce -State 92 conflicts: 1 shift/reduce -State 93 conflicts: 1 shift/reduce -State 102 conflicts: 1 shift/reduce +State 41 conflicts: 1 shift/reduce +State 42 conflicts: 1 shift/reduce +State 53 conflicts: 1 shift/reduce, 17 reduce/reduce +State 54 conflicts: 4 reduce/reduce +State 60 conflicts: 1 shift/reduce +State 64 conflicts: 17 shift/reduce +State 65 conflicts: 17 shift/reduce +State 83 conflicts: 10 shift/reduce +State 96 conflicts: 1 shift/reduce +State 99 conflicts: 2 shift/reduce +State 100 conflicts: 2 shift/reduce +State 101 conflicts: 2 shift/reduce +State 102 conflicts: 2 shift/reduce +State 103 conflicts: 2 shift/reduce State 104 conflicts: 2 shift/reduce State 105 conflicts: 2 shift/reduce -State 106 conflicts: 5 shift/reduce -State 107 conflicts: 5 shift/reduce -State 108 conflicts: 5 shift/reduce -State 109 conflicts: 5 shift/reduce -State 110 conflicts: 5 shift/reduce -State 111 conflicts: 2 shift/reduce -State 112 conflicts: 2 shift/reduce -State 113 conflicts: 2 shift/reduce -State 114 conflicts: 2 shift/reduce -State 115 conflicts: 1 shift/reduce -State 128 conflicts: 1 shift/reduce -State 131 conflicts: 1 shift/reduce -State 156 conflicts: 1 shift/reduce -State 157 conflicts: 1 shift/reduce -State 158 conflicts: 1 shift/reduce -State 159 conflicts: 1 shift/reduce -State 160 conflicts: 1 shift/reduce -State 161 conflicts: 1 shift/reduce -State 162 conflicts: 1 shift/reduce -State 163 conflicts: 1 shift/reduce -State 164 conflicts: 1 shift/reduce -State 165 conflicts: 1 shift/reduce +State 106 conflicts: 2 shift/reduce +State 107 conflicts: 2 shift/reduce +State 116 conflicts: 1 shift/reduce +State 119 conflicts: 2 shift/reduce, 2 reduce/reduce +State 120 conflicts: 2 shift/reduce, 2 reduce/reduce +State 121 conflicts: 5 shift/reduce, 4 reduce/reduce +State 122 conflicts: 5 shift/reduce, 4 reduce/reduce +State 123 conflicts: 5 shift/reduce, 4 reduce/reduce +State 124 conflicts: 5 shift/reduce, 4 reduce/reduce +State 125 conflicts: 5 shift/reduce, 4 reduce/reduce +State 126 conflicts: 2 shift/reduce, 9 reduce/reduce +State 127 conflicts: 2 shift/reduce, 9 reduce/reduce +State 128 conflicts: 2 shift/reduce, 11 reduce/reduce +State 129 conflicts: 2 shift/reduce, 11 reduce/reduce +State 130 conflicts: 1 shift/reduce, 13 reduce/reduce +State 131 conflicts: 14 reduce/reduce +State 132 conflicts: 14 reduce/reduce +State 133 conflicts: 14 reduce/reduce +State 135 conflicts: 2 shift/reduce +State 136 conflicts: 2 shift/reduce +State 137 conflicts: 2 shift/reduce +State 138 conflicts: 2 shift/reduce +State 139 conflicts: 2 shift/reduce +State 140 conflicts: 2 shift/reduce +State 141 conflicts: 2 shift/reduce +State 142 conflicts: 2 shift/reduce +State 143 conflicts: 2 shift/reduce +State 151 conflicts: 1 shift/reduce +State 154 conflicts: 1 shift/reduce +State 169 conflicts: 1 shift/reduce Grammar @@ -64,106 +68,114 @@ Grammar 4 | IF expr THEN stmt ELSE stmt END 5 | WHILE expr DO stmt END 6 | FOR IDENT IN expr DO stmt END - 7 | stmt SEMICOLON - 8 | stmt_list - - 9 stmt_list: stmt stmt - 10 | stmt_list stmt - - 11 expr: IDENT ASSIGN expr - 12 | IDENT ASSIGNPLUS expr - 13 | IDENT ASSIGNMINUS expr - 14 | IDENT ASSIGNSTAR expr - 15 | IDENT ASSIGNSLASH expr - 16 | IDENT ASSIGNDSTAR expr - 17 | IDENT ASSIGNBAND expr - 18 | IDENT ASSIGNBOR expr - 19 | IDENT ASSIGNBXOR expr - 20 | expr LBRACKET expr RBRACKET ASSIGN expr - 21 | expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | logic_expr - - 30 logic_expr: logic_expr LAND logic_expr - 31 | logic_expr LOR logic_expr - 32 | ulogic_expr - - 33 ulogic_expr: LNOT ulogic_expr - 34 | rel_expr - - 35 rel_expr: rel_expr EQUAL rel_expr - 36 | rel_expr LESS rel_expr - 37 | rel_expr GREATER rel_expr - 38 | rel_expr LESSEQ rel_expr - 39 | rel_expr GREATEREQ rel_expr - 40 | term_expr - - 41 term_expr: term_expr PLUS term_expr - 42 | term_expr MINUS term_expr - 43 | factor_expr - - 44 factor_expr: factor_expr STAR factor_expr - 45 | factor_expr SLASH factor_expr - 46 | power_expr - - 47 power_expr: power_expr DSTAR power_expr - 48 | binary_expr - - 49 binary_expr: ubinary_expr BAND ubinary_expr - 50 | ubinary_expr BOR ubinary_expr - 51 | ubinary_expr BXOR ubinary_expr - 52 | ubinary_expr - - 53 ubinary_expr: BNOT call_expr - 54 | call_expr - - 55 call_expr: call_expr LPAREN expr_list RPAREN - 56 | funcdecl_expr - - 57 funcdecl_expr: FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | FUNC LPAREN ident_list RPAREN stmt END - 59 | ref_expr - - 60 ref_expr: IDENT - 61 | index_expr - - 62 index_expr: index_expr LBRACKET index_expr RBRACKET - 63 | lit_expr - - 64 lit_expr: INT - 65 | FLOAT - 66 | STRING - 67 | gen_expr - - 68 gen_expr: LBRACKET expr_list RBRACKET - 69 | LBRACE assoc_list RBRACE - 70 | paren_expr - - 71 paren_expr: LPAREN expr RPAREN - - 72 expr_list: /* empty */ - 73 | expr - 74 | expr_list expr - 75 | expr_list COMMA expr - - 76 ident_list: /* empty */ - 77 | IDENT - 78 | ident_list IDENT - 79 | ident_list COMMA IDENT - - 80 assoc_list: /* empty */ - 81 | assoc_item - 82 | assoc_list assoc_item - 83 | assoc_list COMMA assoc_item - - 84 assoc_item: LBRACKET expr RBRACKET ASSIGN expr - 85 | IDENT ASSIGN expr + 7 | RETURN expr + 8 | RETURN + 9 | BREAK + 10 | CONTINUE + 11 | stmt SEMICOLON + 12 | stmt_list + + 13 stmt_list: stmt_list stmt + 14 | stmt stmt + + 15 expr: IDENT ASSIGN expr + 16 | IDENT ASSIGNPLUS expr + 17 | IDENT ASSIGNMINUS expr + 18 | IDENT ASSIGNSTAR expr + 19 | IDENT ASSIGNSLASH expr + 20 | IDENT ASSIGNDSTAR expr + 21 | IDENT ASSIGNBAND expr + 22 | IDENT ASSIGNBOR expr + 23 | IDENT ASSIGNBXOR expr + 24 | ex_index_expr ASSIGN expr + 25 | ex_index_expr ASSIGNPLUS expr + 26 | ex_index_expr ASSIGNMINUS expr + 27 | ex_index_expr ASSIGNSTAR expr + 28 | ex_index_expr ASSIGNSLASH expr + 29 | ex_index_expr ASSIGNDSTAR expr + 30 | ex_index_expr ASSIGNBAND expr + 31 | ex_index_expr ASSIGNBOR expr + 32 | ex_index_expr ASSIGNBXOR expr + 33 | logic_expr + + 34 logic_expr: logic_expr LAND logic_expr + 35 | logic_expr LOR logic_expr + 36 | ulogic_expr + + 37 ulogic_expr: LNOT ulogic_expr + 38 | rel_expr + + 39 rel_expr: rel_expr EQUAL rel_expr + 40 | rel_expr LESS rel_expr + 41 | rel_expr GREATER rel_expr + 42 | rel_expr LESSEQ rel_expr + 43 | rel_expr GREATEREQ rel_expr + 44 | term_expr + + 45 term_expr: term_expr PLUS term_expr + 46 | term_expr MINUS term_expr + 47 | factor_expr + + 48 factor_expr: factor_expr STAR factor_expr + 49 | factor_expr SLASH factor_expr + 50 | power_expr + + 51 power_expr: power_expr DSTAR power_expr + 52 | binary_expr + + 53 binary_expr: ubinary_expr BAND ubinary_expr + 54 | ubinary_expr BOR ubinary_expr + 55 | ubinary_expr BXOR ubinary_expr + 56 | ubinary_expr + + 57 ubinary_expr: BNOT call_expr + 58 | call_expr + + 59 call_expr: call_expr LPAREN expr_list RPAREN + 60 | funcdecl_expr + + 61 funcdecl_expr: FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | FUNC LPAREN ident_list RPAREN stmt END + 63 | index_expr + + 64 index_expr: expr LBRACKET expr RBRACKET + 65 | expr DOT IDENT + 66 | ref_expr + + 67 ex_index_expr: expr LBRACKET expr RBRACKET + 68 | expr DOT IDENT + + 69 ref_expr: IDENT + 70 | lit_expr + + 71 lit_expr: INT + 72 | FLOAT + 73 | STRING + 74 | gen_expr + + 75 gen_expr: LBRACKET expr_list RBRACKET + 76 | LBRACE assoc_list RBRACE + 77 | paren_expr + + 78 paren_expr: LPAREN expr RPAREN + + 79 expr_list: %empty + 80 | expr + 81 | expr_list expr + 82 | expr_list COMMA expr + + 83 ident_list: %empty + 84 | IDENT + 85 | ident_list IDENT + 86 | ident_list COMMA IDENT + + 87 assoc_list: %empty + 88 | assoc_item + 89 | assoc_list assoc_item + 90 | assoc_list COMMA assoc_item + + 91 assoc_item: LBRACKET expr RBRACKET ASSIGN expr + 92 | IDENT ASSIGN expr Terminals, with rules where they appear @@ -177,102 +189,108 @@ WHILE (261) 5 FOR (262) 6 IN (263) 6 DO (264) 5 6 -FUNC (265) 57 58 -END (266) 3 4 5 6 57 58 -IDENT (267) 6 11 12 13 14 15 16 17 18 19 57 60 77 78 79 85 -INT (268) 64 -FLOAT (269) 65 -STRING (270) 66 -PLUS (271) 41 -MINUS (272) 42 -STAR (273) 44 -SLASH (274) 45 -DSTAR (275) 47 -BAND (276) 49 -BOR (277) 50 -BXOR (278) 51 -BNOT (279) 53 -LAND (280) 30 -LOR (281) 31 -LNOT (282) 33 -ASSIGN (283) 11 20 84 85 -ASSIGNPLUS (284) 12 21 -ASSIGNMINUS (285) 13 22 -ASSIGNSTAR (286) 14 23 -ASSIGNSLASH (287) 15 24 -ASSIGNDSTAR (288) 16 25 -ASSIGNBAND (289) 17 26 -ASSIGNBOR (290) 18 27 -ASSIGNBXOR (291) 19 28 -EQUAL (292) 35 -LESS (293) 36 -GREATER (294) 37 -LESSEQ (295) 38 -GREATEREQ (296) 39 -LBRACE (297) 69 -RBRACE (298) 69 -LPAREN (299) 55 57 58 71 -RPAREN (300) 55 57 58 71 -LBRACKET (301) 20 21 22 23 24 25 26 27 28 62 68 84 -RBRACKET (302) 20 21 22 23 24 25 26 27 28 62 68 84 -DOT (303) -COLON (304) -SEMICOLON (305) 7 -COMMA (306) 75 79 83 +FUNC (265) 61 62 +RETURN (266) 7 8 +BREAK (267) 9 +CONTINUE (268) 10 +END (269) 3 4 5 6 61 62 +IDENT (270) 6 15 16 17 18 19 20 21 22 23 61 65 68 69 84 85 86 92 +INT (271) 71 +FLOAT (272) 72 +STRING (273) 73 +PLUS (274) 45 +MINUS (275) 46 +STAR (276) 48 +SLASH (277) 49 +DSTAR (278) 51 +BAND (279) 53 +BOR (280) 54 +BXOR (281) 55 +BNOT (282) 57 +LAND (283) 34 +LOR (284) 35 +LNOT (285) 37 +ASSIGN (286) 15 24 91 92 +ASSIGNPLUS (287) 16 25 +ASSIGNMINUS (288) 17 26 +ASSIGNSTAR (289) 18 27 +ASSIGNSLASH (290) 19 28 +ASSIGNDSTAR (291) 20 29 +ASSIGNBAND (292) 21 30 +ASSIGNBOR (293) 22 31 +ASSIGNBXOR (294) 23 32 +EQUAL (295) 39 +LESS (296) 40 +GREATER (297) 41 +LESSEQ (298) 42 +GREATEREQ (299) 43 +LBRACE (300) 76 +RBRACE (301) 76 +LPAREN (302) 59 61 62 78 +RPAREN (303) 59 61 62 78 +LBRACKET (304) 64 67 75 91 +RBRACKET (305) 64 67 75 91 +DOT (306) 65 68 +COLON (307) +SEMICOLON (308) 11 +COMMA (309) 82 86 90 Nonterminals, with rules where they appear -$accept (52) +$accept (55) on left: 0 -program (53) +program (56) on left: 1, on right: 0 -stmt (54) - on left: 2 3 4 5 6 7 8, on right: 1 3 4 5 6 7 9 10 57 58 -stmt_list (55) - on left: 9 10, on right: 8 10 -expr (56) - on left: 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 - 29, on right: 2 3 4 5 6 11 12 13 14 15 16 17 18 19 20 21 22 23 - 24 25 26 27 28 71 73 74 75 84 85 -logic_expr (57) - on left: 30 31 32, on right: 29 30 31 -ulogic_expr (58) - on left: 33 34, on right: 32 33 -rel_expr (59) - on left: 35 36 37 38 39 40, on right: 34 35 36 37 38 39 -term_expr (60) - on left: 41 42 43, on right: 40 41 42 -factor_expr (61) - on left: 44 45 46, on right: 43 44 45 -power_expr (62) - on left: 47 48, on right: 46 47 -binary_expr (63) - on left: 49 50 51 52, on right: 48 -ubinary_expr (64) - on left: 53 54, on right: 49 50 51 52 -call_expr (65) - on left: 55 56, on right: 53 54 55 -funcdecl_expr (66) - on left: 57 58 59, on right: 56 -ref_expr (67) - on left: 60 61, on right: 59 -index_expr (68) - on left: 62 63, on right: 61 62 -lit_expr (69) - on left: 64 65 66 67, on right: 63 -gen_expr (70) - on left: 68 69 70, on right: 67 -paren_expr (71) - on left: 71, on right: 70 -expr_list (72) - on left: 72 73 74 75, on right: 55 68 74 75 -ident_list (73) - on left: 76 77 78 79, on right: 57 58 78 79 -assoc_list (74) - on left: 80 81 82 83, on right: 69 82 83 -assoc_item (75) - on left: 84 85, on right: 81 82 83 +stmt (57) + on left: 2 3 4 5 6 7 8 9 10 11 12, on right: 1 3 4 5 6 11 13 14 + 61 62 +stmt_list (58) + on left: 13 14, on right: 12 13 +expr (59) + on left: 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 + 33, on right: 2 3 4 5 6 7 15 16 17 18 19 20 21 22 23 24 25 26 27 + 28 29 30 31 32 64 65 67 68 78 80 81 82 91 92 +logic_expr (60) + on left: 34 35 36, on right: 33 34 35 +ulogic_expr (61) + on left: 37 38, on right: 36 37 +rel_expr (62) + on left: 39 40 41 42 43 44, on right: 38 39 40 41 42 43 +term_expr (63) + on left: 45 46 47, on right: 44 45 46 +factor_expr (64) + on left: 48 49 50, on right: 47 48 49 +power_expr (65) + on left: 51 52, on right: 50 51 +binary_expr (66) + on left: 53 54 55 56, on right: 52 +ubinary_expr (67) + on left: 57 58, on right: 53 54 55 56 +call_expr (68) + on left: 59 60, on right: 57 58 59 +funcdecl_expr (69) + on left: 61 62 63, on right: 60 +index_expr (70) + on left: 64 65 66, on right: 63 +ex_index_expr (71) + on left: 67 68, on right: 24 25 26 27 28 29 30 31 32 +ref_expr (72) + on left: 69 70, on right: 66 +lit_expr (73) + on left: 71 72 73 74, on right: 70 +gen_expr (74) + on left: 75 76 77, on right: 74 +paren_expr (75) + on left: 78, on right: 77 +expr_list (76) + on left: 79 80 81 82, on right: 59 75 81 82 +ident_list (77) + on left: 83 84 85 86, on right: 61 62 85 86 +assoc_list (78) + on left: 87 88 89 90, on right: 76 89 90 +assoc_item (79) + on left: 91 92, on right: 88 89 90 State 0 @@ -284,7248 +302,8580 @@ State 0 4 | . IF expr THEN stmt ELSE stmt END 5 | . WHILE expr DO stmt END 6 | . FOR IDENT IN expr DO stmt END - 7 | . stmt SEMICOLON - 8 | . stmt_list - 9 stmt_list: . stmt stmt - 10 | . stmt_list stmt - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 7 | . RETURN expr + 8 | . RETURN + 9 | . BREAK + 10 | . CONTINUE + 11 | . stmt SEMICOLON + 12 | . stmt_list + 13 stmt_list: . stmt_list stmt + 14 | . stmt stmt + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN IF shift, and go to state 1 WHILE shift, and go to state 2 FOR shift, and go to state 3 FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - program go to state 14 - stmt go to state 15 - stmt_list go to state 16 - expr go to state 17 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + RETURN shift, and go to state 5 + BREAK shift, and go to state 6 + CONTINUE shift, and go to state 7 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + program go to state 17 + stmt go to state 18 + stmt_list go to state 19 + expr go to state 20 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 1 3 stmt: IF . expr THEN stmt END 4 | IF . expr THEN stmt ELSE stmt END - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - expr go to state 33 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 37 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 2 5 stmt: WHILE . expr DO stmt END - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - expr go to state 34 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 38 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 3 6 stmt: FOR . IDENT IN expr DO stmt END - IDENT shift, and go to state 35 + IDENT shift, and go to state 39 State 4 - 57 funcdecl_expr: FUNC . IDENT LPAREN ident_list RPAREN stmt END - 58 | FUNC . LPAREN ident_list RPAREN stmt END + 61 funcdecl_expr: FUNC . IDENT LPAREN ident_list RPAREN stmt END + 62 | FUNC . LPAREN ident_list RPAREN stmt END - IDENT shift, and go to state 36 - LPAREN shift, and go to state 37 + IDENT shift, and go to state 40 + LPAREN shift, and go to state 41 State 5 - 11 expr: IDENT . ASSIGN expr - 12 | IDENT . ASSIGNPLUS expr - 13 | IDENT . ASSIGNMINUS expr - 14 | IDENT . ASSIGNSTAR expr - 15 | IDENT . ASSIGNSLASH expr - 16 | IDENT . ASSIGNDSTAR expr - 17 | IDENT . ASSIGNBAND expr - 18 | IDENT . ASSIGNBOR expr - 19 | IDENT . ASSIGNBXOR expr - 60 ref_expr: IDENT . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, PLUS, MINUS, STAR, SLASH, DSTAR, BAND, BOR, BXOR, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - - ASSIGN shift, and go to state 38 - ASSIGNPLUS shift, and go to state 39 - ASSIGNMINUS shift, and go to state 40 - ASSIGNSTAR shift, and go to state 41 - ASSIGNSLASH shift, and go to state 42 - ASSIGNDSTAR shift, and go to state 43 - ASSIGNBAND shift, and go to state 44 - ASSIGNBOR shift, and go to state 45 - ASSIGNBXOR shift, and go to state 46 - - $default reduce using rule 60 (ref_expr) + 7 stmt: RETURN . expr + 8 | RETURN . [$end, IF, ELSE, WHILE, FOR, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, LPAREN, LBRACKET, SEMICOLON] + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN + + FUNC shift, and go to state 4 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + FUNC [reduce using rule 8 (stmt)] + IDENT [reduce using rule 8 (stmt)] + INT [reduce using rule 8 (stmt)] + FLOAT [reduce using rule 8 (stmt)] + STRING [reduce using rule 8 (stmt)] + BNOT [reduce using rule 8 (stmt)] + LNOT [reduce using rule 8 (stmt)] + LBRACE [reduce using rule 8 (stmt)] + LPAREN [reduce using rule 8 (stmt)] + LBRACKET [reduce using rule 8 (stmt)] + $default reduce using rule 8 (stmt) + + expr go to state 42 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 6 - 64 lit_expr: INT . + 9 stmt: BREAK . - $default reduce using rule 64 (lit_expr) + $default reduce using rule 9 (stmt) State 7 - 65 lit_expr: FLOAT . + 10 stmt: CONTINUE . - $default reduce using rule 65 (lit_expr) + $default reduce using rule 10 (stmt) State 8 - 66 lit_expr: STRING . - - $default reduce using rule 66 (lit_expr) + 15 expr: IDENT . ASSIGN expr + 16 | IDENT . ASSIGNPLUS expr + 17 | IDENT . ASSIGNMINUS expr + 18 | IDENT . ASSIGNSTAR expr + 19 | IDENT . ASSIGNSLASH expr + 20 | IDENT . ASSIGNDSTAR expr + 21 | IDENT . ASSIGNBAND expr + 22 | IDENT . ASSIGNBOR expr + 23 | IDENT . ASSIGNBXOR expr + 69 ref_expr: IDENT . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, PLUS, MINUS, STAR, SLASH, DSTAR, BAND, BOR, BXOR, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + + ASSIGN shift, and go to state 43 + ASSIGNPLUS shift, and go to state 44 + ASSIGNMINUS shift, and go to state 45 + ASSIGNSTAR shift, and go to state 46 + ASSIGNSLASH shift, and go to state 47 + ASSIGNDSTAR shift, and go to state 48 + ASSIGNBAND shift, and go to state 49 + ASSIGNBOR shift, and go to state 50 + ASSIGNBXOR shift, and go to state 51 + + $default reduce using rule 69 (ref_expr) State 9 - 53 ubinary_expr: BNOT . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 71 lit_expr: INT . - FUNC shift, and go to state 4 - IDENT shift, and go to state 47 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - call_expr go to state 48 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + $default reduce using rule 71 (lit_expr) State 10 - 33 ulogic_expr: . LNOT ulogic_expr - 33 | LNOT . ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 72 lit_expr: FLOAT . - FUNC shift, and go to state 4 - IDENT shift, and go to state 47 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - ulogic_expr go to state 49 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + $default reduce using rule 72 (lit_expr) State 11 - 69 gen_expr: LBRACE . assoc_list RBRACE - 80 assoc_list: . [IDENT, RBRACE, LBRACKET, COMMA] - 81 | . assoc_item - 82 | . assoc_list assoc_item - 83 | . assoc_list COMMA assoc_item - 84 assoc_item: . LBRACKET expr RBRACKET ASSIGN expr - 85 | . IDENT ASSIGN expr - - IDENT shift, and go to state 50 - LBRACKET shift, and go to state 51 - - IDENT [reduce using rule 80 (assoc_list)] - LBRACKET [reduce using rule 80 (assoc_list)] - $default reduce using rule 80 (assoc_list) + 73 lit_expr: STRING . - assoc_list go to state 52 - assoc_item go to state 53 + $default reduce using rule 73 (lit_expr) State 12 - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN - 71 | LPAREN . expr RPAREN + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 57 | BNOT . call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - expr go to state 54 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 52 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 53 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 13 - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 68 | LBRACKET . expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN - 72 expr_list: . [FUNC, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, LPAREN, LBRACKET, RBRACKET, COMMA] - 73 | . expr - 74 | . expr_list expr - 75 | . expr_list COMMA expr + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 37 | LNOT . ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - FUNC [reduce using rule 72 (expr_list)] - IDENT [reduce using rule 72 (expr_list)] - INT [reduce using rule 72 (expr_list)] - FLOAT [reduce using rule 72 (expr_list)] - STRING [reduce using rule 72 (expr_list)] - BNOT [reduce using rule 72 (expr_list)] - LNOT [reduce using rule 72 (expr_list)] - LBRACE [reduce using rule 72 (expr_list)] - LPAREN [reduce using rule 72 (expr_list)] - LBRACKET [reduce using rule 72 (expr_list)] - $default reduce using rule 72 (expr_list) - - expr go to state 55 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 - expr_list go to state 56 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 52 + logic_expr go to state 21 + ulogic_expr go to state 54 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 14 - 0 $accept: program . $end + 76 gen_expr: LBRACE . assoc_list RBRACE + 87 assoc_list: . %empty [IDENT, RBRACE, LBRACKET, COMMA] + 88 | . assoc_item + 89 | . assoc_list assoc_item + 90 | . assoc_list COMMA assoc_item + 91 assoc_item: . LBRACKET expr RBRACKET ASSIGN expr + 92 | . IDENT ASSIGN expr + + IDENT shift, and go to state 55 + LBRACKET shift, and go to state 56 - $end shift, and go to state 57 + IDENT [reduce using rule 87 (assoc_list)] + LBRACKET [reduce using rule 87 (assoc_list)] + $default reduce using rule 87 (assoc_list) + + assoc_list go to state 57 + assoc_item go to state 58 State 15 + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN + 78 | LPAREN . expr RPAREN + + FUNC shift, and go to state 4 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 59 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 + + +State 16 + + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 75 | LBRACKET . expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN + 79 expr_list: . %empty [FUNC, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, LPAREN, LBRACKET, RBRACKET, COMMA] + 80 | . expr + 81 | . expr_list expr + 82 | . expr_list COMMA expr + + FUNC shift, and go to state 4 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + FUNC [reduce using rule 79 (expr_list)] + IDENT [reduce using rule 79 (expr_list)] + INT [reduce using rule 79 (expr_list)] + FLOAT [reduce using rule 79 (expr_list)] + STRING [reduce using rule 79 (expr_list)] + BNOT [reduce using rule 79 (expr_list)] + LNOT [reduce using rule 79 (expr_list)] + LBRACE [reduce using rule 79 (expr_list)] + LPAREN [reduce using rule 79 (expr_list)] + LBRACKET [reduce using rule 79 (expr_list)] + $default reduce using rule 79 (expr_list) + + expr go to state 60 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 + expr_list go to state 61 + + +State 17 + + 0 $accept: program . $end + + $end shift, and go to state 62 + + +State 18 + 1 program: stmt . [$end] 2 stmt: . expr 3 | . IF expr THEN stmt END 4 | . IF expr THEN stmt ELSE stmt END 5 | . WHILE expr DO stmt END 6 | . FOR IDENT IN expr DO stmt END - 7 | . stmt SEMICOLON - 7 | stmt . SEMICOLON - 8 | . stmt_list - 9 stmt_list: . stmt stmt - 9 | stmt . stmt - 10 | . stmt_list stmt - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 7 | . RETURN expr + 8 | . RETURN + 9 | . BREAK + 10 | . CONTINUE + 11 | . stmt SEMICOLON + 11 | stmt . SEMICOLON + 12 | . stmt_list + 13 stmt_list: . stmt_list stmt + 14 | . stmt stmt + 14 | stmt . stmt + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN IF shift, and go to state 1 WHILE shift, and go to state 2 FOR shift, and go to state 3 FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - SEMICOLON shift, and go to state 58 + RETURN shift, and go to state 5 + BREAK shift, and go to state 6 + CONTINUE shift, and go to state 7 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + SEMICOLON shift, and go to state 63 $default reduce using rule 1 (program) - stmt go to state 59 - stmt_list go to state 16 - expr go to state 17 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + stmt go to state 64 + stmt_list go to state 19 + expr go to state 20 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 -State 16 +State 19 2 stmt: . expr 3 | . IF expr THEN stmt END 4 | . IF expr THEN stmt ELSE stmt END 5 | . WHILE expr DO stmt END 6 | . FOR IDENT IN expr DO stmt END - 7 | . stmt SEMICOLON - 8 | . stmt_list - 8 | stmt_list . [$end, IF, ELSE, WHILE, FOR, FUNC, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, LPAREN, LBRACKET, SEMICOLON] - 9 stmt_list: . stmt stmt - 10 | . stmt_list stmt - 10 | stmt_list . stmt - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 7 | . RETURN expr + 8 | . RETURN + 9 | . BREAK + 10 | . CONTINUE + 11 | . stmt SEMICOLON + 12 | . stmt_list + 12 | stmt_list . [$end, IF, ELSE, WHILE, FOR, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, LPAREN, LBRACKET, SEMICOLON] + 13 stmt_list: . stmt_list stmt + 13 | stmt_list . stmt + 14 | . stmt stmt + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN IF shift, and go to state 1 WHILE shift, and go to state 2 FOR shift, and go to state 3 FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - IF [reduce using rule 8 (stmt)] - WHILE [reduce using rule 8 (stmt)] - FOR [reduce using rule 8 (stmt)] - FUNC [reduce using rule 8 (stmt)] - IDENT [reduce using rule 8 (stmt)] - INT [reduce using rule 8 (stmt)] - FLOAT [reduce using rule 8 (stmt)] - STRING [reduce using rule 8 (stmt)] - BNOT [reduce using rule 8 (stmt)] - LNOT [reduce using rule 8 (stmt)] - LBRACE [reduce using rule 8 (stmt)] - LPAREN [reduce using rule 8 (stmt)] - LBRACKET [reduce using rule 8 (stmt)] - $default reduce using rule 8 (stmt) + RETURN shift, and go to state 5 + BREAK shift, and go to state 6 + CONTINUE shift, and go to state 7 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + IF [reduce using rule 12 (stmt)] + WHILE [reduce using rule 12 (stmt)] + FOR [reduce using rule 12 (stmt)] + FUNC [reduce using rule 12 (stmt)] + RETURN [reduce using rule 12 (stmt)] + BREAK [reduce using rule 12 (stmt)] + CONTINUE [reduce using rule 12 (stmt)] + IDENT [reduce using rule 12 (stmt)] + INT [reduce using rule 12 (stmt)] + FLOAT [reduce using rule 12 (stmt)] + STRING [reduce using rule 12 (stmt)] + BNOT [reduce using rule 12 (stmt)] + LNOT [reduce using rule 12 (stmt)] + LBRACE [reduce using rule 12 (stmt)] + LPAREN [reduce using rule 12 (stmt)] + LBRACKET [reduce using rule 12 (stmt)] + $default reduce using rule 12 (stmt) + + stmt go to state 65 + stmt_list go to state 19 + expr go to state 20 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 - stmt go to state 60 - stmt_list go to state 16 - expr go to state 17 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 +State 20 -State 17 - - 2 stmt: expr . [$end, IF, ELSE, WHILE, FOR, FUNC, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, LPAREN, LBRACKET, SEMICOLON] - 20 expr: expr . LBRACKET expr RBRACKET ASSIGN expr - 21 | expr . LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | expr . LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | expr . LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | expr . LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | expr . LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | expr . LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | expr . LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | expr . LBRACKET expr RBRACKET ASSIGNBXOR expr + 2 stmt: expr . [$end, IF, ELSE, WHILE, FOR, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, LPAREN, LBRACKET, SEMICOLON] + 64 index_expr: expr . LBRACKET expr RBRACKET + 65 | expr . DOT IDENT + 67 ex_index_expr: expr . LBRACKET expr RBRACKET + 68 | expr . DOT IDENT - LBRACKET shift, and go to state 61 + LBRACKET shift, and go to state 66 + DOT shift, and go to state 67 LBRACKET [reduce using rule 2 (stmt)] $default reduce using rule 2 (stmt) -State 18 - - 29 expr: logic_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - 30 logic_expr: logic_expr . LAND logic_expr - 31 | logic_expr . LOR logic_expr - - LAND shift, and go to state 62 - LOR shift, and go to state 63 - - $default reduce using rule 29 (expr) - - -State 19 - - 32 logic_expr: ulogic_expr . - - $default reduce using rule 32 (logic_expr) - - -State 20 - - 34 ulogic_expr: rel_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, BNOT, LAND, LOR, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - 35 rel_expr: rel_expr . EQUAL rel_expr - 36 | rel_expr . LESS rel_expr - 37 | rel_expr . GREATER rel_expr - 38 | rel_expr . LESSEQ rel_expr - 39 | rel_expr . GREATEREQ rel_expr - - EQUAL shift, and go to state 64 - LESS shift, and go to state 65 - GREATER shift, and go to state 66 - LESSEQ shift, and go to state 67 - GREATEREQ shift, and go to state 68 - - $default reduce using rule 34 (ulogic_expr) - - State 21 - 40 rel_expr: term_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - 41 term_expr: term_expr . PLUS term_expr - 42 | term_expr . MINUS term_expr + 33 expr: logic_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 34 logic_expr: logic_expr . LAND logic_expr + 35 | logic_expr . LOR logic_expr - PLUS shift, and go to state 69 - MINUS shift, and go to state 70 + LAND shift, and go to state 68 + LOR shift, and go to state 69 - $default reduce using rule 40 (rel_expr) + $default reduce using rule 33 (expr) State 22 - 43 term_expr: factor_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, PLUS, MINUS, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - 44 factor_expr: factor_expr . STAR factor_expr - 45 | factor_expr . SLASH factor_expr - - STAR shift, and go to state 71 - SLASH shift, and go to state 72 + 36 logic_expr: ulogic_expr . - $default reduce using rule 43 (term_expr) + $default reduce using rule 36 (logic_expr) State 23 - 46 factor_expr: power_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, PLUS, MINUS, STAR, SLASH, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - 47 power_expr: power_expr . DSTAR power_expr + 38 ulogic_expr: rel_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, BNOT, LAND, LOR, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 39 rel_expr: rel_expr . EQUAL rel_expr + 40 | rel_expr . LESS rel_expr + 41 | rel_expr . GREATER rel_expr + 42 | rel_expr . LESSEQ rel_expr + 43 | rel_expr . GREATEREQ rel_expr - DSTAR shift, and go to state 73 + EQUAL shift, and go to state 70 + LESS shift, and go to state 71 + GREATER shift, and go to state 72 + LESSEQ shift, and go to state 73 + GREATEREQ shift, and go to state 74 - $default reduce using rule 46 (factor_expr) + $default reduce using rule 38 (ulogic_expr) State 24 - 48 power_expr: binary_expr . + 44 rel_expr: term_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 45 term_expr: term_expr . PLUS term_expr + 46 | term_expr . MINUS term_expr - $default reduce using rule 48 (power_expr) + PLUS shift, and go to state 75 + MINUS shift, and go to state 76 + + $default reduce using rule 44 (rel_expr) State 25 - 49 binary_expr: ubinary_expr . BAND ubinary_expr - 50 | ubinary_expr . BOR ubinary_expr - 51 | ubinary_expr . BXOR ubinary_expr - 52 | ubinary_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, PLUS, MINUS, STAR, SLASH, DSTAR, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] + 47 term_expr: factor_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, PLUS, MINUS, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 48 factor_expr: factor_expr . STAR factor_expr + 49 | factor_expr . SLASH factor_expr - BAND shift, and go to state 74 - BOR shift, and go to state 75 - BXOR shift, and go to state 76 + STAR shift, and go to state 77 + SLASH shift, and go to state 78 - $default reduce using rule 52 (binary_expr) + $default reduce using rule 47 (term_expr) State 26 - 54 ubinary_expr: call_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, PLUS, MINUS, STAR, SLASH, DSTAR, BAND, BOR, BXOR, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - 55 call_expr: call_expr . LPAREN expr_list RPAREN + 50 factor_expr: power_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, PLUS, MINUS, STAR, SLASH, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 51 power_expr: power_expr . DSTAR power_expr - LPAREN shift, and go to state 77 + DSTAR shift, and go to state 79 - LPAREN [reduce using rule 54 (ubinary_expr)] - $default reduce using rule 54 (ubinary_expr) + $default reduce using rule 50 (factor_expr) State 27 - 56 call_expr: funcdecl_expr . + 52 power_expr: binary_expr . - $default reduce using rule 56 (call_expr) + $default reduce using rule 52 (power_expr) State 28 - 59 funcdecl_expr: ref_expr . + 53 binary_expr: ubinary_expr . BAND ubinary_expr + 54 | ubinary_expr . BOR ubinary_expr + 55 | ubinary_expr . BXOR ubinary_expr + 56 | ubinary_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, PLUS, MINUS, STAR, SLASH, DSTAR, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + + BAND shift, and go to state 80 + BOR shift, and go to state 81 + BXOR shift, and go to state 82 - $default reduce using rule 59 (funcdecl_expr) + $default reduce using rule 56 (binary_expr) State 29 - 61 ref_expr: index_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, PLUS, MINUS, STAR, SLASH, DSTAR, BAND, BOR, BXOR, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - 62 index_expr: index_expr . LBRACKET index_expr RBRACKET + 58 ubinary_expr: call_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, PLUS, MINUS, STAR, SLASH, DSTAR, BAND, BOR, BXOR, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 59 call_expr: call_expr . LPAREN expr_list RPAREN - LBRACKET shift, and go to state 78 + LPAREN shift, and go to state 83 - LBRACKET [reduce using rule 61 (ref_expr)] - $default reduce using rule 61 (ref_expr) + LPAREN [reduce using rule 58 (ubinary_expr)] + $default reduce using rule 58 (ubinary_expr) State 30 - 63 index_expr: lit_expr . + 60 call_expr: funcdecl_expr . - $default reduce using rule 63 (index_expr) + $default reduce using rule 60 (call_expr) State 31 - 67 lit_expr: gen_expr . + 63 funcdecl_expr: index_expr . - $default reduce using rule 67 (lit_expr) + $default reduce using rule 63 (funcdecl_expr) State 32 - 70 gen_expr: paren_expr . - - $default reduce using rule 70 (gen_expr) + 24 expr: ex_index_expr . ASSIGN expr + 25 | ex_index_expr . ASSIGNPLUS expr + 26 | ex_index_expr . ASSIGNMINUS expr + 27 | ex_index_expr . ASSIGNSTAR expr + 28 | ex_index_expr . ASSIGNSLASH expr + 29 | ex_index_expr . ASSIGNDSTAR expr + 30 | ex_index_expr . ASSIGNBAND expr + 31 | ex_index_expr . ASSIGNBOR expr + 32 | ex_index_expr . ASSIGNBXOR expr + + ASSIGN shift, and go to state 84 + ASSIGNPLUS shift, and go to state 85 + ASSIGNMINUS shift, and go to state 86 + ASSIGNSTAR shift, and go to state 87 + ASSIGNSLASH shift, and go to state 88 + ASSIGNDSTAR shift, and go to state 89 + ASSIGNBAND shift, and go to state 90 + ASSIGNBOR shift, and go to state 91 + ASSIGNBXOR shift, and go to state 92 State 33 - 3 stmt: IF expr . THEN stmt END - 4 | IF expr . THEN stmt ELSE stmt END - 20 expr: expr . LBRACKET expr RBRACKET ASSIGN expr - 21 | expr . LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | expr . LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | expr . LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | expr . LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | expr . LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | expr . LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | expr . LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | expr . LBRACKET expr RBRACKET ASSIGNBXOR expr + 66 index_expr: ref_expr . - THEN shift, and go to state 79 - LBRACKET shift, and go to state 61 + $default reduce using rule 66 (index_expr) State 34 - 5 stmt: WHILE expr . DO stmt END - 20 expr: expr . LBRACKET expr RBRACKET ASSIGN expr - 21 | expr . LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | expr . LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | expr . LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | expr . LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | expr . LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | expr . LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | expr . LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | expr . LBRACKET expr RBRACKET ASSIGNBXOR expr + 70 ref_expr: lit_expr . - DO shift, and go to state 80 - LBRACKET shift, and go to state 61 + $default reduce using rule 70 (ref_expr) State 35 - 6 stmt: FOR IDENT . IN expr DO stmt END + 74 lit_expr: gen_expr . - IN shift, and go to state 81 + $default reduce using rule 74 (lit_expr) State 36 - 57 funcdecl_expr: FUNC IDENT . LPAREN ident_list RPAREN stmt END + 77 gen_expr: paren_expr . - LPAREN shift, and go to state 82 + $default reduce using rule 77 (gen_expr) State 37 - 58 funcdecl_expr: FUNC LPAREN . ident_list RPAREN stmt END - 76 ident_list: . [IDENT, RPAREN, COMMA] - 77 | . IDENT - 78 | . ident_list IDENT - 79 | . ident_list COMMA IDENT - - IDENT shift, and go to state 83 - - IDENT [reduce using rule 76 (ident_list)] - $default reduce using rule 76 (ident_list) + 3 stmt: IF expr . THEN stmt END + 4 | IF expr . THEN stmt ELSE stmt END + 64 index_expr: expr . LBRACKET expr RBRACKET + 65 | expr . DOT IDENT + 67 ex_index_expr: expr . LBRACKET expr RBRACKET + 68 | expr . DOT IDENT - ident_list go to state 84 + THEN shift, and go to state 93 + LBRACKET shift, and go to state 66 + DOT shift, and go to state 67 State 38 - 11 expr: . IDENT ASSIGN expr - 11 | IDENT ASSIGN . expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 5 stmt: WHILE expr . DO stmt END + 64 index_expr: expr . LBRACKET expr RBRACKET + 65 | expr . DOT IDENT + 67 ex_index_expr: expr . LBRACKET expr RBRACKET + 68 | expr . DOT IDENT - FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - expr go to state 85 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + DO shift, and go to state 94 + LBRACKET shift, and go to state 66 + DOT shift, and go to state 67 State 39 - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 12 | IDENT ASSIGNPLUS . expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 6 stmt: FOR IDENT . IN expr DO stmt END - FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - expr go to state 86 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + IN shift, and go to state 95 State 40 - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 13 | IDENT ASSIGNMINUS . expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 61 funcdecl_expr: FUNC IDENT . LPAREN ident_list RPAREN stmt END - FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - expr go to state 87 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + LPAREN shift, and go to state 96 State 41 - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 14 | IDENT ASSIGNSTAR . expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 62 funcdecl_expr: FUNC LPAREN . ident_list RPAREN stmt END + 83 ident_list: . %empty [IDENT, RPAREN, COMMA] + 84 | . IDENT + 85 | . ident_list IDENT + 86 | . ident_list COMMA IDENT - FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - expr go to state 88 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + IDENT shift, and go to state 97 + + IDENT [reduce using rule 83 (ident_list)] + $default reduce using rule 83 (ident_list) + + ident_list go to state 98 State 42 - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 15 | IDENT ASSIGNSLASH . expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 7 stmt: RETURN expr . [$end, IF, ELSE, WHILE, FOR, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, LPAREN, LBRACKET, SEMICOLON] + 64 index_expr: expr . LBRACKET expr RBRACKET + 65 | expr . DOT IDENT + 67 ex_index_expr: expr . LBRACKET expr RBRACKET + 68 | expr . DOT IDENT - FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - expr go to state 89 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + LBRACKET shift, and go to state 66 + DOT shift, and go to state 67 + + LBRACKET [reduce using rule 7 (stmt)] + $default reduce using rule 7 (stmt) State 43 - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 16 | IDENT ASSIGNDSTAR . expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 15 expr: . IDENT ASSIGN expr + 15 | IDENT ASSIGN . expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - expr go to state 90 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 99 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 44 - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 17 | IDENT ASSIGNBAND . expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 16 | IDENT ASSIGNPLUS . expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - expr go to state 91 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 100 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 45 - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 18 | IDENT ASSIGNBOR . expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 17 | IDENT ASSIGNMINUS . expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - expr go to state 92 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 101 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 46 - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 19 | IDENT ASSIGNBXOR . expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 18 | IDENT ASSIGNSTAR . expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - expr go to state 93 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 102 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 47 - 60 ref_expr: IDENT . + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 19 | IDENT ASSIGNSLASH . expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN - $default reduce using rule 60 (ref_expr) + FUNC shift, and go to state 4 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 103 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 48 - 53 ubinary_expr: BNOT call_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, PLUS, MINUS, STAR, SLASH, DSTAR, BAND, BOR, BXOR, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - 55 call_expr: call_expr . LPAREN expr_list RPAREN - - LPAREN shift, and go to state 77 + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 20 | IDENT ASSIGNDSTAR . expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN - LPAREN [reduce using rule 53 (ubinary_expr)] - $default reduce using rule 53 (ubinary_expr) + FUNC shift, and go to state 4 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 104 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 49 - 33 ulogic_expr: LNOT ulogic_expr . + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 21 | IDENT ASSIGNBAND . expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN - $default reduce using rule 33 (ulogic_expr) + FUNC shift, and go to state 4 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 105 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 50 - 85 assoc_item: IDENT . ASSIGN expr + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 22 | IDENT ASSIGNBOR . expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN - ASSIGN shift, and go to state 94 + FUNC shift, and go to state 4 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 106 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 51 - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN - 84 assoc_item: LBRACKET . expr RBRACKET ASSIGN expr + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 23 | IDENT ASSIGNBXOR . expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - expr go to state 95 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 107 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 52 - 69 gen_expr: LBRACE assoc_list . RBRACE - 82 assoc_list: assoc_list . assoc_item - 83 | assoc_list . COMMA assoc_item - 84 assoc_item: . LBRACKET expr RBRACKET ASSIGN expr - 85 | . IDENT ASSIGN expr - - IDENT shift, and go to state 50 - RBRACE shift, and go to state 96 - LBRACKET shift, and go to state 51 - COMMA shift, and go to state 97 + 64 index_expr: expr . LBRACKET expr RBRACKET + 65 | expr . DOT IDENT + 67 ex_index_expr: expr . LBRACKET expr RBRACKET + 68 | expr . DOT IDENT - assoc_item go to state 98 + LBRACKET shift, and go to state 66 + DOT shift, and go to state 67 State 53 - 81 assoc_list: assoc_item . - - $default reduce using rule 81 (assoc_list) + 57 ubinary_expr: BNOT call_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, PLUS, MINUS, STAR, SLASH, DSTAR, BAND, BOR, BXOR, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 58 | call_expr . [PLUS, MINUS, STAR, SLASH, DSTAR, BAND, BOR, BXOR, LAND, LOR, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACKET, DOT] + 59 call_expr: call_expr . LPAREN expr_list RPAREN + + LPAREN shift, and go to state 83 + + PLUS reduce using rule 57 (ubinary_expr) + PLUS [reduce using rule 58 (ubinary_expr)] + MINUS reduce using rule 57 (ubinary_expr) + MINUS [reduce using rule 58 (ubinary_expr)] + STAR reduce using rule 57 (ubinary_expr) + STAR [reduce using rule 58 (ubinary_expr)] + SLASH reduce using rule 57 (ubinary_expr) + SLASH [reduce using rule 58 (ubinary_expr)] + DSTAR reduce using rule 57 (ubinary_expr) + DSTAR [reduce using rule 58 (ubinary_expr)] + BAND reduce using rule 57 (ubinary_expr) + BAND [reduce using rule 58 (ubinary_expr)] + BOR reduce using rule 57 (ubinary_expr) + BOR [reduce using rule 58 (ubinary_expr)] + BXOR reduce using rule 57 (ubinary_expr) + BXOR [reduce using rule 58 (ubinary_expr)] + LAND reduce using rule 57 (ubinary_expr) + LAND [reduce using rule 58 (ubinary_expr)] + LOR reduce using rule 57 (ubinary_expr) + LOR [reduce using rule 58 (ubinary_expr)] + EQUAL reduce using rule 57 (ubinary_expr) + EQUAL [reduce using rule 58 (ubinary_expr)] + LESS reduce using rule 57 (ubinary_expr) + LESS [reduce using rule 58 (ubinary_expr)] + GREATER reduce using rule 57 (ubinary_expr) + GREATER [reduce using rule 58 (ubinary_expr)] + LESSEQ reduce using rule 57 (ubinary_expr) + LESSEQ [reduce using rule 58 (ubinary_expr)] + GREATEREQ reduce using rule 57 (ubinary_expr) + GREATEREQ [reduce using rule 58 (ubinary_expr)] + LPAREN [reduce using rule 57 (ubinary_expr)] + LBRACKET reduce using rule 57 (ubinary_expr) + LBRACKET [reduce using rule 58 (ubinary_expr)] + DOT reduce using rule 57 (ubinary_expr) + DOT [reduce using rule 58 (ubinary_expr)] + $default reduce using rule 57 (ubinary_expr) State 54 - 20 expr: expr . LBRACKET expr RBRACKET ASSIGN expr - 21 | expr . LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | expr . LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | expr . LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | expr . LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | expr . LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | expr . LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | expr . LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | expr . LBRACKET expr RBRACKET ASSIGNBXOR expr - 71 paren_expr: LPAREN expr . RPAREN + 36 logic_expr: ulogic_expr . [LAND, LOR, LBRACKET, DOT] + 37 ulogic_expr: LNOT ulogic_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, BNOT, LAND, LOR, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] - RPAREN shift, and go to state 99 - LBRACKET shift, and go to state 61 + LAND reduce using rule 36 (logic_expr) + LAND [reduce using rule 37 (ulogic_expr)] + LOR reduce using rule 36 (logic_expr) + LOR [reduce using rule 37 (ulogic_expr)] + LBRACKET reduce using rule 36 (logic_expr) + LBRACKET [reduce using rule 37 (ulogic_expr)] + DOT reduce using rule 36 (logic_expr) + DOT [reduce using rule 37 (ulogic_expr)] + $default reduce using rule 37 (ulogic_expr) State 55 - 20 expr: expr . LBRACKET expr RBRACKET ASSIGN expr - 21 | expr . LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | expr . LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | expr . LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | expr . LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | expr . LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | expr . LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | expr . LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | expr . LBRACKET expr RBRACKET ASSIGNBXOR expr - 73 expr_list: expr . [FUNC, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, COMMA] - - LBRACKET shift, and go to state 61 + 92 assoc_item: IDENT . ASSIGN expr - LBRACKET [reduce using rule 73 (expr_list)] - $default reduce using rule 73 (expr_list) + ASSIGN shift, and go to state 108 State 56 - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 68 | LBRACKET expr_list . RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN - 74 expr_list: expr_list . expr - 75 | expr_list . COMMA expr + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN + 91 assoc_item: LBRACKET . expr RBRACKET ASSIGN expr FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - RBRACKET shift, and go to state 100 - COMMA shift, and go to state 101 - - expr go to state 102 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 109 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 57 - 0 $accept: program $end . + 76 gen_expr: LBRACE assoc_list . RBRACE + 89 assoc_list: assoc_list . assoc_item + 90 | assoc_list . COMMA assoc_item + 91 assoc_item: . LBRACKET expr RBRACKET ASSIGN expr + 92 | . IDENT ASSIGN expr - $default accept + IDENT shift, and go to state 55 + RBRACE shift, and go to state 110 + LBRACKET shift, and go to state 56 + COMMA shift, and go to state 111 + + assoc_item go to state 112 State 58 - 7 stmt: stmt SEMICOLON . + 88 assoc_list: assoc_item . - $default reduce using rule 7 (stmt) + $default reduce using rule 88 (assoc_list) State 59 - 2 stmt: . expr - 3 | . IF expr THEN stmt END - 4 | . IF expr THEN stmt ELSE stmt END - 5 | . WHILE expr DO stmt END - 6 | . FOR IDENT IN expr DO stmt END - 7 | . stmt SEMICOLON - 7 | stmt . SEMICOLON - 8 | . stmt_list - 9 stmt_list: . stmt stmt - 9 | stmt . stmt - 9 | stmt stmt . [$end, IF, ELSE, WHILE, FOR, FUNC, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, LPAREN, LBRACKET, SEMICOLON] - 10 | . stmt_list stmt - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 64 index_expr: expr . LBRACKET expr RBRACKET + 65 | expr . DOT IDENT + 67 ex_index_expr: expr . LBRACKET expr RBRACKET + 68 | expr . DOT IDENT + 78 paren_expr: LPAREN expr . RPAREN - IF shift, and go to state 1 - WHILE shift, and go to state 2 - FOR shift, and go to state 3 - FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - SEMICOLON shift, and go to state 58 - - IF [reduce using rule 9 (stmt_list)] - WHILE [reduce using rule 9 (stmt_list)] - FOR [reduce using rule 9 (stmt_list)] - FUNC [reduce using rule 9 (stmt_list)] - IDENT [reduce using rule 9 (stmt_list)] - INT [reduce using rule 9 (stmt_list)] - FLOAT [reduce using rule 9 (stmt_list)] - STRING [reduce using rule 9 (stmt_list)] - BNOT [reduce using rule 9 (stmt_list)] - LNOT [reduce using rule 9 (stmt_list)] - LBRACE [reduce using rule 9 (stmt_list)] - LPAREN [reduce using rule 9 (stmt_list)] - LBRACKET [reduce using rule 9 (stmt_list)] - SEMICOLON [reduce using rule 9 (stmt_list)] - $default reduce using rule 9 (stmt_list) - - stmt go to state 59 - stmt_list go to state 16 - expr go to state 17 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + RPAREN shift, and go to state 113 + LBRACKET shift, and go to state 66 + DOT shift, and go to state 67 State 60 - 2 stmt: . expr - 3 | . IF expr THEN stmt END - 4 | . IF expr THEN stmt ELSE stmt END - 5 | . WHILE expr DO stmt END - 6 | . FOR IDENT IN expr DO stmt END - 7 | . stmt SEMICOLON - 7 | stmt . SEMICOLON - 8 | . stmt_list - 9 stmt_list: . stmt stmt - 9 | stmt . stmt - 10 | . stmt_list stmt - 10 | stmt_list stmt . [$end, IF, ELSE, WHILE, FOR, FUNC, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, LPAREN, LBRACKET, SEMICOLON] - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 64 index_expr: expr . LBRACKET expr RBRACKET + 65 | expr . DOT IDENT + 67 ex_index_expr: expr . LBRACKET expr RBRACKET + 68 | expr . DOT IDENT + 80 expr_list: expr . [FUNC, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, COMMA] - IF shift, and go to state 1 - WHILE shift, and go to state 2 - FOR shift, and go to state 3 - FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - SEMICOLON shift, and go to state 58 - - IF [reduce using rule 10 (stmt_list)] - WHILE [reduce using rule 10 (stmt_list)] - FOR [reduce using rule 10 (stmt_list)] - FUNC [reduce using rule 10 (stmt_list)] - IDENT [reduce using rule 10 (stmt_list)] - INT [reduce using rule 10 (stmt_list)] - FLOAT [reduce using rule 10 (stmt_list)] - STRING [reduce using rule 10 (stmt_list)] - BNOT [reduce using rule 10 (stmt_list)] - LNOT [reduce using rule 10 (stmt_list)] - LBRACE [reduce using rule 10 (stmt_list)] - LPAREN [reduce using rule 10 (stmt_list)] - LBRACKET [reduce using rule 10 (stmt_list)] - SEMICOLON [reduce using rule 10 (stmt_list)] - $default reduce using rule 10 (stmt_list) - - stmt go to state 59 - stmt_list go to state 16 - expr go to state 17 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + LBRACKET shift, and go to state 66 + DOT shift, and go to state 67 + + LBRACKET [reduce using rule 80 (expr_list)] + $default reduce using rule 80 (expr_list) State 61 - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 20 | expr LBRACKET . expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 21 | expr LBRACKET . expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 22 | expr LBRACKET . expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 23 | expr LBRACKET . expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 24 | expr LBRACKET . expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 25 | expr LBRACKET . expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 26 | expr LBRACKET . expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 27 | expr LBRACKET . expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 28 | expr LBRACKET . expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 75 | LBRACKET expr_list . RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN + 81 expr_list: expr_list . expr + 82 | expr_list . COMMA expr FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - expr go to state 103 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + RBRACKET shift, and go to state 114 + COMMA shift, and go to state 115 + + expr go to state 116 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 62 - 30 logic_expr: . logic_expr LAND logic_expr - 30 | logic_expr LAND . logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 0 $accept: program $end . - FUNC shift, and go to state 4 - IDENT shift, and go to state 47 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - logic_expr go to state 104 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + $default accept State 63 - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 31 | logic_expr LOR . logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 11 stmt: stmt SEMICOLON . - FUNC shift, and go to state 4 - IDENT shift, and go to state 47 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - logic_expr go to state 105 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + $default reduce using rule 11 (stmt) State 64 - 35 rel_expr: . rel_expr EQUAL rel_expr - 35 | rel_expr EQUAL . rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 2 stmt: . expr + 3 | . IF expr THEN stmt END + 4 | . IF expr THEN stmt ELSE stmt END + 5 | . WHILE expr DO stmt END + 6 | . FOR IDENT IN expr DO stmt END + 7 | . RETURN expr + 8 | . RETURN + 9 | . BREAK + 10 | . CONTINUE + 11 | . stmt SEMICOLON + 11 | stmt . SEMICOLON + 12 | . stmt_list + 13 stmt_list: . stmt_list stmt + 14 | . stmt stmt + 14 | stmt . stmt + 14 | stmt stmt . [$end, IF, ELSE, WHILE, FOR, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, LPAREN, LBRACKET, SEMICOLON] + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN - FUNC shift, and go to state 4 - IDENT shift, and go to state 47 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - rel_expr go to state 106 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + IF shift, and go to state 1 + WHILE shift, and go to state 2 + FOR shift, and go to state 3 + FUNC shift, and go to state 4 + RETURN shift, and go to state 5 + BREAK shift, and go to state 6 + CONTINUE shift, and go to state 7 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + SEMICOLON shift, and go to state 63 + + IF [reduce using rule 14 (stmt_list)] + WHILE [reduce using rule 14 (stmt_list)] + FOR [reduce using rule 14 (stmt_list)] + FUNC [reduce using rule 14 (stmt_list)] + RETURN [reduce using rule 14 (stmt_list)] + BREAK [reduce using rule 14 (stmt_list)] + CONTINUE [reduce using rule 14 (stmt_list)] + IDENT [reduce using rule 14 (stmt_list)] + INT [reduce using rule 14 (stmt_list)] + FLOAT [reduce using rule 14 (stmt_list)] + STRING [reduce using rule 14 (stmt_list)] + BNOT [reduce using rule 14 (stmt_list)] + LNOT [reduce using rule 14 (stmt_list)] + LBRACE [reduce using rule 14 (stmt_list)] + LPAREN [reduce using rule 14 (stmt_list)] + LBRACKET [reduce using rule 14 (stmt_list)] + SEMICOLON [reduce using rule 14 (stmt_list)] + $default reduce using rule 14 (stmt_list) + + stmt go to state 64 + stmt_list go to state 19 + expr go to state 20 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 65 - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 36 | rel_expr LESS . rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 2 stmt: . expr + 3 | . IF expr THEN stmt END + 4 | . IF expr THEN stmt ELSE stmt END + 5 | . WHILE expr DO stmt END + 6 | . FOR IDENT IN expr DO stmt END + 7 | . RETURN expr + 8 | . RETURN + 9 | . BREAK + 10 | . CONTINUE + 11 | . stmt SEMICOLON + 11 | stmt . SEMICOLON + 12 | . stmt_list + 13 stmt_list: . stmt_list stmt + 13 | stmt_list stmt . [$end, IF, ELSE, WHILE, FOR, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, LPAREN, LBRACKET, SEMICOLON] + 14 | . stmt stmt + 14 | stmt . stmt + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN - FUNC shift, and go to state 4 - IDENT shift, and go to state 47 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - rel_expr go to state 107 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + IF shift, and go to state 1 + WHILE shift, and go to state 2 + FOR shift, and go to state 3 + FUNC shift, and go to state 4 + RETURN shift, and go to state 5 + BREAK shift, and go to state 6 + CONTINUE shift, and go to state 7 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + SEMICOLON shift, and go to state 63 + + IF [reduce using rule 13 (stmt_list)] + WHILE [reduce using rule 13 (stmt_list)] + FOR [reduce using rule 13 (stmt_list)] + FUNC [reduce using rule 13 (stmt_list)] + RETURN [reduce using rule 13 (stmt_list)] + BREAK [reduce using rule 13 (stmt_list)] + CONTINUE [reduce using rule 13 (stmt_list)] + IDENT [reduce using rule 13 (stmt_list)] + INT [reduce using rule 13 (stmt_list)] + FLOAT [reduce using rule 13 (stmt_list)] + STRING [reduce using rule 13 (stmt_list)] + BNOT [reduce using rule 13 (stmt_list)] + LNOT [reduce using rule 13 (stmt_list)] + LBRACE [reduce using rule 13 (stmt_list)] + LPAREN [reduce using rule 13 (stmt_list)] + LBRACKET [reduce using rule 13 (stmt_list)] + SEMICOLON [reduce using rule 13 (stmt_list)] + $default reduce using rule 13 (stmt_list) + + stmt go to state 64 + stmt_list go to state 19 + expr go to state 20 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 66 - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 37 | rel_expr GREATER . rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 64 | expr LBRACKET . expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 67 | expr LBRACKET . expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN FUNC shift, and go to state 4 - IDENT shift, and go to state 47 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - rel_expr go to state 108 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 117 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 67 - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 38 | rel_expr LESSEQ . rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 65 index_expr: expr DOT . IDENT + 68 ex_index_expr: expr DOT . IDENT - FUNC shift, and go to state 4 - IDENT shift, and go to state 47 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - rel_expr go to state 109 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + IDENT shift, and go to state 118 State 68 - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 39 | rel_expr GREATEREQ . rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 34 | logic_expr LAND . logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN FUNC shift, and go to state 4 - IDENT shift, and go to state 47 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - rel_expr go to state 110 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 52 + logic_expr go to state 119 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 69 - 41 term_expr: . term_expr PLUS term_expr - 41 | term_expr PLUS . term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 35 | logic_expr LOR . logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN FUNC shift, and go to state 4 - IDENT shift, and go to state 47 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - term_expr go to state 111 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 52 + logic_expr go to state 120 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 70 - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 42 | term_expr MINUS . term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 39 | rel_expr EQUAL . rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN FUNC shift, and go to state 4 - IDENT shift, and go to state 47 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - term_expr go to state 112 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 52 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 121 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 71 - 44 factor_expr: . factor_expr STAR factor_expr - 44 | factor_expr STAR . factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 40 | rel_expr LESS . rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN FUNC shift, and go to state 4 - IDENT shift, and go to state 47 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - factor_expr go to state 113 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 52 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 122 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 72 - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 45 | factor_expr SLASH . factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 41 | rel_expr GREATER . rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN FUNC shift, and go to state 4 - IDENT shift, and go to state 47 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - factor_expr go to state 114 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 52 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 123 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 73 - 47 power_expr: . power_expr DSTAR power_expr - 47 | power_expr DSTAR . power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 42 | rel_expr LESSEQ . rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN FUNC shift, and go to state 4 - IDENT shift, and go to state 47 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - power_expr go to state 115 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 52 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 124 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 74 - 49 binary_expr: ubinary_expr BAND . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 43 | rel_expr GREATEREQ . rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN FUNC shift, and go to state 4 - IDENT shift, and go to state 47 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - ubinary_expr go to state 116 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 52 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 125 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 75 - 50 binary_expr: ubinary_expr BOR . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 45 | term_expr PLUS . term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN FUNC shift, and go to state 4 - IDENT shift, and go to state 47 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - ubinary_expr go to state 117 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 52 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 126 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 76 - 51 binary_expr: ubinary_expr BXOR . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 46 | term_expr MINUS . term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN FUNC shift, and go to state 4 - IDENT shift, and go to state 47 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - ubinary_expr go to state 118 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 52 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 127 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 77 - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 55 | call_expr LPAREN . expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN - 72 expr_list: . [FUNC, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, LPAREN, RPAREN, LBRACKET, COMMA] - 73 | . expr - 74 | . expr_list expr - 75 | . expr_list COMMA expr + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 48 | factor_expr STAR . factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - FUNC [reduce using rule 72 (expr_list)] - IDENT [reduce using rule 72 (expr_list)] - INT [reduce using rule 72 (expr_list)] - FLOAT [reduce using rule 72 (expr_list)] - STRING [reduce using rule 72 (expr_list)] - BNOT [reduce using rule 72 (expr_list)] - LNOT [reduce using rule 72 (expr_list)] - LBRACE [reduce using rule 72 (expr_list)] - LPAREN [reduce using rule 72 (expr_list)] - LBRACKET [reduce using rule 72 (expr_list)] - $default reduce using rule 72 (expr_list) - - expr go to state 55 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 - expr_list go to state 119 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 52 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 128 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 78 - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 62 | index_expr LBRACKET . index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN - - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - index_expr go to state 120 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 49 | factor_expr SLASH . factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN + + FUNC shift, and go to state 4 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 52 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 129 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 79 - 2 stmt: . expr - 3 | . IF expr THEN stmt END - 3 | IF expr THEN . stmt END - 4 | . IF expr THEN stmt ELSE stmt END - 4 | IF expr THEN . stmt ELSE stmt END - 5 | . WHILE expr DO stmt END - 6 | . FOR IDENT IN expr DO stmt END - 7 | . stmt SEMICOLON - 8 | . stmt_list - 9 stmt_list: . stmt stmt - 10 | . stmt_list stmt - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 51 | power_expr DSTAR . power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN - IF shift, and go to state 1 - WHILE shift, and go to state 2 - FOR shift, and go to state 3 FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - stmt go to state 121 - stmt_list go to state 16 - expr go to state 17 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 52 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 130 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 80 - 2 stmt: . expr - 3 | . IF expr THEN stmt END - 4 | . IF expr THEN stmt ELSE stmt END - 5 | . WHILE expr DO stmt END - 5 | WHILE expr DO . stmt END - 6 | . FOR IDENT IN expr DO stmt END - 7 | . stmt SEMICOLON - 8 | . stmt_list - 9 stmt_list: . stmt stmt - 10 | . stmt_list stmt - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 53 | ubinary_expr BAND . ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN - IF shift, and go to state 1 - WHILE shift, and go to state 2 - FOR shift, and go to state 3 FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - stmt go to state 122 - stmt_list go to state 16 - expr go to state 17 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 52 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 131 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 81 - 6 stmt: FOR IDENT IN . expr DO stmt END - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 54 | ubinary_expr BOR . ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - expr go to state 123 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 52 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 132 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 82 - 57 funcdecl_expr: FUNC IDENT LPAREN . ident_list RPAREN stmt END - 76 ident_list: . [IDENT, RPAREN, COMMA] - 77 | . IDENT - 78 | . ident_list IDENT - 79 | . ident_list COMMA IDENT + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 55 | ubinary_expr BXOR . ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN - IDENT shift, and go to state 83 - - IDENT [reduce using rule 76 (ident_list)] - $default reduce using rule 76 (ident_list) - - ident_list go to state 124 + FUNC shift, and go to state 4 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 52 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 133 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 83 - 77 ident_list: IDENT . + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 59 | call_expr LPAREN . expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN + 79 expr_list: . %empty [FUNC, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, LPAREN, RPAREN, LBRACKET, COMMA] + 80 | . expr + 81 | . expr_list expr + 82 | . expr_list COMMA expr - $default reduce using rule 77 (ident_list) + FUNC shift, and go to state 4 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + FUNC [reduce using rule 79 (expr_list)] + IDENT [reduce using rule 79 (expr_list)] + INT [reduce using rule 79 (expr_list)] + FLOAT [reduce using rule 79 (expr_list)] + STRING [reduce using rule 79 (expr_list)] + BNOT [reduce using rule 79 (expr_list)] + LNOT [reduce using rule 79 (expr_list)] + LBRACE [reduce using rule 79 (expr_list)] + LPAREN [reduce using rule 79 (expr_list)] + LBRACKET [reduce using rule 79 (expr_list)] + $default reduce using rule 79 (expr_list) + + expr go to state 60 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 + expr_list go to state 134 State 84 - 58 funcdecl_expr: FUNC LPAREN ident_list . RPAREN stmt END - 78 ident_list: ident_list . IDENT - 79 | ident_list . COMMA IDENT + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 24 | ex_index_expr ASSIGN . expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN - IDENT shift, and go to state 125 - RPAREN shift, and go to state 126 - COMMA shift, and go to state 127 + FUNC shift, and go to state 4 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 135 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 85 - 11 expr: IDENT ASSIGN expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - 20 | expr . LBRACKET expr RBRACKET ASSIGN expr - 21 | expr . LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | expr . LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | expr . LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | expr . LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | expr . LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | expr . LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | expr . LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | expr . LBRACKET expr RBRACKET ASSIGNBXOR expr - - LBRACKET shift, and go to state 61 + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 25 | ex_index_expr ASSIGNPLUS . expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN - LBRACKET [reduce using rule 11 (expr)] - $default reduce using rule 11 (expr) + FUNC shift, and go to state 4 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 136 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 86 - 12 expr: IDENT ASSIGNPLUS expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - 20 | expr . LBRACKET expr RBRACKET ASSIGN expr - 21 | expr . LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | expr . LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | expr . LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | expr . LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | expr . LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | expr . LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | expr . LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | expr . LBRACKET expr RBRACKET ASSIGNBXOR expr - - LBRACKET shift, and go to state 61 + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 26 | ex_index_expr ASSIGNMINUS . expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN - LBRACKET [reduce using rule 12 (expr)] - $default reduce using rule 12 (expr) + FUNC shift, and go to state 4 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 137 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 87 - 13 expr: IDENT ASSIGNMINUS expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - 20 | expr . LBRACKET expr RBRACKET ASSIGN expr - 21 | expr . LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | expr . LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | expr . LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | expr . LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | expr . LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | expr . LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | expr . LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | expr . LBRACKET expr RBRACKET ASSIGNBXOR expr - - LBRACKET shift, and go to state 61 + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 27 | ex_index_expr ASSIGNSTAR . expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN - LBRACKET [reduce using rule 13 (expr)] - $default reduce using rule 13 (expr) + FUNC shift, and go to state 4 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 138 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 88 - 14 expr: IDENT ASSIGNSTAR expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - 20 | expr . LBRACKET expr RBRACKET ASSIGN expr - 21 | expr . LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | expr . LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | expr . LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | expr . LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | expr . LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | expr . LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | expr . LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | expr . LBRACKET expr RBRACKET ASSIGNBXOR expr - - LBRACKET shift, and go to state 61 + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 28 | ex_index_expr ASSIGNSLASH . expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN - LBRACKET [reduce using rule 14 (expr)] - $default reduce using rule 14 (expr) + FUNC shift, and go to state 4 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 139 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 89 - 15 expr: IDENT ASSIGNSLASH expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - 20 | expr . LBRACKET expr RBRACKET ASSIGN expr - 21 | expr . LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | expr . LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | expr . LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | expr . LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | expr . LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | expr . LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | expr . LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | expr . LBRACKET expr RBRACKET ASSIGNBXOR expr - - LBRACKET shift, and go to state 61 + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 29 | ex_index_expr ASSIGNDSTAR . expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN - LBRACKET [reduce using rule 15 (expr)] - $default reduce using rule 15 (expr) + FUNC shift, and go to state 4 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 140 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 90 - 16 expr: IDENT ASSIGNDSTAR expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - 20 | expr . LBRACKET expr RBRACKET ASSIGN expr - 21 | expr . LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | expr . LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | expr . LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | expr . LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | expr . LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | expr . LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | expr . LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | expr . LBRACKET expr RBRACKET ASSIGNBXOR expr - - LBRACKET shift, and go to state 61 + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 30 | ex_index_expr ASSIGNBAND . expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN - LBRACKET [reduce using rule 16 (expr)] - $default reduce using rule 16 (expr) + FUNC shift, and go to state 4 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 141 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 91 - 17 expr: IDENT ASSIGNBAND expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - 20 | expr . LBRACKET expr RBRACKET ASSIGN expr - 21 | expr . LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | expr . LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | expr . LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | expr . LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | expr . LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | expr . LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | expr . LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | expr . LBRACKET expr RBRACKET ASSIGNBXOR expr - - LBRACKET shift, and go to state 61 + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 31 | ex_index_expr ASSIGNBOR . expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN - LBRACKET [reduce using rule 17 (expr)] - $default reduce using rule 17 (expr) + FUNC shift, and go to state 4 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 142 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 92 - 18 expr: IDENT ASSIGNBOR expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - 20 | expr . LBRACKET expr RBRACKET ASSIGN expr - 21 | expr . LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | expr . LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | expr . LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | expr . LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | expr . LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | expr . LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | expr . LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | expr . LBRACKET expr RBRACKET ASSIGNBXOR expr - - LBRACKET shift, and go to state 61 + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 32 | ex_index_expr ASSIGNBXOR . expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN - LBRACKET [reduce using rule 18 (expr)] - $default reduce using rule 18 (expr) + FUNC shift, and go to state 4 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 143 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 93 - 19 expr: IDENT ASSIGNBXOR expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - 20 | expr . LBRACKET expr RBRACKET ASSIGN expr - 21 | expr . LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | expr . LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | expr . LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | expr . LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | expr . LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | expr . LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | expr . LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | expr . LBRACKET expr RBRACKET ASSIGNBXOR expr - - LBRACKET shift, and go to state 61 + 2 stmt: . expr + 3 | . IF expr THEN stmt END + 3 | IF expr THEN . stmt END + 4 | . IF expr THEN stmt ELSE stmt END + 4 | IF expr THEN . stmt ELSE stmt END + 5 | . WHILE expr DO stmt END + 6 | . FOR IDENT IN expr DO stmt END + 7 | . RETURN expr + 8 | . RETURN + 9 | . BREAK + 10 | . CONTINUE + 11 | . stmt SEMICOLON + 12 | . stmt_list + 13 stmt_list: . stmt_list stmt + 14 | . stmt stmt + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN - LBRACKET [reduce using rule 19 (expr)] - $default reduce using rule 19 (expr) + IF shift, and go to state 1 + WHILE shift, and go to state 2 + FOR shift, and go to state 3 + FUNC shift, and go to state 4 + RETURN shift, and go to state 5 + BREAK shift, and go to state 6 + CONTINUE shift, and go to state 7 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + stmt go to state 144 + stmt_list go to state 19 + expr go to state 20 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 94 - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN - 85 assoc_item: IDENT ASSIGN . expr + 2 stmt: . expr + 3 | . IF expr THEN stmt END + 4 | . IF expr THEN stmt ELSE stmt END + 5 | . WHILE expr DO stmt END + 5 | WHILE expr DO . stmt END + 6 | . FOR IDENT IN expr DO stmt END + 7 | . RETURN expr + 8 | . RETURN + 9 | . BREAK + 10 | . CONTINUE + 11 | . stmt SEMICOLON + 12 | . stmt_list + 13 stmt_list: . stmt_list stmt + 14 | . stmt stmt + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN + IF shift, and go to state 1 + WHILE shift, and go to state 2 + FOR shift, and go to state 3 FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - expr go to state 128 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + RETURN shift, and go to state 5 + BREAK shift, and go to state 6 + CONTINUE shift, and go to state 7 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + stmt go to state 145 + stmt_list go to state 19 + expr go to state 20 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 95 - 20 expr: expr . LBRACKET expr RBRACKET ASSIGN expr - 21 | expr . LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | expr . LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | expr . LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | expr . LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | expr . LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | expr . LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | expr . LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | expr . LBRACKET expr RBRACKET ASSIGNBXOR expr - 84 assoc_item: LBRACKET expr . RBRACKET ASSIGN expr + 6 stmt: FOR IDENT IN . expr DO stmt END + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN - LBRACKET shift, and go to state 61 - RBRACKET shift, and go to state 129 + FUNC shift, and go to state 4 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 146 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 96 - 69 gen_expr: LBRACE assoc_list RBRACE . + 61 funcdecl_expr: FUNC IDENT LPAREN . ident_list RPAREN stmt END + 83 ident_list: . %empty [IDENT, RPAREN, COMMA] + 84 | . IDENT + 85 | . ident_list IDENT + 86 | . ident_list COMMA IDENT - $default reduce using rule 69 (gen_expr) + IDENT shift, and go to state 97 + IDENT [reduce using rule 83 (ident_list)] + $default reduce using rule 83 (ident_list) + + ident_list go to state 147 -State 97 - 83 assoc_list: assoc_list COMMA . assoc_item - 84 assoc_item: . LBRACKET expr RBRACKET ASSIGN expr - 85 | . IDENT ASSIGN expr +State 97 - IDENT shift, and go to state 50 - LBRACKET shift, and go to state 51 + 84 ident_list: IDENT . - assoc_item go to state 130 + $default reduce using rule 84 (ident_list) State 98 - 82 assoc_list: assoc_list assoc_item . + 62 funcdecl_expr: FUNC LPAREN ident_list . RPAREN stmt END + 85 ident_list: ident_list . IDENT + 86 | ident_list . COMMA IDENT - $default reduce using rule 82 (assoc_list) + IDENT shift, and go to state 148 + RPAREN shift, and go to state 149 + COMMA shift, and go to state 150 State 99 - 71 paren_expr: LPAREN expr RPAREN . + 15 expr: IDENT ASSIGN expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 64 index_expr: expr . LBRACKET expr RBRACKET + 65 | expr . DOT IDENT + 67 ex_index_expr: expr . LBRACKET expr RBRACKET + 68 | expr . DOT IDENT + + LBRACKET shift, and go to state 66 + DOT shift, and go to state 67 - $default reduce using rule 71 (paren_expr) + LBRACKET [reduce using rule 15 (expr)] + DOT [reduce using rule 15 (expr)] + $default reduce using rule 15 (expr) State 100 - 68 gen_expr: LBRACKET expr_list RBRACKET . + 16 expr: IDENT ASSIGNPLUS expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 64 index_expr: expr . LBRACKET expr RBRACKET + 65 | expr . DOT IDENT + 67 ex_index_expr: expr . LBRACKET expr RBRACKET + 68 | expr . DOT IDENT - $default reduce using rule 68 (gen_expr) + LBRACKET shift, and go to state 66 + DOT shift, and go to state 67 + + LBRACKET [reduce using rule 16 (expr)] + DOT [reduce using rule 16 (expr)] + $default reduce using rule 16 (expr) State 101 - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN - 75 expr_list: expr_list COMMA . expr + 17 expr: IDENT ASSIGNMINUS expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 64 index_expr: expr . LBRACKET expr RBRACKET + 65 | expr . DOT IDENT + 67 ex_index_expr: expr . LBRACKET expr RBRACKET + 68 | expr . DOT IDENT - FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - expr go to state 131 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + LBRACKET shift, and go to state 66 + DOT shift, and go to state 67 + + LBRACKET [reduce using rule 17 (expr)] + DOT [reduce using rule 17 (expr)] + $default reduce using rule 17 (expr) State 102 - 20 expr: expr . LBRACKET expr RBRACKET ASSIGN expr - 21 | expr . LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | expr . LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | expr . LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | expr . LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | expr . LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | expr . LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | expr . LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | expr . LBRACKET expr RBRACKET ASSIGNBXOR expr - 74 expr_list: expr_list expr . [FUNC, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, COMMA] + 18 expr: IDENT ASSIGNSTAR expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 64 index_expr: expr . LBRACKET expr RBRACKET + 65 | expr . DOT IDENT + 67 ex_index_expr: expr . LBRACKET expr RBRACKET + 68 | expr . DOT IDENT - LBRACKET shift, and go to state 61 + LBRACKET shift, and go to state 66 + DOT shift, and go to state 67 - LBRACKET [reduce using rule 74 (expr_list)] - $default reduce using rule 74 (expr_list) + LBRACKET [reduce using rule 18 (expr)] + DOT [reduce using rule 18 (expr)] + $default reduce using rule 18 (expr) State 103 - 20 expr: expr . LBRACKET expr RBRACKET ASSIGN expr - 20 | expr LBRACKET expr . RBRACKET ASSIGN expr - 21 | expr . LBRACKET expr RBRACKET ASSIGNPLUS expr - 21 | expr LBRACKET expr . RBRACKET ASSIGNPLUS expr - 22 | expr . LBRACKET expr RBRACKET ASSIGNMINUS expr - 22 | expr LBRACKET expr . RBRACKET ASSIGNMINUS expr - 23 | expr . LBRACKET expr RBRACKET ASSIGNSTAR expr - 23 | expr LBRACKET expr . RBRACKET ASSIGNSTAR expr - 24 | expr . LBRACKET expr RBRACKET ASSIGNSLASH expr - 24 | expr LBRACKET expr . RBRACKET ASSIGNSLASH expr - 25 | expr . LBRACKET expr RBRACKET ASSIGNDSTAR expr - 25 | expr LBRACKET expr . RBRACKET ASSIGNDSTAR expr - 26 | expr . LBRACKET expr RBRACKET ASSIGNBAND expr - 26 | expr LBRACKET expr . RBRACKET ASSIGNBAND expr - 27 | expr . LBRACKET expr RBRACKET ASSIGNBOR expr - 27 | expr LBRACKET expr . RBRACKET ASSIGNBOR expr - 28 | expr . LBRACKET expr RBRACKET ASSIGNBXOR expr - 28 | expr LBRACKET expr . RBRACKET ASSIGNBXOR expr - - LBRACKET shift, and go to state 61 - RBRACKET shift, and go to state 132 + 19 expr: IDENT ASSIGNSLASH expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 64 index_expr: expr . LBRACKET expr RBRACKET + 65 | expr . DOT IDENT + 67 ex_index_expr: expr . LBRACKET expr RBRACKET + 68 | expr . DOT IDENT + LBRACKET shift, and go to state 66 + DOT shift, and go to state 67 -State 104 + LBRACKET [reduce using rule 19 (expr)] + DOT [reduce using rule 19 (expr)] + $default reduce using rule 19 (expr) - 30 logic_expr: logic_expr . LAND logic_expr - 30 | logic_expr LAND logic_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, BNOT, LAND, LOR, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - 31 | logic_expr . LOR logic_expr - LAND shift, and go to state 62 - LOR shift, and go to state 63 +State 104 + + 20 expr: IDENT ASSIGNDSTAR expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 64 index_expr: expr . LBRACKET expr RBRACKET + 65 | expr . DOT IDENT + 67 ex_index_expr: expr . LBRACKET expr RBRACKET + 68 | expr . DOT IDENT + + LBRACKET shift, and go to state 66 + DOT shift, and go to state 67 - LAND [reduce using rule 30 (logic_expr)] - LOR [reduce using rule 30 (logic_expr)] - $default reduce using rule 30 (logic_expr) + LBRACKET [reduce using rule 20 (expr)] + DOT [reduce using rule 20 (expr)] + $default reduce using rule 20 (expr) State 105 - 30 logic_expr: logic_expr . LAND logic_expr - 31 | logic_expr . LOR logic_expr - 31 | logic_expr LOR logic_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, BNOT, LAND, LOR, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] + 21 expr: IDENT ASSIGNBAND expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 64 index_expr: expr . LBRACKET expr RBRACKET + 65 | expr . DOT IDENT + 67 ex_index_expr: expr . LBRACKET expr RBRACKET + 68 | expr . DOT IDENT - LAND shift, and go to state 62 - LOR shift, and go to state 63 + LBRACKET shift, and go to state 66 + DOT shift, and go to state 67 - LAND [reduce using rule 31 (logic_expr)] - LOR [reduce using rule 31 (logic_expr)] - $default reduce using rule 31 (logic_expr) + LBRACKET [reduce using rule 21 (expr)] + DOT [reduce using rule 21 (expr)] + $default reduce using rule 21 (expr) State 106 - 35 rel_expr: rel_expr . EQUAL rel_expr - 35 | rel_expr EQUAL rel_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - 36 | rel_expr . LESS rel_expr - 37 | rel_expr . GREATER rel_expr - 38 | rel_expr . LESSEQ rel_expr - 39 | rel_expr . GREATEREQ rel_expr + 22 expr: IDENT ASSIGNBOR expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 64 index_expr: expr . LBRACKET expr RBRACKET + 65 | expr . DOT IDENT + 67 ex_index_expr: expr . LBRACKET expr RBRACKET + 68 | expr . DOT IDENT - EQUAL shift, and go to state 64 - LESS shift, and go to state 65 - GREATER shift, and go to state 66 - LESSEQ shift, and go to state 67 - GREATEREQ shift, and go to state 68 + LBRACKET shift, and go to state 66 + DOT shift, and go to state 67 - EQUAL [reduce using rule 35 (rel_expr)] - LESS [reduce using rule 35 (rel_expr)] - GREATER [reduce using rule 35 (rel_expr)] - LESSEQ [reduce using rule 35 (rel_expr)] - GREATEREQ [reduce using rule 35 (rel_expr)] - $default reduce using rule 35 (rel_expr) + LBRACKET [reduce using rule 22 (expr)] + DOT [reduce using rule 22 (expr)] + $default reduce using rule 22 (expr) State 107 - 35 rel_expr: rel_expr . EQUAL rel_expr - 36 | rel_expr . LESS rel_expr - 36 | rel_expr LESS rel_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - 37 | rel_expr . GREATER rel_expr - 38 | rel_expr . LESSEQ rel_expr - 39 | rel_expr . GREATEREQ rel_expr + 23 expr: IDENT ASSIGNBXOR expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 64 index_expr: expr . LBRACKET expr RBRACKET + 65 | expr . DOT IDENT + 67 ex_index_expr: expr . LBRACKET expr RBRACKET + 68 | expr . DOT IDENT - EQUAL shift, and go to state 64 - LESS shift, and go to state 65 - GREATER shift, and go to state 66 - LESSEQ shift, and go to state 67 - GREATEREQ shift, and go to state 68 + LBRACKET shift, and go to state 66 + DOT shift, and go to state 67 - EQUAL [reduce using rule 36 (rel_expr)] - LESS [reduce using rule 36 (rel_expr)] - GREATER [reduce using rule 36 (rel_expr)] - LESSEQ [reduce using rule 36 (rel_expr)] - GREATEREQ [reduce using rule 36 (rel_expr)] - $default reduce using rule 36 (rel_expr) + LBRACKET [reduce using rule 23 (expr)] + DOT [reduce using rule 23 (expr)] + $default reduce using rule 23 (expr) State 108 - 35 rel_expr: rel_expr . EQUAL rel_expr - 36 | rel_expr . LESS rel_expr - 37 | rel_expr . GREATER rel_expr - 37 | rel_expr GREATER rel_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - 38 | rel_expr . LESSEQ rel_expr - 39 | rel_expr . GREATEREQ rel_expr + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN + 92 assoc_item: IDENT ASSIGN . expr - EQUAL shift, and go to state 64 - LESS shift, and go to state 65 - GREATER shift, and go to state 66 - LESSEQ shift, and go to state 67 - GREATEREQ shift, and go to state 68 - - EQUAL [reduce using rule 37 (rel_expr)] - LESS [reduce using rule 37 (rel_expr)] - GREATER [reduce using rule 37 (rel_expr)] - LESSEQ [reduce using rule 37 (rel_expr)] - GREATEREQ [reduce using rule 37 (rel_expr)] - $default reduce using rule 37 (rel_expr) + FUNC shift, and go to state 4 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 151 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 109 - 35 rel_expr: rel_expr . EQUAL rel_expr - 36 | rel_expr . LESS rel_expr - 37 | rel_expr . GREATER rel_expr - 38 | rel_expr . LESSEQ rel_expr - 38 | rel_expr LESSEQ rel_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - 39 | rel_expr . GREATEREQ rel_expr - - EQUAL shift, and go to state 64 - LESS shift, and go to state 65 - GREATER shift, and go to state 66 - LESSEQ shift, and go to state 67 - GREATEREQ shift, and go to state 68 + 64 index_expr: expr . LBRACKET expr RBRACKET + 65 | expr . DOT IDENT + 67 ex_index_expr: expr . LBRACKET expr RBRACKET + 68 | expr . DOT IDENT + 91 assoc_item: LBRACKET expr . RBRACKET ASSIGN expr - EQUAL [reduce using rule 38 (rel_expr)] - LESS [reduce using rule 38 (rel_expr)] - GREATER [reduce using rule 38 (rel_expr)] - LESSEQ [reduce using rule 38 (rel_expr)] - GREATEREQ [reduce using rule 38 (rel_expr)] - $default reduce using rule 38 (rel_expr) + LBRACKET shift, and go to state 66 + RBRACKET shift, and go to state 152 + DOT shift, and go to state 67 State 110 - 35 rel_expr: rel_expr . EQUAL rel_expr - 36 | rel_expr . LESS rel_expr - 37 | rel_expr . GREATER rel_expr - 38 | rel_expr . LESSEQ rel_expr - 39 | rel_expr . GREATEREQ rel_expr - 39 | rel_expr GREATEREQ rel_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] + 76 gen_expr: LBRACE assoc_list RBRACE . - EQUAL shift, and go to state 64 - LESS shift, and go to state 65 - GREATER shift, and go to state 66 - LESSEQ shift, and go to state 67 - GREATEREQ shift, and go to state 68 - - EQUAL [reduce using rule 39 (rel_expr)] - LESS [reduce using rule 39 (rel_expr)] - GREATER [reduce using rule 39 (rel_expr)] - LESSEQ [reduce using rule 39 (rel_expr)] - GREATEREQ [reduce using rule 39 (rel_expr)] - $default reduce using rule 39 (rel_expr) + $default reduce using rule 76 (gen_expr) State 111 - 41 term_expr: term_expr . PLUS term_expr - 41 | term_expr PLUS term_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, PLUS, MINUS, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - 42 | term_expr . MINUS term_expr + 90 assoc_list: assoc_list COMMA . assoc_item + 91 assoc_item: . LBRACKET expr RBRACKET ASSIGN expr + 92 | . IDENT ASSIGN expr - PLUS shift, and go to state 69 - MINUS shift, and go to state 70 + IDENT shift, and go to state 55 + LBRACKET shift, and go to state 56 - PLUS [reduce using rule 41 (term_expr)] - MINUS [reduce using rule 41 (term_expr)] - $default reduce using rule 41 (term_expr) + assoc_item go to state 153 State 112 - 41 term_expr: term_expr . PLUS term_expr - 42 | term_expr . MINUS term_expr - 42 | term_expr MINUS term_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, PLUS, MINUS, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - - PLUS shift, and go to state 69 - MINUS shift, and go to state 70 + 89 assoc_list: assoc_list assoc_item . - PLUS [reduce using rule 42 (term_expr)] - MINUS [reduce using rule 42 (term_expr)] - $default reduce using rule 42 (term_expr) + $default reduce using rule 89 (assoc_list) State 113 - 44 factor_expr: factor_expr . STAR factor_expr - 44 | factor_expr STAR factor_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, PLUS, MINUS, STAR, SLASH, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - 45 | factor_expr . SLASH factor_expr + 78 paren_expr: LPAREN expr RPAREN . - STAR shift, and go to state 71 - SLASH shift, and go to state 72 - - STAR [reduce using rule 44 (factor_expr)] - SLASH [reduce using rule 44 (factor_expr)] - $default reduce using rule 44 (factor_expr) + $default reduce using rule 78 (paren_expr) State 114 - 44 factor_expr: factor_expr . STAR factor_expr - 45 | factor_expr . SLASH factor_expr - 45 | factor_expr SLASH factor_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, PLUS, MINUS, STAR, SLASH, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - - STAR shift, and go to state 71 - SLASH shift, and go to state 72 + 75 gen_expr: LBRACKET expr_list RBRACKET . - STAR [reduce using rule 45 (factor_expr)] - SLASH [reduce using rule 45 (factor_expr)] - $default reduce using rule 45 (factor_expr) + $default reduce using rule 75 (gen_expr) State 115 - 47 power_expr: power_expr . DSTAR power_expr - 47 | power_expr DSTAR power_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, PLUS, MINUS, STAR, SLASH, DSTAR, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - - DSTAR shift, and go to state 73 + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN + 82 expr_list: expr_list COMMA . expr - DSTAR [reduce using rule 47 (power_expr)] - $default reduce using rule 47 (power_expr) + FUNC shift, and go to state 4 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 154 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 116 - 49 binary_expr: ubinary_expr BAND ubinary_expr . + 64 index_expr: expr . LBRACKET expr RBRACKET + 65 | expr . DOT IDENT + 67 ex_index_expr: expr . LBRACKET expr RBRACKET + 68 | expr . DOT IDENT + 81 expr_list: expr_list expr . [FUNC, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, COMMA] + + LBRACKET shift, and go to state 66 + DOT shift, and go to state 67 - $default reduce using rule 49 (binary_expr) + LBRACKET [reduce using rule 81 (expr_list)] + $default reduce using rule 81 (expr_list) State 117 - 50 binary_expr: ubinary_expr BOR ubinary_expr . + 64 index_expr: expr . LBRACKET expr RBRACKET + 64 | expr LBRACKET expr . RBRACKET + 65 | expr . DOT IDENT + 67 ex_index_expr: expr . LBRACKET expr RBRACKET + 67 | expr LBRACKET expr . RBRACKET + 68 | expr . DOT IDENT - $default reduce using rule 50 (binary_expr) + LBRACKET shift, and go to state 66 + RBRACKET shift, and go to state 155 + DOT shift, and go to state 67 State 118 - 51 binary_expr: ubinary_expr BXOR ubinary_expr . + 65 index_expr: expr DOT IDENT . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, PLUS, MINUS, STAR, SLASH, DSTAR, BAND, BOR, BXOR, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 68 ex_index_expr: expr DOT IDENT . [ASSIGN, ASSIGNPLUS, ASSIGNMINUS, ASSIGNSTAR, ASSIGNSLASH, ASSIGNDSTAR, ASSIGNBAND, ASSIGNBOR, ASSIGNBXOR] - $default reduce using rule 51 (binary_expr) + ASSIGN reduce using rule 68 (ex_index_expr) + ASSIGNPLUS reduce using rule 68 (ex_index_expr) + ASSIGNMINUS reduce using rule 68 (ex_index_expr) + ASSIGNSTAR reduce using rule 68 (ex_index_expr) + ASSIGNSLASH reduce using rule 68 (ex_index_expr) + ASSIGNDSTAR reduce using rule 68 (ex_index_expr) + ASSIGNBAND reduce using rule 68 (ex_index_expr) + ASSIGNBOR reduce using rule 68 (ex_index_expr) + ASSIGNBXOR reduce using rule 68 (ex_index_expr) + $default reduce using rule 65 (index_expr) State 119 - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 55 | call_expr LPAREN expr_list . RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN - 74 expr_list: expr_list . expr - 75 | expr_list . COMMA expr + 33 expr: logic_expr . [LBRACKET, DOT] + 34 logic_expr: logic_expr . LAND logic_expr + 34 | logic_expr LAND logic_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, BNOT, LAND, LOR, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 35 | logic_expr . LOR logic_expr - FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - RPAREN shift, and go to state 133 - LBRACKET shift, and go to state 13 - COMMA shift, and go to state 101 + LAND shift, and go to state 68 + LOR shift, and go to state 69 - expr go to state 102 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + LAND [reduce using rule 34 (logic_expr)] + LOR [reduce using rule 34 (logic_expr)] + LBRACKET reduce using rule 33 (expr) + LBRACKET [reduce using rule 34 (logic_expr)] + DOT reduce using rule 33 (expr) + DOT [reduce using rule 34 (logic_expr)] + $default reduce using rule 34 (logic_expr) State 120 - 62 index_expr: index_expr . LBRACKET index_expr RBRACKET - 62 | index_expr LBRACKET index_expr . RBRACKET + 33 expr: logic_expr . [LBRACKET, DOT] + 34 logic_expr: logic_expr . LAND logic_expr + 35 | logic_expr . LOR logic_expr + 35 | logic_expr LOR logic_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, BNOT, LAND, LOR, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] - LBRACKET shift, and go to state 78 - RBRACKET shift, and go to state 134 + LAND shift, and go to state 68 + LOR shift, and go to state 69 + LAND [reduce using rule 35 (logic_expr)] + LOR [reduce using rule 35 (logic_expr)] + LBRACKET reduce using rule 33 (expr) + LBRACKET [reduce using rule 35 (logic_expr)] + DOT reduce using rule 33 (expr) + DOT [reduce using rule 35 (logic_expr)] + $default reduce using rule 35 (logic_expr) -State 121 - 2 stmt: . expr - 3 | . IF expr THEN stmt END - 3 | IF expr THEN stmt . END - 4 | . IF expr THEN stmt ELSE stmt END - 4 | IF expr THEN stmt . ELSE stmt END - 5 | . WHILE expr DO stmt END - 6 | . FOR IDENT IN expr DO stmt END - 7 | . stmt SEMICOLON - 7 | stmt . SEMICOLON - 8 | . stmt_list - 9 stmt_list: . stmt stmt - 9 | stmt . stmt - 10 | . stmt_list stmt - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN +State 121 - IF shift, and go to state 1 - ELSE shift, and go to state 135 - WHILE shift, and go to state 2 - FOR shift, and go to state 3 - FUNC shift, and go to state 4 - END shift, and go to state 136 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - SEMICOLON shift, and go to state 58 - - stmt go to state 59 - stmt_list go to state 16 - expr go to state 17 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + 38 ulogic_expr: rel_expr . [LAND, LOR, LBRACKET, DOT] + 39 rel_expr: rel_expr . EQUAL rel_expr + 39 | rel_expr EQUAL rel_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 40 | rel_expr . LESS rel_expr + 41 | rel_expr . GREATER rel_expr + 42 | rel_expr . LESSEQ rel_expr + 43 | rel_expr . GREATEREQ rel_expr + + EQUAL shift, and go to state 70 + LESS shift, and go to state 71 + GREATER shift, and go to state 72 + LESSEQ shift, and go to state 73 + GREATEREQ shift, and go to state 74 + + LAND reduce using rule 38 (ulogic_expr) + LAND [reduce using rule 39 (rel_expr)] + LOR reduce using rule 38 (ulogic_expr) + LOR [reduce using rule 39 (rel_expr)] + EQUAL [reduce using rule 39 (rel_expr)] + LESS [reduce using rule 39 (rel_expr)] + GREATER [reduce using rule 39 (rel_expr)] + LESSEQ [reduce using rule 39 (rel_expr)] + GREATEREQ [reduce using rule 39 (rel_expr)] + LBRACKET reduce using rule 38 (ulogic_expr) + LBRACKET [reduce using rule 39 (rel_expr)] + DOT reduce using rule 38 (ulogic_expr) + DOT [reduce using rule 39 (rel_expr)] + $default reduce using rule 39 (rel_expr) State 122 - 2 stmt: . expr - 3 | . IF expr THEN stmt END - 4 | . IF expr THEN stmt ELSE stmt END - 5 | . WHILE expr DO stmt END - 5 | WHILE expr DO stmt . END - 6 | . FOR IDENT IN expr DO stmt END - 7 | . stmt SEMICOLON - 7 | stmt . SEMICOLON - 8 | . stmt_list - 9 stmt_list: . stmt stmt - 9 | stmt . stmt - 10 | . stmt_list stmt - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN - - IF shift, and go to state 1 - WHILE shift, and go to state 2 - FOR shift, and go to state 3 - FUNC shift, and go to state 4 - END shift, and go to state 137 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - SEMICOLON shift, and go to state 58 - - stmt go to state 59 - stmt_list go to state 16 - expr go to state 17 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + 38 ulogic_expr: rel_expr . [LAND, LOR, LBRACKET, DOT] + 39 rel_expr: rel_expr . EQUAL rel_expr + 40 | rel_expr . LESS rel_expr + 40 | rel_expr LESS rel_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 41 | rel_expr . GREATER rel_expr + 42 | rel_expr . LESSEQ rel_expr + 43 | rel_expr . GREATEREQ rel_expr + + EQUAL shift, and go to state 70 + LESS shift, and go to state 71 + GREATER shift, and go to state 72 + LESSEQ shift, and go to state 73 + GREATEREQ shift, and go to state 74 + + LAND reduce using rule 38 (ulogic_expr) + LAND [reduce using rule 40 (rel_expr)] + LOR reduce using rule 38 (ulogic_expr) + LOR [reduce using rule 40 (rel_expr)] + EQUAL [reduce using rule 40 (rel_expr)] + LESS [reduce using rule 40 (rel_expr)] + GREATER [reduce using rule 40 (rel_expr)] + LESSEQ [reduce using rule 40 (rel_expr)] + GREATEREQ [reduce using rule 40 (rel_expr)] + LBRACKET reduce using rule 38 (ulogic_expr) + LBRACKET [reduce using rule 40 (rel_expr)] + DOT reduce using rule 38 (ulogic_expr) + DOT [reduce using rule 40 (rel_expr)] + $default reduce using rule 40 (rel_expr) State 123 - 6 stmt: FOR IDENT IN expr . DO stmt END - 20 expr: expr . LBRACKET expr RBRACKET ASSIGN expr - 21 | expr . LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | expr . LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | expr . LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | expr . LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | expr . LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | expr . LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | expr . LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | expr . LBRACKET expr RBRACKET ASSIGNBXOR expr - - DO shift, and go to state 138 - LBRACKET shift, and go to state 61 + 38 ulogic_expr: rel_expr . [LAND, LOR, LBRACKET, DOT] + 39 rel_expr: rel_expr . EQUAL rel_expr + 40 | rel_expr . LESS rel_expr + 41 | rel_expr . GREATER rel_expr + 41 | rel_expr GREATER rel_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 42 | rel_expr . LESSEQ rel_expr + 43 | rel_expr . GREATEREQ rel_expr + + EQUAL shift, and go to state 70 + LESS shift, and go to state 71 + GREATER shift, and go to state 72 + LESSEQ shift, and go to state 73 + GREATEREQ shift, and go to state 74 + + LAND reduce using rule 38 (ulogic_expr) + LAND [reduce using rule 41 (rel_expr)] + LOR reduce using rule 38 (ulogic_expr) + LOR [reduce using rule 41 (rel_expr)] + EQUAL [reduce using rule 41 (rel_expr)] + LESS [reduce using rule 41 (rel_expr)] + GREATER [reduce using rule 41 (rel_expr)] + LESSEQ [reduce using rule 41 (rel_expr)] + GREATEREQ [reduce using rule 41 (rel_expr)] + LBRACKET reduce using rule 38 (ulogic_expr) + LBRACKET [reduce using rule 41 (rel_expr)] + DOT reduce using rule 38 (ulogic_expr) + DOT [reduce using rule 41 (rel_expr)] + $default reduce using rule 41 (rel_expr) State 124 - 57 funcdecl_expr: FUNC IDENT LPAREN ident_list . RPAREN stmt END - 78 ident_list: ident_list . IDENT - 79 | ident_list . COMMA IDENT - - IDENT shift, and go to state 125 - RPAREN shift, and go to state 139 - COMMA shift, and go to state 127 + 38 ulogic_expr: rel_expr . [LAND, LOR, LBRACKET, DOT] + 39 rel_expr: rel_expr . EQUAL rel_expr + 40 | rel_expr . LESS rel_expr + 41 | rel_expr . GREATER rel_expr + 42 | rel_expr . LESSEQ rel_expr + 42 | rel_expr LESSEQ rel_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 43 | rel_expr . GREATEREQ rel_expr + + EQUAL shift, and go to state 70 + LESS shift, and go to state 71 + GREATER shift, and go to state 72 + LESSEQ shift, and go to state 73 + GREATEREQ shift, and go to state 74 + + LAND reduce using rule 38 (ulogic_expr) + LAND [reduce using rule 42 (rel_expr)] + LOR reduce using rule 38 (ulogic_expr) + LOR [reduce using rule 42 (rel_expr)] + EQUAL [reduce using rule 42 (rel_expr)] + LESS [reduce using rule 42 (rel_expr)] + GREATER [reduce using rule 42 (rel_expr)] + LESSEQ [reduce using rule 42 (rel_expr)] + GREATEREQ [reduce using rule 42 (rel_expr)] + LBRACKET reduce using rule 38 (ulogic_expr) + LBRACKET [reduce using rule 42 (rel_expr)] + DOT reduce using rule 38 (ulogic_expr) + DOT [reduce using rule 42 (rel_expr)] + $default reduce using rule 42 (rel_expr) State 125 - 78 ident_list: ident_list IDENT . - - $default reduce using rule 78 (ident_list) + 38 ulogic_expr: rel_expr . [LAND, LOR, LBRACKET, DOT] + 39 rel_expr: rel_expr . EQUAL rel_expr + 40 | rel_expr . LESS rel_expr + 41 | rel_expr . GREATER rel_expr + 42 | rel_expr . LESSEQ rel_expr + 43 | rel_expr . GREATEREQ rel_expr + 43 | rel_expr GREATEREQ rel_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + + EQUAL shift, and go to state 70 + LESS shift, and go to state 71 + GREATER shift, and go to state 72 + LESSEQ shift, and go to state 73 + GREATEREQ shift, and go to state 74 + + LAND reduce using rule 38 (ulogic_expr) + LAND [reduce using rule 43 (rel_expr)] + LOR reduce using rule 38 (ulogic_expr) + LOR [reduce using rule 43 (rel_expr)] + EQUAL [reduce using rule 43 (rel_expr)] + LESS [reduce using rule 43 (rel_expr)] + GREATER [reduce using rule 43 (rel_expr)] + LESSEQ [reduce using rule 43 (rel_expr)] + GREATEREQ [reduce using rule 43 (rel_expr)] + LBRACKET reduce using rule 38 (ulogic_expr) + LBRACKET [reduce using rule 43 (rel_expr)] + DOT reduce using rule 38 (ulogic_expr) + DOT [reduce using rule 43 (rel_expr)] + $default reduce using rule 43 (rel_expr) State 126 - 2 stmt: . expr - 3 | . IF expr THEN stmt END - 4 | . IF expr THEN stmt ELSE stmt END - 5 | . WHILE expr DO stmt END - 6 | . FOR IDENT IN expr DO stmt END - 7 | . stmt SEMICOLON - 8 | . stmt_list - 9 stmt_list: . stmt stmt - 10 | . stmt_list stmt - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 58 | FUNC LPAREN ident_list RPAREN . stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN - - IF shift, and go to state 1 - WHILE shift, and go to state 2 - FOR shift, and go to state 3 - FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - stmt go to state 140 - stmt_list go to state 16 - expr go to state 17 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + 44 rel_expr: term_expr . [LAND, LOR, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACKET, DOT] + 45 term_expr: term_expr . PLUS term_expr + 45 | term_expr PLUS term_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, PLUS, MINUS, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 46 | term_expr . MINUS term_expr + + PLUS shift, and go to state 75 + MINUS shift, and go to state 76 + + PLUS [reduce using rule 45 (term_expr)] + MINUS [reduce using rule 45 (term_expr)] + LAND reduce using rule 44 (rel_expr) + LAND [reduce using rule 45 (term_expr)] + LOR reduce using rule 44 (rel_expr) + LOR [reduce using rule 45 (term_expr)] + EQUAL reduce using rule 44 (rel_expr) + EQUAL [reduce using rule 45 (term_expr)] + LESS reduce using rule 44 (rel_expr) + LESS [reduce using rule 45 (term_expr)] + GREATER reduce using rule 44 (rel_expr) + GREATER [reduce using rule 45 (term_expr)] + LESSEQ reduce using rule 44 (rel_expr) + LESSEQ [reduce using rule 45 (term_expr)] + GREATEREQ reduce using rule 44 (rel_expr) + GREATEREQ [reduce using rule 45 (term_expr)] + LBRACKET reduce using rule 44 (rel_expr) + LBRACKET [reduce using rule 45 (term_expr)] + DOT reduce using rule 44 (rel_expr) + DOT [reduce using rule 45 (term_expr)] + $default reduce using rule 45 (term_expr) State 127 - 79 ident_list: ident_list COMMA . IDENT - - IDENT shift, and go to state 141 + 44 rel_expr: term_expr . [LAND, LOR, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACKET, DOT] + 45 term_expr: term_expr . PLUS term_expr + 46 | term_expr . MINUS term_expr + 46 | term_expr MINUS term_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, PLUS, MINUS, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + + PLUS shift, and go to state 75 + MINUS shift, and go to state 76 + + PLUS [reduce using rule 46 (term_expr)] + MINUS [reduce using rule 46 (term_expr)] + LAND reduce using rule 44 (rel_expr) + LAND [reduce using rule 46 (term_expr)] + LOR reduce using rule 44 (rel_expr) + LOR [reduce using rule 46 (term_expr)] + EQUAL reduce using rule 44 (rel_expr) + EQUAL [reduce using rule 46 (term_expr)] + LESS reduce using rule 44 (rel_expr) + LESS [reduce using rule 46 (term_expr)] + GREATER reduce using rule 44 (rel_expr) + GREATER [reduce using rule 46 (term_expr)] + LESSEQ reduce using rule 44 (rel_expr) + LESSEQ [reduce using rule 46 (term_expr)] + GREATEREQ reduce using rule 44 (rel_expr) + GREATEREQ [reduce using rule 46 (term_expr)] + LBRACKET reduce using rule 44 (rel_expr) + LBRACKET [reduce using rule 46 (term_expr)] + DOT reduce using rule 44 (rel_expr) + DOT [reduce using rule 46 (term_expr)] + $default reduce using rule 46 (term_expr) State 128 - 20 expr: expr . LBRACKET expr RBRACKET ASSIGN expr - 21 | expr . LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | expr . LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | expr . LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | expr . LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | expr . LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | expr . LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | expr . LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | expr . LBRACKET expr RBRACKET ASSIGNBXOR expr - 85 assoc_item: IDENT ASSIGN expr . [IDENT, RBRACE, LBRACKET, COMMA] - - LBRACKET shift, and go to state 61 - - LBRACKET [reduce using rule 85 (assoc_item)] - $default reduce using rule 85 (assoc_item) + 47 term_expr: factor_expr . [PLUS, MINUS, LAND, LOR, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACKET, DOT] + 48 factor_expr: factor_expr . STAR factor_expr + 48 | factor_expr STAR factor_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, PLUS, MINUS, STAR, SLASH, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 49 | factor_expr . SLASH factor_expr + + STAR shift, and go to state 77 + SLASH shift, and go to state 78 + + PLUS reduce using rule 47 (term_expr) + PLUS [reduce using rule 48 (factor_expr)] + MINUS reduce using rule 47 (term_expr) + MINUS [reduce using rule 48 (factor_expr)] + STAR [reduce using rule 48 (factor_expr)] + SLASH [reduce using rule 48 (factor_expr)] + LAND reduce using rule 47 (term_expr) + LAND [reduce using rule 48 (factor_expr)] + LOR reduce using rule 47 (term_expr) + LOR [reduce using rule 48 (factor_expr)] + EQUAL reduce using rule 47 (term_expr) + EQUAL [reduce using rule 48 (factor_expr)] + LESS reduce using rule 47 (term_expr) + LESS [reduce using rule 48 (factor_expr)] + GREATER reduce using rule 47 (term_expr) + GREATER [reduce using rule 48 (factor_expr)] + LESSEQ reduce using rule 47 (term_expr) + LESSEQ [reduce using rule 48 (factor_expr)] + GREATEREQ reduce using rule 47 (term_expr) + GREATEREQ [reduce using rule 48 (factor_expr)] + LBRACKET reduce using rule 47 (term_expr) + LBRACKET [reduce using rule 48 (factor_expr)] + DOT reduce using rule 47 (term_expr) + DOT [reduce using rule 48 (factor_expr)] + $default reduce using rule 48 (factor_expr) State 129 - 84 assoc_item: LBRACKET expr RBRACKET . ASSIGN expr - - ASSIGN shift, and go to state 142 + 47 term_expr: factor_expr . [PLUS, MINUS, LAND, LOR, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACKET, DOT] + 48 factor_expr: factor_expr . STAR factor_expr + 49 | factor_expr . SLASH factor_expr + 49 | factor_expr SLASH factor_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, PLUS, MINUS, STAR, SLASH, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + + STAR shift, and go to state 77 + SLASH shift, and go to state 78 + + PLUS reduce using rule 47 (term_expr) + PLUS [reduce using rule 49 (factor_expr)] + MINUS reduce using rule 47 (term_expr) + MINUS [reduce using rule 49 (factor_expr)] + STAR [reduce using rule 49 (factor_expr)] + SLASH [reduce using rule 49 (factor_expr)] + LAND reduce using rule 47 (term_expr) + LAND [reduce using rule 49 (factor_expr)] + LOR reduce using rule 47 (term_expr) + LOR [reduce using rule 49 (factor_expr)] + EQUAL reduce using rule 47 (term_expr) + EQUAL [reduce using rule 49 (factor_expr)] + LESS reduce using rule 47 (term_expr) + LESS [reduce using rule 49 (factor_expr)] + GREATER reduce using rule 47 (term_expr) + GREATER [reduce using rule 49 (factor_expr)] + LESSEQ reduce using rule 47 (term_expr) + LESSEQ [reduce using rule 49 (factor_expr)] + GREATEREQ reduce using rule 47 (term_expr) + GREATEREQ [reduce using rule 49 (factor_expr)] + LBRACKET reduce using rule 47 (term_expr) + LBRACKET [reduce using rule 49 (factor_expr)] + DOT reduce using rule 47 (term_expr) + DOT [reduce using rule 49 (factor_expr)] + $default reduce using rule 49 (factor_expr) State 130 - 83 assoc_list: assoc_list COMMA assoc_item . - - $default reduce using rule 83 (assoc_list) + 50 factor_expr: power_expr . [PLUS, MINUS, STAR, SLASH, LAND, LOR, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACKET, DOT] + 51 power_expr: power_expr . DSTAR power_expr + 51 | power_expr DSTAR power_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, PLUS, MINUS, STAR, SLASH, DSTAR, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + + DSTAR shift, and go to state 79 + + PLUS reduce using rule 50 (factor_expr) + PLUS [reduce using rule 51 (power_expr)] + MINUS reduce using rule 50 (factor_expr) + MINUS [reduce using rule 51 (power_expr)] + STAR reduce using rule 50 (factor_expr) + STAR [reduce using rule 51 (power_expr)] + SLASH reduce using rule 50 (factor_expr) + SLASH [reduce using rule 51 (power_expr)] + DSTAR [reduce using rule 51 (power_expr)] + LAND reduce using rule 50 (factor_expr) + LAND [reduce using rule 51 (power_expr)] + LOR reduce using rule 50 (factor_expr) + LOR [reduce using rule 51 (power_expr)] + EQUAL reduce using rule 50 (factor_expr) + EQUAL [reduce using rule 51 (power_expr)] + LESS reduce using rule 50 (factor_expr) + LESS [reduce using rule 51 (power_expr)] + GREATER reduce using rule 50 (factor_expr) + GREATER [reduce using rule 51 (power_expr)] + LESSEQ reduce using rule 50 (factor_expr) + LESSEQ [reduce using rule 51 (power_expr)] + GREATEREQ reduce using rule 50 (factor_expr) + GREATEREQ [reduce using rule 51 (power_expr)] + LBRACKET reduce using rule 50 (factor_expr) + LBRACKET [reduce using rule 51 (power_expr)] + DOT reduce using rule 50 (factor_expr) + DOT [reduce using rule 51 (power_expr)] + $default reduce using rule 51 (power_expr) State 131 - 20 expr: expr . LBRACKET expr RBRACKET ASSIGN expr - 21 | expr . LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | expr . LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | expr . LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | expr . LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | expr . LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | expr . LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | expr . LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | expr . LBRACKET expr RBRACKET ASSIGNBXOR expr - 75 expr_list: expr_list COMMA expr . [FUNC, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, COMMA] - - LBRACKET shift, and go to state 61 - - LBRACKET [reduce using rule 75 (expr_list)] - $default reduce using rule 75 (expr_list) + 53 binary_expr: ubinary_expr . BAND ubinary_expr + 53 | ubinary_expr BAND ubinary_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, PLUS, MINUS, STAR, SLASH, DSTAR, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 54 | ubinary_expr . BOR ubinary_expr + 55 | ubinary_expr . BXOR ubinary_expr + 56 | ubinary_expr . [PLUS, MINUS, STAR, SLASH, DSTAR, LAND, LOR, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACKET, DOT] + + BAND shift, and go to state 80 + BOR shift, and go to state 81 + BXOR shift, and go to state 82 + + PLUS reduce using rule 53 (binary_expr) + PLUS [reduce using rule 56 (binary_expr)] + MINUS reduce using rule 53 (binary_expr) + MINUS [reduce using rule 56 (binary_expr)] + STAR reduce using rule 53 (binary_expr) + STAR [reduce using rule 56 (binary_expr)] + SLASH reduce using rule 53 (binary_expr) + SLASH [reduce using rule 56 (binary_expr)] + DSTAR reduce using rule 53 (binary_expr) + DSTAR [reduce using rule 56 (binary_expr)] + LAND reduce using rule 53 (binary_expr) + LAND [reduce using rule 56 (binary_expr)] + LOR reduce using rule 53 (binary_expr) + LOR [reduce using rule 56 (binary_expr)] + EQUAL reduce using rule 53 (binary_expr) + EQUAL [reduce using rule 56 (binary_expr)] + LESS reduce using rule 53 (binary_expr) + LESS [reduce using rule 56 (binary_expr)] + GREATER reduce using rule 53 (binary_expr) + GREATER [reduce using rule 56 (binary_expr)] + LESSEQ reduce using rule 53 (binary_expr) + LESSEQ [reduce using rule 56 (binary_expr)] + GREATEREQ reduce using rule 53 (binary_expr) + GREATEREQ [reduce using rule 56 (binary_expr)] + LBRACKET reduce using rule 53 (binary_expr) + LBRACKET [reduce using rule 56 (binary_expr)] + DOT reduce using rule 53 (binary_expr) + DOT [reduce using rule 56 (binary_expr)] + $default reduce using rule 53 (binary_expr) State 132 - 20 expr: expr LBRACKET expr RBRACKET . ASSIGN expr - 21 | expr LBRACKET expr RBRACKET . ASSIGNPLUS expr - 22 | expr LBRACKET expr RBRACKET . ASSIGNMINUS expr - 23 | expr LBRACKET expr RBRACKET . ASSIGNSTAR expr - 24 | expr LBRACKET expr RBRACKET . ASSIGNSLASH expr - 25 | expr LBRACKET expr RBRACKET . ASSIGNDSTAR expr - 26 | expr LBRACKET expr RBRACKET . ASSIGNBAND expr - 27 | expr LBRACKET expr RBRACKET . ASSIGNBOR expr - 28 | expr LBRACKET expr RBRACKET . ASSIGNBXOR expr - - ASSIGN shift, and go to state 143 - ASSIGNPLUS shift, and go to state 144 - ASSIGNMINUS shift, and go to state 145 - ASSIGNSTAR shift, and go to state 146 - ASSIGNSLASH shift, and go to state 147 - ASSIGNDSTAR shift, and go to state 148 - ASSIGNBAND shift, and go to state 149 - ASSIGNBOR shift, and go to state 150 - ASSIGNBXOR shift, and go to state 151 + 53 binary_expr: ubinary_expr . BAND ubinary_expr + 54 | ubinary_expr . BOR ubinary_expr + 54 | ubinary_expr BOR ubinary_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, PLUS, MINUS, STAR, SLASH, DSTAR, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 55 | ubinary_expr . BXOR ubinary_expr + 56 | ubinary_expr . [PLUS, MINUS, STAR, SLASH, DSTAR, LAND, LOR, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACKET, DOT] + + BAND shift, and go to state 80 + BOR shift, and go to state 81 + BXOR shift, and go to state 82 + + PLUS reduce using rule 54 (binary_expr) + PLUS [reduce using rule 56 (binary_expr)] + MINUS reduce using rule 54 (binary_expr) + MINUS [reduce using rule 56 (binary_expr)] + STAR reduce using rule 54 (binary_expr) + STAR [reduce using rule 56 (binary_expr)] + SLASH reduce using rule 54 (binary_expr) + SLASH [reduce using rule 56 (binary_expr)] + DSTAR reduce using rule 54 (binary_expr) + DSTAR [reduce using rule 56 (binary_expr)] + LAND reduce using rule 54 (binary_expr) + LAND [reduce using rule 56 (binary_expr)] + LOR reduce using rule 54 (binary_expr) + LOR [reduce using rule 56 (binary_expr)] + EQUAL reduce using rule 54 (binary_expr) + EQUAL [reduce using rule 56 (binary_expr)] + LESS reduce using rule 54 (binary_expr) + LESS [reduce using rule 56 (binary_expr)] + GREATER reduce using rule 54 (binary_expr) + GREATER [reduce using rule 56 (binary_expr)] + LESSEQ reduce using rule 54 (binary_expr) + LESSEQ [reduce using rule 56 (binary_expr)] + GREATEREQ reduce using rule 54 (binary_expr) + GREATEREQ [reduce using rule 56 (binary_expr)] + LBRACKET reduce using rule 54 (binary_expr) + LBRACKET [reduce using rule 56 (binary_expr)] + DOT reduce using rule 54 (binary_expr) + DOT [reduce using rule 56 (binary_expr)] + $default reduce using rule 54 (binary_expr) State 133 - 55 call_expr: call_expr LPAREN expr_list RPAREN . - - $default reduce using rule 55 (call_expr) + 53 binary_expr: ubinary_expr . BAND ubinary_expr + 54 | ubinary_expr . BOR ubinary_expr + 55 | ubinary_expr . BXOR ubinary_expr + 55 | ubinary_expr BXOR ubinary_expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, PLUS, MINUS, STAR, SLASH, DSTAR, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 56 | ubinary_expr . [PLUS, MINUS, STAR, SLASH, DSTAR, LAND, LOR, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACKET, DOT] + + BAND shift, and go to state 80 + BOR shift, and go to state 81 + BXOR shift, and go to state 82 + + PLUS reduce using rule 55 (binary_expr) + PLUS [reduce using rule 56 (binary_expr)] + MINUS reduce using rule 55 (binary_expr) + MINUS [reduce using rule 56 (binary_expr)] + STAR reduce using rule 55 (binary_expr) + STAR [reduce using rule 56 (binary_expr)] + SLASH reduce using rule 55 (binary_expr) + SLASH [reduce using rule 56 (binary_expr)] + DSTAR reduce using rule 55 (binary_expr) + DSTAR [reduce using rule 56 (binary_expr)] + LAND reduce using rule 55 (binary_expr) + LAND [reduce using rule 56 (binary_expr)] + LOR reduce using rule 55 (binary_expr) + LOR [reduce using rule 56 (binary_expr)] + EQUAL reduce using rule 55 (binary_expr) + EQUAL [reduce using rule 56 (binary_expr)] + LESS reduce using rule 55 (binary_expr) + LESS [reduce using rule 56 (binary_expr)] + GREATER reduce using rule 55 (binary_expr) + GREATER [reduce using rule 56 (binary_expr)] + LESSEQ reduce using rule 55 (binary_expr) + LESSEQ [reduce using rule 56 (binary_expr)] + GREATEREQ reduce using rule 55 (binary_expr) + GREATEREQ [reduce using rule 56 (binary_expr)] + LBRACKET reduce using rule 55 (binary_expr) + LBRACKET [reduce using rule 56 (binary_expr)] + DOT reduce using rule 55 (binary_expr) + DOT [reduce using rule 56 (binary_expr)] + $default reduce using rule 55 (binary_expr) State 134 - 62 index_expr: index_expr LBRACKET index_expr RBRACKET . + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 59 | call_expr LPAREN expr_list . RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN + 81 expr_list: expr_list . expr + 82 | expr_list . COMMA expr - $default reduce using rule 62 (index_expr) + FUNC shift, and go to state 4 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + RPAREN shift, and go to state 156 + LBRACKET shift, and go to state 16 + COMMA shift, and go to state 115 + + expr go to state 116 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 135 - 2 stmt: . expr - 3 | . IF expr THEN stmt END - 4 | . IF expr THEN stmt ELSE stmt END - 4 | IF expr THEN stmt ELSE . stmt END - 5 | . WHILE expr DO stmt END - 6 | . FOR IDENT IN expr DO stmt END - 7 | . stmt SEMICOLON - 8 | . stmt_list - 9 stmt_list: . stmt stmt - 10 | . stmt_list stmt - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 24 expr: ex_index_expr ASSIGN expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 64 index_expr: expr . LBRACKET expr RBRACKET + 65 | expr . DOT IDENT + 67 ex_index_expr: expr . LBRACKET expr RBRACKET + 68 | expr . DOT IDENT - IF shift, and go to state 1 - WHILE shift, and go to state 2 - FOR shift, and go to state 3 - FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - stmt go to state 152 - stmt_list go to state 16 - expr go to state 17 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + LBRACKET shift, and go to state 66 + DOT shift, and go to state 67 + + LBRACKET [reduce using rule 24 (expr)] + DOT [reduce using rule 24 (expr)] + $default reduce using rule 24 (expr) State 136 - 3 stmt: IF expr THEN stmt END . + 25 expr: ex_index_expr ASSIGNPLUS expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 64 index_expr: expr . LBRACKET expr RBRACKET + 65 | expr . DOT IDENT + 67 ex_index_expr: expr . LBRACKET expr RBRACKET + 68 | expr . DOT IDENT - $default reduce using rule 3 (stmt) + LBRACKET shift, and go to state 66 + DOT shift, and go to state 67 + + LBRACKET [reduce using rule 25 (expr)] + DOT [reduce using rule 25 (expr)] + $default reduce using rule 25 (expr) State 137 - 5 stmt: WHILE expr DO stmt END . + 26 expr: ex_index_expr ASSIGNMINUS expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 64 index_expr: expr . LBRACKET expr RBRACKET + 65 | expr . DOT IDENT + 67 ex_index_expr: expr . LBRACKET expr RBRACKET + 68 | expr . DOT IDENT - $default reduce using rule 5 (stmt) + LBRACKET shift, and go to state 66 + DOT shift, and go to state 67 + + LBRACKET [reduce using rule 26 (expr)] + DOT [reduce using rule 26 (expr)] + $default reduce using rule 26 (expr) State 138 - 2 stmt: . expr - 3 | . IF expr THEN stmt END - 4 | . IF expr THEN stmt ELSE stmt END - 5 | . WHILE expr DO stmt END - 6 | . FOR IDENT IN expr DO stmt END - 6 | FOR IDENT IN expr DO . stmt END - 7 | . stmt SEMICOLON - 8 | . stmt_list - 9 stmt_list: . stmt stmt - 10 | . stmt_list stmt - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 27 expr: ex_index_expr ASSIGNSTAR expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 64 index_expr: expr . LBRACKET expr RBRACKET + 65 | expr . DOT IDENT + 67 ex_index_expr: expr . LBRACKET expr RBRACKET + 68 | expr . DOT IDENT - IF shift, and go to state 1 - WHILE shift, and go to state 2 - FOR shift, and go to state 3 - FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - stmt go to state 153 - stmt_list go to state 16 - expr go to state 17 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + LBRACKET shift, and go to state 66 + DOT shift, and go to state 67 + + LBRACKET [reduce using rule 27 (expr)] + DOT [reduce using rule 27 (expr)] + $default reduce using rule 27 (expr) State 139 - 2 stmt: . expr - 3 | . IF expr THEN stmt END - 4 | . IF expr THEN stmt ELSE stmt END - 5 | . WHILE expr DO stmt END - 6 | . FOR IDENT IN expr DO stmt END - 7 | . stmt SEMICOLON - 8 | . stmt_list - 9 stmt_list: . stmt stmt - 10 | . stmt_list stmt - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 57 | FUNC IDENT LPAREN ident_list RPAREN . stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 28 expr: ex_index_expr ASSIGNSLASH expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 64 index_expr: expr . LBRACKET expr RBRACKET + 65 | expr . DOT IDENT + 67 ex_index_expr: expr . LBRACKET expr RBRACKET + 68 | expr . DOT IDENT - IF shift, and go to state 1 - WHILE shift, and go to state 2 - FOR shift, and go to state 3 - FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - stmt go to state 154 - stmt_list go to state 16 - expr go to state 17 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + LBRACKET shift, and go to state 66 + DOT shift, and go to state 67 + + LBRACKET [reduce using rule 28 (expr)] + DOT [reduce using rule 28 (expr)] + $default reduce using rule 28 (expr) State 140 - 2 stmt: . expr - 3 | . IF expr THEN stmt END - 4 | . IF expr THEN stmt ELSE stmt END - 5 | . WHILE expr DO stmt END - 6 | . FOR IDENT IN expr DO stmt END - 7 | . stmt SEMICOLON - 7 | stmt . SEMICOLON - 8 | . stmt_list - 9 stmt_list: . stmt stmt - 9 | stmt . stmt - 10 | . stmt_list stmt - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 58 | FUNC LPAREN ident_list RPAREN stmt . END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 29 expr: ex_index_expr ASSIGNDSTAR expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 64 index_expr: expr . LBRACKET expr RBRACKET + 65 | expr . DOT IDENT + 67 ex_index_expr: expr . LBRACKET expr RBRACKET + 68 | expr . DOT IDENT - IF shift, and go to state 1 - WHILE shift, and go to state 2 - FOR shift, and go to state 3 - FUNC shift, and go to state 4 - END shift, and go to state 155 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - SEMICOLON shift, and go to state 58 - - stmt go to state 59 - stmt_list go to state 16 - expr go to state 17 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + LBRACKET shift, and go to state 66 + DOT shift, and go to state 67 + + LBRACKET [reduce using rule 29 (expr)] + DOT [reduce using rule 29 (expr)] + $default reduce using rule 29 (expr) State 141 - 79 ident_list: ident_list COMMA IDENT . + 30 expr: ex_index_expr ASSIGNBAND expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 64 index_expr: expr . LBRACKET expr RBRACKET + 65 | expr . DOT IDENT + 67 ex_index_expr: expr . LBRACKET expr RBRACKET + 68 | expr . DOT IDENT - $default reduce using rule 79 (ident_list) + LBRACKET shift, and go to state 66 + DOT shift, and go to state 67 + + LBRACKET [reduce using rule 30 (expr)] + DOT [reduce using rule 30 (expr)] + $default reduce using rule 30 (expr) State 142 - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN - 84 assoc_item: LBRACKET expr RBRACKET ASSIGN . expr + 31 expr: ex_index_expr ASSIGNBOR expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 64 index_expr: expr . LBRACKET expr RBRACKET + 65 | expr . DOT IDENT + 67 ex_index_expr: expr . LBRACKET expr RBRACKET + 68 | expr . DOT IDENT - FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - expr go to state 156 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + LBRACKET shift, and go to state 66 + DOT shift, and go to state 67 + + LBRACKET [reduce using rule 31 (expr)] + DOT [reduce using rule 31 (expr)] + $default reduce using rule 31 (expr) State 143 - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 20 | expr LBRACKET expr RBRACKET ASSIGN . expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 32 expr: ex_index_expr ASSIGNBXOR expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 64 index_expr: expr . LBRACKET expr RBRACKET + 65 | expr . DOT IDENT + 67 ex_index_expr: expr . LBRACKET expr RBRACKET + 68 | expr . DOT IDENT - FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - expr go to state 157 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + LBRACKET shift, and go to state 66 + DOT shift, and go to state 67 + + LBRACKET [reduce using rule 32 (expr)] + DOT [reduce using rule 32 (expr)] + $default reduce using rule 32 (expr) State 144 - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 21 | expr LBRACKET expr RBRACKET ASSIGNPLUS . expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 2 stmt: . expr + 3 | . IF expr THEN stmt END + 3 | IF expr THEN stmt . END + 4 | . IF expr THEN stmt ELSE stmt END + 4 | IF expr THEN stmt . ELSE stmt END + 5 | . WHILE expr DO stmt END + 6 | . FOR IDENT IN expr DO stmt END + 7 | . RETURN expr + 8 | . RETURN + 9 | . BREAK + 10 | . CONTINUE + 11 | . stmt SEMICOLON + 11 | stmt . SEMICOLON + 12 | . stmt_list + 13 stmt_list: . stmt_list stmt + 14 | . stmt stmt + 14 | stmt . stmt + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN - FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - expr go to state 158 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + IF shift, and go to state 1 + ELSE shift, and go to state 157 + WHILE shift, and go to state 2 + FOR shift, and go to state 3 + FUNC shift, and go to state 4 + RETURN shift, and go to state 5 + BREAK shift, and go to state 6 + CONTINUE shift, and go to state 7 + END shift, and go to state 158 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + SEMICOLON shift, and go to state 63 + + stmt go to state 64 + stmt_list go to state 19 + expr go to state 20 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 145 - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 22 | expr LBRACKET expr RBRACKET ASSIGNMINUS . expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 2 stmt: . expr + 3 | . IF expr THEN stmt END + 4 | . IF expr THEN stmt ELSE stmt END + 5 | . WHILE expr DO stmt END + 5 | WHILE expr DO stmt . END + 6 | . FOR IDENT IN expr DO stmt END + 7 | . RETURN expr + 8 | . RETURN + 9 | . BREAK + 10 | . CONTINUE + 11 | . stmt SEMICOLON + 11 | stmt . SEMICOLON + 12 | . stmt_list + 13 stmt_list: . stmt_list stmt + 14 | . stmt stmt + 14 | stmt . stmt + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN - FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - expr go to state 159 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + IF shift, and go to state 1 + WHILE shift, and go to state 2 + FOR shift, and go to state 3 + FUNC shift, and go to state 4 + RETURN shift, and go to state 5 + BREAK shift, and go to state 6 + CONTINUE shift, and go to state 7 + END shift, and go to state 159 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + SEMICOLON shift, and go to state 63 + + stmt go to state 64 + stmt_list go to state 19 + expr go to state 20 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 146 - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 23 | expr LBRACKET expr RBRACKET ASSIGNSTAR . expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 6 stmt: FOR IDENT IN expr . DO stmt END + 64 index_expr: expr . LBRACKET expr RBRACKET + 65 | expr . DOT IDENT + 67 ex_index_expr: expr . LBRACKET expr RBRACKET + 68 | expr . DOT IDENT - FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - expr go to state 160 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + DO shift, and go to state 160 + LBRACKET shift, and go to state 66 + DOT shift, and go to state 67 State 147 - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 24 | expr LBRACKET expr RBRACKET ASSIGNSLASH . expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 61 funcdecl_expr: FUNC IDENT LPAREN ident_list . RPAREN stmt END + 85 ident_list: ident_list . IDENT + 86 | ident_list . COMMA IDENT - FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - expr go to state 161 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + IDENT shift, and go to state 148 + RPAREN shift, and go to state 161 + COMMA shift, and go to state 150 State 148 - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 25 | expr LBRACKET expr RBRACKET ASSIGNDSTAR . expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 85 ident_list: ident_list IDENT . - FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - expr go to state 162 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + $default reduce using rule 85 (ident_list) State 149 - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 26 | expr LBRACKET expr RBRACKET ASSIGNBAND . expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 2 stmt: . expr + 3 | . IF expr THEN stmt END + 4 | . IF expr THEN stmt ELSE stmt END + 5 | . WHILE expr DO stmt END + 6 | . FOR IDENT IN expr DO stmt END + 7 | . RETURN expr + 8 | . RETURN + 9 | . BREAK + 10 | . CONTINUE + 11 | . stmt SEMICOLON + 12 | . stmt_list + 13 stmt_list: . stmt_list stmt + 14 | . stmt stmt + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 62 | FUNC LPAREN ident_list RPAREN . stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN + IF shift, and go to state 1 + WHILE shift, and go to state 2 + FOR shift, and go to state 3 FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - expr go to state 163 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + RETURN shift, and go to state 5 + BREAK shift, and go to state 6 + CONTINUE shift, and go to state 7 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + stmt go to state 162 + stmt_list go to state 19 + expr go to state 20 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 150 - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 27 | expr LBRACKET expr RBRACKET ASSIGNBOR . expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 86 ident_list: ident_list COMMA . IDENT - FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - expr go to state 164 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + IDENT shift, and go to state 163 State 151 - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 28 | expr LBRACKET expr RBRACKET ASSIGNBXOR . expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 64 index_expr: expr . LBRACKET expr RBRACKET + 65 | expr . DOT IDENT + 67 ex_index_expr: expr . LBRACKET expr RBRACKET + 68 | expr . DOT IDENT + 92 assoc_item: IDENT ASSIGN expr . [IDENT, RBRACE, LBRACKET, COMMA] - FUNC shift, and go to state 4 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - - expr go to state 165 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + LBRACKET shift, and go to state 66 + DOT shift, and go to state 67 + + LBRACKET [reduce using rule 92 (assoc_item)] + $default reduce using rule 92 (assoc_item) State 152 - 2 stmt: . expr - 3 | . IF expr THEN stmt END - 4 | . IF expr THEN stmt ELSE stmt END - 4 | IF expr THEN stmt ELSE stmt . END - 5 | . WHILE expr DO stmt END - 6 | . FOR IDENT IN expr DO stmt END - 7 | . stmt SEMICOLON - 7 | stmt . SEMICOLON - 8 | . stmt_list - 9 stmt_list: . stmt stmt - 9 | stmt . stmt - 10 | . stmt_list stmt - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 91 assoc_item: LBRACKET expr RBRACKET . ASSIGN expr - IF shift, and go to state 1 - WHILE shift, and go to state 2 - FOR shift, and go to state 3 - FUNC shift, and go to state 4 - END shift, and go to state 166 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - SEMICOLON shift, and go to state 58 - - stmt go to state 59 - stmt_list go to state 16 - expr go to state 17 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + ASSIGN shift, and go to state 164 State 153 - 2 stmt: . expr - 3 | . IF expr THEN stmt END - 4 | . IF expr THEN stmt ELSE stmt END - 5 | . WHILE expr DO stmt END - 6 | . FOR IDENT IN expr DO stmt END - 6 | FOR IDENT IN expr DO stmt . END - 7 | . stmt SEMICOLON - 7 | stmt . SEMICOLON - 8 | . stmt_list - 9 stmt_list: . stmt stmt - 9 | stmt . stmt - 10 | . stmt_list stmt - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 90 assoc_list: assoc_list COMMA assoc_item . - IF shift, and go to state 1 - WHILE shift, and go to state 2 - FOR shift, and go to state 3 - FUNC shift, and go to state 4 - END shift, and go to state 167 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - SEMICOLON shift, and go to state 58 - - stmt go to state 59 - stmt_list go to state 16 - expr go to state 17 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + $default reduce using rule 90 (assoc_list) State 154 - 2 stmt: . expr - 3 | . IF expr THEN stmt END - 4 | . IF expr THEN stmt ELSE stmt END - 5 | . WHILE expr DO stmt END - 6 | . FOR IDENT IN expr DO stmt END - 7 | . stmt SEMICOLON - 7 | stmt . SEMICOLON - 8 | . stmt_list - 9 stmt_list: . stmt stmt - 9 | stmt . stmt - 10 | . stmt_list stmt - 11 expr: . IDENT ASSIGN expr - 12 | . IDENT ASSIGNPLUS expr - 13 | . IDENT ASSIGNMINUS expr - 14 | . IDENT ASSIGNSTAR expr - 15 | . IDENT ASSIGNSLASH expr - 16 | . IDENT ASSIGNDSTAR expr - 17 | . IDENT ASSIGNBAND expr - 18 | . IDENT ASSIGNBOR expr - 19 | . IDENT ASSIGNBXOR expr - 20 | . expr LBRACKET expr RBRACKET ASSIGN expr - 21 | . expr LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | . expr LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | . expr LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | . expr LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | . expr LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | . expr LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | . expr LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | . expr LBRACKET expr RBRACKET ASSIGNBXOR expr - 29 | . logic_expr - 30 logic_expr: . logic_expr LAND logic_expr - 31 | . logic_expr LOR logic_expr - 32 | . ulogic_expr - 33 ulogic_expr: . LNOT ulogic_expr - 34 | . rel_expr - 35 rel_expr: . rel_expr EQUAL rel_expr - 36 | . rel_expr LESS rel_expr - 37 | . rel_expr GREATER rel_expr - 38 | . rel_expr LESSEQ rel_expr - 39 | . rel_expr GREATEREQ rel_expr - 40 | . term_expr - 41 term_expr: . term_expr PLUS term_expr - 42 | . term_expr MINUS term_expr - 43 | . factor_expr - 44 factor_expr: . factor_expr STAR factor_expr - 45 | . factor_expr SLASH factor_expr - 46 | . power_expr - 47 power_expr: . power_expr DSTAR power_expr - 48 | . binary_expr - 49 binary_expr: . ubinary_expr BAND ubinary_expr - 50 | . ubinary_expr BOR ubinary_expr - 51 | . ubinary_expr BXOR ubinary_expr - 52 | . ubinary_expr - 53 ubinary_expr: . BNOT call_expr - 54 | . call_expr - 55 call_expr: . call_expr LPAREN expr_list RPAREN - 56 | . funcdecl_expr - 57 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END - 57 | FUNC IDENT LPAREN ident_list RPAREN stmt . END - 58 | . FUNC LPAREN ident_list RPAREN stmt END - 59 | . ref_expr - 60 ref_expr: . IDENT - 61 | . index_expr - 62 index_expr: . index_expr LBRACKET index_expr RBRACKET - 63 | . lit_expr - 64 lit_expr: . INT - 65 | . FLOAT - 66 | . STRING - 67 | . gen_expr - 68 gen_expr: . LBRACKET expr_list RBRACKET - 69 | . LBRACE assoc_list RBRACE - 70 | . paren_expr - 71 paren_expr: . LPAREN expr RPAREN + 64 index_expr: expr . LBRACKET expr RBRACKET + 65 | expr . DOT IDENT + 67 ex_index_expr: expr . LBRACKET expr RBRACKET + 68 | expr . DOT IDENT + 82 expr_list: expr_list COMMA expr . [FUNC, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, COMMA] - IF shift, and go to state 1 - WHILE shift, and go to state 2 - FOR shift, and go to state 3 - FUNC shift, and go to state 4 - END shift, and go to state 168 - IDENT shift, and go to state 5 - INT shift, and go to state 6 - FLOAT shift, and go to state 7 - STRING shift, and go to state 8 - BNOT shift, and go to state 9 - LNOT shift, and go to state 10 - LBRACE shift, and go to state 11 - LPAREN shift, and go to state 12 - LBRACKET shift, and go to state 13 - SEMICOLON shift, and go to state 58 - - stmt go to state 59 - stmt_list go to state 16 - expr go to state 17 - logic_expr go to state 18 - ulogic_expr go to state 19 - rel_expr go to state 20 - term_expr go to state 21 - factor_expr go to state 22 - power_expr go to state 23 - binary_expr go to state 24 - ubinary_expr go to state 25 - call_expr go to state 26 - funcdecl_expr go to state 27 - ref_expr go to state 28 - index_expr go to state 29 - lit_expr go to state 30 - gen_expr go to state 31 - paren_expr go to state 32 + LBRACKET shift, and go to state 66 + DOT shift, and go to state 67 + + LBRACKET [reduce using rule 82 (expr_list)] + $default reduce using rule 82 (expr_list) State 155 - 58 funcdecl_expr: FUNC LPAREN ident_list RPAREN stmt END . + 64 index_expr: expr LBRACKET expr RBRACKET . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, IDENT, INT, FLOAT, STRING, PLUS, MINUS, STAR, SLASH, DSTAR, BAND, BOR, BXOR, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, SEMICOLON, COMMA] + 67 ex_index_expr: expr LBRACKET expr RBRACKET . [ASSIGN, ASSIGNPLUS, ASSIGNMINUS, ASSIGNSTAR, ASSIGNSLASH, ASSIGNDSTAR, ASSIGNBAND, ASSIGNBOR, ASSIGNBXOR] - $default reduce using rule 58 (funcdecl_expr) + ASSIGN reduce using rule 67 (ex_index_expr) + ASSIGNPLUS reduce using rule 67 (ex_index_expr) + ASSIGNMINUS reduce using rule 67 (ex_index_expr) + ASSIGNSTAR reduce using rule 67 (ex_index_expr) + ASSIGNSLASH reduce using rule 67 (ex_index_expr) + ASSIGNDSTAR reduce using rule 67 (ex_index_expr) + ASSIGNBAND reduce using rule 67 (ex_index_expr) + ASSIGNBOR reduce using rule 67 (ex_index_expr) + ASSIGNBXOR reduce using rule 67 (ex_index_expr) + $default reduce using rule 64 (index_expr) State 156 - 20 expr: expr . LBRACKET expr RBRACKET ASSIGN expr - 21 | expr . LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | expr . LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | expr . LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | expr . LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | expr . LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | expr . LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | expr . LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | expr . LBRACKET expr RBRACKET ASSIGNBXOR expr - 84 assoc_item: LBRACKET expr RBRACKET ASSIGN expr . [IDENT, RBRACE, LBRACKET, COMMA] - - LBRACKET shift, and go to state 61 + 59 call_expr: call_expr LPAREN expr_list RPAREN . - LBRACKET [reduce using rule 84 (assoc_item)] - $default reduce using rule 84 (assoc_item) + $default reduce using rule 59 (call_expr) State 157 - 20 expr: expr . LBRACKET expr RBRACKET ASSIGN expr - 20 | expr LBRACKET expr RBRACKET ASSIGN expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - 21 | expr . LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | expr . LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | expr . LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | expr . LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | expr . LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | expr . LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | expr . LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | expr . LBRACKET expr RBRACKET ASSIGNBXOR expr - - LBRACKET shift, and go to state 61 + 2 stmt: . expr + 3 | . IF expr THEN stmt END + 4 | . IF expr THEN stmt ELSE stmt END + 4 | IF expr THEN stmt ELSE . stmt END + 5 | . WHILE expr DO stmt END + 6 | . FOR IDENT IN expr DO stmt END + 7 | . RETURN expr + 8 | . RETURN + 9 | . BREAK + 10 | . CONTINUE + 11 | . stmt SEMICOLON + 12 | . stmt_list + 13 stmt_list: . stmt_list stmt + 14 | . stmt stmt + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN - LBRACKET [reduce using rule 20 (expr)] - $default reduce using rule 20 (expr) + IF shift, and go to state 1 + WHILE shift, and go to state 2 + FOR shift, and go to state 3 + FUNC shift, and go to state 4 + RETURN shift, and go to state 5 + BREAK shift, and go to state 6 + CONTINUE shift, and go to state 7 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + stmt go to state 165 + stmt_list go to state 19 + expr go to state 20 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 158 - 20 expr: expr . LBRACKET expr RBRACKET ASSIGN expr - 21 | expr . LBRACKET expr RBRACKET ASSIGNPLUS expr - 21 | expr LBRACKET expr RBRACKET ASSIGNPLUS expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - 22 | expr . LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | expr . LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | expr . LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | expr . LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | expr . LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | expr . LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | expr . LBRACKET expr RBRACKET ASSIGNBXOR expr - - LBRACKET shift, and go to state 61 + 3 stmt: IF expr THEN stmt END . - LBRACKET [reduce using rule 21 (expr)] - $default reduce using rule 21 (expr) + $default reduce using rule 3 (stmt) State 159 - 20 expr: expr . LBRACKET expr RBRACKET ASSIGN expr - 21 | expr . LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | expr . LBRACKET expr RBRACKET ASSIGNMINUS expr - 22 | expr LBRACKET expr RBRACKET ASSIGNMINUS expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - 23 | expr . LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | expr . LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | expr . LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | expr . LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | expr . LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | expr . LBRACKET expr RBRACKET ASSIGNBXOR expr - - LBRACKET shift, and go to state 61 + 5 stmt: WHILE expr DO stmt END . - LBRACKET [reduce using rule 22 (expr)] - $default reduce using rule 22 (expr) + $default reduce using rule 5 (stmt) State 160 - 20 expr: expr . LBRACKET expr RBRACKET ASSIGN expr - 21 | expr . LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | expr . LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | expr . LBRACKET expr RBRACKET ASSIGNSTAR expr - 23 | expr LBRACKET expr RBRACKET ASSIGNSTAR expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - 24 | expr . LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | expr . LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | expr . LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | expr . LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | expr . LBRACKET expr RBRACKET ASSIGNBXOR expr - - LBRACKET shift, and go to state 61 + 2 stmt: . expr + 3 | . IF expr THEN stmt END + 4 | . IF expr THEN stmt ELSE stmt END + 5 | . WHILE expr DO stmt END + 6 | . FOR IDENT IN expr DO stmt END + 6 | FOR IDENT IN expr DO . stmt END + 7 | . RETURN expr + 8 | . RETURN + 9 | . BREAK + 10 | . CONTINUE + 11 | . stmt SEMICOLON + 12 | . stmt_list + 13 stmt_list: . stmt_list stmt + 14 | . stmt stmt + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN - LBRACKET [reduce using rule 23 (expr)] - $default reduce using rule 23 (expr) + IF shift, and go to state 1 + WHILE shift, and go to state 2 + FOR shift, and go to state 3 + FUNC shift, and go to state 4 + RETURN shift, and go to state 5 + BREAK shift, and go to state 6 + CONTINUE shift, and go to state 7 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + stmt go to state 166 + stmt_list go to state 19 + expr go to state 20 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 161 - 20 expr: expr . LBRACKET expr RBRACKET ASSIGN expr - 21 | expr . LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | expr . LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | expr . LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | expr . LBRACKET expr RBRACKET ASSIGNSLASH expr - 24 | expr LBRACKET expr RBRACKET ASSIGNSLASH expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - 25 | expr . LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | expr . LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | expr . LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | expr . LBRACKET expr RBRACKET ASSIGNBXOR expr - - LBRACKET shift, and go to state 61 + 2 stmt: . expr + 3 | . IF expr THEN stmt END + 4 | . IF expr THEN stmt ELSE stmt END + 5 | . WHILE expr DO stmt END + 6 | . FOR IDENT IN expr DO stmt END + 7 | . RETURN expr + 8 | . RETURN + 9 | . BREAK + 10 | . CONTINUE + 11 | . stmt SEMICOLON + 12 | . stmt_list + 13 stmt_list: . stmt_list stmt + 14 | . stmt stmt + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 61 | FUNC IDENT LPAREN ident_list RPAREN . stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN - LBRACKET [reduce using rule 24 (expr)] - $default reduce using rule 24 (expr) + IF shift, and go to state 1 + WHILE shift, and go to state 2 + FOR shift, and go to state 3 + FUNC shift, and go to state 4 + RETURN shift, and go to state 5 + BREAK shift, and go to state 6 + CONTINUE shift, and go to state 7 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + stmt go to state 167 + stmt_list go to state 19 + expr go to state 20 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 162 - 20 expr: expr . LBRACKET expr RBRACKET ASSIGN expr - 21 | expr . LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | expr . LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | expr . LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | expr . LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | expr . LBRACKET expr RBRACKET ASSIGNDSTAR expr - 25 | expr LBRACKET expr RBRACKET ASSIGNDSTAR expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - 26 | expr . LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | expr . LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | expr . LBRACKET expr RBRACKET ASSIGNBXOR expr - - LBRACKET shift, and go to state 61 + 2 stmt: . expr + 3 | . IF expr THEN stmt END + 4 | . IF expr THEN stmt ELSE stmt END + 5 | . WHILE expr DO stmt END + 6 | . FOR IDENT IN expr DO stmt END + 7 | . RETURN expr + 8 | . RETURN + 9 | . BREAK + 10 | . CONTINUE + 11 | . stmt SEMICOLON + 11 | stmt . SEMICOLON + 12 | . stmt_list + 13 stmt_list: . stmt_list stmt + 14 | . stmt stmt + 14 | stmt . stmt + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 62 | FUNC LPAREN ident_list RPAREN stmt . END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN - LBRACKET [reduce using rule 25 (expr)] - $default reduce using rule 25 (expr) + IF shift, and go to state 1 + WHILE shift, and go to state 2 + FOR shift, and go to state 3 + FUNC shift, and go to state 4 + RETURN shift, and go to state 5 + BREAK shift, and go to state 6 + CONTINUE shift, and go to state 7 + END shift, and go to state 168 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + SEMICOLON shift, and go to state 63 + + stmt go to state 64 + stmt_list go to state 19 + expr go to state 20 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 163 - 20 expr: expr . LBRACKET expr RBRACKET ASSIGN expr - 21 | expr . LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | expr . LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | expr . LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | expr . LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | expr . LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | expr . LBRACKET expr RBRACKET ASSIGNBAND expr - 26 | expr LBRACKET expr RBRACKET ASSIGNBAND expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - 27 | expr . LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | expr . LBRACKET expr RBRACKET ASSIGNBXOR expr + 86 ident_list: ident_list COMMA IDENT . - LBRACKET shift, and go to state 61 - - LBRACKET [reduce using rule 26 (expr)] - $default reduce using rule 26 (expr) + $default reduce using rule 86 (ident_list) State 164 - 20 expr: expr . LBRACKET expr RBRACKET ASSIGN expr - 21 | expr . LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | expr . LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | expr . LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | expr . LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | expr . LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | expr . LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | expr . LBRACKET expr RBRACKET ASSIGNBOR expr - 27 | expr LBRACKET expr RBRACKET ASSIGNBOR expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - 28 | expr . LBRACKET expr RBRACKET ASSIGNBXOR expr + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN + 91 assoc_item: LBRACKET expr RBRACKET ASSIGN . expr - LBRACKET shift, and go to state 61 - - LBRACKET [reduce using rule 27 (expr)] - $default reduce using rule 27 (expr) + FUNC shift, and go to state 4 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + + expr go to state 169 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 165 - 20 expr: expr . LBRACKET expr RBRACKET ASSIGN expr - 21 | expr . LBRACKET expr RBRACKET ASSIGNPLUS expr - 22 | expr . LBRACKET expr RBRACKET ASSIGNMINUS expr - 23 | expr . LBRACKET expr RBRACKET ASSIGNSTAR expr - 24 | expr . LBRACKET expr RBRACKET ASSIGNSLASH expr - 25 | expr . LBRACKET expr RBRACKET ASSIGNDSTAR expr - 26 | expr . LBRACKET expr RBRACKET ASSIGNBAND expr - 27 | expr . LBRACKET expr RBRACKET ASSIGNBOR expr - 28 | expr . LBRACKET expr RBRACKET ASSIGNBXOR expr - 28 | expr LBRACKET expr RBRACKET ASSIGNBXOR expr . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, END, IDENT, INT, FLOAT, STRING, BNOT, LNOT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, SEMICOLON, COMMA] - - LBRACKET shift, and go to state 61 + 2 stmt: . expr + 3 | . IF expr THEN stmt END + 4 | . IF expr THEN stmt ELSE stmt END + 4 | IF expr THEN stmt ELSE stmt . END + 5 | . WHILE expr DO stmt END + 6 | . FOR IDENT IN expr DO stmt END + 7 | . RETURN expr + 8 | . RETURN + 9 | . BREAK + 10 | . CONTINUE + 11 | . stmt SEMICOLON + 11 | stmt . SEMICOLON + 12 | . stmt_list + 13 stmt_list: . stmt_list stmt + 14 | . stmt stmt + 14 | stmt . stmt + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN - LBRACKET [reduce using rule 28 (expr)] - $default reduce using rule 28 (expr) + IF shift, and go to state 1 + WHILE shift, and go to state 2 + FOR shift, and go to state 3 + FUNC shift, and go to state 4 + RETURN shift, and go to state 5 + BREAK shift, and go to state 6 + CONTINUE shift, and go to state 7 + END shift, and go to state 170 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + SEMICOLON shift, and go to state 63 + + stmt go to state 64 + stmt_list go to state 19 + expr go to state 20 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 State 166 + 2 stmt: . expr + 3 | . IF expr THEN stmt END + 4 | . IF expr THEN stmt ELSE stmt END + 5 | . WHILE expr DO stmt END + 6 | . FOR IDENT IN expr DO stmt END + 6 | FOR IDENT IN expr DO stmt . END + 7 | . RETURN expr + 8 | . RETURN + 9 | . BREAK + 10 | . CONTINUE + 11 | . stmt SEMICOLON + 11 | stmt . SEMICOLON + 12 | . stmt_list + 13 stmt_list: . stmt_list stmt + 14 | . stmt stmt + 14 | stmt . stmt + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN + + IF shift, and go to state 1 + WHILE shift, and go to state 2 + FOR shift, and go to state 3 + FUNC shift, and go to state 4 + RETURN shift, and go to state 5 + BREAK shift, and go to state 6 + CONTINUE shift, and go to state 7 + END shift, and go to state 171 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + SEMICOLON shift, and go to state 63 + + stmt go to state 64 + stmt_list go to state 19 + expr go to state 20 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 + + +State 167 + + 2 stmt: . expr + 3 | . IF expr THEN stmt END + 4 | . IF expr THEN stmt ELSE stmt END + 5 | . WHILE expr DO stmt END + 6 | . FOR IDENT IN expr DO stmt END + 7 | . RETURN expr + 8 | . RETURN + 9 | . BREAK + 10 | . CONTINUE + 11 | . stmt SEMICOLON + 11 | stmt . SEMICOLON + 12 | . stmt_list + 13 stmt_list: . stmt_list stmt + 14 | . stmt stmt + 14 | stmt . stmt + 15 expr: . IDENT ASSIGN expr + 16 | . IDENT ASSIGNPLUS expr + 17 | . IDENT ASSIGNMINUS expr + 18 | . IDENT ASSIGNSTAR expr + 19 | . IDENT ASSIGNSLASH expr + 20 | . IDENT ASSIGNDSTAR expr + 21 | . IDENT ASSIGNBAND expr + 22 | . IDENT ASSIGNBOR expr + 23 | . IDENT ASSIGNBXOR expr + 24 | . ex_index_expr ASSIGN expr + 25 | . ex_index_expr ASSIGNPLUS expr + 26 | . ex_index_expr ASSIGNMINUS expr + 27 | . ex_index_expr ASSIGNSTAR expr + 28 | . ex_index_expr ASSIGNSLASH expr + 29 | . ex_index_expr ASSIGNDSTAR expr + 30 | . ex_index_expr ASSIGNBAND expr + 31 | . ex_index_expr ASSIGNBOR expr + 32 | . ex_index_expr ASSIGNBXOR expr + 33 | . logic_expr + 34 logic_expr: . logic_expr LAND logic_expr + 35 | . logic_expr LOR logic_expr + 36 | . ulogic_expr + 37 ulogic_expr: . LNOT ulogic_expr + 38 | . rel_expr + 39 rel_expr: . rel_expr EQUAL rel_expr + 40 | . rel_expr LESS rel_expr + 41 | . rel_expr GREATER rel_expr + 42 | . rel_expr LESSEQ rel_expr + 43 | . rel_expr GREATEREQ rel_expr + 44 | . term_expr + 45 term_expr: . term_expr PLUS term_expr + 46 | . term_expr MINUS term_expr + 47 | . factor_expr + 48 factor_expr: . factor_expr STAR factor_expr + 49 | . factor_expr SLASH factor_expr + 50 | . power_expr + 51 power_expr: . power_expr DSTAR power_expr + 52 | . binary_expr + 53 binary_expr: . ubinary_expr BAND ubinary_expr + 54 | . ubinary_expr BOR ubinary_expr + 55 | . ubinary_expr BXOR ubinary_expr + 56 | . ubinary_expr + 57 ubinary_expr: . BNOT call_expr + 58 | . call_expr + 59 call_expr: . call_expr LPAREN expr_list RPAREN + 60 | . funcdecl_expr + 61 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt END + 61 | FUNC IDENT LPAREN ident_list RPAREN stmt . END + 62 | . FUNC LPAREN ident_list RPAREN stmt END + 63 | . index_expr + 64 index_expr: . expr LBRACKET expr RBRACKET + 65 | . expr DOT IDENT + 66 | . ref_expr + 67 ex_index_expr: . expr LBRACKET expr RBRACKET + 68 | . expr DOT IDENT + 69 ref_expr: . IDENT + 70 | . lit_expr + 71 lit_expr: . INT + 72 | . FLOAT + 73 | . STRING + 74 | . gen_expr + 75 gen_expr: . LBRACKET expr_list RBRACKET + 76 | . LBRACE assoc_list RBRACE + 77 | . paren_expr + 78 paren_expr: . LPAREN expr RPAREN + + IF shift, and go to state 1 + WHILE shift, and go to state 2 + FOR shift, and go to state 3 + FUNC shift, and go to state 4 + RETURN shift, and go to state 5 + BREAK shift, and go to state 6 + CONTINUE shift, and go to state 7 + END shift, and go to state 172 + IDENT shift, and go to state 8 + INT shift, and go to state 9 + FLOAT shift, and go to state 10 + STRING shift, and go to state 11 + BNOT shift, and go to state 12 + LNOT shift, and go to state 13 + LBRACE shift, and go to state 14 + LPAREN shift, and go to state 15 + LBRACKET shift, and go to state 16 + SEMICOLON shift, and go to state 63 + + stmt go to state 64 + stmt_list go to state 19 + expr go to state 20 + logic_expr go to state 21 + ulogic_expr go to state 22 + rel_expr go to state 23 + term_expr go to state 24 + factor_expr go to state 25 + power_expr go to state 26 + binary_expr go to state 27 + ubinary_expr go to state 28 + call_expr go to state 29 + funcdecl_expr go to state 30 + index_expr go to state 31 + ex_index_expr go to state 32 + ref_expr go to state 33 + lit_expr go to state 34 + gen_expr go to state 35 + paren_expr go to state 36 + + +State 168 + + 62 funcdecl_expr: FUNC LPAREN ident_list RPAREN stmt END . + + $default reduce using rule 62 (funcdecl_expr) + + +State 169 + + 64 index_expr: expr . LBRACKET expr RBRACKET + 65 | expr . DOT IDENT + 67 ex_index_expr: expr . LBRACKET expr RBRACKET + 68 | expr . DOT IDENT + 91 assoc_item: LBRACKET expr RBRACKET ASSIGN expr . [IDENT, RBRACE, LBRACKET, COMMA] + + LBRACKET shift, and go to state 66 + DOT shift, and go to state 67 + + LBRACKET [reduce using rule 91 (assoc_item)] + $default reduce using rule 91 (assoc_item) + + +State 170 + 4 stmt: IF expr THEN stmt ELSE stmt END . $default reduce using rule 4 (stmt) -State 167 +State 171 6 stmt: FOR IDENT IN expr DO stmt END . $default reduce using rule 6 (stmt) -State 168 +State 172 - 57 funcdecl_expr: FUNC IDENT LPAREN ident_list RPAREN stmt END . + 61 funcdecl_expr: FUNC IDENT LPAREN ident_list RPAREN stmt END . - $default reduce using rule 57 (funcdecl_expr) + $default reduce using rule 61 (funcdecl_expr) diff --git a/parser.tab.c b/parser.tab.c index 9300c4c..cda5c7f 100644 --- a/parser.tab.c +++ b/parser.tab.c @@ -1,19 +1,19 @@ -/* A Bison parser, made by GNU Bison 2.7.12-4996. */ +/* A Bison parser, made by GNU Bison 3.0.2. */ /* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -26,7 +26,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -44,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.7.12-4996" +#define YYBISON_VERSION "3.0.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -62,8 +62,7 @@ /* Copy the first part of user declarations. */ -/* Line 371 of yacc.c */ -#line 1 "parser.y" +#line 1 "parser.y" /* yacc.c:339 */ #include "sol.h" #include "ast.h" @@ -73,14 +72,13 @@ #define YYSTYPE void * -/* Line 371 of yacc.c */ -#line 78 "parser.tab.c" +#line 76 "parser.tab.c" /* yacc.c:339 */ -# ifndef YY_NULL +# ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULL nullptr +# define YY_NULLPTR nullptr # else -# define YY_NULL 0 +# define YY_NULLPTR 0 # endif # endif @@ -96,7 +94,7 @@ by #include "parser.tab.h". */ #ifndef YY_YY_PARSER_TAB_H_INCLUDED # define YY_YY_PARSER_TAB_H_INCLUDED -/* Enabling traces. */ +/* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 1 #endif @@ -104,94 +102,83 @@ extern int yydebug; #endif -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - IF = 258, - THEN = 259, - ELSE = 260, - WHILE = 261, - FOR = 262, - IN = 263, - DO = 264, - FUNC = 265, - END = 266, - IDENT = 267, - INT = 268, - FLOAT = 269, - STRING = 270, - PLUS = 271, - MINUS = 272, - STAR = 273, - SLASH = 274, - DSTAR = 275, - BAND = 276, - BOR = 277, - BXOR = 278, - BNOT = 279, - LAND = 280, - LOR = 281, - LNOT = 282, - ASSIGN = 283, - ASSIGNPLUS = 284, - ASSIGNMINUS = 285, - ASSIGNSTAR = 286, - ASSIGNSLASH = 287, - ASSIGNDSTAR = 288, - ASSIGNBAND = 289, - ASSIGNBOR = 290, - ASSIGNBXOR = 291, - EQUAL = 292, - LESS = 293, - GREATER = 294, - LESSEQ = 295, - GREATEREQ = 296, - LBRACE = 297, - RBRACE = 298, - LPAREN = 299, - RPAREN = 300, - LBRACKET = 301, - RBRACKET = 302, - DOT = 303, - COLON = 304, - SEMICOLON = 305, - COMMA = 306 - }; + enum yytokentype + { + IF = 258, + THEN = 259, + ELSE = 260, + WHILE = 261, + FOR = 262, + IN = 263, + DO = 264, + FUNC = 265, + RETURN = 266, + BREAK = 267, + CONTINUE = 268, + END = 269, + IDENT = 270, + INT = 271, + FLOAT = 272, + STRING = 273, + PLUS = 274, + MINUS = 275, + STAR = 276, + SLASH = 277, + DSTAR = 278, + BAND = 279, + BOR = 280, + BXOR = 281, + BNOT = 282, + LAND = 283, + LOR = 284, + LNOT = 285, + ASSIGN = 286, + ASSIGNPLUS = 287, + ASSIGNMINUS = 288, + ASSIGNSTAR = 289, + ASSIGNSLASH = 290, + ASSIGNDSTAR = 291, + ASSIGNBAND = 292, + ASSIGNBOR = 293, + ASSIGNBXOR = 294, + EQUAL = 295, + LESS = 296, + GREATER = 297, + LESSEQ = 298, + GREATEREQ = 299, + LBRACE = 300, + RBRACE = 301, + LPAREN = 302, + RPAREN = 303, + LBRACKET = 304, + RBRACKET = 305, + DOT = 306, + COLON = 307, + SEMICOLON = 308, + COMMA = 309 + }; #endif - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif + extern YYSTYPE yylval; -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus int yyparse (stmt_node **program); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ #endif /* !YY_YY_PARSER_TAB_H_INCLUDED */ /* Copy the second part of user declarations. */ -/* Line 390 of yacc.c */ -#line 195 "parser.tab.c" +#line 182 "parser.tab.c" /* yacc.c:358 */ #ifdef short # undef short @@ -205,11 +192,8 @@ typedef unsigned char yytype_uint8; #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; #else -typedef short int yytype_int8; +typedef signed char yytype_int8; #endif #ifdef YYTYPE_UINT16 @@ -229,8 +213,7 @@ typedef short int yytype_int16; # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# elif ! defined YYSIZE_T # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else @@ -252,11 +235,30 @@ typedef short int yytype_int16; # endif #endif -#ifndef __attribute__ -/* This feature is available in gcc versions 2.5 and later. */ -# if (! defined __GNUC__ || __GNUC__ < 2 \ - || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)) -# define __attribute__(Spec) /* empty */ +#ifndef YY_ATTRIBUTE +# if (defined __GNUC__ \ + && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ + || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C +# define YY_ATTRIBUTE(Spec) __attribute__(Spec) +# else +# define YY_ATTRIBUTE(Spec) /* empty */ +# endif +#endif + +#ifndef YY_ATTRIBUTE_PURE +# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) +#endif + +#if !defined _Noreturn \ + && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) +# if defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) # endif #endif @@ -267,25 +269,26 @@ typedef short int yytype_int16; # define YYUSE(E) /* empty */ #endif - -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(N) (N) +#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") #else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int yyi) -#else -static int -YYID (yyi) - int yyi; +# define YY_INITIAL_VALUE(Value) Value #endif -{ - return yyi; -} +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif + #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -303,8 +306,7 @@ YYID (yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS @@ -316,8 +318,8 @@ YYID (yyi) # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely @@ -333,7 +335,7 @@ YYID (yyi) # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) + && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 @@ -341,15 +343,13 @@ YYID (yyi) # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif @@ -359,7 +359,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc @@ -384,16 +384,16 @@ union yyalloc elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) #endif @@ -412,33 +412,35 @@ union yyalloc for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ - while (YYID (0)) + while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 57 +#define YYFINAL 62 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 398 +#define YYLAST 562 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 52 +#define YYNTOKENS 55 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 24 +#define YYNNTS 25 /* YYNRULES -- Number of rules. */ -#define YYNRULES 86 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 169 +#define YYNRULES 93 +/* YYNSTATES -- Number of states. */ +#define YYNSTATES 173 -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned + by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 306 +#define YYMAXUTOK 309 -#define YYTRANSLATE(YYX) \ +#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, without out-of-bounds checking. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -471,75 +473,23 @@ static const yytype_uint8 yytranslate[] = 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51 + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54 }; #if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint16 yyprhs[] = -{ - 0, 0, 3, 5, 7, 13, 21, 27, 35, 38, - 40, 43, 46, 50, 54, 58, 62, 66, 70, 74, - 78, 82, 89, 96, 103, 110, 117, 124, 131, 138, - 145, 147, 151, 155, 157, 160, 162, 166, 170, 174, - 178, 182, 184, 188, 192, 194, 198, 202, 204, 208, - 210, 214, 218, 222, 224, 227, 229, 234, 236, 244, - 251, 253, 255, 257, 262, 264, 266, 268, 270, 272, - 276, 280, 282, 286, 287, 289, 292, 296, 297, 299, - 302, 306, 307, 309, 312, 316, 322 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int8 yyrhs[] = -{ - 53, 0, -1, 54, -1, 56, -1, 3, 56, 4, - 54, 11, -1, 3, 56, 4, 54, 5, 54, 11, - -1, 6, 56, 9, 54, 11, -1, 7, 12, 8, - 56, 9, 54, 11, -1, 54, 50, -1, 55, -1, - 54, 54, -1, 55, 54, -1, 12, 28, 56, -1, - 12, 29, 56, -1, 12, 30, 56, -1, 12, 31, - 56, -1, 12, 32, 56, -1, 12, 33, 56, -1, - 12, 34, 56, -1, 12, 35, 56, -1, 12, 36, - 56, -1, 56, 46, 56, 47, 28, 56, -1, 56, - 46, 56, 47, 29, 56, -1, 56, 46, 56, 47, - 30, 56, -1, 56, 46, 56, 47, 31, 56, -1, - 56, 46, 56, 47, 32, 56, -1, 56, 46, 56, - 47, 33, 56, -1, 56, 46, 56, 47, 34, 56, - -1, 56, 46, 56, 47, 35, 56, -1, 56, 46, - 56, 47, 36, 56, -1, 57, -1, 57, 25, 57, - -1, 57, 26, 57, -1, 58, -1, 27, 58, -1, - 59, -1, 59, 37, 59, -1, 59, 38, 59, -1, - 59, 39, 59, -1, 59, 40, 59, -1, 59, 41, - 59, -1, 60, -1, 60, 16, 60, -1, 60, 17, - 60, -1, 61, -1, 61, 18, 61, -1, 61, 19, - 61, -1, 62, -1, 62, 20, 62, -1, 63, -1, - 64, 21, 64, -1, 64, 22, 64, -1, 64, 23, - 64, -1, 64, -1, 24, 65, -1, 65, -1, 65, - 44, 72, 45, -1, 66, -1, 10, 12, 44, 73, - 45, 54, 11, -1, 10, 44, 73, 45, 54, 11, - -1, 67, -1, 12, -1, 68, -1, 68, 46, 68, - 47, -1, 69, -1, 13, -1, 14, -1, 15, -1, - 70, -1, 46, 72, 47, -1, 42, 74, 43, -1, - 71, -1, 44, 56, 45, -1, -1, 56, -1, 72, - 56, -1, 72, 51, 56, -1, -1, 12, -1, 73, - 12, -1, 73, 51, 12, -1, -1, 75, -1, 74, - 75, -1, 74, 51, 75, -1, 46, 56, 47, 28, - 56, -1, 12, 28, 56, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ + /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 31, 31, 35, 36, 37, 38, 39, 40, 41, - 45, 54, 66, 67, 74, 81, 88, 95, 102, 109, - 116, 123, 131, 139, 147, 155, 163, 171, 179, 187, - 195, 199, 200, 201, 205, 206, 210, 211, 212, 213, - 214, 215, 219, 220, 221, 225, 226, 227, 231, 232, - 236, 237, 238, 239, 243, 244, 248, 249, 253, 261, - 269, 273, 274, 278, 279, 283, 284, 285, 286, 290, - 291, 292, 296, 300, 301, 306, 315, 327, 328, 333, - 342, 354, 355, 360, 369, 381, 386 + 42, 43, 44, 45, 49, 58, 70, 71, 78, 85, + 92, 99, 106, 113, 120, 127, 140, 153, 166, 179, + 192, 205, 218, 231, 244, 248, 249, 250, 254, 255, + 259, 260, 261, 262, 263, 264, 268, 269, 270, 274, + 275, 276, 280, 281, 285, 286, 287, 288, 292, 293, + 297, 298, 302, 310, 318, 322, 323, 334, 338, 339, + 353, 354, 358, 359, 360, 361, 365, 366, 367, 371, + 375, 376, 381, 390, 402, 403, 408, 417, 429, 430, + 435, 444, 456, 461 }; #endif @@ -549,23 +499,24 @@ static const yytype_uint16 yyrline[] = static const char *const yytname[] = { "$end", "error", "$undefined", "IF", "THEN", "ELSE", "WHILE", "FOR", - "IN", "DO", "FUNC", "END", "IDENT", "INT", "FLOAT", "STRING", "PLUS", - "MINUS", "STAR", "SLASH", "DSTAR", "BAND", "BOR", "BXOR", "BNOT", "LAND", - "LOR", "LNOT", "ASSIGN", "ASSIGNPLUS", "ASSIGNMINUS", "ASSIGNSTAR", - "ASSIGNSLASH", "ASSIGNDSTAR", "ASSIGNBAND", "ASSIGNBOR", "ASSIGNBXOR", - "EQUAL", "LESS", "GREATER", "LESSEQ", "GREATEREQ", "LBRACE", "RBRACE", - "LPAREN", "RPAREN", "LBRACKET", "RBRACKET", "DOT", "COLON", "SEMICOLON", - "COMMA", "$accept", "program", "stmt", "stmt_list", "expr", "logic_expr", - "ulogic_expr", "rel_expr", "term_expr", "factor_expr", "power_expr", - "binary_expr", "ubinary_expr", "call_expr", "funcdecl_expr", "ref_expr", - "index_expr", "lit_expr", "gen_expr", "paren_expr", "expr_list", - "ident_list", "assoc_list", "assoc_item", YY_NULL + "IN", "DO", "FUNC", "RETURN", "BREAK", "CONTINUE", "END", "IDENT", "INT", + "FLOAT", "STRING", "PLUS", "MINUS", "STAR", "SLASH", "DSTAR", "BAND", + "BOR", "BXOR", "BNOT", "LAND", "LOR", "LNOT", "ASSIGN", "ASSIGNPLUS", + "ASSIGNMINUS", "ASSIGNSTAR", "ASSIGNSLASH", "ASSIGNDSTAR", "ASSIGNBAND", + "ASSIGNBOR", "ASSIGNBXOR", "EQUAL", "LESS", "GREATER", "LESSEQ", + "GREATEREQ", "LBRACE", "RBRACE", "LPAREN", "RPAREN", "LBRACKET", + "RBRACKET", "DOT", "COLON", "SEMICOLON", "COMMA", "$accept", "program", + "stmt", "stmt_list", "expr", "logic_expr", "ulogic_expr", "rel_expr", + "term_expr", "factor_expr", "power_expr", "binary_expr", "ubinary_expr", + "call_expr", "funcdecl_expr", "index_expr", "ex_index_expr", "ref_expr", + "lit_expr", "gen_expr", "paren_expr", "expr_list", "ident_list", + "assoc_list", "assoc_item", YY_NULLPTR }; #endif # ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ +/* YYTOKNUM[NUM] -- (External) token number corresponding to the + (internal) symbol number NUM (which must be that of a token). */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, @@ -573,247 +524,274 @@ static const yytype_uint16 yytoknum[] = 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306 + 305, 306, 307, 308, 309 }; # endif -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = +#define YYPACT_NINF -56 + +#define yypact_value_is_default(Yystate) \ + (!!((Yystate) == (-56))) + +#define YYTABLE_NINF -70 + +#define yytable_value_is_error(Yytable_value) \ + 0 + + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +static const yytype_int16 yypact[] = { - 0, 52, 53, 54, 54, 54, 54, 54, 54, 54, - 55, 55, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 57, 57, 57, 58, 58, 59, 59, 59, 59, - 59, 59, 60, 60, 60, 61, 61, 61, 62, 62, - 63, 63, 63, 63, 64, 64, 65, 65, 66, 66, - 66, 67, 67, 68, 68, 69, 69, 69, 69, 70, - 70, 70, 71, 72, 72, 72, 72, 73, 73, 73, - 73, 74, 74, 74, 74, 75, 75 + 380, 437, 437, -5, -8, 437, -56, -56, 196, -56, + -56, -56, 437, 437, -12, 437, 437, 13, 335, 380, + -33, 93, -56, 68, 21, 129, -3, -56, 123, -17, + -56, -56, 266, -56, -56, -56, -56, 2, 8, 30, + 7, 51, -33, 437, 437, 437, 437, 437, 437, 437, + 437, 437, -33, -17, -20, 61, 437, 47, -56, -26, + -33, 396, -56, -56, 335, 335, 437, 80, 437, 437, + 437, 437, 437, 437, 437, 437, 437, 437, 437, 437, + 437, 437, 437, 437, 437, 437, 437, 437, 437, 437, + 437, 437, 437, 380, 380, 437, 51, -56, 4, -33, + -33, -33, -33, -33, -33, -33, -33, -33, 437, -23, + -56, -12, -56, -56, -56, 437, -33, 107, 336, 95, + 95, 76, 76, 76, 76, 76, 502, 502, 485, 485, + 468, 123, 123, 123, 421, -33, -33, -33, -33, -33, + -33, -33, -33, -33, 125, 170, 12, 49, -56, 380, + 85, -33, 71, -56, -33, 523, -56, 380, -56, -56, + 380, 380, 195, -56, 437, 240, 265, 310, -56, -33, + -56, -56, -56 }; -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = + /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ +static const yytype_uint8 yydefact[] = { - 0, 2, 1, 1, 5, 7, 5, 7, 2, 1, - 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 1, 3, 3, 1, 2, 1, 3, 3, 3, 3, - 3, 1, 3, 3, 1, 3, 3, 1, 3, 1, - 3, 3, 3, 1, 2, 1, 4, 1, 7, 6, - 1, 1, 1, 4, 1, 1, 1, 1, 1, 3, - 3, 1, 3, 0, 1, 2, 3, 0, 1, 2, - 3, 0, 1, 2, 3, 5, 3 + 0, 0, 0, 0, 0, 9, 10, 11, 70, 72, + 73, 74, 0, 0, 88, 0, 80, 0, 2, 13, + 3, 34, 37, 39, 45, 48, 51, 53, 57, 59, + 61, 64, 0, 67, 71, 75, 78, 0, 0, 0, + 0, 84, 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 58, 38, 0, 0, 0, 89, 0, + 81, 0, 1, 12, 15, 14, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 84, 85, 0, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 0, 0, + 77, 0, 90, 79, 76, 0, 82, 0, 66, 35, + 36, 40, 41, 42, 43, 44, 46, 47, 49, 50, + 52, 54, 55, 56, 0, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 0, 0, 0, 0, 86, 0, + 0, 93, 0, 91, 83, 65, 60, 0, 4, 6, + 0, 0, 0, 87, 0, 0, 0, 0, 63, 92, + 5, 7, 62 }; -/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = + /* YYPGOTO[NTERM-NUM]. */ +static const yytype_int8 yypgoto[] = { - 0, 0, 0, 0, 0, 61, 65, 66, 67, 0, - 0, 81, 0, 73, 0, 2, 9, 3, 30, 33, - 35, 41, 44, 47, 49, 53, 55, 57, 60, 62, - 64, 68, 71, 0, 0, 0, 0, 77, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 61, 54, 34, - 0, 0, 0, 82, 0, 74, 0, 1, 8, 10, - 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 73, 0, 0, - 0, 0, 77, 78, 0, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 0, 0, 70, 0, 83, 72, - 69, 0, 75, 0, 31, 32, 36, 37, 38, 39, - 40, 42, 43, 45, 46, 48, 50, 51, 52, 0, - 0, 0, 0, 0, 0, 79, 0, 0, 86, 0, - 84, 76, 0, 56, 63, 0, 4, 6, 0, 0, - 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 59, 85, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 5, 7, 58 + -56, -56, 5, -56, -1, 99, 100, -38, 114, 115, + 27, -56, 79, 103, -56, -56, -56, -56, -56, -56, + -56, 43, 33, -56, -55 }; -/* YYDEFGOTO[NTERM-NUM]. */ + /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { - -1, 14, 59, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 56, 84, 52, 53 + -1, 17, 64, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 61, 98, 57, 58 }; -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -51 -static const yytype_int16 yypact[] = + /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ +static const yytype_int16 yytable[] = { - 59, 299, 299, 4, -9, 344, -51, -51, -51, 340, - 305, 12, 299, 299, 23, 235, 59, -19, -21, -51, - 139, 65, 14, 9, -51, -14, -8, -51, -51, 8, - -51, -51, -51, 2, 6, 62, 24, 63, 299, 299, - 299, 299, 299, 299, 299, 299, 299, -51, -8, -51, - 74, 299, 13, -51, 39, -19, 251, -51, -51, 235, - 235, 299, 305, 305, 324, 324, 324, 324, 324, 324, - 324, 324, 324, 324, 324, 324, 324, 299, 343, 59, - 59, 299, 63, -51, 16, -19, -19, -19, -19, -19, - -19, -19, -19, -19, 299, 60, -51, 12, -51, -51, - -51, 299, -19, 67, -21, -21, 139, 139, 139, 139, - 139, 65, 65, 14, 14, 9, -51, -51, -51, 259, - 91, 84, 7, 17, 80, -51, 59, 76, -19, 99, - -51, -19, 362, -51, -51, 59, -51, -51, 59, 59, - 109, -51, 299, 299, 299, 299, 299, 299, 299, 299, - 299, 299, 160, 185, 210, -51, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -51, -51, -51 + 37, 38, 112, 55, 42, 18, 93, 40, -37, -37, + 39, 52, 52, 62, 59, 60, 66, 94, 67, 148, + 79, 160, 113, 66, 65, 67, 66, 152, 67, -37, + 83, -37, 121, 122, 123, 124, 125, 56, 95, 41, + 75, 76, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 66, 149, 67, 96, 109, 153, 66, 150, 67, + 116, 66, 55, 67, 148, 117, 97, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 60, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 108, 110, 146, 118, 56, 161, 144, 145, + 163, 111, 164, 150, -39, -39, 130, 151, 70, 71, + 72, 73, 74, 54, 154, 53, 70, 71, 72, 73, + 74, 68, 69, 68, 69, -39, 134, -39, 1, 147, + 157, 2, 3, 116, 0, 4, 5, 6, 7, 158, + 8, 9, 10, 11, -34, 0, -34, 80, 81, 82, + 77, 78, 12, 0, 162, 13, 66, 155, 67, 131, + 132, 133, 165, 169, 0, 166, 167, 119, 120, 0, + 14, 0, 15, 1, 16, 0, 2, 3, 63, 0, + 4, 5, 6, 7, 159, 8, 9, 10, 11, 126, + 127, 0, 128, 129, 0, 0, 0, 12, 1, 0, + 13, 2, 3, 0, 0, 4, 5, 6, 7, 168, + 8, 9, 10, 11, 0, 14, 0, 15, 0, 16, + 0, 0, 12, 63, 0, 13, 0, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 0, 0, 0, 0, + 14, 0, 15, 1, 16, 0, 2, 3, 63, 0, + 4, 5, 6, 7, 170, 8, 9, 10, 11, 0, + 0, 0, 0, 0, 0, 0, 0, 12, 1, 0, + 13, 2, 3, 0, 0, 4, 5, 6, 7, 171, + 8, 9, 10, 11, 0, 14, 0, 15, 0, 16, + 0, 0, 12, 63, 0, 13, 0, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 0, 0, 0, 0, + 14, 0, 15, 1, 16, 0, 2, 3, 63, 0, + 4, 5, 6, 7, 172, 8, 9, 10, 11, 0, + 0, 0, 0, 0, 0, 0, 0, 12, 1, 0, + 13, 2, 3, 0, 0, 4, 5, 6, 7, 0, + 8, 9, 10, 11, 0, 14, 0, 15, 0, 16, + 0, 0, 12, 63, 0, 13, 0, -69, -69, -69, + -69, -69, -69, -69, -69, -69, 0, 0, 0, 0, + 14, 0, 15, 1, 16, 0, 2, 3, 63, 0, + 4, 5, 6, 7, 0, 8, 9, 10, 11, 0, + 0, 0, 0, 0, 0, 0, 4, 12, 0, 0, + 13, 8, 9, 10, 11, 0, 0, 0, 0, 0, + 0, 0, 0, 12, 0, 14, 13, 15, 0, 16, + 0, 4, 0, 0, 0, 0, 8, 9, 10, 11, + 0, 14, 0, 15, 0, 16, 114, 4, 12, 0, + 115, 13, 8, 9, 10, 11, 0, 0, 0, 0, + 0, 0, 0, 0, 12, 0, 14, 13, 15, 156, + 16, 0, 0, 0, 0, 115, 0, 0, 0, 0, + 0, 0, 14, 0, 15, 0, 16, -51, -51, -51, + -51, 79, 0, 0, 0, 0, -51, -51, 0, 0, + 0, 0, 0, 0, -48, -48, 77, 78, -51, -51, + -51, -51, -51, -48, -48, 0, 0, -51, 0, -51, + 0, 75, 76, 0, 0, -48, -48, -48, -48, -48, + -45, -45, 0, 0, -48, 0, -48, 0, 0, 0, + 0, 0, -45, -45, -45, -45, -45, 0, 0, 0, + 0, -45, 0, -45, -68, -68, -68, -68, -68, -68, + -68, -68, -68 }; -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = +static const yytype_int16 yycheck[] = { - -51, -51, 30, -51, -1, 77, 94, 223, 88, 89, - 44, -51, 3, 120, -51, -51, 54, -51, -51, -51, - 58, 70, -51, -50 + 1, 2, 57, 15, 5, 0, 4, 15, 28, 29, + 15, 12, 13, 0, 15, 16, 49, 9, 51, 15, + 23, 9, 48, 49, 19, 51, 49, 50, 51, 49, + 47, 51, 70, 71, 72, 73, 74, 49, 8, 47, + 19, 20, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 49, 48, 51, 47, 56, 111, 49, 54, 51, + 61, 49, 15, 51, 15, 66, 15, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 31, 46, 95, 15, 49, 48, 93, 94, + 15, 54, 31, 54, 28, 29, 79, 108, 40, 41, + 42, 43, 44, 13, 115, 12, 40, 41, 42, 43, + 44, 28, 29, 28, 29, 49, 83, 51, 3, 96, + 5, 6, 7, 134, -1, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 49, -1, 51, 24, 25, 26, + 21, 22, 27, -1, 149, 30, 49, 50, 51, 80, + 81, 82, 157, 164, -1, 160, 161, 68, 69, -1, + 45, -1, 47, 3, 49, -1, 6, 7, 53, -1, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 75, + 76, -1, 77, 78, -1, -1, -1, 27, 3, -1, + 30, 6, 7, -1, -1, 10, 11, 12, 13, 14, + 15, 16, 17, 18, -1, 45, -1, 47, -1, 49, + -1, -1, 27, 53, -1, 30, -1, 31, 32, 33, + 34, 35, 36, 37, 38, 39, -1, -1, -1, -1, + 45, -1, 47, 3, 49, -1, 6, 7, 53, -1, + 10, 11, 12, 13, 14, 15, 16, 17, 18, -1, + -1, -1, -1, -1, -1, -1, -1, 27, 3, -1, + 30, 6, 7, -1, -1, 10, 11, 12, 13, 14, + 15, 16, 17, 18, -1, 45, -1, 47, -1, 49, + -1, -1, 27, 53, -1, 30, -1, 31, 32, 33, + 34, 35, 36, 37, 38, 39, -1, -1, -1, -1, + 45, -1, 47, 3, 49, -1, 6, 7, 53, -1, + 10, 11, 12, 13, 14, 15, 16, 17, 18, -1, + -1, -1, -1, -1, -1, -1, -1, 27, 3, -1, + 30, 6, 7, -1, -1, 10, 11, 12, 13, -1, + 15, 16, 17, 18, -1, 45, -1, 47, -1, 49, + -1, -1, 27, 53, -1, 30, -1, 31, 32, 33, + 34, 35, 36, 37, 38, 39, -1, -1, -1, -1, + 45, -1, 47, 3, 49, -1, 6, 7, 53, -1, + 10, 11, 12, 13, -1, 15, 16, 17, 18, -1, + -1, -1, -1, -1, -1, -1, 10, 27, -1, -1, + 30, 15, 16, 17, 18, -1, -1, -1, -1, -1, + -1, -1, -1, 27, -1, 45, 30, 47, -1, 49, + -1, 10, -1, -1, -1, -1, 15, 16, 17, 18, + -1, 45, -1, 47, -1, 49, 50, 10, 27, -1, + 54, 30, 15, 16, 17, 18, -1, -1, -1, -1, + -1, -1, -1, -1, 27, -1, 45, 30, 47, 48, + 49, -1, -1, -1, -1, 54, -1, -1, -1, -1, + -1, -1, 45, -1, 47, -1, 49, 19, 20, 21, + 22, 23, -1, -1, -1, -1, 28, 29, -1, -1, + -1, -1, -1, -1, 19, 20, 21, 22, 40, 41, + 42, 43, 44, 28, 29, -1, -1, 49, -1, 51, + -1, 19, 20, -1, -1, 40, 41, 42, 43, 44, + 28, 29, -1, -1, 49, -1, 51, -1, -1, -1, + -1, -1, 40, 41, 42, 43, 44, -1, -1, -1, + -1, 49, -1, 51, 31, 32, 33, 34, 35, 36, + 37, 38, 39 }; -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -1 -static const yytype_uint8 yytable[] = + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_uint8 yystos[] = { - 33, 34, 98, 36, 62, 63, 79, 74, 75, 76, - 1, 54, 55, 2, 3, 80, 35, 4, 137, 5, - 6, 7, 8, 57, 50, 50, 138, 61, 125, 73, - 15, 9, 71, 72, 10, 37, 77, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 60, 130, 61, 11, - 95, 12, 61, 13, 78, 102, 96, 58, 51, 51, - 103, 126, 1, 61, 97, 2, 3, 127, 82, 4, - 81, 5, 6, 7, 8, 83, 55, 116, 117, 118, - 123, 69, 70, 9, 99, 61, 10, 1, 141, 135, - 2, 3, 125, 128, 4, 136, 5, 6, 7, 8, - 131, 11, 94, 12, 49, 13, 61, 129, 9, 121, - 122, 10, 1, 61, 132, 2, 3, 115, 102, 4, - 155, 5, 6, 7, 8, 139, 11, 142, 12, 48, - 13, 127, 120, 9, 58, 119, 10, 78, 134, 104, - 105, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 11, 124, 12, 0, 13, 140, 111, 112, 58, - 113, 114, 0, 1, 0, 152, 2, 3, 153, 154, - 4, 166, 5, 6, 7, 8, 64, 65, 66, 67, - 68, 0, 0, 0, 9, 0, 0, 10, 1, 0, - 0, 2, 3, 0, 0, 4, 167, 5, 6, 7, - 8, 0, 11, 0, 12, 0, 13, 0, 0, 9, - 58, 0, 10, 1, 0, 0, 2, 3, 0, 0, - 4, 168, 5, 6, 7, 8, 0, 11, 0, 12, - 0, 13, 0, 0, 9, 58, 0, 10, 1, 0, - 0, 2, 3, 0, 0, 4, 0, 5, 6, 7, - 8, 0, 11, 0, 12, 0, 13, 0, 0, 9, - 58, 4, 10, 5, 6, 7, 8, 0, 0, 4, - 0, 5, 6, 7, 8, 9, 0, 11, 10, 12, - 0, 13, 0, 9, 0, 58, 10, 106, 107, 108, - 109, 110, 0, 11, 0, 12, 0, 13, 100, 0, - 0, 11, 101, 12, 133, 13, 0, 0, 0, 4, - 101, 5, 6, 7, 8, 4, 0, 47, 6, 7, - 8, 0, 0, 9, 0, 0, 10, 0, 0, 9, - 0, 0, 10, 0, 4, 0, 47, 6, 7, 8, - 0, 11, 0, 12, 0, 13, 0, 11, 9, 12, - 4, 13, 47, 6, 7, 8, 6, 7, 8, 0, - 0, 0, 0, 0, 0, 0, 11, 0, 12, 0, - 13, 0, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 0, 11, 0, 12, 11, 13, 12, 0, 13, - 143, 144, 145, 146, 147, 148, 149, 150, 151 + 0, 3, 6, 7, 10, 11, 12, 13, 15, 16, + 17, 18, 27, 30, 45, 47, 49, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 59, 59, 15, + 15, 47, 59, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 59, 68, 61, 15, 49, 78, 79, 59, + 59, 76, 0, 53, 57, 57, 49, 51, 28, 29, + 40, 41, 42, 43, 44, 19, 20, 21, 22, 23, + 24, 25, 26, 47, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 4, 9, 8, 47, 15, 77, 59, + 59, 59, 59, 59, 59, 59, 59, 59, 31, 59, + 46, 54, 79, 48, 50, 54, 59, 59, 15, 60, + 60, 62, 62, 62, 62, 62, 63, 63, 64, 64, + 65, 67, 67, 67, 76, 59, 59, 59, 59, 59, + 59, 59, 59, 59, 57, 57, 59, 77, 15, 48, + 54, 59, 50, 79, 59, 50, 48, 5, 14, 14, + 9, 48, 57, 15, 31, 57, 57, 57, 14, 59, + 14, 14, 14 }; -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-51))) - -#define yytable_value_is_error(Yytable_value) \ - YYID (0) - -static const yytype_int16 yycheck[] = + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = { - 1, 2, 52, 12, 25, 26, 4, 21, 22, 23, - 3, 12, 13, 6, 7, 9, 12, 10, 11, 12, - 13, 14, 15, 0, 12, 12, 9, 46, 12, 20, - 0, 24, 18, 19, 27, 44, 44, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 16, 97, 46, 42, - 51, 44, 46, 46, 46, 56, 43, 50, 46, 46, - 61, 45, 3, 46, 51, 6, 7, 51, 44, 10, - 8, 12, 13, 14, 15, 12, 77, 74, 75, 76, - 81, 16, 17, 24, 45, 46, 27, 3, 12, 5, - 6, 7, 12, 94, 10, 11, 12, 13, 14, 15, - 101, 42, 28, 44, 10, 46, 46, 47, 24, 79, - 80, 27, 3, 46, 47, 6, 7, 73, 119, 10, - 11, 12, 13, 14, 15, 45, 42, 28, 44, 9, - 46, 51, 78, 24, 50, 77, 27, 46, 47, 62, - 63, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 42, 82, 44, -1, 46, 126, 69, 70, 50, - 71, 72, -1, 3, -1, 135, 6, 7, 138, 139, - 10, 11, 12, 13, 14, 15, 37, 38, 39, 40, - 41, -1, -1, -1, 24, -1, -1, 27, 3, -1, - -1, 6, 7, -1, -1, 10, 11, 12, 13, 14, - 15, -1, 42, -1, 44, -1, 46, -1, -1, 24, - 50, -1, 27, 3, -1, -1, 6, 7, -1, -1, - 10, 11, 12, 13, 14, 15, -1, 42, -1, 44, - -1, 46, -1, -1, 24, 50, -1, 27, 3, -1, - -1, 6, 7, -1, -1, 10, -1, 12, 13, 14, - 15, -1, 42, -1, 44, -1, 46, -1, -1, 24, - 50, 10, 27, 12, 13, 14, 15, -1, -1, 10, - -1, 12, 13, 14, 15, 24, -1, 42, 27, 44, - -1, 46, -1, 24, -1, 50, 27, 64, 65, 66, - 67, 68, -1, 42, -1, 44, -1, 46, 47, -1, - -1, 42, 51, 44, 45, 46, -1, -1, -1, 10, - 51, 12, 13, 14, 15, 10, -1, 12, 13, 14, - 15, -1, -1, 24, -1, -1, 27, -1, -1, 24, - -1, -1, 27, -1, 10, -1, 12, 13, 14, 15, - -1, 42, -1, 44, -1, 46, -1, 42, 24, 44, - 10, 46, 12, 13, 14, 15, 13, 14, 15, -1, - -1, -1, -1, -1, -1, -1, 42, -1, 44, -1, - 46, -1, 28, 29, 30, 31, 32, 33, 34, 35, - 36, -1, 42, -1, 44, 42, 46, 44, -1, 46, - 28, 29, 30, 31, 32, 33, 34, 35, 36 + 0, 55, 56, 57, 57, 57, 57, 57, 57, 57, + 57, 57, 57, 57, 58, 58, 59, 59, 59, 59, + 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, + 59, 59, 59, 59, 59, 60, 60, 60, 61, 61, + 62, 62, 62, 62, 62, 62, 63, 63, 63, 64, + 64, 64, 65, 65, 66, 66, 66, 66, 67, 67, + 68, 68, 69, 69, 69, 70, 70, 70, 71, 71, + 72, 72, 73, 73, 73, 73, 74, 74, 74, 75, + 76, 76, 76, 76, 77, 77, 77, 77, 78, 78, + 78, 78, 79, 79 }; -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = + /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = { - 0, 3, 6, 7, 10, 12, 13, 14, 15, 24, - 27, 42, 44, 46, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 56, 56, 12, 12, 44, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 12, 65, 58, - 12, 46, 74, 75, 56, 56, 72, 0, 50, 54, - 54, 46, 25, 26, 37, 38, 39, 40, 41, 16, - 17, 18, 19, 20, 21, 22, 23, 44, 46, 4, - 9, 8, 44, 12, 73, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 28, 56, 43, 51, 75, 45, - 47, 51, 56, 56, 57, 57, 59, 59, 59, 59, - 59, 60, 60, 61, 61, 62, 64, 64, 64, 72, - 68, 54, 54, 56, 73, 12, 45, 51, 56, 47, - 75, 56, 47, 45, 47, 5, 11, 11, 9, 45, - 54, 12, 28, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 54, 54, 54, 11, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 11, 11, 11 + 0, 2, 1, 1, 5, 7, 5, 7, 2, 1, + 1, 1, 2, 1, 2, 2, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 1, 3, 3, 1, 2, 1, + 3, 3, 3, 3, 3, 1, 3, 3, 1, 3, + 3, 1, 3, 1, 3, 3, 3, 1, 2, 1, + 4, 1, 7, 6, 1, 4, 3, 1, 4, 3, + 1, 1, 1, 1, 1, 1, 3, 3, 1, 3, + 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, + 2, 3, 5, 3 }; -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ - -#define YYFAIL goto yyerrlab -#if defined YYFAIL - /* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + #define YYRECOVERING() (!!yyerrstatus) @@ -830,27 +808,15 @@ do \ else \ { \ yyerror (program, YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) + YYERROR; \ + } \ +while (0) /* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 +#define YYTERROR 1 +#define YYERRCODE 256 -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ -#ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) -#else -# define YYLEX yylex () -#endif /* Enable debugging if requested. */ #if YYDEBUG @@ -860,52 +826,45 @@ while (YYID (0)) # define YYFPRINTF fprintf # endif -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value, program); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) +/* This macro is provided for backward compatibility. */ +#ifndef YY_LOCATION_PRINT +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +#endif -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value, program); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + + +/*----------------------------------------. +| Print this symbol's value on YYOUTPUT. | +`----------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, stmt_node **program) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep, program) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; - stmt_node **program; -#endif { FILE *yyo = yyoutput; YYUSE (yyo); + YYUSE (program); if (!yyvaluep) return; - YYUSE (program); # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); # endif YYUSE (yytype); } @@ -915,23 +874,11 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, program) | Print this symbol on YYOUTPUT. | `--------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, stmt_node **program) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep, program) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; - stmt_node **program; -#endif { - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + YYFPRINTF (yyoutput, "%s %s (", + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); yy_symbol_value_print (yyoutput, yytype, yyvaluep, program); YYFPRINTF (yyoutput, ")"); @@ -942,16 +889,8 @@ yy_symbol_print (yyoutput, yytype, yyvaluep, program) | TOP (included). | `------------------------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -#else -static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; -#endif { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) @@ -962,50 +901,42 @@ yy_stack_print (yybottom, yytop) YYFPRINTF (stderr, "\n"); } -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule, stmt_node **program) -#else -static void -yy_reduce_print (yyvsp, yyrule, program) - YYSTYPE *yyvsp; - int yyrule; - stmt_node **program; -#endif +yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, stmt_node **program) { + unsigned long int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; - unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); + yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - , program); + yy_symbol_print (stderr, + yystos[yyssp[yyi + 1 - yynrhs]], + &(yyvsp[(yyi + 1) - (yynrhs)]) + , program); YYFPRINTF (stderr, "\n"); } } -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule, program); \ -} while (YYID (0)) +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, Rule, program); \ +} while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ @@ -1019,7 +950,7 @@ int yydebug; /* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH +#ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif @@ -1042,15 +973,8 @@ int yydebug; # define yystrlen strlen # else /* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) @@ -1066,16 +990,8 @@ yystrlen (yystr) # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif { char *yyd = yydest; const char *yys = yysrc; @@ -1105,27 +1021,27 @@ yytnamerr (char *yyres, const char *yystr) char const *yyp = yystr; for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } do_not_strip_quotes: ; } @@ -1148,11 +1064,11 @@ static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) { - YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); + YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); YYSIZE_T yysize = yysize0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ - const char *yyformat = YY_NULL; + const char *yyformat = YY_NULLPTR; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per @@ -1160,10 +1076,6 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, int yycount = 0; /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - - for details. YYERROR is fine as it does not invoke this - function. - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't check for expected @@ -1213,7 +1125,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, } yyarg[yycount++] = yytname[yyx]; { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) return 2; @@ -1280,28 +1192,18 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, | Release the memory associated to this symbol. | `-----------------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, stmt_node **program) -#else -static void -yydestruct (yymsg, yytype, yyvaluep, program) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; - stmt_node **program; -#endif { YYUSE (yyvaluep); YYUSE (program); - if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -1310,18 +1212,8 @@ yydestruct (yymsg, yytype, yyvaluep, program) /* The lookahead symbol. */ int yychar; - -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - /* The semantic value of the lookahead symbol. */ -YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); - +YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; @@ -1330,35 +1222,16 @@ int yynerrs; | yyparse. | `----------*/ -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) int yyparse (stmt_node **program) -#else -int -yyparse (program) - stmt_node **program; -#endif -#endif { int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. + 'yyss': related to states. + 'yyvs': related to semantic values. Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ @@ -1426,23 +1299,23 @@ yyparse (program) #ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE @@ -1450,22 +1323,22 @@ yyparse (program) # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; + yystacksize = YYMAXDEPTH; { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ @@ -1474,10 +1347,10 @@ yyparse (program) yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) - YYABORT; + YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); @@ -1506,7 +1379,7 @@ yybackup: if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; + yychar = yylex (); } if (yychar <= YYEOF) @@ -1571,7 +1444,7 @@ yyreduce: yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. + '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison @@ -1585,731 +1458,837 @@ yyreduce: switch (yyn) { case 2: -/* Line 1787 of yacc.c */ -#line 31 "parser.y" - { *program = AS_ST((yyvsp[(1) - (1)])); } +#line 31 "parser.y" /* yacc.c:1646 */ + { *program = AS_ST((yyvsp[0])); } +#line 1464 "parser.tab.c" /* yacc.c:1646 */ break; case 3: -/* Line 1787 of yacc.c */ -#line 35 "parser.y" - { (yyval) = NEW_ST(); AS_ST((yyval))->type = ST_EXPR; AS_ST((yyval))->expr = (yyvsp[(1) - (1)]); } +#line 35 "parser.y" /* yacc.c:1646 */ + { (yyval) = NEW_ST(); AS_ST((yyval))->type = ST_EXPR; AS_ST((yyval))->expr = (yyvsp[0]); } +#line 1470 "parser.tab.c" /* yacc.c:1646 */ break; case 4: -/* Line 1787 of yacc.c */ -#line 36 "parser.y" - { (yyval) = NEW_ST(); AS_ST((yyval))->type = ST_IFELSE; AS_ST((yyval))->ifelse = NEW(ifelse_node); AS_ST((yyval))->ifelse->cond = (yyvsp[(2) - (5)]); AS_ST((yyval))->ifelse->iftrue = (yyvsp[(4) - (5)]); AS_ST((yyval))->ifelse->iffalse = NULL; } +#line 36 "parser.y" /* yacc.c:1646 */ + { (yyval) = NEW_ST(); AS_ST((yyval))->type = ST_IFELSE; AS_ST((yyval))->ifelse = NEW(ifelse_node); AS_ST((yyval))->ifelse->cond = (yyvsp[-3]); AS_ST((yyval))->ifelse->iftrue = (yyvsp[-1]); AS_ST((yyval))->ifelse->iffalse = NULL; } +#line 1476 "parser.tab.c" /* yacc.c:1646 */ break; case 5: -/* Line 1787 of yacc.c */ -#line 37 "parser.y" - { (yyval) = NEW_ST(); AS_ST((yyval))->type = ST_IFELSE; AS_ST((yyval))->ifelse = NEW(ifelse_node); AS_ST((yyval))->ifelse->cond = (yyvsp[(2) - (7)]); AS_ST((yyval))->ifelse->iftrue = (yyvsp[(4) - (7)]); AS_ST((yyval))->ifelse->iffalse = (yyvsp[(6) - (7)]); } +#line 37 "parser.y" /* yacc.c:1646 */ + { (yyval) = NEW_ST(); AS_ST((yyval))->type = ST_IFELSE; AS_ST((yyval))->ifelse = NEW(ifelse_node); AS_ST((yyval))->ifelse->cond = (yyvsp[-5]); AS_ST((yyval))->ifelse->iftrue = (yyvsp[-3]); AS_ST((yyval))->ifelse->iffalse = (yyvsp[-1]); } +#line 1482 "parser.tab.c" /* yacc.c:1646 */ break; case 6: -/* Line 1787 of yacc.c */ -#line 38 "parser.y" - { (yyval) = NEW_ST(); AS_ST((yyval))->type = ST_LOOP; AS_ST((yyval))->loop = NEW(loop_node); AS_ST((yyval))->loop->cond = (yyvsp[(2) - (5)]); AS_ST((yyval))->loop->loop = (yyvsp[(4) - (5)]); } +#line 38 "parser.y" /* yacc.c:1646 */ + { (yyval) = NEW_ST(); AS_ST((yyval))->type = ST_LOOP; AS_ST((yyval))->loop = NEW(loop_node); AS_ST((yyval))->loop->cond = (yyvsp[-3]); AS_ST((yyval))->loop->loop = (yyvsp[-1]); } +#line 1488 "parser.tab.c" /* yacc.c:1646 */ break; case 7: -/* Line 1787 of yacc.c */ -#line 39 "parser.y" - { (yyval) = NEW_ST(); AS_ST((yyval))->type = ST_ITER; AS_ST((yyval))->iter = NEW(iter_node); AS_ST((yyval))->iter->var = strdup((yyvsp[(2) - (7)])); AS_ST((yyval))->iter->iter = (yyvsp[(4) - (7)]); AS_ST((yyval))->iter->loop = (yyvsp[(6) - (7)]); } +#line 39 "parser.y" /* yacc.c:1646 */ + { (yyval) = NEW_ST(); AS_ST((yyval))->type = ST_ITER; AS_ST((yyval))->iter = NEW(iter_node); AS_ST((yyval))->iter->var = strdup((yyvsp[-5])); AS_ST((yyval))->iter->iter = (yyvsp[-3]); AS_ST((yyval))->iter->loop = (yyvsp[-1]); } +#line 1494 "parser.tab.c" /* yacc.c:1646 */ break; case 8: -/* Line 1787 of yacc.c */ -#line 40 "parser.y" - { (yyval) = (yyvsp[(1) - (2)]); } +#line 40 "parser.y" /* yacc.c:1646 */ + { (yyval) = NEW_ST(); AS_ST((yyval))->type = ST_RET; AS_ST((yyval))->ret = NEW(ret_node); AS_ST((yyval))->ret->ret = (yyvsp[0]); } +#line 1500 "parser.tab.c" /* yacc.c:1646 */ break; case 9: -/* Line 1787 of yacc.c */ -#line 41 "parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 41 "parser.y" /* yacc.c:1646 */ + { (yyval) = NEW_ST(); AS_ST((yyval))->type = ST_RET; AS_ST((yyval))->ret = NEW(ret_node); AS_ST((yyval))->ret->ret = NULL; } +#line 1506 "parser.tab.c" /* yacc.c:1646 */ break; case 10: -/* Line 1787 of yacc.c */ -#line 45 "parser.y" - { - (yyval) = NEW_ST(); - AS_ST((yyval))->type = ST_LIST; - AS_ST((yyval))->stmtlist = NEW(stmtlist_node); - AS_ST((yyval))->stmtlist->stmt = (yyvsp[(1) - (2)]); - AS_ST((yyval))->stmtlist->next = NEW(stmtlist_node); - AS_ST((yyval))->stmtlist->next->stmt = (yyvsp[(2) - (2)]); - AS_ST((yyval))->stmtlist->next->next = NULL; - } +#line 42 "parser.y" /* yacc.c:1646 */ + { (yyval) = NEW_ST(); AS_ST((yyval))->type = ST_BREAK; } +#line 1512 "parser.tab.c" /* yacc.c:1646 */ break; case 11: -/* Line 1787 of yacc.c */ -#line 54 "parser.y" - { - stmtlist_node *cur = AS_ST((yyvsp[(1) - (2)]))->stmtlist; - while(cur->next) cur = cur->next; - cur->next = NEW(stmtlist_node); - cur = cur->next; - cur->stmt = (yyvsp[(2) - (2)]); - cur->next = NULL; - (yyval) = (yyvsp[(1) - (2)]); - } +#line 43 "parser.y" /* yacc.c:1646 */ + { (yyval) = NEW_ST(); AS_ST((yyval))->type = ST_CONT; } +#line 1518 "parser.tab.c" /* yacc.c:1646 */ break; case 12: -/* Line 1787 of yacc.c */ -#line 66 "parser.y" - { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_ASSIGN; AS_EX((yyval))->assign = NEW(assign_node); AS_EX((yyval))->assign->ident = (yyvsp[(1) - (3)]); AS_EX((yyval))->assign->value = (yyvsp[(3) - (3)]); } +#line 44 "parser.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[-1]); } +#line 1524 "parser.tab.c" /* yacc.c:1646 */ break; case 13: -/* Line 1787 of yacc.c */ -#line 67 "parser.y" - { - (yyval) = NEW_EX(); - AS_EX((yyval))->type = EX_ASSIGN; - AS_EX((yyval))->assign = NEW(assign_node); - AS_EX((yyval))->assign->ident = (yyvsp[(1) - (3)]); - MAKE_REF_BINOP(AS_EX((yyval))->assign->value, OP_ADD, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); - } +#line 45 "parser.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 1530 "parser.tab.c" /* yacc.c:1646 */ break; case 14: -/* Line 1787 of yacc.c */ -#line 74 "parser.y" +#line 49 "parser.y" /* yacc.c:1646 */ { - (yyval) = NEW_EX(); - AS_EX((yyval))->type = EX_ASSIGN; - AS_EX((yyval))->assign = NEW(assign_node); - AS_EX((yyval))->assign->ident = (yyvsp[(1) - (3)]); - MAKE_REF_BINOP(AS_EX((yyval))->assign->value, OP_SUB, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); + stmtlist_node *cur = AS_ST((yyvsp[-1]))->stmtlist; + while(cur->next) cur = cur->next; + cur->next = NEW(stmtlist_node); + cur = cur->next; + cur->stmt = (yyvsp[0]); + cur->next = NULL; + (yyval) = (yyvsp[-1]); } +#line 1544 "parser.tab.c" /* yacc.c:1646 */ break; case 15: -/* Line 1787 of yacc.c */ -#line 81 "parser.y" +#line 58 "parser.y" /* yacc.c:1646 */ { - (yyval) = NEW_EX(); - AS_EX((yyval))->type = EX_ASSIGN; - AS_EX((yyval))->assign = NEW(assign_node); - AS_EX((yyval))->assign->ident = (yyvsp[(1) - (3)]); - MAKE_REF_BINOP(AS_EX((yyval))->assign->value, OP_MUL, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); + (yyval) = NEW_ST(); + AS_ST((yyval))->type = ST_LIST; + AS_ST((yyval))->stmtlist = NEW(stmtlist_node); + AS_ST((yyval))->stmtlist->stmt = (yyvsp[-1]); + AS_ST((yyval))->stmtlist->next = NEW(stmtlist_node); + AS_ST((yyval))->stmtlist->next->stmt = (yyvsp[0]); + AS_ST((yyval))->stmtlist->next->next = NULL; } +#line 1558 "parser.tab.c" /* yacc.c:1646 */ break; case 16: -/* Line 1787 of yacc.c */ -#line 88 "parser.y" - { - (yyval) = NEW_EX(); - AS_EX((yyval))->type = EX_ASSIGN; - AS_EX((yyval))->assign = NEW(assign_node); - AS_EX((yyval))->assign->ident = (yyvsp[(1) - (3)]); - MAKE_REF_BINOP(AS_EX((yyval))->assign->value, OP_DIV, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); - } +#line 70 "parser.y" /* yacc.c:1646 */ + { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_ASSIGN; AS_EX((yyval))->assign = NEW(assign_node); AS_EX((yyval))->assign->ident = (yyvsp[-2]); AS_EX((yyval))->assign->value = (yyvsp[0]); } +#line 1564 "parser.tab.c" /* yacc.c:1646 */ break; case 17: -/* Line 1787 of yacc.c */ -#line 95 "parser.y" +#line 71 "parser.y" /* yacc.c:1646 */ { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_ASSIGN; AS_EX((yyval))->assign = NEW(assign_node); - AS_EX((yyval))->assign->ident = (yyvsp[(1) - (3)]); - MAKE_REF_BINOP(AS_EX((yyval))->assign->value, OP_POW, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); + AS_EX((yyval))->assign->ident = (yyvsp[-2]); + MAKE_REF_BINOP(AS_EX((yyval))->assign->value, OP_ADD, (yyvsp[-2]), (yyvsp[0])); } +#line 1576 "parser.tab.c" /* yacc.c:1646 */ break; case 18: -/* Line 1787 of yacc.c */ -#line 102 "parser.y" +#line 78 "parser.y" /* yacc.c:1646 */ { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_ASSIGN; AS_EX((yyval))->assign = NEW(assign_node); - AS_EX((yyval))->assign->ident = (yyvsp[(1) - (3)]); - MAKE_REF_BINOP(AS_EX((yyval))->assign->value, OP_BAND, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); + AS_EX((yyval))->assign->ident = (yyvsp[-2]); + MAKE_REF_BINOP(AS_EX((yyval))->assign->value, OP_SUB, (yyvsp[-2]), (yyvsp[0])); } +#line 1588 "parser.tab.c" /* yacc.c:1646 */ break; case 19: -/* Line 1787 of yacc.c */ -#line 109 "parser.y" +#line 85 "parser.y" /* yacc.c:1646 */ { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_ASSIGN; AS_EX((yyval))->assign = NEW(assign_node); - AS_EX((yyval))->assign->ident = (yyvsp[(1) - (3)]); - MAKE_REF_BINOP(AS_EX((yyval))->assign->value, OP_BOR, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); + AS_EX((yyval))->assign->ident = (yyvsp[-2]); + MAKE_REF_BINOP(AS_EX((yyval))->assign->value, OP_MUL, (yyvsp[-2]), (yyvsp[0])); } +#line 1600 "parser.tab.c" /* yacc.c:1646 */ break; case 20: -/* Line 1787 of yacc.c */ -#line 116 "parser.y" +#line 92 "parser.y" /* yacc.c:1646 */ { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_ASSIGN; AS_EX((yyval))->assign = NEW(assign_node); - AS_EX((yyval))->assign->ident = (yyvsp[(1) - (3)]); - MAKE_REF_BINOP(AS_EX((yyval))->assign->value, OP_BXOR, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); + AS_EX((yyval))->assign->ident = (yyvsp[-2]); + MAKE_REF_BINOP(AS_EX((yyval))->assign->value, OP_DIV, (yyvsp[-2]), (yyvsp[0])); } +#line 1612 "parser.tab.c" /* yacc.c:1646 */ break; case 21: -/* Line 1787 of yacc.c */ -#line 123 "parser.y" +#line 99 "parser.y" /* yacc.c:1646 */ { (yyval) = NEW_EX(); - AS_EX((yyval))->type = EX_SETINDEX; - AS_EX((yyval))->setindex = NEW(setindex_node); - AS_EX((yyval))->setindex->expr = (yyvsp[(1) - (6)]); - AS_EX((yyval))->setindex->index = (yyvsp[(3) - (6)]); - AS_EX((yyval))->setindex->value = (yyvsp[(6) - (6)]); -} + AS_EX((yyval))->type = EX_ASSIGN; + AS_EX((yyval))->assign = NEW(assign_node); + AS_EX((yyval))->assign->ident = (yyvsp[-2]); + MAKE_REF_BINOP(AS_EX((yyval))->assign->value, OP_POW, (yyvsp[-2]), (yyvsp[0])); + } +#line 1624 "parser.tab.c" /* yacc.c:1646 */ break; case 22: -/* Line 1787 of yacc.c */ -#line 131 "parser.y" +#line 106 "parser.y" /* yacc.c:1646 */ { (yyval) = NEW_EX(); - AS_EX((yyval))->type = EX_SETINDEX; - AS_EX((yyval))->setindex = NEW(setindex_node); - AS_EX((yyval))->setindex->expr = (yyvsp[(1) - (6)]); - AS_EX((yyval))->setindex->index = (yyvsp[(3) - (6)]); - MAKE_IDX_BINOP(AS_EX((yyval))->setindex->value, OP_ADD, (yyvsp[(1) - (6)]), (yyvsp[(3) - (6)]), (yyvsp[(6) - (6)])); -} + AS_EX((yyval))->type = EX_ASSIGN; + AS_EX((yyval))->assign = NEW(assign_node); + AS_EX((yyval))->assign->ident = (yyvsp[-2]); + MAKE_REF_BINOP(AS_EX((yyval))->assign->value, OP_BAND, (yyvsp[-2]), (yyvsp[0])); + } +#line 1636 "parser.tab.c" /* yacc.c:1646 */ break; case 23: -/* Line 1787 of yacc.c */ -#line 139 "parser.y" +#line 113 "parser.y" /* yacc.c:1646 */ { (yyval) = NEW_EX(); - AS_EX((yyval))->type = EX_SETINDEX; - AS_EX((yyval))->setindex = NEW(setindex_node); - AS_EX((yyval))->setindex->expr = (yyvsp[(1) - (6)]); - AS_EX((yyval))->setindex->index = (yyvsp[(3) - (6)]); - MAKE_IDX_BINOP(AS_EX((yyval))->setindex->value, OP_SUB, (yyvsp[(1) - (6)]), (yyvsp[(3) - (6)]), (yyvsp[(6) - (6)])); -} + AS_EX((yyval))->type = EX_ASSIGN; + AS_EX((yyval))->assign = NEW(assign_node); + AS_EX((yyval))->assign->ident = (yyvsp[-2]); + MAKE_REF_BINOP(AS_EX((yyval))->assign->value, OP_BOR, (yyvsp[-2]), (yyvsp[0])); + } +#line 1648 "parser.tab.c" /* yacc.c:1646 */ break; case 24: -/* Line 1787 of yacc.c */ -#line 147 "parser.y" +#line 120 "parser.y" /* yacc.c:1646 */ { (yyval) = NEW_EX(); - AS_EX((yyval))->type = EX_SETINDEX; - AS_EX((yyval))->setindex = NEW(setindex_node); - AS_EX((yyval))->setindex->expr = (yyvsp[(1) - (6)]); - AS_EX((yyval))->setindex->index = (yyvsp[(3) - (6)]); - MAKE_IDX_BINOP(AS_EX((yyval))->setindex->value, OP_MUL, (yyvsp[(1) - (6)]), (yyvsp[(3) - (6)]), (yyvsp[(6) - (6)])); -} + AS_EX((yyval))->type = EX_ASSIGN; + AS_EX((yyval))->assign = NEW(assign_node); + AS_EX((yyval))->assign->ident = (yyvsp[-2]); + MAKE_REF_BINOP(AS_EX((yyval))->assign->value, OP_BXOR, (yyvsp[-2]), (yyvsp[0])); + } +#line 1660 "parser.tab.c" /* yacc.c:1646 */ break; case 25: -/* Line 1787 of yacc.c */ -#line 155 "parser.y" +#line 127 "parser.y" /* yacc.c:1646 */ { - (yyval) = NEW_EX(); - AS_EX((yyval))->type = EX_SETINDEX; - AS_EX((yyval))->setindex = NEW(setindex_node); - AS_EX((yyval))->setindex->expr = (yyvsp[(1) - (6)]); - AS_EX((yyval))->setindex->index = (yyvsp[(3) - (6)]); - MAKE_IDX_BINOP(AS_EX((yyval))->setindex->value, OP_DIV, (yyvsp[(1) - (6)]), (yyvsp[(3) - (6)]), (yyvsp[(6) - (6)])); + if(AS_EX((yyvsp[-2]))->type != EX_INDEX) { + yyerror("Assigning to non-indexing expression"); + YYABORT; + } + (yyval) = NEW_EX(); + AS_EX((yyval))->type = EX_SETINDEX; + AS_EX((yyval))->setindex = NEW(setindex_node); + AS_EX((yyval))->setindex->expr = AS_EX((yyvsp[-2]))->index->expr; + AS_EX((yyval))->setindex->index = AS_EX((yyvsp[-2]))->index->index; + AS_EX((yyval))->setindex->value = (yyvsp[0]); + //ex_free(AS_EX($1)); } +#line 1678 "parser.tab.c" /* yacc.c:1646 */ break; case 26: -/* Line 1787 of yacc.c */ -#line 163 "parser.y" +#line 140 "parser.y" /* yacc.c:1646 */ { - (yyval) = NEW_EX(); - AS_EX((yyval))->type = EX_SETINDEX; - AS_EX((yyval))->setindex = NEW(setindex_node); - AS_EX((yyval))->setindex->expr = (yyvsp[(1) - (6)]); - AS_EX((yyval))->setindex->index = (yyvsp[(3) - (6)]); - MAKE_IDX_BINOP(AS_EX((yyval))->setindex->value, OP_POW, (yyvsp[(1) - (6)]), (yyvsp[(3) - (6)]), (yyvsp[(6) - (6)])); + if(AS_EX((yyvsp[-2]))->type != EX_INDEX) { + yyerror("Assigning to non-indexing expression"); + YYABORT; + } + (yyval) = NEW_EX(); + AS_EX((yyval))->type = EX_SETINDEX; + AS_EX((yyval))->setindex = NEW(setindex_node); + AS_EX((yyval))->setindex->expr = AS_EX((yyvsp[-2]))->index->expr; + AS_EX((yyval))->setindex->index = AS_EX((yyvsp[-2]))->index->index; + MAKE_IDX_BINOP(AS_EX((yyval))->setindex->value, OP_ADD, AS_EX((yyvsp[-2]))->index->expr, AS_EX((yyvsp[-2]))->index->index, (yyvsp[0])); + //ex_free(AS_EX($1)); } +#line 1696 "parser.tab.c" /* yacc.c:1646 */ break; case 27: -/* Line 1787 of yacc.c */ -#line 171 "parser.y" +#line 153 "parser.y" /* yacc.c:1646 */ { - (yyval) = NEW_EX(); - AS_EX((yyval))->type = EX_SETINDEX; - AS_EX((yyval))->setindex = NEW(setindex_node); - AS_EX((yyval))->setindex->expr = (yyvsp[(1) - (6)]); - AS_EX((yyval))->setindex->index = (yyvsp[(3) - (6)]); - MAKE_IDX_BINOP(AS_EX((yyval))->setindex->value, OP_BAND, (yyvsp[(1) - (6)]), (yyvsp[(3) - (6)]), (yyvsp[(6) - (6)])); + if(AS_EX((yyvsp[-2]))->type != EX_INDEX) { + yyerror("Assigning to non-indexing expression"); + YYABORT; + } + (yyval) = NEW_EX(); + AS_EX((yyval))->type = EX_SETINDEX; + AS_EX((yyval))->setindex = NEW(setindex_node); + AS_EX((yyval))->setindex->expr = AS_EX((yyvsp[-2]))->index->expr; + AS_EX((yyval))->setindex->index = AS_EX((yyvsp[-2]))->index->index; + MAKE_IDX_BINOP(AS_EX((yyval))->setindex->value, OP_SUB, AS_EX((yyvsp[-2]))->index->expr, AS_EX((yyvsp[-2]))->index->index, (yyvsp[0])); + //ex_free(AS_EX($1)); } +#line 1714 "parser.tab.c" /* yacc.c:1646 */ break; case 28: -/* Line 1787 of yacc.c */ -#line 179 "parser.y" +#line 166 "parser.y" /* yacc.c:1646 */ { - (yyval) = NEW_EX(); - AS_EX((yyval))->type = EX_SETINDEX; - AS_EX((yyval))->setindex = NEW(setindex_node); - AS_EX((yyval))->setindex->expr = (yyvsp[(1) - (6)]); - AS_EX((yyval))->setindex->index = (yyvsp[(3) - (6)]); - MAKE_IDX_BINOP(AS_EX((yyval))->setindex->value, OP_BOR, (yyvsp[(1) - (6)]), (yyvsp[(3) - (6)]), (yyvsp[(6) - (6)])); + if(AS_EX((yyvsp[-2]))->type != EX_INDEX) { + yyerror("Assigning to non-indexing expression"); + YYABORT; + } + (yyval) = NEW_EX(); + AS_EX((yyval))->type = EX_SETINDEX; + AS_EX((yyval))->setindex = NEW(setindex_node); + AS_EX((yyval))->setindex->expr = AS_EX((yyvsp[-2]))->index->expr; + AS_EX((yyval))->setindex->index = AS_EX((yyvsp[-2]))->index->index; + MAKE_IDX_BINOP(AS_EX((yyval))->setindex->value, OP_MUL, AS_EX((yyvsp[-2]))->index->expr, AS_EX((yyvsp[-2]))->index->index, (yyvsp[0])); + //ex_free(AS_EX($1)); } +#line 1732 "parser.tab.c" /* yacc.c:1646 */ break; case 29: -/* Line 1787 of yacc.c */ -#line 187 "parser.y" +#line 179 "parser.y" /* yacc.c:1646 */ { - (yyval) = NEW_EX(); - AS_EX((yyval))->type = EX_SETINDEX; - AS_EX((yyval))->setindex = NEW(setindex_node); - AS_EX((yyval))->setindex->expr = (yyvsp[(1) - (6)]); - AS_EX((yyval))->setindex->index = (yyvsp[(3) - (6)]); - MAKE_IDX_BINOP(AS_EX((yyval))->setindex->value, OP_BXOR, (yyvsp[(1) - (6)]), (yyvsp[(3) - (6)]), (yyvsp[(6) - (6)])); + if(AS_EX((yyvsp[-2]))->type != EX_INDEX) { + yyerror("Assigning to non-indexing expression"); + YYABORT; + } + (yyval) = NEW_EX(); + AS_EX((yyval))->type = EX_SETINDEX; + AS_EX((yyval))->setindex = NEW(setindex_node); + AS_EX((yyval))->setindex->expr = AS_EX((yyvsp[-2]))->index->expr; + AS_EX((yyval))->setindex->index = AS_EX((yyvsp[-2]))->index->index; + MAKE_IDX_BINOP(AS_EX((yyval))->setindex->value, OP_DIV, AS_EX((yyvsp[-2]))->index->expr, AS_EX((yyvsp[-2]))->index->index, (yyvsp[0])); + //ex_free(AS_EX($1)); } +#line 1750 "parser.tab.c" /* yacc.c:1646 */ break; case 30: -/* Line 1787 of yacc.c */ -#line 195 "parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 192 "parser.y" /* yacc.c:1646 */ + { + if(AS_EX((yyvsp[-2]))->type != EX_INDEX) { + yyerror("Assigning to non-indexing expression"); + YYABORT; + } + (yyval) = NEW_EX(); + AS_EX((yyval))->type = EX_SETINDEX; + AS_EX((yyval))->setindex = NEW(setindex_node); + AS_EX((yyval))->setindex->expr = AS_EX((yyvsp[-2]))->index->expr; + AS_EX((yyval))->setindex->index = AS_EX((yyvsp[-2]))->index->index; + MAKE_IDX_BINOP(AS_EX((yyval))->setindex->value, OP_POW, AS_EX((yyvsp[-2]))->index->expr, AS_EX((yyvsp[-2]))->index->index, (yyvsp[0])); + //ex_free(AS_EX($1)); +} +#line 1768 "parser.tab.c" /* yacc.c:1646 */ break; case 31: -/* Line 1787 of yacc.c */ -#line 199 "parser.y" - { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_LAND; AS_EX((yyval))->binop->left = (yyvsp[(1) - (3)]); AS_EX((yyval))->binop->right = (yyvsp[(3) - (3)]); } +#line 205 "parser.y" /* yacc.c:1646 */ + { + if(AS_EX((yyvsp[-2]))->type != EX_INDEX) { + yyerror("Assigning to non-indexing expression"); + YYABORT; + } + (yyval) = NEW_EX(); + AS_EX((yyval))->type = EX_SETINDEX; + AS_EX((yyval))->setindex = NEW(setindex_node); + AS_EX((yyval))->setindex->expr = AS_EX((yyvsp[-2]))->index->expr; + AS_EX((yyval))->setindex->index = AS_EX((yyvsp[-2]))->index->index; + MAKE_IDX_BINOP(AS_EX((yyval))->setindex->value, OP_BAND, AS_EX((yyvsp[-2]))->index->expr, AS_EX((yyvsp[-2]))->index->index, (yyvsp[0])); + //ex_free(AS_EX($1)); +} +#line 1786 "parser.tab.c" /* yacc.c:1646 */ break; case 32: -/* Line 1787 of yacc.c */ -#line 200 "parser.y" - { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_LOR; AS_EX((yyval))->binop->left = (yyvsp[(1) - (3)]); AS_EX((yyval))->binop->right = (yyvsp[(3) - (3)]); } +#line 218 "parser.y" /* yacc.c:1646 */ + { + if(AS_EX((yyvsp[-2]))->type != EX_INDEX) { + yyerror("Assigning to non-indexing expression"); + YYABORT; + } + (yyval) = NEW_EX(); + AS_EX((yyval))->type = EX_SETINDEX; + AS_EX((yyval))->setindex = NEW(setindex_node); + AS_EX((yyval))->setindex->expr = AS_EX((yyvsp[-2]))->index->expr; + AS_EX((yyval))->setindex->index = AS_EX((yyvsp[-2]))->index->index; + MAKE_IDX_BINOP(AS_EX((yyval))->setindex->value, OP_BOR, AS_EX((yyvsp[-2]))->index->expr, AS_EX((yyvsp[-2]))->index->index, (yyvsp[0])); + //ex_free(AS_EX($1)); +} +#line 1804 "parser.tab.c" /* yacc.c:1646 */ break; case 33: -/* Line 1787 of yacc.c */ -#line 201 "parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 231 "parser.y" /* yacc.c:1646 */ + { + if(AS_EX((yyvsp[-2]))->type != EX_INDEX) { + yyerror("Assigning to non-indexing expression"); + YYABORT; + } + (yyval) = NEW_EX(); + AS_EX((yyval))->type = EX_SETINDEX; + AS_EX((yyval))->setindex = NEW(setindex_node); + AS_EX((yyval))->setindex->expr = AS_EX((yyvsp[-2]))->index->expr; + AS_EX((yyval))->setindex->index = AS_EX((yyvsp[-2]))->index->index; + MAKE_IDX_BINOP(AS_EX((yyval))->setindex->value, OP_BXOR, AS_EX((yyvsp[-2]))->index->expr, AS_EX((yyvsp[-2]))->index->index, (yyvsp[0])); + //ex_free(AS_EX($1)); +} +#line 1822 "parser.tab.c" /* yacc.c:1646 */ break; case 34: -/* Line 1787 of yacc.c */ -#line 205 "parser.y" - { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_UNOP; AS_EX((yyval))->unop = NEW(unop_node); AS_EX((yyval))->unop->type = OP_LNOT; AS_EX((yyval))->unop->expr = (yyvsp[(2) - (2)]); } +#line 244 "parser.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 1828 "parser.tab.c" /* yacc.c:1646 */ break; case 35: -/* Line 1787 of yacc.c */ -#line 206 "parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 248 "parser.y" /* yacc.c:1646 */ + { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_LAND; AS_EX((yyval))->binop->left = (yyvsp[-2]); AS_EX((yyval))->binop->right = (yyvsp[0]); } +#line 1834 "parser.tab.c" /* yacc.c:1646 */ break; case 36: -/* Line 1787 of yacc.c */ -#line 210 "parser.y" - { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_EQUAL; AS_EX((yyval))->binop->left = (yyvsp[(1) - (3)]); AS_EX((yyval))->binop->right = (yyvsp[(3) - (3)]); } +#line 249 "parser.y" /* yacc.c:1646 */ + { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_LOR; AS_EX((yyval))->binop->left = (yyvsp[-2]); AS_EX((yyval))->binop->right = (yyvsp[0]); } +#line 1840 "parser.tab.c" /* yacc.c:1646 */ break; case 37: -/* Line 1787 of yacc.c */ -#line 211 "parser.y" - { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_LESS; AS_EX((yyval))->binop->left = (yyvsp[(1) - (3)]); AS_EX((yyval))->binop->right = (yyvsp[(3) - (3)]); } +#line 250 "parser.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 1846 "parser.tab.c" /* yacc.c:1646 */ break; case 38: -/* Line 1787 of yacc.c */ -#line 212 "parser.y" - { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_GREATER; AS_EX((yyval))->binop->left = (yyvsp[(1) - (3)]); AS_EX((yyval))->binop->right = (yyvsp[(3) - (3)]); } +#line 254 "parser.y" /* yacc.c:1646 */ + { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_UNOP; AS_EX((yyval))->unop = NEW(unop_node); AS_EX((yyval))->unop->type = OP_LNOT; AS_EX((yyval))->unop->expr = (yyvsp[0]); } +#line 1852 "parser.tab.c" /* yacc.c:1646 */ break; case 39: -/* Line 1787 of yacc.c */ -#line 213 "parser.y" - { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_LESSEQ; AS_EX((yyval))->binop->left = (yyvsp[(1) - (3)]); AS_EX((yyval))->binop->right = (yyvsp[(3) - (3)]); } +#line 255 "parser.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 1858 "parser.tab.c" /* yacc.c:1646 */ break; case 40: -/* Line 1787 of yacc.c */ -#line 214 "parser.y" - { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_GREATEREQ; AS_EX((yyval))->binop->left = (yyvsp[(1) - (3)]); AS_EX((yyval))->binop->right = (yyvsp[(3) - (3)]); } +#line 259 "parser.y" /* yacc.c:1646 */ + { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_EQUAL; AS_EX((yyval))->binop->left = (yyvsp[-2]); AS_EX((yyval))->binop->right = (yyvsp[0]); } +#line 1864 "parser.tab.c" /* yacc.c:1646 */ break; case 41: -/* Line 1787 of yacc.c */ -#line 215 "parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 260 "parser.y" /* yacc.c:1646 */ + { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_LESS; AS_EX((yyval))->binop->left = (yyvsp[-2]); AS_EX((yyval))->binop->right = (yyvsp[0]); } +#line 1870 "parser.tab.c" /* yacc.c:1646 */ break; case 42: -/* Line 1787 of yacc.c */ -#line 219 "parser.y" - { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_ADD; AS_EX((yyval))->binop->left = (yyvsp[(1) - (3)]); AS_EX((yyval))->binop->right = (yyvsp[(3) - (3)]); } +#line 261 "parser.y" /* yacc.c:1646 */ + { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_GREATER; AS_EX((yyval))->binop->left = (yyvsp[-2]); AS_EX((yyval))->binop->right = (yyvsp[0]); } +#line 1876 "parser.tab.c" /* yacc.c:1646 */ break; case 43: -/* Line 1787 of yacc.c */ -#line 220 "parser.y" - { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_SUB; AS_EX((yyval))->binop->left = (yyvsp[(1) - (3)]); AS_EX((yyval))->binop->right = (yyvsp[(3) - (3)]); } +#line 262 "parser.y" /* yacc.c:1646 */ + { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_LESSEQ; AS_EX((yyval))->binop->left = (yyvsp[-2]); AS_EX((yyval))->binop->right = (yyvsp[0]); } +#line 1882 "parser.tab.c" /* yacc.c:1646 */ break; case 44: -/* Line 1787 of yacc.c */ -#line 221 "parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 263 "parser.y" /* yacc.c:1646 */ + { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_GREATEREQ; AS_EX((yyval))->binop->left = (yyvsp[-2]); AS_EX((yyval))->binop->right = (yyvsp[0]); } +#line 1888 "parser.tab.c" /* yacc.c:1646 */ break; case 45: -/* Line 1787 of yacc.c */ -#line 225 "parser.y" - { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_MUL; AS_EX((yyval))->binop->left = (yyvsp[(1) - (3)]); AS_EX((yyval))->binop->right = (yyvsp[(3) - (3)]); } +#line 264 "parser.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 1894 "parser.tab.c" /* yacc.c:1646 */ break; case 46: -/* Line 1787 of yacc.c */ -#line 226 "parser.y" - { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_DIV; AS_EX((yyval))->binop->left = (yyvsp[(1) - (3)]); AS_EX((yyval))->binop->right = (yyvsp[(3) - (3)]); } +#line 268 "parser.y" /* yacc.c:1646 */ + { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_ADD; AS_EX((yyval))->binop->left = (yyvsp[-2]); AS_EX((yyval))->binop->right = (yyvsp[0]); } +#line 1900 "parser.tab.c" /* yacc.c:1646 */ break; case 47: -/* Line 1787 of yacc.c */ -#line 227 "parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 269 "parser.y" /* yacc.c:1646 */ + { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_SUB; AS_EX((yyval))->binop->left = (yyvsp[-2]); AS_EX((yyval))->binop->right = (yyvsp[0]); } +#line 1906 "parser.tab.c" /* yacc.c:1646 */ break; case 48: -/* Line 1787 of yacc.c */ -#line 231 "parser.y" - { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_POW; AS_EX((yyval))->binop->left = (yyvsp[(1) - (3)]); AS_EX((yyval))->binop->right = (yyvsp[(3) - (3)]); } +#line 270 "parser.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 1912 "parser.tab.c" /* yacc.c:1646 */ break; case 49: -/* Line 1787 of yacc.c */ -#line 232 "parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 274 "parser.y" /* yacc.c:1646 */ + { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_MUL; AS_EX((yyval))->binop->left = (yyvsp[-2]); AS_EX((yyval))->binop->right = (yyvsp[0]); } +#line 1918 "parser.tab.c" /* yacc.c:1646 */ break; case 50: -/* Line 1787 of yacc.c */ -#line 236 "parser.y" - { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_BAND; AS_EX((yyval))->binop->left = (yyvsp[(1) - (3)]); AS_EX((yyval))->binop->right = (yyvsp[(3) - (3)]); } +#line 275 "parser.y" /* yacc.c:1646 */ + { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_DIV; AS_EX((yyval))->binop->left = (yyvsp[-2]); AS_EX((yyval))->binop->right = (yyvsp[0]); } +#line 1924 "parser.tab.c" /* yacc.c:1646 */ break; case 51: -/* Line 1787 of yacc.c */ -#line 237 "parser.y" - { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_BOR; AS_EX((yyval))->binop->left = (yyvsp[(1) - (3)]); AS_EX((yyval))->binop->right = (yyvsp[(3) - (3)]); } +#line 276 "parser.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 1930 "parser.tab.c" /* yacc.c:1646 */ break; case 52: -/* Line 1787 of yacc.c */ -#line 238 "parser.y" - { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_BXOR; AS_EX((yyval))->binop->left = (yyvsp[(1) - (3)]); AS_EX((yyval))->binop->right = (yyvsp[(3) - (3)]); } +#line 280 "parser.y" /* yacc.c:1646 */ + { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_POW; AS_EX((yyval))->binop->left = (yyvsp[-2]); AS_EX((yyval))->binop->right = (yyvsp[0]); } +#line 1936 "parser.tab.c" /* yacc.c:1646 */ break; case 53: -/* Line 1787 of yacc.c */ -#line 239 "parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 281 "parser.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 1942 "parser.tab.c" /* yacc.c:1646 */ break; case 54: -/* Line 1787 of yacc.c */ -#line 243 "parser.y" - { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->unop = NEW(unop_node); AS_EX((yyval))->unop->type = OP_BNOT; AS_EX((yyval))->unop->expr = (yyvsp[(2) - (2)]); } +#line 285 "parser.y" /* yacc.c:1646 */ + { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_BAND; AS_EX((yyval))->binop->left = (yyvsp[-2]); AS_EX((yyval))->binop->right = (yyvsp[0]); } +#line 1948 "parser.tab.c" /* yacc.c:1646 */ break; case 55: -/* Line 1787 of yacc.c */ -#line 244 "parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 286 "parser.y" /* yacc.c:1646 */ + { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_BOR; AS_EX((yyval))->binop->left = (yyvsp[-2]); AS_EX((yyval))->binop->right = (yyvsp[0]); } +#line 1954 "parser.tab.c" /* yacc.c:1646 */ break; case 56: -/* Line 1787 of yacc.c */ -#line 248 "parser.y" - { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_CALL; AS_EX((yyval))->call = NEW(call_node); AS_EX((yyval))->call->expr = (yyvsp[(1) - (4)]); AS_EX((yyval))->call->args = (yyvsp[(3) - (4)]); } +#line 287 "parser.y" /* yacc.c:1646 */ + { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_BXOR; AS_EX((yyval))->binop->left = (yyvsp[-2]); AS_EX((yyval))->binop->right = (yyvsp[0]); } +#line 1960 "parser.tab.c" /* yacc.c:1646 */ break; case 57: -/* Line 1787 of yacc.c */ -#line 249 "parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 288 "parser.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 1966 "parser.tab.c" /* yacc.c:1646 */ break; case 58: -/* Line 1787 of yacc.c */ -#line 253 "parser.y" - { - (yyval) = NEW_EX(); - AS_EX((yyval))->type = EX_FUNCDECL; - AS_EX((yyval))->funcdecl = NEW(funcdecl_node); - AS_EX((yyval))->funcdecl->name = (yyvsp[(2) - (7)]); - AS_EX((yyval))->funcdecl->args = (yyvsp[(4) - (7)]); - AS_EX((yyval))->funcdecl->body = (yyvsp[(6) - (7)]); -} +#line 292 "parser.y" /* yacc.c:1646 */ + { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->unop = NEW(unop_node); AS_EX((yyval))->unop->type = OP_BNOT; AS_EX((yyval))->unop->expr = (yyvsp[0]); } +#line 1972 "parser.tab.c" /* yacc.c:1646 */ break; case 59: -/* Line 1787 of yacc.c */ -#line 261 "parser.y" - { - (yyval) = NEW_EX(); - AS_EX((yyval))->type = EX_FUNCDECL; - AS_EX((yyval))->funcdecl = NEW(funcdecl_node); - AS_EX((yyval))->funcdecl->name = NULL; - AS_EX((yyval))->funcdecl->args = (yyvsp[(3) - (6)]); - AS_EX((yyval))->funcdecl->body = (yyvsp[(5) - (6)]); -} +#line 293 "parser.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 1978 "parser.tab.c" /* yacc.c:1646 */ break; case 60: -/* Line 1787 of yacc.c */ -#line 269 "parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 297 "parser.y" /* yacc.c:1646 */ + { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_CALL; AS_EX((yyval))->call = NEW(call_node); AS_EX((yyval))->call->expr = (yyvsp[-3]); AS_EX((yyval))->call->args = (yyvsp[-1]); } +#line 1984 "parser.tab.c" /* yacc.c:1646 */ break; case 61: -/* Line 1787 of yacc.c */ -#line 273 "parser.y" - { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_REF; AS_EX((yyval))->ref = NEW(ref_node); AS_EX((yyval))->ref->ident = (yyvsp[(1) - (1)]); } +#line 298 "parser.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 1990 "parser.tab.c" /* yacc.c:1646 */ break; case 62: -/* Line 1787 of yacc.c */ -#line 274 "parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 302 "parser.y" /* yacc.c:1646 */ + { + (yyval) = NEW_EX(); + AS_EX((yyval))->type = EX_FUNCDECL; + AS_EX((yyval))->funcdecl = NEW(funcdecl_node); + AS_EX((yyval))->funcdecl->name = (yyvsp[-5]); + AS_EX((yyval))->funcdecl->args = (yyvsp[-3]); + AS_EX((yyval))->funcdecl->body = (yyvsp[-1]); +} +#line 2003 "parser.tab.c" /* yacc.c:1646 */ break; case 63: -/* Line 1787 of yacc.c */ -#line 278 "parser.y" - { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_INDEX; AS_EX((yyval))->index = NEW(index_node); AS_EX((yyval))->index->expr = (yyvsp[(1) - (4)]); AS_EX((yyval))->index->index = (yyvsp[(3) - (4)]); } +#line 310 "parser.y" /* yacc.c:1646 */ + { + (yyval) = NEW_EX(); + AS_EX((yyval))->type = EX_FUNCDECL; + AS_EX((yyval))->funcdecl = NEW(funcdecl_node); + AS_EX((yyval))->funcdecl->name = NULL; + AS_EX((yyval))->funcdecl->args = (yyvsp[-3]); + AS_EX((yyval))->funcdecl->body = (yyvsp[-1]); +} +#line 2016 "parser.tab.c" /* yacc.c:1646 */ break; case 64: -/* Line 1787 of yacc.c */ -#line 279 "parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 318 "parser.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 2022 "parser.tab.c" /* yacc.c:1646 */ break; case 65: -/* Line 1787 of yacc.c */ -#line 283 "parser.y" - { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_LIT; AS_EX((yyval))->lit = NEW(lit_node); AS_EX((yyval))->lit->type = LIT_INT; AS_EX((yyval))->lit->ival = *AS((yyvsp[(1) - (1)]), long); free((yyvsp[(1) - (1)])); } +#line 322 "parser.y" /* yacc.c:1646 */ + { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_INDEX; AS_EX((yyval))->index = NEW(index_node); AS_EX((yyval))->index->expr = (yyvsp[-3]); AS_EX((yyval))->index->index = (yyvsp[-1]); } +#line 2028 "parser.tab.c" /* yacc.c:1646 */ break; case 66: -/* Line 1787 of yacc.c */ -#line 284 "parser.y" - { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_LIT; AS_EX((yyval))->lit = NEW(lit_node); AS_EX((yyval))->lit->type = LIT_FLOAT; AS_EX((yyval))->lit->fval = *AS((yyvsp[(1) - (1)]), double); free((yyvsp[(1) - (1)])); } +#line 323 "parser.y" /* yacc.c:1646 */ + { + (yyval) = NEW_EX(); + AS_EX((yyval))->type = EX_INDEX; + AS_EX((yyval))->index = NEW(index_node); + AS_EX((yyval))->index->expr = (yyvsp[-2]); + AS_EX((yyval))->index->index = NEW_EX(); + AS_EX((yyval))->index->index->type = EX_LIT; + AS_EX((yyval))->index->index->lit = NEW(lit_node); + AS_EX((yyval))->index->index->lit->type = LIT_STRING; + AS_EX((yyval))->index->index->lit->str = (yyvsp[0]); +} +#line 2044 "parser.tab.c" /* yacc.c:1646 */ break; case 67: -/* Line 1787 of yacc.c */ -#line 285 "parser.y" - { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_LIT; AS_EX((yyval))->lit = NEW(lit_node); AS_EX((yyval))->lit->type = LIT_STRING; AS_EX((yyval))->lit->str = (yyvsp[(1) - (1)]); } +#line 334 "parser.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 2050 "parser.tab.c" /* yacc.c:1646 */ break; case 68: -/* Line 1787 of yacc.c */ -#line 286 "parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 338 "parser.y" /* yacc.c:1646 */ + { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_INDEX; AS_EX((yyval))->index = NEW(index_node); AS_EX((yyval))->index->expr = (yyvsp[-3]); AS_EX((yyval))->index->index = (yyvsp[-1]); } +#line 2056 "parser.tab.c" /* yacc.c:1646 */ break; case 69: -/* Line 1787 of yacc.c */ -#line 290 "parser.y" - { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_LISTGEN; AS_EX((yyval))->listgen = NEW(listgen_node); AS_EX((yyval))->listgen->list = (yyvsp[(2) - (3)]); } +#line 339 "parser.y" /* yacc.c:1646 */ + { + (yyval) = NEW_EX(); + AS_EX((yyval))->type = EX_INDEX; + AS_EX((yyval))->index = NEW(index_node); + AS_EX((yyval))->index->expr = (yyvsp[-2]); + AS_EX((yyval))->index->index = NEW_EX(); + AS_EX((yyval))->index->index->type = EX_LIT; + AS_EX((yyval))->index->index->lit = NEW(lit_node); + AS_EX((yyval))->index->index->lit->type = LIT_STRING; + AS_EX((yyval))->index->index->lit->str = (yyvsp[0]); +} +#line 2072 "parser.tab.c" /* yacc.c:1646 */ break; case 70: -/* Line 1787 of yacc.c */ -#line 291 "parser.y" - { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_MAPGEN; AS_EX((yyval))->mapgen = NEW(mapgen_node); AS_EX((yyval))->mapgen->map = (yyvsp[(2) - (3)]); } +#line 353 "parser.y" /* yacc.c:1646 */ + { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_REF; AS_EX((yyval))->ref = NEW(ref_node); AS_EX((yyval))->ref->ident = (yyvsp[0]); } +#line 2078 "parser.tab.c" /* yacc.c:1646 */ break; case 71: -/* Line 1787 of yacc.c */ -#line 292 "parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 354 "parser.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 2084 "parser.tab.c" /* yacc.c:1646 */ break; case 72: -/* Line 1787 of yacc.c */ -#line 296 "parser.y" - { (yyval) = (yyvsp[(2) - (3)]); } +#line 358 "parser.y" /* yacc.c:1646 */ + { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_LIT; AS_EX((yyval))->lit = NEW(lit_node); AS_EX((yyval))->lit->type = LIT_INT; AS_EX((yyval))->lit->ival = *AS((yyvsp[0]), long); free((yyvsp[0])); } +#line 2090 "parser.tab.c" /* yacc.c:1646 */ break; case 73: -/* Line 1787 of yacc.c */ -#line 300 "parser.y" - { (yyval) = NULL; } +#line 359 "parser.y" /* yacc.c:1646 */ + { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_LIT; AS_EX((yyval))->lit = NEW(lit_node); AS_EX((yyval))->lit->type = LIT_FLOAT; AS_EX((yyval))->lit->fval = *AS((yyvsp[0]), double); free((yyvsp[0])); } +#line 2096 "parser.tab.c" /* yacc.c:1646 */ break; case 74: -/* Line 1787 of yacc.c */ -#line 301 "parser.y" +#line 360 "parser.y" /* yacc.c:1646 */ + { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_LIT; AS_EX((yyval))->lit = NEW(lit_node); AS_EX((yyval))->lit->type = LIT_STRING; AS_EX((yyval))->lit->str = (yyvsp[0]); } +#line 2102 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 75: +#line 361 "parser.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 2108 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 76: +#line 365 "parser.y" /* yacc.c:1646 */ + { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_LISTGEN; AS_EX((yyval))->listgen = NEW(listgen_node); AS_EX((yyval))->listgen->list = (yyvsp[-1]); } +#line 2114 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 77: +#line 366 "parser.y" /* yacc.c:1646 */ + { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_MAPGEN; AS_EX((yyval))->mapgen = NEW(mapgen_node); AS_EX((yyval))->mapgen->map = (yyvsp[-1]); } +#line 2120 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 78: +#line 367 "parser.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 2126 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 79: +#line 371 "parser.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[-1]); } +#line 2132 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 80: +#line 375 "parser.y" /* yacc.c:1646 */ + { (yyval) = NULL; } +#line 2138 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 81: +#line 376 "parser.y" /* yacc.c:1646 */ { (yyval) = NEW(exprlist_node); - AS((yyval), exprlist_node)->expr = (yyvsp[(1) - (1)]); + AS((yyval), exprlist_node)->expr = (yyvsp[0]); AS((yyval), exprlist_node)->next = NULL; } +#line 2148 "parser.tab.c" /* yacc.c:1646 */ break; - case 75: -/* Line 1787 of yacc.c */ -#line 306 "parser.y" + case 82: +#line 381 "parser.y" /* yacc.c:1646 */ { - exprlist_node *cur = (yyvsp[(1) - (2)]); + exprlist_node *cur = (yyvsp[-1]); while(cur->next) cur = cur->next; cur->next = NEW(exprlist_node); cur = cur->next; - cur->expr = (yyvsp[(2) - (2)]); + cur->expr = (yyvsp[0]); cur->next = NULL; - (yyval) = (yyvsp[(1) - (2)]); + (yyval) = (yyvsp[-1]); } +#line 2162 "parser.tab.c" /* yacc.c:1646 */ break; - case 76: -/* Line 1787 of yacc.c */ -#line 315 "parser.y" + case 83: +#line 390 "parser.y" /* yacc.c:1646 */ { - exprlist_node *cur = (yyvsp[(1) - (3)]); + exprlist_node *cur = (yyvsp[-2]); while(cur->next) cur = cur->next; cur->next = NEW(exprlist_node); cur = cur->next; - cur->expr = (yyvsp[(3) - (3)]); + cur->expr = (yyvsp[0]); cur->next = NULL; - (yyval) = (yyvsp[(1) - (3)]); + (yyval) = (yyvsp[-2]); } +#line 2176 "parser.tab.c" /* yacc.c:1646 */ break; - case 77: -/* Line 1787 of yacc.c */ -#line 327 "parser.y" + case 84: +#line 402 "parser.y" /* yacc.c:1646 */ { (yyval) = NULL; } +#line 2182 "parser.tab.c" /* yacc.c:1646 */ break; - case 78: -/* Line 1787 of yacc.c */ -#line 328 "parser.y" + case 85: +#line 403 "parser.y" /* yacc.c:1646 */ { (yyval) = NEW(identlist_node); - AS((yyval), identlist_node)->ident = (yyvsp[(1) - (1)]); + AS((yyval), identlist_node)->ident = (yyvsp[0]); AS((yyval), identlist_node)->next = NULL; } +#line 2192 "parser.tab.c" /* yacc.c:1646 */ break; - case 79: -/* Line 1787 of yacc.c */ -#line 333 "parser.y" + case 86: +#line 408 "parser.y" /* yacc.c:1646 */ { - identlist_node *cur = (yyvsp[(1) - (2)]); + identlist_node *cur = (yyvsp[-1]); while(cur->next) cur = cur->next; cur->next = NEW(identlist_node); cur = cur->next; - cur->ident = (yyvsp[(2) - (2)]); + cur->ident = (yyvsp[0]); cur->next = NULL; - (yyval) = (yyvsp[(1) - (2)]); + (yyval) = (yyvsp[-1]); } +#line 2206 "parser.tab.c" /* yacc.c:1646 */ break; - case 80: -/* Line 1787 of yacc.c */ -#line 342 "parser.y" + case 87: +#line 417 "parser.y" /* yacc.c:1646 */ { - identlist_node *cur = (yyvsp[(1) - (3)]); + identlist_node *cur = (yyvsp[-2]); while(cur->next) cur = cur->next; cur->next = NEW(identlist_node); cur = cur->next; - cur->ident = (yyvsp[(3) - (3)]); + cur->ident = (yyvsp[0]); cur->next = NULL; - (yyval) = (yyvsp[(1) - (3)]); + (yyval) = (yyvsp[-2]); } +#line 2220 "parser.tab.c" /* yacc.c:1646 */ break; - case 81: -/* Line 1787 of yacc.c */ -#line 354 "parser.y" + case 88: +#line 429 "parser.y" /* yacc.c:1646 */ { (yyval) = NULL; } +#line 2226 "parser.tab.c" /* yacc.c:1646 */ break; - case 82: -/* Line 1787 of yacc.c */ -#line 355 "parser.y" + case 89: +#line 430 "parser.y" /* yacc.c:1646 */ { (yyval) = NEW(assoclist_node); - AS((yyval), assoclist_node)->item = (yyvsp[(1) - (1)]); + AS((yyval), assoclist_node)->item = (yyvsp[0]); AS((yyval), assoclist_node)->next = NULL; } +#line 2236 "parser.tab.c" /* yacc.c:1646 */ break; - case 83: -/* Line 1787 of yacc.c */ -#line 360 "parser.y" + case 90: +#line 435 "parser.y" /* yacc.c:1646 */ { - assoclist_node *cur = (yyvsp[(1) - (2)]); + assoclist_node *cur = (yyvsp[-1]); while(cur->next) cur = cur->next; cur->next = NEW(assoclist_node); cur = cur->next; - cur->item = (yyvsp[(2) - (2)]); + cur->item = (yyvsp[0]); cur->next = NULL; - (yyval) = (yyvsp[(1) - (2)]); + (yyval) = (yyvsp[-1]); } +#line 2250 "parser.tab.c" /* yacc.c:1646 */ break; - case 84: -/* Line 1787 of yacc.c */ -#line 369 "parser.y" + case 91: +#line 444 "parser.y" /* yacc.c:1646 */ { - assoclist_node *cur = (yyvsp[(1) - (3)]); + assoclist_node *cur = (yyvsp[-2]); while(cur->next) cur = cur->next; cur->next = NEW(assoclist_node); cur = cur->next; - cur->item = (yyvsp[(3) - (3)]); + cur->item = (yyvsp[0]); cur->next = NULL; - (yyval) = (yyvsp[(1) - (3)]); + (yyval) = (yyvsp[-2]); } +#line 2264 "parser.tab.c" /* yacc.c:1646 */ break; - case 85: -/* Line 1787 of yacc.c */ -#line 381 "parser.y" + case 92: +#line 456 "parser.y" /* yacc.c:1646 */ { (yyval) = NEW(associtem_node); - AS((yyval), associtem_node)->key = (yyvsp[(2) - (5)]); - AS((yyval), associtem_node)->value = (yyvsp[(5) - (5)]); + AS((yyval), associtem_node)->key = (yyvsp[-3]); + AS((yyval), associtem_node)->value = (yyvsp[0]); } +#line 2274 "parser.tab.c" /* yacc.c:1646 */ break; - case 86: -/* Line 1787 of yacc.c */ -#line 386 "parser.y" + case 93: +#line 461 "parser.y" /* yacc.c:1646 */ { (yyval) = NEW(associtem_node); AS((yyval), associtem_node)->key = NEW_EX(); AS((yyval), associtem_node)->key->type = EX_LIT; AS((yyval), associtem_node)->key->lit = NEW(lit_node); AS((yyval), associtem_node)->key->lit->type = LIT_STRING; - AS((yyval), associtem_node)->key->lit->str = (yyvsp[(1) - (3)]); - AS((yyval), associtem_node)->value = (yyvsp[(3) - (3)]); + AS((yyval), associtem_node)->key->lit->str = (yyvsp[-2]); + AS((yyval), associtem_node)->value = (yyvsp[0]); } +#line 2288 "parser.tab.c" /* yacc.c:1646 */ break; -/* Line 1787 of yacc.c */ -#line 2313 "parser.tab.c" +#line 2292 "parser.tab.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -2331,7 +2310,7 @@ yyreduce: *++yyvsp = yyval; - /* Now `shift' the result of the reduction. Determine what state + /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -2346,9 +2325,9 @@ yyreduce: goto yynewstate; -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ @@ -2399,20 +2378,20 @@ yyerrlab: if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an - error, discard it. */ + error, discard it. */ if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } else - { - yydestruct ("Error: discarding", - yytoken, &yylval, program); - yychar = YYEMPTY; - } + { + yydestruct ("Error: discarding", + yytoken, &yylval, program); + yychar = YYEMPTY; + } } /* Else will try to reuse lookahead token after shifting the error @@ -2431,7 +2410,7 @@ yyerrorlab: if (/*CONSTCOND*/ 0) goto yyerrorlab; - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; @@ -2444,29 +2423,29 @@ yyerrorlab: | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ + yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) - YYABORT; + YYABORT; yydestruct ("Error: popping", - yystos[yystate], yyvsp, program); + yystos[yystate], yyvsp, program); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); @@ -2517,14 +2496,14 @@ yyreturn: yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval, program); } - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp, program); + yystos[*yyssp], yyvsp, program); YYPOPSTACK (1); } #ifndef yyoverflow @@ -2535,13 +2514,9 @@ yyreturn: if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif - /* Make sure YYID is used. */ - return YYID (yyresult); + return yyresult; } +#line 472 "parser.y" /* yacc.c:1906 */ -/* Line 2050 of yacc.c */ -#line 397 "parser.y" - - -// TODO \ No newline at end of file +// TODO diff --git a/parser.tab.h b/parser.tab.h index 984c055..c77982e 100644 --- a/parser.tab.h +++ b/parser.tab.h @@ -1,19 +1,19 @@ -/* A Bison parser, made by GNU Bison 2.7.12-4996. */ +/* A Bison parser, made by GNU Bison 3.0.2. */ /* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -26,13 +26,13 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ #ifndef YY_YY_PARSER_TAB_H_INCLUDED # define YY_YY_PARSER_TAB_H_INCLUDED -/* Enabling traces. */ +/* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 1 #endif @@ -40,86 +40,76 @@ extern int yydebug; #endif -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - IF = 258, - THEN = 259, - ELSE = 260, - WHILE = 261, - FOR = 262, - IN = 263, - DO = 264, - FUNC = 265, - END = 266, - IDENT = 267, - INT = 268, - FLOAT = 269, - STRING = 270, - PLUS = 271, - MINUS = 272, - STAR = 273, - SLASH = 274, - DSTAR = 275, - BAND = 276, - BOR = 277, - BXOR = 278, - BNOT = 279, - LAND = 280, - LOR = 281, - LNOT = 282, - ASSIGN = 283, - ASSIGNPLUS = 284, - ASSIGNMINUS = 285, - ASSIGNSTAR = 286, - ASSIGNSLASH = 287, - ASSIGNDSTAR = 288, - ASSIGNBAND = 289, - ASSIGNBOR = 290, - ASSIGNBXOR = 291, - EQUAL = 292, - LESS = 293, - GREATER = 294, - LESSEQ = 295, - GREATEREQ = 296, - LBRACE = 297, - RBRACE = 298, - LPAREN = 299, - RPAREN = 300, - LBRACKET = 301, - RBRACKET = 302, - DOT = 303, - COLON = 304, - SEMICOLON = 305, - COMMA = 306 - }; + enum yytokentype + { + IF = 258, + THEN = 259, + ELSE = 260, + WHILE = 261, + FOR = 262, + IN = 263, + DO = 264, + FUNC = 265, + RETURN = 266, + BREAK = 267, + CONTINUE = 268, + END = 269, + IDENT = 270, + INT = 271, + FLOAT = 272, + STRING = 273, + PLUS = 274, + MINUS = 275, + STAR = 276, + SLASH = 277, + DSTAR = 278, + BAND = 279, + BOR = 280, + BXOR = 281, + BNOT = 282, + LAND = 283, + LOR = 284, + LNOT = 285, + ASSIGN = 286, + ASSIGNPLUS = 287, + ASSIGNMINUS = 288, + ASSIGNSTAR = 289, + ASSIGNSLASH = 290, + ASSIGNDSTAR = 291, + ASSIGNBAND = 292, + ASSIGNBOR = 293, + ASSIGNBXOR = 294, + EQUAL = 295, + LESS = 296, + GREATER = 297, + LESSEQ = 298, + GREATEREQ = 299, + LBRACE = 300, + RBRACE = 301, + LPAREN = 302, + RPAREN = 303, + LBRACKET = 304, + RBRACKET = 305, + DOT = 306, + COLON = 307, + SEMICOLON = 308, + COMMA = 309 + }; #endif - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif + extern YYSTYPE yylval; -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus int yyparse (stmt_node **program); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ #endif /* !YY_YY_PARSER_TAB_H_INCLUDED */ diff --git a/parser.y b/parser.y index 9cba636..ebdc425 100644 --- a/parser.y +++ b/parser.y @@ -12,7 +12,7 @@ %token IF THEN ELSE %token WHILE FOR IN DO -%token FUNC +%token FUNC RETURN BREAK CONTINUE %token END %token IDENT %token INT FLOAT STRING @@ -37,21 +37,16 @@ stmt: | IF expr THEN stmt ELSE stmt END { $$ = NEW_ST(); AS_ST($$)->type = ST_IFELSE; AS_ST($$)->ifelse = NEW(ifelse_node); AS_ST($$)->ifelse->cond = $2; AS_ST($$)->ifelse->iftrue = $4; AS_ST($$)->ifelse->iffalse = $6; } | WHILE expr DO stmt END { $$ = NEW_ST(); AS_ST($$)->type = ST_LOOP; AS_ST($$)->loop = NEW(loop_node); AS_ST($$)->loop->cond = $2; AS_ST($$)->loop->loop = $4; } | FOR IDENT IN expr DO stmt END { $$ = NEW_ST(); AS_ST($$)->type = ST_ITER; AS_ST($$)->iter = NEW(iter_node); AS_ST($$)->iter->var = strdup($2); AS_ST($$)->iter->iter = $4; AS_ST($$)->iter->loop = $6; } +| RETURN expr { $$ = NEW_ST(); AS_ST($$)->type = ST_RET; AS_ST($$)->ret = NEW(ret_node); AS_ST($$)->ret->ret = $2; } +| RETURN { $$ = NEW_ST(); AS_ST($$)->type = ST_RET; AS_ST($$)->ret = NEW(ret_node); AS_ST($$)->ret->ret = NULL; } +| BREAK { $$ = NEW_ST(); AS_ST($$)->type = ST_BREAK; } +| CONTINUE { $$ = NEW_ST(); AS_ST($$)->type = ST_CONT; } | stmt SEMICOLON { $$ = $1; } | stmt_list { $$ = $1; } ; stmt_list: - stmt stmt { - $$ = NEW_ST(); - AS_ST($$)->type = ST_LIST; - AS_ST($$)->stmtlist = NEW(stmtlist_node); - AS_ST($$)->stmtlist->stmt = $1; - AS_ST($$)->stmtlist->next = NEW(stmtlist_node); - AS_ST($$)->stmtlist->next->stmt = $2; - AS_ST($$)->stmtlist->next->next = NULL; - } -| stmt_list stmt { + stmt_list stmt { stmtlist_node *cur = AS_ST($1)->stmtlist; while(cur->next) cur = cur->next; cur->next = NEW(stmtlist_node); @@ -60,6 +55,15 @@ stmt_list: cur->next = NULL; $$ = $1; } +| stmt stmt { + $$ = NEW_ST(); + AS_ST($$)->type = ST_LIST; + AS_ST($$)->stmtlist = NEW(stmtlist_node); + AS_ST($$)->stmtlist->stmt = $1; + AS_ST($$)->stmtlist->next = NEW(stmtlist_node); + AS_ST($$)->stmtlist->next->stmt = $2; + AS_ST($$)->stmtlist->next->next = NULL; + } ; expr: @@ -120,77 +124,122 @@ expr: AS_EX($$)->assign->ident = $1; MAKE_REF_BINOP(AS_EX($$)->assign->value, OP_BXOR, $1, $3); } -| expr LBRACKET expr RBRACKET ASSIGN expr { - $$ = NEW_EX(); - AS_EX($$)->type = EX_SETINDEX; - AS_EX($$)->setindex = NEW(setindex_node); - AS_EX($$)->setindex->expr = $1; - AS_EX($$)->setindex->index = $3; - AS_EX($$)->setindex->value = $6; +| ex_index_expr ASSIGN expr { + if(AS_EX($1)->type != EX_INDEX) { + yyerror("Assigning to non-indexing expression"); + YYABORT; + } + $$ = NEW_EX(); + AS_EX($$)->type = EX_SETINDEX; + AS_EX($$)->setindex = NEW(setindex_node); + AS_EX($$)->setindex->expr = AS_EX($1)->index->expr; + AS_EX($$)->setindex->index = AS_EX($1)->index->index; + AS_EX($$)->setindex->value = $3; + //ex_free(AS_EX($1)); } -| expr LBRACKET expr RBRACKET ASSIGNPLUS expr { - $$ = NEW_EX(); - AS_EX($$)->type = EX_SETINDEX; - AS_EX($$)->setindex = NEW(setindex_node); - AS_EX($$)->setindex->expr = $1; - AS_EX($$)->setindex->index = $3; - MAKE_IDX_BINOP(AS_EX($$)->setindex->value, OP_ADD, $1, $3, $6); +| ex_index_expr ASSIGNPLUS expr { + if(AS_EX($1)->type != EX_INDEX) { + yyerror("Assigning to non-indexing expression"); + YYABORT; + } + $$ = NEW_EX(); + AS_EX($$)->type = EX_SETINDEX; + AS_EX($$)->setindex = NEW(setindex_node); + AS_EX($$)->setindex->expr = AS_EX($1)->index->expr; + AS_EX($$)->setindex->index = AS_EX($1)->index->index; + MAKE_IDX_BINOP(AS_EX($$)->setindex->value, OP_ADD, AS_EX($1)->index->expr, AS_EX($1)->index->index, $3); + //ex_free(AS_EX($1)); } -| expr LBRACKET expr RBRACKET ASSIGNMINUS expr { - $$ = NEW_EX(); - AS_EX($$)->type = EX_SETINDEX; - AS_EX($$)->setindex = NEW(setindex_node); - AS_EX($$)->setindex->expr = $1; - AS_EX($$)->setindex->index = $3; - MAKE_IDX_BINOP(AS_EX($$)->setindex->value, OP_SUB, $1, $3, $6); +| ex_index_expr ASSIGNMINUS expr { + if(AS_EX($1)->type != EX_INDEX) { + yyerror("Assigning to non-indexing expression"); + YYABORT; + } + $$ = NEW_EX(); + AS_EX($$)->type = EX_SETINDEX; + AS_EX($$)->setindex = NEW(setindex_node); + AS_EX($$)->setindex->expr = AS_EX($1)->index->expr; + AS_EX($$)->setindex->index = AS_EX($1)->index->index; + MAKE_IDX_BINOP(AS_EX($$)->setindex->value, OP_SUB, AS_EX($1)->index->expr, AS_EX($1)->index->index, $3); + //ex_free(AS_EX($1)); } -| expr LBRACKET expr RBRACKET ASSIGNSTAR expr { - $$ = NEW_EX(); - AS_EX($$)->type = EX_SETINDEX; - AS_EX($$)->setindex = NEW(setindex_node); - AS_EX($$)->setindex->expr = $1; - AS_EX($$)->setindex->index = $3; - MAKE_IDX_BINOP(AS_EX($$)->setindex->value, OP_MUL, $1, $3, $6); +| ex_index_expr ASSIGNSTAR expr { + if(AS_EX($1)->type != EX_INDEX) { + yyerror("Assigning to non-indexing expression"); + YYABORT; + } + $$ = NEW_EX(); + AS_EX($$)->type = EX_SETINDEX; + AS_EX($$)->setindex = NEW(setindex_node); + AS_EX($$)->setindex->expr = AS_EX($1)->index->expr; + AS_EX($$)->setindex->index = AS_EX($1)->index->index; + MAKE_IDX_BINOP(AS_EX($$)->setindex->value, OP_MUL, AS_EX($1)->index->expr, AS_EX($1)->index->index, $3); + //ex_free(AS_EX($1)); } -| expr LBRACKET expr RBRACKET ASSIGNSLASH expr { - $$ = NEW_EX(); - AS_EX($$)->type = EX_SETINDEX; - AS_EX($$)->setindex = NEW(setindex_node); - AS_EX($$)->setindex->expr = $1; - AS_EX($$)->setindex->index = $3; - MAKE_IDX_BINOP(AS_EX($$)->setindex->value, OP_DIV, $1, $3, $6); +| ex_index_expr ASSIGNSLASH expr { + if(AS_EX($1)->type != EX_INDEX) { + yyerror("Assigning to non-indexing expression"); + YYABORT; + } + $$ = NEW_EX(); + AS_EX($$)->type = EX_SETINDEX; + AS_EX($$)->setindex = NEW(setindex_node); + AS_EX($$)->setindex->expr = AS_EX($1)->index->expr; + AS_EX($$)->setindex->index = AS_EX($1)->index->index; + MAKE_IDX_BINOP(AS_EX($$)->setindex->value, OP_DIV, AS_EX($1)->index->expr, AS_EX($1)->index->index, $3); + //ex_free(AS_EX($1)); } -| expr LBRACKET expr RBRACKET ASSIGNDSTAR expr { - $$ = NEW_EX(); - AS_EX($$)->type = EX_SETINDEX; - AS_EX($$)->setindex = NEW(setindex_node); - AS_EX($$)->setindex->expr = $1; - AS_EX($$)->setindex->index = $3; - MAKE_IDX_BINOP(AS_EX($$)->setindex->value, OP_POW, $1, $3, $6); +| ex_index_expr ASSIGNDSTAR expr { + if(AS_EX($1)->type != EX_INDEX) { + yyerror("Assigning to non-indexing expression"); + YYABORT; + } + $$ = NEW_EX(); + AS_EX($$)->type = EX_SETINDEX; + AS_EX($$)->setindex = NEW(setindex_node); + AS_EX($$)->setindex->expr = AS_EX($1)->index->expr; + AS_EX($$)->setindex->index = AS_EX($1)->index->index; + MAKE_IDX_BINOP(AS_EX($$)->setindex->value, OP_POW, AS_EX($1)->index->expr, AS_EX($1)->index->index, $3); + //ex_free(AS_EX($1)); } -| expr LBRACKET expr RBRACKET ASSIGNBAND expr { - $$ = NEW_EX(); - AS_EX($$)->type = EX_SETINDEX; - AS_EX($$)->setindex = NEW(setindex_node); - AS_EX($$)->setindex->expr = $1; - AS_EX($$)->setindex->index = $3; - MAKE_IDX_BINOP(AS_EX($$)->setindex->value, OP_BAND, $1, $3, $6); +| ex_index_expr ASSIGNBAND expr { + if(AS_EX($1)->type != EX_INDEX) { + yyerror("Assigning to non-indexing expression"); + YYABORT; + } + $$ = NEW_EX(); + AS_EX($$)->type = EX_SETINDEX; + AS_EX($$)->setindex = NEW(setindex_node); + AS_EX($$)->setindex->expr = AS_EX($1)->index->expr; + AS_EX($$)->setindex->index = AS_EX($1)->index->index; + MAKE_IDX_BINOP(AS_EX($$)->setindex->value, OP_BAND, AS_EX($1)->index->expr, AS_EX($1)->index->index, $3); + //ex_free(AS_EX($1)); } -| expr LBRACKET expr RBRACKET ASSIGNBOR expr { - $$ = NEW_EX(); - AS_EX($$)->type = EX_SETINDEX; - AS_EX($$)->setindex = NEW(setindex_node); - AS_EX($$)->setindex->expr = $1; - AS_EX($$)->setindex->index = $3; - MAKE_IDX_BINOP(AS_EX($$)->setindex->value, OP_BOR, $1, $3, $6); +| ex_index_expr ASSIGNBOR expr { + if(AS_EX($1)->type != EX_INDEX) { + yyerror("Assigning to non-indexing expression"); + YYABORT; + } + $$ = NEW_EX(); + AS_EX($$)->type = EX_SETINDEX; + AS_EX($$)->setindex = NEW(setindex_node); + AS_EX($$)->setindex->expr = AS_EX($1)->index->expr; + AS_EX($$)->setindex->index = AS_EX($1)->index->index; + MAKE_IDX_BINOP(AS_EX($$)->setindex->value, OP_BOR, AS_EX($1)->index->expr, AS_EX($1)->index->index, $3); + //ex_free(AS_EX($1)); } -| expr LBRACKET expr RBRACKET ASSIGNBXOR expr { - $$ = NEW_EX(); - AS_EX($$)->type = EX_SETINDEX; - AS_EX($$)->setindex = NEW(setindex_node); - AS_EX($$)->setindex->expr = $1; - AS_EX($$)->setindex->index = $3; - MAKE_IDX_BINOP(AS_EX($$)->setindex->value, OP_BXOR, $1, $3, $6); +| ex_index_expr ASSIGNBXOR expr { + if(AS_EX($1)->type != EX_INDEX) { + yyerror("Assigning to non-indexing expression"); + YYABORT; + } + $$ = NEW_EX(); + AS_EX($$)->type = EX_SETINDEX; + AS_EX($$)->setindex = NEW(setindex_node); + AS_EX($$)->setindex->expr = AS_EX($1)->index->expr; + AS_EX($$)->setindex->index = AS_EX($1)->index->index; + MAKE_IDX_BINOP(AS_EX($$)->setindex->value, OP_BXOR, AS_EX($1)->index->expr, AS_EX($1)->index->index, $3); + //ex_free(AS_EX($1)); } | logic_expr { $$ = $1; } ; @@ -266,16 +315,42 @@ funcdecl_expr: AS_EX($$)->funcdecl->args = $3; AS_EX($$)->funcdecl->body = $5; } +| index_expr { $$ = $1; } +; + +index_expr: + expr LBRACKET expr RBRACKET { $$ = NEW_EX(); AS_EX($$)->type = EX_INDEX; AS_EX($$)->index = NEW(index_node); AS_EX($$)->index->expr = $1; AS_EX($$)->index->index = $3; } +| expr DOT IDENT { + $$ = NEW_EX(); + AS_EX($$)->type = EX_INDEX; + AS_EX($$)->index = NEW(index_node); + AS_EX($$)->index->expr = $1; + AS_EX($$)->index->index = NEW_EX(); + AS_EX($$)->index->index->type = EX_LIT; + AS_EX($$)->index->index->lit = NEW(lit_node); + AS_EX($$)->index->index->lit->type = LIT_STRING; + AS_EX($$)->index->index->lit->str = $3; +} | ref_expr { $$ = $1; } ; -ref_expr: - IDENT { $$ = NEW_EX(); AS_EX($$)->type = EX_REF; AS_EX($$)->ref = NEW(ref_node); AS_EX($$)->ref->ident = $1; } -| index_expr { $$ = $1; } +ex_index_expr: + expr LBRACKET expr RBRACKET { $$ = NEW_EX(); AS_EX($$)->type = EX_INDEX; AS_EX($$)->index = NEW(index_node); AS_EX($$)->index->expr = $1; AS_EX($$)->index->index = $3; } +| expr DOT IDENT { + $$ = NEW_EX(); + AS_EX($$)->type = EX_INDEX; + AS_EX($$)->index = NEW(index_node); + AS_EX($$)->index->expr = $1; + AS_EX($$)->index->index = NEW_EX(); + AS_EX($$)->index->index->type = EX_LIT; + AS_EX($$)->index->index->lit = NEW(lit_node); + AS_EX($$)->index->index->lit->type = LIT_STRING; + AS_EX($$)->index->index->lit->str = $3; +} ; -index_expr: - index_expr LBRACKET index_expr RBRACKET { $$ = NEW_EX(); AS_EX($$)->type = EX_INDEX; AS_EX($$)->index = NEW(index_node); AS_EX($$)->index->expr = $1; AS_EX($$)->index->index = $3; } +ref_expr: + IDENT { $$ = NEW_EX(); AS_EX($$)->type = EX_REF; AS_EX($$)->ref = NEW(ref_node); AS_EX($$)->ref->ident = $1; } | lit_expr { $$ = $1; } ; @@ -396,4 +471,4 @@ assoc_item: %% -// TODO \ No newline at end of file +// TODO diff --git a/runtime.c b/runtime.c new file mode 100644 index 0000000..c166135 --- /dev/null +++ b/runtime.c @@ -0,0 +1,495 @@ +#include +#include "ast.h" + +expr_node *sol_comp_as_expr(stmt_node *stmt) { + if(stmt->type == ST_EXPR) return stmt->expr; + return NULL; +} + +void sol_comp_free(stmt_node *stmt) { + st_free(stmt); +} + +void ex_free(expr_node *); + +void st_free(stmt_node *stmt) { + stmtlist_node *curs, *prevs; + if(!stmt) return; + switch(stmt->type) { + case ST_EXPR: + ex_free(stmt->expr); + break; + + case ST_IFELSE: + ex_free(stmt->ifelse->cond); + st_free(stmt->ifelse->iftrue); + st_free(stmt->ifelse->iffalse); + free(stmt->ifelse); + break; + + case ST_LOOP: + ex_free(stmt->loop->cond); + st_free(stmt->loop->loop); + free(stmt->loop); + break; + + case ST_ITER: + free(stmt->iter->var); + ex_free(stmt->iter->iter); + st_free(stmt->iter->loop); + free(stmt->iter); + break; + + case ST_LIST: + curs = stmt->stmtlist; + while(curs) { + if(curs->stmt) st_free(curs->stmt); + prevs = curs; + curs = curs->next; + free(prevs); + } + break; + + case ST_RET: + ex_free(stmt->ret->ret); + free(stmt->ret); + break; + } + free(stmt); +} + +void ex_free(expr_node *expr) { + exprlist_node *cure, *preve; + assoclist_node *cura, *preva; + identlist_node *curi, *previ; + if(!expr) return; + switch(expr->type) { + case EX_LIT: + if(expr->lit->type == LIT_STRING) free(expr->lit->str); + free(expr->lit); + break; + + case EX_LISTGEN: + cure = expr->listgen->list; + while(cure) { + if(cure->expr) ex_free(cure->expr); + preve = cure; + cure = cure->next; + free(preve); + } + free(expr->listgen); + break; + + case EX_MAPGEN: + cura = expr->mapgen->map; + while(cura) { + if(cura->item) { + ex_free(cura->item->key); + ex_free(cura->item->value); + free(cura->item); + } + preva = cura; + cura = cura->next; + free(preva); + } + free(expr->mapgen); + break; + + case EX_BINOP: + ex_free(expr->binop->left); + ex_free(expr->binop->right); + free(expr->binop); + break; + + case EX_UNOP: + ex_free(expr->unop->expr); + free(expr->unop); + break; + + case EX_INDEX: + ex_free(expr->index->expr); + ex_free(expr->index->index); + free(expr->index); + break; + + case EX_SETINDEX: + ex_free(expr->setindex->expr); + ex_free(expr->setindex->index); + ex_free(expr->setindex->value); + free(expr->setindex); + break; + + case EX_ASSIGN: + free(expr->assign->ident); + ex_free(expr->assign->value); + free(expr->assign); + break; + + case EX_REF: + free(expr->ref->ident); + free(expr->ref); + break; + + case EX_CALL: + ex_free(expr->call->expr); + cure = expr->call->args; + while(cure) { + if(cure->expr) ex_free(cure->expr); + preve = cure; + cure = cure->next; + free(preve); + } + free(expr->call); + break; + + case EX_FUNCDECL: + free(expr->funcdecl->name); + st_free(expr->funcdecl->body); + curi = expr->funcdecl->args; + while(curi) { + if(curi->ident) free(curi->ident); + previ = curi; + curi = curi->next; + free(previ); + } + free(expr->funcdecl); + break; + } + free(expr); +} + +sol_object_t *sol_eval(sol_state_t *state, expr_node *expr) { + sol_object_t *res, *args, *left, *right, *lint, *rint, *value, *scope, *key, *list; + exprlist_node *cure; + assoclist_node *cura; + identlist_node *curi; + if(!expr) return sol_set_error_string(state, "Evaluate NULL expression"); + switch(expr->type) { + case EX_LIT: + switch(expr->lit->type) { + case LIT_INT: + return sol_new_int(state, expr->lit->ival); + break; + + case LIT_FLOAT: + return sol_new_float(state, expr->lit->fval); + break; + + case LIT_STRING: + return sol_new_string(state, expr->lit->str); + break; + } + break; + + case EX_LISTGEN: + res = sol_new_list(state); + cure = expr->listgen->list; + while(cure) { + if(cure->expr) sol_list_insert(state, &res, sol_list_len(state, res), sol_eval(state, cure->expr)); + cure = cure->next; + } + return res; + break; + + case EX_MAPGEN: + res = sol_new_map(state); + cura = expr->mapgen->map; + while(cura) { + if(cura->item) sol_map_set(state, res, sol_eval(state, cura->item->key), sol_eval(state, cura->item->value)); + cura = cura->next; + } + return res; + break; + + case EX_BINOP: + list = sol_new_list(state); + left = sol_eval(state, expr->binop->left); + right = sol_eval(state, expr->binop->right); + sol_list_insert(state, &list, 0, left); + sol_list_insert(state, &list, 1, right); + switch(expr->binop->type) { + case OP_ADD: + res = left->ops->add(state, list); + break; + + case OP_SUB: + res = left->ops->sub(state, list); + break; + + case OP_MUL: + res = left->ops->mul(state, list); + break; + + case OP_DIV: + res = left->ops->div(state, list); + break; + + case OP_POW: + res = left->ops->pow(state, list); + break; + + case OP_BAND: + res = left->ops->band(state, list); + break; + + case OP_BOR: + res = left->ops->bor(state, list); + break; + + case OP_BXOR: + res = left->ops->bxor(state, list); + break; + + case OP_LAND: + lint = sol_cast_int(state, left); + rint = sol_cast_int(state, right); + res = sol_new_int(state, BOOL_TO_INT(lint && rint)); + sol_obj_free(lint); + sol_obj_free(rint); + break; + + case OP_LOR: + lint = sol_cast_int(state, left); + rint = sol_cast_int(state, right); + res = sol_new_int(state, BOOL_TO_INT(lint || rint)); + sol_obj_free(lint); + sol_obj_free(rint); + break; + + case OP_EQUAL: + res = sol_new_int(state, BOOL_TO_INT(left->ops->cmp(state, list)==0)); + break; + + case OP_LESS: + res = sol_new_int(state, BOOL_TO_INT(left->ops->cmp(state, list)<0)); + break; + + case OP_GREATER: + res = sol_new_int(state, BOOL_TO_INT(left->ops->cmp(state, list)>0)); + break; + + case OP_LESSEQ: + res = sol_new_int(state, BOOL_TO_INT(left->ops->cmp(state, list)<=0)); + break; + + case OP_GREATEREQ: + res = sol_new_int(state, BOOL_TO_INT(left->ops->cmp(state, list)>=0)); + break; + } + sol_obj_free(left); + sol_obj_free(right); + sol_obj_free(list); + return res; + break; + + case EX_UNOP: + left = sol_eval(state, expr->unop->expr); + list = sol_new_list(state); + sol_list_insert(state, &list, 0, left); + switch(expr->unop->type) { + case OP_NEG: + right = sol_new_int(state, -1); + sol_list_insert(state, &list, 1, right); + res = left->ops->mul(state, list); + sol_obj_free(right); + break; + + case OP_BNOT: + res = left->ops->bnot(state, list); + break; + + case OP_LNOT: + lint = sol_cast_int(state, left); + res = sol_new_int(state, BOOL_TO_INT(!lint->ival)); + sol_obj_free(lint); + break; + } + sol_obj_free(left); + sol_obj_free(list); + return res; + break; + + case EX_INDEX: + left = sol_eval(state, expr->index->expr); + right = sol_eval(state, expr->index->index); + list = sol_new_list(state); + sol_list_insert(state, &list, 0, left); + sol_list_insert(state, &list, 1, right); + res = left->ops->index(state, list); + sol_obj_free(left); + sol_obj_free(right); + sol_obj_free(list); + return res; + break; + + case EX_SETINDEX: + left = sol_eval(state, expr->setindex->expr); + right = sol_eval(state, expr->setindex->index); + value = sol_eval(state, expr->setindex->value); + list = sol_new_list(state); + sol_list_insert(state, &list, 0, left); + sol_list_insert(state, &list, 1, right); + sol_list_insert(state, &list, 2, value); + res = left->ops->setindex(state, list); + sol_obj_free(left); + sol_obj_free(right); + sol_obj_free(value); + sol_obj_free(list); + return res; + break; + + case EX_ASSIGN: + value = sol_eval(state, expr->assign->value); + sol_state_assign_l_name(state, expr->assign->ident, value); + return value; + break; + + case EX_REF: + return sol_state_resolve_name(state, expr->ref->ident); + break; + + case EX_CALL: + value = sol_eval(state, expr->call->expr); + list = sol_new_list(state); + sol_list_insert(state, &list, 0, value); + cure = expr->call->args; + while(cure) { + if(cure->expr) sol_list_insert(state, &list, sol_list_len(state, list), sol_eval(state, cure->expr)); + cure = cure->next; + } + res = value->ops->call(state, list); + sol_obj_free(value); + sol_obj_free(list); + return res; + break; + + case EX_FUNCDECL: + res = sol_new_func(state, expr->funcdecl->args, expr->funcdecl->body); + if(expr->funcdecl->name) { + sol_state_assign_l_name(state, expr->funcdecl->name, res); + } + return res; + break; + } +} + +void sol_exec(sol_state_t *state, stmt_node *stmt) { + sol_object_t *value, *vint; + stmtlist_node *curs; + if(!stmt) { + sol_obj_free(sol_set_error_string(state, "Execute NULL statement")); + return; + } + switch(stmt->type) { + case ST_EXPR: + sol_obj_free(sol_eval(state, stmt->expr)); + break; + + case ST_IFELSE: + value = sol_eval(state, stmt->ifelse->cond); + vint = sol_cast_int(state, value); + if(vint->ival) { + sol_exec(state, stmt->ifelse->iftrue); + } else { + sol_exec(state, stmt->ifelse->iffalse); + } + sol_obj_free(vint); + sol_obj_free(value); + break; + + case ST_LOOP: + value = sol_eval(state, stmt->loop->cond); + vint = sol_cast_int(state, value); + while(vint->ival) { + sol_obj_free(value); + sol_obj_free(vint); + sol_exec(state, stmt->loop->loop); + if(state->ret || state->sflag == SF_BREAKING) break; + value = sol_eval(state, stmt->loop->cond); + vint = sol_cast_int(state, value); + } + state->sflag = SF_NORMAL; + break; + + case ST_ITER: + value = sol_eval(state, stmt->iter->iter); + while(value != state->StopIteration) { + sol_state_assign_l_name(state, stmt->iter->var, value); + sol_obj_free(value); + sol_exec(state, stmt->loop->loop); + if(state->ret || state->sflag == SF_BREAKING) break; + value = sol_eval(state, stmt->iter->iter); + } + state->sflag = SF_NORMAL; + break; + + case ST_LIST: + curs = stmt->stmtlist; + while(curs && state->sflag == SF_NORMAL) { + if(curs->stmt) sol_exec(state, curs->stmt); + curs = curs->next; + } + break; + + case ST_RET: + if(stmt->ret->ret) { + state->ret = sol_eval(state, stmt->ret->ret); + } else { + state->ret = sol_incref(state->None); + } + break; + + case ST_CONT: + state->sflag = SF_CONTINUING; + break; + + case ST_BREAK: + state->sflag = SF_BREAKING; + break; + } +} + +sol_object_t *sol_f_func_call(sol_state_t *state, sol_object_t *args) { + sol_object_t *res, *scope, *value, *curo = args, *key; + identlist_node *curi; + value = curo->lvalue; + curo = curo->lnext; + scope = sol_map_copy(state, value->closure); + curi = AS(value->args, identlist_node); + while(curi) { + if(curi->ident) { + key = sol_new_string(state, curi->ident); + if(!(curo && curo->lvalue)) { + sol_map_set(state, scope, key, sol_incref(state->None)); + } else { + sol_map_set(state, scope, key, curo->lvalue); + curo = curo->lnext; + } + sol_obj_free(key); + curi = curi->next; + } + } + sol_state_push_scope(state, scope); + sol_exec(state, AS(value->func, stmt_node)); + sol_state_pop_scope(state); + sol_map_merge_existing(state, value->closure, scope); + if(state->ret) { + res = state->ret; + state->ret = NULL; + } else { + res = sol_incref(state->None); + } + sol_obj_free(scope); + return res; +} + +sol_object_t *sol_new_func(sol_state_t *state, identlist_node *identlist, stmt_node *body) { + sol_object_t *obj = sol_alloc_object(state); + if(sol_has_error(state)) return sol_incref(state->None); + obj->func = body; + obj->args = identlist; + obj->closure = sol_new_map(state); + obj->type = SOL_FUNCTION; + obj->ops = &(state->FuncOps); + return obj; +} diff --git a/sol.h b/sol.h index 60db760..58c03cd 100644 --- a/sol.h +++ b/sol.h @@ -19,10 +19,12 @@ typedef struct { sol_cfunc_t sub; sol_cfunc_t mul; sol_cfunc_t div; + sol_cfunc_t pow; sol_cfunc_t band; sol_cfunc_t bor; sol_cfunc_t bxor; sol_cfunc_t bnot; + sol_cfunc_t cmp; sol_cfunc_t call; sol_cfunc_t index; sol_cfunc_t setindex; @@ -43,8 +45,7 @@ typedef enum { SOL_MAP, SOL_FUNCTION, SOL_CFUNCTION, - SOL_CDATA, - SOL_FRAME + SOL_CDATA } sol_objtype_t; typedef enum { @@ -57,9 +58,9 @@ typedef struct sol_tag_object_t { int refcnt; sol_ops_t *ops; union { - int ival; + long ival; double fval; - const char *str; + char *str; struct { struct sol_tag_object_t *lvalue; struct sol_tag_object_t *lnext; @@ -70,25 +71,25 @@ typedef struct sol_tag_object_t { struct sol_tag_object_t *mnext; }; struct { - void *func; // Actually a node * - sol_object_t *closure; + void *func; // Actually a stmt_node * + void *args; // Actually an identlist_node * + struct sol_tag_object_t *closure; }; sol_cfunc_t cfunc; void *cdata; - struct { - sol_frametype_t frtype; - void *frame; // Actually a node * - }; }; } sol_object_t; +typedef enum {SF_NORMAL, SF_BREAKING, SF_CONTINUING} sol_state_flag_t; + typedef struct sol_tag_state_t { sol_object_t *scopes; // A list of scope maps, innermost out, ending at the global scope - sol_object_t *values; // Expression value stack (as a list) - sol_object_t *returns; // Return frame stack (as a list) + sol_object_t *ret; // Return value of this function, for early return + sol_state_flag_t sflag; // Used to implement break/continue sol_object_t *error; // Some arbitrary error descriptor, sol_None if no error sol_object_t *None; sol_object_t *OutOfMemory; + sol_object_t *StopIteration; sol_ops_t NullOps; sol_ops_t IntOps; sol_ops_t FloatOps; @@ -111,6 +112,9 @@ void sol_state_assign_name(sol_state_t *, const char *, sol_object_t *); void sol_state_assign_l(sol_state_t *, sol_object_t *, sol_object_t *); void sol_state_assign_l_name(sol_state_t *, const char *, sol_object_t *); +void sol_state_push_scope(sol_state_t *, sol_object_t *); +sol_object_t *sol_state_pop_scope(sol_state_t *); + sol_object_t *sol_get_error(sol_state_t *); sol_object_t *sol_set_error(sol_state_t *, sol_object_t *); sol_object_t *sol_set_error_string(sol_state_t *, const char *); @@ -118,59 +122,67 @@ void sol_clear_error(sol_state_t *); // builtins.c -extern sol_cfunc_t sol_f_not_impl; -extern sol_cfunc_t sol_f_no_op; - -extern sol_cfunc_t sol_f_toint; -extern sol_cfunc_t sol_f_tofloat; -extern sol_cfunc_t sol_f_tostring; -extern sol_cfunc_t sol_f_try; - -extern sol_cfunc_t sol_f_int_add; -extern sol_cfunc_t sol_f_int_sub; -extern sol_cfunc_t sol_f_int_mul; -extern sol_cfunc_t sol_f_int_div; -extern sol_cfunc_t sol_f_int_band; -extern sol_cfunc_t sol_f_int_bor; -extern sol_cfunc_t sol_f_int_bxor; -extern sol_cfunc_t sol_f_int_bnot; -extern sol_cfunc_t sol_f_int_toint; -extern sol_cfunc_t sol_f_int_tofloat; -extern sol_cfunc_t sol_f_int_tostring; - -extern sol_cfunc_t sol_f_float_add; -extern sol_cfunc_t sol_f_float_sub; -extern sol_cfunc_t sol_f_float_mul; -extern sol_cfunc_t sol_f_float_div; -extern sol_cfunc_t sol_f_float_toint; -extern sol_cfunc_t sol_f_float_tofloat; -extern sol_cfunc_t sol_f_float_tostring; - -extern sol_cfunc_t sol_f_str_add; -extern sol_cfunc_t sol_f_str_mul; -extern sol_cfunc_t sol_f_str_len; -extern sol_cfunc_t sol_f_str_toint; -extern sol_cfunc_t sol_f_str_tofloat; -extern sol_cfunc_t sol_f_str_tostring; - -extern sol_cfunc_t sol_f_list_add; -extern sol_cfunc_t sol_f_list_mul; -extern sol_cfunc_t sol_f_list_index; -extern sol_cfunc_t sol_f_list_setindex; -extern sol_cfunc_t sol_f_list_len; -extern sol_cfunc_t sol_f_list_tostring; - -extern sol_cfunc_t sol_f_map_add; -extern sol_cfunc_t sol_f_map_index; -extern sol_cfunc_t sol_f_map_setindex; -extern sol_cfunc_t sol_f_map_len; -extern sol_cfunc_t sol_f_map_tostring; - -extern sol_cfunc_t sol_f_func_call; // Defined in ast.c -extern sol_cfunc_t sol_f_func_tostring; - -extern sol_cfunc_t sol_f_cfunc_call; -extern sol_cfunc_t sol_f_cfunc_tostring; +sol_object_t *sol_f_not_impl(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_no_op(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_default_cmp(sol_state_t *, sol_object_t *); + +sol_object_t *sol_f_toint(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_tofloat(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_tostring(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_try(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_type(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_prepr(sol_state_t *, sol_object_t *); + +sol_object_t *sol_f_int_add(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_int_sub(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_int_mul(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_int_div(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_int_pow(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_int_band(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_int_bor(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_int_bxor(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_int_bnot(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_int_cmp(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_int_toint(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_int_tofloat(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_int_tostring(sol_state_t *, sol_object_t *); + +sol_object_t *sol_f_float_add(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_float_sub(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_float_mul(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_float_div(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_float_pow(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_float_cmp(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_float_toint(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_float_tofloat(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_float_tostring(sol_state_t *, sol_object_t *); + +sol_object_t *sol_f_str_add(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_str_mul(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_str_len(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_str_cmp(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_str_toint(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_str_tofloat(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_str_tostring(sol_state_t *, sol_object_t *); + +sol_object_t *sol_f_list_add(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_list_mul(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_list_index(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_list_setindex(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_list_len(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_list_tostring(sol_state_t *, sol_object_t *); + +sol_object_t *sol_f_map_add(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_map_index(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_map_setindex(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_map_len(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_map_tostring(sol_state_t *, sol_object_t *); + +sol_object_t *sol_f_func_call(sol_state_t *, sol_object_t *); // Defined in ast.c +sol_object_t *sol_f_func_tostring(sol_state_t *, sol_object_t *); + +sol_object_t *sol_f_cfunc_call(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_cfunc_tostring(sol_state_t *, sol_object_t *); // object.c @@ -181,8 +193,8 @@ void sol_obj_free(sol_object_t *); void sol_obj_release(sol_object_t *); #define sol_is_singlet(obj) ((obj)->type == SOL_SINGLET) -#define sol_is_none(state, obj) ((obj) == state->sol_None) -#define sol_is_oom(state, obj) ((obj) == state->sol_OutOfMemory) +#define sol_is_none(state, obj) ((obj) == state->None) +#define sol_is_oom(state, obj) ((obj) == state->OutOfMemory) #define sol_is_int(obj) ((obj)-> type == SOL_INTEGER) #define sol_is_float(obj) ((obj)->type == SOL_FLOAT) #define sol_is_string(obj) ((obj)->type == SOL_STRING) @@ -194,8 +206,10 @@ void sol_obj_release(sol_object_t *); #define sol_has_error(state) (!sol_is_none((state), (state)->error)) +sol_object_t *sol_alloc_object(sol_state_t *); + sol_object_t *sol_new_singlet(sol_state_t *); -sol_object_t *sol_new_int(sol_state_t *, int); +sol_object_t *sol_new_int(sol_state_t *, long); sol_object_t *sol_new_float(sol_state_t *, double); sol_object_t *sol_new_string(sol_state_t *, const char *); @@ -216,8 +230,10 @@ int sol_map_len(sol_state_t *, sol_object_t *); sol_object_t *sol_map_submap(sol_state_t *, sol_object_t *, sol_object_t *); sol_object_t *sol_map_get(sol_state_t *, sol_object_t *, sol_object_t *); void sol_map_set(sol_state_t *, sol_object_t *, sol_object_t *, sol_object_t *); +void sol_map_set_existing(sol_state_t *, sol_object_t *, sol_object_t *, sol_object_t *); sol_object_t *sol_map_copy(sol_state_t *, sol_object_t *); void sol_map_merge(sol_state_t *, sol_object_t *, sol_object_t *); +void sol_map_merge_existing(sol_state_t *, sol_object_t *, sol_object_t *); // Defined in ast.h // sol_object_t *sol_new_func(sol_state_t *, identlist_node *, stmt_node *); @@ -229,8 +245,8 @@ sol_object_t *sol_cast_int(sol_state_t *, sol_object_t *); sol_object_t *sol_cast_float(sol_state_t *, sol_object_t *); sol_object_t *sol_cast_string(sol_state_t *, sol_object_t *); -extern sol_cfunc_t sol_f_str_free; -extern sol_cfunc_t sol_f_list_free; -extern sol_cfunc_t sol_f_map_free; +sol_object_t *sol_f_str_free(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_list_free(sol_state_t *, sol_object_t *); +sol_object_t *sol_f_map_free(sol_state_t *, sol_object_t *); #endif diff --git a/solrun.c b/solrun.c new file mode 100644 index 0000000..461a4e7 --- /dev/null +++ b/solrun.c @@ -0,0 +1,19 @@ +#include +#include "ast.h" + +int main(int argc, char **argv) { + stmt_node *program; + sol_state_t state; + + program = sol_compile_file(stdin); + + st_print(program); + + if(program) { + sol_state_init(&state); + sol_exec(&state, program); + return 0; + } + + return 1; +} diff --git a/state.c b/state.c index e539731..b02f64d 100644 --- a/state.c +++ b/state.c @@ -7,26 +7,16 @@ int sol_state_init(sol_state_t *state) { state->OutOfMemory = NULL; state->scopes = NULL; state->error = NULL; + state->ret = NULL; + state->sflag = SF_NORMAL; // If any of the following fail, some very weird things are happening. if(!(state->None = sol_new_singlet(state))) goto cleanup; if(!(state->OutOfMemory = sol_new_singlet(state))) goto cleanup; + if(!(state->StopIteration = sol_new_singlet(state))) goto cleanup; // We can now use the normal error reporting mechanism, now // that errors are distinguishable. Set that up now. - state->error = state->None; - state->scopes = sol_new_list(state); - if(sol_has_error(state)) goto cleanup; - globals = sol_new_map(); - if(sol_has_error(state)) goto cleanup; - sol_list_insert(state, state->scopes, 0, globals); - if(sol_has_error(state)) goto cleanup; - // I'm going to buffer all of these together because I can. - sol_map_set(state, globals, sol_new_string(state, "toint"), sol_new_cfunc(state, sol_f_toint)); - sol_map_set(state, globals, sol_new_string(state, "tofloat"), sol_new_cfunc(state, sol_f_tofloat)); - sol_map_set(state, globals, sol_new_string(state, "tostring"), sol_new_cfunc(state, sol_f_tostring)); - sol_map_set(state, globals, sol_new_string(state, "try"), sol_new_cfunc(state, sol_f_try)); - if(sol_has_error(state)) goto cleanup; //Initialize all of the builtin operations //(these ones are technically already pointed to by None/OOM) @@ -38,12 +28,13 @@ int sol_state_init(sol_state_t *state) { state->NullOps.bor = sol_f_not_impl; state->NullOps.bxor = sol_f_not_impl; state->NullOps.bnot = sol_f_not_impl; + state->NullOps.cmp = sol_f_default_cmp; state->NullOps.call = sol_f_not_impl; state->NullOps.index = sol_f_not_impl; state->NullOps.setindex = sol_f_not_impl; state->NullOps.len = sol_f_not_impl; state->NullOps.toint = sol_f_not_impl; - state->NullOps.tofloat = sol_not_impl + state->NullOps.tofloat = sol_f_not_impl; state->NullOps.tostring = sol_f_not_impl; state->NullOps.init = sol_f_no_op; state->NullOps.free = sol_f_no_op; @@ -56,6 +47,7 @@ int sol_state_init(sol_state_t *state) { state->IntOps.bor = sol_f_int_bor; state->IntOps.bxor = sol_f_int_bxor; state->IntOps.bnot = sol_f_int_bnot; + state->IntOps.cmp = sol_f_int_cmp; state->IntOps.call = sol_f_not_impl; state->IntOps.index = sol_f_not_impl; state->IntOps.setindex = sol_f_not_impl; @@ -74,6 +66,7 @@ int sol_state_init(sol_state_t *state) { state->FloatOps.bor = sol_f_not_impl; state->FloatOps.bxor = sol_f_not_impl; state->FloatOps.bnot = sol_f_not_impl; + state->FloatOps.cmp = sol_f_float_cmp; state->FloatOps.call = sol_f_not_impl; state->FloatOps.index = sol_f_not_impl; state->FloatOps.setindex = sol_f_not_impl; @@ -88,10 +81,11 @@ int sol_state_init(sol_state_t *state) { state->StringOps.sub = sol_f_not_impl; state->StringOps.mul = sol_f_str_mul; state->StringOps.div = sol_f_not_impl; - state->StringOps.band = sol_f_not_impl + state->StringOps.band = sol_f_not_impl; state->StringOps.bor = sol_f_not_impl; state->StringOps.bxor = sol_f_not_impl; state->StringOps.bnot = sol_f_not_impl; + state->StringOps.cmp = sol_f_str_cmp; state->StringOps.call = sol_f_not_impl; state->StringOps.index = sol_f_not_impl; state->StringOps.setindex = sol_f_not_impl; @@ -110,6 +104,7 @@ int sol_state_init(sol_state_t *state) { state->ListOps.bor = sol_f_not_impl; state->ListOps.bxor = sol_f_not_impl; state->ListOps.bnot = sol_f_not_impl; + state->ListOps.cmp = sol_f_default_cmp; state->ListOps.call = sol_f_not_impl; state->ListOps.index = sol_f_list_index; state->ListOps.setindex = sol_f_list_setindex; @@ -128,6 +123,7 @@ int sol_state_init(sol_state_t *state) { state->MapOps.bor = sol_f_not_impl; state->MapOps.bxor = sol_f_not_impl; state->MapOps.bnot = sol_f_not_impl; + state->MapOps.cmp = sol_f_default_cmp; state->MapOps.call = sol_f_not_impl; state->MapOps.index = sol_f_map_index; state->MapOps.setindex = sol_f_map_setindex; @@ -138,6 +134,25 @@ int sol_state_init(sol_state_t *state) { state->MapOps.init = sol_f_no_op; state->MapOps.free = sol_f_map_free; + state->FuncOps.add = sol_f_not_impl; + state->FuncOps.sub = sol_f_not_impl; + state->FuncOps.mul = sol_f_not_impl; + state->FuncOps.div = sol_f_not_impl; + state->FuncOps.band = sol_f_not_impl; + state->FuncOps.bor = sol_f_not_impl; + state->FuncOps.bxor = sol_f_not_impl; + state->FuncOps.bnot = sol_f_not_impl; + state->FuncOps.cmp = sol_f_default_cmp; + state->FuncOps.call = sol_f_func_call; + state->FuncOps.index = sol_f_not_impl; + state->FuncOps.setindex = sol_f_not_impl; + state->FuncOps.len = sol_f_not_impl; + state->FuncOps.toint = sol_f_not_impl; + state->FuncOps.tofloat = sol_f_not_impl; + state->FuncOps.tostring = sol_f_func_tostring; + state->FuncOps.init = sol_f_no_op; + state->FuncOps.free = sol_f_no_op; + state->CFuncOps.add = sol_f_not_impl; state->CFuncOps.sub = sol_f_not_impl; state->CFuncOps.mul = sol_f_not_impl; @@ -146,6 +161,7 @@ int sol_state_init(sol_state_t *state) { state->CFuncOps.bor = sol_f_not_impl; state->CFuncOps.bxor = sol_f_not_impl; state->CFuncOps.bnot = sol_f_not_impl; + state->CFuncOps.cmp = sol_f_default_cmp; state->CFuncOps.call = sol_f_cfunc_call; state->CFuncOps.index = sol_f_not_impl; state->CFuncOps.setindex = sol_f_not_impl; @@ -156,21 +172,42 @@ int sol_state_init(sol_state_t *state) { state->CFuncOps.init = sol_f_no_op; state->CFuncOps.free = sol_f_no_op; + state->error = state->None; + state->scopes = sol_new_list(state); + if(sol_has_error(state)) goto cleanup; + globals = sol_new_map(state); + if(sol_has_error(state)) goto cleanup; + sol_list_insert(state, &(state->scopes), 0, globals); + if(sol_has_error(state)) goto cleanup; + // I'm going to buffer all of these together because I can. + sol_map_set(state, globals, sol_new_string(state, "None"), state->None); + sol_map_set(state, globals, sol_new_string(state, "OutOfMemory"), state->OutOfMemory); + sol_map_set(state, globals, sol_new_string(state, "StopIteration"), state->StopIteration); + sol_map_set(state, globals, sol_new_string(state, "toint"), sol_new_cfunc(state, sol_f_toint)); + sol_map_set(state, globals, sol_new_string(state, "tofloat"), sol_new_cfunc(state, sol_f_tofloat)); + sol_map_set(state, globals, sol_new_string(state, "tostring"), sol_new_cfunc(state, sol_f_tostring)); + sol_map_set(state, globals, sol_new_string(state, "try"), sol_new_cfunc(state, sol_f_try)); + sol_map_set(state, globals, sol_new_string(state, "type"), sol_new_cfunc(state, sol_f_type)); + sol_map_set(state, globals, sol_new_string(state, "prepr"), sol_new_cfunc(state, sol_f_prepr)); + if(sol_has_error(state)) goto cleanup; + // We're all set! return 1; - _cleanup: + cleanup: sol_obj_free(state->None); sol_obj_free(state->OutOfMemory); + sol_obj_free(state->StopIteration); return 0; } sol_object_t *sol_state_resolve(sol_state_t *state, sol_object_t *key) { sol_object_t *cur = state->scopes, *temp; - while(cur.lvalue) { - temp = sol_map_get(state, cur.lvalue, key); - if(!sol_is_none(temp)) return sol_incref(temp); - cur = cur.lnext; + while(cur) { + if(!cur->lvalue) continue; + temp = sol_map_get(state, cur->lvalue, key); + if(!sol_is_none(state, temp)) return sol_incref(temp); + cur = cur->lnext; } return sol_incref(state->None); @@ -194,17 +231,17 @@ void sol_state_assign(sol_state_t *state, sol_object_t *key, sol_object_t *val) return; } - next = cur.lnext; + next = cur->lnext; while(next) { cur = next; - next = cur.lnext; + next = cur->lnext; } - sol_map_set(state, cur.lvalue, key, val); + sol_map_set(state, cur->lvalue, key, val); } void sol_state_assign_name(sol_state_t *state, const char *name, sol_object_t *val) { - sol_object_t *key = sol_new_string(name); + sol_object_t *key = sol_new_string(state, name); if(sol_has_error(state)) return; @@ -220,11 +257,11 @@ void sol_state_assign_l(sol_state_t *state, sol_object_t *key, sol_object_t *val return; } - sol_map_set(state, cur.lvalue, key, val); + sol_map_set(state, cur->lvalue, key, val); } void sol_state_assign_l_name(sol_state_t *state, const char *name, sol_object_t *val) { - sol_object_t *key = sol_new_string(name); + sol_object_t *key = sol_new_string(state, name); if(sol_has_error(state)) return; @@ -232,6 +269,14 @@ void sol_state_assign_l_name(sol_state_t *state, const char *name, sol_object_t sol_obj_free(key); } +void sol_state_push_scope(sol_state_t *state, sol_object_t *scope) { + sol_list_push(state, state->scopes, scope); +} + +sol_object_t *sol_state_pop_scope(sol_state_t *state) { + return sol_list_pop(state, state->scopes); +} + sol_object_t *sol_get_error(sol_state_t *state) { return sol_incref(state->error); } @@ -242,12 +287,14 @@ sol_object_t *sol_set_error(sol_state_t *state, sol_object_t *err) { } sol_object_t *sol_set_error_string(sol_state_t *state, const char *serr) { - sol_object_t *err = sol_new_string(serr); + sol_object_t *err = sol_new_string(state, serr), *res; if(sol_has_error(state)) return sol_incref(state->None); - sol_set_error(state, err); + res = sol_set_error(state, err); sol_obj_free(err); + + return res; } void sol_clear_error(sol_state_t *state) { diff --git a/test.sol b/test.sol index cbc5ad4..9eb8799 100644 --- a/test.sol +++ b/test.sol @@ -5,7 +5,7 @@ while a < 10 do end func mul9(b) - for i in b do + for i in range(len(b)) do b[i] *= 9 end end @@ -25,3 +25,7 @@ d = { ["this time with spaces"] = 2*PI, [1 + 5] = 1 + 5 } + +d["integer"] +d.integer +d.integer += 5 diff --git a/testbuild.sh b/testbuild.sh index 41e05dc..b8ca52b 100755 --- a/testbuild.sh +++ b/testbuild.sh @@ -3,4 +3,9 @@ flex tokenizer.lex gcc -c -g lex.yy.c gcc -c -g parser.tab.c gcc -c -g astprint.c -gcc -g lex.yy.o parser.tab.o astprint.o -o astprint +gcc -c -g runtime.c +gcc -c -g object.c +gcc -c -g state.c +gcc -c -g builtins.c +gcc -c -g solrun.c +gcc -g -lm *.o -o sol diff --git a/tokenizer.lex b/tokenizer.lex index 22d5cfb..6827d62 100644 --- a/tokenizer.lex +++ b/tokenizer.lex @@ -78,6 +78,12 @@ do { return DO; } func { return FUNC; } +return { return RETURN; } + +break { return BREAK; } + +continue { return CONTINUE; } + end { return END; } "+" { return PLUS; } @@ -166,4 +172,21 @@ int yywrap(void) { void yyerror(char *s) { puts(s); -} \ No newline at end of file +} + +stmt_node *sol_compile(const char *prgstr) { + stmt_node *program = NULL; + YY_BUFFER_STATE buf = yy_scan_string(prgstr); + yyparse(&program); + yy_delete_buffer(buf); + return program; +} + +stmt_node *sol_compile_file(FILE *prgfile) { + stmt_node *program = NULL; + YY_BUFFER_STATE buf = yy_create_buffer(prgfile, YY_BUF_SIZE); + yy_switch_to_buffer(buf); + yyparse(&program); + yy_delete_buffer(buf); + return program; +}