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

using namespace std;
using namespace uCalcSoftware;

#define tf(IsTrue) ((IsTrue) ? "True" : "False")

int main() {
   uCalc uc;
   uCalc::Transformer t;
   auto grandParentRule = t.Pattern("grandparent");

   // Create a child
   auto parentTransformer = grandParentRule.LocalTransformer();
   auto parentRule = parentTransformer.Pattern("parent");

   // Create a grandchild
   auto childTransformer = parentRule.LocalTransformer();
   auto childRule = childTransformer.Pattern("child");

   cout << "Grandparent is child: " << tf(grandParentRule.IsChildRule()) << endl;
   cout << "Parent is child: " << tf(parentRule.IsChildRule()) << endl;
   cout << "Child (grandchild) is child: " << tf(childRule.IsChildRule()) << endl;
}