OutWit.Engine.Parser 1.0.1

dotnet add package OutWit.Engine.Parser --version 1.0.1
                    
NuGet\Install-Package OutWit.Engine.Parser -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OutWit.Engine.Parser" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OutWit.Engine.Parser" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="OutWit.Engine.Parser" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add OutWit.Engine.Parser --version 1.0.1
                    
#r "nuget: OutWit.Engine.Parser, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package OutWit.Engine.Parser@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=OutWit.Engine.Parser&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=OutWit.Engine.Parser&version=1.0.1
                    
Install as a Cake Tool

OutWit.Engine.Parser

ANTLR-based parser for WitEngine job scripts.

Overview

This package provides the script parser for WitEngine. It converts WitJob script text into executable job objects using ANTLR4 for lexing and parsing.

Installation

dotnet add package OutWit.Engine.Parser

Features

  • Full WitJob script syntax support
  • Job parameters and variables
  • Activity calls with arguments
  • Composite activities with blocks
  • Transform expressions (arrow syntax)
  • Conditions and arrays
  • Comments

Script Syntax

Job Definition

Job:JobName(Type:param1, Type:param2)
{
    ~ Job body ~
}

Variable Declaration

Int:counter = 0;
String:message = "Hello";
Boolean:flag = true;
Object:data;

Activity Calls

~ Simple activity ~
Trace("Message", false);

~ Activity with return value ~
Int:result = Calculate(10, 20);

~ Composite activity with block ~
Loop(5)
{
    Trace("Iteration", false);
}

Transform Expressions

~ Arrow syntax for transforms ~
IntCollection:output = ForEach(x in input) => Transform(x);

Conditions

If(value > 10)
{
    Trace("Greater", false);
}

Arrays

IntCollection:list = IntCollection([1, 2, 3, 4, 5]);

Comments

~ This is a comment ~

Usage

Basic Parsing

var parser = new ParsingManager(controllerManager, jobFactory, logger);

string script = @"
    Job:Example()
    {
        Int:x = 42;
        Trace(""Value is "" + x, false);
    }
";

IWitJob job = parser.Parse(script);

Integration with WitEngine

The parser is automatically used by WitEngine.Compile():

WitEngine.Instance.Reload();

var job = WitEngine.Instance.Compile(@"
    Job:MyJob()
    {
        Int:result = Calculate(10);
    }
");

Grammar

The parser uses ANTLR4 with the WitJob.g4 grammar file. Key grammar rules:

Rule Description
job Root rule: job definition
statement Variable declaration, assignment, or activity call
activityExpression Activity name with optional parameters
transformExpression Activity with arrow transformer
argument Literal value or variable reference
literal String, number, boolean, null, or array

Architecture

Script Text
    |
    v
[ANTLR Lexer] --> Tokens
    |
    v
[ANTLR Parser] --> Parse Tree
    |
    v
[JobBuilderVisitor] --> IWitJob
    |
    +-- Uses IWitControllerManager to create activities
    +-- Uses IWitJobFactory to create job instances

Project Structure

OutWit.Engine.Parser/
  Grammars/
    WitJob.g4              - ANTLR grammar definition
  Managers/
    ParsingManager.cs      - Public parsing API
  Visitors/
    JobBuilderVisitor.cs   - Parse tree to job converter (internal)
  Utils/
    ParsingUtils.cs        - Helper extensions (internal)
  MakeInternal.ps1         - Script to make ANTLR code internal

Build Process

ANTLR code generation happens during build:

  1. Antlr4Compile target generates C# code from .g4 files
  2. MakeAntlrGeneratedCodeInternal target runs MakeInternal.ps1
  3. PowerShell script changes public to internal for obfuscation

Dependencies

  • OutWit.Engine.Data
  • Antlr4.Runtime.Standard
  • Antlr4BuildTasks (build-time only)

License

This software is licensed under the Non-Commercial License (NCL).

  • Free for personal, educational, and research purposes
  • Commercial use requires a separate license agreement
  • Contact licensing@ratner.io for commercial licensing inquiries

See the full LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on OutWit.Engine.Parser:

Package Downloads
OutWit.Engine.Sdk

Limited SDK version of WitEngine for controller plugin development and testing. Provides local execution with built-in limits for development workflows.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 99 1/16/2026