uCalc API Version: 5.7.0-preview.1 Released: 7/30/2026
Warning
uCalc API Preview Release Notice:This preview documentation describes the intended behavior of the API. It is not fully accurate or complete.The current preview build contains incomplete features, unoptimized performance, and is subject to breaking changes.Use of the preview version in your production code is not recommended.
Description: The syntax used to trigger engine-level logic dynamically at the moment a pattern match occurs, allowing the directive to use data captured during the match.
The @@ prefix is a modifier that shifts the execution of a directive from Rule Creation Time to Match Time. While a single-@ directive (like {@File}) is resolved once when the rule is defined, a double-@@ directive is resolved every single time the pattern finds a match in the source text.
Match-time directives are the key to building "intelligent" transformers. Because they execute during the transformation process, they have access to the local variables captured by the pattern match.
{@@Eval:expr}: Evaluates an expression using captured data.{@@File:var}: Loads a file whose name is determined by a captured variable.{@@Define:var}: Dynamically sets a variable or function in the evaluator space based on the match.{@@Exec:code}: Runs a procedure during the match without returning text.When using variables captured in a pattern (e.g., {@Number:n}) within a {@@...} directive, do not use curly braces. The variable is already resident in the evaluator space for the duration of that specific match.
{@@Eval:n * 10}{@@Eval:{n} * 10}ID: 201
using uCalcSoftware;
var uc = new uCalc();
var t = uc.NewTransformer();
t.FromTo("'['{word}']'", "{@Eval: UCase(word)}");
t.FromTo("'{'{expr}'}'", "{@@Eval: expr}");
Console.WriteLine(t.Transform("Words like [this] and [that]."));
Console.WriteLine(t.Transform("Is {5*3} bigger than {5^3}?"));
Words like THIS and THAT.
Is 15 bigger than 125? using uCalcSoftware; var uc = new uCalc(); var t = uc.NewTransformer(); t.FromTo("'['{word}']'", "{@Eval: UCase(word)}"); t.FromTo("'{'{expr}'}'", "{@@Eval: expr}"); Console.WriteLine(t.Transform("Words like [this] and [that].")); Console.WriteLine(t.Transform("Is {5*3} bigger than {5^3}?"));
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
int main() {
uCalc uc;
auto t = uc.NewTransformer();
t.FromTo("'['{word}']'", "{@Eval: UCase(word)}");
t.FromTo("'{'{expr}'}'", "{@@Eval: expr}");
cout << t.Transform("Words like [this] and [that].") << endl;
cout << t.Transform("Is {5*3} bigger than {5^3}?") << endl;
}
Words like THIS and THAT.
Is 15 bigger than 125? #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; auto t = uc.NewTransformer(); t.FromTo("'['{word}']'", "{@Eval: UCase(word)}"); t.FromTo("'{'{expr}'}'", "{@@Eval: expr}"); cout << t.Transform("Words like [this] and [that].") << endl; cout << t.Transform("Is {5*3} bigger than {5^3}?") << endl; }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
Dim t = uc.NewTransformer()
t.FromTo("'['{word}']'", "{@Eval: UCase(word)}")
t.FromTo("'{'{expr}'}'", "{@@Eval: expr}")
Console.WriteLine(t.Transform("Words like [this] and [that]."))
Console.WriteLine(t.Transform("Is {5*3} bigger than {5^3}?"))
End Sub
End Module
Words like THIS and THAT.
Is 15 bigger than 125? Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() Dim t = uc.NewTransformer() t.FromTo("'['{word}']'", "{@Eval: UCase(word)}") t.FromTo("'{'{expr}'}'", "{@@Eval: expr}") Console.WriteLine(t.Transform("Words like [this] and [that].")) Console.WriteLine(t.Transform("Is {5*3} bigger than {5^3}?")) End Sub End Module
ID: 1359
using uCalcSoftware;
var uc = new uCalc();
// Define the data context for our template
uc.DefineVariable("user = 'Alice'");
uc.DefineVariable("score = 95");
// Define the template with placeholders
var myTemplate = "User: {user}, Score: {score * 10}, Status: {IIf(score > 90, 'Excellent', 'Good')}";
var t = uc.NewTransformer();
// This single rule finds placeholders like {...}
// and uses the Expression Parser ({@@Eval}) to evaluate the content inside.
t.FromTo("'{' {expr} '}'", "{@@Eval: expr}");
Console.WriteLine(t.Transform(myTemplate));
User: Alice, Score: 950, Status: Excellent using uCalcSoftware; var uc = new uCalc(); // Define the data context for our template uc.DefineVariable("user = 'Alice'"); uc.DefineVariable("score = 95"); // Define the template with placeholders var myTemplate = "User: {user}, Score: {score * 10}, Status: {IIf(score > 90, 'Excellent', 'Good')}"; var t = uc.NewTransformer(); // This single rule finds placeholders like {...} // and uses the Expression Parser ({@@Eval}) to evaluate the content inside. t.FromTo("'{' {expr} '}'", "{@@Eval: expr}"); Console.WriteLine(t.Transform(myTemplate));
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
int main() {
uCalc uc;
// Define the data context for our template
uc.DefineVariable("user = 'Alice'");
uc.DefineVariable("score = 95");
// Define the template with placeholders
auto myTemplate = "User: {user}, Score: {score * 10}, Status: {IIf(score > 90, 'Excellent', 'Good')}";
auto t = uc.NewTransformer();
// This single rule finds placeholders like {...}
// and uses the Expression Parser ({@@Eval}) to evaluate the content inside.
t.FromTo("'{' {expr} '}'", "{@@Eval: expr}");
cout << t.Transform(myTemplate) << endl;
}
User: Alice, Score: 950, Status: Excellent #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; // Define the data context for our template uc.DefineVariable("user = 'Alice'"); uc.DefineVariable("score = 95"); // Define the template with placeholders auto myTemplate = "User: {user}, Score: {score * 10}, Status: {IIf(score > 90, 'Excellent', 'Good')}"; auto t = uc.NewTransformer(); // This single rule finds placeholders like {...} // and uses the Expression Parser ({@@Eval}) to evaluate the content inside. t.FromTo("'{' {expr} '}'", "{@@Eval: expr}"); cout << t.Transform(myTemplate) << endl; }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
'// Define the data context for our template
uc.DefineVariable("user = 'Alice'")
uc.DefineVariable("score = 95")
'// Define the template with placeholders
Dim myTemplate = "User: {user}, Score: {score * 10}, Status: {IIf(score > 90, 'Excellent', 'Good')}"
Dim t = uc.NewTransformer()
'// This single rule finds placeholders like {...}
'// and uses the Expression Parser ({@@Eval}) to evaluate the content inside.
t.FromTo("'{' {expr} '}'", "{@@Eval: expr}")
Console.WriteLine(t.Transform(myTemplate))
End Sub
End Module
User: Alice, Score: 950, Status: Excellent Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() '// Define the data context for our template uc.DefineVariable("user = 'Alice'") uc.DefineVariable("score = 95") '// Define the template with placeholders Dim myTemplate = "User: {user}, Score: {score * 10}, Status: {IIf(score > 90, 'Excellent', 'Good')}" Dim t = uc.NewTransformer() '// This single rule finds placeholders like {...} '// and uses the Expression Parser ({@@Eval}) to evaluate the content inside. t.FromTo("'{' {expr} '}'", "{@@Eval: expr}") Console.WriteLine(t.Transform(myTemplate)) End Sub End Module