Removed 'typedef Definition rule'.

This commit is contained in:
yhirose 2015-06-05 08:54:02 -04:00
parent ab3d8b0d0e
commit 682417b410
3 changed files with 7 additions and 9 deletions

View File

@ -44,7 +44,7 @@ int main(int argc, const char** argv)
return result; return result;
}; };
rule EXPRESSION, TERM, FACTOR, TERM_OPERATOR, FACTOR_OPERATOR, NUMBER; Definition EXPRESSION, TERM, FACTOR, TERM_OPERATOR, FACTOR_OPERATOR, NUMBER;
EXPRESSION <= seq(TERM, zom(seq(TERM_OPERATOR, TERM))), reduce; EXPRESSION <= seq(TERM, zom(seq(TERM_OPERATOR, TERM))), reduce;
TERM <= seq(FACTOR, zom(seq(FACTOR_OPERATOR, FACTOR))), reduce; TERM <= seq(FACTOR, zom(seq(FACTOR_OPERATOR, FACTOR))), reduce;

View File

@ -1221,8 +1221,6 @@ private:
std::shared_ptr<Holder> holder_; std::shared_ptr<Holder> holder_;
}; };
typedef Definition rule;
/* /*
* Implementations * Implementations
*/ */

View File

@ -70,7 +70,7 @@ TEST_CASE("String capture test2", "[general]")
{ {
vector<string> tags; vector<string> tags;
rule ROOT, TAG, TAG_NAME, WS; Definition ROOT, TAG, TAG_NAME, WS;
ROOT <= seq(WS, zom(TAG)); ROOT <= seq(WS, zom(TAG));
TAG <= seq(chr('['), TAG_NAME, chr(']'), WS); TAG <= seq(chr('['), TAG_NAME, chr(']'), WS);
TAG_NAME <= oom(seq(npd(chr(']')), dot())), [&](const char* s, size_t n) { tags.push_back(string(s, n)); }; TAG_NAME <= oom(seq(npd(chr(']')), dot())), [&](const char* s, size_t n) { tags.push_back(string(s, n)); };
@ -131,7 +131,7 @@ TEST_CASE("Named capture test", "[general]")
TEST_CASE("String capture test with embedded match action", "[general]") TEST_CASE("String capture test with embedded match action", "[general]")
{ {
rule ROOT, TAG, TAG_NAME, WS; Definition ROOT, TAG, TAG_NAME, WS;
vector<string> tags; vector<string> tags;
@ -156,8 +156,8 @@ TEST_CASE("String capture test with embedded match action", "[general]")
TEST_CASE("Cyclic grammer test", "[general]") TEST_CASE("Cyclic grammer test", "[general]")
{ {
rule PARENT; Definition PARENT;
rule CHILD; Definition CHILD;
PARENT <= seq(CHILD); PARENT <= seq(CHILD);
CHILD <= seq(PARENT); CHILD <= seq(PARENT);
@ -165,7 +165,7 @@ TEST_CASE("Cyclic grammer test", "[general]")
TEST_CASE("Visit test", "[general]") TEST_CASE("Visit test", "[general]")
{ {
rule ROOT, TAG, TAG_NAME, WS; Definition ROOT, TAG, TAG_NAME, WS;
ROOT <= seq(WS, zom(TAG)); ROOT <= seq(WS, zom(TAG));
TAG <= seq(chr('['), TAG_NAME, chr(']'), WS); TAG <= seq(chr('['), TAG_NAME, chr(']'), WS);
@ -296,7 +296,7 @@ TEST_CASE("Simple calculator test", "[general]")
TEST_CASE("Calculator test", "[general]") TEST_CASE("Calculator test", "[general]")
{ {
// Construct grammer // Construct grammer
rule EXPRESSION, TERM, FACTOR, TERM_OPERATOR, FACTOR_OPERATOR, NUMBER; Definition EXPRESSION, TERM, FACTOR, TERM_OPERATOR, FACTOR_OPERATOR, NUMBER;
EXPRESSION <= seq(TERM, zom(seq(TERM_OPERATOR, TERM))); EXPRESSION <= seq(TERM, zom(seq(TERM_OPERATOR, TERM)));
TERM <= seq(FACTOR, zom(seq(FACTOR_OPERATOR, FACTOR))); TERM <= seq(FACTOR, zom(seq(FACTOR_OPERATOR, FACTOR)));