Skip to content

Commit

Permalink
足し算・引き算式のパース
Browse files Browse the repository at this point in the history
  • Loading branch information
yhirose committed Mar 30, 2017
1 parent fd96e64 commit 2a32c11
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.cpp
Expand Up @@ -5,7 +5,9 @@ using namespace std;
typedef shared_ptr<peg::Ast> AST;

const auto grammar = R"(
NUMBER <- '-'? [0-9]+ ('.' [0-9]+)?
ADDITIVE <- NUMBER (ADDITIVE_OPERATOR NUMBER)*
ADDITIVE_OPERATOR <- [-+]
NUMBER <- '-'? [0-9]+ ('.' [0-9]+)?
)";

int main() {
Expand Down

0 comments on commit 2a32c11

Please sign in to comment.