#include #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; // Define the data context for our template uc.DefineVariable("user = 'Alice'"); uc.DefineVariable("score = 95"); // Define the template with placeholders auto myTemplate = "User: {user}, Score: {score * 10}, Status: {IIf(score > 90, 'Excellent', 'Good')}"; auto t = uc.NewTransformer(); // This single rule finds placeholders like {...} // and uses the Expression Parser ({@@Eval}) to evaluate the content inside. t.FromTo("'{' {expr} '}'", "{@@Eval: expr}"); cout << t.Transform(myTemplate) << endl; }