summaryrefslogtreecommitdiffstats
path: root/src/parse.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse.cpp')
-rw-r--r--src/parse.cpp199
1 files changed, 73 insertions, 126 deletions
diff --git a/src/parse.cpp b/src/parse.cpp
index fe3a026..9a24c03 100644
--- a/src/parse.cpp
+++ b/src/parse.cpp
@@ -141,8 +141,6 @@ static inline std::string * parse_reduce_23(std::string *v, __attribute__((unuse
static inline std::string * parse_reduce_24(std::string *v, __attribute__((unused)) solar::grammar_t *grammar) {return v;}
-static inline std::string * parse_reduce_25(std::string *v, __attribute__((unused)) solar::grammar_t *grammar) {return v;}
-
static int parse_do_push(parse_context_t *parser, int token, __attribute__((unused)) solar::grammar_t *grammar) {
parse_symbol_value_t result;
@@ -161,7 +159,7 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
case 0:
return 0;
- case TOK_SYMBOL_LC:
+ case TOK_SYMBOL:
parser->stack[++parser->top].state = 4;
return 1;
@@ -378,7 +376,7 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
parser->stack[++parser->top].state = 30;
return 1;
- case TOK_SYMBOL_LC:
+ case TOK_SYMBOL:
parser->stack[++parser->top].state = 31;
return 1;
@@ -489,8 +487,8 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
parser->stack[++parser->top].state = 25;
break;
- case 69:
- parser->stack[++parser->top].state = 71;
+ case 68:
+ parser->stack[++parser->top].state = 70;
break;
}
@@ -515,7 +513,7 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
parser->stack[parser->top].value.symbol_term = result.symbol_term;
switch (parser->stack[parser->top].state) {
case 18:
- case 69:
+ case 68:
parser->stack[++parser->top].state = 26;
break;
@@ -561,8 +559,8 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
parser->stack[++parser->top].state = 25;
break;
- case 69:
- parser->stack[++parser->top].state = 71;
+ case 68:
+ parser->stack[++parser->top].state = 70;
break;
}
@@ -578,7 +576,7 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
parser->stack[parser->top].value.symbol_term = result.symbol_term;
switch (parser->stack[parser->top].state) {
case 18:
- case 69:
+ case 68:
parser->stack[++parser->top].state = 26;
break;
@@ -654,7 +652,7 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
parser->stack[++parser->top].state = 32;
return 1;
- case TOK_SYMBOL_LC:
+ case TOK_SYMBOL:
parser->stack[++parser->top].state = 45;
return 1;
@@ -669,16 +667,12 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
parser->stack[++parser->top].state = 47;
return 1;
- case TOK_SYMBOL_LC:
- parser->stack[++parser->top].state = 48;
- return 1;
-
case TOK_SYMBOL_UC:
- parser->stack[++parser->top].state = 49;
+ parser->stack[++parser->top].state = 48;
return 1;
case '=':
- parser->stack[++parser->top].state = 50;
+ parser->stack[++parser->top].state = 49;
return 1;
default:
@@ -689,7 +683,7 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
case 40:
switch (token) {
case 'u':
- parser->stack[++parser->top].state = 51;
+ parser->stack[++parser->top].state = 50;
return 1;
default:
@@ -700,7 +694,7 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
case 41:
switch (token) {
case '_':
- parser->stack[++parser->top].state = 52;
+ parser->stack[++parser->top].state = 51;
return 1;
default:
@@ -711,7 +705,7 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
case 42:
switch (token) {
case 'r':
- parser->stack[++parser->top].state = 53;
+ parser->stack[++parser->top].state = 52;
return 1;
default:
@@ -722,7 +716,7 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
case 43:
switch (token) {
case 'e':
- parser->stack[++parser->top].state = 54;
+ parser->stack[++parser->top].state = 53;
return 1;
default:
@@ -733,7 +727,7 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
case 44:
switch (token) {
case TOK_BLOCK:
- parser->stack[++parser->top].state = 55;
+ parser->stack[++parser->top].state = 54;
return 1;
default:
@@ -744,7 +738,7 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
case 45:
switch (token) {
case TOK_BLOCK:
- parser->stack[++parser->top].state = 56;
+ parser->stack[++parser->top].state = 55;
return 1;
default:
@@ -755,7 +749,7 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
case 46:
switch (token) {
case ')':
- parser->stack[++parser->top].state = 57;
+ parser->stack[++parser->top].state = 56;
return 1;
default:
@@ -767,27 +761,27 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
switch (token) {
default:
parser->top -= 1;
- result.symbol_varname = parse_reduce_25(parser->stack[parser->top + 0].value.token.str, grammar);
+ result.symbol_varname = parse_reduce_24(parser->stack[parser->top + 0].value.token.str, grammar);
parser->stack[parser->top].value.symbol_varname = result.symbol_varname;
switch (parser->stack[parser->top].state) {
case 39:
parser->stack[++parser->top].state = 46;
break;
- case 50:
- parser->stack[++parser->top].state = 58;
+ case 49:
+ parser->stack[++parser->top].state = 57;
break;
- case 55:
- parser->stack[++parser->top].state = 63;
+ case 54:
+ parser->stack[++parser->top].state = 62;
break;
- case 70:
- parser->stack[++parser->top].state = 72;
+ case 69:
+ parser->stack[++parser->top].state = 71;
break;
- case 71:
- parser->stack[++parser->top].state = 73;
+ case 70:
+ parser->stack[++parser->top].state = 72;
break;
}
@@ -805,69 +799,34 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
parser->stack[++parser->top].state = 46;
break;
- case 50:
- parser->stack[++parser->top].state = 58;
+ case 49:
+ parser->stack[++parser->top].state = 57;
break;
- case 55:
- parser->stack[++parser->top].state = 63;
+ case 54:
+ parser->stack[++parser->top].state = 62;
break;
- case 70:
- parser->stack[++parser->top].state = 72;
- break;
-
- case 71:
- parser->stack[++parser->top].state = 73;
- break;
-
- }
- }
- break;
-
- case 49:
- switch (token) {
- default:
- parser->top -= 1;
- result.symbol_varname = parse_reduce_24(parser->stack[parser->top + 0].value.token.str, grammar);
- parser->stack[parser->top].value.symbol_varname = result.symbol_varname;
- switch (parser->stack[parser->top].state) {
- case 39:
- parser->stack[++parser->top].state = 46;
- break;
-
- case 50:
- parser->stack[++parser->top].state = 58;
- break;
-
- case 55:
- parser->stack[++parser->top].state = 63;
+ case 69:
+ parser->stack[++parser->top].state = 71;
break;
case 70:
parser->stack[++parser->top].state = 72;
break;
- case 71:
- parser->stack[++parser->top].state = 73;
- break;
-
}
}
break;
- case 50:
+ case 49:
switch (token) {
case TOK_SYMBOL:
parser->stack[++parser->top].state = 47;
return 1;
- case TOK_SYMBOL_LC:
- parser->stack[++parser->top].state = 48;
- return 1;
-
case TOK_SYMBOL_UC:
- parser->stack[++parser->top].state = 49;
+ parser->stack[++parser->top].state = 48;
return 1;
default:
@@ -875,10 +834,10 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
}
break;
- case 51:
+ case 50:
switch (token) {
case 'c':
- parser->stack[++parser->top].state = 59;
+ parser->stack[++parser->top].state = 58;
return 1;
default:
@@ -886,10 +845,10 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
}
break;
- case 52:
+ case 51:
switch (token) {
case 'a':
- parser->stack[++parser->top].state = 60;
+ parser->stack[++parser->top].state = 59;
return 1;
default:
@@ -897,10 +856,10 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
}
break;
- case 53:
+ case 52:
switch (token) {
case TOK_BLOCK:
- parser->stack[++parser->top].state = 61;
+ parser->stack[++parser->top].state = 60;
return 1;
default:
@@ -908,10 +867,10 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
}
break;
- case 54:
+ case 53:
switch (token) {
case TOK_BLOCK:
- parser->stack[++parser->top].state = 62;
+ parser->stack[++parser->top].state = 61;
return 1;
default:
@@ -919,18 +878,14 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
}
break;
- case 55:
+ case 54:
switch (token) {
case TOK_SYMBOL:
parser->stack[++parser->top].state = 47;
return 1;
- case TOK_SYMBOL_LC:
- parser->stack[++parser->top].state = 48;
- return 1;
-
case TOK_SYMBOL_UC:
- parser->stack[++parser->top].state = 49;
+ parser->stack[++parser->top].state = 48;
return 1;
default:
@@ -938,7 +893,7 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
}
break;
- case 56:
+ case 55:
switch (token) {
default:
parser->top -= 7;
@@ -949,7 +904,7 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
}
break;
- case 57:
+ case 56:
switch (token) {
default:
parser->top -= 5;
@@ -961,10 +916,10 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
}
break;
- case 58:
+ case 57:
switch (token) {
case ')':
- parser->stack[++parser->top].state = 64;
+ parser->stack[++parser->top].state = 63;
return 1;
default:
@@ -972,10 +927,10 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
}
break;
- case 59:
+ case 58:
switch (token) {
case 't':
- parser->stack[++parser->top].state = 65;
+ parser->stack[++parser->top].state = 64;
return 1;
default:
@@ -983,10 +938,10 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
}
break;
- case 60:
+ case 59:
switch (token) {
case 'r':
- parser->stack[++parser->top].state = 66;
+ parser->stack[++parser->top].state = 65;
return 1;
default:
@@ -994,7 +949,7 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
}
break;
- case 61:
+ case 60:
switch (token) {
default:
parser->top -= 8;
@@ -1004,7 +959,7 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
}
break;
- case 62:
+ case 61:
switch (token) {
default:
parser->top -= 8;
@@ -1014,7 +969,7 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
}
break;
- case 63:
+ case 62:
switch (token) {
default:
parser->top -= 8;
@@ -1026,7 +981,7 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
}
break;
- case 64:
+ case 63:
switch (token) {
default:
parser->top -= 6;
@@ -1038,10 +993,10 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
}
break;
- case 65:
+ case 64:
switch (token) {
case 'o':
- parser->stack[++parser->top].state = 67;
+ parser->stack[++parser->top].state = 66;
return 1;
default:
@@ -1049,10 +1004,10 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
}
break;
- case 66:
+ case 65:
switch (token) {
case 'g':
- parser->stack[++parser->top].state = 68;
+ parser->stack[++parser->top].state = 67;
return 1;
default:
@@ -1060,10 +1015,10 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
}
break;
- case 67:
+ case 66:
switch (token) {
case 'r':
- parser->stack[++parser->top].state = 69;
+ parser->stack[++parser->top].state = 68;
return 1;
default:
@@ -1071,10 +1026,10 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
}
break;
- case 68:
+ case 67:
switch (token) {
case TOK_BLOCK:
- parser->stack[++parser->top].state = 70;
+ parser->stack[++parser->top].state = 69;
return 1;
default:
@@ -1082,13 +1037,13 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
}
break;
- case 69:
+ case 68:
switch (token) {
case TOK_CHAR:
parser->stack[++parser->top].state = 28;
return 1;
- case TOK_SYMBOL_LC:
+ case TOK_SYMBOL:
parser->stack[++parser->top].state = 31;
return 1;
@@ -1101,18 +1056,14 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
}
break;
- case 70:
+ case 69:
switch (token) {
case TOK_SYMBOL:
parser->stack[++parser->top].state = 47;
return 1;
- case TOK_SYMBOL_LC:
- parser->stack[++parser->top].state = 48;
- return 1;
-
case TOK_SYMBOL_UC:
- parser->stack[++parser->top].state = 49;
+ parser->stack[++parser->top].state = 48;
return 1;
default:
@@ -1120,18 +1071,14 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
}
break;
- case 71:
+ case 70:
switch (token) {
case TOK_SYMBOL:
parser->stack[++parser->top].state = 47;
return 1;
- case TOK_SYMBOL_LC:
- parser->stack[++parser->top].state = 48;
- return 1;
-
case TOK_SYMBOL_UC:
- parser->stack[++parser->top].state = 49;
+ parser->stack[++parser->top].state = 48;
return 1;
default:
@@ -1139,7 +1086,7 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
}
break;
- case 72:
+ case 71:
switch (token) {
default:
parser->top -= 12;
@@ -1150,7 +1097,7 @@ static int parse_do_push(parse_context_t *parser, int token, __attribute__((unus
}
break;
- case 73:
+ case 72:
switch (token) {
default:
parser->top -= 13;