From d91b60407ce812de60f0700ffc15712cb9a05d15 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 11 Apr 2015 03:02:29 +0200 Subject: parse: introduce rhs_t typedef --- src/parse.y | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/parse.y') 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> 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> *} +%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>()] +rhs |= [new rhs_t()] rhs |= rhs(rhs) symbol(sym) { rhs->first.push_back(*sym); -- cgit v1.2.3