Include names of in-progress rules in shift/reduce conflicts
This commit is contained in:
parent
ec31249fe6
commit
5dc08ccce9
14 changed files with 426 additions and 295 deletions
|
|
@ -22,42 +22,40 @@ using std::to_string;
|
|||
using std::vector;
|
||||
using util::escape_char;
|
||||
|
||||
static const map<char, string> REPLACEMENTS({
|
||||
{ '~', "TILDE" },
|
||||
{ '`', "BQUOTE" },
|
||||
{ '!', "BANG" },
|
||||
{ '@', "AT" },
|
||||
{ '#', "POUND" },
|
||||
{ '$', "DOLLAR" },
|
||||
{ '%', "PERCENT" },
|
||||
{ '^', "CARET" },
|
||||
{ '&', "AMP" },
|
||||
{ '*', "STAR" },
|
||||
{ '(', "LPAREN" },
|
||||
{ ')', "RPAREN" },
|
||||
{ '-', "DASH" },
|
||||
{ '+', "PLUS" },
|
||||
{ '=', "EQ" },
|
||||
{ '{', "LBRACE" },
|
||||
{ '}', "RBRACE" },
|
||||
{ '[', "LBRACK" },
|
||||
{ ']', "RBRACK" },
|
||||
{ '\\', "BSLASH" },
|
||||
{ '|', "PIPE" },
|
||||
{ ':', "COLON" },
|
||||
{ ';', "SEMI" },
|
||||
{ '"', "DQUOTE" },
|
||||
{ '\'', "SQUOTE" },
|
||||
{ '<', "LT" },
|
||||
{ '>', "GT" },
|
||||
{ ',', "COMMA" },
|
||||
{ '.', "DOT" },
|
||||
{ '?', "QMARK" },
|
||||
{ '/', "SLASH" },
|
||||
{ '\n', "LB" },
|
||||
{ '\r', "CR" },
|
||||
{ '\t', "TAB" },
|
||||
});
|
||||
static const map<char, string> REPLACEMENTS({ { '~', "TILDE" },
|
||||
{ '`', "BQUOTE" },
|
||||
{ '!', "BANG" },
|
||||
{ '@', "AT" },
|
||||
{ '#', "POUND" },
|
||||
{ '$', "DOLLAR" },
|
||||
{ '%', "PERCENT" },
|
||||
{ '^', "CARET" },
|
||||
{ '&', "AMP" },
|
||||
{ '*', "STAR" },
|
||||
{ '(', "LPAREN" },
|
||||
{ ')', "RPAREN" },
|
||||
{ '-', "DASH" },
|
||||
{ '+', "PLUS" },
|
||||
{ '=', "EQ" },
|
||||
{ '{', "LBRACE" },
|
||||
{ '}', "RBRACE" },
|
||||
{ '[', "LBRACK" },
|
||||
{ ']', "RBRACK" },
|
||||
{ '\\', "BSLASH" },
|
||||
{ '|', "PIPE" },
|
||||
{ ':', "COLON" },
|
||||
{ ';', "SEMI" },
|
||||
{ '"', "DQUOTE" },
|
||||
{ '\'', "SQUOTE" },
|
||||
{ '<', "LT" },
|
||||
{ '>', "GT" },
|
||||
{ ',', "COMMA" },
|
||||
{ '.', "DOT" },
|
||||
{ '?', "QMARK" },
|
||||
{ '/', "SLASH" },
|
||||
{ '\n', "LB" },
|
||||
{ '\r', "CR" },
|
||||
{ '\t', "TAB" }, });
|
||||
|
||||
class CCodeGenerator {
|
||||
string buffer;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue