Getting Started

Prerequisites

CDTk targets .NET 10. QUILL targets .NET 8. You need:

  • .NET 10 SDK
  • Any editor (VS Code, Visual Studio, Rider)

Installation

# Clone the source
git clone https://github.com/Tristin-Porter/CDTk
cd CDTk
dotnet build CDTk.slnx

# Run the stress test
dotnet run --project Testing/Testing.csproj
Build Verification
All 8 translation phases should pass when running Tests.

Your First Grammar

using CDTk;

public class MyLang : Grammar {
    public static Token KW_IF     = Kw("if");
    public static Token KW_RETURN = Kw("return");
    public static Token IDENT     = Id();
    public static Token INT       = Num();

    public static Map Structural = new() {
        { KW_IF,     "IfKeyword"     },
        { KW_RETURN, "ReturnKeyword" },
    };
}

Compile Source Code

// C# source to Python output
string pyOutput = Compiler.CompileText(
    input:  new CSharpGrammar(),
    output: new PythonGrammar(),
    source: csSource
);

Binary Output

// Compile to native PE EXE via CRAB
byte[] exe = Compiler.CompileToBinary(csSource);
File.WriteAllBytes("output.exe", exe);

Next Steps