Matching tokens by category.

ID: 245

See: Tokens
				
					using uCalcSoftware;

var uc = new uCalc();
var t = uc.NewTransformer();
// Match a word (Alpha) followed by equals and a Number (Literal)
t.FromTo("{@Alpha} = {@Number}", "Assignment Detected");

Console.WriteLine(t.Transform("x = 10")); 
				
			
Assignment Detected
				
					#include <iostream>
#include "uCalc.h"

using namespace std;
using namespace uCalcSoftware;

int main() {
   uCalc uc;
   auto t = uc.NewTransformer();
   // Match a word (Alpha) followed by equals and a Number (Literal)
   t.FromTo("{@Alpha} = {@Number}", "Assignment Detected");

   cout << t.Transform("x = 10") << endl;
}
				
			
Assignment Detected
				
					Imports System
Imports uCalcSoftware
Public Module Program
   Public Sub Main()
      Dim uc As New uCalc()
      Dim t = uc.NewTransformer()
      '// Match a word (Alpha) followed by equals and a Number (Literal)
      t.FromTo("{@Alpha} = {@Number}", "Assignment Detected")
      
      Console.WriteLine(t.Transform("x = 10"))
   End Sub
End Module
				
			
Assignment Detected