Language Engineering Platform
From grammar to native binary
Grammar
Lexer
Parser
Semantics
C++23 IR
Native Binary
Under active development

One file defines your language.
One command compiles your program.

Metamorf is a language engineering platform. You describe a complete programming language in a single .mor file. Tokens, types, grammar rules, semantic analysis, and C++23 code generation. Metamorf reads that file, populates dispatch tables, and uses them to compile source files to native Win64/Linux64 binaries via Zig/Clang.

Most language definition tools (YACC, ANTLR, traditional BNF grammars) give you a declarative grammar and then punt to a host language for anything non-trivial. Metamorf is a complete, unified compiler-construction language. Variables, loops, conditionals, recursion, string operations, and user-defined routines are first-class constructs alongside declarative grammar rules and token definitions.

No host language glue code. No build system integration. No escape hatch to C, Java, or Python.

Turing complete by design. The .mor language has variables, loops, conditionals, recursion, and string operations as first-class constructs alongside declarative grammar rules. Every handler body uses the same unified language. No escape hatch to a host language. A .mor file is a complete, self-contained language specification.

Terminal
Metamorf -l pascal.mor -s hello.pas -r

Table-driven pipeline. Zero glue code.

Metamorf compiles in a single pass through a table-driven pipeline. The .mor file is parsed first, and its contents populate dispatch tables. These tables then drive lexing, parsing, semantic analysis, and code generation of your user source files.

Setup
Language Definition
The .mor file is parsed by a dedicated lexer and parser. The interpreter walks the AST and populates dispatch tables with your tokens, grammar rules, semantic handlers, and emitters.
.mor file Parse .mor Walk AST Dispatch tables
Compile
Source to Binary
The table-driven generic lexer, Pratt parser, semantic engine, and emitters process your source files through the full pipeline to produce native binaries.
Source file Lex Parse Semantics C++23 Native binary

Turing complete. Not a bolt-on.

The .mor language has variables, assignment, unbounded loops, conditionals, arithmetic, string operations, and user-defined routines with recursion. These aren't a separate scripting layer bolted onto a grammar DSL. They're the same unified language surface. Declarative grammar rules and imperative logic are first-class peers.

pascal.mor (grammar excerpt)
grammar {
  // Prefix rule: identifiers
  rule expr.ident {
    consume identifier -> @name;
  }

  // Infix rule with precedence
  rule expr.add precedence left 20 {
    consume [op.plus, op.minus] -> @operator;
    parse expr -> @right;
  }

  // Statement rule with imperative logic inside
  rule stmt.if {
    expect keyword.if;
    parse expr -> @condition;
    expect keyword.then;
    parse many stmt until [keyword.else, keyword.end] -> @then_body;
    optional {
      expect keyword.else;
      parse many stmt until keyword.end -> @else_body;
    }
    expect keyword.end;
  }
}
pascal.mor (emitter excerpt)
emitters {
  on stmt.var_decl {
    let i = 0;
    let n = child_count();
    while i < n {
      let v = getChild(node, i);
      let ctype = resolveType(getAttr(v, "vtype"));
      let vname = getAttr(v, "vname");
      declVar(vname, ctype);
      i = i + 1;
    }
  }

  on stmt.for {
    let varName = getAttr(node, "var");
    let startExpr = exprToString(getChild(node, 0));
    let finishExpr = exprToString(getChild(node, 1));
    forStmt(varName, startExpr, varName + " <= " + finishExpr, varName + "++");
    emitBlock(getChild(node, 2));
    endFor();
  }
}

Everything in one surface.

Traditional tools split your language across files, frameworks, and host languages. Metamorf keeps it all in one place.

Capability YACC / Bison ANTLR Metamorf
Grammar definition
Semantic analysis Host language Host language Built-in
Code generation Host language Host language IR builders
Turing complete logic Via C/C++ Via Java/Python Native
Single-file definition No No Yes
Native binary output Manual Manual Automatic

The full pipeline in one tool.
📄
Single-File Languages
Tokens, grammar, semantics, and code generation. One .mor file is a complete, portable language specification.
🔄
Pratt Parser
Declarative prefix/infix/statement rules with full imperative constructs for complex parsing. Both are part of one language.
🧠
Semantic Analysis
Multi-pass scope management, symbol declaration, forward reference resolution, and overload detection. All in .mor.
⚙️
IR Builder Codegen
Structured C++23 output through typed builders like func(), declVar(), ifStmt(). Not string concatenation.
🔗
C++ Passthrough
Your language interoperates with C/C++ automatically. No configuration needed in the .mor file.
🎯
Native Binaries
Win64 and Linux64 output via Zig/Clang. Cross-compilation through WSL2. No external toolchain setup.

Media
Metamorf Infographic

Running in three steps.
1
Download
Grab the latest release from GitHub. Everything is included. No separate toolchain, no configuration.
github.com/tinyBigGAMES/Metamorf/releases
2
Write a .mor file
Define your language's tokens, grammar, semantics, and code generation in a single file. See tests/pascal.mor for a working example.
3
Compile
One command. Native binary out.
Metamorf -l pascal.mor -s hello.pas -r

System requirements:

Host OSWindows 10/11 x64
Linux targetWSL2 + Ubuntu
Build from sourceDelphi 12 Athens or later

Community

Metamorf is built in the open. Whether you're fixing a bug, building a showcase language, or just curious, you're welcome.