#include #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; // 1. Define the account balance variable uc.DefineVariable("balance = 100.0"); // 2. Get the expression transformer and define a single rule auto t = uc.ExpressionTransformer(); t.FromTo("DEPOSIT {@Number:amount}", "balance = balance + {amount}"); // 3. Process a single-line script. // This gets transformed to "balance = balance + 500" and executed. uc.EvalStr("DEPOSIT 500"); // 4. Print the final balance cout << "Final Balance: " << uc.EvalStr("balance") << endl; }