#include <iostream>
#include <cmath>
#include <buffalo/buffalo.h>
Go to the source code of this file.
◆ main()
int main |
( |
int |
argc, |
|
|
char const ** |
argv |
|
) |
| |
◆ OP_MUL()
◆ expression
Initial value:
bf::DefineNonTerminal< G > expression
bf::DefineTerminal< G, R"(\*)"> OP_MUL(bf::Left)
bf::DefineTerminal< G, R"(\()"> PAR_OPEN;bf::DefineTerminal< G, R"(\))"> PAR_CLOSE
bf::DefineTerminal< G, R"(\+)"> OP_ADD(bf::Left)
bf::DefineTerminal< G, R"(\^)"> OP_EXP(bf::Right)
bf::DefineTerminal< G, R"(\d+(\.\d+)?)", double > NUMBER([](auto const &tok) { return std::stod(std::string(tok.raw));})
bf::DefineTerminal< G, R"(\/)"> OP_DIV(bf::Left)
bf::DefineTerminal< G, R"(\-)"> OP_SUB(bf::Left)
Definition at line 30 of file calculator.cpp.
◆ NUMBER
bf::DefineTerminal< G, R"(\d+(\.\d+)?)", double > NUMBER([](auto const &tok) { return std::stod(std::string(tok.raw));}) |
( |
[] (auto const &tok) { return std::stod(std::string(tok.raw));} |
| ) |
|
◆ OP_ADD
◆ OP_DIV
◆ OP_EXP
◆ OP_SUB
◆ PAR_CLOSE
◆ statement