diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2015-04-11 03:02:29 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2015-04-11 03:02:29 +0200 |
commit | d91b60407ce812de60f0700ffc15712cb9a05d15 (patch) | |
tree | 107944cfcb4259cebeb2e9934fdd1caf9ded192e /src/parse.y | |
parent | 42f74c83bf53d60d25408e6afb8aa92ca23e0a16 (diff) | |
download | solar-d91b60407ce812de60f0700ffc15712cb9a05d15.tar solar-d91b60407ce812de60f0700ffc15712cb9a05d15.zip |
parse: introduce rhs_t typedef
Diffstat (limited to 'src/parse.y')
-rw-r--r-- | src/parse.y | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/parse.y b/src/parse.y index dba747e..274e374 100644 --- a/src/parse.y +++ b/src/parse.y @@ -3,6 +3,9 @@ } %source { +typedef std::pair<std::vector<solar::symbol_t>, std::vector<std::string>> rhs_t; + + static inline void free_string(std::string *v) { delete v; } @@ -41,7 +44,7 @@ static inline void free_rule(solar::rule_t *v) { %type rule {solar::rule_t *} %destructor rule free_rule -%type rhs {std::pair<std::vector<solar::symbol_t>, std::vector<std::string>> *} +%type rhs {rhs_t *} %type action {std::string *} %destructor action free_string @@ -105,7 +108,7 @@ rule |= SYMBOL_LC(lhs) "|=" rhs(rhs) action(action) { } -rhs |= [new std::pair<std::vector<solar::symbol_t>, std::vector<std::string>>()] +rhs |= [new rhs_t()] rhs |= rhs(rhs) symbol(sym) { rhs->first.push_back(*sym); |