7. The core
Contents of ATD 0.1
The core holds what every kind shares, stated once (FR-004): identity and origin, localized text and documentation, element types and attributes, data types and enums, ids, containment, constraints and findings, operations, hooks, actions, reasons and messages, limits and settings (grammar/core.lark). Each construct carries the DISL or DESL construct this section names.
A tool construct, and a part, holds any of: label, doc, settings, import (section 5.3), requires capability (section 13), model, constraints and constraint, operation, hook, reason, message, behavior, persistence, plugin, fn (section 12), the constructs of its kind's surface (sections 8 to 10) and bindings (section 11). The tool construct's settings are DISL's Language and DESL's Language (id, defaultLocale, locales, icon, authors, homepage, license, limits, fileExtension, profiles).
label <value> is a construct's display name (DISL §2.4): a string, or a settings map from BCP 47 tags to strings ({ en: "State", de: "Zustand" }), or, in a position DISL types as a Message, ( CEL ) returning a string or a map of strings. A construct without a label has the one DISL derives from its name.
A construct's documentation is its /// comments (section 3.2) and its doc <value> member: a string, the summary, or a settings map of DISL's Doc (summary, description, rationale, examples, seeAlso, tags, audience, since, deprecated, image, helpUrl). The language servers show it on hover with the construct's entry of Appendix B.
model { … } holds the tool type's metamodel (DISL §4, DESL §4): element, relation, enum, datatype and document, and settings of DISL's Metamodel.
element <Name> [extends <Types>] { … }is an element type: DISL's node type, DESL's element type. Its members areattribute,contains,port,label,docand settings of DISL'sNodeType(abstract,icon,labelAttribute,multiplicity,bounds,tags,viewOnly,derived).relation <Name> [extends <Types>] [from <Types> to <Types>] { … }is a relation type (DISL §4.9), admitted in diagrams only. Its members are those of an element type; its settings are DISL'sRelationType(directed,allowSelfLoops,allowParallel,acyclic,derived,connectsRelations), andsourceandtargetsettings give the rest of each end (DISL'sRelationEnd).port <name> { … }is a port type of an element type (DISL §4.10).- Inheritance is C3, as DISL §4.7 says, for element types and relation types alike.
attribute <name>: <Type> [required] [many] [readonly] [default <value>] { … } is an attribute (DISL §4.3, DESL §4.3). The type is one of DISL's or DESL's primitive types, an enum, a data type, an element type (a reference), or a CEL parameterised type (list<Concept>). Its settings are DISL's Attribute (label, min, max, pattern, markup, group, order, unit, readOnlyReasons and the others) and DESL's (mentions, timezone).
enum <Name> ["<label>"] { <value> … }is an enumeration (DISL §4.5). Each value is a name, or a string where it is not one, with an optional block of DISL'sEnumValue(label,color,icon,value,deprecated); the enum's other settings (extensible,ordered) stand among its values.datatype <Name> [: <Base>] { … }is a data type (DISL §4.4).
contains <Types> [as <slot>] [ordered] { … }says which element types an element type contains (DISL §4.8, DESL §4.6): withoutas, in its children; withas, in the named slot. Its settings are DISL'sContainment(min,max,perType,acrossViews).document { … }holds the attributes of the document itself: DISL'smetamodel.diagram, DESL'smetamodel.document.
constraint <id> [for <Types>] { … }is a constraint (DISL §8.2, DESL §6.2):when <CEL>,rule <CEL>,severity <name>,message <value>,fix <name> ["<label>"] { … }quick fixes (DISL §8.5) whose statements are actions,label,doc, and settings of DISL'sConstraint(kind,code,attribute,target,enforcement,timing,group,subject,location, …).constraints { … }holds constraints,builtin <std.name> { … }settings of the built-in constraints (DISL §8.7, DESL §6.5), and settings of DISL'sConstraints(blockSaveOn,defaults,groups,order).- A finding of a running tool is DISL's (DISL §8.6); a finding of ATD's checker is section 15's.
operation <id> ["<label>"] [for <Types>] { … } is an operation (DISL §9.3, DESL §8.1). Its members are enabled <CEL>, unavailable <value> (a list of reasons), param <name>: <Type> …, confirm { … } (DISL's Confirmation), label, doc, settings of DISL's Operation (icon, shortcut, paramsForm, simulate), and statements (section 12), which are its actions, run in the operation's transaction. for document makes it an operation of the document.
hook <id> on <event> [for <Types>] { … } is a hook (DISL §9.2): when <CEL>, settings of DISL's Hook (phase, order, attribute), and statements. Hooks are admitted in diagrams only, as DESL has none.
reason <id> "<text>", orreason <id> { when <CEL> message <value> }, declares a named reason (DISL §2.3, §9.1'sreasons). A list of reasons, wherever DISL has one (unavailable,readOnlyReasons, refusals), is a list of values: a message, a settings map{ when: (…), message: … }, or{ reason: <id> }.message <std.name> <value>sets a standard message (DISL §9.1'smessages).behavior { … }holds the rest of DISL'sBehavioras settings:deletion,clipboard,retype,undo,editGate,placements,maxHookDepth.
persistence { … } holds DISL's and DESL's Persistence as settings, ids and id strategies among them (ids: { strategy: …, prefix: …, types: { … } }, DISL §11.5, DESL §5.3, the counter strategy with its mark among them), the part of the model a registration keeps (settings, DESL §5.5), and the type map, view data and migrations. The type map (typeMap) names the binding types that are not types of the model, as DESL §5.2 does: a binding rule may name a key of it as its type (section 14.7). A binding is a binding of the description (section 11), never a reference to a file.
plugin <name> { … } declares a DISL plugin (DISL §13.1). In ATD, an algorithm the platform provides is a capability (section 13); a plugin declaration carries a DISL specification's plugin to its description, until the capability that replaces it is in the catalogue.
The tool construct's setting limits holds DISL's language.limits and the script's budget (section 12.6): limits: { steps: 50000 } sets a lower budget than the default.