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

using namespace std;
using namespace uCalcSoftware;

int main() {
   uCalc uc;
   // Note how the definition order matters if patterns overlap (though here they are distinct).
   auto t = uc.NewTransformer();

   // Define patterns for a simple math language
   t.FromTo("{d: {@Number}}", "[NUM:{d}]");
   t.FromTo("{op: + | - | * | / }", "[OP:{op}]");
   t.FromTo("print", "[CMD:PRINT]"); // Specific keyword

   auto code = "print 10 + 20";
   cout << t.Transform(code) << endl;
}