diff options
Diffstat (limited to 'src/parse.cpp')
-rw-r--r-- | src/parse.cpp | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/src/parse.cpp b/src/parse.cpp index f9cefc1..2b5b9f7 100644 --- a/src/parse.cpp +++ b/src/parse.cpp @@ -14,11 +14,11 @@ namespace solar { typedef union parse_symbol_value { parse_token_value_t token; std::string *symbol_action; + std::string *symbol_csymbol; std::vector<std::string> *symbol_namespace; rhs_t *symbol_rhs; symbol_t *symbol_symbol; symbol_t *symbol_term; - std::string *symbol_varname; } parse_symbol_value_t; typedef struct parse_context_state { @@ -845,8 +845,8 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus switch (token) { default: parser->top -= 1; - result.symbol_varname = parse_reduce_27(parser->stack[parser->top + 0].value.token.str, grammar); - parser->stack[parser->top].value.symbol_varname = result.symbol_varname; + result.symbol_csymbol = parse_reduce_27(parser->stack[parser->top + 0].value.token.str, grammar); + parser->stack[parser->top].value.symbol_csymbol = result.symbol_csymbol; switch (parser->stack[parser->top].state) { case 44: parser->stack[++parser->top].state = 53; @@ -861,7 +861,7 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus break; case 82: - parser->stack[++parser->top].state = 87; + parser->stack[++parser->top].state = 86; break; case 85: @@ -884,8 +884,8 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus switch (token) { default: parser->top -= 1; - result.symbol_varname = parse_reduce_26(parser->stack[parser->top + 0].value.token.str, grammar); - parser->stack[parser->top].value.symbol_varname = result.symbol_varname; + result.symbol_csymbol = parse_reduce_26(parser->stack[parser->top + 0].value.token.str, grammar); + parser->stack[parser->top].value.symbol_csymbol = result.symbol_csymbol; switch (parser->stack[parser->top].state) { case 44: parser->stack[++parser->top].state = 53; @@ -900,7 +900,7 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus break; case 82: - parser->stack[++parser->top].state = 87; + parser->stack[++parser->top].state = 86; break; case 85: @@ -1030,9 +1030,9 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus switch (token) { default: parser->top -= 5; - result.symbol_rhs = parse_reduce_14(parser->stack[parser->top + 0].value.symbol_rhs, parser->stack[parser->top + 1].value.symbol_symbol, parser->stack[parser->top + 3].value.symbol_varname, grammar); + result.symbol_rhs = parse_reduce_14(parser->stack[parser->top + 0].value.symbol_rhs, parser->stack[parser->top + 1].value.symbol_symbol, parser->stack[parser->top + 3].value.symbol_csymbol, grammar); delete(parser->stack[parser->top + 1].value.symbol_symbol); - delete(parser->stack[parser->top + 3].value.symbol_varname); + delete(parser->stack[parser->top + 3].value.symbol_csymbol); parser->stack[parser->top].value.symbol_rhs = result.symbol_rhs; parser->stack[++parser->top].state = 19; } @@ -1117,10 +1117,10 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus switch (token) { default: parser->top -= 8; - parse_reduce_4(parser->stack[parser->top + 5].value.symbol_term, parser->stack[parser->top + 6].value.token.str, parser->stack[parser->top + 7].value.symbol_varname, grammar); + parse_reduce_4(parser->stack[parser->top + 5].value.symbol_term, parser->stack[parser->top + 6].value.token.str, parser->stack[parser->top + 7].value.symbol_csymbol, grammar); delete(parser->stack[parser->top + 5].value.symbol_term); delete(parser->stack[parser->top + 6].value.token.str); - delete(parser->stack[parser->top + 7].value.symbol_varname); + delete(parser->stack[parser->top + 7].value.symbol_csymbol); parser->stack[++parser->top].state = 2; } break; @@ -1129,9 +1129,9 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus switch (token) { default: parser->top -= 6; - result.symbol_rhs = parse_reduce_15(parser->stack[parser->top + 0].value.symbol_rhs, parser->stack[parser->top + 1].value.symbol_symbol, parser->stack[parser->top + 4].value.symbol_varname, grammar); + result.symbol_rhs = parse_reduce_15(parser->stack[parser->top + 0].value.symbol_rhs, parser->stack[parser->top + 1].value.symbol_symbol, parser->stack[parser->top + 4].value.symbol_csymbol, grammar); delete(parser->stack[parser->top + 1].value.symbol_symbol); - delete(parser->stack[parser->top + 4].value.symbol_varname); + delete(parser->stack[parser->top + 4].value.symbol_csymbol); parser->stack[parser->top].value.symbol_rhs = result.symbol_rhs; parser->stack[++parser->top].state = 19; } @@ -1275,6 +1275,17 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus case 86: switch (token) { + default: + parser->top -= 1; + result.symbol_namespace = parse_reduce_20(parser->stack[parser->top + 0].value.symbol_csymbol, grammar); + delete(parser->stack[parser->top + 0].value.symbol_csymbol); + parser->stack[parser->top].value.symbol_namespace = result.symbol_namespace; + parser->stack[++parser->top].state = 87; + } + break; + + case 87: + switch (token) { case ':': parser->stack[++parser->top].state = 90; return 1; @@ -1287,17 +1298,6 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus } break; - case 87: - switch (token) { - default: - parser->top -= 1; - result.symbol_namespace = parse_reduce_20(parser->stack[parser->top + 0].value.symbol_varname, grammar); - delete(parser->stack[parser->top + 0].value.symbol_varname); - parser->stack[parser->top].value.symbol_namespace = result.symbol_namespace; - parser->stack[++parser->top].state = 86; - } - break; - case 88: switch (token) { case TOK_SYMBOL: @@ -1317,9 +1317,9 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus switch (token) { default: parser->top -= 12; - parse_reduce_9(parser->stack[parser->top + 10].value.token.str, parser->stack[parser->top + 11].value.symbol_varname, grammar); + parse_reduce_9(parser->stack[parser->top + 10].value.token.str, parser->stack[parser->top + 11].value.symbol_csymbol, grammar); delete(parser->stack[parser->top + 10].value.token.str); - delete(parser->stack[parser->top + 11].value.symbol_varname); + delete(parser->stack[parser->top + 11].value.symbol_csymbol); parser->stack[++parser->top].state = 2; } break; @@ -1339,9 +1339,9 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus switch (token) { default: parser->top -= 13; - parse_reduce_5(parser->stack[parser->top + 11].value.symbol_symbol, parser->stack[parser->top + 12].value.symbol_varname, grammar); + parse_reduce_5(parser->stack[parser->top + 11].value.symbol_symbol, parser->stack[parser->top + 12].value.symbol_csymbol, grammar); delete(parser->stack[parser->top + 11].value.symbol_symbol); - delete(parser->stack[parser->top + 12].value.symbol_varname); + delete(parser->stack[parser->top + 12].value.symbol_csymbol); parser->stack[++parser->top].state = 2; } break; @@ -1365,10 +1365,10 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus switch (token) { default: parser->top -= 4; - result.symbol_namespace = parse_reduce_21(parser->stack[parser->top + 0].value.symbol_namespace, parser->stack[parser->top + 3].value.symbol_varname, grammar); - delete(parser->stack[parser->top + 3].value.symbol_varname); + result.symbol_namespace = parse_reduce_21(parser->stack[parser->top + 0].value.symbol_namespace, parser->stack[parser->top + 3].value.symbol_csymbol, grammar); + delete(parser->stack[parser->top + 3].value.symbol_csymbol); parser->stack[parser->top].value.symbol_namespace = result.symbol_namespace; - parser->stack[++parser->top].state = 86; + parser->stack[++parser->top].state = 87; } break; |