diff --git a/Resources/KerML-textual-bnf.kebnf b/Resources/KerML-textual-bnf.kebnf new file mode 100644 index 000000000..2837bcfd8 --- /dev/null +++ b/Resources/KerML-textual-bnf.kebnf @@ -0,0 +1,1467 @@ +// Manual corrections by HP de Koning + +// Part 1 - Kernel Modeling Language (KerML) + +// Clause 8.2 Concrete Syntax + +// Clause 8.2.1 Concrete Syntax Overview + +// Clause 8.2.2 Lexical Structure + +// Clause 8.2.2.1 Line Terminators and White Space + +LINE_TERMINATOR = + '\n' | '\r' | '\r\n' +// implementation defined character sequence + +LINE_TEXT = + '[^\r\n]*' +// character sequence excluding LINE_TERMINATORs + +WHITE_SPACE = + ' ' | '\t' | '\f' | LINE_TERMINATOR +// space | tab | form_feed | LINE_TERMINATOR + +// Notes: +// 1. Notation text is divided up into lines separated by line terminators. A line terminator may be a single character (such as a line feed) or a sequence of characters (such as a carriage return/line feed combination). This specification does not require any specific encoding for a line terminator, but any encoding used must be consistent throughout any specific input text. +// 2. Any characters in text line that are not a part of the line terminator are referred to as line text. +// 3. A white space character is a space, tab, form feed or line terminator. Any contiguous sequence of white space characters can be used to separate tokens that would otherwise be considered to be part of a single token. It is otherwise ignored, with the single exception that a line terminator is used to mark the end of a single-line note (see 8.2.2.2). + +// Clause 8.2.2.2 Notes and Comments + +SINGLE_LINE_NOTE = + '//' LINE_TEXT + +MULTILINE_NOTE = + '//*' COMMENT_TEXT '*/' + +REGULAR_COMMENT = + '/*' COMMENT_TEXT '*/' + +COMMENT_TEXT = + ( COMMENT_LINE_TEXT | LINE_TERMINATOR )* + +COMMENT_LINE_TEXT = + '.*(?=(\r|\n|\*/))' +// LINE_TEXT excluding the sequence '*/' + +// Clause 8.2.2.3 Names + +NAME = + BASIC_NAME | UNRESTRICTED_NAME + +BASIC_NAME = + BASIC_INITIAL_CHARACTER BASIC_NAME_CHARACTER* + +SINGLE_QUOTE = + '#x27' + +UNRESTRICTED_NAME = + SINGLE_QUOTE ( NAME_CHARACTER | ESCAPE_SEQUENCE )* SINGLE_QUOTE + +// (See Note 1) + +BASIC_INITIAL_CHARACTER = + ALPHABETIC_CHARACTER | '_' + +BASIC_NAME_CHARACTER = + BASIC_INITIAL_CHARACTER | DECIMAL_DIGIT + +ALPHABETIC_CHARACTER = + 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z' | + 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z' +// any character 'a' through 'z' or 'A' through 'Z' + +DECIMAL_DIGIT = + '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' + +NAME_CHARACTER = + 'any printable character other than backslash or single_quote' + +ESCAPE_SEQUENCE = + '\f' | '\n' | '\t' | '\r' | '\v' +// (See Note 2) + +// Notes: +// 1. The single_quote character is '. The name represented by an UNRESTRICTED_NAME shall consist of the characters within the single quotes, with escape characters resolved as described below. The surrounding single quote characters are not part of the represented name. +// 2. An ESCAPE_SEQUENCE is a sequence of two text characters starting with a backslash that actually denotes only a single character, except for the newline escape sequence, which represents however many characters is necessary to represent an end of line in a specific implementation (see also 8.2.2.1). Table 4 shows the meaning of the allowed escape sequences. The ESCAPE_SEQUENCES in an UNRESTRICTED_NAME shall be replaced by the characters specified as their meanings in the actual represented name. + +// Clause 8.2.2.4 Numeric Values + +DECIMAL_VALUE = + DECIMAL_DIGIT+ + +EXPONENTIAL_VALUE = + DECIMAL_VALUE ('e' | 'E') ('+' | '-')? DECIMAL_VALUE + +// Notes: +// 1. A DECIMAL_VALUE may specify a natural literal, or it may be part of the specification of a real literal (see 8.2.5.8.4). Note that a DECIMAL_VALUE does not include a sign, because negating a literal is an operator in the KerML Expression syntax. +// 2. An EXPONENTIAL_VALUE may be used in the specification of a real literal (see 8.2.5.8.4). Note that a decimal point and fractional part are not included in the lexical structure of an exponential value. They are handled as part of the syntax of real literals. + +// Clause 8.2.2.5 String Value + +STRING_VALUE = + '"' ( STRING_CHARACTER | ESCAPE_SEQUENCE )* '"' + +STRING_CHARACTER = + 'any printable character other than backslash or "' + +// Notes: +// 1. ESCAPE_SEQUENCE is specified in 8.2.2.3. + +// Clause 8.2.2.6 Reserved Words + +RESERVED_KEYWORD = + 'about' | 'abstract' | 'alias' | 'all' | 'and' | 'as' | 'assoc' | 'behavior' | 'binding' | 'bool' | 'by' | 'chains' + | 'class' | 'classifier' | 'comment' | 'composite' | 'conjugate' | 'conjugates' | 'conjugation' | 'connector' + | 'const' | 'crosses' | 'datatype' | 'default' | 'dependency' | 'derived' | 'differences' | 'disjoining' | 'disjoint' + | 'doc' | 'else' | 'end' | 'expr' | 'false' | 'feature' | 'featured' | 'featuring' | 'filter' | 'first' | 'flow' + | 'for' | 'from' | 'function' | 'hastype' | 'if' | 'implies' | 'import' | 'in' | 'inout' | 'interaction' + | 'intersects' | 'inv' | 'inverse' | 'inverting' | 'istype' | 'language' | 'library' | 'locale' | 'member' | 'meta' + | 'metaclass' | 'metadata' | 'multiplicity' | 'namespace' | 'nonunique' | 'not' | 'null' | 'of' | 'or' | 'ordered' + | 'out' | 'package' | 'portion' | 'predicate' | 'private' | 'protected' | 'public' | 'redefines' | 'redefinition' + | 'references' | 'rep' | 'return' | 'specialization' | 'specializes' | 'standard' | 'step' | 'struct' + | 'subclassifier' | 'subset' | 'subsets' | 'subtype' | 'succession' | 'then' | 'to' | 'true' | 'type' | 'typed' + | 'typing' | 'unions' | 'var' | 'xor' + +// Clause 8.2.2.7 Symbols + +RESERVED_SYMBOL = + '~' | '}' | '|' | '{' | '^' | ']' | '[' | '@' | '??' | '?' | '>=' | '>' | '=>' | '===' | '==' | '=' | '<=' | '<' + | ';' | ':>>' | ':>' | ':=' | '::>' | '::' | ':' | '/' | '.?' | '..' | '.' | '->' | '-' | ',' | '+' | '**' | '*' | ')' + | '(' | '&' | '%' | '$' | '#' | '!==' | '!=' + +TYPED_BY = ':' | 'typed' 'by' + +SPECIALIZES = ':>' | 'specializes' + +SUBSETS = ':>' | 'subsets' + +REFERENCES = '::>' | 'references' + +CROSSES = '=>' | 'crosses' + +REDEFINES = ':>>' | 'redefines' + +CONJUGATES = '~' | 'conjugates' + +// Clause 8.2.3 Root Concrete Syntax + +// Clause 8.2.3.1 Elements and Relationships Concrete Syntax + +Identification : Element = + ( '<' declaredShortName = NAME '>' )? + ( declaredName = NAME )? + +RelationshipBody : Relationship = + ';' | '{' RelationshipOwnedElement* '}' + +RelationshipOwnedElement : Relationship = + ownedRelatedElement += OwnedRelatedElement + | ownedRelationship += OwnedAnnotation + +OwnedRelatedElement : Element = + NonFeatureElement | FeatureElement + +// Clause 8.2.3.2 Dependencies Concrete Syntax + +Dependency = + ( ownedRelationship += PrefixMetadataAnnotation )* + 'dependency' ( Identification? 'from' )? + client += [QualifiedName] ( ',' client += [QualifiedName] )* 'to' + supplier += [QualifiedName] ( ',' supplier += [QualifiedName] )* + RelationshipBody + +// Notes: +// 1. PrefixMetadataAnnotation is defined in the Kernel layer (see 8.2.5.12). + +// Clause 8.2.3.3 Annotations Concrete Syntax + +// Clause 8.2.3.3.1 Annotations + +Annotation = + annotatedElement = [QualifiedName] + +OwnedAnnotation : Annotation = + ownedRelatedElement += AnnotatingElement + +AnnotatingElement = + Comment + | Documentation + | TextualRepresentation + | MetadataFeature + +// Notes: +// 1. MetadataFeature is defined in the Kernel layer (see 8.2.5.12). + +// Clause 8.2.3.3.2 Comments and Documentation + +Comment = + ( 'comment' Identification + ( 'about' ownedRelationship += Annotation + ( ',' ownedRelationship += Annotation )* + )? + )? + ( 'locale' locale = STRING_VALUE )? + body = REGULAR_COMMENT + +Documentation = + 'doc' Identification + ( 'locale' locale = STRING_VALUE )? + body = REGULAR_COMMENT + +// Notes: +// 1. The text of a lexical REGULAR_COMMENT or PREFIX_COMMENT shall be processed as follows before it is included as the body of a Comment or Documentation: +// • Remove the initial /* and final */ characters. +// • Remove any white space immediately after the initial /*, up to and including the first line terminator (if any). +// • On each subsequent line of the text: +// • Strip initial white space other than line terminators. +// • Then, if the first remaining character is "*", remove it. +// • Then, if the first remaining character is now a space, remove it. +// 2. The body text of a Comment can include markup information (such as HTML), and a conforming tool may display such text as rendered according to the markup. However, marked up "rich text" for a Comment written using the KerML textual concrete syntax shall be stored in the Comment body in plain text including all mark up text, with all line terminators and white space included as entered, other than what is removed according to the rules above. + +// Clause 8.2.3.3.3 Textual Representation + +TextualRepresentation = + ( 'rep' Identification )? + 'language' language = STRING_VALUE + body = REGULAR_COMMENT + +// Notes: +// 1. The lexical text of a REGULAR_COMMENT shall be processed as specified in 8.2.3.3.2 for Comments before being included as the body of a TextualRepresentation. +// 2. See also 8.3.2.3.6 on the standard language names recognized for a TextualRepresentation. + +// Clause 8.2.3.4 Namespaces Concrete Syntax + +// Clause 8.2.3.4.1 Namespaces + +RootNamespace : Namespace = + NamespaceBodyElement* + +// (See Note 1) + +Namespace = + ( ownedRelationship += PrefixMetadataMember )* + NamespaceDeclaration NamespaceBody + +// (See Note 2) + +NamespaceDeclaration : Namespace = + 'namespace' Identification + +NamespaceBody : Namespace = + ';' | '{' NamespaceBodyElement* '}' + +NamespaceBodyElement : Namespace = + ownedRelationship += NamespaceMember + | ownedRelationship += AliasMember + | ownedRelationship += Import + +MemberPrefix : Membership = + ( visibility = VisibilityIndicator )? + +VisibilityIndicator : VisibilityKind = + 'public' | 'private' | 'protected' + +NamespaceMember : OwningMembership = + NonFeatureMember + | NamespaceFeatureMember + +NonFeatureMember : OwningMembership = + MemberPrefix + ownedRelatedElement += MemberElement + +NamespaceFeatureMember : OwningMembership = + MemberPrefix + ownedRelatedElement += FeatureElement + +AliasMember : Membership = + MemberPrefix + 'alias' ( '<' memberShortName = NAME '>' )? + ( memberName = NAME )? + 'for' memberElement = [QualifiedName] + RelationshipBody + +QualifiedName = + ( '$' '::' )? ( NAME '::' )* NAME + +// (See Note 3) + +// Notes: +// 1. A root Namespace is a Namespace that has no owningNamespace (see 8.3.2.4). Every Element other than a root Namespace must be contained, directly or indirectly, within some root Namespace. Therefore, every valid KerML concrete syntax text can be parsed starting from the RootNamespace production. +// 2. PrefixMetadataMember is defined in the Kernel layer (see 8.2.5.12). +// 3. A qualified name is notated as a sequence of segment names separated by "::" punctuation, optionally with the global scope qualifier "$" as an initial segment. An unqualified name can be considered the degenerate case of a qualified name with a single segment name. A qualified name is used in the KerML textual concrete syntax to identify an Element that is being referred to in the representation of another Element. A qualified name used in this way does not appear in the corresponding abstract syntax—instead, the abstract syntax representation contains an actual reference to the identified Element. Name resolution is the process of determining the Element that is identified by a qualified name. The segment names of the qualified name other than the last identify a sequence of nested Namespaces that provide the context for resolving the final segment name (see 8.2.3.5). The notation [QualifiedName] is used in concrete syntax grammar productions to indicate the result of resolving text parsed as a QualifiedName (see also 8.2.1). + +// Clause 8.2.3.4.2 Imports + +Import = + visibility = VisibilityIndicator + 'import' ( isImportAll ?= 'all' )? + ImportDeclaration RelationshipBody + +ImportDeclaration : Import = + MembershipImport | NamespaceImport + +MembershipImport = + importedMembership = [QualifiedName] + ( '::' isRecursive ?= '**' )? + +// (See Note 1) + +NamespaceImport = + importedNamespace = [QualifiedName] '::' '*' + ( '::' isRecursive ?= '**' )? + | importedNamespace = FilterPackage + { ownedRelatedElement += importedNamespace } + +FilterPackage : Package = + ownedRelationship += ImportDeclaration + ( ownedRelationship += FilterPackageMember )+ + +FilterPackageMember : ElementFilterMembership = + '[' ownedRelatedElement += OwnedExpression ']' + +// Notes: +// 1. The importedMembership of a MembershipImport is the single case in which the Element required from the resolution [QualifiedName] is the actual Membership identified by the QualifedName, not the memberElement of that Membership (see 8.2.3.5). + +// Clause 8.2.3.4.3 Namespace Elements + +MemberElement : Element = + AnnotatingElement | NonFeatureElement + +NonFeatureElement : Element = + Dependency + | Namespace + | Type + | Classifier + | DataType + | Class + | Structure + | Metaclass + | Association + | AssociationStructure + | Interaction + | Behavior + | Function + | Predicate + | Multiplicity + | Package + | LibraryPackage + | Specialization + | Conjugation + | Subclassification + | Disjoining + | FeatureInverting + | FeatureTyping + | Subsetting + | Redefinition + | TypeFeaturing + +FeatureElement : Feature = + Feature + | Step + | Expression + | BooleanExpression + | Invariant + | Connector + | BindingConnector + | Succession + | Flow + | SuccessionFlow + +// Clause 8.2.3.5 Name Resolution + +// Clause 8.2.3.5.1 Name Resolution Overview + +// Clause 8.2.3.5.2 Local and Global Namespaces + +// Clause 8.2.3.5.3 Local and Visible Resolution + +// Clause 8.2.3.5.4 Full Resolution + +// Clause 8.2.4 Core Concrete Syntax + +// Clause 8.2.4.1 Types Concrete Syntax + +// Clause 8.2.4.1.1 Types + +Type = + TypePrefix 'type' + TypeDeclaration TypeBody + +TypePrefix : Type = + ( isAbstract ?= 'abstract' )? + ( ownedRelationship += PrefixMetadataMember )* + +TypeDeclaration : Type = + ( isSufficient ?= 'all' )? Identification + ( ownedRelationship += OwnedMultiplicity )? + ( SpecializationPart | ConjugationPart )+ + TypeRelationshipPart* + +SpecializationPart : Type = + SPECIALIZES ownedRelationship += OwnedSpecialization + ( ',' ownedRelationship += OwnedSpecialization )* + +ConjugationPart : Type = + CONJUGATES ownedRelationship += OwnedConjugation + +TypeRelationshipPart : Type = + DisjoiningPart + | UnioningPart + | IntersectingPart + | DifferencingPart + +DisjoiningPart : Type = + 'disjoint' 'from' ownedRelationship += OwnedDisjoining + ( ',' ownedRelationship += OwnedDisjoining )* + +UnioningPart : Type = + 'unions' ownedRelationship += Unioning + ( ',' ownedRelationship += Unioning )* + +IntersectingPart : Type = + 'intersects' ownedRelationship += Intersecting + ( ',' ownedRelationship += Intersecting )* + +DifferencingPart : Type = + 'differences' ownedRelationship += Differencing + ( ',' ownedRelationship += Differencing )* + +TypeBody : Type = + ';' | '{' TypeBodyElement* '}' + +TypeBodyElement : Type = + ownedRelationship += NonFeatureMember + | ownedRelationship += FeatureMember + | ownedRelationship += AliasMember + | ownedRelationship += Import + +// Clause 8.2.4.1.2 Specialization + +Specialization = + ( 'specialization' Identification )? + 'subtype' SpecificType + SPECIALIZES GeneralType + RelationshipBody + +OwnedSpecialization : Specialization = + GeneralType + +SpecificType : Specialization = + specific = [QualifiedName] + | specific += OwnedFeatureChain + { ownedRelatedElement += specific } + +GeneralType : Specialization = + general = [QualifiedName] + | general += OwnedFeatureChain + { ownedRelatedElement += general } + +// Clause 8.2.4.1.3 Conjugation + +Conjugation = + ( 'conjugation' Identification )? + 'conjugate' + ( conjugatedType = [QualifiedName] + | conjugatedType = FeatureChain + { ownedRelatedElement += conjugatedType } + ) + CONJUGATES + ( originalType = [QualifiedName] + | originalType = FeatureChain + { ownedRelatedElement += originalType } + ) + RelationshipBody + +OwnedConjugation : Conjugation = + originalType = [QualifiedName] + | originalType = FeatureChain + { ownedRelatedElement += originalType } + +// Clause 8.2.4.1.4 Disjoining + +Disjoining = + ( 'disjoining' Identification )? + 'disjoint' + ( typeDisjoined = [QualifiedName] + | typeDisjoined = FeatureChain + { ownedRelatedElement += typeDisjoined } + ) + 'from' + ( disjoiningType = [QualifiedName] + | disjoiningType = FeatureChain + { ownedRelatedElement += disjoiningType } + ) + RelationshipBody + +OwnedDisjoining : Disjoining = + disjoiningType = [QualifiedName] + | disjoiningType = FeatureChain + { ownedRelatedElement += disjoiningType } + +// Clause 8.2.4.1.5 Unioning, Intersecting and Differencing + +Unioning = + unioningType = [QualifiedName] + | ownedRelatedElement += OwnedFeatureChain + +Intersecting = + intersectingType = [QualifiedName] + | ownedRelatedElement += OwnedFeatureChain + +Differencing = + differencingType = [QualifiedName] + | ownedRelatedElement += OwnedFeatureChain + +// Clause 8.2.4.1.6 Feature Membership + +FeatureMember : OwningMembership = + TypeFeatureMember + | OwnedFeatureMember + +TypeFeatureMember : OwningMembership = + MemberPrefix 'member' ownedRelatedElement += FeatureElement + +OwnedFeatureMember : FeatureMembership = + MemberPrefix ownedRelatedElement += FeatureElement + +// Clause 8.2.4.2 Classifiers Concrete Syntax + +// Clause 8.2.4.2.1 Classifiers + +Classifier = + TypePrefix 'classifier' + ClassifierDeclaration TypeBody + +ClassifierDeclaration : Classifier = + ( isSufficient ?= 'all' )? Identification + ( ownedRelationship += OwnedMultiplicity )? + ( SuperclassingPart | ConjugationPart )? + TypeRelationshipPart* + +SuperclassingPart : Classifier = + SPECIALIZES ownedRelationship += OwnedSubclassification + ( ',' ownedRelationship += OwnedSubclassification )* + +// Clause 8.2.4.2.2 Subclassification + +Subclassification = + ( 'specialization' Identification )? + 'subclassifier' subclassifier = [QualifiedName] + SPECIALIZES superclassifier = [QualifiedName] + RelationshipBody + +OwnedSubclassification : Subclassification = + superclassifier = [QualifiedName] + +// Clause 8.2.4.3 Features Concrete Syntax + +// Clause 8.2.4.3.1 Features + +Feature = + ( FeaturePrefix + ( 'feature' | ownedRelationship += PrefixMetadataMember ) + FeatureDeclaration? + | ( EndFeaturePrefix | BasicFeaturePrefix ) + FeatureDeclaration + ) + ValuePart? TypeBody + +// (See Note 1) + +EndFeaturePrefix : Feature = + ( isConstant ?= 'const' { isVariable = true } )? + isEnd ?= 'end' + +BasicFeaturePrefix : Feature = + ( direction = FeatureDirection )? + ( isDerived ?= 'derived' )? + ( isAbstract ?= 'abstract' )? + ( isComposite ?= 'composite' | isPortion ?= 'portion' )? + ( isVariable ?= 'var' | isConstant ?= 'const' { isVariable = true } )? + +FeaturePrefix = + ( EndFeaturePrefix ( ownedRelationship += OwnedCrossFeatureMember )? + | BasicFeaturePrefix + ) + ( ownedRelationship += PrefixMetadataMember )* + +// (See Note 1) + +OwnedCrossFeatureMember : OwningMembership = + ownedRelatedElement += OwnedCrossFeature + +OwnedCrossFeature : Feature = + BasicFeaturePrefix FeatureDeclaration + +FeatureDirection : FeatureDirectionKind = + 'in' | 'out' | 'inout' + +FeatureDeclaration : Feature = + ( isSufficient ?= 'all' )? + ( FeatureIdentification + ( FeatureSpecializationPart | ConjugationPart )? + | FeatureSpecializationPart + | ConjugationPart + ) + FeatureRelationshipPart* + +FeatureIdentification : Feature = + '<' declaredShortName = NAME '>' ( declaredName = NAME )? + | declaredName = NAME + +FeatureRelationshipPart : Feature = + TypeRelationshipPart + | ChainingPart + | InvertingPart + | TypeFeaturingPart + +ChainingPart : Feature = + 'chains' + ( ownedRelationship += OwnedFeatureChaining + | FeatureChain ) + +InvertingPart : Feature = + 'inverse' 'of' ownedRelationship += OwnedFeatureInverting + +TypeFeaturingPart : Feature = + 'featured' 'by' ownedRelationship += OwnedTypeFeaturing + ( ',' ownedTypeFeaturing += OwnedTypeFeaturing )* + +FeatureSpecializationPart : Feature = + FeatureSpecialization+ MultiplicityPart? FeatureSpecialization* + | MultiplicityPart FeatureSpecialization* + +MultiplicityPart : Feature = + ownedRelationship += OwnedMultiplicity + | ( ownedRelationship += OwnedMultiplicity )? + ( isOrdered ?= 'ordered' ( {isUnique = false} 'nonunique' )? + | {isUnique = false} 'nonunique' ( isOrdered ?= 'ordered' )? ) + +FeatureSpecialization : Feature = + Typings | Subsettings | References | Crosses | Redefinitions + +Typings : Feature = + TypedBy ( ',' ownedRelationship += OwnedFeatureTyping )* + +TypedBy : Feature = + TYPED_BY ownedRelationship += OwnedFeatureTyping + +Subsettings : Feature = + Subsets ( ',' ownedRelationship += OwnedSubsetting )* + +Subsets : Feature = + SUBSETS ownedRelationship += OwnedSubsetting + +References : Feature = + REFERENCES ownedRelationship += OwnedReferenceSubsetting + +Crosses : Feature = + CROSSES ownedRelationship += OwnedCrossSubsetting + +Redefinitions : Feature = + Redefines ( ',' ownedRelationship += OwnedRedefinition )* + +Redefines : Feature = + REDEFINES ownedRelationship += OwnedRedefinition + +// Notes: +// 1. PrefixMetadataMember is defined in the Kernel layer (see 8.3.4.12). + +// Clause 8.2.4.3.2 Feature Typing + +FeatureTyping = + ( 'specialization' Identification )? + 'typing' typedFeature = [QualifiedName] + TYPED_BY GeneralType + RelationshipBody + +OwnedFeatureTyping : FeatureTyping = + GeneralType + +// Clause 8.2.4.3.3 Subsetting + +Subsetting = + ( 'specialization' Identification )? + 'subset' SpecificType + SUBSETS GeneralType + RelationshipBody + +OwnedSubsetting : Subsetting = + GeneralType + +OwnedReferenceSubsetting : ReferenceSubsetting = + GeneralType + +OwnedCrossSubsetting : CrossSubsetting = + GeneralType + +// Clause 8.2.4.3.4 Redefinition + +Redefinition = + ( 'specialization' Identification )? + 'redefinition' SpecificType + REDEFINES GeneralType + RelationshipBody + +OwnedRedefinition : Redefinition = + GeneralType + +// Clause 8.2.4.3.5 Feature Chaining + +OwnedFeatureChain : Feature = + FeatureChain + +FeatureChain : Feature = + ownedRelationship += OwnedFeatureChaining + ( '.' ownedRelationship += OwnedFeatureChaining )+ + +OwnedFeatureChaining : FeatureChaining = + chainingFeature = [QualifiedName] + +// Clause 8.2.4.3.6 Feature Inverting + +FeatureInverting = + ( 'inverting' Identification? )? + 'inverse' + ( featureInverted = [QualifiedName] + | featureInverted = OwnedFeatureChain + { ownedRelatedElement += featureInverted } + ) + 'of' + ( invertingFeature = [QualifiedName] + | ownedRelatedElement += OwnedFeatureChain + { ownedRelatedElement += invertingFeature } + ) + RelationshipBody + +OwnedFeatureInverting : FeatureInverting = + invertingFeature = [QualifiedName] + | invertingFeature = OwnedFeatureChain + { ownedRelatedElement += invertingFeature } + +// Clause 8.2.4.3.7 Type Featuring + +TypeFeaturing = + 'featuring' ( Identification 'of' )? + featureOfType = [QualifiedName] + 'by' featuringType = [QualifiedName] + RelationshipBody + +OwnedTypeFeaturing : TypeFeaturing = + featuringType = [QualifiedName] + +// Clause 8.2.5 Kernel Concrete Syntax + +// Clause 8.2.5.1 Data Types Concrete Syntax + +DataType = + TypePrefix 'datatype' + ClassifierDeclaration TypeBody + +// Clause 8.2.5.2 Classes Concrete Syntax + +Class = + TypePrefix 'class' + ClassifierDeclaration TypeBody + +// Clause 8.2.5.3 Structures Concrete Syntax + +Structure = + TypePrefix 'struct' + ClassifierDeclaration TypeBody + +// Clause 8.2.5.4 Associations Concrete Syntax + +Association = + TypePrefix 'assoc' + ClassifierDeclaration TypeBody + +AssociationStructure = + TypePrefix 'assoc' 'struct' + ClassifierDeclaration TypeBody + +// Clause 8.2.5.5 Connectors Concrete Syntax + +// Clause 8.2.5.5.1 Connectors + +Connector = + FeaturePrefix 'connector' + ( FeatureDeclaration? ValuePart? + | ConnectorDeclaration + ) + TypeBody + +ConnectorDeclaration : Connector = + BinaryConnectorDeclaration | NaryConnectorDeclaration + +BinaryConnectorDeclaration : Connector = + ( FeatureDeclaration? 'from' | isSufficient ?= 'all' 'from'? )? + ownedRelationship += ConnectorEndMember 'to' + ownedRelationship += ConnectorEndMember + +NaryConnectorDeclaration : Connector = + FeatureDeclaration? + '(' ownedRelationship += ConnectorEndMember ',' + ownedRelationship += ConnectorEndMember + ( ',' ownedRelationship += ConnectorEndMember )* + ')' + +ConnectorEndMember : EndFeatureMembership = + ownedRelatedElement += ConnectorEnd + +ConnectorEnd : Feature = + ( ownedRelationship += OwnedCrossMultiplicityMember )? + ( declaredName = NAME REFERENCES )? + ownedRelationship += OwnedReferenceSubsetting + +OwnedCrossMultiplicityMember : OwningMembership = + ownedRelatedElement += OwnedCrossMultiplicity + +OwnedCrossMultiplicity : Feature = + ownedRelationship += OwnedMultiplicity + +// Clause 8.2.5.5.2 Binding Connectors + +BindingConnector = + FeaturePrefix 'binding' + BindingConnectorDeclaration TypeBody + +BindingConnectorDeclaration : BindingConnector = + FeatureDeclaration + ( 'of' ownedRelationship += ConnectorEndMember + '=' ownedRelationship += ConnectorEndMember )? + | ( isSufficient ?= 'all' )? + ( 'of'? ownedRelationship += ConnectorEndMember + '=' ownedRelationship += ConnectorEndMember )? + +// Clause 8.2.5.5.3 Successions + +Succession = + FeaturePrefix 'succession' + SuccessionDeclaration TypeBody + +SuccessionDeclaration : Succession = + FeatureDeclaration + ( 'first' ownedRelationship += ConnectorEndMember + 'then' ownedRelationship += ConnectorEndMember )? + | ( s.isSufficient ?= 'all' )? + ( 'first'? ownedRelationship += ConnectorEndMember + 'then' ownedRelationship += ConnectorEndMember )? + +// Clause 8.2.5.6 Behaviors Concrete Syntax + +// Clause 8.2.5.6.1 Behaviors + +Behavior = + TypePrefix 'behavior' + ClassifierDeclaration TypeBody + +// Clause 8.2.5.6.2 Steps + +Step = + FeaturePrefix + 'step' FeatureDeclaration ValuePart? + TypeBody + +// Clause 8.2.5.7 Functions Concrete Syntax + +// Clause 8.2.5.7.1 Functions + +Function = + TypePrefix 'function' + ClassifierDeclaration FunctionBody + +FunctionBody : Type = + ';' | '{' FunctionBodyPart '}' + +FunctionBodyPart : Type = + ( TypeBodyElement + | ownedRelationship += ReturnFeatureMember + )* + ( ownedRelationship += ResultExpressionMember )? + +ReturnFeatureMember : ReturnParameterMembership = + MemberPrefix 'return' + ownedRelatedElement += FeatureElement + +ResultExpressionMember : ResultExpressionMembership = + MemberPrefix + ownedRelatedElement += OwnedExpression + +// Clause 8.2.5.7.2 Expressions + +Expression = + FeaturePrefix + 'expr' FeatureDeclaration ValuePart? + FunctionBody + +// Clause 8.2.5.7.3 Predicates + +Predicate = + TypePrefix 'predicate' + ClassifierDeclaration FunctionBody + +// Clause 8.2.5.7.4 Boolean Expressions and Invariants + +BooleanExpression = + FeaturePrefix + 'bool' FeatureDeclaration ValuePart? + FunctionBody + +Invariant = + FeaturePrefix + 'inv' ( 'true' | isNegated ?= 'false' )? + FeatureDeclaration ValuePart? + FunctionBody + +// Clause 8.2.5.8 Expressions Concrete Syntax + +// Clause 8.2.5.8.1 Operator Expressions + +OwnedExpressionReferenceMember : FeatureMembership = + ownedRelationship += OwnedExpressionReference + +OwnedExpressionReference : FeatureReferenceExpression = + ownedRelationship += OwnedExpressionMember + +OwnedExpressionMember : FeatureMembership = + ownedFeatureMember = OwnedExpression + +OwnedExpression : Expression = + ConditionalExpression + | ConditionalBinaryOperatorExpression + | BinaryOperatorExpression + | UnaryOperatorExpression + | ClassificationExpression + | MetaclassificationExpression + | ExtentExpression + | PrimaryExpression + +ConditionalExpression : OperatorExpression = + operator = 'if' + ownedRelationship += ArgumentMember '?' + ownedRelationship += ArgumentExpressionMember 'else' + ownedRelationship += ArgumentExpressionMember + ownedRelationship += EmptyResultMember + +ConditionalBinaryOperatorExpression : OperatorExpression = + ownedRelationship += ArgumentMember + operator = ConditionalBinaryOperator + ownedRelationship += ArgumentExpressionMember + ownedRelationship += EmptyResultMember + +ConditionalBinaryOperator = + '??' | 'or' | 'and' | 'implies' + +BinaryOperatorExpression : OperatorExpression = + ownedRelationship += ArgumentMember + operator = BinaryOperator + ownedRelationship += ArgumentMember + ownedRelationship += EmptyResultMember + +BinaryOperator = + '|' | '&' | 'xor' | '..' + | '==' | '!=' | '===' | '!==' + | '<' | '>' | '<=' | '>=' + | '+' | '-' | '*' | '/' + | '%' | '^' | '**' + +UnaryOperatorExpression : OperatorExpression = + operator = UnaryOperator + ownedRelationship += ArgumentMember + ownedRelationship += EmptyResultMember + +UnaryOperator = + '+' | '-' | '~' | 'not' + +ClassificationExpression : OperatorExpression = + ( ownedRelationship += ArgumentMember )? + ( operator = ClassificationTestOperator + ownedRelationship += TypeReferenceMember + | operator = CastOperator + ownedRelationship += TypeResultMember + ) + ownedRelationship += EmptyResultMember + +ClassificationTestOperator = + 'istype' | 'hastype' | '@' + +CastOperator = + 'as' + +MetaclassificationExpression : OperatorExpression = + ownedRelationship += MetadataArgumentMember + ( operator = ClassificationTestOperator + ownedRelationship += TypeReferenceMember + | operator = MetaCastOperator + ownedRelationship += TypeResultMember + ) + ownedRelationship += EmptyResultMember + +ArgumentMember : ParameterMembership = + ownedMemberParameter = Argument + +Argument : Feature = + ownedRelationship += ArgumentValue + +ArgumentValue : FeatureValue = + value = OwnedExpression + +ArgumentExpressionMember : FeatureMembership = + ownedRelatedElement += ArgumentExpression + +ArgumentExpression : Feature = + ownedRelationship += ArgumentExpressionValue + +ArgumentExpressionValue : FeatureValue = + value = OwnedExpressionReference + +MetadataArgumentMember : ParameterMembership = + ownedRelatedElement += MetadataArgument + +MetadataArgument : Feature = + ownedRelationship += MetadataValue + +MetadataValue : FeatureValue = + value = MetadataReference + +MetadataReference : MetadataAccessExpression = + ownedRelationship += ElementReferenceMember + +MetaclassificationTestOperator = + '@@' + +MetaCastOperator = + 'meta' + +ExtentExpression : OperatorExpression = + operator = 'all' + ownedRelationship += TypeReferenceMember + +TypeReferenceMember : ParameterMembership = + ownedMemberFeature = TypeReference + +TypeResultMember : ResultParameterMembership = + ownedMemberFeature = TypeReference + +TypeReference : Feature = + ownedRelationship += ReferenceTyping + +ReferenceTyping : FeatureTyping = + type = [QualifiedName] + +EmptyResultMember : ReturnParameterMembership = + ownedRelatedElement += EmptyFeature + +EmptyFeature : Feature = + { } + +// Notes: +// 1. OperatorExpressions provide a shorthand notation for InvocationExpressions that invoke a library Function represented as an operator symbol. Table 5 shows the mapping from operator symbols to the Functions they represent from the Kernel Model Library (see Clause 9). An OperatorExpression contains subexpressions called its operands that generally correspond to the argument Expressions of the OperatorExpression, except in the case of operators representing control Functions, in which case the evaluation of certain operands is as determined by the Function (see 8.4.4.9 for details). +// 2. Though not directly expressed in the syntactic productions given above, in any OperatorExpression containing nested OperatorExpressions, the nested OperatorExpressions shall be implicitly grouped according to the precedence of the operators involved, as given in Table 6. OperatorExpressions with higher precedence operators shall be grouped more tightly than those with lower precedence operators. Further, all BinaryOperators other than exponentiation are left-associative (i.e, they group to the left), while the exponentiation operators (^ and **) are right-associative (i.e., they group to the right). +// 3. The unary operator symbol ~ maps to the library Function DataFunctions::'~', as shown in Table 5. This abstract Function may be given a concrete definition in a domain-specific Function library, but no default definition is provided in the Kernel Functions Library. If no domain-specific definition is available, a tool should give a warning if this operator is used. + +// Clause 8.2.5.8.2 Primary Expressions + +PrimaryExpression : Expression = + FeatureChainExpression + | NonFeatureChainPrimaryExpression + +PrimaryArgumentValue : FeatureValue = + value = PrimaryExpression + +PrimaryArgument : Feature = + ownedRelationship += PrimaryArgumentValue + +PrimaryArgumentMember : ParameterMembership = + ownedMemberParameter = PrimaryArgument + +NonFeatureChainPrimaryExpression : Expression = + BracketExpression + | IndexExpression + | SequenceExpression + | SelectExpression + | CollectExpression + | FunctionOperationExpression + | BaseExpression + +NonFeatureChainPrimaryArgumentValue : FeatureValue = + value = NonFeatureChainPrimaryExpression + +NonFeatureChainPrimaryArgument : Feature = + ownedRelationship += NonFeatureChainPrimaryArgumentValue + +NonFeatureChainPrimaryArgumentMember : ParameterMembership = + ownedMemberParameter = PrimaryArgument + +BracketExpression : OperatorExpression = + ownedRelationship += PrimaryArgumentMember + operator = '[' + ownedRelationship += SequenceExpressionListMember ']' + +IndexExpression = + ownedRelationship += PrimaryArgumentMember '#' + '(' ownedRelationship += SequenceExpressionListMember ')' + +SequenceExpression : Expression = + '(' SequenceExpressionList ')' + +SequenceExpressionList : Expression = + OwnedExpression ','? | SequenceOperatorExpression + +SequenceOperatorExpression : OperatorExpression = + ownedRelationship += OwnedExpressionMember + operator = ',' + ownedRelationship += SequenceExpressionListMember + +SequenceExpressionListMember : FeatureMembership = + ownedMemberFeature = SequenceExpressionList + +FeatureChainExpression = + ownedRelationship += NonFeatureChainPrimaryArgumentMember '.' + ownedRelationship += FeatureChainMember + +CollectExpression = + ownedRelationship += PrimaryArgumentMember '.' + ownedRelationship += BodyArgumentMember + +SelectExpression = + ownedRelationship += PrimaryArgumentMember '.?' + ownedRelationship += BodyArgumentMember + +FunctionOperationExpression : InvocationExpression = + ownedRelationship += PrimaryArgumentMember '->' + ownedRelationship += InvocationTypeMember + ( ownedRelationship += BodyArgumentMember + | ownedRelationship += FunctionReferenceArgumentMember + | ArgumentList ) + ownedRelationship += EmptyResultMember + +BodyArgumentMember : ParameterMembership = + ownedMemberParameter = BodyArgument + +BodyArgument : Feature = + ownedRelationship += BodyArgumentValue + +BodyArgumentValue : FeatureValue = + value = BodyExpression + +FunctionReferenceArgumentMember : ParameterMembership = + ownedMemberParameter = FunctionReferenceArgument + +FunctionReferenceArgument : Feature = + ownedRelationship += FunctionReferenceArgumentValue + +FunctionReferenceArgumentValue : FeatureValue = + value = FunctionReferenceExpression + +FunctionReferenceExpression : FeatureReferenceExpression = + ownedRelationship += FunctionReferenceMember + +FunctionReferenceMember : FeatureMembership = + ownedMemberFeature = FunctionReference + +FunctionReference : Expression = + ownedRelationship += ReferenceTyping + +FeatureChainMember : Membership = + FeatureReferenceMember + | OwnedFeatureChainMember + +OwnedFeatureChainMember : OwningMembership = + ownedMemberElement = FeatureChain + +// Notes: +// 1. Primary expressions provide additional shorthand notations for certain kinds of InvocationExpressions. For those cases in which the InvocationExpression is an OperatorExpression, its operator shall be resolved to the appropriate library function as given in Table 7. Note also that, for a CollectionExpression or SelectExpression, the abstract syntax constrains the operator to be collect and select, respectively, separately from the . and .? symbols used in their concrete syntax notation (see 8.3.4.8.2 and 8.3.4.8.18). +// 2. The grammar allows a bracket syntax [...]that parses to an invocation of the library Function BaseFunctions::'[', as shown in Table 7. This notation is available for use with domain-specific library models that given a concrete definition to the abstract base '[' Function, but no default definition is provided in the Kernel Functions Library. If no domain-specific definition is available, a tool should give a warning if this operator is used. + +// Clause 8.2.5.8.3 Base Expressions + +BaseExpression : Expression = + NullExpression + | LiteralExpression + | FeatureReferenceExpression + | MetadataAccessExpression + | InvocationExpression + | ConstructorExpression + | BodyExpression + +NullExpression : NullExpression = + 'null' | '(' ')' + +FeatureReferenceExpression : FeatureReferenceExpression = + ownedRelationship += FeatureReferenceMember + ownedRelationship += EmptyResultMember + +FeatureReferenceMember : Membership = + memberElement = FeatureReference + +FeatureReference : Feature = + [QualifiedName] + +MetadataAccessExpression = + ownedRelationship += ElementReferenceMember '.' 'metadata' + +ElementReferenceMember : Membership = + memberElement = [QualifiedName] + +InvocationExpression : InvocationExpression = + ownedRelationship += InstantiatedTypeMember + ArgumentList + ownedRelationship += EmptyResultMember + +ConstructorExpression = + 'new' ownedRelationship += InstantiatedTypeMember + ownedRelationship += ConstructorResultMember + +ConstructorResultMember : ReturnParameterMembership = + ownedRelatedElement += ConstructorResult + +ConstructorResult : Feature = + ArgumentList + +InstantiatedTypeMember : Membership = + memberElement = InstantiatedTypeReference + | OwnedFeatureChainMember + +InstantiatedTypeReference : Type = + [QualifiedName] + +ArgumentList : Feature = + '(' ( PositionalArgumentList | NamedArgumentList )? ')' + +PositionalArgumentList : Feature = + e.ownedRelationship += ArgumentMember + ( ',' e.ownedRelationship += ArgumentMember )* + +NamedArgumentList : Feature = + ownedRelationship += NamedArgumentMember + ( ',' ownedRelationship += NamedArgumentMember )* + +NamedArgumentMember : FeatureMembership = + ownedMemberFeature = NamedArgument + +NamedArgument : Feature = + ownedRelationship += ParameterRedefinition '=' + ownedRelationship += ArgumentValue + +ParameterRedefinition : Redefinition = + redefinedFeature = [QualifiedName] + +BodyExpression : FeatureReferenceExpression = + ownedRelationship += ExpressionBodyMember + +ExpressionBodyMember : FeatureMembership = + ownedMemberFeature = ExpressionBody + +ExpressionBody : Expression = + '{' FunctionBodyPart '}' + +// Clause 8.2.5.8.4 Literal Expressions + +LiteralExpression = + LiteralBoolean + | LiteralString + | LiteralInteger + | LiteralReal + | LiteralInfinity + +LiteralBoolean = + value = BooleanValue + +BooleanValue : Boolean = + 'true' | 'false' + +LiteralString = + value = STRING_VALUE + +LiteralInteger = + value = DECIMAL_VALUE + +LiteralReal = + value = RealValue + +RealValue : Real = + DECIMAL_VALUE? '.' ( DECIMAL_VALUE | EXPONENTIAL_VALUE ) + | EXPONENTIAL_VALUE + +LiteralInfinity = + '*' + +// Clause 8.2.5.9 Interactions Concrete Syntax + +// Clause 8.2.5.9.1 Interactions + +Interaction = + TypePrefix 'interaction' + ClassifierDeclaration TypeBody + +// Clause 8.2.5.9.2 Flows + +Flow = + FeaturePrefix 'flow' + FlowDeclaration TypeBody + +SuccessionFlow = + FeaturePrefix 'succession' 'flow' + FlowDeclaration TypeBody + +FlowDeclaration : Flow = + FeatureDeclaration ValuePart? + ( 'of' ownedRelationship += PayloadFeatureMember )? + ( 'from' ownedRelationship += FlowEndMember + 'to' ownedRelationship += FlowEndMember )? + | ( isSufficient ?= 'all' )? + ownedRelationship += FlowEndMember 'to' + ownedRelationship += FlowEndMember + +PayloadFeatureMember : FeatureMembership = + ownedRelatedElement = PayloadFeature + +PayloadFeature = + Identification PayloadFeatureSpecializationPart ValuePart? + | Identification ValuePart + | ownedRelationship += OwnedFeatureTyping + ( ownedRelationship += OwnedMultiplicity )? + | ownedRelationship += OwnedMultiplicity + ( ownedRelationship += OwnedFeatureTyping )? + +PayloadFeatureSpecializationPart : Feature = + FeatureSpecialization+ MultiplicityPart? + FeatureSpecialization* + | MultiplicityPart FeatureSpecialization+ + +FlowEndMember : EndFeatureMembership = + ownedRelatedElement += FlowEnd + +FlowEnd = + ( ownedRelationship += OwnedReferenceSubsetting '.' )? + ownedRelationship += FlowFeatureMember + +FlowFeatureMember : FeatureMembership = + ownedRelatedElement += FlowFeature + +FlowFeature : Feature = + ownedRelationship += FlowFeatureRedefinition + +// (See Note 1) + +FlowFeatureRedefinition : Redefinition = + redefinedFeature = [QualifiedName] + +// Notes: +// 1. To ensure that an FlowFeature passes the validateRedefinitionDirectionConformance constraint (see 8.3.3.3.8), its direction must be set to the direction of its redefinedFeature, relative to its owning FlowEnd, that is, the result of the following OCL expression: owningType.directionOf(ownedRedefinition->at(1).redefinedFeature) + +// Clause 8.2.5.10 Feature Values Concrete Syntax + +ValuePart : Feature = + ownedRelationship += FeatureValue + +FeatureValue = + ( '=' + | isInitial ?= ':=' + | isDefault ?= 'default' ( '=' | isInitial ?= ':=' )? + ) + ownedRelatedElement += OwnedExpression + +// Clause 8.2.5.11 Multiplicities Concrete Syntax + +Multiplicity = + MultiplicitySubset | MultiplicityRange + +MultiplicitySubset : Multiplicity = + 'multiplicity' Identification Subsets + TypeBody + +MultiplicityRange = + 'multiplicity' Identification MultiplicityBounds + TypeBody + +OwnedMultiplicity : OwningMembership = + ownedRelatedElement += OwnedMultiplicityRange + +OwnedMultiplicityRange : MultiplicityRange = + MultiplicityBounds + +MultiplicityBounds : MultiplicityRange = + '[' ( ownedRelationship += MultiplicityExpressionMember '..' )? + ownedRelationship += MultiplicityExpressionMember ']' + +MultiplicityExpressionMember : OwningMembership = + ownedRelatedElement += ( LiteralExpression | FeatureReferenceExpression ) + +// Clause 8.2.5.12 Metadata Concrete Syntax + +Metaclass = + TypePrefix 'metaclass' + ClassifierDeclaration TypeBody + +PrefixMetadataAnnotation : Annotation = + '#' ownedRelatedElement += PrefixMetadataFeature + +PrefixMetadataMember : OwningMembership = + '#' ownedRelatedElement += PrefixMetadataFeature + +PrefixMetadataFeature : MetadataFeature = + ownedRelationship += OwnedFeatureTyping + +MetadataFeature = + ( ownedRelationship += PrefixMetadataMember )* + ( '@' | 'metadata' ) + MetadataFeatureDeclaration + ( 'about' ownedRelationship += Annotation + ( ',' ownedRelationship += Annotation )* + )? + MetadataBody + +MetadataFeatureDeclaration : MetadataFeature = + ( Identification ( ':' | 'typed' 'by' ) )? + ownedRelationship += OwnedFeatureTyping + +MetadataBody : Feature = + ';' | '{' ( ownedRelationship += MetadataBodyElement )* '}' + +MetadataBodyElement : Membership = + NonFeatureMember + | MetadataBodyFeatureMember + | AliasMember + | Import + +MetadataBodyFeatureMember : FeatureMembership = + ownedMemberFeature = MetadataBodyFeature + +MetadataBodyFeature : Feature = + 'feature'? ( ':>>' | 'redefines')? ownedRelationship += OwnedRedefinition + FeatureSpecializationPart? ValuePart? + MetadataBody + +// Clause 8.2.5.13 Packages Concrete Syntax + +Package = + ( ownedRelationship += PrefixMetadataMember )* + PackageDeclaration PackageBody + +LibraryPackage = + ( isStandard ?= 'standard' ) 'library' + ( ownedRelationship += PrefixMetadataMember )* + PackageDeclaration PackageBody + +PackageDeclaration : Package = + 'package' Identification + +PackageBody : Package = + ';' + | '{' ( NamespaceBodyElement + | ownedRelationship += ElementFilterMember + )* + '}' + +ElementFilterMember : ElementFilterMembership = + MemberPrefix + 'filter' condition = OwnedExpression ';' + +// End of BNF + + diff --git a/Resources/SysML-textual-bnf.kebnf b/Resources/SysML-textual-bnf.kebnf new file mode 100644 index 000000000..e5c771e9e --- /dev/null +++ b/Resources/SysML-textual-bnf.kebnf @@ -0,0 +1,1705 @@ +// Manual corrections by HP de Koning + +// Part 2 - Systems Modeling Language (SysML) + +// Clause 8.2.2 Textual Notation + +// Clause 8.2.2.1 Textual Notation Overview + +// Clause 8.2.2.1.1 EBNF Conventions + +// Clause 8.2.2.1.2 Lexical Structure + +RESERVED_KEYWORD = + 'about' | 'abstract' | 'accept' | 'action' | 'actor' | 'after' | 'alias' | 'all' | 'allocate' | 'allocation' + | 'analysis' | 'and' | 'as' | 'assert' | 'assign' | 'assume' | 'at' | 'attribute' | 'bind' | 'binding' | 'by' | 'calc' + | 'case' | 'comment' | 'concern' | 'connect' | 'connection' | 'constant' | 'constraint' | 'crosses' | 'decide' + | 'def' | 'default' | 'defined' | 'dependency' | 'derived' | 'do' | 'doc' | 'else' | 'end' | 'entry' | 'enum' + | 'event' | 'exhibit' | 'exit' | 'expose' | 'false' | 'filter' | 'first' | 'flow' | 'for' | 'fork' | 'frame' | 'from' + | 'hastype' | 'if' | 'implies' | 'import' | 'in' | 'include' | 'individual' | 'inout' | 'interface' | 'istype' + | 'item' | 'join' | 'language' | 'library' | 'locale' | 'loop' | 'merge' | 'message' | 'meta' | 'metadata' + | 'nonunique' | 'not' | 'null' | 'objective' | 'occurrence' | 'of' | 'or' | 'ordered' | 'out' | 'package' | 'parallel' + | 'part' | 'perform' | 'port' | 'private' | 'protected' | 'public' | 'redefines' | 'ref' | 'references' | 'render' + | 'rendering' | 'rep' | 'require' | 'requirement' | 'return' | 'satisfy' | 'send' | 'snapshot' | 'specializes' + | 'stakeholder' | 'standard' | 'state' | 'subject' | 'subsets' | 'succession' | 'terminate' | 'then' | 'timeslice' + | 'to' | 'transition' | 'true' | 'until' | 'use' | 'variant' | 'variation' | 'verification' | 'verify' | 'via' + | 'view' | 'viewpoint' | 'when' | 'while' | 'xor' + +DEFINED_BY = ':' | 'defined' 'by' + +SPECIALIZES = ':>' | 'specializes' + +SUBSETS = ':>' | 'subsets' + +REFERENCES = '::>' | 'references' + +CROSSES = '=>' | 'crosses' + +REDEFINES = ':>>' | 'redefines' + +// Clause 8.2.2.2 Elements and Relationships Textual Notation + +Identification : Element = + ( '<' declaredShortName = NAME '>' )? + ( declaredName = NAME )? + +RelationshipBody : Relationship = + ';' | '{' ( ownedRelationship += OwnedAnnotation )* '}' + +// Clause 8.2.2.3 Dependencies Textual Notation + +Dependency = + ( ownedRelationship += PrefixMetadataAnnotation )* + 'dependency' DependencyDeclaration + RelationshipBody + +DependencyDeclaration = + ( Identification 'from' )? + client += [QualifiedName] ( ',' client += [QualifiedName] )* 'to' + supplier += [QualifiedName] ( ',' supplier += [QualifiedName] )* + +// Clause 8.2.2.4 Annotations Textual Notation + +// Clause 8.2.2.4.1 Annotations + +Annotation = + annotatedElement = [QualifiedName] + +OwnedAnnotation : Annotation = + ownedRelatedElement += AnnotatingElement + +AnnotatingMember : OwningMembership = + ownedRelatedElement += AnnotatingElement + +AnnotatingElement = + Comment + | Documentation + | TextualRepresentation + | MetadataFeature + +// Clause 8.2.2.4.2 Comments and Documentation + +Comment = + ( 'comment' Identification + ( 'about' ownedRelationship += Annotation + ( ',' ownedRelationship += Annotation )* + )? + )? + ( 'locale' locale = STRING_VALUE )? + body = REGULAR_COMMENT + +Documentation = + 'doc' Identification + ( 'locale' locale = STRING_VALUE )? + body = REGULAR_COMMENT + +// Clause 8.2.2.4.3 Textual Representation + +TextualRepresentation = + ( 'rep' Identification )? + 'language' language = STRING_VALUE body = REGULAR_COMMENT + +// Clause 8.2.2.5 Namespaces and Packages Textual Notation + +// Clause 8.2.2.5.1 Packages + +RootNamespace : Namespace = + PackageBodyElement* + +Package = + ( ownedRelationship += PrefixMetadataMember )* + PackageDeclaration PackageBody + +LibraryPackage = + ( isStandard ?= 'standard' ) 'library' + ( ownedRelationship += PrefixMetadataMember )* + PackageDeclaration PackageBody + +PackageDeclaration : Package = + 'package' Identification + +PackageBody : Package = + ';' | '{' PackageBodyElement* '}' + +PackageBodyElement : Package = + ownedRelationship += PackageMember + | ownedRelationship += ElementFilterMember + | ownedRelationship += AliasMember + | ownedRelationship += Import + +MemberPrefix : Membership = + ( visibility = VisibilityIndicator )? + +PackageMember : OwningMembership = + MemberPrefix + ( ownedRelatedElement += DefinitionElement + | ownedRelatedElement = UsageElement ) + +ElementFilterMember : ElementFilterMembership = + MemberPrefix + 'filter' ownedRelatedElement += OwnedExpression ';' + +AliasMember : Membership = + MemberPrefix + 'alias' ( '<' memberShortName = NAME '>' )? + ( memberName = NAME )? + 'for' memberElement = [QualifiedName] + RelationshipBody + +Import = + visibility = VisibilityIndicator + 'import' ( isImportAll ?= 'all' )? + ImportDeclaration + RelationshipBody + +ImportDeclaration : Import = + MembershipImport | NamespaceImport + +MembershipImport = + importedMembership = [QualifiedName] + ( '::' isRecursive ?= '**' )? + +NamespaceImport = + importedNamespace = [QualifiedName] '::' '*' + ( '::' isRecursive ?= '**' )? + | importedNamespace = FilterPackage + { ownedRelatedElement += importedNamespace } + +FilterPackage : Package = + ownedRelationship += FilterPackageImport + ( ownedRelationship += FilterPackageMember )+ + +FilterPackageMember : ElementFilterMembership = + '[' ownedRelatedElement += OwnedExpression ']' + +VisibilityIndicator : VisibilityKind = + 'public' | 'private' | 'protected' + +// Clause 8.2.2.5.2 Package Elements + +DefinitionElement : Element = + Package + | LibraryPackage + | AnnotatingElement + | Dependency + | AttributeDefinition + | EnumerationDefinition + | OccurrenceDefinition + | IndividualDefinition + | ItemDefinition + | PartDefinition + | ConnectionDefinition + | FlowDefinition + | InterfaceDefinition + | PortDefinition + | ActionDefinition + | CalculationDefinition + | StateDefinition + | ConstraintDefinition + | RequirementDefinition + | ConcernDefinition + | CaseDefinition + | AnalysisCaseDefinition + | VerificationCaseDefinition + | UseCaseDefinition + | ViewDefinition + | ViewpointDefinition + | RenderingDefinition + | MetadataDefinition + | ExtendedDefinition + +UsageElement : Usage = + NonOccurrenceUsageElement + | OccurrenceUsageElement + +// Clause 8.2.2.6 Definition and Usage Textual Notation + +// Clause 8.2.2.6.1 Definitions + +BasicDefinitionPrefix = + isAbstract ?= 'abstract' | isVariation ?= 'variation' + +DefinitionExtensionKeyword : Definition = + ownedRelationship += PrefixMetadataMember + +DefinitionPrefix : Definition = + BasicDefinitionPrefix? DefinitionExtensionKeyword* + +Definition = + DefinitionDeclaration DefinitionBody + +DefinitionDeclaration : Definition = + Identification SubclassificationPart? + +DefinitionBody : Type = + ';' | '{' DefinitionBodyItem* '}' + +DefinitionBodyItem : Type = + ownedRelationship += DefinitionMember + | ownedRelationship += VariantUsageMember + | ownedRelationship += NonOccurrenceUsageMember + | ( ownedRelationship += SourceSuccessionMember )? + ownedRelationship += OccurrenceUsageMember + | ownedRelationship += AliasMember + | ownedRelationship += Import + +DefinitionMember : OwningMembership = + MemberPrefix + ownedRelatedElement += DefinitionElement + +VariantUsageMember : VariantMembership = + MemberPrefix 'variant' + ownedVariantUsage = VariantUsageElement + +NonOccurrenceUsageMember : FeatureMembership = + MemberPrefix + ownedRelatedElement += NonOccurrenceUsageElement + +OccurrenceUsageMember : FeatureMembership = + MemberPrefix + ownedRelatedElement += OccurrenceUsageElement + +StructureUsageMember : FeatureMembership = + MemberPrefix + ownedRelatedElement += StructureUsageElement + +BehaviorUsageMember : FeatureMembership = + MemberPrefix + ownedRelatedElement += BehaviorUsageElement + +// Clause 8.2.2.6.2 Usages + +FeatureDirection : FeatureDirectionKind = + 'in' | 'out' | 'inout' + +RefPrefix : Usage = + ( direction = FeatureDirection )? + ( isDerived ?= 'derived' )? + ( isAbstract ?= 'abstract' | isVariation ?= 'variation' )? + ( isConstant ?= 'constant' )? + +BasicUsagePrefix : Usage = + RefPrefix + ( isReference ?= 'ref' )? + +EndUsagePrefix : Usage = + isEnd ?= 'end' ( ownedRelationship += OwnedCrossFeatureMember )? + +// (See Note 1) + +OwnedCrossFeatureMember : OwningMembership = + ownedRelatedElement += OwnedCrossFeature + +OwnedCrossFeature : ReferenceUsage = + BasicUsagePrefix UsageDeclaration + +UsageExtensionKeyword : Usage = + ownedRelationship += PrefixMetadataMember + +UnextendedUsagePrefix : Usage = + EndUsagePrefix | BasicUsagePrefix + +UsagePrefix : Usage = + UnextendedUsagePrefix UsageExtensionKeyword* + +Usage = + UsageDeclaration UsageCompletion + +UsageDeclaration : Usage = + Identification FeatureSpecializationPart? + +UsageCompletion : Usage = + ValuePart? UsageBody + +UsageBody : Usage = + DefinitionBody + +ValuePart : Feature = + ownedRelationship += FeatureValue + +FeatureValue = + ( '=' + | isInitial ?= ':=' + | isDefault ?= 'default' ( '=' | isInitial ?= ':=' )? + ) + ownedRelatedElement += OwnedExpression + +// Notes: +// 1. A Usage parsed with isEnd = true for which mayTimeVary = true must also have isConstant set to true, even though this is not explicitly notated in the textual notation, in order to satisfy the KerML constraint checkFeatureEndIsConstant. + +// Clause 8.2.2.6.3 Reference Usages + +DefaultReferenceUsage : ReferenceUsage = + RefPrefix Usage + +ReferenceUsage = + ( EndUsagePrefix | RefPrefix ) + 'ref' Usage + +VariantReference : ReferenceUsage = + ownedRelationship += OwnedReferenceSubsetting + FeatureSpecialization* UsageBody + +// Clause 8.2.2.6.4 Body Elements + +NonOccurrenceUsageElement : Usage = + DefaultReferenceUsage + | ReferenceUsage + | AttributeUsage + | EnumerationUsage + | BindingConnectorAsUsage + | SuccessionAsUsage + | ExtendedUsage + +OccurrenceUsageElement : Usage = + StructureUsageElement | BehaviorUsageElement + +StructureUsageElement : Usage = + OccurrenceUsage + | IndividualUsage + | PortionUsage + | EventOccurrenceUsage + | ItemUsage + | PartUsage + | ViewUsage + | RenderingUsage + | PortUsage + | ConnectionUsage + | InterfaceUsage + | AllocationUsage + | Message + | FlowUsage + | SuccessionFlowUsage + +BehaviorUsageElement : Usage = + ActionUsage + | CalculationUsage + | StateUsage + | ConstraintUsage + | RequirementUsage + | ConcernUsage + | CaseUsage + | AnalysisCaseUsage + | VerificationCaseUsage + | UseCaseUsage + | ViewpointUsage + | PerformActionUsage + | ExhibitStateUsage + | IncludeUseCaseUsage + | AssertConstraintUsage + | SatisfyRequirementUsage + +VariantUsageElement : Usage = + VariantReference + | ReferenceUsage + | AttributeUsage + | BindingConnectorAsUsage + | SuccessionAsUsage + | OccurrenceUsage + | IndividualUsage + | PortionUsage + | EventOccurrenceUsage + | ItemUsage + | PartUsage + | ViewUsage + | RenderingUsage + | PortUsage + | ConnectionUsage + | InterfaceUsage + | AllocationUsage + | Message + | FlowUsage + | SuccessionFlowUsage + | BehaviorUsageElement + +// Clause 8.2.2.6.5 Specialization + +SubclassificationPart : Classifier = + SPECIALIZES ownedRelationship += OwnedSubclassification + ( ',' ownedRelationship += OwnedSubclassification )* + +OwnedSubclassification : Subclassification = + superClassifier = [QualifiedName] + +FeatureSpecializationPart : Feature = + FeatureSpecialization+ MultiplicityPart? FeatureSpecialization* + | MultiplicityPart FeatureSpecialization* + +FeatureSpecialization : Feature = + Typings | Subsettings | References | Crosses | Redefinitions + +Typings : Feature = + TypedBy ( ',' ownedRelationship += FeatureTyping )* + +TypedBy : Feature = + DEFINED_BY ownedRelationship += FeatureTyping + +FeatureTyping = + OwnedFeatureTyping | ConjugatedPortTyping + +OwnedFeatureTyping : FeatureTyping = + type = [QualifiedName] + | type = OwnedFeatureChain + { ownedRelatedElement += type } + +Subsettings : Feature = + Subsets ( ',' ownedRelationship += OwnedSubsetting )* + +Subsets : Feature = + SUBSETS ownedRelationship += OwnedSubsetting + +OwnedSubsetting : Subsetting = + subsettedFeature = [QualifiedName] + | subsettedFeature = OwnedFeatureChain + { ownedRelatedElement += subsettedFeature } + +References : Feature = + REFERENCES ownedRelationship += OwnedReferenceSubsetting + +OwnedReferenceSubsetting : ReferenceSubsetting = + referencedFeature = [QualifiedName] + | referencedFeature = OwnedFeatureChain + { ownedRelatedElement += referenceFeature } + +Crosses : Feature = + CROSSES ownedRelationship += OwnedCrossSubsetting + +OwnedCrossSubsetting : CrossSubsetting = + crossedFeature = [QualifiedName] + | crossedFeature = OwnedFeatureChain + { ownedRelatedElement += crossedFeature } + +Redefinitions : Feature = + Redefines ( ',' ownedRelationship += OwnedRedefinition )* + +Redefines : Feature = + REDEFINES ownedRelationship += OwnedRedefinition + +OwnedRedefinition : Redefinition = + redefinedFeature = [QualifiedName] + | redefinedFeature = OwnedFeatureChain + { ownedRelatedElement += redefinedFeature } + +OwnedFeatureChain : Feature = + ownedRelationship += OwnedFeatureChaining + ( '.' ownedRelationship += OwnedFeatureChaining )+ + +OwnedFeatureChaining : FeatureChaining = + chainingFeature = [QualifiedName] + +// Clause 8.2.2.6.6 Multiplicity + +MultiplicityPart : Feature = + ownedRelationship += OwnedMultiplicity + | ( ownedRelationship += OwnedMultiplicity )? + ( isOrdered ?= 'ordered' ( { isUnique = false } 'nonunique' )? + | { isUnique = false } 'nonunique' ( isOrdered ?= 'ordered' )? ) + +OwnedMultiplicity : OwningMembership = + ownedRelatedElement += MultiplicityRange + +MultiplicityRange = + '[' ( ownedRelationship += MultiplicityExpressionMember '..' )? + ownedRelationship += MultiplicityExpressionMember ']' + +MultiplicityExpressionMember : OwningMembership = + ownedRelatedElement += ( LiteralExpression | FeatureReferenceExpression ) + +// Clause 8.2.2.7 Attributes Textual Notation + +AttributeDefinition : AttributeDefinition = + DefinitionPrefix 'attribute' 'def' Definition + +AttributeUsage : AttributeUsage = + UsagePrefix 'attribute' Usage + +// Clause 8.2.2.8 Enumerations Textual Notation + +EnumerationDefinition = + DefinitionExtensionKeyword* + 'enum' 'def' DefinitionDeclaration EnumerationBody + +EnumerationBody : EnumerationDefinition = + ';' + | '{' ( ownedRelationship += AnnotatingMember + | ownedRelationship += EnumerationUsageMember )* + '}' + +EnumerationUsageMember : VariantMembership = + MemberPrefix ownedRelatedElement += EnumeratedValue + +EnumeratedValue : EnumerationUsage = + 'enum'? Usage + +EnumerationUsage : EnumerationUsage = + UsagePrefix 'enum' Usage + +// Clause 8.2.2.9 Occurrences Textual Notation + +// Clause 8.2.2.9.1 Occurrence Definitions + +OccurrenceDefinitionPrefix : OccurrenceDefinition = + BasicDefinitionPrefix? + ( isIndividual ?= 'individual' + ownedRelationship += EmptyMultiplicityMember + )? + DefinitionExtensionKeyword* + +OccurrenceDefinition = + OccurrenceDefinitionPrefix 'occurrence' 'def' Definition + +IndividualDefinition : OccurrenceDefinition = + BasicDefinitionPrefix? isIndividual ?= 'individual' + DefinitionExtensionKeyword* 'def' Definition + ownedRelationship += EmptyMultiplicityMember + +EmptyMultiplicityMember : OwningMembership = + ownedRelatedElement += EmptyMultiplicity + +EmptyMultiplicity : Multiplicity = + { } + +// Clause 8.2.2.9.2 Occurrence Usages + +OccurrenceUsagePrefix : OccurrenceUsage = + BasicUsagePrefix + ( isIndividual ?= 'individual' )? + ( portionKind = PortionKind + { isPortion = true } + )? + UsageExtensionKeyword* + +OccurrenceUsage = + OccurrenceUsagePrefix 'occurrence' Usage + +IndividualUsage : OccurrenceUsage = + BasicUsagePrefix isIndividual ?= 'individual' + UsageExtensionKeyword* Usage + +PortionUsage : OccurrenceUsage = + BasicUsagePrefix ( isIndividual ?= 'individual' )? + portionKind = PortionKind + UsageExtensionKeyword* Usage + { isPortion = true } + +PortionKind = + 'snapshot' | 'timeslice' + +EventOccurrenceUsage = + OccurrenceUsagePrefix 'event' + ( ownedRelationship += OwnedReferenceSubsetting + FeatureSpecializationPart? + | 'occurrence' UsageDeclaration? ) + UsageCompletion + +// Clause 8.2.2.9.3 Occurrence Successions + +SourceSuccessionMember : FeatureMembership = + 'then' ownedRelatedElement += SourceSuccession + +SourceSuccession : SuccessionAsUsage = + ownedRelationship += SourceEndMember + +SourceEndMember : EndFeatureMembership = + ownedRelatedElement += SourceEnd + +SourceEnd : ReferenceUsage = + ( ownedRelationship += OwnedMultiplicity )? + +// Clause 8.2.2.10 Items Textual Notation + +ItemDefinition = + OccurrenceDefinitionPrefix + 'item' 'def' Definition + +ItemUsage = + OccurrenceUsagePrefix 'item' Usage + +// Clause 8.2.2.11 Parts Textual Notation + +PartDefinition = + OccurrenceDefinitionPrefix 'part' 'def' Definition + +PartUsage = + OccurrenceUsagePrefix 'part' Usage + +// Clause 8.2.2.12 Ports Textual Notation + +PortDefinition = + DefinitionPrefix 'port' 'def' Definition + ownedRelationship += ConjugatedPortDefinitionMember + { conjugatedPortDefinition.ownedPortConjugator. + originalPortDefinition = this } + +// (See Note 1) + +ConjugatedPortDefinitionMember : OwningMembership = + ownedRelatedElement += ConjugatedPortDefinition + +ConjugatedPortDefinition = + ownedRelationship += PortConjugation + +PortConjugation = + {} + +PortUsage = + OccurrenceUsagePrefix 'port' Usage + +ConjugatedPortTyping : ConjugatedPortTyping = + '~' originalPortDefinition = ~[QualifiedName] + +// (See Note 2) + +// Notes: +// 1. Even though it is not explicitly represented in the text, a PortDefinition is always parsed as containing a nested ConjugatedPortDefinition with a PortDefinition Relationship pointing back to the containing PortDefinition. The abstract syntax for ConjugatedPortDefinition sets its effectiveName to the name of its originalPortDefinition with the symbol ~ prepended to it (see 8.3.12.2). (See also 8.4.8.1.) +// 2. The notation ~[QualifiedName] indicates that a QualifiedName shall be parsed from the input text, but that it shall be resolved as if it was the qualified name constructed as follows: +// • Extract the last segment name of the given QualifiedName and prepend the symbol ~ to it. +// • Append the name so constructed to the end of the entire original QualifiedName. +// For example, if the ConjugatedPortTyping is ~A::B::C, then the given QualifiedName is A::B::C, and ~[QualifiedName] is resolved as A::B::C::'~C'. Alternatively, a conforming tool may first resolve the given QualifiedName as usual to a PortDefinition and then use the conjugatedPortDefinition of this PortDefinition as the resolution of ~[QualifiedName]. + +// Clause 8.2.2.13 Connections Textual Notation + +// Clause 8.2.2.13.1 Connection Definition and Usage + +ConnectionDefinition = + OccurrenceDefinitionPrefix 'connection' 'def' Definition + +ConnectionUsage = + OccurrenceUsagePrefix + ( 'connection' UsageDeclaration ValuePart? + ( 'connect' ConnectorPart )? + | 'connect' ConnectorPart ) + UsageBody + +ConnectorPart : ConnectionUsage = + BinaryConnectorPart | NaryConnectorPart + +BinaryConnectorPart : ConnectionUsage = + ownedRelationship += ConnectorEndMember 'to' + ownedRelationship += ConnectorEndMember + +NaryConnectorPart : ConnectionUsage = + '(' ownedRelationship += ConnectorEndMember ',' + ownedRelationship += ConnectorEndMember + ( ',' ownedRelationship += ConnectorEndMember )* ')' + +ConnectorEndMember : EndFeatureMembership = + ownedRelatedElement += ConnectorEnd + +ConnectorEnd : ReferenceUsage = + ( ownedRelationship += OwnedCrossMultiplicityMember )? + ( declaredName = NAME REFERENCES )? + ownedRelationship += OwnedReferenceSubsetting + +OwnedCrossMultiplicityMember : OwningMembership = + ownedRelatedElement += OwnedCrossMultiplicity + +OwnedCrossMultiplicity : Feature = + ownedRelationship += OwnedMultiplicity + +// Clause 8.2.2.13.2 Binding Connectors + +BindingConnectorAsUsage = + UsagePrefix ( 'binding' UsageDeclaration )? + 'bind' ownedRelationship += ConnectorEndMember + '=' ownedRelationship += ConnectorEndMember + UsageBody + +// Clause 8.2.2.13.3 Successions + +SuccessionAsUsage = + UsagePrefix ( 'succession' UsageDeclaration )? + 'first' s.ownedRelationship += ConnectorEndMember + 'then' s.ownedRelationship += ConnectorEndMember + UsageBody + +// Clause 8.2.2.14 Interfaces Textual Notation + +// Clause 8.2.2.14.1 Interface Definitions + +InterfaceDefinition = + OccurrenceDefinitionPrefix 'interface' 'def' + DefinitionDeclaration InterfaceBody + +InterfaceBody : Type = + ';' | '{' InterfaceBodyItem* '}' + +InterfaceBodyItem : Type = + ownedRelationship += DefinitionMember + | ownedRelationship += VariantUsageMember + | ownedRelationship += InterfaceNonOccurrenceUsageMember + | ( ownedRelationship += SourceSuccessionMember )? + ownedRelationship += InterfaceOccurrenceUsageMember + | ownedRelationship += AliasMember + | ownedRelationship += Import + +InterfaceNonOccurrenceUsageMember : FeatureMembership = + MemberPrefix ownedRelatedElement += InterfaceNonOccurrenceUsageElement + +InterfaceNonOccurrenceUsageElement : Usage = + ReferenceUsage + | AttributeUsage + | EnumerationUsage + | BindingConnectorAsUsage + | SuccessionAsUsage + +InterfaceOccurrenceUsageMember : FeatureMembership = + MemberPrefix ownedRelatedElement += InterfaceOccurrenceUsageElement + +InterfaceOccurrenceUsageElement : Usage = + DefaultInterfaceEnd | StructureUsageElement | BehaviorUsageElement + +DefaultInterfaceEnd : PortUsage = + isEnd ?= 'end' Usage + +// Clause 8.2.2.14.2 Interface Usages + +InterfaceUsage = + OccurrenceUsagePrefix 'interface' + InterfaceUsageDeclaration InterfaceBody + +InterfaceUsageDeclaration : InterfaceUsage = + UsageDeclaration ValuePart? + ( 'connect' InterfacePart )? + | InterfacePart + +InterfacePart : InterfaceUsage = + BinaryInterfacePart | NaryInterfacePart + +BinaryInterfacePart : InterfaceUsage = + ownedRelationship += InterfaceEndMember 'to' + ownedRelationship += InterfaceEndMember + +NaryInterfacePart : InterfaceUsage = + '(' ownedRelationship += InterfaceEndMember ',' + ownedRelationship += InterfaceEndMember + ( ',' ownedRelationship += InterfaceEndMember )* ')' + +InterfaceEndMember : EndFeatureMembership = + ownedRelatedElement += InterfaceEnd + +InterfaceEnd : PortUsage = + ( ownedRelationship += OwnedCrossMultiplicityMember )? + ( declaredName = NAME REFERENCES )? + ownedRelationship += OwnedReferenceSubsetting + +// Clause 8.2.2.15 Allocations Textual Notation + +AllocationDefinition = + OccurrenceDefinitionPrefix 'allocation' 'def' Definition + +AllocationUsage = + OccurrenceUsagePrefix + AllocationUsageDeclaration UsageBody + +AllocationUsageDeclaration : AllocationUsage = + 'allocation' UsageDeclaration + ( 'allocate' ConnectorPart )? + | 'allocate' ConnectorPart + +// Clause 8.2.2.16 Flows Textual Notation + +FlowDefinition = + OccurrenceDefinitionPrefix 'flow' 'def' Definition + +Message : FlowUsage = + OccurrenceUsagePrefix 'message' + MessageDeclaration DefinitionBody + { isAbstract = true } + +MessageDeclaration : FlowUsage = + UsageDeclaration ValuePart? + ( 'of' ownedRelationship += FlowPayloadFeatureMember )? + ( 'from' ownedRelationship += MessageEventMember + 'to' ownedRelationship += MessageEventMember + )? + | ownedRelationship += MessageEventMember 'to' + ownedRelationship += MessageEventMember + +MessageEventMember : ParameterMembership = + ownedRelatedElement += MessageEvent + +MessageEvent : EventOccurrenceUsage = + ownedRelationship += OwnedReferenceSubsetting + +FlowUsage = + OccurrenceUsagePrefix 'flow' + FlowDeclaration DefinitionBody + +SuccessionFlowUsage = + OccurrenceUsagePrefix 'succession' 'flow' + FlowDeclaration DefinitionBody + +FlowDeclaration : FlowUsage = + UsageDeclaration ValuePart? + ( 'of' ownedRelationship += FlowPayloadFeatureMember )? + ( 'from' ownedRelationship += FlowEndMember + 'to' ownedRelationship += FlowEndMember )? + | ownedRelationship += FlowEndMember 'to' + ownedRelationship += FlowEndMember + +FlowPayloadFeatureMember : FeatureMembership = + ownedRelatedElement += FlowPayloadFeature + +FlowPayloadFeature : PayloadFeature = + PayloadFeature + +PayloadFeature : Feature = + Identification? PayloadFeatureSpecializationPart + ValuePart? + | ownedRelationship += OwnedFeatureTyping + ( ownedRelationship += OwnedMultiplicity )? + | ownedRelationship += OwnedMultiplicity + ownedRelationship += OwnedFeatureTyping + +PayloadFeatureSpecializationPart : Feature = + ( FeatureSpecialization )+ MultiplicityPart? + FeatureSpecialization* + | MultiplicityPart FeatureSpecialization+ + +FlowEndMember : EndFeatureMembership = + ownedRelatedElement += FlowEnd + +FlowEnd = + ( ownedRelationship += FlowEndSubsetting )? + ownedRelationship += FlowFeatureMember + +FlowEndSubsetting : ReferenceSubsetting = + referencedFeature = [QualifiedName] + | referencedFeature = FeatureChainPrefix + { ownedRelatedElement += referencedFeature } + +FeatureChainPrefix : Feature = + ( ownedRelationship += OwnedFeatureChaining '.' )+ + ownedRelationship += OwnedFeatureChaining '.' + +FlowFeatureMember : FeatureMembership = + ownedRelatedElement += FlowFeature + +FlowFeature : ReferenceUsage = + ownedRelationship += FlowFeatureRedefinition + +// (See Note 1) + +FlowFeatureRedefinition : Redefinition = + redefinedFeature = [QualifiedName] + +// Notes: +// 1. To ensure that a FlowFeature passes the validateRedefinitionDirectionConformance constraint (see [KerML, 8.3.3.3.8]), its direction must be set to the direction of its redefinedFeature, relative to its owning FlowEnd, that is, the result of the following OCL expression: owningType.directionOf(ownedRedefinition->at(1).redefinedFeature) + +// Clause 8.2.2.17 Actions Textual Notation + +// Clause 8.2.2.17.1 Action Definitions + +ActionDefinition = + OccurrenceDefinitionPrefix 'action' 'def' + DefinitionDeclaration ActionBody + +ActionBody : Type = + ';' | '{' ActionBodyItem* '}' + +ActionBodyItem : Type = + NonBehaviorBodyItem + | ownedRelationship += InitialNodeMember + ( ownedRelationship += ActionTargetSuccessionMember )* + | ( ownedRelationship += SourceSuccessionMember )? + ownedRelationship += ActionBehaviorMember + ( ownedRelationship += ActionTargetSuccessionMember )* + | ownedRelationship += GuardedSuccessionMember + +NonBehaviorBodyItem = + ownedRelationship += Import + | ownedRelationship += AliasMember + | ownedRelationship += DefinitionMember + | ownedRelationship += VariantUsageMember + | ownedRelationship += NonOccurrenceUsageMember + | ( ownedRelationship += SourceSuccessionMember )? + ownedRelationship += StructureUsageMember + +ActionBehaviorMember : FeatureMembership = + BehaviorUsageMember | ActionNodeMember + +InitialNodeMember : FeatureMembership = + MemberPrefix 'first' memberFeature = [QualifiedName] + RelationshipBody + +ActionNodeMember : FeatureMembership = + MemberPrefix ownedRelatedElement += ActionNode + +ActionTargetSuccessionMember : FeatureMembership = + MemberPrefix ownedRelatedElement += ActionTargetSuccession + +GuardedSuccessionMember : FeatureMembership = + MemberPrefix ownedRelatedElement += GuardedSuccession + +// Clause 8.2.2.17.2 Action Usages + +ActionUsage = + OccurrenceUsagePrefix 'action' + ActionUsageDeclaration ActionBody + +ActionUsageDeclaration : ActionUsage = + UsageDeclaration ValuePart? + +PerformActionUsage = + OccurrenceUsagePrefix 'perform' + PerformActionUsageDeclaration ActionBody + +PerformActionUsageDeclaration : PerformActionUsage = + ( ownedRelationship += OwnedReferenceSubsetting + FeatureSpecializationPart? + | 'action' UsageDeclaration ) + ValuePart? + +ActionNode : ActionUsage = + ControlNode + | SendNode | AcceptNode + | AssignmentNode + | TerminateNode + | IfNode | WhileLoopNode | ForLoopNode + +ActionNodeUsageDeclaration : ActionUsage = + 'action' UsageDeclaration? + +ActionNodePrefix : ActionUsage = + OccurrenceUsagePrefix ActionNodeUsageDeclaration? + +// Clause 8.2.2.17.3 Control Nodes + +ControlNode = + MergeNode | DecisionNode | JoinNode| ForkNode + +ControlNodePrefix : OccurrenceUsage = + RefPrefix + ( isIndividual ?= 'individual' )? + ( portionKind = PortionKind + { isPortion = true } + )? + UsageExtensionKeyword* + +MergeNode = + ControlNodePrefix + isComposite ?= 'merge' UsageDeclaration + ActionBody + +DecisionNode = + ControlNodePrefix + isComposite ?= 'decide' UsageDeclaration + ActionBody + +JoinNode = + ControlNodePrefix + isComposite ?= 'join' UsageDeclaration + ActionBody + +ForkNode = + ControlNodePrefix + isComposite ?= 'fork' UsageDeclaration + ActionBody + +// Clause 8.2.2.17.4 Send and Accept Action Usages + +AcceptNode : AcceptActionUsage = + OccurrenceUsagePrefix + AcceptNodeDeclaration ActionBody + +AcceptNodeDeclaration : AcceptActionUsage = + ActionNodeUsageDeclaration? + 'accept' AcceptParameterPart + +AcceptParameterPart : AcceptActionUsage = + ownedRelationship += PayloadParameterMember + ( 'via' ownedRelationship += NodeParameterMember )? + +PayloadParameterMember : ParameterMembership = + ownedRelatedElement += PayloadParameter + +PayloadParameter : ReferenceUsage = + PayloadFeature + | Identification PayloadFeatureSpecializationPart? + TriggerValuePart + +TriggerValuePart : Feature = + ownedRelationship += TriggerFeatureValue + +TriggerFeatureValue : FeatureValue = + ownedRelatedElement += TriggerExpression + +TriggerExpression : TriggerInvocationExpression = + kind = ( 'at' | 'after' ) + ownedRelationship += ArgumentMember + | kind = 'when' + ownedRelationship += ArgumentExpressionMember + +ArgumentMember : ParameterMembership = + ownedMemberParameter = Argument + +Argument : Feature = + ownedRelationship += ArgumentValue + +ArgumentValue : FeatureValue = + value = OwnedExpression + +ArgumentExpressionMember : ParameterMembership = + ownedRelatedElement += ArgumentExpression + +ArgumentExpression : Feature = + ownedRelationship += ArgumentExpressionValue + +ArgumentExpressionValue : FeatureValue = + ownedRelatedElement += OwnedExpressionReference + +SendNode : SendActionUsage = + OccurrenceUsagePrefix ActionUsageDeclaration? 'send' + ( ownedRelationship += NodeParameterMember SenderReceiverPart? + | ownedRelationship += EmptyParameterMember SenderReceiverPart )? + ActionBody + +SendNodeDeclaration : SendActionUsage = + ActionNodeUsageDeclaration? 'send' + ownedRelationship += NodeParameterMember SenderReceiverPart? + +SenderReceiverPart : SendActionUsage = + 'via' ownedRelationship += NodeParameterMember + ( 'to' ownedRelationship += NodeParameterMember )? + | ownedRelationship += EmptyParameterMember + 'to' ownedRelationship += NodeParameterMember + +NodeParameterMember : ParameterMembership = + ownedRelatedElement += NodeParameter + +NodeParameter : ReferenceUsage = + ownedRelationship += FeatureBinding + +FeatureBinding : FeatureValue = + ownedRelatedElement += OwnedExpression + +EmptyParameterMember : ParameterMembership = + ownedRelatedElement += EmptyUsage + +EmptyUsage : ReferenceUsage = + {} + +// Notes: +// 1. The productions for ArgumentMember, Argument, ArgumentValue, ArgumentExpressionMember, ArgumentExpression and ArgumentExpressionValue are the same as given in [KerML, 8.2.5.8.1]. + +// Clause 8.2.2.17.5 Assignment Action Usages + +AssignmentNode : AssignmentActionUsage = + OccurrenceUsagePrefix + AssignmentNodeDeclaration ActionBody + +AssignmentNodeDeclaration: ActionUsage = + ( ActionNodeUsageDeclaration )? 'assign' + ownedRelationship += AssignmentTargetMember + ownedRelationship += FeatureChainMember ':=' + ownedRelationship += NodeParameterMember + +AssignmentTargetMember : ParameterMembership = + ownedRelatedElement += AssignmentTargetParameter + +AssignmentTargetParameter : ReferenceUsage = + ( ownedRelationship += AssignmentTargetBinding '.' )? + +AssignmentTargetBinding : FeatureValue = + ownedRelatedElement += NonFeatureChainPrimaryExpression + +FeatureChainMember : Membership = + memberElement = [QualifiedName] + | OwnedFeatureChainMember + +OwnedFeatureChainMember : OwningMembership = + ownedRelatedElement += OwnedFeatureChain + +// Clause 8.2.2.17.6 Terminate Action Usages + +TerminateNode : TerminateActionUsage = + OccurrenceUsagePrefix ActionNodeUsageDeclaration? + 'terminate' ( ownedRelationship += NodeParameterMember )? + ActionBody + +// Clause 8.2.2.17.7 Structured Control Action Usages + +IfNode : IfActionUsage = + ActionNodePrefix + 'if' ownedRelationship += ExpressionParameterMember + ownedRelationship += ActionBodyParameterMember + ( 'else' ownedRelationship += + ( ActionBodyParameterMember | IfNodeParameterMember ) )? + +ExpressionParameterMember : ParameterMembership = + ownedRelatedElement += OwnedExpression + +ActionBodyParameterMember : ParameterMembership = + ownedRelatedElement += ActionBodyParameter + +ActionBodyParameter : ActionUsage = + ( 'action' UsageDeclaration? )? + '{' ActionBodyItem* '}' + +IfNodeParameterMember : ParameterMembership = + ownedRelatedElement += IfNode + +WhileLoopNode : WhileLoopActionUsage = + ActionNodePrefix + ( 'while' ownedRelationship += ExpressionParameterMember + | 'loop' ownedRelationship += EmptyParameterMember + ) + ownedRelationship += ActionBodyParameterMember + ( 'until' ownedRelationship += ExpressionParameterMember ';' )? + +ForLoopNode : ForLoopActionUsage = + ActionNodePrefix + 'for' ownedRelationship += ForVariableDeclarationMember + 'in' ownedRelationship += NodeParameterMember + ownedRelationship += ActionBodyParameterMember + +ForVariableDeclarationMember : FeatureMembership = + ownedRelatedElement += UsageDeclaration + +ForVariableDeclaration : ReferenceUsage = + UsageDeclaration + +// Clause 8.2.2.17.8 Action Successions + +ActionTargetSuccession : Usage = + ( TargetSuccession | GuardedTargetSuccession | DefaultTargetSuccession ) + UsageBody + +TargetSuccession : SuccessionAsUsage = + ownedRelationship += SourceEndMember + 'then' ownedRelationship += ConnectorEndMember + +GuardedTargetSuccession : TransitionUsage = + ownedRelationship += GuardExpressionMember + 'then' ownedRelationship += TransitionSuccessionMember + +DefaultTargetSuccession : TransitionUsage = + 'else' ownedRelationship += TransitionSuccessionMember + +GuardedSuccession : TransitionUsage = + ( 'succession' UsageDeclaration )? + 'first' ownedRelationship += FeatureChainMember + ownedRelationship += GuardExpressionMember + 'then' ownedRelationship += TransitionSuccessionMember + UsageBody + +// Clause 8.2.2.18 States Textual Notation + +// Clause 8.2.2.18.1 State Definitions + +StateDefinition = + OccurrenceDefinitionPrefix 'state' 'def' + DefinitionDeclaration StateDefBody + +StateDefBody : StateDefinition = + ';' + | ( isParallel ?= 'parallel' )? + '{' StateBodyItem* '}' + +StateBodyItem : Type = + NonBehaviorBodyItem + | ( ownedRelationship += SourceSuccessionMember )? + ownedRelationship += BehaviorUsageMember + ( ownedRelationship += TargetTransitionUsageMember )* + | ownedRelationship += TransitionUsageMember + | ownedRelationship += EntryActionMember + ( ownedRelationship += EntryTransitionMember )* + | ownedRelationship += DoActionMember + | ownedRelationship += ExitActionMember + +EntryActionMember : StateSubactionMembership = + MemberPrefix kind = 'entry' + ownedRelatedElement += StateActionUsage + +DoActionMember : StateSubactionMembership = + MemberPrefix kind = 'do' + ownedRelatedElement += StateActionUsage + +ExitActionMember : StateSubactionMembership = + MemberPrefix kind = 'exit' + ownedRelatedElement += StateActionUsage + +EntryTransitionMember : FeatureMembership = + MemberPrefix + ( ownedRelatedElement += GuardedTargetSuccession + | 'then' ownedRelatedElement += TargetSuccession + ) ';' + +StateActionUsage : ActionUsage = + EmptyActionUsage ';' + | StatePerformActionUsage + | StateAcceptActionUsage + | StateSendActionUsage + | StateAssignmentActionUsage + +EmptyActionUsage : ActionUsage = + {} + +StatePerformActionUsage : PerformActionUsage = + PerformActionUsageDeclaration ActionBody + +StateAcceptActionUsage : AcceptActionUsage = + AcceptNodeDeclaration ActionBody + +StateSendActionUsage : SendActionUsage = + SendNodeDeclaration ActionBody + +StateAssignmentActionUsage : AssignmentActionUsage = + AssignmentNodeDeclaration ActionBody + +TransitionUsageMember : FeatureMembership = + MemberPrefix ownedRelatedElement += TransitionUsage + +TargetTransitionUsageMember : FeatureMembership = + MemberPrefix ownedRelatedElement += TargetTransitionUsage + +// Clause 8.2.2.18.2 State Usages + +StateUsage = + OccurrenceUsagePrefix 'state' + ActionUsageDeclaration StateUsageBody + +StateUsageBody : StateUsage = + ';' + | ( isParallel ?= 'parallel' )? + '{' StateBodyItem* '}' + +ExhibitStateUsage = + OccurrenceUsagePrefix 'exhibit' + ( ownedRelationship += OwnedReferenceSubsetting + FeatureSpecializationPart? + | 'state' UsageDeclaration ) + ValuePart? StateUsageBody + +// Clause 8.2.2.18.3 Transition Usages + +TransitionUsage = + 'transition' ( UsageDeclaration 'first' )? + ownedRelationship += FeatureChainMember + ownedRelationship += EmptyParameterMember + ( ownedRelationship += EmptyParameterMember + ownedRelationship += TriggerActionMember )? + ( ownedRelationship += GuardExpressionMember )? + ( ownedRelationship += EffectBehaviorMember )? + 'then' ownedRelationship += TransitionSuccessionMember + ActionBody + +TargetTransitionUsage : TransitionUsage = + ownedRelationship += EmptyParameterMember + ( 'transition' + ( ownedRelationship += EmptyParameterMember + ownedRelationship += TriggerActionMember )? + ( ownedRelationship += GuardExpressionMember )? + ( ownedRelationship += EffectBehaviorMember )? + | ownedRelationship += EmptyParameterMember + ownedRelationship += TriggerActionMember + ( ownedRelationship += GuardExpressionMember )? + ( ownedRelationship += EffectBehaviorMember )? + | ownedRelationship += GuardExpressionMember + ( ownedRelationship += EffectBehaviorMember )? + )? + 'then' ownedRelationship += TransitionSuccessionMember + ActionBody + +TriggerActionMember : TransitionFeatureMembership = + 'accept' { kind = 'trigger' } ownedRelatedElement += TriggerAction + +TriggerAction : AcceptActionUsage = + AcceptParameterPart + +GuardExpressionMember : TransitionFeatureMembership = + 'if' { kind = 'guard' } ownedRelatedElement += OwnedExpression + +EffectBehaviorMember : TransitionFeatureMembership = + 'do' { kind = 'effect' } ownedRelatedElement += EffectBehaviorUsage + +EffectBehaviorUsage : ActionUsage = + EmptyActionUsage + | TransitionPerformActionUsage + | TransitionAcceptActionUsage + | TransitionSendActionUsage + | TransitionAssignmentActionUsage + +TransitionPerformActionUsage : PerformActionUsage = + PerformActionUsageDeclaration ( '{' ActionBodyItem* '}' )? + +TransitionAcceptActionUsage : AcceptActionUsage = + AcceptNodeDeclaration ( '{' ActionBodyItem* '}' )? + +TransitionSendActionUsage : SendActionUsage = + SendNodeDeclaration ( '{' ActionBodyItem* '}' )? + +TransitionAssignmentActionUsage : AssignmentActionUsage = + AssignmentNodeDeclaration ( '{' ActionBodyItem* '}' )? + +TransitionSuccessionMember : OwningMembership = + ownedRelatedElement += TransitionSuccession + +TransitionSuccession : Succession = + ownedRelationship += EmptyEndMember + ownedRelationship += ConnectorEndMember + +EmptyEndMember : EndFeatureMembership = + ownedRelatedElement += EmptyFeature + +EmptyFeature : ReferenceUsage = + {} + +// Clause 8.2.2.19 Calculations Textual Notation + +CalculationDefinition = + OccurrenceDefinitionPrefix 'calc' 'def' + DefinitionDeclaration CalculationBody + +CalculationUsage : CalculationUsage = + OccurrenceUsagePrefix 'calc' + ActionUsageDeclaration CalculationBody + +CalculationBody : Type = + ';' | '{' CalculationBodyPart '}' + +CalculationBodyPart : Type = + CalculationBodyItem* + ( ownedRelationship += ResultExpressionMember )? + +CalculationBodyItem : Type = + ActionBodyItem + | ownedRelationship += ReturnParameterMember + +ReturnParameterMember : ReturnParameterMembership = + MemberPrefix? 'return' ownedRelatedElement += UsageElement + +ResultExpressionMember : ResultExpressionMembership = + MemberPrefix? ownedRelatedElement += OwnedExpression + +// Clause 8.2.2.20 Constraints Textual Notation + +ConstraintDefinition = + OccurrenceDefinitionPrefix 'constraint' 'def' + DefinitionDeclaration CalculationBody + +ConstraintUsage = + OccurrenceUsagePrefix 'constraint' + ConstraintUsageDeclaration CalculationBody + +AssertConstraintUsage = + OccurrenceUsagePrefix 'assert' ( isNegated ?= 'not' )? + ( ownedRelationship += OwnedReferenceSubsetting + FeatureSpecializationPart? + | 'constraint' ConstraintUsageDeclaration ) + CalculationBody + +ConstraintUsageDeclaration : ConstraintUsage = + UsageDeclaration ValuePart? + +// Clause 8.2.2.21 Requirements Textual Notation + +// Clause 8.2.2.21.1 Requirement Definitions + +RequirementDefinition = + OccurrenceDefinitionPrefix 'requirement' 'def' + DefinitionDeclaration RequirementBody + +RequirementBody : Type = + ';' | '{' RequirementBodyItem* '}' + +RequirementBodyItem : Type = + DefinitionBodyItem + | ownedRelationship += SubjectMember + | ownedRelationship += RequirementConstraintMember + | ownedRelationship += FramedConcernMember + | ownedRelationship += RequirementVerificationMember + | ownedRelationship += ActorMember + | ownedRelationship += StakeholderMember + +SubjectMember : SubjectMembership = + MemberPrefix ownedRelatedElement += SubjectUsage + +SubjectUsage : ReferenceUsage = + 'subject' UsageExtensionKeyword* Usage + +RequirementConstraintMember : RequirementConstraintMembership = + MemberPrefix? RequirementKind + ownedRelatedElement += RequirementConstraintUsage + +RequirementKind : RequirementConstraintMembership = + 'assume' { kind = 'assumption' } + | 'require' { kind = 'requirement' } + +RequirementConstraintUsage : ConstraintUsage = + ownedRelationship += OwnedReferenceSubsetting + FeatureSpecializationPart? RequirementBody + | ( UsageExtensionKeyword* 'constraint' + | UsageExtensionKeyword+ ) + ConstraintUsageDeclaration CalculationBody + +FramedConcernMember : FramedConcernMembership = + MemberPrefix? 'frame' + ownedRelatedElement += FramedConcernUsage + +FramedConcernUsage : ConcernUsage = + ownedRelationship += OwnedReferenceSubsetting + FeatureSpecializationPart? CalculationBody + | ( UsageExtensionKeyword* 'concern' + | UsageExtensionKeyword+ ) + CalculationUsageDeclaration CalculationBody + +ActorMember : ActorMembership = + MemberPrefix ownedRelatedElement += ActorUsage + +ActorUsage : PartUsage = + 'actor' UsageExtensionKeyword* Usage + +StakeholderMember : StakeholderMembership = + MemberPrefix ownedRelatedElement += StakeholderUsage + +StakeholderUsage : PartUsage = + 'stakeholder' UsageExtensionKeyword* Usage + +// Clause 8.2.2.21.2 Requirement Usages + +RequirementUsage = + OccurrenceUsagePrefix 'requirement' + ConstraintUsageDeclaration RequirementBody + +SatisfyRequirementUsage = + OccurrenceUsagePrefix 'assert' ( isNegated ?= 'not' ) 'satisfy' + ( ownedRelationship += OwnedReferenceSubsetting + FeatureSpecializationPart? + | 'requirement' UsageDeclaration ) + ValuePart? + ( 'by' ownedRelationship += SatisfactionSubjectMember )? + RequirementBody + +SatisfactionSubjectMember : SubjectMembership = + ownedRelatedElement += SatisfactionParameter + +SatisfactionParameter : ReferenceUsage = + ownedRelationship += SatisfactionFeatureValue + +SatisfactionFeatureValue : FeatureValue = + ownedRelatedElement += SatisfactionReferenceExpression + +SatisfactionReferenceExpression : FeatureReferenceExpression = + ownedRelationship += FeatureChainMember + +// Clause 8.2.2.21.3 Concerns + +ConcernDefinition = + OccurrenceDefinitionPrefix 'concern' 'def' + DefinitionDeclaration RequirementBody + +ConcernUsage = + OccurrenceUsagePrefix 'concern' + ConstraintUsageDeclaration RequirementBody + +// Clause 8.2.2.22 Cases Textual Notation + +CaseDefinition = + OccurrenceDefinitionPrefix 'case' 'def' + DefinitionDeclaration CaseBody + +CaseUsage = + OccurrenceUsagePrefix 'case' + ConstraintUsageDeclaration CaseBody + +CaseBody : Type = + ';' + | '{' CaseBodyItem* + ( ownedRelationship += ResultExpressionMember )? + '}' + +CaseBodyItem : Type = + ActionBodyItem + | ownedRelationship += SubjectMember + | ownedRelationship += ActorMember + | ownedRelationship += ObjectiveMember + +ObjectiveMember : ObjectiveMembership = + MemberPrefix 'objective' + ownedRelatedElement += ObjectiveRequirementUsage + +ObjectiveRequirementUsage : RequirementUsage = + UsageExtensionKeyword* ConstraintUsageDeclaration + RequirementBody + +// Clause 8.2.2.23 Analysis Cases Textual Notation + +AnalysisCaseDefinition = + OccurrenceDefinitionPrefix 'analysis' 'def' + DefinitionDeclaration CaseBody + +AnalysisCaseUsage = + OccurrenceUsagePrefix 'analysis' + ConstraintUsageDeclaration CaseBody + +// Clause 8.2.2.24 Verification Cases Textual Notation + +VerificationCaseDefinition = + OccurrenceDefinitionPrefix 'verification' 'def' + DefinitionDeclaration CaseBody + +VerificationCaseUsage = + OccurrenceUsagePrefix 'verification' + ConstraintUsageDeclaration CaseBody + +RequirementVerificationMember : RequirementVerificationMembership = + MemberPrefix 'verify' { kind = 'requirement' } + ownedRelatedElement += RequirementVerificationUsage + +RequirementVerificationUsage : RequirementUsage = + ownedRelationship += OwnedReferenceSubsetting + FeatureSpecialization* RequirementBody + | ( UsageExtensionKeyword* 'requirement' + | UsageExtensionKeyword+ ) + ConstraintUsageDeclaration RequirementBody + +// Clause 8.2.2.25 Use Cases Textual Notation + +UseCaseDefinition = + OccurrenceDefinitionPrefix 'use' 'case' 'def' + DefinitionDeclaration CaseBody + +UseCaseUsage = + OccurrenceUsagePrefix 'use' 'case' + ConstraintUsageDeclaration CaseBody + +IncludeUseCaseUsage = + OccurrenceUsagePrefix 'include' + ( ownedRelationship += OwnedReferenceSubsetting + FeatureSpecializationPart? + | 'use' 'case' UsageDeclaration ) + ValuePart? + CaseBody + +// Clause 8.2.2.26 Views and Viewpoints Textual Notation + +// Clause 8.2.2.26.1 View Definitions + +ViewDefinition = + OccurrenceDefinitionPrefix 'view' 'def' + DefinitionDeclaration ViewDefinitionBody + +ViewDefinitionBody : ViewDefinition = + ';' | '{' ViewDefinitionBodyItem* '}' + +ViewDefinitionBodyItem : ViewDefinition = + DefinitionBodyItem + | ownedRelationship += ElementFilterMember + | ownedRelationship += ViewRenderingMember + +ViewRenderingMember : ViewRenderingMembership = + MemberPrefix 'render' + ownedRelatedElement += ViewRenderingUsage + +ViewRenderingUsage : RenderingUsage = + ownedRelationship += OwnedReferenceSubsetting + FeatureSpecializationPart? + UsageBody + | ( UsageExtensionKeyword* 'rendering' + | UsageExtensionKeyword+ ) + Usage + +// Clause 8.2.2.26.2 View Usages + +ViewUsage = + OccurrenceUsagePrefix 'view' + UsageDeclaration? ValuePart? + ViewBody + +ViewBody : ViewUsage = + ';' | '{' ViewBodyItem* '}' + +ViewBodyItem : ViewUsage = + DefinitionBodyItem + | ownedRelationship += ElementFilterMember + | ownedRelationship += ViewRenderingMember + | ownedRelationship += Expose + +Expose = + 'expose' ( MembershipExpose | NamespaceExpose ) + RelationshipBody + +MembershipExpose = + MembershipImport + +NamespaceExpose = + NamespaceImport + +// Clause 8.2.2.26.3 Viewpoints + +ViewpointDefinition = + OccurrenceDefinitionPrefix 'viewpoint' 'def' + DefinitionDeclaration RequirementBody + +ViewpointUsage = + OccurrenceUsagePrefix 'viewpoint' + ConstraintUsageDeclaration RequirementBody + +// Clause 8.2.2.26.4 Renderings + +RenderingDefinition = + OccurrenceDefinitionPrefix 'rendering' 'def' + Definition + +RenderingUsage = + OccurrenceUsagePrefix 'rendering' + Usage + +// Clause 8.2.2.27 Metadata Textual Notation + +MetadataDefinition = + ( isAbstract ?= 'abstract')? DefinitionExtensionKeyword* + 'metadata' 'def' Definition + +PrefixMetadataAnnotation : Annotation = + '#' annotatingElement = PrefixMetadataUsage + { ownedRelatedElement += annotatingElement } + +PrefixMetadataMember : OwningMembership = + '#' ownedRelatedElement = PrefixMetadataUsage + +PrefixMetadataUsage : MetadataUsage = + ownedRelationship += OwnedFeatureTyping + +MetadataUsage = + UsageExtensionKeyword* ( '@' | 'metadata' ) + MetadataUsageDeclaration + ( 'about' ownedRelationship += Annotation + ( ',' ownedRelationship += Annotation )* + )? + MetadataBody + +MetadataUsageDeclaration : MetadataUsage = + ( Identification ( ':' | 'typed' 'by' ) )? + ownedRelationship += OwnedFeatureTyping + +MetadataBody : Type = + ';' | + '{' ( ownedRelationship += DefinitionMember + | ownedRelationship += MetadataBodyUsageMember + | ownedRelationship += AliasMember + | ownedRelationship += Import + )* + '}' + +MetadataBodyUsageMember : FeatureMembership = + ownedMemberFeature = MetadataBodyUsage + +MetadataBodyUsage : ReferenceUsage = + 'ref'? ( ':>>' | 'redefines' )? ownedRelationship += OwnedRedefinition + FeatureSpecializationPart? ValuePart? + MetadataBody + +ExtendedDefinition : Definition = + BasicDefinitionPrefix? DefinitionExtensionKeyword+ + 'def' Definition + +ExtendedUsage : Usage = + UnextendedUsagePrefix UsageExtensionKeyword+ + Usage + +// End of BNF + + diff --git a/Resources/kebnf.g4 b/Resources/kebnf.g4 new file mode 100644 index 000000000..d059914a1 --- /dev/null +++ b/Resources/kebnf.g4 @@ -0,0 +1,104 @@ +// Grammar + +grammar kebnf; + +specification : (NL)* rule_definition+ EOF ; + +rule_definition + : name=UPPER_ID (params=parameter_list)? (COLON target_ast=UPPER_ID)? ASSIGN rule_body=alternatives SEMICOLON? NL+ + ; + +parameter_list + : LPAREN param_name=ID COLON param_type=ID RPAREN + ; + +alternatives + : alternative (PIPE alternative)* + ; + +alternative + : element* + ; + +element + : assignment + | non_parsing_assignment + | non_parsing_empty + | cross_reference + | group + | terminal + | non_terminal + | value_literal + ; + +assignment + : property=dotted_id op=(ASSIGN | ADD_ASSIGN | BOOL_ASSIGN) (prefix=TILDE)?content=element_core (suffix=suffix_op)? + ; + +non_parsing_assignment + : LBRACE property=dotted_id op=(ASSIGN | ADD_ASSIGN) val=value_literal RBRACE + ; + +non_parsing_empty + : LBRACE RBRACE + ; + +cross_reference + : TILDE? LBRACK ref=ID RBRACK + ; + +group + : LPAREN alternatives RPAREN (suffix=suffix_op)? + ; + +terminal + : val=SINGLE_QUOTED_STRING (suffix=suffix_op)? + ; + +non_terminal + : name=UPPER_ID (suffix=suffix_op)? + ; + +element_core + : cross_reference + | group + | terminal + | non_terminal + | value_literal + ; + +dotted_id + : ID (DOT ID)* + ; + +suffix_op : '*' | '+' | '?' ; + +value_literal : ID | INT | STRING | '[QualifiedName]' | SINGLE_QUOTED_STRING; + +// Lexer +ASSIGN : '::=' | '=' ; +ADD_ASSIGN : '+=' ; +BOOL_ASSIGN : '?=' ; +PIPE : '|' ; +COLON : ':' ; +SEMICOLON : ';' ; +COMMA : ',' ; +LPAREN : '(' ; +RPAREN : ')' ; +LBRACK : '[' ; +RBRACK : ']' ; +LBRACE : '{' ; +RBRACE : '}' ; +DOT : '.' ; +TILDE : '~' ; + +UPPER_ID : [A-Z] [a-zA-Z0-9_]* ; +ID : [a-zA-Z_][a-zA-Z0-9_]* ; +SINGLE_QUOTED_STRING : '\'' (~['\\] | '\\' .)* '\'' ; +INT : [0-9]+ ; +STRING : '\'' ( ~['\\] | '\\' . )* '\'' ; + +COMMENT : '//' ~[\r\n]* -> skip ; +WS : [ \t]+ -> skip ; +CONTINUATION : '\r'? '\n' [ \t]+ -> skip ; +NL : '\r'? '\n' ; \ No newline at end of file diff --git a/SysML2.NET.CodeGenerator.Tests/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGeneratorTestFixture.cs b/SysML2.NET.CodeGenerator.Tests/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGeneratorTestFixture.cs new file mode 100644 index 000000000..373705c59 --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGeneratorTestFixture.cs @@ -0,0 +1,71 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.CodeGenerator.Tests.Generators.UmlHandleBarsGenerators +{ + using System.IO; + using System.Linq; + using System.Threading.Tasks; + + using NUnit.Framework; + + using SysML2.NET.CodeGenerator.Generators.UmlHandleBarsGenerators; + using SysML2.NET.CodeGenerator.Grammar; + using SysML2.NET.CodeGenerator.Grammar.Model; + + [TestFixture] + public class UmlCoreTextualNotationBuilderGeneratorTestFixture + { + private DirectoryInfo umlPocoDirectoryInfo; + private UmlCoreTextualNotationBuilderGenerator umlCoreTextualNotationBuilderGenerator; + private TextualNotationSpecification textualNotationSpecification; + + [OneTimeSetUp] + public void OneTimeSetup() + { + var directoryInfo = new DirectoryInfo(TestContext.CurrentContext.TestDirectory); + + var path = Path.Combine("UML", "_SysML2.NET.Core.UmlCoreTextualNotationBuilderGenerator"); + + this.umlPocoDirectoryInfo = directoryInfo.CreateSubdirectory(path); + this.umlCoreTextualNotationBuilderGenerator = new UmlCoreTextualNotationBuilderGenerator(); + + var textualRulesFolder = Path.Combine(TestContext.CurrentContext.TestDirectory, "datamodel"); + var kermlRules = GrammarLoader.LoadTextualNotationSpecification(Path.Combine(textualRulesFolder, "KerML-textual-bnf.kebnf")); + var sysmlRules = GrammarLoader.LoadTextualNotationSpecification(Path.Combine(textualRulesFolder, "SysML-textual-bnf.kebnf")); + + var combinesRules = new TextualNotationSpecification(); + combinesRules.Rules.AddRange(sysmlRules.Rules); + + foreach (var rule in kermlRules.Rules.Where(rule => combinesRules.Rules.All(r => r.RuleName != rule.RuleName))) + { + combinesRules.Rules.Add(rule); + } + + this.textualNotationSpecification = combinesRules; + } + + [Test] + public async Task VerifyCanGenerateTextualNotation() + { + await Assert.ThatAsync(() => this.umlCoreTextualNotationBuilderGenerator.GenerateAsync(GeneratorSetupFixture.XmiReaderResult, this.textualNotationSpecification, this.umlPocoDirectoryInfo), Throws.Nothing); + } + } +} diff --git a/SysML2.NET.CodeGenerator.Tests/Grammar/TextualNotationSpecificationVisitorTestFixture.cs b/SysML2.NET.CodeGenerator.Tests/Grammar/TextualNotationSpecificationVisitorTestFixture.cs new file mode 100644 index 000000000..7990d4cc7 --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Grammar/TextualNotationSpecificationVisitorTestFixture.cs @@ -0,0 +1,64 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.CodeGenerator.Tests.Grammar +{ + using System; + using System.IO; + using System.Linq; + + using Antlr4.Runtime; + + using NUnit.Framework; + + using SysML2.NET.CodeGenerator.Grammar; + using SysML2.NET.CodeGenerator.Grammar.Model; + + [TestFixture] + public class TextualNotationSpecificationVisitorTestFixture + { + [Test] + [TestCase("KerML-textual-bnf.kebnf")] + [TestCase("SysML-textual-bnf.kebnf")] + public void VerifyCanParseGrammar(string modelName) + { + var filePath = Path.Combine(TestContext.CurrentContext.TestDirectory, "datamodel",modelName ); + + var stream = CharStreams.fromPath(filePath); + var lexer = new kebnfLexer(stream); + var tokens = new CommonTokenStream(lexer); + var parser = new kebnfParser(tokens); + + var tree = parser.specification(); + var explorer = new TextualNotationSpecificationVisitor(); + var result = (TextualNotationSpecification)explorer.Visit(tree); + var rules = result.Rules; + + using (Assert.EnterMultipleScope()) + { + Assert.That(rules, Is.Not.Null); + Assert.That(rules, Is.Not.Empty); + Assert.That(rules.DistinctBy(x => x.RuleName), Is.EquivalentTo(rules)); + } + + Console.WriteLine($"Found {rules.Count} rules"); + } + } +} diff --git a/SysML2.NET.CodeGenerator/Extensions/NamedElementExtensions.cs b/SysML2.NET.CodeGenerator/Extensions/NamedElementExtensions.cs index 402bc3454..9bea96a6c 100644 --- a/SysML2.NET.CodeGenerator/Extensions/NamedElementExtensions.cs +++ b/SysML2.NET.CodeGenerator/Extensions/NamedElementExtensions.cs @@ -20,9 +20,11 @@ namespace SysML2.NET.CodeGenerator.Extensions { + using System; using System.Linq; using uml4net.CommonStructure; + using uml4net.SimpleClassifiers; /// /// Extension class for @@ -40,5 +42,36 @@ public static string QueryNamespace(this INamedElement namedElement) var namespaces = qualifiedNameSpaces.Skip(1).Take(qualifiedNameSpaces.Length - 2); return string.Join('.', namespaces); } + + /// + /// Query the fully qualified type name (Namespace + Type name). + /// + /// The specific that should have the fully qualified type name computed + /// A specific namespace part (POCO/DTO distinction) + /// Asserts if the type should be the interface name or not + /// The fully qualified type name + public static string QueryFullyQualifiedTypeName(this INamedElement namedElement, string namespacePart = "POCO", bool targetInterface = true) + { + ArgumentNullException.ThrowIfNull(namedElement); + ArgumentException.ThrowIfNullOrWhiteSpace(namespacePart); + + var typeName = "SysML2.NET.Core."; + + if (namedElement is not IEnumeration) + { + typeName += $"{namespacePart}."; + } + + typeName += namedElement.QueryNamespace(); + typeName += "."; + + if (namedElement is not IEnumeration && targetInterface) + { + typeName += "I"; + } + + typeName += namedElement.Name; + return typeName; + } } } diff --git a/SysML2.NET.CodeGenerator/Extensions/PropertyExtension.cs b/SysML2.NET.CodeGenerator/Extensions/PropertyExtension.cs index e90320150..c56b1937d 100644 --- a/SysML2.NET.CodeGenerator/Extensions/PropertyExtension.cs +++ b/SysML2.NET.CodeGenerator/Extensions/PropertyExtension.cs @@ -92,5 +92,49 @@ public static bool QueryPropertyIsPartOfNonDerivedCompositeAggregation(this IPro return property.Opposite is { IsComposite: true, IsDerived: false }; } + + /// + /// Queries the content of a IF statement for non-empty values + /// + /// The property that have to be used to produce the content + /// The name of the name + /// The If Statement content + public static string QueryIfStatementContentForNonEmpty(this IProperty property, string variableName) + { + var propertyName = property.QueryPropertyNameBasedOnUmlProperties(); + + if (property.QueryIsEnumerable()) + { + return $"{variableName}.MoveNext()"; + } + + if (property.QueryIsReferenceProperty()) + { + return $"{variableName}.{propertyName} != null"; + } + + if (property.QueryIsNullableAndNotString()) + { + return $"{variableName}.{propertyName}.HasValue"; + } + + if (property.QueryIsString()) + { + return $"!string.IsNullOrWhiteSpace({variableName}.{propertyName})"; + } + + if (property.QueryIsBool()) + { + return $"{variableName}.{propertyName}"; + } + + if (property.QueryIsEnum()) + { + var defaultValue = property.QueryIsEnumPropertyWithDefaultValue() ? $"{property.Type.QueryFullyQualifiedTypeName()}.{property.QueryDefaultValueAsString().CapitalizeFirstLetter()}" : ((IEnumeration)property.Type).OwnedLiteral[0].Name; + return $"{variableName}.{propertyName} != {defaultValue}"; + } + + return "THIS WILL PRODUCE COMPILE ERROR"; + } } } diff --git a/SysML2.NET.CodeGenerator/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGenerator.cs b/SysML2.NET.CodeGenerator/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGenerator.cs new file mode 100644 index 000000000..9b45ddb9b --- /dev/null +++ b/SysML2.NET.CodeGenerator/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGenerator.cs @@ -0,0 +1,224 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.CodeGenerator.Generators.UmlHandleBarsGenerators +{ + using System; + using System.IO; + using System.Linq; + using System.Threading.Tasks; + + using SysML2.NET.CodeGenerator.Extensions; + using SysML2.NET.CodeGenerator.Grammar.Model; + using SysML2.NET.CodeGenerator.HandleBarHelpers; + + using uml4net.CommonStructure; + using uml4net.Extensions; + using uml4net.HandleBars; + using uml4net.StructuredClassifiers; + using uml4net.xmi.Readers; + + using NamedElementHelper = SysML2.NET.CodeGenerator.HandleBarHelpers.NamedElementHelper; + + /// + /// An to generate Textual Notation Builder + /// + public class UmlCoreTextualNotationBuilderGenerator: UmlHandleBarsGenerator + { + /// + /// Gets the name of template for builder classes + /// + private const string BuilderTemplateName = "core-textual-notation-builder-template"; + + /// + /// Gets the name of template for builder facade class + /// + private const string BuilderFacadeTemplateName = "core-textual-notation-builder-facade-template"; + + /// + /// Register the custom helpers + /// + protected override void RegisterHelpers() + { + NamedElementHelper.RegisterNamedElementHelper(this.Handlebars); + this.Handlebars.RegisterStringHelper(); + this.Handlebars.RegisterRulesHelper(); + } + + /// + /// Register the code templates + /// + protected override void RegisterTemplates() + { + this.RegisterTemplate(BuilderTemplateName); + this.RegisterTemplate(BuilderFacadeTemplateName); + } + + /// + /// Generates code specific to the concrete implementation + /// + /// + /// the that contains the UML model to generate from + /// + /// + /// The target + /// + /// This method cannot be used since it requires to have . Uses + /// + /// an awaitable + /// + public override Task GenerateAsync(XmiReaderResult xmiReaderResult, DirectoryInfo outputDirectory) + { + throw new NotSupportedException("The generator needs TextualNotationSpecification access"); + } + + /// + /// Generates code specific to the concrete implementation + /// + /// + /// the that contains the UML model to generate from + /// + /// The that contains specific grammar rules to produce textual notation + /// + /// The target + /// + /// + /// an awaitable + /// + public async Task GenerateAsync(XmiReaderResult xmiReaderResult, TextualNotationSpecification textualNotationSpecification, DirectoryInfo outputDirectory) + { + await this.GenerateBuilderClasses(xmiReaderResult, textualNotationSpecification, outputDirectory); + // await this.GenerateBuilderFacade(xmiReaderResult, outputDirectory); + } + + /// + /// Generates Textual Notation builder classes for each targeted by a rule + /// + /// + /// the that contains the UML model to generate from + /// + /// The that contains specific grammar rules to produce textual notation + /// + /// The target + /// + /// If one of the given parameters is null + /// + /// an awaitable + /// + private Task GenerateBuilderClasses(XmiReaderResult xmiReaderResult, TextualNotationSpecification textualNotationSpecification, DirectoryInfo outputDirectory) + { + ArgumentNullException.ThrowIfNull(xmiReaderResult); + ArgumentNullException.ThrowIfNull(textualNotationSpecification); + ArgumentNullException.ThrowIfNull(outputDirectory); + + return this.GenerateBuilderClassesInternal(xmiReaderResult, textualNotationSpecification, outputDirectory); + } + + /// + /// Generates Textual Notation builder classes for each targeted by a rule + /// + /// + /// the that contains the UML model to generate from + /// + /// The that contains specific grammar rules to produce textual notation + /// + /// The target + /// + /// + /// an awaitable + /// + private async Task GenerateBuilderClassesInternal(XmiReaderResult xmiReaderResult, TextualNotationSpecification textualNotationSpecification, DirectoryInfo outputDirectory) + { + var template = this.Templates[BuilderTemplateName]; + + var namedElements = xmiReaderResult.QueryContainedAndImported("SysML") + .SelectMany(x => x.PackagedElement.OfType()) + .ToList(); + + var rulesGroupedByType = textualNotationSpecification.Rules + .Where(x => !string.IsNullOrWhiteSpace(x.TargetElementName) && namedElements.Any(n => n.Name == x.TargetElementName)) + .GroupBy(x => x.TargetElementName).ToDictionary(x => x.Key, x => x.ToList()); + + foreach (var nonTargetingRule in textualNotationSpecification.Rules.Where(x => string.IsNullOrWhiteSpace(x.TargetElementName))) + { + var matchingClass = namedElements.SingleOrDefault(x => x.Name == nonTargetingRule.RuleName); + + if (matchingClass != null) + { + if (rulesGroupedByType.TryGetValue(matchingClass.Name, out var existingRules)) + { + existingRules.Add(nonTargetingRule); + } + else + { + rulesGroupedByType[matchingClass.Name] = [nonTargetingRule]; + } + } + } + + foreach (var rulesPerType in rulesGroupedByType) + { + var targetClassContext = namedElements.Single(x => x.Name == rulesPerType.Key); + + var generatedBuilder = template(new {Context = targetClassContext, Rules = rulesPerType.Value, AllRules = textualNotationSpecification.Rules}); + generatedBuilder = this.CodeCleanup(generatedBuilder); + + var fileName = $"{targetClassContext.Name.CapitalizeFirstLetter()}TextualNotationBuilder.cs"; + + await WriteAsync(generatedBuilder, outputDirectory, fileName); + } + } + + /// + /// Generates the Textual Notation builder facade + /// + /// the that contains the UML model to generate from + /// The target + /// If one of the given parameters is null + /// an awaitable + private Task GenerateBuilderFacade(XmiReaderResult xmiReaderResult, DirectoryInfo outputDirectory) + { + ArgumentNullException.ThrowIfNull(xmiReaderResult); + ArgumentNullException.ThrowIfNull(outputDirectory); + return this.GenerateBuilderFacadeInternal(xmiReaderResult, outputDirectory); + } + + /// + /// Generates the Textual Notation builder facade + /// + /// the that contains the UML model to generate from + /// The target + /// an awaitable + private async Task GenerateBuilderFacadeInternal(XmiReaderResult xmiReaderResult, DirectoryInfo outputDirectory) + { + var template = this.Templates[BuilderFacadeTemplateName]; + + var classes = xmiReaderResult.QueryContainedAndImported("SysML") + .SelectMany(x => x.PackagedElement.OfType()) + .Where(x => !x.IsAbstract) + .ToList(); + + var generatedFacade = template(classes); + generatedFacade = this.CodeCleanup(generatedFacade); + + await WriteAsync(generatedFacade, outputDirectory, "TextualNotationBuilderFacade.cs"); + } + } +} diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnf.interp b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnf.interp new file mode 100644 index 000000000..1291cb779 --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnf.interp @@ -0,0 +1,84 @@ +token literal names: +null +'*' +'+' +'?' +'[QualifiedName]' +null +'+=' +'?=' +'|' +':' +';' +',' +'(' +')' +'[' +']' +'{' +'}' +'.' +'~' +null +null +null +null +null +null +null +null +null + +token symbolic names: +null +null +null +null +null +ASSIGN +ADD_ASSIGN +BOOL_ASSIGN +PIPE +COLON +SEMICOLON +COMMA +LPAREN +RPAREN +LBRACK +RBRACK +LBRACE +RBRACE +DOT +TILDE +UPPER_ID +ID +SINGLE_QUOTED_STRING +INT +STRING +COMMENT +WS +CONTINUATION +NL + +rule names: +specification +rule_definition +parameter_list +alternatives +alternative +element +assignment +non_parsing_assignment +non_parsing_empty +cross_reference +group +terminal +non_terminal +element_core +dotted_id +suffix_op +value_literal + + +atn: +[4, 1, 28, 154, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 1, 0, 5, 0, 36, 8, 0, 10, 0, 12, 0, 39, 9, 0, 1, 0, 4, 0, 42, 8, 0, 11, 0, 12, 0, 43, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 50, 8, 1, 1, 1, 1, 1, 3, 1, 54, 8, 1, 1, 1, 1, 1, 1, 1, 3, 1, 59, 8, 1, 1, 1, 4, 1, 62, 8, 1, 11, 1, 12, 1, 63, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 5, 3, 75, 8, 3, 10, 3, 12, 3, 78, 9, 3, 1, 4, 5, 4, 81, 8, 4, 10, 4, 12, 4, 84, 9, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 94, 8, 5, 1, 6, 1, 6, 1, 6, 3, 6, 99, 8, 6, 1, 6, 1, 6, 3, 6, 103, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 9, 3, 9, 115, 8, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 125, 8, 10, 1, 11, 1, 11, 3, 11, 129, 8, 11, 1, 12, 1, 12, 3, 12, 133, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 140, 8, 13, 1, 14, 1, 14, 1, 14, 5, 14, 145, 8, 14, 10, 14, 12, 14, 148, 9, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 0, 0, 17, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 0, 4, 1, 0, 5, 7, 1, 0, 5, 6, 1, 0, 1, 3, 2, 0, 4, 4, 21, 24, 162, 0, 37, 1, 0, 0, 0, 2, 47, 1, 0, 0, 0, 4, 65, 1, 0, 0, 0, 6, 71, 1, 0, 0, 0, 8, 82, 1, 0, 0, 0, 10, 93, 1, 0, 0, 0, 12, 95, 1, 0, 0, 0, 14, 104, 1, 0, 0, 0, 16, 110, 1, 0, 0, 0, 18, 114, 1, 0, 0, 0, 20, 120, 1, 0, 0, 0, 22, 126, 1, 0, 0, 0, 24, 130, 1, 0, 0, 0, 26, 139, 1, 0, 0, 0, 28, 141, 1, 0, 0, 0, 30, 149, 1, 0, 0, 0, 32, 151, 1, 0, 0, 0, 34, 36, 5, 28, 0, 0, 35, 34, 1, 0, 0, 0, 36, 39, 1, 0, 0, 0, 37, 35, 1, 0, 0, 0, 37, 38, 1, 0, 0, 0, 38, 41, 1, 0, 0, 0, 39, 37, 1, 0, 0, 0, 40, 42, 3, 2, 1, 0, 41, 40, 1, 0, 0, 0, 42, 43, 1, 0, 0, 0, 43, 41, 1, 0, 0, 0, 43, 44, 1, 0, 0, 0, 44, 45, 1, 0, 0, 0, 45, 46, 5, 0, 0, 1, 46, 1, 1, 0, 0, 0, 47, 49, 5, 20, 0, 0, 48, 50, 3, 4, 2, 0, 49, 48, 1, 0, 0, 0, 49, 50, 1, 0, 0, 0, 50, 53, 1, 0, 0, 0, 51, 52, 5, 9, 0, 0, 52, 54, 5, 20, 0, 0, 53, 51, 1, 0, 0, 0, 53, 54, 1, 0, 0, 0, 54, 55, 1, 0, 0, 0, 55, 56, 5, 5, 0, 0, 56, 58, 3, 6, 3, 0, 57, 59, 5, 10, 0, 0, 58, 57, 1, 0, 0, 0, 58, 59, 1, 0, 0, 0, 59, 61, 1, 0, 0, 0, 60, 62, 5, 28, 0, 0, 61, 60, 1, 0, 0, 0, 62, 63, 1, 0, 0, 0, 63, 61, 1, 0, 0, 0, 63, 64, 1, 0, 0, 0, 64, 3, 1, 0, 0, 0, 65, 66, 5, 12, 0, 0, 66, 67, 5, 21, 0, 0, 67, 68, 5, 9, 0, 0, 68, 69, 5, 21, 0, 0, 69, 70, 5, 13, 0, 0, 70, 5, 1, 0, 0, 0, 71, 76, 3, 8, 4, 0, 72, 73, 5, 8, 0, 0, 73, 75, 3, 8, 4, 0, 74, 72, 1, 0, 0, 0, 75, 78, 1, 0, 0, 0, 76, 74, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 7, 1, 0, 0, 0, 78, 76, 1, 0, 0, 0, 79, 81, 3, 10, 5, 0, 80, 79, 1, 0, 0, 0, 81, 84, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 82, 83, 1, 0, 0, 0, 83, 9, 1, 0, 0, 0, 84, 82, 1, 0, 0, 0, 85, 94, 3, 12, 6, 0, 86, 94, 3, 14, 7, 0, 87, 94, 3, 16, 8, 0, 88, 94, 3, 18, 9, 0, 89, 94, 3, 20, 10, 0, 90, 94, 3, 22, 11, 0, 91, 94, 3, 24, 12, 0, 92, 94, 3, 32, 16, 0, 93, 85, 1, 0, 0, 0, 93, 86, 1, 0, 0, 0, 93, 87, 1, 0, 0, 0, 93, 88, 1, 0, 0, 0, 93, 89, 1, 0, 0, 0, 93, 90, 1, 0, 0, 0, 93, 91, 1, 0, 0, 0, 93, 92, 1, 0, 0, 0, 94, 11, 1, 0, 0, 0, 95, 96, 3, 28, 14, 0, 96, 98, 7, 0, 0, 0, 97, 99, 5, 19, 0, 0, 98, 97, 1, 0, 0, 0, 98, 99, 1, 0, 0, 0, 99, 100, 1, 0, 0, 0, 100, 102, 3, 26, 13, 0, 101, 103, 3, 30, 15, 0, 102, 101, 1, 0, 0, 0, 102, 103, 1, 0, 0, 0, 103, 13, 1, 0, 0, 0, 104, 105, 5, 16, 0, 0, 105, 106, 3, 28, 14, 0, 106, 107, 7, 1, 0, 0, 107, 108, 3, 32, 16, 0, 108, 109, 5, 17, 0, 0, 109, 15, 1, 0, 0, 0, 110, 111, 5, 16, 0, 0, 111, 112, 5, 17, 0, 0, 112, 17, 1, 0, 0, 0, 113, 115, 5, 19, 0, 0, 114, 113, 1, 0, 0, 0, 114, 115, 1, 0, 0, 0, 115, 116, 1, 0, 0, 0, 116, 117, 5, 14, 0, 0, 117, 118, 5, 21, 0, 0, 118, 119, 5, 15, 0, 0, 119, 19, 1, 0, 0, 0, 120, 121, 5, 12, 0, 0, 121, 122, 3, 6, 3, 0, 122, 124, 5, 13, 0, 0, 123, 125, 3, 30, 15, 0, 124, 123, 1, 0, 0, 0, 124, 125, 1, 0, 0, 0, 125, 21, 1, 0, 0, 0, 126, 128, 5, 22, 0, 0, 127, 129, 3, 30, 15, 0, 128, 127, 1, 0, 0, 0, 128, 129, 1, 0, 0, 0, 129, 23, 1, 0, 0, 0, 130, 132, 5, 20, 0, 0, 131, 133, 3, 30, 15, 0, 132, 131, 1, 0, 0, 0, 132, 133, 1, 0, 0, 0, 133, 25, 1, 0, 0, 0, 134, 140, 3, 18, 9, 0, 135, 140, 3, 20, 10, 0, 136, 140, 3, 22, 11, 0, 137, 140, 3, 24, 12, 0, 138, 140, 3, 32, 16, 0, 139, 134, 1, 0, 0, 0, 139, 135, 1, 0, 0, 0, 139, 136, 1, 0, 0, 0, 139, 137, 1, 0, 0, 0, 139, 138, 1, 0, 0, 0, 140, 27, 1, 0, 0, 0, 141, 146, 5, 21, 0, 0, 142, 143, 5, 18, 0, 0, 143, 145, 5, 21, 0, 0, 144, 142, 1, 0, 0, 0, 145, 148, 1, 0, 0, 0, 146, 144, 1, 0, 0, 0, 146, 147, 1, 0, 0, 0, 147, 29, 1, 0, 0, 0, 148, 146, 1, 0, 0, 0, 149, 150, 7, 2, 0, 0, 150, 31, 1, 0, 0, 0, 151, 152, 7, 3, 0, 0, 152, 33, 1, 0, 0, 0, 17, 37, 43, 49, 53, 58, 63, 76, 82, 93, 98, 102, 114, 124, 128, 132, 139, 146] \ No newline at end of file diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnf.tokens b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnf.tokens new file mode 100644 index 000000000..5c28d84ec --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnf.tokens @@ -0,0 +1,46 @@ +T__0=1 +T__1=2 +T__2=3 +T__3=4 +ASSIGN=5 +ADD_ASSIGN=6 +BOOL_ASSIGN=7 +PIPE=8 +COLON=9 +SEMICOLON=10 +COMMA=11 +LPAREN=12 +RPAREN=13 +LBRACK=14 +RBRACK=15 +LBRACE=16 +RBRACE=17 +DOT=18 +TILDE=19 +UPPER_ID=20 +ID=21 +SINGLE_QUOTED_STRING=22 +INT=23 +STRING=24 +COMMENT=25 +WS=26 +CONTINUATION=27 +NL=28 +'*'=1 +'+'=2 +'?'=3 +'[QualifiedName]'=4 +'+='=6 +'?='=7 +'|'=8 +':'=9 +';'=10 +','=11 +'('=12 +')'=13 +'['=14 +']'=15 +'{'=16 +'}'=17 +'.'=18 +'~'=19 diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfBaseListener.cs b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfBaseListener.cs new file mode 100644 index 000000000..1593400e7 --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfBaseListener.cs @@ -0,0 +1,257 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// ANTLR Version: 4.13.2 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +// Generated from C:/CODE/SysML2.NET/Resources/kebnf.g4 by ANTLR 4.13.2 + +// Unreachable code detected +#pragma warning disable 0162 +// The variable '...' is assigned but its value is never used +#pragma warning disable 0219 +// Missing XML comment for publicly visible type or member '...' +#pragma warning disable 1591 +// Ambiguous reference in cref attribute +#pragma warning disable 419 + +namespace SysML2.NET.CodeGenerator.Grammar { + +using Antlr4.Runtime.Misc; +using IErrorNode = Antlr4.Runtime.Tree.IErrorNode; +using ITerminalNode = Antlr4.Runtime.Tree.ITerminalNode; +using IToken = Antlr4.Runtime.IToken; +using ParserRuleContext = Antlr4.Runtime.ParserRuleContext; + +/// +/// This class provides an empty implementation of , +/// which can be extended to create a listener which only needs to handle a subset +/// of the available methods. +/// +[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.13.2")] +[System.Diagnostics.DebuggerNonUserCode] +[System.CLSCompliant(false)] +public partial class kebnfBaseListener : IkebnfListener { + /// + /// Enter a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void EnterSpecification([NotNull] kebnfParser.SpecificationContext context) { } + /// + /// Exit a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void ExitSpecification([NotNull] kebnfParser.SpecificationContext context) { } + /// + /// Enter a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void EnterRule_definition([NotNull] kebnfParser.Rule_definitionContext context) { } + /// + /// Exit a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void ExitRule_definition([NotNull] kebnfParser.Rule_definitionContext context) { } + /// + /// Enter a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void EnterParameter_list([NotNull] kebnfParser.Parameter_listContext context) { } + /// + /// Exit a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void ExitParameter_list([NotNull] kebnfParser.Parameter_listContext context) { } + /// + /// Enter a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void EnterAlternatives([NotNull] kebnfParser.AlternativesContext context) { } + /// + /// Exit a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void ExitAlternatives([NotNull] kebnfParser.AlternativesContext context) { } + /// + /// Enter a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void EnterAlternative([NotNull] kebnfParser.AlternativeContext context) { } + /// + /// Exit a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void ExitAlternative([NotNull] kebnfParser.AlternativeContext context) { } + /// + /// Enter a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void EnterElement([NotNull] kebnfParser.ElementContext context) { } + /// + /// Exit a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void ExitElement([NotNull] kebnfParser.ElementContext context) { } + /// + /// Enter a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void EnterAssignment([NotNull] kebnfParser.AssignmentContext context) { } + /// + /// Exit a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void ExitAssignment([NotNull] kebnfParser.AssignmentContext context) { } + /// + /// Enter a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void EnterNon_parsing_assignment([NotNull] kebnfParser.Non_parsing_assignmentContext context) { } + /// + /// Exit a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void ExitNon_parsing_assignment([NotNull] kebnfParser.Non_parsing_assignmentContext context) { } + /// + /// Enter a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void EnterNon_parsing_empty([NotNull] kebnfParser.Non_parsing_emptyContext context) { } + /// + /// Exit a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void ExitNon_parsing_empty([NotNull] kebnfParser.Non_parsing_emptyContext context) { } + /// + /// Enter a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void EnterCross_reference([NotNull] kebnfParser.Cross_referenceContext context) { } + /// + /// Exit a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void ExitCross_reference([NotNull] kebnfParser.Cross_referenceContext context) { } + /// + /// Enter a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void EnterGroup([NotNull] kebnfParser.GroupContext context) { } + /// + /// Exit a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void ExitGroup([NotNull] kebnfParser.GroupContext context) { } + /// + /// Enter a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void EnterTerminal([NotNull] kebnfParser.TerminalContext context) { } + /// + /// Exit a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void ExitTerminal([NotNull] kebnfParser.TerminalContext context) { } + /// + /// Enter a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void EnterNon_terminal([NotNull] kebnfParser.Non_terminalContext context) { } + /// + /// Exit a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void ExitNon_terminal([NotNull] kebnfParser.Non_terminalContext context) { } + /// + /// Enter a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void EnterElement_core([NotNull] kebnfParser.Element_coreContext context) { } + /// + /// Exit a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void ExitElement_core([NotNull] kebnfParser.Element_coreContext context) { } + /// + /// Enter a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void EnterDotted_id([NotNull] kebnfParser.Dotted_idContext context) { } + /// + /// Exit a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void ExitDotted_id([NotNull] kebnfParser.Dotted_idContext context) { } + /// + /// Enter a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void EnterSuffix_op([NotNull] kebnfParser.Suffix_opContext context) { } + /// + /// Exit a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void ExitSuffix_op([NotNull] kebnfParser.Suffix_opContext context) { } + /// + /// Enter a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void EnterValue_literal([NotNull] kebnfParser.Value_literalContext context) { } + /// + /// Exit a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void ExitValue_literal([NotNull] kebnfParser.Value_literalContext context) { } + + /// + /// The default implementation does nothing. + public virtual void EnterEveryRule([NotNull] ParserRuleContext context) { } + /// + /// The default implementation does nothing. + public virtual void ExitEveryRule([NotNull] ParserRuleContext context) { } + /// + /// The default implementation does nothing. + public virtual void VisitTerminal([NotNull] ITerminalNode node) { } + /// + /// The default implementation does nothing. + public virtual void VisitErrorNode([NotNull] IErrorNode node) { } +} +} // namespace SysML2.NET.CodeGenerator.Grammar diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfBaseVisitor.cs b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfBaseVisitor.cs new file mode 100644 index 000000000..3a64587f2 --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfBaseVisitor.cs @@ -0,0 +1,209 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// ANTLR Version: 4.13.2 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +// Generated from C:/CODE/SysML2.NET/Resources/kebnf.g4 by ANTLR 4.13.2 + +// Unreachable code detected +#pragma warning disable 0162 +// The variable '...' is assigned but its value is never used +#pragma warning disable 0219 +// Missing XML comment for publicly visible type or member '...' +#pragma warning disable 1591 +// Ambiguous reference in cref attribute +#pragma warning disable 419 + +namespace SysML2.NET.CodeGenerator.Grammar { +using Antlr4.Runtime.Misc; +using Antlr4.Runtime.Tree; +using IToken = Antlr4.Runtime.IToken; +using ParserRuleContext = Antlr4.Runtime.ParserRuleContext; + +/// +/// This class provides an empty implementation of , +/// which can be extended to create a visitor which only needs to handle a subset +/// of the available methods. +/// +/// The return type of the visit operation. +[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.13.2")] +[System.Diagnostics.DebuggerNonUserCode] +[System.CLSCompliant(false)] +public partial class kebnfBaseVisitor : AbstractParseTreeVisitor, IkebnfVisitor { + /// + /// Visit a parse tree produced by . + /// + /// The default implementation returns the result of calling + /// on . + /// + /// + /// The parse tree. + /// The visitor result. + public virtual Result VisitSpecification([NotNull] kebnfParser.SpecificationContext context) { return VisitChildren(context); } + /// + /// Visit a parse tree produced by . + /// + /// The default implementation returns the result of calling + /// on . + /// + /// + /// The parse tree. + /// The visitor result. + public virtual Result VisitRule_definition([NotNull] kebnfParser.Rule_definitionContext context) { return VisitChildren(context); } + /// + /// Visit a parse tree produced by . + /// + /// The default implementation returns the result of calling + /// on . + /// + /// + /// The parse tree. + /// The visitor result. + public virtual Result VisitParameter_list([NotNull] kebnfParser.Parameter_listContext context) { return VisitChildren(context); } + /// + /// Visit a parse tree produced by . + /// + /// The default implementation returns the result of calling + /// on . + /// + /// + /// The parse tree. + /// The visitor result. + public virtual Result VisitAlternatives([NotNull] kebnfParser.AlternativesContext context) { return VisitChildren(context); } + /// + /// Visit a parse tree produced by . + /// + /// The default implementation returns the result of calling + /// on . + /// + /// + /// The parse tree. + /// The visitor result. + public virtual Result VisitAlternative([NotNull] kebnfParser.AlternativeContext context) { return VisitChildren(context); } + /// + /// Visit a parse tree produced by . + /// + /// The default implementation returns the result of calling + /// on . + /// + /// + /// The parse tree. + /// The visitor result. + public virtual Result VisitElement([NotNull] kebnfParser.ElementContext context) { return VisitChildren(context); } + /// + /// Visit a parse tree produced by . + /// + /// The default implementation returns the result of calling + /// on . + /// + /// + /// The parse tree. + /// The visitor result. + public virtual Result VisitAssignment([NotNull] kebnfParser.AssignmentContext context) { return VisitChildren(context); } + /// + /// Visit a parse tree produced by . + /// + /// The default implementation returns the result of calling + /// on . + /// + /// + /// The parse tree. + /// The visitor result. + public virtual Result VisitNon_parsing_assignment([NotNull] kebnfParser.Non_parsing_assignmentContext context) { return VisitChildren(context); } + /// + /// Visit a parse tree produced by . + /// + /// The default implementation returns the result of calling + /// on . + /// + /// + /// The parse tree. + /// The visitor result. + public virtual Result VisitNon_parsing_empty([NotNull] kebnfParser.Non_parsing_emptyContext context) { return VisitChildren(context); } + /// + /// Visit a parse tree produced by . + /// + /// The default implementation returns the result of calling + /// on . + /// + /// + /// The parse tree. + /// The visitor result. + public virtual Result VisitCross_reference([NotNull] kebnfParser.Cross_referenceContext context) { return VisitChildren(context); } + /// + /// Visit a parse tree produced by . + /// + /// The default implementation returns the result of calling + /// on . + /// + /// + /// The parse tree. + /// The visitor result. + public virtual Result VisitGroup([NotNull] kebnfParser.GroupContext context) { return VisitChildren(context); } + /// + /// Visit a parse tree produced by . + /// + /// The default implementation returns the result of calling + /// on . + /// + /// + /// The parse tree. + /// The visitor result. + public virtual Result VisitTerminal([NotNull] kebnfParser.TerminalContext context) { return VisitChildren(context); } + /// + /// Visit a parse tree produced by . + /// + /// The default implementation returns the result of calling + /// on . + /// + /// + /// The parse tree. + /// The visitor result. + public virtual Result VisitNon_terminal([NotNull] kebnfParser.Non_terminalContext context) { return VisitChildren(context); } + /// + /// Visit a parse tree produced by . + /// + /// The default implementation returns the result of calling + /// on . + /// + /// + /// The parse tree. + /// The visitor result. + public virtual Result VisitElement_core([NotNull] kebnfParser.Element_coreContext context) { return VisitChildren(context); } + /// + /// Visit a parse tree produced by . + /// + /// The default implementation returns the result of calling + /// on . + /// + /// + /// The parse tree. + /// The visitor result. + public virtual Result VisitDotted_id([NotNull] kebnfParser.Dotted_idContext context) { return VisitChildren(context); } + /// + /// Visit a parse tree produced by . + /// + /// The default implementation returns the result of calling + /// on . + /// + /// + /// The parse tree. + /// The visitor result. + public virtual Result VisitSuffix_op([NotNull] kebnfParser.Suffix_opContext context) { return VisitChildren(context); } + /// + /// Visit a parse tree produced by . + /// + /// The default implementation returns the result of calling + /// on . + /// + /// + /// The parse tree. + /// The visitor result. + public virtual Result VisitValue_literal([NotNull] kebnfParser.Value_literalContext context) { return VisitChildren(context); } +} +} // namespace SysML2.NET.CodeGenerator.Grammar diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.cs b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.cs new file mode 100644 index 000000000..bae07a492 --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.cs @@ -0,0 +1,176 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// ANTLR Version: 4.13.2 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +// Generated from C:/CODE/SysML2.NET/Resources/kebnf.g4 by ANTLR 4.13.2 + +// Unreachable code detected +#pragma warning disable 0162 +// The variable '...' is assigned but its value is never used +#pragma warning disable 0219 +// Missing XML comment for publicly visible type or member '...' +#pragma warning disable 1591 +// Ambiguous reference in cref attribute +#pragma warning disable 419 + +namespace SysML2.NET.CodeGenerator.Grammar { +using System; +using System.IO; +using System.Text; +using Antlr4.Runtime; +using Antlr4.Runtime.Atn; +using Antlr4.Runtime.Misc; +using DFA = Antlr4.Runtime.Dfa.DFA; + +[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.13.2")] +[System.CLSCompliant(false)] +public partial class kebnfLexer : Lexer { + protected static DFA[] decisionToDFA; + protected static PredictionContextCache sharedContextCache = new PredictionContextCache(); + public const int + T__0=1, T__1=2, T__2=3, T__3=4, ASSIGN=5, ADD_ASSIGN=6, BOOL_ASSIGN=7, + PIPE=8, COLON=9, SEMICOLON=10, COMMA=11, LPAREN=12, RPAREN=13, LBRACK=14, + RBRACK=15, LBRACE=16, RBRACE=17, DOT=18, TILDE=19, UPPER_ID=20, ID=21, + SINGLE_QUOTED_STRING=22, INT=23, STRING=24, COMMENT=25, WS=26, CONTINUATION=27, + NL=28; + public static string[] channelNames = { + "DEFAULT_TOKEN_CHANNEL", "HIDDEN" + }; + + public static string[] modeNames = { + "DEFAULT_MODE" + }; + + public static readonly string[] ruleNames = { + "T__0", "T__1", "T__2", "T__3", "ASSIGN", "ADD_ASSIGN", "BOOL_ASSIGN", + "PIPE", "COLON", "SEMICOLON", "COMMA", "LPAREN", "RPAREN", "LBRACK", "RBRACK", + "LBRACE", "RBRACE", "DOT", "TILDE", "UPPER_ID", "ID", "SINGLE_QUOTED_STRING", + "INT", "STRING", "COMMENT", "WS", "CONTINUATION", "NL" + }; + + + public kebnfLexer(ICharStream input) + : this(input, Console.Out, Console.Error) { } + + public kebnfLexer(ICharStream input, TextWriter output, TextWriter errorOutput) + : base(input, output, errorOutput) + { + Interpreter = new LexerATNSimulator(this, _ATN, decisionToDFA, sharedContextCache); + } + + private static readonly string[] _LiteralNames = { + null, "'*'", "'+'", "'?'", "'[QualifiedName]'", null, "'+='", "'?='", + "'|'", "':'", "';'", "','", "'('", "')'", "'['", "']'", "'{'", "'}'", + "'.'", "'~'" + }; + private static readonly string[] _SymbolicNames = { + null, null, null, null, null, "ASSIGN", "ADD_ASSIGN", "BOOL_ASSIGN", "PIPE", + "COLON", "SEMICOLON", "COMMA", "LPAREN", "RPAREN", "LBRACK", "RBRACK", + "LBRACE", "RBRACE", "DOT", "TILDE", "UPPER_ID", "ID", "SINGLE_QUOTED_STRING", + "INT", "STRING", "COMMENT", "WS", "CONTINUATION", "NL" + }; + public static readonly IVocabulary DefaultVocabulary = new Vocabulary(_LiteralNames, _SymbolicNames); + + [NotNull] + public override IVocabulary Vocabulary + { + get + { + return DefaultVocabulary; + } + } + + public override string GrammarFileName { get { return "kebnf.g4"; } } + + public override string[] RuleNames { get { return ruleNames; } } + + public override string[] ChannelNames { get { return channelNames; } } + + public override string[] ModeNames { get { return modeNames; } } + + public override int[] SerializedAtn { get { return _serializedATN; } } + + static kebnfLexer() { + decisionToDFA = new DFA[_ATN.NumberOfDecisions]; + for (int i = 0; i < _ATN.NumberOfDecisions; i++) { + decisionToDFA[i] = new DFA(_ATN.GetDecisionState(i), i); + } + } + private static int[] _serializedATN = { + 4,0,28,190,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7, + 6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14, + 7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21, + 7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,26,2,27,7,27,1,0,1, + 0,1,1,1,1,1,2,1,2,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3, + 1,3,1,3,1,3,1,4,1,4,1,4,1,4,3,4,84,8,4,1,5,1,5,1,5,1,6,1,6,1,6,1,7,1,7, + 1,8,1,8,1,9,1,9,1,10,1,10,1,11,1,11,1,12,1,12,1,13,1,13,1,14,1,14,1,15, + 1,15,1,16,1,16,1,17,1,17,1,18,1,18,1,19,1,19,5,19,118,8,19,10,19,12,19, + 121,9,19,1,20,1,20,5,20,125,8,20,10,20,12,20,128,9,20,1,21,1,21,1,21,1, + 21,5,21,134,8,21,10,21,12,21,137,9,21,1,21,1,21,1,22,4,22,142,8,22,11, + 22,12,22,143,1,23,1,23,1,23,1,23,5,23,150,8,23,10,23,12,23,153,9,23,1, + 23,1,23,1,24,1,24,1,24,1,24,5,24,161,8,24,10,24,12,24,164,9,24,1,24,1, + 24,1,25,4,25,169,8,25,11,25,12,25,170,1,25,1,25,1,26,3,26,176,8,26,1,26, + 1,26,4,26,180,8,26,11,26,12,26,181,1,26,1,26,1,27,3,27,187,8,27,1,27,1, + 27,0,0,28,1,1,3,2,5,3,7,4,9,5,11,6,13,7,15,8,17,9,19,10,21,11,23,12,25, + 13,27,14,29,15,31,16,33,17,35,18,37,19,39,20,41,21,43,22,45,23,47,24,49, + 25,51,26,53,27,55,28,1,0,7,1,0,65,90,4,0,48,57,65,90,95,95,97,122,3,0, + 65,90,95,95,97,122,2,0,39,39,92,92,1,0,48,57,2,0,10,10,13,13,2,0,9,9,32, + 32,202,0,1,1,0,0,0,0,3,1,0,0,0,0,5,1,0,0,0,0,7,1,0,0,0,0,9,1,0,0,0,0,11, + 1,0,0,0,0,13,1,0,0,0,0,15,1,0,0,0,0,17,1,0,0,0,0,19,1,0,0,0,0,21,1,0,0, + 0,0,23,1,0,0,0,0,25,1,0,0,0,0,27,1,0,0,0,0,29,1,0,0,0,0,31,1,0,0,0,0,33, + 1,0,0,0,0,35,1,0,0,0,0,37,1,0,0,0,0,39,1,0,0,0,0,41,1,0,0,0,0,43,1,0,0, + 0,0,45,1,0,0,0,0,47,1,0,0,0,0,49,1,0,0,0,0,51,1,0,0,0,0,53,1,0,0,0,0,55, + 1,0,0,0,1,57,1,0,0,0,3,59,1,0,0,0,5,61,1,0,0,0,7,63,1,0,0,0,9,83,1,0,0, + 0,11,85,1,0,0,0,13,88,1,0,0,0,15,91,1,0,0,0,17,93,1,0,0,0,19,95,1,0,0, + 0,21,97,1,0,0,0,23,99,1,0,0,0,25,101,1,0,0,0,27,103,1,0,0,0,29,105,1,0, + 0,0,31,107,1,0,0,0,33,109,1,0,0,0,35,111,1,0,0,0,37,113,1,0,0,0,39,115, + 1,0,0,0,41,122,1,0,0,0,43,129,1,0,0,0,45,141,1,0,0,0,47,145,1,0,0,0,49, + 156,1,0,0,0,51,168,1,0,0,0,53,175,1,0,0,0,55,186,1,0,0,0,57,58,5,42,0, + 0,58,2,1,0,0,0,59,60,5,43,0,0,60,4,1,0,0,0,61,62,5,63,0,0,62,6,1,0,0,0, + 63,64,5,91,0,0,64,65,5,81,0,0,65,66,5,117,0,0,66,67,5,97,0,0,67,68,5,108, + 0,0,68,69,5,105,0,0,69,70,5,102,0,0,70,71,5,105,0,0,71,72,5,101,0,0,72, + 73,5,100,0,0,73,74,5,78,0,0,74,75,5,97,0,0,75,76,5,109,0,0,76,77,5,101, + 0,0,77,78,5,93,0,0,78,8,1,0,0,0,79,80,5,58,0,0,80,81,5,58,0,0,81,84,5, + 61,0,0,82,84,5,61,0,0,83,79,1,0,0,0,83,82,1,0,0,0,84,10,1,0,0,0,85,86, + 5,43,0,0,86,87,5,61,0,0,87,12,1,0,0,0,88,89,5,63,0,0,89,90,5,61,0,0,90, + 14,1,0,0,0,91,92,5,124,0,0,92,16,1,0,0,0,93,94,5,58,0,0,94,18,1,0,0,0, + 95,96,5,59,0,0,96,20,1,0,0,0,97,98,5,44,0,0,98,22,1,0,0,0,99,100,5,40, + 0,0,100,24,1,0,0,0,101,102,5,41,0,0,102,26,1,0,0,0,103,104,5,91,0,0,104, + 28,1,0,0,0,105,106,5,93,0,0,106,30,1,0,0,0,107,108,5,123,0,0,108,32,1, + 0,0,0,109,110,5,125,0,0,110,34,1,0,0,0,111,112,5,46,0,0,112,36,1,0,0,0, + 113,114,5,126,0,0,114,38,1,0,0,0,115,119,7,0,0,0,116,118,7,1,0,0,117,116, + 1,0,0,0,118,121,1,0,0,0,119,117,1,0,0,0,119,120,1,0,0,0,120,40,1,0,0,0, + 121,119,1,0,0,0,122,126,7,2,0,0,123,125,7,1,0,0,124,123,1,0,0,0,125,128, + 1,0,0,0,126,124,1,0,0,0,126,127,1,0,0,0,127,42,1,0,0,0,128,126,1,0,0,0, + 129,135,5,39,0,0,130,134,8,3,0,0,131,132,5,92,0,0,132,134,9,0,0,0,133, + 130,1,0,0,0,133,131,1,0,0,0,134,137,1,0,0,0,135,133,1,0,0,0,135,136,1, + 0,0,0,136,138,1,0,0,0,137,135,1,0,0,0,138,139,5,39,0,0,139,44,1,0,0,0, + 140,142,7,4,0,0,141,140,1,0,0,0,142,143,1,0,0,0,143,141,1,0,0,0,143,144, + 1,0,0,0,144,46,1,0,0,0,145,151,5,39,0,0,146,150,8,3,0,0,147,148,5,92,0, + 0,148,150,9,0,0,0,149,146,1,0,0,0,149,147,1,0,0,0,150,153,1,0,0,0,151, + 149,1,0,0,0,151,152,1,0,0,0,152,154,1,0,0,0,153,151,1,0,0,0,154,155,5, + 39,0,0,155,48,1,0,0,0,156,157,5,47,0,0,157,158,5,47,0,0,158,162,1,0,0, + 0,159,161,8,5,0,0,160,159,1,0,0,0,161,164,1,0,0,0,162,160,1,0,0,0,162, + 163,1,0,0,0,163,165,1,0,0,0,164,162,1,0,0,0,165,166,6,24,0,0,166,50,1, + 0,0,0,167,169,7,6,0,0,168,167,1,0,0,0,169,170,1,0,0,0,170,168,1,0,0,0, + 170,171,1,0,0,0,171,172,1,0,0,0,172,173,6,25,0,0,173,52,1,0,0,0,174,176, + 5,13,0,0,175,174,1,0,0,0,175,176,1,0,0,0,176,177,1,0,0,0,177,179,5,10, + 0,0,178,180,7,6,0,0,179,178,1,0,0,0,180,181,1,0,0,0,181,179,1,0,0,0,181, + 182,1,0,0,0,182,183,1,0,0,0,183,184,6,26,0,0,184,54,1,0,0,0,185,187,5, + 13,0,0,186,185,1,0,0,0,186,187,1,0,0,0,187,188,1,0,0,0,188,189,5,10,0, + 0,189,56,1,0,0,0,14,0,83,119,126,133,135,143,149,151,162,170,175,181,186, + 1,6,0,0 + }; + + public static readonly ATN _ATN = + new ATNDeserializer().Deserialize(_serializedATN); + + +} +} // namespace SysML2.NET.CodeGenerator.Grammar diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.interp b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.interp new file mode 100644 index 000000000..753b3d36c --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.interp @@ -0,0 +1,101 @@ +token literal names: +null +'*' +'+' +'?' +'[QualifiedName]' +null +'+=' +'?=' +'|' +':' +';' +',' +'(' +')' +'[' +']' +'{' +'}' +'.' +'~' +null +null +null +null +null +null +null +null +null + +token symbolic names: +null +null +null +null +null +ASSIGN +ADD_ASSIGN +BOOL_ASSIGN +PIPE +COLON +SEMICOLON +COMMA +LPAREN +RPAREN +LBRACK +RBRACK +LBRACE +RBRACE +DOT +TILDE +UPPER_ID +ID +SINGLE_QUOTED_STRING +INT +STRING +COMMENT +WS +CONTINUATION +NL + +rule names: +T__0 +T__1 +T__2 +T__3 +ASSIGN +ADD_ASSIGN +BOOL_ASSIGN +PIPE +COLON +SEMICOLON +COMMA +LPAREN +RPAREN +LBRACK +RBRACK +LBRACE +RBRACE +DOT +TILDE +UPPER_ID +ID +SINGLE_QUOTED_STRING +INT +STRING +COMMENT +WS +CONTINUATION +NL + +channel names: +DEFAULT_TOKEN_CHANNEL +HIDDEN + +mode names: +DEFAULT_MODE + +atn: +[4, 0, 28, 190, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 84, 8, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 18, 1, 18, 1, 19, 1, 19, 5, 19, 118, 8, 19, 10, 19, 12, 19, 121, 9, 19, 1, 20, 1, 20, 5, 20, 125, 8, 20, 10, 20, 12, 20, 128, 9, 20, 1, 21, 1, 21, 1, 21, 1, 21, 5, 21, 134, 8, 21, 10, 21, 12, 21, 137, 9, 21, 1, 21, 1, 21, 1, 22, 4, 22, 142, 8, 22, 11, 22, 12, 22, 143, 1, 23, 1, 23, 1, 23, 1, 23, 5, 23, 150, 8, 23, 10, 23, 12, 23, 153, 9, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 5, 24, 161, 8, 24, 10, 24, 12, 24, 164, 9, 24, 1, 24, 1, 24, 1, 25, 4, 25, 169, 8, 25, 11, 25, 12, 25, 170, 1, 25, 1, 25, 1, 26, 3, 26, 176, 8, 26, 1, 26, 1, 26, 4, 26, 180, 8, 26, 11, 26, 12, 26, 181, 1, 26, 1, 26, 1, 27, 3, 27, 187, 8, 27, 1, 27, 1, 27, 0, 0, 28, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 1, 0, 7, 1, 0, 65, 90, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 3, 0, 65, 90, 95, 95, 97, 122, 2, 0, 39, 39, 92, 92, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, 0, 9, 9, 32, 32, 202, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 1, 57, 1, 0, 0, 0, 3, 59, 1, 0, 0, 0, 5, 61, 1, 0, 0, 0, 7, 63, 1, 0, 0, 0, 9, 83, 1, 0, 0, 0, 11, 85, 1, 0, 0, 0, 13, 88, 1, 0, 0, 0, 15, 91, 1, 0, 0, 0, 17, 93, 1, 0, 0, 0, 19, 95, 1, 0, 0, 0, 21, 97, 1, 0, 0, 0, 23, 99, 1, 0, 0, 0, 25, 101, 1, 0, 0, 0, 27, 103, 1, 0, 0, 0, 29, 105, 1, 0, 0, 0, 31, 107, 1, 0, 0, 0, 33, 109, 1, 0, 0, 0, 35, 111, 1, 0, 0, 0, 37, 113, 1, 0, 0, 0, 39, 115, 1, 0, 0, 0, 41, 122, 1, 0, 0, 0, 43, 129, 1, 0, 0, 0, 45, 141, 1, 0, 0, 0, 47, 145, 1, 0, 0, 0, 49, 156, 1, 0, 0, 0, 51, 168, 1, 0, 0, 0, 53, 175, 1, 0, 0, 0, 55, 186, 1, 0, 0, 0, 57, 58, 5, 42, 0, 0, 58, 2, 1, 0, 0, 0, 59, 60, 5, 43, 0, 0, 60, 4, 1, 0, 0, 0, 61, 62, 5, 63, 0, 0, 62, 6, 1, 0, 0, 0, 63, 64, 5, 91, 0, 0, 64, 65, 5, 81, 0, 0, 65, 66, 5, 117, 0, 0, 66, 67, 5, 97, 0, 0, 67, 68, 5, 108, 0, 0, 68, 69, 5, 105, 0, 0, 69, 70, 5, 102, 0, 0, 70, 71, 5, 105, 0, 0, 71, 72, 5, 101, 0, 0, 72, 73, 5, 100, 0, 0, 73, 74, 5, 78, 0, 0, 74, 75, 5, 97, 0, 0, 75, 76, 5, 109, 0, 0, 76, 77, 5, 101, 0, 0, 77, 78, 5, 93, 0, 0, 78, 8, 1, 0, 0, 0, 79, 80, 5, 58, 0, 0, 80, 81, 5, 58, 0, 0, 81, 84, 5, 61, 0, 0, 82, 84, 5, 61, 0, 0, 83, 79, 1, 0, 0, 0, 83, 82, 1, 0, 0, 0, 84, 10, 1, 0, 0, 0, 85, 86, 5, 43, 0, 0, 86, 87, 5, 61, 0, 0, 87, 12, 1, 0, 0, 0, 88, 89, 5, 63, 0, 0, 89, 90, 5, 61, 0, 0, 90, 14, 1, 0, 0, 0, 91, 92, 5, 124, 0, 0, 92, 16, 1, 0, 0, 0, 93, 94, 5, 58, 0, 0, 94, 18, 1, 0, 0, 0, 95, 96, 5, 59, 0, 0, 96, 20, 1, 0, 0, 0, 97, 98, 5, 44, 0, 0, 98, 22, 1, 0, 0, 0, 99, 100, 5, 40, 0, 0, 100, 24, 1, 0, 0, 0, 101, 102, 5, 41, 0, 0, 102, 26, 1, 0, 0, 0, 103, 104, 5, 91, 0, 0, 104, 28, 1, 0, 0, 0, 105, 106, 5, 93, 0, 0, 106, 30, 1, 0, 0, 0, 107, 108, 5, 123, 0, 0, 108, 32, 1, 0, 0, 0, 109, 110, 5, 125, 0, 0, 110, 34, 1, 0, 0, 0, 111, 112, 5, 46, 0, 0, 112, 36, 1, 0, 0, 0, 113, 114, 5, 126, 0, 0, 114, 38, 1, 0, 0, 0, 115, 119, 7, 0, 0, 0, 116, 118, 7, 1, 0, 0, 117, 116, 1, 0, 0, 0, 118, 121, 1, 0, 0, 0, 119, 117, 1, 0, 0, 0, 119, 120, 1, 0, 0, 0, 120, 40, 1, 0, 0, 0, 121, 119, 1, 0, 0, 0, 122, 126, 7, 2, 0, 0, 123, 125, 7, 1, 0, 0, 124, 123, 1, 0, 0, 0, 125, 128, 1, 0, 0, 0, 126, 124, 1, 0, 0, 0, 126, 127, 1, 0, 0, 0, 127, 42, 1, 0, 0, 0, 128, 126, 1, 0, 0, 0, 129, 135, 5, 39, 0, 0, 130, 134, 8, 3, 0, 0, 131, 132, 5, 92, 0, 0, 132, 134, 9, 0, 0, 0, 133, 130, 1, 0, 0, 0, 133, 131, 1, 0, 0, 0, 134, 137, 1, 0, 0, 0, 135, 133, 1, 0, 0, 0, 135, 136, 1, 0, 0, 0, 136, 138, 1, 0, 0, 0, 137, 135, 1, 0, 0, 0, 138, 139, 5, 39, 0, 0, 139, 44, 1, 0, 0, 0, 140, 142, 7, 4, 0, 0, 141, 140, 1, 0, 0, 0, 142, 143, 1, 0, 0, 0, 143, 141, 1, 0, 0, 0, 143, 144, 1, 0, 0, 0, 144, 46, 1, 0, 0, 0, 145, 151, 5, 39, 0, 0, 146, 150, 8, 3, 0, 0, 147, 148, 5, 92, 0, 0, 148, 150, 9, 0, 0, 0, 149, 146, 1, 0, 0, 0, 149, 147, 1, 0, 0, 0, 150, 153, 1, 0, 0, 0, 151, 149, 1, 0, 0, 0, 151, 152, 1, 0, 0, 0, 152, 154, 1, 0, 0, 0, 153, 151, 1, 0, 0, 0, 154, 155, 5, 39, 0, 0, 155, 48, 1, 0, 0, 0, 156, 157, 5, 47, 0, 0, 157, 158, 5, 47, 0, 0, 158, 162, 1, 0, 0, 0, 159, 161, 8, 5, 0, 0, 160, 159, 1, 0, 0, 0, 161, 164, 1, 0, 0, 0, 162, 160, 1, 0, 0, 0, 162, 163, 1, 0, 0, 0, 163, 165, 1, 0, 0, 0, 164, 162, 1, 0, 0, 0, 165, 166, 6, 24, 0, 0, 166, 50, 1, 0, 0, 0, 167, 169, 7, 6, 0, 0, 168, 167, 1, 0, 0, 0, 169, 170, 1, 0, 0, 0, 170, 168, 1, 0, 0, 0, 170, 171, 1, 0, 0, 0, 171, 172, 1, 0, 0, 0, 172, 173, 6, 25, 0, 0, 173, 52, 1, 0, 0, 0, 174, 176, 5, 13, 0, 0, 175, 174, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 179, 5, 10, 0, 0, 178, 180, 7, 6, 0, 0, 179, 178, 1, 0, 0, 0, 180, 181, 1, 0, 0, 0, 181, 179, 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 183, 1, 0, 0, 0, 183, 184, 6, 26, 0, 0, 184, 54, 1, 0, 0, 0, 185, 187, 5, 13, 0, 0, 186, 185, 1, 0, 0, 0, 186, 187, 1, 0, 0, 0, 187, 188, 1, 0, 0, 0, 188, 189, 5, 10, 0, 0, 189, 56, 1, 0, 0, 0, 14, 0, 83, 119, 126, 133, 135, 143, 149, 151, 162, 170, 175, 181, 186, 1, 6, 0, 0] \ No newline at end of file diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.tokens b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.tokens new file mode 100644 index 000000000..5c28d84ec --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.tokens @@ -0,0 +1,46 @@ +T__0=1 +T__1=2 +T__2=3 +T__3=4 +ASSIGN=5 +ADD_ASSIGN=6 +BOOL_ASSIGN=7 +PIPE=8 +COLON=9 +SEMICOLON=10 +COMMA=11 +LPAREN=12 +RPAREN=13 +LBRACK=14 +RBRACK=15 +LBRACE=16 +RBRACE=17 +DOT=18 +TILDE=19 +UPPER_ID=20 +ID=21 +SINGLE_QUOTED_STRING=22 +INT=23 +STRING=24 +COMMENT=25 +WS=26 +CONTINUATION=27 +NL=28 +'*'=1 +'+'=2 +'?'=3 +'[QualifiedName]'=4 +'+='=6 +'?='=7 +'|'=8 +':'=9 +';'=10 +','=11 +'('=12 +')'=13 +'['=14 +']'=15 +'{'=16 +'}'=17 +'.'=18 +'~'=19 diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfListener.cs b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfListener.cs new file mode 100644 index 000000000..154345220 --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfListener.cs @@ -0,0 +1,205 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// ANTLR Version: 4.13.2 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +// Generated from C:/CODE/SysML2.NET/Resources/kebnf.g4 by ANTLR 4.13.2 + +// Unreachable code detected +#pragma warning disable 0162 +// The variable '...' is assigned but its value is never used +#pragma warning disable 0219 +// Missing XML comment for publicly visible type or member '...' +#pragma warning disable 1591 +// Ambiguous reference in cref attribute +#pragma warning disable 419 + +namespace SysML2.NET.CodeGenerator.Grammar { +using Antlr4.Runtime.Misc; +using IParseTreeListener = Antlr4.Runtime.Tree.IParseTreeListener; +using IToken = Antlr4.Runtime.IToken; + +/// +/// This interface defines a complete listener for a parse tree produced by +/// . +/// +[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.13.2")] +[System.CLSCompliant(false)] +public interface IkebnfListener : IParseTreeListener { + /// + /// Enter a parse tree produced by . + /// + /// The parse tree. + void EnterSpecification([NotNull] kebnfParser.SpecificationContext context); + /// + /// Exit a parse tree produced by . + /// + /// The parse tree. + void ExitSpecification([NotNull] kebnfParser.SpecificationContext context); + /// + /// Enter a parse tree produced by . + /// + /// The parse tree. + void EnterRule_definition([NotNull] kebnfParser.Rule_definitionContext context); + /// + /// Exit a parse tree produced by . + /// + /// The parse tree. + void ExitRule_definition([NotNull] kebnfParser.Rule_definitionContext context); + /// + /// Enter a parse tree produced by . + /// + /// The parse tree. + void EnterParameter_list([NotNull] kebnfParser.Parameter_listContext context); + /// + /// Exit a parse tree produced by . + /// + /// The parse tree. + void ExitParameter_list([NotNull] kebnfParser.Parameter_listContext context); + /// + /// Enter a parse tree produced by . + /// + /// The parse tree. + void EnterAlternatives([NotNull] kebnfParser.AlternativesContext context); + /// + /// Exit a parse tree produced by . + /// + /// The parse tree. + void ExitAlternatives([NotNull] kebnfParser.AlternativesContext context); + /// + /// Enter a parse tree produced by . + /// + /// The parse tree. + void EnterAlternative([NotNull] kebnfParser.AlternativeContext context); + /// + /// Exit a parse tree produced by . + /// + /// The parse tree. + void ExitAlternative([NotNull] kebnfParser.AlternativeContext context); + /// + /// Enter a parse tree produced by . + /// + /// The parse tree. + void EnterElement([NotNull] kebnfParser.ElementContext context); + /// + /// Exit a parse tree produced by . + /// + /// The parse tree. + void ExitElement([NotNull] kebnfParser.ElementContext context); + /// + /// Enter a parse tree produced by . + /// + /// The parse tree. + void EnterAssignment([NotNull] kebnfParser.AssignmentContext context); + /// + /// Exit a parse tree produced by . + /// + /// The parse tree. + void ExitAssignment([NotNull] kebnfParser.AssignmentContext context); + /// + /// Enter a parse tree produced by . + /// + /// The parse tree. + void EnterNon_parsing_assignment([NotNull] kebnfParser.Non_parsing_assignmentContext context); + /// + /// Exit a parse tree produced by . + /// + /// The parse tree. + void ExitNon_parsing_assignment([NotNull] kebnfParser.Non_parsing_assignmentContext context); + /// + /// Enter a parse tree produced by . + /// + /// The parse tree. + void EnterNon_parsing_empty([NotNull] kebnfParser.Non_parsing_emptyContext context); + /// + /// Exit a parse tree produced by . + /// + /// The parse tree. + void ExitNon_parsing_empty([NotNull] kebnfParser.Non_parsing_emptyContext context); + /// + /// Enter a parse tree produced by . + /// + /// The parse tree. + void EnterCross_reference([NotNull] kebnfParser.Cross_referenceContext context); + /// + /// Exit a parse tree produced by . + /// + /// The parse tree. + void ExitCross_reference([NotNull] kebnfParser.Cross_referenceContext context); + /// + /// Enter a parse tree produced by . + /// + /// The parse tree. + void EnterGroup([NotNull] kebnfParser.GroupContext context); + /// + /// Exit a parse tree produced by . + /// + /// The parse tree. + void ExitGroup([NotNull] kebnfParser.GroupContext context); + /// + /// Enter a parse tree produced by . + /// + /// The parse tree. + void EnterTerminal([NotNull] kebnfParser.TerminalContext context); + /// + /// Exit a parse tree produced by . + /// + /// The parse tree. + void ExitTerminal([NotNull] kebnfParser.TerminalContext context); + /// + /// Enter a parse tree produced by . + /// + /// The parse tree. + void EnterNon_terminal([NotNull] kebnfParser.Non_terminalContext context); + /// + /// Exit a parse tree produced by . + /// + /// The parse tree. + void ExitNon_terminal([NotNull] kebnfParser.Non_terminalContext context); + /// + /// Enter a parse tree produced by . + /// + /// The parse tree. + void EnterElement_core([NotNull] kebnfParser.Element_coreContext context); + /// + /// Exit a parse tree produced by . + /// + /// The parse tree. + void ExitElement_core([NotNull] kebnfParser.Element_coreContext context); + /// + /// Enter a parse tree produced by . + /// + /// The parse tree. + void EnterDotted_id([NotNull] kebnfParser.Dotted_idContext context); + /// + /// Exit a parse tree produced by . + /// + /// The parse tree. + void ExitDotted_id([NotNull] kebnfParser.Dotted_idContext context); + /// + /// Enter a parse tree produced by . + /// + /// The parse tree. + void EnterSuffix_op([NotNull] kebnfParser.Suffix_opContext context); + /// + /// Exit a parse tree produced by . + /// + /// The parse tree. + void ExitSuffix_op([NotNull] kebnfParser.Suffix_opContext context); + /// + /// Enter a parse tree produced by . + /// + /// The parse tree. + void EnterValue_literal([NotNull] kebnfParser.Value_literalContext context); + /// + /// Exit a parse tree produced by . + /// + /// The parse tree. + void ExitValue_literal([NotNull] kebnfParser.Value_literalContext context); +} +} // namespace SysML2.NET.CodeGenerator.Grammar diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfParser.cs b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfParser.cs new file mode 100644 index 000000000..7cfb9dadc --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfParser.cs @@ -0,0 +1,1447 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// ANTLR Version: 4.13.2 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +// Generated from C:/CODE/SysML2.NET/Resources/kebnf.g4 by ANTLR 4.13.2 + +// Unreachable code detected +#pragma warning disable 0162 +// The variable '...' is assigned but its value is never used +#pragma warning disable 0219 +// Missing XML comment for publicly visible type or member '...' +#pragma warning disable 1591 +// Ambiguous reference in cref attribute +#pragma warning disable 419 + +namespace SysML2.NET.CodeGenerator.Grammar { +using System; +using System.IO; +using System.Text; +using System.Diagnostics; +using System.Collections.Generic; +using Antlr4.Runtime; +using Antlr4.Runtime.Atn; +using Antlr4.Runtime.Misc; +using Antlr4.Runtime.Tree; +using DFA = Antlr4.Runtime.Dfa.DFA; + +[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.13.2")] +[System.CLSCompliant(false)] +public partial class kebnfParser : Parser { + protected static DFA[] decisionToDFA; + protected static PredictionContextCache sharedContextCache = new PredictionContextCache(); + public const int + T__0=1, T__1=2, T__2=3, T__3=4, ASSIGN=5, ADD_ASSIGN=6, BOOL_ASSIGN=7, + PIPE=8, COLON=9, SEMICOLON=10, COMMA=11, LPAREN=12, RPAREN=13, LBRACK=14, + RBRACK=15, LBRACE=16, RBRACE=17, DOT=18, TILDE=19, UPPER_ID=20, ID=21, + SINGLE_QUOTED_STRING=22, INT=23, STRING=24, COMMENT=25, WS=26, CONTINUATION=27, + NL=28; + public const int + RULE_specification = 0, RULE_rule_definition = 1, RULE_parameter_list = 2, + RULE_alternatives = 3, RULE_alternative = 4, RULE_element = 5, RULE_assignment = 6, + RULE_non_parsing_assignment = 7, RULE_non_parsing_empty = 8, RULE_cross_reference = 9, + RULE_group = 10, RULE_terminal = 11, RULE_non_terminal = 12, RULE_element_core = 13, + RULE_dotted_id = 14, RULE_suffix_op = 15, RULE_value_literal = 16; + public static readonly string[] ruleNames = { + "specification", "rule_definition", "parameter_list", "alternatives", + "alternative", "element", "assignment", "non_parsing_assignment", "non_parsing_empty", + "cross_reference", "group", "terminal", "non_terminal", "element_core", + "dotted_id", "suffix_op", "value_literal" + }; + + private static readonly string[] _LiteralNames = { + null, "'*'", "'+'", "'?'", "'[QualifiedName]'", null, "'+='", "'?='", + "'|'", "':'", "';'", "','", "'('", "')'", "'['", "']'", "'{'", "'}'", + "'.'", "'~'" + }; + private static readonly string[] _SymbolicNames = { + null, null, null, null, null, "ASSIGN", "ADD_ASSIGN", "BOOL_ASSIGN", "PIPE", + "COLON", "SEMICOLON", "COMMA", "LPAREN", "RPAREN", "LBRACK", "RBRACK", + "LBRACE", "RBRACE", "DOT", "TILDE", "UPPER_ID", "ID", "SINGLE_QUOTED_STRING", + "INT", "STRING", "COMMENT", "WS", "CONTINUATION", "NL" + }; + public static readonly IVocabulary DefaultVocabulary = new Vocabulary(_LiteralNames, _SymbolicNames); + + [NotNull] + public override IVocabulary Vocabulary + { + get + { + return DefaultVocabulary; + } + } + + public override string GrammarFileName { get { return "kebnf.g4"; } } + + public override string[] RuleNames { get { return ruleNames; } } + + public override int[] SerializedAtn { get { return _serializedATN; } } + + static kebnfParser() { + decisionToDFA = new DFA[_ATN.NumberOfDecisions]; + for (int i = 0; i < _ATN.NumberOfDecisions; i++) { + decisionToDFA[i] = new DFA(_ATN.GetDecisionState(i), i); + } + } + + public kebnfParser(ITokenStream input) : this(input, Console.Out, Console.Error) { } + + public kebnfParser(ITokenStream input, TextWriter output, TextWriter errorOutput) + : base(input, output, errorOutput) + { + Interpreter = new ParserATNSimulator(this, _ATN, decisionToDFA, sharedContextCache); + } + + public partial class SpecificationContext : ParserRuleContext { + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode Eof() { return GetToken(kebnfParser.Eof, 0); } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] NL() { return GetTokens(kebnfParser.NL); } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode NL(int i) { + return GetToken(kebnfParser.NL, i); + } + [System.Diagnostics.DebuggerNonUserCode] public Rule_definitionContext[] rule_definition() { + return GetRuleContexts(); + } + [System.Diagnostics.DebuggerNonUserCode] public Rule_definitionContext rule_definition(int i) { + return GetRuleContext(i); + } + public SpecificationContext(ParserRuleContext parent, int invokingState) + : base(parent, invokingState) + { + } + public override int RuleIndex { get { return RULE_specification; } } + [System.Diagnostics.DebuggerNonUserCode] + public override void EnterRule(IParseTreeListener listener) { + IkebnfListener typedListener = listener as IkebnfListener; + if (typedListener != null) typedListener.EnterSpecification(this); + } + [System.Diagnostics.DebuggerNonUserCode] + public override void ExitRule(IParseTreeListener listener) { + IkebnfListener typedListener = listener as IkebnfListener; + if (typedListener != null) typedListener.ExitSpecification(this); + } + [System.Diagnostics.DebuggerNonUserCode] + public override TResult Accept(IParseTreeVisitor visitor) { + IkebnfVisitor typedVisitor = visitor as IkebnfVisitor; + if (typedVisitor != null) return typedVisitor.VisitSpecification(this); + else return visitor.VisitChildren(this); + } + } + + [RuleVersion(0)] + public SpecificationContext specification() { + SpecificationContext _localctx = new SpecificationContext(Context, State); + EnterRule(_localctx, 0, RULE_specification); + int _la; + try { + EnterOuterAlt(_localctx, 1); + { + State = 37; + ErrorHandler.Sync(this); + _la = TokenStream.LA(1); + while (_la==NL) { + { + { + State = 34; + Match(NL); + } + } + State = 39; + ErrorHandler.Sync(this); + _la = TokenStream.LA(1); + } + State = 41; + ErrorHandler.Sync(this); + _la = TokenStream.LA(1); + do { + { + { + State = 40; + rule_definition(); + } + } + State = 43; + ErrorHandler.Sync(this); + _la = TokenStream.LA(1); + } while ( _la==UPPER_ID ); + State = 45; + Match(Eof); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + ErrorHandler.ReportError(this, re); + ErrorHandler.Recover(this, re); + } + finally { + ExitRule(); + } + return _localctx; + } + + public partial class Rule_definitionContext : ParserRuleContext { + public IToken name; + public Parameter_listContext @params; + public IToken target_ast; + public AlternativesContext rule_body; + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ASSIGN() { return GetToken(kebnfParser.ASSIGN, 0); } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] UPPER_ID() { return GetTokens(kebnfParser.UPPER_ID); } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode UPPER_ID(int i) { + return GetToken(kebnfParser.UPPER_ID, i); + } + [System.Diagnostics.DebuggerNonUserCode] public AlternativesContext alternatives() { + return GetRuleContext(0); + } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode COLON() { return GetToken(kebnfParser.COLON, 0); } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode SEMICOLON() { return GetToken(kebnfParser.SEMICOLON, 0); } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] NL() { return GetTokens(kebnfParser.NL); } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode NL(int i) { + return GetToken(kebnfParser.NL, i); + } + [System.Diagnostics.DebuggerNonUserCode] public Parameter_listContext parameter_list() { + return GetRuleContext(0); + } + public Rule_definitionContext(ParserRuleContext parent, int invokingState) + : base(parent, invokingState) + { + } + public override int RuleIndex { get { return RULE_rule_definition; } } + [System.Diagnostics.DebuggerNonUserCode] + public override void EnterRule(IParseTreeListener listener) { + IkebnfListener typedListener = listener as IkebnfListener; + if (typedListener != null) typedListener.EnterRule_definition(this); + } + [System.Diagnostics.DebuggerNonUserCode] + public override void ExitRule(IParseTreeListener listener) { + IkebnfListener typedListener = listener as IkebnfListener; + if (typedListener != null) typedListener.ExitRule_definition(this); + } + [System.Diagnostics.DebuggerNonUserCode] + public override TResult Accept(IParseTreeVisitor visitor) { + IkebnfVisitor typedVisitor = visitor as IkebnfVisitor; + if (typedVisitor != null) return typedVisitor.VisitRule_definition(this); + else return visitor.VisitChildren(this); + } + } + + [RuleVersion(0)] + public Rule_definitionContext rule_definition() { + Rule_definitionContext _localctx = new Rule_definitionContext(Context, State); + EnterRule(_localctx, 2, RULE_rule_definition); + int _la; + try { + EnterOuterAlt(_localctx, 1); + { + State = 47; + _localctx.name = Match(UPPER_ID); + State = 49; + ErrorHandler.Sync(this); + _la = TokenStream.LA(1); + if (_la==LPAREN) { + { + State = 48; + _localctx.@params = parameter_list(); + } + } + + State = 53; + ErrorHandler.Sync(this); + _la = TokenStream.LA(1); + if (_la==COLON) { + { + State = 51; + Match(COLON); + State = 52; + _localctx.target_ast = Match(UPPER_ID); + } + } + + State = 55; + Match(ASSIGN); + State = 56; + _localctx.rule_body = alternatives(); + State = 58; + ErrorHandler.Sync(this); + _la = TokenStream.LA(1); + if (_la==SEMICOLON) { + { + State = 57; + Match(SEMICOLON); + } + } + + State = 61; + ErrorHandler.Sync(this); + _la = TokenStream.LA(1); + do { + { + { + State = 60; + Match(NL); + } + } + State = 63; + ErrorHandler.Sync(this); + _la = TokenStream.LA(1); + } while ( _la==NL ); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + ErrorHandler.ReportError(this, re); + ErrorHandler.Recover(this, re); + } + finally { + ExitRule(); + } + return _localctx; + } + + public partial class Parameter_listContext : ParserRuleContext { + public IToken param_name; + public IToken param_type; + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LPAREN() { return GetToken(kebnfParser.LPAREN, 0); } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode COLON() { return GetToken(kebnfParser.COLON, 0); } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RPAREN() { return GetToken(kebnfParser.RPAREN, 0); } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] ID() { return GetTokens(kebnfParser.ID); } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ID(int i) { + return GetToken(kebnfParser.ID, i); + } + public Parameter_listContext(ParserRuleContext parent, int invokingState) + : base(parent, invokingState) + { + } + public override int RuleIndex { get { return RULE_parameter_list; } } + [System.Diagnostics.DebuggerNonUserCode] + public override void EnterRule(IParseTreeListener listener) { + IkebnfListener typedListener = listener as IkebnfListener; + if (typedListener != null) typedListener.EnterParameter_list(this); + } + [System.Diagnostics.DebuggerNonUserCode] + public override void ExitRule(IParseTreeListener listener) { + IkebnfListener typedListener = listener as IkebnfListener; + if (typedListener != null) typedListener.ExitParameter_list(this); + } + [System.Diagnostics.DebuggerNonUserCode] + public override TResult Accept(IParseTreeVisitor visitor) { + IkebnfVisitor typedVisitor = visitor as IkebnfVisitor; + if (typedVisitor != null) return typedVisitor.VisitParameter_list(this); + else return visitor.VisitChildren(this); + } + } + + [RuleVersion(0)] + public Parameter_listContext parameter_list() { + Parameter_listContext _localctx = new Parameter_listContext(Context, State); + EnterRule(_localctx, 4, RULE_parameter_list); + try { + EnterOuterAlt(_localctx, 1); + { + State = 65; + Match(LPAREN); + State = 66; + _localctx.param_name = Match(ID); + State = 67; + Match(COLON); + State = 68; + _localctx.param_type = Match(ID); + State = 69; + Match(RPAREN); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + ErrorHandler.ReportError(this, re); + ErrorHandler.Recover(this, re); + } + finally { + ExitRule(); + } + return _localctx; + } + + public partial class AlternativesContext : ParserRuleContext { + [System.Diagnostics.DebuggerNonUserCode] public AlternativeContext[] alternative() { + return GetRuleContexts(); + } + [System.Diagnostics.DebuggerNonUserCode] public AlternativeContext alternative(int i) { + return GetRuleContext(i); + } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] PIPE() { return GetTokens(kebnfParser.PIPE); } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode PIPE(int i) { + return GetToken(kebnfParser.PIPE, i); + } + public AlternativesContext(ParserRuleContext parent, int invokingState) + : base(parent, invokingState) + { + } + public override int RuleIndex { get { return RULE_alternatives; } } + [System.Diagnostics.DebuggerNonUserCode] + public override void EnterRule(IParseTreeListener listener) { + IkebnfListener typedListener = listener as IkebnfListener; + if (typedListener != null) typedListener.EnterAlternatives(this); + } + [System.Diagnostics.DebuggerNonUserCode] + public override void ExitRule(IParseTreeListener listener) { + IkebnfListener typedListener = listener as IkebnfListener; + if (typedListener != null) typedListener.ExitAlternatives(this); + } + [System.Diagnostics.DebuggerNonUserCode] + public override TResult Accept(IParseTreeVisitor visitor) { + IkebnfVisitor typedVisitor = visitor as IkebnfVisitor; + if (typedVisitor != null) return typedVisitor.VisitAlternatives(this); + else return visitor.VisitChildren(this); + } + } + + [RuleVersion(0)] + public AlternativesContext alternatives() { + AlternativesContext _localctx = new AlternativesContext(Context, State); + EnterRule(_localctx, 6, RULE_alternatives); + int _la; + try { + EnterOuterAlt(_localctx, 1); + { + State = 71; + alternative(); + State = 76; + ErrorHandler.Sync(this); + _la = TokenStream.LA(1); + while (_la==PIPE) { + { + { + State = 72; + Match(PIPE); + State = 73; + alternative(); + } + } + State = 78; + ErrorHandler.Sync(this); + _la = TokenStream.LA(1); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + ErrorHandler.ReportError(this, re); + ErrorHandler.Recover(this, re); + } + finally { + ExitRule(); + } + return _localctx; + } + + public partial class AlternativeContext : ParserRuleContext { + [System.Diagnostics.DebuggerNonUserCode] public ElementContext[] element() { + return GetRuleContexts(); + } + [System.Diagnostics.DebuggerNonUserCode] public ElementContext element(int i) { + return GetRuleContext(i); + } + public AlternativeContext(ParserRuleContext parent, int invokingState) + : base(parent, invokingState) + { + } + public override int RuleIndex { get { return RULE_alternative; } } + [System.Diagnostics.DebuggerNonUserCode] + public override void EnterRule(IParseTreeListener listener) { + IkebnfListener typedListener = listener as IkebnfListener; + if (typedListener != null) typedListener.EnterAlternative(this); + } + [System.Diagnostics.DebuggerNonUserCode] + public override void ExitRule(IParseTreeListener listener) { + IkebnfListener typedListener = listener as IkebnfListener; + if (typedListener != null) typedListener.ExitAlternative(this); + } + [System.Diagnostics.DebuggerNonUserCode] + public override TResult Accept(IParseTreeVisitor visitor) { + IkebnfVisitor typedVisitor = visitor as IkebnfVisitor; + if (typedVisitor != null) return typedVisitor.VisitAlternative(this); + else return visitor.VisitChildren(this); + } + } + + [RuleVersion(0)] + public AlternativeContext alternative() { + AlternativeContext _localctx = new AlternativeContext(Context, State); + EnterRule(_localctx, 8, RULE_alternative); + int _la; + try { + EnterOuterAlt(_localctx, 1); + { + State = 82; + ErrorHandler.Sync(this); + _la = TokenStream.LA(1); + while ((((_la) & ~0x3f) == 0 && ((1L << _la) & 33116176L) != 0)) { + { + { + State = 79; + element(); + } + } + State = 84; + ErrorHandler.Sync(this); + _la = TokenStream.LA(1); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + ErrorHandler.ReportError(this, re); + ErrorHandler.Recover(this, re); + } + finally { + ExitRule(); + } + return _localctx; + } + + public partial class ElementContext : ParserRuleContext { + [System.Diagnostics.DebuggerNonUserCode] public AssignmentContext assignment() { + return GetRuleContext(0); + } + [System.Diagnostics.DebuggerNonUserCode] public Non_parsing_assignmentContext non_parsing_assignment() { + return GetRuleContext(0); + } + [System.Diagnostics.DebuggerNonUserCode] public Non_parsing_emptyContext non_parsing_empty() { + return GetRuleContext(0); + } + [System.Diagnostics.DebuggerNonUserCode] public Cross_referenceContext cross_reference() { + return GetRuleContext(0); + } + [System.Diagnostics.DebuggerNonUserCode] public GroupContext group() { + return GetRuleContext(0); + } + [System.Diagnostics.DebuggerNonUserCode] public TerminalContext terminal() { + return GetRuleContext(0); + } + [System.Diagnostics.DebuggerNonUserCode] public Non_terminalContext non_terminal() { + return GetRuleContext(0); + } + [System.Diagnostics.DebuggerNonUserCode] public Value_literalContext value_literal() { + return GetRuleContext(0); + } + public ElementContext(ParserRuleContext parent, int invokingState) + : base(parent, invokingState) + { + } + public override int RuleIndex { get { return RULE_element; } } + [System.Diagnostics.DebuggerNonUserCode] + public override void EnterRule(IParseTreeListener listener) { + IkebnfListener typedListener = listener as IkebnfListener; + if (typedListener != null) typedListener.EnterElement(this); + } + [System.Diagnostics.DebuggerNonUserCode] + public override void ExitRule(IParseTreeListener listener) { + IkebnfListener typedListener = listener as IkebnfListener; + if (typedListener != null) typedListener.ExitElement(this); + } + [System.Diagnostics.DebuggerNonUserCode] + public override TResult Accept(IParseTreeVisitor visitor) { + IkebnfVisitor typedVisitor = visitor as IkebnfVisitor; + if (typedVisitor != null) return typedVisitor.VisitElement(this); + else return visitor.VisitChildren(this); + } + } + + [RuleVersion(0)] + public ElementContext element() { + ElementContext _localctx = new ElementContext(Context, State); + EnterRule(_localctx, 10, RULE_element); + try { + State = 93; + ErrorHandler.Sync(this); + switch ( Interpreter.AdaptivePredict(TokenStream,8,Context) ) { + case 1: + EnterOuterAlt(_localctx, 1); + { + State = 85; + assignment(); + } + break; + case 2: + EnterOuterAlt(_localctx, 2); + { + State = 86; + non_parsing_assignment(); + } + break; + case 3: + EnterOuterAlt(_localctx, 3); + { + State = 87; + non_parsing_empty(); + } + break; + case 4: + EnterOuterAlt(_localctx, 4); + { + State = 88; + cross_reference(); + } + break; + case 5: + EnterOuterAlt(_localctx, 5); + { + State = 89; + group(); + } + break; + case 6: + EnterOuterAlt(_localctx, 6); + { + State = 90; + terminal(); + } + break; + case 7: + EnterOuterAlt(_localctx, 7); + { + State = 91; + non_terminal(); + } + break; + case 8: + EnterOuterAlt(_localctx, 8); + { + State = 92; + value_literal(); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + ErrorHandler.ReportError(this, re); + ErrorHandler.Recover(this, re); + } + finally { + ExitRule(); + } + return _localctx; + } + + public partial class AssignmentContext : ParserRuleContext { + public Dotted_idContext property; + public IToken op; + public IToken prefix; + public Element_coreContext content; + public Suffix_opContext suffix; + [System.Diagnostics.DebuggerNonUserCode] public Dotted_idContext dotted_id() { + return GetRuleContext(0); + } + [System.Diagnostics.DebuggerNonUserCode] public Element_coreContext element_core() { + return GetRuleContext(0); + } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ASSIGN() { return GetToken(kebnfParser.ASSIGN, 0); } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ADD_ASSIGN() { return GetToken(kebnfParser.ADD_ASSIGN, 0); } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode BOOL_ASSIGN() { return GetToken(kebnfParser.BOOL_ASSIGN, 0); } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode TILDE() { return GetToken(kebnfParser.TILDE, 0); } + [System.Diagnostics.DebuggerNonUserCode] public Suffix_opContext suffix_op() { + return GetRuleContext(0); + } + public AssignmentContext(ParserRuleContext parent, int invokingState) + : base(parent, invokingState) + { + } + public override int RuleIndex { get { return RULE_assignment; } } + [System.Diagnostics.DebuggerNonUserCode] + public override void EnterRule(IParseTreeListener listener) { + IkebnfListener typedListener = listener as IkebnfListener; + if (typedListener != null) typedListener.EnterAssignment(this); + } + [System.Diagnostics.DebuggerNonUserCode] + public override void ExitRule(IParseTreeListener listener) { + IkebnfListener typedListener = listener as IkebnfListener; + if (typedListener != null) typedListener.ExitAssignment(this); + } + [System.Diagnostics.DebuggerNonUserCode] + public override TResult Accept(IParseTreeVisitor visitor) { + IkebnfVisitor typedVisitor = visitor as IkebnfVisitor; + if (typedVisitor != null) return typedVisitor.VisitAssignment(this); + else return visitor.VisitChildren(this); + } + } + + [RuleVersion(0)] + public AssignmentContext assignment() { + AssignmentContext _localctx = new AssignmentContext(Context, State); + EnterRule(_localctx, 12, RULE_assignment); + int _la; + try { + EnterOuterAlt(_localctx, 1); + { + State = 95; + _localctx.property = dotted_id(); + State = 96; + _localctx.op = TokenStream.LT(1); + _la = TokenStream.LA(1); + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 224L) != 0)) ) { + _localctx.op = ErrorHandler.RecoverInline(this); + } + else { + ErrorHandler.ReportMatch(this); + Consume(); + } + State = 98; + ErrorHandler.Sync(this); + switch ( Interpreter.AdaptivePredict(TokenStream,9,Context) ) { + case 1: + { + State = 97; + _localctx.prefix = Match(TILDE); + } + break; + } + State = 100; + _localctx.content = element_core(); + State = 102; + ErrorHandler.Sync(this); + _la = TokenStream.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 14L) != 0)) { + { + State = 101; + _localctx.suffix = suffix_op(); + } + } + + } + } + catch (RecognitionException re) { + _localctx.exception = re; + ErrorHandler.ReportError(this, re); + ErrorHandler.Recover(this, re); + } + finally { + ExitRule(); + } + return _localctx; + } + + public partial class Non_parsing_assignmentContext : ParserRuleContext { + public Dotted_idContext property; + public IToken op; + public Value_literalContext val; + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LBRACE() { return GetToken(kebnfParser.LBRACE, 0); } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RBRACE() { return GetToken(kebnfParser.RBRACE, 0); } + [System.Diagnostics.DebuggerNonUserCode] public Dotted_idContext dotted_id() { + return GetRuleContext(0); + } + [System.Diagnostics.DebuggerNonUserCode] public Value_literalContext value_literal() { + return GetRuleContext(0); + } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ASSIGN() { return GetToken(kebnfParser.ASSIGN, 0); } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ADD_ASSIGN() { return GetToken(kebnfParser.ADD_ASSIGN, 0); } + public Non_parsing_assignmentContext(ParserRuleContext parent, int invokingState) + : base(parent, invokingState) + { + } + public override int RuleIndex { get { return RULE_non_parsing_assignment; } } + [System.Diagnostics.DebuggerNonUserCode] + public override void EnterRule(IParseTreeListener listener) { + IkebnfListener typedListener = listener as IkebnfListener; + if (typedListener != null) typedListener.EnterNon_parsing_assignment(this); + } + [System.Diagnostics.DebuggerNonUserCode] + public override void ExitRule(IParseTreeListener listener) { + IkebnfListener typedListener = listener as IkebnfListener; + if (typedListener != null) typedListener.ExitNon_parsing_assignment(this); + } + [System.Diagnostics.DebuggerNonUserCode] + public override TResult Accept(IParseTreeVisitor visitor) { + IkebnfVisitor typedVisitor = visitor as IkebnfVisitor; + if (typedVisitor != null) return typedVisitor.VisitNon_parsing_assignment(this); + else return visitor.VisitChildren(this); + } + } + + [RuleVersion(0)] + public Non_parsing_assignmentContext non_parsing_assignment() { + Non_parsing_assignmentContext _localctx = new Non_parsing_assignmentContext(Context, State); + EnterRule(_localctx, 14, RULE_non_parsing_assignment); + int _la; + try { + EnterOuterAlt(_localctx, 1); + { + State = 104; + Match(LBRACE); + State = 105; + _localctx.property = dotted_id(); + State = 106; + _localctx.op = TokenStream.LT(1); + _la = TokenStream.LA(1); + if ( !(_la==ASSIGN || _la==ADD_ASSIGN) ) { + _localctx.op = ErrorHandler.RecoverInline(this); + } + else { + ErrorHandler.ReportMatch(this); + Consume(); + } + State = 107; + _localctx.val = value_literal(); + State = 108; + Match(RBRACE); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + ErrorHandler.ReportError(this, re); + ErrorHandler.Recover(this, re); + } + finally { + ExitRule(); + } + return _localctx; + } + + public partial class Non_parsing_emptyContext : ParserRuleContext { + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LBRACE() { return GetToken(kebnfParser.LBRACE, 0); } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RBRACE() { return GetToken(kebnfParser.RBRACE, 0); } + public Non_parsing_emptyContext(ParserRuleContext parent, int invokingState) + : base(parent, invokingState) + { + } + public override int RuleIndex { get { return RULE_non_parsing_empty; } } + [System.Diagnostics.DebuggerNonUserCode] + public override void EnterRule(IParseTreeListener listener) { + IkebnfListener typedListener = listener as IkebnfListener; + if (typedListener != null) typedListener.EnterNon_parsing_empty(this); + } + [System.Diagnostics.DebuggerNonUserCode] + public override void ExitRule(IParseTreeListener listener) { + IkebnfListener typedListener = listener as IkebnfListener; + if (typedListener != null) typedListener.ExitNon_parsing_empty(this); + } + [System.Diagnostics.DebuggerNonUserCode] + public override TResult Accept(IParseTreeVisitor visitor) { + IkebnfVisitor typedVisitor = visitor as IkebnfVisitor; + if (typedVisitor != null) return typedVisitor.VisitNon_parsing_empty(this); + else return visitor.VisitChildren(this); + } + } + + [RuleVersion(0)] + public Non_parsing_emptyContext non_parsing_empty() { + Non_parsing_emptyContext _localctx = new Non_parsing_emptyContext(Context, State); + EnterRule(_localctx, 16, RULE_non_parsing_empty); + try { + EnterOuterAlt(_localctx, 1); + { + State = 110; + Match(LBRACE); + State = 111; + Match(RBRACE); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + ErrorHandler.ReportError(this, re); + ErrorHandler.Recover(this, re); + } + finally { + ExitRule(); + } + return _localctx; + } + + public partial class Cross_referenceContext : ParserRuleContext { + public IToken @ref; + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LBRACK() { return GetToken(kebnfParser.LBRACK, 0); } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RBRACK() { return GetToken(kebnfParser.RBRACK, 0); } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ID() { return GetToken(kebnfParser.ID, 0); } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode TILDE() { return GetToken(kebnfParser.TILDE, 0); } + public Cross_referenceContext(ParserRuleContext parent, int invokingState) + : base(parent, invokingState) + { + } + public override int RuleIndex { get { return RULE_cross_reference; } } + [System.Diagnostics.DebuggerNonUserCode] + public override void EnterRule(IParseTreeListener listener) { + IkebnfListener typedListener = listener as IkebnfListener; + if (typedListener != null) typedListener.EnterCross_reference(this); + } + [System.Diagnostics.DebuggerNonUserCode] + public override void ExitRule(IParseTreeListener listener) { + IkebnfListener typedListener = listener as IkebnfListener; + if (typedListener != null) typedListener.ExitCross_reference(this); + } + [System.Diagnostics.DebuggerNonUserCode] + public override TResult Accept(IParseTreeVisitor visitor) { + IkebnfVisitor typedVisitor = visitor as IkebnfVisitor; + if (typedVisitor != null) return typedVisitor.VisitCross_reference(this); + else return visitor.VisitChildren(this); + } + } + + [RuleVersion(0)] + public Cross_referenceContext cross_reference() { + Cross_referenceContext _localctx = new Cross_referenceContext(Context, State); + EnterRule(_localctx, 18, RULE_cross_reference); + int _la; + try { + EnterOuterAlt(_localctx, 1); + { + State = 114; + ErrorHandler.Sync(this); + _la = TokenStream.LA(1); + if (_la==TILDE) { + { + State = 113; + Match(TILDE); + } + } + + State = 116; + Match(LBRACK); + State = 117; + _localctx.@ref = Match(ID); + State = 118; + Match(RBRACK); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + ErrorHandler.ReportError(this, re); + ErrorHandler.Recover(this, re); + } + finally { + ExitRule(); + } + return _localctx; + } + + public partial class GroupContext : ParserRuleContext { + public Suffix_opContext suffix; + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LPAREN() { return GetToken(kebnfParser.LPAREN, 0); } + [System.Diagnostics.DebuggerNonUserCode] public AlternativesContext alternatives() { + return GetRuleContext(0); + } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RPAREN() { return GetToken(kebnfParser.RPAREN, 0); } + [System.Diagnostics.DebuggerNonUserCode] public Suffix_opContext suffix_op() { + return GetRuleContext(0); + } + public GroupContext(ParserRuleContext parent, int invokingState) + : base(parent, invokingState) + { + } + public override int RuleIndex { get { return RULE_group; } } + [System.Diagnostics.DebuggerNonUserCode] + public override void EnterRule(IParseTreeListener listener) { + IkebnfListener typedListener = listener as IkebnfListener; + if (typedListener != null) typedListener.EnterGroup(this); + } + [System.Diagnostics.DebuggerNonUserCode] + public override void ExitRule(IParseTreeListener listener) { + IkebnfListener typedListener = listener as IkebnfListener; + if (typedListener != null) typedListener.ExitGroup(this); + } + [System.Diagnostics.DebuggerNonUserCode] + public override TResult Accept(IParseTreeVisitor visitor) { + IkebnfVisitor typedVisitor = visitor as IkebnfVisitor; + if (typedVisitor != null) return typedVisitor.VisitGroup(this); + else return visitor.VisitChildren(this); + } + } + + [RuleVersion(0)] + public GroupContext group() { + GroupContext _localctx = new GroupContext(Context, State); + EnterRule(_localctx, 20, RULE_group); + try { + EnterOuterAlt(_localctx, 1); + { + State = 120; + Match(LPAREN); + State = 121; + alternatives(); + State = 122; + Match(RPAREN); + State = 124; + ErrorHandler.Sync(this); + switch ( Interpreter.AdaptivePredict(TokenStream,12,Context) ) { + case 1: + { + State = 123; + _localctx.suffix = suffix_op(); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + ErrorHandler.ReportError(this, re); + ErrorHandler.Recover(this, re); + } + finally { + ExitRule(); + } + return _localctx; + } + + public partial class TerminalContext : ParserRuleContext { + public IToken val; + public Suffix_opContext suffix; + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode SINGLE_QUOTED_STRING() { return GetToken(kebnfParser.SINGLE_QUOTED_STRING, 0); } + [System.Diagnostics.DebuggerNonUserCode] public Suffix_opContext suffix_op() { + return GetRuleContext(0); + } + public TerminalContext(ParserRuleContext parent, int invokingState) + : base(parent, invokingState) + { + } + public override int RuleIndex { get { return RULE_terminal; } } + [System.Diagnostics.DebuggerNonUserCode] + public override void EnterRule(IParseTreeListener listener) { + IkebnfListener typedListener = listener as IkebnfListener; + if (typedListener != null) typedListener.EnterTerminal(this); + } + [System.Diagnostics.DebuggerNonUserCode] + public override void ExitRule(IParseTreeListener listener) { + IkebnfListener typedListener = listener as IkebnfListener; + if (typedListener != null) typedListener.ExitTerminal(this); + } + [System.Diagnostics.DebuggerNonUserCode] + public override TResult Accept(IParseTreeVisitor visitor) { + IkebnfVisitor typedVisitor = visitor as IkebnfVisitor; + if (typedVisitor != null) return typedVisitor.VisitTerminal(this); + else return visitor.VisitChildren(this); + } + } + + [RuleVersion(0)] + public TerminalContext terminal() { + TerminalContext _localctx = new TerminalContext(Context, State); + EnterRule(_localctx, 22, RULE_terminal); + try { + EnterOuterAlt(_localctx, 1); + { + State = 126; + _localctx.val = Match(SINGLE_QUOTED_STRING); + State = 128; + ErrorHandler.Sync(this); + switch ( Interpreter.AdaptivePredict(TokenStream,13,Context) ) { + case 1: + { + State = 127; + _localctx.suffix = suffix_op(); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + ErrorHandler.ReportError(this, re); + ErrorHandler.Recover(this, re); + } + finally { + ExitRule(); + } + return _localctx; + } + + public partial class Non_terminalContext : ParserRuleContext { + public IToken name; + public Suffix_opContext suffix; + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode UPPER_ID() { return GetToken(kebnfParser.UPPER_ID, 0); } + [System.Diagnostics.DebuggerNonUserCode] public Suffix_opContext suffix_op() { + return GetRuleContext(0); + } + public Non_terminalContext(ParserRuleContext parent, int invokingState) + : base(parent, invokingState) + { + } + public override int RuleIndex { get { return RULE_non_terminal; } } + [System.Diagnostics.DebuggerNonUserCode] + public override void EnterRule(IParseTreeListener listener) { + IkebnfListener typedListener = listener as IkebnfListener; + if (typedListener != null) typedListener.EnterNon_terminal(this); + } + [System.Diagnostics.DebuggerNonUserCode] + public override void ExitRule(IParseTreeListener listener) { + IkebnfListener typedListener = listener as IkebnfListener; + if (typedListener != null) typedListener.ExitNon_terminal(this); + } + [System.Diagnostics.DebuggerNonUserCode] + public override TResult Accept(IParseTreeVisitor visitor) { + IkebnfVisitor typedVisitor = visitor as IkebnfVisitor; + if (typedVisitor != null) return typedVisitor.VisitNon_terminal(this); + else return visitor.VisitChildren(this); + } + } + + [RuleVersion(0)] + public Non_terminalContext non_terminal() { + Non_terminalContext _localctx = new Non_terminalContext(Context, State); + EnterRule(_localctx, 24, RULE_non_terminal); + try { + EnterOuterAlt(_localctx, 1); + { + State = 130; + _localctx.name = Match(UPPER_ID); + State = 132; + ErrorHandler.Sync(this); + switch ( Interpreter.AdaptivePredict(TokenStream,14,Context) ) { + case 1: + { + State = 131; + _localctx.suffix = suffix_op(); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + ErrorHandler.ReportError(this, re); + ErrorHandler.Recover(this, re); + } + finally { + ExitRule(); + } + return _localctx; + } + + public partial class Element_coreContext : ParserRuleContext { + [System.Diagnostics.DebuggerNonUserCode] public Cross_referenceContext cross_reference() { + return GetRuleContext(0); + } + [System.Diagnostics.DebuggerNonUserCode] public GroupContext group() { + return GetRuleContext(0); + } + [System.Diagnostics.DebuggerNonUserCode] public TerminalContext terminal() { + return GetRuleContext(0); + } + [System.Diagnostics.DebuggerNonUserCode] public Non_terminalContext non_terminal() { + return GetRuleContext(0); + } + [System.Diagnostics.DebuggerNonUserCode] public Value_literalContext value_literal() { + return GetRuleContext(0); + } + public Element_coreContext(ParserRuleContext parent, int invokingState) + : base(parent, invokingState) + { + } + public override int RuleIndex { get { return RULE_element_core; } } + [System.Diagnostics.DebuggerNonUserCode] + public override void EnterRule(IParseTreeListener listener) { + IkebnfListener typedListener = listener as IkebnfListener; + if (typedListener != null) typedListener.EnterElement_core(this); + } + [System.Diagnostics.DebuggerNonUserCode] + public override void ExitRule(IParseTreeListener listener) { + IkebnfListener typedListener = listener as IkebnfListener; + if (typedListener != null) typedListener.ExitElement_core(this); + } + [System.Diagnostics.DebuggerNonUserCode] + public override TResult Accept(IParseTreeVisitor visitor) { + IkebnfVisitor typedVisitor = visitor as IkebnfVisitor; + if (typedVisitor != null) return typedVisitor.VisitElement_core(this); + else return visitor.VisitChildren(this); + } + } + + [RuleVersion(0)] + public Element_coreContext element_core() { + Element_coreContext _localctx = new Element_coreContext(Context, State); + EnterRule(_localctx, 26, RULE_element_core); + try { + State = 139; + ErrorHandler.Sync(this); + switch ( Interpreter.AdaptivePredict(TokenStream,15,Context) ) { + case 1: + EnterOuterAlt(_localctx, 1); + { + State = 134; + cross_reference(); + } + break; + case 2: + EnterOuterAlt(_localctx, 2); + { + State = 135; + group(); + } + break; + case 3: + EnterOuterAlt(_localctx, 3); + { + State = 136; + terminal(); + } + break; + case 4: + EnterOuterAlt(_localctx, 4); + { + State = 137; + non_terminal(); + } + break; + case 5: + EnterOuterAlt(_localctx, 5); + { + State = 138; + value_literal(); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + ErrorHandler.ReportError(this, re); + ErrorHandler.Recover(this, re); + } + finally { + ExitRule(); + } + return _localctx; + } + + public partial class Dotted_idContext : ParserRuleContext { + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] ID() { return GetTokens(kebnfParser.ID); } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ID(int i) { + return GetToken(kebnfParser.ID, i); + } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] DOT() { return GetTokens(kebnfParser.DOT); } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode DOT(int i) { + return GetToken(kebnfParser.DOT, i); + } + public Dotted_idContext(ParserRuleContext parent, int invokingState) + : base(parent, invokingState) + { + } + public override int RuleIndex { get { return RULE_dotted_id; } } + [System.Diagnostics.DebuggerNonUserCode] + public override void EnterRule(IParseTreeListener listener) { + IkebnfListener typedListener = listener as IkebnfListener; + if (typedListener != null) typedListener.EnterDotted_id(this); + } + [System.Diagnostics.DebuggerNonUserCode] + public override void ExitRule(IParseTreeListener listener) { + IkebnfListener typedListener = listener as IkebnfListener; + if (typedListener != null) typedListener.ExitDotted_id(this); + } + [System.Diagnostics.DebuggerNonUserCode] + public override TResult Accept(IParseTreeVisitor visitor) { + IkebnfVisitor typedVisitor = visitor as IkebnfVisitor; + if (typedVisitor != null) return typedVisitor.VisitDotted_id(this); + else return visitor.VisitChildren(this); + } + } + + [RuleVersion(0)] + public Dotted_idContext dotted_id() { + Dotted_idContext _localctx = new Dotted_idContext(Context, State); + EnterRule(_localctx, 28, RULE_dotted_id); + int _la; + try { + EnterOuterAlt(_localctx, 1); + { + State = 141; + Match(ID); + State = 146; + ErrorHandler.Sync(this); + _la = TokenStream.LA(1); + while (_la==DOT) { + { + { + State = 142; + Match(DOT); + State = 143; + Match(ID); + } + } + State = 148; + ErrorHandler.Sync(this); + _la = TokenStream.LA(1); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + ErrorHandler.ReportError(this, re); + ErrorHandler.Recover(this, re); + } + finally { + ExitRule(); + } + return _localctx; + } + + public partial class Suffix_opContext : ParserRuleContext { + public Suffix_opContext(ParserRuleContext parent, int invokingState) + : base(parent, invokingState) + { + } + public override int RuleIndex { get { return RULE_suffix_op; } } + [System.Diagnostics.DebuggerNonUserCode] + public override void EnterRule(IParseTreeListener listener) { + IkebnfListener typedListener = listener as IkebnfListener; + if (typedListener != null) typedListener.EnterSuffix_op(this); + } + [System.Diagnostics.DebuggerNonUserCode] + public override void ExitRule(IParseTreeListener listener) { + IkebnfListener typedListener = listener as IkebnfListener; + if (typedListener != null) typedListener.ExitSuffix_op(this); + } + [System.Diagnostics.DebuggerNonUserCode] + public override TResult Accept(IParseTreeVisitor visitor) { + IkebnfVisitor typedVisitor = visitor as IkebnfVisitor; + if (typedVisitor != null) return typedVisitor.VisitSuffix_op(this); + else return visitor.VisitChildren(this); + } + } + + [RuleVersion(0)] + public Suffix_opContext suffix_op() { + Suffix_opContext _localctx = new Suffix_opContext(Context, State); + EnterRule(_localctx, 30, RULE_suffix_op); + int _la; + try { + EnterOuterAlt(_localctx, 1); + { + State = 149; + _la = TokenStream.LA(1); + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 14L) != 0)) ) { + ErrorHandler.RecoverInline(this); + } + else { + ErrorHandler.ReportMatch(this); + Consume(); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + ErrorHandler.ReportError(this, re); + ErrorHandler.Recover(this, re); + } + finally { + ExitRule(); + } + return _localctx; + } + + public partial class Value_literalContext : ParserRuleContext { + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ID() { return GetToken(kebnfParser.ID, 0); } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode INT() { return GetToken(kebnfParser.INT, 0); } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode STRING() { return GetToken(kebnfParser.STRING, 0); } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode SINGLE_QUOTED_STRING() { return GetToken(kebnfParser.SINGLE_QUOTED_STRING, 0); } + public Value_literalContext(ParserRuleContext parent, int invokingState) + : base(parent, invokingState) + { + } + public override int RuleIndex { get { return RULE_value_literal; } } + [System.Diagnostics.DebuggerNonUserCode] + public override void EnterRule(IParseTreeListener listener) { + IkebnfListener typedListener = listener as IkebnfListener; + if (typedListener != null) typedListener.EnterValue_literal(this); + } + [System.Diagnostics.DebuggerNonUserCode] + public override void ExitRule(IParseTreeListener listener) { + IkebnfListener typedListener = listener as IkebnfListener; + if (typedListener != null) typedListener.ExitValue_literal(this); + } + [System.Diagnostics.DebuggerNonUserCode] + public override TResult Accept(IParseTreeVisitor visitor) { + IkebnfVisitor typedVisitor = visitor as IkebnfVisitor; + if (typedVisitor != null) return typedVisitor.VisitValue_literal(this); + else return visitor.VisitChildren(this); + } + } + + [RuleVersion(0)] + public Value_literalContext value_literal() { + Value_literalContext _localctx = new Value_literalContext(Context, State); + EnterRule(_localctx, 32, RULE_value_literal); + int _la; + try { + EnterOuterAlt(_localctx, 1); + { + State = 151; + _la = TokenStream.LA(1); + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 31457296L) != 0)) ) { + ErrorHandler.RecoverInline(this); + } + else { + ErrorHandler.ReportMatch(this); + Consume(); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + ErrorHandler.ReportError(this, re); + ErrorHandler.Recover(this, re); + } + finally { + ExitRule(); + } + return _localctx; + } + + private static int[] _serializedATN = { + 4,1,28,154,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7, + 7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14, + 2,15,7,15,2,16,7,16,1,0,5,0,36,8,0,10,0,12,0,39,9,0,1,0,4,0,42,8,0,11, + 0,12,0,43,1,0,1,0,1,1,1,1,3,1,50,8,1,1,1,1,1,3,1,54,8,1,1,1,1,1,1,1,3, + 1,59,8,1,1,1,4,1,62,8,1,11,1,12,1,63,1,2,1,2,1,2,1,2,1,2,1,2,1,3,1,3,1, + 3,5,3,75,8,3,10,3,12,3,78,9,3,1,4,5,4,81,8,4,10,4,12,4,84,9,4,1,5,1,5, + 1,5,1,5,1,5,1,5,1,5,1,5,3,5,94,8,5,1,6,1,6,1,6,3,6,99,8,6,1,6,1,6,3,6, + 103,8,6,1,7,1,7,1,7,1,7,1,7,1,7,1,8,1,8,1,8,1,9,3,9,115,8,9,1,9,1,9,1, + 9,1,9,1,10,1,10,1,10,1,10,3,10,125,8,10,1,11,1,11,3,11,129,8,11,1,12,1, + 12,3,12,133,8,12,1,13,1,13,1,13,1,13,1,13,3,13,140,8,13,1,14,1,14,1,14, + 5,14,145,8,14,10,14,12,14,148,9,14,1,15,1,15,1,16,1,16,1,16,0,0,17,0,2, + 4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,0,4,1,0,5,7,1,0,5,6,1,0,1,3, + 2,0,4,4,21,24,162,0,37,1,0,0,0,2,47,1,0,0,0,4,65,1,0,0,0,6,71,1,0,0,0, + 8,82,1,0,0,0,10,93,1,0,0,0,12,95,1,0,0,0,14,104,1,0,0,0,16,110,1,0,0,0, + 18,114,1,0,0,0,20,120,1,0,0,0,22,126,1,0,0,0,24,130,1,0,0,0,26,139,1,0, + 0,0,28,141,1,0,0,0,30,149,1,0,0,0,32,151,1,0,0,0,34,36,5,28,0,0,35,34, + 1,0,0,0,36,39,1,0,0,0,37,35,1,0,0,0,37,38,1,0,0,0,38,41,1,0,0,0,39,37, + 1,0,0,0,40,42,3,2,1,0,41,40,1,0,0,0,42,43,1,0,0,0,43,41,1,0,0,0,43,44, + 1,0,0,0,44,45,1,0,0,0,45,46,5,0,0,1,46,1,1,0,0,0,47,49,5,20,0,0,48,50, + 3,4,2,0,49,48,1,0,0,0,49,50,1,0,0,0,50,53,1,0,0,0,51,52,5,9,0,0,52,54, + 5,20,0,0,53,51,1,0,0,0,53,54,1,0,0,0,54,55,1,0,0,0,55,56,5,5,0,0,56,58, + 3,6,3,0,57,59,5,10,0,0,58,57,1,0,0,0,58,59,1,0,0,0,59,61,1,0,0,0,60,62, + 5,28,0,0,61,60,1,0,0,0,62,63,1,0,0,0,63,61,1,0,0,0,63,64,1,0,0,0,64,3, + 1,0,0,0,65,66,5,12,0,0,66,67,5,21,0,0,67,68,5,9,0,0,68,69,5,21,0,0,69, + 70,5,13,0,0,70,5,1,0,0,0,71,76,3,8,4,0,72,73,5,8,0,0,73,75,3,8,4,0,74, + 72,1,0,0,0,75,78,1,0,0,0,76,74,1,0,0,0,76,77,1,0,0,0,77,7,1,0,0,0,78,76, + 1,0,0,0,79,81,3,10,5,0,80,79,1,0,0,0,81,84,1,0,0,0,82,80,1,0,0,0,82,83, + 1,0,0,0,83,9,1,0,0,0,84,82,1,0,0,0,85,94,3,12,6,0,86,94,3,14,7,0,87,94, + 3,16,8,0,88,94,3,18,9,0,89,94,3,20,10,0,90,94,3,22,11,0,91,94,3,24,12, + 0,92,94,3,32,16,0,93,85,1,0,0,0,93,86,1,0,0,0,93,87,1,0,0,0,93,88,1,0, + 0,0,93,89,1,0,0,0,93,90,1,0,0,0,93,91,1,0,0,0,93,92,1,0,0,0,94,11,1,0, + 0,0,95,96,3,28,14,0,96,98,7,0,0,0,97,99,5,19,0,0,98,97,1,0,0,0,98,99,1, + 0,0,0,99,100,1,0,0,0,100,102,3,26,13,0,101,103,3,30,15,0,102,101,1,0,0, + 0,102,103,1,0,0,0,103,13,1,0,0,0,104,105,5,16,0,0,105,106,3,28,14,0,106, + 107,7,1,0,0,107,108,3,32,16,0,108,109,5,17,0,0,109,15,1,0,0,0,110,111, + 5,16,0,0,111,112,5,17,0,0,112,17,1,0,0,0,113,115,5,19,0,0,114,113,1,0, + 0,0,114,115,1,0,0,0,115,116,1,0,0,0,116,117,5,14,0,0,117,118,5,21,0,0, + 118,119,5,15,0,0,119,19,1,0,0,0,120,121,5,12,0,0,121,122,3,6,3,0,122,124, + 5,13,0,0,123,125,3,30,15,0,124,123,1,0,0,0,124,125,1,0,0,0,125,21,1,0, + 0,0,126,128,5,22,0,0,127,129,3,30,15,0,128,127,1,0,0,0,128,129,1,0,0,0, + 129,23,1,0,0,0,130,132,5,20,0,0,131,133,3,30,15,0,132,131,1,0,0,0,132, + 133,1,0,0,0,133,25,1,0,0,0,134,140,3,18,9,0,135,140,3,20,10,0,136,140, + 3,22,11,0,137,140,3,24,12,0,138,140,3,32,16,0,139,134,1,0,0,0,139,135, + 1,0,0,0,139,136,1,0,0,0,139,137,1,0,0,0,139,138,1,0,0,0,140,27,1,0,0,0, + 141,146,5,21,0,0,142,143,5,18,0,0,143,145,5,21,0,0,144,142,1,0,0,0,145, + 148,1,0,0,0,146,144,1,0,0,0,146,147,1,0,0,0,147,29,1,0,0,0,148,146,1,0, + 0,0,149,150,7,2,0,0,150,31,1,0,0,0,151,152,7,3,0,0,152,33,1,0,0,0,17,37, + 43,49,53,58,63,76,82,93,98,102,114,124,128,132,139,146 + }; + + public static readonly ATN _ATN = + new ATNDeserializer().Deserialize(_serializedATN); + + +} +} // namespace SysML2.NET.CodeGenerator.Grammar diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfVisitor.cs b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfVisitor.cs new file mode 100644 index 000000000..658bbffc8 --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfVisitor.cs @@ -0,0 +1,138 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// ANTLR Version: 4.13.2 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +// Generated from C:/CODE/SysML2.NET/Resources/kebnf.g4 by ANTLR 4.13.2 + +// Unreachable code detected +#pragma warning disable 0162 +// The variable '...' is assigned but its value is never used +#pragma warning disable 0219 +// Missing XML comment for publicly visible type or member '...' +#pragma warning disable 1591 +// Ambiguous reference in cref attribute +#pragma warning disable 419 + +namespace SysML2.NET.CodeGenerator.Grammar { +using Antlr4.Runtime.Misc; +using Antlr4.Runtime.Tree; +using IToken = Antlr4.Runtime.IToken; + +/// +/// This interface defines a complete generic visitor for a parse tree produced +/// by . +/// +/// The return type of the visit operation. +[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.13.2")] +[System.CLSCompliant(false)] +public interface IkebnfVisitor : IParseTreeVisitor { + /// + /// Visit a parse tree produced by . + /// + /// The parse tree. + /// The visitor result. + Result VisitSpecification([NotNull] kebnfParser.SpecificationContext context); + /// + /// Visit a parse tree produced by . + /// + /// The parse tree. + /// The visitor result. + Result VisitRule_definition([NotNull] kebnfParser.Rule_definitionContext context); + /// + /// Visit a parse tree produced by . + /// + /// The parse tree. + /// The visitor result. + Result VisitParameter_list([NotNull] kebnfParser.Parameter_listContext context); + /// + /// Visit a parse tree produced by . + /// + /// The parse tree. + /// The visitor result. + Result VisitAlternatives([NotNull] kebnfParser.AlternativesContext context); + /// + /// Visit a parse tree produced by . + /// + /// The parse tree. + /// The visitor result. + Result VisitAlternative([NotNull] kebnfParser.AlternativeContext context); + /// + /// Visit a parse tree produced by . + /// + /// The parse tree. + /// The visitor result. + Result VisitElement([NotNull] kebnfParser.ElementContext context); + /// + /// Visit a parse tree produced by . + /// + /// The parse tree. + /// The visitor result. + Result VisitAssignment([NotNull] kebnfParser.AssignmentContext context); + /// + /// Visit a parse tree produced by . + /// + /// The parse tree. + /// The visitor result. + Result VisitNon_parsing_assignment([NotNull] kebnfParser.Non_parsing_assignmentContext context); + /// + /// Visit a parse tree produced by . + /// + /// The parse tree. + /// The visitor result. + Result VisitNon_parsing_empty([NotNull] kebnfParser.Non_parsing_emptyContext context); + /// + /// Visit a parse tree produced by . + /// + /// The parse tree. + /// The visitor result. + Result VisitCross_reference([NotNull] kebnfParser.Cross_referenceContext context); + /// + /// Visit a parse tree produced by . + /// + /// The parse tree. + /// The visitor result. + Result VisitGroup([NotNull] kebnfParser.GroupContext context); + /// + /// Visit a parse tree produced by . + /// + /// The parse tree. + /// The visitor result. + Result VisitTerminal([NotNull] kebnfParser.TerminalContext context); + /// + /// Visit a parse tree produced by . + /// + /// The parse tree. + /// The visitor result. + Result VisitNon_terminal([NotNull] kebnfParser.Non_terminalContext context); + /// + /// Visit a parse tree produced by . + /// + /// The parse tree. + /// The visitor result. + Result VisitElement_core([NotNull] kebnfParser.Element_coreContext context); + /// + /// Visit a parse tree produced by . + /// + /// The parse tree. + /// The visitor result. + Result VisitDotted_id([NotNull] kebnfParser.Dotted_idContext context); + /// + /// Visit a parse tree produced by . + /// + /// The parse tree. + /// The visitor result. + Result VisitSuffix_op([NotNull] kebnfParser.Suffix_opContext context); + /// + /// Visit a parse tree produced by . + /// + /// The parse tree. + /// The visitor result. + Result VisitValue_literal([NotNull] kebnfParser.Value_literalContext context); +} +} // namespace SysML2.NET.CodeGenerator.Grammar diff --git a/SysML2.NET.CodeGenerator/Grammar/GrammarLoader.cs b/SysML2.NET.CodeGenerator/Grammar/GrammarLoader.cs new file mode 100644 index 000000000..9aa3d884b --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/GrammarLoader.cs @@ -0,0 +1,57 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.CodeGenerator.Grammar +{ + using System.IO; + + using Antlr4.Runtime; + + using SysML2.NET.CodeGenerator.Grammar.Model; + + /// + /// Provides direct access to by providing file path + /// + public static class GrammarLoader + { + /// + /// Loads the + /// + /// The string uri that locates the KEBNF file to load + /// The loaded + /// If the does not locate an existing + public static TextualNotationSpecification LoadTextualNotationSpecification(string fileUri) + { + if (!File.Exists(fileUri)) + { + throw new FileNotFoundException("File not found", fileUri); + } + + var stream = CharStreams.fromPath(fileUri); + var lexer = new kebnfLexer(stream); + var tokens = new CommonTokenStream(lexer); + var parser = new kebnfParser(tokens); + + var tree = parser.specification(); + var explorer = new TextualNotationSpecificationVisitor(); + return (TextualNotationSpecification)explorer.Visit(tree); + } + } +} diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/Alternatives.cs b/SysML2.NET.CodeGenerator/Grammar/Model/Alternatives.cs new file mode 100644 index 000000000..ff3ba6635 --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/Model/Alternatives.cs @@ -0,0 +1,40 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.CodeGenerator.Grammar.Model +{ + using System.Collections.Generic; + + /// + /// Provides mapping data class for the alternative grammar part + /// + public class Alternatives: IPartOfTextualRule + { + /// + /// Gets a collection of that is part of the + /// + public List Elements { get; } = []; + + /// + /// Gets the + /// + public TextualNotationRule TextualNotationRule { get; init; } + } +} diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/AssignmentElement.cs b/SysML2.NET.CodeGenerator/Grammar/Model/AssignmentElement.cs new file mode 100644 index 000000000..32219bc4a --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/Model/AssignmentElement.cs @@ -0,0 +1,48 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.CodeGenerator.Grammar.Model +{ + /// + /// Defines the assignment element + /// + public class AssignmentElement: RuleElement + { + /// + /// Gets or set the property's name + /// + public string Property { get; set; } + + /// + /// Gets or sets the assignment operator + /// + public string Operator { get; set; } + + /// + /// Gets or sets the assignment value + /// + public RuleElement Value { get; set; } + + /// + /// Gets or sets an optional prefix + /// + public string Prefix { get; set; } + } +} diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/GroupElement.cs b/SysML2.NET.CodeGenerator/Grammar/Model/GroupElement.cs new file mode 100644 index 000000000..820bbf6f5 --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/Model/GroupElement.cs @@ -0,0 +1,35 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.CodeGenerator.Grammar.Model +{ + using System.Collections.Generic; + + /// + /// Defines a group of + /// + public class GroupElement: RuleElement + { + /// + /// Gets the collection that are part of the + /// + public List Alternatives { get; } = []; + } +} diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/IPartOfTextualRule.cs b/SysML2.NET.CodeGenerator/Grammar/Model/IPartOfTextualRule.cs new file mode 100644 index 000000000..c47436d8a --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/Model/IPartOfTextualRule.cs @@ -0,0 +1,33 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.CodeGenerator.Grammar.Model +{ + /// + /// Asserts that the current element is part of + /// + public interface IPartOfTextualRule + { + /// + /// Gets the + /// + TextualNotationRule TextualNotationRule { get; } + } +} diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/NonParsingAssignmentElement.cs b/SysML2.NET.CodeGenerator/Grammar/Model/NonParsingAssignmentElement.cs new file mode 100644 index 000000000..54060b604 --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/Model/NonParsingAssignmentElement.cs @@ -0,0 +1,43 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.CodeGenerator.Grammar.Model +{ + /// + /// Defines the non-parsing assignment element + /// + public class NonParsingAssignmentElement : RuleElement + { + /// + /// Gets or sets the property's name + /// + public string PropertyName { get; set; } + + /// + /// Gets or sets the assignment operator + /// + public string Operator { get; set; } + + /// + /// Gets or sets the assigned value + /// + public string Value { get; set; } + } +} diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/NonTerminalElement.cs b/SysML2.NET.CodeGenerator/Grammar/Model/NonTerminalElement.cs new file mode 100644 index 000000000..48d3d91a5 --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/Model/NonTerminalElement.cs @@ -0,0 +1,33 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.CodeGenerator.Grammar.Model +{ + /// + /// Describes a non-terminal Element + /// + public class NonTerminalElement: RuleElement + { + /// + /// Gets or sets the non-terminal element name + /// + public string Name { get; set; } + } +} diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/RuleElement.cs b/SysML2.NET.CodeGenerator/Grammar/Model/RuleElement.cs new file mode 100644 index 000000000..dc937d23e --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/Model/RuleElement.cs @@ -0,0 +1,65 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.CodeGenerator.Grammar.Model +{ + using System.Linq; + + /// + /// Base class that provides information about element that is part of a rule + /// + public abstract class RuleElement: IPartOfTextualRule + { + /// + /// Defines all suffix that defines optional elements + /// + private static readonly string[] OptionalSuffix = ["?", "*"]; + + /// + /// Defines all suffix that defines collection elements + /// + private static readonly string[] CollectionSuffix = ["*", "+"]; + + /// + /// Gets or sets an optional suffix + /// + public string Suffix { get; set; } + + /// + /// Asserts that the current rule element defines an optional element + /// + public bool IsOptional => !string.IsNullOrEmpty(this.Suffix) && OptionalSuffix.Contains(this.Suffix); + + /// + /// Asserts that the current rule element defines an collection element + /// + public bool IsCollection => !string.IsNullOrEmpty(this.Suffix) && CollectionSuffix.Contains(this.Suffix); + + /// + /// Gets or sets an optional that acts as container + /// + public RuleElement Container { get; set; } + + /// + /// Gets the + /// + public TextualNotationRule TextualNotationRule { get; init; } + } +} diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/RuleParameter.cs b/SysML2.NET.CodeGenerator/Grammar/Model/RuleParameter.cs new file mode 100644 index 000000000..aa4978756 --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/Model/RuleParameter.cs @@ -0,0 +1,38 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.CodeGenerator.Grammar.Model +{ + /// + /// Defines possible parameter that could be added to a + /// + public class RuleParameter + { + /// + /// Gets the parameter's name + /// + public string ParameterName { get; set; } + + /// + /// Gets the name of the target Element + /// + public string TargetElementName { get; set; } + } +} diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/TerminalElement.cs b/SysML2.NET.CodeGenerator/Grammar/Model/TerminalElement.cs new file mode 100644 index 000000000..ac2f8abe7 --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/Model/TerminalElement.cs @@ -0,0 +1,33 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.CodeGenerator.Grammar.Model +{ + /// + /// Describes a terminal Element + /// + public class TerminalElement: RuleElement + { + /// + /// Gets or sets the terminal element value + /// + public string Value { get; set; } + } +} diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/TextualNotationRule.cs b/SysML2.NET.CodeGenerator/Grammar/Model/TextualNotationRule.cs new file mode 100644 index 000000000..22811eac2 --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/Model/TextualNotationRule.cs @@ -0,0 +1,55 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.CodeGenerator.Grammar.Model +{ + using System.Collections.Generic; + + /// + /// Describe the content of a rule + /// + public class TextualNotationRule + { + /// + /// Get or set rule's name + /// + public string RuleName { get; set; } + + /// + /// Gets or set the name of the KerML Element that the rule target + /// + public string TargetElementName { get; set; } + + /// + /// Gets or set an optional + /// + public RuleParameter Parameter { get; set; } + + /// + /// Gets or sets the raw string that declares the rule + /// + public string RawRule { get; set; } + + /// + /// Gets or the collection of defined by the rule + /// + public List Alternatives { get; } = []; + } +} diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/TextualNotationSpecification.cs b/SysML2.NET.CodeGenerator/Grammar/Model/TextualNotationSpecification.cs new file mode 100644 index 000000000..affae75c2 --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/Model/TextualNotationSpecification.cs @@ -0,0 +1,35 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.CodeGenerator.Grammar.Model +{ + using System.Collections.Generic; + + /// + /// Provides access to all defined into the textual notation specification + /// + public class TextualNotationSpecification + { + /// + /// Gets the collection of all + /// + public List Rules { get; } = []; + } +} diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/ValueLiteralElement.cs b/SysML2.NET.CodeGenerator/Grammar/Model/ValueLiteralElement.cs new file mode 100644 index 000000000..1bf518797 --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/Model/ValueLiteralElement.cs @@ -0,0 +1,39 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.CodeGenerator.Grammar.Model +{ + /// + /// Defines a that is a value literal + /// + public class ValueLiteralElement: RuleElement + { + /// + /// Gets or sets the literal value + /// + public string Value { get; init; } + + /// + /// Asserts that this value literal is to + /// + /// + public bool QueryIsQualifiedName() => this.Value == "[QualifiedName]"; + } +} diff --git a/SysML2.NET.CodeGenerator/Grammar/TextualNotationSpecificationVisitor.cs b/SysML2.NET.CodeGenerator/Grammar/TextualNotationSpecificationVisitor.cs new file mode 100644 index 000000000..2a17f4dd6 --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/TextualNotationSpecificationVisitor.cs @@ -0,0 +1,215 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.CodeGenerator.Grammar +{ + using System.Collections.Generic; + using System.Linq; + + using SysML2.NET.CodeGenerator.Grammar.Model; + + /// + /// Custom to read + /// + public class TextualNotationSpecificationVisitor: kebnfBaseVisitor + { + /// + /// Visit a parse tree produced by . + /// + /// The parse tree. + /// The visitor result, as . + public override object VisitSpecification(kebnfParser.SpecificationContext context) + { + var specification = new TextualNotationSpecification(); + + specification.Rules.AddRange(context.rule_definition().Select(rule => (TextualNotationRule)this.Visit(rule))); + return specification; + } + + /// + /// Visit a parse tree produced by . + /// + /// The parse tree. + /// The visitor result, as + public override object VisitRule_definition(kebnfParser.Rule_definitionContext context) + { + var rule = new TextualNotationRule() + { + RuleName = context.name.Text, + TargetElementName = context.target_ast?.Text, + RawRule = context.GetText().Trim() + }; + + this.CurrentRule = rule; + + if (string.IsNullOrWhiteSpace(rule.RuleName)) + { + rule.RuleName = rule.TargetElementName; + } + + if (context.parameter_list() != null) + { + rule.Parameter = new RuleParameter() + { + ParameterName = context.parameter_list().param_name.Text, + TargetElementName = context.parameter_list().param_type.Text + }; + } + + rule.Alternatives.AddRange((IEnumerable)this.Visit(context.rule_body)); + return rule; + } + + /// + /// Gets or sets the current that is processed + /// + public TextualNotationRule CurrentRule { get; set; } + + /// + /// Visit a parse tree produced by . + /// + /// The parse tree. + /// The visitor result, as an + public override object VisitAlternatives(kebnfParser.AlternativesContext context) + { + return context.alternative().Select(a => (Alternatives)this.Visit(a)); + } + + /// + /// Visit a parse tree produced by . + /// + /// The parse tree. + /// The visitor result, as an . + public override object VisitAlternative(kebnfParser.AlternativeContext context) + { + var alternatives = new Alternatives() + { + TextualNotationRule = this.CurrentRule + }; + + alternatives.Elements.AddRange(context.element().Select(e => (RuleElement)this.Visit(e)).Where(x => x != null)); + return alternatives; + } + + /// + /// Visit a parse tree produced by . + /// + /// The parse tree. + /// The visitor result, as . + public override object VisitAssignment(kebnfParser.AssignmentContext context) + { + var assignement = new AssignmentElement() + { + Property = context.property.GetText().Split(".")[^1], + Operator = context.op.Text, + Suffix = context.suffix?.GetText(), + Value = (RuleElement)this.Visit(context.content), + Prefix = context.prefix?.Text, + TextualNotationRule = this.CurrentRule + }; + + assignement.Value.Container = assignement; + return assignement; + } + + /// + /// Visit a parse tree produced by . + /// + /// The parse tree. + /// The visitor result, as + public override object VisitNon_parsing_assignment(kebnfParser.Non_parsing_assignmentContext context) + { + return new NonParsingAssignmentElement() + { + PropertyName = context.property.GetText(), + Operator = context.op.Text, + Value = context.val.GetText(), + TextualNotationRule = this.CurrentRule + }; + } + + /// + /// Visit a parse tree produced by . + /// + /// The parse tree. + /// The visitor result. + public override object VisitValue_literal(kebnfParser.Value_literalContext context) + { + return new ValueLiteralElement() + { + Value = context.GetText(), + TextualNotationRule = this.CurrentRule + }; + } + + /// + /// Visit a parse tree produced by . + /// + /// The parse tree. + /// The visitor result, as . + public override object VisitGroup(kebnfParser.GroupContext context) + { + var group = new GroupElement + { + Suffix = context.suffix?.GetText(), + TextualNotationRule = this.CurrentRule + }; + + group.Alternatives.AddRange((IEnumerable)this.Visit(context.alternatives())); + + foreach (var element in group.Alternatives.SelectMany(x => x.Elements)) + { + element.Container = group; + } + + return group; + } + + /// + /// Visit a parse tree produced by . + /// + /// The parse tree. + /// The visitor result, as . + public override object VisitTerminal(kebnfParser.TerminalContext context) + { + return new TerminalElement() + { + Value = context.val.Text.Trim('\''), + Suffix = context.suffix?.GetText(), + TextualNotationRule = this.CurrentRule + }; + } + + /// + /// Visit a parse tree produced by . + /// + /// The parse tree. + /// The visitor result, as . + public override object VisitNon_terminal(kebnfParser.Non_terminalContext context) + { + return new NonTerminalElement() + { + Name = context.name.Text, + Suffix = context.suffix?.GetText(), + TextualNotationRule = this.CurrentRule + }; + } + } +} diff --git a/SysML2.NET.CodeGenerator/HandleBarHelpers/NamedElementHelper.cs b/SysML2.NET.CodeGenerator/HandleBarHelpers/NamedElementHelper.cs index 2705fd893..1a7e63dc8 100644 --- a/SysML2.NET.CodeGenerator/HandleBarHelpers/NamedElementHelper.cs +++ b/SysML2.NET.CodeGenerator/HandleBarHelpers/NamedElementHelper.cs @@ -52,6 +52,16 @@ public static void RegisterNamedElementHelper(this IHandlebars handlebars) writer.WriteSafeString(namedElement.QueryNamespace()); }); + + handlebars.RegisterHelper("NamedElement.WriteFullyQualifiedTypeName", (writer, _, arguments) => + { + if (arguments[0] is not INamedElement namedElement) + { + throw new ArgumentException("supposed to be INamedElement"); + } + + writer.WriteSafeString(namedElement.QueryFullyQualifiedTypeName()); + }); } } } diff --git a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs new file mode 100644 index 000000000..2fdf0d5d9 --- /dev/null +++ b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs @@ -0,0 +1,615 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.CodeGenerator.HandleBarHelpers +{ + using System; + using System.Collections.Generic; + using System.Linq; + + using HandlebarsDotNet; + + using SysML2.NET.CodeGenerator.Extensions; + using SysML2.NET.CodeGenerator.Grammar.Model; + + using uml4net.Classification; + using uml4net.CommonStructure; + using uml4net.Extensions; + using uml4net.StructuredClassifiers; + + /// + /// Provides textual notation rules related helper for + /// + public static class RulesHelper + { + /// + /// Register this helper + /// + /// The context with which the helper needs to be registered + public static void RegisterRulesHelper(this IHandlebars handlebars) + { + handlebars.RegisterHelper("RulesHelper.WriteRule", (writer, _, arguments) => + { + if (arguments.Length != 3) + { + throw new ArgumentException("RulesHelper.WriteRule expects to have 3 arguments"); + } + + if (arguments[0] is not TextualNotationRule textualRule) + { + throw new ArgumentException("RulesHelper.WriteRule expects TextualNotationRule as first argument"); + } + + if (arguments[1] is not INamedElement namedElement) + { + throw new ArgumentException("RulesHelper.WriteRule expects INamedElement as second argument"); + } + + if (arguments[2] is not List allRules) + { + throw new ArgumentException("RulesHelper.WriteRule expects a list of TextualNotationRule as third argument"); + } + + if (namedElement is IClass umlClass) + { + var ruleGenerationContext = new RuleGenerationContext(namedElement); + ruleGenerationContext.AllRules.AddRange(allRules); + ProcessAlternatives(writer, umlClass, textualRule.Alternatives, ruleGenerationContext); + } + }); + } + + /// + /// Processes a collection of a + /// + /// The used to write into output content + /// The related + /// The collection of alternatives to process + /// The current + private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClass, IReadOnlyCollection alternatives, RuleGenerationContext ruleGenerationContext) + { + ruleGenerationContext.DefinedIterators ??= []; + + if (alternatives.Count == 1) + { + var alternative = alternatives.ElementAt(0); + var elements = alternative.Elements; + DeclareAllRequiredIterators(writer, umlClass, alternative, ruleGenerationContext); + + if (ruleGenerationContext.CallerRule is { IsOptional: true, IsCollection: false }) + { + var targetPropertiesName = elements.OfType().Select(x => x.Property).Distinct().ToList(); + var allProperties = umlClass.QueryAllProperties(); + + if (targetPropertiesName.Count > 0) + { + writer.WriteSafeString(Environment.NewLine); + writer.WriteSafeString("if("); + + var ifStatementContent = new List(); + + foreach (var targetPropertyName in targetPropertiesName) + { + var property = allProperties.Single(x => string.Equals(x.Name, targetPropertyName, StringComparison.OrdinalIgnoreCase)); + + if (property.QueryIsEnumerable()) + { + var assigment = elements.OfType().First(x => x.Property == targetPropertyName); + var iterator = ruleGenerationContext.DefinedIterators.FirstOrDefault(x => x.ApplicableRuleElements.Contains(assigment)); + ifStatementContent.Add(iterator == null ? $"BuildGroupConditionFor{assigment.TextualNotationRule.RuleName}(poco)" : property.QueryIfStatementContentForNonEmpty(iterator.IteratorVariableName)); + } + else + { + ifStatementContent.Add(property.QueryIfStatementContentForNonEmpty("poco")); + } + } + + writer.WriteSafeString(string.Join(" && ", ifStatementContent)); + writer.WriteSafeString($"){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + + foreach (var textualRuleElement in elements) + { + var previousCaller = ruleGenerationContext.CallerRule; + ProcessRuleElement(writer, umlClass, textualRuleElement, ruleGenerationContext); + ruleGenerationContext.CallerRule = previousCaller; + } + } + else + { + writer.WriteSafeString($"{Environment.NewLine}if(BuildGroupConditionFor{alternative.TextualNotationRule.RuleName}(poco))"); + writer.WriteSafeString($"{Environment.NewLine}{{{Environment.NewLine}"); + + foreach (var textualRuleElement in elements) + { + ProcessRuleElement(writer, umlClass, textualRuleElement, ruleGenerationContext); + } + } + + writer.WriteSafeString($"stringBuilder.Append(' ');{Environment.NewLine}"); + writer.WriteSafeString($"}}{Environment.NewLine}"); + } + else + { + foreach (var textualRuleElement in elements) + { + var previousCaller = ruleGenerationContext.CallerRule; + ProcessRuleElement(writer, umlClass, textualRuleElement, ruleGenerationContext); + ruleGenerationContext.CallerRule = previousCaller; + } + } + } + else + { + writer.WriteSafeString("throw new System.NotSupportedException(\"Multiple alternatives not implemented yet\");"); + } + } + + /// + /// Declares all required iterator for all present inside an + /// + /// The used to write into output content + /// The related + /// The to process + /// + private static void DeclareAllRequiredIterators(EncodedTextWriter writer, IClass umlClass, Alternatives alternatives, RuleGenerationContext ruleGenerationContext) + { + foreach (var ruleElement in alternatives.Elements) + { + switch (ruleElement) + { + case AssignmentElement { Value: NonTerminalElement } assignmentElement: + DeclareIteratorIfRequired(writer, umlClass, assignmentElement, ruleGenerationContext); + break; + case AssignmentElement { Value: GroupElement } assignmentElement: + DeclareIteratorIfRequired(writer, umlClass, assignmentElement, ruleGenerationContext); + break; + case GroupElement groupElement: + foreach (var groupElementAlternative in groupElement.Alternatives) + { + DeclareAllRequiredIterators(writer, umlClass, groupElementAlternative, ruleGenerationContext); + } + + break; + } + } + } + + /// + /// Processes a + /// + /// The used to write into output content + /// The related + /// The to process + /// + /// If the type of the is not supported + private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass, RuleElement textualRuleElement, RuleGenerationContext ruleGenerationContext) + { + switch (textualRuleElement) + { + case TerminalElement terminalElement: + var valueToAdd = terminalElement.Value; + + if (valueToAdd.Length > 1) + { + valueToAdd += ' '; + } + + writer.WriteSafeString($"stringBuilder.Append(\"{valueToAdd}\");"); + break; + case NonTerminalElement nonTerminalElement: + if (ruleGenerationContext.CallerRule is NonTerminalElement { Container: AssignmentElement assignmentElementContainer }) + { + var textualBuilderClass = ruleGenerationContext.NamedElementToGenerate as IClass; + var assignedProperty = textualBuilderClass.QueryAllProperties().SingleOrDefault(x => x.Name == assignmentElementContainer.Property); + ProcessNonTerminalElement(writer, umlClass, nonTerminalElement, assignedProperty == null ? "poco" : $"poco.{assignedProperty.QueryPropertyNameBasedOnUmlProperties()}", ruleGenerationContext); + } + else + { + ProcessNonTerminalElement(writer, umlClass, nonTerminalElement, "poco", ruleGenerationContext); + } + + break; + case GroupElement groupElement: + ruleGenerationContext.CallerRule = groupElement ; + + if (groupElement.IsCollection) + { + var assignmentRule = groupElement.Alternatives.SelectMany(x => x.Elements).FirstOrDefault(x => x is AssignmentElement { Value: NonTerminalElement }); + + if (assignmentRule is AssignmentElement assignmentElement) + { + var iteratorToUse = ruleGenerationContext.DefinedIterators.Single(x => x.ApplicableRuleElements.Contains(assignmentElement)); + writer.WriteSafeString($"{Environment.NewLine}while({iteratorToUse.IteratorVariableName}.MoveNext()){Environment.NewLine}"); + } + + writer.WriteSafeString($"{{{Environment.NewLine}"); + ProcessAlternatives(writer, umlClass, groupElement.Alternatives, ruleGenerationContext); + writer.WriteSafeString($"{Environment.NewLine}}}"); + } + else + { + ProcessAlternatives(writer, umlClass, groupElement.Alternatives, ruleGenerationContext); + } + + if (!groupElement.IsOptional) + { + writer.WriteSafeString($"{Environment.NewLine}stringBuilder.Append(' ');"); + } + + break; + case AssignmentElement assignmentElement: + var properties = umlClass.QueryAllProperties(); + var targetProperty = properties.SingleOrDefault(x => string.Equals(x.Name, assignmentElement.Property, StringComparison.OrdinalIgnoreCase)); + + if (targetProperty != null) + { + if (targetProperty.QueryIsEnumerable()) + { + if (assignmentElement.Value is NonTerminalElement nonTerminalElement) + { + var iteratorToUse = ruleGenerationContext.DefinedIterators.Single(x => x.ApplicableRuleElements.Contains(assignmentElement)); + + if (assignmentElement.Container is not GroupElement { IsCollection: true } && assignmentElement.Container is not GroupElement { IsOptional: true }) + { + writer.WriteSafeString($"{iteratorToUse.IteratorVariableName}.MoveNext();{Environment.NewLine}"); + } + + ProcessNonTerminalElement(writer, umlClass, nonTerminalElement, $"{iteratorToUse.IteratorVariableName}.Current", ruleGenerationContext); + } + else + { + writer.WriteSafeString("throw new System.NotSupportedException(\"Assigment of enumerable with non NonTerminalElement not supported yet\");"); + } + } + else + { + if (assignmentElement.IsOptional) + { + writer.WriteSafeString($"{Environment.NewLine}if({targetProperty.QueryIfStatementContentForNonEmpty("poco")}){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + writer.WriteSafeString($"stringBuilder.Append(poco.{targetProperty.Name.CapitalizeFirstLetter()});{Environment.NewLine}"); + writer.WriteSafeString("}}"); + } + else + { + var targetPropertyName = targetProperty.QueryPropertyNameBasedOnUmlProperties(); + + if (targetProperty.QueryIsString()) + { + writer.WriteSafeString($"stringBuilder.Append(poco.{targetPropertyName});"); + } + else if (targetProperty.QueryIsBool()) + { + if (assignmentElement.Value is TerminalElement terminalElement) + { + writer.WriteSafeString($"stringBuilder.Append(\"{terminalElement.Value}\");"); + } + else + { + writer.WriteSafeString($"stringBuilder.Append(poco.{targetPropertyName}.ToString().ToLower());"); + } + } + else if (targetProperty.QueryIsEnum()) + { + writer.WriteSafeString($"stringBuilder.Append(poco.{targetPropertyName}.ToString().ToLower());"); + } + else if(targetProperty.QueryIsReferenceProperty()) + { + switch (assignmentElement.Value) + { + case NonTerminalElement nonTerminalElement: + { + var previousCaller = ruleGenerationContext.CallerRule; + ruleGenerationContext.CallerRule = nonTerminalElement; + ProcessNonTerminalElement(writer, targetProperty.Type as IClass, nonTerminalElement, $"poco.{targetPropertyName}", ruleGenerationContext); + ruleGenerationContext.CallerRule = previousCaller; + break; + } + case ValueLiteralElement valueLiteralElement when valueLiteralElement.QueryIsQualifiedName(): + writer.WriteSafeString($"{Environment.NewLine}if (poco.{targetPropertyName} != null){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + writer.WriteSafeString($"stringBuilder.Append(poco.{targetPropertyName}.qualifiedName);{Environment.NewLine}"); + writer.WriteSafeString("stringBuilder.Append(' ');"); + writer.WriteSafeString($"{Environment.NewLine}}}"); + break; + default: + writer.WriteSafeString("throw new System.NotSupportedException(\"Assigment of reference element not supported yet for this case\");"); + break; + } + } + else + { + writer.WriteSafeString($"stringBuilder.Append(poco.{targetPropertyName}.ToString());"); + } + } + } + } + else + { + writer.WriteSafeString($"Build{assignmentElement.Property.CapitalizeFirstLetter()}(poco, stringBuilder);"); + } + + break; + case NonParsingAssignmentElement nonParsingAssignmentElement: + writer.WriteSafeString($"// NonParsing Assignment Element : {nonParsingAssignmentElement.PropertyName} {nonParsingAssignmentElement.Operator} {nonParsingAssignmentElement.Value} => Does not have to be process"); + break; + case ValueLiteralElement valueLiteralElement: + if (valueLiteralElement.QueryIsQualifiedName()) + { + writer.WriteSafeString($"stringBuilder.Append(poco.qualifiedName);{Environment.NewLine}"); + writer.WriteSafeString("stringBuilder.Append(' ');"); + } + else + { + writer.WriteSafeString("throw new System.NotSupportedException(\"Value Literal different than QualifiedName not supported\");"); + } + + break; + default: + throw new ArgumentException("Unknown element type"); + } + + writer.WriteSafeString(Environment.NewLine); + } + + /// + /// Process a + /// + /// The used to write into output content + /// The related + /// The to process + /// The name of the variable that should be used to call the non-terminal method + /// + private static void ProcessNonTerminalElement(EncodedTextWriter writer, IClass umlClass, NonTerminalElement nonTerminalElement, string variableName, RuleGenerationContext ruleGenerationContext) + { + var referencedRule = ruleGenerationContext.AllRules.SingleOrDefault(x => x.RuleName == nonTerminalElement.Name); + + string typeTarget; + + if (referencedRule == null) + { + typeTarget = umlClass.Name; + } + else + { + typeTarget = referencedRule.TargetElementName ?? referencedRule.RuleName; + } + + var isForProperty = variableName.Contains('.'); + + if (isForProperty) + { + writer.WriteSafeString($"{Environment.NewLine}if ({variableName} != null){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + } + + if (typeTarget != ruleGenerationContext.NamedElementToGenerate.Name) + { + var targetType = umlClass.Cache.Values.OfType().SingleOrDefault(x => x.Name == typeTarget); + + if (targetType != null) + { + if (targetType is IClass targetClass && (umlClass.QueryAllGeneralClassifiers().Contains(targetClass) || !variableName.Contains("poco"))) + { + writer.WriteSafeString($"{targetType.Name}TextualNotationBuilder.Build{nonTerminalElement.Name}({variableName}, stringBuilder);"); + } + else + { + var previousCaller = ruleGenerationContext.CallerRule; + ruleGenerationContext.CallerRule = nonTerminalElement; + ProcessAlternatives(writer, umlClass, referencedRule?.Alternatives, ruleGenerationContext); + ruleGenerationContext.CallerRule = previousCaller; + } + } + else + { + var previousCaller = ruleGenerationContext.CallerRule; + ruleGenerationContext.CallerRule = nonTerminalElement; + ProcessAlternatives(writer, umlClass, referencedRule?.Alternatives, ruleGenerationContext); + ruleGenerationContext.CallerRule = previousCaller; + } + } + else + { + writer.WriteSafeString($"Build{ nonTerminalElement.Name}({variableName}, stringBuilder);"); + } + + if (isForProperty) + { + writer.WriteSafeString($"{Environment.NewLine}}}"); + } + } + + /// + /// Declares an iterator to perform iteration over a collection, if required to declare it + /// + /// The used to write into output content + /// The related + /// The to process + /// + private static void DeclareIteratorIfRequired(EncodedTextWriter writer, IClass umlClass, AssignmentElement assignmentElement, RuleGenerationContext ruleGenerationContext) + { + var allProperties = umlClass.QueryAllProperties(); + var targetProperty = allProperties.SingleOrDefault(x => string.Equals(x.Name, assignmentElement.Property, StringComparison.OrdinalIgnoreCase)); + + if (targetProperty == null || !targetProperty.QueryIsEnumerable()) + { + return; + } + + if (assignmentElement.Value is GroupElement groupElement) + { + var groupedAssignment = groupElement.Alternatives.SelectMany(x => x.Elements).OfType(); + + foreach (var assignment in groupedAssignment) + { + DeclareIteratorIfRequired(writer, umlClass, assignment, ruleGenerationContext); + } + } + + if (assignmentElement.Value is not NonTerminalElement nonTerminalElement) + { + return; + } + + var referencedRule = ruleGenerationContext.AllRules.SingleOrDefault(x => x.RuleName == nonTerminalElement.Name); + + if (ruleGenerationContext.DefinedIterators.SingleOrDefault(x => x.IsIteratorValidForProperty(targetProperty, referencedRule) || x.ApplicableRuleElements.Contains(assignmentElement)) is { } alreadyDefinedIterator) + { + alreadyDefinedIterator.ApplicableRuleElements.Add(assignmentElement); + return; + } + + var iteratorToUse = new IteratorDefinition + { + DefinedForProperty = targetProperty + }; + + iteratorToUse.ApplicableRuleElements.Add(assignmentElement); + + string typeTarget; + + if (referencedRule == null) + { + typeTarget = umlClass.Name; + } + else + { + typeTarget = referencedRule.TargetElementName ?? referencedRule.RuleName; + } + + if (typeTarget != targetProperty.Type.Name) + { + var targetType = umlClass.Cache.Values.OfType().SingleOrDefault(x => x.Name == typeTarget); + iteratorToUse.ConstrainedType = targetType; + + writer.WriteSafeString(targetType != null + ? $"using var {iteratorToUse.IteratorVariableName} = poco.{targetProperty.QueryPropertyNameBasedOnUmlProperties()}.OfType<{targetType.QueryFullyQualifiedTypeName(targetInterface: false)}>().GetEnumerator();" + : $"using var {iteratorToUse.IteratorVariableName} = poco.{targetProperty.QueryPropertyNameBasedOnUmlProperties()}.GetEnumerator();"); + } + else + { + writer.WriteSafeString($"using var {iteratorToUse.IteratorVariableName} = poco.{targetProperty.QueryPropertyNameBasedOnUmlProperties()}.GetEnumerator();"); + } + + writer.WriteSafeString(Environment.NewLine); + ruleGenerationContext.DefinedIterators.Add(iteratorToUse); + } + + /// + /// Keeps tracks of defined iterator for enumerable + /// + private class IteratorDefinition + { + /// + /// Gets or sets the that have to have an iterator defined + /// + public IProperty DefinedForProperty { get; init; } + + /// + /// Gets or sets the that should be + /// + public INamedElement ConstrainedType { get; set; } + + /// + /// Gets the name of the variable defined for the iterator + /// + public string IteratorVariableName => this.ComputeIteratorName(); + + /// + /// Provides a collection of that will use the defined iterator + /// + public HashSet ApplicableRuleElements { get; } = []; + + /// + /// Compute the name of the iterator variable + /// + /// The computed name + private string ComputeIteratorName() + { + var name = this.DefinedForProperty.Name.LowerCaseFirstLetter(); + + if (this.ConstrainedType != null) + { + name += $"Of{this.ConstrainedType.Name.CapitalizeFirstLetter()}"; + } + + name += "Iterator"; + return name; + } + + /// + /// Asserts that the current is valid for an for a specific + /// + /// The specific + /// The specific that should constraint a collection type + /// True if the is valid for the provided parameters + public bool IsIteratorValidForProperty(IProperty property, TextualNotationRule targetRule) + { + if (property != this.DefinedForProperty) + { + return false; + } + + if (targetRule == null) + { + return this.ConstrainedType == null; + } + + var typeTarget = targetRule.TargetElementName ?? targetRule.RuleName; + + return string.Equals(this.ConstrainedType?.Name, typeTarget, StringComparison.InvariantCultureIgnoreCase); + } + } + + /// + /// Provides context over the rule generation history + /// + private class RuleGenerationContext + { + /// + /// Gets or sets the collection of + /// + public List DefinedIterators { get; set; } + + /// + /// Gets the collection of all available + /// + public List AllRules { get; } = []; + + /// + /// Gets or sets the that called other rule + /// + public RuleElement CallerRule { get; set; } + + /// Initializes a new instance of the class. + public RuleGenerationContext(INamedElement namedElementToGenerate) + { + this.NamedElementToGenerate = namedElementToGenerate; + } + + /// + /// Gets the that is used in the current generation + /// + public INamedElement NamedElementToGenerate { get; } + } + } +} diff --git a/SysML2.NET.CodeGenerator/SysML2.NET.CodeGenerator.csproj b/SysML2.NET.CodeGenerator/SysML2.NET.CodeGenerator.csproj index eb2f99cc2..57428a5f0 100644 --- a/SysML2.NET.CodeGenerator/SysML2.NET.CodeGenerator.csproj +++ b/SysML2.NET.CodeGenerator/SysML2.NET.CodeGenerator.csproj @@ -19,6 +19,7 @@ en-US + @@ -211,6 +212,12 @@ Always + + Always + + + Always + @@ -229,4 +236,17 @@ Always + + + datamodel\kebnf.g4 + + + datamodel\KerML-textual-bnf.kebnf + Always + + + datamodel\SysML-textual-bnf.kebnf + Always + + \ No newline at end of file diff --git a/SysML2.NET.CodeGenerator/Templates/Uml/core-textual-notation-builder-facade-template.hbs b/SysML2.NET.CodeGenerator/Templates/Uml/core-textual-notation-builder-facade-template.hbs new file mode 100644 index 000000000..e41972e02 --- /dev/null +++ b/SysML2.NET.CodeGenerator/Templates/Uml/core-textual-notation-builder-facade-template.hbs @@ -0,0 +1,60 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides access to built textual notation for via + /// + public class TextualNotationBuilderFacade: ITextualNotationBuilderFacade + { + /// + /// Queries the Textual Notation of an + /// + /// The to built textual notation from + /// The built textual notation string + public string QueryTextualNotationOfElement(IElement element) + { + switch (element) + { + {{#each this as | class |}} + case SysML2.NET.Core.POCO.{{ #NamedElement.WriteFullyQualifiedNameSpace this }}.{{ this.Name }} poco{{ this.Name }}: + var {{String.LowerCaseFirstLetter this.Name }}TextualNotationBuilder = new {{ this.Name }}TextualNotationBuilder(this); + return {{String.LowerCaseFirstLetter this.Name }}TextualNotationBuilder.BuildTextualNotation(poco{{ this.Name }}); + + {{/each}} + default: + throw new ArgumentOutOfRangeException(nameof(element), "Provided element is not supported"); + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator/Templates/Uml/core-textual-notation-builder-template.hbs b/SysML2.NET.CodeGenerator/Templates/Uml/core-textual-notation-builder-template.hbs new file mode 100644 index 000000000..c92a1ed1d --- /dev/null +++ b/SysML2.NET.CodeGenerator/Templates/Uml/core-textual-notation-builder-template.hbs @@ -0,0 +1,58 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class {{this.Context.Name}}TextualNotationBuilder + { + {{#each this.Rules as | rule | }} + /// + /// Builds the Textual Notation string for the rule {{Rule.RuleName}} + /// {{Rule.RawRule}} + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void Build{{rule.RuleName}}({{ #NamedElement.WriteFullyQualifiedTypeName ../this.Context }} poco, StringBuilder stringBuilder) + { + {{RulesHelper.WriteRule rule ../this.Context ../this.AllRules}} + } + {{#unless @last}} + + {{/unless}} + {{/each}} + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + \ No newline at end of file diff --git a/SysML2.NET/TextualNotation/AcceptActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AcceptActionUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..4a228022a --- /dev/null +++ b/SysML2.NET/TextualNotation/AcceptActionUsageTextualNotationBuilder.cs @@ -0,0 +1,40 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using SysML2.NET.Core.POCO.Systems.Actions; + + /// + /// Hand-coded part of the + /// + public static partial class AcceptActionUsageTextualNotationBuilder + { + /// + /// Builds the conditional part for the TransitionAcceptActionUsage rule + /// + /// The + /// The assertion of the condition + private static bool BuildGroupConditionForTransitionAcceptActionUsage(IAcceptActionUsage poco) + { + return poco.OwnedRelationship.Count != 0; + } + } +} diff --git a/SysML2.NET/TextualNotation/ActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/ActionUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..2345afd79 --- /dev/null +++ b/SysML2.NET/TextualNotation/ActionUsageTextualNotationBuilder.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using SysML2.NET.Core.POCO.Systems.Actions; + + /// + /// Hand-coded part of + /// + public static partial class ActionUsageTextualNotationBuilder + { + /// + /// Builds the conditional part for the ActionBodyParameter rule + /// + /// The + /// The assertion of the condition + private static bool BuildGroupConditionForActionBodyParameter(IActionUsage poco) + { + return CommonTextualNotationBuilder.DoesDefinesUsageDeclaration(poco); + } + + /// + /// Builds the conditional part for the AssignmentNodeDeclaration rule + /// + /// The + /// The assertion of the condition + private static bool BuildGroupConditionForAssignmentNodeDeclaration(IActionUsage poco) + { + return CommonTextualNotationBuilder.DoesDefinesUsageDeclaration(poco); + } + } +} diff --git a/SysML2.NET/TextualNotation/AssignmentActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AssignmentActionUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..a6aa6abc1 --- /dev/null +++ b/SysML2.NET/TextualNotation/AssignmentActionUsageTextualNotationBuilder.cs @@ -0,0 +1,43 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + + using SysML2.NET.Core.POCO.Core.Features; + using SysML2.NET.Core.POCO.Systems.Actions; + + /// + /// Hand-coded part of + /// + public static partial class AssignmentActionUsageTextualNotationBuilder + { + /// + /// Builds the conditional part for the TransitionAssignmentActionUsage rule + /// + /// The + /// The assertion of the condition + private static bool BuildGroupConditionForTransitionAssignmentActionUsage(IAssignmentActionUsage poco) + { + return poco.OwnedRelationship.OfType().Any(); + } + } +} diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..e7ddec66b --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.cs @@ -0,0 +1,145 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class AcceptActionUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule AcceptNode + /// AcceptNode:AcceptActionUsage=OccurrenceUsagePrefixAcceptNodeDeclarationActionBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildAcceptNode(SysML2.NET.Core.POCO.Systems.Actions.IAcceptActionUsage poco, StringBuilder stringBuilder) + { + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + BuildAcceptNodeDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule AcceptNodeDeclaration + /// AcceptNodeDeclaration:AcceptActionUsage=ActionNodeUsageDeclaration?'accept'AcceptParameterPart + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildAcceptNodeDeclaration(SysML2.NET.Core.POCO.Systems.Actions.IAcceptActionUsage poco, StringBuilder stringBuilder) + { + ActionUsageTextualNotationBuilder.BuildActionNodeUsageDeclaration(poco, stringBuilder); + stringBuilder.Append("accept "); + BuildAcceptParameterPart(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule AcceptParameterPart + /// AcceptParameterPart:AcceptActionUsage=ownedRelationship+=PayloadParameterMember('via'ownedRelationship+=NodeParameterMember)? + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildAcceptParameterPart(SysML2.NET.Core.POCO.Systems.Actions.IAcceptActionUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildPayloadParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + + if (ownedRelationshipOfParameterMembershipIterator.MoveNext()) + { + stringBuilder.Append("via "); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append(' '); + } + + + } + + /// + /// Builds the Textual Notation string for the rule StateAcceptActionUsage + /// StateAcceptActionUsage:AcceptActionUsage=AcceptNodeDeclarationActionBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildStateAcceptActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IAcceptActionUsage poco, StringBuilder stringBuilder) + { + BuildAcceptNodeDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule TriggerAction + /// TriggerAction:AcceptActionUsage=AcceptParameterPart + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildTriggerAction(SysML2.NET.Core.POCO.Systems.Actions.IAcceptActionUsage poco, StringBuilder stringBuilder) + { + BuildAcceptParameterPart(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule TransitionAcceptActionUsage + /// TransitionAcceptActionUsage:AcceptActionUsage=AcceptNodeDeclaration('{'ActionBodyItem*'}')? + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildTransitionAcceptActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IAcceptActionUsage poco, StringBuilder stringBuilder) + { + BuildAcceptNodeDeclaration(poco, stringBuilder); + + if (BuildGroupConditionForTransitionAcceptActionUsage(poco)) + { + stringBuilder.Append("{"); + TypeTextualNotationBuilder.BuildActionBodyItem(poco, stringBuilder); + stringBuilder.Append("}"); + stringBuilder.Append(' '); + } + + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionDefinitionTextualNotationBuilder.cs new file mode 100644 index 000000000..c92602c55 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionDefinitionTextualNotationBuilder.cs @@ -0,0 +1,57 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ActionDefinitionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ActionDefinition + /// ActionDefinition=OccurrenceDefinitionPrefix'action''def'DefinitionDeclarationActionBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildActionDefinition(SysML2.NET.Core.POCO.Systems.Actions.IActionDefinition poco, StringBuilder stringBuilder) + { + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + stringBuilder.Append("action "); + stringBuilder.Append("def "); + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..5e5dbbca8 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs @@ -0,0 +1,201 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ActionUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ActionUsageDeclaration + /// ActionUsageDeclaration:ActionUsage=UsageDeclarationValuePart? + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildActionUsageDeclaration(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, StringBuilder stringBuilder) + { + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule ActionNode + /// ActionNode:ActionUsage=ControlNode|SendNode|AcceptNode|AssignmentNode|TerminateNode|IfNode|WhileLoopNode|ForLoopNode + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildActionNode(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule ActionNodeUsageDeclaration + /// ActionNodeUsageDeclaration:ActionUsage='action'UsageDeclaration? + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildActionNodeUsageDeclaration(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, StringBuilder stringBuilder) + { + stringBuilder.Append("action "); + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule ActionNodePrefix + /// ActionNodePrefix:ActionUsage=OccurrenceUsagePrefixActionNodeUsageDeclaration? + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildActionNodePrefix(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, StringBuilder stringBuilder) + { + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + BuildActionNodeUsageDeclaration(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule AssignmentNodeDeclaration + /// AssignmentNodeDeclaration:ActionUsage=(ActionNodeUsageDeclaration)?'assign'ownedRelationship+=AssignmentTargetMemberownedRelationship+=FeatureChainMember':='ownedRelationship+=NodeParameterMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildAssignmentNodeDeclaration(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + + if (BuildGroupConditionForAssignmentNodeDeclaration(poco)) + { + BuildActionNodeUsageDeclaration(poco, stringBuilder); + stringBuilder.Append(' '); + } + + stringBuilder.Append("assign "); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildAssignmentTargetMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + ownedRelationshipOfMembershipIterator.MoveNext(); + + if (ownedRelationshipOfMembershipIterator.Current != null) + { + MembershipTextualNotationBuilder.BuildFeatureChainMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append(":= "); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule ActionBodyParameter + /// ActionBodyParameter:ActionUsage=('action'UsageDeclaration?)?'{'ActionBodyItem*'}' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildActionBodyParameter(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, StringBuilder stringBuilder) + { + + if (BuildGroupConditionForActionBodyParameter(poco)) + { + stringBuilder.Append("action "); + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + stringBuilder.Append(' '); + } + + stringBuilder.Append("{"); + TypeTextualNotationBuilder.BuildActionBodyItem(poco, stringBuilder); + stringBuilder.Append("}"); + + } + + /// + /// Builds the Textual Notation string for the rule StateActionUsage + /// StateActionUsage:ActionUsage=EmptyActionUsage';'|StatePerformActionUsage|StateAcceptActionUsage|StateSendActionUsage|StateAssignmentActionUsage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildStateActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule EmptyActionUsage + /// EmptyActionUsage:ActionUsage={} + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildEmptyActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, StringBuilder stringBuilder) + { + + } + + /// + /// Builds the Textual Notation string for the rule EffectBehaviorUsage + /// EffectBehaviorUsage:ActionUsage=EmptyActionUsage|TransitionPerformActionUsage|TransitionAcceptActionUsage|TransitionSendActionUsage|TransitionAssignmentActionUsage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildEffectBehaviorUsage(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule ActionUsage + /// ActionUsage=OccurrenceUsagePrefix'action'ActionUsageDeclarationActionBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, StringBuilder stringBuilder) + { + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + stringBuilder.Append("action "); + BuildActionUsageDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActorMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActorMembershipTextualNotationBuilder.cs new file mode 100644 index 000000000..df86fc377 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActorMembershipTextualNotationBuilder.cs @@ -0,0 +1,60 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ActorMembershipTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ActorMember + /// ActorMember:ActorMembership=MemberPrefixownedRelatedElement+=ActorUsage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildActorMember(SysML2.NET.Core.POCO.Systems.Requirements.IActorMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfPartUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + ownedRelatedElementOfPartUsageIterator.MoveNext(); + + if (ownedRelatedElementOfPartUsageIterator.Current != null) + { + PartUsageTextualNotationBuilder.BuildActorUsage(ownedRelatedElementOfPartUsageIterator.Current, stringBuilder); + } + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationDefinitionTextualNotationBuilder.cs new file mode 100644 index 000000000..ff58ecec2 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationDefinitionTextualNotationBuilder.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class AllocationDefinitionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule AllocationDefinition + /// AllocationDefinition=OccurrenceDefinitionPrefix'allocation''def'Definition + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildAllocationDefinition(SysML2.NET.Core.POCO.Systems.Allocations.IAllocationDefinition poco, StringBuilder stringBuilder) + { + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + stringBuilder.Append("allocation "); + stringBuilder.Append("def "); + DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..650f7ef7e --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationUsageTextualNotationBuilder.cs @@ -0,0 +1,66 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class AllocationUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule AllocationUsageDeclaration + /// AllocationUsageDeclaration:AllocationUsage='allocation'UsageDeclaration('allocate'ConnectorPart)?|'allocate'ConnectorPart + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildAllocationUsageDeclaration(SysML2.NET.Core.POCO.Systems.Allocations.IAllocationUsage poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule AllocationUsage + /// AllocationUsage=OccurrenceUsagePrefixAllocationUsageDeclarationUsageBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildAllocationUsage(SysML2.NET.Core.POCO.Systems.Allocations.IAllocationUsage poco, StringBuilder stringBuilder) + { + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + BuildAllocationUsageDeclaration(poco, stringBuilder); + UsageTextualNotationBuilder.BuildUsageBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseDefinitionTextualNotationBuilder.cs new file mode 100644 index 000000000..cfca3f931 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseDefinitionTextualNotationBuilder.cs @@ -0,0 +1,57 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class AnalysisCaseDefinitionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule AnalysisCaseDefinition + /// AnalysisCaseDefinition=OccurrenceDefinitionPrefix'analysis''def'DefinitionDeclarationCaseBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildAnalysisCaseDefinition(SysML2.NET.Core.POCO.Systems.AnalysisCases.IAnalysisCaseDefinition poco, StringBuilder stringBuilder) + { + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + stringBuilder.Append("analysis "); + stringBuilder.Append("def "); + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..1d0f4015e --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseUsageTextualNotationBuilder.cs @@ -0,0 +1,58 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class AnalysisCaseUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule AnalysisCaseUsage + /// AnalysisCaseUsage=OccurrenceUsagePrefix'analysis'ConstraintUsageDeclarationCaseBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildAnalysisCaseUsage(SysML2.NET.Core.POCO.Systems.AnalysisCases.IAnalysisCaseUsage poco, StringBuilder stringBuilder) + { + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + stringBuilder.Append("analysis "); + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + + TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotatingElementTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotatingElementTextualNotationBuilder.cs new file mode 100644 index 000000000..d3b6c1d18 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotatingElementTextualNotationBuilder.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class AnnotatingElementTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule AnnotatingElement + /// AnnotatingElement=Comment|Documentation|TextualRepresentation|MetadataFeature + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildAnnotatingElement(SysML2.NET.Core.POCO.Root.Annotations.IAnnotatingElement poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.cs new file mode 100644 index 000000000..7f894330d --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.cs @@ -0,0 +1,101 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class AnnotationTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule OwnedAnnotation + /// OwnedAnnotation:Annotation=ownedRelatedElement+=AnnotatingElement + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildOwnedAnnotation(SysML2.NET.Core.POCO.Root.Annotations.IAnnotation poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfAnnotatingElementIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfAnnotatingElementIterator.MoveNext(); + + if (ownedRelatedElementOfAnnotatingElementIterator.Current != null) + { + AnnotatingElementTextualNotationBuilder.BuildAnnotatingElement(ownedRelatedElementOfAnnotatingElementIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule PrefixMetadataAnnotation + /// PrefixMetadataAnnotation:Annotation='#'annotatingElement=PrefixMetadataUsage{ownedRelatedElement+=annotatingElement} + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildPrefixMetadataAnnotation(SysML2.NET.Core.POCO.Root.Annotations.IAnnotation poco, StringBuilder stringBuilder) + { + stringBuilder.Append("#"); + + if (poco.annotatingElement != null) + { + using var ownedRelationshipOfFeatureTypingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureTypingIterator.MoveNext(); + + if (ownedRelationshipOfFeatureTypingIterator.Current != null) + { + FeatureTypingTextualNotationBuilder.BuildOwnedFeatureTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + } + + } + // NonParsing Assignment Element : ownedRelatedElement += annotatingElement => Does not have to be process + + } + + /// + /// Builds the Textual Notation string for the rule Annotation + /// Annotation=annotatedElement=[QualifiedName] + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildAnnotation(SysML2.NET.Core.POCO.Root.Annotations.IAnnotation poco, StringBuilder stringBuilder) + { + + if (poco.AnnotatedElement != null) + { + stringBuilder.Append(poco.AnnotatedElement.qualifiedName); + stringBuilder.Append(' '); + } + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssertConstraintUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssertConstraintUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..f21db1ea1 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssertConstraintUsageTextualNotationBuilder.cs @@ -0,0 +1,65 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class AssertConstraintUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule AssertConstraintUsage + /// AssertConstraintUsage=OccurrenceUsagePrefix'assert'(isNegated?='not')?(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'constraint'ConstraintUsageDeclaration)CalculationBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildAssertConstraintUsage(SysML2.NET.Core.POCO.Systems.Constraints.IAssertConstraintUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfReferenceSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + stringBuilder.Append("assert "); + + if (poco.IsNegated) + { + stringBuilder.Append("not"); + stringBuilder.Append(' '); + } + + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + TypeTextualNotationBuilder.BuildCalculationBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssignmentActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssignmentActionUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..069d63a83 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssignmentActionUsageTextualNotationBuilder.cs @@ -0,0 +1,89 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class AssignmentActionUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule AssignmentNode + /// AssignmentNode:AssignmentActionUsage=OccurrenceUsagePrefixAssignmentNodeDeclarationActionBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildAssignmentNode(SysML2.NET.Core.POCO.Systems.Actions.IAssignmentActionUsage poco, StringBuilder stringBuilder) + { + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + ActionUsageTextualNotationBuilder.BuildAssignmentNodeDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule StateAssignmentActionUsage + /// StateAssignmentActionUsage:AssignmentActionUsage=AssignmentNodeDeclarationActionBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildStateAssignmentActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IAssignmentActionUsage poco, StringBuilder stringBuilder) + { + ActionUsageTextualNotationBuilder.BuildAssignmentNodeDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule TransitionAssignmentActionUsage + /// TransitionAssignmentActionUsage:AssignmentActionUsage=AssignmentNodeDeclaration('{'ActionBodyItem*'}')? + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildTransitionAssignmentActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IAssignmentActionUsage poco, StringBuilder stringBuilder) + { + ActionUsageTextualNotationBuilder.BuildAssignmentNodeDeclaration(poco, stringBuilder); + + if (BuildGroupConditionForTransitionAssignmentActionUsage(poco)) + { + stringBuilder.Append("{"); + TypeTextualNotationBuilder.BuildActionBodyItem(poco, stringBuilder); + stringBuilder.Append("}"); + stringBuilder.Append(' '); + } + + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationStructureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationStructureTextualNotationBuilder.cs new file mode 100644 index 000000000..ff949da0c --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationStructureTextualNotationBuilder.cs @@ -0,0 +1,57 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class AssociationStructureTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule AssociationStructure + /// AssociationStructure=TypePrefix'assoc''struct'ClassifierDeclarationTypeBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildAssociationStructure(SysML2.NET.Core.POCO.Kernel.Associations.IAssociationStructure poco, StringBuilder stringBuilder) + { + TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); + stringBuilder.Append("assoc "); + stringBuilder.Append("struct "); + ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationTextualNotationBuilder.cs new file mode 100644 index 000000000..c9c173a37 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationTextualNotationBuilder.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class AssociationTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule Association + /// Association=TypePrefix'assoc'ClassifierDeclarationTypeBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildAssociation(SysML2.NET.Core.POCO.Kernel.Associations.IAssociation poco, StringBuilder stringBuilder) + { + TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); + stringBuilder.Append("assoc "); + ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeDefinitionTextualNotationBuilder.cs new file mode 100644 index 000000000..5f2260a7b --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeDefinitionTextualNotationBuilder.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class AttributeDefinitionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule AttributeDefinition + /// AttributeDefinition:AttributeDefinition=DefinitionPrefix'attribute''def'Definition + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildAttributeDefinition(SysML2.NET.Core.POCO.Systems.Attributes.IAttributeDefinition poco, StringBuilder stringBuilder) + { + DefinitionTextualNotationBuilder.BuildDefinitionPrefix(poco, stringBuilder); + stringBuilder.Append("attribute "); + stringBuilder.Append("def "); + DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..1be2d1f56 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeUsageTextualNotationBuilder.cs @@ -0,0 +1,55 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class AttributeUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule AttributeUsage + /// AttributeUsage:AttributeUsage=UsagePrefix'attribute'Usage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildAttributeUsage(SysML2.NET.Core.POCO.Systems.Attributes.IAttributeUsage poco, StringBuilder stringBuilder) + { + UsageTextualNotationBuilder.BuildUsagePrefix(poco, stringBuilder); + stringBuilder.Append("attribute "); + UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BehaviorTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BehaviorTextualNotationBuilder.cs new file mode 100644 index 000000000..11522991d --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BehaviorTextualNotationBuilder.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class BehaviorTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule Behavior + /// Behavior=TypePrefix'behavior'ClassifierDeclarationTypeBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildBehavior(SysML2.NET.Core.POCO.Kernel.Behaviors.IBehavior poco, StringBuilder stringBuilder) + { + TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); + stringBuilder.Append("behavior "); + ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorAsUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorAsUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..495c3fbc3 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorAsUsageTextualNotationBuilder.cs @@ -0,0 +1,77 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class BindingConnectorAsUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule BindingConnectorAsUsage + /// BindingConnectorAsUsage=UsagePrefix('binding'UsageDeclaration)?'bind'ownedRelationship+=ConnectorEndMember'='ownedRelationship+=ConnectorEndMemberUsageBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildBindingConnectorAsUsage(SysML2.NET.Core.POCO.Systems.Connections.IBindingConnectorAsUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfEndFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + UsageTextualNotationBuilder.BuildUsagePrefix(poco, stringBuilder); + + if (BuildGroupConditionForBindingConnectorAsUsage(poco)) + { + stringBuilder.Append("binding "); + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + stringBuilder.Append(' '); + } + + stringBuilder.Append("bind "); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append("="); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } + UsageTextualNotationBuilder.BuildUsageBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorTextualNotationBuilder.cs new file mode 100644 index 000000000..c67e96b15 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorTextualNotationBuilder.cs @@ -0,0 +1,80 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class BindingConnectorTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule BindingConnectorDeclaration + /// BindingConnectorDeclaration:BindingConnector=FeatureDeclaration('of'ownedRelationship+=ConnectorEndMember'='ownedRelationship+=ConnectorEndMember)?|(isSufficient?='all')?('of'?ownedRelationship+=ConnectorEndMember'='ownedRelationship+=ConnectorEndMember)? + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildBindingConnectorDeclaration(SysML2.NET.Core.POCO.Kernel.Connectors.IBindingConnector poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule BindingConnector + /// BindingConnector=FeaturePrefix'binding'BindingConnectorDeclarationTypeBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildBindingConnector(SysML2.NET.Core.POCO.Kernel.Connectors.IBindingConnector poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + + while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + { + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } + + } + + stringBuilder.Append("binding "); + BuildBindingConnectorDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BooleanExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BooleanExpressionTextualNotationBuilder.cs new file mode 100644 index 000000000..8f8ae3808 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BooleanExpressionTextualNotationBuilder.cs @@ -0,0 +1,70 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class BooleanExpressionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule BooleanExpression + /// BooleanExpression=FeaturePrefix'bool'FeatureDeclarationValuePart?FunctionBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildBooleanExpression(SysML2.NET.Core.POCO.Kernel.Functions.IBooleanExpression poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + + while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + { + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } + + } + + stringBuilder.Append("bool "); + FeatureTextualNotationBuilder.BuildFeatureDeclaration(poco, stringBuilder); + FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + TypeTextualNotationBuilder.BuildFunctionBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationDefinitionTextualNotationBuilder.cs new file mode 100644 index 000000000..8195eecc5 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationDefinitionTextualNotationBuilder.cs @@ -0,0 +1,57 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class CalculationDefinitionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule CalculationDefinition + /// CalculationDefinition=OccurrenceDefinitionPrefix'calc''def'DefinitionDeclarationCalculationBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildCalculationDefinition(SysML2.NET.Core.POCO.Systems.Calculations.ICalculationDefinition poco, StringBuilder stringBuilder) + { + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + stringBuilder.Append("calc "); + stringBuilder.Append("def "); + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildCalculationBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..72a021ce3 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationUsageTextualNotationBuilder.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class CalculationUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule CalculationUsage + /// CalculationUsage:CalculationUsage=OccurrenceUsagePrefix'calc'ActionUsageDeclarationCalculationBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildCalculationUsage(SysML2.NET.Core.POCO.Systems.Calculations.ICalculationUsage poco, StringBuilder stringBuilder) + { + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + stringBuilder.Append("calc "); + ActionUsageTextualNotationBuilder.BuildActionUsageDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildCalculationBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseDefinitionTextualNotationBuilder.cs new file mode 100644 index 000000000..4a6f29714 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseDefinitionTextualNotationBuilder.cs @@ -0,0 +1,57 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class CaseDefinitionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule CaseDefinition + /// CaseDefinition=OccurrenceDefinitionPrefix'case''def'DefinitionDeclarationCaseBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildCaseDefinition(SysML2.NET.Core.POCO.Systems.Cases.ICaseDefinition poco, StringBuilder stringBuilder) + { + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + stringBuilder.Append("case "); + stringBuilder.Append("def "); + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..00ef1b6b3 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseUsageTextualNotationBuilder.cs @@ -0,0 +1,58 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class CaseUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule CaseUsage + /// CaseUsage=OccurrenceUsagePrefix'case'ConstraintUsageDeclarationCaseBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildCaseUsage(SysML2.NET.Core.POCO.Systems.Cases.ICaseUsage poco, StringBuilder stringBuilder) + { + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + stringBuilder.Append("case "); + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + + TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassTextualNotationBuilder.cs new file mode 100644 index 000000000..4abead850 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassTextualNotationBuilder.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ClassTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule Class + /// Class=TypePrefix'class'ClassifierDeclarationTypeBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildClass(SysML2.NET.Core.POCO.Kernel.Classes.IClass poco, StringBuilder stringBuilder) + { + TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); + stringBuilder.Append("class "); + ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs new file mode 100644 index 000000000..9f2f67681 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs @@ -0,0 +1,149 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ClassifierTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule SubclassificationPart + /// SubclassificationPart:Classifier=SPECIALIZESownedRelationship+=OwnedSubclassification(','ownedRelationship+=OwnedSubclassification)* + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildSubclassificationPart(SysML2.NET.Core.POCO.Core.Classifiers.IClassifier poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfSubclassificationIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + ownedRelationshipOfSubclassificationIterator.MoveNext(); + + if (ownedRelationshipOfSubclassificationIterator.Current != null) + { + SubclassificationTextualNotationBuilder.BuildOwnedSubclassification(ownedRelationshipOfSubclassificationIterator.Current, stringBuilder); + } + + while (ownedRelationshipOfSubclassificationIterator.MoveNext()) + { + stringBuilder.Append(","); + + if (ownedRelationshipOfSubclassificationIterator.Current != null) + { + SubclassificationTextualNotationBuilder.BuildOwnedSubclassification(ownedRelationshipOfSubclassificationIterator.Current, stringBuilder); + } + + } + + } + + /// + /// Builds the Textual Notation string for the rule ClassifierDeclaration + /// ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildClassifierDeclaration(SysML2.NET.Core.POCO.Core.Classifiers.IClassifier poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + + if (poco.IsSufficient) + { + stringBuilder.Append("all"); + stringBuilder.Append(' '); + } + + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + + if (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + { + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildOwnedMultiplicity(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append(' '); + } + + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + TypeTextualNotationBuilder.BuildTypeRelationshipPart(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule SuperclassingPart + /// SuperclassingPart:Classifier=SPECIALIZESownedRelationship+=OwnedSubclassification(','ownedRelationship+=OwnedSubclassification)* + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildSuperclassingPart(SysML2.NET.Core.POCO.Core.Classifiers.IClassifier poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfSubclassificationIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + ownedRelationshipOfSubclassificationIterator.MoveNext(); + + if (ownedRelationshipOfSubclassificationIterator.Current != null) + { + SubclassificationTextualNotationBuilder.BuildOwnedSubclassification(ownedRelationshipOfSubclassificationIterator.Current, stringBuilder); + } + + while (ownedRelationshipOfSubclassificationIterator.MoveNext()) + { + stringBuilder.Append(","); + + if (ownedRelationshipOfSubclassificationIterator.Current != null) + { + SubclassificationTextualNotationBuilder.BuildOwnedSubclassification(ownedRelationshipOfSubclassificationIterator.Current, stringBuilder); + } + + } + + } + + /// + /// Builds the Textual Notation string for the rule Classifier + /// Classifier=TypePrefix'classifier'ClassifierDeclarationTypeBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildClassifier(SysML2.NET.Core.POCO.Core.Classifiers.IClassifier poco, StringBuilder stringBuilder) + { + TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); + stringBuilder.Append("classifier "); + BuildClassifierDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CollectExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CollectExpressionTextualNotationBuilder.cs new file mode 100644 index 000000000..0279240e7 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CollectExpressionTextualNotationBuilder.cs @@ -0,0 +1,66 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class CollectExpressionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule CollectExpression + /// CollectExpression=ownedRelationship+=PrimaryArgumentMember'.'ownedRelationship+=BodyArgumentMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildCollectExpression(SysML2.NET.Core.POCO.Kernel.Expressions.ICollectExpression poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildPrimaryArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append("."); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildBodyArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CommentTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CommentTextualNotationBuilder.cs new file mode 100644 index 000000000..824751548 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CommentTextualNotationBuilder.cs @@ -0,0 +1,93 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class CommentTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule Comment + /// Comment=('comment'Identification('about'ownedRelationship+=Annotation(','ownedRelationship+=Annotation)*)?)?('locale'locale=STRING_VALUE)?body=REGULAR_COMMENT + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildComment(SysML2.NET.Core.POCO.Root.Annotations.IComment poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfAnnotationIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + + if (BuildGroupConditionForComment(poco)) + { + stringBuilder.Append("comment "); + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + + if (ownedRelationshipOfAnnotationIterator.MoveNext()) + { + stringBuilder.Append("about "); + + if (ownedRelationshipOfAnnotationIterator.Current != null) + { + AnnotationTextualNotationBuilder.BuildAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + } + + while (ownedRelationshipOfAnnotationIterator.MoveNext()) + { + stringBuilder.Append(","); + + if (ownedRelationshipOfAnnotationIterator.Current != null) + { + AnnotationTextualNotationBuilder.BuildAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + } + + } + stringBuilder.Append(' '); + } + + stringBuilder.Append(' '); + } + + + if (!string.IsNullOrWhiteSpace(poco.Locale)) + { + stringBuilder.Append("locale "); + stringBuilder.Append(poco.Locale); + stringBuilder.Append(' '); + } + + stringBuilder.Append(poco.Body); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernDefinitionTextualNotationBuilder.cs new file mode 100644 index 000000000..3fefd30c2 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernDefinitionTextualNotationBuilder.cs @@ -0,0 +1,57 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ConcernDefinitionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ConcernDefinition + /// ConcernDefinition=OccurrenceDefinitionPrefix'concern''def'DefinitionDeclarationRequirementBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildConcernDefinition(SysML2.NET.Core.POCO.Systems.Requirements.IConcernDefinition poco, StringBuilder stringBuilder) + { + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + stringBuilder.Append("concern "); + stringBuilder.Append("def "); + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildRequirementBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..993889c71 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernUsageTextualNotationBuilder.cs @@ -0,0 +1,67 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ConcernUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule FramedConcernUsage + /// FramedConcernUsage:ConcernUsage=ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?CalculationBody|(UsageExtensionKeyword*'concern'|UsageExtensionKeyword+)CalculationUsageDeclarationCalculationBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFramedConcernUsage(SysML2.NET.Core.POCO.Systems.Requirements.IConcernUsage poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule ConcernUsage + /// ConcernUsage=OccurrenceUsagePrefix'concern'ConstraintUsageDeclarationRequirementBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildConcernUsage(SysML2.NET.Core.POCO.Systems.Requirements.IConcernUsage poco, StringBuilder stringBuilder) + { + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + stringBuilder.Append("concern "); + ConstraintUsageTextualNotationBuilder.BuildConstraintUsageDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildRequirementBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortDefinitionTextualNotationBuilder.cs new file mode 100644 index 000000000..8118e68e9 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortDefinitionTextualNotationBuilder.cs @@ -0,0 +1,59 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ConjugatedPortDefinitionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ConjugatedPortDefinition + /// ConjugatedPortDefinition=ownedRelationship+=PortConjugation + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildConjugatedPortDefinition(SysML2.NET.Core.POCO.Systems.Ports.IConjugatedPortDefinition poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfPortConjugationIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfPortConjugationIterator.MoveNext(); + + if (ownedRelationshipOfPortConjugationIterator.Current != null) + { + PortConjugationTextualNotationBuilder.BuildPortConjugation(ownedRelationshipOfPortConjugationIterator.Current, stringBuilder); + } + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortTypingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortTypingTextualNotationBuilder.cs new file mode 100644 index 000000000..6ca6cc1f5 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortTypingTextualNotationBuilder.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ConjugatedPortTypingTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ConjugatedPortTyping + /// ConjugatedPortTyping:ConjugatedPortTyping='~'originalPortDefinition=~[QualifiedName] + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildConjugatedPortTyping(SysML2.NET.Core.POCO.Systems.Ports.IConjugatedPortTyping poco, StringBuilder stringBuilder) + { + stringBuilder.Append("~"); + BuildOriginalPortDefinition(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugationTextualNotationBuilder.cs new file mode 100644 index 000000000..5868a1481 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugationTextualNotationBuilder.cs @@ -0,0 +1,78 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ConjugationTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule OwnedConjugation + /// OwnedConjugation:Conjugation=originalType=[QualifiedName]|originalType=FeatureChain{ownedRelatedElement+=originalType} + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildOwnedConjugation(SysML2.NET.Core.POCO.Core.Types.IConjugation poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule Conjugation + /// Conjugation=('conjugation'Identification)?'conjugate'(conjugatedType=[QualifiedName]|conjugatedType=FeatureChain{ownedRelatedElement+=conjugatedType})CONJUGATES(originalType=[QualifiedName]|originalType=FeatureChain{ownedRelatedElement+=originalType})RelationshipBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildConjugation(SysML2.NET.Core.POCO.Core.Types.IConjugation poco, StringBuilder stringBuilder) + { + + if (BuildGroupConditionForConjugation(poco)) + { + stringBuilder.Append("conjugation "); + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + stringBuilder.Append(' '); + } + + stringBuilder.Append("conjugate "); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionDefinitionTextualNotationBuilder.cs new file mode 100644 index 000000000..5d1fcc6d4 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionDefinitionTextualNotationBuilder.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ConnectionDefinitionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ConnectionDefinition + /// ConnectionDefinition=OccurrenceDefinitionPrefix'connection''def'Definition + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildConnectionDefinition(SysML2.NET.Core.POCO.Systems.Connections.IConnectionDefinition poco, StringBuilder stringBuilder) + { + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + stringBuilder.Append("connection "); + stringBuilder.Append("def "); + DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..52e3b0626 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs @@ -0,0 +1,130 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ConnectionUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ConnectorPart + /// ConnectorPart:ConnectionUsage=BinaryConnectorPart|NaryConnectorPart + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildConnectorPart(SysML2.NET.Core.POCO.Systems.Connections.IConnectionUsage poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule BinaryConnectorPart + /// BinaryConnectorPart:ConnectionUsage=ownedRelationship+=ConnectorEndMember'to'ownedRelationship+=ConnectorEndMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildBinaryConnectorPart(SysML2.NET.Core.POCO.Systems.Connections.IConnectionUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfEndFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append("to "); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule NaryConnectorPart + /// NaryConnectorPart:ConnectionUsage='('ownedRelationship+=ConnectorEndMember','ownedRelationship+=ConnectorEndMember(','ownedRelationship+=ConnectorEndMember)*')' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildNaryConnectorPart(SysML2.NET.Core.POCO.Systems.Connections.IConnectionUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfEndFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + stringBuilder.Append("("); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append(","); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } + + while (ownedRelationshipOfEndFeatureMembershipIterator.MoveNext()) + { + stringBuilder.Append(","); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } + + } + stringBuilder.Append(")"); + + } + + /// + /// Builds the Textual Notation string for the rule ConnectionUsage + /// ConnectionUsage=OccurrenceUsagePrefix('connection'UsageDeclarationValuePart?('connect'ConnectorPart)?|'connect'ConnectorPart)UsageBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildConnectionUsage(SysML2.NET.Core.POCO.Systems.Connections.IConnectionUsage poco, StringBuilder stringBuilder) + { + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + UsageTextualNotationBuilder.BuildUsageBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs new file mode 100644 index 000000000..894830569 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs @@ -0,0 +1,146 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ConnectorTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ConnectorDeclaration + /// ConnectorDeclaration:Connector=BinaryConnectorDeclaration|NaryConnectorDeclaration + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildConnectorDeclaration(SysML2.NET.Core.POCO.Kernel.Connectors.IConnector poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule BinaryConnectorDeclaration + /// BinaryConnectorDeclaration:Connector=(FeatureDeclaration?'from'|isSufficient?='all''from'?)?ownedRelationship+=ConnectorEndMember'to'ownedRelationship+=ConnectorEndMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildBinaryConnectorDeclaration(SysML2.NET.Core.POCO.Kernel.Connectors.IConnector poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfEndFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append("to "); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule NaryConnectorDeclaration + /// NaryConnectorDeclaration:Connector=FeatureDeclaration?'('ownedRelationship+=ConnectorEndMember','ownedRelationship+=ConnectorEndMember(','ownedRelationship+=ConnectorEndMember)*')' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildNaryConnectorDeclaration(SysML2.NET.Core.POCO.Kernel.Connectors.IConnector poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfEndFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + FeatureTextualNotationBuilder.BuildFeatureDeclaration(poco, stringBuilder); + stringBuilder.Append("("); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append(","); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } + + while (ownedRelationshipOfEndFeatureMembershipIterator.MoveNext()) + { + stringBuilder.Append(","); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } + + } + stringBuilder.Append(")"); + + } + + /// + /// Builds the Textual Notation string for the rule Connector + /// Connector=FeaturePrefix'connector'(FeatureDeclaration?ValuePart?|ConnectorDeclaration)TypeBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildConnector(SysML2.NET.Core.POCO.Kernel.Connectors.IConnector poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + + while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + { + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } + + } + + stringBuilder.Append("connector "); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintDefinitionTextualNotationBuilder.cs new file mode 100644 index 000000000..e80cb7a22 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintDefinitionTextualNotationBuilder.cs @@ -0,0 +1,57 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ConstraintDefinitionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ConstraintDefinition + /// ConstraintDefinition=OccurrenceDefinitionPrefix'constraint''def'DefinitionDeclarationCalculationBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildConstraintDefinition(SysML2.NET.Core.POCO.Systems.Constraints.IConstraintDefinition poco, StringBuilder stringBuilder) + { + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + stringBuilder.Append("constraint "); + stringBuilder.Append("def "); + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildCalculationBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..151ba9f09 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintUsageTextualNotationBuilder.cs @@ -0,0 +1,80 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ConstraintUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ConstraintUsageDeclaration + /// ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildConstraintUsageDeclaration(SysML2.NET.Core.POCO.Systems.Constraints.IConstraintUsage poco, StringBuilder stringBuilder) + { + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule RequirementConstraintUsage + /// RequirementConstraintUsage:ConstraintUsage=ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?RequirementBody|(UsageExtensionKeyword*'constraint'|UsageExtensionKeyword+)ConstraintUsageDeclarationCalculationBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildRequirementConstraintUsage(SysML2.NET.Core.POCO.Systems.Constraints.IConstraintUsage poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule ConstraintUsage + /// ConstraintUsage=OccurrenceUsagePrefix'constraint'ConstraintUsageDeclarationCalculationBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildConstraintUsage(SysML2.NET.Core.POCO.Systems.Constraints.IConstraintUsage poco, StringBuilder stringBuilder) + { + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + stringBuilder.Append("constraint "); + BuildConstraintUsageDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildCalculationBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstructorExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstructorExpressionTextualNotationBuilder.cs new file mode 100644 index 000000000..aa87c35b7 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstructorExpressionTextualNotationBuilder.cs @@ -0,0 +1,67 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ConstructorExpressionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ConstructorExpression + /// ConstructorExpression='new'ownedRelationship+=InstantiatedTypeMemberownedRelationship+=ConstructorResultMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildConstructorExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IConstructorExpression poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + stringBuilder.Append("new "); + ownedRelationshipOfMembershipIterator.MoveNext(); + + if (ownedRelationshipOfMembershipIterator.Current != null) + { + MembershipTextualNotationBuilder.BuildInstantiatedTypeMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + } + ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) + { + ReturnParameterMembershipTextualNotationBuilder.BuildConstructorResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + } + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ControlNodeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ControlNodeTextualNotationBuilder.cs new file mode 100644 index 000000000..64b1f7318 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ControlNodeTextualNotationBuilder.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ControlNodeTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ControlNode + /// ControlNode=MergeNode|DecisionNode|JoinNode|ForkNode + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildControlNode(SysML2.NET.Core.POCO.Systems.Actions.IControlNode poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CrossSubsettingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CrossSubsettingTextualNotationBuilder.cs new file mode 100644 index 000000000..b64b8cadc --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CrossSubsettingTextualNotationBuilder.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class CrossSubsettingTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule OwnedCrossSubsetting + /// OwnedCrossSubsetting:CrossSubsetting=crossedFeature=[QualifiedName]|crossedFeature=OwnedFeatureChain{ownedRelatedElement+=crossedFeature} + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildOwnedCrossSubsetting(SysML2.NET.Core.POCO.Core.Features.ICrossSubsetting poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DataTypeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DataTypeTextualNotationBuilder.cs new file mode 100644 index 000000000..ea76f159d --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DataTypeTextualNotationBuilder.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class DataTypeTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule DataType + /// DataType=TypePrefix'datatype'ClassifierDeclarationTypeBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildDataType(SysML2.NET.Core.POCO.Kernel.DataTypes.IDataType poco, StringBuilder stringBuilder) + { + TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); + stringBuilder.Append("datatype "); + ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DecisionNodeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DecisionNodeTextualNotationBuilder.cs new file mode 100644 index 000000000..3f8b633b8 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DecisionNodeTextualNotationBuilder.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class DecisionNodeTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule DecisionNode + /// DecisionNode=ControlNodePrefixisComposite?='decide'UsageDeclarationActionBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildDecisionNode(SysML2.NET.Core.POCO.Systems.Actions.IDecisionNode poco, StringBuilder stringBuilder) + { + OccurrenceUsageTextualNotationBuilder.BuildControlNodePrefix(poco, stringBuilder); + stringBuilder.Append("decide"); + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs new file mode 100644 index 000000000..0aeccd873 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs @@ -0,0 +1,113 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class DefinitionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule DefinitionExtensionKeyword + /// DefinitionExtensionKeyword:Definition=ownedRelationship+=PrefixMetadataMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildDefinitionExtensionKeyword(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IDefinition poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfOwningMembershipIterator.MoveNext(); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule DefinitionPrefix + /// DefinitionPrefix:Definition=BasicDefinitionPrefix?DefinitionExtensionKeyword* + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildDefinitionPrefix(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IDefinition poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildDefinitionExtensionKeyword(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule DefinitionDeclaration + /// DefinitionDeclaration:Definition=IdentificationSubclassificationPart? + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildDefinitionDeclaration(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IDefinition poco, StringBuilder stringBuilder) + { + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + ClassifierTextualNotationBuilder.BuildSubclassificationPart(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule ExtendedDefinition + /// ExtendedDefinition:Definition=BasicDefinitionPrefix?DefinitionExtensionKeyword+'def'Definition + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildExtendedDefinition(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IDefinition poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildDefinitionExtensionKeyword(poco, stringBuilder); + stringBuilder.Append("def "); + BuildDefinition(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule Definition + /// Definition=DefinitionDeclarationDefinitionBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildDefinition(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IDefinition poco, StringBuilder stringBuilder) + { + BuildDefinitionDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildDefinitionBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DependencyTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DependencyTextualNotationBuilder.cs new file mode 100644 index 000000000..d0e42fb3d --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DependencyTextualNotationBuilder.cs @@ -0,0 +1,87 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class DependencyTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule Dependency + /// Dependency=(ownedRelationship+=PrefixMetadataAnnotation)*'dependency'DependencyDeclarationRelationshipBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildDependency(SysML2.NET.Core.POCO.Root.Dependencies.IDependency poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfAnnotationIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + + while (ownedRelationshipOfAnnotationIterator.MoveNext()) + { + + if (ownedRelationshipOfAnnotationIterator.Current != null) + { + AnnotationTextualNotationBuilder.BuildPrefixMetadataAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + } + + } + stringBuilder.Append("dependency "); + + if (BuildGroupConditionForDependencyDeclaration(poco)) + { + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + stringBuilder.Append("from "); + stringBuilder.Append(' '); + } + + throw new System.NotSupportedException("Assigment of enumerable with non NonTerminalElement not supported yet"); + { + stringBuilder.Append(","); + throw new System.NotSupportedException("Assigment of enumerable with non NonTerminalElement not supported yet"); + + } + stringBuilder.Append("to "); + throw new System.NotSupportedException("Assigment of enumerable with non NonTerminalElement not supported yet"); + { + stringBuilder.Append(","); + throw new System.NotSupportedException("Assigment of enumerable with non NonTerminalElement not supported yet"); + + } + + RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DifferencingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DifferencingTextualNotationBuilder.cs new file mode 100644 index 000000000..d45fe3722 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DifferencingTextualNotationBuilder.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class DifferencingTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule Differencing + /// Differencing=differencingType=[QualifiedName]|ownedRelatedElement+=OwnedFeatureChain + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildDifferencing(SysML2.NET.Core.POCO.Core.Types.IDifferencing poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DisjoiningTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DisjoiningTextualNotationBuilder.cs new file mode 100644 index 000000000..0202d5b35 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DisjoiningTextualNotationBuilder.cs @@ -0,0 +1,78 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class DisjoiningTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule OwnedDisjoining + /// OwnedDisjoining:Disjoining=disjoiningType=[QualifiedName]|disjoiningType=FeatureChain{ownedRelatedElement+=disjoiningType} + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildOwnedDisjoining(SysML2.NET.Core.POCO.Core.Types.IDisjoining poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule Disjoining + /// Disjoining=('disjoining'Identification)?'disjoint'(typeDisjoined=[QualifiedName]|typeDisjoined=FeatureChain{ownedRelatedElement+=typeDisjoined})'from'(disjoiningType=[QualifiedName]|disjoiningType=FeatureChain{ownedRelatedElement+=disjoiningType})RelationshipBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildDisjoining(SysML2.NET.Core.POCO.Core.Types.IDisjoining poco, StringBuilder stringBuilder) + { + + if (BuildGroupConditionForDisjoining(poco)) + { + stringBuilder.Append("disjoining "); + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + stringBuilder.Append(' '); + } + + stringBuilder.Append("disjoint "); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + stringBuilder.Append("from "); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DocumentationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DocumentationTextualNotationBuilder.cs new file mode 100644 index 000000000..faa8e2abf --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DocumentationTextualNotationBuilder.cs @@ -0,0 +1,63 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class DocumentationTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule Documentation + /// Documentation='doc'Identification('locale'locale=STRING_VALUE)?body=REGULAR_COMMENT + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildDocumentation(SysML2.NET.Core.POCO.Root.Annotations.IDocumentation poco, StringBuilder stringBuilder) + { + stringBuilder.Append("doc "); + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + + if (!string.IsNullOrWhiteSpace(poco.Locale)) + { + stringBuilder.Append("locale "); + stringBuilder.Append(poco.Locale); + stringBuilder.Append(' '); + } + + stringBuilder.Append(poco.Body); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementFilterMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementFilterMembershipTextualNotationBuilder.cs new file mode 100644 index 000000000..6147bf64f --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementFilterMembershipTextualNotationBuilder.cs @@ -0,0 +1,82 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ElementFilterMembershipTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ElementFilterMember + /// ElementFilterMember:ElementFilterMembership=MemberPrefix'filter'ownedRelatedElement+=OwnedExpression';' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildElementFilterMember(SysML2.NET.Core.POCO.Kernel.Packages.IElementFilterMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + stringBuilder.Append("filter "); + ownedRelatedElementOfExpressionIterator.MoveNext(); + + if (ownedRelatedElementOfExpressionIterator.Current != null) + { + ExpressionTextualNotationBuilder.BuildOwnedExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); + } + stringBuilder.Append(";"); + + } + + /// + /// Builds the Textual Notation string for the rule FilterPackageMember + /// FilterPackageMember:ElementFilterMembership='['ownedRelatedElement+=OwnedExpression']' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFilterPackageMember(SysML2.NET.Core.POCO.Kernel.Packages.IElementFilterMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + stringBuilder.Append("["); + ownedRelatedElementOfExpressionIterator.MoveNext(); + + if (ownedRelatedElementOfExpressionIterator.Current != null) + { + ExpressionTextualNotationBuilder.BuildOwnedExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); + } + stringBuilder.Append("]"); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementTextualNotationBuilder.cs new file mode 100644 index 000000000..9e720f525 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementTextualNotationBuilder.cs @@ -0,0 +1,112 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ElementTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule Identification + /// Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildIdentification(SysML2.NET.Core.POCO.Root.Elements.IElement poco, StringBuilder stringBuilder) + { + + if (!string.IsNullOrWhiteSpace(poco.DeclaredShortName)) + { + stringBuilder.Append("<"); + stringBuilder.Append(poco.DeclaredShortName); + stringBuilder.Append(">"); + stringBuilder.Append(' '); + } + + + if (!string.IsNullOrWhiteSpace(poco.DeclaredName)) + { + stringBuilder.Append(poco.DeclaredName); + stringBuilder.Append(' '); + } + + + } + + /// + /// Builds the Textual Notation string for the rule DefinitionElement + /// DefinitionElement:Element=Package|LibraryPackage|AnnotatingElement|Dependency|AttributeDefinition|EnumerationDefinition|OccurrenceDefinition|IndividualDefinition|ItemDefinition|PartDefinition|ConnectionDefinition|FlowDefinition|InterfaceDefinition|PortDefinition|ActionDefinition|CalculationDefinition|StateDefinition|ConstraintDefinition|RequirementDefinition|ConcernDefinition|CaseDefinition|AnalysisCaseDefinition|VerificationCaseDefinition|UseCaseDefinition|ViewDefinition|ViewpointDefinition|RenderingDefinition|MetadataDefinition|ExtendedDefinition + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildDefinitionElement(SysML2.NET.Core.POCO.Root.Elements.IElement poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule OwnedRelatedElement + /// OwnedRelatedElement:Element=NonFeatureElement|FeatureElement + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildOwnedRelatedElement(SysML2.NET.Core.POCO.Root.Elements.IElement poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule MemberElement + /// MemberElement:Element=AnnotatingElement|NonFeatureElement + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildMemberElement(SysML2.NET.Core.POCO.Root.Elements.IElement poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule NonFeatureElement + /// NonFeatureElement:Element=Dependency|Namespace|Type|Classifier|DataType|Class|Structure|Metaclass|Association|AssociationStructure|Interaction|Behavior|Function|Predicate|Multiplicity|Package|LibraryPackage|Specialization|Conjugation|Subclassification|Disjoining|FeatureInverting|FeatureTyping|Subsetting|Redefinition|TypeFeaturing + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildNonFeatureElement(SysML2.NET.Core.POCO.Root.Elements.IElement poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EndFeatureMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EndFeatureMembershipTextualNotationBuilder.cs new file mode 100644 index 000000000..4683a2276 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EndFeatureMembershipTextualNotationBuilder.cs @@ -0,0 +1,131 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class EndFeatureMembershipTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule SourceEndMember + /// SourceEndMember:EndFeatureMembership=ownedRelatedElement+=SourceEnd + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildSourceEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfReferenceUsageIterator.MoveNext(); + + if (ownedRelatedElementOfReferenceUsageIterator.Current != null) + { + ReferenceUsageTextualNotationBuilder.BuildSourceEnd(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule ConnectorEndMember + /// ConnectorEndMember:EndFeatureMembership=ownedRelatedElement+=ConnectorEnd + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildConnectorEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfReferenceUsageIterator.MoveNext(); + + if (ownedRelatedElementOfReferenceUsageIterator.Current != null) + { + ReferenceUsageTextualNotationBuilder.BuildConnectorEnd(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule InterfaceEndMember + /// InterfaceEndMember:EndFeatureMembership=ownedRelatedElement+=InterfaceEnd + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildInterfaceEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfPortUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfPortUsageIterator.MoveNext(); + + if (ownedRelatedElementOfPortUsageIterator.Current != null) + { + PortUsageTextualNotationBuilder.BuildInterfaceEnd(ownedRelatedElementOfPortUsageIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule FlowEndMember + /// FlowEndMember:EndFeatureMembership=ownedRelatedElement+=FlowEnd + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFlowEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfFlowEndIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfFlowEndIterator.MoveNext(); + + if (ownedRelatedElementOfFlowEndIterator.Current != null) + { + FlowEndTextualNotationBuilder.BuildFlowEnd(ownedRelatedElementOfFlowEndIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule EmptyEndMember + /// EmptyEndMember:EndFeatureMembership=ownedRelatedElement+=EmptyFeature + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildEmptyEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfReferenceUsageIterator.MoveNext(); + + if (ownedRelatedElementOfReferenceUsageIterator.Current != null) + { + ReferenceUsageTextualNotationBuilder.BuildEmptyFeature(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + } + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationDefinitionTextualNotationBuilder.cs new file mode 100644 index 000000000..164f20a38 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationDefinitionTextualNotationBuilder.cs @@ -0,0 +1,68 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class EnumerationDefinitionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule EnumerationBody + /// EnumerationBody:EnumerationDefinition=';'|'{'(ownedRelationship+=AnnotatingMember|ownedRelationship+=EnumerationUsageMember)*'}' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildEnumerationBody(SysML2.NET.Core.POCO.Systems.Enumerations.IEnumerationDefinition poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule EnumerationDefinition + /// EnumerationDefinition=DefinitionExtensionKeyword*'enum''def'DefinitionDeclarationEnumerationBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildEnumerationDefinition(SysML2.NET.Core.POCO.Systems.Enumerations.IEnumerationDefinition poco, StringBuilder stringBuilder) + { + DefinitionTextualNotationBuilder.BuildDefinitionExtensionKeyword(poco, stringBuilder); + stringBuilder.Append("enum "); + stringBuilder.Append("def "); + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); + BuildEnumerationBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..9058751cd --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationUsageTextualNotationBuilder.cs @@ -0,0 +1,68 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class EnumerationUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule EnumeratedValue + /// EnumeratedValue:EnumerationUsage='enum'?Usage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildEnumeratedValue(SysML2.NET.Core.POCO.Systems.Enumerations.IEnumerationUsage poco, StringBuilder stringBuilder) + { + stringBuilder.Append("enum "); + UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule EnumerationUsage + /// EnumerationUsage:EnumerationUsage=UsagePrefix'enum'Usage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildEnumerationUsage(SysML2.NET.Core.POCO.Systems.Enumerations.IEnumerationUsage poco, StringBuilder stringBuilder) + { + UsageTextualNotationBuilder.BuildUsagePrefix(poco, stringBuilder); + stringBuilder.Append("enum "); + UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EventOccurrenceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EventOccurrenceUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..03d79240f --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EventOccurrenceUsageTextualNotationBuilder.cs @@ -0,0 +1,76 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class EventOccurrenceUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule MessageEvent + /// MessageEvent:EventOccurrenceUsage=ownedRelationship+=OwnedReferenceSubsetting + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildMessageEvent(SysML2.NET.Core.POCO.Systems.Occurrences.IEventOccurrenceUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfReferenceSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfReferenceSubsettingIterator.MoveNext(); + + if (ownedRelationshipOfReferenceSubsettingIterator.Current != null) + { + ReferenceSubsettingTextualNotationBuilder.BuildOwnedReferenceSubsetting(ownedRelationshipOfReferenceSubsettingIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule EventOccurrenceUsage + /// EventOccurrenceUsage=OccurrenceUsagePrefix'event'(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'occurrence'UsageDeclaration?)UsageCompletion + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildEventOccurrenceUsage(SysML2.NET.Core.POCO.Systems.Occurrences.IEventOccurrenceUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfReferenceSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + stringBuilder.Append("event "); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + UsageTextualNotationBuilder.BuildUsageCompletion(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExhibitStateUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExhibitStateUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..6cd6147cc --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExhibitStateUsageTextualNotationBuilder.cs @@ -0,0 +1,59 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ExhibitStateUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ExhibitStateUsage + /// ExhibitStateUsage=OccurrenceUsagePrefix'exhibit'(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'state'UsageDeclaration)ValuePart?StateUsageBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildExhibitStateUsage(SysML2.NET.Core.POCO.Systems.States.IExhibitStateUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfReferenceSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + stringBuilder.Append("exhibit "); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + StateUsageTextualNotationBuilder.BuildStateUsageBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExposeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExposeTextualNotationBuilder.cs new file mode 100644 index 000000000..49cd6253c --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExposeTextualNotationBuilder.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ExposeTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule Expose + /// Expose='expose'(MembershipExpose|NamespaceExpose)RelationshipBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildExpose(SysML2.NET.Core.POCO.Systems.Views.IExpose poco, StringBuilder stringBuilder) + { + stringBuilder.Append("expose "); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs new file mode 100644 index 000000000..a18f1c00b --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs @@ -0,0 +1,171 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ExpressionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule OwnedExpression + /// OwnedExpression:Expression=ConditionalExpression|ConditionalBinaryOperatorExpression|BinaryOperatorExpression|UnaryOperatorExpression|ClassificationExpression|MetaclassificationExpression|ExtentExpression|PrimaryExpression + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildOwnedExpression(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule PrimaryExpression + /// PrimaryExpression:Expression=FeatureChainExpression|NonFeatureChainPrimaryExpression + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildPrimaryExpression(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule NonFeatureChainPrimaryExpression + /// NonFeatureChainPrimaryExpression:Expression=BracketExpression|IndexExpression|SequenceExpression|SelectExpression|CollectExpression|FunctionOperationExpression|BaseExpression + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildNonFeatureChainPrimaryExpression(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule SequenceExpression + /// SequenceExpression:Expression='('SequenceExpressionList')' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildSequenceExpression(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, StringBuilder stringBuilder) + { + stringBuilder.Append("("); + BuildSequenceExpressionList(poco, stringBuilder); + stringBuilder.Append(")"); + + } + + /// + /// Builds the Textual Notation string for the rule SequenceExpressionList + /// SequenceExpressionList:Expression=OwnedExpression','?|SequenceOperatorExpression + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildSequenceExpressionList(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule FunctionReference + /// FunctionReference:Expression=ownedRelationship+=ReferenceTyping + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFunctionReference(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfFeatureTypingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureTypingIterator.MoveNext(); + + if (ownedRelationshipOfFeatureTypingIterator.Current != null) + { + FeatureTypingTextualNotationBuilder.BuildReferenceTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule BaseExpression + /// BaseExpression:Expression=NullExpression|LiteralExpression|FeatureReferenceExpression|MetadataAccessExpression|InvocationExpression|ConstructorExpression|BodyExpression + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildBaseExpression(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule ExpressionBody + /// ExpressionBody:Expression='{'FunctionBodyPart'}' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildExpressionBody(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, StringBuilder stringBuilder) + { + stringBuilder.Append("{"); + TypeTextualNotationBuilder.BuildFunctionBodyPart(poco, stringBuilder); + stringBuilder.Append("}"); + + } + + /// + /// Builds the Textual Notation string for the rule Expression + /// Expression=FeaturePrefix'expr'FeatureDeclarationValuePart?FunctionBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildExpression(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + + while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + { + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } + + } + + stringBuilder.Append("expr "); + FeatureTextualNotationBuilder.BuildFeatureDeclaration(poco, stringBuilder); + FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + TypeTextualNotationBuilder.BuildFunctionBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainExpressionTextualNotationBuilder.cs new file mode 100644 index 000000000..316ae3e6c --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainExpressionTextualNotationBuilder.cs @@ -0,0 +1,67 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class FeatureChainExpressionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule FeatureChainExpression + /// FeatureChainExpression=ownedRelationship+=NonFeatureChainPrimaryArgumentMember'.'ownedRelationship+=FeatureChainMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFeatureChainExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureChainExpression poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildNonFeatureChainPrimaryArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append("."); + ownedRelationshipOfMembershipIterator.MoveNext(); + + if (ownedRelationshipOfMembershipIterator.Current != null) + { + MembershipTextualNotationBuilder.BuildFeatureChainMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + } + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainingTextualNotationBuilder.cs new file mode 100644 index 000000000..795d9f87d --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainingTextualNotationBuilder.cs @@ -0,0 +1,58 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class FeatureChainingTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule OwnedFeatureChaining + /// OwnedFeatureChaining:FeatureChaining=chainingFeature=[QualifiedName] + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildOwnedFeatureChaining(SysML2.NET.Core.POCO.Core.Features.IFeatureChaining poco, StringBuilder stringBuilder) + { + + if (poco.ChainingFeature != null) + { + stringBuilder.Append(poco.ChainingFeature.qualifiedName); + stringBuilder.Append(' '); + } + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureDirectionKindTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureDirectionKindTextualNotationBuilder.cs new file mode 100644 index 000000000..781003230 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureDirectionKindTextualNotationBuilder.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class FeatureDirectionKindTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule FeatureDirection + /// FeatureDirection:FeatureDirectionKind='in'|'out'|'inout' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFeatureDirection(SysML2.NET.Core.Core.Types.FeatureDirectionKind poco, StringBuilder stringBuilder) + { + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureInvertingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureInvertingTextualNotationBuilder.cs new file mode 100644 index 000000000..2592aed09 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureInvertingTextualNotationBuilder.cs @@ -0,0 +1,79 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class FeatureInvertingTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule OwnedFeatureInverting + /// OwnedFeatureInverting:FeatureInverting=invertingFeature=[QualifiedName]|invertingFeature=OwnedFeatureChain{ownedRelatedElement+=invertingFeature} + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildOwnedFeatureInverting(SysML2.NET.Core.POCO.Core.Features.IFeatureInverting poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule FeatureInverting + /// FeatureInverting=('inverting'Identification?)?'inverse'(featureInverted=[QualifiedName]|featureInverted=OwnedFeatureChain{ownedRelatedElement+=featureInverted})'of'(invertingFeature=[QualifiedName]|ownedRelatedElement+=OwnedFeatureChain{ownedRelatedElement+=invertingFeature})RelationshipBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFeatureInverting(SysML2.NET.Core.POCO.Core.Features.IFeatureInverting poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + + if (BuildGroupConditionForFeatureInverting(poco)) + { + stringBuilder.Append("inverting "); + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + stringBuilder.Append(' '); + } + + stringBuilder.Append("inverse "); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + stringBuilder.Append("of "); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs new file mode 100644 index 000000000..6a6dab0b7 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs @@ -0,0 +1,567 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class FeatureMembershipTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule NonOccurrenceUsageMember + /// NonOccurrenceUsageMember:FeatureMembership=MemberPrefixownedRelatedElement+=NonOccurrenceUsageElement + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildNonOccurrenceUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + ownedRelatedElementOfUsageIterator.MoveNext(); + + if (ownedRelatedElementOfUsageIterator.Current != null) + { + UsageTextualNotationBuilder.BuildNonOccurrenceUsageElement(ownedRelatedElementOfUsageIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule OccurrenceUsageMember + /// OccurrenceUsageMember:FeatureMembership=MemberPrefixownedRelatedElement+=OccurrenceUsageElement + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildOccurrenceUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + ownedRelatedElementOfUsageIterator.MoveNext(); + + if (ownedRelatedElementOfUsageIterator.Current != null) + { + UsageTextualNotationBuilder.BuildOccurrenceUsageElement(ownedRelatedElementOfUsageIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule StructureUsageMember + /// StructureUsageMember:FeatureMembership=MemberPrefixownedRelatedElement+=StructureUsageElement + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildStructureUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + ownedRelatedElementOfUsageIterator.MoveNext(); + + if (ownedRelatedElementOfUsageIterator.Current != null) + { + UsageTextualNotationBuilder.BuildStructureUsageElement(ownedRelatedElementOfUsageIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule BehaviorUsageMember + /// BehaviorUsageMember:FeatureMembership=MemberPrefixownedRelatedElement+=BehaviorUsageElement + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildBehaviorUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + ownedRelatedElementOfUsageIterator.MoveNext(); + + if (ownedRelatedElementOfUsageIterator.Current != null) + { + UsageTextualNotationBuilder.BuildBehaviorUsageElement(ownedRelatedElementOfUsageIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule SourceSuccessionMember + /// SourceSuccessionMember:FeatureMembership='then'ownedRelatedElement+=SourceSuccession + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildSourceSuccessionMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfSuccessionAsUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + stringBuilder.Append("then "); + ownedRelatedElementOfSuccessionAsUsageIterator.MoveNext(); + + if (ownedRelatedElementOfSuccessionAsUsageIterator.Current != null) + { + SuccessionAsUsageTextualNotationBuilder.BuildSourceSuccession(ownedRelatedElementOfSuccessionAsUsageIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule InterfaceNonOccurrenceUsageMember + /// InterfaceNonOccurrenceUsageMember:FeatureMembership=MemberPrefixownedRelatedElement+=InterfaceNonOccurrenceUsageElement + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildInterfaceNonOccurrenceUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + ownedRelatedElementOfUsageIterator.MoveNext(); + + if (ownedRelatedElementOfUsageIterator.Current != null) + { + UsageTextualNotationBuilder.BuildInterfaceNonOccurrenceUsageElement(ownedRelatedElementOfUsageIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule InterfaceOccurrenceUsageMember + /// InterfaceOccurrenceUsageMember:FeatureMembership=MemberPrefixownedRelatedElement+=InterfaceOccurrenceUsageElement + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildInterfaceOccurrenceUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + ownedRelatedElementOfUsageIterator.MoveNext(); + + if (ownedRelatedElementOfUsageIterator.Current != null) + { + UsageTextualNotationBuilder.BuildInterfaceOccurrenceUsageElement(ownedRelatedElementOfUsageIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule FlowPayloadFeatureMember + /// FlowPayloadFeatureMember:FeatureMembership=ownedRelatedElement+=FlowPayloadFeature + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFlowPayloadFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfPayloadFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfPayloadFeatureIterator.MoveNext(); + + if (ownedRelatedElementOfPayloadFeatureIterator.Current != null) + { + PayloadFeatureTextualNotationBuilder.BuildFlowPayloadFeature(ownedRelatedElementOfPayloadFeatureIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule FlowFeatureMember + /// FlowFeatureMember:FeatureMembership=ownedRelatedElement+=FlowFeature + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFlowFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfReferenceUsageIterator.MoveNext(); + + if (ownedRelatedElementOfReferenceUsageIterator.Current != null) + { + ReferenceUsageTextualNotationBuilder.BuildFlowFeature(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule ActionBehaviorMember + /// ActionBehaviorMember:FeatureMembership=BehaviorUsageMember|ActionNodeMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildActionBehaviorMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule InitialNodeMember + /// InitialNodeMember:FeatureMembership=MemberPrefix'first'memberFeature=[QualifiedName]RelationshipBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildInitialNodeMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + { + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + stringBuilder.Append("first "); + BuildMemberFeature(poco, stringBuilder); + RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule ActionNodeMember + /// ActionNodeMember:FeatureMembership=MemberPrefixownedRelatedElement+=ActionNode + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildActionNodeMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfActionUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + ownedRelatedElementOfActionUsageIterator.MoveNext(); + + if (ownedRelatedElementOfActionUsageIterator.Current != null) + { + ActionUsageTextualNotationBuilder.BuildActionNode(ownedRelatedElementOfActionUsageIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule ActionTargetSuccessionMember + /// ActionTargetSuccessionMember:FeatureMembership=MemberPrefixownedRelatedElement+=ActionTargetSuccession + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildActionTargetSuccessionMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + ownedRelatedElementOfUsageIterator.MoveNext(); + + if (ownedRelatedElementOfUsageIterator.Current != null) + { + UsageTextualNotationBuilder.BuildActionTargetSuccession(ownedRelatedElementOfUsageIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule GuardedSuccessionMember + /// GuardedSuccessionMember:FeatureMembership=MemberPrefixownedRelatedElement+=GuardedSuccession + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildGuardedSuccessionMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfTransitionUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + ownedRelatedElementOfTransitionUsageIterator.MoveNext(); + + if (ownedRelatedElementOfTransitionUsageIterator.Current != null) + { + TransitionUsageTextualNotationBuilder.BuildGuardedSuccession(ownedRelatedElementOfTransitionUsageIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule ForVariableDeclarationMember + /// ForVariableDeclarationMember:FeatureMembership=ownedRelatedElement+=UsageDeclaration + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildForVariableDeclarationMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfUsageIterator.MoveNext(); + + if (ownedRelatedElementOfUsageIterator.Current != null) + { + UsageTextualNotationBuilder.BuildUsageDeclaration(ownedRelatedElementOfUsageIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule EntryTransitionMember + /// EntryTransitionMember:FeatureMembership=MemberPrefix(ownedRelatedElement+=GuardedTargetSuccession|'then'ownedRelatedElement+=TargetSuccession)';' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildEntryTransitionMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfTransitionUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + using var ownedRelatedElementOfSuccessionAsUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + stringBuilder.Append(";"); + + } + + /// + /// Builds the Textual Notation string for the rule TransitionUsageMember + /// TransitionUsageMember:FeatureMembership=MemberPrefixownedRelatedElement+=TransitionUsage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildTransitionUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfTransitionUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + ownedRelatedElementOfTransitionUsageIterator.MoveNext(); + + if (ownedRelatedElementOfTransitionUsageIterator.Current != null) + { + TransitionUsageTextualNotationBuilder.BuildTransitionUsage(ownedRelatedElementOfTransitionUsageIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule TargetTransitionUsageMember + /// TargetTransitionUsageMember:FeatureMembership=MemberPrefixownedRelatedElement+=TargetTransitionUsage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildTargetTransitionUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfTransitionUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + ownedRelatedElementOfTransitionUsageIterator.MoveNext(); + + if (ownedRelatedElementOfTransitionUsageIterator.Current != null) + { + TransitionUsageTextualNotationBuilder.BuildTargetTransitionUsage(ownedRelatedElementOfTransitionUsageIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule MetadataBodyUsageMember + /// MetadataBodyUsageMember:FeatureMembership=ownedMemberFeature=MetadataBodyUsage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildMetadataBodyUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + { + + if (poco.ownedMemberFeature != null) + { + using var ownedRelationshipOfRedefinitionIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + stringBuilder.Append("ref "); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + ownedRelationshipOfRedefinitionIterator.MoveNext(); + + if (ownedRelationshipOfRedefinitionIterator.Current != null) + { + RedefinitionTextualNotationBuilder.BuildOwnedRedefinition(ownedRelationshipOfRedefinitionIterator.Current, stringBuilder); + } + + if (poco.ownedMemberFeature != null) + { + FeatureTextualNotationBuilder.BuildFeatureSpecializationPart(poco.ownedMemberFeature, stringBuilder); + } + + if (poco.ownedMemberFeature != null) + { + FeatureTextualNotationBuilder.BuildValuePart(poco.ownedMemberFeature, stringBuilder); + } + + if (poco.ownedMemberFeature != null) + { + TypeTextualNotationBuilder.BuildMetadataBody(poco.ownedMemberFeature, stringBuilder); + } + + } + + } + + /// + /// Builds the Textual Notation string for the rule OwnedFeatureMember + /// OwnedFeatureMember:FeatureMembership=MemberPrefixownedRelatedElement+=FeatureElement + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildOwnedFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + ownedRelatedElementOfFeatureIterator.MoveNext(); + + if (ownedRelatedElementOfFeatureIterator.Current != null) + { + FeatureTextualNotationBuilder.BuildFeatureElement(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule OwnedExpressionReferenceMember + /// OwnedExpressionReferenceMember:FeatureMembership=ownedRelationship+=OwnedExpressionReference + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildOwnedExpressionReferenceMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfFeatureReferenceExpressionIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureReferenceExpressionIterator.MoveNext(); + + if (ownedRelationshipOfFeatureReferenceExpressionIterator.Current != null) + { + FeatureReferenceExpressionTextualNotationBuilder.BuildOwnedExpressionReference(ownedRelationshipOfFeatureReferenceExpressionIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule OwnedExpressionMember + /// OwnedExpressionMember:FeatureMembership=ownedFeatureMember=OwnedExpression + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildOwnedExpressionMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + { + BuildOwnedFeatureMember(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule SequenceExpressionListMember + /// SequenceExpressionListMember:FeatureMembership=ownedMemberFeature=SequenceExpressionList + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildSequenceExpressionListMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + { + + if (poco.ownedMemberFeature != null) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + } + + /// + /// Builds the Textual Notation string for the rule FunctionReferenceMember + /// FunctionReferenceMember:FeatureMembership=ownedMemberFeature=FunctionReference + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFunctionReferenceMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + { + + if (poco.ownedMemberFeature != null) + { + using var ownedRelationshipOfFeatureTypingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureTypingIterator.MoveNext(); + + if (ownedRelationshipOfFeatureTypingIterator.Current != null) + { + FeatureTypingTextualNotationBuilder.BuildReferenceTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + } + + } + + } + + /// + /// Builds the Textual Notation string for the rule NamedArgumentMember + /// NamedArgumentMember:FeatureMembership=ownedMemberFeature=NamedArgument + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildNamedArgumentMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + { + + if (poco.ownedMemberFeature != null) + { + FeatureTextualNotationBuilder.BuildNamedArgument(poco.ownedMemberFeature, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule ExpressionBodyMember + /// ExpressionBodyMember:FeatureMembership=ownedMemberFeature=ExpressionBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildExpressionBodyMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + { + + if (poco.ownedMemberFeature != null) + { + stringBuilder.Append("{"); + + if (poco.ownedMemberFeature != null) + { + TypeTextualNotationBuilder.BuildFunctionBodyPart(poco.ownedMemberFeature, stringBuilder); + } + stringBuilder.Append("}"); + + } + + } + + /// + /// Builds the Textual Notation string for the rule PayloadFeatureMember + /// PayloadFeatureMember:FeatureMembership=ownedRelatedElement=PayloadFeature + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildPayloadFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfFeatureIterator.MoveNext(); + + if (ownedRelatedElementOfFeatureIterator.Current != null) + { + FeatureTextualNotationBuilder.BuildPayloadFeature(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule MetadataBodyFeatureMember + /// MetadataBodyFeatureMember:FeatureMembership=ownedMemberFeature=MetadataBodyFeature + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildMetadataBodyFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + { + + if (poco.ownedMemberFeature != null) + { + FeatureTextualNotationBuilder.BuildMetadataBodyFeature(poco.ownedMemberFeature, stringBuilder); + } + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureReferenceExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureReferenceExpressionTextualNotationBuilder.cs new file mode 100644 index 000000000..f11f4fd56 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureReferenceExpressionTextualNotationBuilder.cs @@ -0,0 +1,138 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class FeatureReferenceExpressionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule SatisfactionReferenceExpression + /// SatisfactionReferenceExpression:FeatureReferenceExpression=ownedRelationship+=FeatureChainMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildSatisfactionReferenceExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfMembershipIterator.MoveNext(); + + if (ownedRelationshipOfMembershipIterator.Current != null) + { + MembershipTextualNotationBuilder.BuildFeatureChainMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule OwnedExpressionReference + /// OwnedExpressionReference:FeatureReferenceExpression=ownedRelationship+=OwnedExpressionMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildOwnedExpressionReference(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + { + FeatureMembershipTextualNotationBuilder.BuildOwnedExpressionMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule FunctionReferenceExpression + /// FunctionReferenceExpression:FeatureReferenceExpression=ownedRelationship+=FunctionReferenceMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFunctionReferenceExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + { + FeatureMembershipTextualNotationBuilder.BuildFunctionReferenceMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule FeatureReferenceExpression + /// FeatureReferenceExpression:FeatureReferenceExpression=ownedRelationship+=FeatureReferenceMemberownedRelationship+=EmptyResultMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFeatureReferenceExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfMembershipIterator.MoveNext(); + + if (ownedRelationshipOfMembershipIterator.Current != null) + { + MembershipTextualNotationBuilder.BuildFeatureReferenceMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + } + ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) + { + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule BodyExpression + /// BodyExpression:FeatureReferenceExpression=ownedRelationship+=ExpressionBodyMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildBodyExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + { + FeatureMembershipTextualNotationBuilder.BuildExpressionBodyMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + } + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs new file mode 100644 index 000000000..74b34c469 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs @@ -0,0 +1,889 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class FeatureTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ValuePart + /// ValuePart:Feature=ownedRelationship+=FeatureValue + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildValuePart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureValueIterator.MoveNext(); + + if (ownedRelationshipOfFeatureValueIterator.Current != null) + { + FeatureValueTextualNotationBuilder.BuildFeatureValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule FeatureSpecializationPart + /// FeatureSpecializationPart:Feature=FeatureSpecialization+MultiplicityPart?FeatureSpecialization*|MultiplicityPartFeatureSpecialization* + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFeatureSpecializationPart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule FeatureSpecialization + /// FeatureSpecialization:Feature=Typings|Subsettings|References|Crosses|Redefinitions + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFeatureSpecialization(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule Typings + /// Typings:Feature=TypedBy(','ownedRelationship+=FeatureTyping)* + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildTypings(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfFeatureTypingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + BuildTypedBy(poco, stringBuilder); + + while (ownedRelationshipOfFeatureTypingIterator.MoveNext()) + { + stringBuilder.Append(","); + + if (ownedRelationshipOfFeatureTypingIterator.Current != null) + { + FeatureTypingTextualNotationBuilder.BuildFeatureTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + } + + } + + } + + /// + /// Builds the Textual Notation string for the rule TypedBy + /// TypedBy:Feature=DEFINED_BYownedRelationship+=FeatureTyping + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildTypedBy(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfFeatureTypingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + ownedRelationshipOfFeatureTypingIterator.MoveNext(); + + if (ownedRelationshipOfFeatureTypingIterator.Current != null) + { + FeatureTypingTextualNotationBuilder.BuildFeatureTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule Subsettings + /// Subsettings:Feature=Subsets(','ownedRelationship+=OwnedSubsetting)* + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildSubsettings(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + BuildSubsets(poco, stringBuilder); + + while (ownedRelationshipOfSubsettingIterator.MoveNext()) + { + stringBuilder.Append(","); + + if (ownedRelationshipOfSubsettingIterator.Current != null) + { + SubsettingTextualNotationBuilder.BuildOwnedSubsetting(ownedRelationshipOfSubsettingIterator.Current, stringBuilder); + } + + } + + } + + /// + /// Builds the Textual Notation string for the rule Subsets + /// Subsets:Feature=SUBSETSownedRelationship+=OwnedSubsetting + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildSubsets(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + ownedRelationshipOfSubsettingIterator.MoveNext(); + + if (ownedRelationshipOfSubsettingIterator.Current != null) + { + SubsettingTextualNotationBuilder.BuildOwnedSubsetting(ownedRelationshipOfSubsettingIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule References + /// References:Feature=REFERENCESownedRelationship+=OwnedReferenceSubsetting + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildReferences(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfReferenceSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + ownedRelationshipOfReferenceSubsettingIterator.MoveNext(); + + if (ownedRelationshipOfReferenceSubsettingIterator.Current != null) + { + ReferenceSubsettingTextualNotationBuilder.BuildOwnedReferenceSubsetting(ownedRelationshipOfReferenceSubsettingIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule Crosses + /// Crosses:Feature=CROSSESownedRelationship+=OwnedCrossSubsetting + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildCrosses(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfCrossSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + ownedRelationshipOfCrossSubsettingIterator.MoveNext(); + + if (ownedRelationshipOfCrossSubsettingIterator.Current != null) + { + CrossSubsettingTextualNotationBuilder.BuildOwnedCrossSubsetting(ownedRelationshipOfCrossSubsettingIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule Redefinitions + /// Redefinitions:Feature=Redefines(','ownedRelationship+=OwnedRedefinition)* + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildRedefinitions(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfRedefinitionIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + BuildRedefines(poco, stringBuilder); + + while (ownedRelationshipOfRedefinitionIterator.MoveNext()) + { + stringBuilder.Append(","); + + if (ownedRelationshipOfRedefinitionIterator.Current != null) + { + RedefinitionTextualNotationBuilder.BuildOwnedRedefinition(ownedRelationshipOfRedefinitionIterator.Current, stringBuilder); + } + + } + + } + + /// + /// Builds the Textual Notation string for the rule Redefines + /// Redefines:Feature=REDEFINESownedRelationship+=OwnedRedefinition + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildRedefines(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfRedefinitionIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + ownedRelationshipOfRedefinitionIterator.MoveNext(); + + if (ownedRelationshipOfRedefinitionIterator.Current != null) + { + RedefinitionTextualNotationBuilder.BuildOwnedRedefinition(ownedRelationshipOfRedefinitionIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule OwnedFeatureChain + /// OwnedFeatureChain:Feature=ownedRelationship+=OwnedFeatureChaining('.'ownedRelationship+=OwnedFeatureChaining)+ + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildOwnedFeatureChain(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfFeatureChainingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureChainingIterator.MoveNext(); + + if (ownedRelationshipOfFeatureChainingIterator.Current != null) + { + FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(ownedRelationshipOfFeatureChainingIterator.Current, stringBuilder); + } + + while (ownedRelationshipOfFeatureChainingIterator.MoveNext()) + { + stringBuilder.Append("."); + + if (ownedRelationshipOfFeatureChainingIterator.Current != null) + { + FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(ownedRelationshipOfFeatureChainingIterator.Current, stringBuilder); + } + + } + stringBuilder.Append(' '); + + } + + /// + /// Builds the Textual Notation string for the rule MultiplicityPart + /// MultiplicityPart:Feature=ownedRelationship+=OwnedMultiplicity|(ownedRelationship+=OwnedMultiplicity)?(isOrdered?='ordered'({isUnique=false}'nonunique')?|{isUnique=false}'nonunique'(isOrdered?='ordered')?) + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildMultiplicityPart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule OwnedCrossMultiplicity + /// OwnedCrossMultiplicity:Feature=ownedRelationship+=OwnedMultiplicity + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildOwnedCrossMultiplicity(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfOwningMembershipIterator.MoveNext(); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildOwnedMultiplicity(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule PayloadFeature + /// PayloadFeature:Feature=Identification?PayloadFeatureSpecializationPartValuePart?|ownedRelationship+=OwnedFeatureTyping(ownedRelationship+=OwnedMultiplicity)?|ownedRelationship+=OwnedMultiplicityownedRelationship+=OwnedFeatureTyping + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildPayloadFeature(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule PayloadFeatureSpecializationPart + /// PayloadFeatureSpecializationPart:Feature=(FeatureSpecialization)+MultiplicityPart?FeatureSpecialization*|MultiplicityPartFeatureSpecialization+ + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildPayloadFeatureSpecializationPart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule FeatureChainPrefix + /// FeatureChainPrefix:Feature=(ownedRelationship+=OwnedFeatureChaining'.')+ownedRelationship+=OwnedFeatureChaining'.' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFeatureChainPrefix(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfFeatureChainingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + + while (ownedRelationshipOfFeatureChainingIterator.MoveNext()) + { + + if (ownedRelationshipOfFeatureChainingIterator.Current != null) + { + FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(ownedRelationshipOfFeatureChainingIterator.Current, stringBuilder); + } + stringBuilder.Append("."); + + } + stringBuilder.Append(' '); + ownedRelationshipOfFeatureChainingIterator.MoveNext(); + + if (ownedRelationshipOfFeatureChainingIterator.Current != null) + { + FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(ownedRelationshipOfFeatureChainingIterator.Current, stringBuilder); + } + stringBuilder.Append("."); + + } + + /// + /// Builds the Textual Notation string for the rule TriggerValuePart + /// TriggerValuePart:Feature=ownedRelationship+=TriggerFeatureValue + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildTriggerValuePart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureValueIterator.MoveNext(); + + if (ownedRelationshipOfFeatureValueIterator.Current != null) + { + FeatureValueTextualNotationBuilder.BuildTriggerFeatureValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule Argument + /// Argument:Feature=ownedRelationship+=ArgumentValue + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureValueIterator.MoveNext(); + + if (ownedRelationshipOfFeatureValueIterator.Current != null) + { + FeatureValueTextualNotationBuilder.BuildArgumentValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule ArgumentExpression + /// ArgumentExpression:Feature=ownedRelationship+=ArgumentExpressionValue + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildArgumentExpression(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureValueIterator.MoveNext(); + + if (ownedRelationshipOfFeatureValueIterator.Current != null) + { + FeatureValueTextualNotationBuilder.BuildArgumentExpressionValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule FeatureElement + /// FeatureElement:Feature=Feature|Step|Expression|BooleanExpression|Invariant|Connector|BindingConnector|Succession|Flow|SuccessionFlow + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFeatureElement(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule EndFeaturePrefix + /// EndFeaturePrefix:Feature=(isConstant?='const'{isVariable=true})?isEnd?='end' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildEndFeaturePrefix(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + + if (poco.IsConstant) + { + stringBuilder.Append("const"); + // NonParsing Assignment Element : isVariable = true => Does not have to be process + stringBuilder.Append(' '); + } + + stringBuilder.Append("end"); + + } + + /// + /// Builds the Textual Notation string for the rule BasicFeaturePrefix + /// BasicFeaturePrefix:Feature=(direction=FeatureDirection)?(isDerived?='derived')?(isAbstract?='abstract')?(isComposite?='composite'|isPortion?='portion')?(isVariable?='var'|isConstant?='const'{isVariable=true})? + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildBasicFeaturePrefix(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + + if (poco.Direction.HasValue) + { + stringBuilder.Append(poco.Direction.ToString().ToLower()); + stringBuilder.Append(' '); + } + + + if (poco.IsDerived) + { + stringBuilder.Append("derived"); + stringBuilder.Append(' '); + } + + + if (poco.IsAbstract) + { + stringBuilder.Append("abstract"); + stringBuilder.Append(' '); + } + + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + + } + + /// + /// Builds the Textual Notation string for the rule FeatureDeclaration + /// FeatureDeclaration:Feature=(isSufficient?='all')?(FeatureIdentification(FeatureSpecializationPart|ConjugationPart)?|FeatureSpecializationPart|ConjugationPart)FeatureRelationshipPart* + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFeatureDeclaration(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + + if (poco.IsSufficient) + { + stringBuilder.Append("all"); + stringBuilder.Append(' '); + } + + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + BuildFeatureRelationshipPart(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule FeatureIdentification + /// FeatureIdentification:Feature='<'declaredShortName=NAME'>'(declaredName=NAME)?|declaredName=NAME + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFeatureIdentification(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule FeatureRelationshipPart + /// FeatureRelationshipPart:Feature=TypeRelationshipPart|ChainingPart|InvertingPart|TypeFeaturingPart + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFeatureRelationshipPart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule ChainingPart + /// ChainingPart:Feature='chains'(ownedRelationship+=OwnedFeatureChaining|FeatureChain) + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildChainingPart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfFeatureChainingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + stringBuilder.Append("chains "); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + + } + + /// + /// Builds the Textual Notation string for the rule InvertingPart + /// InvertingPart:Feature='inverse''of'ownedRelationship+=OwnedFeatureInverting + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildInvertingPart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfFeatureInvertingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + stringBuilder.Append("inverse "); + stringBuilder.Append("of "); + ownedRelationshipOfFeatureInvertingIterator.MoveNext(); + + if (ownedRelationshipOfFeatureInvertingIterator.Current != null) + { + FeatureInvertingTextualNotationBuilder.BuildOwnedFeatureInverting(ownedRelationshipOfFeatureInvertingIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule TypeFeaturingPart + /// TypeFeaturingPart:Feature='featured''by'ownedRelationship+=OwnedTypeFeaturing(','ownedTypeFeaturing+=OwnedTypeFeaturing)* + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildTypeFeaturingPart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfTypeFeaturingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedTypeFeaturingIterator = poco.ownedTypeFeaturing.GetEnumerator(); + stringBuilder.Append("featured "); + stringBuilder.Append("by "); + ownedRelationshipOfTypeFeaturingIterator.MoveNext(); + + if (ownedRelationshipOfTypeFeaturingIterator.Current != null) + { + TypeFeaturingTextualNotationBuilder.BuildOwnedTypeFeaturing(ownedRelationshipOfTypeFeaturingIterator.Current, stringBuilder); + } + + while (ownedTypeFeaturingIterator.MoveNext()) + { + stringBuilder.Append(","); + + if (ownedTypeFeaturingIterator.Current != null) + { + TypeFeaturingTextualNotationBuilder.BuildOwnedTypeFeaturing(ownedTypeFeaturingIterator.Current, stringBuilder); + } + + } + + } + + /// + /// Builds the Textual Notation string for the rule FeatureChain + /// FeatureChain:Feature=ownedRelationship+=OwnedFeatureChaining('.'ownedRelationship+=OwnedFeatureChaining)+ + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFeatureChain(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfFeatureChainingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureChainingIterator.MoveNext(); + + if (ownedRelationshipOfFeatureChainingIterator.Current != null) + { + FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(ownedRelationshipOfFeatureChainingIterator.Current, stringBuilder); + } + + while (ownedRelationshipOfFeatureChainingIterator.MoveNext()) + { + stringBuilder.Append("."); + + if (ownedRelationshipOfFeatureChainingIterator.Current != null) + { + FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(ownedRelationshipOfFeatureChainingIterator.Current, stringBuilder); + } + + } + stringBuilder.Append(' '); + + } + + /// + /// Builds the Textual Notation string for the rule MetadataArgument + /// MetadataArgument:Feature=ownedRelationship+=MetadataValue + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildMetadataArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureValueIterator.MoveNext(); + + if (ownedRelationshipOfFeatureValueIterator.Current != null) + { + FeatureValueTextualNotationBuilder.BuildMetadataValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule TypeReference + /// TypeReference:Feature=ownedRelationship+=ReferenceTyping + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildTypeReference(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfFeatureTypingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureTypingIterator.MoveNext(); + + if (ownedRelationshipOfFeatureTypingIterator.Current != null) + { + FeatureTypingTextualNotationBuilder.BuildReferenceTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule PrimaryArgument + /// PrimaryArgument:Feature=ownedRelationship+=PrimaryArgumentValue + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildPrimaryArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureValueIterator.MoveNext(); + + if (ownedRelationshipOfFeatureValueIterator.Current != null) + { + FeatureValueTextualNotationBuilder.BuildPrimaryArgumentValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule NonFeatureChainPrimaryArgument + /// NonFeatureChainPrimaryArgument:Feature=ownedRelationship+=NonFeatureChainPrimaryArgumentValue + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildNonFeatureChainPrimaryArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureValueIterator.MoveNext(); + + if (ownedRelationshipOfFeatureValueIterator.Current != null) + { + FeatureValueTextualNotationBuilder.BuildNonFeatureChainPrimaryArgumentValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule BodyArgument + /// BodyArgument:Feature=ownedRelationship+=BodyArgumentValue + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildBodyArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureValueIterator.MoveNext(); + + if (ownedRelationshipOfFeatureValueIterator.Current != null) + { + FeatureValueTextualNotationBuilder.BuildBodyArgumentValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule FunctionReferenceArgument + /// FunctionReferenceArgument:Feature=ownedRelationship+=FunctionReferenceArgumentValue + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFunctionReferenceArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureValueIterator.MoveNext(); + + if (ownedRelationshipOfFeatureValueIterator.Current != null) + { + FeatureValueTextualNotationBuilder.BuildFunctionReferenceArgumentValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule FeatureReference + /// FeatureReference:Feature=[QualifiedName] + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFeatureReference(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + stringBuilder.Append(poco.qualifiedName); + stringBuilder.Append(' '); + + } + + /// + /// Builds the Textual Notation string for the rule ConstructorResult + /// ConstructorResult:Feature=ArgumentList + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildConstructorResult(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + BuildArgumentList(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule ArgumentList + /// ArgumentList:Feature='('(PositionalArgumentList|NamedArgumentList)?')' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildArgumentList(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + stringBuilder.Append("("); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(")"); + + } + + /// + /// Builds the Textual Notation string for the rule PositionalArgumentList + /// PositionalArgumentList:Feature=e.ownedRelationship+=ArgumentMember(','e.ownedRelationship+=ArgumentMember)* + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildPositionalArgumentList(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + + while (ownedRelationshipOfParameterMembershipIterator.MoveNext()) + { + stringBuilder.Append(","); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + + } + + } + + /// + /// Builds the Textual Notation string for the rule NamedArgumentList + /// NamedArgumentList:Feature=ownedRelationship+=NamedArgumentMember(','ownedRelationship+=NamedArgumentMember)* + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildNamedArgumentList(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + { + FeatureMembershipTextualNotationBuilder.BuildNamedArgumentMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + } + + while (ownedRelationshipOfFeatureMembershipIterator.MoveNext()) + { + stringBuilder.Append(","); + + if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + { + FeatureMembershipTextualNotationBuilder.BuildNamedArgumentMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + } + + } + + } + + /// + /// Builds the Textual Notation string for the rule NamedArgument + /// NamedArgument:Feature=ownedRelationship+=ParameterRedefinition'='ownedRelationship+=ArgumentValue + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildNamedArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfRedefinitionIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfRedefinitionIterator.MoveNext(); + + if (ownedRelationshipOfRedefinitionIterator.Current != null) + { + RedefinitionTextualNotationBuilder.BuildParameterRedefinition(ownedRelationshipOfRedefinitionIterator.Current, stringBuilder); + } + stringBuilder.Append("="); + ownedRelationshipOfFeatureValueIterator.MoveNext(); + + if (ownedRelationshipOfFeatureValueIterator.Current != null) + { + FeatureValueTextualNotationBuilder.BuildArgumentValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule MetadataBodyFeature + /// MetadataBodyFeature:Feature='feature'?(':>>'|'redefines')?ownedRelationship+=OwnedRedefinitionFeatureSpecializationPart?ValuePart?MetadataBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildMetadataBodyFeature(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfRedefinitionIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + stringBuilder.Append("feature "); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + ownedRelationshipOfRedefinitionIterator.MoveNext(); + + if (ownedRelationshipOfRedefinitionIterator.Current != null) + { + RedefinitionTextualNotationBuilder.BuildOwnedRedefinition(ownedRelationshipOfRedefinitionIterator.Current, stringBuilder); + } + BuildFeatureSpecializationPart(poco, stringBuilder); + BuildValuePart(poco, stringBuilder); + TypeTextualNotationBuilder.BuildMetadataBody(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule Feature + /// Feature=(FeaturePrefix('feature'|ownedRelationship+=PrefixMetadataMember)FeatureDeclaration?|(EndFeaturePrefix|BasicFeaturePrefix)FeatureDeclaration)ValuePart?TypeBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFeature(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + BuildValuePart(poco, stringBuilder); + TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs new file mode 100644 index 000000000..6c4f74df6 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs @@ -0,0 +1,80 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class FeatureTypingTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule OwnedFeatureTyping + /// OwnedFeatureTyping:FeatureTyping=type=[QualifiedName]|type=OwnedFeatureChain{ownedRelatedElement+=type} + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildOwnedFeatureTyping(SysML2.NET.Core.POCO.Core.Features.IFeatureTyping poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule ReferenceTyping + /// ReferenceTyping:FeatureTyping=type=[QualifiedName] + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildReferenceTyping(SysML2.NET.Core.POCO.Core.Features.IFeatureTyping poco, StringBuilder stringBuilder) + { + + if (poco.Type != null) + { + stringBuilder.Append(poco.Type.qualifiedName); + stringBuilder.Append(' '); + } + + } + + /// + /// Builds the Textual Notation string for the rule FeatureTyping + /// FeatureTyping=OwnedFeatureTyping|ConjugatedPortTyping + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFeatureTyping(SysML2.NET.Core.POCO.Core.Features.IFeatureTyping poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureValueTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureValueTextualNotationBuilder.cs new file mode 100644 index 000000000..7c3bc4ee3 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureValueTextualNotationBuilder.cs @@ -0,0 +1,268 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class FeatureValueTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule TriggerFeatureValue + /// TriggerFeatureValue:FeatureValue=ownedRelatedElement+=TriggerExpression + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildTriggerFeatureValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfTriggerInvocationExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfTriggerInvocationExpressionIterator.MoveNext(); + + if (ownedRelatedElementOfTriggerInvocationExpressionIterator.Current != null) + { + TriggerInvocationExpressionTextualNotationBuilder.BuildTriggerExpression(ownedRelatedElementOfTriggerInvocationExpressionIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule ArgumentValue + /// ArgumentValue:FeatureValue=value=OwnedExpression + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildArgumentValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) + { + + if (poco.value != null) + { + ExpressionTextualNotationBuilder.BuildOwnedExpression(poco.value, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule ArgumentExpressionValue + /// ArgumentExpressionValue:FeatureValue=ownedRelatedElement+=OwnedExpressionReference + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildArgumentExpressionValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfFeatureReferenceExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfFeatureReferenceExpressionIterator.MoveNext(); + + if (ownedRelatedElementOfFeatureReferenceExpressionIterator.Current != null) + { + FeatureReferenceExpressionTextualNotationBuilder.BuildOwnedExpressionReference(ownedRelatedElementOfFeatureReferenceExpressionIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule FeatureBinding + /// FeatureBinding:FeatureValue=ownedRelatedElement+=OwnedExpression + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFeatureBinding(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfExpressionIterator.MoveNext(); + + if (ownedRelatedElementOfExpressionIterator.Current != null) + { + ExpressionTextualNotationBuilder.BuildOwnedExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule AssignmentTargetBinding + /// AssignmentTargetBinding:FeatureValue=ownedRelatedElement+=NonFeatureChainPrimaryExpression + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildAssignmentTargetBinding(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfExpressionIterator.MoveNext(); + + if (ownedRelatedElementOfExpressionIterator.Current != null) + { + ExpressionTextualNotationBuilder.BuildNonFeatureChainPrimaryExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule SatisfactionFeatureValue + /// SatisfactionFeatureValue:FeatureValue=ownedRelatedElement+=SatisfactionReferenceExpression + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildSatisfactionFeatureValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfFeatureReferenceExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfFeatureReferenceExpressionIterator.MoveNext(); + + if (ownedRelatedElementOfFeatureReferenceExpressionIterator.Current != null) + { + FeatureReferenceExpressionTextualNotationBuilder.BuildSatisfactionReferenceExpression(ownedRelatedElementOfFeatureReferenceExpressionIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule MetadataValue + /// MetadataValue:FeatureValue=value=MetadataReference + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildMetadataValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) + { + + if (poco.value != null) + { + using var ownedRelationshipOfMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfMembershipIterator.MoveNext(); + + if (ownedRelationshipOfMembershipIterator.Current != null) + { + MembershipTextualNotationBuilder.BuildElementReferenceMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + } + + } + + } + + /// + /// Builds the Textual Notation string for the rule PrimaryArgumentValue + /// PrimaryArgumentValue:FeatureValue=value=PrimaryExpression + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildPrimaryArgumentValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) + { + + if (poco.value != null) + { + ExpressionTextualNotationBuilder.BuildPrimaryExpression(poco.value, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule NonFeatureChainPrimaryArgumentValue + /// NonFeatureChainPrimaryArgumentValue:FeatureValue=value=NonFeatureChainPrimaryExpression + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildNonFeatureChainPrimaryArgumentValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) + { + + if (poco.value != null) + { + ExpressionTextualNotationBuilder.BuildNonFeatureChainPrimaryExpression(poco.value, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule BodyArgumentValue + /// BodyArgumentValue:FeatureValue=value=BodyExpression + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildBodyArgumentValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) + { + + if (poco.value != null) + { + using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + { + FeatureMembershipTextualNotationBuilder.BuildExpressionBodyMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + } + + } + + } + + /// + /// Builds the Textual Notation string for the rule FunctionReferenceArgumentValue + /// FunctionReferenceArgumentValue:FeatureValue=value=FunctionReferenceExpression + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFunctionReferenceArgumentValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) + { + + if (poco.value != null) + { + using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + { + FeatureMembershipTextualNotationBuilder.BuildFunctionReferenceMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + } + + } + + } + + /// + /// Builds the Textual Notation string for the rule FeatureValue + /// FeatureValue=('='|isInitial?=':='|isDefault?='default'('='|isInitial?=':=')?)ownedRelatedElement+=OwnedExpression + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFeatureValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + ownedRelatedElementOfExpressionIterator.MoveNext(); + + if (ownedRelatedElementOfExpressionIterator.Current != null) + { + ExpressionTextualNotationBuilder.BuildOwnedExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); + } + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowDefinitionTextualNotationBuilder.cs new file mode 100644 index 000000000..8e03f5f9e --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowDefinitionTextualNotationBuilder.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class FlowDefinitionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule FlowDefinition + /// FlowDefinition=OccurrenceDefinitionPrefix'flow''def'Definition + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFlowDefinition(SysML2.NET.Core.POCO.Systems.Flows.IFlowDefinition poco, StringBuilder stringBuilder) + { + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + stringBuilder.Append("flow "); + stringBuilder.Append("def "); + DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowEndTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowEndTextualNotationBuilder.cs new file mode 100644 index 000000000..5b7562fe5 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowEndTextualNotationBuilder.cs @@ -0,0 +1,71 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class FlowEndTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule FlowEnd + /// FlowEnd=(ownedRelationship+=FlowEndSubsetting)?ownedRelationship+=FlowFeatureMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFlowEnd(SysML2.NET.Core.POCO.Kernel.Interactions.IFlowEnd poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfReferenceSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + + if (ownedRelationshipOfReferenceSubsettingIterator.MoveNext()) + { + + if (ownedRelationshipOfReferenceSubsettingIterator.Current != null) + { + ReferenceSubsettingTextualNotationBuilder.BuildFlowEndSubsetting(ownedRelationshipOfReferenceSubsettingIterator.Current, stringBuilder); + } + stringBuilder.Append(' '); + } + + ownedRelationshipOfFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + { + FeatureMembershipTextualNotationBuilder.BuildFlowFeatureMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + } + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowTextualNotationBuilder.cs new file mode 100644 index 000000000..2d5dd3fa5 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowTextualNotationBuilder.cs @@ -0,0 +1,69 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class FlowTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule Flow + /// Flow=FeaturePrefix'flow'FlowDeclarationTypeBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFlow(SysML2.NET.Core.POCO.Kernel.Interactions.IFlow poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + + while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + { + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } + + } + + stringBuilder.Append("flow "); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..914068cbf --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowUsageTextualNotationBuilder.cs @@ -0,0 +1,94 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class FlowUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule Message + /// Message:FlowUsage=OccurrenceUsagePrefix'message'MessageDeclarationDefinitionBody{isAbstract=true} + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildMessage(SysML2.NET.Core.POCO.Systems.Flows.IFlowUsage poco, StringBuilder stringBuilder) + { + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + stringBuilder.Append("message "); + BuildMessageDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildDefinitionBody(poco, stringBuilder); + // NonParsing Assignment Element : isAbstract = true => Does not have to be process + + } + + /// + /// Builds the Textual Notation string for the rule MessageDeclaration + /// MessageDeclaration:FlowUsage=UsageDeclarationValuePart?('of'ownedRelationship+=FlowPayloadFeatureMember)?('from'ownedRelationship+=MessageEventMember'to'ownedRelationship+=MessageEventMember)?|ownedRelationship+=MessageEventMember'to'ownedRelationship+=MessageEventMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildMessageDeclaration(SysML2.NET.Core.POCO.Systems.Flows.IFlowUsage poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule FlowDeclaration + /// FlowDeclaration:FlowUsage=UsageDeclarationValuePart?('of'ownedRelationship+=FlowPayloadFeatureMember)?('from'ownedRelationship+=FlowEndMember'to'ownedRelationship+=FlowEndMember)?|ownedRelationship+=FlowEndMember'to'ownedRelationship+=FlowEndMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFlowDeclaration(SysML2.NET.Core.POCO.Systems.Flows.IFlowUsage poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule FlowUsage + /// FlowUsage=OccurrenceUsagePrefix'flow'FlowDeclarationDefinitionBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFlowUsage(SysML2.NET.Core.POCO.Systems.Flows.IFlowUsage poco, StringBuilder stringBuilder) + { + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + stringBuilder.Append("flow "); + BuildFlowDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildDefinitionBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForLoopActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForLoopActionUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..60fded55b --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForLoopActionUsageTextualNotationBuilder.cs @@ -0,0 +1,75 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ForLoopActionUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ForLoopNode + /// ForLoopNode:ForLoopActionUsage=ActionNodePrefix'for'ownedRelationship+=ForVariableDeclarationMember'in'ownedRelationship+=NodeParameterMemberownedRelationship+=ActionBodyParameterMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildForLoopNode(SysML2.NET.Core.POCO.Systems.Actions.IForLoopActionUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ActionUsageTextualNotationBuilder.BuildActionNodePrefix(poco, stringBuilder); + stringBuilder.Append("for "); + ownedRelationshipOfFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + { + FeatureMembershipTextualNotationBuilder.BuildForVariableDeclarationMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append("in "); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildActionBodyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForkNodeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForkNodeTextualNotationBuilder.cs new file mode 100644 index 000000000..0c8f6cd08 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForkNodeTextualNotationBuilder.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ForkNodeTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ForkNode + /// ForkNode=ControlNodePrefixisComposite?='fork'UsageDeclarationActionBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildForkNode(SysML2.NET.Core.POCO.Systems.Actions.IForkNode poco, StringBuilder stringBuilder) + { + OccurrenceUsageTextualNotationBuilder.BuildControlNodePrefix(poco, stringBuilder); + stringBuilder.Append("fork"); + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FramedConcernMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FramedConcernMembershipTextualNotationBuilder.cs new file mode 100644 index 000000000..97edba8e9 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FramedConcernMembershipTextualNotationBuilder.cs @@ -0,0 +1,61 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class FramedConcernMembershipTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule FramedConcernMember + /// FramedConcernMember:FramedConcernMembership=MemberPrefix?'frame'ownedRelatedElement+=FramedConcernUsage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFramedConcernMember(SysML2.NET.Core.POCO.Systems.Requirements.IFramedConcernMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfConcernUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + stringBuilder.Append("frame "); + ownedRelatedElementOfConcernUsageIterator.MoveNext(); + + if (ownedRelatedElementOfConcernUsageIterator.Current != null) + { + ConcernUsageTextualNotationBuilder.BuildFramedConcernUsage(ownedRelatedElementOfConcernUsageIterator.Current, stringBuilder); + } + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FunctionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FunctionTextualNotationBuilder.cs new file mode 100644 index 000000000..7533b9c93 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FunctionTextualNotationBuilder.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class FunctionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule Function + /// Function=TypePrefix'function'ClassifierDeclarationFunctionBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFunction(SysML2.NET.Core.POCO.Kernel.Functions.IFunction poco, StringBuilder stringBuilder) + { + TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); + stringBuilder.Append("function "); + ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildFunctionBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..08b23b293 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs @@ -0,0 +1,75 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class IfActionUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule IfNode + /// IfNode:IfActionUsage=ActionNodePrefix'if'ownedRelationship+=ExpressionParameterMemberownedRelationship+=ActionBodyParameterMember('else'ownedRelationship+=(ActionBodyParameterMember|IfNodeParameterMember))? + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildIfNode(SysML2.NET.Core.POCO.Systems.Actions.IIfActionUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ActionUsageTextualNotationBuilder.BuildActionNodePrefix(poco, stringBuilder); + stringBuilder.Append("if "); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildExpressionParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildActionBodyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + + if (BuildGroupConditionForIfNode(poco)) + { + stringBuilder.Append("else "); + throw new System.NotSupportedException("Assigment of enumerable with non NonTerminalElement not supported yet"); + stringBuilder.Append(' '); + } + + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ImportTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ImportTextualNotationBuilder.cs new file mode 100644 index 000000000..f43e0d6ca --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ImportTextualNotationBuilder.cs @@ -0,0 +1,74 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ImportTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ImportDeclaration + /// ImportDeclaration:Import=MembershipImport|NamespaceImport + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildImportDeclaration(SysML2.NET.Core.POCO.Root.Namespaces.IImport poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule Import + /// Import=visibility=VisibilityIndicator'import'(isImportAll?='all')?ImportDeclarationRelationshipBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildImport(SysML2.NET.Core.POCO.Root.Namespaces.IImport poco, StringBuilder stringBuilder) + { + stringBuilder.Append(poco.Visibility.ToString().ToLower()); + stringBuilder.Append("import "); + + if (poco.IsImportAll) + { + stringBuilder.Append("all"); + stringBuilder.Append(' '); + } + + BuildImportDeclaration(poco, stringBuilder); + RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IncludeUseCaseUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IncludeUseCaseUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..f6b8fbb7e --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IncludeUseCaseUsageTextualNotationBuilder.cs @@ -0,0 +1,59 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class IncludeUseCaseUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule IncludeUseCaseUsage + /// IncludeUseCaseUsage=OccurrenceUsagePrefix'include'(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'use''case'UsageDeclaration)ValuePart?CaseBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildIncludeUseCaseUsage(SysML2.NET.Core.POCO.Systems.UseCases.IIncludeUseCaseUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfReferenceSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + stringBuilder.Append("include "); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IndexExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IndexExpressionTextualNotationBuilder.cs new file mode 100644 index 000000000..3a765c76c --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IndexExpressionTextualNotationBuilder.cs @@ -0,0 +1,69 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class IndexExpressionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule IndexExpression + /// IndexExpression=ownedRelationship+=PrimaryArgumentMember'#''('ownedRelationship+=SequenceExpressionListMember')' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildIndexExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IIndexExpression poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildPrimaryArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append("#"); + stringBuilder.Append("("); + ownedRelationshipOfFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + { + FeatureMembershipTextualNotationBuilder.BuildSequenceExpressionListMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append(")"); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InteractionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InteractionTextualNotationBuilder.cs new file mode 100644 index 000000000..55e47728f --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InteractionTextualNotationBuilder.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class InteractionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule Interaction + /// Interaction=TypePrefix'interaction'ClassifierDeclarationTypeBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildInteraction(SysML2.NET.Core.POCO.Kernel.Interactions.IInteraction poco, StringBuilder stringBuilder) + { + TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); + stringBuilder.Append("interaction "); + ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceDefinitionTextualNotationBuilder.cs new file mode 100644 index 000000000..b1efd5bd6 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceDefinitionTextualNotationBuilder.cs @@ -0,0 +1,57 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class InterfaceDefinitionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule InterfaceDefinition + /// InterfaceDefinition=OccurrenceDefinitionPrefix'interface''def'DefinitionDeclarationInterfaceBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildInterfaceDefinition(SysML2.NET.Core.POCO.Systems.Interfaces.IInterfaceDefinition poco, StringBuilder stringBuilder) + { + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + stringBuilder.Append("interface "); + stringBuilder.Append("def "); + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildInterfaceBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..68942d76c --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs @@ -0,0 +1,141 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class InterfaceUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule InterfaceUsageDeclaration + /// InterfaceUsageDeclaration:InterfaceUsage=UsageDeclarationValuePart?('connect'InterfacePart)?|InterfacePart + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildInterfaceUsageDeclaration(SysML2.NET.Core.POCO.Systems.Interfaces.IInterfaceUsage poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule InterfacePart + /// InterfacePart:InterfaceUsage=BinaryInterfacePart|NaryInterfacePart + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildInterfacePart(SysML2.NET.Core.POCO.Systems.Interfaces.IInterfaceUsage poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule BinaryInterfacePart + /// BinaryInterfacePart:InterfaceUsage=ownedRelationship+=InterfaceEndMember'to'ownedRelationship+=InterfaceEndMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildBinaryInterfacePart(SysML2.NET.Core.POCO.Systems.Interfaces.IInterfaceUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfEndFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append("to "); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule NaryInterfacePart + /// NaryInterfacePart:InterfaceUsage='('ownedRelationship+=InterfaceEndMember','ownedRelationship+=InterfaceEndMember(','ownedRelationship+=InterfaceEndMember)*')' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildNaryInterfacePart(SysML2.NET.Core.POCO.Systems.Interfaces.IInterfaceUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfEndFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + stringBuilder.Append("("); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append(","); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } + + while (ownedRelationshipOfEndFeatureMembershipIterator.MoveNext()) + { + stringBuilder.Append(","); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } + + } + stringBuilder.Append(")"); + + } + + /// + /// Builds the Textual Notation string for the rule InterfaceUsage + /// InterfaceUsage=OccurrenceUsagePrefix'interface'InterfaceUsageDeclarationInterfaceBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildInterfaceUsage(SysML2.NET.Core.POCO.Systems.Interfaces.IInterfaceUsage poco, StringBuilder stringBuilder) + { + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + stringBuilder.Append("interface "); + BuildInterfaceUsageDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildInterfaceBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IntersectingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IntersectingTextualNotationBuilder.cs new file mode 100644 index 000000000..e34439398 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IntersectingTextualNotationBuilder.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class IntersectingTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule Intersecting + /// Intersecting=intersectingType=[QualifiedName]|ownedRelatedElement+=OwnedFeatureChain + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildIntersecting(SysML2.NET.Core.POCO.Core.Types.IIntersecting poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs new file mode 100644 index 000000000..c96cd1f2f --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs @@ -0,0 +1,71 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class InvariantTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule Invariant + /// Invariant=FeaturePrefix'inv'('true'|isNegated?='false')?FeatureDeclarationValuePart?FunctionBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildInvariant(SysML2.NET.Core.POCO.Kernel.Functions.IInvariant poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + + while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + { + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } + + } + + stringBuilder.Append("inv "); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + FeatureTextualNotationBuilder.BuildFeatureDeclaration(poco, stringBuilder); + FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + TypeTextualNotationBuilder.BuildFunctionBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs new file mode 100644 index 000000000..23af400c0 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs @@ -0,0 +1,102 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class InvocationExpressionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule FunctionOperationExpression + /// FunctionOperationExpression:InvocationExpression=ownedRelationship+=PrimaryArgumentMember'->'ownedRelationship+=InvocationTypeMember(ownedRelationship+=BodyArgumentMember|ownedRelationship+=FunctionReferenceArgumentMember|ArgumentList)ownedRelationship+=EmptyResultMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFunctionOperationExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IInvocationExpression poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfInvocationExpressionIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildPrimaryArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append("-> "); + ownedRelationshipOfInvocationExpressionIterator.MoveNext(); + + if (ownedRelationshipOfInvocationExpressionIterator.Current != null) + { + BuildInvocationTypeMember(ownedRelationshipOfInvocationExpressionIterator.Current, stringBuilder); + } + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) + { + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule InvocationExpression + /// InvocationExpression:InvocationExpression=ownedRelationship+=InstantiatedTypeMemberArgumentListownedRelationship+=EmptyResultMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildInvocationExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IInvocationExpression poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfMembershipIterator.MoveNext(); + + if (ownedRelationshipOfMembershipIterator.Current != null) + { + MembershipTextualNotationBuilder.BuildInstantiatedTypeMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + } + FeatureTextualNotationBuilder.BuildArgumentList(poco, stringBuilder); + ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) + { + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + } + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemDefinitionTextualNotationBuilder.cs new file mode 100644 index 000000000..20e3209d6 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemDefinitionTextualNotationBuilder.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ItemDefinitionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ItemDefinition + /// ItemDefinition=OccurrenceDefinitionPrefix'item''def'Definition + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildItemDefinition(SysML2.NET.Core.POCO.Systems.Items.IItemDefinition poco, StringBuilder stringBuilder) + { + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + stringBuilder.Append("item "); + stringBuilder.Append("def "); + DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..9e9772f7f --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemUsageTextualNotationBuilder.cs @@ -0,0 +1,55 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ItemUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ItemUsage + /// ItemUsage=OccurrenceUsagePrefix'item'Usage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildItemUsage(SysML2.NET.Core.POCO.Systems.Items.IItemUsage poco, StringBuilder stringBuilder) + { + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + stringBuilder.Append("item "); + UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/JoinNodeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/JoinNodeTextualNotationBuilder.cs new file mode 100644 index 000000000..e17813d2d --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/JoinNodeTextualNotationBuilder.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class JoinNodeTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule JoinNode + /// JoinNode=ControlNodePrefixisComposite?='join'UsageDeclarationActionBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildJoinNode(SysML2.NET.Core.POCO.Systems.Actions.IJoinNode poco, StringBuilder stringBuilder) + { + OccurrenceUsageTextualNotationBuilder.BuildControlNodePrefix(poco, stringBuilder); + stringBuilder.Append("join"); + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LibraryPackageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LibraryPackageTextualNotationBuilder.cs new file mode 100644 index 000000000..da98b0fe8 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LibraryPackageTextualNotationBuilder.cs @@ -0,0 +1,69 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class LibraryPackageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule LibraryPackage + /// LibraryPackage=(isStandard?='standard')'library'(ownedRelationship+=PrefixMetadataMember)*PackageDeclarationPackageBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildLibraryPackage(SysML2.NET.Core.POCO.Kernel.Packages.ILibraryPackage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + stringBuilder.Append("standard"); + + stringBuilder.Append(' '); + stringBuilder.Append("library "); + + while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + { + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } + + } + PackageTextualNotationBuilder.BuildPackageDeclaration(poco, stringBuilder); + PackageTextualNotationBuilder.BuildPackageBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralBooleanTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralBooleanTextualNotationBuilder.cs new file mode 100644 index 000000000..3179d4426 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralBooleanTextualNotationBuilder.cs @@ -0,0 +1,53 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class LiteralBooleanTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule LiteralBoolean + /// LiteralBoolean=value=BooleanValue + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildLiteralBoolean(SysML2.NET.Core.POCO.Kernel.Expressions.ILiteralBoolean poco, StringBuilder stringBuilder) + { + stringBuilder.Append(poco.Value.ToString().ToLower()); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralExpressionTextualNotationBuilder.cs new file mode 100644 index 000000000..21ab5ec6c --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralExpressionTextualNotationBuilder.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class LiteralExpressionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule LiteralExpression + /// LiteralExpression=LiteralBoolean|LiteralString|LiteralInteger|LiteralReal|LiteralInfinity + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildLiteralExpression(SysML2.NET.Core.POCO.Kernel.Expressions.ILiteralExpression poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralInfinityTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralInfinityTextualNotationBuilder.cs new file mode 100644 index 000000000..e877fdf13 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralInfinityTextualNotationBuilder.cs @@ -0,0 +1,53 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class LiteralInfinityTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule LiteralInfinity + /// LiteralInfinity='*' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildLiteralInfinity(SysML2.NET.Core.POCO.Kernel.Expressions.ILiteralInfinity poco, StringBuilder stringBuilder) + { + stringBuilder.Append("*"); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralIntegerTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralIntegerTextualNotationBuilder.cs new file mode 100644 index 000000000..55e8bf07f --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralIntegerTextualNotationBuilder.cs @@ -0,0 +1,53 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class LiteralIntegerTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule LiteralInteger + /// LiteralInteger=value=DECIMAL_VALUE + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildLiteralInteger(SysML2.NET.Core.POCO.Kernel.Expressions.ILiteralInteger poco, StringBuilder stringBuilder) + { + stringBuilder.Append(poco.Value.ToString()); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralStringTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralStringTextualNotationBuilder.cs new file mode 100644 index 000000000..4e1731783 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralStringTextualNotationBuilder.cs @@ -0,0 +1,53 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class LiteralStringTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule LiteralString + /// LiteralString=value=STRING_VALUE + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildLiteralString(SysML2.NET.Core.POCO.Kernel.Expressions.ILiteralString poco, StringBuilder stringBuilder) + { + stringBuilder.Append(poco.Value); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipExposeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipExposeTextualNotationBuilder.cs new file mode 100644 index 000000000..76ef4447c --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipExposeTextualNotationBuilder.cs @@ -0,0 +1,53 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class MembershipExposeTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule MembershipExpose + /// MembershipExpose=MembershipImport + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildMembershipExpose(SysML2.NET.Core.POCO.Systems.Views.IMembershipExpose poco, StringBuilder stringBuilder) + { + MembershipImportTextualNotationBuilder.BuildMembershipImport(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.cs new file mode 100644 index 000000000..253583cf9 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.cs @@ -0,0 +1,66 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class MembershipImportTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule MembershipImport + /// MembershipImport=importedMembership=[QualifiedName]('::'isRecursive?='**')? + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildMembershipImport(SysML2.NET.Core.POCO.Root.Namespaces.IMembershipImport poco, StringBuilder stringBuilder) + { + + if (poco.ImportedMembership != null) + { + stringBuilder.Append(poco.ImportedMembership.qualifiedName); + stringBuilder.Append(' '); + } + + if (poco.IsRecursive) + { + stringBuilder.Append(":: "); + stringBuilder.Append("**"); + stringBuilder.Append(' '); + } + + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs new file mode 100644 index 000000000..3d03d1719 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs @@ -0,0 +1,164 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class MembershipTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule MemberPrefix + /// MemberPrefix:Membership=(visibility=VisibilityIndicator)? + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildMemberPrefix(SysML2.NET.Core.POCO.Root.Namespaces.IMembership poco, StringBuilder stringBuilder) + { + + if (poco.Visibility != SysML2.NET.Core.Root.Namespaces.VisibilityKind.Public) + { + stringBuilder.Append(poco.Visibility.ToString().ToLower()); + stringBuilder.Append(' '); + } + + + } + + /// + /// Builds the Textual Notation string for the rule AliasMember + /// AliasMember:Membership=MemberPrefix'alias'('<'memberShortName=NAME'>')?(memberName=NAME)?'for'memberElement=[QualifiedName]RelationshipBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildAliasMember(SysML2.NET.Core.POCO.Root.Namespaces.IMembership poco, StringBuilder stringBuilder) + { + BuildMemberPrefix(poco, stringBuilder); + stringBuilder.Append("alias "); + + if (!string.IsNullOrWhiteSpace(poco.MemberShortName)) + { + stringBuilder.Append("<"); + stringBuilder.Append(poco.MemberShortName); + stringBuilder.Append(">"); + stringBuilder.Append(' '); + } + + + if (!string.IsNullOrWhiteSpace(poco.MemberName)) + { + stringBuilder.Append(poco.MemberName); + stringBuilder.Append(' '); + } + + stringBuilder.Append("for "); + + if (poco.MemberElement != null) + { + stringBuilder.Append(poco.MemberElement.qualifiedName); + stringBuilder.Append(' '); + } + RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule FeatureChainMember + /// FeatureChainMember:Membership=memberElement=[QualifiedName]|OwnedFeatureChainMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFeatureChainMember(SysML2.NET.Core.POCO.Root.Namespaces.IMembership poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule FeatureReferenceMember + /// FeatureReferenceMember:Membership=memberElement=FeatureReference + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFeatureReferenceMember(SysML2.NET.Core.POCO.Root.Namespaces.IMembership poco, StringBuilder stringBuilder) + { + + if (poco.MemberElement != null) + { + stringBuilder.Append(poco.qualifiedName); + stringBuilder.Append(' '); + + } + + } + + /// + /// Builds the Textual Notation string for the rule ElementReferenceMember + /// ElementReferenceMember:Membership=memberElement=[QualifiedName] + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildElementReferenceMember(SysML2.NET.Core.POCO.Root.Namespaces.IMembership poco, StringBuilder stringBuilder) + { + + if (poco.MemberElement != null) + { + stringBuilder.Append(poco.MemberElement.qualifiedName); + stringBuilder.Append(' '); + } + + } + + /// + /// Builds the Textual Notation string for the rule InstantiatedTypeMember + /// InstantiatedTypeMember:Membership=memberElement=InstantiatedTypeReference|OwnedFeatureChainMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildInstantiatedTypeMember(SysML2.NET.Core.POCO.Root.Namespaces.IMembership poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule MetadataBodyElement + /// MetadataBodyElement:Membership=NonFeatureMember|MetadataBodyFeatureMember|AliasMember|Import + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildMetadataBodyElement(SysML2.NET.Core.POCO.Root.Namespaces.IMembership poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MergeNodeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MergeNodeTextualNotationBuilder.cs new file mode 100644 index 000000000..d499a57c3 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MergeNodeTextualNotationBuilder.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class MergeNodeTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule MergeNode + /// MergeNode=ControlNodePrefixisComposite?='merge'UsageDeclarationActionBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildMergeNode(SysML2.NET.Core.POCO.Systems.Actions.IMergeNode poco, StringBuilder stringBuilder) + { + OccurrenceUsageTextualNotationBuilder.BuildControlNodePrefix(poco, stringBuilder); + stringBuilder.Append("merge"); + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetaclassTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetaclassTextualNotationBuilder.cs new file mode 100644 index 000000000..54c203f6d --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetaclassTextualNotationBuilder.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class MetaclassTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule Metaclass + /// Metaclass=TypePrefix'metaclass'ClassifierDeclarationTypeBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildMetaclass(SysML2.NET.Core.POCO.Kernel.Metadata.IMetaclass poco, StringBuilder stringBuilder) + { + TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); + stringBuilder.Append("metaclass "); + ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataAccessExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataAccessExpressionTextualNotationBuilder.cs new file mode 100644 index 000000000..2a6fbfecd --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataAccessExpressionTextualNotationBuilder.cs @@ -0,0 +1,79 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class MetadataAccessExpressionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule MetadataReference + /// MetadataReference:MetadataAccessExpression=ownedRelationship+=ElementReferenceMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildMetadataReference(SysML2.NET.Core.POCO.Kernel.Expressions.IMetadataAccessExpression poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfMembershipIterator.MoveNext(); + + if (ownedRelationshipOfMembershipIterator.Current != null) + { + MembershipTextualNotationBuilder.BuildElementReferenceMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule MetadataAccessExpression + /// MetadataAccessExpression=ownedRelationship+=ElementReferenceMember'.''metadata' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildMetadataAccessExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IMetadataAccessExpression poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfMembershipIterator.MoveNext(); + + if (ownedRelationshipOfMembershipIterator.Current != null) + { + MembershipTextualNotationBuilder.BuildElementReferenceMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append("."); + stringBuilder.Append("metadata "); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.cs new file mode 100644 index 000000000..191d42687 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.cs @@ -0,0 +1,63 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class MetadataDefinitionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule MetadataDefinition + /// MetadataDefinition=(isAbstract?='abstract')?DefinitionExtensionKeyword*'metadata''def'Definition + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildMetadataDefinition(SysML2.NET.Core.POCO.Systems.Metadata.IMetadataDefinition poco, StringBuilder stringBuilder) + { + + if (poco.IsAbstract) + { + stringBuilder.Append("abstract"); + stringBuilder.Append(' '); + } + + DefinitionTextualNotationBuilder.BuildDefinitionExtensionKeyword(poco, stringBuilder); + stringBuilder.Append("metadata "); + stringBuilder.Append("def "); + DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs new file mode 100644 index 000000000..e96c9a6de --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs @@ -0,0 +1,136 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class MetadataFeatureTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule PrefixMetadataFeature + /// PrefixMetadataFeature:MetadataFeature=ownedRelationship+=OwnedFeatureTyping + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildPrefixMetadataFeature(SysML2.NET.Core.POCO.Kernel.Metadata.IMetadataFeature poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfFeatureTypingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureTypingIterator.MoveNext(); + + if (ownedRelationshipOfFeatureTypingIterator.Current != null) + { + FeatureTypingTextualNotationBuilder.BuildOwnedFeatureTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule MetadataFeatureDeclaration + /// MetadataFeatureDeclaration:MetadataFeature=(Identification(':'|'typed''by'))?ownedRelationship+=OwnedFeatureTyping + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildMetadataFeatureDeclaration(SysML2.NET.Core.POCO.Kernel.Metadata.IMetadataFeature poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfFeatureTypingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + + if (BuildGroupConditionForMetadataFeatureDeclaration(poco)) + { + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + stringBuilder.Append(' '); + } + + ownedRelationshipOfFeatureTypingIterator.MoveNext(); + + if (ownedRelationshipOfFeatureTypingIterator.Current != null) + { + FeatureTypingTextualNotationBuilder.BuildOwnedFeatureTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule MetadataFeature + /// MetadataFeature=(ownedRelationship+=PrefixMetadataMember)*('@'|'metadata')MetadataFeatureDeclaration('about'ownedRelationship+=Annotation(','ownedRelationship+=Annotation)*)?MetadataBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildMetadataFeature(SysML2.NET.Core.POCO.Kernel.Metadata.IMetadataFeature poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfAnnotationIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + + while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + { + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } + + } + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + BuildMetadataFeatureDeclaration(poco, stringBuilder); + + if (ownedRelationshipOfAnnotationIterator.MoveNext()) + { + stringBuilder.Append("about "); + + if (ownedRelationshipOfAnnotationIterator.Current != null) + { + AnnotationTextualNotationBuilder.BuildAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + } + + while (ownedRelationshipOfAnnotationIterator.MoveNext()) + { + stringBuilder.Append(","); + + if (ownedRelationshipOfAnnotationIterator.Current != null) + { + AnnotationTextualNotationBuilder.BuildAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + } + + } + stringBuilder.Append(' '); + } + + TypeTextualNotationBuilder.BuildMetadataBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..168ac253c --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs @@ -0,0 +1,126 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class MetadataUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule PrefixMetadataUsage + /// PrefixMetadataUsage:MetadataUsage=ownedRelationship+=OwnedFeatureTyping + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildPrefixMetadataUsage(SysML2.NET.Core.POCO.Systems.Metadata.IMetadataUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfFeatureTypingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureTypingIterator.MoveNext(); + + if (ownedRelationshipOfFeatureTypingIterator.Current != null) + { + FeatureTypingTextualNotationBuilder.BuildOwnedFeatureTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule MetadataUsageDeclaration + /// MetadataUsageDeclaration:MetadataUsage=(Identification(':'|'typed''by'))?ownedRelationship+=OwnedFeatureTyping + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildMetadataUsageDeclaration(SysML2.NET.Core.POCO.Systems.Metadata.IMetadataUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfFeatureTypingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + + if (BuildGroupConditionForMetadataUsageDeclaration(poco)) + { + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + stringBuilder.Append(' '); + } + + ownedRelationshipOfFeatureTypingIterator.MoveNext(); + + if (ownedRelationshipOfFeatureTypingIterator.Current != null) + { + FeatureTypingTextualNotationBuilder.BuildOwnedFeatureTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule MetadataUsage + /// MetadataUsage=UsageExtensionKeyword*('@'|'metadata')MetadataUsageDeclaration('about'ownedRelationship+=Annotation(','ownedRelationship+=Annotation)*)?MetadataBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildMetadataUsage(SysML2.NET.Core.POCO.Systems.Metadata.IMetadataUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfAnnotationIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, stringBuilder); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + BuildMetadataUsageDeclaration(poco, stringBuilder); + + if (ownedRelationshipOfAnnotationIterator.MoveNext()) + { + stringBuilder.Append("about "); + + if (ownedRelationshipOfAnnotationIterator.Current != null) + { + AnnotationTextualNotationBuilder.BuildAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + } + + while (ownedRelationshipOfAnnotationIterator.MoveNext()) + { + stringBuilder.Append(","); + + if (ownedRelationshipOfAnnotationIterator.Current != null) + { + AnnotationTextualNotationBuilder.BuildAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + } + + } + stringBuilder.Append(' '); + } + + TypeTextualNotationBuilder.BuildMetadataBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityRangeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityRangeTextualNotationBuilder.cs new file mode 100644 index 000000000..dffe2bee1 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityRangeTextualNotationBuilder.cs @@ -0,0 +1,117 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class MultiplicityRangeTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule OwnedMultiplicityRange + /// OwnedMultiplicityRange:MultiplicityRange=MultiplicityBounds + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildOwnedMultiplicityRange(SysML2.NET.Core.POCO.Kernel.Multiplicities.IMultiplicityRange poco, StringBuilder stringBuilder) + { + BuildMultiplicityBounds(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule MultiplicityBounds + /// MultiplicityBounds:MultiplicityRange='['(ownedRelationship+=MultiplicityExpressionMember'..')?ownedRelationship+=MultiplicityExpressionMember']' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildMultiplicityBounds(SysML2.NET.Core.POCO.Kernel.Multiplicities.IMultiplicityRange poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + stringBuilder.Append("["); + + if (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + { + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildMultiplicityExpressionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append(".. "); + stringBuilder.Append(' '); + } + + ownedRelationshipOfOwningMembershipIterator.MoveNext(); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildMultiplicityExpressionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append("]"); + + } + + /// + /// Builds the Textual Notation string for the rule MultiplicityRange + /// MultiplicityRange='['(ownedRelationship+=MultiplicityExpressionMember'..')?ownedRelationship+=MultiplicityExpressionMember']' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildMultiplicityRange(SysML2.NET.Core.POCO.Kernel.Multiplicities.IMultiplicityRange poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + stringBuilder.Append("["); + + if (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + { + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildMultiplicityExpressionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append(".. "); + stringBuilder.Append(' '); + } + + ownedRelationshipOfOwningMembershipIterator.MoveNext(); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildMultiplicityExpressionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append("]"); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityTextualNotationBuilder.cs new file mode 100644 index 000000000..a387ceec1 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityTextualNotationBuilder.cs @@ -0,0 +1,78 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class MultiplicityTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule EmptyMultiplicity + /// EmptyMultiplicity:Multiplicity={} + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildEmptyMultiplicity(SysML2.NET.Core.POCO.Core.Types.IMultiplicity poco, StringBuilder stringBuilder) + { + + } + + /// + /// Builds the Textual Notation string for the rule MultiplicitySubset + /// MultiplicitySubset:Multiplicity='multiplicity'IdentificationSubsetsTypeBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildMultiplicitySubset(SysML2.NET.Core.POCO.Core.Types.IMultiplicity poco, StringBuilder stringBuilder) + { + stringBuilder.Append("multiplicity "); + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + FeatureTextualNotationBuilder.BuildSubsets(poco, stringBuilder); + TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule Multiplicity + /// Multiplicity=MultiplicitySubset|MultiplicityRange + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildMultiplicity(SysML2.NET.Core.POCO.Core.Types.IMultiplicity poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceExposeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceExposeTextualNotationBuilder.cs new file mode 100644 index 000000000..f31c167ba --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceExposeTextualNotationBuilder.cs @@ -0,0 +1,53 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class NamespaceExposeTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule NamespaceExpose + /// NamespaceExpose=NamespaceImport + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildNamespaceExpose(SysML2.NET.Core.POCO.Systems.Views.INamespaceExpose poco, StringBuilder stringBuilder) + { + NamespaceImportTextualNotationBuilder.BuildNamespaceImport(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceImportTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceImportTextualNotationBuilder.cs new file mode 100644 index 000000000..e325221f2 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceImportTextualNotationBuilder.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class NamespaceImportTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule NamespaceImport + /// NamespaceImport=importedNamespace=[QualifiedName]'::''*'('::'isRecursive?='**')?|importedNamespace=FilterPackage{ownedRelatedElement+=importedNamespace} + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildNamespaceImport(SysML2.NET.Core.POCO.Root.Namespaces.INamespaceImport poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs new file mode 100644 index 000000000..07d4b473b --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs @@ -0,0 +1,112 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class NamespaceTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule RootNamespace + /// RootNamespace:Namespace=PackageBodyElement* + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildRootNamespace(SysML2.NET.Core.POCO.Root.Namespaces.INamespace poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + + } + + /// + /// Builds the Textual Notation string for the rule NamespaceDeclaration + /// NamespaceDeclaration:Namespace='namespace'Identification + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildNamespaceDeclaration(SysML2.NET.Core.POCO.Root.Namespaces.INamespace poco, StringBuilder stringBuilder) + { + stringBuilder.Append("namespace "); + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule NamespaceBody + /// NamespaceBody:Namespace=';'|'{'NamespaceBodyElement*'}' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildNamespaceBody(SysML2.NET.Core.POCO.Root.Namespaces.INamespace poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule NamespaceBodyElement + /// NamespaceBodyElement:Namespace=ownedRelationship+=NamespaceMember|ownedRelationship+=AliasMember|ownedRelationship+=Import + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildNamespaceBodyElement(SysML2.NET.Core.POCO.Root.Namespaces.INamespace poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule Namespace + /// Namespace=(ownedRelationship+=PrefixMetadataMember)*NamespaceDeclarationNamespaceBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildNamespace(SysML2.NET.Core.POCO.Root.Namespaces.INamespace poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + + while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + { + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } + + } + BuildNamespaceDeclaration(poco, stringBuilder); + BuildNamespaceBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NullExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NullExpressionTextualNotationBuilder.cs new file mode 100644 index 000000000..0b5aba454 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NullExpressionTextualNotationBuilder.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class NullExpressionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule NullExpression + /// NullExpression:NullExpression='null'|'('')' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildNullExpression(SysML2.NET.Core.POCO.Kernel.Expressions.INullExpression poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ObjectiveMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ObjectiveMembershipTextualNotationBuilder.cs new file mode 100644 index 000000000..7a6248213 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ObjectiveMembershipTextualNotationBuilder.cs @@ -0,0 +1,61 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ObjectiveMembershipTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ObjectiveMember + /// ObjectiveMember:ObjectiveMembership=MemberPrefix'objective'ownedRelatedElement+=ObjectiveRequirementUsage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildObjectiveMember(SysML2.NET.Core.POCO.Systems.Cases.IObjectiveMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfRequirementUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + stringBuilder.Append("objective "); + ownedRelatedElementOfRequirementUsageIterator.MoveNext(); + + if (ownedRelatedElementOfRequirementUsageIterator.Current != null) + { + RequirementUsageTextualNotationBuilder.BuildObjectiveRequirementUsage(ownedRelatedElementOfRequirementUsageIterator.Current, stringBuilder); + } + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs new file mode 100644 index 000000000..72c33c79a --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs @@ -0,0 +1,105 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class OccurrenceDefinitionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule OccurrenceDefinitionPrefix + /// OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildOccurrenceDefinitionPrefix(SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceDefinition poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + + if (poco.IsIndividual && ownedRelationshipOfOwningMembershipIterator.MoveNext()) + { + stringBuilder.Append("individual"); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildEmptyMultiplicityMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append(' '); + } + + DefinitionTextualNotationBuilder.BuildDefinitionExtensionKeyword(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule IndividualDefinition + /// IndividualDefinition:OccurrenceDefinition=BasicDefinitionPrefix?isIndividual?='individual'DefinitionExtensionKeyword*'def'DefinitionownedRelationship+=EmptyMultiplicityMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildIndividualDefinition(SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceDefinition poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append("individual"); + DefinitionTextualNotationBuilder.BuildDefinitionExtensionKeyword(poco, stringBuilder); + stringBuilder.Append("def "); + DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); + ownedRelationshipOfOwningMembershipIterator.MoveNext(); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildEmptyMultiplicityMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule OccurrenceDefinition + /// OccurrenceDefinition=OccurrenceDefinitionPrefix'occurrence''def'Definition + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildOccurrenceDefinition(SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceDefinition poco, StringBuilder stringBuilder) + { + BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + stringBuilder.Append("occurrence "); + stringBuilder.Append("def "); + DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..56dbad970 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs @@ -0,0 +1,149 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class OccurrenceUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule OccurrenceUsagePrefix + /// OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildOccurrenceUsagePrefix(SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceUsage poco, StringBuilder stringBuilder) + { + UsageTextualNotationBuilder.BuildBasicUsagePrefix(poco, stringBuilder); + + if (poco.IsIndividual) + { + stringBuilder.Append("individual"); + stringBuilder.Append(' '); + } + + + if (poco.PortionKind.HasValue) + { + stringBuilder.Append(poco.PortionKind.ToString().ToLower()); + // NonParsing Assignment Element : isPortion = true => Does not have to be process + stringBuilder.Append(' '); + } + + UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule IndividualUsage + /// IndividualUsage:OccurrenceUsage=BasicUsagePrefixisIndividual?='individual'UsageExtensionKeyword*Usage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildIndividualUsage(SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceUsage poco, StringBuilder stringBuilder) + { + UsageTextualNotationBuilder.BuildBasicUsagePrefix(poco, stringBuilder); + stringBuilder.Append("individual"); + UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, stringBuilder); + UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule PortionUsage + /// PortionUsage:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?portionKind=PortionKindUsageExtensionKeyword*Usage{isPortion=true} + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildPortionUsage(SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceUsage poco, StringBuilder stringBuilder) + { + UsageTextualNotationBuilder.BuildBasicUsagePrefix(poco, stringBuilder); + + if (poco.IsIndividual) + { + stringBuilder.Append("individual"); + stringBuilder.Append(' '); + } + + stringBuilder.Append(poco.PortionKind.ToString().ToLower()); + UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, stringBuilder); + UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); + // NonParsing Assignment Element : isPortion = true => Does not have to be process + + } + + /// + /// Builds the Textual Notation string for the rule ControlNodePrefix + /// ControlNodePrefix:OccurrenceUsage=RefPrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildControlNodePrefix(SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceUsage poco, StringBuilder stringBuilder) + { + UsageTextualNotationBuilder.BuildRefPrefix(poco, stringBuilder); + + if (poco.IsIndividual) + { + stringBuilder.Append("individual"); + stringBuilder.Append(' '); + } + + + if (poco.PortionKind.HasValue) + { + stringBuilder.Append(poco.PortionKind.ToString().ToLower()); + // NonParsing Assignment Element : isPortion = true => Does not have to be process + stringBuilder.Append(' '); + } + + UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule OccurrenceUsage + /// OccurrenceUsage=OccurrenceUsagePrefix'occurrence'Usage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildOccurrenceUsage(SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceUsage poco, StringBuilder stringBuilder) + { + BuildOccurrenceUsagePrefix(poco, stringBuilder); + stringBuilder.Append("occurrence "); + UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OperatorExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OperatorExpressionTextualNotationBuilder.cs new file mode 100644 index 000000000..d8fab4baa --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OperatorExpressionTextualNotationBuilder.cs @@ -0,0 +1,303 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class OperatorExpressionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ConditionalExpression + /// ConditionalExpression:OperatorExpression=operator='if'ownedRelationship+=ArgumentMember'?'ownedRelationship+=ArgumentExpressionMember'else'ownedRelationship+=ArgumentExpressionMemberownedRelationship+=EmptyResultMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildConditionalExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + stringBuilder.Append(poco.Operator); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append("?"); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildArgumentExpressionMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append("else "); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildArgumentExpressionMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) + { + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule ConditionalBinaryOperatorExpression + /// ConditionalBinaryOperatorExpression:OperatorExpression=ownedRelationship+=ArgumentMemberoperator=ConditionalBinaryOperatorownedRelationship+=ArgumentExpressionMemberownedRelationship+=EmptyResultMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildConditionalBinaryOperatorExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append(poco.Operator); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildArgumentExpressionMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) + { + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule BinaryOperatorExpression + /// BinaryOperatorExpression:OperatorExpression=ownedRelationship+=ArgumentMemberoperator=BinaryOperatorownedRelationship+=ArgumentMemberownedRelationship+=EmptyResultMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildBinaryOperatorExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append(poco.Operator); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) + { + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule UnaryOperatorExpression + /// UnaryOperatorExpression:OperatorExpression=operator=UnaryOperatorownedRelationship+=ArgumentMemberownedRelationship+=EmptyResultMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildUnaryOperatorExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + stringBuilder.Append(poco.Operator); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) + { + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule ClassificationExpression + /// ClassificationExpression:OperatorExpression=(ownedRelationship+=ArgumentMember)?(operator=ClassificationTestOperatorownedRelationship+=TypeReferenceMember|operator=CastOperatorownedRelationship+=TypeResultMember)ownedRelationship+=EmptyResultMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildClassificationExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipIterator = poco.OwnedRelationship.GetEnumerator(); + using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + + if (ownedRelationshipOfParameterMembershipIterator.MoveNext()) + { + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append(' '); + } + + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) + { + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule MetaclassificationExpression + /// MetaclassificationExpression:OperatorExpression=ownedRelationship+=MetadataArgumentMember(operator=ClassificationTestOperatorownedRelationship+=TypeReferenceMember|operator=MetaCastOperatorownedRelationship+=TypeResultMember)ownedRelationship+=EmptyResultMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildMetaclassificationExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipIterator = poco.OwnedRelationship.GetEnumerator(); + using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildMetadataArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) + { + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule ExtentExpression + /// ExtentExpression:OperatorExpression=operator='all'ownedRelationship+=TypeReferenceMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildExtentExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + stringBuilder.Append(poco.Operator); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildTypeReferenceMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule BracketExpression + /// BracketExpression:OperatorExpression=ownedRelationship+=PrimaryArgumentMemberoperator='['ownedRelationship+=SequenceExpressionListMember']' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildBracketExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildPrimaryArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append(poco.Operator); + ownedRelationshipOfFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + { + FeatureMembershipTextualNotationBuilder.BuildSequenceExpressionListMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append("]"); + + } + + /// + /// Builds the Textual Notation string for the rule SequenceOperatorExpression + /// SequenceOperatorExpression:OperatorExpression=ownedRelationship+=OwnedExpressionMemberoperator=','ownedRelationship+=SequenceExpressionListMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildSequenceOperatorExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + { + FeatureMembershipTextualNotationBuilder.BuildOwnedExpressionMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append(poco.Operator); + ownedRelationshipOfFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + { + FeatureMembershipTextualNotationBuilder.BuildSequenceExpressionListMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + } + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs new file mode 100644 index 000000000..5226443c0 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs @@ -0,0 +1,331 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class OwningMembershipTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule AnnotatingMember + /// AnnotatingMember:OwningMembership=ownedRelatedElement+=AnnotatingElement + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildAnnotatingMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfAnnotatingElementIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfAnnotatingElementIterator.MoveNext(); + + if (ownedRelatedElementOfAnnotatingElementIterator.Current != null) + { + AnnotatingElementTextualNotationBuilder.BuildAnnotatingElement(ownedRelatedElementOfAnnotatingElementIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule PackageMember + /// PackageMember:OwningMembership=MemberPrefix(ownedRelatedElement+=DefinitionElement|ownedRelatedElement=UsageElement) + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildPackageMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementIterator = poco.OwnedRelatedElement.GetEnumerator(); + using var ownedRelatedElementOfUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + + } + + /// + /// Builds the Textual Notation string for the rule DefinitionMember + /// DefinitionMember:OwningMembership=MemberPrefixownedRelatedElement+=DefinitionElement + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildDefinitionMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementIterator = poco.OwnedRelatedElement.GetEnumerator(); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + ownedRelatedElementIterator.MoveNext(); + + if (ownedRelatedElementIterator.Current != null) + { + ElementTextualNotationBuilder.BuildDefinitionElement(ownedRelatedElementIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule OwnedCrossFeatureMember + /// OwnedCrossFeatureMember:OwningMembership=ownedRelatedElement+=OwnedCrossFeature + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildOwnedCrossFeatureMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfReferenceUsageIterator.MoveNext(); + + if (ownedRelatedElementOfReferenceUsageIterator.Current != null) + { + ReferenceUsageTextualNotationBuilder.BuildOwnedCrossFeature(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule OwnedMultiplicity + /// OwnedMultiplicity:OwningMembership=ownedRelatedElement+=MultiplicityRange + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildOwnedMultiplicity(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfMultiplicityRangeIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfMultiplicityRangeIterator.MoveNext(); + + if (ownedRelatedElementOfMultiplicityRangeIterator.Current != null) + { + MultiplicityRangeTextualNotationBuilder.BuildMultiplicityRange(ownedRelatedElementOfMultiplicityRangeIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule MultiplicityExpressionMember + /// MultiplicityExpressionMember:OwningMembership=ownedRelatedElement+=(LiteralExpression|FeatureReferenceExpression) + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildMultiplicityExpressionMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Assigment of enumerable with non NonTerminalElement not supported yet"); + + } + + /// + /// Builds the Textual Notation string for the rule EmptyMultiplicityMember + /// EmptyMultiplicityMember:OwningMembership=ownedRelatedElement+=EmptyMultiplicity + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildEmptyMultiplicityMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfMultiplicityIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfMultiplicityIterator.MoveNext(); + + if (ownedRelatedElementOfMultiplicityIterator.Current != null) + { + MultiplicityTextualNotationBuilder.BuildEmptyMultiplicity(ownedRelatedElementOfMultiplicityIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule ConjugatedPortDefinitionMember + /// ConjugatedPortDefinitionMember:OwningMembership=ownedRelatedElement+=ConjugatedPortDefinition + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildConjugatedPortDefinitionMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfConjugatedPortDefinitionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfConjugatedPortDefinitionIterator.MoveNext(); + + if (ownedRelatedElementOfConjugatedPortDefinitionIterator.Current != null) + { + ConjugatedPortDefinitionTextualNotationBuilder.BuildConjugatedPortDefinition(ownedRelatedElementOfConjugatedPortDefinitionIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule OwnedCrossMultiplicityMember + /// OwnedCrossMultiplicityMember:OwningMembership=ownedRelatedElement+=OwnedCrossMultiplicity + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildOwnedCrossMultiplicityMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfFeatureIterator.MoveNext(); + + if (ownedRelatedElementOfFeatureIterator.Current != null) + { + FeatureTextualNotationBuilder.BuildOwnedCrossMultiplicity(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule OwnedFeatureChainMember + /// OwnedFeatureChainMember:OwningMembership=ownedRelatedElement+=OwnedFeatureChain + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildOwnedFeatureChainMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfFeatureIterator.MoveNext(); + + if (ownedRelatedElementOfFeatureIterator.Current != null) + { + FeatureTextualNotationBuilder.BuildOwnedFeatureChain(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule TransitionSuccessionMember + /// TransitionSuccessionMember:OwningMembership=ownedRelatedElement+=TransitionSuccession + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildTransitionSuccessionMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfSuccessionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfSuccessionIterator.MoveNext(); + + if (ownedRelatedElementOfSuccessionIterator.Current != null) + { + SuccessionTextualNotationBuilder.BuildTransitionSuccession(ownedRelatedElementOfSuccessionIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule PrefixMetadataMember + /// PrefixMetadataMember:OwningMembership='#'ownedRelatedElement=PrefixMetadataUsage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildPrefixMetadataMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfMetadataUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + stringBuilder.Append("#"); + ownedRelatedElementOfMetadataUsageIterator.MoveNext(); + + if (ownedRelatedElementOfMetadataUsageIterator.Current != null) + { + MetadataUsageTextualNotationBuilder.BuildPrefixMetadataUsage(ownedRelatedElementOfMetadataUsageIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule NamespaceMember + /// NamespaceMember:OwningMembership=NonFeatureMember|NamespaceFeatureMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildNamespaceMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule NonFeatureMember + /// NonFeatureMember:OwningMembership=MemberPrefixownedRelatedElement+=MemberElement + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildNonFeatureMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementIterator = poco.OwnedRelatedElement.GetEnumerator(); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + ownedRelatedElementIterator.MoveNext(); + + if (ownedRelatedElementIterator.Current != null) + { + ElementTextualNotationBuilder.BuildMemberElement(ownedRelatedElementIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule NamespaceFeatureMember + /// NamespaceFeatureMember:OwningMembership=MemberPrefixownedRelatedElement+=FeatureElement + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildNamespaceFeatureMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + ownedRelatedElementOfFeatureIterator.MoveNext(); + + if (ownedRelatedElementOfFeatureIterator.Current != null) + { + FeatureTextualNotationBuilder.BuildFeatureElement(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule FeatureMember + /// FeatureMember:OwningMembership=TypeFeatureMember|OwnedFeatureMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFeatureMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule TypeFeatureMember + /// TypeFeatureMember:OwningMembership=MemberPrefix'member'ownedRelatedElement+=FeatureElement + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildTypeFeatureMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + stringBuilder.Append("member "); + ownedRelatedElementOfFeatureIterator.MoveNext(); + + if (ownedRelatedElementOfFeatureIterator.Current != null) + { + FeatureTextualNotationBuilder.BuildFeatureElement(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + } + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs new file mode 100644 index 000000000..9f198a531 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs @@ -0,0 +1,130 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class PackageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule PackageDeclaration + /// PackageDeclaration:Package='package'Identification + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildPackageDeclaration(SysML2.NET.Core.POCO.Kernel.Packages.IPackage poco, StringBuilder stringBuilder) + { + stringBuilder.Append("package "); + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule PackageBody + /// PackageBody:Package=';'|'{'PackageBodyElement*'}' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildPackageBody(SysML2.NET.Core.POCO.Kernel.Packages.IPackage poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule PackageBodyElement + /// PackageBodyElement:Package=ownedRelationship+=PackageMember|ownedRelationship+=ElementFilterMember|ownedRelationship+=AliasMember|ownedRelationship+=Import + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildPackageBodyElement(SysML2.NET.Core.POCO.Kernel.Packages.IPackage poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule FilterPackage + /// FilterPackage:Package=ownedRelationship+=FilterPackageImport(ownedRelationship+=FilterPackageMember)+ + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFilterPackage(SysML2.NET.Core.POCO.Kernel.Packages.IPackage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfPackageIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfElementFilterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfPackageIterator.MoveNext(); + + if (ownedRelationshipOfPackageIterator.Current != null) + { + BuildFilterPackageImport(ownedRelationshipOfPackageIterator.Current, stringBuilder); + } + + while (ownedRelationshipOfElementFilterMembershipIterator.MoveNext()) + { + + if (ownedRelationshipOfElementFilterMembershipIterator.Current != null) + { + ElementFilterMembershipTextualNotationBuilder.BuildFilterPackageMember(ownedRelationshipOfElementFilterMembershipIterator.Current, stringBuilder); + } + + } + stringBuilder.Append(' '); + + } + + /// + /// Builds the Textual Notation string for the rule Package + /// Package=(ownedRelationship+=PrefixMetadataMember)*PackageDeclarationPackageBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildPackage(SysML2.NET.Core.POCO.Kernel.Packages.IPackage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + + while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + { + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } + + } + BuildPackageDeclaration(poco, stringBuilder); + BuildPackageBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ParameterMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ParameterMembershipTextualNotationBuilder.cs new file mode 100644 index 000000000..069f9a2f2 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ParameterMembershipTextualNotationBuilder.cs @@ -0,0 +1,317 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ParameterMembershipTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule MessageEventMember + /// MessageEventMember:ParameterMembership=ownedRelatedElement+=MessageEvent + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildMessageEventMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfEventOccurrenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfEventOccurrenceUsageIterator.MoveNext(); + + if (ownedRelatedElementOfEventOccurrenceUsageIterator.Current != null) + { + EventOccurrenceUsageTextualNotationBuilder.BuildMessageEvent(ownedRelatedElementOfEventOccurrenceUsageIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule PayloadParameterMember + /// PayloadParameterMember:ParameterMembership=ownedRelatedElement+=PayloadParameter + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildPayloadParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfReferenceUsageIterator.MoveNext(); + + if (ownedRelatedElementOfReferenceUsageIterator.Current != null) + { + ReferenceUsageTextualNotationBuilder.BuildPayloadParameter(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule ArgumentMember + /// ArgumentMember:ParameterMembership=ownedMemberParameter=Argument + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) + { + + if (poco.ownedMemberParameter != null) + { + FeatureTextualNotationBuilder.BuildArgument(poco.ownedMemberParameter, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule ArgumentExpressionMember + /// ArgumentExpressionMember:ParameterMembership=ownedRelatedElement+=ArgumentExpression + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildArgumentExpressionMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfFeatureIterator.MoveNext(); + + if (ownedRelatedElementOfFeatureIterator.Current != null) + { + FeatureTextualNotationBuilder.BuildArgumentExpression(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule NodeParameterMember + /// NodeParameterMember:ParameterMembership=ownedRelatedElement+=NodeParameter + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildNodeParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfReferenceUsageIterator.MoveNext(); + + if (ownedRelatedElementOfReferenceUsageIterator.Current != null) + { + ReferenceUsageTextualNotationBuilder.BuildNodeParameter(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule EmptyParameterMember + /// EmptyParameterMember:ParameterMembership=ownedRelatedElement+=EmptyUsage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildEmptyParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfReferenceUsageIterator.MoveNext(); + + if (ownedRelatedElementOfReferenceUsageIterator.Current != null) + { + ReferenceUsageTextualNotationBuilder.BuildEmptyUsage(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule AssignmentTargetMember + /// AssignmentTargetMember:ParameterMembership=ownedRelatedElement+=AssignmentTargetParameter + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildAssignmentTargetMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfReferenceUsageIterator.MoveNext(); + + if (ownedRelatedElementOfReferenceUsageIterator.Current != null) + { + ReferenceUsageTextualNotationBuilder.BuildAssignmentTargetParameter(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule ExpressionParameterMember + /// ExpressionParameterMember:ParameterMembership=ownedRelatedElement+=OwnedExpression + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildExpressionParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfExpressionIterator.MoveNext(); + + if (ownedRelatedElementOfExpressionIterator.Current != null) + { + ExpressionTextualNotationBuilder.BuildOwnedExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule ActionBodyParameterMember + /// ActionBodyParameterMember:ParameterMembership=ownedRelatedElement+=ActionBodyParameter + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildActionBodyParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfActionUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfActionUsageIterator.MoveNext(); + + if (ownedRelatedElementOfActionUsageIterator.Current != null) + { + ActionUsageTextualNotationBuilder.BuildActionBodyParameter(ownedRelatedElementOfActionUsageIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule IfNodeParameterMember + /// IfNodeParameterMember:ParameterMembership=ownedRelatedElement+=IfNode + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildIfNodeParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfIfActionUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfIfActionUsageIterator.MoveNext(); + + if (ownedRelatedElementOfIfActionUsageIterator.Current != null) + { + IfActionUsageTextualNotationBuilder.BuildIfNode(ownedRelatedElementOfIfActionUsageIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule MetadataArgumentMember + /// MetadataArgumentMember:ParameterMembership=ownedRelatedElement+=MetadataArgument + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildMetadataArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfFeatureIterator.MoveNext(); + + if (ownedRelatedElementOfFeatureIterator.Current != null) + { + FeatureTextualNotationBuilder.BuildMetadataArgument(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule TypeReferenceMember + /// TypeReferenceMember:ParameterMembership=ownedMemberFeature=TypeReference + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildTypeReferenceMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) + { + + if (poco.ownedMemberFeature != null) + { + FeatureTextualNotationBuilder.BuildTypeReference(poco.ownedMemberFeature, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule PrimaryArgumentMember + /// PrimaryArgumentMember:ParameterMembership=ownedMemberParameter=PrimaryArgument + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildPrimaryArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) + { + + if (poco.ownedMemberParameter != null) + { + FeatureTextualNotationBuilder.BuildPrimaryArgument(poco.ownedMemberParameter, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule NonFeatureChainPrimaryArgumentMember + /// NonFeatureChainPrimaryArgumentMember:ParameterMembership=ownedMemberParameter=PrimaryArgument + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildNonFeatureChainPrimaryArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) + { + + if (poco.ownedMemberParameter != null) + { + FeatureTextualNotationBuilder.BuildPrimaryArgument(poco.ownedMemberParameter, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule BodyArgumentMember + /// BodyArgumentMember:ParameterMembership=ownedMemberParameter=BodyArgument + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildBodyArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) + { + + if (poco.ownedMemberParameter != null) + { + FeatureTextualNotationBuilder.BuildBodyArgument(poco.ownedMemberParameter, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule FunctionReferenceArgumentMember + /// FunctionReferenceArgumentMember:ParameterMembership=ownedMemberParameter=FunctionReferenceArgument + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFunctionReferenceArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) + { + + if (poco.ownedMemberParameter != null) + { + FeatureTextualNotationBuilder.BuildFunctionReferenceArgument(poco.ownedMemberParameter, stringBuilder); + } + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartDefinitionTextualNotationBuilder.cs new file mode 100644 index 000000000..be495e173 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartDefinitionTextualNotationBuilder.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class PartDefinitionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule PartDefinition + /// PartDefinition=OccurrenceDefinitionPrefix'part''def'Definition + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildPartDefinition(SysML2.NET.Core.POCO.Systems.Parts.IPartDefinition poco, StringBuilder stringBuilder) + { + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + stringBuilder.Append("part "); + stringBuilder.Append("def "); + DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..f6869f2ed --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartUsageTextualNotationBuilder.cs @@ -0,0 +1,83 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class PartUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ActorUsage + /// ActorUsage:PartUsage='actor'UsageExtensionKeyword*Usage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildActorUsage(SysML2.NET.Core.POCO.Systems.Parts.IPartUsage poco, StringBuilder stringBuilder) + { + stringBuilder.Append("actor "); + UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, stringBuilder); + UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule StakeholderUsage + /// StakeholderUsage:PartUsage='stakeholder'UsageExtensionKeyword*Usage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildStakeholderUsage(SysML2.NET.Core.POCO.Systems.Parts.IPartUsage poco, StringBuilder stringBuilder) + { + stringBuilder.Append("stakeholder "); + UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, stringBuilder); + UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule PartUsage + /// PartUsage=OccurrenceUsagePrefix'part'Usage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildPartUsage(SysML2.NET.Core.POCO.Systems.Parts.IPartUsage poco, StringBuilder stringBuilder) + { + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + stringBuilder.Append("part "); + UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PayloadFeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PayloadFeatureTextualNotationBuilder.cs new file mode 100644 index 000000000..f237689fa --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PayloadFeatureTextualNotationBuilder.cs @@ -0,0 +1,53 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class PayloadFeatureTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule FlowPayloadFeature + /// FlowPayloadFeature:PayloadFeature=PayloadFeature + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFlowPayloadFeature(SysML2.NET.Core.POCO.Kernel.Interactions.IPayloadFeature poco, StringBuilder stringBuilder) + { + FeatureTextualNotationBuilder.BuildPayloadFeature(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PerformActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PerformActionUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..f3b0b9a71 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PerformActionUsageTextualNotationBuilder.cs @@ -0,0 +1,105 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class PerformActionUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule PerformActionUsageDeclaration + /// PerformActionUsageDeclaration:PerformActionUsage=(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'action'UsageDeclaration)ValuePart? + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildPerformActionUsageDeclaration(SysML2.NET.Core.POCO.Systems.Actions.IPerformActionUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfReferenceSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule StatePerformActionUsage + /// StatePerformActionUsage:PerformActionUsage=PerformActionUsageDeclarationActionBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildStatePerformActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IPerformActionUsage poco, StringBuilder stringBuilder) + { + BuildPerformActionUsageDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule TransitionPerformActionUsage + /// TransitionPerformActionUsage:PerformActionUsage=PerformActionUsageDeclaration('{'ActionBodyItem*'}')? + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildTransitionPerformActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IPerformActionUsage poco, StringBuilder stringBuilder) + { + BuildPerformActionUsageDeclaration(poco, stringBuilder); + + if (BuildGroupConditionForTransitionPerformActionUsage(poco)) + { + stringBuilder.Append("{"); + TypeTextualNotationBuilder.BuildActionBodyItem(poco, stringBuilder); + stringBuilder.Append("}"); + stringBuilder.Append(' '); + } + + + } + + /// + /// Builds the Textual Notation string for the rule PerformActionUsage + /// PerformActionUsage=OccurrenceUsagePrefix'perform'PerformActionUsageDeclarationActionBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildPerformActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IPerformActionUsage poco, StringBuilder stringBuilder) + { + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + stringBuilder.Append("perform "); + BuildPerformActionUsageDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortConjugationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortConjugationTextualNotationBuilder.cs new file mode 100644 index 000000000..ec8ddda96 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortConjugationTextualNotationBuilder.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class PortConjugationTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule PortConjugation + /// PortConjugation={} + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildPortConjugation(SysML2.NET.Core.POCO.Systems.Ports.IPortConjugation poco, StringBuilder stringBuilder) + { + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortDefinitionTextualNotationBuilder.cs new file mode 100644 index 000000000..f99f35791 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortDefinitionTextualNotationBuilder.cs @@ -0,0 +1,64 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class PortDefinitionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule PortDefinition + /// PortDefinition=DefinitionPrefix'port''def'DefinitionownedRelationship+=ConjugatedPortDefinitionMember{conjugatedPortDefinition.ownedPortConjugator.originalPortDefinition=this} + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildPortDefinition(SysML2.NET.Core.POCO.Systems.Ports.IPortDefinition poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + DefinitionTextualNotationBuilder.BuildDefinitionPrefix(poco, stringBuilder); + stringBuilder.Append("port "); + stringBuilder.Append("def "); + DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); + ownedRelationshipOfOwningMembershipIterator.MoveNext(); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildConjugatedPortDefinitionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } + // NonParsing Assignment Element : conjugatedPortDefinition.ownedPortConjugator.originalPortDefinition = this => Does not have to be process + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..540b1d236 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs @@ -0,0 +1,106 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class PortUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule DefaultInterfaceEnd + /// DefaultInterfaceEnd:PortUsage=isEnd?='end'Usage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildDefaultInterfaceEnd(SysML2.NET.Core.POCO.Systems.Ports.IPortUsage poco, StringBuilder stringBuilder) + { + stringBuilder.Append("end"); + UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule InterfaceEnd + /// InterfaceEnd:PortUsage=(ownedRelationship+=OwnedCrossMultiplicityMember)?(declaredName=NAMEREFERENCES)?ownedRelationship+=OwnedReferenceSubsetting + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildInterfaceEnd(SysML2.NET.Core.POCO.Systems.Ports.IPortUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfReferenceSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + + if (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + { + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildOwnedCrossMultiplicityMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append(' '); + } + + + if (!string.IsNullOrWhiteSpace(poco.DeclaredName)) + { + stringBuilder.Append(poco.DeclaredName); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + } + + ownedRelationshipOfReferenceSubsettingIterator.MoveNext(); + + if (ownedRelationshipOfReferenceSubsettingIterator.Current != null) + { + ReferenceSubsettingTextualNotationBuilder.BuildOwnedReferenceSubsetting(ownedRelationshipOfReferenceSubsettingIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule PortUsage + /// PortUsage=OccurrenceUsagePrefix'port'Usage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildPortUsage(SysML2.NET.Core.POCO.Systems.Ports.IPortUsage poco, StringBuilder stringBuilder) + { + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + stringBuilder.Append("port "); + UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortionKindTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortionKindTextualNotationBuilder.cs new file mode 100644 index 000000000..ff40e40e2 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortionKindTextualNotationBuilder.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class PortionKindTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule PortionKind + /// PortionKind='snapshot'|'timeslice' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildPortionKind(SysML2.NET.Core.Systems.Occurrences.PortionKind poco, StringBuilder stringBuilder) + { + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PredicateTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PredicateTextualNotationBuilder.cs new file mode 100644 index 000000000..f151f59da --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PredicateTextualNotationBuilder.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class PredicateTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule Predicate + /// Predicate=TypePrefix'predicate'ClassifierDeclarationFunctionBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildPredicate(SysML2.NET.Core.POCO.Kernel.Functions.IPredicate poco, StringBuilder stringBuilder) + { + TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); + stringBuilder.Append("predicate "); + ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildFunctionBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs new file mode 100644 index 000000000..4cb5deb25 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs @@ -0,0 +1,110 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class RedefinitionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule OwnedRedefinition + /// OwnedRedefinition:Redefinition=redefinedFeature=[QualifiedName]|redefinedFeature=OwnedFeatureChain{ownedRelatedElement+=redefinedFeature} + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildOwnedRedefinition(SysML2.NET.Core.POCO.Core.Features.IRedefinition poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule FlowFeatureRedefinition + /// FlowFeatureRedefinition:Redefinition=redefinedFeature=[QualifiedName] + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFlowFeatureRedefinition(SysML2.NET.Core.POCO.Core.Features.IRedefinition poco, StringBuilder stringBuilder) + { + + if (poco.RedefinedFeature != null) + { + stringBuilder.Append(poco.RedefinedFeature.qualifiedName); + stringBuilder.Append(' '); + } + + } + + /// + /// Builds the Textual Notation string for the rule ParameterRedefinition + /// ParameterRedefinition:Redefinition=redefinedFeature=[QualifiedName] + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildParameterRedefinition(SysML2.NET.Core.POCO.Core.Features.IRedefinition poco, StringBuilder stringBuilder) + { + + if (poco.RedefinedFeature != null) + { + stringBuilder.Append(poco.RedefinedFeature.qualifiedName); + stringBuilder.Append(' '); + } + + } + + /// + /// Builds the Textual Notation string for the rule Redefinition + /// Redefinition=('specialization'Identification)?'redefinition'SpecificTypeREDEFINESGeneralTypeRelationshipBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildRedefinition(SysML2.NET.Core.POCO.Core.Features.IRedefinition poco, StringBuilder stringBuilder) + { + + if (BuildGroupConditionForRedefinition(poco)) + { + stringBuilder.Append("specialization "); + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + stringBuilder.Append(' '); + } + + stringBuilder.Append("redefinition "); + SpecializationTextualNotationBuilder.BuildSpecificType(poco, stringBuilder); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + SpecializationTextualNotationBuilder.BuildGeneralType(poco, stringBuilder); + RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceSubsettingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceSubsettingTextualNotationBuilder.cs new file mode 100644 index 000000000..03dac04f5 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceSubsettingTextualNotationBuilder.cs @@ -0,0 +1,63 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ReferenceSubsettingTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule OwnedReferenceSubsetting + /// OwnedReferenceSubsetting:ReferenceSubsetting=referencedFeature=[QualifiedName]|referencedFeature=OwnedFeatureChain{ownedRelatedElement+=referenceFeature} + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildOwnedReferenceSubsetting(SysML2.NET.Core.POCO.Core.Features.IReferenceSubsetting poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule FlowEndSubsetting + /// FlowEndSubsetting:ReferenceSubsetting=referencedFeature=[QualifiedName]|referencedFeature=FeatureChainPrefix{ownedRelatedElement+=referencedFeature} + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFlowEndSubsetting(SysML2.NET.Core.POCO.Core.Features.IReferenceSubsetting poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..1e7a4cb14 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs @@ -0,0 +1,323 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ReferenceUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule OwnedCrossFeature + /// OwnedCrossFeature:ReferenceUsage=BasicUsagePrefixUsageDeclaration + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildOwnedCrossFeature(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) + { + UsageTextualNotationBuilder.BuildBasicUsagePrefix(poco, stringBuilder); + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule DefaultReferenceUsage + /// DefaultReferenceUsage:ReferenceUsage=RefPrefixUsage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildDefaultReferenceUsage(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) + { + UsageTextualNotationBuilder.BuildRefPrefix(poco, stringBuilder); + UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule VariantReference + /// VariantReference:ReferenceUsage=ownedRelationship+=OwnedReferenceSubsettingFeatureSpecialization*UsageBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildVariantReference(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfReferenceSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfReferenceSubsettingIterator.MoveNext(); + + if (ownedRelationshipOfReferenceSubsettingIterator.Current != null) + { + ReferenceSubsettingTextualNotationBuilder.BuildOwnedReferenceSubsetting(ownedRelationshipOfReferenceSubsettingIterator.Current, stringBuilder); + } + FeatureTextualNotationBuilder.BuildFeatureSpecialization(poco, stringBuilder); + UsageTextualNotationBuilder.BuildUsageBody(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule SourceEnd + /// SourceEnd:ReferenceUsage=(ownedRelationship+=OwnedMultiplicity)? + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildSourceEnd(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + + if (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + { + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildOwnedMultiplicity(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append(' '); + } + + + } + + /// + /// Builds the Textual Notation string for the rule ConnectorEnd + /// ConnectorEnd:ReferenceUsage=(ownedRelationship+=OwnedCrossMultiplicityMember)?(declaredName=NAMEREFERENCES)?ownedRelationship+=OwnedReferenceSubsetting + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildConnectorEnd(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfReferenceSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + + if (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + { + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildOwnedCrossMultiplicityMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append(' '); + } + + + if (!string.IsNullOrWhiteSpace(poco.DeclaredName)) + { + stringBuilder.Append(poco.DeclaredName); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + } + + ownedRelationshipOfReferenceSubsettingIterator.MoveNext(); + + if (ownedRelationshipOfReferenceSubsettingIterator.Current != null) + { + ReferenceSubsettingTextualNotationBuilder.BuildOwnedReferenceSubsetting(ownedRelationshipOfReferenceSubsettingIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule FlowFeature + /// FlowFeature:ReferenceUsage=ownedRelationship+=FlowFeatureRedefinition + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFlowFeature(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfRedefinitionIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfRedefinitionIterator.MoveNext(); + + if (ownedRelationshipOfRedefinitionIterator.Current != null) + { + RedefinitionTextualNotationBuilder.BuildFlowFeatureRedefinition(ownedRelationshipOfRedefinitionIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule PayloadParameter + /// PayloadParameter:ReferenceUsage=PayloadFeature|IdentificationPayloadFeatureSpecializationPart?TriggerValuePart + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildPayloadParameter(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule NodeParameter + /// NodeParameter:ReferenceUsage=ownedRelationship+=FeatureBinding + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildNodeParameter(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureValueIterator.MoveNext(); + + if (ownedRelationshipOfFeatureValueIterator.Current != null) + { + FeatureValueTextualNotationBuilder.BuildFeatureBinding(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule EmptyUsage + /// EmptyUsage:ReferenceUsage={} + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildEmptyUsage(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) + { + + } + + /// + /// Builds the Textual Notation string for the rule AssignmentTargetParameter + /// AssignmentTargetParameter:ReferenceUsage=(ownedRelationship+=AssignmentTargetBinding'.')? + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildAssignmentTargetParameter(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + + if (ownedRelationshipOfFeatureValueIterator.MoveNext()) + { + + if (ownedRelationshipOfFeatureValueIterator.Current != null) + { + FeatureValueTextualNotationBuilder.BuildAssignmentTargetBinding(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + } + stringBuilder.Append("."); + stringBuilder.Append(' '); + } + + + } + + /// + /// Builds the Textual Notation string for the rule ForVariableDeclaration + /// ForVariableDeclaration:ReferenceUsage=UsageDeclaration + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildForVariableDeclaration(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) + { + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule EmptyFeature + /// EmptyFeature:ReferenceUsage={} + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildEmptyFeature(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) + { + + } + + /// + /// Builds the Textual Notation string for the rule SubjectUsage + /// SubjectUsage:ReferenceUsage='subject'UsageExtensionKeyword*Usage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildSubjectUsage(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) + { + stringBuilder.Append("subject "); + UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, stringBuilder); + UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule SatisfactionParameter + /// SatisfactionParameter:ReferenceUsage=ownedRelationship+=SatisfactionFeatureValue + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildSatisfactionParameter(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureValueIterator.MoveNext(); + + if (ownedRelationshipOfFeatureValueIterator.Current != null) + { + FeatureValueTextualNotationBuilder.BuildSatisfactionFeatureValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule MetadataBodyUsage + /// MetadataBodyUsage:ReferenceUsage='ref'?(':>>'|'redefines')?ownedRelationship+=OwnedRedefinitionFeatureSpecializationPart?ValuePart?MetadataBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildMetadataBodyUsage(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfRedefinitionIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + stringBuilder.Append("ref "); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + ownedRelationshipOfRedefinitionIterator.MoveNext(); + + if (ownedRelationshipOfRedefinitionIterator.Current != null) + { + RedefinitionTextualNotationBuilder.BuildOwnedRedefinition(ownedRelationshipOfRedefinitionIterator.Current, stringBuilder); + } + FeatureTextualNotationBuilder.BuildFeatureSpecializationPart(poco, stringBuilder); + FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + TypeTextualNotationBuilder.BuildMetadataBody(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule ReferenceUsage + /// ReferenceUsage=(EndUsagePrefix|RefPrefix)'ref'Usage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildReferenceUsage(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + stringBuilder.Append("ref "); + UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RelationshipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RelationshipTextualNotationBuilder.cs new file mode 100644 index 000000000..922ae2535 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RelationshipTextualNotationBuilder.cs @@ -0,0 +1,63 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class RelationshipTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule RelationshipBody + /// RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildRelationshipBody(SysML2.NET.Core.POCO.Root.Elements.IRelationship poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule RelationshipOwnedElement + /// RelationshipOwnedElement:Relationship=ownedRelatedElement+=OwnedRelatedElement|ownedRelationship+=OwnedAnnotation + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildRelationshipOwnedElement(SysML2.NET.Core.POCO.Root.Elements.IRelationship poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingDefinitionTextualNotationBuilder.cs new file mode 100644 index 000000000..50209fc80 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingDefinitionTextualNotationBuilder.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class RenderingDefinitionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule RenderingDefinition + /// RenderingDefinition=OccurrenceDefinitionPrefix'rendering''def'Definition + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildRenderingDefinition(SysML2.NET.Core.POCO.Systems.Views.IRenderingDefinition poco, StringBuilder stringBuilder) + { + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + stringBuilder.Append("rendering "); + stringBuilder.Append("def "); + DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..5835570f8 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingUsageTextualNotationBuilder.cs @@ -0,0 +1,66 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class RenderingUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ViewRenderingUsage + /// ViewRenderingUsage:RenderingUsage=ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?UsageBody|(UsageExtensionKeyword*'rendering'|UsageExtensionKeyword+)Usage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildViewRenderingUsage(SysML2.NET.Core.POCO.Systems.Views.IRenderingUsage poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule RenderingUsage + /// RenderingUsage=OccurrenceUsagePrefix'rendering'Usage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildRenderingUsage(SysML2.NET.Core.POCO.Systems.Views.IRenderingUsage poco, StringBuilder stringBuilder) + { + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + stringBuilder.Append("rendering "); + UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.cs new file mode 100644 index 000000000..6bc28e376 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.cs @@ -0,0 +1,72 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class RequirementConstraintMembershipTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule RequirementConstraintMember + /// RequirementConstraintMember:RequirementConstraintMembership=MemberPrefix?RequirementKindownedRelatedElement+=RequirementConstraintUsage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildRequirementConstraintMember(SysML2.NET.Core.POCO.Systems.Requirements.IRequirementConstraintMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfConstraintUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + BuildRequirementKind(poco, stringBuilder); + ownedRelatedElementOfConstraintUsageIterator.MoveNext(); + + if (ownedRelatedElementOfConstraintUsageIterator.Current != null) + { + ConstraintUsageTextualNotationBuilder.BuildRequirementConstraintUsage(ownedRelatedElementOfConstraintUsageIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule RequirementKind + /// RequirementKind:RequirementConstraintMembership='assume'{kind='assumption'}|'require'{kind='requirement'} + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildRequirementKind(SysML2.NET.Core.POCO.Systems.Requirements.IRequirementConstraintMembership poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementDefinitionTextualNotationBuilder.cs new file mode 100644 index 000000000..df6dc74d3 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementDefinitionTextualNotationBuilder.cs @@ -0,0 +1,57 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class RequirementDefinitionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule RequirementDefinition + /// RequirementDefinition=OccurrenceDefinitionPrefix'requirement''def'DefinitionDeclarationRequirementBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildRequirementDefinition(SysML2.NET.Core.POCO.Systems.Requirements.IRequirementDefinition poco, StringBuilder stringBuilder) + { + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + stringBuilder.Append("requirement "); + stringBuilder.Append("def "); + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildRequirementBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..6afde8fdc --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementUsageTextualNotationBuilder.cs @@ -0,0 +1,81 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class RequirementUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ObjectiveRequirementUsage + /// ObjectiveRequirementUsage:RequirementUsage=UsageExtensionKeyword*ConstraintUsageDeclarationRequirementBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildObjectiveRequirementUsage(SysML2.NET.Core.POCO.Systems.Requirements.IRequirementUsage poco, StringBuilder stringBuilder) + { + UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, stringBuilder); + ConstraintUsageTextualNotationBuilder.BuildConstraintUsageDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildRequirementBody(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule RequirementVerificationUsage + /// RequirementVerificationUsage:RequirementUsage=ownedRelationship+=OwnedReferenceSubsettingFeatureSpecialization*RequirementBody|(UsageExtensionKeyword*'requirement'|UsageExtensionKeyword+)ConstraintUsageDeclarationRequirementBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildRequirementVerificationUsage(SysML2.NET.Core.POCO.Systems.Requirements.IRequirementUsage poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule RequirementUsage + /// RequirementUsage=OccurrenceUsagePrefix'requirement'ConstraintUsageDeclarationRequirementBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildRequirementUsage(SysML2.NET.Core.POCO.Systems.Requirements.IRequirementUsage poco, StringBuilder stringBuilder) + { + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + stringBuilder.Append("requirement "); + ConstraintUsageTextualNotationBuilder.BuildConstraintUsageDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildRequirementBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementVerificationMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementVerificationMembershipTextualNotationBuilder.cs new file mode 100644 index 000000000..9fc0e3093 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementVerificationMembershipTextualNotationBuilder.cs @@ -0,0 +1,62 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class RequirementVerificationMembershipTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule RequirementVerificationMember + /// RequirementVerificationMember:RequirementVerificationMembership=MemberPrefix'verify'{kind='requirement'}ownedRelatedElement+=RequirementVerificationUsage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildRequirementVerificationMember(SysML2.NET.Core.POCO.Systems.VerificationCases.IRequirementVerificationMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfRequirementUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + stringBuilder.Append("verify "); + // NonParsing Assignment Element : kind = 'requirement' => Does not have to be process + ownedRelatedElementOfRequirementUsageIterator.MoveNext(); + + if (ownedRelatedElementOfRequirementUsageIterator.Current != null) + { + RequirementUsageTextualNotationBuilder.BuildRequirementVerificationUsage(ownedRelatedElementOfRequirementUsageIterator.Current, stringBuilder); + } + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ResultExpressionMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ResultExpressionMembershipTextualNotationBuilder.cs new file mode 100644 index 000000000..aa2417e87 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ResultExpressionMembershipTextualNotationBuilder.cs @@ -0,0 +1,60 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ResultExpressionMembershipTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ResultExpressionMember + /// ResultExpressionMember:ResultExpressionMembership=MemberPrefix?ownedRelatedElement+=OwnedExpression + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildResultExpressionMember(SysML2.NET.Core.POCO.Kernel.Functions.IResultExpressionMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + ownedRelatedElementOfExpressionIterator.MoveNext(); + + if (ownedRelatedElementOfExpressionIterator.Current != null) + { + ExpressionTextualNotationBuilder.BuildOwnedExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); + } + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReturnParameterMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReturnParameterMembershipTextualNotationBuilder.cs new file mode 100644 index 000000000..1daf515f2 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReturnParameterMembershipTextualNotationBuilder.cs @@ -0,0 +1,117 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ReturnParameterMembershipTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ReturnParameterMember + /// ReturnParameterMember:ReturnParameterMembership=MemberPrefix?'return'ownedRelatedElement+=UsageElement + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildReturnParameterMember(SysML2.NET.Core.POCO.Kernel.Functions.IReturnParameterMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + stringBuilder.Append("return "); + ownedRelatedElementOfUsageIterator.MoveNext(); + + if (ownedRelatedElementOfUsageIterator.Current != null) + { + UsageTextualNotationBuilder.BuildUsageElement(ownedRelatedElementOfUsageIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule ReturnFeatureMember + /// ReturnFeatureMember:ReturnParameterMembership=MemberPrefix'return'ownedRelatedElement+=FeatureElement + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildReturnFeatureMember(SysML2.NET.Core.POCO.Kernel.Functions.IReturnParameterMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + stringBuilder.Append("return "); + ownedRelatedElementOfFeatureIterator.MoveNext(); + + if (ownedRelatedElementOfFeatureIterator.Current != null) + { + FeatureTextualNotationBuilder.BuildFeatureElement(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule EmptyResultMember + /// EmptyResultMember:ReturnParameterMembership=ownedRelatedElement+=EmptyFeature + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildEmptyResultMember(SysML2.NET.Core.POCO.Kernel.Functions.IReturnParameterMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfReferenceUsageIterator.MoveNext(); + + if (ownedRelatedElementOfReferenceUsageIterator.Current != null) + { + ReferenceUsageTextualNotationBuilder.BuildEmptyFeature(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule ConstructorResultMember + /// ConstructorResultMember:ReturnParameterMembership=ownedRelatedElement+=ConstructorResult + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildConstructorResultMember(SysML2.NET.Core.POCO.Kernel.Functions.IReturnParameterMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfFeatureIterator.MoveNext(); + + if (ownedRelatedElementOfFeatureIterator.Current != null) + { + FeatureTextualNotationBuilder.BuildConstructorResult(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + } + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..20dab2911 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.cs @@ -0,0 +1,76 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class SatisfyRequirementUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule SatisfyRequirementUsage + /// SatisfyRequirementUsage=OccurrenceUsagePrefix'assert'(isNegated?='not')'satisfy'(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'requirement'UsageDeclaration)ValuePart?('by'ownedRelationship+=SatisfactionSubjectMember)?RequirementBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildSatisfyRequirementUsage(SysML2.NET.Core.POCO.Systems.Requirements.ISatisfyRequirementUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfReferenceSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfSubjectMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + stringBuilder.Append("assert "); + stringBuilder.Append("not"); + + stringBuilder.Append(' '); + stringBuilder.Append("satisfy "); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + + if (ownedRelationshipOfSubjectMembershipIterator.MoveNext()) + { + stringBuilder.Append("by "); + + if (ownedRelationshipOfSubjectMembershipIterator.Current != null) + { + SubjectMembershipTextualNotationBuilder.BuildSatisfactionSubjectMember(ownedRelationshipOfSubjectMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append(' '); + } + + TypeTextualNotationBuilder.BuildRequirementBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SelectExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SelectExpressionTextualNotationBuilder.cs new file mode 100644 index 000000000..c0276adc3 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SelectExpressionTextualNotationBuilder.cs @@ -0,0 +1,66 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class SelectExpressionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule SelectExpression + /// SelectExpression=ownedRelationship+=PrimaryArgumentMember'.?'ownedRelationship+=BodyArgumentMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildSelectExpression(SysML2.NET.Core.POCO.Kernel.Expressions.ISelectExpression poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildPrimaryArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append(".? "); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildBodyArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..f319cd254 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.cs @@ -0,0 +1,124 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class SendActionUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule SendNode + /// SendNode:SendActionUsage=OccurrenceUsagePrefixActionUsageDeclaration?'send'(ownedRelationship+=NodeParameterMemberSenderReceiverPart?|ownedRelationship+=EmptyParameterMemberSenderReceiverPart)?ActionBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildSendNode(SysML2.NET.Core.POCO.Systems.Actions.ISendActionUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + ActionUsageTextualNotationBuilder.BuildActionUsageDeclaration(poco, stringBuilder); + stringBuilder.Append("send "); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule SendNodeDeclaration + /// SendNodeDeclaration:SendActionUsage=ActionNodeUsageDeclaration?'send'ownedRelationship+=NodeParameterMemberSenderReceiverPart? + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildSendNodeDeclaration(SysML2.NET.Core.POCO.Systems.Actions.ISendActionUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ActionUsageTextualNotationBuilder.BuildActionNodeUsageDeclaration(poco, stringBuilder); + stringBuilder.Append("send "); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + BuildSenderReceiverPart(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule SenderReceiverPart + /// SenderReceiverPart:SendActionUsage='via'ownedRelationship+=NodeParameterMember('to'ownedRelationship+=NodeParameterMember)?|ownedRelationship+=EmptyParameterMember'to'ownedRelationship+=NodeParameterMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildSenderReceiverPart(SysML2.NET.Core.POCO.Systems.Actions.ISendActionUsage poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule StateSendActionUsage + /// StateSendActionUsage:SendActionUsage=SendNodeDeclarationActionBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildStateSendActionUsage(SysML2.NET.Core.POCO.Systems.Actions.ISendActionUsage poco, StringBuilder stringBuilder) + { + BuildSendNodeDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule TransitionSendActionUsage + /// TransitionSendActionUsage:SendActionUsage=SendNodeDeclaration('{'ActionBodyItem*'}')? + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildTransitionSendActionUsage(SysML2.NET.Core.POCO.Systems.Actions.ISendActionUsage poco, StringBuilder stringBuilder) + { + BuildSendNodeDeclaration(poco, stringBuilder); + + if (BuildGroupConditionForTransitionSendActionUsage(poco)) + { + stringBuilder.Append("{"); + TypeTextualNotationBuilder.BuildActionBodyItem(poco, stringBuilder); + stringBuilder.Append("}"); + stringBuilder.Append(' '); + } + + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.cs new file mode 100644 index 000000000..05282fd12 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.cs @@ -0,0 +1,99 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class SpecializationTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule OwnedSpecialization + /// OwnedSpecialization:Specialization=GeneralType + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildOwnedSpecialization(SysML2.NET.Core.POCO.Core.Types.ISpecialization poco, StringBuilder stringBuilder) + { + BuildGeneralType(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule SpecificType + /// SpecificType:Specialization=specific=[QualifiedName]|specific+=OwnedFeatureChain{ownedRelatedElement+=specific} + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildSpecificType(SysML2.NET.Core.POCO.Core.Types.ISpecialization poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule GeneralType + /// GeneralType:Specialization=general=[QualifiedName]|general+=OwnedFeatureChain{ownedRelatedElement+=general} + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildGeneralType(SysML2.NET.Core.POCO.Core.Types.ISpecialization poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule Specialization + /// Specialization=('specialization'Identification)?'subtype'SpecificTypeSPECIALIZESGeneralTypeRelationshipBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildSpecialization(SysML2.NET.Core.POCO.Core.Types.ISpecialization poco, StringBuilder stringBuilder) + { + + if (BuildGroupConditionForSpecialization(poco)) + { + stringBuilder.Append("specialization "); + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + stringBuilder.Append(' '); + } + + stringBuilder.Append("subtype "); + BuildSpecificType(poco, stringBuilder); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildGeneralType(poco, stringBuilder); + RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StakeholderMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StakeholderMembershipTextualNotationBuilder.cs new file mode 100644 index 000000000..93c35b22f --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StakeholderMembershipTextualNotationBuilder.cs @@ -0,0 +1,60 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class StakeholderMembershipTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule StakeholderMember + /// StakeholderMember:StakeholderMembership=MemberPrefixownedRelatedElement+=StakeholderUsage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildStakeholderMember(SysML2.NET.Core.POCO.Systems.Requirements.IStakeholderMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfPartUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + ownedRelatedElementOfPartUsageIterator.MoveNext(); + + if (ownedRelatedElementOfPartUsageIterator.Current != null) + { + PartUsageTextualNotationBuilder.BuildStakeholderUsage(ownedRelatedElementOfPartUsageIterator.Current, stringBuilder); + } + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateDefinitionTextualNotationBuilder.cs new file mode 100644 index 000000000..ed74d6cf9 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateDefinitionTextualNotationBuilder.cs @@ -0,0 +1,68 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class StateDefinitionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule StateDefBody + /// StateDefBody:StateDefinition=';'|(isParallel?='parallel')?'{'StateBodyItem*'}' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildStateDefBody(SysML2.NET.Core.POCO.Systems.States.IStateDefinition poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule StateDefinition + /// StateDefinition=OccurrenceDefinitionPrefix'state''def'DefinitionDeclarationStateDefBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildStateDefinition(SysML2.NET.Core.POCO.Systems.States.IStateDefinition poco, StringBuilder stringBuilder) + { + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + stringBuilder.Append("state "); + stringBuilder.Append("def "); + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); + BuildStateDefBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateSubactionMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateSubactionMembershipTextualNotationBuilder.cs new file mode 100644 index 000000000..9f7ea3844 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateSubactionMembershipTextualNotationBuilder.cs @@ -0,0 +1,101 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class StateSubactionMembershipTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule EntryActionMember + /// EntryActionMember:StateSubactionMembership=MemberPrefixkind='entry'ownedRelatedElement+=StateActionUsage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildEntryActionMember(SysML2.NET.Core.POCO.Systems.States.IStateSubactionMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfActionUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + stringBuilder.Append(poco.Kind.ToString().ToLower()); + ownedRelatedElementOfActionUsageIterator.MoveNext(); + + if (ownedRelatedElementOfActionUsageIterator.Current != null) + { + ActionUsageTextualNotationBuilder.BuildStateActionUsage(ownedRelatedElementOfActionUsageIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule DoActionMember + /// DoActionMember:StateSubactionMembership=MemberPrefixkind='do'ownedRelatedElement+=StateActionUsage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildDoActionMember(SysML2.NET.Core.POCO.Systems.States.IStateSubactionMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfActionUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + stringBuilder.Append(poco.Kind.ToString().ToLower()); + ownedRelatedElementOfActionUsageIterator.MoveNext(); + + if (ownedRelatedElementOfActionUsageIterator.Current != null) + { + ActionUsageTextualNotationBuilder.BuildStateActionUsage(ownedRelatedElementOfActionUsageIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule ExitActionMember + /// ExitActionMember:StateSubactionMembership=MemberPrefixkind='exit'ownedRelatedElement+=StateActionUsage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildExitActionMember(SysML2.NET.Core.POCO.Systems.States.IStateSubactionMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfActionUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + stringBuilder.Append(poco.Kind.ToString().ToLower()); + ownedRelatedElementOfActionUsageIterator.MoveNext(); + + if (ownedRelatedElementOfActionUsageIterator.Current != null) + { + ActionUsageTextualNotationBuilder.BuildStateActionUsage(ownedRelatedElementOfActionUsageIterator.Current, stringBuilder); + } + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..3515d42cc --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateUsageTextualNotationBuilder.cs @@ -0,0 +1,67 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class StateUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule StateUsageBody + /// StateUsageBody:StateUsage=';'|(isParallel?='parallel')?'{'StateBodyItem*'}' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildStateUsageBody(SysML2.NET.Core.POCO.Systems.States.IStateUsage poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule StateUsage + /// StateUsage=OccurrenceUsagePrefix'state'ActionUsageDeclarationStateUsageBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildStateUsage(SysML2.NET.Core.POCO.Systems.States.IStateUsage poco, StringBuilder stringBuilder) + { + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + stringBuilder.Append("state "); + ActionUsageTextualNotationBuilder.BuildActionUsageDeclaration(poco, stringBuilder); + BuildStateUsageBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StepTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StepTextualNotationBuilder.cs new file mode 100644 index 000000000..e6aedc8d7 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StepTextualNotationBuilder.cs @@ -0,0 +1,70 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class StepTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule Step + /// Step=FeaturePrefix'step'FeatureDeclarationValuePart?TypeBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildStep(SysML2.NET.Core.POCO.Kernel.Behaviors.IStep poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + + while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + { + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } + + } + + stringBuilder.Append("step "); + FeatureTextualNotationBuilder.BuildFeatureDeclaration(poco, stringBuilder); + FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StructureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StructureTextualNotationBuilder.cs new file mode 100644 index 000000000..cf7cd2144 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StructureTextualNotationBuilder.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class StructureTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule Structure + /// Structure=TypePrefix'struct'ClassifierDeclarationTypeBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildStructure(SysML2.NET.Core.POCO.Kernel.Structures.IStructure poco, StringBuilder stringBuilder) + { + TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); + stringBuilder.Append("struct "); + ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.cs new file mode 100644 index 000000000..0f1d4956a --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.cs @@ -0,0 +1,92 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class SubclassificationTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule OwnedSubclassification + /// OwnedSubclassification:Subclassification=superClassifier=[QualifiedName] + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildOwnedSubclassification(SysML2.NET.Core.POCO.Core.Classifiers.ISubclassification poco, StringBuilder stringBuilder) + { + + if (poco.Superclassifier != null) + { + stringBuilder.Append(poco.Superclassifier.qualifiedName); + stringBuilder.Append(' '); + } + + } + + /// + /// Builds the Textual Notation string for the rule Subclassification + /// Subclassification=('specialization'Identification)?'subclassifier'subclassifier=[QualifiedName]SPECIALIZESsuperclassifier=[QualifiedName]RelationshipBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildSubclassification(SysML2.NET.Core.POCO.Core.Classifiers.ISubclassification poco, StringBuilder stringBuilder) + { + + if (BuildGroupConditionForSubclassification(poco)) + { + stringBuilder.Append("specialization "); + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + stringBuilder.Append(' '); + } + + stringBuilder.Append("subclassifier "); + + if (poco.Subclassifier != null) + { + stringBuilder.Append(poco.Subclassifier.qualifiedName); + stringBuilder.Append(' '); + } + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + + if (poco.Superclassifier != null) + { + stringBuilder.Append(poco.Superclassifier.qualifiedName); + stringBuilder.Append(' '); + } + RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubjectMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubjectMembershipTextualNotationBuilder.cs new file mode 100644 index 000000000..9be7c4eed --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubjectMembershipTextualNotationBuilder.cs @@ -0,0 +1,78 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class SubjectMembershipTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule SubjectMember + /// SubjectMember:SubjectMembership=MemberPrefixownedRelatedElement+=SubjectUsage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildSubjectMember(SysML2.NET.Core.POCO.Systems.Requirements.ISubjectMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + ownedRelatedElementOfReferenceUsageIterator.MoveNext(); + + if (ownedRelatedElementOfReferenceUsageIterator.Current != null) + { + ReferenceUsageTextualNotationBuilder.BuildSubjectUsage(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule SatisfactionSubjectMember + /// SatisfactionSubjectMember:SubjectMembership=ownedRelatedElement+=SatisfactionParameter + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildSatisfactionSubjectMember(SysML2.NET.Core.POCO.Systems.Requirements.ISubjectMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfReferenceUsageIterator.MoveNext(); + + if (ownedRelatedElementOfReferenceUsageIterator.Current != null) + { + ReferenceUsageTextualNotationBuilder.BuildSatisfactionParameter(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + } + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.cs new file mode 100644 index 000000000..65f53846e --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.cs @@ -0,0 +1,76 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class SubsettingTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule OwnedSubsetting + /// OwnedSubsetting:Subsetting=subsettedFeature=[QualifiedName]|subsettedFeature=OwnedFeatureChain{ownedRelatedElement+=subsettedFeature} + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildOwnedSubsetting(SysML2.NET.Core.POCO.Core.Features.ISubsetting poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule Subsetting + /// Subsetting=('specialization'Identification)?'subset'SpecificTypeSUBSETSGeneralTypeRelationshipBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildSubsetting(SysML2.NET.Core.POCO.Core.Features.ISubsetting poco, StringBuilder stringBuilder) + { + + if (BuildGroupConditionForSubsetting(poco)) + { + stringBuilder.Append("specialization "); + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + stringBuilder.Append(' '); + } + + stringBuilder.Append("subset "); + SpecializationTextualNotationBuilder.BuildSpecificType(poco, stringBuilder); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + SpecializationTextualNotationBuilder.BuildGeneralType(poco, stringBuilder); + RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionAsUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionAsUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..37e7c62bb --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionAsUsageTextualNotationBuilder.cs @@ -0,0 +1,120 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class SuccessionAsUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule SourceSuccession + /// SourceSuccession:SuccessionAsUsage=ownedRelationship+=SourceEndMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildSourceSuccession(SysML2.NET.Core.POCO.Systems.Connections.ISuccessionAsUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfEndFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildSourceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule TargetSuccession + /// TargetSuccession:SuccessionAsUsage=ownedRelationship+=SourceEndMember'then'ownedRelationship+=ConnectorEndMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildTargetSuccession(SysML2.NET.Core.POCO.Systems.Connections.ISuccessionAsUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfEndFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildSourceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append("then "); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule SuccessionAsUsage + /// SuccessionAsUsage=UsagePrefix('succession'UsageDeclaration)?'first's.ownedRelationship+=ConnectorEndMember'then's.ownedRelationship+=ConnectorEndMemberUsageBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildSuccessionAsUsage(SysML2.NET.Core.POCO.Systems.Connections.ISuccessionAsUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfEndFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + UsageTextualNotationBuilder.BuildUsagePrefix(poco, stringBuilder); + + if (BuildGroupConditionForSuccessionAsUsage(poco)) + { + stringBuilder.Append("succession "); + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + stringBuilder.Append(' '); + } + + stringBuilder.Append("first "); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append("then "); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } + UsageTextualNotationBuilder.BuildUsageBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowTextualNotationBuilder.cs new file mode 100644 index 000000000..31051b1dd --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowTextualNotationBuilder.cs @@ -0,0 +1,70 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class SuccessionFlowTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule SuccessionFlow + /// SuccessionFlow=FeaturePrefix'succession''flow'FlowDeclarationTypeBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildSuccessionFlow(SysML2.NET.Core.POCO.Kernel.Interactions.ISuccessionFlow poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + + while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + { + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } + + } + + stringBuilder.Append("succession "); + stringBuilder.Append("flow "); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..d54f23d95 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowUsageTextualNotationBuilder.cs @@ -0,0 +1,57 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class SuccessionFlowUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule SuccessionFlowUsage + /// SuccessionFlowUsage=OccurrenceUsagePrefix'succession''flow'FlowDeclarationDefinitionBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildSuccessionFlowUsage(SysML2.NET.Core.POCO.Systems.Flows.ISuccessionFlowUsage poco, StringBuilder stringBuilder) + { + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + stringBuilder.Append("succession "); + stringBuilder.Append("flow "); + FlowUsageTextualNotationBuilder.BuildFlowDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildDefinitionBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionTextualNotationBuilder.cs new file mode 100644 index 000000000..6e4febc5e --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionTextualNotationBuilder.cs @@ -0,0 +1,104 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class SuccessionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule TransitionSuccession + /// TransitionSuccession:Succession=ownedRelationship+=EmptyEndMemberownedRelationship+=ConnectorEndMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildTransitionSuccession(SysML2.NET.Core.POCO.Kernel.Connectors.ISuccession poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfEndFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildEmptyEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule SuccessionDeclaration + /// SuccessionDeclaration:Succession=FeatureDeclaration('first'ownedRelationship+=ConnectorEndMember'then'ownedRelationship+=ConnectorEndMember)?|(s.isSufficient?='all')?('first'?ownedRelationship+=ConnectorEndMember'then'ownedRelationship+=ConnectorEndMember)? + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildSuccessionDeclaration(SysML2.NET.Core.POCO.Kernel.Connectors.ISuccession poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule Succession + /// Succession=FeaturePrefix'succession'SuccessionDeclarationTypeBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildSuccession(SysML2.NET.Core.POCO.Kernel.Connectors.ISuccession poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + + while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + { + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } + + } + + stringBuilder.Append("succession "); + BuildSuccessionDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TerminateActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TerminateActionUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..a361fe095 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TerminateActionUsageTextualNotationBuilder.cs @@ -0,0 +1,68 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class TerminateActionUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule TerminateNode + /// TerminateNode:TerminateActionUsage=OccurrenceUsagePrefixActionNodeUsageDeclaration?'terminate'(ownedRelationship+=NodeParameterMember)?ActionBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildTerminateNode(SysML2.NET.Core.POCO.Systems.Actions.ITerminateActionUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + ActionUsageTextualNotationBuilder.BuildActionNodeUsageDeclaration(poco, stringBuilder); + stringBuilder.Append("terminate "); + + if (ownedRelationshipOfParameterMembershipIterator.MoveNext()) + { + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append(' '); + } + + TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TextualRepresentationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TextualRepresentationTextualNotationBuilder.cs new file mode 100644 index 000000000..e2fc7c20a --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TextualRepresentationTextualNotationBuilder.cs @@ -0,0 +1,63 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class TextualRepresentationTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule TextualRepresentation + /// TextualRepresentation=('rep'Identification)?'language'language=STRING_VALUEbody=REGULAR_COMMENT + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildTextualRepresentation(SysML2.NET.Core.POCO.Root.Annotations.ITextualRepresentation poco, StringBuilder stringBuilder) + { + + if (BuildGroupConditionForTextualRepresentation(poco)) + { + stringBuilder.Append("rep "); + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + stringBuilder.Append(' '); + } + + stringBuilder.Append("language "); + stringBuilder.Append(poco.Language); + stringBuilder.Append(poco.Body); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionFeatureMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionFeatureMembershipTextualNotationBuilder.cs new file mode 100644 index 000000000..554f93de5 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionFeatureMembershipTextualNotationBuilder.cs @@ -0,0 +1,101 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class TransitionFeatureMembershipTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule TriggerActionMember + /// TriggerActionMember:TransitionFeatureMembership='accept'{kind='trigger'}ownedRelatedElement+=TriggerAction + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildTriggerActionMember(SysML2.NET.Core.POCO.Systems.States.ITransitionFeatureMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfAcceptActionUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + stringBuilder.Append("accept "); + // NonParsing Assignment Element : kind = 'trigger' => Does not have to be process + ownedRelatedElementOfAcceptActionUsageIterator.MoveNext(); + + if (ownedRelatedElementOfAcceptActionUsageIterator.Current != null) + { + AcceptActionUsageTextualNotationBuilder.BuildTriggerAction(ownedRelatedElementOfAcceptActionUsageIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule GuardExpressionMember + /// GuardExpressionMember:TransitionFeatureMembership='if'{kind='guard'}ownedRelatedElement+=OwnedExpression + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildGuardExpressionMember(SysML2.NET.Core.POCO.Systems.States.ITransitionFeatureMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + stringBuilder.Append("if "); + // NonParsing Assignment Element : kind = 'guard' => Does not have to be process + ownedRelatedElementOfExpressionIterator.MoveNext(); + + if (ownedRelatedElementOfExpressionIterator.Current != null) + { + ExpressionTextualNotationBuilder.BuildOwnedExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule EffectBehaviorMember + /// EffectBehaviorMember:TransitionFeatureMembership='do'{kind='effect'}ownedRelatedElement+=EffectBehaviorUsage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildEffectBehaviorMember(SysML2.NET.Core.POCO.Systems.States.ITransitionFeatureMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfActionUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + stringBuilder.Append("do "); + // NonParsing Assignment Element : kind = 'effect' => Does not have to be process + ownedRelatedElementOfActionUsageIterator.MoveNext(); + + if (ownedRelatedElementOfActionUsageIterator.Current != null) + { + ActionUsageTextualNotationBuilder.BuildEffectBehaviorUsage(ownedRelatedElementOfActionUsageIterator.Current, stringBuilder); + } + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..aec0cca04 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionUsageTextualNotationBuilder.cs @@ -0,0 +1,240 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class TransitionUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule GuardedTargetSuccession + /// GuardedTargetSuccession:TransitionUsage=ownedRelationship+=GuardExpressionMember'then'ownedRelationship+=TransitionSuccessionMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildGuardedTargetSuccession(SysML2.NET.Core.POCO.Systems.States.ITransitionUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfTransitionFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfTransitionFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfTransitionFeatureMembershipIterator.Current != null) + { + TransitionFeatureMembershipTextualNotationBuilder.BuildGuardExpressionMember(ownedRelationshipOfTransitionFeatureMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append("then "); + ownedRelationshipOfOwningMembershipIterator.MoveNext(); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule DefaultTargetSuccession + /// DefaultTargetSuccession:TransitionUsage='else'ownedRelationship+=TransitionSuccessionMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildDefaultTargetSuccession(SysML2.NET.Core.POCO.Systems.States.ITransitionUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + stringBuilder.Append("else "); + ownedRelationshipOfOwningMembershipIterator.MoveNext(); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule GuardedSuccession + /// GuardedSuccession:TransitionUsage=('succession'UsageDeclaration)?'first'ownedRelationship+=FeatureChainMemberownedRelationship+=GuardExpressionMember'then'ownedRelationship+=TransitionSuccessionMemberUsageBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildGuardedSuccession(SysML2.NET.Core.POCO.Systems.States.ITransitionUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfTransitionFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + + if (BuildGroupConditionForGuardedSuccession(poco)) + { + stringBuilder.Append("succession "); + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + stringBuilder.Append(' '); + } + + stringBuilder.Append("first "); + ownedRelationshipOfMembershipIterator.MoveNext(); + + if (ownedRelationshipOfMembershipIterator.Current != null) + { + MembershipTextualNotationBuilder.BuildFeatureChainMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + } + ownedRelationshipOfTransitionFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfTransitionFeatureMembershipIterator.Current != null) + { + TransitionFeatureMembershipTextualNotationBuilder.BuildGuardExpressionMember(ownedRelationshipOfTransitionFeatureMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append("then "); + ownedRelationshipOfOwningMembershipIterator.MoveNext(); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } + UsageTextualNotationBuilder.BuildUsageBody(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule TargetTransitionUsage + /// TargetTransitionUsage:TransitionUsage=ownedRelationship+=EmptyParameterMember('transition'(ownedRelationship+=EmptyParameterMemberownedRelationship+=TriggerActionMember)?(ownedRelationship+=GuardExpressionMember)?(ownedRelationship+=EffectBehaviorMember)?|ownedRelationship+=EmptyParameterMemberownedRelationship+=TriggerActionMember(ownedRelationship+=GuardExpressionMember)?(ownedRelationship+=EffectBehaviorMember)?|ownedRelationship+=GuardExpressionMember(ownedRelationship+=EffectBehaviorMember)?)?'then'ownedRelationship+=TransitionSuccessionMemberActionBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildTargetTransitionUsage(SysML2.NET.Core.POCO.Systems.States.ITransitionUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfTransitionFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildEmptyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append("then "); + ownedRelationshipOfOwningMembershipIterator.MoveNext(); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } + TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule TransitionUsage + /// TransitionUsage='transition'(UsageDeclaration'first')?ownedRelationship+=FeatureChainMemberownedRelationship+=EmptyParameterMember(ownedRelationship+=EmptyParameterMemberownedRelationship+=TriggerActionMember)?(ownedRelationship+=GuardExpressionMember)?(ownedRelationship+=EffectBehaviorMember)?'then'ownedRelationship+=TransitionSuccessionMemberActionBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildTransitionUsage(SysML2.NET.Core.POCO.Systems.States.ITransitionUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfTransitionFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + stringBuilder.Append("transition "); + + if (BuildGroupConditionForTransitionUsage(poco)) + { + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + stringBuilder.Append("first "); + stringBuilder.Append(' '); + } + + ownedRelationshipOfMembershipIterator.MoveNext(); + + if (ownedRelationshipOfMembershipIterator.Current != null) + { + MembershipTextualNotationBuilder.BuildFeatureChainMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + } + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildEmptyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + + if (ownedRelationshipOfParameterMembershipIterator.MoveNext()) + { + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildEmptyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + + if (ownedRelationshipOfTransitionFeatureMembershipIterator.Current != null) + { + TransitionFeatureMembershipTextualNotationBuilder.BuildTriggerActionMember(ownedRelationshipOfTransitionFeatureMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append(' '); + } + + + if (ownedRelationshipOfTransitionFeatureMembershipIterator.MoveNext()) + { + + if (ownedRelationshipOfTransitionFeatureMembershipIterator.Current != null) + { + TransitionFeatureMembershipTextualNotationBuilder.BuildGuardExpressionMember(ownedRelationshipOfTransitionFeatureMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append(' '); + } + + + if (ownedRelationshipOfTransitionFeatureMembershipIterator.MoveNext()) + { + + if (ownedRelationshipOfTransitionFeatureMembershipIterator.Current != null) + { + TransitionFeatureMembershipTextualNotationBuilder.BuildEffectBehaviorMember(ownedRelationshipOfTransitionFeatureMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append(' '); + } + + stringBuilder.Append("then "); + ownedRelationshipOfOwningMembershipIterator.MoveNext(); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } + TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TriggerInvocationExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TriggerInvocationExpressionTextualNotationBuilder.cs new file mode 100644 index 000000000..91d8ba092 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TriggerInvocationExpressionTextualNotationBuilder.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class TriggerInvocationExpressionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule TriggerExpression + /// TriggerExpression:TriggerInvocationExpression=kind=('at'|'after')ownedRelationship+=ArgumentMember|kind='when'ownedRelationship+=ArgumentExpressionMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildTriggerExpression(SysML2.NET.Core.POCO.Systems.Actions.ITriggerInvocationExpression poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeFeaturingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeFeaturingTextualNotationBuilder.cs new file mode 100644 index 000000000..19d95abcc --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeFeaturingTextualNotationBuilder.cs @@ -0,0 +1,92 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class TypeFeaturingTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule OwnedTypeFeaturing + /// OwnedTypeFeaturing:TypeFeaturing=featuringType=[QualifiedName] + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildOwnedTypeFeaturing(SysML2.NET.Core.POCO.Core.Features.ITypeFeaturing poco, StringBuilder stringBuilder) + { + + if (poco.FeaturingType != null) + { + stringBuilder.Append(poco.FeaturingType.qualifiedName); + stringBuilder.Append(' '); + } + + } + + /// + /// Builds the Textual Notation string for the rule TypeFeaturing + /// TypeFeaturing='featuring'(Identification'of')?featureOfType=[QualifiedName]'by'featuringType=[QualifiedName]RelationshipBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildTypeFeaturing(SysML2.NET.Core.POCO.Core.Features.ITypeFeaturing poco, StringBuilder stringBuilder) + { + stringBuilder.Append("featuring "); + + if (BuildGroupConditionForTypeFeaturing(poco)) + { + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + stringBuilder.Append("of "); + stringBuilder.Append(' '); + } + + + if (poco.FeatureOfType != null) + { + stringBuilder.Append(poco.FeatureOfType.qualifiedName); + stringBuilder.Append(' '); + } + stringBuilder.Append("by "); + + if (poco.FeaturingType != null) + { + stringBuilder.Append(poco.FeaturingType.qualifiedName); + stringBuilder.Append(' '); + } + RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs new file mode 100644 index 000000000..74c5151fe --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs @@ -0,0 +1,555 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class TypeTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule DefinitionBody + /// DefinitionBody:Type=';'|'{'DefinitionBodyItem*'}' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildDefinitionBody(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule DefinitionBodyItem + /// DefinitionBodyItem:Type=ownedRelationship+=DefinitionMember|ownedRelationship+=VariantUsageMember|ownedRelationship+=NonOccurrenceUsageMember|(ownedRelationship+=SourceSuccessionMember)?ownedRelationship+=OccurrenceUsageMember|ownedRelationship+=AliasMember|ownedRelationship+=Import + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildDefinitionBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule InterfaceBody + /// InterfaceBody:Type=';'|'{'InterfaceBodyItem*'}' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildInterfaceBody(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule InterfaceBodyItem + /// InterfaceBodyItem:Type=ownedRelationship+=DefinitionMember|ownedRelationship+=VariantUsageMember|ownedRelationship+=InterfaceNonOccurrenceUsageMember|(ownedRelationship+=SourceSuccessionMember)?ownedRelationship+=InterfaceOccurrenceUsageMember|ownedRelationship+=AliasMember|ownedRelationship+=Import + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildInterfaceBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule ActionBody + /// ActionBody:Type=';'|'{'ActionBodyItem*'}' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildActionBody(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule ActionBodyItem + /// ActionBodyItem:Type=NonBehaviorBodyItem|ownedRelationship+=InitialNodeMember(ownedRelationship+=ActionTargetSuccessionMember)*|(ownedRelationship+=SourceSuccessionMember)?ownedRelationship+=ActionBehaviorMember(ownedRelationship+=ActionTargetSuccessionMember)*|ownedRelationship+=GuardedSuccessionMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildActionBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule StateBodyItem + /// StateBodyItem:Type=NonBehaviorBodyItem|(ownedRelationship+=SourceSuccessionMember)?ownedRelationship+=BehaviorUsageMember(ownedRelationship+=TargetTransitionUsageMember)*|ownedRelationship+=TransitionUsageMember|ownedRelationship+=EntryActionMember(ownedRelationship+=EntryTransitionMember)*|ownedRelationship+=DoActionMember|ownedRelationship+=ExitActionMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildStateBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule CalculationBody + /// CalculationBody:Type=';'|'{'CalculationBodyPart'}' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildCalculationBody(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule CalculationBodyPart + /// CalculationBodyPart:Type=CalculationBodyItem*(ownedRelationship+=ResultExpressionMember)? + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildCalculationBodyPart(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfResultExpressionMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + BuildCalculationBodyItem(poco, stringBuilder); + + if (ownedRelationshipOfResultExpressionMembershipIterator.MoveNext()) + { + + if (ownedRelationshipOfResultExpressionMembershipIterator.Current != null) + { + ResultExpressionMembershipTextualNotationBuilder.BuildResultExpressionMember(ownedRelationshipOfResultExpressionMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append(' '); + } + + + } + + /// + /// Builds the Textual Notation string for the rule CalculationBodyItem + /// CalculationBodyItem:Type=ActionBodyItem|ownedRelationship+=ReturnParameterMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildCalculationBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule RequirementBody + /// RequirementBody:Type=';'|'{'RequirementBodyItem*'}' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildRequirementBody(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule RequirementBodyItem + /// RequirementBodyItem:Type=DefinitionBodyItem|ownedRelationship+=SubjectMember|ownedRelationship+=RequirementConstraintMember|ownedRelationship+=FramedConcernMember|ownedRelationship+=RequirementVerificationMember|ownedRelationship+=ActorMember|ownedRelationship+=StakeholderMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildRequirementBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule CaseBody + /// CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildCaseBody(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule CaseBodyItem + /// CaseBodyItem:Type=ActionBodyItem|ownedRelationship+=SubjectMember|ownedRelationship+=ActorMember|ownedRelationship+=ObjectiveMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildCaseBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule MetadataBody + /// MetadataBody:Type=';'|'{'(ownedRelationship+=DefinitionMember|ownedRelationship+=MetadataBodyUsageMember|ownedRelationship+=AliasMember|ownedRelationship+=Import)*'}' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildMetadataBody(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule TypePrefix + /// TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildTypePrefix(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + + if (poco.IsAbstract) + { + stringBuilder.Append("abstract"); + stringBuilder.Append(' '); + } + + + while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + { + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } + + } + + } + + /// + /// Builds the Textual Notation string for the rule TypeDeclaration + /// TypeDeclaration:Type=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SpecializationPart|ConjugationPart)+TypeRelationshipPart* + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildTypeDeclaration(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + + if (poco.IsSufficient) + { + stringBuilder.Append("all"); + stringBuilder.Append(' '); + } + + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + + if (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + { + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildOwnedMultiplicity(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append(' '); + } + + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + stringBuilder.Append(' '); + BuildTypeRelationshipPart(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule SpecializationPart + /// SpecializationPart:Type=SPECIALIZESownedRelationship+=OwnedSpecialization(','ownedRelationship+=OwnedSpecialization)* + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildSpecializationPart(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfSpecializationIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + ownedRelationshipOfSpecializationIterator.MoveNext(); + + if (ownedRelationshipOfSpecializationIterator.Current != null) + { + SpecializationTextualNotationBuilder.BuildOwnedSpecialization(ownedRelationshipOfSpecializationIterator.Current, stringBuilder); + } + + while (ownedRelationshipOfSpecializationIterator.MoveNext()) + { + stringBuilder.Append(","); + + if (ownedRelationshipOfSpecializationIterator.Current != null) + { + SpecializationTextualNotationBuilder.BuildOwnedSpecialization(ownedRelationshipOfSpecializationIterator.Current, stringBuilder); + } + + } + + } + + /// + /// Builds the Textual Notation string for the rule ConjugationPart + /// ConjugationPart:Type=CONJUGATESownedRelationship+=OwnedConjugation + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildConjugationPart(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfConjugationIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + ownedRelationshipOfConjugationIterator.MoveNext(); + + if (ownedRelationshipOfConjugationIterator.Current != null) + { + ConjugationTextualNotationBuilder.BuildOwnedConjugation(ownedRelationshipOfConjugationIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule TypeRelationshipPart + /// TypeRelationshipPart:Type=DisjoiningPart|UnioningPart|IntersectingPart|DifferencingPart + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildTypeRelationshipPart(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule DisjoiningPart + /// DisjoiningPart:Type='disjoint''from'ownedRelationship+=OwnedDisjoining(','ownedRelationship+=OwnedDisjoining)* + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildDisjoiningPart(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfDisjoiningIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + stringBuilder.Append("disjoint "); + stringBuilder.Append("from "); + ownedRelationshipOfDisjoiningIterator.MoveNext(); + + if (ownedRelationshipOfDisjoiningIterator.Current != null) + { + DisjoiningTextualNotationBuilder.BuildOwnedDisjoining(ownedRelationshipOfDisjoiningIterator.Current, stringBuilder); + } + + while (ownedRelationshipOfDisjoiningIterator.MoveNext()) + { + stringBuilder.Append(","); + + if (ownedRelationshipOfDisjoiningIterator.Current != null) + { + DisjoiningTextualNotationBuilder.BuildOwnedDisjoining(ownedRelationshipOfDisjoiningIterator.Current, stringBuilder); + } + + } + + } + + /// + /// Builds the Textual Notation string for the rule UnioningPart + /// UnioningPart:Type='unions'ownedRelationship+=Unioning(','ownedRelationship+=Unioning)* + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildUnioningPart(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfUnioningIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + stringBuilder.Append("unions "); + ownedRelationshipOfUnioningIterator.MoveNext(); + + if (ownedRelationshipOfUnioningIterator.Current != null) + { + UnioningTextualNotationBuilder.BuildUnioning(ownedRelationshipOfUnioningIterator.Current, stringBuilder); + } + + while (ownedRelationshipOfUnioningIterator.MoveNext()) + { + stringBuilder.Append(","); + + if (ownedRelationshipOfUnioningIterator.Current != null) + { + UnioningTextualNotationBuilder.BuildUnioning(ownedRelationshipOfUnioningIterator.Current, stringBuilder); + } + + } + + } + + /// + /// Builds the Textual Notation string for the rule IntersectingPart + /// IntersectingPart:Type='intersects'ownedRelationship+=Intersecting(','ownedRelationship+=Intersecting)* + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildIntersectingPart(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfIntersectingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + stringBuilder.Append("intersects "); + ownedRelationshipOfIntersectingIterator.MoveNext(); + + if (ownedRelationshipOfIntersectingIterator.Current != null) + { + IntersectingTextualNotationBuilder.BuildIntersecting(ownedRelationshipOfIntersectingIterator.Current, stringBuilder); + } + + while (ownedRelationshipOfIntersectingIterator.MoveNext()) + { + stringBuilder.Append(","); + + if (ownedRelationshipOfIntersectingIterator.Current != null) + { + IntersectingTextualNotationBuilder.BuildIntersecting(ownedRelationshipOfIntersectingIterator.Current, stringBuilder); + } + + } + + } + + /// + /// Builds the Textual Notation string for the rule DifferencingPart + /// DifferencingPart:Type='differences'ownedRelationship+=Differencing(','ownedRelationship+=Differencing)* + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildDifferencingPart(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfDifferencingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + stringBuilder.Append("differences "); + ownedRelationshipOfDifferencingIterator.MoveNext(); + + if (ownedRelationshipOfDifferencingIterator.Current != null) + { + DifferencingTextualNotationBuilder.BuildDifferencing(ownedRelationshipOfDifferencingIterator.Current, stringBuilder); + } + + while (ownedRelationshipOfDifferencingIterator.MoveNext()) + { + stringBuilder.Append(","); + + if (ownedRelationshipOfDifferencingIterator.Current != null) + { + DifferencingTextualNotationBuilder.BuildDifferencing(ownedRelationshipOfDifferencingIterator.Current, stringBuilder); + } + + } + + } + + /// + /// Builds the Textual Notation string for the rule TypeBody + /// TypeBody:Type=';'|'{'TypeBodyElement*'}' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildTypeBody(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule TypeBodyElement + /// TypeBodyElement:Type=ownedRelationship+=NonFeatureMember|ownedRelationship+=FeatureMember|ownedRelationship+=AliasMember|ownedRelationship+=Import + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildTypeBodyElement(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule FunctionBody + /// FunctionBody:Type=';'|'{'FunctionBodyPart'}' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFunctionBody(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule FunctionBodyPart + /// FunctionBodyPart:Type=(TypeBodyElement|ownedRelationship+=ReturnFeatureMember)*(ownedRelationship+=ResultExpressionMember)? + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildFunctionBodyPart(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfResultExpressionMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + + while (ownedRelationshipOfReturnParameterMembershipIterator.MoveNext()) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + if (ownedRelationshipOfResultExpressionMembershipIterator.MoveNext()) + { + + if (ownedRelationshipOfResultExpressionMembershipIterator.Current != null) + { + ResultExpressionMembershipTextualNotationBuilder.BuildResultExpressionMember(ownedRelationshipOfResultExpressionMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append(' '); + } + + + } + + /// + /// Builds the Textual Notation string for the rule InstantiatedTypeReference + /// InstantiatedTypeReference:Type=[QualifiedName] + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildInstantiatedTypeReference(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + { + stringBuilder.Append(poco.qualifiedName); + stringBuilder.Append(' '); + + } + + /// + /// Builds the Textual Notation string for the rule Type + /// Type=TypePrefix'type'TypeDeclarationTypeBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildType(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + { + BuildTypePrefix(poco, stringBuilder); + stringBuilder.Append("type "); + BuildTypeDeclaration(poco, stringBuilder); + BuildTypeBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UnioningTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UnioningTextualNotationBuilder.cs new file mode 100644 index 000000000..808c514ab --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UnioningTextualNotationBuilder.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class UnioningTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule Unioning + /// Unioning=unioningType=[QualifiedName]|ownedRelatedElement+=OwnedFeatureChain + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildUnioning(SysML2.NET.Core.POCO.Core.Types.IUnioning poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs new file mode 100644 index 000000000..6609d26f1 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs @@ -0,0 +1,326 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class UsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule UsageElement + /// UsageElement:Usage=NonOccurrenceUsageElement|OccurrenceUsageElement + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildUsageElement(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule RefPrefix + /// RefPrefix:Usage=(direction=FeatureDirection)?(isDerived?='derived')?(isAbstract?='abstract'|isVariation?='variation')?(isConstant?='constant')? + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildRefPrefix(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + { + + if (poco.Direction.HasValue) + { + stringBuilder.Append(poco.Direction.ToString().ToLower()); + stringBuilder.Append(' '); + } + + + if (poco.IsDerived) + { + stringBuilder.Append("derived"); + stringBuilder.Append(' '); + } + + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + + if (poco.IsConstant) + { + stringBuilder.Append("constant"); + stringBuilder.Append(' '); + } + + + } + + /// + /// Builds the Textual Notation string for the rule BasicUsagePrefix + /// BasicUsagePrefix:Usage=RefPrefix(isReference?='ref')? + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildBasicUsagePrefix(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + { + BuildRefPrefix(poco, stringBuilder); + + if (poco.isReference) + { + stringBuilder.Append("ref"); + stringBuilder.Append(' '); + } + + + } + + /// + /// Builds the Textual Notation string for the rule EndUsagePrefix + /// EndUsagePrefix:Usage=isEnd?='end'(ownedRelationship+=OwnedCrossFeatureMember)? + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildEndUsagePrefix(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + stringBuilder.Append("end"); + + if (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + { + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildOwnedCrossFeatureMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append(' '); + } + + + } + + /// + /// Builds the Textual Notation string for the rule UsageExtensionKeyword + /// UsageExtensionKeyword:Usage=ownedRelationship+=PrefixMetadataMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildUsageExtensionKeyword(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfOwningMembershipIterator.MoveNext(); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule UnextendedUsagePrefix + /// UnextendedUsagePrefix:Usage=EndUsagePrefix|BasicUsagePrefix + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildUnextendedUsagePrefix(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule UsagePrefix + /// UsagePrefix:Usage=UnextendedUsagePrefixUsageExtensionKeyword* + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildUsagePrefix(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + { + BuildUnextendedUsagePrefix(poco, stringBuilder); + BuildUsageExtensionKeyword(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule UsageDeclaration + /// UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildUsageDeclaration(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + { + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + FeatureTextualNotationBuilder.BuildFeatureSpecializationPart(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule UsageCompletion + /// UsageCompletion:Usage=ValuePart?UsageBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildUsageCompletion(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + { + FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + BuildUsageBody(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule UsageBody + /// UsageBody:Usage=DefinitionBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildUsageBody(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + { + TypeTextualNotationBuilder.BuildDefinitionBody(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule NonOccurrenceUsageElement + /// NonOccurrenceUsageElement:Usage=DefaultReferenceUsage|ReferenceUsage|AttributeUsage|EnumerationUsage|BindingConnectorAsUsage|SuccessionAsUsage|ExtendedUsage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildNonOccurrenceUsageElement(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule OccurrenceUsageElement + /// OccurrenceUsageElement:Usage=StructureUsageElement|BehaviorUsageElement + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildOccurrenceUsageElement(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule StructureUsageElement + /// StructureUsageElement:Usage=OccurrenceUsage|IndividualUsage|PortionUsage|EventOccurrenceUsage|ItemUsage|PartUsage|ViewUsage|RenderingUsage|PortUsage|ConnectionUsage|InterfaceUsage|AllocationUsage|Message|FlowUsage|SuccessionFlowUsage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildStructureUsageElement(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule BehaviorUsageElement + /// BehaviorUsageElement:Usage=ActionUsage|CalculationUsage|StateUsage|ConstraintUsage|RequirementUsage|ConcernUsage|CaseUsage|AnalysisCaseUsage|VerificationCaseUsage|UseCaseUsage|ViewpointUsage|PerformActionUsage|ExhibitStateUsage|IncludeUseCaseUsage|AssertConstraintUsage|SatisfyRequirementUsage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildBehaviorUsageElement(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule VariantUsageElement + /// VariantUsageElement:Usage=VariantReference|ReferenceUsage|AttributeUsage|BindingConnectorAsUsage|SuccessionAsUsage|OccurrenceUsage|IndividualUsage|PortionUsage|EventOccurrenceUsage|ItemUsage|PartUsage|ViewUsage|RenderingUsage|PortUsage|ConnectionUsage|InterfaceUsage|AllocationUsage|Message|FlowUsage|SuccessionFlowUsage|BehaviorUsageElement + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildVariantUsageElement(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule InterfaceNonOccurrenceUsageElement + /// InterfaceNonOccurrenceUsageElement:Usage=ReferenceUsage|AttributeUsage|EnumerationUsage|BindingConnectorAsUsage|SuccessionAsUsage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildInterfaceNonOccurrenceUsageElement(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule InterfaceOccurrenceUsageElement + /// InterfaceOccurrenceUsageElement:Usage=DefaultInterfaceEnd|StructureUsageElement|BehaviorUsageElement + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildInterfaceOccurrenceUsageElement(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule ActionTargetSuccession + /// ActionTargetSuccession:Usage=(TargetSuccession|GuardedTargetSuccession|DefaultTargetSuccession)UsageBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildActionTargetSuccession(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + BuildUsageBody(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule ExtendedUsage + /// ExtendedUsage:Usage=UnextendedUsagePrefixUsageExtensionKeyword+Usage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildExtendedUsage(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + { + BuildUnextendedUsagePrefix(poco, stringBuilder); + BuildUsageExtensionKeyword(poco, stringBuilder); + BuildUsage(poco, stringBuilder); + + } + + /// + /// Builds the Textual Notation string for the rule Usage + /// Usage=UsageDeclarationUsageCompletion + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildUsage(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + { + BuildUsageDeclaration(poco, stringBuilder); + BuildUsageCompletion(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseDefinitionTextualNotationBuilder.cs new file mode 100644 index 000000000..2bff9828b --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseDefinitionTextualNotationBuilder.cs @@ -0,0 +1,58 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class UseCaseDefinitionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule UseCaseDefinition + /// UseCaseDefinition=OccurrenceDefinitionPrefix'use''case''def'DefinitionDeclarationCaseBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildUseCaseDefinition(SysML2.NET.Core.POCO.Systems.UseCases.IUseCaseDefinition poco, StringBuilder stringBuilder) + { + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + stringBuilder.Append("use "); + stringBuilder.Append("case "); + stringBuilder.Append("def "); + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..459abd46f --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseUsageTextualNotationBuilder.cs @@ -0,0 +1,59 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class UseCaseUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule UseCaseUsage + /// UseCaseUsage=OccurrenceUsagePrefix'use''case'ConstraintUsageDeclarationCaseBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildUseCaseUsage(SysML2.NET.Core.POCO.Systems.UseCases.IUseCaseUsage poco, StringBuilder stringBuilder) + { + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + stringBuilder.Append("use "); + stringBuilder.Append("case "); + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + + TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VariantMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VariantMembershipTextualNotationBuilder.cs new file mode 100644 index 000000000..779cd53e0 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VariantMembershipTextualNotationBuilder.cs @@ -0,0 +1,78 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class VariantMembershipTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule VariantUsageMember + /// VariantUsageMember:VariantMembership=MemberPrefix'variant'ownedVariantUsage=VariantUsageElement + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildVariantUsageMember(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IVariantMembership poco, StringBuilder stringBuilder) + { + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + stringBuilder.Append("variant "); + + if (poco.ownedVariantUsage != null) + { + UsageTextualNotationBuilder.BuildVariantUsageElement(poco.ownedVariantUsage, stringBuilder); + } + + } + + /// + /// Builds the Textual Notation string for the rule EnumerationUsageMember + /// EnumerationUsageMember:VariantMembership=MemberPrefixownedRelatedElement+=EnumeratedValue + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildEnumerationUsageMember(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IVariantMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfEnumerationUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + ownedRelatedElementOfEnumerationUsageIterator.MoveNext(); + + if (ownedRelatedElementOfEnumerationUsageIterator.Current != null) + { + EnumerationUsageTextualNotationBuilder.BuildEnumeratedValue(ownedRelatedElementOfEnumerationUsageIterator.Current, stringBuilder); + } + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseDefinitionTextualNotationBuilder.cs new file mode 100644 index 000000000..18c99b5c8 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseDefinitionTextualNotationBuilder.cs @@ -0,0 +1,57 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class VerificationCaseDefinitionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule VerificationCaseDefinition + /// VerificationCaseDefinition=OccurrenceDefinitionPrefix'verification''def'DefinitionDeclarationCaseBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildVerificationCaseDefinition(SysML2.NET.Core.POCO.Systems.VerificationCases.IVerificationCaseDefinition poco, StringBuilder stringBuilder) + { + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + stringBuilder.Append("verification "); + stringBuilder.Append("def "); + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..699b3e553 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseUsageTextualNotationBuilder.cs @@ -0,0 +1,58 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class VerificationCaseUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule VerificationCaseUsage + /// VerificationCaseUsage=OccurrenceUsagePrefix'verification'ConstraintUsageDeclarationCaseBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildVerificationCaseUsage(SysML2.NET.Core.POCO.Systems.VerificationCases.IVerificationCaseUsage poco, StringBuilder stringBuilder) + { + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + stringBuilder.Append("verification "); + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + + TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs new file mode 100644 index 000000000..acad0ebd4 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs @@ -0,0 +1,79 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ViewDefinitionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ViewDefinitionBody + /// ViewDefinitionBody:ViewDefinition=';'|'{'ViewDefinitionBodyItem*'}' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildViewDefinitionBody(SysML2.NET.Core.POCO.Systems.Views.IViewDefinition poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule ViewDefinitionBodyItem + /// ViewDefinitionBodyItem:ViewDefinition=DefinitionBodyItem|ownedRelationship+=ElementFilterMember|ownedRelationship+=ViewRenderingMember + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildViewDefinitionBodyItem(SysML2.NET.Core.POCO.Systems.Views.IViewDefinition poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule ViewDefinition + /// ViewDefinition=OccurrenceDefinitionPrefix'view''def'DefinitionDeclarationViewDefinitionBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildViewDefinition(SysML2.NET.Core.POCO.Systems.Views.IViewDefinition poco, StringBuilder stringBuilder) + { + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + stringBuilder.Append("view "); + stringBuilder.Append("def "); + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); + BuildViewDefinitionBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewRenderingMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewRenderingMembershipTextualNotationBuilder.cs new file mode 100644 index 000000000..d94ba0914 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewRenderingMembershipTextualNotationBuilder.cs @@ -0,0 +1,61 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ViewRenderingMembershipTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ViewRenderingMember + /// ViewRenderingMember:ViewRenderingMembership=MemberPrefix'render'ownedRelatedElement+=ViewRenderingUsage + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildViewRenderingMember(SysML2.NET.Core.POCO.Systems.Views.IViewRenderingMembership poco, StringBuilder stringBuilder) + { + using var ownedRelatedElementOfRenderingUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + stringBuilder.Append("render "); + ownedRelatedElementOfRenderingUsageIterator.MoveNext(); + + if (ownedRelatedElementOfRenderingUsageIterator.Current != null) + { + RenderingUsageTextualNotationBuilder.BuildViewRenderingUsage(ownedRelatedElementOfRenderingUsageIterator.Current, stringBuilder); + } + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..d5f274528 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs @@ -0,0 +1,79 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ViewUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ViewBody + /// ViewBody:ViewUsage=';'|'{'ViewBodyItem*'}' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildViewBody(SysML2.NET.Core.POCO.Systems.Views.IViewUsage poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule ViewBodyItem + /// ViewBodyItem:ViewUsage=DefinitionBodyItem|ownedRelationship+=ElementFilterMember|ownedRelationship+=ViewRenderingMember|ownedRelationship+=Expose + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildViewBodyItem(SysML2.NET.Core.POCO.Systems.Views.IViewUsage poco, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } + + /// + /// Builds the Textual Notation string for the rule ViewUsage + /// ViewUsage=OccurrenceUsagePrefix'view'UsageDeclaration?ValuePart?ViewBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildViewUsage(SysML2.NET.Core.POCO.Systems.Views.IViewUsage poco, StringBuilder stringBuilder) + { + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + stringBuilder.Append("view "); + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + BuildViewBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointDefinitionTextualNotationBuilder.cs new file mode 100644 index 000000000..ed73cc1fc --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointDefinitionTextualNotationBuilder.cs @@ -0,0 +1,57 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ViewpointDefinitionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ViewpointDefinition + /// ViewpointDefinition=OccurrenceDefinitionPrefix'viewpoint''def'DefinitionDeclarationRequirementBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildViewpointDefinition(SysML2.NET.Core.POCO.Systems.Views.IViewpointDefinition poco, StringBuilder stringBuilder) + { + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + stringBuilder.Append("viewpoint "); + stringBuilder.Append("def "); + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildRequirementBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..58d03e70d --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointUsageTextualNotationBuilder.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class ViewpointUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ViewpointUsage + /// ViewpointUsage=OccurrenceUsagePrefix'viewpoint'ConstraintUsageDeclarationRequirementBody + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildViewpointUsage(SysML2.NET.Core.POCO.Systems.Views.IViewpointUsage poco, StringBuilder stringBuilder) + { + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + stringBuilder.Append("viewpoint "); + ConstraintUsageTextualNotationBuilder.BuildConstraintUsageDeclaration(poco, stringBuilder); + TypeTextualNotationBuilder.BuildRequirementBody(poco, stringBuilder); + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VisibilityKindTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VisibilityKindTextualNotationBuilder.cs new file mode 100644 index 000000000..da48d0a7d --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VisibilityKindTextualNotationBuilder.cs @@ -0,0 +1,52 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class VisibilityKindTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule VisibilityIndicator + /// VisibilityIndicator:VisibilityKind='public'|'private'|'protected' + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildVisibilityIndicator(SysML2.NET.Core.Root.Namespaces.VisibilityKind poco, StringBuilder stringBuilder) + { + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/WhileLoopActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/WhileLoopActionUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..89684b3b2 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/WhileLoopActionUsageTextualNotationBuilder.cs @@ -0,0 +1,75 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + using System.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public static partial class WhileLoopActionUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule WhileLoopNode + /// WhileLoopNode:WhileLoopActionUsage=ActionNodePrefix('while'ownedRelationship+=ExpressionParameterMember|'loop'ownedRelationship+=EmptyParameterMember)ownedRelationship+=ActionBodyParameterMember('until'ownedRelationship+=ExpressionParameterMember';')? + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + public static void BuildWhileLoopNode(SysML2.NET.Core.POCO.Systems.Actions.IWhileLoopActionUsage poco, StringBuilder stringBuilder) + { + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ActionUsageTextualNotationBuilder.BuildActionNodePrefix(poco, stringBuilder); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildActionBodyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + + if (ownedRelationshipOfParameterMembershipIterator.MoveNext()) + { + stringBuilder.Append("until "); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildExpressionParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + stringBuilder.Append(";"); + stringBuilder.Append(' '); + } + + + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/BindingConnectorAsUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/BindingConnectorAsUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..448b9cf43 --- /dev/null +++ b/SysML2.NET/TextualNotation/BindingConnectorAsUsageTextualNotationBuilder.cs @@ -0,0 +1,40 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using SysML2.NET.Core.POCO.Systems.Connections; + + /// + /// Hand-coded part of the + /// + public static partial class BindingConnectorAsUsageTextualNotationBuilder + { + /// + /// Builds the conditional part for the BindingConnectorAsUsage rule + /// + /// The + /// The assertion of the condition + private static bool BuildGroupConditionForBindingConnectorAsUsage(IBindingConnectorAsUsage poco) + { + return CommonTextualNotationBuilder.DoesDefinesUsageDeclaration(poco); + } + } +} diff --git a/SysML2.NET/TextualNotation/CommentTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/CommentTextualNotationBuilder.cs new file mode 100644 index 000000000..02fa70d24 --- /dev/null +++ b/SysML2.NET/TextualNotation/CommentTextualNotationBuilder.cs @@ -0,0 +1,40 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using SysML2.NET.Core.POCO.Root.Annotations; + + /// + /// Hand-coded part of the + /// + public static partial class CommentTextualNotationBuilder + { + /// + /// Builds the conditional part for the Comment rule + /// + /// The + /// The assertion of the condition + private static bool BuildGroupConditionForComment(IComment poco) + { + return CommonTextualNotationBuilder.DoesDefinesIdentificationProperties(poco) || poco.ownedAnnotation.Count != 0; + } + } +} diff --git a/SysML2.NET/TextualNotation/CommonTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/CommonTextualNotationBuilder.cs new file mode 100644 index 000000000..08b21374f --- /dev/null +++ b/SysML2.NET/TextualNotation/CommonTextualNotationBuilder.cs @@ -0,0 +1,54 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + + using SysML2.NET.Core.POCO.Core.Features; + using SysML2.NET.Core.POCO.Root.Elements; + using SysML2.NET.Core.POCO.Systems.DefinitionAndUsage; + + /// + /// Textual Notation Builder that provides common features, usable by others builder + /// + public static class CommonTextualNotationBuilder + { + /// + /// Asserts that an defines properties used by the Identification rule + /// + /// The + /// True if the or is defined + public static bool DoesDefinesIdentificationProperties(IElement poco) + { + return !string.IsNullOrWhiteSpace(poco.DeclaredName) || !string.IsNullOrWhiteSpace(poco.DeclaredShortName); + } + + /// + /// Asserts that an defines properties used by the UsageDeclaration rule + /// + /// The + /// True if respects the or have not empty + public static bool DoesDefinesUsageDeclaration(IElement poco) + { + return DoesDefinesIdentificationProperties(poco) || poco.OwnedRelationship.OfType().Any(); + } + } +} diff --git a/SysML2.NET/TextualNotation/ConjugatedPortTypingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/ConjugatedPortTypingTextualNotationBuilder.cs new file mode 100644 index 000000000..afe670ebf --- /dev/null +++ b/SysML2.NET/TextualNotation/ConjugatedPortTypingTextualNotationBuilder.cs @@ -0,0 +1,41 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Text; + + using SysML2.NET.Core.POCO.Systems.Ports; + + /// + /// Hand-coded part of the + /// + public static partial class ConjugatedPortTypingTextualNotationBuilder + { + /// + /// Build the originalPortDefinition=~[QualifiedName] rule part + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + private static void BuildOriginalPortDefinition(IConjugatedPortTyping poco, StringBuilder stringBuilder) + { + } + } +} diff --git a/SysML2.NET/TextualNotation/ConjugationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/ConjugationTextualNotationBuilder.cs new file mode 100644 index 000000000..cb62745fb --- /dev/null +++ b/SysML2.NET/TextualNotation/ConjugationTextualNotationBuilder.cs @@ -0,0 +1,40 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using SysML2.NET.Core.POCO.Core.Types; + + /// + /// Hand-coded part of the + /// + public static partial class ConjugationTextualNotationBuilder + { + /// + /// Builds the conditional part for the Conjugation rule + /// + /// The + /// The assertion of the condition + private static bool BuildGroupConditionForConjugation(IConjugation poco) + { + return CommonTextualNotationBuilder.DoesDefinesIdentificationProperties(poco); + } + } +} diff --git a/SysML2.NET/TextualNotation/DependencyTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/DependencyTextualNotationBuilder.cs new file mode 100644 index 000000000..1c400c228 --- /dev/null +++ b/SysML2.NET/TextualNotation/DependencyTextualNotationBuilder.cs @@ -0,0 +1,40 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using SysML2.NET.Core.POCO.Root.Dependencies; + + /// + /// Hand-coded part of the + /// + public static partial class DependencyTextualNotationBuilder + { + /// + /// Builds the conditional part for the DependencyDeclaration rule + /// + /// The + /// The assertion of the condition + private static bool BuildGroupConditionForDependencyDeclaration(IDependency poco) + { + return poco.Client.Count != 0 && poco.Supplier.Count != 0; + } + } +} diff --git a/SysML2.NET/TextualNotation/DisjoiningTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/DisjoiningTextualNotationBuilder.cs new file mode 100644 index 000000000..6d39056b8 --- /dev/null +++ b/SysML2.NET/TextualNotation/DisjoiningTextualNotationBuilder.cs @@ -0,0 +1,40 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using SysML2.NET.Core.POCO.Core.Types; + + /// + /// Hand-coded part of the + /// + public static partial class DisjoiningTextualNotationBuilder + { + /// + /// Builds the conditional part for the Disjoining rule + /// + /// The + /// The assertion of the condition + private static bool BuildGroupConditionForDisjoining(IDisjoining poco) + { + return CommonTextualNotationBuilder.DoesDefinesIdentificationProperties(poco); + } + } +} diff --git a/SysML2.NET/TextualNotation/FeatureInvertingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/FeatureInvertingTextualNotationBuilder.cs new file mode 100644 index 000000000..d4d7a919f --- /dev/null +++ b/SysML2.NET/TextualNotation/FeatureInvertingTextualNotationBuilder.cs @@ -0,0 +1,42 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Buffers; + + using SysML2.NET.Core.POCO.Core.Features; + + /// + /// Hand-coded part of the + /// + public static partial class FeatureInvertingTextualNotationBuilder + { + /// + /// Builds the conditional part for the FeatureInverting rule + /// + /// The + /// The assertion of the condition + private static bool BuildGroupConditionForFeatureInverting(IFeatureInverting poco) + { + return CommonTextualNotationBuilder.DoesDefinesIdentificationProperties(poco); + } + } +} diff --git a/SysML2.NET/TextualNotation/FeatureMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/FeatureMembershipTextualNotationBuilder.cs new file mode 100644 index 000000000..e1c0ddbf1 --- /dev/null +++ b/SysML2.NET/TextualNotation/FeatureMembershipTextualNotationBuilder.cs @@ -0,0 +1,41 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Text; + + using SysML2.NET.Core.POCO.Core.Types; + + /// + /// Hand-coded part of the + /// + public static partial class FeatureMembershipTextualNotationBuilder + { + /// + /// Build the memberFeature=[QualifiedName] of the rule + /// + /// The from which the rule should be build + /// The that contains the entire textual notation + private static void BuildMemberFeature(IFeatureMembership poco, StringBuilder stringBuilder) + { + } + } +} diff --git a/SysML2.NET/TextualNotation/IfActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/IfActionUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..4639c28c7 --- /dev/null +++ b/SysML2.NET/TextualNotation/IfActionUsageTextualNotationBuilder.cs @@ -0,0 +1,43 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Linq; + + using SysML2.NET.Core.POCO.Kernel.Behaviors; + using SysML2.NET.Core.POCO.Systems.Actions; + + /// + /// Hand-coded part of the + /// + public static partial class IfActionUsageTextualNotationBuilder + { + /// + /// Builds the conditional part for the IfNode rule + /// + /// The + /// The assertion of the condition + private static bool BuildGroupConditionForIfNode(IIfActionUsage poco) + { + return poco.OwnedRelationship.OfType().Count() != 0; + } + } +} diff --git a/SysML2.NET/TextualNotation/InvocationExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/InvocationExpressionTextualNotationBuilder.cs new file mode 100644 index 000000000..8cd8fe575 --- /dev/null +++ b/SysML2.NET/TextualNotation/InvocationExpressionTextualNotationBuilder.cs @@ -0,0 +1,41 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Text; + + using SysML2.NET.Core.POCO.Kernel.Expressions; + + /// + /// Hand-coded part of the + /// + public static partial class InvocationExpressionTextualNotationBuilder + { + /// + /// Build the non-existing InvocationTypeMember rule + /// + /// The + /// The + private static void BuildInvocationTypeMember(InvocationExpression invocationExpression, StringBuilder stringBuilder) + { + } + } +} diff --git a/SysML2.NET/TextualNotation/MetadataFeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/MetadataFeatureTextualNotationBuilder.cs new file mode 100644 index 000000000..e4f7f8f6c --- /dev/null +++ b/SysML2.NET/TextualNotation/MetadataFeatureTextualNotationBuilder.cs @@ -0,0 +1,40 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using SysML2.NET.Core.POCO.Kernel.Metadata; + + /// + /// Hand-coded part of the + /// + public static partial class MetadataFeatureTextualNotationBuilder + { + /// + /// Builds the conditional part for the MetadataFeatureDeclaration rule + /// + /// The + /// The assertion of the condition + private static bool BuildGroupConditionForMetadataFeatureDeclaration(IMetadataFeature poco) + { + return CommonTextualNotationBuilder.DoesDefinesIdentificationProperties(poco); + } + } +} diff --git a/SysML2.NET/TextualNotation/MetadataUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/MetadataUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..dea71f2f3 --- /dev/null +++ b/SysML2.NET/TextualNotation/MetadataUsageTextualNotationBuilder.cs @@ -0,0 +1,40 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using SysML2.NET.Core.POCO.Systems.Metadata; + + /// + /// Hand-coded part of the + /// + public static partial class MetadataUsageTextualNotationBuilder + { + /// + /// Builds the conditional part for the MetadataUsageDeclaration rule + /// + /// The + /// The assertion of the condition + private static bool BuildGroupConditionForMetadataUsageDeclaration(IMetadataUsage poco) + { + return CommonTextualNotationBuilder.DoesDefinesIdentificationProperties(poco); + } + } +} diff --git a/SysML2.NET/TextualNotation/PackageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/PackageTextualNotationBuilder.cs new file mode 100644 index 000000000..0ea35d1e4 --- /dev/null +++ b/SysML2.NET/TextualNotation/PackageTextualNotationBuilder.cs @@ -0,0 +1,41 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Text; + + using SysML2.NET.Core.POCO.Kernel.Packages; + + /// + /// Hand-coded part of the + /// + public static partial class PackageTextualNotationBuilder + { + /// + /// Build the non-existing Filter Package import rule + /// + /// The package + /// The + private static void BuildFilterPackageImport(Package package, StringBuilder stringBuilder) + { + } + } +} diff --git a/SysML2.NET/TextualNotation/PerformActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/PerformActionUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..eb43b430e --- /dev/null +++ b/SysML2.NET/TextualNotation/PerformActionUsageTextualNotationBuilder.cs @@ -0,0 +1,40 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using SysML2.NET.Core.POCO.Systems.Actions; + + /// + /// Hand-coded part of + /// + public static partial class PerformActionUsageTextualNotationBuilder + { + /// + /// Builds the conditional part for the TransitionPerformActionUsage rule + /// + /// The + /// The assertion of the condition + private static bool BuildGroupConditionForTransitionPerformActionUsage(IPerformActionUsage poco) + { + return poco.OwnedRelationship.Count != 0; + } + } +} diff --git a/SysML2.NET/TextualNotation/RedefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/RedefinitionTextualNotationBuilder.cs new file mode 100644 index 000000000..6386e12f3 --- /dev/null +++ b/SysML2.NET/TextualNotation/RedefinitionTextualNotationBuilder.cs @@ -0,0 +1,40 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using SysML2.NET.Core.POCO.Core.Features; + + /// + /// Hand-coded part of the + /// + public static partial class RedefinitionTextualNotationBuilder + { + /// + /// Builds the conditional part for the Redefinition rule + /// + /// The + /// The assertion of the condition + private static bool BuildGroupConditionForRedefinition(IRedefinition poco) + { + return CommonTextualNotationBuilder.DoesDefinesIdentificationProperties(poco); + } + } +} diff --git a/SysML2.NET/TextualNotation/SendActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/SendActionUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..3650ac5b7 --- /dev/null +++ b/SysML2.NET/TextualNotation/SendActionUsageTextualNotationBuilder.cs @@ -0,0 +1,40 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using SysML2.NET.Core.POCO.Systems.Actions; + + /// + /// Hand-coded part of the + /// + public static partial class SendActionUsageTextualNotationBuilder + { + /// + /// Builds the conditional part for the TransitionSendActionUsage rule + /// + /// The + /// The assertion of the condition + private static bool BuildGroupConditionForTransitionSendActionUsage(ISendActionUsage poco) + { + return poco.OwnedRelationship.Count != 0; + } + } +} diff --git a/SysML2.NET/TextualNotation/SpecializationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/SpecializationTextualNotationBuilder.cs new file mode 100644 index 000000000..2b9367b22 --- /dev/null +++ b/SysML2.NET/TextualNotation/SpecializationTextualNotationBuilder.cs @@ -0,0 +1,40 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using SysML2.NET.Core.POCO.Core.Types; + + /// + /// Hand-coded part of the + /// + public static partial class SpecializationTextualNotationBuilder + { + /// + /// Builds the conditional part for the Specialization rule + /// + /// The + /// The assertion of the condition + private static bool BuildGroupConditionForSpecialization(ISpecialization poco) + { + return CommonTextualNotationBuilder.DoesDefinesIdentificationProperties(poco); + } + } +} diff --git a/SysML2.NET/TextualNotation/SubclassificationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/SubclassificationTextualNotationBuilder.cs new file mode 100644 index 000000000..ece869414 --- /dev/null +++ b/SysML2.NET/TextualNotation/SubclassificationTextualNotationBuilder.cs @@ -0,0 +1,40 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using SysML2.NET.Core.POCO.Core.Classifiers; + + /// + /// Hand-coded part of the + /// + public static partial class SubclassificationTextualNotationBuilder + { + /// + /// Builds the conditional part for the Subclassification rule + /// + /// The + /// The assertion of the condition + private static bool BuildGroupConditionForSubclassification(ISubclassification poco) + { + return CommonTextualNotationBuilder.DoesDefinesIdentificationProperties(poco); + } + } +} diff --git a/SysML2.NET/TextualNotation/SubsettingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/SubsettingTextualNotationBuilder.cs new file mode 100644 index 000000000..bda14aa07 --- /dev/null +++ b/SysML2.NET/TextualNotation/SubsettingTextualNotationBuilder.cs @@ -0,0 +1,40 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using SysML2.NET.Core.POCO.Core.Features; + + /// + /// Hand-coded part of the + /// + public static partial class SubsettingTextualNotationBuilder + { + /// + /// Builds the conditional part for the Subsetting rule + /// + /// The + /// The assertion of the condition + private static bool BuildGroupConditionForSubsetting(ISubsetting poco) + { + return CommonTextualNotationBuilder.DoesDefinesIdentificationProperties(poco); + } + } +} diff --git a/SysML2.NET/TextualNotation/SuccessionAsUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/SuccessionAsUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..6881b77d1 --- /dev/null +++ b/SysML2.NET/TextualNotation/SuccessionAsUsageTextualNotationBuilder.cs @@ -0,0 +1,40 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using SysML2.NET.Core.POCO.Systems.Connections; + + /// + /// Hand-coded part of the + /// + public static partial class SuccessionAsUsageTextualNotationBuilder + { + /// + /// Builds the conditional part for the SuccessionAsUsage rule + /// + /// The + /// The assertion of the condition + private static bool BuildGroupConditionForSuccessionAsUsage(ISuccessionAsUsage poco) + { + return CommonTextualNotationBuilder.DoesDefinesUsageDeclaration(poco); + } + } +} diff --git a/SysML2.NET/TextualNotation/TextualRepresentationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/TextualRepresentationTextualNotationBuilder.cs new file mode 100644 index 000000000..ce7ea3e0e --- /dev/null +++ b/SysML2.NET/TextualNotation/TextualRepresentationTextualNotationBuilder.cs @@ -0,0 +1,40 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using SysML2.NET.Core.POCO.Root.Annotations; + + /// + /// Hand-coded part of the + /// + public static partial class TextualRepresentationTextualNotationBuilder + { + /// + /// Builds the conditional part for the TextualRepresentation rule + /// + /// The + /// The assertion of the condition + private static bool BuildGroupConditionForTextualRepresentation(ITextualRepresentation poco) + { + return CommonTextualNotationBuilder.DoesDefinesIdentificationProperties(poco); + } + } +} diff --git a/SysML2.NET/TextualNotation/TransitionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/TransitionUsageTextualNotationBuilder.cs new file mode 100644 index 000000000..f455d8b52 --- /dev/null +++ b/SysML2.NET/TextualNotation/TransitionUsageTextualNotationBuilder.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using SysML2.NET.Core.POCO.Systems.States; + + /// + /// Hand-coded part of the + /// + public static partial class TransitionUsageTextualNotationBuilder + { + /// + /// Builds the conditional part for the GuardedSuccession rule + /// + /// The + /// The assertion of the condition + private static bool BuildGroupConditionForGuardedSuccession(ITransitionUsage poco) + { + return CommonTextualNotationBuilder.DoesDefinesUsageDeclaration(poco); + } + + /// + /// Builds the conditional part for the TransitionUsage rule + /// + /// The + /// The assertion of the condition + private static bool BuildGroupConditionForTransitionUsage(ITransitionUsage poco) + { + return CommonTextualNotationBuilder.DoesDefinesUsageDeclaration(poco); + } + } +} diff --git a/SysML2.NET/TextualNotation/TypeFeaturingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/TypeFeaturingTextualNotationBuilder.cs new file mode 100644 index 000000000..570b7fbba --- /dev/null +++ b/SysML2.NET/TextualNotation/TypeFeaturingTextualNotationBuilder.cs @@ -0,0 +1,40 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// Copyright 2022-2026 Starion Group S.A. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using SysML2.NET.Core.POCO.Core.Features; + + /// + /// Hand-coded part of the + /// + public static partial class TypeFeaturingTextualNotationBuilder + { + /// + /// Builds the conditional part for the TypeFeaturing rule + /// + /// The + /// The assertion of the condition + private static bool BuildGroupConditionForTypeFeaturing(ITypeFeaturing poco) + { + return CommonTextualNotationBuilder.DoesDefinesIdentificationProperties(poco); + } + } +}