#include #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; { uCalc::Transformer t; t.Owned(); // Causes t to be released when it goes out of scope // Define a rule to replace the alphanumeric token 'x' with 'value' t.FromTo("x", "value"); auto code = R"(x = 10; print("The max value is x.");)"; // The Transformer correctly identifies that the first 'x' is a variable token // and the second 'x' is part of a string literal token. // The replacement is only applied to the variable. cout << t.Transform(code) << endl; }; }