summaryrefslogtreecommitdiffstats
path: root/src/parse.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse.cpp')
-rw-r--r--src/parse.cpp346
1 files changed, 230 insertions, 116 deletions
diff --git a/src/parse.cpp b/src/parse.cpp
index fba7e79..b68943d 100644
--- a/src/parse.cpp
+++ b/src/parse.cpp
@@ -107,43 +107,54 @@ static inline std::pair<std::vector<solar::symbol_t>, std::vector<std::string>>
return rhs;
}
-static inline std::string * parse_reduce_12(__attribute__((unused)) solar::grammar_t * grammar) {
+static inline std::pair<std::vector<solar::symbol_t>, std::vector<std::string>> * parse_reduce_12(std::pair<std::vector<solar::symbol_t>, std::vector<std::string>> * rhs, std::string * str, __attribute__((unused)) solar::grammar_t * grammar) {
+ for (char c : *str) {
+ rhs->first.push_back(solar::symbol_t::make_char(c));
+ rhs->second.emplace_back();
+ }
+
+ delete str;
+
+ return rhs;
+}
+
+static inline std::string * parse_reduce_13(__attribute__((unused)) solar::grammar_t * grammar) {
return new std::string;
}
-static inline std::string * parse_reduce_13(std::string * v, __attribute__((unused)) solar::grammar_t * grammar) {
+static inline std::string * parse_reduce_14(std::string * v, __attribute__((unused)) solar::grammar_t * grammar) {
return v;
}
-static inline solar::symbol_t * parse_reduce_14(solar::symbol_t * v, __attribute__((unused)) solar::grammar_t * grammar) {
+static inline solar::symbol_t * parse_reduce_15(solar::symbol_t * v, __attribute__((unused)) solar::grammar_t * grammar) {
return v;
}
-static inline solar::symbol_t * parse_reduce_15(std::string * v, __attribute__((unused)) solar::grammar_t * grammar) {
+static inline solar::symbol_t * parse_reduce_16(std::string * v, __attribute__((unused)) solar::grammar_t * grammar) {
solar::symbol_t *ret = new solar::symbol_t(solar::symbol_t::make_nonterm(*v));
delete v;
return ret;
}
-static inline solar::symbol_t * parse_reduce_16(std::string * v, __attribute__((unused)) solar::grammar_t * grammar) {
+static inline solar::symbol_t * parse_reduce_17(std::string * v, __attribute__((unused)) solar::grammar_t * grammar) {
solar::symbol_t *ret = new solar::symbol_t(solar::symbol_t::make_term(*v));
delete v;
return ret;
}
-static inline solar::symbol_t * parse_reduce_17(char v, __attribute__((unused)) solar::grammar_t * grammar) {
+static inline solar::symbol_t * parse_reduce_18(char v, __attribute__((unused)) solar::grammar_t * grammar) {
return new solar::symbol_t(solar::symbol_t::make_char(v));
}
-static inline std::string * parse_reduce_18(std::string * v, __attribute__((unused)) solar::grammar_t * grammar) {
+static inline std::string * parse_reduce_19(std::string * v, __attribute__((unused)) solar::grammar_t * grammar) {
return v;
}
-static inline std::string * parse_reduce_19(std::string * v, __attribute__((unused)) solar::grammar_t * grammar) {
+static inline std::string * parse_reduce_20(std::string * v, __attribute__((unused)) solar::grammar_t * grammar) {
return v;
}
-static inline std::string * parse_reduce_20(std::string * v, __attribute__((unused)) solar::grammar_t * grammar) {
+static inline std::string * parse_reduce_21(std::string * v, __attribute__((unused)) solar::grammar_t * grammar) {
return v;
}
@@ -465,7 +476,7 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
switch (token) {
case TOK_BLOCK:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_term = parse_reduce_17(parser->stack[parser->top + 0].value.token.c, grammar);
+ parser->stack[parser->top].value.symbol_term = parse_reduce_18(parser->stack[parser->top + 0].value.token.c, grammar);
switch (parser->stack[parser->top].state) {
case 7:
parser->stack[++parser->top].state = 12;
@@ -478,7 +489,20 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
case TOK_CHAR:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_term = parse_reduce_17(parser->stack[parser->top + 0].value.token.c, grammar);
+ parser->stack[parser->top].value.symbol_term = parse_reduce_18(parser->stack[parser->top + 0].value.token.c, grammar);
+ switch (parser->stack[parser->top].state) {
+ case 7:
+ parser->stack[++parser->top].state = 12;
+ break;
+ case 23:
+ parser->stack[++parser->top].state = 27;
+ break;
+ }
+ break;
+
+ case TOK_STRING:
+ parser->top -= 1;
+ parser->stack[parser->top].value.symbol_term = parse_reduce_18(parser->stack[parser->top + 0].value.token.c, grammar);
switch (parser->stack[parser->top].state) {
case 7:
parser->stack[++parser->top].state = 12;
@@ -491,7 +515,7 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
case TOK_SYMBOL_LC:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_term = parse_reduce_17(parser->stack[parser->top + 0].value.token.c, grammar);
+ parser->stack[parser->top].value.symbol_term = parse_reduce_18(parser->stack[parser->top + 0].value.token.c, grammar);
switch (parser->stack[parser->top].state) {
case 7:
parser->stack[++parser->top].state = 12;
@@ -504,7 +528,7 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
case TOK_SYMBOL_UC:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_term = parse_reduce_17(parser->stack[parser->top + 0].value.token.c, grammar);
+ parser->stack[parser->top].value.symbol_term = parse_reduce_18(parser->stack[parser->top + 0].value.token.c, grammar);
switch (parser->stack[parser->top].state) {
case 7:
parser->stack[++parser->top].state = 12;
@@ -517,7 +541,7 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
case '(':
parser->top -= 1;
- parser->stack[parser->top].value.symbol_term = parse_reduce_17(parser->stack[parser->top + 0].value.token.c, grammar);
+ parser->stack[parser->top].value.symbol_term = parse_reduce_18(parser->stack[parser->top + 0].value.token.c, grammar);
switch (parser->stack[parser->top].state) {
case 7:
parser->stack[++parser->top].state = 12;
@@ -530,7 +554,7 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
case ';':
parser->top -= 1;
- parser->stack[parser->top].value.symbol_term = parse_reduce_17(parser->stack[parser->top + 0].value.token.c, grammar);
+ parser->stack[parser->top].value.symbol_term = parse_reduce_18(parser->stack[parser->top + 0].value.token.c, grammar);
switch (parser->stack[parser->top].state) {
case 7:
parser->stack[++parser->top].state = 12;
@@ -562,7 +586,7 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
switch (token) {
case TOK_BLOCK:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_term = parse_reduce_16(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_term = parse_reduce_17(parser->stack[parser->top + 0].value.token.str, grammar);
switch (parser->stack[parser->top].state) {
case 7:
parser->stack[++parser->top].state = 12;
@@ -575,7 +599,20 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
case TOK_CHAR:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_term = parse_reduce_16(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_term = parse_reduce_17(parser->stack[parser->top + 0].value.token.str, grammar);
+ switch (parser->stack[parser->top].state) {
+ case 7:
+ parser->stack[++parser->top].state = 12;
+ break;
+ case 23:
+ parser->stack[++parser->top].state = 27;
+ break;
+ }
+ break;
+
+ case TOK_STRING:
+ parser->top -= 1;
+ parser->stack[parser->top].value.symbol_term = parse_reduce_17(parser->stack[parser->top + 0].value.token.str, grammar);
switch (parser->stack[parser->top].state) {
case 7:
parser->stack[++parser->top].state = 12;
@@ -588,7 +625,7 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
case TOK_SYMBOL_LC:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_term = parse_reduce_16(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_term = parse_reduce_17(parser->stack[parser->top + 0].value.token.str, grammar);
switch (parser->stack[parser->top].state) {
case 7:
parser->stack[++parser->top].state = 12;
@@ -601,7 +638,7 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
case TOK_SYMBOL_UC:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_term = parse_reduce_16(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_term = parse_reduce_17(parser->stack[parser->top + 0].value.token.str, grammar);
switch (parser->stack[parser->top].state) {
case 7:
parser->stack[++parser->top].state = 12;
@@ -614,7 +651,7 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
case '(':
parser->top -= 1;
- parser->stack[parser->top].value.symbol_term = parse_reduce_16(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_term = parse_reduce_17(parser->stack[parser->top + 0].value.token.str, grammar);
switch (parser->stack[parser->top].state) {
case 7:
parser->stack[++parser->top].state = 12;
@@ -627,7 +664,7 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
case ';':
parser->top -= 1;
- parser->stack[parser->top].value.symbol_term = parse_reduce_16(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_term = parse_reduce_17(parser->stack[parser->top + 0].value.token.str, grammar);
switch (parser->stack[parser->top].state) {
case 7:
parser->stack[++parser->top].state = 12;
@@ -690,7 +727,7 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
switch (token) {
case 0:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_varname = parse_reduce_20(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_varname = parse_reduce_21(parser->stack[parser->top + 0].value.token.str, grammar);
switch (parser->stack[parser->top].state) {
case 8:
parser->stack[++parser->top].state = 16;
@@ -698,15 +735,15 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
case 21:
parser->stack[++parser->top].state = 24;
break;
- case 31:
- parser->stack[++parser->top].state = 32;
+ case 32:
+ parser->stack[++parser->top].state = 33;
break;
}
break;
case TOK_EXTRA_ARG:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_varname = parse_reduce_20(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_varname = parse_reduce_21(parser->stack[parser->top + 0].value.token.str, grammar);
switch (parser->stack[parser->top].state) {
case 8:
parser->stack[++parser->top].state = 16;
@@ -714,15 +751,15 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
case 21:
parser->stack[++parser->top].state = 24;
break;
- case 31:
- parser->stack[++parser->top].state = 32;
+ case 32:
+ parser->stack[++parser->top].state = 33;
break;
}
break;
case TOK_HEADER:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_varname = parse_reduce_20(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_varname = parse_reduce_21(parser->stack[parser->top + 0].value.token.str, grammar);
switch (parser->stack[parser->top].state) {
case 8:
parser->stack[++parser->top].state = 16;
@@ -730,15 +767,15 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
case 21:
parser->stack[++parser->top].state = 24;
break;
- case 31:
- parser->stack[++parser->top].state = 32;
+ case 32:
+ parser->stack[++parser->top].state = 33;
break;
}
break;
case TOK_SOURCE:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_varname = parse_reduce_20(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_varname = parse_reduce_21(parser->stack[parser->top + 0].value.token.str, grammar);
switch (parser->stack[parser->top].state) {
case 8:
parser->stack[++parser->top].state = 16;
@@ -746,15 +783,15 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
case 21:
parser->stack[++parser->top].state = 24;
break;
- case 31:
- parser->stack[++parser->top].state = 32;
+ case 32:
+ parser->stack[++parser->top].state = 33;
break;
}
break;
case TOK_SYMBOL_LC:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_varname = parse_reduce_20(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_varname = parse_reduce_21(parser->stack[parser->top + 0].value.token.str, grammar);
switch (parser->stack[parser->top].state) {
case 8:
parser->stack[++parser->top].state = 16;
@@ -762,15 +799,15 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
case 21:
parser->stack[++parser->top].state = 24;
break;
- case 31:
- parser->stack[++parser->top].state = 32;
+ case 32:
+ parser->stack[++parser->top].state = 33;
break;
}
break;
case TOK_TYPE:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_varname = parse_reduce_20(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_varname = parse_reduce_21(parser->stack[parser->top + 0].value.token.str, grammar);
switch (parser->stack[parser->top].state) {
case 8:
parser->stack[++parser->top].state = 16;
@@ -778,15 +815,15 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
case 21:
parser->stack[++parser->top].state = 24;
break;
- case 31:
- parser->stack[++parser->top].state = 32;
+ case 32:
+ parser->stack[++parser->top].state = 33;
break;
}
break;
case ')':
parser->top -= 1;
- parser->stack[parser->top].value.symbol_varname = parse_reduce_20(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_varname = parse_reduce_21(parser->stack[parser->top + 0].value.token.str, grammar);
switch (parser->stack[parser->top].state) {
case 8:
parser->stack[++parser->top].state = 16;
@@ -794,8 +831,8 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
case 21:
parser->stack[++parser->top].state = 24;
break;
- case 31:
- parser->stack[++parser->top].state = 32;
+ case 32:
+ parser->stack[++parser->top].state = 33;
break;
}
break;
@@ -809,7 +846,7 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
switch (token) {
case 0:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_varname = parse_reduce_18(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_varname = parse_reduce_19(parser->stack[parser->top + 0].value.token.str, grammar);
switch (parser->stack[parser->top].state) {
case 8:
parser->stack[++parser->top].state = 16;
@@ -817,15 +854,15 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
case 21:
parser->stack[++parser->top].state = 24;
break;
- case 31:
- parser->stack[++parser->top].state = 32;
+ case 32:
+ parser->stack[++parser->top].state = 33;
break;
}
break;
case TOK_EXTRA_ARG:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_varname = parse_reduce_18(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_varname = parse_reduce_19(parser->stack[parser->top + 0].value.token.str, grammar);
switch (parser->stack[parser->top].state) {
case 8:
parser->stack[++parser->top].state = 16;
@@ -833,15 +870,15 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
case 21:
parser->stack[++parser->top].state = 24;
break;
- case 31:
- parser->stack[++parser->top].state = 32;
+ case 32:
+ parser->stack[++parser->top].state = 33;
break;
}
break;
case TOK_HEADER:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_varname = parse_reduce_18(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_varname = parse_reduce_19(parser->stack[parser->top + 0].value.token.str, grammar);
switch (parser->stack[parser->top].state) {
case 8:
parser->stack[++parser->top].state = 16;
@@ -849,15 +886,15 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
case 21:
parser->stack[++parser->top].state = 24;
break;
- case 31:
- parser->stack[++parser->top].state = 32;
+ case 32:
+ parser->stack[++parser->top].state = 33;
break;
}
break;
case TOK_SOURCE:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_varname = parse_reduce_18(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_varname = parse_reduce_19(parser->stack[parser->top + 0].value.token.str, grammar);
switch (parser->stack[parser->top].state) {
case 8:
parser->stack[++parser->top].state = 16;
@@ -865,15 +902,15 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
case 21:
parser->stack[++parser->top].state = 24;
break;
- case 31:
- parser->stack[++parser->top].state = 32;
+ case 32:
+ parser->stack[++parser->top].state = 33;
break;
}
break;
case TOK_SYMBOL_LC:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_varname = parse_reduce_18(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_varname = parse_reduce_19(parser->stack[parser->top + 0].value.token.str, grammar);
switch (parser->stack[parser->top].state) {
case 8:
parser->stack[++parser->top].state = 16;
@@ -881,15 +918,15 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
case 21:
parser->stack[++parser->top].state = 24;
break;
- case 31:
- parser->stack[++parser->top].state = 32;
+ case 32:
+ parser->stack[++parser->top].state = 33;
break;
}
break;
case TOK_TYPE:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_varname = parse_reduce_18(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_varname = parse_reduce_19(parser->stack[parser->top + 0].value.token.str, grammar);
switch (parser->stack[parser->top].state) {
case 8:
parser->stack[++parser->top].state = 16;
@@ -897,15 +934,15 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
case 21:
parser->stack[++parser->top].state = 24;
break;
- case 31:
- parser->stack[++parser->top].state = 32;
+ case 32:
+ parser->stack[++parser->top].state = 33;
break;
}
break;
case ')':
parser->top -= 1;
- parser->stack[parser->top].value.symbol_varname = parse_reduce_18(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_varname = parse_reduce_19(parser->stack[parser->top + 0].value.token.str, grammar);
switch (parser->stack[parser->top].state) {
case 8:
parser->stack[++parser->top].state = 16;
@@ -913,8 +950,8 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
case 21:
parser->stack[++parser->top].state = 24;
break;
- case 31:
- parser->stack[++parser->top].state = 32;
+ case 32:
+ parser->stack[++parser->top].state = 33;
break;
}
break;
@@ -928,7 +965,7 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
switch (token) {
case 0:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_varname = parse_reduce_19(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_varname = parse_reduce_20(parser->stack[parser->top + 0].value.token.str, grammar);
switch (parser->stack[parser->top].state) {
case 8:
parser->stack[++parser->top].state = 16;
@@ -936,15 +973,15 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
case 21:
parser->stack[++parser->top].state = 24;
break;
- case 31:
- parser->stack[++parser->top].state = 32;
+ case 32:
+ parser->stack[++parser->top].state = 33;
break;
}
break;
case TOK_EXTRA_ARG:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_varname = parse_reduce_19(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_varname = parse_reduce_20(parser->stack[parser->top + 0].value.token.str, grammar);
switch (parser->stack[parser->top].state) {
case 8:
parser->stack[++parser->top].state = 16;
@@ -952,15 +989,15 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
case 21:
parser->stack[++parser->top].state = 24;
break;
- case 31:
- parser->stack[++parser->top].state = 32;
+ case 32:
+ parser->stack[++parser->top].state = 33;
break;
}
break;
case TOK_HEADER:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_varname = parse_reduce_19(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_varname = parse_reduce_20(parser->stack[parser->top + 0].value.token.str, grammar);
switch (parser->stack[parser->top].state) {
case 8:
parser->stack[++parser->top].state = 16;
@@ -968,15 +1005,15 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
case 21:
parser->stack[++parser->top].state = 24;
break;
- case 31:
- parser->stack[++parser->top].state = 32;
+ case 32:
+ parser->stack[++parser->top].state = 33;
break;
}
break;
case TOK_SOURCE:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_varname = parse_reduce_19(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_varname = parse_reduce_20(parser->stack[parser->top + 0].value.token.str, grammar);
switch (parser->stack[parser->top].state) {
case 8:
parser->stack[++parser->top].state = 16;
@@ -984,15 +1021,15 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
case 21:
parser->stack[++parser->top].state = 24;
break;
- case 31:
- parser->stack[++parser->top].state = 32;
+ case 32:
+ parser->stack[++parser->top].state = 33;
break;
}
break;
case TOK_SYMBOL_LC:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_varname = parse_reduce_19(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_varname = parse_reduce_20(parser->stack[parser->top + 0].value.token.str, grammar);
switch (parser->stack[parser->top].state) {
case 8:
parser->stack[++parser->top].state = 16;
@@ -1000,15 +1037,15 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
case 21:
parser->stack[++parser->top].state = 24;
break;
- case 31:
- parser->stack[++parser->top].state = 32;
+ case 32:
+ parser->stack[++parser->top].state = 33;
break;
}
break;
case TOK_TYPE:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_varname = parse_reduce_19(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_varname = parse_reduce_20(parser->stack[parser->top + 0].value.token.str, grammar);
switch (parser->stack[parser->top].state) {
case 8:
parser->stack[++parser->top].state = 16;
@@ -1016,15 +1053,15 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
case 21:
parser->stack[++parser->top].state = 24;
break;
- case 31:
- parser->stack[++parser->top].state = 32;
+ case 32:
+ parser->stack[++parser->top].state = 33;
break;
}
break;
case ')':
parser->top -= 1;
- parser->stack[parser->top].value.symbol_varname = parse_reduce_19(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_varname = parse_reduce_20(parser->stack[parser->top + 0].value.token.str, grammar);
switch (parser->stack[parser->top].state) {
case 8:
parser->stack[++parser->top].state = 16;
@@ -1032,8 +1069,8 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
case 21:
parser->stack[++parser->top].state = 24;
break;
- case 31:
- parser->stack[++parser->top].state = 32;
+ case 32:
+ parser->stack[++parser->top].state = 33;
break;
}
break;
@@ -1055,6 +1092,11 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
parser->stack[++parser->top].state = 23;
break;
+ case TOK_STRING:
+ parser->stack[parser->top].value.symbol_rhs = parse_reduce_9(grammar);
+ parser->stack[++parser->top].state = 23;
+ break;
+
case TOK_SYMBOL_LC:
parser->stack[parser->top].value.symbol_rhs = parse_reduce_9(grammar);
parser->stack[++parser->top].state = 23;
@@ -1152,11 +1194,16 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
parser->stack[++parser->top].state = 13;
return 1;
- case TOK_SYMBOL_LC:
+ case TOK_STRING:
parser->stack[parser->top].value.token = *value;
parser->stack[++parser->top].state = 29;
return 1;
+ case TOK_SYMBOL_LC:
+ parser->stack[parser->top].value.token = *value;
+ parser->stack[++parser->top].state = 30;
+ return 1;
+
case TOK_SYMBOL_UC:
parser->stack[parser->top].value.token = *value;
parser->stack[++parser->top].state = 15;
@@ -1164,7 +1211,7 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
case ';':
parser->stack[parser->top].value.token = *value;
- parser->stack[++parser->top].state = 30;
+ parser->stack[++parser->top].state = 31;
return 1;
default:
@@ -1272,6 +1319,12 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
parser->stack[++parser->top].state = 23;
break;
+ case TOK_STRING:
+ parser->top -= 2;
+ parser->stack[parser->top].value.symbol_rhs = parse_reduce_10(parser->stack[parser->top + 0].value.symbol_rhs, parser->stack[parser->top + 1].value.symbol_symbol, grammar);
+ parser->stack[++parser->top].state = 23;
+ break;
+
case TOK_SYMBOL_LC:
parser->top -= 2;
parser->stack[parser->top].value.symbol_rhs = parse_reduce_10(parser->stack[parser->top + 0].value.symbol_rhs, parser->stack[parser->top + 1].value.symbol_symbol, grammar);
@@ -1286,7 +1339,7 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
case '(':
parser->stack[parser->top].value.token = *value;
- parser->stack[++parser->top].state = 31;
+ parser->stack[++parser->top].state = 32;
return 1;
case ';':
@@ -1304,37 +1357,43 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
switch (token) {
case TOK_BLOCK:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_symbol = parse_reduce_14(parser->stack[parser->top + 0].value.symbol_term, grammar);
+ parser->stack[parser->top].value.symbol_symbol = parse_reduce_15(parser->stack[parser->top + 0].value.symbol_term, grammar);
parser->stack[++parser->top].state = 26;
break;
case TOK_CHAR:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_symbol = parse_reduce_14(parser->stack[parser->top + 0].value.symbol_term, grammar);
+ parser->stack[parser->top].value.symbol_symbol = parse_reduce_15(parser->stack[parser->top + 0].value.symbol_term, grammar);
+ parser->stack[++parser->top].state = 26;
+ break;
+
+ case TOK_STRING:
+ parser->top -= 1;
+ parser->stack[parser->top].value.symbol_symbol = parse_reduce_15(parser->stack[parser->top + 0].value.symbol_term, grammar);
parser->stack[++parser->top].state = 26;
break;
case TOK_SYMBOL_LC:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_symbol = parse_reduce_14(parser->stack[parser->top + 0].value.symbol_term, grammar);
+ parser->stack[parser->top].value.symbol_symbol = parse_reduce_15(parser->stack[parser->top + 0].value.symbol_term, grammar);
parser->stack[++parser->top].state = 26;
break;
case TOK_SYMBOL_UC:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_symbol = parse_reduce_14(parser->stack[parser->top + 0].value.symbol_term, grammar);
+ parser->stack[parser->top].value.symbol_symbol = parse_reduce_15(parser->stack[parser->top + 0].value.symbol_term, grammar);
parser->stack[++parser->top].state = 26;
break;
case '(':
parser->top -= 1;
- parser->stack[parser->top].value.symbol_symbol = parse_reduce_14(parser->stack[parser->top + 0].value.symbol_term, grammar);
+ parser->stack[parser->top].value.symbol_symbol = parse_reduce_15(parser->stack[parser->top + 0].value.symbol_term, grammar);
parser->stack[++parser->top].state = 26;
break;
case ';':
parser->top -= 1;
- parser->stack[parser->top].value.symbol_symbol = parse_reduce_14(parser->stack[parser->top + 0].value.symbol_term, grammar);
+ parser->stack[parser->top].value.symbol_symbol = parse_reduce_15(parser->stack[parser->top + 0].value.symbol_term, grammar);
parser->stack[++parser->top].state = 26;
break;
@@ -1347,37 +1406,37 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
switch (token) {
case 0:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_action = parse_reduce_13(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_action = parse_reduce_14(parser->stack[parser->top + 0].value.token.str, grammar);
parser->stack[++parser->top].state = 25;
break;
case TOK_EXTRA_ARG:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_action = parse_reduce_13(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_action = parse_reduce_14(parser->stack[parser->top + 0].value.token.str, grammar);
parser->stack[++parser->top].state = 25;
break;
case TOK_HEADER:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_action = parse_reduce_13(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_action = parse_reduce_14(parser->stack[parser->top + 0].value.token.str, grammar);
parser->stack[++parser->top].state = 25;
break;
case TOK_SOURCE:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_action = parse_reduce_13(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_action = parse_reduce_14(parser->stack[parser->top + 0].value.token.str, grammar);
parser->stack[++parser->top].state = 25;
break;
case TOK_SYMBOL_LC:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_action = parse_reduce_13(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_action = parse_reduce_14(parser->stack[parser->top + 0].value.token.str, grammar);
parser->stack[++parser->top].state = 25;
break;
case TOK_TYPE:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_action = parse_reduce_13(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_action = parse_reduce_14(parser->stack[parser->top + 0].value.token.str, grammar);
parser->stack[++parser->top].state = 25;
break;
@@ -1389,38 +1448,87 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
case 29:
switch (token) {
case TOK_BLOCK:
+ parser->top -= 2;
+ parser->stack[parser->top].value.symbol_rhs = parse_reduce_12(parser->stack[parser->top + 0].value.symbol_rhs, parser->stack[parser->top + 1].value.token.str, grammar);
+ parser->stack[++parser->top].state = 23;
+ break;
+
+ case TOK_CHAR:
+ parser->top -= 2;
+ parser->stack[parser->top].value.symbol_rhs = parse_reduce_12(parser->stack[parser->top + 0].value.symbol_rhs, parser->stack[parser->top + 1].value.token.str, grammar);
+ parser->stack[++parser->top].state = 23;
+ break;
+
+ case TOK_STRING:
+ parser->top -= 2;
+ parser->stack[parser->top].value.symbol_rhs = parse_reduce_12(parser->stack[parser->top + 0].value.symbol_rhs, parser->stack[parser->top + 1].value.token.str, grammar);
+ parser->stack[++parser->top].state = 23;
+ break;
+
+ case TOK_SYMBOL_LC:
+ parser->top -= 2;
+ parser->stack[parser->top].value.symbol_rhs = parse_reduce_12(parser->stack[parser->top + 0].value.symbol_rhs, parser->stack[parser->top + 1].value.token.str, grammar);
+ parser->stack[++parser->top].state = 23;
+ break;
+
+ case TOK_SYMBOL_UC:
+ parser->top -= 2;
+ parser->stack[parser->top].value.symbol_rhs = parse_reduce_12(parser->stack[parser->top + 0].value.symbol_rhs, parser->stack[parser->top + 1].value.token.str, grammar);
+ parser->stack[++parser->top].state = 23;
+ break;
+
+ case ';':
+ parser->top -= 2;
+ parser->stack[parser->top].value.symbol_rhs = parse_reduce_12(parser->stack[parser->top + 0].value.symbol_rhs, parser->stack[parser->top + 1].value.token.str, grammar);
+ parser->stack[++parser->top].state = 23;
+ break;
+
+ default:
+ return -1;
+ }
+ break;
+
+ case 30:
+ switch (token) {
+ case TOK_BLOCK:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_symbol = parse_reduce_15(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_symbol = parse_reduce_16(parser->stack[parser->top + 0].value.token.str, grammar);
parser->stack[++parser->top].state = 26;
break;
case TOK_CHAR:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_symbol = parse_reduce_15(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_symbol = parse_reduce_16(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[++parser->top].state = 26;
+ break;
+
+ case TOK_STRING:
+ parser->top -= 1;
+ parser->stack[parser->top].value.symbol_symbol = parse_reduce_16(parser->stack[parser->top + 0].value.token.str, grammar);
parser->stack[++parser->top].state = 26;
break;
case TOK_SYMBOL_LC:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_symbol = parse_reduce_15(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_symbol = parse_reduce_16(parser->stack[parser->top + 0].value.token.str, grammar);
parser->stack[++parser->top].state = 26;
break;
case TOK_SYMBOL_UC:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_symbol = parse_reduce_15(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_symbol = parse_reduce_16(parser->stack[parser->top + 0].value.token.str, grammar);
parser->stack[++parser->top].state = 26;
break;
case '(':
parser->top -= 1;
- parser->stack[parser->top].value.symbol_symbol = parse_reduce_15(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_symbol = parse_reduce_16(parser->stack[parser->top + 0].value.token.str, grammar);
parser->stack[++parser->top].state = 26;
break;
case ';':
parser->top -= 1;
- parser->stack[parser->top].value.symbol_symbol = parse_reduce_15(parser->stack[parser->top + 0].value.token.str, grammar);
+ parser->stack[parser->top].value.symbol_symbol = parse_reduce_16(parser->stack[parser->top + 0].value.token.str, grammar);
parser->stack[++parser->top].state = 26;
break;
@@ -1429,41 +1537,41 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
}
break;
- case 30:
+ case 31:
switch (token) {
case 0:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_action = parse_reduce_12(grammar);
+ parser->stack[parser->top].value.symbol_action = parse_reduce_13(grammar);
parser->stack[++parser->top].state = 25;
break;
case TOK_EXTRA_ARG:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_action = parse_reduce_12(grammar);
+ parser->stack[parser->top].value.symbol_action = parse_reduce_13(grammar);
parser->stack[++parser->top].state = 25;
break;
case TOK_HEADER:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_action = parse_reduce_12(grammar);
+ parser->stack[parser->top].value.symbol_action = parse_reduce_13(grammar);
parser->stack[++parser->top].state = 25;
break;
case TOK_SOURCE:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_action = parse_reduce_12(grammar);
+ parser->stack[parser->top].value.symbol_action = parse_reduce_13(grammar);
parser->stack[++parser->top].state = 25;
break;
case TOK_SYMBOL_LC:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_action = parse_reduce_12(grammar);
+ parser->stack[parser->top].value.symbol_action = parse_reduce_13(grammar);
parser->stack[++parser->top].state = 25;
break;
case TOK_TYPE:
parser->top -= 1;
- parser->stack[parser->top].value.symbol_action = parse_reduce_12(grammar);
+ parser->stack[parser->top].value.symbol_action = parse_reduce_13(grammar);
parser->stack[++parser->top].state = 25;
break;
@@ -1472,7 +1580,7 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
}
break;
- case 31:
+ case 32:
switch (token) {
case TOK_SYMBOL:
parser->stack[parser->top].value.token = *value;
@@ -1494,11 +1602,11 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
}
break;
- case 32:
+ case 33:
switch (token) {
case ')':
parser->stack[parser->top].value.token = *value;
- parser->stack[++parser->top].state = 33;
+ parser->stack[++parser->top].state = 34;
return 1;
default:
@@ -1506,7 +1614,7 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
}
break;
- case 33:
+ case 34:
switch (token) {
case TOK_BLOCK:
parser->top -= 5;
@@ -1520,6 +1628,12 @@ int parse_push(parse_context_t *parser, int token, const parse_token_value_t *va
parser->stack[++parser->top].state = 23;
break;
+ case TOK_STRING:
+ parser->top -= 5;
+ parser->stack[parser->top].value.symbol_rhs = parse_reduce_11(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);
+ parser->stack[++parser->top].state = 23;
+ break;
+
case TOK_SYMBOL_LC:
parser->top -= 5;
parser->stack[parser->top].value.symbol_rhs = parse_reduce_11(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);