Skip to content

Syntax Overview

Benedict Albrecht edited this page Jun 2, 2026 · 3 revisions

Syntax Overview

A complete reference of all Crodox grammar elements and their notation.


Element Hierarchy

graph TD
    FILE["<b>File</b><br/>&lt;~ file.xy ~&gt;"] --> VOBJ["<b>Visible Object</b><br/>&lt;: name :&gt;"]
    FILE --> HOBJ["<b>Hidden Object</b><br/>&lt;* name *&gt;"]
    FILE --> SUBFILE["<b>Subgrammar</b><br/>Nested &lt;~ ~&gt;"]

    VOBJ --> SUB["<b>Sub-body</b><br/>&lt;---&gt;"]
    VOBJ --> REF["<b>Reference</b><br/>&lt;-{ref}-&gt;"]
    VOBJ --> VAR["<b>Variable</b><br/>&lt;&lt; var &gt;&gt;"]
    VOBJ --> OR["<b>Or</b><br/>&lt;| a &lt;||&gt; b |&gt;"]
    VOBJ --> REP["<b>Repeat</b><br/>&lt;? ... ?&gt;"]
    VOBJ --> JUMP["<b>Jump</b><br/>--&gt;&gt; target"]

    HOBJ --> SUB2["Sub-body"]
    HOBJ --> OR2["Or / Repeat / Jump"]

    SUB --> VOBJ2["Child Objects"]

    style FILE fill:#4a90d9,color:#fff
    style VOBJ fill:#7b68ee,color:#fff
    style HOBJ fill:#888,color:#fff
    style VAR fill:#e67e22,color:#fff
Loading

Grammar Elements

Syntax Element Description Details
<~ file.xy ~> File Defines a grammar for a file type Grammar Structure
<: object :> Visible Object Named object that participates in the dependency graph Objects
<* object *> Hidden Object Structural object, not referenceable Objects
<---> Sub-body Accepts child objects Sub-bodies
<-{ref}-> Reference Substitutes another object's variables References
<< variable >> Variable Captures a token from source code Variables
<| a <||> b |> Or Statement Matches one of several alternatives Or Statements
<? ... ?> Repeat Matches a pattern zero or more times Repeat Statements
-->> target Jump Skips input until target token is found Jump Instructions

Variable Modifiers

Syntax Type Scope Description
<< var >> Standard :following Default - visible to following siblings
<< "path" >> Path - File path reference
<< 'ref' >> Reference - Creates dependency, no overwrite
<< VAR >> Uppercase - Overwrites value, no dependency
<< var:following >> Standard :following Explicit forward scope (default)
<< var:up >> Standard :up Visible to parent objects
<< var:down >> Standard :down Visible to child objects
<< var:siblings >> Standard :siblings Visible to all siblings
<< var:global >> Standard :global Visible everywhere
<< var:hook >> Standard :hook Hook scope

Next: Objects - Learn about visible and hidden building blocks.

Clone this wiki locally