Add factory creation ports and owner initialization contracts

This commit is contained in:
Timothy J. Aveni
2026-09-19 22:20:55 -07:00
parent 03ac7f8557
commit 0555c929b1
25 changed files with 3899 additions and 3012 deletions
+20 -2
View File
@@ -222,6 +222,7 @@ dependencyPort
| STATE identifier ID stringLiteral COLON valueType primitiveList SEMI
| EDGE identifier ID stringLiteral COLON cardinality targetConstraint primitiveList SEMI
| INTERFACE identifier ID stringLiteral COLON identifier typeArguments? selectedOperations? SEMI
| CREATION identifier ID stringLiteral COLON identifier INPUT valueType SEMI
| CONSTRUCTOR identifier ID stringLiteral COLON identifier (INPUT valueType)? SEMI
| QUERY identifier ID stringLiteral COLON identifier DOT identifier SEMI
;
@@ -255,7 +256,7 @@ stateDecl
;
storagePolicy
: OPTIMISTIC_REGISTER
: REGISTER
| CRDT LPAREN valueType RPAREN
;
@@ -277,9 +278,23 @@ conformanceItem
: PRIVATE attachmentDecl
| operationBindingDecl
| stateFieldBindingDecl
| initializationDecl
| relationshipMaterializationDecl
;
initializationDecl
: INITIALIZE LBRACE initializationField* RBRACE SEMI
;
initializationField
: identifier TO STATE identifier SEMI
| identifier TO EDGE identifier DOT identifier SEMI
;
creationOwnerMapping
: interfaceType FROM INPUT (DOT identifier)* SEMI
;
stateFieldBindingDecl
: BIND identifier TO STATE identifier SEMI
;
@@ -341,6 +356,7 @@ dependencyBinding
| identifier TO STATE identifier (VIA EDGE identifier DOT identifier)? SEMI
| identifier TO EDGE identifier DOT identifier (VIA EDGE identifier DOT identifier)? SEMI
| identifier TO INTERFACE identifier typeArguments? (VIA EDGE identifier DOT identifier)? SEMI
| identifier TO CREATION identifier WITH LBRACE creationOwnerMapping* RBRACE SEMI
| identifier TO CONSTRUCTOR identifier SEMI
| identifier TO WORKSPACE? QUERY identifier DOT identifier (VIA EDGE identifier DOT identifier)? SEMI
;
@@ -433,6 +449,8 @@ stringLiteral
: STRING_LITERAL
;
CREATION: 'creation';
INITIALIZE: 'initialize';
WORKSPACE: 'workspace';
EXECUTION: 'execution';
SNAPSHOT: 'snapshot';
@@ -528,7 +546,7 @@ WATCH_START: 'watch-start';
WATCH_STOP: 'watch-stop';
SUBSCRIBE: 'subscribe';
UNSUBSCRIBE: 'unsubscribe';
OPTIMISTIC_REGISTER: 'optimistic-register';
REGISTER: 'register';
CRDT: 'crdt';
OPTIONAL_ONE: 'optional-one';
EXACTLY_ONE: 'exactly-one';