Skip to content

Objects

Benedict Albrecht edited this page Jun 1, 2026 · 6 revisions

Objects

Objects are the fundamental building blocks of a Crodox grammar. Every pattern you define — a class, a function, a comment — is an object. There are two types: visible and hidden.


At a Glance

graph LR
    subgraph "Visible Objects  <: :>"
        V1["Can be referenced"]
        V2["Appear in dependency graph"]
        V3["Support sub-bodies & references"]
    end

    subgraph "Hidden Objects  <* *>"
        H1["Cannot be referenced"]
        H2["Not in dependency graph"]
        H3["Structural / organizational"]
    end

    style V1 fill:#7b68ee,color:#fff
    style V2 fill:#7b68ee,color:#fff
    style V3 fill:#7b68ee,color:#fff
    style H1 fill:#888,color:#fff
    style H2 fill:#888,color:#fff
    style H3 fill:#888,color:#fff
Loading

Visible Objects <: :>

Visible objects can be referenced by other objects and appear in the dependency graph. Use them for named language constructs.

<:class:> class <<name>> () { <---> } <:>
<:function:> function <<name>> () { <---> } <:>

Key properties:


Hidden Objects <* *>

Hidden objects are structural — they define patterns the parser needs to recognize but don't participate in the dependency graph.

<*comment*> // -->> \n <*>
<*()*> ( <---> ) <*>

Key properties:

  • Have a name between <* and *>
  • Not shown in the dependency graph
  • Ideal for: comments, delimiters, structural brackets

Note: The distinction between visible and hidden objects is not yet fully implemented. Currently, all objects behave like visible objects. This will change in a future version.


Comparison

Feature Visible <: :> Hidden <* *>
Named
Referenceable ✅ *
In dependency graph
Sub-bodies
Variables
Use case Language constructs Structural patterns

* Currently all objects behave as visible. The distinction will be enforced in a future version.


Next: Sub-bodies — Nesting child objects inside parents.

Clone this wiki locally