diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2015-04-17 20:48:06 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2015-04-17 21:15:44 +0200 |
commit | 9624984557151e405d62f134e12270475d7ca7e7 (patch) | |
tree | 5a5204af65ba7f651798c6103cb67723a6dad512 /src/parse.y | |
parent | dd5fa160c23b206ed52d42a63e5edcc08fee6e48 (diff) | |
download | solar-9624984557151e405d62f134e12270475d7ca7e7.tar solar-9624984557151e405d62f134e12270475d7ca7e7.zip |
lex: change treatment of symbols which are neither all-uppercase or all-lowercase
Diffstat (limited to 'src/parse.y')
-rw-r--r-- | src/parse.y | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/parse.y b/src/parse.y index f0ff040..56fc567 100644 --- a/src/parse.y +++ b/src/parse.y @@ -31,9 +31,6 @@ static inline void free_rhs(rhs_t *v) { %type SYMBOL_UC {std::string *} str %destructor SYMBOL_UC free_string -%type SYMBOL_LC {std::string *} str -%destructor SYMBOL_LC free_string - %type BLOCK {std::string *} str %destructor BLOCK free_string @@ -72,7 +69,7 @@ grammar |=; grammar |= grammar directive; -directive |= "%type" SYMBOL_LC(nonterm) BLOCK(type) { +directive |= "%type" SYMBOL(nonterm) BLOCK(type) { grammar->nonterm_types.insert(std::make_pair(*nonterm, *type)); } @@ -107,7 +104,7 @@ directive |= rule(rule) { } -rule |= SYMBOL_LC(lhs) "|=" rhs(rhs) action(action) +rule |= SYMBOL(lhs) "|=" rhs(rhs) action(action) [new solar::rule_t {solar::item_t(*lhs, rhs->first), rhs->second, *action}] @@ -149,12 +146,11 @@ action |= BLOCK(=v) [v] action |= SQBLOCK(v) [new std::string("return " + *v + ";")] -symbol |= SYMBOL_LC(v) [new solar::symbol_t(solar::symbol_t::make_nonterm(*v))] +symbol |= SYMBOL(v) [new solar::symbol_t(solar::symbol_t::make_nonterm(*v))] symbol |= term(=v) [v] term |= SYMBOL_UC(v) [new solar::symbol_t(solar::symbol_t::make_term(*v))] term |= CHAR(v) [new solar::symbol_t(solar::symbol_t::make_char(v))] -varname |= SYMBOL_LC(=v) [v] varname |= SYMBOL_UC(=v) [v] varname |= SYMBOL(=v) [v] |