/****************************************************************************** * This file was generated by langium-cli 4.2.0. * DO NOT EDIT MANUALLY! ******************************************************************************/ import type { Grammar } from 'langium'; import { loadGrammarFromJson } from 'langium'; let loadedDomainLangGrammar: Grammar | undefined; export const DomainLangGrammar = (): Grammar => loadedDomainLangGrammar ?? (loadedDomainLangGrammar = loadGrammarFromJson(`{ "$type": "Grammar", "isDeclared": true, "name": "DomainLang", "rules": [ { "$type": "ParserRule", "entry": true, "name": "Model", "definition": { "$type": "Group", "elements": [ { "$type": "Assignment", "feature": "imports", "operator": "+=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@24" }, "arguments": [] }, "cardinality": "*" }, { "$type": "Assignment", "feature": "children", "operator": "+=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@1" }, "arguments": [] }, "cardinality": "*" } ] }, "fragment": false, "parameters": [], "$comment": "/**\\n * Root AST node - aggregates all top-level DDD elements.\\n * Produces the entry point for parsing .dlang files.\\n */" }, { "$type": "ParserRule", "name": "StructureElement", "definition": { "$type": "Alternatives", "elements": [ { "$type": "RuleCall", "rule": { "$ref": "#/rules@2" }, "arguments": [] }, { "$type": "RuleCall", "rule": { "$ref": "#/rules@9" }, "arguments": [] }, { "$type": "RuleCall", "rule": { "$ref": "#/rules@25" }, "arguments": [] } ] }, "entry": false, "fragment": false, "parameters": [], "$comment": "/**\\n * Top-level elements that can appear in the model.\\n * Unifies all major DDD constructs for flexible ordering.\\n */" }, { "$type": "ParserRule", "name": "Type", "definition": { "$type": "Alternatives", "elements": [ { "$type": "RuleCall", "rule": { "$ref": "#/rules@3" }, "arguments": [] }, { "$type": "RuleCall", "rule": { "$ref": "#/rules@4" }, "arguments": [] }, { "$type": "RuleCall", "rule": { "$ref": "#/rules@6" }, "arguments": [] }, { "$type": "RuleCall", "rule": { "$ref": "#/rules@7" }, "arguments": [] }, { "$type": "RuleCall", "rule": { "$ref": "#/rules@8" }, "arguments": [] } ] }, "entry": false, "fragment": false, "parameters": [], "$comment": "/**\\n * Union of all main DDD type constructs.\\n */" }, { "$type": "ParserRule", "name": "Domain", "definition": { "$type": "Group", "elements": [ { "$type": "Alternatives", "elements": [ { "$type": "Keyword", "value": "Domain" }, { "$type": "Keyword", "value": "dom" } ] }, { "$type": "Assignment", "feature": "name", "operator": "=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@29" }, "arguments": [] } }, { "$type": "Group", "elements": [ { "$type": "Keyword", "value": "in" }, { "$type": "Assignment", "feature": "parent", "operator": "=", "terminal": { "$type": "CrossReference", "type": { "$ref": "#/rules@3" }, "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@27" }, "arguments": [] }, "deprecatedSyntax": false, "isMulti": false } } ], "cardinality": "?" }, { "$type": "Group", "elements": [ { "$type": "Keyword", "value": "{" }, { "$type": "Alternatives", "elements": [ { "$type": "Group", "elements": [ { "$type": "Keyword", "value": "description" }, { "$type": "RuleCall", "rule": { "$ref": "#/rules@26" }, "arguments": [] }, { "$type": "Assignment", "feature": "description", "operator": "=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@30" }, "arguments": [] } } ] }, { "$type": "Group", "elements": [ { "$type": "Keyword", "value": "vision" }, { "$type": "RuleCall", "rule": { "$ref": "#/rules@26" }, "arguments": [] }, { "$type": "Assignment", "feature": "vision", "operator": "=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@30" }, "arguments": [] } } ] }, { "$type": "Group", "elements": [ { "$type": "Keyword", "value": "type" }, { "$type": "RuleCall", "rule": { "$ref": "#/rules@26" }, "arguments": [] }, { "$type": "Assignment", "feature": "type", "operator": "=", "terminal": { "$type": "CrossReference", "type": { "$ref": "#/rules@7" }, "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@27" }, "arguments": [] }, "deprecatedSyntax": false, "isMulti": false } } ] } ], "cardinality": "*" }, { "$type": "Keyword", "value": "}" } ], "cardinality": "?" } ] }, "entry": false, "fragment": false, "parameters": [], "$comment": "/**\\n * Domain - A sphere of knowledge or activity in DDD.\\n * Can be nested via \`in\` to show subdomain hierarchy.\\n * The \`type\` property indicates strategic importance (Core, Supporting, Generic) per Bounded Context Canvas.\\n * Body is optional - allows header-only Domain definitions.\\n * \\n * [Read more on domainlang.net](https://domainlang.net/reference/language#domains)\\n */" }, { "$type": "ParserRule", "name": "BoundedContext", "definition": { "$type": "Group", "elements": [ { "$type": "Alternatives", "elements": [ { "$type": "Keyword", "value": "BoundedContext" }, { "$type": "Keyword", "value": "bc" } ] }, { "$type": "Assignment", "feature": "name", "operator": "=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@29" }, "arguments": [] } }, { "$type": "Group", "elements": [ { "$type": "Keyword", "value": "for" }, { "$type": "Assignment", "feature": "domain", "operator": "=", "terminal": { "$type": "CrossReference", "type": { "$ref": "#/rules@3" }, "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@27" }, "arguments": [] }, "deprecatedSyntax": false, "isMulti": false } } ], "cardinality": "?" }, { "$type": "Group", "elements": [ { "$type": "Group", "elements": [ { "$type": "Keyword", "value": "as" }, { "$type": "Assignment", "feature": "classification", "operator": "+=", "terminal": { "$type": "CrossReference", "type": { "$ref": "#/rules@7" }, "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@27" }, "arguments": [] }, "deprecatedSyntax": false, "isMulti": false } } ], "cardinality": "?" }, { "$type": "Group", "elements": [ { "$type": "Keyword", "value": "by" }, { "$type": "Assignment", "feature": "team", "operator": "+=", "terminal": { "$type": "CrossReference", "type": { "$ref": "#/rules@6" }, "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@27" }, "arguments": [] }, "deprecatedSyntax": false, "isMulti": false } } ], "cardinality": "?" } ], "cardinality": "?" }, { "$type": "Group", "elements": [ { "$type": "Keyword", "value": "{" }, { "$type": "Alternatives", "elements": [ { "$type": "Group", "elements": [ { "$type": "Keyword", "value": "description" }, { "$type": "RuleCall", "rule": { "$ref": "#/rules@26" }, "arguments": [] }, { "$type": "Assignment", "feature": "description", "operator": "=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@30" }, "arguments": [] } } ] }, { "$type": "Group", "elements": [ { "$type": "Keyword", "value": "classification" }, { "$type": "RuleCall", "rule": { "$ref": "#/rules@26" }, "arguments": [] }, { "$type": "Assignment", "feature": "classification", "operator": "+=", "terminal": { "$type": "CrossReference", "type": { "$ref": "#/rules@7" }, "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@27" }, "arguments": [] }, "deprecatedSyntax": false, "isMulti": false } } ] }, { "$type": "Group", "elements": [ { "$type": "Keyword", "value": "team" }, { "$type": "RuleCall", "rule": { "$ref": "#/rules@26" }, "arguments": [] }, { "$type": "Assignment", "feature": "team", "operator": "+=", "terminal": { "$type": "CrossReference", "type": { "$ref": "#/rules@6" }, "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@27" }, "arguments": [] }, "deprecatedSyntax": false, "isMulti": false } } ] }, { "$type": "Group", "elements": [ { "$type": "Keyword", "value": "businessModel" }, { "$type": "RuleCall", "rule": { "$ref": "#/rules@26" }, "arguments": [] }, { "$type": "Assignment", "feature": "businessModel", "operator": "=", "terminal": { "$type": "CrossReference", "type": { "$ref": "#/rules@7" }, "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@27" }, "arguments": [] }, "deprecatedSyntax": false, "isMulti": false } } ] }, { "$type": "Group", "elements": [ { "$type": "Keyword", "value": "evolution" }, { "$type": "RuleCall", "rule": { "$ref": "#/rules@26" }, "arguments": [] }, { "$type": "Assignment", "feature": "evolution", "operator": "=", "terminal": { "$type": "CrossReference", "type": { "$ref": "#/rules@7" }, "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@27" }, "arguments": [] }, "deprecatedSyntax": false, "isMulti": false } } ] }, { "$type": "Group", "elements": [ { "$type": "Keyword", "value": "archetype" }, { "$type": "RuleCall", "rule": { "$ref": "#/rules@26" }, "arguments": [] }, { "$type": "Assignment", "feature": "archetype", "operator": "=", "terminal": { "$type": "CrossReference", "type": { "$ref": "#/rules@7" }, "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@27" }, "arguments": [] }, "deprecatedSyntax": false, "isMulti": false } } ] }, { "$type": "Group", "elements": [ { "$type": "Alternatives", "elements": [ { "$type": "Keyword", "value": "metadata" }, { "$type": "Keyword", "value": "meta" } ] }, { "$type": "Keyword", "value": "{" }, { "$type": "Assignment", "feature": "metadata", "operator": "+=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@5" }, "arguments": [] }, "cardinality": "*" }, { "$type": "Keyword", "value": "}" } ] }, { "$type": "Group", "elements": [ { "$type": "Alternatives", "elements": [ { "$type": "Keyword", "value": "relationships" }, { "$type": "Keyword", "value": "integrations" } ] }, { "$type": "Keyword", "value": "{" }, { "$type": "Group", "elements": [ { "$type": "Assignment", "feature": "relationships", "operator": "+=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@12" }, "arguments": [] } }, { "$type": "Group", "elements": [ { "$type": "Keyword", "value": ",", "cardinality": "?" }, { "$type": "Assignment", "feature": "relationships", "operator": "+=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@12" }, "arguments": [] } } ], "cardinality": "*" } ], "cardinality": "*" }, { "$type": "Keyword", "value": "}" } ] }, { "$type": "Group", "elements": [ { "$type": "Alternatives", "elements": [ { "$type": "Keyword", "value": "terminology" }, { "$type": "Keyword", "value": "glossary" } ] }, { "$type": "Keyword", "value": "{" }, { "$type": "Group", "elements": [ { "$type": "Assignment", "feature": "terminology", "operator": "+=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@19" }, "arguments": [] } }, { "$type": "Keyword", "value": ",", "cardinality": "?" } ], "cardinality": "*" }, { "$type": "Keyword", "value": "}" } ] }, { "$type": "Group", "elements": [ { "$type": "Alternatives", "elements": [ { "$type": "Keyword", "value": "decisions" }, { "$type": "Keyword", "value": "rules" } ] }, { "$type": "Keyword", "value": "{" }, { "$type": "Group", "elements": [ { "$type": "Assignment", "feature": "decisions", "operator": "+=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@20" }, "arguments": [] } }, { "$type": "Keyword", "value": ",", "cardinality": "?" } ], "cardinality": "*" }, { "$type": "Keyword", "value": "}" } ] } ], "cardinality": "*" }, { "$type": "Keyword", "value": "}" } ], "cardinality": "?" } ] }, "entry": false, "fragment": false, "parameters": [], "$comment": "/**\\n * Bounded Context - A boundary within which a domain model is defined.\\n * Central pattern in DDD for managing complexity and team boundaries.\\n * Belongs to exactly ONE domain (fundamental DDD principle).\\n * Body properties can appear in any order. Validation enforces at-most-once constraint.\\n * The \`classification\` property indicates strategic importance per Bounded Context Canvas.\\n * The \`evolution\` property indicates maturity stage per Wardley Maps/BC Canvas.\\n * The \`archetype\` property indicates behavioral role per DDD archetypes (Gateway, Execution, etc).\\n * \\n * [Read more on domainlang.net](https://domainlang.net/reference/language#bounded-contexts)\\n */" }, { "$type": "ParserRule", "name": "MetadataEntry", "definition": { "$type": "Group", "elements": [ { "$type": "Assignment", "feature": "key", "operator": "=", "terminal": { "$type": "CrossReference", "type": { "$ref": "#/rules@8" }, "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@27" }, "arguments": [] }, "deprecatedSyntax": false, "isMulti": false } }, { "$type": "RuleCall", "rule": { "$ref": "#/rules@26" }, "arguments": [] }, { "$type": "Assignment", "feature": "value", "operator": "=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@30" }, "arguments": [] } } ] }, "entry": false, "fragment": false, "parameters": [] }, { "$type": "ParserRule", "name": "Team", "definition": { "$type": "Group", "elements": [ { "$type": "Keyword", "value": "Team" }, { "$type": "Assignment", "feature": "name", "operator": "=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@29" }, "arguments": [] } } ] }, "entry": false, "fragment": false, "parameters": [], "$comment": "/**\\n * Team - People responsible for a Bounded Context or Domain.\\n * Represents organizational boundaries in DDD.\\n * \\n * [Read more on domainlang.net](https://domainlang.net/reference/language#teams)\\n */" }, { "$type": "ParserRule", "name": "Classification", "definition": { "$type": "Group", "elements": [ { "$type": "Keyword", "value": "Classification" }, { "$type": "Assignment", "feature": "name", "operator": "=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@29" }, "arguments": [] } } ] }, "entry": false, "fragment": false, "parameters": [], "$comment": "/**\\n * Classification - Reusable label for categorizing elements.\\n * Examples: Core, Supporting, Generic, Strategic, Commodity, Architectural, Business, Technical.\\n * \\n * [Read more on domainlang.net](https://domainlang.net/reference/language#classifications)\\n */" }, { "$type": "ParserRule", "name": "Metadata", "definition": { "$type": "Group", "elements": [ { "$type": "Keyword", "value": "Metadata" }, { "$type": "Assignment", "feature": "name", "operator": "=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@29" }, "arguments": [] } } ] }, "entry": false, "fragment": false, "parameters": [], "$comment": "/**\\n * Metadata - Defines a key that can be used in metadata blocks.\\n * Examples: Language, Framework, Database, Repository.\\n * Can be defined locally or imported from stdlib.\\n * \\n * [Read more on domainlang.net](https://domainlang.net/reference/language#metadata)\\n */" }, { "$type": "ParserRule", "name": "ObjectMap", "definition": { "$type": "Alternatives", "elements": [ { "$type": "RuleCall", "rule": { "$ref": "#/rules@10" }, "arguments": [] }, { "$type": "RuleCall", "rule": { "$ref": "#/rules@11" }, "arguments": [] } ] }, "entry": false, "fragment": false, "parameters": [], "$comment": "/**\\n * Union of mapping constructs for visualizing architecture.\\n */" }, { "$type": "ParserRule", "name": "ContextMap", "definition": { "$type": "Group", "elements": [ { "$type": "Alternatives", "elements": [ { "$type": "Keyword", "value": "ContextMap" }, { "$type": "Keyword", "value": "cmap" } ] }, { "$type": "Assignment", "feature": "name", "operator": "=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@29" }, "arguments": [] } }, { "$type": "Keyword", "value": "{" }, { "$type": "Group", "elements": [ { "$type": "Keyword", "value": "contains" }, { "$type": "Assignment", "feature": "boundedContexts", "operator": "+=", "terminal": { "$type": "CrossReference", "isMulti": true, "type": { "$ref": "#/rules@4" }, "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@27" }, "arguments": [] }, "deprecatedSyntax": false } }, { "$type": "Group", "elements": [ { "$type": "Keyword", "value": ",", "cardinality": "?" }, { "$type": "Assignment", "feature": "boundedContexts", "operator": "+=", "terminal": { "$type": "CrossReference", "isMulti": true, "type": { "$ref": "#/rules@4" }, "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@27" }, "arguments": [] }, "deprecatedSyntax": false } } ], "cardinality": "*" } ], "cardinality": "*" }, { "$type": "Group", "elements": [ { "$type": "Assignment", "feature": "relationships", "operator": "+=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@12" }, "arguments": [] } }, { "$type": "Group", "elements": [ { "$type": "Keyword", "value": ",", "cardinality": "?" }, { "$type": "Assignment", "feature": "relationships", "operator": "+=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@12" }, "arguments": [] } } ], "cardinality": "*" } ], "cardinality": "*" }, { "$type": "Keyword", "value": "}" } ] }, "entry": false, "fragment": false, "parameters": [], "$comment": "/**\\n * Context Map - Visualizes relationships between Bounded Contexts.\\n * Shows integration patterns and team interactions.\\n * \\n * [Read more on domainlang.net](https://domainlang.net/reference/language#context-maps)\\n */" }, { "$type": "ParserRule", "name": "DomainMap", "definition": { "$type": "Group", "elements": [ { "$type": "Alternatives", "elements": [ { "$type": "Keyword", "value": "DomainMap" }, { "$type": "Keyword", "value": "dmap" } ] }, { "$type": "Assignment", "feature": "name", "operator": "=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@29" }, "arguments": [] } }, { "$type": "Keyword", "value": "{" }, { "$type": "Group", "elements": [ { "$type": "Keyword", "value": "contains" }, { "$type": "Assignment", "feature": "domains", "operator": "+=", "terminal": { "$type": "CrossReference", "isMulti": true, "type": { "$ref": "#/rules@3" }, "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@27" }, "arguments": [] }, "deprecatedSyntax": false } }, { "$type": "Group", "elements": [ { "$type": "Keyword", "value": ",", "cardinality": "?" }, { "$type": "Assignment", "feature": "domains", "operator": "+=", "terminal": { "$type": "CrossReference", "isMulti": true, "type": { "$ref": "#/rules@3" }, "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@27" }, "arguments": [] }, "deprecatedSyntax": false } } ], "cardinality": "*" } ], "cardinality": "*" }, { "$type": "Keyword", "value": "}" } ] }, "entry": false, "fragment": false, "parameters": [], "$comment": "/**\\n * Domain Map - Visualizes relationships between Domains.\\n * Shows high-level domain organization and subdomain structure.\\n * \\n * [Read more on domainlang.net](https://domainlang.net/reference/language#domain-maps)\\n */" }, { "$type": "ParserRule", "name": "Relationship", "definition": { "$type": "Alternatives", "elements": [ { "$type": "RuleCall", "rule": { "$ref": "#/rules@13" }, "arguments": [] }, { "$type": "RuleCall", "rule": { "$ref": "#/rules@14" }, "arguments": [] } ] }, "entry": false, "fragment": false, "parameters": [], "$comment": "/**\\n * Relationship - Connection between two Bounded Contexts.\\n * Uses entity–relationship–entity structure where the relationship expression\\n * (type, arrow, side annotations) sits between the two entity references.\\n * \\n * Forms:\\n * Directional: Orders [OHS] -> [CF] Payments\\n * Symmetric: CardManagement [SK] AccountManagement\\n * Separate Ways arrow: Orders >< Payments\\n * \\n * [Read more on domainlang.net](https://domainlang.net/reference/language#relationships)\\n */" }, { "$type": "ParserRule", "name": "DirectionalRelationship", "definition": { "$type": "Group", "elements": [ { "$type": "Assignment", "feature": "left", "operator": "=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@15" }, "arguments": [] } }, { "$type": "Group", "elements": [ { "$type": "Keyword", "value": "[" }, { "$type": "Assignment", "feature": "leftPatterns", "operator": "+=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@17" }, "arguments": [] } }, { "$type": "Group", "elements": [ { "$type": "Keyword", "value": "," }, { "$type": "Assignment", "feature": "leftPatterns", "operator": "+=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@17" }, "arguments": [] } } ], "cardinality": "*" }, { "$type": "Keyword", "value": "]" } ], "cardinality": "?" }, { "$type": "Assignment", "feature": "arrow", "operator": "=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@16" }, "arguments": [] } }, { "$type": "Group", "elements": [ { "$type": "Keyword", "value": "[" }, { "$type": "Assignment", "feature": "rightPatterns", "operator": "+=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@17" }, "arguments": [] } }, { "$type": "Group", "elements": [ { "$type": "Keyword", "value": "," }, { "$type": "Assignment", "feature": "rightPatterns", "operator": "+=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@17" }, "arguments": [] } } ], "cardinality": "*" }, { "$type": "Keyword", "value": "]" } ], "cardinality": "?" }, { "$type": "Assignment", "feature": "right", "operator": "=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@15" }, "arguments": [] } } ] }, "entry": false, "fragment": false, "parameters": [], "$comment": "/**\\n * Directional relationship - upstream/downstream with optional side patterns.\\n * \\n * Examples:\\n * Orders [OHS] -> [CF] Payments\\n * Orders [S] -> [C] Payments\\n * Orders -> Payments\\n * Orders [OHS] <-> [CF] Payments\\n */" }, { "$type": "ParserRule", "name": "SymmetricRelationship", "definition": { "$type": "Group", "elements": [ { "$type": "Assignment", "feature": "left", "operator": "=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@15" }, "arguments": [] } }, { "$type": "Alternatives", "elements": [ { "$type": "Group", "elements": [ { "$type": "Keyword", "value": "[" }, { "$type": "Assignment", "feature": "pattern", "operator": "=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@18" }, "arguments": [] } }, { "$type": "Keyword", "value": "]" } ] }, { "$type": "Assignment", "feature": "arrow", "operator": "=", "terminal": { "$type": "Keyword", "value": "><" } } ] }, { "$type": "Assignment", "feature": "right", "operator": "=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@15" }, "arguments": [] } } ] }, "entry": false, "fragment": false, "parameters": [], "$comment": "/**\\n * Symmetric relationship - mutual pattern between two contexts, no directionality.\\n * \\n * Examples:\\n * CardManagement [SK] AccountManagement\\n * Orders [P] Payments\\n * Orders >< Payments\\n * Orders [SW] Payments\\n */" }, { "$type": "ParserRule", "name": "BoundedContextRef", "definition": { "$type": "Alternatives", "elements": [ { "$type": "Group", "elements": [ { "$type": "Action", "inferredType": { "$type": "InferredType", "name": "ThisRef" } }, { "$type": "Keyword", "value": "this" } ] }, { "$type": "Assignment", "feature": "link", "operator": "=", "terminal": { "$type": "CrossReference", "type": { "$ref": "#/rules@4" }, "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@27" }, "arguments": [] }, "deprecatedSyntax": false, "isMulti": false } } ] }, "entry": false, "fragment": false, "parameters": [], "$comment": "/**\\n * Context reference - can be 'this' (self-reference) or a qualified name.\\n */" }, { "$type": "ParserRule", "name": "DirectionalArrow", "dataType": "string", "definition": { "$type": "Alternatives", "elements": [ { "$type": "Keyword", "value": "<->" }, { "$type": "Keyword", "value": "->" }, { "$type": "Keyword", "value": "<-" } ] }, "entry": false, "fragment": false, "parameters": [], "$comment": "/**\\n * Directional relationship arrows.\\n * \\n * Arrow semantics:\\n * -> Upstream to downstream (left provides, right consumes)\\n * <- Downstream to upstream (right provides, left consumes)\\n * <-> Bidirectional (mutual data flow with explicit patterns)\\n */" }, { "$type": "ParserRule", "name": "SidePattern", "definition": { "$type": "Alternatives", "elements": [ { "$type": "Group", "elements": [ { "$type": "Action", "inferredType": { "$type": "InferredType", "name": "OpenHostService" } }, { "$type": "Alternatives", "elements": [ { "$type": "Keyword", "value": "OHS" }, { "$type": "Keyword", "value": "OpenHostService" } ] } ] }, { "$type": "Group", "elements": [ { "$type": "Action", "inferredType": { "$type": "InferredType", "name": "PublishedLanguage" } }, { "$type": "Alternatives", "elements": [ { "$type": "Keyword", "value": "PL" }, { "$type": "Keyword", "value": "PublishedLanguage" } ] } ] }, { "$type": "Group", "elements": [ { "$type": "Action", "inferredType": { "$type": "InferredType", "name": "Conformist" } }, { "$type": "Alternatives", "elements": [ { "$type": "Keyword", "value": "CF" }, { "$type": "Keyword", "value": "Conformist" } ] } ] }, { "$type": "Group", "elements": [ { "$type": "Action", "inferredType": { "$type": "InferredType", "name": "AntiCorruptionLayer" } }, { "$type": "Alternatives", "elements": [ { "$type": "Keyword", "value": "ACL" }, { "$type": "Keyword", "value": "AntiCorruptionLayer" } ] } ] }, { "$type": "Group", "elements": [ { "$type": "Action", "inferredType": { "$type": "InferredType", "name": "Supplier" } }, { "$type": "Alternatives", "elements": [ { "$type": "Keyword", "value": "S" }, { "$type": "Keyword", "value": "Supplier" } ] } ] }, { "$type": "Group", "elements": [ { "$type": "Action", "inferredType": { "$type": "InferredType", "name": "Customer" } }, { "$type": "Alternatives", "elements": [ { "$type": "Keyword", "value": "C" }, { "$type": "Keyword", "value": "Customer" } ] } ] }, { "$type": "Group", "elements": [ { "$type": "Action", "inferredType": { "$type": "InferredType", "name": "BigBallOfMud" } }, { "$type": "Alternatives", "elements": [ { "$type": "Keyword", "value": "BBoM" }, { "$type": "Keyword", "value": "BigBallOfMud" } ] } ] } ] }, "entry": false, "fragment": false, "parameters": [], "$comment": "/**\\n * DDD Side Patterns - describe one side's role in a directional relationship.\\n * Each pattern produces a distinct AST node type via {infer} actions.\\n * Short and long forms parse to the same node type.\\n */" }, { "$type": "ParserRule", "name": "SymmetricPattern", "definition": { "$type": "Alternatives", "elements": [ { "$type": "Group", "elements": [ { "$type": "Action", "inferredType": { "$type": "InferredType", "name": "SharedKernel" } }, { "$type": "Alternatives", "elements": [ { "$type": "Keyword", "value": "SK" }, { "$type": "Keyword", "value": "SharedKernel" } ] } ] }, { "$type": "Group", "elements": [ { "$type": "Action", "inferredType": { "$type": "InferredType", "name": "Partnership" } }, { "$type": "Alternatives", "elements": [ { "$type": "Keyword", "value": "P" }, { "$type": "Keyword", "value": "Partnership" } ] } ] }, { "$type": "Group", "elements": [ { "$type": "Action", "inferredType": { "$type": "InferredType", "name": "SeparateWays" } }, { "$type": "Alternatives", "elements": [ { "$type": "Keyword", "value": "SW" }, { "$type": "Keyword", "value": "SeparateWays" } ] } ] } ] }, "entry": false, "fragment": false, "parameters": [], "$comment": "/**\\n * DDD Symmetric Patterns - describe the relationship between two contexts.\\n * These are mutual/shared patterns, not directional.\\n */" }, { "$type": "ParserRule", "name": "DomainTerm", "definition": { "$type": "Group", "elements": [ { "$type": "Alternatives", "elements": [ { "$type": "Keyword", "value": "Term" }, { "$type": "Keyword", "value": "term" } ] }, { "$type": "Assignment", "feature": "name", "operator": "=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@29" }, "arguments": [] } }, { "$type": "Group", "elements": [ { "$type": "RuleCall", "rule": { "$ref": "#/rules@26" }, "arguments": [] }, { "$type": "Assignment", "feature": "meaning", "operator": "=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@30" }, "arguments": [] } } ], "cardinality": "?" }, { "$type": "Group", "elements": [ { "$type": "Alternatives", "elements": [ { "$type": "Keyword", "value": "aka" }, { "$type": "Keyword", "value": "synonyms" } ] }, { "$type": "RuleCall", "rule": { "$ref": "#/rules@26" }, "arguments": [], "cardinality": "?" }, { "$type": "Assignment", "feature": "synonyms", "operator": "+=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@29" }, "arguments": [] } }, { "$type": "Group", "elements": [ { "$type": "Keyword", "value": "," }, { "$type": "Assignment", "feature": "synonyms", "operator": "+=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@29" }, "arguments": [] } } ], "cardinality": "*" } ], "cardinality": "?" }, { "$type": "Group", "elements": [ { "$type": "Keyword", "value": "examples" }, { "$type": "RuleCall", "rule": { "$ref": "#/rules@26" }, "arguments": [], "cardinality": "?" }, { "$type": "Assignment", "feature": "examples", "operator": "+=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@30" }, "arguments": [] } }, { "$type": "Group", "elements": [ { "$type": "Keyword", "value": "," }, { "$type": "Assignment", "feature": "examples", "operator": "+=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@30" }, "arguments": [] } } ], "cardinality": "*" } ], "cardinality": "?" } ] }, "entry": false, "fragment": false, "parameters": [], "$comment": "/**\\n * Domain Terminology - Ubiquitous language terms with definitions.\\n * Supports synonyms and examples for richer glossaries.\\n * \\n * [Read more on domainlang.net](https://domainlang.net/reference/language#terminology)\\n */" }, { "$type": "ParserRule", "name": "AbstractDecision", "definition": { "$type": "Alternatives", "elements": [ { "$type": "RuleCall", "rule": { "$ref": "#/rules@21" }, "arguments": [] }, { "$type": "RuleCall", "rule": { "$ref": "#/rules@22" }, "arguments": [] }, { "$type": "RuleCall", "rule": { "$ref": "#/rules@23" }, "arguments": [] } ] }, "entry": false, "fragment": false, "parameters": [], "$comment": "/**\\n * Decisions, Policies, and Business Rules.\\n * All types are interchangeable - use what reads best for your domain.\\n * \\n * [Read more on domainlang.net](https://domainlang.net/reference/language#decisions-policies-rules)\\n */" }, { "$type": "ParserRule", "name": "Decision", "definition": { "$type": "Group", "elements": [ { "$type": "Alternatives", "elements": [ { "$type": "Keyword", "value": "Decision" }, { "$type": "Keyword", "value": "decision" } ] }, { "$type": "Group", "elements": [ { "$type": "Keyword", "value": "[" }, { "$type": "Assignment", "feature": "classification", "operator": "=", "terminal": { "$type": "CrossReference", "type": { "$ref": "#/rules@7" }, "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@27" }, "arguments": [] }, "deprecatedSyntax": false, "isMulti": false } }, { "$type": "Keyword", "value": "]" } ], "cardinality": "?" }, { "$type": "Assignment", "feature": "name", "operator": "=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@29" }, "arguments": [] } }, { "$type": "RuleCall", "rule": { "$ref": "#/rules@26" }, "arguments": [] }, { "$type": "Assignment", "feature": "value", "operator": "=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@30" }, "arguments": [] } } ] }, "entry": false, "fragment": false, "parameters": [] }, { "$type": "ParserRule", "name": "Policy", "definition": { "$type": "Group", "elements": [ { "$type": "Alternatives", "elements": [ { "$type": "Keyword", "value": "Policy" }, { "$type": "Keyword", "value": "policy" } ] }, { "$type": "Group", "elements": [ { "$type": "Keyword", "value": "[" }, { "$type": "Assignment", "feature": "classification", "operator": "=", "terminal": { "$type": "CrossReference", "type": { "$ref": "#/rules@7" }, "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@27" }, "arguments": [] }, "deprecatedSyntax": false, "isMulti": false } }, { "$type": "Keyword", "value": "]" } ], "cardinality": "?" }, { "$type": "Assignment", "feature": "name", "operator": "=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@29" }, "arguments": [] } }, { "$type": "RuleCall", "rule": { "$ref": "#/rules@26" }, "arguments": [] }, { "$type": "Assignment", "feature": "value", "operator": "=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@30" }, "arguments": [] } } ] }, "entry": false, "fragment": false, "parameters": [] }, { "$type": "ParserRule", "name": "BusinessRule", "definition": { "$type": "Group", "elements": [ { "$type": "Alternatives", "elements": [ { "$type": "Keyword", "value": "Rule" }, { "$type": "Keyword", "value": "rule" } ] }, { "$type": "Group", "elements": [ { "$type": "Keyword", "value": "[" }, { "$type": "Assignment", "feature": "classification", "operator": "=", "terminal": { "$type": "CrossReference", "type": { "$ref": "#/rules@7" }, "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@27" }, "arguments": [] }, "deprecatedSyntax": false, "isMulti": false } }, { "$type": "Keyword", "value": "]" } ], "cardinality": "?" }, { "$type": "Assignment", "feature": "name", "operator": "=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@29" }, "arguments": [] } }, { "$type": "RuleCall", "rule": { "$ref": "#/rules@26" }, "arguments": [] }, { "$type": "Assignment", "feature": "value", "operator": "=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@30" }, "arguments": [] } } ] }, "entry": false, "fragment": false, "parameters": [] }, { "$type": "ParserRule", "name": "ImportStatement", "definition": { "$type": "Group", "elements": [ { "$type": "Alternatives", "elements": [ { "$type": "Keyword", "value": "Import" }, { "$type": "Keyword", "value": "import" } ] }, { "$type": "Assignment", "feature": "uri", "operator": "=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@30" }, "arguments": [] } }, { "$type": "Group", "elements": [ { "$type": "Keyword", "value": "as" }, { "$type": "Assignment", "feature": "alias", "operator": "=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@29" }, "arguments": [] } } ], "cardinality": "?" } ] }, "entry": false, "fragment": false, "parameters": [], "$comment": "/**\\n * Import Statement - Manifest-centric import system per PRS-010.\\n * \\n * Simplified syntax where import statements use short specifiers:\\n * - External dependencies (from manifest): import \\"core\\" as Core\\n * - Local files: import \\"./shared/types.dlang\\"\\n * - Workspace-relative: import \\"~/contexts/sales.dlang\\"\\n * \\n * All resolution details (source, version, integrity) live in model.yaml manifest.\\n * Named imports and inline integrity checks have been removed per PRS-010.\\n * \\n * [Read more on domainlang.net](https://domainlang.net/reference/language#imports)\\n */" }, { "$type": "ParserRule", "name": "NamespaceDeclaration", "definition": { "$type": "Group", "elements": [ { "$type": "Alternatives", "elements": [ { "$type": "Keyword", "value": "Namespace" }, { "$type": "Keyword", "value": "ns" } ] }, { "$type": "Assignment", "feature": "name", "operator": "=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@27" }, "arguments": [] } }, { "$type": "Keyword", "value": "{" }, { "$type": "Assignment", "feature": "children", "operator": "+=", "terminal": { "$type": "RuleCall", "rule": { "$ref": "#/rules@1" }, "arguments": [] }, "cardinality": "*" }, { "$type": "Keyword", "value": "}" } ] }, "entry": false, "fragment": false, "parameters": [], "$comment": "/**\\n * Namespace Declaration - Hierarchical namespacing for organizing models.\\n * Combines package modularity with group-style nesting.\\n * \\n * [Read more on domainlang.net](https://domainlang.net/reference/language#namespaces)\\n */" }, { "$type": "ParserRule", "name": "Assignment", "dataType": "string", "definition": { "$type": "Alternatives", "elements": [ { "$type": "Keyword", "value": ":" }, { "$type": "Keyword", "value": "is" }, { "$type": "Keyword", "value": "=" } ] }, "entry": false, "fragment": false, "parameters": [], "$comment": "/**\\n * Assignment operators - flexible syntax.\\n */" }, { "$type": "ParserRule", "name": "QualifiedName", "dataType": "string", "definition": { "$type": "Group", "elements": [ { "$type": "RuleCall", "rule": { "$ref": "#/rules@29" }, "arguments": [] }, { "$type": "Group", "elements": [ { "$type": "Keyword", "value": "." }, { "$type": "RuleCall", "rule": { "$ref": "#/rules@29" }, "arguments": [] } ], "cardinality": "*" } ] }, "entry": false, "fragment": false, "parameters": [], "$comment": "/**\\n * Qualified Name - Hierarchical namespacing with dots.\\n */" }, { "$type": "TerminalRule", "hidden": true, "name": "WS", "definition": { "$type": "RegexToken", "regex": "/\\\\s+/", "parenthesized": false }, "fragment": false }, { "$type": "TerminalRule", "name": "ID", "definition": { "$type": "RegexToken", "regex": "/[_a-zA-Z][\\\\w_-]*/", "parenthesized": false }, "fragment": false, "hidden": false }, { "$type": "TerminalRule", "name": "STRING", "definition": { "$type": "RegexToken", "regex": "/\\"(\\\\\\\\.|[^\\"\\\\\\\\])*\\"|'(\\\\\\\\.|[^'\\\\\\\\])*'/", "parenthesized": false }, "fragment": false, "hidden": false }, { "$type": "TerminalRule", "hidden": true, "name": "ML_COMMENT", "definition": { "$type": "RegexToken", "regex": "/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//", "parenthesized": false }, "fragment": false }, { "$type": "TerminalRule", "hidden": true, "name": "SL_COMMENT", "definition": { "$type": "RegexToken", "regex": "/\\\\/\\\\/[^\\\\n\\\\r]*/", "parenthesized": false }, "fragment": false } ], "types": [ { "$type": "Type", "name": "Container", "type": { "$type": "UnionType", "types": [ { "$type": "SimpleType", "typeRef": { "$ref": "#/rules@25" } }, { "$type": "SimpleType", "typeRef": { "$ref": "#/rules@0" } } ] } } ], "imports": [], "interfaces": [] }`));