mixin

ProjCompanion

const mixin ProjCompanion

Manage Xeto specs and instances in the project companion library

Spec record AST format:

  • rt: required to be "spec"
  • name: unique str name in companion lib
  • spec: must be @sys::Spec
  • base: ref qname for base type
  • slots: grid with cols: name, type ref, plus col for each meta
  • any other tags are spec meta
  • all type references must be a qname ref

Instance record AST format:

  • rt: required to be "instance"
  • name: unique str name in companion lib
  • spec: must be anything other than @sys::Spec
  • any other tags for instance data

methods add

Add a new spec or instance rt companion record

print

Print to Xeto source representation from its rt rec AST representation

lib

Get the project companion lib

printAxon

Print to Axon source representation from its rt rec AST representation

update

Replace an existing companion rt record by id

readById

Read the companion rt record by id

parse

Parse Xeto source representation into its rt rec AST representation

readByName

Read the companion rt record by name

parseAxon

Parse Axon source representation into its rt rec AST representation

readAll

Read all companion rt records

remove

Remove the companion rt rec from database

add abstract Dict add(Dict rec)

Add a new spec or instance rt companion record. The given dict must match the AST respresentation as described in class header. Raise exception if a definition already exists for the defined name. Return new companion rt record. The namespace is reloaded on next access.

lib abstract Lib? lib(Bool checked)

Get the project companion lib. If the companion lib cannot be compiled then return null or raise exception based on checked flag.

parse abstract Dict parse(Str xeto, Dict? meta)

Parse Xeto source representation into its rt rec AST representation. The optional meta parameter may be used to add additional tags into the rt record (such as carrying through the id tag).

parseAxon abstract Dict parseAxon(Str name, Str xeto, Dict? meta)

Parse Axon source representation into its rt rec AST representation.

print abstract Str print(Dict dict)

Print to Xeto source representation from its rt rec AST representation.

printAxon abstract Str printAxon(Dict dict)

Print to Axon source representation from its rt rec AST representation.

readAll abstract Dict[] readAll()

Read all companion rt records

readById abstract Dict? readById(Ref id, Bool checked)

Read the companion rt record by id. Raise exception or return null if id does not exist or does not map to companion rt rec.

readByName abstract Dict? readByName(Str name, Bool checked)

Read the companion rt record by name. Raise exception or return null if name does not exist or does not map to companion rt rec.

remove abstract Void remove(Ref id)

Remove the companion rt rec from database. Raise exception if id does not map to a exisiting rt record. The namespace is reloaded on next access.

update abstract Dict update(Dict rec)

Replace an existing companion rt record by id. The given dict must match the AST respresentation as described in class header. Raise exception if no existing definition for the dict id. Return updated rt record. The namespace is reloaded on next access.

Haxall 4.0.5 ∙ 24-Feb-2026 14:33 EST