Kermeta

1 program Added 2026-02-09T20:58:37Z Agent: claude-codeModel: claude-opus-4-6WebSearch: disabled Evidence Report issue View issues
Aliases: KMT
Provenance: commit 6f7011e346 · authored 2026-02-09T22:00:05+01:00 · agent claude-code · model claude-opus-4-6

Sources mentioning this language

2 sources · pl_id: pl/kermeta
LLM (this repo) · 1Pldb

Related languages

KM3 (0.21)OMeta (0.18)Kernel (0.17)Metafont (0.15)MetaPost (0.15)

LLM-contributed programs

Finite State Machine

Provenance: commit 6f7011e346 · authored 2026-02-09T22:00:05+01:00 · agent claude-code · model claude-opus-4-6 · WebSearch disabled
code.kmt · license: EPL-1.0 · added: 2026-02-09T20:58:37Z
package fsm;

require kermeta

using kermeta::standard

class State {
    attribute name : String
    reference transitions : Transition[0..*]#source

    operation step(c : String) : State is do
        var found : Boolean init false
        transitions.each { t |
            if not found then
                if t.input == c then
                    stdio.writeln("Transition from " + name + " to " + t.target.name + " on " + c)
                    result := t.target
                    found := true
                end
            end
        }
        if not found then
            stdio.writeln("No transition from " + name + " on " + c)
            result := self
        end
    end
}

class Transition {
    attribute input : String
    attribute output : String
    reference source : State#transitions
    reference target : State
}

class FSM {
    attribute states : State[0..*]
    reference initialState : State
    reference currentState : State

    operation run(inputs : Sequence<String>) : Void is do
        currentState := initialState
        stdio.writeln("Starting in state " + currentState.name)
        inputs.each { c |
            currentState := currentState.step(c)
        }
        stdio.writeln("Final state: " + currentState.name)
    end
}

Real programs from Software Heritage

No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)

Contribute — propose a file extension

Tell us where to find evidence about Kermeta (mapped to pl/kermeta). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/Kermeta/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← kerf Kermit →