- Index
- »
- fan.hx
- »
- ProjCompanion
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
Add a new spec or instance rt companion record
Print to Xeto source representation from its rt rec AST representation
Get the project companion lib
Print to Axon source representation from its rt rec AST representation
Replace an existing companion rt record by id
Read the companion rt record by id
Parse Xeto source representation into its rt rec AST representation
Read the companion rt record by name
Parse Axon source representation into its rt rec AST representation
Read all companion rt records
Remove the companion rt rec from database
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.
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.
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).
abstract Dict parseAxon(Str name, Str xeto, Dict? meta)
Parse Axon source representation into its rt rec AST representation.
abstract Str print(Dict dict)
Print to Xeto source representation from its rt rec AST representation.
abstract Str printAxon(Dict dict)
Print to Axon source representation from its rt rec AST representation.
abstract Dict[] readAll()
Read all companion rt records
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.
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.
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.
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.