#include <iostream>
#include "uCalc.h"

using namespace std;
using namespace uCalcSoftware;

int main() {
   uCalc uc;
   auto t = uc.NewTransformer();
   t.Text("Config { setting = 123; }");

   // 1. Define the parent rule to capture the content inside the braces.
   auto parentRule = t.Pattern("Config '{' {body} '}'").SetStatementSensitive(false);

   // 2. Get the local transformer for the parent rule.
   auto local_t = parentRule.LocalTransformer();

   // 3. Define a rule that operates ONLY on the text captured by '{body}'.
   local_t.FromTo("setting = {val}", "Found Value: {val}");

   // 4. Perform the transformation.
   // The local rule will run on the text " setting = 123; ".
   t.Transform();

   cout << t.Text() << endl;
}