Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() Dim t As New uCalc.Transformer() '// Turn single-line comments into whitespace tokens (to be ignored) t.Tokens.Add("//.*", TokenType.Whitespace) '// Define a rule to replace the alphanumeric token 'x' with 'value' t.FromTo("x", "value") Dim code = "x = 10; print('The max value is x.'); // x is 10 here" '// The Transformer correctly identifies that only the first 'x' is '// a token on its own. Imbedded occurrences of 'x' are left alone. Console.WriteLine(t.Transform(code)) End Sub End Module