Grouping alternatives to limit scope.

ID: 242

				
					using uCalcSoftware;

var uc = new uCalc();
var t = uc.NewTransformer();
// Matches "File Open" or "File Close".
// Capture needs explicit naming.
t.FromTo("File {cmd: Open | Close }", "Command: {cmd}");

Console.WriteLine(t.Transform("File Open"));
Console.WriteLine(t.Transform("File Close"));
				
			
Command: Open
Command: Close
				
					#include <iostream>
#include "uCalc.h"

using namespace std;
using namespace uCalcSoftware;

int main() {
   uCalc uc;
   auto t = uc.NewTransformer();
   // Matches "File Open" or "File Close".
   // Capture needs explicit naming.
   t.FromTo("File {cmd: Open | Close }", "Command: {cmd}");

   cout << t.Transform("File Open") << endl;
   cout << t.Transform("File Close") << endl;
}
				
			
Command: Open
Command: Close
				
					Imports System
Imports uCalcSoftware
Public Module Program
   Public Sub Main()
      Dim uc As New uCalc()
      Dim t = uc.NewTransformer()
      '// Matches "File Open" or "File Close". 
      '// Capture needs explicit naming.
      t.FromTo("File {cmd: Open | Close }", "Command: {cmd}")
      
      Console.WriteLine(t.Transform("File Open"))
      Console.WriteLine(t.Transform("File Close"))
   End Sub
End Module
				
			
Command: Open
Command: Close