#include #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; auto t = uc.NewTransformer(); t.DefaultRuleSet().RewindOnChange(true); t.FromTo("AddUp({x})", "{x}"); t.FromTo("AddUp({x}, {y})", "({x} + AddUp({y}))"); cout << t.TraceTransform("AddUp(1, 2, 3, 4)", "", "$'Step {Index}: {x}\n'") << endl; // 0 is the default IndexBase. Now we use 1 instead. // So it will now start with "Step: 1" instead of "Step: 0" cout << "--- Now with IndexBase = 1 ---" << endl; cout << t.TraceTransform("AddUp(1, 2, 3, 4)", "", "$'Step {Index} of {Count}: {x}\n'").IndexBase(1) << endl; }