#include #include "uCalc.h" using namespace std; using namespace uCalcSoftware; #define tf(IsTrue) ((IsTrue) ? "True" : "False") int main() { uCalc uc; uCalc::Transformer t; t.Text("This is a test."); // Rule 1 (defined first, lower priority) auto rule1 = t.FromTo("is", "[IS_1]"); // Rule 2 (defined second, higher priority) auto rule2 = t.FromTo("is", "[IS_2]"); cout << "--- Applying transform (Rule 2 has precedence) ---" << endl; cout << t.Transform() << endl; cout << "" << endl; cout << "--- Using NextOverload ---" << endl; // Get the rule that comes after rule2 auto nextRule = rule2.NextOverload(); cout << "Rule 2 pattern: " << rule2.Pattern() << endl; cout << "Next rule's pattern: " << nextRule.Pattern() << endl; // Verify that the next rule is indeed rule1 cout << "Next rule is rule1: " << tf(nextRule.Handle() == rule1.Handle()) << endl; }