Skip to the content.

arbor language reference

Compact enough to paste into an LLM prompt alongside the profiles in use.

Two kinds of file, one grammar

File starts with Layer Defines
profile <name> { … } M2 (MOF/EMOF analog) element kinds, their features, enums, visuals
model <name> { … } M1 instances of those kinds

The grammar is the fixed M3 layer. A new domain is a new profile, never a grammar change.

Profiles

profile persistence version "0.1.0" {
    abstract kind Base { prop description: string [0..1] }

    kind Entity extends DataType {
        prop tableName: string [1]            // required
        prop schema:    string = "public"     // default
        contains fields: Column [0..*]        // nested children
        ref      owner:  Team   [0..1]        // reference to another element
        visual { shape: "rectangle" color: "#f59e0b" label: "{name}" icon: "database" }
    }

    enum OnDeleteAction { cascade, setNull, restrict }
}

Models

Every element has the same shape:

<Kind> <Name> (@"stable-id")? {
    slot: value
    <nested elements>
}
Value Syntax
string "text"
number 42, 3.5
bool true, false
enum literal cascade (bare identifier)
reference -> Name, -> Parent.Child, -> model.Name
list [ "a", "b" ], [ -> A, -> B ]

Diagnostics

arbor check prints one JSON object per line:

{"uri":"bad.arbor","line":3,"column":5,"severity":"error","code":"ARB102",
 "message":"Entity has no feature 'tabelName'. Did you mean 'tableName'?","fix":"tableName"}
Code Meaning
ARB001 duplicate name (in a profile, or two profiles/models with the same name)
ARB002 inheritance cycle
ARB003 feature redefined as a different feature type
ARB004 default doesn’t match the property type
ARB005 bad multiplicity
ARB006 unknown visual key (warning)
ARB007 simple name defined by several profiles (or models); write the qualified name listed in the message
ARB008 visual value doesn’t fit its key, e.g. unknown shape or non-hex color (warning; fix = closest shape)
ARB101 abstract kind instantiated
ARB102 unknown slot (fix = closest feature)
ARB103 value has the wrong type
ARB104 reference points to the wrong kind
ARB105 missing required feature (fix = feature name)
ARB106 nested element fits no containment, or several
ARB107 too many values / children
ARB108 slot set twice
ARB110 duplicate element ID