From 148951a7077a2d77a9023f5f99c7706aa6895592 Mon Sep 17 00:00:00 2001 From: atheate Date: Mon, 20 Apr 2026 16:47:54 +0200 Subject: [PATCH 01/33] Fix #218: PackageExtension methods implemented --- .../Extend/PackageExtensionsTestFixture.cs | 66 ++++++++++++++++++- SysML2.NET/Extend/PackageExtensions.cs | 36 ++++++++-- 2 files changed, 93 insertions(+), 9 deletions(-) diff --git a/SysML2.NET.Tests/Extend/PackageExtensionsTestFixture.cs b/SysML2.NET.Tests/Extend/PackageExtensionsTestFixture.cs index e9f5c68f..9886cf4c 100644 --- a/SysML2.NET.Tests/Extend/PackageExtensionsTestFixture.cs +++ b/SysML2.NET.Tests/Extend/PackageExtensionsTestFixture.cs @@ -23,16 +23,76 @@ namespace SysML2.NET.Tests.Extend using System; using NUnit.Framework; - + + using SysML2.NET.Core.POCO.Kernel.Associations; + using SysML2.NET.Core.POCO.Kernel.Functions; using SysML2.NET.Core.POCO.Kernel.Packages; + using SysML2.NET.Core.POCO.Root.Annotations; + using SysML2.NET.Core.POCO.Root.Namespaces; + using SysML2.NET.Extensions; + + using Type = SysML2.NET.Core.POCO.Core.Types.Type; [TestFixture] public class PackageExtensionsTestFixture { [Test] - public void ComputeFilterCondition_ThrowsNotSupportedException() + public void VerifyComputeFilterCondition() + { + Assert.That(() => ((IPackage)null).ComputeFilterCondition(), Throws.TypeOf()); + + var package = new Package(); + + Assert.That(package.ComputeFilterCondition(), Is.Empty); + var membership = new ElementFilterMembership(); + var expression = new BooleanExpression(); + + var annotation = new Annotation(); + var comment = new Comment(); + + package.AssignOwnership(membership, expression); + package.AssignOwnership(annotation, comment); + + Assert.That(package.ComputeFilterCondition, Throws.InstanceOf()); + } + + [Test] + public void VerifyComputeRedefinedImportedMembershipsOperation() { - Assert.That(() => ((IPackage)null).ComputeFilterCondition(), Throws.TypeOf()); + Assert.That(() => ((IPackage)null).ComputeRedefinedImportedMembershipsOperation([]), Throws.TypeOf()); + + var package = new Package(); + + Assert.That(package.ComputeRedefinedImportedMembershipsOperation([]), Is.Empty); + + var importMember = new MembershipImport(); + var type = new Type(); + + package.AssignOwnership(importMember, type); + Assert.That(()=> package.ComputeRedefinedImportedMembershipsOperation([]), Throws.InstanceOf()); + + var membership = new ElementFilterMembership(); + var expression = new BooleanExpression(); + package.AssignOwnership(membership, expression); + Assert.That(()=> package.ComputeRedefinedImportedMembershipsOperation([]), Throws.InstanceOf()); + } + + [Test] + public void VerifyComputeIncludeAsMemberOperation() + { + Assert.That(() => ((IPackage)null).ComputeIncludeAsMemberOperation(null), Throws.TypeOf()); + + var package = new Package(); + Assert.That(package.ComputeIncludeAsMemberOperation(null), Is.False); + + var element = new Type(); + Assert.That(package.ComputeIncludeAsMemberOperation(element), Is.True); + var membership = new ElementFilterMembership(); + var expression = new BooleanExpression(); + + package.AssignOwnership(membership, expression); + + Assert.That(() => package.ComputeIncludeAsMemberOperation(element), Throws.TypeOf()); } } } diff --git a/SysML2.NET/Extend/PackageExtensions.cs b/SysML2.NET/Extend/PackageExtensions.cs index 58a88ae7..94ad5fe4 100644 --- a/SysML2.NET/Extend/PackageExtensions.cs +++ b/SysML2.NET/Extend/PackageExtensions.cs @@ -22,6 +22,7 @@ namespace SysML2.NET.Core.POCO.Kernel.Packages { using System; using System.Collections.Generic; + using System.Linq; using SysML2.NET.Core.POCO.Kernel.Functions; using SysML2.NET.Core.POCO.Root.Annotations; @@ -37,16 +38,16 @@ internal static class PackageExtensions /// /// Computes the derived property. /// + /// OCL2: filterCondition = ownedMembership-> selectByKind(ElementFilterMembership).condition /// /// The subject /// /// /// the computed result /// - [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] internal static List ComputeFilterCondition(this IPackage packageSubject) { - throw new NotSupportedException("Create a GitHub issue when this method is required"); + return packageSubject == null ? throw new ArgumentNullException(nameof(packageSubject)) : [..packageSubject.ownedMembership.OfType().Select(x => x.condition)]; } /// @@ -61,10 +62,23 @@ internal static List ComputeFilterCondition(this IPackage packageSu /// /// The expected collection of /// - [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] internal static List ComputeRedefinedImportedMembershipsOperation(this IPackage packageSubject, List excluded) { - throw new NotSupportedException("Create a GitHub issue when this method is required"); + if (packageSubject == null) + { + throw new ArgumentNullException(nameof(packageSubject)); + } + + var importedMembership= packageSubject.ComputeImportedMembershipsOperation(excluded); + var filters = packageSubject.ComputeFilterCondition(); + + if (filters.Count == 0) + { + return importedMembership; + } + + var validImportedMembership = importedMembership.Where(membership => filters.All(x => x.CheckCondition(membership))).ToList(); + return validImportedMembership; } /// @@ -79,10 +93,20 @@ internal static List ComputeRedefinedImportedMembershipsOperation(t /// /// The expected /// - [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] internal static bool ComputeIncludeAsMemberOperation(this IPackage packageSubject, IElement element) { - throw new NotSupportedException("Create a GitHub issue when this method is required"); + if (packageSubject == null) + { + throw new ArgumentNullException(nameof(packageSubject)); + } + + if (element == null) + { + return false; + } + + var filters = packageSubject.ComputeFilterCondition(); + return filters.Count == 0 || filters.All(x => x.CheckCondition(element)); } } } From 79e45fa67f736f1d81e547b562bd2c09f7d54f6c Mon Sep 17 00:00:00 2001 From: atheate Date: Wed, 18 Feb 2026 15:11:07 +0100 Subject: [PATCH 02/33] [WIP]: KEBNF files are parsed and turn into object graph --- Resources/KerML-textual-bnf.kebnf | 1467 ++++++++++++++ Resources/SysML-textual-bnf.kebnf | 1705 +++++++++++++++++ Resources/kebnf.g4 | 100 + ...NotationSpecificationVisitorTestFixture.cs | 62 + .../NET/CodeGenerator/Grammar/kebnf.interp | 86 + .../NET/CodeGenerator/Grammar/kebnf.tokens | 50 + .../Grammar/kebnfBaseListener.cs | 257 +++ .../CodeGenerator/Grammar/kebnfBaseVisitor.cs | 209 ++ .../NET/CodeGenerator/Grammar/kebnfLexer.cs | 174 ++ .../CodeGenerator/Grammar/kebnfLexer.interp | 104 + .../CodeGenerator/Grammar/kebnfLexer.tokens | 50 + .../CodeGenerator/Grammar/kebnfListener.cs | 205 ++ .../NET/CodeGenerator/Grammar/kebnfParser.cs | 1413 ++++++++++++++ .../NET/CodeGenerator/Grammar/kebnfVisitor.cs | 138 ++ .../Grammar/Model/AssignmentElement.cs | 43 + .../Grammar/Model/GroupElement.cs | 35 + .../Model/NonParsingAssignmentElement.cs | 43 + .../Grammar/Model/NonTerminalElement.cs | 33 + .../Grammar/Model/RuleElement.cs | 55 + .../Grammar/Model/RuleParameter.cs | 38 + .../Grammar/Model/TerminalElement.cs | 33 + .../Grammar/Model/TextualNotationRule.cs | 50 + .../Model/TextualNotationSpecification.cs | 35 + .../TextualNotationSpecificationVisitor.cs | 180 ++ .../SysML2.NET.CodeGenerator.csproj | 18 +- 25 files changed, 6581 insertions(+), 2 deletions(-) create mode 100644 Resources/KerML-textual-bnf.kebnf create mode 100644 Resources/SysML-textual-bnf.kebnf create mode 100644 Resources/kebnf.g4 create mode 100644 SysML2.NET.CodeGenerator.Tests/Grammar/TextualNotationSpecificationVisitorTestFixture.cs create mode 100644 SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnf.interp create mode 100644 SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnf.tokens create mode 100644 SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfBaseListener.cs create mode 100644 SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfBaseVisitor.cs create mode 100644 SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.cs create mode 100644 SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.interp create mode 100644 SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.tokens create mode 100644 SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfListener.cs create mode 100644 SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfParser.cs create mode 100644 SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfVisitor.cs create mode 100644 SysML2.NET.CodeGenerator/Grammar/Model/AssignmentElement.cs create mode 100644 SysML2.NET.CodeGenerator/Grammar/Model/GroupElement.cs create mode 100644 SysML2.NET.CodeGenerator/Grammar/Model/NonParsingAssignmentElement.cs create mode 100644 SysML2.NET.CodeGenerator/Grammar/Model/NonTerminalElement.cs create mode 100644 SysML2.NET.CodeGenerator/Grammar/Model/RuleElement.cs create mode 100644 SysML2.NET.CodeGenerator/Grammar/Model/RuleParameter.cs create mode 100644 SysML2.NET.CodeGenerator/Grammar/Model/TerminalElement.cs create mode 100644 SysML2.NET.CodeGenerator/Grammar/Model/TextualNotationRule.cs create mode 100644 SysML2.NET.CodeGenerator/Grammar/Model/TextualNotationSpecification.cs create mode 100644 SysML2.NET.CodeGenerator/Grammar/TextualNotationSpecificationVisitor.cs diff --git a/Resources/KerML-textual-bnf.kebnf b/Resources/KerML-textual-bnf.kebnf new file mode 100644 index 00000000..2837bcfd --- /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 00000000..e5c771e9 --- /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 00000000..5be3842d --- /dev/null +++ b/Resources/kebnf.g4 @@ -0,0 +1,100 @@ +// Grammar + +grammar kebnf; + +specification : (NL)* rule_definition+ EOF ; + +rule_definition + : name=ID (params=parameter_list)? (COLON target_ast=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 + ; + +assignment + : property=dotted_id op=(ASSIGN | ADD_ASSIGN | BOOL_ASSIGN) 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=value_literal (suffix=suffix_op)? + ; + +non_terminal + : name=ID (suffix=suffix_op)? + ; + +element_core + : cross_reference + | group + | terminal + | non_terminal + ; + +dotted_id + : ID (DOT ID)* + ; + +suffix_op : '*' | '+' | '?' ; + +value_literal : ID | 'true' | 'false' | 'this' | INT | STRING | '[QualifiedName]'; + +// Lexer +ASSIGN : '::=' | '=' ; +ADD_ASSIGN : '+=' ; +BOOL_ASSIGN : '?=' ; +PIPE : '|' ; +COLON : ':' ; +SEMICOLON : ';' ; +COMMA : ',' ; +LPAREN : '(' ; +RPAREN : ')' ; +LBRACK : '[' ; +RBRACK : ']' ; +LBRACE : '{' ; +RBRACE : '}' ; +DOT : '.' ; +TILDE : '~' ; + +ID : [a-zA-Z_][a-zA-Z0-9_]* ; +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/Grammar/TextualNotationSpecificationVisitorTestFixture.cs b/SysML2.NET.CodeGenerator.Tests/Grammar/TextualNotationSpecificationVisitorTestFixture.cs new file mode 100644 index 00000000..6ea3d80b --- /dev/null +++ b/SysML2.NET.CodeGenerator.Tests/Grammar/TextualNotationSpecificationVisitorTestFixture.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. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.CodeGenerator.Tests.Grammar +{ + using System; + using System.IO; + + 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); + } + + Console.WriteLine($"Found {rules.Count} rules"); + } + } +} 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 00000000..54fabec1 --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnf.interp @@ -0,0 +1,86 @@ +token literal names: +null +'*' +'+' +'?' +'true' +'false' +'this' +'[QualifiedName]' +null +'+=' +'?=' +'|' +':' +';' +',' +'(' +')' +'[' +']' +'{' +'}' +'.' +'~' +null +null +null +null +null +null +null + +token symbolic names: +null +null +null +null +null +null +null +null +ASSIGN +ADD_ASSIGN +BOOL_ASSIGN +PIPE +COLON +SEMICOLON +COMMA +LPAREN +RPAREN +LBRACK +RBRACK +LBRACE +RBRACE +DOT +TILDE +ID +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, 29, 149, 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, 3, 5, 93, 8, 5, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 99, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 9, 3, 9, 111, 8, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 121, 8, 10, 1, 11, 1, 11, 3, 11, 125, 8, 11, 1, 12, 1, 12, 3, 12, 129, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 135, 8, 13, 1, 14, 1, 14, 1, 14, 5, 14, 140, 8, 14, 10, 14, 12, 14, 143, 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, 8, 10, 1, 0, 8, 9, 1, 0, 1, 3, 2, 0, 4, 7, 23, 25, 154, 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, 92, 1, 0, 0, 0, 12, 94, 1, 0, 0, 0, 14, 100, 1, 0, 0, 0, 16, 106, 1, 0, 0, 0, 18, 110, 1, 0, 0, 0, 20, 116, 1, 0, 0, 0, 22, 122, 1, 0, 0, 0, 24, 126, 1, 0, 0, 0, 26, 134, 1, 0, 0, 0, 28, 136, 1, 0, 0, 0, 30, 144, 1, 0, 0, 0, 32, 146, 1, 0, 0, 0, 34, 36, 5, 29, 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, 23, 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, 12, 0, 0, 52, 54, 5, 23, 0, 0, 53, 51, 1, 0, 0, 0, 53, 54, 1, 0, 0, 0, 54, 55, 1, 0, 0, 0, 55, 56, 5, 8, 0, 0, 56, 58, 3, 6, 3, 0, 57, 59, 5, 13, 0, 0, 58, 57, 1, 0, 0, 0, 58, 59, 1, 0, 0, 0, 59, 61, 1, 0, 0, 0, 60, 62, 5, 29, 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, 15, 0, 0, 66, 67, 5, 23, 0, 0, 67, 68, 5, 12, 0, 0, 68, 69, 5, 23, 0, 0, 69, 70, 5, 16, 0, 0, 70, 5, 1, 0, 0, 0, 71, 76, 3, 8, 4, 0, 72, 73, 5, 11, 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, 93, 3, 12, 6, 0, 86, 93, 3, 14, 7, 0, 87, 93, 3, 16, 8, 0, 88, 93, 3, 18, 9, 0, 89, 93, 3, 20, 10, 0, 90, 93, 3, 22, 11, 0, 91, 93, 3, 24, 12, 0, 92, 85, 1, 0, 0, 0, 92, 86, 1, 0, 0, 0, 92, 87, 1, 0, 0, 0, 92, 88, 1, 0, 0, 0, 92, 89, 1, 0, 0, 0, 92, 90, 1, 0, 0, 0, 92, 91, 1, 0, 0, 0, 93, 11, 1, 0, 0, 0, 94, 95, 3, 28, 14, 0, 95, 96, 7, 0, 0, 0, 96, 98, 3, 26, 13, 0, 97, 99, 3, 30, 15, 0, 98, 97, 1, 0, 0, 0, 98, 99, 1, 0, 0, 0, 99, 13, 1, 0, 0, 0, 100, 101, 5, 19, 0, 0, 101, 102, 3, 28, 14, 0, 102, 103, 7, 1, 0, 0, 103, 104, 3, 32, 16, 0, 104, 105, 5, 20, 0, 0, 105, 15, 1, 0, 0, 0, 106, 107, 5, 19, 0, 0, 107, 108, 5, 20, 0, 0, 108, 17, 1, 0, 0, 0, 109, 111, 5, 22, 0, 0, 110, 109, 1, 0, 0, 0, 110, 111, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, 113, 5, 17, 0, 0, 113, 114, 5, 23, 0, 0, 114, 115, 5, 18, 0, 0, 115, 19, 1, 0, 0, 0, 116, 117, 5, 15, 0, 0, 117, 118, 3, 6, 3, 0, 118, 120, 5, 16, 0, 0, 119, 121, 3, 30, 15, 0, 120, 119, 1, 0, 0, 0, 120, 121, 1, 0, 0, 0, 121, 21, 1, 0, 0, 0, 122, 124, 3, 32, 16, 0, 123, 125, 3, 30, 15, 0, 124, 123, 1, 0, 0, 0, 124, 125, 1, 0, 0, 0, 125, 23, 1, 0, 0, 0, 126, 128, 5, 23, 0, 0, 127, 129, 3, 30, 15, 0, 128, 127, 1, 0, 0, 0, 128, 129, 1, 0, 0, 0, 129, 25, 1, 0, 0, 0, 130, 135, 3, 18, 9, 0, 131, 135, 3, 20, 10, 0, 132, 135, 3, 22, 11, 0, 133, 135, 3, 24, 12, 0, 134, 130, 1, 0, 0, 0, 134, 131, 1, 0, 0, 0, 134, 132, 1, 0, 0, 0, 134, 133, 1, 0, 0, 0, 135, 27, 1, 0, 0, 0, 136, 141, 5, 23, 0, 0, 137, 138, 5, 21, 0, 0, 138, 140, 5, 23, 0, 0, 139, 137, 1, 0, 0, 0, 140, 143, 1, 0, 0, 0, 141, 139, 1, 0, 0, 0, 141, 142, 1, 0, 0, 0, 142, 29, 1, 0, 0, 0, 143, 141, 1, 0, 0, 0, 144, 145, 7, 2, 0, 0, 145, 31, 1, 0, 0, 0, 146, 147, 7, 3, 0, 0, 147, 33, 1, 0, 0, 0, 16, 37, 43, 49, 53, 58, 63, 76, 82, 92, 98, 110, 120, 124, 128, 134, 141] \ 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 00000000..a34fe965 --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnf.tokens @@ -0,0 +1,50 @@ +T__0=1 +T__1=2 +T__2=3 +T__3=4 +T__4=5 +T__5=6 +T__6=7 +ASSIGN=8 +ADD_ASSIGN=9 +BOOL_ASSIGN=10 +PIPE=11 +COLON=12 +SEMICOLON=13 +COMMA=14 +LPAREN=15 +RPAREN=16 +LBRACK=17 +RBRACK=18 +LBRACE=19 +RBRACE=20 +DOT=21 +TILDE=22 +ID=23 +INT=24 +STRING=25 +COMMENT=26 +WS=27 +CONTINUATION=28 +NL=29 +'*'=1 +'+'=2 +'?'=3 +'true'=4 +'false'=5 +'this'=6 +'[QualifiedName]'=7 +'+='=9 +'?='=10 +'|'=11 +':'=12 +';'=13 +','=14 +'('=15 +')'=16 +'['=17 +']'=18 +'{'=19 +'}'=20 +'.'=21 +'~'=22 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 00000000..1593400e --- /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 00000000..3a64587f --- /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 00000000..9f980ce9 --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.cs @@ -0,0 +1,174 @@ +//------------------------------------------------------------------------------ +// +// 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, T__4=5, T__5=6, T__6=7, ASSIGN=8, ADD_ASSIGN=9, + BOOL_ASSIGN=10, PIPE=11, COLON=12, SEMICOLON=13, COMMA=14, LPAREN=15, + RPAREN=16, LBRACK=17, RBRACK=18, LBRACE=19, RBRACE=20, DOT=21, TILDE=22, + ID=23, INT=24, STRING=25, COMMENT=26, WS=27, CONTINUATION=28, NL=29; + 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", "T__4", "T__5", "T__6", "ASSIGN", "ADD_ASSIGN", + "BOOL_ASSIGN", "PIPE", "COLON", "SEMICOLON", "COMMA", "LPAREN", "RPAREN", + "LBRACK", "RBRACK", "LBRACE", "RBRACE", "DOT", "TILDE", "ID", "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, "'*'", "'+'", "'?'", "'true'", "'false'", "'this'", "'[QualifiedName]'", + null, "'+='", "'?='", "'|'", "':'", "';'", "','", "'('", "')'", "'['", + "']'", "'{'", "'}'", "'.'", "'~'" + }; + private static readonly string[] _SymbolicNames = { + null, null, null, null, null, null, null, null, "ASSIGN", "ADD_ASSIGN", + "BOOL_ASSIGN", "PIPE", "COLON", "SEMICOLON", "COMMA", "LPAREN", "RPAREN", + "LBRACK", "RBRACK", "LBRACE", "RBRACE", "DOT", "TILDE", "ID", "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,29,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,2,28, + 7,28,1,0,1,0,1,1,1,1,1,2,1,2,1,3,1,3,1,3,1,3,1,3,1,4,1,4,1,4,1,4,1,4,1, + 4,1,5,1,5,1,5,1,5,1,5,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6, + 1,6,1,6,1,6,1,6,1,7,1,7,1,7,1,7,3,7,102,8,7,1,8,1,8,1,8,1,9,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,1,20,1,20,1,21,1,21,1,22,1,22,5,22,136,8,22, + 10,22,12,22,139,9,22,1,23,4,23,142,8,23,11,23,12,23,143,1,24,1,24,1,24, + 1,24,5,24,150,8,24,10,24,12,24,153,9,24,1,24,1,24,1,25,1,25,1,25,1,25, + 5,25,161,8,25,10,25,12,25,164,9,25,1,25,1,25,1,26,4,26,169,8,26,11,26, + 12,26,170,1,26,1,26,1,27,3,27,176,8,27,1,27,1,27,4,27,180,8,27,11,27,12, + 27,181,1,27,1,27,1,28,3,28,187,8,28,1,28,1,28,0,0,29,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,57,29, + 1,0,6,3,0,65,90,95,95,97,122,4,0,48,57,65,90,95,95,97,122,1,0,48,57,2, + 0,39,39,92,92,2,0,10,10,13,13,2,0,9,9,32,32,199,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,0,57,1,0,0,0,1,59, + 1,0,0,0,3,61,1,0,0,0,5,63,1,0,0,0,7,65,1,0,0,0,9,70,1,0,0,0,11,76,1,0, + 0,0,13,81,1,0,0,0,15,101,1,0,0,0,17,103,1,0,0,0,19,106,1,0,0,0,21,109, + 1,0,0,0,23,111,1,0,0,0,25,113,1,0,0,0,27,115,1,0,0,0,29,117,1,0,0,0,31, + 119,1,0,0,0,33,121,1,0,0,0,35,123,1,0,0,0,37,125,1,0,0,0,39,127,1,0,0, + 0,41,129,1,0,0,0,43,131,1,0,0,0,45,133,1,0,0,0,47,141,1,0,0,0,49,145,1, + 0,0,0,51,156,1,0,0,0,53,168,1,0,0,0,55,175,1,0,0,0,57,186,1,0,0,0,59,60, + 5,42,0,0,60,2,1,0,0,0,61,62,5,43,0,0,62,4,1,0,0,0,63,64,5,63,0,0,64,6, + 1,0,0,0,65,66,5,116,0,0,66,67,5,114,0,0,67,68,5,117,0,0,68,69,5,101,0, + 0,69,8,1,0,0,0,70,71,5,102,0,0,71,72,5,97,0,0,72,73,5,108,0,0,73,74,5, + 115,0,0,74,75,5,101,0,0,75,10,1,0,0,0,76,77,5,116,0,0,77,78,5,104,0,0, + 78,79,5,105,0,0,79,80,5,115,0,0,80,12,1,0,0,0,81,82,5,91,0,0,82,83,5,81, + 0,0,83,84,5,117,0,0,84,85,5,97,0,0,85,86,5,108,0,0,86,87,5,105,0,0,87, + 88,5,102,0,0,88,89,5,105,0,0,89,90,5,101,0,0,90,91,5,100,0,0,91,92,5,78, + 0,0,92,93,5,97,0,0,93,94,5,109,0,0,94,95,5,101,0,0,95,96,5,93,0,0,96,14, + 1,0,0,0,97,98,5,58,0,0,98,99,5,58,0,0,99,102,5,61,0,0,100,102,5,61,0,0, + 101,97,1,0,0,0,101,100,1,0,0,0,102,16,1,0,0,0,103,104,5,43,0,0,104,105, + 5,61,0,0,105,18,1,0,0,0,106,107,5,63,0,0,107,108,5,61,0,0,108,20,1,0,0, + 0,109,110,5,124,0,0,110,22,1,0,0,0,111,112,5,58,0,0,112,24,1,0,0,0,113, + 114,5,59,0,0,114,26,1,0,0,0,115,116,5,44,0,0,116,28,1,0,0,0,117,118,5, + 40,0,0,118,30,1,0,0,0,119,120,5,41,0,0,120,32,1,0,0,0,121,122,5,91,0,0, + 122,34,1,0,0,0,123,124,5,93,0,0,124,36,1,0,0,0,125,126,5,123,0,0,126,38, + 1,0,0,0,127,128,5,125,0,0,128,40,1,0,0,0,129,130,5,46,0,0,130,42,1,0,0, + 0,131,132,5,126,0,0,132,44,1,0,0,0,133,137,7,0,0,0,134,136,7,1,0,0,135, + 134,1,0,0,0,136,139,1,0,0,0,137,135,1,0,0,0,137,138,1,0,0,0,138,46,1,0, + 0,0,139,137,1,0,0,0,140,142,7,2,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,48,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,50,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,4,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, + 25,0,0,166,52,1,0,0,0,167,169,7,5,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,26,0,0,173,54, + 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,5,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,27,0,0,184,56,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,58,1,0,0,0,11,0,101,137,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 00000000..f5467a47 --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.interp @@ -0,0 +1,104 @@ +token literal names: +null +'*' +'+' +'?' +'true' +'false' +'this' +'[QualifiedName]' +null +'+=' +'?=' +'|' +':' +';' +',' +'(' +')' +'[' +']' +'{' +'}' +'.' +'~' +null +null +null +null +null +null +null + +token symbolic names: +null +null +null +null +null +null +null +null +ASSIGN +ADD_ASSIGN +BOOL_ASSIGN +PIPE +COLON +SEMICOLON +COMMA +LPAREN +RPAREN +LBRACK +RBRACK +LBRACE +RBRACE +DOT +TILDE +ID +INT +STRING +COMMENT +WS +CONTINUATION +NL + +rule names: +T__0 +T__1 +T__2 +T__3 +T__4 +T__5 +T__6 +ASSIGN +ADD_ASSIGN +BOOL_ASSIGN +PIPE +COLON +SEMICOLON +COMMA +LPAREN +RPAREN +LBRACK +RBRACK +LBRACE +RBRACE +DOT +TILDE +ID +INT +STRING +COMMENT +WS +CONTINUATION +NL + +channel names: +DEFAULT_TOKEN_CHANNEL +HIDDEN + +mode names: +DEFAULT_MODE + +atn: +[4, 0, 29, 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, 2, 28, 7, 28, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 102, 8, 7, 1, 8, 1, 8, 1, 8, 1, 9, 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, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 5, 22, 136, 8, 22, 10, 22, 12, 22, 139, 9, 22, 1, 23, 4, 23, 142, 8, 23, 11, 23, 12, 23, 143, 1, 24, 1, 24, 1, 24, 1, 24, 5, 24, 150, 8, 24, 10, 24, 12, 24, 153, 9, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 5, 25, 161, 8, 25, 10, 25, 12, 25, 164, 9, 25, 1, 25, 1, 25, 1, 26, 4, 26, 169, 8, 26, 11, 26, 12, 26, 170, 1, 26, 1, 26, 1, 27, 3, 27, 176, 8, 27, 1, 27, 1, 27, 4, 27, 180, 8, 27, 11, 27, 12, 27, 181, 1, 27, 1, 27, 1, 28, 3, 28, 187, 8, 28, 1, 28, 1, 28, 0, 0, 29, 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, 57, 29, 1, 0, 6, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 39, 39, 92, 92, 2, 0, 10, 10, 13, 13, 2, 0, 9, 9, 32, 32, 199, 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, 0, 57, 1, 0, 0, 0, 1, 59, 1, 0, 0, 0, 3, 61, 1, 0, 0, 0, 5, 63, 1, 0, 0, 0, 7, 65, 1, 0, 0, 0, 9, 70, 1, 0, 0, 0, 11, 76, 1, 0, 0, 0, 13, 81, 1, 0, 0, 0, 15, 101, 1, 0, 0, 0, 17, 103, 1, 0, 0, 0, 19, 106, 1, 0, 0, 0, 21, 109, 1, 0, 0, 0, 23, 111, 1, 0, 0, 0, 25, 113, 1, 0, 0, 0, 27, 115, 1, 0, 0, 0, 29, 117, 1, 0, 0, 0, 31, 119, 1, 0, 0, 0, 33, 121, 1, 0, 0, 0, 35, 123, 1, 0, 0, 0, 37, 125, 1, 0, 0, 0, 39, 127, 1, 0, 0, 0, 41, 129, 1, 0, 0, 0, 43, 131, 1, 0, 0, 0, 45, 133, 1, 0, 0, 0, 47, 141, 1, 0, 0, 0, 49, 145, 1, 0, 0, 0, 51, 156, 1, 0, 0, 0, 53, 168, 1, 0, 0, 0, 55, 175, 1, 0, 0, 0, 57, 186, 1, 0, 0, 0, 59, 60, 5, 42, 0, 0, 60, 2, 1, 0, 0, 0, 61, 62, 5, 43, 0, 0, 62, 4, 1, 0, 0, 0, 63, 64, 5, 63, 0, 0, 64, 6, 1, 0, 0, 0, 65, 66, 5, 116, 0, 0, 66, 67, 5, 114, 0, 0, 67, 68, 5, 117, 0, 0, 68, 69, 5, 101, 0, 0, 69, 8, 1, 0, 0, 0, 70, 71, 5, 102, 0, 0, 71, 72, 5, 97, 0, 0, 72, 73, 5, 108, 0, 0, 73, 74, 5, 115, 0, 0, 74, 75, 5, 101, 0, 0, 75, 10, 1, 0, 0, 0, 76, 77, 5, 116, 0, 0, 77, 78, 5, 104, 0, 0, 78, 79, 5, 105, 0, 0, 79, 80, 5, 115, 0, 0, 80, 12, 1, 0, 0, 0, 81, 82, 5, 91, 0, 0, 82, 83, 5, 81, 0, 0, 83, 84, 5, 117, 0, 0, 84, 85, 5, 97, 0, 0, 85, 86, 5, 108, 0, 0, 86, 87, 5, 105, 0, 0, 87, 88, 5, 102, 0, 0, 88, 89, 5, 105, 0, 0, 89, 90, 5, 101, 0, 0, 90, 91, 5, 100, 0, 0, 91, 92, 5, 78, 0, 0, 92, 93, 5, 97, 0, 0, 93, 94, 5, 109, 0, 0, 94, 95, 5, 101, 0, 0, 95, 96, 5, 93, 0, 0, 96, 14, 1, 0, 0, 0, 97, 98, 5, 58, 0, 0, 98, 99, 5, 58, 0, 0, 99, 102, 5, 61, 0, 0, 100, 102, 5, 61, 0, 0, 101, 97, 1, 0, 0, 0, 101, 100, 1, 0, 0, 0, 102, 16, 1, 0, 0, 0, 103, 104, 5, 43, 0, 0, 104, 105, 5, 61, 0, 0, 105, 18, 1, 0, 0, 0, 106, 107, 5, 63, 0, 0, 107, 108, 5, 61, 0, 0, 108, 20, 1, 0, 0, 0, 109, 110, 5, 124, 0, 0, 110, 22, 1, 0, 0, 0, 111, 112, 5, 58, 0, 0, 112, 24, 1, 0, 0, 0, 113, 114, 5, 59, 0, 0, 114, 26, 1, 0, 0, 0, 115, 116, 5, 44, 0, 0, 116, 28, 1, 0, 0, 0, 117, 118, 5, 40, 0, 0, 118, 30, 1, 0, 0, 0, 119, 120, 5, 41, 0, 0, 120, 32, 1, 0, 0, 0, 121, 122, 5, 91, 0, 0, 122, 34, 1, 0, 0, 0, 123, 124, 5, 93, 0, 0, 124, 36, 1, 0, 0, 0, 125, 126, 5, 123, 0, 0, 126, 38, 1, 0, 0, 0, 127, 128, 5, 125, 0, 0, 128, 40, 1, 0, 0, 0, 129, 130, 5, 46, 0, 0, 130, 42, 1, 0, 0, 0, 131, 132, 5, 126, 0, 0, 132, 44, 1, 0, 0, 0, 133, 137, 7, 0, 0, 0, 134, 136, 7, 1, 0, 0, 135, 134, 1, 0, 0, 0, 136, 139, 1, 0, 0, 0, 137, 135, 1, 0, 0, 0, 137, 138, 1, 0, 0, 0, 138, 46, 1, 0, 0, 0, 139, 137, 1, 0, 0, 0, 140, 142, 7, 2, 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, 48, 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, 50, 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, 4, 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, 25, 0, 0, 166, 52, 1, 0, 0, 0, 167, 169, 7, 5, 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, 26, 0, 0, 173, 54, 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, 5, 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, 27, 0, 0, 184, 56, 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, 58, 1, 0, 0, 0, 11, 0, 101, 137, 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 00000000..a34fe965 --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.tokens @@ -0,0 +1,50 @@ +T__0=1 +T__1=2 +T__2=3 +T__3=4 +T__4=5 +T__5=6 +T__6=7 +ASSIGN=8 +ADD_ASSIGN=9 +BOOL_ASSIGN=10 +PIPE=11 +COLON=12 +SEMICOLON=13 +COMMA=14 +LPAREN=15 +RPAREN=16 +LBRACK=17 +RBRACK=18 +LBRACE=19 +RBRACE=20 +DOT=21 +TILDE=22 +ID=23 +INT=24 +STRING=25 +COMMENT=26 +WS=27 +CONTINUATION=28 +NL=29 +'*'=1 +'+'=2 +'?'=3 +'true'=4 +'false'=5 +'this'=6 +'[QualifiedName]'=7 +'+='=9 +'?='=10 +'|'=11 +':'=12 +';'=13 +','=14 +'('=15 +')'=16 +'['=17 +']'=18 +'{'=19 +'}'=20 +'.'=21 +'~'=22 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 00000000..15434522 --- /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 00000000..14ce997c --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfParser.cs @@ -0,0 +1,1413 @@ +//------------------------------------------------------------------------------ +// +// 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, T__4=5, T__5=6, T__6=7, ASSIGN=8, ADD_ASSIGN=9, + BOOL_ASSIGN=10, PIPE=11, COLON=12, SEMICOLON=13, COMMA=14, LPAREN=15, + RPAREN=16, LBRACK=17, RBRACK=18, LBRACE=19, RBRACE=20, DOT=21, TILDE=22, + ID=23, INT=24, STRING=25, COMMENT=26, WS=27, CONTINUATION=28, NL=29; + 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, "'*'", "'+'", "'?'", "'true'", "'false'", "'this'", "'[QualifiedName]'", + null, "'+='", "'?='", "'|'", "':'", "';'", "','", "'('", "')'", "'['", + "']'", "'{'", "'}'", "'.'", "'~'" + }; + private static readonly string[] _SymbolicNames = { + null, null, null, null, null, null, null, null, "ASSIGN", "ADD_ASSIGN", + "BOOL_ASSIGN", "PIPE", "COLON", "SEMICOLON", "COMMA", "LPAREN", "RPAREN", + "LBRACK", "RBRACK", "LBRACE", "RBRACE", "DOT", "TILDE", "ID", "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==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[] ID() { return GetTokens(kebnfParser.ID); } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ID(int i) { + return GetToken(kebnfParser.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(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(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) & 63602928L) != 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); + } + 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 = 92; + 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; + } + } + 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 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 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 = 94; + _localctx.property = dotted_id(); + State = 95; + _localctx.op = TokenStream.LT(1); + _la = TokenStream.LA(1); + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 1792L) != 0)) ) { + _localctx.op = ErrorHandler.RecoverInline(this); + } + else { + ErrorHandler.ReportMatch(this); + Consume(); + } + State = 96; + _localctx.content = element_core(); + State = 98; + ErrorHandler.Sync(this); + _la = TokenStream.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 14L) != 0)) { + { + State = 97; + _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 = 100; + Match(LBRACE); + State = 101; + _localctx.property = dotted_id(); + State = 102; + _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 = 103; + _localctx.val = value_literal(); + State = 104; + 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 = 106; + Match(LBRACE); + State = 107; + 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 = 110; + ErrorHandler.Sync(this); + _la = TokenStream.LA(1); + if (_la==TILDE) { + { + State = 109; + Match(TILDE); + } + } + + State = 112; + Match(LBRACK); + State = 113; + _localctx.@ref = Match(ID); + State = 114; + 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 = 116; + Match(LPAREN); + State = 117; + alternatives(); + State = 118; + Match(RPAREN); + State = 120; + ErrorHandler.Sync(this); + switch ( Interpreter.AdaptivePredict(TokenStream,11,Context) ) { + case 1: + { + State = 119; + _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 Value_literalContext val; + public Suffix_opContext suffix; + [System.Diagnostics.DebuggerNonUserCode] public Value_literalContext value_literal() { + return GetRuleContext(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 = 122; + _localctx.val = value_literal(); + 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 Non_terminalContext : ParserRuleContext { + public IToken name; + public Suffix_opContext suffix; + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ID() { return GetToken(kebnfParser.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 = 126; + _localctx.name = Match(ID); + 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 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); + } + 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 = 134; + ErrorHandler.Sync(this); + switch ( Interpreter.AdaptivePredict(TokenStream,14,Context) ) { + case 1: + EnterOuterAlt(_localctx, 1); + { + State = 130; + cross_reference(); + } + break; + case 2: + EnterOuterAlt(_localctx, 2); + { + State = 131; + group(); + } + break; + case 3: + EnterOuterAlt(_localctx, 3); + { + State = 132; + terminal(); + } + break; + case 4: + EnterOuterAlt(_localctx, 4); + { + State = 133; + non_terminal(); + } + 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 = 136; + Match(ID); + State = 141; + ErrorHandler.Sync(this); + _la = TokenStream.LA(1); + while (_la==DOT) { + { + { + State = 137; + Match(DOT); + State = 138; + Match(ID); + } + } + State = 143; + 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 = 144; + _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); } + 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 = 146; + _la = TokenStream.LA(1); + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 58720496L) != 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,29,149,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,3,5,93,8,5,1,6,1,6,1,6,1,6,3,6,99,8,6,1,7,1,7,1,7, + 1,7,1,7,1,7,1,8,1,8,1,8,1,9,3,9,111,8,9,1,9,1,9,1,9,1,9,1,10,1,10,1,10, + 1,10,3,10,121,8,10,1,11,1,11,3,11,125,8,11,1,12,1,12,3,12,129,8,12,1,13, + 1,13,1,13,1,13,3,13,135,8,13,1,14,1,14,1,14,5,14,140,8,14,10,14,12,14, + 143,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,8,10,1,0,8,9,1,0,1,3,2,0,4,7,23,25,154,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,92,1,0,0,0, + 12,94,1,0,0,0,14,100,1,0,0,0,16,106,1,0,0,0,18,110,1,0,0,0,20,116,1,0, + 0,0,22,122,1,0,0,0,24,126,1,0,0,0,26,134,1,0,0,0,28,136,1,0,0,0,30,144, + 1,0,0,0,32,146,1,0,0,0,34,36,5,29,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,23,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,12,0,0,52,54,5,23,0,0,53,51,1,0,0,0,53,54, + 1,0,0,0,54,55,1,0,0,0,55,56,5,8,0,0,56,58,3,6,3,0,57,59,5,13,0,0,58,57, + 1,0,0,0,58,59,1,0,0,0,59,61,1,0,0,0,60,62,5,29,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,15,0,0,66,67, + 5,23,0,0,67,68,5,12,0,0,68,69,5,23,0,0,69,70,5,16,0,0,70,5,1,0,0,0,71, + 76,3,8,4,0,72,73,5,11,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,93,3,12,6,0,86,93,3,14,7,0,87,93,3,16,8,0,88,93,3,18,9,0,89, + 93,3,20,10,0,90,93,3,22,11,0,91,93,3,24,12,0,92,85,1,0,0,0,92,86,1,0,0, + 0,92,87,1,0,0,0,92,88,1,0,0,0,92,89,1,0,0,0,92,90,1,0,0,0,92,91,1,0,0, + 0,93,11,1,0,0,0,94,95,3,28,14,0,95,96,7,0,0,0,96,98,3,26,13,0,97,99,3, + 30,15,0,98,97,1,0,0,0,98,99,1,0,0,0,99,13,1,0,0,0,100,101,5,19,0,0,101, + 102,3,28,14,0,102,103,7,1,0,0,103,104,3,32,16,0,104,105,5,20,0,0,105,15, + 1,0,0,0,106,107,5,19,0,0,107,108,5,20,0,0,108,17,1,0,0,0,109,111,5,22, + 0,0,110,109,1,0,0,0,110,111,1,0,0,0,111,112,1,0,0,0,112,113,5,17,0,0,113, + 114,5,23,0,0,114,115,5,18,0,0,115,19,1,0,0,0,116,117,5,15,0,0,117,118, + 3,6,3,0,118,120,5,16,0,0,119,121,3,30,15,0,120,119,1,0,0,0,120,121,1,0, + 0,0,121,21,1,0,0,0,122,124,3,32,16,0,123,125,3,30,15,0,124,123,1,0,0,0, + 124,125,1,0,0,0,125,23,1,0,0,0,126,128,5,23,0,0,127,129,3,30,15,0,128, + 127,1,0,0,0,128,129,1,0,0,0,129,25,1,0,0,0,130,135,3,18,9,0,131,135,3, + 20,10,0,132,135,3,22,11,0,133,135,3,24,12,0,134,130,1,0,0,0,134,131,1, + 0,0,0,134,132,1,0,0,0,134,133,1,0,0,0,135,27,1,0,0,0,136,141,5,23,0,0, + 137,138,5,21,0,0,138,140,5,23,0,0,139,137,1,0,0,0,140,143,1,0,0,0,141, + 139,1,0,0,0,141,142,1,0,0,0,142,29,1,0,0,0,143,141,1,0,0,0,144,145,7,2, + 0,0,145,31,1,0,0,0,146,147,7,3,0,0,147,33,1,0,0,0,16,37,43,49,53,58,63, + 76,82,92,98,110,120,124,128,134,141 + }; + + 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 00000000..658bbffc --- /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/Model/AssignmentElement.cs b/SysML2.NET.CodeGenerator/Grammar/Model/AssignmentElement.cs new file mode 100644 index 00000000..19d83112 --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/Model/AssignmentElement.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 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; } + + /// + /// Getss or sets the assignment value + /// + public RuleElement Value { 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 00000000..c6fb5b1a --- /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 + { + /// + /// All that are part of the group + /// + public List Elements { get; } = []; + } +} diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/NonParsingAssignmentElement.cs b/SysML2.NET.CodeGenerator/Grammar/Model/NonParsingAssignmentElement.cs new file mode 100644 index 00000000..54060b60 --- /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 00000000..48d3d91a --- /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 00000000..c7858dfb --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/Model/RuleElement.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.Linq; + + /// + /// Base class that provides information about element that is part of a rule + /// + public abstract class RuleElement + { + /// + /// 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); + } +} diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/RuleParameter.cs b/SysML2.NET.CodeGenerator/Grammar/Model/RuleParameter.cs new file mode 100644 index 00000000..aa497875 --- /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 00000000..ac2f8abe --- /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 00000000..957fb5d5 --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/Model/TextualNotationRule.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.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 the collection of defined + /// + public List Elements { get; } = []; + } +} diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/TextualNotationSpecification.cs b/SysML2.NET.CodeGenerator/Grammar/Model/TextualNotationSpecification.cs new file mode 100644 index 00000000..affae75c --- /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/TextualNotationSpecificationVisitor.cs b/SysML2.NET.CodeGenerator/Grammar/TextualNotationSpecificationVisitor.cs new file mode 100644 index 00000000..a5fcd1b6 --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/TextualNotationSpecificationVisitor.cs @@ -0,0 +1,180 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// 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.name.Text + }; + + if (context.parameter_list() != null) + { + rule.Parameter = new RuleParameter() + { + ParameterName = context.parameter_list().param_name.Text, + TargetElementName = context.parameter_list().param_type.Text + }; + } + + rule.Elements.AddRange((List)this.Visit(context.rule_body)); + return rule; + } + + /// + /// Visit a parse tree produced by . + /// + /// The parse tree. + /// The visitor result, as a collection of + public override object VisitAlternatives(kebnfParser.AlternativesContext context) + { + return context.alternative().Select(a => (Alternatives)this.Visit(a)).SelectMany(x => x.Elements).ToList(); + } + + /// + /// 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(); + alternatives.Elements.AddRange(context.element().Select(e => (RuleElement)this.Visit(e))); + return alternatives; + } + + /// + /// Visit a parse tree produced by . + /// + /// The parse tree. + /// The visitor result, as . + public override object VisitAssignment(kebnfParser.AssignmentContext context) + { + return new AssignmentElement() + { + Property = context.property.GetText(), + Operator = context.op.Text, + Suffix = context.suffix?.GetText(), + Value = (RuleElement)this.Visit(context.content) + }; + } + + /// + /// 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() + }; + } + + /// + /// 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(), + }; + + group.Elements.AddRange((List)this.Visit(context.alternatives())); + 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.GetText().Trim('\''), + Suffix = context.suffix?.GetText() + }; + } + + /// + /// 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() + }; + } + + /// + /// Provides mapping data class for the alternative grammar part + /// + private class Alternatives + { + /// + /// Gets a collection of that is part of the + /// + public List Elements { get; } = []; + } + } +} diff --git a/SysML2.NET.CodeGenerator/SysML2.NET.CodeGenerator.csproj b/SysML2.NET.CodeGenerator/SysML2.NET.CodeGenerator.csproj index 3389fd24..334552c7 100644 --- a/SysML2.NET.CodeGenerator/SysML2.NET.CodeGenerator.csproj +++ b/SysML2.NET.CodeGenerator/SysML2.NET.CodeGenerator.csproj @@ -19,8 +19,9 @@ en-US - - + + + @@ -240,4 +241,17 @@ Always + + + datamodel\kebnf.g4 + + + datamodel\KerML-textual-bnf.kebnf + Always + + + datamodel\SysML-textual-bnf.kebnf + Always + + \ No newline at end of file From ea686ba242d4de0b97ac455c91f0449a01828bc4 Mon Sep 17 00:00:00 2001 From: atheate Date: Thu, 19 Feb 2026 15:36:57 +0100 Subject: [PATCH 03/33] [WIP] First draft of Code-Gen --- ...tualNotationBuilderGeneratorTestFixture.cs | 71 ++ .../UmlCoreTextualNotationBuilderGenerator.cs | 199 +++++ .../Grammar/GrammarLoader.cs | 57 ++ .../SysML2.NET.CodeGenerator.csproj | 6 + ...xtual-notation-builder-facade-template.hbs | 60 ++ ...core-textual-notation-builder-template.hbs | 57 ++ ...AcceptActionUsageTextualNotationBuilder.cs | 56 ++ .../ActionDefinitionTextualNotationBuilder.cs | 56 ++ .../ActionUsageTextualNotationBuilder.cs | 56 ++ .../ActorMembershipTextualNotationBuilder.cs | 56 ++ ...ocationDefinitionTextualNotationBuilder.cs | 56 ++ .../AllocationUsageTextualNotationBuilder.cs | 56 ++ ...sisCaseDefinitionTextualNotationBuilder.cs | 56 ++ ...AnalysisCaseUsageTextualNotationBuilder.cs | 56 ++ ...AnnotatingElementTextualNotationBuilder.cs | 56 ++ .../AnnotationTextualNotationBuilder.cs | 56 ++ ...rtConstraintUsageTextualNotationBuilder.cs | 56 ++ ...gnmentActionUsageTextualNotationBuilder.cs | 56 ++ ...ociationStructureTextualNotationBuilder.cs | 56 ++ .../AssociationTextualNotationBuilder.cs | 56 ++ ...tributeDefinitionTextualNotationBuilder.cs | 56 ++ .../AttributeUsageTextualNotationBuilder.cs | 56 ++ .../BehaviorTextualNotationBuilder.cs | 56 ++ ...gConnectorAsUsageTextualNotationBuilder.cs | 56 ++ .../BindingConnectorTextualNotationBuilder.cs | 56 ++ ...BooleanExpressionTextualNotationBuilder.cs | 56 ++ ...ulationDefinitionTextualNotationBuilder.cs | 56 ++ .../CalculationUsageTextualNotationBuilder.cs | 56 ++ .../CaseDefinitionTextualNotationBuilder.cs | 56 ++ .../CaseUsageTextualNotationBuilder.cs | 56 ++ .../ClassTextualNotationBuilder.cs | 56 ++ .../ClassifierTextualNotationBuilder.cs | 56 ++ ...CollectExpressionTextualNotationBuilder.cs | 56 ++ .../CommentTextualNotationBuilder.cs | 56 ++ ...ConcernDefinitionTextualNotationBuilder.cs | 56 ++ .../ConcernUsageTextualNotationBuilder.cs | 56 ++ ...tedPortDefinitionTextualNotationBuilder.cs | 56 ++ ...jugatedPortTypingTextualNotationBuilder.cs | 56 ++ .../ConjugationTextualNotationBuilder.cs | 56 ++ ...nectionDefinitionTextualNotationBuilder.cs | 56 ++ .../ConnectionUsageTextualNotationBuilder.cs | 56 ++ .../ConnectorTextualNotationBuilder.cs | 56 ++ ...straintDefinitionTextualNotationBuilder.cs | 56 ++ .../ConstraintUsageTextualNotationBuilder.cs | 56 ++ ...tructorExpressionTextualNotationBuilder.cs | 56 ++ .../CrossSubsettingTextualNotationBuilder.cs | 56 ++ .../DataTypeTextualNotationBuilder.cs | 56 ++ .../DecisionNodeTextualNotationBuilder.cs | 56 ++ .../DefinitionTextualNotationBuilder.cs | 56 ++ .../DependencyTextualNotationBuilder.cs | 56 ++ .../DifferencingTextualNotationBuilder.cs | 56 ++ .../DisjoiningTextualNotationBuilder.cs | 56 ++ .../DocumentationTextualNotationBuilder.cs | 56 ++ ...tFilterMembershipTextualNotationBuilder.cs | 56 ++ ...FeatureMembershipTextualNotationBuilder.cs | 56 ++ ...erationDefinitionTextualNotationBuilder.cs | 56 ++ .../EnumerationUsageTextualNotationBuilder.cs | 56 ++ ...ntOccurrenceUsageTextualNotationBuilder.cs | 56 ++ ...ExhibitStateUsageTextualNotationBuilder.cs | 56 ++ .../ExpressionTextualNotationBuilder.cs | 56 ++ ...reChainExpressionTextualNotationBuilder.cs | 56 ++ .../FeatureChainingTextualNotationBuilder.cs | 56 ++ .../FeatureInvertingTextualNotationBuilder.cs | 56 ++ ...FeatureMembershipTextualNotationBuilder.cs | 56 ++ ...ferenceExpressionTextualNotationBuilder.cs | 56 ++ .../FeatureTextualNotationBuilder.cs | 56 ++ .../FeatureTypingTextualNotationBuilder.cs | 56 ++ .../FeatureValueTextualNotationBuilder.cs | 56 ++ .../FlowDefinitionTextualNotationBuilder.cs | 56 ++ .../FlowEndTextualNotationBuilder.cs | 56 ++ .../FlowTextualNotationBuilder.cs | 56 ++ .../FlowUsageTextualNotationBuilder.cs | 56 ++ ...orLoopActionUsageTextualNotationBuilder.cs | 56 ++ .../ForkNodeTextualNotationBuilder.cs | 56 ++ ...ConcernMembershipTextualNotationBuilder.cs | 56 ++ .../FunctionTextualNotationBuilder.cs | 56 ++ .../IfActionUsageTextualNotationBuilder.cs | 56 ++ ...cludeUseCaseUsageTextualNotationBuilder.cs | 56 ++ .../IndexExpressionTextualNotationBuilder.cs | 56 ++ .../InteractionTextualNotationBuilder.cs | 56 ++ ...terfaceDefinitionTextualNotationBuilder.cs | 56 ++ .../InterfaceUsageTextualNotationBuilder.cs | 56 ++ .../IntersectingTextualNotationBuilder.cs | 56 ++ .../InvariantTextualNotationBuilder.cs | 56 ++ ...ocationExpressionTextualNotationBuilder.cs | 56 ++ .../ItemDefinitionTextualNotationBuilder.cs | 56 ++ .../ItemUsageTextualNotationBuilder.cs | 56 ++ .../JoinNodeTextualNotationBuilder.cs | 56 ++ .../LibraryPackageTextualNotationBuilder.cs | 56 ++ .../LiteralBooleanTextualNotationBuilder.cs | 56 ++ ...LiteralExpressionTextualNotationBuilder.cs | 56 ++ .../LiteralInfinityTextualNotationBuilder.cs | 56 ++ .../LiteralIntegerTextualNotationBuilder.cs | 56 ++ .../LiteralRationalTextualNotationBuilder.cs | 56 ++ .../LiteralStringTextualNotationBuilder.cs | 56 ++ .../MembershipExposeTextualNotationBuilder.cs | 56 ++ .../MembershipImportTextualNotationBuilder.cs | 56 ++ .../MembershipTextualNotationBuilder.cs | 56 ++ .../MergeNodeTextualNotationBuilder.cs | 56 ++ .../MetaclassTextualNotationBuilder.cs | 56 ++ ...aAccessExpressionTextualNotationBuilder.cs | 56 ++ ...etadataDefinitionTextualNotationBuilder.cs | 56 ++ .../MetadataFeatureTextualNotationBuilder.cs | 56 ++ .../MetadataUsageTextualNotationBuilder.cs | 56 ++ ...MultiplicityRangeTextualNotationBuilder.cs | 56 ++ .../MultiplicityTextualNotationBuilder.cs | 56 ++ .../NamespaceExposeTextualNotationBuilder.cs | 56 ++ .../NamespaceImportTextualNotationBuilder.cs | 56 ++ .../NamespaceTextualNotationBuilder.cs | 56 ++ .../NullExpressionTextualNotationBuilder.cs | 56 ++ ...jectiveMembershipTextualNotationBuilder.cs | 56 ++ ...urrenceDefinitionTextualNotationBuilder.cs | 56 ++ .../OccurrenceUsageTextualNotationBuilder.cs | 56 ++ ...peratorExpressionTextualNotationBuilder.cs | 56 ++ .../OwningMembershipTextualNotationBuilder.cs | 56 ++ .../PackageTextualNotationBuilder.cs | 56 ++ ...rameterMembershipTextualNotationBuilder.cs | 56 ++ .../PartDefinitionTextualNotationBuilder.cs | 56 ++ .../PartUsageTextualNotationBuilder.cs | 56 ++ .../PayloadFeatureTextualNotationBuilder.cs | 56 ++ ...erformActionUsageTextualNotationBuilder.cs | 56 ++ .../PortConjugationTextualNotationBuilder.cs | 56 ++ .../PortDefinitionTextualNotationBuilder.cs | 56 ++ .../PortUsageTextualNotationBuilder.cs | 56 ++ .../PredicateTextualNotationBuilder.cs | 56 ++ .../RedefinitionTextualNotationBuilder.cs | 56 ++ ...ferenceSubsettingTextualNotationBuilder.cs | 56 ++ .../ReferenceUsageTextualNotationBuilder.cs | 56 ++ ...nderingDefinitionTextualNotationBuilder.cs | 56 ++ .../RenderingUsageTextualNotationBuilder.cs | 56 ++ ...straintMembershipTextualNotationBuilder.cs | 56 ++ ...irementDefinitionTextualNotationBuilder.cs | 56 ++ .../RequirementUsageTextualNotationBuilder.cs | 56 ++ ...icationMembershipTextualNotationBuilder.cs | 56 ++ ...ressionMembershipTextualNotationBuilder.cs | 56 ++ ...rameterMembershipTextualNotationBuilder.cs | 56 ++ ...yRequirementUsageTextualNotationBuilder.cs | 56 ++ .../SelectExpressionTextualNotationBuilder.cs | 56 ++ .../SendActionUsageTextualNotationBuilder.cs | 56 ++ .../SpecializationTextualNotationBuilder.cs | 56 ++ ...eholderMembershipTextualNotationBuilder.cs | 56 ++ .../StateDefinitionTextualNotationBuilder.cs | 56 ++ ...bactionMembershipTextualNotationBuilder.cs | 56 ++ .../StateUsageTextualNotationBuilder.cs | 56 ++ .../StepTextualNotationBuilder.cs | 56 ++ .../StructureTextualNotationBuilder.cs | 56 ++ ...SubclassificationTextualNotationBuilder.cs | 56 ++ ...SubjectMembershipTextualNotationBuilder.cs | 56 ++ .../SubsettingTextualNotationBuilder.cs | 56 ++ ...SuccessionAsUsageTextualNotationBuilder.cs | 56 ++ .../SuccessionFlowTextualNotationBuilder.cs | 56 ++ ...ccessionFlowUsageTextualNotationBuilder.cs | 56 ++ .../SuccessionTextualNotationBuilder.cs | 56 ++ ...minateActionUsageTextualNotationBuilder.cs | 56 ++ .../TextualNotationBuilderFacade.cs | 722 ++++++++++++++++++ ...ualRepresentationTextualNotationBuilder.cs | 56 ++ ...FeatureMembershipTextualNotationBuilder.cs | 56 ++ .../TransitionUsageTextualNotationBuilder.cs | 56 ++ ...ocationExpressionTextualNotationBuilder.cs | 56 ++ .../TypeFeaturingTextualNotationBuilder.cs | 56 ++ .../TypeTextualNotationBuilder.cs | 56 ++ .../UnioningTextualNotationBuilder.cs | 56 ++ .../UsageTextualNotationBuilder.cs | 56 ++ ...UseCaseDefinitionTextualNotationBuilder.cs | 56 ++ .../UseCaseUsageTextualNotationBuilder.cs | 56 ++ ...VariantMembershipTextualNotationBuilder.cs | 56 ++ ...ionCaseDefinitionTextualNotationBuilder.cs | 56 ++ ...ficationCaseUsageTextualNotationBuilder.cs | 56 ++ .../ViewDefinitionTextualNotationBuilder.cs | 56 ++ ...nderingMembershipTextualNotationBuilder.cs | 56 ++ .../ViewUsageTextualNotationBuilder.cs | 56 ++ ...ewpointDefinitionTextualNotationBuilder.cs | 56 ++ .../ViewpointUsageTextualNotationBuilder.cs | 56 ++ ...leLoopActionUsageTextualNotationBuilder.cs | 56 ++ .../ITextualNotationBuilderFacade.cs | 37 + .../TextualNotation/TextualNotationBuilder.cs | 52 ++ 176 files changed, 10613 insertions(+) create mode 100644 SysML2.NET.CodeGenerator.Tests/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGeneratorTestFixture.cs create mode 100644 SysML2.NET.CodeGenerator/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGenerator.cs create mode 100644 SysML2.NET.CodeGenerator/Grammar/GrammarLoader.cs create mode 100644 SysML2.NET.CodeGenerator/Templates/Uml/core-textual-notation-builder-facade-template.hbs create mode 100644 SysML2.NET.CodeGenerator/Templates/Uml/core-textual-notation-builder-template.hbs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionDefinitionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActorMembershipTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationDefinitionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseDefinitionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotatingElementTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssertConstraintUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssignmentActionUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationStructureTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeDefinitionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BehaviorTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorAsUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BooleanExpressionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationDefinitionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseDefinitionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CollectExpressionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CommentTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernDefinitionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortDefinitionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortTypingTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugationTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionDefinitionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintDefinitionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstructorExpressionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CrossSubsettingTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DataTypeTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DecisionNodeTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DependencyTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DifferencingTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DisjoiningTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DocumentationTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementFilterMembershipTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EndFeatureMembershipTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationDefinitionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EventOccurrenceUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExhibitStateUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainExpressionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainingTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureInvertingTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureReferenceExpressionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureValueTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowDefinitionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowEndTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForLoopActionUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForkNodeTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FramedConcernMembershipTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FunctionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IncludeUseCaseUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IndexExpressionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InteractionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceDefinitionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IntersectingTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemDefinitionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/JoinNodeTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LibraryPackageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralBooleanTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralExpressionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralInfinityTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralIntegerTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralRationalTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralStringTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipExposeTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MergeNodeTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetaclassTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataAccessExpressionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityRangeTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceExposeTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceImportTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NullExpressionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ObjectiveMembershipTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OperatorExpressionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ParameterMembershipTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartDefinitionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PayloadFeatureTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PerformActionUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortConjugationTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortDefinitionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PredicateTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceSubsettingTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingDefinitionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementDefinitionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementVerificationMembershipTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ResultExpressionMembershipTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReturnParameterMembershipTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SelectExpressionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StakeholderMembershipTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateDefinitionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateSubactionMembershipTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StepTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StructureTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubjectMembershipTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionAsUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TerminateActionUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TextualNotationBuilderFacade.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TextualRepresentationTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionFeatureMembershipTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TriggerInvocationExpressionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeFeaturingTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UnioningTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseDefinitionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VariantMembershipTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseDefinitionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewRenderingMembershipTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointDefinitionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/WhileLoopActionUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/ITextualNotationBuilderFacade.cs create mode 100644 SysML2.NET/TextualNotation/TextualNotationBuilder.cs 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 00000000..373705c5 --- /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/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGenerator.cs b/SysML2.NET.CodeGenerator/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGenerator.cs new file mode 100644 index 00000000..aa04cba9 --- /dev/null +++ b/SysML2.NET.CodeGenerator/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGenerator.cs @@ -0,0 +1,199 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// 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 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(); + } + + /// + /// 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 concrete + /// + /// + /// 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 concrete + /// + /// + /// 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 classes = xmiReaderResult.QueryContainedAndImported("SysML") + .SelectMany(x => x.PackagedElement.OfType()) + .Where(x => !x.IsAbstract) + .ToList(); + + foreach (var umlClass in classes) + { + var generatedBuilder = template(umlClass); + generatedBuilder = this.CodeCleanup(generatedBuilder); + + var fileName = $"{umlClass.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/GrammarLoader.cs b/SysML2.NET.CodeGenerator/Grammar/GrammarLoader.cs new file mode 100644 index 00000000..9aa3d884 --- /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/SysML2.NET.CodeGenerator.csproj b/SysML2.NET.CodeGenerator/SysML2.NET.CodeGenerator.csproj index 334552c7..2f8d0b3e 100644 --- a/SysML2.NET.CodeGenerator/SysML2.NET.CodeGenerator.csproj +++ b/SysML2.NET.CodeGenerator/SysML2.NET.CodeGenerator.csproj @@ -223,6 +223,12 @@ Always + + Always + + + Always + 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 00000000..e41972e0 --- /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 00000000..97f881e3 --- /dev/null +++ b/SysML2.NET.CodeGenerator/Templates/Uml/core-textual-notation-builder-template.hbs @@ -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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class {{this.Name}}TextualNotationBuilder: TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public {{this.Name}}TextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.{{ #NamedElement.WriteFullyQualifiedNameSpace this }}.{{ this.Name }} poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ + \ No newline at end of file diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.cs new file mode 100644 index 00000000..a057be8f --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class AcceptActionUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public AcceptActionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.AcceptActionUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..c0a1f991 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionDefinitionTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class ActionDefinitionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public ActionDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.ActionDefinition poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..9e9b7320 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class ActionUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public ActionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.ActionUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..fc181961 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActorMembershipTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class ActorMembershipTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public ActorMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Requirements.ActorMembership poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..23b3a5d7 --- /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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class AllocationDefinitionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public AllocationDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Allocations.AllocationDefinition poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..cddc6e71 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class AllocationUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public AllocationUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Allocations.AllocationUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..d376b8d3 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseDefinitionTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class AnalysisCaseDefinitionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public AnalysisCaseDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.AnalysisCases.AnalysisCaseDefinition poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..fd693722 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class AnalysisCaseUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public AnalysisCaseUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.AnalysisCases.AnalysisCaseUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..7f9b8724 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotatingElementTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class AnnotatingElementTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public AnnotatingElementTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Root.Annotations.AnnotatingElement poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..559818d2 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class AnnotationTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public AnnotationTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Root.Annotations.Annotation poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..a2106272 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssertConstraintUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class AssertConstraintUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public AssertConstraintUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Constraints.AssertConstraintUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..1fc7f5e7 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssignmentActionUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class AssignmentActionUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public AssignmentActionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.AssignmentActionUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..30b1950d --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationStructureTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class AssociationStructureTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public AssociationStructureTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Associations.AssociationStructure poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..4f3bfb17 --- /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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class AssociationTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public AssociationTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Associations.Association poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..0f4ea18f --- /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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class AttributeDefinitionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public AttributeDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Attributes.AttributeDefinition poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..ae50325d --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class AttributeUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public AttributeUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Attributes.AttributeUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..232c3f5e --- /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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class BehaviorTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public BehaviorTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Behaviors.Behavior poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..ceac3e0b --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorAsUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class BindingConnectorAsUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public BindingConnectorAsUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Connections.BindingConnectorAsUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..0bb69c31 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class BindingConnectorTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public BindingConnectorTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Connectors.BindingConnector poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..65c9e7eb --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BooleanExpressionTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class BooleanExpressionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public BooleanExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Functions.BooleanExpression poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..59293bee --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationDefinitionTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class CalculationDefinitionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public CalculationDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Calculations.CalculationDefinition poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..562cdf64 --- /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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class CalculationUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public CalculationUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Calculations.CalculationUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..aaffa984 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseDefinitionTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class CaseDefinitionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public CaseDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Cases.CaseDefinition poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..9382d1f7 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class CaseUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public CaseUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Cases.CaseUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..ac192b74 --- /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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class ClassTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public ClassTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Classes.Class poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..45f43954 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class ClassifierTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public ClassifierTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Classifiers.Classifier poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..8cc44e44 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CollectExpressionTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class CollectExpressionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public CollectExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.CollectExpression poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..f2560afd --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CommentTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class CommentTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public CommentTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Root.Annotations.Comment poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..56613677 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernDefinitionTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class ConcernDefinitionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public ConcernDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Requirements.ConcernDefinition poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..d4344613 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class ConcernUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public ConcernUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Requirements.ConcernUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..c35af26b --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortDefinitionTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class ConjugatedPortDefinitionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public ConjugatedPortDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Ports.ConjugatedPortDefinition poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..773c4da5 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortTypingTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class ConjugatedPortTypingTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public ConjugatedPortTypingTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Ports.ConjugatedPortTyping poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..9f6b63e5 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugationTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class ConjugationTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public ConjugationTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Types.Conjugation poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..5ff8d1b9 --- /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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class ConnectionDefinitionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public ConnectionDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Connections.ConnectionDefinition poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..555cc96e --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class ConnectionUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public ConnectionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Connections.ConnectionUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..28988131 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class ConnectorTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public ConnectorTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Connectors.Connector poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..64abd164 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintDefinitionTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class ConstraintDefinitionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public ConstraintDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Constraints.ConstraintDefinition poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..648cef38 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class ConstraintUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public ConstraintUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Constraints.ConstraintUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..726aa707 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstructorExpressionTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class ConstructorExpressionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public ConstructorExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.ConstructorExpression poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..d2287a2f --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CrossSubsettingTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class CrossSubsettingTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public CrossSubsettingTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Features.CrossSubsetting poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..50ee12ae --- /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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class DataTypeTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public DataTypeTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.DataTypes.DataType poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..b9702f8a --- /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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class DecisionNodeTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public DecisionNodeTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.DecisionNode poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..29ee79ac --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class DefinitionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public DefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.Definition poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..a8ebe9b6 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DependencyTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class DependencyTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public DependencyTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Root.Dependencies.Dependency poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..3082177e --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DifferencingTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class DifferencingTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public DifferencingTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Types.Differencing poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..5ceaae51 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DisjoiningTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class DisjoiningTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public DisjoiningTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Types.Disjoining poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..1ece483a --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DocumentationTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class DocumentationTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public DocumentationTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Root.Annotations.Documentation poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..04b434fa --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementFilterMembershipTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class ElementFilterMembershipTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public ElementFilterMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Packages.ElementFilterMembership poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..6f8d4a1e --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EndFeatureMembershipTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class EndFeatureMembershipTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public EndFeatureMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Features.EndFeatureMembership poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..ad96cb47 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationDefinitionTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class EnumerationDefinitionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public EnumerationDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Enumerations.EnumerationDefinition poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..a834048d --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class EnumerationUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public EnumerationUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Enumerations.EnumerationUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..3789b0e7 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EventOccurrenceUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class EventOccurrenceUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public EventOccurrenceUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Occurrences.EventOccurrenceUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..df31bfbf --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExhibitStateUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class ExhibitStateUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public ExhibitStateUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.States.ExhibitStateUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..308497c0 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class ExpressionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public ExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Functions.Expression poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..19670dbc --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainExpressionTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class FeatureChainExpressionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public FeatureChainExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.FeatureChainExpression poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..18d69384 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainingTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class FeatureChainingTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public FeatureChainingTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Features.FeatureChaining poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..f413882f --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureInvertingTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class FeatureInvertingTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public FeatureInvertingTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Features.FeatureInverting poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..6455eba3 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class FeatureMembershipTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public FeatureMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Types.FeatureMembership poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..f3168215 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureReferenceExpressionTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class FeatureReferenceExpressionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public FeatureReferenceExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.FeatureReferenceExpression poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..06e184cf --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class FeatureTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public FeatureTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Features.Feature poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..be37e6ff --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class FeatureTypingTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public FeatureTypingTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Features.FeatureTyping poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..41f2c911 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureValueTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class FeatureValueTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public FeatureValueTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.FeatureValues.FeatureValue poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..8bb1986c --- /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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class FlowDefinitionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public FlowDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Flows.FlowDefinition poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..d3d875ab --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowEndTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class FlowEndTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public FlowEndTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Interactions.FlowEnd poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..7205ef89 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class FlowTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public FlowTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Interactions.Flow poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..924473af --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class FlowUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public FlowUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Flows.FlowUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..f87ed1bb --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForLoopActionUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class ForLoopActionUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public ForLoopActionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.ForLoopActionUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..0703248e --- /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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class ForkNodeTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public ForkNodeTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.ForkNode poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..95b1c3db --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FramedConcernMembershipTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class FramedConcernMembershipTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public FramedConcernMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Requirements.FramedConcernMembership poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..10c29640 --- /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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class FunctionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public FunctionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Functions.Function poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..c92456fe --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class IfActionUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public IfActionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.IfActionUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..2b98ef33 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IncludeUseCaseUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class IncludeUseCaseUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public IncludeUseCaseUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.UseCases.IncludeUseCaseUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..c0234f57 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IndexExpressionTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class IndexExpressionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public IndexExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.IndexExpression poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..661ecef7 --- /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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class InteractionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public InteractionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Interactions.Interaction poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..4e4ef98f --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceDefinitionTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class InterfaceDefinitionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public InterfaceDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Interfaces.InterfaceDefinition poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..5d9c5911 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class InterfaceUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public InterfaceUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Interfaces.InterfaceUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..e637b316 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IntersectingTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class IntersectingTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public IntersectingTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Types.Intersecting poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..3823761f --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class InvariantTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public InvariantTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Functions.Invariant poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..10001e4e --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class InvocationExpressionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public InvocationExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.InvocationExpression poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..27431910 --- /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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class ItemDefinitionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public ItemDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Items.ItemDefinition poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..20a21075 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class ItemUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public ItemUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Items.ItemUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..a8acbff3 --- /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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class JoinNodeTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public JoinNodeTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.JoinNode poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..0d4012b8 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LibraryPackageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class LibraryPackageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public LibraryPackageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Packages.LibraryPackage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..2a90066f --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralBooleanTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class LiteralBooleanTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public LiteralBooleanTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.LiteralBoolean poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..ae091cad --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralExpressionTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class LiteralExpressionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public LiteralExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.LiteralExpression poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..6cf1bb30 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralInfinityTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class LiteralInfinityTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public LiteralInfinityTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.LiteralInfinity poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..147116ae --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralIntegerTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class LiteralIntegerTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public LiteralIntegerTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.LiteralInteger poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralRationalTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralRationalTextualNotationBuilder.cs new file mode 100644 index 00000000..c8b499bd --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralRationalTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class LiteralRationalTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public LiteralRationalTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.LiteralRational poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..4aff1cff --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralStringTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class LiteralStringTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public LiteralStringTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.LiteralString poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..26b67df2 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipExposeTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class MembershipExposeTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public MembershipExposeTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Views.MembershipExpose poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..5f6f73f1 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class MembershipImportTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public MembershipImportTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Root.Namespaces.MembershipImport poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..596f0685 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class MembershipTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public MembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Root.Namespaces.Membership poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..04858ab6 --- /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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class MergeNodeTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public MergeNodeTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.MergeNode poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..73f49827 --- /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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class MetaclassTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public MetaclassTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Metadata.Metaclass poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..21ad5ee7 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataAccessExpressionTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class MetadataAccessExpressionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public MetadataAccessExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.MetadataAccessExpression poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..8551fb97 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class MetadataDefinitionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public MetadataDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Metadata.MetadataDefinition poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..74ebcb0d --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class MetadataFeatureTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public MetadataFeatureTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Metadata.MetadataFeature poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..d8f44f9d --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class MetadataUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public MetadataUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Metadata.MetadataUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..45d03d82 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityRangeTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class MultiplicityRangeTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public MultiplicityRangeTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Multiplicities.MultiplicityRange poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..b12a1877 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class MultiplicityTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public MultiplicityTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Types.Multiplicity poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..b39486ad --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceExposeTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class NamespaceExposeTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public NamespaceExposeTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Views.NamespaceExpose poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..e3c7988b --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceImportTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class NamespaceImportTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public NamespaceImportTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Root.Namespaces.NamespaceImport poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..9826ab5b --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class NamespaceTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public NamespaceTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Root.Namespaces.Namespace poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..dc9a2ba4 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NullExpressionTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class NullExpressionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public NullExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.NullExpression poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..1d345283 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ObjectiveMembershipTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class ObjectiveMembershipTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public ObjectiveMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Cases.ObjectiveMembership poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..150bd0b3 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class OccurrenceDefinitionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public OccurrenceDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Occurrences.OccurrenceDefinition poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..4ffded5e --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class OccurrenceUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public OccurrenceUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Occurrences.OccurrenceUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..8f42dec7 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OperatorExpressionTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class OperatorExpressionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public OperatorExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.OperatorExpression poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..2ac702d5 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class OwningMembershipTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public OwningMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Root.Namespaces.OwningMembership poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..bf9430be --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class PackageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public PackageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Packages.Package poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..fdbb5a85 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ParameterMembershipTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class ParameterMembershipTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public ParameterMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Behaviors.ParameterMembership poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..b2035ace --- /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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class PartDefinitionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public PartDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Parts.PartDefinition poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..4029b06a --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class PartUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public PartUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Parts.PartUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..0c2ce859 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PayloadFeatureTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class PayloadFeatureTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public PayloadFeatureTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Interactions.PayloadFeature poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..6b4b19a5 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PerformActionUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class PerformActionUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public PerformActionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.PerformActionUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..9b135767 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortConjugationTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class PortConjugationTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public PortConjugationTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Ports.PortConjugation poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..d8afb8df --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortDefinitionTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class PortDefinitionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public PortDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Ports.PortDefinition poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..0767bb08 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class PortUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public PortUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Ports.PortUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..e60633c5 --- /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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class PredicateTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public PredicateTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Functions.Predicate poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..417bff22 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class RedefinitionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public RedefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Features.Redefinition poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..8f623a0f --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceSubsettingTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class ReferenceSubsettingTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public ReferenceSubsettingTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Features.ReferenceSubsetting poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..69cb2e00 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class ReferenceUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public ReferenceUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.ReferenceUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..45e90e18 --- /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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class RenderingDefinitionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public RenderingDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Views.RenderingDefinition poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..3ee43fca --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class RenderingUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public RenderingUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Views.RenderingUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..f677c608 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class RequirementConstraintMembershipTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public RequirementConstraintMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Requirements.RequirementConstraintMembership poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..f47ba59d --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementDefinitionTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class RequirementDefinitionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public RequirementDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Requirements.RequirementDefinition poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..412d6708 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class RequirementUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public RequirementUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Requirements.RequirementUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..532a4856 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementVerificationMembershipTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class RequirementVerificationMembershipTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public RequirementVerificationMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.VerificationCases.RequirementVerificationMembership poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..c2fade6a --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ResultExpressionMembershipTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class ResultExpressionMembershipTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public ResultExpressionMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Functions.ResultExpressionMembership poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..34b0c6c2 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReturnParameterMembershipTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class ReturnParameterMembershipTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public ReturnParameterMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Functions.ReturnParameterMembership poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..faaf6298 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class SatisfyRequirementUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public SatisfyRequirementUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Requirements.SatisfyRequirementUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..0248d379 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SelectExpressionTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class SelectExpressionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public SelectExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.SelectExpression poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..089e72df --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class SendActionUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public SendActionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.SendActionUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..8bcf649f --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class SpecializationTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public SpecializationTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Types.Specialization poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..1166d807 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StakeholderMembershipTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class StakeholderMembershipTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public StakeholderMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Requirements.StakeholderMembership poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..595ab509 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateDefinitionTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class StateDefinitionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public StateDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.States.StateDefinition poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..68e24065 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateSubactionMembershipTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class StateSubactionMembershipTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public StateSubactionMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.States.StateSubactionMembership poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..a8891cd8 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class StateUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public StateUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.States.StateUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..23a7d396 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StepTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class StepTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public StepTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Behaviors.Step poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..c5be5072 --- /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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class StructureTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public StructureTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Structures.Structure poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..2c1f46d7 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class SubclassificationTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public SubclassificationTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Classifiers.Subclassification poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..098f9d64 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubjectMembershipTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class SubjectMembershipTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public SubjectMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Requirements.SubjectMembership poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..0a4ec260 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class SubsettingTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public SubsettingTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Features.Subsetting poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..4f273f55 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionAsUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class SuccessionAsUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public SuccessionAsUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Connections.SuccessionAsUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..1e9cc87d --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class SuccessionFlowTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public SuccessionFlowTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Interactions.SuccessionFlow poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..5affca57 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class SuccessionFlowUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public SuccessionFlowUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Flows.SuccessionFlowUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..6a44b58a --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class SuccessionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public SuccessionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Connectors.Succession poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..0631c87b --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TerminateActionUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class TerminateActionUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public TerminateActionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.TerminateActionUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TextualNotationBuilderFacade.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TextualNotationBuilderFacade.cs new file mode 100644 index 00000000..20ed5cb6 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TextualNotationBuilderFacade.cs @@ -0,0 +1,722 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// 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) + { + case SysML2.NET.Core.POCO.Systems.Ports.PortUsage pocoPortUsage: + var portUsageTextualNotationBuilder = new PortUsageTextualNotationBuilder(this); + return portUsageTextualNotationBuilder.BuildTextualNotation(pocoPortUsage); + + case SysML2.NET.Core.POCO.Systems.Ports.PortDefinition pocoPortDefinition: + var portDefinitionTextualNotationBuilder = new PortDefinitionTextualNotationBuilder(this); + return portDefinitionTextualNotationBuilder.BuildTextualNotation(pocoPortDefinition); + + case SysML2.NET.Core.POCO.Systems.Ports.ConjugatedPortDefinition pocoConjugatedPortDefinition: + var conjugatedPortDefinitionTextualNotationBuilder = new ConjugatedPortDefinitionTextualNotationBuilder(this); + return conjugatedPortDefinitionTextualNotationBuilder.BuildTextualNotation(pocoConjugatedPortDefinition); + + case SysML2.NET.Core.POCO.Systems.Ports.PortConjugation pocoPortConjugation: + var portConjugationTextualNotationBuilder = new PortConjugationTextualNotationBuilder(this); + return portConjugationTextualNotationBuilder.BuildTextualNotation(pocoPortConjugation); + + case SysML2.NET.Core.POCO.Systems.Ports.ConjugatedPortTyping pocoConjugatedPortTyping: + var conjugatedPortTypingTextualNotationBuilder = new ConjugatedPortTypingTextualNotationBuilder(this); + return conjugatedPortTypingTextualNotationBuilder.BuildTextualNotation(pocoConjugatedPortTyping); + + case SysML2.NET.Core.POCO.Systems.Attributes.AttributeDefinition pocoAttributeDefinition: + var attributeDefinitionTextualNotationBuilder = new AttributeDefinitionTextualNotationBuilder(this); + return attributeDefinitionTextualNotationBuilder.BuildTextualNotation(pocoAttributeDefinition); + + case SysML2.NET.Core.POCO.Systems.Attributes.AttributeUsage pocoAttributeUsage: + var attributeUsageTextualNotationBuilder = new AttributeUsageTextualNotationBuilder(this); + return attributeUsageTextualNotationBuilder.BuildTextualNotation(pocoAttributeUsage); + + case SysML2.NET.Core.POCO.Systems.Actions.AcceptActionUsage pocoAcceptActionUsage: + var acceptActionUsageTextualNotationBuilder = new AcceptActionUsageTextualNotationBuilder(this); + return acceptActionUsageTextualNotationBuilder.BuildTextualNotation(pocoAcceptActionUsage); + + case SysML2.NET.Core.POCO.Systems.Actions.SendActionUsage pocoSendActionUsage: + var sendActionUsageTextualNotationBuilder = new SendActionUsageTextualNotationBuilder(this); + return sendActionUsageTextualNotationBuilder.BuildTextualNotation(pocoSendActionUsage); + + case SysML2.NET.Core.POCO.Systems.Actions.PerformActionUsage pocoPerformActionUsage: + var performActionUsageTextualNotationBuilder = new PerformActionUsageTextualNotationBuilder(this); + return performActionUsageTextualNotationBuilder.BuildTextualNotation(pocoPerformActionUsage); + + case SysML2.NET.Core.POCO.Systems.Actions.ForkNode pocoForkNode: + var forkNodeTextualNotationBuilder = new ForkNodeTextualNotationBuilder(this); + return forkNodeTextualNotationBuilder.BuildTextualNotation(pocoForkNode); + + case SysML2.NET.Core.POCO.Systems.Actions.JoinNode pocoJoinNode: + var joinNodeTextualNotationBuilder = new JoinNodeTextualNotationBuilder(this); + return joinNodeTextualNotationBuilder.BuildTextualNotation(pocoJoinNode); + + case SysML2.NET.Core.POCO.Systems.Actions.ActionUsage pocoActionUsage: + var actionUsageTextualNotationBuilder = new ActionUsageTextualNotationBuilder(this); + return actionUsageTextualNotationBuilder.BuildTextualNotation(pocoActionUsage); + + case SysML2.NET.Core.POCO.Systems.Actions.DecisionNode pocoDecisionNode: + var decisionNodeTextualNotationBuilder = new DecisionNodeTextualNotationBuilder(this); + return decisionNodeTextualNotationBuilder.BuildTextualNotation(pocoDecisionNode); + + case SysML2.NET.Core.POCO.Systems.Actions.MergeNode pocoMergeNode: + var mergeNodeTextualNotationBuilder = new MergeNodeTextualNotationBuilder(this); + return mergeNodeTextualNotationBuilder.BuildTextualNotation(pocoMergeNode); + + case SysML2.NET.Core.POCO.Systems.Actions.ActionDefinition pocoActionDefinition: + var actionDefinitionTextualNotationBuilder = new ActionDefinitionTextualNotationBuilder(this); + return actionDefinitionTextualNotationBuilder.BuildTextualNotation(pocoActionDefinition); + + case SysML2.NET.Core.POCO.Systems.Actions.IfActionUsage pocoIfActionUsage: + var ifActionUsageTextualNotationBuilder = new IfActionUsageTextualNotationBuilder(this); + return ifActionUsageTextualNotationBuilder.BuildTextualNotation(pocoIfActionUsage); + + case SysML2.NET.Core.POCO.Systems.Actions.ForLoopActionUsage pocoForLoopActionUsage: + var forLoopActionUsageTextualNotationBuilder = new ForLoopActionUsageTextualNotationBuilder(this); + return forLoopActionUsageTextualNotationBuilder.BuildTextualNotation(pocoForLoopActionUsage); + + case SysML2.NET.Core.POCO.Systems.Actions.AssignmentActionUsage pocoAssignmentActionUsage: + var assignmentActionUsageTextualNotationBuilder = new AssignmentActionUsageTextualNotationBuilder(this); + return assignmentActionUsageTextualNotationBuilder.BuildTextualNotation(pocoAssignmentActionUsage); + + case SysML2.NET.Core.POCO.Systems.Actions.WhileLoopActionUsage pocoWhileLoopActionUsage: + var whileLoopActionUsageTextualNotationBuilder = new WhileLoopActionUsageTextualNotationBuilder(this); + return whileLoopActionUsageTextualNotationBuilder.BuildTextualNotation(pocoWhileLoopActionUsage); + + case SysML2.NET.Core.POCO.Systems.Actions.TriggerInvocationExpression pocoTriggerInvocationExpression: + var triggerInvocationExpressionTextualNotationBuilder = new TriggerInvocationExpressionTextualNotationBuilder(this); + return triggerInvocationExpressionTextualNotationBuilder.BuildTextualNotation(pocoTriggerInvocationExpression); + + case SysML2.NET.Core.POCO.Systems.Actions.TerminateActionUsage pocoTerminateActionUsage: + var terminateActionUsageTextualNotationBuilder = new TerminateActionUsageTextualNotationBuilder(this); + return terminateActionUsageTextualNotationBuilder.BuildTextualNotation(pocoTerminateActionUsage); + + case SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.Definition pocoDefinition: + var definitionTextualNotationBuilder = new DefinitionTextualNotationBuilder(this); + return definitionTextualNotationBuilder.BuildTextualNotation(pocoDefinition); + + case SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.Usage pocoUsage: + var usageTextualNotationBuilder = new UsageTextualNotationBuilder(this); + return usageTextualNotationBuilder.BuildTextualNotation(pocoUsage); + + case SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.ReferenceUsage pocoReferenceUsage: + var referenceUsageTextualNotationBuilder = new ReferenceUsageTextualNotationBuilder(this); + return referenceUsageTextualNotationBuilder.BuildTextualNotation(pocoReferenceUsage); + + case SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.VariantMembership pocoVariantMembership: + var variantMembershipTextualNotationBuilder = new VariantMembershipTextualNotationBuilder(this); + return variantMembershipTextualNotationBuilder.BuildTextualNotation(pocoVariantMembership); + + case SysML2.NET.Core.POCO.Systems.Parts.PartDefinition pocoPartDefinition: + var partDefinitionTextualNotationBuilder = new PartDefinitionTextualNotationBuilder(this); + return partDefinitionTextualNotationBuilder.BuildTextualNotation(pocoPartDefinition); + + case SysML2.NET.Core.POCO.Systems.Parts.PartUsage pocoPartUsage: + var partUsageTextualNotationBuilder = new PartUsageTextualNotationBuilder(this); + return partUsageTextualNotationBuilder.BuildTextualNotation(pocoPartUsage); + + case SysML2.NET.Core.POCO.Systems.Interfaces.InterfaceUsage pocoInterfaceUsage: + var interfaceUsageTextualNotationBuilder = new InterfaceUsageTextualNotationBuilder(this); + return interfaceUsageTextualNotationBuilder.BuildTextualNotation(pocoInterfaceUsage); + + case SysML2.NET.Core.POCO.Systems.Interfaces.InterfaceDefinition pocoInterfaceDefinition: + var interfaceDefinitionTextualNotationBuilder = new InterfaceDefinitionTextualNotationBuilder(this); + return interfaceDefinitionTextualNotationBuilder.BuildTextualNotation(pocoInterfaceDefinition); + + case SysML2.NET.Core.POCO.Systems.States.StateUsage pocoStateUsage: + var stateUsageTextualNotationBuilder = new StateUsageTextualNotationBuilder(this); + return stateUsageTextualNotationBuilder.BuildTextualNotation(pocoStateUsage); + + case SysML2.NET.Core.POCO.Systems.States.StateSubactionMembership pocoStateSubactionMembership: + var stateSubactionMembershipTextualNotationBuilder = new StateSubactionMembershipTextualNotationBuilder(this); + return stateSubactionMembershipTextualNotationBuilder.BuildTextualNotation(pocoStateSubactionMembership); + + case SysML2.NET.Core.POCO.Systems.States.StateDefinition pocoStateDefinition: + var stateDefinitionTextualNotationBuilder = new StateDefinitionTextualNotationBuilder(this); + return stateDefinitionTextualNotationBuilder.BuildTextualNotation(pocoStateDefinition); + + case SysML2.NET.Core.POCO.Systems.States.TransitionUsage pocoTransitionUsage: + var transitionUsageTextualNotationBuilder = new TransitionUsageTextualNotationBuilder(this); + return transitionUsageTextualNotationBuilder.BuildTextualNotation(pocoTransitionUsage); + + case SysML2.NET.Core.POCO.Systems.States.TransitionFeatureMembership pocoTransitionFeatureMembership: + var transitionFeatureMembershipTextualNotationBuilder = new TransitionFeatureMembershipTextualNotationBuilder(this); + return transitionFeatureMembershipTextualNotationBuilder.BuildTextualNotation(pocoTransitionFeatureMembership); + + case SysML2.NET.Core.POCO.Systems.States.ExhibitStateUsage pocoExhibitStateUsage: + var exhibitStateUsageTextualNotationBuilder = new ExhibitStateUsageTextualNotationBuilder(this); + return exhibitStateUsageTextualNotationBuilder.BuildTextualNotation(pocoExhibitStateUsage); + + case SysML2.NET.Core.POCO.Systems.Constraints.ConstraintUsage pocoConstraintUsage: + var constraintUsageTextualNotationBuilder = new ConstraintUsageTextualNotationBuilder(this); + return constraintUsageTextualNotationBuilder.BuildTextualNotation(pocoConstraintUsage); + + case SysML2.NET.Core.POCO.Systems.Constraints.ConstraintDefinition pocoConstraintDefinition: + var constraintDefinitionTextualNotationBuilder = new ConstraintDefinitionTextualNotationBuilder(this); + return constraintDefinitionTextualNotationBuilder.BuildTextualNotation(pocoConstraintDefinition); + + case SysML2.NET.Core.POCO.Systems.Constraints.AssertConstraintUsage pocoAssertConstraintUsage: + var assertConstraintUsageTextualNotationBuilder = new AssertConstraintUsageTextualNotationBuilder(this); + return assertConstraintUsageTextualNotationBuilder.BuildTextualNotation(pocoAssertConstraintUsage); + + case SysML2.NET.Core.POCO.Systems.Requirements.RequirementDefinition pocoRequirementDefinition: + var requirementDefinitionTextualNotationBuilder = new RequirementDefinitionTextualNotationBuilder(this); + return requirementDefinitionTextualNotationBuilder.BuildTextualNotation(pocoRequirementDefinition); + + case SysML2.NET.Core.POCO.Systems.Requirements.SatisfyRequirementUsage pocoSatisfyRequirementUsage: + var satisfyRequirementUsageTextualNotationBuilder = new SatisfyRequirementUsageTextualNotationBuilder(this); + return satisfyRequirementUsageTextualNotationBuilder.BuildTextualNotation(pocoSatisfyRequirementUsage); + + case SysML2.NET.Core.POCO.Systems.Requirements.RequirementUsage pocoRequirementUsage: + var requirementUsageTextualNotationBuilder = new RequirementUsageTextualNotationBuilder(this); + return requirementUsageTextualNotationBuilder.BuildTextualNotation(pocoRequirementUsage); + + case SysML2.NET.Core.POCO.Systems.Requirements.RequirementConstraintMembership pocoRequirementConstraintMembership: + var requirementConstraintMembershipTextualNotationBuilder = new RequirementConstraintMembershipTextualNotationBuilder(this); + return requirementConstraintMembershipTextualNotationBuilder.BuildTextualNotation(pocoRequirementConstraintMembership); + + case SysML2.NET.Core.POCO.Systems.Requirements.SubjectMembership pocoSubjectMembership: + var subjectMembershipTextualNotationBuilder = new SubjectMembershipTextualNotationBuilder(this); + return subjectMembershipTextualNotationBuilder.BuildTextualNotation(pocoSubjectMembership); + + case SysML2.NET.Core.POCO.Systems.Requirements.FramedConcernMembership pocoFramedConcernMembership: + var framedConcernMembershipTextualNotationBuilder = new FramedConcernMembershipTextualNotationBuilder(this); + return framedConcernMembershipTextualNotationBuilder.BuildTextualNotation(pocoFramedConcernMembership); + + case SysML2.NET.Core.POCO.Systems.Requirements.ConcernDefinition pocoConcernDefinition: + var concernDefinitionTextualNotationBuilder = new ConcernDefinitionTextualNotationBuilder(this); + return concernDefinitionTextualNotationBuilder.BuildTextualNotation(pocoConcernDefinition); + + case SysML2.NET.Core.POCO.Systems.Requirements.ConcernUsage pocoConcernUsage: + var concernUsageTextualNotationBuilder = new ConcernUsageTextualNotationBuilder(this); + return concernUsageTextualNotationBuilder.BuildTextualNotation(pocoConcernUsage); + + case SysML2.NET.Core.POCO.Systems.Requirements.StakeholderMembership pocoStakeholderMembership: + var stakeholderMembershipTextualNotationBuilder = new StakeholderMembershipTextualNotationBuilder(this); + return stakeholderMembershipTextualNotationBuilder.BuildTextualNotation(pocoStakeholderMembership); + + case SysML2.NET.Core.POCO.Systems.Requirements.ActorMembership pocoActorMembership: + var actorMembershipTextualNotationBuilder = new ActorMembershipTextualNotationBuilder(this); + return actorMembershipTextualNotationBuilder.BuildTextualNotation(pocoActorMembership); + + case SysML2.NET.Core.POCO.Systems.Calculations.CalculationDefinition pocoCalculationDefinition: + var calculationDefinitionTextualNotationBuilder = new CalculationDefinitionTextualNotationBuilder(this); + return calculationDefinitionTextualNotationBuilder.BuildTextualNotation(pocoCalculationDefinition); + + case SysML2.NET.Core.POCO.Systems.Calculations.CalculationUsage pocoCalculationUsage: + var calculationUsageTextualNotationBuilder = new CalculationUsageTextualNotationBuilder(this); + return calculationUsageTextualNotationBuilder.BuildTextualNotation(pocoCalculationUsage); + + case SysML2.NET.Core.POCO.Systems.Connections.ConnectionDefinition pocoConnectionDefinition: + var connectionDefinitionTextualNotationBuilder = new ConnectionDefinitionTextualNotationBuilder(this); + return connectionDefinitionTextualNotationBuilder.BuildTextualNotation(pocoConnectionDefinition); + + case SysML2.NET.Core.POCO.Systems.Connections.ConnectionUsage pocoConnectionUsage: + var connectionUsageTextualNotationBuilder = new ConnectionUsageTextualNotationBuilder(this); + return connectionUsageTextualNotationBuilder.BuildTextualNotation(pocoConnectionUsage); + + case SysML2.NET.Core.POCO.Systems.Connections.SuccessionAsUsage pocoSuccessionAsUsage: + var successionAsUsageTextualNotationBuilder = new SuccessionAsUsageTextualNotationBuilder(this); + return successionAsUsageTextualNotationBuilder.BuildTextualNotation(pocoSuccessionAsUsage); + + case SysML2.NET.Core.POCO.Systems.Connections.BindingConnectorAsUsage pocoBindingConnectorAsUsage: + var bindingConnectorAsUsageTextualNotationBuilder = new BindingConnectorAsUsageTextualNotationBuilder(this); + return bindingConnectorAsUsageTextualNotationBuilder.BuildTextualNotation(pocoBindingConnectorAsUsage); + + case SysML2.NET.Core.POCO.Systems.Cases.CaseUsage pocoCaseUsage: + var caseUsageTextualNotationBuilder = new CaseUsageTextualNotationBuilder(this); + return caseUsageTextualNotationBuilder.BuildTextualNotation(pocoCaseUsage); + + case SysML2.NET.Core.POCO.Systems.Cases.CaseDefinition pocoCaseDefinition: + var caseDefinitionTextualNotationBuilder = new CaseDefinitionTextualNotationBuilder(this); + return caseDefinitionTextualNotationBuilder.BuildTextualNotation(pocoCaseDefinition); + + case SysML2.NET.Core.POCO.Systems.Cases.ObjectiveMembership pocoObjectiveMembership: + var objectiveMembershipTextualNotationBuilder = new ObjectiveMembershipTextualNotationBuilder(this); + return objectiveMembershipTextualNotationBuilder.BuildTextualNotation(pocoObjectiveMembership); + + case SysML2.NET.Core.POCO.Systems.AnalysisCases.AnalysisCaseUsage pocoAnalysisCaseUsage: + var analysisCaseUsageTextualNotationBuilder = new AnalysisCaseUsageTextualNotationBuilder(this); + return analysisCaseUsageTextualNotationBuilder.BuildTextualNotation(pocoAnalysisCaseUsage); + + case SysML2.NET.Core.POCO.Systems.AnalysisCases.AnalysisCaseDefinition pocoAnalysisCaseDefinition: + var analysisCaseDefinitionTextualNotationBuilder = new AnalysisCaseDefinitionTextualNotationBuilder(this); + return analysisCaseDefinitionTextualNotationBuilder.BuildTextualNotation(pocoAnalysisCaseDefinition); + + case SysML2.NET.Core.POCO.Systems.Items.ItemUsage pocoItemUsage: + var itemUsageTextualNotationBuilder = new ItemUsageTextualNotationBuilder(this); + return itemUsageTextualNotationBuilder.BuildTextualNotation(pocoItemUsage); + + case SysML2.NET.Core.POCO.Systems.Items.ItemDefinition pocoItemDefinition: + var itemDefinitionTextualNotationBuilder = new ItemDefinitionTextualNotationBuilder(this); + return itemDefinitionTextualNotationBuilder.BuildTextualNotation(pocoItemDefinition); + + case SysML2.NET.Core.POCO.Systems.Views.ViewpointDefinition pocoViewpointDefinition: + var viewpointDefinitionTextualNotationBuilder = new ViewpointDefinitionTextualNotationBuilder(this); + return viewpointDefinitionTextualNotationBuilder.BuildTextualNotation(pocoViewpointDefinition); + + case SysML2.NET.Core.POCO.Systems.Views.ViewUsage pocoViewUsage: + var viewUsageTextualNotationBuilder = new ViewUsageTextualNotationBuilder(this); + return viewUsageTextualNotationBuilder.BuildTextualNotation(pocoViewUsage); + + case SysML2.NET.Core.POCO.Systems.Views.RenderingDefinition pocoRenderingDefinition: + var renderingDefinitionTextualNotationBuilder = new RenderingDefinitionTextualNotationBuilder(this); + return renderingDefinitionTextualNotationBuilder.BuildTextualNotation(pocoRenderingDefinition); + + case SysML2.NET.Core.POCO.Systems.Views.ViewpointUsage pocoViewpointUsage: + var viewpointUsageTextualNotationBuilder = new ViewpointUsageTextualNotationBuilder(this); + return viewpointUsageTextualNotationBuilder.BuildTextualNotation(pocoViewpointUsage); + + case SysML2.NET.Core.POCO.Systems.Views.ViewDefinition pocoViewDefinition: + var viewDefinitionTextualNotationBuilder = new ViewDefinitionTextualNotationBuilder(this); + return viewDefinitionTextualNotationBuilder.BuildTextualNotation(pocoViewDefinition); + + case SysML2.NET.Core.POCO.Systems.Views.RenderingUsage pocoRenderingUsage: + var renderingUsageTextualNotationBuilder = new RenderingUsageTextualNotationBuilder(this); + return renderingUsageTextualNotationBuilder.BuildTextualNotation(pocoRenderingUsage); + + case SysML2.NET.Core.POCO.Systems.Views.ViewRenderingMembership pocoViewRenderingMembership: + var viewRenderingMembershipTextualNotationBuilder = new ViewRenderingMembershipTextualNotationBuilder(this); + return viewRenderingMembershipTextualNotationBuilder.BuildTextualNotation(pocoViewRenderingMembership); + + case SysML2.NET.Core.POCO.Systems.Views.NamespaceExpose pocoNamespaceExpose: + var namespaceExposeTextualNotationBuilder = new NamespaceExposeTextualNotationBuilder(this); + return namespaceExposeTextualNotationBuilder.BuildTextualNotation(pocoNamespaceExpose); + + case SysML2.NET.Core.POCO.Systems.Views.MembershipExpose pocoMembershipExpose: + var membershipExposeTextualNotationBuilder = new MembershipExposeTextualNotationBuilder(this); + return membershipExposeTextualNotationBuilder.BuildTextualNotation(pocoMembershipExpose); + + case SysML2.NET.Core.POCO.Systems.VerificationCases.VerificationCaseDefinition pocoVerificationCaseDefinition: + var verificationCaseDefinitionTextualNotationBuilder = new VerificationCaseDefinitionTextualNotationBuilder(this); + return verificationCaseDefinitionTextualNotationBuilder.BuildTextualNotation(pocoVerificationCaseDefinition); + + case SysML2.NET.Core.POCO.Systems.VerificationCases.VerificationCaseUsage pocoVerificationCaseUsage: + var verificationCaseUsageTextualNotationBuilder = new VerificationCaseUsageTextualNotationBuilder(this); + return verificationCaseUsageTextualNotationBuilder.BuildTextualNotation(pocoVerificationCaseUsage); + + case SysML2.NET.Core.POCO.Systems.VerificationCases.RequirementVerificationMembership pocoRequirementVerificationMembership: + var requirementVerificationMembershipTextualNotationBuilder = new RequirementVerificationMembershipTextualNotationBuilder(this); + return requirementVerificationMembershipTextualNotationBuilder.BuildTextualNotation(pocoRequirementVerificationMembership); + + case SysML2.NET.Core.POCO.Systems.Enumerations.EnumerationDefinition pocoEnumerationDefinition: + var enumerationDefinitionTextualNotationBuilder = new EnumerationDefinitionTextualNotationBuilder(this); + return enumerationDefinitionTextualNotationBuilder.BuildTextualNotation(pocoEnumerationDefinition); + + case SysML2.NET.Core.POCO.Systems.Enumerations.EnumerationUsage pocoEnumerationUsage: + var enumerationUsageTextualNotationBuilder = new EnumerationUsageTextualNotationBuilder(this); + return enumerationUsageTextualNotationBuilder.BuildTextualNotation(pocoEnumerationUsage); + + case SysML2.NET.Core.POCO.Systems.Allocations.AllocationDefinition pocoAllocationDefinition: + var allocationDefinitionTextualNotationBuilder = new AllocationDefinitionTextualNotationBuilder(this); + return allocationDefinitionTextualNotationBuilder.BuildTextualNotation(pocoAllocationDefinition); + + case SysML2.NET.Core.POCO.Systems.Allocations.AllocationUsage pocoAllocationUsage: + var allocationUsageTextualNotationBuilder = new AllocationUsageTextualNotationBuilder(this); + return allocationUsageTextualNotationBuilder.BuildTextualNotation(pocoAllocationUsage); + + case SysML2.NET.Core.POCO.Systems.Occurrences.OccurrenceUsage pocoOccurrenceUsage: + var occurrenceUsageTextualNotationBuilder = new OccurrenceUsageTextualNotationBuilder(this); + return occurrenceUsageTextualNotationBuilder.BuildTextualNotation(pocoOccurrenceUsage); + + case SysML2.NET.Core.POCO.Systems.Occurrences.OccurrenceDefinition pocoOccurrenceDefinition: + var occurrenceDefinitionTextualNotationBuilder = new OccurrenceDefinitionTextualNotationBuilder(this); + return occurrenceDefinitionTextualNotationBuilder.BuildTextualNotation(pocoOccurrenceDefinition); + + case SysML2.NET.Core.POCO.Systems.Occurrences.EventOccurrenceUsage pocoEventOccurrenceUsage: + var eventOccurrenceUsageTextualNotationBuilder = new EventOccurrenceUsageTextualNotationBuilder(this); + return eventOccurrenceUsageTextualNotationBuilder.BuildTextualNotation(pocoEventOccurrenceUsage); + + case SysML2.NET.Core.POCO.Systems.UseCases.IncludeUseCaseUsage pocoIncludeUseCaseUsage: + var includeUseCaseUsageTextualNotationBuilder = new IncludeUseCaseUsageTextualNotationBuilder(this); + return includeUseCaseUsageTextualNotationBuilder.BuildTextualNotation(pocoIncludeUseCaseUsage); + + case SysML2.NET.Core.POCO.Systems.UseCases.UseCaseUsage pocoUseCaseUsage: + var useCaseUsageTextualNotationBuilder = new UseCaseUsageTextualNotationBuilder(this); + return useCaseUsageTextualNotationBuilder.BuildTextualNotation(pocoUseCaseUsage); + + case SysML2.NET.Core.POCO.Systems.UseCases.UseCaseDefinition pocoUseCaseDefinition: + var useCaseDefinitionTextualNotationBuilder = new UseCaseDefinitionTextualNotationBuilder(this); + return useCaseDefinitionTextualNotationBuilder.BuildTextualNotation(pocoUseCaseDefinition); + + case SysML2.NET.Core.POCO.Systems.Metadata.MetadataDefinition pocoMetadataDefinition: + var metadataDefinitionTextualNotationBuilder = new MetadataDefinitionTextualNotationBuilder(this); + return metadataDefinitionTextualNotationBuilder.BuildTextualNotation(pocoMetadataDefinition); + + case SysML2.NET.Core.POCO.Systems.Metadata.MetadataUsage pocoMetadataUsage: + var metadataUsageTextualNotationBuilder = new MetadataUsageTextualNotationBuilder(this); + return metadataUsageTextualNotationBuilder.BuildTextualNotation(pocoMetadataUsage); + + case SysML2.NET.Core.POCO.Systems.Flows.FlowUsage pocoFlowUsage: + var flowUsageTextualNotationBuilder = new FlowUsageTextualNotationBuilder(this); + return flowUsageTextualNotationBuilder.BuildTextualNotation(pocoFlowUsage); + + case SysML2.NET.Core.POCO.Systems.Flows.FlowDefinition pocoFlowDefinition: + var flowDefinitionTextualNotationBuilder = new FlowDefinitionTextualNotationBuilder(this); + return flowDefinitionTextualNotationBuilder.BuildTextualNotation(pocoFlowDefinition); + + case SysML2.NET.Core.POCO.Systems.Flows.SuccessionFlowUsage pocoSuccessionFlowUsage: + var successionFlowUsageTextualNotationBuilder = new SuccessionFlowUsageTextualNotationBuilder(this); + return successionFlowUsageTextualNotationBuilder.BuildTextualNotation(pocoSuccessionFlowUsage); + + case SysML2.NET.Core.POCO.Root.Dependencies.Dependency pocoDependency: + var dependencyTextualNotationBuilder = new DependencyTextualNotationBuilder(this); + return dependencyTextualNotationBuilder.BuildTextualNotation(pocoDependency); + + case SysML2.NET.Core.POCO.Root.Annotations.Comment pocoComment: + var commentTextualNotationBuilder = new CommentTextualNotationBuilder(this); + return commentTextualNotationBuilder.BuildTextualNotation(pocoComment); + + case SysML2.NET.Core.POCO.Root.Annotations.Annotation pocoAnnotation: + var annotationTextualNotationBuilder = new AnnotationTextualNotationBuilder(this); + return annotationTextualNotationBuilder.BuildTextualNotation(pocoAnnotation); + + case SysML2.NET.Core.POCO.Root.Annotations.AnnotatingElement pocoAnnotatingElement: + var annotatingElementTextualNotationBuilder = new AnnotatingElementTextualNotationBuilder(this); + return annotatingElementTextualNotationBuilder.BuildTextualNotation(pocoAnnotatingElement); + + case SysML2.NET.Core.POCO.Root.Annotations.TextualRepresentation pocoTextualRepresentation: + var textualRepresentationTextualNotationBuilder = new TextualRepresentationTextualNotationBuilder(this); + return textualRepresentationTextualNotationBuilder.BuildTextualNotation(pocoTextualRepresentation); + + case SysML2.NET.Core.POCO.Root.Annotations.Documentation pocoDocumentation: + var documentationTextualNotationBuilder = new DocumentationTextualNotationBuilder(this); + return documentationTextualNotationBuilder.BuildTextualNotation(pocoDocumentation); + + case SysML2.NET.Core.POCO.Root.Namespaces.Namespace pocoNamespace: + var namespaceTextualNotationBuilder = new NamespaceTextualNotationBuilder(this); + return namespaceTextualNotationBuilder.BuildTextualNotation(pocoNamespace); + + case SysML2.NET.Core.POCO.Root.Namespaces.MembershipImport pocoMembershipImport: + var membershipImportTextualNotationBuilder = new MembershipImportTextualNotationBuilder(this); + return membershipImportTextualNotationBuilder.BuildTextualNotation(pocoMembershipImport); + + case SysML2.NET.Core.POCO.Root.Namespaces.NamespaceImport pocoNamespaceImport: + var namespaceImportTextualNotationBuilder = new NamespaceImportTextualNotationBuilder(this); + return namespaceImportTextualNotationBuilder.BuildTextualNotation(pocoNamespaceImport); + + case SysML2.NET.Core.POCO.Root.Namespaces.Membership pocoMembership: + var membershipTextualNotationBuilder = new MembershipTextualNotationBuilder(this); + return membershipTextualNotationBuilder.BuildTextualNotation(pocoMembership); + + case SysML2.NET.Core.POCO.Root.Namespaces.OwningMembership pocoOwningMembership: + var owningMembershipTextualNotationBuilder = new OwningMembershipTextualNotationBuilder(this); + return owningMembershipTextualNotationBuilder.BuildTextualNotation(pocoOwningMembership); + + case SysML2.NET.Core.POCO.Core.Types.Specialization pocoSpecialization: + var specializationTextualNotationBuilder = new SpecializationTextualNotationBuilder(this); + return specializationTextualNotationBuilder.BuildTextualNotation(pocoSpecialization); + + case SysML2.NET.Core.POCO.Core.Types.Type pocoType: + var typeTextualNotationBuilder = new TypeTextualNotationBuilder(this); + return typeTextualNotationBuilder.BuildTextualNotation(pocoType); + + case SysML2.NET.Core.POCO.Core.Types.FeatureMembership pocoFeatureMembership: + var featureMembershipTextualNotationBuilder = new FeatureMembershipTextualNotationBuilder(this); + return featureMembershipTextualNotationBuilder.BuildTextualNotation(pocoFeatureMembership); + + case SysML2.NET.Core.POCO.Core.Types.Conjugation pocoConjugation: + var conjugationTextualNotationBuilder = new ConjugationTextualNotationBuilder(this); + return conjugationTextualNotationBuilder.BuildTextualNotation(pocoConjugation); + + case SysML2.NET.Core.POCO.Core.Types.Multiplicity pocoMultiplicity: + var multiplicityTextualNotationBuilder = new MultiplicityTextualNotationBuilder(this); + return multiplicityTextualNotationBuilder.BuildTextualNotation(pocoMultiplicity); + + case SysML2.NET.Core.POCO.Core.Types.Disjoining pocoDisjoining: + var disjoiningTextualNotationBuilder = new DisjoiningTextualNotationBuilder(this); + return disjoiningTextualNotationBuilder.BuildTextualNotation(pocoDisjoining); + + case SysML2.NET.Core.POCO.Core.Types.Differencing pocoDifferencing: + var differencingTextualNotationBuilder = new DifferencingTextualNotationBuilder(this); + return differencingTextualNotationBuilder.BuildTextualNotation(pocoDifferencing); + + case SysML2.NET.Core.POCO.Core.Types.Unioning pocoUnioning: + var unioningTextualNotationBuilder = new UnioningTextualNotationBuilder(this); + return unioningTextualNotationBuilder.BuildTextualNotation(pocoUnioning); + + case SysML2.NET.Core.POCO.Core.Types.Intersecting pocoIntersecting: + var intersectingTextualNotationBuilder = new IntersectingTextualNotationBuilder(this); + return intersectingTextualNotationBuilder.BuildTextualNotation(pocoIntersecting); + + case SysML2.NET.Core.POCO.Core.Classifiers.Subclassification pocoSubclassification: + var subclassificationTextualNotationBuilder = new SubclassificationTextualNotationBuilder(this); + return subclassificationTextualNotationBuilder.BuildTextualNotation(pocoSubclassification); + + case SysML2.NET.Core.POCO.Core.Classifiers.Classifier pocoClassifier: + var classifierTextualNotationBuilder = new ClassifierTextualNotationBuilder(this); + return classifierTextualNotationBuilder.BuildTextualNotation(pocoClassifier); + + case SysML2.NET.Core.POCO.Core.Features.Redefinition pocoRedefinition: + var redefinitionTextualNotationBuilder = new RedefinitionTextualNotationBuilder(this); + return redefinitionTextualNotationBuilder.BuildTextualNotation(pocoRedefinition); + + case SysML2.NET.Core.POCO.Core.Features.Feature pocoFeature: + var featureTextualNotationBuilder = new FeatureTextualNotationBuilder(this); + return featureTextualNotationBuilder.BuildTextualNotation(pocoFeature); + + case SysML2.NET.Core.POCO.Core.Features.FeatureTyping pocoFeatureTyping: + var featureTypingTextualNotationBuilder = new FeatureTypingTextualNotationBuilder(this); + return featureTypingTextualNotationBuilder.BuildTextualNotation(pocoFeatureTyping); + + case SysML2.NET.Core.POCO.Core.Features.Subsetting pocoSubsetting: + var subsettingTextualNotationBuilder = new SubsettingTextualNotationBuilder(this); + return subsettingTextualNotationBuilder.BuildTextualNotation(pocoSubsetting); + + case SysML2.NET.Core.POCO.Core.Features.TypeFeaturing pocoTypeFeaturing: + var typeFeaturingTextualNotationBuilder = new TypeFeaturingTextualNotationBuilder(this); + return typeFeaturingTextualNotationBuilder.BuildTextualNotation(pocoTypeFeaturing); + + case SysML2.NET.Core.POCO.Core.Features.EndFeatureMembership pocoEndFeatureMembership: + var endFeatureMembershipTextualNotationBuilder = new EndFeatureMembershipTextualNotationBuilder(this); + return endFeatureMembershipTextualNotationBuilder.BuildTextualNotation(pocoEndFeatureMembership); + + case SysML2.NET.Core.POCO.Core.Features.FeatureChaining pocoFeatureChaining: + var featureChainingTextualNotationBuilder = new FeatureChainingTextualNotationBuilder(this); + return featureChainingTextualNotationBuilder.BuildTextualNotation(pocoFeatureChaining); + + case SysML2.NET.Core.POCO.Core.Features.FeatureInverting pocoFeatureInverting: + var featureInvertingTextualNotationBuilder = new FeatureInvertingTextualNotationBuilder(this); + return featureInvertingTextualNotationBuilder.BuildTextualNotation(pocoFeatureInverting); + + case SysML2.NET.Core.POCO.Core.Features.ReferenceSubsetting pocoReferenceSubsetting: + var referenceSubsettingTextualNotationBuilder = new ReferenceSubsettingTextualNotationBuilder(this); + return referenceSubsettingTextualNotationBuilder.BuildTextualNotation(pocoReferenceSubsetting); + + case SysML2.NET.Core.POCO.Core.Features.CrossSubsetting pocoCrossSubsetting: + var crossSubsettingTextualNotationBuilder = new CrossSubsettingTextualNotationBuilder(this); + return crossSubsettingTextualNotationBuilder.BuildTextualNotation(pocoCrossSubsetting); + + case SysML2.NET.Core.POCO.Kernel.Interactions.PayloadFeature pocoPayloadFeature: + var payloadFeatureTextualNotationBuilder = new PayloadFeatureTextualNotationBuilder(this); + return payloadFeatureTextualNotationBuilder.BuildTextualNotation(pocoPayloadFeature); + + case SysML2.NET.Core.POCO.Kernel.Interactions.Interaction pocoInteraction: + var interactionTextualNotationBuilder = new InteractionTextualNotationBuilder(this); + return interactionTextualNotationBuilder.BuildTextualNotation(pocoInteraction); + + case SysML2.NET.Core.POCO.Kernel.Interactions.SuccessionFlow pocoSuccessionFlow: + var successionFlowTextualNotationBuilder = new SuccessionFlowTextualNotationBuilder(this); + return successionFlowTextualNotationBuilder.BuildTextualNotation(pocoSuccessionFlow); + + case SysML2.NET.Core.POCO.Kernel.Interactions.Flow pocoFlow: + var flowTextualNotationBuilder = new FlowTextualNotationBuilder(this); + return flowTextualNotationBuilder.BuildTextualNotation(pocoFlow); + + case SysML2.NET.Core.POCO.Kernel.Interactions.FlowEnd pocoFlowEnd: + var flowEndTextualNotationBuilder = new FlowEndTextualNotationBuilder(this); + return flowEndTextualNotationBuilder.BuildTextualNotation(pocoFlowEnd); + + case SysML2.NET.Core.POCO.Kernel.Packages.LibraryPackage pocoLibraryPackage: + var libraryPackageTextualNotationBuilder = new LibraryPackageTextualNotationBuilder(this); + return libraryPackageTextualNotationBuilder.BuildTextualNotation(pocoLibraryPackage); + + case SysML2.NET.Core.POCO.Kernel.Packages.ElementFilterMembership pocoElementFilterMembership: + var elementFilterMembershipTextualNotationBuilder = new ElementFilterMembershipTextualNotationBuilder(this); + return elementFilterMembershipTextualNotationBuilder.BuildTextualNotation(pocoElementFilterMembership); + + case SysML2.NET.Core.POCO.Kernel.Packages.Package pocoPackage: + var packageTextualNotationBuilder = new PackageTextualNotationBuilder(this); + return packageTextualNotationBuilder.BuildTextualNotation(pocoPackage); + + case SysML2.NET.Core.POCO.Kernel.Classes.Class pocoClass: + var classTextualNotationBuilder = new ClassTextualNotationBuilder(this); + return classTextualNotationBuilder.BuildTextualNotation(pocoClass); + + case SysML2.NET.Core.POCO.Kernel.Expressions.LiteralBoolean pocoLiteralBoolean: + var literalBooleanTextualNotationBuilder = new LiteralBooleanTextualNotationBuilder(this); + return literalBooleanTextualNotationBuilder.BuildTextualNotation(pocoLiteralBoolean); + + case SysML2.NET.Core.POCO.Kernel.Expressions.LiteralExpression pocoLiteralExpression: + var literalExpressionTextualNotationBuilder = new LiteralExpressionTextualNotationBuilder(this); + return literalExpressionTextualNotationBuilder.BuildTextualNotation(pocoLiteralExpression); + + case SysML2.NET.Core.POCO.Kernel.Expressions.LiteralRational pocoLiteralRational: + var literalRationalTextualNotationBuilder = new LiteralRationalTextualNotationBuilder(this); + return literalRationalTextualNotationBuilder.BuildTextualNotation(pocoLiteralRational); + + case SysML2.NET.Core.POCO.Kernel.Expressions.LiteralInfinity pocoLiteralInfinity: + var literalInfinityTextualNotationBuilder = new LiteralInfinityTextualNotationBuilder(this); + return literalInfinityTextualNotationBuilder.BuildTextualNotation(pocoLiteralInfinity); + + case SysML2.NET.Core.POCO.Kernel.Expressions.LiteralInteger pocoLiteralInteger: + var literalIntegerTextualNotationBuilder = new LiteralIntegerTextualNotationBuilder(this); + return literalIntegerTextualNotationBuilder.BuildTextualNotation(pocoLiteralInteger); + + case SysML2.NET.Core.POCO.Kernel.Expressions.NullExpression pocoNullExpression: + var nullExpressionTextualNotationBuilder = new NullExpressionTextualNotationBuilder(this); + return nullExpressionTextualNotationBuilder.BuildTextualNotation(pocoNullExpression); + + case SysML2.NET.Core.POCO.Kernel.Expressions.LiteralString pocoLiteralString: + var literalStringTextualNotationBuilder = new LiteralStringTextualNotationBuilder(this); + return literalStringTextualNotationBuilder.BuildTextualNotation(pocoLiteralString); + + case SysML2.NET.Core.POCO.Kernel.Expressions.InvocationExpression pocoInvocationExpression: + var invocationExpressionTextualNotationBuilder = new InvocationExpressionTextualNotationBuilder(this); + return invocationExpressionTextualNotationBuilder.BuildTextualNotation(pocoInvocationExpression); + + case SysML2.NET.Core.POCO.Kernel.Expressions.FeatureReferenceExpression pocoFeatureReferenceExpression: + var featureReferenceExpressionTextualNotationBuilder = new FeatureReferenceExpressionTextualNotationBuilder(this); + return featureReferenceExpressionTextualNotationBuilder.BuildTextualNotation(pocoFeatureReferenceExpression); + + case SysML2.NET.Core.POCO.Kernel.Expressions.SelectExpression pocoSelectExpression: + var selectExpressionTextualNotationBuilder = new SelectExpressionTextualNotationBuilder(this); + return selectExpressionTextualNotationBuilder.BuildTextualNotation(pocoSelectExpression); + + case SysML2.NET.Core.POCO.Kernel.Expressions.OperatorExpression pocoOperatorExpression: + var operatorExpressionTextualNotationBuilder = new OperatorExpressionTextualNotationBuilder(this); + return operatorExpressionTextualNotationBuilder.BuildTextualNotation(pocoOperatorExpression); + + case SysML2.NET.Core.POCO.Kernel.Expressions.CollectExpression pocoCollectExpression: + var collectExpressionTextualNotationBuilder = new CollectExpressionTextualNotationBuilder(this); + return collectExpressionTextualNotationBuilder.BuildTextualNotation(pocoCollectExpression); + + case SysML2.NET.Core.POCO.Kernel.Expressions.FeatureChainExpression pocoFeatureChainExpression: + var featureChainExpressionTextualNotationBuilder = new FeatureChainExpressionTextualNotationBuilder(this); + return featureChainExpressionTextualNotationBuilder.BuildTextualNotation(pocoFeatureChainExpression); + + case SysML2.NET.Core.POCO.Kernel.Expressions.MetadataAccessExpression pocoMetadataAccessExpression: + var metadataAccessExpressionTextualNotationBuilder = new MetadataAccessExpressionTextualNotationBuilder(this); + return metadataAccessExpressionTextualNotationBuilder.BuildTextualNotation(pocoMetadataAccessExpression); + + case SysML2.NET.Core.POCO.Kernel.Expressions.IndexExpression pocoIndexExpression: + var indexExpressionTextualNotationBuilder = new IndexExpressionTextualNotationBuilder(this); + return indexExpressionTextualNotationBuilder.BuildTextualNotation(pocoIndexExpression); + + case SysML2.NET.Core.POCO.Kernel.Expressions.ConstructorExpression pocoConstructorExpression: + var constructorExpressionTextualNotationBuilder = new ConstructorExpressionTextualNotationBuilder(this); + return constructorExpressionTextualNotationBuilder.BuildTextualNotation(pocoConstructorExpression); + + case SysML2.NET.Core.POCO.Kernel.Structures.Structure pocoStructure: + var structureTextualNotationBuilder = new StructureTextualNotationBuilder(this); + return structureTextualNotationBuilder.BuildTextualNotation(pocoStructure); + + case SysML2.NET.Core.POCO.Kernel.Functions.Predicate pocoPredicate: + var predicateTextualNotationBuilder = new PredicateTextualNotationBuilder(this); + return predicateTextualNotationBuilder.BuildTextualNotation(pocoPredicate); + + case SysML2.NET.Core.POCO.Kernel.Functions.ReturnParameterMembership pocoReturnParameterMembership: + var returnParameterMembershipTextualNotationBuilder = new ReturnParameterMembershipTextualNotationBuilder(this); + return returnParameterMembershipTextualNotationBuilder.BuildTextualNotation(pocoReturnParameterMembership); + + case SysML2.NET.Core.POCO.Kernel.Functions.Invariant pocoInvariant: + var invariantTextualNotationBuilder = new InvariantTextualNotationBuilder(this); + return invariantTextualNotationBuilder.BuildTextualNotation(pocoInvariant); + + case SysML2.NET.Core.POCO.Kernel.Functions.BooleanExpression pocoBooleanExpression: + var booleanExpressionTextualNotationBuilder = new BooleanExpressionTextualNotationBuilder(this); + return booleanExpressionTextualNotationBuilder.BuildTextualNotation(pocoBooleanExpression); + + case SysML2.NET.Core.POCO.Kernel.Functions.Expression pocoExpression: + var expressionTextualNotationBuilder = new ExpressionTextualNotationBuilder(this); + return expressionTextualNotationBuilder.BuildTextualNotation(pocoExpression); + + case SysML2.NET.Core.POCO.Kernel.Functions.Function pocoFunction: + var functionTextualNotationBuilder = new FunctionTextualNotationBuilder(this); + return functionTextualNotationBuilder.BuildTextualNotation(pocoFunction); + + case SysML2.NET.Core.POCO.Kernel.Functions.ResultExpressionMembership pocoResultExpressionMembership: + var resultExpressionMembershipTextualNotationBuilder = new ResultExpressionMembershipTextualNotationBuilder(this); + return resultExpressionMembershipTextualNotationBuilder.BuildTextualNotation(pocoResultExpressionMembership); + + case SysML2.NET.Core.POCO.Kernel.Multiplicities.MultiplicityRange pocoMultiplicityRange: + var multiplicityRangeTextualNotationBuilder = new MultiplicityRangeTextualNotationBuilder(this); + return multiplicityRangeTextualNotationBuilder.BuildTextualNotation(pocoMultiplicityRange); + + case SysML2.NET.Core.POCO.Kernel.Behaviors.Step pocoStep: + var stepTextualNotationBuilder = new StepTextualNotationBuilder(this); + return stepTextualNotationBuilder.BuildTextualNotation(pocoStep); + + case SysML2.NET.Core.POCO.Kernel.Behaviors.Behavior pocoBehavior: + var behaviorTextualNotationBuilder = new BehaviorTextualNotationBuilder(this); + return behaviorTextualNotationBuilder.BuildTextualNotation(pocoBehavior); + + case SysML2.NET.Core.POCO.Kernel.Behaviors.ParameterMembership pocoParameterMembership: + var parameterMembershipTextualNotationBuilder = new ParameterMembershipTextualNotationBuilder(this); + return parameterMembershipTextualNotationBuilder.BuildTextualNotation(pocoParameterMembership); + + case SysML2.NET.Core.POCO.Kernel.Metadata.Metaclass pocoMetaclass: + var metaclassTextualNotationBuilder = new MetaclassTextualNotationBuilder(this); + return metaclassTextualNotationBuilder.BuildTextualNotation(pocoMetaclass); + + case SysML2.NET.Core.POCO.Kernel.Metadata.MetadataFeature pocoMetadataFeature: + var metadataFeatureTextualNotationBuilder = new MetadataFeatureTextualNotationBuilder(this); + return metadataFeatureTextualNotationBuilder.BuildTextualNotation(pocoMetadataFeature); + + case SysML2.NET.Core.POCO.Kernel.DataTypes.DataType pocoDataType: + var dataTypeTextualNotationBuilder = new DataTypeTextualNotationBuilder(this); + return dataTypeTextualNotationBuilder.BuildTextualNotation(pocoDataType); + + case SysML2.NET.Core.POCO.Kernel.Associations.AssociationStructure pocoAssociationStructure: + var associationStructureTextualNotationBuilder = new AssociationStructureTextualNotationBuilder(this); + return associationStructureTextualNotationBuilder.BuildTextualNotation(pocoAssociationStructure); + + case SysML2.NET.Core.POCO.Kernel.Associations.Association pocoAssociation: + var associationTextualNotationBuilder = new AssociationTextualNotationBuilder(this); + return associationTextualNotationBuilder.BuildTextualNotation(pocoAssociation); + + case SysML2.NET.Core.POCO.Kernel.FeatureValues.FeatureValue pocoFeatureValue: + var featureValueTextualNotationBuilder = new FeatureValueTextualNotationBuilder(this); + return featureValueTextualNotationBuilder.BuildTextualNotation(pocoFeatureValue); + + case SysML2.NET.Core.POCO.Kernel.Connectors.Connector pocoConnector: + var connectorTextualNotationBuilder = new ConnectorTextualNotationBuilder(this); + return connectorTextualNotationBuilder.BuildTextualNotation(pocoConnector); + + case SysML2.NET.Core.POCO.Kernel.Connectors.BindingConnector pocoBindingConnector: + var bindingConnectorTextualNotationBuilder = new BindingConnectorTextualNotationBuilder(this); + return bindingConnectorTextualNotationBuilder.BuildTextualNotation(pocoBindingConnector); + + case SysML2.NET.Core.POCO.Kernel.Connectors.Succession pocoSuccession: + var successionTextualNotationBuilder = new SuccessionTextualNotationBuilder(this); + return successionTextualNotationBuilder.BuildTextualNotation(pocoSuccession); + + 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/TextualNotation/AutoGenTextualNotationBuilder/TextualRepresentationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TextualRepresentationTextualNotationBuilder.cs new file mode 100644 index 00000000..f1aaa69c --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TextualRepresentationTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class TextualRepresentationTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public TextualRepresentationTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Root.Annotations.TextualRepresentation poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..e728d6a0 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionFeatureMembershipTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class TransitionFeatureMembershipTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public TransitionFeatureMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.States.TransitionFeatureMembership poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..304e45dd --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class TransitionUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public TransitionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.States.TransitionUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..f1936c2c --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TriggerInvocationExpressionTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class TriggerInvocationExpressionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public TriggerInvocationExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.TriggerInvocationExpression poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..c1ef9236 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeFeaturingTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class TypeFeaturingTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public TypeFeaturingTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Features.TypeFeaturing poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..f01befde --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class TypeTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public TypeTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Types.Type poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..a970c88e --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UnioningTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class UnioningTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public UnioningTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Types.Unioning poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..304340c6 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class UsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public UsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.Usage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..aa84e885 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseDefinitionTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class UseCaseDefinitionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public UseCaseDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.UseCases.UseCaseDefinition poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..eaccd628 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class UseCaseUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public UseCaseUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.UseCases.UseCaseUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..e5e7fbfd --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VariantMembershipTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class VariantMembershipTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public VariantMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.VariantMembership poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..57667c78 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseDefinitionTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class VerificationCaseDefinitionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public VerificationCaseDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.VerificationCases.VerificationCaseDefinition poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..cc381b27 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class VerificationCaseUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public VerificationCaseUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.VerificationCases.VerificationCaseUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..fe3b48de --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class ViewDefinitionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public ViewDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Views.ViewDefinition poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..fd6430a6 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewRenderingMembershipTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class ViewRenderingMembershipTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public ViewRenderingMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Views.ViewRenderingMembership poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..294b7954 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class ViewUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public ViewUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Views.ViewUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..f37f29b6 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointDefinitionTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class ViewpointDefinitionTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public ViewpointDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Views.ViewpointDefinition poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..c61212a5 --- /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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class ViewpointUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public ViewpointUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Views.ViewpointUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------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 00000000..b3bb4567 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/WhileLoopActionUsageTextualNotationBuilder.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 SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides Textual Notation Builder for the element + /// + public class WhileLoopActionUsageTextualNotationBuilder : TextualNotationBuilder + { + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + public WhileLoopActionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + { + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.WhileLoopActionUsage poco) + { + return string.Empty; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET/TextualNotation/ITextualNotationBuilderFacade.cs b/SysML2.NET/TextualNotation/ITextualNotationBuilderFacade.cs new file mode 100644 index 00000000..a290d58f --- /dev/null +++ b/SysML2.NET/TextualNotation/ITextualNotationBuilderFacade.cs @@ -0,0 +1,37 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// 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.Elements; + + /// + /// The provides access to built textual notation for via + /// + public interface ITextualNotationBuilderFacade + { + /// + /// Queries the Textual Notation of an + /// + /// The to built textual notation from + /// The built textual notation string + string QueryTextualNotationOfElement(IElement element); + } +} diff --git a/SysML2.NET/TextualNotation/TextualNotationBuilder.cs b/SysML2.NET/TextualNotation/TextualNotationBuilder.cs new file mode 100644 index 00000000..4ea1b815 --- /dev/null +++ b/SysML2.NET/TextualNotation/TextualNotationBuilder.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. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// Base class that provides Textual Notation string builder for a specific + /// + /// Any concrete class + public abstract class TextualNotationBuilder where TElement : class, IElement + { + /// + /// Gets the used to query textual notation of referenced + /// + protected readonly ITextualNotationBuilderFacade Facade; + + /// + /// Initializes a new instance of a + /// + /// The used to query textual notation of referenced + protected TextualNotationBuilder(ITextualNotationBuilderFacade facade) + { + this.Facade = facade; + } + + /// + /// Builds the Textual Notation string for the provided + /// + /// The from which the textual notation should be build + /// The built textual notation string + public abstract string BuildTextualNotation(TElement poco); + } +} From 90cf346a06c598dc4c8731df1ecd9457ffe857f1 Mon Sep 17 00:00:00 2001 From: atheate Date: Thu, 19 Feb 2026 17:06:01 +0100 Subject: [PATCH 04/33] [WIP] Added prefix on assingment, gonna start implement logic for builder --- Resources/kebnf.g4 | 2 +- ...NotationSpecificationVisitorTestFixture.cs | 2 + .../UmlCoreTextualNotationBuilderGenerator.cs | 2 +- .../NET/CodeGenerator/Grammar/kebnf.interp | 86 --------- .../Grammar/AutoGenGrammar/kebnf.interp | 86 +++++++++ .../CodeGenerator/Grammar => }/kebnf.tokens | 0 .../Grammar => }/kebnfBaseListener.cs | 0 .../Grammar => }/kebnfBaseVisitor.cs | 0 .../CodeGenerator/Grammar => }/kebnfLexer.cs | 0 .../Grammar => }/kebnfLexer.interp | 0 .../Grammar => }/kebnfLexer.tokens | 0 .../Grammar => }/kebnfListener.cs | 0 .../CodeGenerator/Grammar => }/kebnfParser.cs | 179 ++++++++++-------- .../Grammar => }/kebnfVisitor.cs | 0 .../Grammar/Model/AssignmentElement.cs | 7 +- .../TextualNotationSpecificationVisitor.cs | 8 +- ...core-textual-notation-builder-template.hbs | 22 ++- 17 files changed, 212 insertions(+), 182 deletions(-) delete mode 100644 SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnf.interp create mode 100644 SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnf.interp rename SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/{SysML2/NET/CodeGenerator/Grammar => }/kebnf.tokens (100%) rename SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/{SysML2/NET/CodeGenerator/Grammar => }/kebnfBaseListener.cs (100%) rename SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/{SysML2/NET/CodeGenerator/Grammar => }/kebnfBaseVisitor.cs (100%) rename SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/{SysML2/NET/CodeGenerator/Grammar => }/kebnfLexer.cs (100%) rename SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/{SysML2/NET/CodeGenerator/Grammar => }/kebnfLexer.interp (100%) rename SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/{SysML2/NET/CodeGenerator/Grammar => }/kebnfLexer.tokens (100%) rename SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/{SysML2/NET/CodeGenerator/Grammar => }/kebnfListener.cs (100%) rename SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/{SysML2/NET/CodeGenerator/Grammar => }/kebnfParser.cs (92%) rename SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/{SysML2/NET/CodeGenerator/Grammar => }/kebnfVisitor.cs (100%) diff --git a/Resources/kebnf.g4 b/Resources/kebnf.g4 index 5be3842d..f068d86e 100644 --- a/Resources/kebnf.g4 +++ b/Resources/kebnf.g4 @@ -31,7 +31,7 @@ element ; assignment - : property=dotted_id op=(ASSIGN | ADD_ASSIGN | BOOL_ASSIGN) content=element_core (suffix=suffix_op)? + : property=dotted_id op=(ASSIGN | ADD_ASSIGN | BOOL_ASSIGN) (prefix=TILDE)?content=element_core (suffix=suffix_op)? ; non_parsing_assignment diff --git a/SysML2.NET.CodeGenerator.Tests/Grammar/TextualNotationSpecificationVisitorTestFixture.cs b/SysML2.NET.CodeGenerator.Tests/Grammar/TextualNotationSpecificationVisitorTestFixture.cs index 6ea3d80b..7990d4cc 100644 --- a/SysML2.NET.CodeGenerator.Tests/Grammar/TextualNotationSpecificationVisitorTestFixture.cs +++ b/SysML2.NET.CodeGenerator.Tests/Grammar/TextualNotationSpecificationVisitorTestFixture.cs @@ -22,6 +22,7 @@ namespace SysML2.NET.CodeGenerator.Tests.Grammar { using System; using System.IO; + using System.Linq; using Antlr4.Runtime; @@ -54,6 +55,7 @@ public void VerifyCanParseGrammar(string modelName) { 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/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGenerator.cs b/SysML2.NET.CodeGenerator/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGenerator.cs index aa04cba9..0c314862 100644 --- a/SysML2.NET.CodeGenerator/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGenerator.cs +++ b/SysML2.NET.CodeGenerator/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGenerator.cs @@ -152,7 +152,7 @@ private async Task GenerateBuilderClassesInternal(XmiReaderResult xmiReaderResul foreach (var umlClass in classes) { - var generatedBuilder = template(umlClass); + var generatedBuilder = template(new {ClassContext = umlClass, Rules = textualNotationSpecification.Rules}); generatedBuilder = this.CodeCleanup(generatedBuilder); var fileName = $"{umlClass.Name.CapitalizeFirstLetter()}TextualNotationBuilder.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 deleted file mode 100644 index 54fabec1..00000000 --- a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnf.interp +++ /dev/null @@ -1,86 +0,0 @@ -token literal names: -null -'*' -'+' -'?' -'true' -'false' -'this' -'[QualifiedName]' -null -'+=' -'?=' -'|' -':' -';' -',' -'(' -')' -'[' -']' -'{' -'}' -'.' -'~' -null -null -null -null -null -null -null - -token symbolic names: -null -null -null -null -null -null -null -null -ASSIGN -ADD_ASSIGN -BOOL_ASSIGN -PIPE -COLON -SEMICOLON -COMMA -LPAREN -RPAREN -LBRACK -RBRACK -LBRACE -RBRACE -DOT -TILDE -ID -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, 29, 149, 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, 3, 5, 93, 8, 5, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 99, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 9, 3, 9, 111, 8, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 121, 8, 10, 1, 11, 1, 11, 3, 11, 125, 8, 11, 1, 12, 1, 12, 3, 12, 129, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 135, 8, 13, 1, 14, 1, 14, 1, 14, 5, 14, 140, 8, 14, 10, 14, 12, 14, 143, 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, 8, 10, 1, 0, 8, 9, 1, 0, 1, 3, 2, 0, 4, 7, 23, 25, 154, 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, 92, 1, 0, 0, 0, 12, 94, 1, 0, 0, 0, 14, 100, 1, 0, 0, 0, 16, 106, 1, 0, 0, 0, 18, 110, 1, 0, 0, 0, 20, 116, 1, 0, 0, 0, 22, 122, 1, 0, 0, 0, 24, 126, 1, 0, 0, 0, 26, 134, 1, 0, 0, 0, 28, 136, 1, 0, 0, 0, 30, 144, 1, 0, 0, 0, 32, 146, 1, 0, 0, 0, 34, 36, 5, 29, 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, 23, 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, 12, 0, 0, 52, 54, 5, 23, 0, 0, 53, 51, 1, 0, 0, 0, 53, 54, 1, 0, 0, 0, 54, 55, 1, 0, 0, 0, 55, 56, 5, 8, 0, 0, 56, 58, 3, 6, 3, 0, 57, 59, 5, 13, 0, 0, 58, 57, 1, 0, 0, 0, 58, 59, 1, 0, 0, 0, 59, 61, 1, 0, 0, 0, 60, 62, 5, 29, 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, 15, 0, 0, 66, 67, 5, 23, 0, 0, 67, 68, 5, 12, 0, 0, 68, 69, 5, 23, 0, 0, 69, 70, 5, 16, 0, 0, 70, 5, 1, 0, 0, 0, 71, 76, 3, 8, 4, 0, 72, 73, 5, 11, 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, 93, 3, 12, 6, 0, 86, 93, 3, 14, 7, 0, 87, 93, 3, 16, 8, 0, 88, 93, 3, 18, 9, 0, 89, 93, 3, 20, 10, 0, 90, 93, 3, 22, 11, 0, 91, 93, 3, 24, 12, 0, 92, 85, 1, 0, 0, 0, 92, 86, 1, 0, 0, 0, 92, 87, 1, 0, 0, 0, 92, 88, 1, 0, 0, 0, 92, 89, 1, 0, 0, 0, 92, 90, 1, 0, 0, 0, 92, 91, 1, 0, 0, 0, 93, 11, 1, 0, 0, 0, 94, 95, 3, 28, 14, 0, 95, 96, 7, 0, 0, 0, 96, 98, 3, 26, 13, 0, 97, 99, 3, 30, 15, 0, 98, 97, 1, 0, 0, 0, 98, 99, 1, 0, 0, 0, 99, 13, 1, 0, 0, 0, 100, 101, 5, 19, 0, 0, 101, 102, 3, 28, 14, 0, 102, 103, 7, 1, 0, 0, 103, 104, 3, 32, 16, 0, 104, 105, 5, 20, 0, 0, 105, 15, 1, 0, 0, 0, 106, 107, 5, 19, 0, 0, 107, 108, 5, 20, 0, 0, 108, 17, 1, 0, 0, 0, 109, 111, 5, 22, 0, 0, 110, 109, 1, 0, 0, 0, 110, 111, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, 113, 5, 17, 0, 0, 113, 114, 5, 23, 0, 0, 114, 115, 5, 18, 0, 0, 115, 19, 1, 0, 0, 0, 116, 117, 5, 15, 0, 0, 117, 118, 3, 6, 3, 0, 118, 120, 5, 16, 0, 0, 119, 121, 3, 30, 15, 0, 120, 119, 1, 0, 0, 0, 120, 121, 1, 0, 0, 0, 121, 21, 1, 0, 0, 0, 122, 124, 3, 32, 16, 0, 123, 125, 3, 30, 15, 0, 124, 123, 1, 0, 0, 0, 124, 125, 1, 0, 0, 0, 125, 23, 1, 0, 0, 0, 126, 128, 5, 23, 0, 0, 127, 129, 3, 30, 15, 0, 128, 127, 1, 0, 0, 0, 128, 129, 1, 0, 0, 0, 129, 25, 1, 0, 0, 0, 130, 135, 3, 18, 9, 0, 131, 135, 3, 20, 10, 0, 132, 135, 3, 22, 11, 0, 133, 135, 3, 24, 12, 0, 134, 130, 1, 0, 0, 0, 134, 131, 1, 0, 0, 0, 134, 132, 1, 0, 0, 0, 134, 133, 1, 0, 0, 0, 135, 27, 1, 0, 0, 0, 136, 141, 5, 23, 0, 0, 137, 138, 5, 21, 0, 0, 138, 140, 5, 23, 0, 0, 139, 137, 1, 0, 0, 0, 140, 143, 1, 0, 0, 0, 141, 139, 1, 0, 0, 0, 141, 142, 1, 0, 0, 0, 142, 29, 1, 0, 0, 0, 143, 141, 1, 0, 0, 0, 144, 145, 7, 2, 0, 0, 145, 31, 1, 0, 0, 0, 146, 147, 7, 3, 0, 0, 147, 33, 1, 0, 0, 0, 16, 37, 43, 49, 53, 58, 63, 76, 82, 92, 98, 110, 120, 124, 128, 134, 141] \ No newline at end of file diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnf.interp b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnf.interp new file mode 100644 index 00000000..c34fc53c --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnf.interp @@ -0,0 +1,86 @@ +token literal names: +null +'*' +'+' +'?' +'true' +'false' +'this' +'[QualifiedName]' +null +'+=' +'?=' +'|' +':' +';' +',' +'(' +')' +'[' +']' +'{' +'}' +'.' +'~' +null +null +null +null +null +null +null + +token symbolic names: +null +null +null +null +null +null +null +null +ASSIGN +ADD_ASSIGN +BOOL_ASSIGN +PIPE +COLON +SEMICOLON +COMMA +LPAREN +RPAREN +LBRACK +RBRACK +LBRACE +RBRACE +DOT +TILDE +ID +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, 29, 152, 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, 3, 5, 93, 8, 5, 1, 6, 1, 6, 1, 6, 3, 6, 98, 8, 6, 1, 6, 1, 6, 3, 6, 102, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 9, 3, 9, 114, 8, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 124, 8, 10, 1, 11, 1, 11, 3, 11, 128, 8, 11, 1, 12, 1, 12, 3, 12, 132, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 138, 8, 13, 1, 14, 1, 14, 1, 14, 5, 14, 143, 8, 14, 10, 14, 12, 14, 146, 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, 8, 10, 1, 0, 8, 9, 1, 0, 1, 3, 2, 0, 4, 7, 23, 25, 158, 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, 92, 1, 0, 0, 0, 12, 94, 1, 0, 0, 0, 14, 103, 1, 0, 0, 0, 16, 109, 1, 0, 0, 0, 18, 113, 1, 0, 0, 0, 20, 119, 1, 0, 0, 0, 22, 125, 1, 0, 0, 0, 24, 129, 1, 0, 0, 0, 26, 137, 1, 0, 0, 0, 28, 139, 1, 0, 0, 0, 30, 147, 1, 0, 0, 0, 32, 149, 1, 0, 0, 0, 34, 36, 5, 29, 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, 23, 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, 12, 0, 0, 52, 54, 5, 23, 0, 0, 53, 51, 1, 0, 0, 0, 53, 54, 1, 0, 0, 0, 54, 55, 1, 0, 0, 0, 55, 56, 5, 8, 0, 0, 56, 58, 3, 6, 3, 0, 57, 59, 5, 13, 0, 0, 58, 57, 1, 0, 0, 0, 58, 59, 1, 0, 0, 0, 59, 61, 1, 0, 0, 0, 60, 62, 5, 29, 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, 15, 0, 0, 66, 67, 5, 23, 0, 0, 67, 68, 5, 12, 0, 0, 68, 69, 5, 23, 0, 0, 69, 70, 5, 16, 0, 0, 70, 5, 1, 0, 0, 0, 71, 76, 3, 8, 4, 0, 72, 73, 5, 11, 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, 93, 3, 12, 6, 0, 86, 93, 3, 14, 7, 0, 87, 93, 3, 16, 8, 0, 88, 93, 3, 18, 9, 0, 89, 93, 3, 20, 10, 0, 90, 93, 3, 22, 11, 0, 91, 93, 3, 24, 12, 0, 92, 85, 1, 0, 0, 0, 92, 86, 1, 0, 0, 0, 92, 87, 1, 0, 0, 0, 92, 88, 1, 0, 0, 0, 92, 89, 1, 0, 0, 0, 92, 90, 1, 0, 0, 0, 92, 91, 1, 0, 0, 0, 93, 11, 1, 0, 0, 0, 94, 95, 3, 28, 14, 0, 95, 97, 7, 0, 0, 0, 96, 98, 5, 22, 0, 0, 97, 96, 1, 0, 0, 0, 97, 98, 1, 0, 0, 0, 98, 99, 1, 0, 0, 0, 99, 101, 3, 26, 13, 0, 100, 102, 3, 30, 15, 0, 101, 100, 1, 0, 0, 0, 101, 102, 1, 0, 0, 0, 102, 13, 1, 0, 0, 0, 103, 104, 5, 19, 0, 0, 104, 105, 3, 28, 14, 0, 105, 106, 7, 1, 0, 0, 106, 107, 3, 32, 16, 0, 107, 108, 5, 20, 0, 0, 108, 15, 1, 0, 0, 0, 109, 110, 5, 19, 0, 0, 110, 111, 5, 20, 0, 0, 111, 17, 1, 0, 0, 0, 112, 114, 5, 22, 0, 0, 113, 112, 1, 0, 0, 0, 113, 114, 1, 0, 0, 0, 114, 115, 1, 0, 0, 0, 115, 116, 5, 17, 0, 0, 116, 117, 5, 23, 0, 0, 117, 118, 5, 18, 0, 0, 118, 19, 1, 0, 0, 0, 119, 120, 5, 15, 0, 0, 120, 121, 3, 6, 3, 0, 121, 123, 5, 16, 0, 0, 122, 124, 3, 30, 15, 0, 123, 122, 1, 0, 0, 0, 123, 124, 1, 0, 0, 0, 124, 21, 1, 0, 0, 0, 125, 127, 3, 32, 16, 0, 126, 128, 3, 30, 15, 0, 127, 126, 1, 0, 0, 0, 127, 128, 1, 0, 0, 0, 128, 23, 1, 0, 0, 0, 129, 131, 5, 23, 0, 0, 130, 132, 3, 30, 15, 0, 131, 130, 1, 0, 0, 0, 131, 132, 1, 0, 0, 0, 132, 25, 1, 0, 0, 0, 133, 138, 3, 18, 9, 0, 134, 138, 3, 20, 10, 0, 135, 138, 3, 22, 11, 0, 136, 138, 3, 24, 12, 0, 137, 133, 1, 0, 0, 0, 137, 134, 1, 0, 0, 0, 137, 135, 1, 0, 0, 0, 137, 136, 1, 0, 0, 0, 138, 27, 1, 0, 0, 0, 139, 144, 5, 23, 0, 0, 140, 141, 5, 21, 0, 0, 141, 143, 5, 23, 0, 0, 142, 140, 1, 0, 0, 0, 143, 146, 1, 0, 0, 0, 144, 142, 1, 0, 0, 0, 144, 145, 1, 0, 0, 0, 145, 29, 1, 0, 0, 0, 146, 144, 1, 0, 0, 0, 147, 148, 7, 2, 0, 0, 148, 31, 1, 0, 0, 0, 149, 150, 7, 3, 0, 0, 150, 33, 1, 0, 0, 0, 17, 37, 43, 49, 53, 58, 63, 76, 82, 92, 97, 101, 113, 123, 127, 131, 137, 144] \ 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/kebnf.tokens similarity index 100% rename from SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnf.tokens rename to SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnf.tokens diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfBaseListener.cs b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfBaseListener.cs similarity index 100% rename from SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfBaseListener.cs rename to SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfBaseListener.cs diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfBaseVisitor.cs b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfBaseVisitor.cs similarity index 100% rename from SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfBaseVisitor.cs rename to SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfBaseVisitor.cs diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.cs b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfLexer.cs similarity index 100% rename from SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.cs rename to SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfLexer.cs diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.interp b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfLexer.interp similarity index 100% rename from SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.interp rename to SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfLexer.interp diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.tokens b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfLexer.tokens similarity index 100% rename from SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.tokens rename to SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfLexer.tokens diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfListener.cs b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfListener.cs similarity index 100% rename from SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfListener.cs rename to SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfListener.cs diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfParser.cs b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfParser.cs similarity index 92% rename from SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfParser.cs rename to SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfParser.cs index 14ce997c..f48c7aa7 100644 --- a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfParser.cs +++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfParser.cs @@ -620,6 +620,7 @@ public ElementContext element() { 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() { @@ -631,6 +632,7 @@ [System.Diagnostics.DebuggerNonUserCode] public Element_coreContext element_core [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); } @@ -677,14 +679,24 @@ public AssignmentContext assignment() { ErrorHandler.ReportMatch(this); Consume(); } - State = 96; + State = 97; + ErrorHandler.Sync(this); + switch ( Interpreter.AdaptivePredict(TokenStream,9,Context) ) { + case 1: + { + State = 96; + _localctx.prefix = Match(TILDE); + } + break; + } + State = 99; _localctx.content = element_core(); - State = 98; + State = 101; ErrorHandler.Sync(this); _la = TokenStream.LA(1); if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 14L) != 0)) { { - State = 97; + State = 100; _localctx.suffix = suffix_op(); } } @@ -747,11 +759,11 @@ public Non_parsing_assignmentContext non_parsing_assignment() { try { EnterOuterAlt(_localctx, 1); { - State = 100; + State = 103; Match(LBRACE); - State = 101; + State = 104; _localctx.property = dotted_id(); - State = 102; + State = 105; _localctx.op = TokenStream.LT(1); _la = TokenStream.LA(1); if ( !(_la==ASSIGN || _la==ADD_ASSIGN) ) { @@ -761,9 +773,9 @@ public Non_parsing_assignmentContext non_parsing_assignment() { ErrorHandler.ReportMatch(this); Consume(); } - State = 103; + State = 106; _localctx.val = value_literal(); - State = 104; + State = 107; Match(RBRACE); } } @@ -811,9 +823,9 @@ public Non_parsing_emptyContext non_parsing_empty() { try { EnterOuterAlt(_localctx, 1); { - State = 106; + State = 109; Match(LBRACE); - State = 107; + State = 110; Match(RBRACE); } } @@ -865,21 +877,21 @@ public Cross_referenceContext cross_reference() { try { EnterOuterAlt(_localctx, 1); { - State = 110; + State = 113; ErrorHandler.Sync(this); _la = TokenStream.LA(1); if (_la==TILDE) { { - State = 109; + State = 112; Match(TILDE); } } - State = 112; + State = 115; Match(LBRACK); - State = 113; + State = 116; _localctx.@ref = Match(ID); - State = 114; + State = 117; Match(RBRACK); } } @@ -934,18 +946,18 @@ public GroupContext group() { try { EnterOuterAlt(_localctx, 1); { - State = 116; + State = 119; Match(LPAREN); - State = 117; + State = 120; alternatives(); - State = 118; + State = 121; Match(RPAREN); - State = 120; + State = 123; ErrorHandler.Sync(this); - switch ( Interpreter.AdaptivePredict(TokenStream,11,Context) ) { + switch ( Interpreter.AdaptivePredict(TokenStream,12,Context) ) { case 1: { - State = 119; + State = 122; _localctx.suffix = suffix_op(); } break; @@ -1002,14 +1014,14 @@ public TerminalContext terminal() { try { EnterOuterAlt(_localctx, 1); { - State = 122; + State = 125; _localctx.val = value_literal(); - State = 124; + State = 127; ErrorHandler.Sync(this); - switch ( Interpreter.AdaptivePredict(TokenStream,12,Context) ) { + switch ( Interpreter.AdaptivePredict(TokenStream,13,Context) ) { case 1: { - State = 123; + State = 126; _localctx.suffix = suffix_op(); } break; @@ -1064,14 +1076,14 @@ public Non_terminalContext non_terminal() { try { EnterOuterAlt(_localctx, 1); { - State = 126; + State = 129; _localctx.name = Match(ID); - State = 128; + State = 131; ErrorHandler.Sync(this); - switch ( Interpreter.AdaptivePredict(TokenStream,13,Context) ) { + switch ( Interpreter.AdaptivePredict(TokenStream,14,Context) ) { case 1: { - State = 127; + State = 130; _localctx.suffix = suffix_op(); } break; @@ -1130,34 +1142,34 @@ public Element_coreContext element_core() { Element_coreContext _localctx = new Element_coreContext(Context, State); EnterRule(_localctx, 26, RULE_element_core); try { - State = 134; + State = 137; ErrorHandler.Sync(this); - switch ( Interpreter.AdaptivePredict(TokenStream,14,Context) ) { + switch ( Interpreter.AdaptivePredict(TokenStream,15,Context) ) { case 1: EnterOuterAlt(_localctx, 1); { - State = 130; + State = 133; cross_reference(); } break; case 2: EnterOuterAlt(_localctx, 2); { - State = 131; + State = 134; group(); } break; case 3: EnterOuterAlt(_localctx, 3); { - State = 132; + State = 135; terminal(); } break; case 4: EnterOuterAlt(_localctx, 4); { - State = 133; + State = 136; non_terminal(); } break; @@ -1214,21 +1226,21 @@ public Dotted_idContext dotted_id() { try { EnterOuterAlt(_localctx, 1); { - State = 136; + State = 139; Match(ID); - State = 141; + State = 144; ErrorHandler.Sync(this); _la = TokenStream.LA(1); while (_la==DOT) { { { - State = 137; + State = 140; Match(DOT); - State = 138; + State = 141; Match(ID); } } - State = 143; + State = 146; ErrorHandler.Sync(this); _la = TokenStream.LA(1); } @@ -1277,7 +1289,7 @@ public Suffix_opContext suffix_op() { try { EnterOuterAlt(_localctx, 1); { - State = 144; + State = 147; _la = TokenStream.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 14L) != 0)) ) { ErrorHandler.RecoverInline(this); @@ -1334,7 +1346,7 @@ public Value_literalContext value_literal() { try { EnterOuterAlt(_localctx, 1); { - State = 146; + State = 149; _la = TokenStream.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 58720496L) != 0)) ) { ErrorHandler.RecoverInline(this); @@ -1357,52 +1369,53 @@ public Value_literalContext value_literal() { } private static int[] _serializedATN = { - 4,1,29,149,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, + 4,1,29,152,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,3,5,93,8,5,1,6,1,6,1,6,1,6,3,6,99,8,6,1,7,1,7,1,7, - 1,7,1,7,1,7,1,8,1,8,1,8,1,9,3,9,111,8,9,1,9,1,9,1,9,1,9,1,10,1,10,1,10, - 1,10,3,10,121,8,10,1,11,1,11,3,11,125,8,11,1,12,1,12,3,12,129,8,12,1,13, - 1,13,1,13,1,13,3,13,135,8,13,1,14,1,14,1,14,5,14,140,8,14,10,14,12,14, - 143,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,8,10,1,0,8,9,1,0,1,3,2,0,4,7,23,25,154,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,92,1,0,0,0, - 12,94,1,0,0,0,14,100,1,0,0,0,16,106,1,0,0,0,18,110,1,0,0,0,20,116,1,0, - 0,0,22,122,1,0,0,0,24,126,1,0,0,0,26,134,1,0,0,0,28,136,1,0,0,0,30,144, - 1,0,0,0,32,146,1,0,0,0,34,36,5,29,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,23,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,12,0,0,52,54,5,23,0,0,53,51,1,0,0,0,53,54, - 1,0,0,0,54,55,1,0,0,0,55,56,5,8,0,0,56,58,3,6,3,0,57,59,5,13,0,0,58,57, - 1,0,0,0,58,59,1,0,0,0,59,61,1,0,0,0,60,62,5,29,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,15,0,0,66,67, - 5,23,0,0,67,68,5,12,0,0,68,69,5,23,0,0,69,70,5,16,0,0,70,5,1,0,0,0,71, - 76,3,8,4,0,72,73,5,11,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,93,3,12,6,0,86,93,3,14,7,0,87,93,3,16,8,0,88,93,3,18,9,0,89, - 93,3,20,10,0,90,93,3,22,11,0,91,93,3,24,12,0,92,85,1,0,0,0,92,86,1,0,0, - 0,92,87,1,0,0,0,92,88,1,0,0,0,92,89,1,0,0,0,92,90,1,0,0,0,92,91,1,0,0, - 0,93,11,1,0,0,0,94,95,3,28,14,0,95,96,7,0,0,0,96,98,3,26,13,0,97,99,3, - 30,15,0,98,97,1,0,0,0,98,99,1,0,0,0,99,13,1,0,0,0,100,101,5,19,0,0,101, - 102,3,28,14,0,102,103,7,1,0,0,103,104,3,32,16,0,104,105,5,20,0,0,105,15, - 1,0,0,0,106,107,5,19,0,0,107,108,5,20,0,0,108,17,1,0,0,0,109,111,5,22, - 0,0,110,109,1,0,0,0,110,111,1,0,0,0,111,112,1,0,0,0,112,113,5,17,0,0,113, - 114,5,23,0,0,114,115,5,18,0,0,115,19,1,0,0,0,116,117,5,15,0,0,117,118, - 3,6,3,0,118,120,5,16,0,0,119,121,3,30,15,0,120,119,1,0,0,0,120,121,1,0, - 0,0,121,21,1,0,0,0,122,124,3,32,16,0,123,125,3,30,15,0,124,123,1,0,0,0, - 124,125,1,0,0,0,125,23,1,0,0,0,126,128,5,23,0,0,127,129,3,30,15,0,128, - 127,1,0,0,0,128,129,1,0,0,0,129,25,1,0,0,0,130,135,3,18,9,0,131,135,3, - 20,10,0,132,135,3,22,11,0,133,135,3,24,12,0,134,130,1,0,0,0,134,131,1, - 0,0,0,134,132,1,0,0,0,134,133,1,0,0,0,135,27,1,0,0,0,136,141,5,23,0,0, - 137,138,5,21,0,0,138,140,5,23,0,0,139,137,1,0,0,0,140,143,1,0,0,0,141, - 139,1,0,0,0,141,142,1,0,0,0,142,29,1,0,0,0,143,141,1,0,0,0,144,145,7,2, - 0,0,145,31,1,0,0,0,146,147,7,3,0,0,147,33,1,0,0,0,16,37,43,49,53,58,63, - 76,82,92,98,110,120,124,128,134,141 + 1,5,1,5,1,5,1,5,1,5,3,5,93,8,5,1,6,1,6,1,6,3,6,98,8,6,1,6,1,6,3,6,102, + 8,6,1,7,1,7,1,7,1,7,1,7,1,7,1,8,1,8,1,8,1,9,3,9,114,8,9,1,9,1,9,1,9,1, + 9,1,10,1,10,1,10,1,10,3,10,124,8,10,1,11,1,11,3,11,128,8,11,1,12,1,12, + 3,12,132,8,12,1,13,1,13,1,13,1,13,3,13,138,8,13,1,14,1,14,1,14,5,14,143, + 8,14,10,14,12,14,146,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,8,10,1,0,8,9,1,0,1,3,2,0,4,7, + 23,25,158,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,92,1,0,0,0,12,94,1,0,0,0,14,103,1,0,0,0,16,109,1,0,0,0,18,113,1, + 0,0,0,20,119,1,0,0,0,22,125,1,0,0,0,24,129,1,0,0,0,26,137,1,0,0,0,28,139, + 1,0,0,0,30,147,1,0,0,0,32,149,1,0,0,0,34,36,5,29,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,23,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,12,0,0,52,54,5,23,0,0,53, + 51,1,0,0,0,53,54,1,0,0,0,54,55,1,0,0,0,55,56,5,8,0,0,56,58,3,6,3,0,57, + 59,5,13,0,0,58,57,1,0,0,0,58,59,1,0,0,0,59,61,1,0,0,0,60,62,5,29,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,15,0,0,66,67,5,23,0,0,67,68,5,12,0,0,68,69,5,23,0,0,69,70,5,16,0,0,70, + 5,1,0,0,0,71,76,3,8,4,0,72,73,5,11,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,93,3,12,6,0,86,93,3,14,7,0,87,93,3,16,8,0,88, + 93,3,18,9,0,89,93,3,20,10,0,90,93,3,22,11,0,91,93,3,24,12,0,92,85,1,0, + 0,0,92,86,1,0,0,0,92,87,1,0,0,0,92,88,1,0,0,0,92,89,1,0,0,0,92,90,1,0, + 0,0,92,91,1,0,0,0,93,11,1,0,0,0,94,95,3,28,14,0,95,97,7,0,0,0,96,98,5, + 22,0,0,97,96,1,0,0,0,97,98,1,0,0,0,98,99,1,0,0,0,99,101,3,26,13,0,100, + 102,3,30,15,0,101,100,1,0,0,0,101,102,1,0,0,0,102,13,1,0,0,0,103,104,5, + 19,0,0,104,105,3,28,14,0,105,106,7,1,0,0,106,107,3,32,16,0,107,108,5,20, + 0,0,108,15,1,0,0,0,109,110,5,19,0,0,110,111,5,20,0,0,111,17,1,0,0,0,112, + 114,5,22,0,0,113,112,1,0,0,0,113,114,1,0,0,0,114,115,1,0,0,0,115,116,5, + 17,0,0,116,117,5,23,0,0,117,118,5,18,0,0,118,19,1,0,0,0,119,120,5,15,0, + 0,120,121,3,6,3,0,121,123,5,16,0,0,122,124,3,30,15,0,123,122,1,0,0,0,123, + 124,1,0,0,0,124,21,1,0,0,0,125,127,3,32,16,0,126,128,3,30,15,0,127,126, + 1,0,0,0,127,128,1,0,0,0,128,23,1,0,0,0,129,131,5,23,0,0,130,132,3,30,15, + 0,131,130,1,0,0,0,131,132,1,0,0,0,132,25,1,0,0,0,133,138,3,18,9,0,134, + 138,3,20,10,0,135,138,3,22,11,0,136,138,3,24,12,0,137,133,1,0,0,0,137, + 134,1,0,0,0,137,135,1,0,0,0,137,136,1,0,0,0,138,27,1,0,0,0,139,144,5,23, + 0,0,140,141,5,21,0,0,141,143,5,23,0,0,142,140,1,0,0,0,143,146,1,0,0,0, + 144,142,1,0,0,0,144,145,1,0,0,0,145,29,1,0,0,0,146,144,1,0,0,0,147,148, + 7,2,0,0,148,31,1,0,0,0,149,150,7,3,0,0,150,33,1,0,0,0,17,37,43,49,53,58, + 63,76,82,92,97,101,113,123,127,131,137,144 }; public static readonly ATN _ATN = diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfVisitor.cs b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfVisitor.cs similarity index 100% rename from SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfVisitor.cs rename to SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfVisitor.cs diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/AssignmentElement.cs b/SysML2.NET.CodeGenerator/Grammar/Model/AssignmentElement.cs index 19d83112..719dd5d2 100644 --- a/SysML2.NET.CodeGenerator/Grammar/Model/AssignmentElement.cs +++ b/SysML2.NET.CodeGenerator/Grammar/Model/AssignmentElement.cs @@ -36,8 +36,13 @@ public class AssignmentElement: RuleElement public string Operator { get; set; } /// - /// Getss or sets the assignment value + /// 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/TextualNotationSpecificationVisitor.cs b/SysML2.NET.CodeGenerator/Grammar/TextualNotationSpecificationVisitor.cs index a5fcd1b6..fff2225b 100644 --- a/SysML2.NET.CodeGenerator/Grammar/TextualNotationSpecificationVisitor.cs +++ b/SysML2.NET.CodeGenerator/Grammar/TextualNotationSpecificationVisitor.cs @@ -56,6 +56,11 @@ public override object VisitRule_definition(kebnfParser.Rule_definitionContext c TargetElementName = context.name.Text }; + if (string.IsNullOrWhiteSpace(rule.RuleName)) + { + rule.RuleName = rule.TargetElementName; + } + if (context.parameter_list() != null) { rule.Parameter = new RuleParameter() @@ -103,7 +108,8 @@ public override object VisitAssignment(kebnfParser.AssignmentContext context) Property = context.property.GetText(), Operator = context.op.Text, Suffix = context.suffix?.GetText(), - Value = (RuleElement)this.Visit(context.content) + Value = (RuleElement)this.Visit(context.content), + Prefix = context.prefix?.Text }; } 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 index 97f881e3..0797bc83 100644 --- a/SysML2.NET.CodeGenerator/Templates/Uml/core-textual-notation-builder-template.hbs +++ b/SysML2.NET.CodeGenerator/Templates/Uml/core-textual-notation-builder-template.hbs @@ -1,5 +1,5 @@ // ------------------------------------------------------------------------------------------------- -// +// // // Copyright 2022-2026 Starion Group S.A. // @@ -24,29 +24,33 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class {{this.Name}}TextualNotationBuilder: TextualNotationBuilder + public class {{this.ClassContext.Name}}TextualNotationBuilder: TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced - public {{this.Name}}TextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + public {{this.ClassContext.Name}}TextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) { } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the provided /// - /// The from which the textual notation should be build + /// The from which the textual notation should be build /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.{{ #NamedElement.WriteFullyQualifiedNameSpace this }}.{{ this.Name }} poco) + public override string BuildTextualNotation(SysML2.NET.Core.POCO.{{ #NamedElement.WriteFullyQualifiedNameSpace this.ClassContext }}.{{ this.ClassContext.Name }} poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + {{RulesHelper.WriteForPoco this.ClassContext this.Rules}} + return stringBuilder.ToString(); } } } From 6779ca887aa860978c65b046f5159b6bf6e06ef6 Mon Sep 17 00:00:00 2001 From: atheate Date: Fri, 20 Feb 2026 16:12:43 +0100 Subject: [PATCH 05/33] [WIP] Improved G4 and process TerminalElement rules --- Resources/kebnf.g4 | 12 +- .../UmlCoreTextualNotationBuilderGenerator.cs | 2 + .../NET/CodeGenerator/Grammar/kebnf.interp | 90 +++++++ .../NET/CodeGenerator/Grammar}/kebnf.tokens | 16 +- .../Grammar}/kebnfBaseListener.cs | 0 .../Grammar}/kebnfBaseVisitor.cs | 0 .../NET/CodeGenerator/Grammar/kebnfLexer.cs | 185 ++++++++++++++ .../CodeGenerator/Grammar/kebnfLexer.interp | 110 +++++++++ .../CodeGenerator/Grammar}/kebnfLexer.tokens | 16 +- .../CodeGenerator/Grammar}/kebnfListener.cs | 0 .../NET/CodeGenerator/Grammar}/kebnfParser.cs | 228 ++++++++++-------- .../CodeGenerator/Grammar}/kebnfVisitor.cs | 0 .../Grammar/AutoGenGrammar/kebnf.interp | 86 ------- .../Grammar/AutoGenGrammar/kebnfLexer.cs | 174 ------------- .../Grammar/AutoGenGrammar/kebnfLexer.interp | 104 -------- .../Grammar/Model/TextualNotationRule.cs | 5 + .../Grammar/Model/ValueLiteralElement.cs | 33 +++ .../TextualNotationSpecificationVisitor.cs | 24 +- .../HandleBarHelpers/RulesHelper.cs | 103 ++++++++ ...AcceptActionUsageTextualNotationBuilder.cs | 8 +- .../ActionDefinitionTextualNotationBuilder.cs | 21 +- .../ActionUsageTextualNotationBuilder.cs | 20 +- .../ActorMembershipTextualNotationBuilder.cs | 8 +- ...ocationDefinitionTextualNotationBuilder.cs | 18 +- .../AllocationUsageTextualNotationBuilder.cs | 21 +- ...sisCaseDefinitionTextualNotationBuilder.cs | 21 +- ...AnalysisCaseUsageTextualNotationBuilder.cs | 26 +- ...AnnotatingElementTextualNotationBuilder.cs | 30 ++- .../AnnotationTextualNotationBuilder.cs | 11 +- ...rtConstraintUsageTextualNotationBuilder.cs | 19 +- ...gnmentActionUsageTextualNotationBuilder.cs | 8 +- ...ociationStructureTextualNotationBuilder.cs | 25 +- .../AssociationTextualNotationBuilder.cs | 20 +- ...tributeDefinitionTextualNotationBuilder.cs | 18 +- .../AttributeUsageTextualNotationBuilder.cs | 19 +- .../BehaviorTextualNotationBuilder.cs | 22 +- ...gConnectorAsUsageTextualNotationBuilder.cs | 23 +- .../BindingConnectorTextualNotationBuilder.cs | 24 +- ...BooleanExpressionTextualNotationBuilder.cs | 25 +- ...ulationDefinitionTextualNotationBuilder.cs | 21 +- .../CalculationUsageTextualNotationBuilder.cs | 20 +- .../CaseDefinitionTextualNotationBuilder.cs | 21 +- .../CaseUsageTextualNotationBuilder.cs | 24 +- .../ClassTextualNotationBuilder.cs | 22 +- .../ClassifierTextualNotationBuilder.cs | 20 +- ...CollectExpressionTextualNotationBuilder.cs | 13 +- .../CommentTextualNotationBuilder.cs | 13 +- ...ConcernDefinitionTextualNotationBuilder.cs | 21 +- .../ConcernUsageTextualNotationBuilder.cs | 26 +- ...tedPortDefinitionTextualNotationBuilder.cs | 11 +- ...jugatedPortTypingTextualNotationBuilder.cs | 25 +- .../ConjugationTextualNotationBuilder.cs | 26 +- ...nectionDefinitionTextualNotationBuilder.cs | 18 +- .../ConnectionUsageTextualNotationBuilder.cs | 17 +- .../ConnectorTextualNotationBuilder.cs | 20 +- ...straintDefinitionTextualNotationBuilder.cs | 21 +- .../ConstraintUsageTextualNotationBuilder.cs | 24 +- ...tructorExpressionTextualNotationBuilder.cs | 13 +- .../CrossSubsettingTextualNotationBuilder.cs | 8 +- .../DataTypeTextualNotationBuilder.cs | 22 +- .../DecisionNodeTextualNotationBuilder.cs | 20 +- .../DefinitionTextualNotationBuilder.cs | 16 +- .../DependencyTextualNotationBuilder.cs | 24 +- .../DifferencingTextualNotationBuilder.cs | 14 +- .../DisjoiningTextualNotationBuilder.cs | 20 +- .../DocumentationTextualNotationBuilder.cs | 18 +- ...tFilterMembershipTextualNotationBuilder.cs | 8 +- ...FeatureMembershipTextualNotationBuilder.cs | 8 +- ...erationDefinitionTextualNotationBuilder.cs | 21 +- .../EnumerationUsageTextualNotationBuilder.cs | 21 +- ...ntOccurrenceUsageTextualNotationBuilder.cs | 20 +- ...ExhibitStateUsageTextualNotationBuilder.cs | 23 +- .../ExpressionTextualNotationBuilder.cs | 27 ++- ...reChainExpressionTextualNotationBuilder.cs | 13 +- .../FeatureChainingTextualNotationBuilder.cs | 8 +- .../FeatureInvertingTextualNotationBuilder.cs | 20 +- ...FeatureMembershipTextualNotationBuilder.cs | 8 +- ...ferenceExpressionTextualNotationBuilder.cs | 12 +- .../FeatureTextualNotationBuilder.cs | 19 +- .../FeatureTypingTextualNotationBuilder.cs | 29 ++- .../FeatureValueTextualNotationBuilder.cs | 17 +- .../FlowDefinitionTextualNotationBuilder.cs | 18 +- .../FlowEndTextualNotationBuilder.cs | 12 +- .../FlowTextualNotationBuilder.cs | 22 +- .../FlowUsageTextualNotationBuilder.cs | 20 +- ...orLoopActionUsageTextualNotationBuilder.cs | 8 +- .../ForkNodeTextualNotationBuilder.cs | 22 +- ...ConcernMembershipTextualNotationBuilder.cs | 8 +- .../FunctionTextualNotationBuilder.cs | 20 +- .../IfActionUsageTextualNotationBuilder.cs | 8 +- ...cludeUseCaseUsageTextualNotationBuilder.cs | 25 +- .../IndexExpressionTextualNotationBuilder.cs | 15 +- .../InteractionTextualNotationBuilder.cs | 22 +- ...terfaceDefinitionTextualNotationBuilder.cs | 21 +- .../InterfaceUsageTextualNotationBuilder.cs | 20 +- .../IntersectingTextualNotationBuilder.cs | 12 +- .../InvariantTextualNotationBuilder.cs | 30 ++- ...ocationExpressionTextualNotationBuilder.cs | 15 +- .../ItemDefinitionTextualNotationBuilder.cs | 18 +- .../ItemUsageTextualNotationBuilder.cs | 19 +- .../JoinNodeTextualNotationBuilder.cs | 20 +- .../LibraryPackageTextualNotationBuilder.cs | 19 +- .../LiteralBooleanTextualNotationBuilder.cs | 11 +- ...LiteralExpressionTextualNotationBuilder.cs | 29 ++- .../LiteralInfinityTextualNotationBuilder.cs | 15 +- .../LiteralIntegerTextualNotationBuilder.cs | 11 +- .../LiteralRationalTextualNotationBuilder.cs | 8 +- .../LiteralStringTextualNotationBuilder.cs | 11 +- .../MembershipExposeTextualNotationBuilder.cs | 13 +- .../MembershipImportTextualNotationBuilder.cs | 12 +- .../MembershipTextualNotationBuilder.cs | 8 +- .../MergeNodeTextualNotationBuilder.cs | 20 +- .../MetaclassTextualNotationBuilder.cs | 20 +- ...aAccessExpressionTextualNotationBuilder.cs | 13 +- ...etadataDefinitionTextualNotationBuilder.cs | 19 +- .../MetadataFeatureTextualNotationBuilder.cs | 19 +- .../MetadataUsageTextualNotationBuilder.cs | 21 +- ...MultiplicityRangeTextualNotationBuilder.cs | 14 +- .../MultiplicityTextualNotationBuilder.cs | 16 +- .../NamespaceExposeTextualNotationBuilder.cs | 15 +- .../NamespaceImportTextualNotationBuilder.cs | 16 +- .../NamespaceTextualNotationBuilder.cs | 17 +- .../NullExpressionTextualNotationBuilder.cs | 13 +- ...jectiveMembershipTextualNotationBuilder.cs | 8 +- ...urrenceDefinitionTextualNotationBuilder.cs | 18 +- .../OccurrenceUsageTextualNotationBuilder.cs | 17 +- ...peratorExpressionTextualNotationBuilder.cs | 8 +- .../OwningMembershipTextualNotationBuilder.cs | 8 +- .../PackageTextualNotationBuilder.cs | 17 +- ...rameterMembershipTextualNotationBuilder.cs | 8 +- .../PartDefinitionTextualNotationBuilder.cs | 18 +- .../PartUsageTextualNotationBuilder.cs | 19 +- .../PayloadFeatureTextualNotationBuilder.cs | 23 +- ...erformActionUsageTextualNotationBuilder.cs | 20 +- .../PortConjugationTextualNotationBuilder.cs | 10 +- .../PortDefinitionTextualNotationBuilder.cs | 22 +- .../PortUsageTextualNotationBuilder.cs | 17 +- .../PredicateTextualNotationBuilder.cs | 22 +- .../RedefinitionTextualNotationBuilder.cs | 30 ++- ...ferenceSubsettingTextualNotationBuilder.cs | 8 +- .../ReferenceUsageTextualNotationBuilder.cs | 15 +- ...nderingDefinitionTextualNotationBuilder.cs | 18 +- .../RenderingUsageTextualNotationBuilder.cs | 19 +- ...straintMembershipTextualNotationBuilder.cs | 8 +- ...irementDefinitionTextualNotationBuilder.cs | 21 +- .../RequirementUsageTextualNotationBuilder.cs | 24 +- ...icationMembershipTextualNotationBuilder.cs | 8 +- ...ressionMembershipTextualNotationBuilder.cs | 8 +- ...rameterMembershipTextualNotationBuilder.cs | 8 +- ...yRequirementUsageTextualNotationBuilder.cs | 24 +- .../SelectExpressionTextualNotationBuilder.cs | 13 +- .../SendActionUsageTextualNotationBuilder.cs | 8 +- .../SpecializationTextualNotationBuilder.cs | 28 ++- ...eholderMembershipTextualNotationBuilder.cs | 8 +- .../StateDefinitionTextualNotationBuilder.cs | 21 +- ...bactionMembershipTextualNotationBuilder.cs | 8 +- .../StateUsageTextualNotationBuilder.cs | 20 +- .../StepTextualNotationBuilder.cs | 29 ++- .../StructureTextualNotationBuilder.cs | 22 +- ...SubclassificationTextualNotationBuilder.cs | 22 +- ...SubjectMembershipTextualNotationBuilder.cs | 8 +- .../SubsettingTextualNotationBuilder.cs | 28 ++- ...SuccessionAsUsageTextualNotationBuilder.cs | 25 +- .../SuccessionFlowTextualNotationBuilder.cs | 23 +- ...ccessionFlowUsageTextualNotationBuilder.cs | 21 +- .../SuccessionTextualNotationBuilder.cs | 26 +- ...minateActionUsageTextualNotationBuilder.cs | 8 +- ...ualRepresentationTextualNotationBuilder.cs | 18 +- ...FeatureMembershipTextualNotationBuilder.cs | 8 +- .../TransitionUsageTextualNotationBuilder.cs | 22 +- ...ocationExpressionTextualNotationBuilder.cs | 8 +- .../TypeFeaturingTextualNotationBuilder.cs | 20 +- .../TypeTextualNotationBuilder.cs | 20 +- .../UnioningTextualNotationBuilder.cs | 12 +- .../UsageTextualNotationBuilder.cs | 16 +- ...UseCaseDefinitionTextualNotationBuilder.cs | 22 +- .../UseCaseUsageTextualNotationBuilder.cs | 25 +- ...VariantMembershipTextualNotationBuilder.cs | 8 +- ...ionCaseDefinitionTextualNotationBuilder.cs | 21 +- ...ficationCaseUsageTextualNotationBuilder.cs | 24 +- .../ViewDefinitionTextualNotationBuilder.cs | 21 +- ...nderingMembershipTextualNotationBuilder.cs | 8 +- .../ViewUsageTextualNotationBuilder.cs | 23 +- ...ewpointDefinitionTextualNotationBuilder.cs | 21 +- .../ViewpointUsageTextualNotationBuilder.cs | 26 +- ...leLoopActionUsageTextualNotationBuilder.cs | 8 +- 186 files changed, 3296 insertions(+), 821 deletions(-) create mode 100644 SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnf.interp rename SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/{ => SysML2/NET/CodeGenerator/Grammar}/kebnf.tokens (78%) rename SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/{ => SysML2/NET/CodeGenerator/Grammar}/kebnfBaseListener.cs (100%) rename SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/{ => SysML2/NET/CodeGenerator/Grammar}/kebnfBaseVisitor.cs (100%) create mode 100644 SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.cs create mode 100644 SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.interp rename SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/{ => SysML2/NET/CodeGenerator/Grammar}/kebnfLexer.tokens (78%) rename SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/{ => SysML2/NET/CodeGenerator/Grammar}/kebnfListener.cs (100%) rename SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/{ => SysML2/NET/CodeGenerator/Grammar}/kebnfParser.cs (89%) rename SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/{ => SysML2/NET/CodeGenerator/Grammar}/kebnfVisitor.cs (100%) delete mode 100644 SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnf.interp delete mode 100644 SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfLexer.cs delete mode 100644 SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfLexer.interp create mode 100644 SysML2.NET.CodeGenerator/Grammar/Model/ValueLiteralElement.cs create mode 100644 SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs diff --git a/Resources/kebnf.g4 b/Resources/kebnf.g4 index f068d86e..b67c94d2 100644 --- a/Resources/kebnf.g4 +++ b/Resources/kebnf.g4 @@ -5,7 +5,7 @@ grammar kebnf; specification : (NL)* rule_definition+ EOF ; rule_definition - : name=ID (params=parameter_list)? (COLON target_ast=ID)? ASSIGN rule_body=alternatives SEMICOLON? NL+ + : name=UPPER_ID (params=parameter_list)? (COLON target_ast=UPPER_ID)? ASSIGN rule_body=alternatives SEMICOLON? NL+ ; parameter_list @@ -28,6 +28,7 @@ element | group | terminal | non_terminal + | value_literal ; assignment @@ -51,11 +52,11 @@ group ; terminal - : val=value_literal (suffix=suffix_op)? + : val=SINGLE_QUOTED_STRING (suffix=suffix_op)? ; non_terminal - : name=ID (suffix=suffix_op)? + : name=UPPER_ID (suffix=suffix_op)? ; element_core @@ -63,6 +64,7 @@ element_core | group | terminal | non_terminal + | value_literal ; dotted_id @@ -71,7 +73,7 @@ dotted_id suffix_op : '*' | '+' | '?' ; -value_literal : ID | 'true' | 'false' | 'this' | INT | STRING | '[QualifiedName]'; +value_literal : ID | 'true' | 'false' | 'this' | INT | STRING | '[QualifiedName]' | SINGLE_QUOTED_STRING; // Lexer ASSIGN : '::=' | '=' ; @@ -90,7 +92,9 @@ 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 : '\'' ( ~['\\] | '\\' . )* '\'' ; diff --git a/SysML2.NET.CodeGenerator/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGenerator.cs b/SysML2.NET.CodeGenerator/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGenerator.cs index 0c314862..fd82343a 100644 --- a/SysML2.NET.CodeGenerator/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGenerator.cs +++ b/SysML2.NET.CodeGenerator/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGenerator.cs @@ -27,6 +27,7 @@ namespace SysML2.NET.CodeGenerator.Generators.UmlHandleBarsGenerators using SysML2.NET.CodeGenerator.Extensions; using SysML2.NET.CodeGenerator.Grammar.Model; + using SysML2.NET.CodeGenerator.HandleBarHelpers; using uml4net.Extensions; using uml4net.HandleBars; @@ -57,6 +58,7 @@ protected override void RegisterHelpers() { NamedElementHelper.RegisterNamedElementHelper(this.Handlebars); this.Handlebars.RegisterStringHelper(); + this.Handlebars.RegisterRulesHelper(); } /// 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 00000000..e16ea718 --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnf.interp @@ -0,0 +1,90 @@ +token literal names: +null +'*' +'+' +'?' +'true' +'false' +'this' +'[QualifiedName]' +null +'+=' +'?=' +'|' +':' +';' +',' +'(' +')' +'[' +']' +'{' +'}' +'.' +'~' +null +null +null +null +null +null +null +null +null + +token symbolic names: +null +null +null +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, 31, 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, 8, 10, 1, 0, 8, 9, 1, 0, 1, 3, 2, 0, 4, 7, 24, 27, 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, 31, 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, 23, 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, 12, 0, 0, 52, 54, 5, 23, 0, 0, 53, 51, 1, 0, 0, 0, 53, 54, 1, 0, 0, 0, 54, 55, 1, 0, 0, 0, 55, 56, 5, 8, 0, 0, 56, 58, 3, 6, 3, 0, 57, 59, 5, 13, 0, 0, 58, 57, 1, 0, 0, 0, 58, 59, 1, 0, 0, 0, 59, 61, 1, 0, 0, 0, 60, 62, 5, 31, 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, 15, 0, 0, 66, 67, 5, 24, 0, 0, 67, 68, 5, 12, 0, 0, 68, 69, 5, 24, 0, 0, 69, 70, 5, 16, 0, 0, 70, 5, 1, 0, 0, 0, 71, 76, 3, 8, 4, 0, 72, 73, 5, 11, 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, 22, 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, 19, 0, 0, 105, 106, 3, 28, 14, 0, 106, 107, 7, 1, 0, 0, 107, 108, 3, 32, 16, 0, 108, 109, 5, 20, 0, 0, 109, 15, 1, 0, 0, 0, 110, 111, 5, 19, 0, 0, 111, 112, 5, 20, 0, 0, 112, 17, 1, 0, 0, 0, 113, 115, 5, 22, 0, 0, 114, 113, 1, 0, 0, 0, 114, 115, 1, 0, 0, 0, 115, 116, 1, 0, 0, 0, 116, 117, 5, 17, 0, 0, 117, 118, 5, 24, 0, 0, 118, 119, 5, 18, 0, 0, 119, 19, 1, 0, 0, 0, 120, 121, 5, 15, 0, 0, 121, 122, 3, 6, 3, 0, 122, 124, 5, 16, 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, 25, 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, 23, 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, 24, 0, 0, 142, 143, 5, 21, 0, 0, 143, 145, 5, 24, 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/kebnf.tokens b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnf.tokens similarity index 78% rename from SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnf.tokens rename to SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnf.tokens index a34fe965..07eb9f09 100644 --- a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnf.tokens +++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnf.tokens @@ -20,13 +20,15 @@ LBRACE=19 RBRACE=20 DOT=21 TILDE=22 -ID=23 -INT=24 -STRING=25 -COMMENT=26 -WS=27 -CONTINUATION=28 -NL=29 +UPPER_ID=23 +ID=24 +SINGLE_QUOTED_STRING=25 +INT=26 +STRING=27 +COMMENT=28 +WS=29 +CONTINUATION=30 +NL=31 '*'=1 '+'=2 '?'=3 diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfBaseListener.cs b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfBaseListener.cs similarity index 100% rename from SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfBaseListener.cs rename to SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfBaseListener.cs diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfBaseVisitor.cs b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfBaseVisitor.cs similarity index 100% rename from SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfBaseVisitor.cs rename to SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfBaseVisitor.cs 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 00000000..42c8411d --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.cs @@ -0,0 +1,185 @@ +//------------------------------------------------------------------------------ +// +// 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, T__4=5, T__5=6, T__6=7, ASSIGN=8, ADD_ASSIGN=9, + BOOL_ASSIGN=10, PIPE=11, COLON=12, SEMICOLON=13, COMMA=14, LPAREN=15, + RPAREN=16, LBRACK=17, RBRACK=18, LBRACE=19, RBRACE=20, DOT=21, TILDE=22, + UPPER_ID=23, ID=24, SINGLE_QUOTED_STRING=25, INT=26, STRING=27, COMMENT=28, + WS=29, CONTINUATION=30, NL=31; + 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", "T__4", "T__5", "T__6", "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, "'*'", "'+'", "'?'", "'true'", "'false'", "'this'", "'[QualifiedName]'", + null, "'+='", "'?='", "'|'", "':'", "';'", "','", "'('", "')'", "'['", + "']'", "'{'", "'}'", "'.'", "'~'" + }; + private static readonly string[] _SymbolicNames = { + null, null, null, 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,31,212,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,2,28, + 7,28,2,29,7,29,2,30,7,30,1,0,1,0,1,1,1,1,1,2,1,2,1,3,1,3,1,3,1,3,1,3,1, + 4,1,4,1,4,1,4,1,4,1,4,1,5,1,5,1,5,1,5,1,5,1,6,1,6,1,6,1,6,1,6,1,6,1,6, + 1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,7,1,7,1,7,1,7,3,7,106,8,7,1,8,1, + 8,1,8,1,9,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,1,20,1,20,1,21,1,21,1, + 22,1,22,5,22,140,8,22,10,22,12,22,143,9,22,1,23,1,23,5,23,147,8,23,10, + 23,12,23,150,9,23,1,24,1,24,1,24,1,24,5,24,156,8,24,10,24,12,24,159,9, + 24,1,24,1,24,1,25,4,25,164,8,25,11,25,12,25,165,1,26,1,26,1,26,1,26,5, + 26,172,8,26,10,26,12,26,175,9,26,1,26,1,26,1,27,1,27,1,27,1,27,5,27,183, + 8,27,10,27,12,27,186,9,27,1,27,1,27,1,28,4,28,191,8,28,11,28,12,28,192, + 1,28,1,28,1,29,3,29,198,8,29,1,29,1,29,4,29,202,8,29,11,29,12,29,203,1, + 29,1,29,1,30,3,30,209,8,30,1,30,1,30,0,0,31,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,57,29,59,30,61,31, + 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,224,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,0,57, + 1,0,0,0,0,59,1,0,0,0,0,61,1,0,0,0,1,63,1,0,0,0,3,65,1,0,0,0,5,67,1,0,0, + 0,7,69,1,0,0,0,9,74,1,0,0,0,11,80,1,0,0,0,13,85,1,0,0,0,15,105,1,0,0,0, + 17,107,1,0,0,0,19,110,1,0,0,0,21,113,1,0,0,0,23,115,1,0,0,0,25,117,1,0, + 0,0,27,119,1,0,0,0,29,121,1,0,0,0,31,123,1,0,0,0,33,125,1,0,0,0,35,127, + 1,0,0,0,37,129,1,0,0,0,39,131,1,0,0,0,41,133,1,0,0,0,43,135,1,0,0,0,45, + 137,1,0,0,0,47,144,1,0,0,0,49,151,1,0,0,0,51,163,1,0,0,0,53,167,1,0,0, + 0,55,178,1,0,0,0,57,190,1,0,0,0,59,197,1,0,0,0,61,208,1,0,0,0,63,64,5, + 42,0,0,64,2,1,0,0,0,65,66,5,43,0,0,66,4,1,0,0,0,67,68,5,63,0,0,68,6,1, + 0,0,0,69,70,5,116,0,0,70,71,5,114,0,0,71,72,5,117,0,0,72,73,5,101,0,0, + 73,8,1,0,0,0,74,75,5,102,0,0,75,76,5,97,0,0,76,77,5,108,0,0,77,78,5,115, + 0,0,78,79,5,101,0,0,79,10,1,0,0,0,80,81,5,116,0,0,81,82,5,104,0,0,82,83, + 5,105,0,0,83,84,5,115,0,0,84,12,1,0,0,0,85,86,5,91,0,0,86,87,5,81,0,0, + 87,88,5,117,0,0,88,89,5,97,0,0,89,90,5,108,0,0,90,91,5,105,0,0,91,92,5, + 102,0,0,92,93,5,105,0,0,93,94,5,101,0,0,94,95,5,100,0,0,95,96,5,78,0,0, + 96,97,5,97,0,0,97,98,5,109,0,0,98,99,5,101,0,0,99,100,5,93,0,0,100,14, + 1,0,0,0,101,102,5,58,0,0,102,103,5,58,0,0,103,106,5,61,0,0,104,106,5,61, + 0,0,105,101,1,0,0,0,105,104,1,0,0,0,106,16,1,0,0,0,107,108,5,43,0,0,108, + 109,5,61,0,0,109,18,1,0,0,0,110,111,5,63,0,0,111,112,5,61,0,0,112,20,1, + 0,0,0,113,114,5,124,0,0,114,22,1,0,0,0,115,116,5,58,0,0,116,24,1,0,0,0, + 117,118,5,59,0,0,118,26,1,0,0,0,119,120,5,44,0,0,120,28,1,0,0,0,121,122, + 5,40,0,0,122,30,1,0,0,0,123,124,5,41,0,0,124,32,1,0,0,0,125,126,5,91,0, + 0,126,34,1,0,0,0,127,128,5,93,0,0,128,36,1,0,0,0,129,130,5,123,0,0,130, + 38,1,0,0,0,131,132,5,125,0,0,132,40,1,0,0,0,133,134,5,46,0,0,134,42,1, + 0,0,0,135,136,5,126,0,0,136,44,1,0,0,0,137,141,7,0,0,0,138,140,7,1,0,0, + 139,138,1,0,0,0,140,143,1,0,0,0,141,139,1,0,0,0,141,142,1,0,0,0,142,46, + 1,0,0,0,143,141,1,0,0,0,144,148,7,2,0,0,145,147,7,1,0,0,146,145,1,0,0, + 0,147,150,1,0,0,0,148,146,1,0,0,0,148,149,1,0,0,0,149,48,1,0,0,0,150,148, + 1,0,0,0,151,157,5,39,0,0,152,156,8,3,0,0,153,154,5,92,0,0,154,156,9,0, + 0,0,155,152,1,0,0,0,155,153,1,0,0,0,156,159,1,0,0,0,157,155,1,0,0,0,157, + 158,1,0,0,0,158,160,1,0,0,0,159,157,1,0,0,0,160,161,5,39,0,0,161,50,1, + 0,0,0,162,164,7,4,0,0,163,162,1,0,0,0,164,165,1,0,0,0,165,163,1,0,0,0, + 165,166,1,0,0,0,166,52,1,0,0,0,167,173,5,39,0,0,168,172,8,3,0,0,169,170, + 5,92,0,0,170,172,9,0,0,0,171,168,1,0,0,0,171,169,1,0,0,0,172,175,1,0,0, + 0,173,171,1,0,0,0,173,174,1,0,0,0,174,176,1,0,0,0,175,173,1,0,0,0,176, + 177,5,39,0,0,177,54,1,0,0,0,178,179,5,47,0,0,179,180,5,47,0,0,180,184, + 1,0,0,0,181,183,8,5,0,0,182,181,1,0,0,0,183,186,1,0,0,0,184,182,1,0,0, + 0,184,185,1,0,0,0,185,187,1,0,0,0,186,184,1,0,0,0,187,188,6,27,0,0,188, + 56,1,0,0,0,189,191,7,6,0,0,190,189,1,0,0,0,191,192,1,0,0,0,192,190,1,0, + 0,0,192,193,1,0,0,0,193,194,1,0,0,0,194,195,6,28,0,0,195,58,1,0,0,0,196, + 198,5,13,0,0,197,196,1,0,0,0,197,198,1,0,0,0,198,199,1,0,0,0,199,201,5, + 10,0,0,200,202,7,6,0,0,201,200,1,0,0,0,202,203,1,0,0,0,203,201,1,0,0,0, + 203,204,1,0,0,0,204,205,1,0,0,0,205,206,6,29,0,0,206,60,1,0,0,0,207,209, + 5,13,0,0,208,207,1,0,0,0,208,209,1,0,0,0,209,210,1,0,0,0,210,211,5,10, + 0,0,211,62,1,0,0,0,14,0,105,141,148,155,157,165,171,173,184,192,197,203, + 208,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 00000000..72caecf6 --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.interp @@ -0,0 +1,110 @@ +token literal names: +null +'*' +'+' +'?' +'true' +'false' +'this' +'[QualifiedName]' +null +'+=' +'?=' +'|' +':' +';' +',' +'(' +')' +'[' +']' +'{' +'}' +'.' +'~' +null +null +null +null +null +null +null +null +null + +token symbolic names: +null +null +null +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 +T__4 +T__5 +T__6 +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, 31, 212, 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, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 106, 8, 7, 1, 8, 1, 8, 1, 8, 1, 9, 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, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 5, 22, 140, 8, 22, 10, 22, 12, 22, 143, 9, 22, 1, 23, 1, 23, 5, 23, 147, 8, 23, 10, 23, 12, 23, 150, 9, 23, 1, 24, 1, 24, 1, 24, 1, 24, 5, 24, 156, 8, 24, 10, 24, 12, 24, 159, 9, 24, 1, 24, 1, 24, 1, 25, 4, 25, 164, 8, 25, 11, 25, 12, 25, 165, 1, 26, 1, 26, 1, 26, 1, 26, 5, 26, 172, 8, 26, 10, 26, 12, 26, 175, 9, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 5, 27, 183, 8, 27, 10, 27, 12, 27, 186, 9, 27, 1, 27, 1, 27, 1, 28, 4, 28, 191, 8, 28, 11, 28, 12, 28, 192, 1, 28, 1, 28, 1, 29, 3, 29, 198, 8, 29, 1, 29, 1, 29, 4, 29, 202, 8, 29, 11, 29, 12, 29, 203, 1, 29, 1, 29, 1, 30, 3, 30, 209, 8, 30, 1, 30, 1, 30, 0, 0, 31, 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, 57, 29, 59, 30, 61, 31, 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, 224, 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, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 1, 63, 1, 0, 0, 0, 3, 65, 1, 0, 0, 0, 5, 67, 1, 0, 0, 0, 7, 69, 1, 0, 0, 0, 9, 74, 1, 0, 0, 0, 11, 80, 1, 0, 0, 0, 13, 85, 1, 0, 0, 0, 15, 105, 1, 0, 0, 0, 17, 107, 1, 0, 0, 0, 19, 110, 1, 0, 0, 0, 21, 113, 1, 0, 0, 0, 23, 115, 1, 0, 0, 0, 25, 117, 1, 0, 0, 0, 27, 119, 1, 0, 0, 0, 29, 121, 1, 0, 0, 0, 31, 123, 1, 0, 0, 0, 33, 125, 1, 0, 0, 0, 35, 127, 1, 0, 0, 0, 37, 129, 1, 0, 0, 0, 39, 131, 1, 0, 0, 0, 41, 133, 1, 0, 0, 0, 43, 135, 1, 0, 0, 0, 45, 137, 1, 0, 0, 0, 47, 144, 1, 0, 0, 0, 49, 151, 1, 0, 0, 0, 51, 163, 1, 0, 0, 0, 53, 167, 1, 0, 0, 0, 55, 178, 1, 0, 0, 0, 57, 190, 1, 0, 0, 0, 59, 197, 1, 0, 0, 0, 61, 208, 1, 0, 0, 0, 63, 64, 5, 42, 0, 0, 64, 2, 1, 0, 0, 0, 65, 66, 5, 43, 0, 0, 66, 4, 1, 0, 0, 0, 67, 68, 5, 63, 0, 0, 68, 6, 1, 0, 0, 0, 69, 70, 5, 116, 0, 0, 70, 71, 5, 114, 0, 0, 71, 72, 5, 117, 0, 0, 72, 73, 5, 101, 0, 0, 73, 8, 1, 0, 0, 0, 74, 75, 5, 102, 0, 0, 75, 76, 5, 97, 0, 0, 76, 77, 5, 108, 0, 0, 77, 78, 5, 115, 0, 0, 78, 79, 5, 101, 0, 0, 79, 10, 1, 0, 0, 0, 80, 81, 5, 116, 0, 0, 81, 82, 5, 104, 0, 0, 82, 83, 5, 105, 0, 0, 83, 84, 5, 115, 0, 0, 84, 12, 1, 0, 0, 0, 85, 86, 5, 91, 0, 0, 86, 87, 5, 81, 0, 0, 87, 88, 5, 117, 0, 0, 88, 89, 5, 97, 0, 0, 89, 90, 5, 108, 0, 0, 90, 91, 5, 105, 0, 0, 91, 92, 5, 102, 0, 0, 92, 93, 5, 105, 0, 0, 93, 94, 5, 101, 0, 0, 94, 95, 5, 100, 0, 0, 95, 96, 5, 78, 0, 0, 96, 97, 5, 97, 0, 0, 97, 98, 5, 109, 0, 0, 98, 99, 5, 101, 0, 0, 99, 100, 5, 93, 0, 0, 100, 14, 1, 0, 0, 0, 101, 102, 5, 58, 0, 0, 102, 103, 5, 58, 0, 0, 103, 106, 5, 61, 0, 0, 104, 106, 5, 61, 0, 0, 105, 101, 1, 0, 0, 0, 105, 104, 1, 0, 0, 0, 106, 16, 1, 0, 0, 0, 107, 108, 5, 43, 0, 0, 108, 109, 5, 61, 0, 0, 109, 18, 1, 0, 0, 0, 110, 111, 5, 63, 0, 0, 111, 112, 5, 61, 0, 0, 112, 20, 1, 0, 0, 0, 113, 114, 5, 124, 0, 0, 114, 22, 1, 0, 0, 0, 115, 116, 5, 58, 0, 0, 116, 24, 1, 0, 0, 0, 117, 118, 5, 59, 0, 0, 118, 26, 1, 0, 0, 0, 119, 120, 5, 44, 0, 0, 120, 28, 1, 0, 0, 0, 121, 122, 5, 40, 0, 0, 122, 30, 1, 0, 0, 0, 123, 124, 5, 41, 0, 0, 124, 32, 1, 0, 0, 0, 125, 126, 5, 91, 0, 0, 126, 34, 1, 0, 0, 0, 127, 128, 5, 93, 0, 0, 128, 36, 1, 0, 0, 0, 129, 130, 5, 123, 0, 0, 130, 38, 1, 0, 0, 0, 131, 132, 5, 125, 0, 0, 132, 40, 1, 0, 0, 0, 133, 134, 5, 46, 0, 0, 134, 42, 1, 0, 0, 0, 135, 136, 5, 126, 0, 0, 136, 44, 1, 0, 0, 0, 137, 141, 7, 0, 0, 0, 138, 140, 7, 1, 0, 0, 139, 138, 1, 0, 0, 0, 140, 143, 1, 0, 0, 0, 141, 139, 1, 0, 0, 0, 141, 142, 1, 0, 0, 0, 142, 46, 1, 0, 0, 0, 143, 141, 1, 0, 0, 0, 144, 148, 7, 2, 0, 0, 145, 147, 7, 1, 0, 0, 146, 145, 1, 0, 0, 0, 147, 150, 1, 0, 0, 0, 148, 146, 1, 0, 0, 0, 148, 149, 1, 0, 0, 0, 149, 48, 1, 0, 0, 0, 150, 148, 1, 0, 0, 0, 151, 157, 5, 39, 0, 0, 152, 156, 8, 3, 0, 0, 153, 154, 5, 92, 0, 0, 154, 156, 9, 0, 0, 0, 155, 152, 1, 0, 0, 0, 155, 153, 1, 0, 0, 0, 156, 159, 1, 0, 0, 0, 157, 155, 1, 0, 0, 0, 157, 158, 1, 0, 0, 0, 158, 160, 1, 0, 0, 0, 159, 157, 1, 0, 0, 0, 160, 161, 5, 39, 0, 0, 161, 50, 1, 0, 0, 0, 162, 164, 7, 4, 0, 0, 163, 162, 1, 0, 0, 0, 164, 165, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 165, 166, 1, 0, 0, 0, 166, 52, 1, 0, 0, 0, 167, 173, 5, 39, 0, 0, 168, 172, 8, 3, 0, 0, 169, 170, 5, 92, 0, 0, 170, 172, 9, 0, 0, 0, 171, 168, 1, 0, 0, 0, 171, 169, 1, 0, 0, 0, 172, 175, 1, 0, 0, 0, 173, 171, 1, 0, 0, 0, 173, 174, 1, 0, 0, 0, 174, 176, 1, 0, 0, 0, 175, 173, 1, 0, 0, 0, 176, 177, 5, 39, 0, 0, 177, 54, 1, 0, 0, 0, 178, 179, 5, 47, 0, 0, 179, 180, 5, 47, 0, 0, 180, 184, 1, 0, 0, 0, 181, 183, 8, 5, 0, 0, 182, 181, 1, 0, 0, 0, 183, 186, 1, 0, 0, 0, 184, 182, 1, 0, 0, 0, 184, 185, 1, 0, 0, 0, 185, 187, 1, 0, 0, 0, 186, 184, 1, 0, 0, 0, 187, 188, 6, 27, 0, 0, 188, 56, 1, 0, 0, 0, 189, 191, 7, 6, 0, 0, 190, 189, 1, 0, 0, 0, 191, 192, 1, 0, 0, 0, 192, 190, 1, 0, 0, 0, 192, 193, 1, 0, 0, 0, 193, 194, 1, 0, 0, 0, 194, 195, 6, 28, 0, 0, 195, 58, 1, 0, 0, 0, 196, 198, 5, 13, 0, 0, 197, 196, 1, 0, 0, 0, 197, 198, 1, 0, 0, 0, 198, 199, 1, 0, 0, 0, 199, 201, 5, 10, 0, 0, 200, 202, 7, 6, 0, 0, 201, 200, 1, 0, 0, 0, 202, 203, 1, 0, 0, 0, 203, 201, 1, 0, 0, 0, 203, 204, 1, 0, 0, 0, 204, 205, 1, 0, 0, 0, 205, 206, 6, 29, 0, 0, 206, 60, 1, 0, 0, 0, 207, 209, 5, 13, 0, 0, 208, 207, 1, 0, 0, 0, 208, 209, 1, 0, 0, 0, 209, 210, 1, 0, 0, 0, 210, 211, 5, 10, 0, 0, 211, 62, 1, 0, 0, 0, 14, 0, 105, 141, 148, 155, 157, 165, 171, 173, 184, 192, 197, 203, 208, 1, 6, 0, 0] \ No newline at end of file diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfLexer.tokens b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.tokens similarity index 78% rename from SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfLexer.tokens rename to SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.tokens index a34fe965..07eb9f09 100644 --- a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfLexer.tokens +++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.tokens @@ -20,13 +20,15 @@ LBRACE=19 RBRACE=20 DOT=21 TILDE=22 -ID=23 -INT=24 -STRING=25 -COMMENT=26 -WS=27 -CONTINUATION=28 -NL=29 +UPPER_ID=23 +ID=24 +SINGLE_QUOTED_STRING=25 +INT=26 +STRING=27 +COMMENT=28 +WS=29 +CONTINUATION=30 +NL=31 '*'=1 '+'=2 '?'=3 diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfListener.cs b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfListener.cs similarity index 100% rename from SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfListener.cs rename to SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfListener.cs diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfParser.cs b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfParser.cs similarity index 89% rename from SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfParser.cs rename to SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfParser.cs index f48c7aa7..8aa8cab1 100644 --- a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfParser.cs +++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfParser.cs @@ -40,7 +40,8 @@ public const int T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, T__5=6, T__6=7, ASSIGN=8, ADD_ASSIGN=9, BOOL_ASSIGN=10, PIPE=11, COLON=12, SEMICOLON=13, COMMA=14, LPAREN=15, RPAREN=16, LBRACK=17, RBRACK=18, LBRACE=19, RBRACE=20, DOT=21, TILDE=22, - ID=23, INT=24, STRING=25, COMMENT=26, WS=27, CONTINUATION=28, NL=29; + UPPER_ID=23, ID=24, SINGLE_QUOTED_STRING=25, INT=26, STRING=27, COMMENT=28, + WS=29, CONTINUATION=30, NL=31; 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, @@ -62,8 +63,9 @@ public const int private static readonly string[] _SymbolicNames = { null, null, null, null, null, null, null, null, "ASSIGN", "ADD_ASSIGN", "BOOL_ASSIGN", "PIPE", "COLON", "SEMICOLON", "COMMA", "LPAREN", "RPAREN", - "LBRACK", "RBRACK", "LBRACE", "RBRACE", "DOT", "TILDE", "ID", "INT", "STRING", - "COMMENT", "WS", "CONTINUATION", "NL" + "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); @@ -167,7 +169,7 @@ public SpecificationContext specification() { State = 43; ErrorHandler.Sync(this); _la = TokenStream.LA(1); - } while ( _la==ID ); + } while ( _la==UPPER_ID ); State = 45; Match(Eof); } @@ -189,9 +191,9 @@ public partial class Rule_definitionContext : ParserRuleContext { public IToken target_ast; public AlternativesContext rule_body; [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ASSIGN() { return GetToken(kebnfParser.ASSIGN, 0); } - [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[] 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); @@ -237,7 +239,7 @@ public Rule_definitionContext rule_definition() { EnterOuterAlt(_localctx, 1); { State = 47; - _localctx.name = Match(ID); + _localctx.name = Match(UPPER_ID); State = 49; ErrorHandler.Sync(this); _la = TokenStream.LA(1); @@ -256,7 +258,7 @@ public Rule_definitionContext rule_definition() { State = 51; Match(COLON); State = 52; - _localctx.target_ast = Match(ID); + _localctx.target_ast = Match(UPPER_ID); } } @@ -478,7 +480,7 @@ public AlternativeContext alternative() { State = 82; ErrorHandler.Sync(this); _la = TokenStream.LA(1); - while ((((_la) & ~0x3f) == 0 && ((1L << _la) & 63602928L) != 0)) { + while ((((_la) & ~0x3f) == 0 && ((1L << _la) & 264929520L) != 0)) { { { State = 79; @@ -524,6 +526,9 @@ [System.Diagnostics.DebuggerNonUserCode] public TerminalContext terminal() { [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) { @@ -552,7 +557,7 @@ public ElementContext element() { ElementContext _localctx = new ElementContext(Context, State); EnterRule(_localctx, 10, RULE_element); try { - State = 92; + State = 93; ErrorHandler.Sync(this); switch ( Interpreter.AdaptivePredict(TokenStream,8,Context) ) { case 1: @@ -604,6 +609,13 @@ public ElementContext element() { non_terminal(); } break; + case 8: + EnterOuterAlt(_localctx, 8); + { + State = 92; + value_literal(); + } + break; } } catch (RecognitionException re) { @@ -667,9 +679,9 @@ public AssignmentContext assignment() { try { EnterOuterAlt(_localctx, 1); { - State = 94; - _localctx.property = dotted_id(); State = 95; + _localctx.property = dotted_id(); + State = 96; _localctx.op = TokenStream.LT(1); _la = TokenStream.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 1792L) != 0)) ) { @@ -679,24 +691,24 @@ public AssignmentContext assignment() { ErrorHandler.ReportMatch(this); Consume(); } - State = 97; + State = 98; ErrorHandler.Sync(this); switch ( Interpreter.AdaptivePredict(TokenStream,9,Context) ) { case 1: { - State = 96; + State = 97; _localctx.prefix = Match(TILDE); } break; } - State = 99; + State = 100; _localctx.content = element_core(); - State = 101; + State = 102; ErrorHandler.Sync(this); _la = TokenStream.LA(1); if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 14L) != 0)) { { - State = 100; + State = 101; _localctx.suffix = suffix_op(); } } @@ -759,11 +771,11 @@ public Non_parsing_assignmentContext non_parsing_assignment() { try { EnterOuterAlt(_localctx, 1); { - State = 103; - Match(LBRACE); State = 104; - _localctx.property = dotted_id(); + 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) ) { @@ -773,9 +785,9 @@ public Non_parsing_assignmentContext non_parsing_assignment() { ErrorHandler.ReportMatch(this); Consume(); } - State = 106; - _localctx.val = value_literal(); State = 107; + _localctx.val = value_literal(); + State = 108; Match(RBRACE); } } @@ -823,9 +835,9 @@ public Non_parsing_emptyContext non_parsing_empty() { try { EnterOuterAlt(_localctx, 1); { - State = 109; - Match(LBRACE); State = 110; + Match(LBRACE); + State = 111; Match(RBRACE); } } @@ -877,21 +889,21 @@ public Cross_referenceContext cross_reference() { try { EnterOuterAlt(_localctx, 1); { - State = 113; + State = 114; ErrorHandler.Sync(this); _la = TokenStream.LA(1); if (_la==TILDE) { { - State = 112; + State = 113; Match(TILDE); } } - State = 115; - Match(LBRACK); State = 116; - _localctx.@ref = Match(ID); + Match(LBRACK); State = 117; + _localctx.@ref = Match(ID); + State = 118; Match(RBRACK); } } @@ -946,18 +958,18 @@ public GroupContext group() { try { EnterOuterAlt(_localctx, 1); { - State = 119; - Match(LPAREN); State = 120; - alternatives(); + Match(LPAREN); State = 121; + alternatives(); + State = 122; Match(RPAREN); - State = 123; + State = 124; ErrorHandler.Sync(this); switch ( Interpreter.AdaptivePredict(TokenStream,12,Context) ) { case 1: { - State = 122; + State = 123; _localctx.suffix = suffix_op(); } break; @@ -976,11 +988,9 @@ public GroupContext group() { } public partial class TerminalContext : ParserRuleContext { - public Value_literalContext val; + public IToken val; public Suffix_opContext suffix; - [System.Diagnostics.DebuggerNonUserCode] public Value_literalContext value_literal() { - return GetRuleContext(0); - } + [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); } @@ -1014,14 +1024,14 @@ public TerminalContext terminal() { try { EnterOuterAlt(_localctx, 1); { - State = 125; - _localctx.val = value_literal(); - State = 127; + State = 126; + _localctx.val = Match(SINGLE_QUOTED_STRING); + State = 128; ErrorHandler.Sync(this); switch ( Interpreter.AdaptivePredict(TokenStream,13,Context) ) { case 1: { - State = 126; + State = 127; _localctx.suffix = suffix_op(); } break; @@ -1042,7 +1052,7 @@ public TerminalContext terminal() { public partial class Non_terminalContext : ParserRuleContext { public IToken name; public Suffix_opContext suffix; - [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ID() { return GetToken(kebnfParser.ID, 0); } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode UPPER_ID() { return GetToken(kebnfParser.UPPER_ID, 0); } [System.Diagnostics.DebuggerNonUserCode] public Suffix_opContext suffix_op() { return GetRuleContext(0); } @@ -1076,14 +1086,14 @@ public Non_terminalContext non_terminal() { try { EnterOuterAlt(_localctx, 1); { - State = 129; - _localctx.name = Match(ID); - State = 131; + State = 130; + _localctx.name = Match(UPPER_ID); + State = 132; ErrorHandler.Sync(this); switch ( Interpreter.AdaptivePredict(TokenStream,14,Context) ) { case 1: { - State = 130; + State = 131; _localctx.suffix = suffix_op(); } break; @@ -1114,6 +1124,9 @@ [System.Diagnostics.DebuggerNonUserCode] public TerminalContext terminal() { [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) { @@ -1142,37 +1155,44 @@ public Element_coreContext element_core() { Element_coreContext _localctx = new Element_coreContext(Context, State); EnterRule(_localctx, 26, RULE_element_core); try { - State = 137; + State = 139; ErrorHandler.Sync(this); switch ( Interpreter.AdaptivePredict(TokenStream,15,Context) ) { case 1: EnterOuterAlt(_localctx, 1); { - State = 133; + State = 134; cross_reference(); } break; case 2: EnterOuterAlt(_localctx, 2); { - State = 134; + State = 135; group(); } break; case 3: EnterOuterAlt(_localctx, 3); { - State = 135; + State = 136; terminal(); } break; case 4: EnterOuterAlt(_localctx, 4); { - State = 136; + State = 137; non_terminal(); } break; + case 5: + EnterOuterAlt(_localctx, 5); + { + State = 138; + value_literal(); + } + break; } } catch (RecognitionException re) { @@ -1226,21 +1246,21 @@ public Dotted_idContext dotted_id() { try { EnterOuterAlt(_localctx, 1); { - State = 139; + State = 141; Match(ID); - State = 144; + State = 146; ErrorHandler.Sync(this); _la = TokenStream.LA(1); while (_la==DOT) { { { - State = 140; + State = 142; Match(DOT); - State = 141; + State = 143; Match(ID); } } - State = 146; + State = 148; ErrorHandler.Sync(this); _la = TokenStream.LA(1); } @@ -1289,7 +1309,7 @@ public Suffix_opContext suffix_op() { try { EnterOuterAlt(_localctx, 1); { - State = 147; + State = 149; _la = TokenStream.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 14L) != 0)) ) { ErrorHandler.RecoverInline(this); @@ -1315,6 +1335,7 @@ 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) { @@ -1346,9 +1367,9 @@ public Value_literalContext value_literal() { try { EnterOuterAlt(_localctx, 1); { - State = 149; + State = 151; _la = TokenStream.LA(1); - if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 58720496L) != 0)) ) { + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 251658480L) != 0)) ) { ErrorHandler.RecoverInline(this); } else { @@ -1369,53 +1390,54 @@ public Value_literalContext value_literal() { } private static int[] _serializedATN = { - 4,1,29,152,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, + 4,1,31,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,3,5,93,8,5,1,6,1,6,1,6,3,6,98,8,6,1,6,1,6,3,6,102, - 8,6,1,7,1,7,1,7,1,7,1,7,1,7,1,8,1,8,1,8,1,9,3,9,114,8,9,1,9,1,9,1,9,1, - 9,1,10,1,10,1,10,1,10,3,10,124,8,10,1,11,1,11,3,11,128,8,11,1,12,1,12, - 3,12,132,8,12,1,13,1,13,1,13,1,13,3,13,138,8,13,1,14,1,14,1,14,5,14,143, - 8,14,10,14,12,14,146,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,8,10,1,0,8,9,1,0,1,3,2,0,4,7, - 23,25,158,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,92,1,0,0,0,12,94,1,0,0,0,14,103,1,0,0,0,16,109,1,0,0,0,18,113,1, - 0,0,0,20,119,1,0,0,0,22,125,1,0,0,0,24,129,1,0,0,0,26,137,1,0,0,0,28,139, - 1,0,0,0,30,147,1,0,0,0,32,149,1,0,0,0,34,36,5,29,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,23,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,12,0,0,52,54,5,23,0,0,53, - 51,1,0,0,0,53,54,1,0,0,0,54,55,1,0,0,0,55,56,5,8,0,0,56,58,3,6,3,0,57, - 59,5,13,0,0,58,57,1,0,0,0,58,59,1,0,0,0,59,61,1,0,0,0,60,62,5,29,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,15,0,0,66,67,5,23,0,0,67,68,5,12,0,0,68,69,5,23,0,0,69,70,5,16,0,0,70, - 5,1,0,0,0,71,76,3,8,4,0,72,73,5,11,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,93,3,12,6,0,86,93,3,14,7,0,87,93,3,16,8,0,88, - 93,3,18,9,0,89,93,3,20,10,0,90,93,3,22,11,0,91,93,3,24,12,0,92,85,1,0, - 0,0,92,86,1,0,0,0,92,87,1,0,0,0,92,88,1,0,0,0,92,89,1,0,0,0,92,90,1,0, - 0,0,92,91,1,0,0,0,93,11,1,0,0,0,94,95,3,28,14,0,95,97,7,0,0,0,96,98,5, - 22,0,0,97,96,1,0,0,0,97,98,1,0,0,0,98,99,1,0,0,0,99,101,3,26,13,0,100, - 102,3,30,15,0,101,100,1,0,0,0,101,102,1,0,0,0,102,13,1,0,0,0,103,104,5, - 19,0,0,104,105,3,28,14,0,105,106,7,1,0,0,106,107,3,32,16,0,107,108,5,20, - 0,0,108,15,1,0,0,0,109,110,5,19,0,0,110,111,5,20,0,0,111,17,1,0,0,0,112, - 114,5,22,0,0,113,112,1,0,0,0,113,114,1,0,0,0,114,115,1,0,0,0,115,116,5, - 17,0,0,116,117,5,23,0,0,117,118,5,18,0,0,118,19,1,0,0,0,119,120,5,15,0, - 0,120,121,3,6,3,0,121,123,5,16,0,0,122,124,3,30,15,0,123,122,1,0,0,0,123, - 124,1,0,0,0,124,21,1,0,0,0,125,127,3,32,16,0,126,128,3,30,15,0,127,126, - 1,0,0,0,127,128,1,0,0,0,128,23,1,0,0,0,129,131,5,23,0,0,130,132,3,30,15, - 0,131,130,1,0,0,0,131,132,1,0,0,0,132,25,1,0,0,0,133,138,3,18,9,0,134, - 138,3,20,10,0,135,138,3,22,11,0,136,138,3,24,12,0,137,133,1,0,0,0,137, - 134,1,0,0,0,137,135,1,0,0,0,137,136,1,0,0,0,138,27,1,0,0,0,139,144,5,23, - 0,0,140,141,5,21,0,0,141,143,5,23,0,0,142,140,1,0,0,0,143,146,1,0,0,0, - 144,142,1,0,0,0,144,145,1,0,0,0,145,29,1,0,0,0,146,144,1,0,0,0,147,148, - 7,2,0,0,148,31,1,0,0,0,149,150,7,3,0,0,150,33,1,0,0,0,17,37,43,49,53,58, - 63,76,82,92,97,101,113,123,127,131,137,144 + 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,8,10,1,0,8,9,1,0,1,3, + 2,0,4,7,24,27,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,31,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,23,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,12,0,0,52,54, + 5,23,0,0,53,51,1,0,0,0,53,54,1,0,0,0,54,55,1,0,0,0,55,56,5,8,0,0,56,58, + 3,6,3,0,57,59,5,13,0,0,58,57,1,0,0,0,58,59,1,0,0,0,59,61,1,0,0,0,60,62, + 5,31,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,15,0,0,66,67,5,24,0,0,67,68,5,12,0,0,68,69,5,24,0,0,69, + 70,5,16,0,0,70,5,1,0,0,0,71,76,3,8,4,0,72,73,5,11,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,22,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,19,0,0,105,106,3,28,14,0,106, + 107,7,1,0,0,107,108,3,32,16,0,108,109,5,20,0,0,109,15,1,0,0,0,110,111, + 5,19,0,0,111,112,5,20,0,0,112,17,1,0,0,0,113,115,5,22,0,0,114,113,1,0, + 0,0,114,115,1,0,0,0,115,116,1,0,0,0,116,117,5,17,0,0,117,118,5,24,0,0, + 118,119,5,18,0,0,119,19,1,0,0,0,120,121,5,15,0,0,121,122,3,6,3,0,122,124, + 5,16,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,25,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,23,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,24,0,0,142,143,5,21,0,0,143,145,5,24,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 = diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfVisitor.cs b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfVisitor.cs similarity index 100% rename from SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfVisitor.cs rename to SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfVisitor.cs diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnf.interp b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnf.interp deleted file mode 100644 index c34fc53c..00000000 --- a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnf.interp +++ /dev/null @@ -1,86 +0,0 @@ -token literal names: -null -'*' -'+' -'?' -'true' -'false' -'this' -'[QualifiedName]' -null -'+=' -'?=' -'|' -':' -';' -',' -'(' -')' -'[' -']' -'{' -'}' -'.' -'~' -null -null -null -null -null -null -null - -token symbolic names: -null -null -null -null -null -null -null -null -ASSIGN -ADD_ASSIGN -BOOL_ASSIGN -PIPE -COLON -SEMICOLON -COMMA -LPAREN -RPAREN -LBRACK -RBRACK -LBRACE -RBRACE -DOT -TILDE -ID -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, 29, 152, 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, 3, 5, 93, 8, 5, 1, 6, 1, 6, 1, 6, 3, 6, 98, 8, 6, 1, 6, 1, 6, 3, 6, 102, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 9, 3, 9, 114, 8, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 124, 8, 10, 1, 11, 1, 11, 3, 11, 128, 8, 11, 1, 12, 1, 12, 3, 12, 132, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 138, 8, 13, 1, 14, 1, 14, 1, 14, 5, 14, 143, 8, 14, 10, 14, 12, 14, 146, 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, 8, 10, 1, 0, 8, 9, 1, 0, 1, 3, 2, 0, 4, 7, 23, 25, 158, 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, 92, 1, 0, 0, 0, 12, 94, 1, 0, 0, 0, 14, 103, 1, 0, 0, 0, 16, 109, 1, 0, 0, 0, 18, 113, 1, 0, 0, 0, 20, 119, 1, 0, 0, 0, 22, 125, 1, 0, 0, 0, 24, 129, 1, 0, 0, 0, 26, 137, 1, 0, 0, 0, 28, 139, 1, 0, 0, 0, 30, 147, 1, 0, 0, 0, 32, 149, 1, 0, 0, 0, 34, 36, 5, 29, 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, 23, 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, 12, 0, 0, 52, 54, 5, 23, 0, 0, 53, 51, 1, 0, 0, 0, 53, 54, 1, 0, 0, 0, 54, 55, 1, 0, 0, 0, 55, 56, 5, 8, 0, 0, 56, 58, 3, 6, 3, 0, 57, 59, 5, 13, 0, 0, 58, 57, 1, 0, 0, 0, 58, 59, 1, 0, 0, 0, 59, 61, 1, 0, 0, 0, 60, 62, 5, 29, 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, 15, 0, 0, 66, 67, 5, 23, 0, 0, 67, 68, 5, 12, 0, 0, 68, 69, 5, 23, 0, 0, 69, 70, 5, 16, 0, 0, 70, 5, 1, 0, 0, 0, 71, 76, 3, 8, 4, 0, 72, 73, 5, 11, 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, 93, 3, 12, 6, 0, 86, 93, 3, 14, 7, 0, 87, 93, 3, 16, 8, 0, 88, 93, 3, 18, 9, 0, 89, 93, 3, 20, 10, 0, 90, 93, 3, 22, 11, 0, 91, 93, 3, 24, 12, 0, 92, 85, 1, 0, 0, 0, 92, 86, 1, 0, 0, 0, 92, 87, 1, 0, 0, 0, 92, 88, 1, 0, 0, 0, 92, 89, 1, 0, 0, 0, 92, 90, 1, 0, 0, 0, 92, 91, 1, 0, 0, 0, 93, 11, 1, 0, 0, 0, 94, 95, 3, 28, 14, 0, 95, 97, 7, 0, 0, 0, 96, 98, 5, 22, 0, 0, 97, 96, 1, 0, 0, 0, 97, 98, 1, 0, 0, 0, 98, 99, 1, 0, 0, 0, 99, 101, 3, 26, 13, 0, 100, 102, 3, 30, 15, 0, 101, 100, 1, 0, 0, 0, 101, 102, 1, 0, 0, 0, 102, 13, 1, 0, 0, 0, 103, 104, 5, 19, 0, 0, 104, 105, 3, 28, 14, 0, 105, 106, 7, 1, 0, 0, 106, 107, 3, 32, 16, 0, 107, 108, 5, 20, 0, 0, 108, 15, 1, 0, 0, 0, 109, 110, 5, 19, 0, 0, 110, 111, 5, 20, 0, 0, 111, 17, 1, 0, 0, 0, 112, 114, 5, 22, 0, 0, 113, 112, 1, 0, 0, 0, 113, 114, 1, 0, 0, 0, 114, 115, 1, 0, 0, 0, 115, 116, 5, 17, 0, 0, 116, 117, 5, 23, 0, 0, 117, 118, 5, 18, 0, 0, 118, 19, 1, 0, 0, 0, 119, 120, 5, 15, 0, 0, 120, 121, 3, 6, 3, 0, 121, 123, 5, 16, 0, 0, 122, 124, 3, 30, 15, 0, 123, 122, 1, 0, 0, 0, 123, 124, 1, 0, 0, 0, 124, 21, 1, 0, 0, 0, 125, 127, 3, 32, 16, 0, 126, 128, 3, 30, 15, 0, 127, 126, 1, 0, 0, 0, 127, 128, 1, 0, 0, 0, 128, 23, 1, 0, 0, 0, 129, 131, 5, 23, 0, 0, 130, 132, 3, 30, 15, 0, 131, 130, 1, 0, 0, 0, 131, 132, 1, 0, 0, 0, 132, 25, 1, 0, 0, 0, 133, 138, 3, 18, 9, 0, 134, 138, 3, 20, 10, 0, 135, 138, 3, 22, 11, 0, 136, 138, 3, 24, 12, 0, 137, 133, 1, 0, 0, 0, 137, 134, 1, 0, 0, 0, 137, 135, 1, 0, 0, 0, 137, 136, 1, 0, 0, 0, 138, 27, 1, 0, 0, 0, 139, 144, 5, 23, 0, 0, 140, 141, 5, 21, 0, 0, 141, 143, 5, 23, 0, 0, 142, 140, 1, 0, 0, 0, 143, 146, 1, 0, 0, 0, 144, 142, 1, 0, 0, 0, 144, 145, 1, 0, 0, 0, 145, 29, 1, 0, 0, 0, 146, 144, 1, 0, 0, 0, 147, 148, 7, 2, 0, 0, 148, 31, 1, 0, 0, 0, 149, 150, 7, 3, 0, 0, 150, 33, 1, 0, 0, 0, 17, 37, 43, 49, 53, 58, 63, 76, 82, 92, 97, 101, 113, 123, 127, 131, 137, 144] \ No newline at end of file diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfLexer.cs b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfLexer.cs deleted file mode 100644 index 9f980ce9..00000000 --- a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfLexer.cs +++ /dev/null @@ -1,174 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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, T__4=5, T__5=6, T__6=7, ASSIGN=8, ADD_ASSIGN=9, - BOOL_ASSIGN=10, PIPE=11, COLON=12, SEMICOLON=13, COMMA=14, LPAREN=15, - RPAREN=16, LBRACK=17, RBRACK=18, LBRACE=19, RBRACE=20, DOT=21, TILDE=22, - ID=23, INT=24, STRING=25, COMMENT=26, WS=27, CONTINUATION=28, NL=29; - 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", "T__4", "T__5", "T__6", "ASSIGN", "ADD_ASSIGN", - "BOOL_ASSIGN", "PIPE", "COLON", "SEMICOLON", "COMMA", "LPAREN", "RPAREN", - "LBRACK", "RBRACK", "LBRACE", "RBRACE", "DOT", "TILDE", "ID", "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, "'*'", "'+'", "'?'", "'true'", "'false'", "'this'", "'[QualifiedName]'", - null, "'+='", "'?='", "'|'", "':'", "';'", "','", "'('", "')'", "'['", - "']'", "'{'", "'}'", "'.'", "'~'" - }; - private static readonly string[] _SymbolicNames = { - null, null, null, null, null, null, null, null, "ASSIGN", "ADD_ASSIGN", - "BOOL_ASSIGN", "PIPE", "COLON", "SEMICOLON", "COMMA", "LPAREN", "RPAREN", - "LBRACK", "RBRACK", "LBRACE", "RBRACE", "DOT", "TILDE", "ID", "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,29,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,2,28, - 7,28,1,0,1,0,1,1,1,1,1,2,1,2,1,3,1,3,1,3,1,3,1,3,1,4,1,4,1,4,1,4,1,4,1, - 4,1,5,1,5,1,5,1,5,1,5,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6, - 1,6,1,6,1,6,1,6,1,7,1,7,1,7,1,7,3,7,102,8,7,1,8,1,8,1,8,1,9,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,1,20,1,20,1,21,1,21,1,22,1,22,5,22,136,8,22, - 10,22,12,22,139,9,22,1,23,4,23,142,8,23,11,23,12,23,143,1,24,1,24,1,24, - 1,24,5,24,150,8,24,10,24,12,24,153,9,24,1,24,1,24,1,25,1,25,1,25,1,25, - 5,25,161,8,25,10,25,12,25,164,9,25,1,25,1,25,1,26,4,26,169,8,26,11,26, - 12,26,170,1,26,1,26,1,27,3,27,176,8,27,1,27,1,27,4,27,180,8,27,11,27,12, - 27,181,1,27,1,27,1,28,3,28,187,8,28,1,28,1,28,0,0,29,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,57,29, - 1,0,6,3,0,65,90,95,95,97,122,4,0,48,57,65,90,95,95,97,122,1,0,48,57,2, - 0,39,39,92,92,2,0,10,10,13,13,2,0,9,9,32,32,199,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,0,57,1,0,0,0,1,59, - 1,0,0,0,3,61,1,0,0,0,5,63,1,0,0,0,7,65,1,0,0,0,9,70,1,0,0,0,11,76,1,0, - 0,0,13,81,1,0,0,0,15,101,1,0,0,0,17,103,1,0,0,0,19,106,1,0,0,0,21,109, - 1,0,0,0,23,111,1,0,0,0,25,113,1,0,0,0,27,115,1,0,0,0,29,117,1,0,0,0,31, - 119,1,0,0,0,33,121,1,0,0,0,35,123,1,0,0,0,37,125,1,0,0,0,39,127,1,0,0, - 0,41,129,1,0,0,0,43,131,1,0,0,0,45,133,1,0,0,0,47,141,1,0,0,0,49,145,1, - 0,0,0,51,156,1,0,0,0,53,168,1,0,0,0,55,175,1,0,0,0,57,186,1,0,0,0,59,60, - 5,42,0,0,60,2,1,0,0,0,61,62,5,43,0,0,62,4,1,0,0,0,63,64,5,63,0,0,64,6, - 1,0,0,0,65,66,5,116,0,0,66,67,5,114,0,0,67,68,5,117,0,0,68,69,5,101,0, - 0,69,8,1,0,0,0,70,71,5,102,0,0,71,72,5,97,0,0,72,73,5,108,0,0,73,74,5, - 115,0,0,74,75,5,101,0,0,75,10,1,0,0,0,76,77,5,116,0,0,77,78,5,104,0,0, - 78,79,5,105,0,0,79,80,5,115,0,0,80,12,1,0,0,0,81,82,5,91,0,0,82,83,5,81, - 0,0,83,84,5,117,0,0,84,85,5,97,0,0,85,86,5,108,0,0,86,87,5,105,0,0,87, - 88,5,102,0,0,88,89,5,105,0,0,89,90,5,101,0,0,90,91,5,100,0,0,91,92,5,78, - 0,0,92,93,5,97,0,0,93,94,5,109,0,0,94,95,5,101,0,0,95,96,5,93,0,0,96,14, - 1,0,0,0,97,98,5,58,0,0,98,99,5,58,0,0,99,102,5,61,0,0,100,102,5,61,0,0, - 101,97,1,0,0,0,101,100,1,0,0,0,102,16,1,0,0,0,103,104,5,43,0,0,104,105, - 5,61,0,0,105,18,1,0,0,0,106,107,5,63,0,0,107,108,5,61,0,0,108,20,1,0,0, - 0,109,110,5,124,0,0,110,22,1,0,0,0,111,112,5,58,0,0,112,24,1,0,0,0,113, - 114,5,59,0,0,114,26,1,0,0,0,115,116,5,44,0,0,116,28,1,0,0,0,117,118,5, - 40,0,0,118,30,1,0,0,0,119,120,5,41,0,0,120,32,1,0,0,0,121,122,5,91,0,0, - 122,34,1,0,0,0,123,124,5,93,0,0,124,36,1,0,0,0,125,126,5,123,0,0,126,38, - 1,0,0,0,127,128,5,125,0,0,128,40,1,0,0,0,129,130,5,46,0,0,130,42,1,0,0, - 0,131,132,5,126,0,0,132,44,1,0,0,0,133,137,7,0,0,0,134,136,7,1,0,0,135, - 134,1,0,0,0,136,139,1,0,0,0,137,135,1,0,0,0,137,138,1,0,0,0,138,46,1,0, - 0,0,139,137,1,0,0,0,140,142,7,2,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,48,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,50,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,4,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, - 25,0,0,166,52,1,0,0,0,167,169,7,5,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,26,0,0,173,54, - 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,5,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,27,0,0,184,56,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,58,1,0,0,0,11,0,101,137,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/kebnfLexer.interp b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfLexer.interp deleted file mode 100644 index f5467a47..00000000 --- a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/kebnfLexer.interp +++ /dev/null @@ -1,104 +0,0 @@ -token literal names: -null -'*' -'+' -'?' -'true' -'false' -'this' -'[QualifiedName]' -null -'+=' -'?=' -'|' -':' -';' -',' -'(' -')' -'[' -']' -'{' -'}' -'.' -'~' -null -null -null -null -null -null -null - -token symbolic names: -null -null -null -null -null -null -null -null -ASSIGN -ADD_ASSIGN -BOOL_ASSIGN -PIPE -COLON -SEMICOLON -COMMA -LPAREN -RPAREN -LBRACK -RBRACK -LBRACE -RBRACE -DOT -TILDE -ID -INT -STRING -COMMENT -WS -CONTINUATION -NL - -rule names: -T__0 -T__1 -T__2 -T__3 -T__4 -T__5 -T__6 -ASSIGN -ADD_ASSIGN -BOOL_ASSIGN -PIPE -COLON -SEMICOLON -COMMA -LPAREN -RPAREN -LBRACK -RBRACK -LBRACE -RBRACE -DOT -TILDE -ID -INT -STRING -COMMENT -WS -CONTINUATION -NL - -channel names: -DEFAULT_TOKEN_CHANNEL -HIDDEN - -mode names: -DEFAULT_MODE - -atn: -[4, 0, 29, 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, 2, 28, 7, 28, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 102, 8, 7, 1, 8, 1, 8, 1, 8, 1, 9, 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, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 5, 22, 136, 8, 22, 10, 22, 12, 22, 139, 9, 22, 1, 23, 4, 23, 142, 8, 23, 11, 23, 12, 23, 143, 1, 24, 1, 24, 1, 24, 1, 24, 5, 24, 150, 8, 24, 10, 24, 12, 24, 153, 9, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 5, 25, 161, 8, 25, 10, 25, 12, 25, 164, 9, 25, 1, 25, 1, 25, 1, 26, 4, 26, 169, 8, 26, 11, 26, 12, 26, 170, 1, 26, 1, 26, 1, 27, 3, 27, 176, 8, 27, 1, 27, 1, 27, 4, 27, 180, 8, 27, 11, 27, 12, 27, 181, 1, 27, 1, 27, 1, 28, 3, 28, 187, 8, 28, 1, 28, 1, 28, 0, 0, 29, 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, 57, 29, 1, 0, 6, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 39, 39, 92, 92, 2, 0, 10, 10, 13, 13, 2, 0, 9, 9, 32, 32, 199, 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, 0, 57, 1, 0, 0, 0, 1, 59, 1, 0, 0, 0, 3, 61, 1, 0, 0, 0, 5, 63, 1, 0, 0, 0, 7, 65, 1, 0, 0, 0, 9, 70, 1, 0, 0, 0, 11, 76, 1, 0, 0, 0, 13, 81, 1, 0, 0, 0, 15, 101, 1, 0, 0, 0, 17, 103, 1, 0, 0, 0, 19, 106, 1, 0, 0, 0, 21, 109, 1, 0, 0, 0, 23, 111, 1, 0, 0, 0, 25, 113, 1, 0, 0, 0, 27, 115, 1, 0, 0, 0, 29, 117, 1, 0, 0, 0, 31, 119, 1, 0, 0, 0, 33, 121, 1, 0, 0, 0, 35, 123, 1, 0, 0, 0, 37, 125, 1, 0, 0, 0, 39, 127, 1, 0, 0, 0, 41, 129, 1, 0, 0, 0, 43, 131, 1, 0, 0, 0, 45, 133, 1, 0, 0, 0, 47, 141, 1, 0, 0, 0, 49, 145, 1, 0, 0, 0, 51, 156, 1, 0, 0, 0, 53, 168, 1, 0, 0, 0, 55, 175, 1, 0, 0, 0, 57, 186, 1, 0, 0, 0, 59, 60, 5, 42, 0, 0, 60, 2, 1, 0, 0, 0, 61, 62, 5, 43, 0, 0, 62, 4, 1, 0, 0, 0, 63, 64, 5, 63, 0, 0, 64, 6, 1, 0, 0, 0, 65, 66, 5, 116, 0, 0, 66, 67, 5, 114, 0, 0, 67, 68, 5, 117, 0, 0, 68, 69, 5, 101, 0, 0, 69, 8, 1, 0, 0, 0, 70, 71, 5, 102, 0, 0, 71, 72, 5, 97, 0, 0, 72, 73, 5, 108, 0, 0, 73, 74, 5, 115, 0, 0, 74, 75, 5, 101, 0, 0, 75, 10, 1, 0, 0, 0, 76, 77, 5, 116, 0, 0, 77, 78, 5, 104, 0, 0, 78, 79, 5, 105, 0, 0, 79, 80, 5, 115, 0, 0, 80, 12, 1, 0, 0, 0, 81, 82, 5, 91, 0, 0, 82, 83, 5, 81, 0, 0, 83, 84, 5, 117, 0, 0, 84, 85, 5, 97, 0, 0, 85, 86, 5, 108, 0, 0, 86, 87, 5, 105, 0, 0, 87, 88, 5, 102, 0, 0, 88, 89, 5, 105, 0, 0, 89, 90, 5, 101, 0, 0, 90, 91, 5, 100, 0, 0, 91, 92, 5, 78, 0, 0, 92, 93, 5, 97, 0, 0, 93, 94, 5, 109, 0, 0, 94, 95, 5, 101, 0, 0, 95, 96, 5, 93, 0, 0, 96, 14, 1, 0, 0, 0, 97, 98, 5, 58, 0, 0, 98, 99, 5, 58, 0, 0, 99, 102, 5, 61, 0, 0, 100, 102, 5, 61, 0, 0, 101, 97, 1, 0, 0, 0, 101, 100, 1, 0, 0, 0, 102, 16, 1, 0, 0, 0, 103, 104, 5, 43, 0, 0, 104, 105, 5, 61, 0, 0, 105, 18, 1, 0, 0, 0, 106, 107, 5, 63, 0, 0, 107, 108, 5, 61, 0, 0, 108, 20, 1, 0, 0, 0, 109, 110, 5, 124, 0, 0, 110, 22, 1, 0, 0, 0, 111, 112, 5, 58, 0, 0, 112, 24, 1, 0, 0, 0, 113, 114, 5, 59, 0, 0, 114, 26, 1, 0, 0, 0, 115, 116, 5, 44, 0, 0, 116, 28, 1, 0, 0, 0, 117, 118, 5, 40, 0, 0, 118, 30, 1, 0, 0, 0, 119, 120, 5, 41, 0, 0, 120, 32, 1, 0, 0, 0, 121, 122, 5, 91, 0, 0, 122, 34, 1, 0, 0, 0, 123, 124, 5, 93, 0, 0, 124, 36, 1, 0, 0, 0, 125, 126, 5, 123, 0, 0, 126, 38, 1, 0, 0, 0, 127, 128, 5, 125, 0, 0, 128, 40, 1, 0, 0, 0, 129, 130, 5, 46, 0, 0, 130, 42, 1, 0, 0, 0, 131, 132, 5, 126, 0, 0, 132, 44, 1, 0, 0, 0, 133, 137, 7, 0, 0, 0, 134, 136, 7, 1, 0, 0, 135, 134, 1, 0, 0, 0, 136, 139, 1, 0, 0, 0, 137, 135, 1, 0, 0, 0, 137, 138, 1, 0, 0, 0, 138, 46, 1, 0, 0, 0, 139, 137, 1, 0, 0, 0, 140, 142, 7, 2, 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, 48, 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, 50, 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, 4, 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, 25, 0, 0, 166, 52, 1, 0, 0, 0, 167, 169, 7, 5, 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, 26, 0, 0, 173, 54, 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, 5, 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, 27, 0, 0, 184, 56, 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, 58, 1, 0, 0, 0, 11, 0, 101, 137, 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/Model/TextualNotationRule.cs b/SysML2.NET.CodeGenerator/Grammar/Model/TextualNotationRule.cs index 957fb5d5..f60a6273 100644 --- a/SysML2.NET.CodeGenerator/Grammar/Model/TextualNotationRule.cs +++ b/SysML2.NET.CodeGenerator/Grammar/Model/TextualNotationRule.cs @@ -46,5 +46,10 @@ public class TextualNotationRule /// Gets the collection of defined /// public List Elements { get; } = []; + + /// + /// Gets or sets the raw string that declares the rule + /// + public string RawRule { get; set; } } } diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/ValueLiteralElement.cs b/SysML2.NET.CodeGenerator/Grammar/Model/ValueLiteralElement.cs new file mode 100644 index 00000000..e85b673a --- /dev/null +++ b/SysML2.NET.CodeGenerator/Grammar/Model/ValueLiteralElement.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 +{ + /// + /// Defines a that is a value literal + /// + public class ValueLiteralElement: RuleElement + { + /// + /// Gets or sets the literal value + /// + public string Value { get; set; } + } +} diff --git a/SysML2.NET.CodeGenerator/Grammar/TextualNotationSpecificationVisitor.cs b/SysML2.NET.CodeGenerator/Grammar/TextualNotationSpecificationVisitor.cs index fff2225b..5eb07260 100644 --- a/SysML2.NET.CodeGenerator/Grammar/TextualNotationSpecificationVisitor.cs +++ b/SysML2.NET.CodeGenerator/Grammar/TextualNotationSpecificationVisitor.cs @@ -53,7 +53,8 @@ public override object VisitRule_definition(kebnfParser.Rule_definitionContext c var rule = new TextualNotationRule() { RuleName = context.name.Text, - TargetElementName = context.name.Text + TargetElementName = context.target_ast?.Text, + RawRule = context.GetText() }; if (string.IsNullOrWhiteSpace(rule.RuleName)) @@ -81,7 +82,7 @@ public override object VisitRule_definition(kebnfParser.Rule_definitionContext c /// The visitor result, as a collection of public override object VisitAlternatives(kebnfParser.AlternativesContext context) { - return context.alternative().Select(a => (Alternatives)this.Visit(a)).SelectMany(x => x.Elements).ToList(); + return context.alternative().Select(a => (Alternatives)this.Visit(a)).SelectMany(x => x.Elements.Where(e => e!=null)).ToList(); } /// @@ -128,6 +129,23 @@ public override object VisitNon_parsing_assignment(kebnfParser.Non_parsing_assig }; } + /// + /// Visit a parse tree produced by . + /// + /// The default implementation returns the result of calling + /// on . + /// + /// + /// The parse tree. + /// The visitor result. + public override object VisitValue_literal(kebnfParser.Value_literalContext context) + { + return new ValueLiteralElement() + { + Value = context.GetText() + }; + } + /// /// Visit a parse tree produced by . /// @@ -153,7 +171,7 @@ public override object VisitTerminal(kebnfParser.TerminalContext context) { return new TerminalElement() { - Value = context.val.GetText().Trim('\''), + Value = context.val.Text.Trim('\''), Suffix = context.suffix?.GetText() }; } diff --git a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs new file mode 100644 index 00000000..cddeef09 --- /dev/null +++ b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs @@ -0,0 +1,103 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// 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.Grammar.Model; + + 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.WriteForPoco", (writer, _, arguments) => + { + if (arguments.Length != 2) + { + throw new ArgumentException("RulesHelper.WriteForPoco expects to have 2 arguments"); + } + + if (arguments[0] is not IClass umlClass) + { + throw new ArgumentException("RulesHelper.WriteForPoco expects IClass as first argument"); + } + + if (arguments[1] is not List rules) + { + throw new ArgumentException("RulesHelper.WriteForPoco expects a list of TextualNotationRule as second argument"); + } + + var canonicalRule = rules.SingleOrDefault(x => x.RuleName == umlClass.Name); + + if (canonicalRule == null) + { + return; + } + + writer.WriteSafeString($"// Rule definition : {canonicalRule.RawRule}"); + WriteForRule(writer, umlClass, canonicalRule, rules); + }); + } + + private static void WriteForRule(EncodedTextWriter writer, IClass umlClass, TextualNotationRule textualRule, List rules) + { + foreach (var textualRuleElement in textualRule.Elements) + { + switch (textualRuleElement) + { + case TerminalElement terminalElement: + writer.WriteSafeString($"stringBuilder.Append(\"{terminalElement.Value} \");"); + break; + case NonTerminalElement nonTerminalElement: + var referencedRule = rules.SingleOrDefault(x => x.RuleName == nonTerminalElement.Name); + writer.WriteSafeString($"// non Terminal : {nonTerminalElement.Name}; Found rule {referencedRule?.RawRule}"); + break; + case GroupElement groupElement: + writer.WriteSafeString("// Group Element "); + break; + case AssignmentElement assignmentElement: + writer.WriteSafeString($"// Assignment Element : {assignmentElement.Property} {assignmentElement.Operator} {assignmentElement.Value}"); + break; + case NonParsingAssignmentElement nonParsingAssignmentElement: + writer.WriteSafeString($"// Assignment Element : {nonParsingAssignmentElement.PropertyName} {nonParsingAssignmentElement.Operator} {nonParsingAssignmentElement.Value}"); + break; + default: + throw new ArgumentException("Unknown element type"); + } + + writer.WriteSafeString(Environment.NewLine); + } + } + } +} diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.cs index a057be8f..18473811 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class AcceptActionUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public AcceptActionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,9 @@ public AcceptActionUsageTextualNotationBuilder(ITextualNotationBuilderFacade fac /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.AcceptActionUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionDefinitionTextualNotationBuilder.cs index c0a1f991..778d2465 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionDefinitionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class ActionDefinitionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public ActionDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,22 @@ public ActionDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade faca /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.ActionDefinition poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : ActionDefinition=OccurrenceDefinitionPrefix'action''def'DefinitionDeclarationActionBody + + + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + + stringBuilder.Append("action "); + stringBuilder.Append("def "); + // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? + + + // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs index 9e9b7320..544a83a7 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class ActionUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public ActionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,21 @@ public ActionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.ActionUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : ActionUsage=OccurrenceUsagePrefix'action'ActionUsageDeclarationActionBody + + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + + + stringBuilder.Append("action "); + // non Terminal : ActionUsageDeclaration; Found rule ActionUsageDeclaration:ActionUsage=UsageDeclarationValuePart? + + + // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActorMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActorMembershipTextualNotationBuilder.cs index fc181961..d43e6335 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActorMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActorMembershipTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class ActorMembershipTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public ActorMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,9 @@ public ActorMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facad /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Requirements.ActorMembership poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationDefinitionTextualNotationBuilder.cs index 23b3a5d7..66a8ec2a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationDefinitionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class AllocationDefinitionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public AllocationDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,19 @@ public AllocationDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Allocations.AllocationDefinition poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : AllocationDefinition=OccurrenceDefinitionPrefix'allocation''def'Definition + + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + + + stringBuilder.Append("allocation "); + stringBuilder.Append("def "); + // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationUsageTextualNotationBuilder.cs index cddc6e71..630fa981 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class AllocationUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public AllocationUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,22 @@ public AllocationUsageTextualNotationBuilder(ITextualNotationBuilderFacade facad /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Allocations.AllocationUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : AllocationUsage=OccurrenceUsagePrefixAllocationUsageDeclarationUsageBody + + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + + + // non Terminal : AllocationUsageDeclaration; Found rule AllocationUsageDeclaration:AllocationUsage='allocation'UsageDeclaration('allocate'ConnectorPart)?|'allocate'ConnectorPart + + + + + // non Terminal : UsageBody; Found rule UsageBody:Usage=DefinitionBody + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseDefinitionTextualNotationBuilder.cs index d376b8d3..5f61ce7e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseDefinitionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class AnalysisCaseDefinitionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public AnalysisCaseDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,22 @@ public AnalysisCaseDefinitionTextualNotationBuilder(ITextualNotationBuilderFacad /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.AnalysisCases.AnalysisCaseDefinition poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : AnalysisCaseDefinition=OccurrenceDefinitionPrefix'analysis''def'DefinitionDeclarationCaseBody + + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + + + stringBuilder.Append("analysis "); + stringBuilder.Append("def "); + // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? + + + // non Terminal : CaseBody; Found rule CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseUsageTextualNotationBuilder.cs index fd693722..e2c61eba 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class AnalysisCaseUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public AnalysisCaseUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,27 @@ public AnalysisCaseUsageTextualNotationBuilder(ITextualNotationBuilderFacade fac /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.AnalysisCases.AnalysisCaseUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : AnalysisCaseUsage=OccurrenceUsagePrefix'analysis'ConstraintUsageDeclarationCaseBody + + + + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + + + stringBuilder.Append("analysis "); + // non Terminal : ConstraintUsageDeclaration; Found rule ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? + + + + + + + // non Terminal : CaseBody; Found rule CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotatingElementTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotatingElementTextualNotationBuilder.cs index 7f9b8724..b312b461 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotatingElementTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotatingElementTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class AnnotatingElementTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public AnnotatingElementTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,31 @@ public AnnotatingElementTextualNotationBuilder(ITextualNotationBuilderFacade fac /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Root.Annotations.AnnotatingElement poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : AnnotatingElement=Comment|Documentation|TextualRepresentation|MetadataFeature + + + + // non Terminal : Comment; Found rule Comment=('comment'Identification('about'ownedRelationship+=Annotation(','ownedRelationship+=Annotation)*)?)?('locale'locale=STRING_VALUE)?body=REGULAR_COMMENT + + + // non Terminal : Documentation; Found rule Documentation='doc'Identification('locale'locale=STRING_VALUE)?body=REGULAR_COMMENT + + + + + // non Terminal : TextualRepresentation; Found rule TextualRepresentation=('rep'Identification)?'language'language=STRING_VALUEbody=REGULAR_COMMENT + + + + + + + // non Terminal : MetadataFeature; Found rule MetadataFeature=(ownedRelationship+=PrefixMetadataMember)*('@'|'metadata')MetadataFeatureDeclaration('about'ownedRelationship+=Annotation(','ownedRelationship+=Annotation)*)?MetadataBody + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.cs index 559818d2..ced6d125 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class AnnotationTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public AnnotationTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,12 @@ public AnnotationTextualNotationBuilder(ITextualNotationBuilderFacade facade) : /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Root.Annotations.Annotation poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : Annotation=annotatedElement=[QualifiedName] + + // Assignment Element : annotatedElement = + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssertConstraintUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssertConstraintUsageTextualNotationBuilder.cs index a2106272..398b7d80 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssertConstraintUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssertConstraintUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class AssertConstraintUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public AssertConstraintUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,20 @@ public AssertConstraintUsageTextualNotationBuilder(ITextualNotationBuilderFacade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Constraints.AssertConstraintUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : AssertConstraintUsage=OccurrenceUsagePrefix'assert'(isNegated?='not')?(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'constraint'ConstraintUsageDeclaration)CalculationBody + + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + + + stringBuilder.Append("assert "); + // Group Element + // Group Element + // non Terminal : CalculationBody; Found rule CalculationBody:Type=';'|'{'CalculationBodyPart'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssignmentActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssignmentActionUsageTextualNotationBuilder.cs index 1fc7f5e7..a405b00b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssignmentActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssignmentActionUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class AssignmentActionUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public AssignmentActionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,9 @@ public AssignmentActionUsageTextualNotationBuilder(ITextualNotationBuilderFacade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.AssignmentActionUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationStructureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationStructureTextualNotationBuilder.cs index 30b1950d..9ee85d6d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationStructureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationStructureTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class AssociationStructureTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public AssociationStructureTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,26 @@ public AssociationStructureTextualNotationBuilder(ITextualNotationBuilderFacade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Associations.AssociationStructure poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : AssociationStructure=TypePrefix'assoc''struct'ClassifierDeclarationTypeBody + + + + + + // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* + + + stringBuilder.Append("assoc "); + stringBuilder.Append("struct "); + // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* + + + // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationTextualNotationBuilder.cs index 4f3bfb17..beefd97f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class AssociationTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public AssociationTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,21 @@ public AssociationTextualNotationBuilder(ITextualNotationBuilderFacade facade) : /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Associations.Association poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : Association=TypePrefix'assoc'ClassifierDeclarationTypeBody + + // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* + + + stringBuilder.Append("assoc "); + // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* + + + // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeDefinitionTextualNotationBuilder.cs index 0f4ea18f..a09bbf4a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeDefinitionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class AttributeDefinitionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public AttributeDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,19 @@ public AttributeDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade f /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Attributes.AttributeDefinition poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : AttributeDefinition:AttributeDefinition=DefinitionPrefix'attribute''def'Definition + + // non Terminal : DefinitionPrefix; Found rule DefinitionPrefix:Definition=BasicDefinitionPrefix?DefinitionExtensionKeyword* + + + stringBuilder.Append("attribute "); + stringBuilder.Append("def "); + // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeUsageTextualNotationBuilder.cs index ae50325d..55142496 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class AttributeUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public AttributeUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,20 @@ public AttributeUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Attributes.AttributeUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : AttributeUsage:AttributeUsage=UsagePrefix'attribute'Usage + + + + // non Terminal : UsagePrefix; Found rule UsagePrefix:Usage=UnextendedUsagePrefixUsageExtensionKeyword* + + + stringBuilder.Append("attribute "); + // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BehaviorTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BehaviorTextualNotationBuilder.cs index 232c3f5e..06db73a0 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BehaviorTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BehaviorTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class BehaviorTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public BehaviorTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,23 @@ public BehaviorTextualNotationBuilder(ITextualNotationBuilderFacade facade) : ba /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Behaviors.Behavior poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : Behavior=TypePrefix'behavior'ClassifierDeclarationTypeBody + + + + // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* + + + stringBuilder.Append("behavior "); + // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* + + + // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorAsUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorAsUsageTextualNotationBuilder.cs index ceac3e0b..c3da729c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorAsUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorAsUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class BindingConnectorAsUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public BindingConnectorAsUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,24 @@ public BindingConnectorAsUsageTextualNotationBuilder(ITextualNotationBuilderFaca /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Connections.BindingConnectorAsUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : BindingConnectorAsUsage=UsagePrefix('binding'UsageDeclaration)?'bind'ownedRelationship+=ConnectorEndMember'='ownedRelationship+=ConnectorEndMemberUsageBody + + + + // non Terminal : UsagePrefix; Found rule UsagePrefix:Usage=UnextendedUsagePrefixUsageExtensionKeyword* + + + // Group Element + stringBuilder.Append("bind "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append("= "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // non Terminal : UsageBody; Found rule UsageBody:Usage=DefinitionBody + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorTextualNotationBuilder.cs index 0bb69c31..6af305cb 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class BindingConnectorTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public BindingConnectorTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,25 @@ public BindingConnectorTextualNotationBuilder(ITextualNotationBuilderFacade faca /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Connectors.BindingConnector poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : BindingConnector=FeaturePrefix'binding'BindingConnectorDeclarationTypeBody + + // non Terminal : FeaturePrefix; Found rule FeaturePrefix=(EndFeaturePrefix(ownedRelationship+=OwnedCrossFeatureMember)?|BasicFeaturePrefix)(ownedRelationship+=PrefixMetadataMember)* + + + + + stringBuilder.Append("binding "); + // non Terminal : BindingConnectorDeclaration; Found rule BindingConnectorDeclaration:BindingConnector=FeatureDeclaration('of'ownedRelationship+=ConnectorEndMember'='ownedRelationship+=ConnectorEndMember)?|(isSufficient?='all')?('of'?ownedRelationship+=ConnectorEndMember'='ownedRelationship+=ConnectorEndMember)? + + + + + // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BooleanExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BooleanExpressionTextualNotationBuilder.cs index 65c9e7eb..f50b773d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BooleanExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BooleanExpressionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class BooleanExpressionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public BooleanExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,26 @@ public BooleanExpressionTextualNotationBuilder(ITextualNotationBuilderFacade fac /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Functions.BooleanExpression poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : BooleanExpression=FeaturePrefix'bool'FeatureDeclarationValuePart?FunctionBody + + // non Terminal : FeaturePrefix; Found rule FeaturePrefix=(EndFeaturePrefix(ownedRelationship+=OwnedCrossFeatureMember)?|BasicFeaturePrefix)(ownedRelationship+=PrefixMetadataMember)* + + + + + stringBuilder.Append("bool "); + // non Terminal : FeatureDeclaration; Found rule FeatureDeclaration:Feature=(isSufficient?='all')?(FeatureIdentification(FeatureSpecializationPart|ConjugationPart)?|FeatureSpecializationPart|ConjugationPart)FeatureRelationshipPart* + + + // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue + + + // non Terminal : FunctionBody; Found rule FunctionBody:Type=';'|'{'FunctionBodyPart'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationDefinitionTextualNotationBuilder.cs index 59293bee..8608fea0 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationDefinitionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class CalculationDefinitionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public CalculationDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,22 @@ public CalculationDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Calculations.CalculationDefinition poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : CalculationDefinition=OccurrenceDefinitionPrefix'calc''def'DefinitionDeclarationCalculationBody + + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + + + stringBuilder.Append("calc "); + stringBuilder.Append("def "); + // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? + + + // non Terminal : CalculationBody; Found rule CalculationBody:Type=';'|'{'CalculationBodyPart'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationUsageTextualNotationBuilder.cs index 562cdf64..734608f2 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class CalculationUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public CalculationUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,21 @@ public CalculationUsageTextualNotationBuilder(ITextualNotationBuilderFacade faca /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Calculations.CalculationUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : CalculationUsage:CalculationUsage=OccurrenceUsagePrefix'calc'ActionUsageDeclarationCalculationBody + + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + + + stringBuilder.Append("calc "); + // non Terminal : ActionUsageDeclaration; Found rule ActionUsageDeclaration:ActionUsage=UsageDeclarationValuePart? + + + // non Terminal : CalculationBody; Found rule CalculationBody:Type=';'|'{'CalculationBodyPart'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseDefinitionTextualNotationBuilder.cs index aaffa984..02ab8927 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseDefinitionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class CaseDefinitionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public CaseDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,22 @@ public CaseDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Cases.CaseDefinition poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : CaseDefinition=OccurrenceDefinitionPrefix'case''def'DefinitionDeclarationCaseBody + + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + + + stringBuilder.Append("case "); + stringBuilder.Append("def "); + // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? + + + // non Terminal : CaseBody; Found rule CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseUsageTextualNotationBuilder.cs index 9382d1f7..77a84abb 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class CaseUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public CaseUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,25 @@ public CaseUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : b /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Cases.CaseUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : CaseUsage=OccurrenceUsagePrefix'case'ConstraintUsageDeclarationCaseBody + + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + + + stringBuilder.Append("case "); + // non Terminal : ConstraintUsageDeclaration; Found rule ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? + + + + + + + // non Terminal : CaseBody; Found rule CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassTextualNotationBuilder.cs index ac192b74..de09fd90 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class ClassTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public ClassTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,23 @@ public ClassTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base( /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Classes.Class poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : Class=TypePrefix'class'ClassifierDeclarationTypeBody + + + + // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* + + + stringBuilder.Append("class "); + // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* + + + // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs index 45f43954..fb572d82 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class ClassifierTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public ClassifierTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,21 @@ public ClassifierTextualNotationBuilder(ITextualNotationBuilderFacade facade) : /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Classifiers.Classifier poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : Classifier=TypePrefix'classifier'ClassifierDeclarationTypeBody + + // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* + + + stringBuilder.Append("classifier "); + // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* + + + // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CollectExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CollectExpressionTextualNotationBuilder.cs index 8cc44e44..c6dc6abd 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CollectExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CollectExpressionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class CollectExpressionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public CollectExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,14 @@ public CollectExpressionTextualNotationBuilder(ITextualNotationBuilderFacade fac /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.CollectExpression poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : CollectExpression=ownedRelationship+=PrimaryArgumentMember'.'ownedRelationship+=BodyArgumentMember + + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(". "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CommentTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CommentTextualNotationBuilder.cs index f2560afd..f3cd16a3 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CommentTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CommentTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class CommentTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public CommentTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,14 @@ public CommentTextualNotationBuilder(ITextualNotationBuilderFacade facade) : bas /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Root.Annotations.Comment poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : Comment=('comment'Identification('about'ownedRelationship+=Annotation(','ownedRelationship+=Annotation)*)?)?('locale'locale=STRING_VALUE)?body=REGULAR_COMMENT + + // Group Element + // Group Element + // Assignment Element : body = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernDefinitionTextualNotationBuilder.cs index 56613677..38bb9bfd 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernDefinitionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class ConcernDefinitionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public ConcernDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,22 @@ public ConcernDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade fac /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Requirements.ConcernDefinition poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : ConcernDefinition=OccurrenceDefinitionPrefix'concern''def'DefinitionDeclarationRequirementBody + + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + + + stringBuilder.Append("concern "); + stringBuilder.Append("def "); + // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? + + + // non Terminal : RequirementBody; Found rule RequirementBody:Type=';'|'{'RequirementBodyItem*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernUsageTextualNotationBuilder.cs index d4344613..52cca171 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class ConcernUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public ConcernUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,27 @@ public ConcernUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Requirements.ConcernUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : ConcernUsage=OccurrenceUsagePrefix'concern'ConstraintUsageDeclarationRequirementBody + + + + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + + + stringBuilder.Append("concern "); + // non Terminal : ConstraintUsageDeclaration; Found rule ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? + + + + + + + // non Terminal : RequirementBody; Found rule RequirementBody:Type=';'|'{'RequirementBodyItem*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortDefinitionTextualNotationBuilder.cs index c35af26b..a42c64cd 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortDefinitionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class ConjugatedPortDefinitionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public ConjugatedPortDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,12 @@ public ConjugatedPortDefinitionTextualNotationBuilder(ITextualNotationBuilderFac /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Ports.ConjugatedPortDefinition poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : ConjugatedPortDefinition=ownedRelationship+=PortConjugation + + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortTypingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortTypingTextualNotationBuilder.cs index 773c4da5..54256a70 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortTypingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortTypingTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class ConjugatedPortTypingTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public ConjugatedPortTypingTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,26 @@ public ConjugatedPortTypingTextualNotationBuilder(ITextualNotationBuilderFacade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Ports.ConjugatedPortTyping poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : ConjugatedPortTyping:ConjugatedPortTyping='~'originalPortDefinition=~[QualifiedName] + + + + + + + + + + + + + + + stringBuilder.Append("~ "); + // Assignment Element : originalPortDefinition = + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugationTextualNotationBuilder.cs index 9f6b63e5..c4fc6bdd 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugationTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class ConjugationTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public ConjugationTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,27 @@ public ConjugationTextualNotationBuilder(ITextualNotationBuilderFacade facade) : /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Types.Conjugation poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : Conjugation=('conjugation'Identification)?'conjugate'(conjugatedType=[QualifiedName]|conjugatedType=FeatureChain{ownedRelatedElement+=conjugatedType})CONJUGATES(originalType=[QualifiedName]|originalType=FeatureChain{ownedRelatedElement+=originalType})RelationshipBody + + // Group Element + stringBuilder.Append("conjugate "); + // Group Element + // non Terminal : CONJUGATES; Found rule CONJUGATES='~'|'conjugates' + + + + + + + // Group Element + // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' + + + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionDefinitionTextualNotationBuilder.cs index 5ff8d1b9..6ff91ddd 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionDefinitionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class ConnectionDefinitionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public ConnectionDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,19 @@ public ConnectionDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Connections.ConnectionDefinition poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : ConnectionDefinition=OccurrenceDefinitionPrefix'connection''def'Definition + + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + + + stringBuilder.Append("connection "); + stringBuilder.Append("def "); + // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs index 555cc96e..6e3de8c1 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class ConnectionUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public ConnectionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,18 @@ public ConnectionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facad /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Connections.ConnectionUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : ConnectionUsage=OccurrenceUsagePrefix('connection'UsageDeclarationValuePart?('connect'ConnectorPart)?|'connect'ConnectorPart)UsageBody + + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + + + // Group Element + // non Terminal : UsageBody; Found rule UsageBody:Usage=DefinitionBody + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs index 28988131..b054e23d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class ConnectorTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public ConnectorTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,21 @@ public ConnectorTextualNotationBuilder(ITextualNotationBuilderFacade facade) : b /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Connectors.Connector poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : Connector=FeaturePrefix'connector'(FeatureDeclaration?ValuePart?|ConnectorDeclaration)TypeBody + + // non Terminal : FeaturePrefix; Found rule FeaturePrefix=(EndFeaturePrefix(ownedRelationship+=OwnedCrossFeatureMember)?|BasicFeaturePrefix)(ownedRelationship+=PrefixMetadataMember)* + + + + + stringBuilder.Append("connector "); + // Group Element + // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintDefinitionTextualNotationBuilder.cs index 64abd164..e04f227f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintDefinitionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class ConstraintDefinitionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public ConstraintDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,22 @@ public ConstraintDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Constraints.ConstraintDefinition poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : ConstraintDefinition=OccurrenceDefinitionPrefix'constraint''def'DefinitionDeclarationCalculationBody + + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + + + stringBuilder.Append("constraint "); + stringBuilder.Append("def "); + // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? + + + // non Terminal : CalculationBody; Found rule CalculationBody:Type=';'|'{'CalculationBodyPart'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintUsageTextualNotationBuilder.cs index 648cef38..d6ab2b14 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class ConstraintUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public ConstraintUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,25 @@ public ConstraintUsageTextualNotationBuilder(ITextualNotationBuilderFacade facad /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Constraints.ConstraintUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : ConstraintUsage=OccurrenceUsagePrefix'constraint'ConstraintUsageDeclarationCalculationBody + + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + + + stringBuilder.Append("constraint "); + // non Terminal : ConstraintUsageDeclaration; Found rule ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? + + + + + + + // non Terminal : CalculationBody; Found rule CalculationBody:Type=';'|'{'CalculationBodyPart'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstructorExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstructorExpressionTextualNotationBuilder.cs index 726aa707..e3ec167c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstructorExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstructorExpressionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class ConstructorExpressionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public ConstructorExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,14 @@ public ConstructorExpressionTextualNotationBuilder(ITextualNotationBuilderFacade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.ConstructorExpression poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : ConstructorExpression='new'ownedRelationship+=InstantiatedTypeMemberownedRelationship+=ConstructorResultMember + + stringBuilder.Append("new "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CrossSubsettingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CrossSubsettingTextualNotationBuilder.cs index d2287a2f..41e0b661 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CrossSubsettingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CrossSubsettingTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class CrossSubsettingTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public CrossSubsettingTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,9 @@ public CrossSubsettingTextualNotationBuilder(ITextualNotationBuilderFacade facad /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Features.CrossSubsetting poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DataTypeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DataTypeTextualNotationBuilder.cs index 50ee12ae..f31594b4 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DataTypeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DataTypeTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class DataTypeTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public DataTypeTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,23 @@ public DataTypeTextualNotationBuilder(ITextualNotationBuilderFacade facade) : ba /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.DataTypes.DataType poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : DataType=TypePrefix'datatype'ClassifierDeclarationTypeBody + + + + // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* + + + stringBuilder.Append("datatype "); + // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* + + + // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DecisionNodeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DecisionNodeTextualNotationBuilder.cs index b9702f8a..53187f23 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DecisionNodeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DecisionNodeTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class DecisionNodeTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public DecisionNodeTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,21 @@ public DecisionNodeTextualNotationBuilder(ITextualNotationBuilderFacade facade) /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.DecisionNode poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : DecisionNode=ControlNodePrefixisComposite?='decide'UsageDeclarationActionBody + + // non Terminal : ControlNodePrefix; Found rule ControlNodePrefix:OccurrenceUsage=RefPrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + + + // Assignment Element : isComposite ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? + + + // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs index 29ee79ac..1bab9ec6 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class DefinitionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public DefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,17 @@ public DefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.Definition poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : Definition=DefinitionDeclarationDefinitionBody + + // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? + + + // non Terminal : DefinitionBody; Found rule DefinitionBody:Type=';'|'{'DefinitionBodyItem*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DependencyTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DependencyTextualNotationBuilder.cs index a8ebe9b6..6a62ac69 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DependencyTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DependencyTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class DependencyTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public DependencyTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,25 @@ public DependencyTextualNotationBuilder(ITextualNotationBuilderFacade facade) : /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Root.Dependencies.Dependency poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : Dependency=(ownedRelationship+=PrefixMetadataAnnotation)*'dependency'DependencyDeclarationRelationshipBody + + // Group Element + stringBuilder.Append("dependency "); + // non Terminal : DependencyDeclaration; Found rule DependencyDeclaration=(Identification'from')?client+=[QualifiedName](','client+=[QualifiedName])*'to'supplier+=[QualifiedName](','supplier+=[QualifiedName])* + + + + + + + // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' + + + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DifferencingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DifferencingTextualNotationBuilder.cs index 3082177e..befe8581 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DifferencingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DifferencingTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class DifferencingTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public DifferencingTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,15 @@ public DifferencingTextualNotationBuilder(ITextualNotationBuilderFacade facade) /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Types.Differencing poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : Differencing=differencingType=[QualifiedName]|ownedRelatedElement+=OwnedFeatureChain + + + + // Assignment Element : differencingType = + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DisjoiningTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DisjoiningTextualNotationBuilder.cs index 5ceaae51..ca8bc185 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DisjoiningTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DisjoiningTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class DisjoiningTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public DisjoiningTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,21 @@ public DisjoiningTextualNotationBuilder(ITextualNotationBuilderFacade facade) : /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Types.Disjoining poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : Disjoining=('disjoining'Identification)?'disjoint'(typeDisjoined=[QualifiedName]|typeDisjoined=FeatureChain{ownedRelatedElement+=typeDisjoined})'from'(disjoiningType=[QualifiedName]|disjoiningType=FeatureChain{ownedRelatedElement+=disjoiningType})RelationshipBody + + // Group Element + stringBuilder.Append("disjoint "); + // Group Element + stringBuilder.Append("from "); + // Group Element + // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' + + + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DocumentationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DocumentationTextualNotationBuilder.cs index 1ece483a..9f77279d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DocumentationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DocumentationTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class DocumentationTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public DocumentationTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,19 @@ public DocumentationTextualNotationBuilder(ITextualNotationBuilderFacade facade) /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Root.Annotations.Documentation poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : Documentation='doc'Identification('locale'locale=STRING_VALUE)?body=REGULAR_COMMENT + + + + stringBuilder.Append("doc "); + // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? + + + // Group Element + // Assignment Element : body = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementFilterMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementFilterMembershipTextualNotationBuilder.cs index 04b434fa..c94f4d5a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementFilterMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementFilterMembershipTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class ElementFilterMembershipTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public ElementFilterMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,9 @@ public ElementFilterMembershipTextualNotationBuilder(ITextualNotationBuilderFaca /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Packages.ElementFilterMembership poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EndFeatureMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EndFeatureMembershipTextualNotationBuilder.cs index 6f8d4a1e..aff631e9 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EndFeatureMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EndFeatureMembershipTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class EndFeatureMembershipTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public EndFeatureMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,9 @@ public EndFeatureMembershipTextualNotationBuilder(ITextualNotationBuilderFacade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Features.EndFeatureMembership poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationDefinitionTextualNotationBuilder.cs index ad96cb47..6aa8a491 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationDefinitionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class EnumerationDefinitionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public EnumerationDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,22 @@ public EnumerationDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Enumerations.EnumerationDefinition poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : EnumerationDefinition=DefinitionExtensionKeyword*'enum''def'DefinitionDeclarationEnumerationBody + + // non Terminal : DefinitionExtensionKeyword; Found rule DefinitionExtensionKeyword:Definition=ownedRelationship+=PrefixMetadataMember + + + stringBuilder.Append("enum "); + stringBuilder.Append("def "); + // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? + + + // non Terminal : EnumerationBody; Found rule EnumerationBody:EnumerationDefinition=';'|'{'(ownedRelationship+=AnnotatingMember|ownedRelationship+=EnumerationUsageMember)*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationUsageTextualNotationBuilder.cs index a834048d..15303836 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class EnumerationUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public EnumerationUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,22 @@ public EnumerationUsageTextualNotationBuilder(ITextualNotationBuilderFacade faca /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Enumerations.EnumerationUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : EnumerationUsage:EnumerationUsage=UsagePrefix'enum'Usage + + + + + + // non Terminal : UsagePrefix; Found rule UsagePrefix:Usage=UnextendedUsagePrefixUsageExtensionKeyword* + + + stringBuilder.Append("enum "); + // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EventOccurrenceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EventOccurrenceUsageTextualNotationBuilder.cs index 3789b0e7..6c8698a2 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EventOccurrenceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EventOccurrenceUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class EventOccurrenceUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public EventOccurrenceUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,21 @@ public EventOccurrenceUsageTextualNotationBuilder(ITextualNotationBuilderFacade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Occurrences.EventOccurrenceUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : EventOccurrenceUsage=OccurrenceUsagePrefix'event'(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'occurrence'UsageDeclaration?)UsageCompletion + + + + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + + + stringBuilder.Append("event "); + // Group Element + // non Terminal : UsageCompletion; Found rule UsageCompletion:Usage=ValuePart?UsageBody + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExhibitStateUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExhibitStateUsageTextualNotationBuilder.cs index df31bfbf..78bc6c40 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExhibitStateUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExhibitStateUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class ExhibitStateUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public ExhibitStateUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,24 @@ public ExhibitStateUsageTextualNotationBuilder(ITextualNotationBuilderFacade fac /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.States.ExhibitStateUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : ExhibitStateUsage=OccurrenceUsagePrefix'exhibit'(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'state'UsageDeclaration)ValuePart?StateUsageBody + + + + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + + + stringBuilder.Append("exhibit "); + // Group Element + // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue + + + // non Terminal : StateUsageBody; Found rule StateUsageBody:StateUsage=';'|(isParallel?='parallel')?'{'StateBodyItem*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs index 308497c0..51a81d68 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class ExpressionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public ExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,28 @@ public ExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Functions.Expression poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : Expression=FeaturePrefix'expr'FeatureDeclarationValuePart?FunctionBody + + + + // non Terminal : FeaturePrefix; Found rule FeaturePrefix=(EndFeaturePrefix(ownedRelationship+=OwnedCrossFeatureMember)?|BasicFeaturePrefix)(ownedRelationship+=PrefixMetadataMember)* + + + + + stringBuilder.Append("expr "); + // non Terminal : FeatureDeclaration; Found rule FeatureDeclaration:Feature=(isSufficient?='all')?(FeatureIdentification(FeatureSpecializationPart|ConjugationPart)?|FeatureSpecializationPart|ConjugationPart)FeatureRelationshipPart* + + + // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue + + + // non Terminal : FunctionBody; Found rule FunctionBody:Type=';'|'{'FunctionBodyPart'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainExpressionTextualNotationBuilder.cs index 19670dbc..94789d10 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainExpressionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class FeatureChainExpressionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public FeatureChainExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,14 @@ public FeatureChainExpressionTextualNotationBuilder(ITextualNotationBuilderFacad /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.FeatureChainExpression poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : FeatureChainExpression=ownedRelationship+=NonFeatureChainPrimaryArgumentMember'.'ownedRelationship+=FeatureChainMember + + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(". "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainingTextualNotationBuilder.cs index 18d69384..13e6303f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainingTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class FeatureChainingTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public FeatureChainingTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,9 @@ public FeatureChainingTextualNotationBuilder(ITextualNotationBuilderFacade facad /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Features.FeatureChaining poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureInvertingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureInvertingTextualNotationBuilder.cs index f413882f..1081e8d4 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureInvertingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureInvertingTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class FeatureInvertingTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public FeatureInvertingTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,21 @@ public FeatureInvertingTextualNotationBuilder(ITextualNotationBuilderFacade faca /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Features.FeatureInverting poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : FeatureInverting=('inverting'Identification?)?'inverse'(featureInverted=[QualifiedName]|featureInverted=OwnedFeatureChain{ownedRelatedElement+=featureInverted})'of'(invertingFeature=[QualifiedName]|ownedRelatedElement+=OwnedFeatureChain{ownedRelatedElement+=invertingFeature})RelationshipBody + + // Group Element + stringBuilder.Append("inverse "); + // Group Element + stringBuilder.Append("of "); + // Group Element + // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' + + + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs index 6455eba3..a0ef9280 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class FeatureMembershipTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public FeatureMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,9 @@ public FeatureMembershipTextualNotationBuilder(ITextualNotationBuilderFacade fac /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Types.FeatureMembership poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureReferenceExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureReferenceExpressionTextualNotationBuilder.cs index f3168215..ed784336 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureReferenceExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureReferenceExpressionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class FeatureReferenceExpressionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public FeatureReferenceExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,13 @@ public FeatureReferenceExpressionTextualNotationBuilder(ITextualNotationBuilderF /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.FeatureReferenceExpression poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : FeatureReferenceExpression:FeatureReferenceExpression=ownedRelationship+=FeatureReferenceMemberownedRelationship+=EmptyResultMember + + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs index 06e184cf..4c4f36b9 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class FeatureTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public FeatureTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,20 @@ public FeatureTextualNotationBuilder(ITextualNotationBuilderFacade facade) : bas /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Features.Feature poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : Feature=(FeaturePrefix('feature'|ownedRelationship+=PrefixMetadataMember)FeatureDeclaration?|(EndFeaturePrefix|BasicFeaturePrefix)FeatureDeclaration)ValuePart?TypeBody + + + + // Group Element + // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue + + + // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs index be37e6ff..d9e9034d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class FeatureTypingTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public FeatureTypingTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,30 @@ public FeatureTypingTextualNotationBuilder(ITextualNotationBuilderFacade facade) /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Features.FeatureTyping poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : FeatureTyping=OwnedFeatureTyping|ConjugatedPortTyping + + // non Terminal : OwnedFeatureTyping; Found rule OwnedFeatureTyping:FeatureTyping=type=[QualifiedName]|type=OwnedFeatureChain{ownedRelatedElement+=type} + + + // non Terminal : ConjugatedPortTyping; Found rule ConjugatedPortTyping:ConjugatedPortTyping='~'originalPortDefinition=~[QualifiedName] + + + + + + + + + + + + + + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureValueTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureValueTextualNotationBuilder.cs index 41f2c911..1a64bd05 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureValueTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureValueTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class FeatureValueTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public FeatureValueTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,18 @@ public FeatureValueTextualNotationBuilder(ITextualNotationBuilderFacade facade) /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.FeatureValues.FeatureValue poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : FeatureValue=('='|isInitial?=':='|isDefault?='default'('='|isInitial?=':=')?)ownedRelatedElement+=OwnedExpression + + + + + + + // Group Element + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowDefinitionTextualNotationBuilder.cs index 8bb1986c..e1796899 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowDefinitionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class FlowDefinitionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public FlowDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,19 @@ public FlowDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Flows.FlowDefinition poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : FlowDefinition=OccurrenceDefinitionPrefix'flow''def'Definition + + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + + + stringBuilder.Append("flow "); + stringBuilder.Append("def "); + // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowEndTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowEndTextualNotationBuilder.cs index d3d875ab..18b5d6a0 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowEndTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowEndTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class FlowEndTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public FlowEndTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,13 @@ public FlowEndTextualNotationBuilder(ITextualNotationBuilderFacade facade) : bas /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Interactions.FlowEnd poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : FlowEnd=(ownedRelationship+=FlowEndSubsetting)?ownedRelationship+=FlowFeatureMember + + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowTextualNotationBuilder.cs index 7205ef89..83cfede0 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class FlowTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public FlowTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,23 @@ public FlowTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(f /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Interactions.Flow poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : Flow=FeaturePrefix'flow'FlowDeclarationTypeBody + + // non Terminal : FeaturePrefix; Found rule FeaturePrefix=(EndFeaturePrefix(ownedRelationship+=OwnedCrossFeatureMember)?|BasicFeaturePrefix)(ownedRelationship+=PrefixMetadataMember)* + + + + + stringBuilder.Append("flow "); + // non Terminal : FlowDeclaration; Found rule FlowDeclaration:FlowUsage=UsageDeclarationValuePart?('of'ownedRelationship+=FlowPayloadFeatureMember)?('from'ownedRelationship+=FlowEndMember'to'ownedRelationship+=FlowEndMember)?|ownedRelationship+=FlowEndMember'to'ownedRelationship+=FlowEndMember + + + // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowUsageTextualNotationBuilder.cs index 924473af..8a12225f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class FlowUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public FlowUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,21 @@ public FlowUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : b /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Flows.FlowUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : FlowUsage=OccurrenceUsagePrefix'flow'FlowDeclarationDefinitionBody + + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + + + stringBuilder.Append("flow "); + // non Terminal : FlowDeclaration; Found rule FlowDeclaration:FlowUsage=UsageDeclarationValuePart?('of'ownedRelationship+=FlowPayloadFeatureMember)?('from'ownedRelationship+=FlowEndMember'to'ownedRelationship+=FlowEndMember)?|ownedRelationship+=FlowEndMember'to'ownedRelationship+=FlowEndMember + + + // non Terminal : DefinitionBody; Found rule DefinitionBody:Type=';'|'{'DefinitionBodyItem*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForLoopActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForLoopActionUsageTextualNotationBuilder.cs index f87ed1bb..c3d723d8 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForLoopActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForLoopActionUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class ForLoopActionUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public ForLoopActionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,9 @@ public ForLoopActionUsageTextualNotationBuilder(ITextualNotationBuilderFacade fa /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.ForLoopActionUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForkNodeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForkNodeTextualNotationBuilder.cs index 0703248e..80472fca 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForkNodeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForkNodeTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class ForkNodeTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public ForkNodeTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,23 @@ public ForkNodeTextualNotationBuilder(ITextualNotationBuilderFacade facade) : ba /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.ForkNode poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : ForkNode=ControlNodePrefixisComposite?='fork'UsageDeclarationActionBody + + + + // non Terminal : ControlNodePrefix; Found rule ControlNodePrefix:OccurrenceUsage=RefPrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + + + // Assignment Element : isComposite ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? + + + // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FramedConcernMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FramedConcernMembershipTextualNotationBuilder.cs index 95b1c3db..dd0b5794 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FramedConcernMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FramedConcernMembershipTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class FramedConcernMembershipTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public FramedConcernMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,9 @@ public FramedConcernMembershipTextualNotationBuilder(ITextualNotationBuilderFaca /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Requirements.FramedConcernMembership poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FunctionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FunctionTextualNotationBuilder.cs index 10c29640..bac8b85a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FunctionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FunctionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class FunctionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public FunctionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,21 @@ public FunctionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : ba /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Functions.Function poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : Function=TypePrefix'function'ClassifierDeclarationFunctionBody + + // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* + + + stringBuilder.Append("function "); + // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* + + + // non Terminal : FunctionBody; Found rule FunctionBody:Type=';'|'{'FunctionBodyPart'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs index c92456fe..f4c33922 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class IfActionUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public IfActionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,9 @@ public IfActionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.IfActionUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IncludeUseCaseUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IncludeUseCaseUsageTextualNotationBuilder.cs index 2b98ef33..6b4990d3 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IncludeUseCaseUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IncludeUseCaseUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class IncludeUseCaseUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public IncludeUseCaseUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,26 @@ public IncludeUseCaseUsageTextualNotationBuilder(ITextualNotationBuilderFacade f /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.UseCases.IncludeUseCaseUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : IncludeUseCaseUsage=OccurrenceUsagePrefix'include'(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'use''case'UsageDeclaration)ValuePart?CaseBody + + + + + + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + + + stringBuilder.Append("include "); + // Group Element + // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue + + + // non Terminal : CaseBody; Found rule CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IndexExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IndexExpressionTextualNotationBuilder.cs index c0234f57..0ace1535 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IndexExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IndexExpressionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class IndexExpressionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public IndexExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,16 @@ public IndexExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facad /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.IndexExpression poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : IndexExpression=ownedRelationship+=PrimaryArgumentMember'#''('ownedRelationship+=SequenceExpressionListMember')' + + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append("# "); + stringBuilder.Append("( "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(") "); + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InteractionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InteractionTextualNotationBuilder.cs index 661ecef7..2f1a4f53 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InteractionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InteractionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class InteractionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public InteractionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,23 @@ public InteractionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Interactions.Interaction poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : Interaction=TypePrefix'interaction'ClassifierDeclarationTypeBody + + + + // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* + + + stringBuilder.Append("interaction "); + // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* + + + // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceDefinitionTextualNotationBuilder.cs index 4e4ef98f..7be9e7cf 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceDefinitionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class InterfaceDefinitionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public InterfaceDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,22 @@ public InterfaceDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade f /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Interfaces.InterfaceDefinition poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : InterfaceDefinition=OccurrenceDefinitionPrefix'interface''def'DefinitionDeclarationInterfaceBody + + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + + + stringBuilder.Append("interface "); + stringBuilder.Append("def "); + // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? + + + // non Terminal : InterfaceBody; Found rule InterfaceBody:Type=';'|'{'InterfaceBodyItem*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs index 5d9c5911..c8503112 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class InterfaceUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public InterfaceUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,21 @@ public InterfaceUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Interfaces.InterfaceUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : InterfaceUsage=OccurrenceUsagePrefix'interface'InterfaceUsageDeclarationInterfaceBody + + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + + + stringBuilder.Append("interface "); + // non Terminal : InterfaceUsageDeclaration; Found rule InterfaceUsageDeclaration:InterfaceUsage=UsageDeclarationValuePart?('connect'InterfacePart)?|InterfacePart + + + // non Terminal : InterfaceBody; Found rule InterfaceBody:Type=';'|'{'InterfaceBodyItem*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IntersectingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IntersectingTextualNotationBuilder.cs index e637b316..bac35b11 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IntersectingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IntersectingTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class IntersectingTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public IntersectingTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,13 @@ public IntersectingTextualNotationBuilder(ITextualNotationBuilderFacade facade) /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Types.Intersecting poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : Intersecting=intersectingType=[QualifiedName]|ownedRelatedElement+=OwnedFeatureChain + + // Assignment Element : intersectingType = + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs index 3823761f..db278abc 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class InvariantTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public InvariantTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,31 @@ public InvariantTextualNotationBuilder(ITextualNotationBuilderFacade facade) : b /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Functions.Invariant poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : Invariant=FeaturePrefix'inv'('true'|isNegated?='false')?FeatureDeclarationValuePart?FunctionBody + + + + + + // non Terminal : FeaturePrefix; Found rule FeaturePrefix=(EndFeaturePrefix(ownedRelationship+=OwnedCrossFeatureMember)?|BasicFeaturePrefix)(ownedRelationship+=PrefixMetadataMember)* + + + + + stringBuilder.Append("inv "); + // Group Element + // non Terminal : FeatureDeclaration; Found rule FeatureDeclaration:Feature=(isSufficient?='all')?(FeatureIdentification(FeatureSpecializationPart|ConjugationPart)?|FeatureSpecializationPart|ConjugationPart)FeatureRelationshipPart* + + + // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue + + + // non Terminal : FunctionBody; Found rule FunctionBody:Type=';'|'{'FunctionBodyPart'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs index 10001e4e..6b67bfbb 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class InvocationExpressionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public InvocationExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,16 @@ public InvocationExpressionTextualNotationBuilder(ITextualNotationBuilderFacade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.InvocationExpression poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : InvocationExpression:InvocationExpression=ownedRelationship+=InstantiatedTypeMemberArgumentListownedRelationship+=EmptyResultMember + + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // non Terminal : ArgumentList; Found rule ArgumentList:Feature='('(PositionalArgumentList|NamedArgumentList)?')' + + + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemDefinitionTextualNotationBuilder.cs index 27431910..d9fbbedf 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemDefinitionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class ItemDefinitionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public ItemDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,19 @@ public ItemDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Items.ItemDefinition poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : ItemDefinition=OccurrenceDefinitionPrefix'item''def'Definition + + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + + + stringBuilder.Append("item "); + stringBuilder.Append("def "); + // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemUsageTextualNotationBuilder.cs index 20a21075..49a66600 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class ItemUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public ItemUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,20 @@ public ItemUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : b /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Items.ItemUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : ItemUsage=OccurrenceUsagePrefix'item'Usage + + + + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + + + stringBuilder.Append("item "); + // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/JoinNodeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/JoinNodeTextualNotationBuilder.cs index a8acbff3..7debc859 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/JoinNodeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/JoinNodeTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class JoinNodeTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public JoinNodeTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,21 @@ public JoinNodeTextualNotationBuilder(ITextualNotationBuilderFacade facade) : ba /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.JoinNode poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : JoinNode=ControlNodePrefixisComposite?='join'UsageDeclarationActionBody + + // non Terminal : ControlNodePrefix; Found rule ControlNodePrefix:OccurrenceUsage=RefPrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + + + // Assignment Element : isComposite ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? + + + // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LibraryPackageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LibraryPackageTextualNotationBuilder.cs index 0d4012b8..0047e9b6 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LibraryPackageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LibraryPackageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class LibraryPackageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public LibraryPackageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,20 @@ public LibraryPackageTextualNotationBuilder(ITextualNotationBuilderFacade facade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Packages.LibraryPackage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : LibraryPackage=(isStandard?='standard')'library'(ownedRelationship+=PrefixMetadataMember)*PackageDeclarationPackageBody + + // Group Element + stringBuilder.Append("library "); + // Group Element + // non Terminal : PackageDeclaration; Found rule PackageDeclaration:Package='package'Identification + + + // non Terminal : PackageBody; Found rule PackageBody:Package=';'|'{'PackageBodyElement*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralBooleanTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralBooleanTextualNotationBuilder.cs index 2a90066f..07718fec 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralBooleanTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralBooleanTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class LiteralBooleanTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public LiteralBooleanTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,12 @@ public LiteralBooleanTextualNotationBuilder(ITextualNotationBuilderFacade facade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.LiteralBoolean poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : LiteralBoolean=value=BooleanValue + + // Assignment Element : value = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralExpressionTextualNotationBuilder.cs index ae091cad..bcf9b3e0 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralExpressionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class LiteralExpressionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public LiteralExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,30 @@ public LiteralExpressionTextualNotationBuilder(ITextualNotationBuilderFacade fac /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.LiteralExpression poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : LiteralExpression=LiteralBoolean|LiteralString|LiteralInteger|LiteralReal|LiteralInfinity + + // non Terminal : LiteralBoolean; Found rule LiteralBoolean=value=BooleanValue + + + // non Terminal : LiteralString; Found rule LiteralString=value=STRING_VALUE + + + // non Terminal : LiteralInteger; Found rule LiteralInteger=value=DECIMAL_VALUE + + + // non Terminal : LiteralReal; Found rule LiteralReal=value=RealValue + + + // non Terminal : LiteralInfinity; Found rule LiteralInfinity='*' + + + + + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralInfinityTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralInfinityTextualNotationBuilder.cs index 6cf1bb30..f4170c85 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralInfinityTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralInfinityTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class LiteralInfinityTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public LiteralInfinityTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,16 @@ public LiteralInfinityTextualNotationBuilder(ITextualNotationBuilderFacade facad /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.LiteralInfinity poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : LiteralInfinity='*' + + + + + + stringBuilder.Append("* "); + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralIntegerTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralIntegerTextualNotationBuilder.cs index 147116ae..8fc0645a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralIntegerTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralIntegerTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class LiteralIntegerTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public LiteralIntegerTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,12 @@ public LiteralIntegerTextualNotationBuilder(ITextualNotationBuilderFacade facade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.LiteralInteger poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : LiteralInteger=value=DECIMAL_VALUE + + // Assignment Element : value = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralRationalTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralRationalTextualNotationBuilder.cs index c8b499bd..24e82c08 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralRationalTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralRationalTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class LiteralRationalTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public LiteralRationalTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,9 @@ public LiteralRationalTextualNotationBuilder(ITextualNotationBuilderFacade facad /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.LiteralRational poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralStringTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralStringTextualNotationBuilder.cs index 4aff1cff..422861eb 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralStringTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralStringTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class LiteralStringTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public LiteralStringTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,12 @@ public LiteralStringTextualNotationBuilder(ITextualNotationBuilderFacade facade) /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.LiteralString poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : LiteralString=value=STRING_VALUE + + // Assignment Element : value = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipExposeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipExposeTextualNotationBuilder.cs index 26b67df2..b39165be 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipExposeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipExposeTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class MembershipExposeTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public MembershipExposeTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,14 @@ public MembershipExposeTextualNotationBuilder(ITextualNotationBuilderFacade faca /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Views.MembershipExpose poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : MembershipExpose=MembershipImport + + // non Terminal : MembershipImport; Found rule MembershipImport=importedMembership=[QualifiedName]('::'isRecursive?='**')? + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.cs index 5f6f73f1..b1269203 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class MembershipImportTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public MembershipImportTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,13 @@ public MembershipImportTextualNotationBuilder(ITextualNotationBuilderFacade faca /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Root.Namespaces.MembershipImport poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : MembershipImport=importedMembership=[QualifiedName]('::'isRecursive?='**')? + + // Assignment Element : importedMembership = + // Group Element + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs index 596f0685..42cecd12 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class MembershipTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public MembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,9 @@ public MembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Root.Namespaces.Membership poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MergeNodeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MergeNodeTextualNotationBuilder.cs index 04858ab6..af5187fa 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MergeNodeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MergeNodeTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class MergeNodeTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public MergeNodeTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,21 @@ public MergeNodeTextualNotationBuilder(ITextualNotationBuilderFacade facade) : b /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.MergeNode poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : MergeNode=ControlNodePrefixisComposite?='merge'UsageDeclarationActionBody + + // non Terminal : ControlNodePrefix; Found rule ControlNodePrefix:OccurrenceUsage=RefPrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + + + // Assignment Element : isComposite ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? + + + // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetaclassTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetaclassTextualNotationBuilder.cs index 73f49827..84393832 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetaclassTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetaclassTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class MetaclassTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public MetaclassTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,21 @@ public MetaclassTextualNotationBuilder(ITextualNotationBuilderFacade facade) : b /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Metadata.Metaclass poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : Metaclass=TypePrefix'metaclass'ClassifierDeclarationTypeBody + + // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* + + + stringBuilder.Append("metaclass "); + // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* + + + // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataAccessExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataAccessExpressionTextualNotationBuilder.cs index 21ad5ee7..d76685f5 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataAccessExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataAccessExpressionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class MetadataAccessExpressionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public MetadataAccessExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,14 @@ public MetadataAccessExpressionTextualNotationBuilder(ITextualNotationBuilderFac /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.MetadataAccessExpression poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : MetadataAccessExpression=ownedRelationship+=ElementReferenceMember'.''metadata' + + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(". "); + stringBuilder.Append("metadata "); + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.cs index 8551fb97..bc2c8720 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class MetadataDefinitionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public MetadataDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,20 @@ public MetadataDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade fa /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Metadata.MetadataDefinition poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : MetadataDefinition=(isAbstract?='abstract')?DefinitionExtensionKeyword*'metadata''def'Definition + + // Group Element + // non Terminal : DefinitionExtensionKeyword; Found rule DefinitionExtensionKeyword:Definition=ownedRelationship+=PrefixMetadataMember + + + stringBuilder.Append("metadata "); + stringBuilder.Append("def "); + // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs index 74ebcb0d..62236c3a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class MetadataFeatureTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public MetadataFeatureTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,20 @@ public MetadataFeatureTextualNotationBuilder(ITextualNotationBuilderFacade facad /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Metadata.MetadataFeature poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : MetadataFeature=(ownedRelationship+=PrefixMetadataMember)*('@'|'metadata')MetadataFeatureDeclaration('about'ownedRelationship+=Annotation(','ownedRelationship+=Annotation)*)?MetadataBody + + // Group Element + // Group Element + // non Terminal : MetadataFeatureDeclaration; Found rule MetadataFeatureDeclaration:MetadataFeature=(Identification(':'|'typed''by'))?ownedRelationship+=OwnedFeatureTyping + + + // Group Element + // non Terminal : MetadataBody; Found rule MetadataBody:Type=';'|'{'(ownedRelationship+=DefinitionMember|ownedRelationship+=MetadataBodyUsageMember|ownedRelationship+=AliasMember|ownedRelationship+=Import)*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs index d8f44f9d..40519a7d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class MetadataUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public MetadataUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,22 @@ public MetadataUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Metadata.MetadataUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : MetadataUsage=UsageExtensionKeyword*('@'|'metadata')MetadataUsageDeclaration('about'ownedRelationship+=Annotation(','ownedRelationship+=Annotation)*)?MetadataBody + + // non Terminal : UsageExtensionKeyword; Found rule UsageExtensionKeyword:Usage=ownedRelationship+=PrefixMetadataMember + + + // Group Element + // non Terminal : MetadataUsageDeclaration; Found rule MetadataUsageDeclaration:MetadataUsage=(Identification(':'|'typed''by'))?ownedRelationship+=OwnedFeatureTyping + + + // Group Element + // non Terminal : MetadataBody; Found rule MetadataBody:Type=';'|'{'(ownedRelationship+=DefinitionMember|ownedRelationship+=MetadataBodyUsageMember|ownedRelationship+=AliasMember|ownedRelationship+=Import)*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityRangeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityRangeTextualNotationBuilder.cs index 45d03d82..cbecd043 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityRangeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityRangeTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class MultiplicityRangeTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public MultiplicityRangeTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,15 @@ public MultiplicityRangeTextualNotationBuilder(ITextualNotationBuilderFacade fac /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Multiplicities.MultiplicityRange poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : MultiplicityRange='['(ownedRelationship+=MultiplicityExpressionMember'..')?ownedRelationship+=MultiplicityExpressionMember']' + + stringBuilder.Append("[ "); + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append("] "); + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityTextualNotationBuilder.cs index b12a1877..f35a4ebf 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class MultiplicityTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public MultiplicityTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,17 @@ public MultiplicityTextualNotationBuilder(ITextualNotationBuilderFacade facade) /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Types.Multiplicity poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : Multiplicity=MultiplicitySubset|MultiplicityRange + + // non Terminal : MultiplicitySubset; Found rule MultiplicitySubset:Multiplicity='multiplicity'IdentificationSubsetsTypeBody + + + // non Terminal : MultiplicityRange; Found rule MultiplicityRange='['(ownedRelationship+=MultiplicityExpressionMember'..')?ownedRelationship+=MultiplicityExpressionMember']' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceExposeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceExposeTextualNotationBuilder.cs index b39486ad..23d907dc 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceExposeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceExposeTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class NamespaceExposeTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public NamespaceExposeTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,16 @@ public NamespaceExposeTextualNotationBuilder(ITextualNotationBuilderFacade facad /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Views.NamespaceExpose poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : NamespaceExpose=NamespaceImport + + + + // non Terminal : NamespaceImport; Found rule NamespaceImport=importedNamespace=[QualifiedName]'::''*'('::'isRecursive?='**')?|importedNamespace=FilterPackage{ownedRelatedElement+=importedNamespace} + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceImportTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceImportTextualNotationBuilder.cs index e3c7988b..67559bb0 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceImportTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceImportTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class NamespaceImportTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public NamespaceImportTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,17 @@ public NamespaceImportTextualNotationBuilder(ITextualNotationBuilderFacade facad /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Root.Namespaces.NamespaceImport poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : NamespaceImport=importedNamespace=[QualifiedName]'::''*'('::'isRecursive?='**')?|importedNamespace=FilterPackage{ownedRelatedElement+=importedNamespace} + + // Assignment Element : importedNamespace = + stringBuilder.Append(":: "); + stringBuilder.Append("* "); + // Group Element + // Assignment Element : importedNamespace = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Assignment Element : ownedRelatedElement += importedNamespace + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs index 9826ab5b..b6d31697 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -46,7 +48,20 @@ public NamespaceTextualNotationBuilder(ITextualNotationBuilderFacade facade) : b /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Root.Namespaces.Namespace poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : Namespace=(ownedRelationship+=PrefixMetadataMember)*NamespaceDeclarationNamespaceBody + + + + // Group Element + // non Terminal : NamespaceDeclaration; Found rule NamespaceDeclaration:Namespace='namespace'Identification + + + // non Terminal : NamespaceBody; Found rule NamespaceBody:Namespace=';'|'{'NamespaceBodyElement*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NullExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NullExpressionTextualNotationBuilder.cs index dc9a2ba4..56fbbf50 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NullExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NullExpressionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class NullExpressionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public NullExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,14 @@ public NullExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.NullExpression poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : NullExpression:NullExpression='null'|'('')' + + stringBuilder.Append("null "); + stringBuilder.Append("( "); + stringBuilder.Append(") "); + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ObjectiveMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ObjectiveMembershipTextualNotationBuilder.cs index 1d345283..ff11b993 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ObjectiveMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ObjectiveMembershipTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class ObjectiveMembershipTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public ObjectiveMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,9 @@ public ObjectiveMembershipTextualNotationBuilder(ITextualNotationBuilderFacade f /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Cases.ObjectiveMembership poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs index 150bd0b3..6873371f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class OccurrenceDefinitionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public OccurrenceDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,19 @@ public OccurrenceDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Occurrences.OccurrenceDefinition poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : OccurrenceDefinition=OccurrenceDefinitionPrefix'occurrence''def'Definition + + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + + + stringBuilder.Append("occurrence "); + stringBuilder.Append("def "); + // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs index 4ffded5e..ceb2725b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class OccurrenceUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public OccurrenceUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,18 @@ public OccurrenceUsageTextualNotationBuilder(ITextualNotationBuilderFacade facad /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Occurrences.OccurrenceUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : OccurrenceUsage=OccurrenceUsagePrefix'occurrence'Usage + + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + + + stringBuilder.Append("occurrence "); + // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OperatorExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OperatorExpressionTextualNotationBuilder.cs index 8f42dec7..52d0c1b4 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OperatorExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OperatorExpressionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class OperatorExpressionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public OperatorExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,9 @@ public OperatorExpressionTextualNotationBuilder(ITextualNotationBuilderFacade fa /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.OperatorExpression poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs index 2ac702d5..07cc56bc 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class OwningMembershipTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public OwningMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,9 @@ public OwningMembershipTextualNotationBuilder(ITextualNotationBuilderFacade faca /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Root.Namespaces.OwningMembership poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs index bf9430be..71aea619 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class PackageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public PackageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,18 @@ public PackageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : bas /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Packages.Package poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : Package=(ownedRelationship+=PrefixMetadataMember)*PackageDeclarationPackageBody + + // Group Element + // non Terminal : PackageDeclaration; Found rule PackageDeclaration:Package='package'Identification + + + // non Terminal : PackageBody; Found rule PackageBody:Package=';'|'{'PackageBodyElement*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ParameterMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ParameterMembershipTextualNotationBuilder.cs index fdbb5a85..9d64fb11 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ParameterMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ParameterMembershipTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class ParameterMembershipTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public ParameterMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,9 @@ public ParameterMembershipTextualNotationBuilder(ITextualNotationBuilderFacade f /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Behaviors.ParameterMembership poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartDefinitionTextualNotationBuilder.cs index b2035ace..20d9546f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartDefinitionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class PartDefinitionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public PartDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,19 @@ public PartDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Parts.PartDefinition poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : PartDefinition=OccurrenceDefinitionPrefix'part''def'Definition + + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + + + stringBuilder.Append("part "); + stringBuilder.Append("def "); + // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartUsageTextualNotationBuilder.cs index 4029b06a..2252af43 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class PartUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public PartUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,20 @@ public PartUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : b /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Parts.PartUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : PartUsage=OccurrenceUsagePrefix'part'Usage + + + + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + + + stringBuilder.Append("part "); + // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PayloadFeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PayloadFeatureTextualNotationBuilder.cs index 0c2ce859..fa3ac495 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PayloadFeatureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PayloadFeatureTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class PayloadFeatureTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public PayloadFeatureTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,24 @@ public PayloadFeatureTextualNotationBuilder(ITextualNotationBuilderFacade facade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Interactions.PayloadFeature poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : PayloadFeature:Feature=Identification?PayloadFeatureSpecializationPartValuePart?|ownedRelationship+=OwnedFeatureTyping(ownedRelationship+=OwnedMultiplicity)?|ownedRelationship+=OwnedMultiplicityownedRelationship+=OwnedFeatureTyping + + // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? + + + // non Terminal : PayloadFeatureSpecializationPart; Found rule PayloadFeatureSpecializationPart:Feature=(FeatureSpecialization)+MultiplicityPart?FeatureSpecialization*|MultiplicityPartFeatureSpecialization+ + + + // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue + + + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PerformActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PerformActionUsageTextualNotationBuilder.cs index 6b4b19a5..44c02c21 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PerformActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PerformActionUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class PerformActionUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public PerformActionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,21 @@ public PerformActionUsageTextualNotationBuilder(ITextualNotationBuilderFacade fa /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.PerformActionUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : PerformActionUsage=OccurrenceUsagePrefix'perform'PerformActionUsageDeclarationActionBody + + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + + + stringBuilder.Append("perform "); + // non Terminal : PerformActionUsageDeclaration; Found rule PerformActionUsageDeclaration:PerformActionUsage=(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'action'UsageDeclaration)ValuePart? + + + // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortConjugationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortConjugationTextualNotationBuilder.cs index 9b135767..b6a7cf10 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortConjugationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortConjugationTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class PortConjugationTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public PortConjugationTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,11 @@ public PortConjugationTextualNotationBuilder(ITextualNotationBuilderFacade facad /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Ports.PortConjugation poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : PortConjugation={} + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortDefinitionTextualNotationBuilder.cs index d8afb8df..d443a055 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortDefinitionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class PortDefinitionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public PortDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,23 @@ public PortDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Ports.PortDefinition poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : PortDefinition=DefinitionPrefix'port''def'DefinitionownedRelationship+=ConjugatedPortDefinitionMember{conjugatedPortDefinition.ownedPortConjugator.originalPortDefinition=this} + + + + // non Terminal : DefinitionPrefix; Found rule DefinitionPrefix:Definition=BasicDefinitionPrefix?DefinitionExtensionKeyword* + + + stringBuilder.Append("port "); + stringBuilder.Append("def "); + // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody + + + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Assignment Element : conjugatedPortDefinition.ownedPortConjugator.originalPortDefinition = this + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs index 0767bb08..4a0d4854 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class PortUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public PortUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,18 @@ public PortUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : b /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Ports.PortUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : PortUsage=OccurrenceUsagePrefix'port'Usage + + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + + + stringBuilder.Append("port "); + // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PredicateTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PredicateTextualNotationBuilder.cs index e60633c5..b6e0ab28 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PredicateTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PredicateTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class PredicateTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public PredicateTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,23 @@ public PredicateTextualNotationBuilder(ITextualNotationBuilderFacade facade) : b /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Functions.Predicate poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : Predicate=TypePrefix'predicate'ClassifierDeclarationFunctionBody + + + + // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* + + + stringBuilder.Append("predicate "); + // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* + + + // non Terminal : FunctionBody; Found rule FunctionBody:Type=';'|'{'FunctionBodyPart'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs index 417bff22..c381fbd5 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class RedefinitionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public RedefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,31 @@ public RedefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Features.Redefinition poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : Redefinition=('specialization'Identification)?'redefinition'SpecificTypeREDEFINESGeneralTypeRelationshipBody + + // Group Element + stringBuilder.Append("redefinition "); + // non Terminal : SpecificType; Found rule SpecificType:Specialization=specific=[QualifiedName]|specific+=OwnedFeatureChain{ownedRelatedElement+=specific} + + + // non Terminal : REDEFINES; Found rule REDEFINES=':>>'|'redefines' + + + + + // non Terminal : GeneralType; Found rule GeneralType:Specialization=general=[QualifiedName]|general+=OwnedFeatureChain{ownedRelatedElement+=general} + + + + + // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' + + + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceSubsettingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceSubsettingTextualNotationBuilder.cs index 8f623a0f..378d2a3d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceSubsettingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceSubsettingTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class ReferenceSubsettingTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public ReferenceSubsettingTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,9 @@ public ReferenceSubsettingTextualNotationBuilder(ITextualNotationBuilderFacade f /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Features.ReferenceSubsetting poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs index 69cb2e00..19fb28fe 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class ReferenceUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public ReferenceUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,16 @@ public ReferenceUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.ReferenceUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : ReferenceUsage=(EndUsagePrefix|RefPrefix)'ref'Usage + + // Group Element + stringBuilder.Append("ref "); + // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingDefinitionTextualNotationBuilder.cs index 45e90e18..d68aeb78 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingDefinitionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class RenderingDefinitionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public RenderingDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,19 @@ public RenderingDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade f /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Views.RenderingDefinition poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : RenderingDefinition=OccurrenceDefinitionPrefix'rendering''def'Definition + + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + + + stringBuilder.Append("rendering "); + stringBuilder.Append("def "); + // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingUsageTextualNotationBuilder.cs index 3ee43fca..0093a76a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class RenderingUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public RenderingUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,20 @@ public RenderingUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Views.RenderingUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : RenderingUsage=OccurrenceUsagePrefix'rendering'Usage + + + + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + + + stringBuilder.Append("rendering "); + // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.cs index f677c608..3be5c9fa 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class RequirementConstraintMembershipTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public RequirementConstraintMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,9 @@ public RequirementConstraintMembershipTextualNotationBuilder(ITextualNotationBui /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Requirements.RequirementConstraintMembership poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementDefinitionTextualNotationBuilder.cs index f47ba59d..d891905f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementDefinitionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class RequirementDefinitionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public RequirementDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,22 @@ public RequirementDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Requirements.RequirementDefinition poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : RequirementDefinition=OccurrenceDefinitionPrefix'requirement''def'DefinitionDeclarationRequirementBody + + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + + + stringBuilder.Append("requirement "); + stringBuilder.Append("def "); + // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? + + + // non Terminal : RequirementBody; Found rule RequirementBody:Type=';'|'{'RequirementBodyItem*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementUsageTextualNotationBuilder.cs index 412d6708..b400dc7c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class RequirementUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public RequirementUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,25 @@ public RequirementUsageTextualNotationBuilder(ITextualNotationBuilderFacade faca /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Requirements.RequirementUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : RequirementUsage=OccurrenceUsagePrefix'requirement'ConstraintUsageDeclarationRequirementBody + + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + + + stringBuilder.Append("requirement "); + // non Terminal : ConstraintUsageDeclaration; Found rule ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? + + + + + + + // non Terminal : RequirementBody; Found rule RequirementBody:Type=';'|'{'RequirementBodyItem*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementVerificationMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementVerificationMembershipTextualNotationBuilder.cs index 532a4856..f4a28e3e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementVerificationMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementVerificationMembershipTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class RequirementVerificationMembershipTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public RequirementVerificationMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,9 @@ public RequirementVerificationMembershipTextualNotationBuilder(ITextualNotationB /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.VerificationCases.RequirementVerificationMembership poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ResultExpressionMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ResultExpressionMembershipTextualNotationBuilder.cs index c2fade6a..b4a3e1cd 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ResultExpressionMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ResultExpressionMembershipTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class ResultExpressionMembershipTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public ResultExpressionMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,9 @@ public ResultExpressionMembershipTextualNotationBuilder(ITextualNotationBuilderF /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Functions.ResultExpressionMembership poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReturnParameterMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReturnParameterMembershipTextualNotationBuilder.cs index 34b0c6c2..c4d4b05a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReturnParameterMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReturnParameterMembershipTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class ReturnParameterMembershipTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public ReturnParameterMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,9 @@ public ReturnParameterMembershipTextualNotationBuilder(ITextualNotationBuilderFa /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Functions.ReturnParameterMembership poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.cs index faaf6298..c6a117f2 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class SatisfyRequirementUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public SatisfyRequirementUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,25 @@ public SatisfyRequirementUsageTextualNotationBuilder(ITextualNotationBuilderFaca /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Requirements.SatisfyRequirementUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : SatisfyRequirementUsage=OccurrenceUsagePrefix'assert'(isNegated?='not')'satisfy'(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'requirement'UsageDeclaration)ValuePart?('by'ownedRelationship+=SatisfactionSubjectMember)?RequirementBody + + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + + + stringBuilder.Append("assert "); + // Group Element + stringBuilder.Append("satisfy "); + // Group Element + // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue + + + // Group Element + // non Terminal : RequirementBody; Found rule RequirementBody:Type=';'|'{'RequirementBodyItem*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SelectExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SelectExpressionTextualNotationBuilder.cs index 0248d379..95ad32bd 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SelectExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SelectExpressionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class SelectExpressionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public SelectExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,14 @@ public SelectExpressionTextualNotationBuilder(ITextualNotationBuilderFacade faca /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.SelectExpression poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : SelectExpression=ownedRelationship+=PrimaryArgumentMember'.?'ownedRelationship+=BodyArgumentMember + + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(".? "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.cs index 089e72df..d2ba96e3 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class SendActionUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public SendActionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,9 @@ public SendActionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facad /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.SendActionUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.cs index 8bcf649f..c2b7ad8d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class SpecializationTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public SpecializationTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,29 @@ public SpecializationTextualNotationBuilder(ITextualNotationBuilderFacade facade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Types.Specialization poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : Specialization=('specialization'Identification)?'subtype'SpecificTypeSPECIALIZESGeneralTypeRelationshipBody + + // Group Element + stringBuilder.Append("subtype "); + // non Terminal : SpecificType; Found rule SpecificType:Specialization=specific=[QualifiedName]|specific+=OwnedFeatureChain{ownedRelatedElement+=specific} + + + // non Terminal : SPECIALIZES; Found rule SPECIALIZES=':>'|'specializes' + + + // non Terminal : GeneralType; Found rule GeneralType:Specialization=general=[QualifiedName]|general+=OwnedFeatureChain{ownedRelatedElement+=general} + + + + + // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' + + + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StakeholderMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StakeholderMembershipTextualNotationBuilder.cs index 1166d807..a30fccb5 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StakeholderMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StakeholderMembershipTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class StakeholderMembershipTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public StakeholderMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,9 @@ public StakeholderMembershipTextualNotationBuilder(ITextualNotationBuilderFacade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Requirements.StakeholderMembership poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateDefinitionTextualNotationBuilder.cs index 595ab509..09f17f2e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateDefinitionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class StateDefinitionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public StateDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,22 @@ public StateDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facad /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.States.StateDefinition poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : StateDefinition=OccurrenceDefinitionPrefix'state''def'DefinitionDeclarationStateDefBody + + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + + + stringBuilder.Append("state "); + stringBuilder.Append("def "); + // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? + + + // non Terminal : StateDefBody; Found rule StateDefBody:StateDefinition=';'|(isParallel?='parallel')?'{'StateBodyItem*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateSubactionMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateSubactionMembershipTextualNotationBuilder.cs index 68e24065..d8693999 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateSubactionMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateSubactionMembershipTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class StateSubactionMembershipTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public StateSubactionMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,9 @@ public StateSubactionMembershipTextualNotationBuilder(ITextualNotationBuilderFac /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.States.StateSubactionMembership poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateUsageTextualNotationBuilder.cs index a8891cd8..29922472 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class StateUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public StateUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,21 @@ public StateUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.States.StateUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : StateUsage=OccurrenceUsagePrefix'state'ActionUsageDeclarationStateUsageBody + + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + + + stringBuilder.Append("state "); + // non Terminal : ActionUsageDeclaration; Found rule ActionUsageDeclaration:ActionUsage=UsageDeclarationValuePart? + + + // non Terminal : StateUsageBody; Found rule StateUsageBody:StateUsage=';'|(isParallel?='parallel')?'{'StateBodyItem*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StepTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StepTextualNotationBuilder.cs index 23a7d396..fc747a3a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StepTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StepTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class StepTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public StepTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,30 @@ public StepTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(f /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Behaviors.Step poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : Step=FeaturePrefix'step'FeatureDeclarationValuePart?TypeBody + + + + + + // non Terminal : FeaturePrefix; Found rule FeaturePrefix=(EndFeaturePrefix(ownedRelationship+=OwnedCrossFeatureMember)?|BasicFeaturePrefix)(ownedRelationship+=PrefixMetadataMember)* + + + + + stringBuilder.Append("step "); + // non Terminal : FeatureDeclaration; Found rule FeatureDeclaration:Feature=(isSufficient?='all')?(FeatureIdentification(FeatureSpecializationPart|ConjugationPart)?|FeatureSpecializationPart|ConjugationPart)FeatureRelationshipPart* + + + // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue + + + // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StructureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StructureTextualNotationBuilder.cs index c5be5072..12965dac 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StructureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StructureTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class StructureTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public StructureTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,23 @@ public StructureTextualNotationBuilder(ITextualNotationBuilderFacade facade) : b /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Structures.Structure poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : Structure=TypePrefix'struct'ClassifierDeclarationTypeBody + + + + // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* + + + stringBuilder.Append("struct "); + // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* + + + // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.cs index 2c1f46d7..33cdd0f8 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class SubclassificationTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public SubclassificationTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,23 @@ public SubclassificationTextualNotationBuilder(ITextualNotationBuilderFacade fac /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Classifiers.Subclassification poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : Subclassification=('specialization'Identification)?'subclassifier'subclassifier=[QualifiedName]SPECIALIZESsuperclassifier=[QualifiedName]RelationshipBody + + // Group Element + stringBuilder.Append("subclassifier "); + // Assignment Element : subclassifier = + // non Terminal : SPECIALIZES; Found rule SPECIALIZES=':>'|'specializes' + + + // Assignment Element : superclassifier = + // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' + + + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubjectMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubjectMembershipTextualNotationBuilder.cs index 098f9d64..2e048911 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubjectMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubjectMembershipTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class SubjectMembershipTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public SubjectMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,9 @@ public SubjectMembershipTextualNotationBuilder(ITextualNotationBuilderFacade fac /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Requirements.SubjectMembership poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.cs index 0a4ec260..13ea3ffa 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class SubsettingTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public SubsettingTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,29 @@ public SubsettingTextualNotationBuilder(ITextualNotationBuilderFacade facade) : /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Features.Subsetting poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : Subsetting=('specialization'Identification)?'subset'SpecificTypeSUBSETSGeneralTypeRelationshipBody + + // Group Element + stringBuilder.Append("subset "); + // non Terminal : SpecificType; Found rule SpecificType:Specialization=specific=[QualifiedName]|specific+=OwnedFeatureChain{ownedRelatedElement+=specific} + + + // non Terminal : SUBSETS; Found rule SUBSETS=':>'|'subsets' + + + // non Terminal : GeneralType; Found rule GeneralType:Specialization=general=[QualifiedName]|general+=OwnedFeatureChain{ownedRelatedElement+=general} + + + + + // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' + + + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionAsUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionAsUsageTextualNotationBuilder.cs index 4f273f55..0d22683a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionAsUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionAsUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class SuccessionAsUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public SuccessionAsUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,26 @@ public SuccessionAsUsageTextualNotationBuilder(ITextualNotationBuilderFacade fac /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Connections.SuccessionAsUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : SuccessionAsUsage=UsagePrefix('succession'UsageDeclaration)?'first's.ownedRelationship+=ConnectorEndMember'then's.ownedRelationship+=ConnectorEndMemberUsageBody + + + + + + // non Terminal : UsagePrefix; Found rule UsagePrefix:Usage=UnextendedUsagePrefixUsageExtensionKeyword* + + + // Group Element + stringBuilder.Append("first "); + // Assignment Element : s.ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append("then "); + // Assignment Element : s.ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // non Terminal : UsageBody; Found rule UsageBody:Usage=DefinitionBody + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowTextualNotationBuilder.cs index 1e9cc87d..91e59333 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class SuccessionFlowTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public SuccessionFlowTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,24 @@ public SuccessionFlowTextualNotationBuilder(ITextualNotationBuilderFacade facade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Interactions.SuccessionFlow poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : SuccessionFlow=FeaturePrefix'succession''flow'FlowDeclarationTypeBody + + // non Terminal : FeaturePrefix; Found rule FeaturePrefix=(EndFeaturePrefix(ownedRelationship+=OwnedCrossFeatureMember)?|BasicFeaturePrefix)(ownedRelationship+=PrefixMetadataMember)* + + + + + stringBuilder.Append("succession "); + stringBuilder.Append("flow "); + // non Terminal : FlowDeclaration; Found rule FlowDeclaration:FlowUsage=UsageDeclarationValuePart?('of'ownedRelationship+=FlowPayloadFeatureMember)?('from'ownedRelationship+=FlowEndMember'to'ownedRelationship+=FlowEndMember)?|ownedRelationship+=FlowEndMember'to'ownedRelationship+=FlowEndMember + + + // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowUsageTextualNotationBuilder.cs index 5affca57..130e3c6c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class SuccessionFlowUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public SuccessionFlowUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,22 @@ public SuccessionFlowUsageTextualNotationBuilder(ITextualNotationBuilderFacade f /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Flows.SuccessionFlowUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : SuccessionFlowUsage=OccurrenceUsagePrefix'succession''flow'FlowDeclarationDefinitionBody + + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + + + stringBuilder.Append("succession "); + stringBuilder.Append("flow "); + // non Terminal : FlowDeclaration; Found rule FlowDeclaration:FlowUsage=UsageDeclarationValuePart?('of'ownedRelationship+=FlowPayloadFeatureMember)?('from'ownedRelationship+=FlowEndMember'to'ownedRelationship+=FlowEndMember)?|ownedRelationship+=FlowEndMember'to'ownedRelationship+=FlowEndMember + + + // non Terminal : DefinitionBody; Found rule DefinitionBody:Type=';'|'{'DefinitionBodyItem*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionTextualNotationBuilder.cs index 6a44b58a..346ac701 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class SuccessionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public SuccessionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,27 @@ public SuccessionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Connectors.Succession poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : Succession=FeaturePrefix'succession'SuccessionDeclarationTypeBody + + // non Terminal : FeaturePrefix; Found rule FeaturePrefix=(EndFeaturePrefix(ownedRelationship+=OwnedCrossFeatureMember)?|BasicFeaturePrefix)(ownedRelationship+=PrefixMetadataMember)* + + + + + stringBuilder.Append("succession "); + // non Terminal : SuccessionDeclaration; Found rule SuccessionDeclaration:Succession=FeatureDeclaration('first'ownedRelationship+=ConnectorEndMember'then'ownedRelationship+=ConnectorEndMember)?|(s.isSufficient?='all')?('first'?ownedRelationship+=ConnectorEndMember'then'ownedRelationship+=ConnectorEndMember)? + + + + + + + // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TerminateActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TerminateActionUsageTextualNotationBuilder.cs index 0631c87b..e59cfd38 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TerminateActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TerminateActionUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class TerminateActionUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public TerminateActionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,9 @@ public TerminateActionUsageTextualNotationBuilder(ITextualNotationBuilderFacade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.TerminateActionUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TextualRepresentationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TextualRepresentationTextualNotationBuilder.cs index f1aaa69c..abc8bde5 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TextualRepresentationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TextualRepresentationTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class TextualRepresentationTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public TextualRepresentationTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,19 @@ public TextualRepresentationTextualNotationBuilder(ITextualNotationBuilderFacade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Root.Annotations.TextualRepresentation poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : TextualRepresentation=('rep'Identification)?'language'language=STRING_VALUEbody=REGULAR_COMMENT + + + + + + // Group Element + stringBuilder.Append("language "); + // Assignment Element : language = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Assignment Element : body = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionFeatureMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionFeatureMembershipTextualNotationBuilder.cs index e728d6a0..a848734b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionFeatureMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionFeatureMembershipTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class TransitionFeatureMembershipTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public TransitionFeatureMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,9 @@ public TransitionFeatureMembershipTextualNotationBuilder(ITextualNotationBuilder /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.States.TransitionFeatureMembership poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionUsageTextualNotationBuilder.cs index 304e45dd..d18e8571 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class TransitionUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public TransitionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,23 @@ public TransitionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facad /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.States.TransitionUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : TransitionUsage='transition'(UsageDeclaration'first')?ownedRelationship+=FeatureChainMemberownedRelationship+=EmptyParameterMember(ownedRelationship+=EmptyParameterMemberownedRelationship+=TriggerActionMember)?(ownedRelationship+=GuardExpressionMember)?(ownedRelationship+=EffectBehaviorMember)?'then'ownedRelationship+=TransitionSuccessionMemberActionBody + + stringBuilder.Append("transition "); + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Group Element + // Group Element + // Group Element + stringBuilder.Append("then "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TriggerInvocationExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TriggerInvocationExpressionTextualNotationBuilder.cs index f1936c2c..e92a2caf 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TriggerInvocationExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TriggerInvocationExpressionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class TriggerInvocationExpressionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public TriggerInvocationExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,9 @@ public TriggerInvocationExpressionTextualNotationBuilder(ITextualNotationBuilder /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.TriggerInvocationExpression poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeFeaturingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeFeaturingTextualNotationBuilder.cs index c1ef9236..a6c973f2 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeFeaturingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeFeaturingTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class TypeFeaturingTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public TypeFeaturingTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,21 @@ public TypeFeaturingTextualNotationBuilder(ITextualNotationBuilderFacade facade) /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Features.TypeFeaturing poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : TypeFeaturing='featuring'(Identification'of')?featureOfType=[QualifiedName]'by'featuringType=[QualifiedName]RelationshipBody + + stringBuilder.Append("featuring "); + // Group Element + // Assignment Element : featureOfType = + stringBuilder.Append("by "); + // Assignment Element : featuringType = + // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' + + + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs index f01befde..aa3cc3ed 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class TypeTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public TypeTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,21 @@ public TypeTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(f /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Types.Type poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : Type=TypePrefix'type'TypeDeclarationTypeBody + + // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* + + + stringBuilder.Append("type "); + // non Terminal : TypeDeclaration; Found rule TypeDeclaration:Type=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SpecializationPart|ConjugationPart)+TypeRelationshipPart* + + + // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UnioningTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UnioningTextualNotationBuilder.cs index a970c88e..4e722d83 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UnioningTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UnioningTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class UnioningTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public UnioningTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,13 @@ public UnioningTextualNotationBuilder(ITextualNotationBuilderFacade facade) : ba /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Types.Unioning poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : Unioning=unioningType=[QualifiedName]|ownedRelatedElement+=OwnedFeatureChain + + // Assignment Element : unioningType = + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs index 304340c6..484e83a5 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class UsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public UsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,17 @@ public UsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base( /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.Usage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : Usage=UsageDeclarationUsageCompletion + + // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? + + + // non Terminal : UsageCompletion; Found rule UsageCompletion:Usage=ValuePart?UsageBody + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseDefinitionTextualNotationBuilder.cs index aa84e885..c49f7b97 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseDefinitionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class UseCaseDefinitionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public UseCaseDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,23 @@ public UseCaseDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade fac /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.UseCases.UseCaseDefinition poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : UseCaseDefinition=OccurrenceDefinitionPrefix'use''case''def'DefinitionDeclarationCaseBody + + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + + + stringBuilder.Append("use "); + stringBuilder.Append("case "); + stringBuilder.Append("def "); + // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? + + + // non Terminal : CaseBody; Found rule CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseUsageTextualNotationBuilder.cs index eaccd628..752d5434 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class UseCaseUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public UseCaseUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,26 @@ public UseCaseUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.UseCases.UseCaseUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : UseCaseUsage=OccurrenceUsagePrefix'use''case'ConstraintUsageDeclarationCaseBody + + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + + + stringBuilder.Append("use "); + stringBuilder.Append("case "); + // non Terminal : ConstraintUsageDeclaration; Found rule ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? + + + + + + + // non Terminal : CaseBody; Found rule CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VariantMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VariantMembershipTextualNotationBuilder.cs index e5e7fbfd..23444e06 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VariantMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VariantMembershipTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class VariantMembershipTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public VariantMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,9 @@ public VariantMembershipTextualNotationBuilder(ITextualNotationBuilderFacade fac /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.VariantMembership poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseDefinitionTextualNotationBuilder.cs index 57667c78..425defbb 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseDefinitionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class VerificationCaseDefinitionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public VerificationCaseDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,22 @@ public VerificationCaseDefinitionTextualNotationBuilder(ITextualNotationBuilderF /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.VerificationCases.VerificationCaseDefinition poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : VerificationCaseDefinition=OccurrenceDefinitionPrefix'verification''def'DefinitionDeclarationCaseBody + + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + + + stringBuilder.Append("verification "); + stringBuilder.Append("def "); + // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? + + + // non Terminal : CaseBody; Found rule CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseUsageTextualNotationBuilder.cs index cc381b27..64bbaa09 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class VerificationCaseUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public VerificationCaseUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,25 @@ public VerificationCaseUsageTextualNotationBuilder(ITextualNotationBuilderFacade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.VerificationCases.VerificationCaseUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : VerificationCaseUsage=OccurrenceUsagePrefix'verification'ConstraintUsageDeclarationCaseBody + + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + + + stringBuilder.Append("verification "); + // non Terminal : ConstraintUsageDeclaration; Found rule ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? + + + + + + + // non Terminal : CaseBody; Found rule CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs index fe3b48de..0784a909 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class ViewDefinitionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public ViewDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,22 @@ public ViewDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Views.ViewDefinition poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : ViewDefinition=OccurrenceDefinitionPrefix'view''def'DefinitionDeclarationViewDefinitionBody + + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + + + stringBuilder.Append("view "); + stringBuilder.Append("def "); + // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? + + + // non Terminal : ViewDefinitionBody; Found rule ViewDefinitionBody:ViewDefinition=';'|'{'ViewDefinitionBodyItem*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewRenderingMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewRenderingMembershipTextualNotationBuilder.cs index fd6430a6..656522e1 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewRenderingMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewRenderingMembershipTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class ViewRenderingMembershipTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public ViewRenderingMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,9 @@ public ViewRenderingMembershipTextualNotationBuilder(ITextualNotationBuilderFaca /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Views.ViewRenderingMembership poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs index 294b7954..5da8be3a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class ViewUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public ViewUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,24 @@ public ViewUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : b /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Views.ViewUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : ViewUsage=OccurrenceUsagePrefix'view'UsageDeclaration?ValuePart?ViewBody + + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + + + stringBuilder.Append("view "); + // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? + + + // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue + + + // non Terminal : ViewBody; Found rule ViewBody:ViewUsage=';'|'{'ViewBodyItem*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointDefinitionTextualNotationBuilder.cs index f37f29b6..d5646706 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointDefinitionTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class ViewpointDefinitionTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public ViewpointDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,22 @@ public ViewpointDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade f /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Views.ViewpointDefinition poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : ViewpointDefinition=OccurrenceDefinitionPrefix'viewpoint''def'DefinitionDeclarationRequirementBody + + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + + + stringBuilder.Append("viewpoint "); + stringBuilder.Append("def "); + // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? + + + // non Terminal : RequirementBody; Found rule RequirementBody:Type=';'|'{'RequirementBodyItem*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointUsageTextualNotationBuilder.cs index c61212a5..727f0287 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class ViewpointUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public ViewpointUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,27 @@ public ViewpointUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Views.ViewpointUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + // Rule definition : ViewpointUsage=OccurrenceUsagePrefix'viewpoint'ConstraintUsageDeclarationRequirementBody + + + + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + + + stringBuilder.Append("viewpoint "); + // non Terminal : ConstraintUsageDeclaration; Found rule ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? + + + + + + + // non Terminal : RequirementBody; Found rule RequirementBody:Type=';'|'{'RequirementBodyItem*'}' + + + + return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/WhileLoopActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/WhileLoopActionUsageTextualNotationBuilder.cs index b3bb4567..d4f759d4 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/WhileLoopActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/WhileLoopActionUsageTextualNotationBuilder.cs @@ -24,6 +24,8 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Root.Elements; /// @@ -32,7 +34,7 @@ namespace SysML2.NET.TextualNotation public class WhileLoopActionUsageTextualNotationBuilder : TextualNotationBuilder { /// - /// Initializes a new instance of a + /// Initializes a new instance of a /// /// The used to query textual notation of referenced public WhileLoopActionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) @@ -46,7 +48,9 @@ public WhileLoopActionUsageTextualNotationBuilder(ITextualNotationBuilderFacade /// The built textual notation string public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.WhileLoopActionUsage poco) { - return string.Empty; + var stringBuilder = new StringBuilder(); + + return stringBuilder.ToString(); } } } From 129d6a35b94470a9caa4905d69b6e6612f23fa63 Mon Sep 17 00:00:00 2001 From: atheate Date: Fri, 20 Feb 2026 16:18:55 +0100 Subject: [PATCH 06/33] [WIP] Eased the value_literal on G4 --- Resources/kebnf.g4 | 2 +- .../NET/CodeGenerator/Grammar/kebnf.interp | 8 +- .../NET/CodeGenerator/Grammar/kebnf.tokens | 84 +++++---- .../NET/CodeGenerator/Grammar/kebnfLexer.cs | 163 +++++++++--------- .../CodeGenerator/Grammar/kebnfLexer.interp | 11 +- .../CodeGenerator/Grammar/kebnfLexer.tokens | 84 +++++---- .../NET/CodeGenerator/Grammar/kebnfParser.cs | 73 ++++---- 7 files changed, 194 insertions(+), 231 deletions(-) diff --git a/Resources/kebnf.g4 b/Resources/kebnf.g4 index b67c94d2..d059914a 100644 --- a/Resources/kebnf.g4 +++ b/Resources/kebnf.g4 @@ -73,7 +73,7 @@ dotted_id suffix_op : '*' | '+' | '?' ; -value_literal : ID | 'true' | 'false' | 'this' | INT | STRING | '[QualifiedName]' | SINGLE_QUOTED_STRING; +value_literal : ID | INT | STRING | '[QualifiedName]' | SINGLE_QUOTED_STRING; // Lexer ASSIGN : '::=' | '=' ; 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 index e16ea718..1291cb77 100644 --- a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnf.interp +++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnf.interp @@ -3,9 +3,6 @@ null '*' '+' '?' -'true' -'false' -'this' '[QualifiedName]' null '+=' @@ -38,9 +35,6 @@ null null null null -null -null -null ASSIGN ADD_ASSIGN BOOL_ASSIGN @@ -87,4 +81,4 @@ value_literal atn: -[4, 1, 31, 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, 8, 10, 1, 0, 8, 9, 1, 0, 1, 3, 2, 0, 4, 7, 24, 27, 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, 31, 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, 23, 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, 12, 0, 0, 52, 54, 5, 23, 0, 0, 53, 51, 1, 0, 0, 0, 53, 54, 1, 0, 0, 0, 54, 55, 1, 0, 0, 0, 55, 56, 5, 8, 0, 0, 56, 58, 3, 6, 3, 0, 57, 59, 5, 13, 0, 0, 58, 57, 1, 0, 0, 0, 58, 59, 1, 0, 0, 0, 59, 61, 1, 0, 0, 0, 60, 62, 5, 31, 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, 15, 0, 0, 66, 67, 5, 24, 0, 0, 67, 68, 5, 12, 0, 0, 68, 69, 5, 24, 0, 0, 69, 70, 5, 16, 0, 0, 70, 5, 1, 0, 0, 0, 71, 76, 3, 8, 4, 0, 72, 73, 5, 11, 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, 22, 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, 19, 0, 0, 105, 106, 3, 28, 14, 0, 106, 107, 7, 1, 0, 0, 107, 108, 3, 32, 16, 0, 108, 109, 5, 20, 0, 0, 109, 15, 1, 0, 0, 0, 110, 111, 5, 19, 0, 0, 111, 112, 5, 20, 0, 0, 112, 17, 1, 0, 0, 0, 113, 115, 5, 22, 0, 0, 114, 113, 1, 0, 0, 0, 114, 115, 1, 0, 0, 0, 115, 116, 1, 0, 0, 0, 116, 117, 5, 17, 0, 0, 117, 118, 5, 24, 0, 0, 118, 119, 5, 18, 0, 0, 119, 19, 1, 0, 0, 0, 120, 121, 5, 15, 0, 0, 121, 122, 3, 6, 3, 0, 122, 124, 5, 16, 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, 25, 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, 23, 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, 24, 0, 0, 142, 143, 5, 21, 0, 0, 143, 145, 5, 24, 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 +[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 index 07eb9f09..5c28d84e 100644 --- a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnf.tokens +++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnf.tokens @@ -2,51 +2,45 @@ T__0=1 T__1=2 T__2=3 T__3=4 -T__4=5 -T__5=6 -T__6=7 -ASSIGN=8 -ADD_ASSIGN=9 -BOOL_ASSIGN=10 -PIPE=11 -COLON=12 -SEMICOLON=13 -COMMA=14 -LPAREN=15 -RPAREN=16 -LBRACK=17 -RBRACK=18 -LBRACE=19 -RBRACE=20 -DOT=21 -TILDE=22 -UPPER_ID=23 -ID=24 -SINGLE_QUOTED_STRING=25 -INT=26 -STRING=27 -COMMENT=28 -WS=29 -CONTINUATION=30 -NL=31 +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 -'true'=4 -'false'=5 -'this'=6 -'[QualifiedName]'=7 -'+='=9 -'?='=10 -'|'=11 -':'=12 -';'=13 -','=14 -'('=15 -')'=16 -'['=17 -']'=18 -'{'=19 -'}'=20 -'.'=21 -'~'=22 +'[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/kebnfLexer.cs b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.cs index 42c8411d..bae07a49 100644 --- a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.cs +++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.cs @@ -34,11 +34,11 @@ 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, T__4=5, T__5=6, T__6=7, ASSIGN=8, ADD_ASSIGN=9, - BOOL_ASSIGN=10, PIPE=11, COLON=12, SEMICOLON=13, COMMA=14, LPAREN=15, - RPAREN=16, LBRACK=17, RBRACK=18, LBRACE=19, RBRACE=20, DOT=21, TILDE=22, - UPPER_ID=23, ID=24, SINGLE_QUOTED_STRING=25, INT=26, STRING=27, COMMENT=28, - WS=29, CONTINUATION=30, NL=31; + 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" }; @@ -48,11 +48,10 @@ public const int }; public static readonly string[] ruleNames = { - "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "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" + "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" }; @@ -66,16 +65,15 @@ public kebnfLexer(ICharStream input, TextWriter output, TextWriter errorOutput) } private static readonly string[] _LiteralNames = { - null, "'*'", "'+'", "'?'", "'true'", "'false'", "'this'", "'[QualifiedName]'", - null, "'+='", "'?='", "'|'", "':'", "';'", "','", "'('", "')'", "'['", - "']'", "'{'", "'}'", "'.'", "'~'" + null, "'*'", "'+'", "'?'", "'[QualifiedName]'", null, "'+='", "'?='", + "'|'", "':'", "';'", "','", "'('", "')'", "'['", "']'", "'{'", "'}'", + "'.'", "'~'" }; private static readonly string[] _SymbolicNames = { - null, null, null, 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" + 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); @@ -105,76 +103,69 @@ static kebnfLexer() { } } private static int[] _serializedATN = { - 4,0,31,212,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, + 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,2,28, - 7,28,2,29,7,29,2,30,7,30,1,0,1,0,1,1,1,1,1,2,1,2,1,3,1,3,1,3,1,3,1,3,1, - 4,1,4,1,4,1,4,1,4,1,4,1,5,1,5,1,5,1,5,1,5,1,6,1,6,1,6,1,6,1,6,1,6,1,6, - 1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,7,1,7,1,7,1,7,3,7,106,8,7,1,8,1, - 8,1,8,1,9,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,1,20,1,20,1,21,1,21,1, - 22,1,22,5,22,140,8,22,10,22,12,22,143,9,22,1,23,1,23,5,23,147,8,23,10, - 23,12,23,150,9,23,1,24,1,24,1,24,1,24,5,24,156,8,24,10,24,12,24,159,9, - 24,1,24,1,24,1,25,4,25,164,8,25,11,25,12,25,165,1,26,1,26,1,26,1,26,5, - 26,172,8,26,10,26,12,26,175,9,26,1,26,1,26,1,27,1,27,1,27,1,27,5,27,183, - 8,27,10,27,12,27,186,9,27,1,27,1,27,1,28,4,28,191,8,28,11,28,12,28,192, - 1,28,1,28,1,29,3,29,198,8,29,1,29,1,29,4,29,202,8,29,11,29,12,29,203,1, - 29,1,29,1,30,3,30,209,8,30,1,30,1,30,0,0,31,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,57,29,59,30,61,31, - 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,224,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,0,57, - 1,0,0,0,0,59,1,0,0,0,0,61,1,0,0,0,1,63,1,0,0,0,3,65,1,0,0,0,5,67,1,0,0, - 0,7,69,1,0,0,0,9,74,1,0,0,0,11,80,1,0,0,0,13,85,1,0,0,0,15,105,1,0,0,0, - 17,107,1,0,0,0,19,110,1,0,0,0,21,113,1,0,0,0,23,115,1,0,0,0,25,117,1,0, - 0,0,27,119,1,0,0,0,29,121,1,0,0,0,31,123,1,0,0,0,33,125,1,0,0,0,35,127, - 1,0,0,0,37,129,1,0,0,0,39,131,1,0,0,0,41,133,1,0,0,0,43,135,1,0,0,0,45, - 137,1,0,0,0,47,144,1,0,0,0,49,151,1,0,0,0,51,163,1,0,0,0,53,167,1,0,0, - 0,55,178,1,0,0,0,57,190,1,0,0,0,59,197,1,0,0,0,61,208,1,0,0,0,63,64,5, - 42,0,0,64,2,1,0,0,0,65,66,5,43,0,0,66,4,1,0,0,0,67,68,5,63,0,0,68,6,1, - 0,0,0,69,70,5,116,0,0,70,71,5,114,0,0,71,72,5,117,0,0,72,73,5,101,0,0, - 73,8,1,0,0,0,74,75,5,102,0,0,75,76,5,97,0,0,76,77,5,108,0,0,77,78,5,115, - 0,0,78,79,5,101,0,0,79,10,1,0,0,0,80,81,5,116,0,0,81,82,5,104,0,0,82,83, - 5,105,0,0,83,84,5,115,0,0,84,12,1,0,0,0,85,86,5,91,0,0,86,87,5,81,0,0, - 87,88,5,117,0,0,88,89,5,97,0,0,89,90,5,108,0,0,90,91,5,105,0,0,91,92,5, - 102,0,0,92,93,5,105,0,0,93,94,5,101,0,0,94,95,5,100,0,0,95,96,5,78,0,0, - 96,97,5,97,0,0,97,98,5,109,0,0,98,99,5,101,0,0,99,100,5,93,0,0,100,14, - 1,0,0,0,101,102,5,58,0,0,102,103,5,58,0,0,103,106,5,61,0,0,104,106,5,61, - 0,0,105,101,1,0,0,0,105,104,1,0,0,0,106,16,1,0,0,0,107,108,5,43,0,0,108, - 109,5,61,0,0,109,18,1,0,0,0,110,111,5,63,0,0,111,112,5,61,0,0,112,20,1, - 0,0,0,113,114,5,124,0,0,114,22,1,0,0,0,115,116,5,58,0,0,116,24,1,0,0,0, - 117,118,5,59,0,0,118,26,1,0,0,0,119,120,5,44,0,0,120,28,1,0,0,0,121,122, - 5,40,0,0,122,30,1,0,0,0,123,124,5,41,0,0,124,32,1,0,0,0,125,126,5,91,0, - 0,126,34,1,0,0,0,127,128,5,93,0,0,128,36,1,0,0,0,129,130,5,123,0,0,130, - 38,1,0,0,0,131,132,5,125,0,0,132,40,1,0,0,0,133,134,5,46,0,0,134,42,1, - 0,0,0,135,136,5,126,0,0,136,44,1,0,0,0,137,141,7,0,0,0,138,140,7,1,0,0, - 139,138,1,0,0,0,140,143,1,0,0,0,141,139,1,0,0,0,141,142,1,0,0,0,142,46, - 1,0,0,0,143,141,1,0,0,0,144,148,7,2,0,0,145,147,7,1,0,0,146,145,1,0,0, - 0,147,150,1,0,0,0,148,146,1,0,0,0,148,149,1,0,0,0,149,48,1,0,0,0,150,148, - 1,0,0,0,151,157,5,39,0,0,152,156,8,3,0,0,153,154,5,92,0,0,154,156,9,0, - 0,0,155,152,1,0,0,0,155,153,1,0,0,0,156,159,1,0,0,0,157,155,1,0,0,0,157, - 158,1,0,0,0,158,160,1,0,0,0,159,157,1,0,0,0,160,161,5,39,0,0,161,50,1, - 0,0,0,162,164,7,4,0,0,163,162,1,0,0,0,164,165,1,0,0,0,165,163,1,0,0,0, - 165,166,1,0,0,0,166,52,1,0,0,0,167,173,5,39,0,0,168,172,8,3,0,0,169,170, - 5,92,0,0,170,172,9,0,0,0,171,168,1,0,0,0,171,169,1,0,0,0,172,175,1,0,0, - 0,173,171,1,0,0,0,173,174,1,0,0,0,174,176,1,0,0,0,175,173,1,0,0,0,176, - 177,5,39,0,0,177,54,1,0,0,0,178,179,5,47,0,0,179,180,5,47,0,0,180,184, - 1,0,0,0,181,183,8,5,0,0,182,181,1,0,0,0,183,186,1,0,0,0,184,182,1,0,0, - 0,184,185,1,0,0,0,185,187,1,0,0,0,186,184,1,0,0,0,187,188,6,27,0,0,188, - 56,1,0,0,0,189,191,7,6,0,0,190,189,1,0,0,0,191,192,1,0,0,0,192,190,1,0, - 0,0,192,193,1,0,0,0,193,194,1,0,0,0,194,195,6,28,0,0,195,58,1,0,0,0,196, - 198,5,13,0,0,197,196,1,0,0,0,197,198,1,0,0,0,198,199,1,0,0,0,199,201,5, - 10,0,0,200,202,7,6,0,0,201,200,1,0,0,0,202,203,1,0,0,0,203,201,1,0,0,0, - 203,204,1,0,0,0,204,205,1,0,0,0,205,206,6,29,0,0,206,60,1,0,0,0,207,209, - 5,13,0,0,208,207,1,0,0,0,208,209,1,0,0,0,209,210,1,0,0,0,210,211,5,10, - 0,0,211,62,1,0,0,0,14,0,105,141,148,155,157,165,171,173,184,192,197,203, - 208,1,6,0,0 + 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 = 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 index 72caecf6..753b3d36 100644 --- a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.interp +++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.interp @@ -3,9 +3,6 @@ null '*' '+' '?' -'true' -'false' -'this' '[QualifiedName]' null '+=' @@ -38,9 +35,6 @@ null null null null -null -null -null ASSIGN ADD_ASSIGN BOOL_ASSIGN @@ -71,9 +65,6 @@ T__0 T__1 T__2 T__3 -T__4 -T__5 -T__6 ASSIGN ADD_ASSIGN BOOL_ASSIGN @@ -107,4 +98,4 @@ mode names: DEFAULT_MODE atn: -[4, 0, 31, 212, 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, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 106, 8, 7, 1, 8, 1, 8, 1, 8, 1, 9, 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, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 5, 22, 140, 8, 22, 10, 22, 12, 22, 143, 9, 22, 1, 23, 1, 23, 5, 23, 147, 8, 23, 10, 23, 12, 23, 150, 9, 23, 1, 24, 1, 24, 1, 24, 1, 24, 5, 24, 156, 8, 24, 10, 24, 12, 24, 159, 9, 24, 1, 24, 1, 24, 1, 25, 4, 25, 164, 8, 25, 11, 25, 12, 25, 165, 1, 26, 1, 26, 1, 26, 1, 26, 5, 26, 172, 8, 26, 10, 26, 12, 26, 175, 9, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 5, 27, 183, 8, 27, 10, 27, 12, 27, 186, 9, 27, 1, 27, 1, 27, 1, 28, 4, 28, 191, 8, 28, 11, 28, 12, 28, 192, 1, 28, 1, 28, 1, 29, 3, 29, 198, 8, 29, 1, 29, 1, 29, 4, 29, 202, 8, 29, 11, 29, 12, 29, 203, 1, 29, 1, 29, 1, 30, 3, 30, 209, 8, 30, 1, 30, 1, 30, 0, 0, 31, 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, 57, 29, 59, 30, 61, 31, 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, 224, 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, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 1, 63, 1, 0, 0, 0, 3, 65, 1, 0, 0, 0, 5, 67, 1, 0, 0, 0, 7, 69, 1, 0, 0, 0, 9, 74, 1, 0, 0, 0, 11, 80, 1, 0, 0, 0, 13, 85, 1, 0, 0, 0, 15, 105, 1, 0, 0, 0, 17, 107, 1, 0, 0, 0, 19, 110, 1, 0, 0, 0, 21, 113, 1, 0, 0, 0, 23, 115, 1, 0, 0, 0, 25, 117, 1, 0, 0, 0, 27, 119, 1, 0, 0, 0, 29, 121, 1, 0, 0, 0, 31, 123, 1, 0, 0, 0, 33, 125, 1, 0, 0, 0, 35, 127, 1, 0, 0, 0, 37, 129, 1, 0, 0, 0, 39, 131, 1, 0, 0, 0, 41, 133, 1, 0, 0, 0, 43, 135, 1, 0, 0, 0, 45, 137, 1, 0, 0, 0, 47, 144, 1, 0, 0, 0, 49, 151, 1, 0, 0, 0, 51, 163, 1, 0, 0, 0, 53, 167, 1, 0, 0, 0, 55, 178, 1, 0, 0, 0, 57, 190, 1, 0, 0, 0, 59, 197, 1, 0, 0, 0, 61, 208, 1, 0, 0, 0, 63, 64, 5, 42, 0, 0, 64, 2, 1, 0, 0, 0, 65, 66, 5, 43, 0, 0, 66, 4, 1, 0, 0, 0, 67, 68, 5, 63, 0, 0, 68, 6, 1, 0, 0, 0, 69, 70, 5, 116, 0, 0, 70, 71, 5, 114, 0, 0, 71, 72, 5, 117, 0, 0, 72, 73, 5, 101, 0, 0, 73, 8, 1, 0, 0, 0, 74, 75, 5, 102, 0, 0, 75, 76, 5, 97, 0, 0, 76, 77, 5, 108, 0, 0, 77, 78, 5, 115, 0, 0, 78, 79, 5, 101, 0, 0, 79, 10, 1, 0, 0, 0, 80, 81, 5, 116, 0, 0, 81, 82, 5, 104, 0, 0, 82, 83, 5, 105, 0, 0, 83, 84, 5, 115, 0, 0, 84, 12, 1, 0, 0, 0, 85, 86, 5, 91, 0, 0, 86, 87, 5, 81, 0, 0, 87, 88, 5, 117, 0, 0, 88, 89, 5, 97, 0, 0, 89, 90, 5, 108, 0, 0, 90, 91, 5, 105, 0, 0, 91, 92, 5, 102, 0, 0, 92, 93, 5, 105, 0, 0, 93, 94, 5, 101, 0, 0, 94, 95, 5, 100, 0, 0, 95, 96, 5, 78, 0, 0, 96, 97, 5, 97, 0, 0, 97, 98, 5, 109, 0, 0, 98, 99, 5, 101, 0, 0, 99, 100, 5, 93, 0, 0, 100, 14, 1, 0, 0, 0, 101, 102, 5, 58, 0, 0, 102, 103, 5, 58, 0, 0, 103, 106, 5, 61, 0, 0, 104, 106, 5, 61, 0, 0, 105, 101, 1, 0, 0, 0, 105, 104, 1, 0, 0, 0, 106, 16, 1, 0, 0, 0, 107, 108, 5, 43, 0, 0, 108, 109, 5, 61, 0, 0, 109, 18, 1, 0, 0, 0, 110, 111, 5, 63, 0, 0, 111, 112, 5, 61, 0, 0, 112, 20, 1, 0, 0, 0, 113, 114, 5, 124, 0, 0, 114, 22, 1, 0, 0, 0, 115, 116, 5, 58, 0, 0, 116, 24, 1, 0, 0, 0, 117, 118, 5, 59, 0, 0, 118, 26, 1, 0, 0, 0, 119, 120, 5, 44, 0, 0, 120, 28, 1, 0, 0, 0, 121, 122, 5, 40, 0, 0, 122, 30, 1, 0, 0, 0, 123, 124, 5, 41, 0, 0, 124, 32, 1, 0, 0, 0, 125, 126, 5, 91, 0, 0, 126, 34, 1, 0, 0, 0, 127, 128, 5, 93, 0, 0, 128, 36, 1, 0, 0, 0, 129, 130, 5, 123, 0, 0, 130, 38, 1, 0, 0, 0, 131, 132, 5, 125, 0, 0, 132, 40, 1, 0, 0, 0, 133, 134, 5, 46, 0, 0, 134, 42, 1, 0, 0, 0, 135, 136, 5, 126, 0, 0, 136, 44, 1, 0, 0, 0, 137, 141, 7, 0, 0, 0, 138, 140, 7, 1, 0, 0, 139, 138, 1, 0, 0, 0, 140, 143, 1, 0, 0, 0, 141, 139, 1, 0, 0, 0, 141, 142, 1, 0, 0, 0, 142, 46, 1, 0, 0, 0, 143, 141, 1, 0, 0, 0, 144, 148, 7, 2, 0, 0, 145, 147, 7, 1, 0, 0, 146, 145, 1, 0, 0, 0, 147, 150, 1, 0, 0, 0, 148, 146, 1, 0, 0, 0, 148, 149, 1, 0, 0, 0, 149, 48, 1, 0, 0, 0, 150, 148, 1, 0, 0, 0, 151, 157, 5, 39, 0, 0, 152, 156, 8, 3, 0, 0, 153, 154, 5, 92, 0, 0, 154, 156, 9, 0, 0, 0, 155, 152, 1, 0, 0, 0, 155, 153, 1, 0, 0, 0, 156, 159, 1, 0, 0, 0, 157, 155, 1, 0, 0, 0, 157, 158, 1, 0, 0, 0, 158, 160, 1, 0, 0, 0, 159, 157, 1, 0, 0, 0, 160, 161, 5, 39, 0, 0, 161, 50, 1, 0, 0, 0, 162, 164, 7, 4, 0, 0, 163, 162, 1, 0, 0, 0, 164, 165, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 165, 166, 1, 0, 0, 0, 166, 52, 1, 0, 0, 0, 167, 173, 5, 39, 0, 0, 168, 172, 8, 3, 0, 0, 169, 170, 5, 92, 0, 0, 170, 172, 9, 0, 0, 0, 171, 168, 1, 0, 0, 0, 171, 169, 1, 0, 0, 0, 172, 175, 1, 0, 0, 0, 173, 171, 1, 0, 0, 0, 173, 174, 1, 0, 0, 0, 174, 176, 1, 0, 0, 0, 175, 173, 1, 0, 0, 0, 176, 177, 5, 39, 0, 0, 177, 54, 1, 0, 0, 0, 178, 179, 5, 47, 0, 0, 179, 180, 5, 47, 0, 0, 180, 184, 1, 0, 0, 0, 181, 183, 8, 5, 0, 0, 182, 181, 1, 0, 0, 0, 183, 186, 1, 0, 0, 0, 184, 182, 1, 0, 0, 0, 184, 185, 1, 0, 0, 0, 185, 187, 1, 0, 0, 0, 186, 184, 1, 0, 0, 0, 187, 188, 6, 27, 0, 0, 188, 56, 1, 0, 0, 0, 189, 191, 7, 6, 0, 0, 190, 189, 1, 0, 0, 0, 191, 192, 1, 0, 0, 0, 192, 190, 1, 0, 0, 0, 192, 193, 1, 0, 0, 0, 193, 194, 1, 0, 0, 0, 194, 195, 6, 28, 0, 0, 195, 58, 1, 0, 0, 0, 196, 198, 5, 13, 0, 0, 197, 196, 1, 0, 0, 0, 197, 198, 1, 0, 0, 0, 198, 199, 1, 0, 0, 0, 199, 201, 5, 10, 0, 0, 200, 202, 7, 6, 0, 0, 201, 200, 1, 0, 0, 0, 202, 203, 1, 0, 0, 0, 203, 201, 1, 0, 0, 0, 203, 204, 1, 0, 0, 0, 204, 205, 1, 0, 0, 0, 205, 206, 6, 29, 0, 0, 206, 60, 1, 0, 0, 0, 207, 209, 5, 13, 0, 0, 208, 207, 1, 0, 0, 0, 208, 209, 1, 0, 0, 0, 209, 210, 1, 0, 0, 0, 210, 211, 5, 10, 0, 0, 211, 62, 1, 0, 0, 0, 14, 0, 105, 141, 148, 155, 157, 165, 171, 173, 184, 192, 197, 203, 208, 1, 6, 0, 0] \ No newline at end of file +[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 index 07eb9f09..5c28d84e 100644 --- a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.tokens +++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.tokens @@ -2,51 +2,45 @@ T__0=1 T__1=2 T__2=3 T__3=4 -T__4=5 -T__5=6 -T__6=7 -ASSIGN=8 -ADD_ASSIGN=9 -BOOL_ASSIGN=10 -PIPE=11 -COLON=12 -SEMICOLON=13 -COMMA=14 -LPAREN=15 -RPAREN=16 -LBRACK=17 -RBRACK=18 -LBRACE=19 -RBRACE=20 -DOT=21 -TILDE=22 -UPPER_ID=23 -ID=24 -SINGLE_QUOTED_STRING=25 -INT=26 -STRING=27 -COMMENT=28 -WS=29 -CONTINUATION=30 -NL=31 +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 -'true'=4 -'false'=5 -'this'=6 -'[QualifiedName]'=7 -'+='=9 -'?='=10 -'|'=11 -':'=12 -';'=13 -','=14 -'('=15 -')'=16 -'['=17 -']'=18 -'{'=19 -'}'=20 -'.'=21 -'~'=22 +'[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/kebnfParser.cs b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfParser.cs index 8aa8cab1..7cfb9dad 100644 --- a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfParser.cs +++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfParser.cs @@ -37,11 +37,11 @@ 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, T__4=5, T__5=6, T__6=7, ASSIGN=8, ADD_ASSIGN=9, - BOOL_ASSIGN=10, PIPE=11, COLON=12, SEMICOLON=13, COMMA=14, LPAREN=15, - RPAREN=16, LBRACK=17, RBRACK=18, LBRACE=19, RBRACE=20, DOT=21, TILDE=22, - UPPER_ID=23, ID=24, SINGLE_QUOTED_STRING=25, INT=26, STRING=27, COMMENT=28, - WS=29, CONTINUATION=30, NL=31; + 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, @@ -56,16 +56,15 @@ public const int }; private static readonly string[] _LiteralNames = { - null, "'*'", "'+'", "'?'", "'true'", "'false'", "'this'", "'[QualifiedName]'", - null, "'+='", "'?='", "'|'", "':'", "';'", "','", "'('", "')'", "'['", - "']'", "'{'", "'}'", "'.'", "'~'" + null, "'*'", "'+'", "'?'", "'[QualifiedName]'", null, "'+='", "'?='", + "'|'", "':'", "';'", "','", "'('", "')'", "'['", "']'", "'{'", "'}'", + "'.'", "'~'" }; private static readonly string[] _SymbolicNames = { - null, null, null, 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" + 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); @@ -480,7 +479,7 @@ public AlternativeContext alternative() { State = 82; ErrorHandler.Sync(this); _la = TokenStream.LA(1); - while ((((_la) & ~0x3f) == 0 && ((1L << _la) & 264929520L) != 0)) { + while ((((_la) & ~0x3f) == 0 && ((1L << _la) & 33116176L) != 0)) { { { State = 79; @@ -684,7 +683,7 @@ public AssignmentContext assignment() { State = 96; _localctx.op = TokenStream.LT(1); _la = TokenStream.LA(1); - if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 1792L) != 0)) ) { + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 224L) != 0)) ) { _localctx.op = ErrorHandler.RecoverInline(this); } else { @@ -1369,7 +1368,7 @@ public Value_literalContext value_literal() { { State = 151; _la = TokenStream.LA(1); - if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 251658480L) != 0)) ) { + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 31457296L) != 0)) ) { ErrorHandler.RecoverInline(this); } else { @@ -1390,7 +1389,7 @@ public Value_literalContext value_literal() { } private static int[] _serializedATN = { - 4,1,31,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, + 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, @@ -1401,40 +1400,40 @@ public Value_literalContext value_literal() { 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,8,10,1,0,8,9,1,0,1,3, - 2,0,4,7,24,27,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, + 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,31,0,0,35,34, + 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,23,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,12,0,0,52,54, - 5,23,0,0,53,51,1,0,0,0,53,54,1,0,0,0,54,55,1,0,0,0,55,56,5,8,0,0,56,58, - 3,6,3,0,57,59,5,13,0,0,58,57,1,0,0,0,58,59,1,0,0,0,59,61,1,0,0,0,60,62, - 5,31,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,15,0,0,66,67,5,24,0,0,67,68,5,12,0,0,68,69,5,24,0,0,69, - 70,5,16,0,0,70,5,1,0,0,0,71,76,3,8,4,0,72,73,5,11,0,0,73,75,3,8,4,0,74, + 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,22,0,0,98,97,1,0,0,0,98,99,1, + 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,19,0,0,105,106,3,28,14,0,106, - 107,7,1,0,0,107,108,3,32,16,0,108,109,5,20,0,0,109,15,1,0,0,0,110,111, - 5,19,0,0,111,112,5,20,0,0,112,17,1,0,0,0,113,115,5,22,0,0,114,113,1,0, - 0,0,114,115,1,0,0,0,115,116,1,0,0,0,116,117,5,17,0,0,117,118,5,24,0,0, - 118,119,5,18,0,0,119,19,1,0,0,0,120,121,5,15,0,0,121,122,3,6,3,0,122,124, - 5,16,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,25,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,23,0,0,131,133,3,30,15,0,132,131,1,0,0,0,132, + 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,24,0,0,142,143,5,21,0,0,143,145,5,24,0,0,144,142,1,0,0,0,145, + 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 From c8ed9e462604a28f3217a5908e7d788eb17090e0 Mon Sep 17 00:00:00 2001 From: atheate Date: Wed, 25 Feb 2026 14:09:26 +0100 Subject: [PATCH 07/33] [WIP] All rules have method, some logic put on rule Element processing --- .../Extensions/NamedElementExtensions.cs | 33 + .../UmlCoreTextualNotationBuilderGenerator.cs | 41 +- .../Grammar/Model/Alternatives.cs | 18 +- .../Grammar/Model/AssignmentElement.cs | 2 +- .../Grammar/Model/GroupElement.cs | 4 +- .../Grammar/Model/TextualNotationRule.cs | 8 +- .../TextualNotationSpecificationVisitor.cs | 32 +- .../HandleBarHelpers/NamedElementHelper.cs | 10 + .../HandleBarHelpers/RulesHelper.cs | 146 +++- ...core-textual-notation-builder-template.hbs | 40 +- ...AcceptActionUsageTextualNotationBuilder.cs | 100 ++- .../ActionDefinitionTextualNotationBuilder.cs | 40 +- .../ActionUsageTextualNotationBuilder.cs | 147 +++- .../ActorMembershipTextualNotationBuilder.cs | 27 +- ...ocationDefinitionTextualNotationBuilder.cs | 35 +- .../AllocationUsageTextualNotationBuilder.cs | 43 +- ...sisCaseDefinitionTextualNotationBuilder.cs | 40 +- ...AnalysisCaseUsageTextualNotationBuilder.cs | 48 +- ...AnnotatingElementTextualNotationBuilder.cs | 47 +- .../AnnotationTextualNotationBuilder.cs | 44 +- ...rtConstraintUsageTextualNotationBuilder.cs | 41 +- ...gnmentActionUsageTextualNotationBuilder.cs | 53 +- ...ociationStructureTextualNotationBuilder.cs | 44 +- .../AssociationTextualNotationBuilder.cs | 40 +- ...tributeDefinitionTextualNotationBuilder.cs | 35 +- .../AttributeUsageTextualNotationBuilder.cs | 37 +- .../BehaviorTextualNotationBuilder.cs | 42 +- ...gConnectorAsUsageTextualNotationBuilder.cs | 43 +- .../BindingConnectorTextualNotationBuilder.cs | 47 +- ...BooleanExpressionTextualNotationBuilder.cs | 49 +- ...ulationDefinitionTextualNotationBuilder.cs | 40 +- .../CalculationUsageTextualNotationBuilder.cs | 40 +- .../CaseDefinitionTextualNotationBuilder.cs | 40 +- .../CaseUsageTextualNotationBuilder.cs | 46 +- .../ClassTextualNotationBuilder.cs | 42 +- .../ClassifierTextualNotationBuilder.cs | 83 +- ...CollectExpressionTextualNotationBuilder.cs | 27 +- .../CommentTextualNotationBuilder.cs | 44 +- ...ConcernDefinitionTextualNotationBuilder.cs | 40 +- .../ConcernUsageTextualNotationBuilder.cs | 47 +- ...tedPortDefinitionTextualNotationBuilder.cs | 26 +- ...jugatedPortTypingTextualNotationBuilder.cs | 41 +- .../ConjugationTextualNotationBuilder.cs | 52 +- ...nectionDefinitionTextualNotationBuilder.cs | 35 +- .../ConnectionUsageTextualNotationBuilder.cs | 68 +- .../ConnectorTextualNotationBuilder.cs | 78 +- ...straintDefinitionTextualNotationBuilder.cs | 40 +- .../ConstraintUsageTextualNotationBuilder.cs | 58 +- ...tructorExpressionTextualNotationBuilder.cs | 27 +- ...s => ControlNodeTextualNotationBuilder.cs} | 27 +- .../CrossSubsettingTextualNotationBuilder.cs | 25 +- .../DataTypeTextualNotationBuilder.cs | 42 +- .../DecisionNodeTextualNotationBuilder.cs | 41 +- .../DefinitionTextualNotationBuilder.cs | 76 +- .../DependencyTextualNotationBuilder.cs | 64 +- .../DifferencingTextualNotationBuilder.cs | 31 +- .../DisjoiningTextualNotationBuilder.cs | 43 +- .../DocumentationTextualNotationBuilder.cs | 37 +- ...tFilterMembershipTextualNotationBuilder.cs | 34 +- .../ElementTextualNotationBuilder.cs | 105 +++ ...FeatureMembershipTextualNotationBuilder.cs | 67 +- ...erationDefinitionTextualNotationBuilder.cs | 41 +- .../EnumerationUsageTextualNotationBuilder.cs | 43 +- ...ntOccurrenceUsageTextualNotationBuilder.cs | 43 +- ...ExhibitStateUsageTextualNotationBuilder.cs | 45 +- .../ExposeTextualNotationBuilder.cs | 56 ++ .../ExpressionTextualNotationBuilder.cs | 121 ++- ...reChainExpressionTextualNotationBuilder.cs | 27 +- .../FeatureChainingTextualNotationBuilder.cs | 25 +- ...tureDirectionKindTextualNotationBuilder.cs | 51 ++ .../FeatureInvertingTextualNotationBuilder.cs | 43 +- ...FeatureMembershipTextualNotationBuilder.cs | 397 +++++++++- ...ferenceExpressionTextualNotationBuilder.cs | 67 +- .../FeatureTextualNotationBuilder.cs | 658 +++++++++++++++- .../FeatureTypingTextualNotationBuilder.cs | 56 +- .../FeatureValueTextualNotationBuilder.cs | 155 +++- .../FlowDefinitionTextualNotationBuilder.cs | 35 +- .../FlowEndTextualNotationBuilder.cs | 29 +- .../FlowTextualNotationBuilder.cs | 44 +- .../FlowUsageTextualNotationBuilder.cs | 67 +- ...orLoopActionUsageTextualNotationBuilder.cs | 33 +- .../ForkNodeTextualNotationBuilder.cs | 43 +- ...ConcernMembershipTextualNotationBuilder.cs | 28 +- .../FunctionTextualNotationBuilder.cs | 40 +- .../IfActionUsageTextualNotationBuilder.cs | 33 +- .../ImportTextualNotationBuilder.cs | 73 ++ ...cludeUseCaseUsageTextualNotationBuilder.cs | 47 +- .../IndexExpressionTextualNotationBuilder.cs | 27 +- .../InteractionTextualNotationBuilder.cs | 42 +- ...terfaceDefinitionTextualNotationBuilder.cs | 40 +- .../InterfaceUsageTextualNotationBuilder.cs | 81 +- .../IntersectingTextualNotationBuilder.cs | 29 +- .../InvariantTextualNotationBuilder.cs | 56 +- ...ocationExpressionTextualNotationBuilder.cs | 42 +- .../ItemDefinitionTextualNotationBuilder.cs | 35 +- .../ItemUsageTextualNotationBuilder.cs | 37 +- .../JoinNodeTextualNotationBuilder.cs | 41 +- .../LibraryPackageTextualNotationBuilder.cs | 41 +- .../LiteralBooleanTextualNotationBuilder.cs | 26 +- ...LiteralExpressionTextualNotationBuilder.cs | 46 +- .../LiteralInfinityTextualNotationBuilder.cs | 29 +- .../LiteralIntegerTextualNotationBuilder.cs | 26 +- .../LiteralStringTextualNotationBuilder.cs | 26 +- .../MembershipExposeTextualNotationBuilder.cs | 30 +- .../MembershipImportTextualNotationBuilder.cs | 32 +- .../MembershipTextualNotationBuilder.cs | 105 ++- .../MergeNodeTextualNotationBuilder.cs | 41 +- .../MetaclassTextualNotationBuilder.cs | 40 +- ...aAccessExpressionTextualNotationBuilder.cs | 29 +- ...etadataDefinitionTextualNotationBuilder.cs | 38 +- .../MetadataFeatureTextualNotationBuilder.cs | 66 +- .../MetadataUsageTextualNotationBuilder.cs | 66 +- ...MultiplicityRangeTextualNotationBuilder.cs | 53 +- .../MultiplicityTextualNotationBuilder.cs | 48 +- .../NamespaceExposeTextualNotationBuilder.cs | 32 +- .../NamespaceImportTextualNotationBuilder.cs | 33 +- .../NamespaceTextualNotationBuilder.cs | 71 +- .../NullExpressionTextualNotationBuilder.cs | 30 +- ...jectiveMembershipTextualNotationBuilder.cs | 28 +- ...urrenceDefinitionTextualNotationBuilder.cs | 64 +- .../OccurrenceUsageTextualNotationBuilder.cs | 108 ++- ...peratorExpressionTextualNotationBuilder.cs | 166 +++- .../OwningMembershipTextualNotationBuilder.cs | 231 +++++- .../PackageTextualNotationBuilder.cs | 73 +- ...rameterMembershipTextualNotationBuilder.cs | 210 ++++- .../PartDefinitionTextualNotationBuilder.cs | 35 +- .../PartUsageTextualNotationBuilder.cs | 55 +- .../PayloadFeatureTextualNotationBuilder.cs | 40 +- ...erformActionUsageTextualNotationBuilder.cs | 71 +- .../PortConjugationTextualNotationBuilder.cs | 25 +- .../PortDefinitionTextualNotationBuilder.cs | 38 +- .../PortUsageTextualNotationBuilder.cs | 57 +- .../PortionKindTextualNotationBuilder.cs | 51 ++ .../PredicateTextualNotationBuilder.cs | 42 +- .../RedefinitionTextualNotationBuilder.cs | 76 +- ...ferenceSubsettingTextualNotationBuilder.cs | 26 +- .../ReferenceUsageTextualNotationBuilder.cs | 241 +++++- .../RelationshipTextualNotationBuilder.cs | 62 ++ ...nderingDefinitionTextualNotationBuilder.cs | 35 +- .../RenderingUsageTextualNotationBuilder.cs | 38 +- ...straintMembershipTextualNotationBuilder.cs | 32 +- ...irementDefinitionTextualNotationBuilder.cs | 40 +- .../RequirementUsageTextualNotationBuilder.cs | 60 +- ...icationMembershipTextualNotationBuilder.cs | 29 +- ...ressionMembershipTextualNotationBuilder.cs | 27 +- ...rameterMembershipTextualNotationBuilder.cs | 60 +- ...yRequirementUsageTextualNotationBuilder.cs | 52 +- .../SelectExpressionTextualNotationBuilder.cs | 27 +- .../SendActionUsageTextualNotationBuilder.cs | 85 ++- .../SpecializationTextualNotationBuilder.cs | 76 +- ...eholderMembershipTextualNotationBuilder.cs | 27 +- .../StateDefinitionTextualNotationBuilder.cs | 41 +- ...bactionMembershipTextualNotationBuilder.cs | 53 +- .../StateUsageTextualNotationBuilder.cs | 41 +- .../StepTextualNotationBuilder.cs | 53 +- .../StructureTextualNotationBuilder.cs | 42 +- ...SubclassificationTextualNotationBuilder.cs | 50 +- ...SubjectMembershipTextualNotationBuilder.cs | 30 +- .../SubsettingTextualNotationBuilder.cs | 54 +- ...SuccessionAsUsageTextualNotationBuilder.cs | 64 +- .../SuccessionFlowTextualNotationBuilder.cs | 44 +- ...ccessionFlowUsageTextualNotationBuilder.cs | 40 +- .../SuccessionTextualNotationBuilder.cs | 62 +- ...minateActionUsageTextualNotationBuilder.cs | 32 +- .../TextualNotationBuilderFacade.cs | 722 ------------------ ...ualRepresentationTextualNotationBuilder.cs | 35 +- ...FeatureMembershipTextualNotationBuilder.cs | 47 +- .../TransitionUsageTextualNotationBuilder.cs | 118 ++- ...ocationExpressionTextualNotationBuilder.cs | 25 +- .../TypeFeaturingTextualNotationBuilder.cs | 47 +- .../TypeTextualNotationBuilder.cs | 418 +++++++++- .../UnioningTextualNotationBuilder.cs | 29 +- .../UsageTextualNotationBuilder.cs | 276 ++++++- ...UseCaseDefinitionTextualNotationBuilder.cs | 40 +- .../UseCaseUsageTextualNotationBuilder.cs | 46 +- ...VariantMembershipTextualNotationBuilder.cs | 33 +- ...ionCaseDefinitionTextualNotationBuilder.cs | 40 +- ...ficationCaseUsageTextualNotationBuilder.cs | 46 +- .../ViewDefinitionTextualNotationBuilder.cs | 50 +- ...nderingMembershipTextualNotationBuilder.cs | 28 +- .../ViewUsageTextualNotationBuilder.cs | 55 +- ...ewpointDefinitionTextualNotationBuilder.cs | 40 +- .../ViewpointUsageTextualNotationBuilder.cs | 46 +- .../VisibilityKindTextualNotationBuilder.cs | 51 ++ ...leLoopActionUsageTextualNotationBuilder.cs | 33 +- ...jugatedPortTypingTextualNotationBuilder.cs | 41 + ...FeatureMembershipTextualNotationBuilder.cs | 41 + .../TextualNotation/TextualNotationBuilder.cs | 52 -- 188 files changed, 7226 insertions(+), 4466 deletions(-) rename SysML2.NET/TextualNotation/ITextualNotationBuilderFacade.cs => SysML2.NET.CodeGenerator/Grammar/Model/Alternatives.cs (57%) rename SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/{LiteralRationalTextualNotationBuilder.cs => ControlNodeTextualNotationBuilder.cs} (56%) create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExposeTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureDirectionKindTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ImportTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortionKindTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RelationshipTextualNotationBuilder.cs delete mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TextualNotationBuilderFacade.cs create mode 100644 SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VisibilityKindTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/ConjugatedPortTypingTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/FeatureMembershipTextualNotationBuilder.cs delete mode 100644 SysML2.NET/TextualNotation/TextualNotationBuilder.cs diff --git a/SysML2.NET.CodeGenerator/Extensions/NamedElementExtensions.cs b/SysML2.NET.CodeGenerator/Extensions/NamedElementExtensions.cs index 402bc345..9bea96a6 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/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGenerator.cs b/SysML2.NET.CodeGenerator/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGenerator.cs index fd82343a..9b45ddb9 100644 --- a/SysML2.NET.CodeGenerator/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGenerator.cs +++ b/SysML2.NET.CodeGenerator/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGenerator.cs @@ -29,6 +29,7 @@ namespace SysML2.NET.CodeGenerator.Generators.UmlHandleBarsGenerators using SysML2.NET.CodeGenerator.Grammar.Model; using SysML2.NET.CodeGenerator.HandleBarHelpers; + using uml4net.CommonStructure; using uml4net.Extensions; using uml4net.HandleBars; using uml4net.StructuredClassifiers; @@ -104,11 +105,11 @@ public override Task GenerateAsync(XmiReaderResult xmiReaderResult, DirectoryInf public async Task GenerateAsync(XmiReaderResult xmiReaderResult, TextualNotationSpecification textualNotationSpecification, DirectoryInfo outputDirectory) { await this.GenerateBuilderClasses(xmiReaderResult, textualNotationSpecification, outputDirectory); - await this.GenerateBuilderFacade(xmiReaderResult, outputDirectory); + // await this.GenerateBuilderFacade(xmiReaderResult, outputDirectory); } /// - /// Generates Textual Notation builder classes for each concrete + /// Generates Textual Notation builder classes for each targeted by a rule /// /// /// the that contains the UML model to generate from @@ -131,7 +132,7 @@ private Task GenerateBuilderClasses(XmiReaderResult xmiReaderResult, TextualNota } /// - /// Generates Textual Notation builder classes for each concrete + /// Generates Textual Notation builder classes for each targeted by a rule /// /// /// the that contains the UML model to generate from @@ -147,17 +148,39 @@ private async Task GenerateBuilderClassesInternal(XmiReaderResult xmiReaderResul { var template = this.Templates[BuilderTemplateName]; - var classes = xmiReaderResult.QueryContainedAndImported("SysML") - .SelectMany(x => x.PackagedElement.OfType()) - .Where(x => !x.IsAbstract) + var namedElements = xmiReaderResult.QueryContainedAndImported("SysML") + .SelectMany(x => x.PackagedElement.OfType()) .ToList(); - foreach (var umlClass in classes) + 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 generatedBuilder = template(new {ClassContext = umlClass, Rules = textualNotationSpecification.Rules}); + 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 = $"{umlClass.Name.CapitalizeFirstLetter()}TextualNotationBuilder.cs"; + var fileName = $"{targetClassContext.Name.CapitalizeFirstLetter()}TextualNotationBuilder.cs"; await WriteAsync(generatedBuilder, outputDirectory, fileName); } diff --git a/SysML2.NET/TextualNotation/ITextualNotationBuilderFacade.cs b/SysML2.NET.CodeGenerator/Grammar/Model/Alternatives.cs similarity index 57% rename from SysML2.NET/TextualNotation/ITextualNotationBuilderFacade.cs rename to SysML2.NET.CodeGenerator/Grammar/Model/Alternatives.cs index a290d58f..7ea1b61d 100644 --- a/SysML2.NET/TextualNotation/ITextualNotationBuilderFacade.cs +++ b/SysML2.NET.CodeGenerator/Grammar/Model/Alternatives.cs @@ -1,5 +1,5 @@ // ------------------------------------------------------------------------------------------------- -// +// // // Copyright 2022-2026 Starion Group S.A. // @@ -18,20 +18,20 @@ // // ------------------------------------------------------------------------------------------------ -namespace SysML2.NET.TextualNotation +namespace SysML2.NET.CodeGenerator.Grammar { - using SysML2.NET.Core.POCO.Root.Elements; + using System.Collections.Generic; + + using SysML2.NET.CodeGenerator.Grammar.Model; /// - /// The provides access to built textual notation for via + /// Provides mapping data class for the alternative grammar part /// - public interface ITextualNotationBuilderFacade + public class Alternatives { /// - /// Queries the Textual Notation of an + /// Gets a collection of that is part of the /// - /// The to built textual notation from - /// The built textual notation string - string QueryTextualNotationOfElement(IElement element); + public List Elements { get; } = []; } } diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/AssignmentElement.cs b/SysML2.NET.CodeGenerator/Grammar/Model/AssignmentElement.cs index 719dd5d2..32219bc4 100644 --- a/SysML2.NET.CodeGenerator/Grammar/Model/AssignmentElement.cs +++ b/SysML2.NET.CodeGenerator/Grammar/Model/AssignmentElement.cs @@ -43,6 +43,6 @@ public class AssignmentElement: RuleElement /// /// Gets or sets an optional prefix /// - public string Prefix { get; set; } + public string Prefix { get; set; } } } diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/GroupElement.cs b/SysML2.NET.CodeGenerator/Grammar/Model/GroupElement.cs index c6fb5b1a..820bbf6f 100644 --- a/SysML2.NET.CodeGenerator/Grammar/Model/GroupElement.cs +++ b/SysML2.NET.CodeGenerator/Grammar/Model/GroupElement.cs @@ -28,8 +28,8 @@ namespace SysML2.NET.CodeGenerator.Grammar.Model public class GroupElement: RuleElement { /// - /// All that are part of the group + /// Gets the collection that are part of the /// - public List Elements { get; } = []; + public List Alternatives { get; } = []; } } diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/TextualNotationRule.cs b/SysML2.NET.CodeGenerator/Grammar/Model/TextualNotationRule.cs index f60a6273..22811eac 100644 --- a/SysML2.NET.CodeGenerator/Grammar/Model/TextualNotationRule.cs +++ b/SysML2.NET.CodeGenerator/Grammar/Model/TextualNotationRule.cs @@ -43,13 +43,13 @@ public class TextualNotationRule public RuleParameter Parameter { get; set; } /// - /// Gets the collection of defined + /// Gets or sets the raw string that declares the rule /// - public List Elements { get; } = []; + public string RawRule { get; set; } /// - /// Gets or sets the raw string that declares the rule + /// Gets or the collection of defined by the rule /// - public string RawRule { get; set; } + public List Alternatives { get; } = []; } } diff --git a/SysML2.NET.CodeGenerator/Grammar/TextualNotationSpecificationVisitor.cs b/SysML2.NET.CodeGenerator/Grammar/TextualNotationSpecificationVisitor.cs index 5eb07260..aeeeb1b8 100644 --- a/SysML2.NET.CodeGenerator/Grammar/TextualNotationSpecificationVisitor.cs +++ b/SysML2.NET.CodeGenerator/Grammar/TextualNotationSpecificationVisitor.cs @@ -54,7 +54,7 @@ public override object VisitRule_definition(kebnfParser.Rule_definitionContext c { RuleName = context.name.Text, TargetElementName = context.target_ast?.Text, - RawRule = context.GetText() + RawRule = context.GetText().Trim() }; if (string.IsNullOrWhiteSpace(rule.RuleName)) @@ -71,7 +71,7 @@ public override object VisitRule_definition(kebnfParser.Rule_definitionContext c }; } - rule.Elements.AddRange((List)this.Visit(context.rule_body)); + rule.Alternatives.AddRange((IEnumerable)this.Visit(context.rule_body)); return rule; } @@ -79,10 +79,10 @@ public override object VisitRule_definition(kebnfParser.Rule_definitionContext c /// Visit a parse tree produced by . /// /// The parse tree. - /// The visitor result, as a collection of + /// The visitor result, as an public override object VisitAlternatives(kebnfParser.AlternativesContext context) { - return context.alternative().Select(a => (Alternatives)this.Visit(a)).SelectMany(x => x.Elements.Where(e => e!=null)).ToList(); + return context.alternative().Select(a => (Alternatives)this.Visit(a)); } /// @@ -93,7 +93,7 @@ public override object VisitAlternatives(kebnfParser.AlternativesContext context public override object VisitAlternative(kebnfParser.AlternativeContext context) { var alternatives = new Alternatives(); - alternatives.Elements.AddRange(context.element().Select(e => (RuleElement)this.Visit(e))); + alternatives.Elements.AddRange(context.element().Select(e => (RuleElement)this.Visit(e)).Where(x => x != null)); return alternatives; } @@ -106,7 +106,7 @@ public override object VisitAssignment(kebnfParser.AssignmentContext context) { return new AssignmentElement() { - Property = context.property.GetText(), + Property = context.property.GetText().Split(".")[^1], Operator = context.op.Text, Suffix = context.suffix?.GetText(), Value = (RuleElement)this.Visit(context.content), @@ -131,10 +131,6 @@ public override object VisitNon_parsing_assignment(kebnfParser.Non_parsing_assig /// /// Visit a parse tree produced by . - /// - /// The default implementation returns the result of calling - /// on . - /// /// /// The parse tree. /// The visitor result. @@ -153,12 +149,13 @@ public override object VisitValue_literal(kebnfParser.Value_literalContext conte /// The visitor result, as . public override object VisitGroup(kebnfParser.GroupContext context) { - var group = new GroupElement() + var group = new GroupElement { Suffix = context.suffix?.GetText(), }; + + group.Alternatives.AddRange((IEnumerable)this.Visit(context.alternatives())); - group.Elements.AddRange((List)this.Visit(context.alternatives())); return group; } @@ -189,16 +186,5 @@ public override object VisitNon_terminal(kebnfParser.Non_terminalContext context Suffix = context.suffix?.GetText() }; } - - /// - /// Provides mapping data class for the alternative grammar part - /// - private class Alternatives - { - /// - /// Gets a collection of that is part of the - /// - public List Elements { get; } = []; - } } } diff --git a/SysML2.NET.CodeGenerator/HandleBarHelpers/NamedElementHelper.cs b/SysML2.NET.CodeGenerator/HandleBarHelpers/NamedElementHelper.cs index 2705fd89..1a7e63dc 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 index cddeef09..6165d7dc 100644 --- a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs +++ b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs @@ -26,8 +26,12 @@ namespace SysML2.NET.CodeGenerator.HandleBarHelpers using HandlebarsDotNet; + using SysML2.NET.CodeGenerator.Extensions; + using SysML2.NET.CodeGenerator.Grammar; using SysML2.NET.CodeGenerator.Grammar.Model; + using uml4net.CommonStructure; + using uml4net.Extensions; using uml4net.StructuredClassifiers; /// @@ -41,63 +45,133 @@ public static class RulesHelper /// The context with which the helper needs to be registered public static void RegisterRulesHelper(this IHandlebars handlebars) { - handlebars.RegisterHelper("RulesHelper.WriteForPoco", (writer, _, arguments) => + handlebars.RegisterHelper("RulesHelper.WriteRule", (writer, _, arguments) => { - if (arguments.Length != 2) + if (arguments.Length != 3) { - throw new ArgumentException("RulesHelper.WriteForPoco expects to have 2 arguments"); + throw new ArgumentException("RulesHelper.WriteRule expects to have 3 arguments"); } - if (arguments[0] is not IClass umlClass) + if (arguments[0] is not TextualNotationRule textualRule) { - throw new ArgumentException("RulesHelper.WriteForPoco expects IClass as first argument"); + throw new ArgumentException("RulesHelper.WriteRule expects TextualNotationRule as first argument"); } - if (arguments[1] is not List rules) + if (arguments[1] is not INamedElement namedElement) { - throw new ArgumentException("RulesHelper.WriteForPoco expects a list of TextualNotationRule as second argument"); + throw new ArgumentException("RulesHelper.WriteRule expects INamedElement as second argument"); } - - var canonicalRule = rules.SingleOrDefault(x => x.RuleName == umlClass.Name); - if (canonicalRule == null) + if (arguments[2] is not List allRules) { - return; + throw new ArgumentException("RulesHelper.WriteRule expects a list of TextualNotationRule as third argument"); } - writer.WriteSafeString($"// Rule definition : {canonicalRule.RawRule}"); - WriteForRule(writer, umlClass, canonicalRule, rules); + if (namedElement is IClass umlClass) + { + ProcessAlternatives(writer, umlClass, textualRule.Alternatives, allRules); + } }); } - private static void WriteForRule(EncodedTextWriter writer, IClass umlClass, TextualNotationRule textualRule, List rules) + /// + /// Processes a collection of a + /// + /// The used to write into output content + /// The related + /// The collection of alternatives to process + /// A collection of all existing rules + private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClass, IReadOnlyCollection alternatives, IReadOnlyCollection rules) { - foreach (var textualRuleElement in textualRule.Elements) + if (alternatives.Count == 1) { - switch (textualRuleElement) + foreach (var textualRuleElement in alternatives.ElementAt(0).Elements) { - case TerminalElement terminalElement: - writer.WriteSafeString($"stringBuilder.Append(\"{terminalElement.Value} \");"); - break; - case NonTerminalElement nonTerminalElement: - var referencedRule = rules.SingleOrDefault(x => x.RuleName == nonTerminalElement.Name); - writer.WriteSafeString($"// non Terminal : {nonTerminalElement.Name}; Found rule {referencedRule?.RawRule}"); - break; - case GroupElement groupElement: - writer.WriteSafeString("// Group Element "); - break; - case AssignmentElement assignmentElement: - writer.WriteSafeString($"// Assignment Element : {assignmentElement.Property} {assignmentElement.Operator} {assignmentElement.Value}"); - break; - case NonParsingAssignmentElement nonParsingAssignmentElement: - writer.WriteSafeString($"// Assignment Element : {nonParsingAssignmentElement.PropertyName} {nonParsingAssignmentElement.Operator} {nonParsingAssignmentElement.Value}"); - break; - default: - throw new ArgumentException("Unknown element type"); + ProcessRuleElement(writer, umlClass, rules, textualRuleElement); } - - writer.WriteSafeString(Environment.NewLine); } + else + { + writer.WriteSafeString("throw new System.NotSupportedException(\"Multiple alternatives not implemented yet\");"); + } + } + + /// + /// Processes a + /// + /// The used to write into output content + /// The related + /// A collection of all existing rules + /// The to process + /// If the type of the is not supported + private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass, IReadOnlyCollection rules, RuleElement textualRuleElement) + { + switch (textualRuleElement) + { + case TerminalElement terminalElement: + writer.WriteSafeString($"stringBuilder.Append(\"{terminalElement.Value} \");"); + break; + case NonTerminalElement nonTerminalElement: + var referencedRule = rules.Single(x => x.RuleName == nonTerminalElement.Name); + var typeTarget = referencedRule.TargetElementName ?? referencedRule.RuleName; + writer.WriteSafeString($"// non Terminal : {nonTerminalElement.Name}; Found rule {referencedRule.RawRule} {Environment.NewLine}"); + + if (typeTarget != umlClass.Name) + { + var targetType = umlClass.Cache.Values.OfType().SingleOrDefault(x => x.Name == typeTarget); + + if (targetType != null) + { + if (targetType is IClass targetClass && umlClass.QueryAllGeneralClassifiers().Contains(targetClass)) + { + writer.WriteSafeString($"{targetType.Name}TextualNotationBuilder.Build{referencedRule.RuleName}(poco, stringBuilder);"); + } + else + { + ProcessAlternatives(writer, umlClass, referencedRule.Alternatives, rules); + } + } + else + { + ProcessAlternatives(writer, umlClass, referencedRule.Alternatives, rules); + } + } + else + { + writer.WriteSafeString($"Build{referencedRule.RuleName}(poco, stringBuilder);"); + } + + break; + case GroupElement groupElement: + writer.WriteSafeString($"// Group Element{Environment.NewLine}"); + ProcessAlternatives(writer, umlClass, groupElement.Alternatives, rules); + break; + case AssignmentElement assignmentElement: + writer.WriteSafeString($"// Assignment Element : {assignmentElement.Property} {assignmentElement.Operator} {assignmentElement.Value}{Environment.NewLine}"); + var properties = umlClass.QueryAllProperties(); + var targetProperty = properties.SingleOrDefault(x => string.Equals(x.Name, assignmentElement.Property, StringComparison.OrdinalIgnoreCase)); + + if (targetProperty != null) + { + writer.WriteSafeString($"// If property {targetProperty.Name} value is set, print {assignmentElement.Value}"); + } + else + { + writer.WriteSafeString($"Build{assignmentElement.Property.CapitalizeFirstLetter()}(poco, stringBuilder);"); + } + + break; + case NonParsingAssignmentElement nonParsingAssignmentElement: + writer.WriteSafeString($"// Assignment Element : {nonParsingAssignmentElement.PropertyName} {nonParsingAssignmentElement.Operator} {nonParsingAssignmentElement.Value}"); + break; + case ValueLiteralElement valueLiteralElement: + writer.WriteSafeString($"// Value Literal Element : {valueLiteralElement.Value}"); + break; + default: + throw new ArgumentException("Unknown element type"); + } + + writer.WriteSafeString(Environment.NewLine); } } } 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 index 0797bc83..ae78deaf 100644 --- a/SysML2.NET.CodeGenerator/Templates/Uml/core-textual-notation-builder-template.hbs +++ b/SysML2.NET.CodeGenerator/Templates/Uml/core-textual-notation-builder-template.hbs @@ -1,5 +1,5 @@ // ------------------------------------------------------------------------------------------------- -// +// // // Copyright 2022-2026 Starion Group S.A. // @@ -29,29 +29,25 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class {{this.ClassContext.Name}}TextualNotationBuilder: TextualNotationBuilder + public static partial class {{this.Context.Name}}TextualNotationBuilder { - /// - /// Initializes a new instance of a - /// - /// The used to query textual notation of referenced - public {{this.ClassContext.Name}}TextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) - { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.{{ #NamedElement.WriteFullyQualifiedNameSpace this.ClassContext }}.{{ this.ClassContext.Name }} poco) - { - var stringBuilder = new StringBuilder(); - {{RulesHelper.WriteForPoco this.ClassContext this.Rules}} - return stringBuilder.ToString(); - } + {{#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}} } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.cs index 18473811..21bc64aa 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.cs @@ -29,28 +29,106 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class AcceptActionUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class AcceptActionUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule AcceptNode + /// AcceptNode:AcceptActionUsage=OccurrenceUsagePrefixAcceptNodeDeclarationActionBody /// - /// The used to query textual notation of referenced - public AcceptActionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + // non Terminal : AcceptNodeDeclaration; Found rule AcceptNodeDeclaration:AcceptActionUsage=ActionNodeUsageDeclaration?'accept'AcceptParameterPart + BuildAcceptNodeDeclaration(poco, stringBuilder); + // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' + 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) + { + // non Terminal : ActionNodeUsageDeclaration; Found rule ActionNodeUsageDeclaration:ActionUsage='action'UsageDeclaration? + ActionUsageTextualNotationBuilder.BuildActionNodeUsageDeclaration(poco, stringBuilder); + stringBuilder.Append("accept "); + // non Terminal : AcceptParameterPart; Found rule AcceptParameterPart:AcceptActionUsage=ownedRelationship+=PayloadParameterMember('via'ownedRelationship+=NodeParameterMember)? + 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) + { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Group Element + stringBuilder.Append("via "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule StateAcceptActionUsage + /// StateAcceptActionUsage:AcceptActionUsage=AcceptNodeDeclarationActionBody /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.AcceptActionUsage poco) + /// 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) { - var stringBuilder = new StringBuilder(); + // non Terminal : AcceptNodeDeclaration; Found rule AcceptNodeDeclaration:AcceptActionUsage=ActionNodeUsageDeclaration?'accept'AcceptParameterPart + BuildAcceptNodeDeclaration(poco, stringBuilder); + // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' + 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) + { + // non Terminal : AcceptParameterPart; Found rule AcceptParameterPart:AcceptActionUsage=ownedRelationship+=PayloadParameterMember('via'ownedRelationship+=NodeParameterMember)? + 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) + { + // non Terminal : AcceptNodeDeclaration; Found rule AcceptNodeDeclaration:AcceptActionUsage=ActionNodeUsageDeclaration?'accept'AcceptParameterPart + BuildAcceptNodeDeclaration(poco, stringBuilder); + // Group Element + stringBuilder.Append("{ "); + // non Terminal : ActionBodyItem; Found rule ActionBodyItem:Type=NonBehaviorBodyItem|ownedRelationship+=InitialNodeMember(ownedRelationship+=ActionTargetSuccessionMember)*|(ownedRelationship+=SourceSuccessionMember)?ownedRelationship+=ActionBehaviorMember(ownedRelationship+=ActionTargetSuccessionMember)*|ownedRelationship+=GuardedSuccessionMember + TypeTextualNotationBuilder.BuildActionBodyItem(poco, stringBuilder); + stringBuilder.Append("} "); + - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionDefinitionTextualNotationBuilder.cs index 778d2465..5dec7aa8 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionDefinitionTextualNotationBuilder.cs @@ -29,41 +29,27 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class ActionDefinitionTextualNotationBuilder : TextualNotationBuilder + public static partial class ActionDefinitionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule ActionDefinition + /// ActionDefinition=OccurrenceDefinitionPrefix'action''def'DefinitionDeclarationActionBody /// - /// The used to query textual notation of referenced - public ActionDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.ActionDefinition poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : ActionDefinition=OccurrenceDefinitionPrefix'action''def'DefinitionDeclarationActionBody - - - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* - + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("action "); stringBuilder.Append("def "); - // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? - - - // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' - - + // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); + // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' + TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs index 544a83a7..e6d8375b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs @@ -29,40 +29,157 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class ActionUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class ActionUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule ActionUsageDeclaration + /// ActionUsageDeclaration:ActionUsage=UsageDeclarationValuePart? /// - /// The used to query textual notation of referenced - public ActionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue + 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 "); + // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule ActionNodePrefix + /// ActionNodePrefix:ActionUsage=OccurrenceUsagePrefixActionNodeUsageDeclaration? /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.ActionUsage poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : ActionUsage=OccurrenceUsagePrefix'action'ActionUsageDeclarationActionBody + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + // non Terminal : ActionNodeUsageDeclaration; Found rule ActionNodeUsageDeclaration:ActionUsage='action'UsageDeclaration? + BuildActionNodeUsageDeclaration(poco, stringBuilder); - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + } + /// + /// 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) + { + // Group Element + // non Terminal : ActionNodeUsageDeclaration; Found rule ActionNodeUsageDeclaration:ActionUsage='action'UsageDeclaration? + BuildActionNodeUsageDeclaration(poco, stringBuilder); + stringBuilder.Append("assign "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(":= "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Group Element stringBuilder.Append("action "); - // non Terminal : ActionUsageDeclaration; Found rule ActionUsageDeclaration:ActionUsage=UsageDeclarationValuePart? + // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + stringBuilder.Append("{ "); + // non Terminal : ActionBodyItem; Found rule ActionBodyItem:Type=NonBehaviorBodyItem|ownedRelationship+=InitialNodeMember(ownedRelationship+=ActionTargetSuccessionMember)*|(ownedRelationship+=SourceSuccessionMember)?ownedRelationship+=ActionBehaviorMember(ownedRelationship+=ActionTargetSuccessionMember)*|ownedRelationship+=GuardedSuccessionMember + TypeTextualNotationBuilder.BuildActionBodyItem(poco, stringBuilder); + stringBuilder.Append("} "); - // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' + } + /// + /// 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) + { + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + stringBuilder.Append("action "); + // non Terminal : ActionUsageDeclaration; Found rule ActionUsageDeclaration:ActionUsage=UsageDeclarationValuePart? + BuildActionUsageDeclaration(poco, stringBuilder); + // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' + TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActorMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActorMembershipTextualNotationBuilder.cs index d43e6335..32cc3c30 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActorMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActorMembershipTextualNotationBuilder.cs @@ -29,28 +29,23 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class ActorMembershipTextualNotationBuilder : TextualNotationBuilder + public static partial class ActorMembershipTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule ActorMember + /// ActorMember:ActorMembership=MemberPrefixownedRelatedElement+=ActorUsage /// - /// The used to query textual notation of referenced - public ActorMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Requirements.ActorMembership poco) - { - var stringBuilder = new StringBuilder(); + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationDefinitionTextualNotationBuilder.cs index 66a8ec2a..16afccf6 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationDefinitionTextualNotationBuilder.cs @@ -29,38 +29,25 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class AllocationDefinitionTextualNotationBuilder : TextualNotationBuilder + public static partial class AllocationDefinitionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule AllocationDefinition + /// AllocationDefinition=OccurrenceDefinitionPrefix'allocation''def'Definition /// - /// The used to query textual notation of referenced - public AllocationDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Allocations.AllocationDefinition poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : AllocationDefinition=OccurrenceDefinitionPrefix'allocation''def'Definition - - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* - - + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("allocation "); stringBuilder.Append("def "); - // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody - - + // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody + DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationUsageTextualNotationBuilder.cs index 630fa981..3c25ebd6 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationUsageTextualNotationBuilder.cs @@ -29,41 +29,36 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class AllocationUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class AllocationUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule AllocationUsageDeclaration + /// AllocationUsageDeclaration:AllocationUsage='allocation'UsageDeclaration('allocate'ConnectorPart)?|'allocate'ConnectorPart /// - /// The used to query textual notation of referenced - public AllocationUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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 provided + /// Builds the Textual Notation string for the rule AllocationUsage + /// AllocationUsage=OccurrenceUsagePrefixAllocationUsageDeclarationUsageBody /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Allocations.AllocationUsage poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : AllocationUsage=OccurrenceUsagePrefixAllocationUsageDeclarationUsageBody + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + // non Terminal : AllocationUsageDeclaration; Found rule AllocationUsageDeclaration:AllocationUsage='allocation'UsageDeclaration('allocate'ConnectorPart)?|'allocate'ConnectorPart + BuildAllocationUsageDeclaration(poco, stringBuilder); + // non Terminal : UsageBody; Found rule UsageBody:Usage=DefinitionBody + UsageTextualNotationBuilder.BuildUsageBody(poco, stringBuilder); - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* - - - // non Terminal : AllocationUsageDeclaration; Found rule AllocationUsageDeclaration:AllocationUsage='allocation'UsageDeclaration('allocate'ConnectorPart)?|'allocate'ConnectorPart - - - - - // non Terminal : UsageBody; Found rule UsageBody:Usage=DefinitionBody - - - - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseDefinitionTextualNotationBuilder.cs index 5f61ce7e..ad2f0689 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseDefinitionTextualNotationBuilder.cs @@ -29,41 +29,27 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class AnalysisCaseDefinitionTextualNotationBuilder : TextualNotationBuilder + public static partial class AnalysisCaseDefinitionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule AnalysisCaseDefinition + /// AnalysisCaseDefinition=OccurrenceDefinitionPrefix'analysis''def'DefinitionDeclarationCaseBody /// - /// The used to query textual notation of referenced - public AnalysisCaseDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.AnalysisCases.AnalysisCaseDefinition poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : AnalysisCaseDefinition=OccurrenceDefinitionPrefix'analysis''def'DefinitionDeclarationCaseBody - - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* - - + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("analysis "); stringBuilder.Append("def "); - // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? - - - // non Terminal : CaseBody; Found rule CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' - - + // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); + // non Terminal : CaseBody; Found rule CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' + TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseUsageTextualNotationBuilder.cs index e2c61eba..e34b4e54 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseUsageTextualNotationBuilder.cs @@ -29,46 +29,30 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class AnalysisCaseUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class AnalysisCaseUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule AnalysisCaseUsage + /// AnalysisCaseUsage=OccurrenceUsagePrefix'analysis'ConstraintUsageDeclarationCaseBody /// - /// The used to query textual notation of referenced - public AnalysisCaseUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.AnalysisCases.AnalysisCaseUsage poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : AnalysisCaseUsage=OccurrenceUsagePrefix'analysis'ConstraintUsageDeclarationCaseBody - - - - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* - - + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("analysis "); - // non Terminal : ConstraintUsageDeclaration; Found rule ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? - - - - - - - // non Terminal : CaseBody; Found rule CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' - + // non Terminal : ConstraintUsageDeclaration; Found rule ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? + // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue + FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + // non Terminal : CaseBody; Found rule CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' + TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotatingElementTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotatingElementTextualNotationBuilder.cs index b312b461..177e3ddc 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotatingElementTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotatingElementTextualNotationBuilder.cs @@ -29,50 +29,19 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class AnnotatingElementTextualNotationBuilder : TextualNotationBuilder + public static partial class AnnotatingElementTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule AnnotatingElement + /// AnnotatingElement=Comment|Documentation|TextualRepresentation|MetadataFeature /// - /// The used to query textual notation of referenced - public AnnotatingElementTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Root.Annotations.AnnotatingElement poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : AnnotatingElement=Comment|Documentation|TextualRepresentation|MetadataFeature - - - - // non Terminal : Comment; Found rule Comment=('comment'Identification('about'ownedRelationship+=Annotation(','ownedRelationship+=Annotation)*)?)?('locale'locale=STRING_VALUE)?body=REGULAR_COMMENT - - - // non Terminal : Documentation; Found rule Documentation='doc'Identification('locale'locale=STRING_VALUE)?body=REGULAR_COMMENT - - - - - // non Terminal : TextualRepresentation; Found rule TextualRepresentation=('rep'Identification)?'language'language=STRING_VALUEbody=REGULAR_COMMENT - - - - - - - // non Terminal : MetadataFeature; Found rule MetadataFeature=(ownedRelationship+=PrefixMetadataMember)*('@'|'metadata')MetadataFeatureDeclaration('about'ownedRelationship+=Annotation(','ownedRelationship+=Annotation)*)?MetadataBody - - - - return stringBuilder.ToString(); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.cs index ced6d125..52cc66e8 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.cs @@ -29,31 +29,49 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class AnnotationTextualNotationBuilder : TextualNotationBuilder + public static partial class AnnotationTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule OwnedAnnotation + /// OwnedAnnotation:Annotation=ownedRelatedElement+=AnnotatingElement /// - /// The used to query textual notation of referenced - public AnnotationTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule PrefixMetadataAnnotation + /// PrefixMetadataAnnotation:Annotation='#'annotatingElement=PrefixMetadataUsage{ownedRelatedElement+=annotatingElement} /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Root.Annotations.Annotation poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : Annotation=annotatedElement=[QualifiedName] + stringBuilder.Append("# "); + // Assignment Element : annotatingElement = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property annotatingElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Assignment Element : ownedRelatedElement += annotatingElement + + } - // Assignment Element : annotatedElement = + /// + /// 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) + { + // Assignment Element : annotatedElement = SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + // If property annotatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssertConstraintUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssertConstraintUsageTextualNotationBuilder.cs index 398b7d80..aaedc496 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssertConstraintUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssertConstraintUsageTextualNotationBuilder.cs @@ -29,39 +29,30 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class AssertConstraintUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class AssertConstraintUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule AssertConstraintUsage + /// AssertConstraintUsage=OccurrenceUsagePrefix'assert'(isNegated?='not')?(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'constraint'ConstraintUsageDeclaration)CalculationBody /// - /// The used to query textual notation of referenced - public AssertConstraintUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Constraints.AssertConstraintUsage poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : AssertConstraintUsage=OccurrenceUsagePrefix'assert'(isNegated?='not')?(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'constraint'ConstraintUsageDeclaration)CalculationBody - - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* - - + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("assert "); - // Group Element - // Group Element - // non Terminal : CalculationBody; Found rule CalculationBody:Type=';'|'{'CalculationBodyPart'}' - + // Group Element + // Assignment Element : isNegated ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // If property isNegated value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // non Terminal : CalculationBody; Found rule CalculationBody:Type=';'|'{'CalculationBodyPart'}' + TypeTextualNotationBuilder.BuildCalculationBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssignmentActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssignmentActionUsageTextualNotationBuilder.cs index a405b00b..c5ba02b4 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssignmentActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssignmentActionUsageTextualNotationBuilder.cs @@ -29,28 +29,59 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class AssignmentActionUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class AssignmentActionUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule AssignmentNode + /// AssignmentNode:AssignmentActionUsage=OccurrenceUsagePrefixAssignmentNodeDeclarationActionBody /// - /// The used to query textual notation of referenced - public AssignmentActionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + // non Terminal : AssignmentNodeDeclaration; Found rule AssignmentNodeDeclaration:ActionUsage=(ActionNodeUsageDeclaration)?'assign'ownedRelationship+=AssignmentTargetMemberownedRelationship+=FeatureChainMember':='ownedRelationship+=NodeParameterMember + ActionUsageTextualNotationBuilder.BuildAssignmentNodeDeclaration(poco, stringBuilder); + // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' + 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) + { + // non Terminal : AssignmentNodeDeclaration; Found rule AssignmentNodeDeclaration:ActionUsage=(ActionNodeUsageDeclaration)?'assign'ownedRelationship+=AssignmentTargetMemberownedRelationship+=FeatureChainMember':='ownedRelationship+=NodeParameterMember + ActionUsageTextualNotationBuilder.BuildAssignmentNodeDeclaration(poco, stringBuilder); + // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' + TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule TransitionAssignmentActionUsage + /// TransitionAssignmentActionUsage:AssignmentActionUsage=AssignmentNodeDeclaration('{'ActionBodyItem*'}')? /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.AssignmentActionUsage poco) + /// 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) { - var stringBuilder = new StringBuilder(); + // non Terminal : AssignmentNodeDeclaration; Found rule AssignmentNodeDeclaration:ActionUsage=(ActionNodeUsageDeclaration)?'assign'ownedRelationship+=AssignmentTargetMemberownedRelationship+=FeatureChainMember':='ownedRelationship+=NodeParameterMember + ActionUsageTextualNotationBuilder.BuildAssignmentNodeDeclaration(poco, stringBuilder); + // Group Element + stringBuilder.Append("{ "); + // non Terminal : ActionBodyItem; Found rule ActionBodyItem:Type=NonBehaviorBodyItem|ownedRelationship+=InitialNodeMember(ownedRelationship+=ActionTargetSuccessionMember)*|(ownedRelationship+=SourceSuccessionMember)?ownedRelationship+=ActionBehaviorMember(ownedRelationship+=ActionTargetSuccessionMember)*|ownedRelationship+=GuardedSuccessionMember + TypeTextualNotationBuilder.BuildActionBodyItem(poco, stringBuilder); + stringBuilder.Append("} "); + - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationStructureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationStructureTextualNotationBuilder.cs index 9ee85d6d..b1528d69 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationStructureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationStructureTextualNotationBuilder.cs @@ -29,45 +29,27 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class AssociationStructureTextualNotationBuilder : TextualNotationBuilder + public static partial class AssociationStructureTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule AssociationStructure + /// AssociationStructure=TypePrefix'assoc''struct'ClassifierDeclarationTypeBody /// - /// The used to query textual notation of referenced - public AssociationStructureTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Associations.AssociationStructure poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : AssociationStructure=TypePrefix'assoc''struct'ClassifierDeclarationTypeBody - - - - - - // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* - - + // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* + TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); stringBuilder.Append("assoc "); stringBuilder.Append("struct "); - // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* - - - // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' - - + // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* + ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); + // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationTextualNotationBuilder.cs index beefd97f..82923aad 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationTextualNotationBuilder.cs @@ -29,40 +29,26 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class AssociationTextualNotationBuilder : TextualNotationBuilder + public static partial class AssociationTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule Association + /// Association=TypePrefix'assoc'ClassifierDeclarationTypeBody /// - /// The used to query textual notation of referenced - public AssociationTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Associations.Association poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : Association=TypePrefix'assoc'ClassifierDeclarationTypeBody - - // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* - - + // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* + TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); stringBuilder.Append("assoc "); - // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* - - - // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' - - + // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* + ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); + // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeDefinitionTextualNotationBuilder.cs index a09bbf4a..c79ef359 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeDefinitionTextualNotationBuilder.cs @@ -29,38 +29,25 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class AttributeDefinitionTextualNotationBuilder : TextualNotationBuilder + public static partial class AttributeDefinitionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule AttributeDefinition + /// AttributeDefinition:AttributeDefinition=DefinitionPrefix'attribute''def'Definition /// - /// The used to query textual notation of referenced - public AttributeDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Attributes.AttributeDefinition poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : AttributeDefinition:AttributeDefinition=DefinitionPrefix'attribute''def'Definition - - // non Terminal : DefinitionPrefix; Found rule DefinitionPrefix:Definition=BasicDefinitionPrefix?DefinitionExtensionKeyword* - - + // non Terminal : DefinitionPrefix; Found rule DefinitionPrefix:Definition=BasicDefinitionPrefix?DefinitionExtensionKeyword* + DefinitionTextualNotationBuilder.BuildDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("attribute "); stringBuilder.Append("def "); - // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody - - + // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody + DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeUsageTextualNotationBuilder.cs index 55142496..32677578 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeUsageTextualNotationBuilder.cs @@ -29,39 +29,24 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class AttributeUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class AttributeUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule AttributeUsage + /// AttributeUsage:AttributeUsage=UsagePrefix'attribute'Usage /// - /// The used to query textual notation of referenced - public AttributeUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Attributes.AttributeUsage poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : AttributeUsage:AttributeUsage=UsagePrefix'attribute'Usage - - - - // non Terminal : UsagePrefix; Found rule UsagePrefix:Usage=UnextendedUsagePrefixUsageExtensionKeyword* - - + // non Terminal : UsagePrefix; Found rule UsagePrefix:Usage=UnextendedUsagePrefixUsageExtensionKeyword* + UsageTextualNotationBuilder.BuildUsagePrefix(poco, stringBuilder); stringBuilder.Append("attribute "); - // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion - - + // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion + UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BehaviorTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BehaviorTextualNotationBuilder.cs index 06db73a0..0e0fd3d1 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BehaviorTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BehaviorTextualNotationBuilder.cs @@ -29,42 +29,26 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class BehaviorTextualNotationBuilder : TextualNotationBuilder + public static partial class BehaviorTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule Behavior + /// Behavior=TypePrefix'behavior'ClassifierDeclarationTypeBody /// - /// The used to query textual notation of referenced - public BehaviorTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Behaviors.Behavior poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : Behavior=TypePrefix'behavior'ClassifierDeclarationTypeBody - - - - // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* - - + // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* + TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); stringBuilder.Append("behavior "); - // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* - - - // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' - - + // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* + ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); + // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorAsUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorAsUsageTextualNotationBuilder.cs index c3da729c..3ac18dde 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorAsUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorAsUsageTextualNotationBuilder.cs @@ -29,43 +29,34 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class BindingConnectorAsUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class BindingConnectorAsUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule BindingConnectorAsUsage + /// BindingConnectorAsUsage=UsagePrefix('binding'UsageDeclaration)?'bind'ownedRelationship+=ConnectorEndMember'='ownedRelationship+=ConnectorEndMemberUsageBody /// - /// The used to query textual notation of referenced - public BindingConnectorAsUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Connections.BindingConnectorAsUsage poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : BindingConnectorAsUsage=UsagePrefix('binding'UsageDeclaration)?'bind'ownedRelationship+=ConnectorEndMember'='ownedRelationship+=ConnectorEndMemberUsageBody - + // non Terminal : UsagePrefix; Found rule UsagePrefix:Usage=UnextendedUsagePrefixUsageExtensionKeyword* + UsageTextualNotationBuilder.BuildUsagePrefix(poco, stringBuilder); + // Group Element + stringBuilder.Append("binding "); + // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); - - // non Terminal : UsagePrefix; Found rule UsagePrefix:Usage=UnextendedUsagePrefixUsageExtensionKeyword* - - - // Group Element stringBuilder.Append("bind "); // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement stringBuilder.Append("= "); // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // non Terminal : UsageBody; Found rule UsageBody:Usage=DefinitionBody - - + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // non Terminal : UsageBody; Found rule UsageBody:Usage=DefinitionBody + UsageTextualNotationBuilder.BuildUsageBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorTextualNotationBuilder.cs index 6af305cb..484d0758 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorTextualNotationBuilder.cs @@ -29,44 +29,43 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class BindingConnectorTextualNotationBuilder : TextualNotationBuilder + public static partial class BindingConnectorTextualNotationBuilder { /// - /// Initializes a new instance of a + /// 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 used to query textual notation of referenced - public BindingConnectorTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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 provided + /// Builds the Textual Notation string for the rule BindingConnector + /// BindingConnector=FeaturePrefix'binding'BindingConnectorDeclarationTypeBody /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Connectors.BindingConnector poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : BindingConnector=FeaturePrefix'binding'BindingConnectorDeclarationTypeBody - - // non Terminal : FeaturePrefix; Found rule FeaturePrefix=(EndFeaturePrefix(ownedRelationship+=OwnedCrossFeatureMember)?|BasicFeaturePrefix)(ownedRelationship+=PrefixMetadataMember)* - - + // non Terminal : FeaturePrefix; Found rule FeaturePrefix=(EndFeaturePrefix(ownedRelationship+=OwnedCrossFeatureMember)?|BasicFeaturePrefix)(ownedRelationship+=PrefixMetadataMember)* + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement stringBuilder.Append("binding "); - // non Terminal : BindingConnectorDeclaration; Found rule BindingConnectorDeclaration:BindingConnector=FeatureDeclaration('of'ownedRelationship+=ConnectorEndMember'='ownedRelationship+=ConnectorEndMember)?|(isSufficient?='all')?('of'?ownedRelationship+=ConnectorEndMember'='ownedRelationship+=ConnectorEndMember)? - - - - - // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' - - + // non Terminal : BindingConnectorDeclaration; Found rule BindingConnectorDeclaration:BindingConnector=FeatureDeclaration('of'ownedRelationship+=ConnectorEndMember'='ownedRelationship+=ConnectorEndMember)?|(isSufficient?='all')?('of'?ownedRelationship+=ConnectorEndMember'='ownedRelationship+=ConnectorEndMember)? + BuildBindingConnectorDeclaration(poco, stringBuilder); + // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BooleanExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BooleanExpressionTextualNotationBuilder.cs index f50b773d..f74854e3 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BooleanExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BooleanExpressionTextualNotationBuilder.cs @@ -29,45 +29,34 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class BooleanExpressionTextualNotationBuilder : TextualNotationBuilder + public static partial class BooleanExpressionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule BooleanExpression + /// BooleanExpression=FeaturePrefix'bool'FeatureDeclarationValuePart?FunctionBody /// - /// The used to query textual notation of referenced - public BooleanExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Functions.BooleanExpression poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : BooleanExpression=FeaturePrefix'bool'FeatureDeclarationValuePart?FunctionBody - - // non Terminal : FeaturePrefix; Found rule FeaturePrefix=(EndFeaturePrefix(ownedRelationship+=OwnedCrossFeatureMember)?|BasicFeaturePrefix)(ownedRelationship+=PrefixMetadataMember)* - - + // non Terminal : FeaturePrefix; Found rule FeaturePrefix=(EndFeaturePrefix(ownedRelationship+=OwnedCrossFeatureMember)?|BasicFeaturePrefix)(ownedRelationship+=PrefixMetadataMember)* + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement stringBuilder.Append("bool "); - // non Terminal : FeatureDeclaration; Found rule FeatureDeclaration:Feature=(isSufficient?='all')?(FeatureIdentification(FeatureSpecializationPart|ConjugationPart)?|FeatureSpecializationPart|ConjugationPart)FeatureRelationshipPart* - - - // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue - - - // non Terminal : FunctionBody; Found rule FunctionBody:Type=';'|'{'FunctionBodyPart'}' - - + // non Terminal : FeatureDeclaration; Found rule FeatureDeclaration:Feature=(isSufficient?='all')?(FeatureIdentification(FeatureSpecializationPart|ConjugationPart)?|FeatureSpecializationPart|ConjugationPart)FeatureRelationshipPart* + FeatureTextualNotationBuilder.BuildFeatureDeclaration(poco, stringBuilder); + // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue + FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + // non Terminal : FunctionBody; Found rule FunctionBody:Type=';'|'{'FunctionBodyPart'}' + TypeTextualNotationBuilder.BuildFunctionBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationDefinitionTextualNotationBuilder.cs index 8608fea0..368a60c5 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationDefinitionTextualNotationBuilder.cs @@ -29,41 +29,27 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class CalculationDefinitionTextualNotationBuilder : TextualNotationBuilder + public static partial class CalculationDefinitionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule CalculationDefinition + /// CalculationDefinition=OccurrenceDefinitionPrefix'calc''def'DefinitionDeclarationCalculationBody /// - /// The used to query textual notation of referenced - public CalculationDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Calculations.CalculationDefinition poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : CalculationDefinition=OccurrenceDefinitionPrefix'calc''def'DefinitionDeclarationCalculationBody - - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* - - + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("calc "); stringBuilder.Append("def "); - // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? - - - // non Terminal : CalculationBody; Found rule CalculationBody:Type=';'|'{'CalculationBodyPart'}' - - + // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); + // non Terminal : CalculationBody; Found rule CalculationBody:Type=';'|'{'CalculationBodyPart'}' + TypeTextualNotationBuilder.BuildCalculationBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationUsageTextualNotationBuilder.cs index 734608f2..c78ff9bd 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationUsageTextualNotationBuilder.cs @@ -29,40 +29,26 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class CalculationUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class CalculationUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule CalculationUsage + /// CalculationUsage:CalculationUsage=OccurrenceUsagePrefix'calc'ActionUsageDeclarationCalculationBody /// - /// The used to query textual notation of referenced - public CalculationUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Calculations.CalculationUsage poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : CalculationUsage:CalculationUsage=OccurrenceUsagePrefix'calc'ActionUsageDeclarationCalculationBody - - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* - - + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("calc "); - // non Terminal : ActionUsageDeclaration; Found rule ActionUsageDeclaration:ActionUsage=UsageDeclarationValuePart? - - - // non Terminal : CalculationBody; Found rule CalculationBody:Type=';'|'{'CalculationBodyPart'}' - - + // non Terminal : ActionUsageDeclaration; Found rule ActionUsageDeclaration:ActionUsage=UsageDeclarationValuePart? + ActionUsageTextualNotationBuilder.BuildActionUsageDeclaration(poco, stringBuilder); + // non Terminal : CalculationBody; Found rule CalculationBody:Type=';'|'{'CalculationBodyPart'}' + TypeTextualNotationBuilder.BuildCalculationBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseDefinitionTextualNotationBuilder.cs index 02ab8927..b67d14c0 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseDefinitionTextualNotationBuilder.cs @@ -29,41 +29,27 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class CaseDefinitionTextualNotationBuilder : TextualNotationBuilder + public static partial class CaseDefinitionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule CaseDefinition + /// CaseDefinition=OccurrenceDefinitionPrefix'case''def'DefinitionDeclarationCaseBody /// - /// The used to query textual notation of referenced - public CaseDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Cases.CaseDefinition poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : CaseDefinition=OccurrenceDefinitionPrefix'case''def'DefinitionDeclarationCaseBody - - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* - - + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("case "); stringBuilder.Append("def "); - // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? - - - // non Terminal : CaseBody; Found rule CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' - - + // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); + // non Terminal : CaseBody; Found rule CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' + TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseUsageTextualNotationBuilder.cs index 77a84abb..59599bdc 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseUsageTextualNotationBuilder.cs @@ -29,44 +29,30 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class CaseUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class CaseUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule CaseUsage + /// CaseUsage=OccurrenceUsagePrefix'case'ConstraintUsageDeclarationCaseBody /// - /// The used to query textual notation of referenced - public CaseUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Cases.CaseUsage poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : CaseUsage=OccurrenceUsagePrefix'case'ConstraintUsageDeclarationCaseBody - - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* - - + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("case "); - // non Terminal : ConstraintUsageDeclaration; Found rule ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? - - - - - - - // non Terminal : CaseBody; Found rule CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' - + // non Terminal : ConstraintUsageDeclaration; Found rule ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? + // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue + FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + // non Terminal : CaseBody; Found rule CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' + TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassTextualNotationBuilder.cs index de09fd90..0313ea23 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassTextualNotationBuilder.cs @@ -29,42 +29,26 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class ClassTextualNotationBuilder : TextualNotationBuilder + public static partial class ClassTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule Class + /// Class=TypePrefix'class'ClassifierDeclarationTypeBody /// - /// The used to query textual notation of referenced - public ClassTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Classes.Class poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : Class=TypePrefix'class'ClassifierDeclarationTypeBody - - - - // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* - - + // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* + TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); stringBuilder.Append("class "); - // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* - - - // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' - - + // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* + ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); + // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs index fb572d82..4ef89bbe 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs @@ -29,40 +29,91 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class ClassifierTextualNotationBuilder : TextualNotationBuilder + public static partial class ClassifierTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule SubclassificationPart + /// SubclassificationPart:Classifier=SPECIALIZESownedRelationship+=OwnedSubclassification(','ownedRelationship+=OwnedSubclassification)* /// - /// The used to query textual notation of referenced - public ClassifierTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // non Terminal : SPECIALIZES; Found rule SPECIALIZES=':>'|'specializes' + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Group Element + stringBuilder.Append(", "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule ClassifierDeclaration + /// ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Classifiers.Classifier poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : Classifier=TypePrefix'classifier'ClassifierDeclarationTypeBody + // Group Element + // Assignment Element : isSufficient ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // If property isSufficient value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* + // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // non Terminal : TypeRelationshipPart; Found rule TypeRelationshipPart:Type=DisjoiningPart|UnioningPart|IntersectingPart|DifferencingPart + TypeTextualNotationBuilder.BuildTypeRelationshipPart(poco, stringBuilder); - stringBuilder.Append("classifier "); - // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* + } + /// + /// 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) + { + // non Terminal : SPECIALIZES; Found rule SPECIALIZES=':>'|'specializes' + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Group Element + stringBuilder.Append(", "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + } + /// + /// 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) + { + // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* + TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); + stringBuilder.Append("classifier "); + // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* + BuildClassifierDeclaration(poco, stringBuilder); + // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CollectExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CollectExpressionTextualNotationBuilder.cs index c6dc6abd..0b36c549 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CollectExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CollectExpressionTextualNotationBuilder.cs @@ -29,33 +29,24 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class CollectExpressionTextualNotationBuilder : TextualNotationBuilder + public static partial class CollectExpressionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule CollectExpression + /// CollectExpression=ownedRelationship+=PrimaryArgumentMember'.'ownedRelationship+=BodyArgumentMember /// - /// The used to query textual notation of referenced - public CollectExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.CollectExpression poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : CollectExpression=ownedRelationship+=PrimaryArgumentMember'.'ownedRelationship+=BodyArgumentMember - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement stringBuilder.Append(". "); // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CommentTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CommentTextualNotationBuilder.cs index f3cd16a3..e303e66d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CommentTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CommentTextualNotationBuilder.cs @@ -29,33 +29,41 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class CommentTextualNotationBuilder : TextualNotationBuilder + public static partial class CommentTextualNotationBuilder { /// - /// Initializes a new instance of a + /// 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 used to query textual notation of referenced - public CommentTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } + // Group Element + stringBuilder.Append("comment "); + // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + // Group Element + stringBuilder.Append("about "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Group Element + stringBuilder.Append(", "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Root.Annotations.Comment poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : Comment=('comment'Identification('about'ownedRelationship+=Annotation(','ownedRelationship+=Annotation)*)?)?('locale'locale=STRING_VALUE)?body=REGULAR_COMMENT - // Group Element - // Group Element + + // Group Element + stringBuilder.Append("locale "); + // Assignment Element : locale = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property locale value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Assignment Element : body = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property body value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernDefinitionTextualNotationBuilder.cs index 38bb9bfd..78e52f31 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernDefinitionTextualNotationBuilder.cs @@ -29,41 +29,27 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class ConcernDefinitionTextualNotationBuilder : TextualNotationBuilder + public static partial class ConcernDefinitionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule ConcernDefinition + /// ConcernDefinition=OccurrenceDefinitionPrefix'concern''def'DefinitionDeclarationRequirementBody /// - /// The used to query textual notation of referenced - public ConcernDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Requirements.ConcernDefinition poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : ConcernDefinition=OccurrenceDefinitionPrefix'concern''def'DefinitionDeclarationRequirementBody - - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* - - + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("concern "); stringBuilder.Append("def "); - // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? - - - // non Terminal : RequirementBody; Found rule RequirementBody:Type=';'|'{'RequirementBodyItem*'}' - - + // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); + // non Terminal : RequirementBody; Found rule RequirementBody:Type=';'|'{'RequirementBodyItem*'}' + TypeTextualNotationBuilder.BuildRequirementBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernUsageTextualNotationBuilder.cs index 52cca171..8889cd90 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernUsageTextualNotationBuilder.cs @@ -29,46 +29,37 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class ConcernUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class ConcernUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule FramedConcernUsage + /// FramedConcernUsage:ConcernUsage=ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?CalculationBody|(UsageExtensionKeyword*'concern'|UsageExtensionKeyword+)CalculationUsageDeclarationCalculationBody /// - /// The used to query textual notation of referenced - public ConcernUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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 provided + /// Builds the Textual Notation string for the rule ConcernUsage + /// ConcernUsage=OccurrenceUsagePrefix'concern'ConstraintUsageDeclarationRequirementBody /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Requirements.ConcernUsage poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : ConcernUsage=OccurrenceUsagePrefix'concern'ConstraintUsageDeclarationRequirementBody - - - - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* - - + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("concern "); - // non Terminal : ConstraintUsageDeclaration; Found rule ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? - - - - - - - // non Terminal : RequirementBody; Found rule RequirementBody:Type=';'|'{'RequirementBodyItem*'}' - - + // non Terminal : ConstraintUsageDeclaration; Found rule ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? + ConstraintUsageTextualNotationBuilder.BuildConstraintUsageDeclaration(poco, stringBuilder); + // non Terminal : RequirementBody; Found rule RequirementBody:Type=';'|'{'RequirementBodyItem*'}' + TypeTextualNotationBuilder.BuildRequirementBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortDefinitionTextualNotationBuilder.cs index a42c64cd..61256e00 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortDefinitionTextualNotationBuilder.cs @@ -29,31 +29,21 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class ConjugatedPortDefinitionTextualNotationBuilder : TextualNotationBuilder + public static partial class ConjugatedPortDefinitionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule ConjugatedPortDefinition + /// ConjugatedPortDefinition=ownedRelationship+=PortConjugation /// - /// The used to query textual notation of referenced - public ConjugatedPortDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Ports.ConjugatedPortDefinition poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : ConjugatedPortDefinition=ownedRelationship+=PortConjugation - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortTypingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortTypingTextualNotationBuilder.cs index 54256a70..6780ddf0 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortTypingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortTypingTextualNotationBuilder.cs @@ -29,45 +29,22 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class ConjugatedPortTypingTextualNotationBuilder : TextualNotationBuilder + public static partial class ConjugatedPortTypingTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule ConjugatedPortTyping + /// ConjugatedPortTyping:ConjugatedPortTyping='~'originalPortDefinition=~[QualifiedName] /// - /// The used to query textual notation of referenced - public ConjugatedPortTypingTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Ports.ConjugatedPortTyping poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : ConjugatedPortTyping:ConjugatedPortTyping='~'originalPortDefinition=~[QualifiedName] - - - - - - - - - - - - - - stringBuilder.Append("~ "); - // Assignment Element : originalPortDefinition = + // Assignment Element : originalPortDefinition = SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + BuildOriginalPortDefinition(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugationTextualNotationBuilder.cs index c4fc6bdd..fe68b9ca 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugationTextualNotationBuilder.cs @@ -29,46 +29,44 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class ConjugationTextualNotationBuilder : TextualNotationBuilder + public static partial class ConjugationTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule OwnedConjugation + /// OwnedConjugation:Conjugation=originalType=[QualifiedName]|originalType=FeatureChain{ownedRelatedElement+=originalType} /// - /// The used to query textual notation of referenced - public ConjugationTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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 provided + /// 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 textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Types.Conjugation poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : Conjugation=('conjugation'Identification)?'conjugate'(conjugatedType=[QualifiedName]|conjugatedType=FeatureChain{ownedRelatedElement+=conjugatedType})CONJUGATES(originalType=[QualifiedName]|originalType=FeatureChain{ownedRelatedElement+=originalType})RelationshipBody + // Group Element + stringBuilder.Append("conjugation "); + // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); - // Group Element stringBuilder.Append("conjugate "); - // Group Element - // non Terminal : CONJUGATES; Found rule CONJUGATES='~'|'conjugates' + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // non Terminal : CONJUGATES; Found rule CONJUGATES='~'|'conjugates' + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' + RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); - - - - - - // Group Element - // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' - - - - - - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionDefinitionTextualNotationBuilder.cs index 6ff91ddd..06b4a2f7 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionDefinitionTextualNotationBuilder.cs @@ -29,38 +29,25 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class ConnectionDefinitionTextualNotationBuilder : TextualNotationBuilder + public static partial class ConnectionDefinitionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule ConnectionDefinition + /// ConnectionDefinition=OccurrenceDefinitionPrefix'connection''def'Definition /// - /// The used to query textual notation of referenced - public ConnectionDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Connections.ConnectionDefinition poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : ConnectionDefinition=OccurrenceDefinitionPrefix'connection''def'Definition - - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* - - + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("connection "); stringBuilder.Append("def "); - // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody - - + // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody + DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs index 6e3de8c1..d153424b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs @@ -29,37 +29,75 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class ConnectionUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class ConnectionUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule ConnectorPart + /// ConnectorPart:ConnectionUsage=BinaryConnectorPart|NaryConnectorPart /// - /// The used to query textual notation of referenced - public ConnectionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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 provided + /// Builds the Textual Notation string for the rule BinaryConnectorPart + /// BinaryConnectorPart:ConnectionUsage=ownedRelationship+=ConnectorEndMember'to'ownedRelationship+=ConnectorEndMember /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Connections.ConnectionUsage poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : ConnectionUsage=OccurrenceUsagePrefix('connection'UsageDeclarationValuePart?('connect'ConnectorPart)?|'connect'ConnectorPart)UsageBody + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append("to "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + } + /// + /// 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) + { + stringBuilder.Append("( "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(", "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Group Element + stringBuilder.Append(", "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Group Element - // non Terminal : UsageBody; Found rule UsageBody:Usage=DefinitionBody + 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) + { + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // non Terminal : UsageBody; Found rule UsageBody:Usage=DefinitionBody + UsageTextualNotationBuilder.BuildUsageBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs index b054e23d..e4d151c0 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs @@ -29,40 +29,86 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class ConnectorTextualNotationBuilder : TextualNotationBuilder + public static partial class ConnectorTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule ConnectorDeclaration + /// ConnectorDeclaration:Connector=BinaryConnectorDeclaration|NaryConnectorDeclaration /// - /// The used to query textual notation of referenced - public ConnectorTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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 provided + /// 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 textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Connectors.Connector poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : Connector=FeaturePrefix'connector'(FeatureDeclaration?ValuePart?|ConnectorDeclaration)TypeBody + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append("to "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // non Terminal : FeaturePrefix; Found rule FeaturePrefix=(EndFeaturePrefix(ownedRelationship+=OwnedCrossFeatureMember)?|BasicFeaturePrefix)(ownedRelationship+=PrefixMetadataMember)* + } + /// + /// 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) + { + // non Terminal : FeatureDeclaration; Found rule FeatureDeclaration:Feature=(isSufficient?='all')?(FeatureIdentification(FeatureSpecializationPart|ConjugationPart)?|FeatureSpecializationPart|ConjugationPart)FeatureRelationshipPart* + FeatureTextualNotationBuilder.BuildFeatureDeclaration(poco, stringBuilder); + stringBuilder.Append("( "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(", "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Group Element + stringBuilder.Append(", "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(") "); + } - stringBuilder.Append("connector "); - // Group Element - // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + /// + /// 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) + { + // non Terminal : FeaturePrefix; Found rule FeaturePrefix=(EndFeaturePrefix(ownedRelationship+=OwnedCrossFeatureMember)?|BasicFeaturePrefix)(ownedRelationship+=PrefixMetadataMember)* + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append("connector "); + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintDefinitionTextualNotationBuilder.cs index e04f227f..4ebbcdc0 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintDefinitionTextualNotationBuilder.cs @@ -29,41 +29,27 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class ConstraintDefinitionTextualNotationBuilder : TextualNotationBuilder + public static partial class ConstraintDefinitionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule ConstraintDefinition + /// ConstraintDefinition=OccurrenceDefinitionPrefix'constraint''def'DefinitionDeclarationCalculationBody /// - /// The used to query textual notation of referenced - public ConstraintDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Constraints.ConstraintDefinition poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : ConstraintDefinition=OccurrenceDefinitionPrefix'constraint''def'DefinitionDeclarationCalculationBody - - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* - - + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("constraint "); stringBuilder.Append("def "); - // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? - - - // non Terminal : CalculationBody; Found rule CalculationBody:Type=';'|'{'CalculationBodyPart'}' - - + // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); + // non Terminal : CalculationBody; Found rule CalculationBody:Type=';'|'{'CalculationBodyPart'}' + TypeTextualNotationBuilder.BuildCalculationBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintUsageTextualNotationBuilder.cs index d6ab2b14..60157281 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintUsageTextualNotationBuilder.cs @@ -29,44 +29,52 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class ConstraintUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class ConstraintUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule ConstraintUsageDeclaration + /// ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? /// - /// The used to query textual notation of referenced - public ConstraintUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue + FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule RequirementConstraintUsage + /// RequirementConstraintUsage:ConstraintUsage=ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?RequirementBody|(UsageExtensionKeyword*'constraint'|UsageExtensionKeyword+)ConstraintUsageDeclarationCalculationBody /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Constraints.ConstraintUsage poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : ConstraintUsage=OccurrenceUsagePrefix'constraint'ConstraintUsageDeclarationCalculationBody - - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* - + 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) + { + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("constraint "); - // non Terminal : ConstraintUsageDeclaration; Found rule ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? - - - - - - - // non Terminal : CalculationBody; Found rule CalculationBody:Type=';'|'{'CalculationBodyPart'}' - - + // non Terminal : ConstraintUsageDeclaration; Found rule ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? + BuildConstraintUsageDeclaration(poco, stringBuilder); + // non Terminal : CalculationBody; Found rule CalculationBody:Type=';'|'{'CalculationBodyPart'}' + TypeTextualNotationBuilder.BuildCalculationBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstructorExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstructorExpressionTextualNotationBuilder.cs index e3ec167c..8e49a5e2 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstructorExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstructorExpressionTextualNotationBuilder.cs @@ -29,33 +29,24 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class ConstructorExpressionTextualNotationBuilder : TextualNotationBuilder + public static partial class ConstructorExpressionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule ConstructorExpression + /// ConstructorExpression='new'ownedRelationship+=InstantiatedTypeMemberownedRelationship+=ConstructorResultMember /// - /// The used to query textual notation of referenced - public ConstructorExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.ConstructorExpression poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : ConstructorExpression='new'ownedRelationship+=InstantiatedTypeMemberownedRelationship+=ConstructorResultMember - stringBuilder.Append("new "); // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralRationalTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ControlNodeTextualNotationBuilder.cs similarity index 56% rename from SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralRationalTextualNotationBuilder.cs rename to SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ControlNodeTextualNotationBuilder.cs index 24e82c08..ed69bd4f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralRationalTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ControlNodeTextualNotationBuilder.cs @@ -1,5 +1,5 @@ // ------------------------------------------------------------------------------------------------- -// +// // // Copyright 2022-2026 Starion Group S.A. // @@ -29,28 +29,19 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class LiteralRationalTextualNotationBuilder : TextualNotationBuilder + public static partial class ControlNodeTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule ControlNode + /// ControlNode=MergeNode|DecisionNode|JoinNode|ForkNode /// - /// The used to query textual notation of referenced - public LiteralRationalTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.LiteralRational poco) - { - var stringBuilder = new StringBuilder(); - - return stringBuilder.ToString(); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CrossSubsettingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CrossSubsettingTextualNotationBuilder.cs index 41e0b661..3401445a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CrossSubsettingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CrossSubsettingTextualNotationBuilder.cs @@ -29,28 +29,19 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class CrossSubsettingTextualNotationBuilder : TextualNotationBuilder + public static partial class CrossSubsettingTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule OwnedCrossSubsetting + /// OwnedCrossSubsetting:CrossSubsetting=crossedFeature=[QualifiedName]|crossedFeature=OwnedFeatureChain{ownedRelatedElement+=crossedFeature} /// - /// The used to query textual notation of referenced - public CrossSubsettingTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Features.CrossSubsetting poco) - { - var stringBuilder = new StringBuilder(); - - return stringBuilder.ToString(); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DataTypeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DataTypeTextualNotationBuilder.cs index f31594b4..e7bd3f68 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DataTypeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DataTypeTextualNotationBuilder.cs @@ -29,42 +29,26 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class DataTypeTextualNotationBuilder : TextualNotationBuilder + public static partial class DataTypeTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule DataType + /// DataType=TypePrefix'datatype'ClassifierDeclarationTypeBody /// - /// The used to query textual notation of referenced - public DataTypeTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.DataTypes.DataType poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : DataType=TypePrefix'datatype'ClassifierDeclarationTypeBody - - - - // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* - - + // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* + TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); stringBuilder.Append("datatype "); - // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* - - - // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' - - + // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* + ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); + // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DecisionNodeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DecisionNodeTextualNotationBuilder.cs index 53187f23..ea487f4c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DecisionNodeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DecisionNodeTextualNotationBuilder.cs @@ -29,40 +29,27 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class DecisionNodeTextualNotationBuilder : TextualNotationBuilder + public static partial class DecisionNodeTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule DecisionNode + /// DecisionNode=ControlNodePrefixisComposite?='decide'UsageDeclarationActionBody /// - /// The used to query textual notation of referenced - public DecisionNodeTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.DecisionNode poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : DecisionNode=ControlNodePrefixisComposite?='decide'UsageDeclarationActionBody - - // non Terminal : ControlNodePrefix; Found rule ControlNodePrefix:OccurrenceUsage=RefPrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* - - + // non Terminal : ControlNodePrefix; Found rule ControlNodePrefix:OccurrenceUsage=RefPrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildControlNodePrefix(poco, stringBuilder); // Assignment Element : isComposite ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? - - - // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' - - + // If property isComposite value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' + TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs index 1bab9ec6..e5ccadf7 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs @@ -29,36 +29,84 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class DefinitionTextualNotationBuilder : TextualNotationBuilder + public static partial class DefinitionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule DefinitionExtensionKeyword + /// DefinitionExtensionKeyword:Definition=ownedRelationship+=PrefixMetadataMember /// - /// The used to query textual notation of referenced - public DefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule DefinitionPrefix + /// DefinitionPrefix:Definition=BasicDefinitionPrefix?DefinitionExtensionKeyword* /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.Definition poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : Definition=DefinitionDeclarationDefinitionBody + // non Terminal : BasicDefinitionPrefix; Found rule BasicDefinitionPrefix=isAbstract?='abstract'|isVariation?='variation' + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // non Terminal : DefinitionExtensionKeyword; Found rule DefinitionExtensionKeyword:Definition=ownedRelationship+=PrefixMetadataMember + BuildDefinitionExtensionKeyword(poco, stringBuilder); - // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? + } + /// + /// 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) + { + // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + // non Terminal : SubclassificationPart; Found rule SubclassificationPart:Classifier=SPECIALIZESownedRelationship+=OwnedSubclassification(','ownedRelationship+=OwnedSubclassification)* + ClassifierTextualNotationBuilder.BuildSubclassificationPart(poco, stringBuilder); + + } - // non Terminal : DefinitionBody; Found rule DefinitionBody:Type=';'|'{'DefinitionBodyItem*'}' + /// + /// 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) + { + // non Terminal : BasicDefinitionPrefix; Found rule BasicDefinitionPrefix=isAbstract?='abstract'|isVariation?='variation' + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // non Terminal : DefinitionExtensionKeyword; Found rule DefinitionExtensionKeyword:Definition=ownedRelationship+=PrefixMetadataMember + BuildDefinitionExtensionKeyword(poco, stringBuilder); + stringBuilder.Append("def "); + // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody + 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) + { + // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? + BuildDefinitionDeclaration(poco, stringBuilder); + // non Terminal : DefinitionBody; Found rule DefinitionBody:Type=';'|'{'DefinitionBodyItem*'}' + TypeTextualNotationBuilder.BuildDefinitionBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DependencyTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DependencyTextualNotationBuilder.cs index 6a62ac69..4c1d1f68 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DependencyTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DependencyTextualNotationBuilder.cs @@ -29,44 +29,48 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class DependencyTextualNotationBuilder : TextualNotationBuilder + public static partial class DependencyTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule Dependency + /// Dependency=(ownedRelationship+=PrefixMetadataAnnotation)*'dependency'DependencyDeclarationRelationshipBody /// - /// The used to query textual notation of referenced - public DependencyTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Root.Dependencies.Dependency poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : Dependency=(ownedRelationship+=PrefixMetadataAnnotation)*'dependency'DependencyDeclarationRelationshipBody + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Group Element stringBuilder.Append("dependency "); - // non Terminal : DependencyDeclaration; Found rule DependencyDeclaration=(Identification'from')?client+=[QualifiedName](','client+=[QualifiedName])*'to'supplier+=[QualifiedName](','supplier+=[QualifiedName])* - - - - - - - // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' - - - - + // non Terminal : DependencyDeclaration; Found rule DependencyDeclaration=(Identification'from')?client+=[QualifiedName](','client+=[QualifiedName])*'to'supplier+=[QualifiedName](','supplier+=[QualifiedName])* + // Group Element + // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + stringBuilder.Append("from "); + + // Assignment Element : client += SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + // If property client value is set, print SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + // Group Element + stringBuilder.Append(", "); + // Assignment Element : client += SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + // If property client value is set, print SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + + stringBuilder.Append("to "); + // Assignment Element : supplier += SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + // If property supplier value is set, print SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + // Group Element + stringBuilder.Append(", "); + // Assignment Element : supplier += SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + // If property supplier value is set, print SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + + + // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' + RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DifferencingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DifferencingTextualNotationBuilder.cs index befe8581..bc3d0f48 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DifferencingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DifferencingTextualNotationBuilder.cs @@ -29,34 +29,19 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class DifferencingTextualNotationBuilder : TextualNotationBuilder + public static partial class DifferencingTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule Differencing + /// Differencing=differencingType=[QualifiedName]|ownedRelatedElement+=OwnedFeatureChain /// - /// The used to query textual notation of referenced - public DifferencingTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Types.Differencing poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : Differencing=differencingType=[QualifiedName]|ownedRelatedElement+=OwnedFeatureChain - - - - // Assignment Element : differencingType = - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - - return stringBuilder.ToString(); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DisjoiningTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DisjoiningTextualNotationBuilder.cs index ca8bc185..05c0f019 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DisjoiningTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DisjoiningTextualNotationBuilder.cs @@ -29,40 +29,43 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class DisjoiningTextualNotationBuilder : TextualNotationBuilder + public static partial class DisjoiningTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule OwnedDisjoining + /// OwnedDisjoining:Disjoining=disjoiningType=[QualifiedName]|disjoiningType=FeatureChain{ownedRelatedElement+=disjoiningType} /// - /// The used to query textual notation of referenced - public DisjoiningTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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 provided + /// 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 textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Types.Disjoining poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : Disjoining=('disjoining'Identification)?'disjoint'(typeDisjoined=[QualifiedName]|typeDisjoined=FeatureChain{ownedRelatedElement+=typeDisjoined})'from'(disjoiningType=[QualifiedName]|disjoiningType=FeatureChain{ownedRelatedElement+=disjoiningType})RelationshipBody + // Group Element + stringBuilder.Append("disjoining "); + // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); - // Group Element stringBuilder.Append("disjoint "); - // Group Element + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); stringBuilder.Append("from "); - // Group Element - // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' + RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); - - - - - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DocumentationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DocumentationTextualNotationBuilder.cs index 9f77279d..8d6a6429 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DocumentationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DocumentationTextualNotationBuilder.cs @@ -29,38 +29,29 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class DocumentationTextualNotationBuilder : TextualNotationBuilder + public static partial class DocumentationTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule Documentation + /// Documentation='doc'Identification('locale'locale=STRING_VALUE)?body=REGULAR_COMMENT /// - /// The used to query textual notation of referenced - public DocumentationTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Root.Annotations.Documentation poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : Documentation='doc'Identification('locale'locale=STRING_VALUE)?body=REGULAR_COMMENT - - - stringBuilder.Append("doc "); - // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? - + // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + // Group Element + stringBuilder.Append("locale "); + // Assignment Element : locale = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property locale value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Group Element // Assignment Element : body = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property body value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementFilterMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementFilterMembershipTextualNotationBuilder.cs index c94f4d5a..424a25f2 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementFilterMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementFilterMembershipTextualNotationBuilder.cs @@ -29,28 +29,40 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class ElementFilterMembershipTextualNotationBuilder : TextualNotationBuilder + public static partial class ElementFilterMembershipTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule ElementFilterMember + /// ElementFilterMember:ElementFilterMembership=MemberPrefix'filter'ownedRelatedElement+=OwnedExpression';' /// - /// The used to query textual notation of referenced - public ElementFilterMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + stringBuilder.Append("filter "); + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append("; "); + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule FilterPackageMember + /// FilterPackageMember:ElementFilterMembership='['ownedRelatedElement+=OwnedExpression']' /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Packages.ElementFilterMembership poco) + /// 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) { - var stringBuilder = new StringBuilder(); + stringBuilder.Append("[ "); + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append("] "); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementTextualNotationBuilder.cs new file mode 100644 index 00000000..f06f98ff --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementTextualNotationBuilder.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.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) + { + // Group Element + stringBuilder.Append("< "); + // Assignment Element : declaredShortName = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property declaredShortName value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append("> "); + + // Group Element + // Assignment Element : declaredName = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property declaredName value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + + } + + /// + /// 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 index aff631e9..6b868048 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EndFeatureMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EndFeatureMembershipTextualNotationBuilder.cs @@ -29,28 +29,73 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class EndFeatureMembershipTextualNotationBuilder : TextualNotationBuilder + public static partial class EndFeatureMembershipTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule SourceEndMember + /// SourceEndMember:EndFeatureMembership=ownedRelatedElement+=SourceEnd /// - /// The used to query textual notation of referenced - public EndFeatureMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule EmptyEndMember + /// EmptyEndMember:EndFeatureMembership=ownedRelatedElement+=EmptyFeature /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Features.EndFeatureMembership poco) + /// 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) { - var stringBuilder = new StringBuilder(); + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationDefinitionTextualNotationBuilder.cs index 6aa8a491..c89f0f5d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationDefinitionTextualNotationBuilder.cs @@ -29,41 +29,38 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class EnumerationDefinitionTextualNotationBuilder : TextualNotationBuilder + public static partial class EnumerationDefinitionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule EnumerationBody + /// EnumerationBody:EnumerationDefinition=';'|'{'(ownedRelationship+=AnnotatingMember|ownedRelationship+=EnumerationUsageMember)*'}' /// - /// The used to query textual notation of referenced - public EnumerationDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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 provided + /// Builds the Textual Notation string for the rule EnumerationDefinition + /// EnumerationDefinition=DefinitionExtensionKeyword*'enum''def'DefinitionDeclarationEnumerationBody /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Enumerations.EnumerationDefinition poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : EnumerationDefinition=DefinitionExtensionKeyword*'enum''def'DefinitionDeclarationEnumerationBody - - // non Terminal : DefinitionExtensionKeyword; Found rule DefinitionExtensionKeyword:Definition=ownedRelationship+=PrefixMetadataMember - - + // non Terminal : DefinitionExtensionKeyword; Found rule DefinitionExtensionKeyword:Definition=ownedRelationship+=PrefixMetadataMember + DefinitionTextualNotationBuilder.BuildDefinitionExtensionKeyword(poco, stringBuilder); stringBuilder.Append("enum "); stringBuilder.Append("def "); - // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? - - - // non Terminal : EnumerationBody; Found rule EnumerationBody:EnumerationDefinition=';'|'{'(ownedRelationship+=AnnotatingMember|ownedRelationship+=EnumerationUsageMember)*'}' - - + // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); + // non Terminal : EnumerationBody; Found rule EnumerationBody:EnumerationDefinition=';'|'{'(ownedRelationship+=AnnotatingMember|ownedRelationship+=EnumerationUsageMember)*'}' + BuildEnumerationBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationUsageTextualNotationBuilder.cs index 15303836..b81e8827 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationUsageTextualNotationBuilder.cs @@ -29,41 +29,38 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class EnumerationUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class EnumerationUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule EnumeratedValue + /// EnumeratedValue:EnumerationUsage='enum'?Usage /// - /// The used to query textual notation of referenced - public EnumerationUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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 "); + // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion + UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule EnumerationUsage + /// EnumerationUsage:EnumerationUsage=UsagePrefix'enum'Usage /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Enumerations.EnumerationUsage poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : EnumerationUsage:EnumerationUsage=UsagePrefix'enum'Usage - - - - - - // non Terminal : UsagePrefix; Found rule UsagePrefix:Usage=UnextendedUsagePrefixUsageExtensionKeyword* - - + // non Terminal : UsagePrefix; Found rule UsagePrefix:Usage=UnextendedUsagePrefixUsageExtensionKeyword* + UsageTextualNotationBuilder.BuildUsagePrefix(poco, stringBuilder); stringBuilder.Append("enum "); - // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion - - + // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion + UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EventOccurrenceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EventOccurrenceUsageTextualNotationBuilder.cs index 6c8698a2..9514b705 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EventOccurrenceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EventOccurrenceUsageTextualNotationBuilder.cs @@ -29,40 +29,39 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class EventOccurrenceUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class EventOccurrenceUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule MessageEvent + /// MessageEvent:EventOccurrenceUsage=ownedRelationship+=OwnedReferenceSubsetting /// - /// The used to query textual notation of referenced - public EventOccurrenceUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule EventOccurrenceUsage + /// EventOccurrenceUsage=OccurrenceUsagePrefix'event'(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'occurrence'UsageDeclaration?)UsageCompletion /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Occurrences.EventOccurrenceUsage poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : EventOccurrenceUsage=OccurrenceUsagePrefix'event'(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'occurrence'UsageDeclaration?)UsageCompletion - - - - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* - - + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("event "); - // Group Element - // non Terminal : UsageCompletion; Found rule UsageCompletion:Usage=ValuePart?UsageBody - - + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // non Terminal : UsageCompletion; Found rule UsageCompletion:Usage=ValuePart?UsageBody + UsageTextualNotationBuilder.BuildUsageCompletion(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExhibitStateUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExhibitStateUsageTextualNotationBuilder.cs index 78bc6c40..8de84ad5 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExhibitStateUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExhibitStateUsageTextualNotationBuilder.cs @@ -29,43 +29,28 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class ExhibitStateUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class ExhibitStateUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule ExhibitStateUsage + /// ExhibitStateUsage=OccurrenceUsagePrefix'exhibit'(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'state'UsageDeclaration)ValuePart?StateUsageBody /// - /// The used to query textual notation of referenced - public ExhibitStateUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.States.ExhibitStateUsage poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : ExhibitStateUsage=OccurrenceUsagePrefix'exhibit'(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'state'UsageDeclaration)ValuePart?StateUsageBody - - - - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* - - + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("exhibit "); - // Group Element - // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue - - - // non Terminal : StateUsageBody; Found rule StateUsageBody:StateUsage=';'|(isParallel?='parallel')?'{'StateBodyItem*'}' - - + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue + FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + // non Terminal : StateUsageBody; Found rule StateUsageBody:StateUsage=';'|(isParallel?='parallel')?'{'StateBodyItem*'}' + StateUsageTextualNotationBuilder.BuildStateUsageBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExposeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExposeTextualNotationBuilder.cs new file mode 100644 index 00000000..af3d7bf2 --- /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.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 "); + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' + 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 index 51a81d68..4a1d9406 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs @@ -29,47 +29,132 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class ExpressionTextualNotationBuilder : TextualNotationBuilder + public static partial class ExpressionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule OwnedExpression + /// OwnedExpression:Expression=ConditionalExpression|ConditionalBinaryOperatorExpression|BinaryOperatorExpression|UnaryOperatorExpression|ClassificationExpression|MetaclassificationExpression|ExtentExpression|PrimaryExpression /// - /// The used to query textual notation of referenced - public ExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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 provided + /// Builds the Textual Notation string for the rule PrimaryExpression + /// PrimaryExpression:Expression=FeatureChainExpression|NonFeatureChainPrimaryExpression /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Functions.Expression poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : Expression=FeaturePrefix'expr'FeatureDeclarationValuePart?FunctionBody - + 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"); + } - // non Terminal : FeaturePrefix; Found rule FeaturePrefix=(EndFeaturePrefix(ownedRelationship+=OwnedCrossFeatureMember)?|BasicFeaturePrefix)(ownedRelationship+=PrefixMetadataMember)* + /// + /// 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("( "); + // non Terminal : SequenceExpressionList; Found rule SequenceExpressionList:Expression=OwnedExpression','?|SequenceOperatorExpression + 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) + { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - stringBuilder.Append("expr "); - // non Terminal : FeatureDeclaration; Found rule FeatureDeclaration:Feature=(isSufficient?='all')?(FeatureIdentification(FeatureSpecializationPart|ConjugationPart)?|FeatureSpecializationPart|ConjugationPart)FeatureRelationshipPart* + } + /// + /// 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"); + } - // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue + /// + /// 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("{ "); + // non Terminal : FunctionBodyPart; Found rule FunctionBodyPart:Type=(TypeBodyElement|ownedRelationship+=ReturnFeatureMember)*(ownedRelationship+=ResultExpressionMember)? + TypeTextualNotationBuilder.BuildFunctionBodyPart(poco, stringBuilder); + stringBuilder.Append("} "); + } - // non Terminal : FunctionBody; Found rule FunctionBody:Type=';'|'{'FunctionBodyPart'}' + /// + /// 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) + { + // non Terminal : FeaturePrefix; Found rule FeaturePrefix=(EndFeaturePrefix(ownedRelationship+=OwnedCrossFeatureMember)?|BasicFeaturePrefix)(ownedRelationship+=PrefixMetadataMember)* + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append("expr "); + // non Terminal : FeatureDeclaration; Found rule FeatureDeclaration:Feature=(isSufficient?='all')?(FeatureIdentification(FeatureSpecializationPart|ConjugationPart)?|FeatureSpecializationPart|ConjugationPart)FeatureRelationshipPart* + FeatureTextualNotationBuilder.BuildFeatureDeclaration(poco, stringBuilder); + // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue + FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + // non Terminal : FunctionBody; Found rule FunctionBody:Type=';'|'{'FunctionBodyPart'}' + TypeTextualNotationBuilder.BuildFunctionBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainExpressionTextualNotationBuilder.cs index 94789d10..f4f46550 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainExpressionTextualNotationBuilder.cs @@ -29,33 +29,24 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class FeatureChainExpressionTextualNotationBuilder : TextualNotationBuilder + public static partial class FeatureChainExpressionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule FeatureChainExpression + /// FeatureChainExpression=ownedRelationship+=NonFeatureChainPrimaryArgumentMember'.'ownedRelationship+=FeatureChainMember /// - /// The used to query textual notation of referenced - public FeatureChainExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.FeatureChainExpression poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : FeatureChainExpression=ownedRelationship+=NonFeatureChainPrimaryArgumentMember'.'ownedRelationship+=FeatureChainMember - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement stringBuilder.Append(". "); // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainingTextualNotationBuilder.cs index 13e6303f..dd4c6b8a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainingTextualNotationBuilder.cs @@ -29,28 +29,21 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class FeatureChainingTextualNotationBuilder : TextualNotationBuilder + public static partial class FeatureChainingTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule OwnedFeatureChaining + /// OwnedFeatureChaining:FeatureChaining=chainingFeature=[QualifiedName] /// - /// The used to query textual notation of referenced - public FeatureChainingTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Features.FeatureChaining poco) - { - var stringBuilder = new StringBuilder(); + // Assignment Element : chainingFeature = SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + // If property chainingFeature value is set, print SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureDirectionKindTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureDirectionKindTextualNotationBuilder.cs new file mode 100644 index 00000000..0c5a9609 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureDirectionKindTextualNotationBuilder.cs @@ -0,0 +1,51 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// 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.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 index 1081e8d4..0e3118a2 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureInvertingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureInvertingTextualNotationBuilder.cs @@ -29,40 +29,43 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class FeatureInvertingTextualNotationBuilder : TextualNotationBuilder + public static partial class FeatureInvertingTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule OwnedFeatureInverting + /// OwnedFeatureInverting:FeatureInverting=invertingFeature=[QualifiedName]|invertingFeature=OwnedFeatureChain{ownedRelatedElement+=invertingFeature} /// - /// The used to query textual notation of referenced - public FeatureInvertingTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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 provided + /// 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 textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Features.FeatureInverting poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : FeatureInverting=('inverting'Identification?)?'inverse'(featureInverted=[QualifiedName]|featureInverted=OwnedFeatureChain{ownedRelatedElement+=featureInverted})'of'(invertingFeature=[QualifiedName]|ownedRelatedElement+=OwnedFeatureChain{ownedRelatedElement+=invertingFeature})RelationshipBody + // Group Element + stringBuilder.Append("inverting "); + // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); - // Group Element stringBuilder.Append("inverse "); - // Group Element + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); stringBuilder.Append("of "); - // Group Element - // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' + RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); - - - - - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs index a0ef9280..c88c60e5 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs @@ -29,28 +29,403 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class FeatureMembershipTextualNotationBuilder : TextualNotationBuilder + public static partial class FeatureMembershipTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule NonOccurrenceUsageMember + /// NonOccurrenceUsageMember:FeatureMembership=MemberPrefixownedRelatedElement+=NonOccurrenceUsageElement /// - /// The used to query textual notation of referenced - public FeatureMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + stringBuilder.Append("then "); + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + stringBuilder.Append("first "); + // Assignment Element : memberFeature = SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + BuildMemberFeature(poco, stringBuilder); + // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' + 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) + { + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + 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) + { + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedMemberFeature = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedMemberFeature value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedFeatureMember = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + 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) + { + // Assignment Element : ownedMemberFeature = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedMemberFeature value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedMemberFeature = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedMemberFeature value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedMemberFeature = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedMemberFeature value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedMemberFeature = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedMemberFeature value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelatedElement = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule MetadataBodyFeatureMember + /// MetadataBodyFeatureMember:FeatureMembership=ownedMemberFeature=MetadataBodyFeature /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Types.FeatureMembership poco) + /// 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) { - var stringBuilder = new StringBuilder(); + // Assignment Element : ownedMemberFeature = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedMemberFeature value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureReferenceExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureReferenceExpressionTextualNotationBuilder.cs index ed784336..90934ea6 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureReferenceExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureReferenceExpressionTextualNotationBuilder.cs @@ -29,32 +29,75 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class FeatureReferenceExpressionTextualNotationBuilder : TextualNotationBuilder + public static partial class FeatureReferenceExpressionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule SatisfactionReferenceExpression + /// SatisfactionReferenceExpression:FeatureReferenceExpression=ownedRelationship+=FeatureChainMember /// - /// The used to query textual notation of referenced - public FeatureReferenceExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule OwnedExpressionReference + /// OwnedExpressionReference:FeatureReferenceExpression=ownedRelationship+=OwnedExpressionMember /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.FeatureReferenceExpression poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : FeatureReferenceExpression:FeatureReferenceExpression=ownedRelationship+=FeatureReferenceMemberownedRelationship+=EmptyResultMember + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + /// + /// 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) + { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs index 4c4f36b9..53b9088e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs @@ -29,39 +29,667 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class FeatureTextualNotationBuilder : TextualNotationBuilder + public static partial class FeatureTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule ValuePart + /// ValuePart:Feature=ownedRelationship+=FeatureValue /// - /// The used to query textual notation of referenced - public FeatureTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // non Terminal : TypedBy; Found rule TypedBy:Feature=DEFINED_BYownedRelationship+=FeatureTyping + BuildTypedBy(poco, stringBuilder); + // Group Element + stringBuilder.Append(", "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + + } + + /// + /// 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) + { + // non Terminal : DEFINED_BY; Found rule DEFINED_BY=':'|'defined''by' + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // non Terminal : Subsets; Found rule Subsets:Feature=SUBSETSownedRelationship+=OwnedSubsetting + BuildSubsets(poco, stringBuilder); + // Group Element + stringBuilder.Append(", "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + + } + + /// + /// 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) + { + // non Terminal : SUBSETS; Found rule SUBSETS=':>'|'subsets' + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // non Terminal : REFERENCES; Found rule REFERENCES='::>'|'references' + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // non Terminal : CROSSES; Found rule CROSSES='=>'|'crosses' + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // non Terminal : Redefines; Found rule Redefines:Feature=REDEFINESownedRelationship+=OwnedRedefinition + BuildRedefines(poco, stringBuilder); + // Group Element + stringBuilder.Append(", "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + + } + + /// + /// 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) + { + // non Terminal : REDEFINES; Found rule REDEFINES=':>>'|'redefines' + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Group Element + stringBuilder.Append(". "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + + } + + /// + /// 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) + { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(". "); + + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + 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) + { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Group Element + // Assignment Element : isConstant ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // If property isConstant value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // Assignment Element : isVariable = true + + // Assignment Element : isEnd ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // If property isEnd value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + + } + + /// + /// 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) + { + // Group Element + // Assignment Element : direction = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property direction value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + // Group Element + // Assignment Element : isDerived ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // If property isDerived value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + + // Group Element + // Assignment Element : isAbstract ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // If property isAbstract value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // Group Element + 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) + { + // Group Element + // Assignment Element : isSufficient ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // If property isSufficient value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // non Terminal : FeatureRelationshipPart; Found rule FeatureRelationshipPart:Feature=TypeRelationshipPart|ChainingPart|InvertingPart|TypeFeaturingPart + 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) + { + stringBuilder.Append("chains "); + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + + } + + /// + /// 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) + { + stringBuilder.Append("inverse "); + stringBuilder.Append("of "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + stringBuilder.Append("featured "); + stringBuilder.Append("by "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Group Element + stringBuilder.Append(", "); + // Assignment Element : ownedTypeFeaturing += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedTypeFeaturing value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + + } + + /// + /// 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) + { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Group Element + stringBuilder.Append(". "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + + } + + /// + /// 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) + { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule FunctionReferenceArgument + /// FunctionReferenceArgument:Feature=ownedRelationship+=FunctionReferenceArgumentValue /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Features.Feature poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : Feature=(FeaturePrefix('feature'|ownedRelationship+=PrefixMetadataMember)FeatureDeclaration?|(EndFeaturePrefix|BasicFeaturePrefix)FeatureDeclaration)ValuePart?TypeBody + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + } + /// + /// 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) + { + // Value Literal Element : [QualifiedName] - // Group Element - // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue + } + /// + /// 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) + { + // non Terminal : ArgumentList; Found rule ArgumentList:Feature='('(PositionalArgumentList|NamedArgumentList)?')' + BuildArgumentList(poco, stringBuilder); - // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + } + /// + /// 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("( "); + // Group Element + 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) + { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Group Element + stringBuilder.Append(", "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + + } + + /// + /// 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) + { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Group Element + stringBuilder.Append(", "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + + } + + /// + /// 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) + { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append("= "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + stringBuilder.Append("feature "); + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // non Terminal : FeatureSpecializationPart; Found rule FeatureSpecializationPart:Feature=FeatureSpecialization+MultiplicityPart?FeatureSpecialization*|MultiplicityPartFeatureSpecialization* + BuildFeatureSpecializationPart(poco, stringBuilder); + // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue + BuildValuePart(poco, stringBuilder); + // non Terminal : MetadataBody; Found rule MetadataBody:Type=';'|'{'(ownedRelationship+=DefinitionMember|ownedRelationship+=MetadataBodyUsageMember|ownedRelationship+=AliasMember|ownedRelationship+=Import)*'}' + 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) + { + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue + BuildValuePart(poco, stringBuilder); + // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs index d9e9034d..8a3bcb35 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs @@ -29,49 +29,43 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class FeatureTypingTextualNotationBuilder : TextualNotationBuilder + public static partial class FeatureTypingTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule OwnedFeatureTyping + /// OwnedFeatureTyping:FeatureTyping=type=[QualifiedName]|type=OwnedFeatureChain{ownedRelatedElement+=type} /// - /// The used to query textual notation of referenced - public FeatureTypingTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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 provided + /// Builds the Textual Notation string for the rule ReferenceTyping + /// ReferenceTyping:FeatureTyping=type=[QualifiedName] /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Features.FeatureTyping poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : FeatureTyping=OwnedFeatureTyping|ConjugatedPortTyping - - // non Terminal : OwnedFeatureTyping; Found rule OwnedFeatureTyping:FeatureTyping=type=[QualifiedName]|type=OwnedFeatureChain{ownedRelatedElement+=type} - - - // non Terminal : ConjugatedPortTyping; Found rule ConjugatedPortTyping:ConjugatedPortTyping='~'originalPortDefinition=~[QualifiedName] - - - - - - - - - - - - - - + // Assignment Element : type = SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + // If property type value is set, print SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + } - return stringBuilder.ToString(); + /// + /// 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"); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureValueTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureValueTextualNotationBuilder.cs index 1a64bd05..d2ba52fb 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureValueTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureValueTextualNotationBuilder.cs @@ -29,37 +29,166 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class FeatureValueTextualNotationBuilder : TextualNotationBuilder + public static partial class FeatureValueTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule TriggerFeatureValue + /// TriggerFeatureValue:FeatureValue=ownedRelatedElement+=TriggerExpression /// - /// The used to query textual notation of referenced - public FeatureValueTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : value = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property value value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : value = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property value value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : value = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property value value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule NonFeatureChainPrimaryArgumentValue + /// NonFeatureChainPrimaryArgumentValue:FeatureValue=value=NonFeatureChainPrimaryExpression /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.FeatureValues.FeatureValue poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : FeatureValue=('='|isInitial?=':='|isDefault?='default'('='|isInitial?=':=')?)ownedRelatedElement+=OwnedExpression + // Assignment Element : value = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property value value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + } + /// + /// 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) + { + // Assignment Element : value = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property value value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + } + /// + /// 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) + { + // Assignment Element : value = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property value value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + } - // Group Element + /// + /// 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) + { + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowDefinitionTextualNotationBuilder.cs index e1796899..d1bf3698 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowDefinitionTextualNotationBuilder.cs @@ -29,38 +29,25 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class FlowDefinitionTextualNotationBuilder : TextualNotationBuilder + public static partial class FlowDefinitionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule FlowDefinition + /// FlowDefinition=OccurrenceDefinitionPrefix'flow''def'Definition /// - /// The used to query textual notation of referenced - public FlowDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Flows.FlowDefinition poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : FlowDefinition=OccurrenceDefinitionPrefix'flow''def'Definition - - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* - - + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("flow "); stringBuilder.Append("def "); - // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody - - + // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody + DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowEndTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowEndTextualNotationBuilder.cs index 18b5d6a0..1b58aab6 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowEndTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowEndTextualNotationBuilder.cs @@ -29,32 +29,25 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class FlowEndTextualNotationBuilder : TextualNotationBuilder + public static partial class FlowEndTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule FlowEnd + /// FlowEnd=(ownedRelationship+=FlowEndSubsetting)?ownedRelationship+=FlowFeatureMember /// - /// The used to query textual notation of referenced - public FlowEndTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Interactions.FlowEnd poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : FlowEnd=(ownedRelationship+=FlowEndSubsetting)?ownedRelationship+=FlowFeatureMember + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Group Element // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowTextualNotationBuilder.cs index 83cfede0..d76d86df 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowTextualNotationBuilder.cs @@ -29,42 +29,32 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class FlowTextualNotationBuilder : TextualNotationBuilder + public static partial class FlowTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule Flow + /// Flow=FeaturePrefix'flow'FlowDeclarationTypeBody /// - /// The used to query textual notation of referenced - public FlowTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Interactions.Flow poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : Flow=FeaturePrefix'flow'FlowDeclarationTypeBody - - // non Terminal : FeaturePrefix; Found rule FeaturePrefix=(EndFeaturePrefix(ownedRelationship+=OwnedCrossFeatureMember)?|BasicFeaturePrefix)(ownedRelationship+=PrefixMetadataMember)* - - + // non Terminal : FeaturePrefix; Found rule FeaturePrefix=(EndFeaturePrefix(ownedRelationship+=OwnedCrossFeatureMember)?|BasicFeaturePrefix)(ownedRelationship+=PrefixMetadataMember)* + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement stringBuilder.Append("flow "); - // non Terminal : FlowDeclaration; Found rule FlowDeclaration:FlowUsage=UsageDeclarationValuePart?('of'ownedRelationship+=FlowPayloadFeatureMember)?('from'ownedRelationship+=FlowEndMember'to'ownedRelationship+=FlowEndMember)?|ownedRelationship+=FlowEndMember'to'ownedRelationship+=FlowEndMember - - - // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' - - + // non Terminal : FlowDeclaration; Found rule FlowDeclaration:FlowUsage=UsageDeclarationValuePart?('of'ownedRelationship+=FlowPayloadFeatureMember)?('from'ownedRelationship+=FlowEndMember'to'ownedRelationship+=FlowEndMember)?|ownedRelationship+=FlowEndMember'to'ownedRelationship+=FlowEndMember + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowUsageTextualNotationBuilder.cs index 8a12225f..43644f24 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowUsageTextualNotationBuilder.cs @@ -29,40 +29,67 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class FlowUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class FlowUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule Message + /// Message:FlowUsage=OccurrenceUsagePrefix'message'MessageDeclarationDefinitionBody{isAbstract=true} /// - /// The used to query textual notation of referenced - public FlowUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + stringBuilder.Append("message "); + // non Terminal : MessageDeclaration; Found rule MessageDeclaration:FlowUsage=UsageDeclarationValuePart?('of'ownedRelationship+=FlowPayloadFeatureMember)?('from'ownedRelationship+=MessageEventMember'to'ownedRelationship+=MessageEventMember)?|ownedRelationship+=MessageEventMember'to'ownedRelationship+=MessageEventMember + BuildMessageDeclaration(poco, stringBuilder); + // non Terminal : DefinitionBody; Found rule DefinitionBody:Type=';'|'{'DefinitionBodyItem*'}' + TypeTextualNotationBuilder.BuildDefinitionBody(poco, stringBuilder); + // Assignment Element : isAbstract = true + } /// - /// Builds the Textual Notation string for the provided + /// 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 textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Flows.FlowUsage poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : FlowUsage=OccurrenceUsagePrefix'flow'FlowDeclarationDefinitionBody - - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + 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) + { + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("flow "); - // non Terminal : FlowDeclaration; Found rule FlowDeclaration:FlowUsage=UsageDeclarationValuePart?('of'ownedRelationship+=FlowPayloadFeatureMember)?('from'ownedRelationship+=FlowEndMember'to'ownedRelationship+=FlowEndMember)?|ownedRelationship+=FlowEndMember'to'ownedRelationship+=FlowEndMember - - - // non Terminal : DefinitionBody; Found rule DefinitionBody:Type=';'|'{'DefinitionBodyItem*'}' - - + // non Terminal : FlowDeclaration; Found rule FlowDeclaration:FlowUsage=UsageDeclarationValuePart?('of'ownedRelationship+=FlowPayloadFeatureMember)?('from'ownedRelationship+=FlowEndMember'to'ownedRelationship+=FlowEndMember)?|ownedRelationship+=FlowEndMember'to'ownedRelationship+=FlowEndMember + BuildFlowDeclaration(poco, stringBuilder); + // non Terminal : DefinitionBody; Found rule DefinitionBody:Type=';'|'{'DefinitionBodyItem*'}' + TypeTextualNotationBuilder.BuildDefinitionBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForLoopActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForLoopActionUsageTextualNotationBuilder.cs index c3d723d8..bba3ffc9 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForLoopActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForLoopActionUsageTextualNotationBuilder.cs @@ -29,28 +29,29 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class ForLoopActionUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class ForLoopActionUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule ForLoopNode + /// ForLoopNode:ForLoopActionUsage=ActionNodePrefix'for'ownedRelationship+=ForVariableDeclarationMember'in'ownedRelationship+=NodeParameterMemberownedRelationship+=ActionBodyParameterMember /// - /// The used to query textual notation of referenced - public ForLoopActionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.ForLoopActionUsage poco) - { - var stringBuilder = new StringBuilder(); + // non Terminal : ActionNodePrefix; Found rule ActionNodePrefix:ActionUsage=OccurrenceUsagePrefixActionNodeUsageDeclaration? + ActionUsageTextualNotationBuilder.BuildActionNodePrefix(poco, stringBuilder); + stringBuilder.Append("for "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append("in "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForkNodeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForkNodeTextualNotationBuilder.cs index 80472fca..ec9f26d1 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForkNodeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForkNodeTextualNotationBuilder.cs @@ -29,42 +29,27 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class ForkNodeTextualNotationBuilder : TextualNotationBuilder + public static partial class ForkNodeTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule ForkNode + /// ForkNode=ControlNodePrefixisComposite?='fork'UsageDeclarationActionBody /// - /// The used to query textual notation of referenced - public ForkNodeTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.ForkNode poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : ForkNode=ControlNodePrefixisComposite?='fork'UsageDeclarationActionBody - - - - // non Terminal : ControlNodePrefix; Found rule ControlNodePrefix:OccurrenceUsage=RefPrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* - - + // non Terminal : ControlNodePrefix; Found rule ControlNodePrefix:OccurrenceUsage=RefPrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildControlNodePrefix(poco, stringBuilder); // Assignment Element : isComposite ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? - - - // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' - - + // If property isComposite value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' + TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FramedConcernMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FramedConcernMembershipTextualNotationBuilder.cs index dd0b5794..c2d50f48 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FramedConcernMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FramedConcernMembershipTextualNotationBuilder.cs @@ -29,28 +29,24 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class FramedConcernMembershipTextualNotationBuilder : TextualNotationBuilder + public static partial class FramedConcernMembershipTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule FramedConcernMember + /// FramedConcernMember:FramedConcernMembership=MemberPrefix?'frame'ownedRelatedElement+=FramedConcernUsage /// - /// The used to query textual notation of referenced - public FramedConcernMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Requirements.FramedConcernMembership poco) - { - var stringBuilder = new StringBuilder(); + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + stringBuilder.Append("frame "); + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FunctionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FunctionTextualNotationBuilder.cs index bac8b85a..26af9410 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FunctionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FunctionTextualNotationBuilder.cs @@ -29,40 +29,26 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class FunctionTextualNotationBuilder : TextualNotationBuilder + public static partial class FunctionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule Function + /// Function=TypePrefix'function'ClassifierDeclarationFunctionBody /// - /// The used to query textual notation of referenced - public FunctionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Functions.Function poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : Function=TypePrefix'function'ClassifierDeclarationFunctionBody - - // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* - - + // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* + TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); stringBuilder.Append("function "); - // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* - - - // non Terminal : FunctionBody; Found rule FunctionBody:Type=';'|'{'FunctionBodyPart'}' - - + // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* + ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); + // non Terminal : FunctionBody; Found rule FunctionBody:Type=';'|'{'FunctionBodyPart'}' + TypeTextualNotationBuilder.BuildFunctionBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs index f4c33922..a70f729c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs @@ -29,28 +29,31 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class IfActionUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class IfActionUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule IfNode + /// IfNode:IfActionUsage=ActionNodePrefix'if'ownedRelationship+=ExpressionParameterMemberownedRelationship+=ActionBodyParameterMember('else'ownedRelationship+=(ActionBodyParameterMember|IfNodeParameterMember))? /// - /// The used to query textual notation of referenced - public IfActionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } + // non Terminal : ActionNodePrefix; Found rule ActionNodePrefix:ActionUsage=OccurrenceUsagePrefixActionNodeUsageDeclaration? + ActionUsageTextualNotationBuilder.BuildActionNodePrefix(poco, stringBuilder); + stringBuilder.Append("if "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Group Element + stringBuilder.Append("else "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.GroupElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.GroupElement - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.IfActionUsage poco) - { - var stringBuilder = new StringBuilder(); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ImportTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ImportTextualNotationBuilder.cs new file mode 100644 index 00000000..a380989d --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ImportTextualNotationBuilder.cs @@ -0,0 +1,73 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// 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.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) + { + // Assignment Element : visibility = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property visibility value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append("import "); + // Group Element + // Assignment Element : isImportAll ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // If property isImportAll value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + + // non Terminal : ImportDeclaration; Found rule ImportDeclaration:Import=MembershipImport|NamespaceImport + BuildImportDeclaration(poco, stringBuilder); + // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' + 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 index 6b4990d3..2d195a8d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IncludeUseCaseUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IncludeUseCaseUsageTextualNotationBuilder.cs @@ -29,45 +29,28 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class IncludeUseCaseUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class IncludeUseCaseUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule IncludeUseCaseUsage + /// IncludeUseCaseUsage=OccurrenceUsagePrefix'include'(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'use''case'UsageDeclaration)ValuePart?CaseBody /// - /// The used to query textual notation of referenced - public IncludeUseCaseUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.UseCases.IncludeUseCaseUsage poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : IncludeUseCaseUsage=OccurrenceUsagePrefix'include'(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'use''case'UsageDeclaration)ValuePart?CaseBody - - - - - - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* - - + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("include "); - // Group Element - // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue - - - // non Terminal : CaseBody; Found rule CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' - - + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue + FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + // non Terminal : CaseBody; Found rule CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' + TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IndexExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IndexExpressionTextualNotationBuilder.cs index 0ace1535..bef87935 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IndexExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IndexExpressionTextualNotationBuilder.cs @@ -29,35 +29,26 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class IndexExpressionTextualNotationBuilder : TextualNotationBuilder + public static partial class IndexExpressionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule IndexExpression + /// IndexExpression=ownedRelationship+=PrimaryArgumentMember'#''('ownedRelationship+=SequenceExpressionListMember')' /// - /// The used to query textual notation of referenced - public IndexExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.IndexExpression poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : IndexExpression=ownedRelationship+=PrimaryArgumentMember'#''('ownedRelationship+=SequenceExpressionListMember')' - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement stringBuilder.Append("# "); stringBuilder.Append("( "); // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement stringBuilder.Append(") "); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InteractionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InteractionTextualNotationBuilder.cs index 2f1a4f53..90481249 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InteractionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InteractionTextualNotationBuilder.cs @@ -29,42 +29,26 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class InteractionTextualNotationBuilder : TextualNotationBuilder + public static partial class InteractionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule Interaction + /// Interaction=TypePrefix'interaction'ClassifierDeclarationTypeBody /// - /// The used to query textual notation of referenced - public InteractionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Interactions.Interaction poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : Interaction=TypePrefix'interaction'ClassifierDeclarationTypeBody - - - - // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* - - + // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* + TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); stringBuilder.Append("interaction "); - // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* - - - // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' - - + // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* + ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); + // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceDefinitionTextualNotationBuilder.cs index 7be9e7cf..2164c9aa 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceDefinitionTextualNotationBuilder.cs @@ -29,41 +29,27 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class InterfaceDefinitionTextualNotationBuilder : TextualNotationBuilder + public static partial class InterfaceDefinitionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule InterfaceDefinition + /// InterfaceDefinition=OccurrenceDefinitionPrefix'interface''def'DefinitionDeclarationInterfaceBody /// - /// The used to query textual notation of referenced - public InterfaceDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Interfaces.InterfaceDefinition poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : InterfaceDefinition=OccurrenceDefinitionPrefix'interface''def'DefinitionDeclarationInterfaceBody - - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* - - + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("interface "); stringBuilder.Append("def "); - // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? - - - // non Terminal : InterfaceBody; Found rule InterfaceBody:Type=';'|'{'InterfaceBodyItem*'}' - - + // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); + // non Terminal : InterfaceBody; Found rule InterfaceBody:Type=';'|'{'InterfaceBodyItem*'}' + TypeTextualNotationBuilder.BuildInterfaceBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs index c8503112..8c664e03 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs @@ -29,40 +29,87 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class InterfaceUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class InterfaceUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule InterfaceUsageDeclaration + /// InterfaceUsageDeclaration:InterfaceUsage=UsageDeclarationValuePart?('connect'InterfacePart)?|InterfacePart /// - /// The used to query textual notation of referenced - public InterfaceUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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 provided + /// Builds the Textual Notation string for the rule InterfacePart + /// InterfacePart:InterfaceUsage=BinaryInterfacePart|NaryInterfacePart /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Interfaces.InterfaceUsage poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : InterfaceUsage=OccurrenceUsagePrefix'interface'InterfaceUsageDeclarationInterfaceBody - - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + 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) + { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append("to "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - stringBuilder.Append("interface "); - // non Terminal : InterfaceUsageDeclaration; Found rule InterfaceUsageDeclaration:InterfaceUsage=UsageDeclarationValuePart?('connect'InterfacePart)?|InterfacePart + } + /// + /// 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) + { + stringBuilder.Append("( "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(", "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Group Element + stringBuilder.Append(", "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // non Terminal : InterfaceBody; Found rule InterfaceBody:Type=';'|'{'InterfaceBodyItem*'}' + 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) + { + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + stringBuilder.Append("interface "); + // non Terminal : InterfaceUsageDeclaration; Found rule InterfaceUsageDeclaration:InterfaceUsage=UsageDeclarationValuePart?('connect'InterfacePart)?|InterfacePart + BuildInterfaceUsageDeclaration(poco, stringBuilder); + // non Terminal : InterfaceBody; Found rule InterfaceBody:Type=';'|'{'InterfaceBodyItem*'}' + TypeTextualNotationBuilder.BuildInterfaceBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IntersectingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IntersectingTextualNotationBuilder.cs index bac35b11..60267aeb 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IntersectingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IntersectingTextualNotationBuilder.cs @@ -29,32 +29,19 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class IntersectingTextualNotationBuilder : TextualNotationBuilder + public static partial class IntersectingTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule Intersecting + /// Intersecting=intersectingType=[QualifiedName]|ownedRelatedElement+=OwnedFeatureChain /// - /// The used to query textual notation of referenced - public IntersectingTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Types.Intersecting poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : Intersecting=intersectingType=[QualifiedName]|ownedRelatedElement+=OwnedFeatureChain - - // Assignment Element : intersectingType = - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - - return stringBuilder.ToString(); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs index db278abc..761ecea4 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs @@ -29,50 +29,36 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class InvariantTextualNotationBuilder : TextualNotationBuilder + public static partial class InvariantTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule Invariant + /// Invariant=FeaturePrefix'inv'('true'|isNegated?='false')?FeatureDeclarationValuePart?FunctionBody /// - /// The used to query textual notation of referenced - public InvariantTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Functions.Invariant poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : Invariant=FeaturePrefix'inv'('true'|isNegated?='false')?FeatureDeclarationValuePart?FunctionBody - - - - - - // non Terminal : FeaturePrefix; Found rule FeaturePrefix=(EndFeaturePrefix(ownedRelationship+=OwnedCrossFeatureMember)?|BasicFeaturePrefix)(ownedRelationship+=PrefixMetadataMember)* - - + // non Terminal : FeaturePrefix; Found rule FeaturePrefix=(EndFeaturePrefix(ownedRelationship+=OwnedCrossFeatureMember)?|BasicFeaturePrefix)(ownedRelationship+=PrefixMetadataMember)* + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement stringBuilder.Append("inv "); - // Group Element - // non Terminal : FeatureDeclaration; Found rule FeatureDeclaration:Feature=(isSufficient?='all')?(FeatureIdentification(FeatureSpecializationPart|ConjugationPart)?|FeatureSpecializationPart|ConjugationPart)FeatureRelationshipPart* - - - // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue - - - // non Terminal : FunctionBody; Found rule FunctionBody:Type=';'|'{'FunctionBodyPart'}' - - + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // non Terminal : FeatureDeclaration; Found rule FeatureDeclaration:Feature=(isSufficient?='all')?(FeatureIdentification(FeatureSpecializationPart|ConjugationPart)?|FeatureSpecializationPart|ConjugationPart)FeatureRelationshipPart* + FeatureTextualNotationBuilder.BuildFeatureDeclaration(poco, stringBuilder); + // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue + FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + // non Terminal : FunctionBody; Found rule FunctionBody:Type=';'|'{'FunctionBodyPart'}' + TypeTextualNotationBuilder.BuildFunctionBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs index 6b67bfbb..dcbb525f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs @@ -29,35 +29,45 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class InvocationExpressionTextualNotationBuilder : TextualNotationBuilder + public static partial class InvocationExpressionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule FunctionOperationExpression + /// FunctionOperationExpression:InvocationExpression=ownedRelationship+=PrimaryArgumentMember'->'ownedRelationship+=InvocationTypeMember(ownedRelationship+=BodyArgumentMember|ownedRelationship+=FunctionReferenceArgumentMember|ArgumentList)ownedRelationship+=EmptyResultMember /// - /// The used to query textual notation of referenced - public InvocationExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append("-> "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule InvocationExpression + /// InvocationExpression:InvocationExpression=ownedRelationship+=InstantiatedTypeMemberArgumentListownedRelationship+=EmptyResultMember /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.InvocationExpression poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : InvocationExpression:InvocationExpression=ownedRelationship+=InstantiatedTypeMemberArgumentListownedRelationship+=EmptyResultMember - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // non Terminal : ArgumentList; Found rule ArgumentList:Feature='('(PositionalArgumentList|NamedArgumentList)?')' - - + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // non Terminal : ArgumentList; Found rule ArgumentList:Feature='('(PositionalArgumentList|NamedArgumentList)?')' + FeatureTextualNotationBuilder.BuildArgumentList(poco, stringBuilder); // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemDefinitionTextualNotationBuilder.cs index d9fbbedf..d9459d04 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemDefinitionTextualNotationBuilder.cs @@ -29,38 +29,25 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class ItemDefinitionTextualNotationBuilder : TextualNotationBuilder + public static partial class ItemDefinitionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule ItemDefinition + /// ItemDefinition=OccurrenceDefinitionPrefix'item''def'Definition /// - /// The used to query textual notation of referenced - public ItemDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Items.ItemDefinition poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : ItemDefinition=OccurrenceDefinitionPrefix'item''def'Definition - - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* - - + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("item "); stringBuilder.Append("def "); - // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody - - + // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody + DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemUsageTextualNotationBuilder.cs index 49a66600..147f8534 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemUsageTextualNotationBuilder.cs @@ -29,39 +29,24 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class ItemUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class ItemUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule ItemUsage + /// ItemUsage=OccurrenceUsagePrefix'item'Usage /// - /// The used to query textual notation of referenced - public ItemUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Items.ItemUsage poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : ItemUsage=OccurrenceUsagePrefix'item'Usage - - - - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* - - + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("item "); - // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion - - + // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion + UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/JoinNodeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/JoinNodeTextualNotationBuilder.cs index 7debc859..dd822154 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/JoinNodeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/JoinNodeTextualNotationBuilder.cs @@ -29,40 +29,27 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class JoinNodeTextualNotationBuilder : TextualNotationBuilder + public static partial class JoinNodeTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule JoinNode + /// JoinNode=ControlNodePrefixisComposite?='join'UsageDeclarationActionBody /// - /// The used to query textual notation of referenced - public JoinNodeTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.JoinNode poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : JoinNode=ControlNodePrefixisComposite?='join'UsageDeclarationActionBody - - // non Terminal : ControlNodePrefix; Found rule ControlNodePrefix:OccurrenceUsage=RefPrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* - - + // non Terminal : ControlNodePrefix; Found rule ControlNodePrefix:OccurrenceUsage=RefPrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildControlNodePrefix(poco, stringBuilder); // Assignment Element : isComposite ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? - - - // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' - - + // If property isComposite value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' + TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LibraryPackageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LibraryPackageTextualNotationBuilder.cs index 0047e9b6..901adcce 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LibraryPackageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LibraryPackageTextualNotationBuilder.cs @@ -29,39 +29,32 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class LibraryPackageTextualNotationBuilder : TextualNotationBuilder + public static partial class LibraryPackageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule LibraryPackage + /// LibraryPackage=(isStandard?='standard')'library'(ownedRelationship+=PrefixMetadataMember)*PackageDeclarationPackageBody /// - /// The used to query textual notation of referenced - public LibraryPackageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Packages.LibraryPackage poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : LibraryPackage=(isStandard?='standard')'library'(ownedRelationship+=PrefixMetadataMember)*PackageDeclarationPackageBody + // Group Element + // Assignment Element : isStandard ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // If property isStandard value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // Group Element stringBuilder.Append("library "); - // Group Element - // non Terminal : PackageDeclaration; Found rule PackageDeclaration:Package='package'Identification - - - // non Terminal : PackageBody; Found rule PackageBody:Package=';'|'{'PackageBodyElement*'}' - + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // non Terminal : PackageDeclaration; Found rule PackageDeclaration:Package='package'Identification + PackageTextualNotationBuilder.BuildPackageDeclaration(poco, stringBuilder); + // non Terminal : PackageBody; Found rule PackageBody:Package=';'|'{'PackageBodyElement*'}' + PackageTextualNotationBuilder.BuildPackageBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralBooleanTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralBooleanTextualNotationBuilder.cs index 07718fec..8ec970c4 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralBooleanTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralBooleanTextualNotationBuilder.cs @@ -29,31 +29,21 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class LiteralBooleanTextualNotationBuilder : TextualNotationBuilder + public static partial class LiteralBooleanTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule LiteralBoolean + /// LiteralBoolean=value=BooleanValue /// - /// The used to query textual notation of referenced - public LiteralBooleanTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.LiteralBoolean poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : LiteralBoolean=value=BooleanValue - // Assignment Element : value = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property value value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralExpressionTextualNotationBuilder.cs index bcf9b3e0..7965c644 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralExpressionTextualNotationBuilder.cs @@ -29,49 +29,19 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class LiteralExpressionTextualNotationBuilder : TextualNotationBuilder + public static partial class LiteralExpressionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule LiteralExpression + /// LiteralExpression=LiteralBoolean|LiteralString|LiteralInteger|LiteralReal|LiteralInfinity /// - /// The used to query textual notation of referenced - public LiteralExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.LiteralExpression poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : LiteralExpression=LiteralBoolean|LiteralString|LiteralInteger|LiteralReal|LiteralInfinity - - // non Terminal : LiteralBoolean; Found rule LiteralBoolean=value=BooleanValue - - - // non Terminal : LiteralString; Found rule LiteralString=value=STRING_VALUE - - - // non Terminal : LiteralInteger; Found rule LiteralInteger=value=DECIMAL_VALUE - - - // non Terminal : LiteralReal; Found rule LiteralReal=value=RealValue - - - // non Terminal : LiteralInfinity; Found rule LiteralInfinity='*' - - - - - - - - return stringBuilder.ToString(); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralInfinityTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralInfinityTextualNotationBuilder.cs index f4170c85..55ea2a17 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralInfinityTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralInfinityTextualNotationBuilder.cs @@ -29,35 +29,20 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class LiteralInfinityTextualNotationBuilder : TextualNotationBuilder + public static partial class LiteralInfinityTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule LiteralInfinity + /// LiteralInfinity='*' /// - /// The used to query textual notation of referenced - public LiteralInfinityTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.LiteralInfinity poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : LiteralInfinity='*' - - - - - stringBuilder.Append("* "); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralIntegerTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralIntegerTextualNotationBuilder.cs index 8fc0645a..0b61f6ff 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralIntegerTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralIntegerTextualNotationBuilder.cs @@ -29,31 +29,21 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class LiteralIntegerTextualNotationBuilder : TextualNotationBuilder + public static partial class LiteralIntegerTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule LiteralInteger + /// LiteralInteger=value=DECIMAL_VALUE /// - /// The used to query textual notation of referenced - public LiteralIntegerTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.LiteralInteger poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : LiteralInteger=value=DECIMAL_VALUE - // Assignment Element : value = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property value value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralStringTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralStringTextualNotationBuilder.cs index 422861eb..11d80c82 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralStringTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralStringTextualNotationBuilder.cs @@ -29,31 +29,21 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class LiteralStringTextualNotationBuilder : TextualNotationBuilder + public static partial class LiteralStringTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule LiteralString + /// LiteralString=value=STRING_VALUE /// - /// The used to query textual notation of referenced - public LiteralStringTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.LiteralString poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : LiteralString=value=STRING_VALUE - // Assignment Element : value = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property value value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipExposeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipExposeTextualNotationBuilder.cs index b39165be..c9c8ccf1 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipExposeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipExposeTextualNotationBuilder.cs @@ -29,33 +29,21 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class MembershipExposeTextualNotationBuilder : TextualNotationBuilder + public static partial class MembershipExposeTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule MembershipExpose + /// MembershipExpose=MembershipImport /// - /// The used to query textual notation of referenced - public MembershipExposeTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Views.MembershipExpose poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : MembershipExpose=MembershipImport - - // non Terminal : MembershipImport; Found rule MembershipImport=importedMembership=[QualifiedName]('::'isRecursive?='**')? - - + // non Terminal : MembershipImport; Found rule MembershipImport=importedMembership=[QualifiedName]('::'isRecursive?='**')? + MembershipImportTextualNotationBuilder.BuildMembershipImport(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.cs index b1269203..95dba6bd 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.cs @@ -29,32 +29,26 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class MembershipImportTextualNotationBuilder : TextualNotationBuilder + public static partial class MembershipImportTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule MembershipImport + /// MembershipImport=importedMembership=[QualifiedName]('::'isRecursive?='**')? /// - /// The used to query textual notation of referenced - public MembershipImportTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Root.Namespaces.MembershipImport poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : MembershipImport=importedMembership=[QualifiedName]('::'isRecursive?='**')? + // Assignment Element : importedMembership = SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + // If property importedMembership value is set, print SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + // Group Element + stringBuilder.Append(":: "); + // Assignment Element : isRecursive ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // If property isRecursive value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // Assignment Element : importedMembership = - // Group Element - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs index 42cecd12..f74f88d1 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs @@ -29,28 +29,111 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class MembershipTextualNotationBuilder : TextualNotationBuilder + public static partial class MembershipTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule MemberPrefix + /// MemberPrefix:Membership=(visibility=VisibilityIndicator)? /// - /// The used to query textual notation of referenced - public MembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // Group Element + // Assignment Element : visibility = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property visibility value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + + } + + /// + /// 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) + { + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + BuildMemberPrefix(poco, stringBuilder); + stringBuilder.Append("alias "); + // Group Element + stringBuilder.Append("< "); + // Assignment Element : memberShortName = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property memberShortName value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append("> "); + + // Group Element + // Assignment Element : memberName = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property memberName value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + stringBuilder.Append("for "); + // Assignment Element : memberElement = SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + // If property memberElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' + 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 provided + /// Builds the Textual Notation string for the rule FeatureReferenceMember + /// FeatureReferenceMember:Membership=memberElement=FeatureReference /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Root.Namespaces.Membership poco) + /// 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) { - var stringBuilder = new StringBuilder(); + // Assignment Element : memberElement = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property memberElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - return stringBuilder.ToString(); + } + + /// + /// 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) + { + // Assignment Element : memberElement = SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + // If property memberElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + + } + + /// + /// 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"); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MergeNodeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MergeNodeTextualNotationBuilder.cs index af5187fa..f1f99737 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MergeNodeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MergeNodeTextualNotationBuilder.cs @@ -29,40 +29,27 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class MergeNodeTextualNotationBuilder : TextualNotationBuilder + public static partial class MergeNodeTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule MergeNode + /// MergeNode=ControlNodePrefixisComposite?='merge'UsageDeclarationActionBody /// - /// The used to query textual notation of referenced - public MergeNodeTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.MergeNode poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : MergeNode=ControlNodePrefixisComposite?='merge'UsageDeclarationActionBody - - // non Terminal : ControlNodePrefix; Found rule ControlNodePrefix:OccurrenceUsage=RefPrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* - - + // non Terminal : ControlNodePrefix; Found rule ControlNodePrefix:OccurrenceUsage=RefPrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildControlNodePrefix(poco, stringBuilder); // Assignment Element : isComposite ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? - - - // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' - - + // If property isComposite value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' + TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetaclassTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetaclassTextualNotationBuilder.cs index 84393832..0205deb3 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetaclassTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetaclassTextualNotationBuilder.cs @@ -29,40 +29,26 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class MetaclassTextualNotationBuilder : TextualNotationBuilder + public static partial class MetaclassTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule Metaclass + /// Metaclass=TypePrefix'metaclass'ClassifierDeclarationTypeBody /// - /// The used to query textual notation of referenced - public MetaclassTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Metadata.Metaclass poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : Metaclass=TypePrefix'metaclass'ClassifierDeclarationTypeBody - - // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* - - + // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* + TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); stringBuilder.Append("metaclass "); - // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* - - - // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' - - + // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* + ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); + // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataAccessExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataAccessExpressionTextualNotationBuilder.cs index d76685f5..5fa58924 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataAccessExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataAccessExpressionTextualNotationBuilder.cs @@ -29,33 +29,36 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class MetadataAccessExpressionTextualNotationBuilder : TextualNotationBuilder + public static partial class MetadataAccessExpressionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule MetadataReference + /// MetadataReference:MetadataAccessExpression=ownedRelationship+=ElementReferenceMember /// - /// The used to query textual notation of referenced - public MetadataAccessExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule MetadataAccessExpression + /// MetadataAccessExpression=ownedRelationship+=ElementReferenceMember'.''metadata' /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.MetadataAccessExpression poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : MetadataAccessExpression=ownedRelationship+=ElementReferenceMember'.''metadata' - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement stringBuilder.Append(". "); stringBuilder.Append("metadata "); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.cs index bc2c8720..8730c7f6 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.cs @@ -29,39 +29,29 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class MetadataDefinitionTextualNotationBuilder : TextualNotationBuilder + public static partial class MetadataDefinitionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule MetadataDefinition + /// MetadataDefinition=(isAbstract?='abstract')?DefinitionExtensionKeyword*'metadata''def'Definition /// - /// The used to query textual notation of referenced - public MetadataDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Metadata.MetadataDefinition poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : MetadataDefinition=(isAbstract?='abstract')?DefinitionExtensionKeyword*'metadata''def'Definition - - // Group Element - // non Terminal : DefinitionExtensionKeyword; Found rule DefinitionExtensionKeyword:Definition=ownedRelationship+=PrefixMetadataMember - + // Group Element + // Assignment Element : isAbstract ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // If property isAbstract value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // non Terminal : DefinitionExtensionKeyword; Found rule DefinitionExtensionKeyword:Definition=ownedRelationship+=PrefixMetadataMember + DefinitionTextualNotationBuilder.BuildDefinitionExtensionKeyword(poco, stringBuilder); stringBuilder.Append("metadata "); stringBuilder.Append("def "); - // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody - - + // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody + DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs index 62236c3a..0828421b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs @@ -29,39 +29,71 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class MetadataFeatureTextualNotationBuilder : TextualNotationBuilder + public static partial class MetadataFeatureTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule PrefixMetadataFeature + /// PrefixMetadataFeature:MetadataFeature=ownedRelationship+=OwnedFeatureTyping /// - /// The used to query textual notation of referenced - public MetadataFeatureTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule MetadataFeatureDeclaration + /// MetadataFeatureDeclaration:MetadataFeature=(Identification(':'|'typed''by'))?ownedRelationship+=OwnedFeatureTyping /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Metadata.MetadataFeature poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : MetadataFeature=(ownedRelationship+=PrefixMetadataMember)*('@'|'metadata')MetadataFeatureDeclaration('about'ownedRelationship+=Annotation(','ownedRelationship+=Annotation)*)?MetadataBody + // Group Element + // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Group Element - // Group Element - // non Terminal : MetadataFeatureDeclaration; Found rule MetadataFeatureDeclaration:MetadataFeature=(Identification(':'|'typed''by'))?ownedRelationship+=OwnedFeatureTyping + } + /// + /// 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) + { + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Group Element - // non Terminal : MetadataBody; Found rule MetadataBody:Type=';'|'{'(ownedRelationship+=DefinitionMember|ownedRelationship+=MetadataBodyUsageMember|ownedRelationship+=AliasMember|ownedRelationship+=Import)*'}' + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // non Terminal : MetadataFeatureDeclaration; Found rule MetadataFeatureDeclaration:MetadataFeature=(Identification(':'|'typed''by'))?ownedRelationship+=OwnedFeatureTyping + BuildMetadataFeatureDeclaration(poco, stringBuilder); + // Group Element + stringBuilder.Append("about "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Group Element + stringBuilder.Append(", "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // non Terminal : MetadataBody; Found rule MetadataBody:Type=';'|'{'(ownedRelationship+=DefinitionMember|ownedRelationship+=MetadataBodyUsageMember|ownedRelationship+=AliasMember|ownedRelationship+=Import)*'}' + TypeTextualNotationBuilder.BuildMetadataBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs index 40519a7d..e228b194 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs @@ -29,41 +29,69 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class MetadataUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class MetadataUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule PrefixMetadataUsage + /// PrefixMetadataUsage:MetadataUsage=ownedRelationship+=OwnedFeatureTyping /// - /// The used to query textual notation of referenced - public MetadataUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule MetadataUsageDeclaration + /// MetadataUsageDeclaration:MetadataUsage=(Identification(':'|'typed''by'))?ownedRelationship+=OwnedFeatureTyping /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Metadata.MetadataUsage poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : MetadataUsage=UsageExtensionKeyword*('@'|'metadata')MetadataUsageDeclaration('about'ownedRelationship+=Annotation(','ownedRelationship+=Annotation)*)?MetadataBody - - // non Terminal : UsageExtensionKeyword; Found rule UsageExtensionKeyword:Usage=ownedRelationship+=PrefixMetadataMember + // Group Element + // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Group Element - // non Terminal : MetadataUsageDeclaration; Found rule MetadataUsageDeclaration:MetadataUsage=(Identification(':'|'typed''by'))?ownedRelationship+=OwnedFeatureTyping - + } - // Group Element - // non Terminal : MetadataBody; Found rule MetadataBody:Type=';'|'{'(ownedRelationship+=DefinitionMember|ownedRelationship+=MetadataBodyUsageMember|ownedRelationship+=AliasMember|ownedRelationship+=Import)*'}' + /// + /// 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) + { + // non Terminal : UsageExtensionKeyword; Found rule UsageExtensionKeyword:Usage=ownedRelationship+=PrefixMetadataMember + UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, stringBuilder); + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // non Terminal : MetadataUsageDeclaration; Found rule MetadataUsageDeclaration:MetadataUsage=(Identification(':'|'typed''by'))?ownedRelationship+=OwnedFeatureTyping + BuildMetadataUsageDeclaration(poco, stringBuilder); + // Group Element + stringBuilder.Append("about "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Group Element + stringBuilder.Append(", "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // non Terminal : MetadataBody; Found rule MetadataBody:Type=';'|'{'(ownedRelationship+=DefinitionMember|ownedRelationship+=MetadataBodyUsageMember|ownedRelationship+=AliasMember|ownedRelationship+=Import)*'}' + TypeTextualNotationBuilder.BuildMetadataBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityRangeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityRangeTextualNotationBuilder.cs index cbecd043..e71cbe8b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityRangeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityRangeTextualNotationBuilder.cs @@ -29,34 +29,61 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class MultiplicityRangeTextualNotationBuilder : TextualNotationBuilder + public static partial class MultiplicityRangeTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule OwnedMultiplicityRange + /// OwnedMultiplicityRange:MultiplicityRange=MultiplicityBounds /// - /// The used to query textual notation of referenced - public MultiplicityRangeTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // non Terminal : MultiplicityBounds; Found rule MultiplicityBounds:MultiplicityRange='['(ownedRelationship+=MultiplicityExpressionMember'..')?ownedRelationship+=MultiplicityExpressionMember']' + BuildMultiplicityBounds(poco, stringBuilder); + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule MultiplicityBounds + /// MultiplicityBounds:MultiplicityRange='['(ownedRelationship+=MultiplicityExpressionMember'..')?ownedRelationship+=MultiplicityExpressionMember']' /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Multiplicities.MultiplicityRange poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : MultiplicityRange='['(ownedRelationship+=MultiplicityExpressionMember'..')?ownedRelationship+=MultiplicityExpressionMember']' + stringBuilder.Append("[ "); + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(".. "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + 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) + { stringBuilder.Append("[ "); - // Group Element + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(".. "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement stringBuilder.Append("] "); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityTextualNotationBuilder.cs index f35a4ebf..488e68ed 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityTextualNotationBuilder.cs @@ -29,36 +29,48 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class MultiplicityTextualNotationBuilder : TextualNotationBuilder + public static partial class MultiplicityTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule EmptyMultiplicity + /// EmptyMultiplicity:Multiplicity={} /// - /// The used to query textual notation of referenced - public MultiplicityTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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 provided + /// Builds the Textual Notation string for the rule MultiplicitySubset + /// MultiplicitySubset:Multiplicity='multiplicity'IdentificationSubsetsTypeBody /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Types.Multiplicity poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : Multiplicity=MultiplicitySubset|MultiplicityRange - - // non Terminal : MultiplicitySubset; Found rule MultiplicitySubset:Multiplicity='multiplicity'IdentificationSubsetsTypeBody - - - // non Terminal : MultiplicityRange; Found rule MultiplicityRange='['(ownedRelationship+=MultiplicityExpressionMember'..')?ownedRelationship+=MultiplicityExpressionMember']' - + stringBuilder.Append("multiplicity "); + // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + // non Terminal : Subsets; Found rule Subsets:Feature=SUBSETSownedRelationship+=OwnedSubsetting + FeatureTextualNotationBuilder.BuildSubsets(poco, stringBuilder); + // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); + } - return stringBuilder.ToString(); + /// + /// 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"); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceExposeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceExposeTextualNotationBuilder.cs index 23d907dc..3b0da7ef 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceExposeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceExposeTextualNotationBuilder.cs @@ -29,35 +29,21 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class NamespaceExposeTextualNotationBuilder : TextualNotationBuilder + public static partial class NamespaceExposeTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule NamespaceExpose + /// NamespaceExpose=NamespaceImport /// - /// The used to query textual notation of referenced - public NamespaceExposeTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Views.NamespaceExpose poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : NamespaceExpose=NamespaceImport - - - - // non Terminal : NamespaceImport; Found rule NamespaceImport=importedNamespace=[QualifiedName]'::''*'('::'isRecursive?='**')?|importedNamespace=FilterPackage{ownedRelatedElement+=importedNamespace} - - + // non Terminal : NamespaceImport; Found rule NamespaceImport=importedNamespace=[QualifiedName]'::''*'('::'isRecursive?='**')?|importedNamespace=FilterPackage{ownedRelatedElement+=importedNamespace} + NamespaceImportTextualNotationBuilder.BuildNamespaceImport(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceImportTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceImportTextualNotationBuilder.cs index 67559bb0..6bff3b6a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceImportTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceImportTextualNotationBuilder.cs @@ -29,36 +29,19 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class NamespaceImportTextualNotationBuilder : TextualNotationBuilder + public static partial class NamespaceImportTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule NamespaceImport + /// NamespaceImport=importedNamespace=[QualifiedName]'::''*'('::'isRecursive?='**')?|importedNamespace=FilterPackage{ownedRelatedElement+=importedNamespace} /// - /// The used to query textual notation of referenced - public NamespaceImportTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Root.Namespaces.NamespaceImport poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : NamespaceImport=importedNamespace=[QualifiedName]'::''*'('::'isRecursive?='**')?|importedNamespace=FilterPackage{ownedRelatedElement+=importedNamespace} - - // Assignment Element : importedNamespace = - stringBuilder.Append(":: "); - stringBuilder.Append("* "); - // Group Element - // Assignment Element : importedNamespace = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Assignment Element : ownedRelatedElement += importedNamespace - - return stringBuilder.ToString(); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs index b6d31697..fbd07bee 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs @@ -29,39 +29,76 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class NamespaceTextualNotationBuilder : TextualNotationBuilder + public static partial class NamespaceTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule RootNamespace + /// RootNamespace:Namespace=PackageBodyElement* /// - /// The used to query textual notation of referenced - public NamespaceTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // non Terminal : PackageBodyElement; Found rule PackageBodyElement:Package=ownedRelationship+=PackageMember|ownedRelationship+=ElementFilterMember|ownedRelationship+=AliasMember|ownedRelationship+=Import + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule NamespaceDeclaration + /// NamespaceDeclaration:Namespace='namespace'Identification /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Root.Namespaces.Namespace poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : Namespace=(ownedRelationship+=PrefixMetadataMember)*NamespaceDeclarationNamespaceBody - + stringBuilder.Append("namespace "); + // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + } - // Group Element - // non Terminal : NamespaceDeclaration; Found rule NamespaceDeclaration:Namespace='namespace'Identification - + /// + /// 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"); + } - // non Terminal : NamespaceBody; Found rule NamespaceBody:Namespace=';'|'{'NamespaceBodyElement*'}' + /// + /// 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) + { + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // non Terminal : NamespaceDeclaration; Found rule NamespaceDeclaration:Namespace='namespace'Identification + BuildNamespaceDeclaration(poco, stringBuilder); + // non Terminal : NamespaceBody; Found rule NamespaceBody:Namespace=';'|'{'NamespaceBodyElement*'}' + BuildNamespaceBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NullExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NullExpressionTextualNotationBuilder.cs index 56fbbf50..37b0a831 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NullExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NullExpressionTextualNotationBuilder.cs @@ -29,33 +29,19 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class NullExpressionTextualNotationBuilder : TextualNotationBuilder + public static partial class NullExpressionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule NullExpression + /// NullExpression:NullExpression='null'|'('')' /// - /// The used to query textual notation of referenced - public NullExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.NullExpression poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : NullExpression:NullExpression='null'|'('')' - - stringBuilder.Append("null "); - stringBuilder.Append("( "); - stringBuilder.Append(") "); - - return stringBuilder.ToString(); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ObjectiveMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ObjectiveMembershipTextualNotationBuilder.cs index ff11b993..a528eb54 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ObjectiveMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ObjectiveMembershipTextualNotationBuilder.cs @@ -29,28 +29,24 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class ObjectiveMembershipTextualNotationBuilder : TextualNotationBuilder + public static partial class ObjectiveMembershipTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule ObjectiveMember + /// ObjectiveMember:ObjectiveMembership=MemberPrefix'objective'ownedRelatedElement+=ObjectiveRequirementUsage /// - /// The used to query textual notation of referenced - public ObjectiveMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Cases.ObjectiveMembership poco) - { - var stringBuilder = new StringBuilder(); + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + stringBuilder.Append("objective "); + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs index 6873371f..76e5dd02 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs @@ -29,38 +29,68 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class OccurrenceDefinitionTextualNotationBuilder : TextualNotationBuilder + public static partial class OccurrenceDefinitionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule OccurrenceDefinitionPrefix + /// OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* /// - /// The used to query textual notation of referenced - public OccurrenceDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // non Terminal : BasicDefinitionPrefix; Found rule BasicDefinitionPrefix=isAbstract?='abstract'|isVariation?='variation' + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // Group Element + // Assignment Element : isIndividual ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // If property isIndividual value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + // non Terminal : DefinitionExtensionKeyword; Found rule DefinitionExtensionKeyword:Definition=ownedRelationship+=PrefixMetadataMember + DefinitionTextualNotationBuilder.BuildDefinitionExtensionKeyword(poco, stringBuilder); + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule IndividualDefinition + /// IndividualDefinition:OccurrenceDefinition=BasicDefinitionPrefix?isIndividual?='individual'DefinitionExtensionKeyword*'def'DefinitionownedRelationship+=EmptyMultiplicityMember /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Occurrences.OccurrenceDefinition poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : OccurrenceDefinition=OccurrenceDefinitionPrefix'occurrence''def'Definition - - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + // non Terminal : BasicDefinitionPrefix; Found rule BasicDefinitionPrefix=isAbstract?='abstract'|isVariation?='variation' + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // Assignment Element : isIndividual ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // If property isIndividual value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // non Terminal : DefinitionExtensionKeyword; Found rule DefinitionExtensionKeyword:Definition=ownedRelationship+=PrefixMetadataMember + DefinitionTextualNotationBuilder.BuildDefinitionExtensionKeyword(poco, stringBuilder); + stringBuilder.Append("def "); + // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody + DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + } + /// + /// 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) + { + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("occurrence "); stringBuilder.Append("def "); - // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody - - + // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody + DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs index ceb2725b..b6256367 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs @@ -29,37 +29,115 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class OccurrenceUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class OccurrenceUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule OccurrenceUsagePrefix + /// OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* /// - /// The used to query textual notation of referenced - public OccurrenceUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // non Terminal : BasicUsagePrefix; Found rule BasicUsagePrefix:Usage=RefPrefix(isReference?='ref')? + UsageTextualNotationBuilder.BuildBasicUsagePrefix(poco, stringBuilder); + // Group Element + // Assignment Element : isIndividual ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // If property isIndividual value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + + // Group Element + // Assignment Element : portionKind = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property portionKind value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Assignment Element : isPortion = true + + // non Terminal : UsageExtensionKeyword; Found rule UsageExtensionKeyword:Usage=ownedRelationship+=PrefixMetadataMember + UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, stringBuilder); + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule IndividualUsage + /// IndividualUsage:OccurrenceUsage=BasicUsagePrefixisIndividual?='individual'UsageExtensionKeyword*Usage /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Occurrences.OccurrenceUsage poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : OccurrenceUsage=OccurrenceUsagePrefix'occurrence'Usage + // non Terminal : BasicUsagePrefix; Found rule BasicUsagePrefix:Usage=RefPrefix(isReference?='ref')? + UsageTextualNotationBuilder.BuildBasicUsagePrefix(poco, stringBuilder); + // Assignment Element : isIndividual ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // If property isIndividual value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // non Terminal : UsageExtensionKeyword; Found rule UsageExtensionKeyword:Usage=ownedRelationship+=PrefixMetadataMember + UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, stringBuilder); + // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion + UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + } + /// + /// 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) + { + // non Terminal : BasicUsagePrefix; Found rule BasicUsagePrefix:Usage=RefPrefix(isReference?='ref')? + UsageTextualNotationBuilder.BuildBasicUsagePrefix(poco, stringBuilder); + // Group Element + // Assignment Element : isIndividual ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // If property isIndividual value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - stringBuilder.Append("occurrence "); - // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion + // Assignment Element : portionKind = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property portionKind value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // non Terminal : UsageExtensionKeyword; Found rule UsageExtensionKeyword:Usage=ownedRelationship+=PrefixMetadataMember + UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, stringBuilder); + // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion + UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); + // Assignment Element : isPortion = true + } + /// + /// 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) + { + // non Terminal : RefPrefix; Found rule RefPrefix:Usage=(direction=FeatureDirection)?(isDerived?='derived')?(isAbstract?='abstract'|isVariation?='variation')?(isConstant?='constant')? + UsageTextualNotationBuilder.BuildRefPrefix(poco, stringBuilder); + // Group Element + // Assignment Element : isIndividual ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // If property isIndividual value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + + // Group Element + // Assignment Element : portionKind = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property portionKind value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Assignment Element : isPortion = true + + // non Terminal : UsageExtensionKeyword; Found rule UsageExtensionKeyword:Usage=ownedRelationship+=PrefixMetadataMember + 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) + { + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + BuildOccurrenceUsagePrefix(poco, stringBuilder); + stringBuilder.Append("occurrence "); + // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion + UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OperatorExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OperatorExpressionTextualNotationBuilder.cs index 52d0c1b4..d4d0d3f7 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OperatorExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OperatorExpressionTextualNotationBuilder.cs @@ -29,28 +29,172 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class OperatorExpressionTextualNotationBuilder : TextualNotationBuilder + public static partial class OperatorExpressionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule ConditionalExpression + /// ConditionalExpression:OperatorExpression=operator='if'ownedRelationship+=ArgumentMember'?'ownedRelationship+=ArgumentExpressionMember'else'ownedRelationship+=ArgumentExpressionMemberownedRelationship+=EmptyResultMember /// - /// The used to query textual notation of referenced - public OperatorExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // Assignment Element : operator = SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // If property operator value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append("? "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append("else "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Assignment Element : operator = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property operator value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Assignment Element : operator = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property operator value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : operator = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property operator value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : operator = SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // If property operator value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Assignment Element : operator = SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // If property operator value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append("] "); + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule SequenceOperatorExpression + /// SequenceOperatorExpression:OperatorExpression=ownedRelationship+=OwnedExpressionMemberoperator=','ownedRelationship+=SequenceExpressionListMember /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.OperatorExpression poco) + /// 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) { - var stringBuilder = new StringBuilder(); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Assignment Element : operator = SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // If property operator value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs index 07cc56bc..4a4ad2e4 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs @@ -29,28 +29,237 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class OwningMembershipTextualNotationBuilder : TextualNotationBuilder + public static partial class OwningMembershipTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule AnnotatingMember + /// AnnotatingMember:OwningMembership=ownedRelatedElement+=AnnotatingElement /// - /// The used to query textual notation of referenced - public OwningMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + + } + + /// + /// 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) + { + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.GroupElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.GroupElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + stringBuilder.Append("# "); + // Assignment Element : ownedRelatedElement = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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 provided + /// Builds the Textual Notation string for the rule TypeFeatureMember + /// TypeFeatureMember:OwningMembership=MemberPrefix'member'ownedRelatedElement+=FeatureElement /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Root.Namespaces.OwningMembership poco) + /// 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) { - var stringBuilder = new StringBuilder(); + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + stringBuilder.Append("member "); + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs index 71aea619..355a2a4f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs @@ -29,37 +29,80 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class PackageTextualNotationBuilder : TextualNotationBuilder + public static partial class PackageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule PackageDeclaration + /// PackageDeclaration:Package='package'Identification /// - /// The used to query textual notation of referenced - public PackageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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 "); + // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule PackageBody + /// PackageBody:Package=';'|'{'PackageBodyElement*'}' /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Packages.Package poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : Package=(ownedRelationship+=PrefixMetadataMember)*PackageDeclarationPackageBody + 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"); + } - // Group Element - // non Terminal : PackageDeclaration; Found rule PackageDeclaration:Package='package'Identification + /// + /// 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) + { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // non Terminal : PackageBody; Found rule PackageBody:Package=';'|'{'PackageBodyElement*'}' + } + /// + /// 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) + { + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // non Terminal : PackageDeclaration; Found rule PackageDeclaration:Package='package'Identification + BuildPackageDeclaration(poco, stringBuilder); + // non Terminal : PackageBody; Found rule PackageBody:Package=';'|'{'PackageBodyElement*'}' + BuildPackageBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ParameterMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ParameterMembershipTextualNotationBuilder.cs index 9d64fb11..b015f440 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ParameterMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ParameterMembershipTextualNotationBuilder.cs @@ -29,28 +29,216 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class ParameterMembershipTextualNotationBuilder : TextualNotationBuilder + public static partial class ParameterMembershipTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule MessageEventMember + /// MessageEventMember:ParameterMembership=ownedRelatedElement+=MessageEvent /// - /// The used to query textual notation of referenced - public ParameterMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedMemberParameter = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedMemberParameter value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedMemberFeature = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedMemberFeature value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedMemberParameter = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedMemberParameter value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedMemberParameter = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedMemberParameter value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedMemberParameter = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedMemberParameter value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule FunctionReferenceArgumentMember + /// FunctionReferenceArgumentMember:ParameterMembership=ownedMemberParameter=FunctionReferenceArgument /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Behaviors.ParameterMembership poco) + /// 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) { - var stringBuilder = new StringBuilder(); + // Assignment Element : ownedMemberParameter = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedMemberParameter value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartDefinitionTextualNotationBuilder.cs index 20d9546f..2472661b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartDefinitionTextualNotationBuilder.cs @@ -29,38 +29,25 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class PartDefinitionTextualNotationBuilder : TextualNotationBuilder + public static partial class PartDefinitionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule PartDefinition + /// PartDefinition=OccurrenceDefinitionPrefix'part''def'Definition /// - /// The used to query textual notation of referenced - public PartDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Parts.PartDefinition poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : PartDefinition=OccurrenceDefinitionPrefix'part''def'Definition - - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* - - + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("part "); stringBuilder.Append("def "); - // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody - - + // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody + DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartUsageTextualNotationBuilder.cs index 2252af43..b09bd8dc 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartUsageTextualNotationBuilder.cs @@ -29,39 +29,56 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class PartUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class PartUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule ActorUsage + /// ActorUsage:PartUsage='actor'UsageExtensionKeyword*Usage /// - /// The used to query textual notation of referenced - public PartUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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 "); + // non Terminal : UsageExtensionKeyword; Found rule UsageExtensionKeyword:Usage=ownedRelationship+=PrefixMetadataMember + UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, stringBuilder); + // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion + UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule StakeholderUsage + /// StakeholderUsage:PartUsage='stakeholder'UsageExtensionKeyword*Usage /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Parts.PartUsage poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : PartUsage=OccurrenceUsagePrefix'part'Usage - - - - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + stringBuilder.Append("stakeholder "); + // non Terminal : UsageExtensionKeyword; Found rule UsageExtensionKeyword:Usage=ownedRelationship+=PrefixMetadataMember + UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, stringBuilder); + // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion + 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) + { + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("part "); - // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion - - + // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion + UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PayloadFeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PayloadFeatureTextualNotationBuilder.cs index fa3ac495..3192759d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PayloadFeatureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PayloadFeatureTextualNotationBuilder.cs @@ -29,43 +29,21 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class PayloadFeatureTextualNotationBuilder : TextualNotationBuilder + public static partial class PayloadFeatureTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule FlowPayloadFeature + /// FlowPayloadFeature:PayloadFeature=PayloadFeature /// - /// The used to query textual notation of referenced - public PayloadFeatureTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Interactions.PayloadFeature poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : PayloadFeature:Feature=Identification?PayloadFeatureSpecializationPartValuePart?|ownedRelationship+=OwnedFeatureTyping(ownedRelationship+=OwnedMultiplicity)?|ownedRelationship+=OwnedMultiplicityownedRelationship+=OwnedFeatureTyping - - // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? - - - // non Terminal : PayloadFeatureSpecializationPart; Found rule PayloadFeatureSpecializationPart:Feature=(FeatureSpecialization)+MultiplicityPart?FeatureSpecialization*|MultiplicityPartFeatureSpecialization+ - - - // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue - - - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Group Element - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // non Terminal : PayloadFeature; Found rule PayloadFeature:Feature=Identification?PayloadFeatureSpecializationPartValuePart?|ownedRelationship+=OwnedFeatureTyping(ownedRelationship+=OwnedMultiplicity)?|ownedRelationship+=OwnedMultiplicityownedRelationship+=OwnedFeatureTyping + FeatureTextualNotationBuilder.BuildPayloadFeature(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PerformActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PerformActionUsageTextualNotationBuilder.cs index 44c02c21..546dece4 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PerformActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PerformActionUsageTextualNotationBuilder.cs @@ -29,40 +29,75 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class PerformActionUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class PerformActionUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule PerformActionUsageDeclaration + /// PerformActionUsageDeclaration:PerformActionUsage=(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'action'UsageDeclaration)ValuePart? /// - /// The used to query textual notation of referenced - public PerformActionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue + FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule StatePerformActionUsage + /// StatePerformActionUsage:PerformActionUsage=PerformActionUsageDeclarationActionBody /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.PerformActionUsage poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : PerformActionUsage=OccurrenceUsagePrefix'perform'PerformActionUsageDeclarationActionBody - - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + // non Terminal : PerformActionUsageDeclaration; Found rule PerformActionUsageDeclaration:PerformActionUsage=(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'action'UsageDeclaration)ValuePart? + BuildPerformActionUsageDeclaration(poco, stringBuilder); + // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' + TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); + } - stringBuilder.Append("perform "); - // non Terminal : PerformActionUsageDeclaration; Found rule PerformActionUsageDeclaration:PerformActionUsage=(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'action'UsageDeclaration)ValuePart? - + /// + /// 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) + { + // non Terminal : PerformActionUsageDeclaration; Found rule PerformActionUsageDeclaration:PerformActionUsage=(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'action'UsageDeclaration)ValuePart? + BuildPerformActionUsageDeclaration(poco, stringBuilder); + // Group Element + stringBuilder.Append("{ "); + // non Terminal : ActionBodyItem; Found rule ActionBodyItem:Type=NonBehaviorBodyItem|ownedRelationship+=InitialNodeMember(ownedRelationship+=ActionTargetSuccessionMember)*|(ownedRelationship+=SourceSuccessionMember)?ownedRelationship+=ActionBehaviorMember(ownedRelationship+=ActionTargetSuccessionMember)*|ownedRelationship+=GuardedSuccessionMember + TypeTextualNotationBuilder.BuildActionBodyItem(poco, stringBuilder); + stringBuilder.Append("} "); - // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' + } + /// + /// 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) + { + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + stringBuilder.Append("perform "); + // non Terminal : PerformActionUsageDeclaration; Found rule PerformActionUsageDeclaration:PerformActionUsage=(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'action'UsageDeclaration)ValuePart? + BuildPerformActionUsageDeclaration(poco, stringBuilder); + // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' + TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortConjugationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortConjugationTextualNotationBuilder.cs index b6a7cf10..3994a9db 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortConjugationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortConjugationTextualNotationBuilder.cs @@ -29,30 +29,19 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class PortConjugationTextualNotationBuilder : TextualNotationBuilder + public static partial class PortConjugationTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule PortConjugation + /// PortConjugation={} /// - /// The used to query textual notation of referenced - public PortConjugationTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Ports.PortConjugation poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : PortConjugation={} - - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortDefinitionTextualNotationBuilder.cs index d443a055..17fd78ab 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortDefinitionTextualNotationBuilder.cs @@ -29,42 +29,28 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class PortDefinitionTextualNotationBuilder : TextualNotationBuilder + public static partial class PortDefinitionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule PortDefinition + /// PortDefinition=DefinitionPrefix'port''def'DefinitionownedRelationship+=ConjugatedPortDefinitionMember{conjugatedPortDefinition.ownedPortConjugator.originalPortDefinition=this} /// - /// The used to query textual notation of referenced - public PortDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Ports.PortDefinition poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : PortDefinition=DefinitionPrefix'port''def'DefinitionownedRelationship+=ConjugatedPortDefinitionMember{conjugatedPortDefinition.ownedPortConjugator.originalPortDefinition=this} - - - - // non Terminal : DefinitionPrefix; Found rule DefinitionPrefix:Definition=BasicDefinitionPrefix?DefinitionExtensionKeyword* - - + // non Terminal : DefinitionPrefix; Found rule DefinitionPrefix:Definition=BasicDefinitionPrefix?DefinitionExtensionKeyword* + DefinitionTextualNotationBuilder.BuildDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("port "); stringBuilder.Append("def "); - // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody - - + // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody + DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement // Assignment Element : conjugatedPortDefinition.ownedPortConjugator.originalPortDefinition = this - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs index 4a0d4854..07e78c98 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs @@ -29,37 +29,62 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class PortUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class PortUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule DefaultInterfaceEnd + /// DefaultInterfaceEnd:PortUsage=isEnd?='end'Usage /// - /// The used to query textual notation of referenced - public PortUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // Assignment Element : isEnd ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // If property isEnd value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion + UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule InterfaceEnd + /// InterfaceEnd:PortUsage=(ownedRelationship+=OwnedCrossMultiplicityMember)?(declaredName=NAMEREFERENCES)?ownedRelationship+=OwnedReferenceSubsetting /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Ports.PortUsage poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : PortUsage=OccurrenceUsagePrefix'port'Usage - - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Group Element + // Assignment Element : declaredName = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property declaredName value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // non Terminal : REFERENCES; Found rule REFERENCES='::>'|'references' + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - stringBuilder.Append("port "); - // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + } + /// + /// 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) + { + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + stringBuilder.Append("port "); + // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion + UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortionKindTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortionKindTextualNotationBuilder.cs new file mode 100644 index 00000000..438b4df7 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortionKindTextualNotationBuilder.cs @@ -0,0 +1,51 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// 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.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 index b6e0ab28..6a7769ba 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PredicateTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PredicateTextualNotationBuilder.cs @@ -29,42 +29,26 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class PredicateTextualNotationBuilder : TextualNotationBuilder + public static partial class PredicateTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule Predicate + /// Predicate=TypePrefix'predicate'ClassifierDeclarationFunctionBody /// - /// The used to query textual notation of referenced - public PredicateTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Functions.Predicate poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : Predicate=TypePrefix'predicate'ClassifierDeclarationFunctionBody - - - - // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* - - + // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* + TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); stringBuilder.Append("predicate "); - // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* - - - // non Terminal : FunctionBody; Found rule FunctionBody:Type=';'|'{'FunctionBodyPart'}' - - + // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* + ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); + // non Terminal : FunctionBody; Found rule FunctionBody:Type=';'|'{'FunctionBodyPart'}' + TypeTextualNotationBuilder.BuildFunctionBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs index c381fbd5..85da06d8 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs @@ -29,50 +29,70 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class RedefinitionTextualNotationBuilder : TextualNotationBuilder + public static partial class RedefinitionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule OwnedRedefinition + /// OwnedRedefinition:Redefinition=redefinedFeature=[QualifiedName]|redefinedFeature=OwnedFeatureChain{ownedRelatedElement+=redefinedFeature} /// - /// The used to query textual notation of referenced - public RedefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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 provided + /// Builds the Textual Notation string for the rule FlowFeatureRedefinition + /// FlowFeatureRedefinition:Redefinition=redefinedFeature=[QualifiedName] /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Features.Redefinition poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : Redefinition=('specialization'Identification)?'redefinition'SpecificTypeREDEFINESGeneralTypeRelationshipBody + // Assignment Element : redefinedFeature = SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + // If property redefinedFeature value is set, print SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement - // Group Element - stringBuilder.Append("redefinition "); - // non Terminal : SpecificType; Found rule SpecificType:Specialization=specific=[QualifiedName]|specific+=OwnedFeatureChain{ownedRelatedElement+=specific} - - - // non Terminal : REDEFINES; Found rule REDEFINES=':>>'|'redefines' - - - - - // non Terminal : GeneralType; Found rule GeneralType:Specialization=general=[QualifiedName]|general+=OwnedFeatureChain{ownedRelatedElement+=general} - - - - - // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' + } + /// + /// 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) + { + // Assignment Element : redefinedFeature = SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + // If property redefinedFeature value is set, print SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + } + /// + /// 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) + { + // Group Element + stringBuilder.Append("specialization "); + // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + stringBuilder.Append("redefinition "); + // non Terminal : SpecificType; Found rule SpecificType:Specialization=specific=[QualifiedName]|specific+=OwnedFeatureChain{ownedRelatedElement+=specific} + SpecializationTextualNotationBuilder.BuildSpecificType(poco, stringBuilder); + // non Terminal : REDEFINES; Found rule REDEFINES=':>>'|'redefines' + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // non Terminal : GeneralType; Found rule GeneralType:Specialization=general=[QualifiedName]|general+=OwnedFeatureChain{ownedRelatedElement+=general} + SpecializationTextualNotationBuilder.BuildGeneralType(poco, stringBuilder); + // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' + RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceSubsettingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceSubsettingTextualNotationBuilder.cs index 378d2a3d..a9365bea 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceSubsettingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceSubsettingTextualNotationBuilder.cs @@ -29,28 +29,30 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class ReferenceSubsettingTextualNotationBuilder : TextualNotationBuilder + public static partial class ReferenceSubsettingTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule OwnedReferenceSubsetting + /// OwnedReferenceSubsetting:ReferenceSubsetting=referencedFeature=[QualifiedName]|referencedFeature=OwnedFeatureChain{ownedRelatedElement+=referenceFeature} /// - /// The used to query textual notation of referenced - public ReferenceSubsettingTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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 provided + /// Builds the Textual Notation string for the rule FlowEndSubsetting + /// FlowEndSubsetting:ReferenceSubsetting=referencedFeature=[QualifiedName]|referencedFeature=FeatureChainPrefix{ownedRelatedElement+=referencedFeature} /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Features.ReferenceSubsetting poco) + /// 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) { - var stringBuilder = new StringBuilder(); - - return stringBuilder.ToString(); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs index 19fb28fe..14e9f6ad 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs @@ -29,35 +29,248 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class ReferenceUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class ReferenceUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule OwnedCrossFeature + /// OwnedCrossFeature:ReferenceUsage=BasicUsagePrefixUsageDeclaration /// - /// The used to query textual notation of referenced - public ReferenceUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // non Terminal : BasicUsagePrefix; Found rule BasicUsagePrefix:Usage=RefPrefix(isReference?='ref')? + UsageTextualNotationBuilder.BuildBasicUsagePrefix(poco, stringBuilder); + // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? + 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) + { + // non Terminal : RefPrefix; Found rule RefPrefix:Usage=(direction=FeatureDirection)?(isDerived?='derived')?(isAbstract?='abstract'|isVariation?='variation')?(isConstant?='constant')? + UsageTextualNotationBuilder.BuildRefPrefix(poco, stringBuilder); + // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion + 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) + { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // non Terminal : FeatureSpecialization; Found rule FeatureSpecialization:Feature=Typings|Subsettings|References|Crosses|Redefinitions + FeatureTextualNotationBuilder.BuildFeatureSpecialization(poco, stringBuilder); + // non Terminal : UsageBody; Found rule UsageBody:Usage=DefinitionBody + 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) + { + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + + } + + /// + /// 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) + { + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + // Group Element + // Assignment Element : declaredName = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property declaredName value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // non Terminal : REFERENCES; Found rule REFERENCES='::>'|'references' + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(". "); + + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule ForVariableDeclaration + /// ForVariableDeclaration:ReferenceUsage=UsageDeclaration /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.ReferenceUsage poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : ReferenceUsage=(EndUsagePrefix|RefPrefix)'ref'Usage + // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + + } - // Group Element + /// + /// 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 "); + // non Terminal : UsageExtensionKeyword; Found rule UsageExtensionKeyword:Usage=ownedRelationship+=PrefixMetadataMember + UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, stringBuilder); + // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion + 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) + { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { stringBuilder.Append("ref "); - // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // non Terminal : FeatureSpecializationPart; Found rule FeatureSpecializationPart:Feature=FeatureSpecialization+MultiplicityPart?FeatureSpecialization*|MultiplicityPartFeatureSpecialization* + FeatureTextualNotationBuilder.BuildFeatureSpecializationPart(poco, stringBuilder); + // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue + FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + // non Terminal : MetadataBody; Found rule MetadataBody:Type=';'|'{'(ownedRelationship+=DefinitionMember|ownedRelationship+=MetadataBodyUsageMember|ownedRelationship+=AliasMember|ownedRelationship+=Import)*'}' + 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) + { + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append("ref "); + // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion + UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RelationshipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RelationshipTextualNotationBuilder.cs new file mode 100644 index 00000000..515cedd6 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RelationshipTextualNotationBuilder.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.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 index d68aeb78..327438b7 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingDefinitionTextualNotationBuilder.cs @@ -29,38 +29,25 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class RenderingDefinitionTextualNotationBuilder : TextualNotationBuilder + public static partial class RenderingDefinitionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule RenderingDefinition + /// RenderingDefinition=OccurrenceDefinitionPrefix'rendering''def'Definition /// - /// The used to query textual notation of referenced - public RenderingDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Views.RenderingDefinition poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : RenderingDefinition=OccurrenceDefinitionPrefix'rendering''def'Definition - - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* - - + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("rendering "); stringBuilder.Append("def "); - // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody - - + // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody + DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingUsageTextualNotationBuilder.cs index 0093a76a..07f3ad6a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingUsageTextualNotationBuilder.cs @@ -29,39 +29,35 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class RenderingUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class RenderingUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule ViewRenderingUsage + /// ViewRenderingUsage:RenderingUsage=ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?UsageBody|(UsageExtensionKeyword*'rendering'|UsageExtensionKeyword+)Usage /// - /// The used to query textual notation of referenced - public RenderingUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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 provided + /// Builds the Textual Notation string for the rule RenderingUsage + /// RenderingUsage=OccurrenceUsagePrefix'rendering'Usage /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Views.RenderingUsage poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : RenderingUsage=OccurrenceUsagePrefix'rendering'Usage - - - - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* - - + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("rendering "); - // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion - - + // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion + UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.cs index 3be5c9fa..26a4e00a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.cs @@ -29,28 +29,36 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class RequirementConstraintMembershipTextualNotationBuilder : TextualNotationBuilder + public static partial class RequirementConstraintMembershipTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule RequirementConstraintMember + /// RequirementConstraintMember:RequirementConstraintMembership=MemberPrefix?RequirementKindownedRelatedElement+=RequirementConstraintUsage /// - /// The used to query textual notation of referenced - public RequirementConstraintMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + // non Terminal : RequirementKind; Found rule RequirementKind:RequirementConstraintMembership='assume'{kind='assumption'}|'require'{kind='requirement'} + BuildRequirementKind(poco, stringBuilder); + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule RequirementKind + /// RequirementKind:RequirementConstraintMembership='assume'{kind='assumption'}|'require'{kind='requirement'} /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Requirements.RequirementConstraintMembership poco) + /// 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) { - var stringBuilder = new StringBuilder(); - - return stringBuilder.ToString(); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementDefinitionTextualNotationBuilder.cs index d891905f..9cabc030 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementDefinitionTextualNotationBuilder.cs @@ -29,41 +29,27 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class RequirementDefinitionTextualNotationBuilder : TextualNotationBuilder + public static partial class RequirementDefinitionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule RequirementDefinition + /// RequirementDefinition=OccurrenceDefinitionPrefix'requirement''def'DefinitionDeclarationRequirementBody /// - /// The used to query textual notation of referenced - public RequirementDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Requirements.RequirementDefinition poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : RequirementDefinition=OccurrenceDefinitionPrefix'requirement''def'DefinitionDeclarationRequirementBody - - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* - - + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("requirement "); stringBuilder.Append("def "); - // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? - - - // non Terminal : RequirementBody; Found rule RequirementBody:Type=';'|'{'RequirementBodyItem*'}' - - + // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); + // non Terminal : RequirementBody; Found rule RequirementBody:Type=';'|'{'RequirementBodyItem*'}' + TypeTextualNotationBuilder.BuildRequirementBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementUsageTextualNotationBuilder.cs index b400dc7c..eac6fee0 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementUsageTextualNotationBuilder.cs @@ -29,44 +29,54 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class RequirementUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class RequirementUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule ObjectiveRequirementUsage + /// ObjectiveRequirementUsage:RequirementUsage=UsageExtensionKeyword*ConstraintUsageDeclarationRequirementBody /// - /// The used to query textual notation of referenced - public RequirementUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // non Terminal : UsageExtensionKeyword; Found rule UsageExtensionKeyword:Usage=ownedRelationship+=PrefixMetadataMember + UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, stringBuilder); + // non Terminal : ConstraintUsageDeclaration; Found rule ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? + ConstraintUsageTextualNotationBuilder.BuildConstraintUsageDeclaration(poco, stringBuilder); + // non Terminal : RequirementBody; Found rule RequirementBody:Type=';'|'{'RequirementBodyItem*'}' + TypeTextualNotationBuilder.BuildRequirementBody(poco, stringBuilder); + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule RequirementVerificationUsage + /// RequirementVerificationUsage:RequirementUsage=ownedRelationship+=OwnedReferenceSubsettingFeatureSpecialization*RequirementBody|(UsageExtensionKeyword*'requirement'|UsageExtensionKeyword+)ConstraintUsageDeclarationRequirementBody /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Requirements.RequirementUsage poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : RequirementUsage=OccurrenceUsagePrefix'requirement'ConstraintUsageDeclarationRequirementBody - - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* - + 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) + { + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("requirement "); - // non Terminal : ConstraintUsageDeclaration; Found rule ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? - - - - - - - // non Terminal : RequirementBody; Found rule RequirementBody:Type=';'|'{'RequirementBodyItem*'}' - - + // non Terminal : ConstraintUsageDeclaration; Found rule ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? + ConstraintUsageTextualNotationBuilder.BuildConstraintUsageDeclaration(poco, stringBuilder); + // non Terminal : RequirementBody; Found rule RequirementBody:Type=';'|'{'RequirementBodyItem*'}' + TypeTextualNotationBuilder.BuildRequirementBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementVerificationMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementVerificationMembershipTextualNotationBuilder.cs index f4a28e3e..eff80fd3 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementVerificationMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementVerificationMembershipTextualNotationBuilder.cs @@ -29,28 +29,25 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class RequirementVerificationMembershipTextualNotationBuilder : TextualNotationBuilder + public static partial class RequirementVerificationMembershipTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule RequirementVerificationMember + /// RequirementVerificationMember:RequirementVerificationMembership=MemberPrefix'verify'{kind='requirement'}ownedRelatedElement+=RequirementVerificationUsage /// - /// The used to query textual notation of referenced - public RequirementVerificationMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.VerificationCases.RequirementVerificationMembership poco) - { - var stringBuilder = new StringBuilder(); + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + stringBuilder.Append("verify "); + // Assignment Element : kind = 'requirement' + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ResultExpressionMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ResultExpressionMembershipTextualNotationBuilder.cs index b4a3e1cd..f8f176bb 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ResultExpressionMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ResultExpressionMembershipTextualNotationBuilder.cs @@ -29,28 +29,23 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class ResultExpressionMembershipTextualNotationBuilder : TextualNotationBuilder + public static partial class ResultExpressionMembershipTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule ResultExpressionMember + /// ResultExpressionMember:ResultExpressionMembership=MemberPrefix?ownedRelatedElement+=OwnedExpression /// - /// The used to query textual notation of referenced - public ResultExpressionMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Functions.ResultExpressionMembership poco) - { - var stringBuilder = new StringBuilder(); + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReturnParameterMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReturnParameterMembershipTextualNotationBuilder.cs index c4d4b05a..7000f70f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReturnParameterMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReturnParameterMembershipTextualNotationBuilder.cs @@ -29,28 +29,66 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class ReturnParameterMembershipTextualNotationBuilder : TextualNotationBuilder + public static partial class ReturnParameterMembershipTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule ReturnParameterMember + /// ReturnParameterMember:ReturnParameterMembership=MemberPrefix?'return'ownedRelatedElement+=UsageElement /// - /// The used to query textual notation of referenced - public ReturnParameterMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + stringBuilder.Append("return "); + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + stringBuilder.Append("return "); + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule ConstructorResultMember + /// ConstructorResultMember:ReturnParameterMembership=ownedRelatedElement+=ConstructorResult /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Functions.ReturnParameterMembership poco) + /// 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) { - var stringBuilder = new StringBuilder(); + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.cs index c6a117f2..d8a0820d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.cs @@ -29,44 +29,38 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class SatisfyRequirementUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class SatisfyRequirementUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// 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 used to query textual notation of referenced - public SatisfyRequirementUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Requirements.SatisfyRequirementUsage poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : SatisfyRequirementUsage=OccurrenceUsagePrefix'assert'(isNegated?='not')'satisfy'(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'requirement'UsageDeclaration)ValuePart?('by'ownedRelationship+=SatisfactionSubjectMember)?RequirementBody - - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* - - + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("assert "); - // Group Element - stringBuilder.Append("satisfy "); - // Group Element - // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue - - - // Group Element - // non Terminal : RequirementBody; Found rule RequirementBody:Type=';'|'{'RequirementBodyItem*'}' + // Group Element + // Assignment Element : isNegated ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // If property isNegated value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + stringBuilder.Append("satisfy "); + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue + FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + // Group Element + stringBuilder.Append("by "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // non Terminal : RequirementBody; Found rule RequirementBody:Type=';'|'{'RequirementBodyItem*'}' + TypeTextualNotationBuilder.BuildRequirementBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SelectExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SelectExpressionTextualNotationBuilder.cs index 95ad32bd..a5070298 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SelectExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SelectExpressionTextualNotationBuilder.cs @@ -29,33 +29,24 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class SelectExpressionTextualNotationBuilder : TextualNotationBuilder + public static partial class SelectExpressionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule SelectExpression + /// SelectExpression=ownedRelationship+=PrimaryArgumentMember'.?'ownedRelationship+=BodyArgumentMember /// - /// The used to query textual notation of referenced - public SelectExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Expressions.SelectExpression poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : SelectExpression=ownedRelationship+=PrimaryArgumentMember'.?'ownedRelationship+=BodyArgumentMember - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement stringBuilder.Append(".? "); // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.cs index d2ba96e3..1c64068f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.cs @@ -29,28 +29,91 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class SendActionUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class SendActionUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule SendNode + /// SendNode:SendActionUsage=OccurrenceUsagePrefixActionUsageDeclaration?'send'(ownedRelationship+=NodeParameterMemberSenderReceiverPart?|ownedRelationship+=EmptyParameterMemberSenderReceiverPart)?ActionBody /// - /// The used to query textual notation of referenced - public SendActionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + // non Terminal : ActionUsageDeclaration; Found rule ActionUsageDeclaration:ActionUsage=UsageDeclarationValuePart? + ActionUsageTextualNotationBuilder.BuildActionUsageDeclaration(poco, stringBuilder); + stringBuilder.Append("send "); + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' + 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) + { + // non Terminal : ActionNodeUsageDeclaration; Found rule ActionNodeUsageDeclaration:ActionUsage='action'UsageDeclaration? + ActionUsageTextualNotationBuilder.BuildActionNodeUsageDeclaration(poco, stringBuilder); + stringBuilder.Append("send "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // non Terminal : SenderReceiverPart; Found rule SenderReceiverPart:SendActionUsage='via'ownedRelationship+=NodeParameterMember('to'ownedRelationship+=NodeParameterMember)?|ownedRelationship+=EmptyParameterMember'to'ownedRelationship+=NodeParameterMember + BuildSenderReceiverPart(poco, stringBuilder); + } /// - /// Builds the Textual Notation string for the provided + /// 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 textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.SendActionUsage poco) + /// 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) { - var stringBuilder = new 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) + { + // non Terminal : SendNodeDeclaration; Found rule SendNodeDeclaration:SendActionUsage=ActionNodeUsageDeclaration?'send'ownedRelationship+=NodeParameterMemberSenderReceiverPart? + BuildSendNodeDeclaration(poco, stringBuilder); + // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' + 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) + { + // non Terminal : SendNodeDeclaration; Found rule SendNodeDeclaration:SendActionUsage=ActionNodeUsageDeclaration?'send'ownedRelationship+=NodeParameterMemberSenderReceiverPart? + BuildSendNodeDeclaration(poco, stringBuilder); + // Group Element + stringBuilder.Append("{ "); + // non Terminal : ActionBodyItem; Found rule ActionBodyItem:Type=NonBehaviorBodyItem|ownedRelationship+=InitialNodeMember(ownedRelationship+=ActionTargetSuccessionMember)*|(ownedRelationship+=SourceSuccessionMember)?ownedRelationship+=ActionBehaviorMember(ownedRelationship+=ActionTargetSuccessionMember)*|ownedRelationship+=GuardedSuccessionMember + TypeTextualNotationBuilder.BuildActionBodyItem(poco, stringBuilder); + stringBuilder.Append("} "); + - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.cs index c2b7ad8d..37383b30 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.cs @@ -29,48 +29,68 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class SpecializationTextualNotationBuilder : TextualNotationBuilder + public static partial class SpecializationTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule OwnedSpecialization + /// OwnedSpecialization:Specialization=GeneralType /// - /// The used to query textual notation of referenced - public SpecializationTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // non Terminal : GeneralType; Found rule GeneralType:Specialization=general=[QualifiedName]|general+=OwnedFeatureChain{ownedRelatedElement+=general} + BuildGeneralType(poco, stringBuilder); + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule SpecificType + /// SpecificType:Specialization=specific=[QualifiedName]|specific+=OwnedFeatureChain{ownedRelatedElement+=specific} /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Types.Specialization poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : Specialization=('specialization'Identification)?'subtype'SpecificTypeSPECIALIZESGeneralTypeRelationshipBody - - // Group Element - stringBuilder.Append("subtype "); - // non Terminal : SpecificType; Found rule SpecificType:Specialization=specific=[QualifiedName]|specific+=OwnedFeatureChain{ownedRelatedElement+=specific} - - - // non Terminal : SPECIALIZES; Found rule SPECIALIZES=':>'|'specializes' - - - // non Terminal : GeneralType; Found rule GeneralType:Specialization=general=[QualifiedName]|general+=OwnedFeatureChain{ownedRelatedElement+=general} - - - - - // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' - + 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) + { + // Group Element + stringBuilder.Append("specialization "); + // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + stringBuilder.Append("subtype "); + // non Terminal : SpecificType; Found rule SpecificType:Specialization=specific=[QualifiedName]|specific+=OwnedFeatureChain{ownedRelatedElement+=specific} + BuildSpecificType(poco, stringBuilder); + // non Terminal : SPECIALIZES; Found rule SPECIALIZES=':>'|'specializes' + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // non Terminal : GeneralType; Found rule GeneralType:Specialization=general=[QualifiedName]|general+=OwnedFeatureChain{ownedRelatedElement+=general} + BuildGeneralType(poco, stringBuilder); + // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' + RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StakeholderMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StakeholderMembershipTextualNotationBuilder.cs index a30fccb5..22568394 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StakeholderMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StakeholderMembershipTextualNotationBuilder.cs @@ -29,28 +29,23 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class StakeholderMembershipTextualNotationBuilder : TextualNotationBuilder + public static partial class StakeholderMembershipTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule StakeholderMember + /// StakeholderMember:StakeholderMembership=MemberPrefixownedRelatedElement+=StakeholderUsage /// - /// The used to query textual notation of referenced - public StakeholderMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Requirements.StakeholderMembership poco) - { - var stringBuilder = new StringBuilder(); + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateDefinitionTextualNotationBuilder.cs index 09f17f2e..8aefc1e5 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateDefinitionTextualNotationBuilder.cs @@ -29,41 +29,38 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class StateDefinitionTextualNotationBuilder : TextualNotationBuilder + public static partial class StateDefinitionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule StateDefBody + /// StateDefBody:StateDefinition=';'|(isParallel?='parallel')?'{'StateBodyItem*'}' /// - /// The used to query textual notation of referenced - public StateDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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 provided + /// Builds the Textual Notation string for the rule StateDefinition + /// StateDefinition=OccurrenceDefinitionPrefix'state''def'DefinitionDeclarationStateDefBody /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.States.StateDefinition poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : StateDefinition=OccurrenceDefinitionPrefix'state''def'DefinitionDeclarationStateDefBody - - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* - - + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("state "); stringBuilder.Append("def "); - // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? - - - // non Terminal : StateDefBody; Found rule StateDefBody:StateDefinition=';'|(isParallel?='parallel')?'{'StateBodyItem*'}' - - + // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); + // non Terminal : StateDefBody; Found rule StateDefBody:StateDefinition=';'|(isParallel?='parallel')?'{'StateBodyItem*'}' + BuildStateDefBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateSubactionMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateSubactionMembershipTextualNotationBuilder.cs index d8693999..3bf417c2 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateSubactionMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateSubactionMembershipTextualNotationBuilder.cs @@ -29,28 +29,59 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class StateSubactionMembershipTextualNotationBuilder : TextualNotationBuilder + public static partial class StateSubactionMembershipTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule EntryActionMember + /// EntryActionMember:StateSubactionMembership=MemberPrefixkind='entry'ownedRelatedElement+=StateActionUsage /// - /// The used to query textual notation of referenced - public StateSubactionMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + // Assignment Element : kind = SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // If property kind value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + // Assignment Element : kind = SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // If property kind value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule ExitActionMember + /// ExitActionMember:StateSubactionMembership=MemberPrefixkind='exit'ownedRelatedElement+=StateActionUsage /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.States.StateSubactionMembership poco) + /// 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) { - var stringBuilder = new StringBuilder(); + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + // Assignment Element : kind = SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // If property kind value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateUsageTextualNotationBuilder.cs index 29922472..4d2c2ef6 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateUsageTextualNotationBuilder.cs @@ -29,40 +29,37 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class StateUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class StateUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule StateUsageBody + /// StateUsageBody:StateUsage=';'|(isParallel?='parallel')?'{'StateBodyItem*'}' /// - /// The used to query textual notation of referenced - public StateUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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 provided + /// Builds the Textual Notation string for the rule StateUsage + /// StateUsage=OccurrenceUsagePrefix'state'ActionUsageDeclarationStateUsageBody /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.States.StateUsage poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : StateUsage=OccurrenceUsagePrefix'state'ActionUsageDeclarationStateUsageBody - - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* - - + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("state "); - // non Terminal : ActionUsageDeclaration; Found rule ActionUsageDeclaration:ActionUsage=UsageDeclarationValuePart? - - - // non Terminal : StateUsageBody; Found rule StateUsageBody:StateUsage=';'|(isParallel?='parallel')?'{'StateBodyItem*'}' - - + // non Terminal : ActionUsageDeclaration; Found rule ActionUsageDeclaration:ActionUsage=UsageDeclarationValuePart? + ActionUsageTextualNotationBuilder.BuildActionUsageDeclaration(poco, stringBuilder); + // non Terminal : StateUsageBody; Found rule StateUsageBody:StateUsage=';'|(isParallel?='parallel')?'{'StateBodyItem*'}' + BuildStateUsageBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StepTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StepTextualNotationBuilder.cs index fc747a3a..f5a9d724 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StepTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StepTextualNotationBuilder.cs @@ -29,49 +29,34 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class StepTextualNotationBuilder : TextualNotationBuilder + public static partial class StepTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule Step + /// Step=FeaturePrefix'step'FeatureDeclarationValuePart?TypeBody /// - /// The used to query textual notation of referenced - public StepTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Behaviors.Step poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : Step=FeaturePrefix'step'FeatureDeclarationValuePart?TypeBody - - - - - - // non Terminal : FeaturePrefix; Found rule FeaturePrefix=(EndFeaturePrefix(ownedRelationship+=OwnedCrossFeatureMember)?|BasicFeaturePrefix)(ownedRelationship+=PrefixMetadataMember)* - - + // non Terminal : FeaturePrefix; Found rule FeaturePrefix=(EndFeaturePrefix(ownedRelationship+=OwnedCrossFeatureMember)?|BasicFeaturePrefix)(ownedRelationship+=PrefixMetadataMember)* + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement stringBuilder.Append("step "); - // non Terminal : FeatureDeclaration; Found rule FeatureDeclaration:Feature=(isSufficient?='all')?(FeatureIdentification(FeatureSpecializationPart|ConjugationPart)?|FeatureSpecializationPart|ConjugationPart)FeatureRelationshipPart* - - - // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue - - - // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' - - + // non Terminal : FeatureDeclaration; Found rule FeatureDeclaration:Feature=(isSufficient?='all')?(FeatureIdentification(FeatureSpecializationPart|ConjugationPart)?|FeatureSpecializationPart|ConjugationPart)FeatureRelationshipPart* + FeatureTextualNotationBuilder.BuildFeatureDeclaration(poco, stringBuilder); + // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue + FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StructureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StructureTextualNotationBuilder.cs index 12965dac..b7e1ed7a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StructureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StructureTextualNotationBuilder.cs @@ -29,42 +29,26 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class StructureTextualNotationBuilder : TextualNotationBuilder + public static partial class StructureTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule Structure + /// Structure=TypePrefix'struct'ClassifierDeclarationTypeBody /// - /// The used to query textual notation of referenced - public StructureTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Structures.Structure poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : Structure=TypePrefix'struct'ClassifierDeclarationTypeBody - - - - // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* - - + // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* + TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); stringBuilder.Append("struct "); - // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* - - - // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' - - + // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* + ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); + // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.cs index 33cdd0f8..e2546bed 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.cs @@ -29,42 +29,46 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class SubclassificationTextualNotationBuilder : TextualNotationBuilder + public static partial class SubclassificationTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule OwnedSubclassification + /// OwnedSubclassification:Subclassification=superClassifier=[QualifiedName] /// - /// The used to query textual notation of referenced - public SubclassificationTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // Assignment Element : superClassifier = SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + // If property superclassifier value is set, print SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule Subclassification + /// Subclassification=('specialization'Identification)?'subclassifier'subclassifier=[QualifiedName]SPECIALIZESsuperclassifier=[QualifiedName]RelationshipBody /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Classifiers.Subclassification poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : Subclassification=('specialization'Identification)?'subclassifier'subclassifier=[QualifiedName]SPECIALIZESsuperclassifier=[QualifiedName]RelationshipBody + // Group Element + stringBuilder.Append("specialization "); + // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); - // Group Element stringBuilder.Append("subclassifier "); - // Assignment Element : subclassifier = - // non Terminal : SPECIALIZES; Found rule SPECIALIZES=':>'|'specializes' - - - // Assignment Element : superclassifier = - // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' - - - - + // Assignment Element : subclassifier = SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + // If property subclassifier value is set, print SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + // non Terminal : SPECIALIZES; Found rule SPECIALIZES=':>'|'specializes' + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // Assignment Element : superclassifier = SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + // If property superclassifier value is set, print SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' + RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubjectMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubjectMembershipTextualNotationBuilder.cs index 2e048911..405b3537 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubjectMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubjectMembershipTextualNotationBuilder.cs @@ -29,28 +29,36 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class SubjectMembershipTextualNotationBuilder : TextualNotationBuilder + public static partial class SubjectMembershipTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule SubjectMember + /// SubjectMember:SubjectMembership=MemberPrefixownedRelatedElement+=SubjectUsage /// - /// The used to query textual notation of referenced - public SubjectMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule SatisfactionSubjectMember + /// SatisfactionSubjectMember:SubjectMembership=ownedRelatedElement+=SatisfactionParameter /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Requirements.SubjectMembership poco) + /// 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) { - var stringBuilder = new StringBuilder(); + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.cs index 13ea3ffa..3c1d4674 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.cs @@ -29,48 +29,44 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class SubsettingTextualNotationBuilder : TextualNotationBuilder + public static partial class SubsettingTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule OwnedSubsetting + /// OwnedSubsetting:Subsetting=subsettedFeature=[QualifiedName]|subsettedFeature=OwnedFeatureChain{ownedRelatedElement+=subsettedFeature} /// - /// The used to query textual notation of referenced - public SubsettingTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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 provided + /// Builds the Textual Notation string for the rule Subsetting + /// Subsetting=('specialization'Identification)?'subset'SpecificTypeSUBSETSGeneralTypeRelationshipBody /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Features.Subsetting poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : Subsetting=('specialization'Identification)?'subset'SpecificTypeSUBSETSGeneralTypeRelationshipBody + // Group Element + stringBuilder.Append("specialization "); + // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); - // Group Element stringBuilder.Append("subset "); - // non Terminal : SpecificType; Found rule SpecificType:Specialization=specific=[QualifiedName]|specific+=OwnedFeatureChain{ownedRelatedElement+=specific} + // non Terminal : SpecificType; Found rule SpecificType:Specialization=specific=[QualifiedName]|specific+=OwnedFeatureChain{ownedRelatedElement+=specific} + SpecializationTextualNotationBuilder.BuildSpecificType(poco, stringBuilder); + // non Terminal : SUBSETS; Found rule SUBSETS=':>'|'subsets' + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // non Terminal : GeneralType; Found rule GeneralType:Specialization=general=[QualifiedName]|general+=OwnedFeatureChain{ownedRelatedElement+=general} + SpecializationTextualNotationBuilder.BuildGeneralType(poco, stringBuilder); + // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' + RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); - - // non Terminal : SUBSETS; Found rule SUBSETS=':>'|'subsets' - - - // non Terminal : GeneralType; Found rule GeneralType:Specialization=general=[QualifiedName]|general+=OwnedFeatureChain{ownedRelatedElement+=general} - - - - - // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' - - - - - - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionAsUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionAsUsageTextualNotationBuilder.cs index 0d22683a..8761e5f7 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionAsUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionAsUsageTextualNotationBuilder.cs @@ -29,45 +29,63 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class SuccessionAsUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class SuccessionAsUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule SourceSuccession + /// SourceSuccession:SuccessionAsUsage=ownedRelationship+=SourceEndMember /// - /// The used to query textual notation of referenced - public SuccessionAsUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule TargetSuccession + /// TargetSuccession:SuccessionAsUsage=ownedRelationship+=SourceEndMember'then'ownedRelationship+=ConnectorEndMember /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Connections.SuccessionAsUsage poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : SuccessionAsUsage=UsagePrefix('succession'UsageDeclaration)?'first's.ownedRelationship+=ConnectorEndMember'then's.ownedRelationship+=ConnectorEndMemberUsageBody - - - - + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append("then "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // non Terminal : UsagePrefix; Found rule UsagePrefix:Usage=UnextendedUsagePrefixUsageExtensionKeyword* + } + /// + /// 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) + { + // non Terminal : UsagePrefix; Found rule UsagePrefix:Usage=UnextendedUsagePrefixUsageExtensionKeyword* + UsageTextualNotationBuilder.BuildUsagePrefix(poco, stringBuilder); + // Group Element + stringBuilder.Append("succession "); + // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); - // Group Element stringBuilder.Append("first "); - // Assignment Element : s.ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement stringBuilder.Append("then "); - // Assignment Element : s.ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // non Terminal : UsageBody; Found rule UsageBody:Usage=DefinitionBody - - + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // non Terminal : UsageBody; Found rule UsageBody:Usage=DefinitionBody + UsageTextualNotationBuilder.BuildUsageBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowTextualNotationBuilder.cs index 91e59333..cd9efa5f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowTextualNotationBuilder.cs @@ -29,43 +29,33 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class SuccessionFlowTextualNotationBuilder : TextualNotationBuilder + public static partial class SuccessionFlowTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule SuccessionFlow + /// SuccessionFlow=FeaturePrefix'succession''flow'FlowDeclarationTypeBody /// - /// The used to query textual notation of referenced - public SuccessionFlowTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Interactions.SuccessionFlow poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : SuccessionFlow=FeaturePrefix'succession''flow'FlowDeclarationTypeBody - - // non Terminal : FeaturePrefix; Found rule FeaturePrefix=(EndFeaturePrefix(ownedRelationship+=OwnedCrossFeatureMember)?|BasicFeaturePrefix)(ownedRelationship+=PrefixMetadataMember)* - - + // non Terminal : FeaturePrefix; Found rule FeaturePrefix=(EndFeaturePrefix(ownedRelationship+=OwnedCrossFeatureMember)?|BasicFeaturePrefix)(ownedRelationship+=PrefixMetadataMember)* + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement stringBuilder.Append("succession "); stringBuilder.Append("flow "); - // non Terminal : FlowDeclaration; Found rule FlowDeclaration:FlowUsage=UsageDeclarationValuePart?('of'ownedRelationship+=FlowPayloadFeatureMember)?('from'ownedRelationship+=FlowEndMember'to'ownedRelationship+=FlowEndMember)?|ownedRelationship+=FlowEndMember'to'ownedRelationship+=FlowEndMember - - - // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' - - + // non Terminal : FlowDeclaration; Found rule FlowDeclaration:FlowUsage=UsageDeclarationValuePart?('of'ownedRelationship+=FlowPayloadFeatureMember)?('from'ownedRelationship+=FlowEndMember'to'ownedRelationship+=FlowEndMember)?|ownedRelationship+=FlowEndMember'to'ownedRelationship+=FlowEndMember + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowUsageTextualNotationBuilder.cs index 130e3c6c..ab339d4e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowUsageTextualNotationBuilder.cs @@ -29,41 +29,27 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class SuccessionFlowUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class SuccessionFlowUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule SuccessionFlowUsage + /// SuccessionFlowUsage=OccurrenceUsagePrefix'succession''flow'FlowDeclarationDefinitionBody /// - /// The used to query textual notation of referenced - public SuccessionFlowUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Flows.SuccessionFlowUsage poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : SuccessionFlowUsage=OccurrenceUsagePrefix'succession''flow'FlowDeclarationDefinitionBody - - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* - - + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("succession "); stringBuilder.Append("flow "); - // non Terminal : FlowDeclaration; Found rule FlowDeclaration:FlowUsage=UsageDeclarationValuePart?('of'ownedRelationship+=FlowPayloadFeatureMember)?('from'ownedRelationship+=FlowEndMember'to'ownedRelationship+=FlowEndMember)?|ownedRelationship+=FlowEndMember'to'ownedRelationship+=FlowEndMember - - - // non Terminal : DefinitionBody; Found rule DefinitionBody:Type=';'|'{'DefinitionBodyItem*'}' - - + // non Terminal : FlowDeclaration; Found rule FlowDeclaration:FlowUsage=UsageDeclarationValuePart?('of'ownedRelationship+=FlowPayloadFeatureMember)?('from'ownedRelationship+=FlowEndMember'to'ownedRelationship+=FlowEndMember)?|ownedRelationship+=FlowEndMember'to'ownedRelationship+=FlowEndMember + FlowUsageTextualNotationBuilder.BuildFlowDeclaration(poco, stringBuilder); + // non Terminal : DefinitionBody; Found rule DefinitionBody:Type=';'|'{'DefinitionBodyItem*'}' + TypeTextualNotationBuilder.BuildDefinitionBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionTextualNotationBuilder.cs index 346ac701..eea58269 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionTextualNotationBuilder.cs @@ -29,46 +29,58 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class SuccessionTextualNotationBuilder : TextualNotationBuilder + public static partial class SuccessionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule TransitionSuccession + /// TransitionSuccession:Succession=ownedRelationship+=EmptyEndMemberownedRelationship+=ConnectorEndMember /// - /// The used to query textual notation of referenced - public SuccessionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + } /// - /// Builds the Textual Notation string for the provided + /// 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 textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Kernel.Connectors.Succession poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : Succession=FeaturePrefix'succession'SuccessionDeclarationTypeBody - - // non Terminal : FeaturePrefix; Found rule FeaturePrefix=(EndFeaturePrefix(ownedRelationship+=OwnedCrossFeatureMember)?|BasicFeaturePrefix)(ownedRelationship+=PrefixMetadataMember)* - + 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) + { + // non Terminal : FeaturePrefix; Found rule FeaturePrefix=(EndFeaturePrefix(ownedRelationship+=OwnedCrossFeatureMember)?|BasicFeaturePrefix)(ownedRelationship+=PrefixMetadataMember)* + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement stringBuilder.Append("succession "); - // non Terminal : SuccessionDeclaration; Found rule SuccessionDeclaration:Succession=FeatureDeclaration('first'ownedRelationship+=ConnectorEndMember'then'ownedRelationship+=ConnectorEndMember)?|(s.isSufficient?='all')?('first'?ownedRelationship+=ConnectorEndMember'then'ownedRelationship+=ConnectorEndMember)? - - - - - - - // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' - - + // non Terminal : SuccessionDeclaration; Found rule SuccessionDeclaration:Succession=FeatureDeclaration('first'ownedRelationship+=ConnectorEndMember'then'ownedRelationship+=ConnectorEndMember)?|(s.isSufficient?='all')?('first'?ownedRelationship+=ConnectorEndMember'then'ownedRelationship+=ConnectorEndMember)? + BuildSuccessionDeclaration(poco, stringBuilder); + // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TerminateActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TerminateActionUsageTextualNotationBuilder.cs index e59cfd38..79445b00 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TerminateActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TerminateActionUsageTextualNotationBuilder.cs @@ -29,28 +29,30 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class TerminateActionUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class TerminateActionUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule TerminateNode + /// TerminateNode:TerminateActionUsage=OccurrenceUsagePrefixActionNodeUsageDeclaration?'terminate'(ownedRelationship+=NodeParameterMember)?ActionBody /// - /// The used to query textual notation of referenced - public TerminateActionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + // non Terminal : ActionNodeUsageDeclaration; Found rule ActionNodeUsageDeclaration:ActionUsage='action'UsageDeclaration? + ActionUsageTextualNotationBuilder.BuildActionNodeUsageDeclaration(poco, stringBuilder); + stringBuilder.Append("terminate "); + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.TerminateActionUsage poco) - { - var stringBuilder = new StringBuilder(); + // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' + TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TextualNotationBuilderFacade.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TextualNotationBuilderFacade.cs deleted file mode 100644 index 20ed5cb6..00000000 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TextualNotationBuilderFacade.cs +++ /dev/null @@ -1,722 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// 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) - { - case SysML2.NET.Core.POCO.Systems.Ports.PortUsage pocoPortUsage: - var portUsageTextualNotationBuilder = new PortUsageTextualNotationBuilder(this); - return portUsageTextualNotationBuilder.BuildTextualNotation(pocoPortUsage); - - case SysML2.NET.Core.POCO.Systems.Ports.PortDefinition pocoPortDefinition: - var portDefinitionTextualNotationBuilder = new PortDefinitionTextualNotationBuilder(this); - return portDefinitionTextualNotationBuilder.BuildTextualNotation(pocoPortDefinition); - - case SysML2.NET.Core.POCO.Systems.Ports.ConjugatedPortDefinition pocoConjugatedPortDefinition: - var conjugatedPortDefinitionTextualNotationBuilder = new ConjugatedPortDefinitionTextualNotationBuilder(this); - return conjugatedPortDefinitionTextualNotationBuilder.BuildTextualNotation(pocoConjugatedPortDefinition); - - case SysML2.NET.Core.POCO.Systems.Ports.PortConjugation pocoPortConjugation: - var portConjugationTextualNotationBuilder = new PortConjugationTextualNotationBuilder(this); - return portConjugationTextualNotationBuilder.BuildTextualNotation(pocoPortConjugation); - - case SysML2.NET.Core.POCO.Systems.Ports.ConjugatedPortTyping pocoConjugatedPortTyping: - var conjugatedPortTypingTextualNotationBuilder = new ConjugatedPortTypingTextualNotationBuilder(this); - return conjugatedPortTypingTextualNotationBuilder.BuildTextualNotation(pocoConjugatedPortTyping); - - case SysML2.NET.Core.POCO.Systems.Attributes.AttributeDefinition pocoAttributeDefinition: - var attributeDefinitionTextualNotationBuilder = new AttributeDefinitionTextualNotationBuilder(this); - return attributeDefinitionTextualNotationBuilder.BuildTextualNotation(pocoAttributeDefinition); - - case SysML2.NET.Core.POCO.Systems.Attributes.AttributeUsage pocoAttributeUsage: - var attributeUsageTextualNotationBuilder = new AttributeUsageTextualNotationBuilder(this); - return attributeUsageTextualNotationBuilder.BuildTextualNotation(pocoAttributeUsage); - - case SysML2.NET.Core.POCO.Systems.Actions.AcceptActionUsage pocoAcceptActionUsage: - var acceptActionUsageTextualNotationBuilder = new AcceptActionUsageTextualNotationBuilder(this); - return acceptActionUsageTextualNotationBuilder.BuildTextualNotation(pocoAcceptActionUsage); - - case SysML2.NET.Core.POCO.Systems.Actions.SendActionUsage pocoSendActionUsage: - var sendActionUsageTextualNotationBuilder = new SendActionUsageTextualNotationBuilder(this); - return sendActionUsageTextualNotationBuilder.BuildTextualNotation(pocoSendActionUsage); - - case SysML2.NET.Core.POCO.Systems.Actions.PerformActionUsage pocoPerformActionUsage: - var performActionUsageTextualNotationBuilder = new PerformActionUsageTextualNotationBuilder(this); - return performActionUsageTextualNotationBuilder.BuildTextualNotation(pocoPerformActionUsage); - - case SysML2.NET.Core.POCO.Systems.Actions.ForkNode pocoForkNode: - var forkNodeTextualNotationBuilder = new ForkNodeTextualNotationBuilder(this); - return forkNodeTextualNotationBuilder.BuildTextualNotation(pocoForkNode); - - case SysML2.NET.Core.POCO.Systems.Actions.JoinNode pocoJoinNode: - var joinNodeTextualNotationBuilder = new JoinNodeTextualNotationBuilder(this); - return joinNodeTextualNotationBuilder.BuildTextualNotation(pocoJoinNode); - - case SysML2.NET.Core.POCO.Systems.Actions.ActionUsage pocoActionUsage: - var actionUsageTextualNotationBuilder = new ActionUsageTextualNotationBuilder(this); - return actionUsageTextualNotationBuilder.BuildTextualNotation(pocoActionUsage); - - case SysML2.NET.Core.POCO.Systems.Actions.DecisionNode pocoDecisionNode: - var decisionNodeTextualNotationBuilder = new DecisionNodeTextualNotationBuilder(this); - return decisionNodeTextualNotationBuilder.BuildTextualNotation(pocoDecisionNode); - - case SysML2.NET.Core.POCO.Systems.Actions.MergeNode pocoMergeNode: - var mergeNodeTextualNotationBuilder = new MergeNodeTextualNotationBuilder(this); - return mergeNodeTextualNotationBuilder.BuildTextualNotation(pocoMergeNode); - - case SysML2.NET.Core.POCO.Systems.Actions.ActionDefinition pocoActionDefinition: - var actionDefinitionTextualNotationBuilder = new ActionDefinitionTextualNotationBuilder(this); - return actionDefinitionTextualNotationBuilder.BuildTextualNotation(pocoActionDefinition); - - case SysML2.NET.Core.POCO.Systems.Actions.IfActionUsage pocoIfActionUsage: - var ifActionUsageTextualNotationBuilder = new IfActionUsageTextualNotationBuilder(this); - return ifActionUsageTextualNotationBuilder.BuildTextualNotation(pocoIfActionUsage); - - case SysML2.NET.Core.POCO.Systems.Actions.ForLoopActionUsage pocoForLoopActionUsage: - var forLoopActionUsageTextualNotationBuilder = new ForLoopActionUsageTextualNotationBuilder(this); - return forLoopActionUsageTextualNotationBuilder.BuildTextualNotation(pocoForLoopActionUsage); - - case SysML2.NET.Core.POCO.Systems.Actions.AssignmentActionUsage pocoAssignmentActionUsage: - var assignmentActionUsageTextualNotationBuilder = new AssignmentActionUsageTextualNotationBuilder(this); - return assignmentActionUsageTextualNotationBuilder.BuildTextualNotation(pocoAssignmentActionUsage); - - case SysML2.NET.Core.POCO.Systems.Actions.WhileLoopActionUsage pocoWhileLoopActionUsage: - var whileLoopActionUsageTextualNotationBuilder = new WhileLoopActionUsageTextualNotationBuilder(this); - return whileLoopActionUsageTextualNotationBuilder.BuildTextualNotation(pocoWhileLoopActionUsage); - - case SysML2.NET.Core.POCO.Systems.Actions.TriggerInvocationExpression pocoTriggerInvocationExpression: - var triggerInvocationExpressionTextualNotationBuilder = new TriggerInvocationExpressionTextualNotationBuilder(this); - return triggerInvocationExpressionTextualNotationBuilder.BuildTextualNotation(pocoTriggerInvocationExpression); - - case SysML2.NET.Core.POCO.Systems.Actions.TerminateActionUsage pocoTerminateActionUsage: - var terminateActionUsageTextualNotationBuilder = new TerminateActionUsageTextualNotationBuilder(this); - return terminateActionUsageTextualNotationBuilder.BuildTextualNotation(pocoTerminateActionUsage); - - case SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.Definition pocoDefinition: - var definitionTextualNotationBuilder = new DefinitionTextualNotationBuilder(this); - return definitionTextualNotationBuilder.BuildTextualNotation(pocoDefinition); - - case SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.Usage pocoUsage: - var usageTextualNotationBuilder = new UsageTextualNotationBuilder(this); - return usageTextualNotationBuilder.BuildTextualNotation(pocoUsage); - - case SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.ReferenceUsage pocoReferenceUsage: - var referenceUsageTextualNotationBuilder = new ReferenceUsageTextualNotationBuilder(this); - return referenceUsageTextualNotationBuilder.BuildTextualNotation(pocoReferenceUsage); - - case SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.VariantMembership pocoVariantMembership: - var variantMembershipTextualNotationBuilder = new VariantMembershipTextualNotationBuilder(this); - return variantMembershipTextualNotationBuilder.BuildTextualNotation(pocoVariantMembership); - - case SysML2.NET.Core.POCO.Systems.Parts.PartDefinition pocoPartDefinition: - var partDefinitionTextualNotationBuilder = new PartDefinitionTextualNotationBuilder(this); - return partDefinitionTextualNotationBuilder.BuildTextualNotation(pocoPartDefinition); - - case SysML2.NET.Core.POCO.Systems.Parts.PartUsage pocoPartUsage: - var partUsageTextualNotationBuilder = new PartUsageTextualNotationBuilder(this); - return partUsageTextualNotationBuilder.BuildTextualNotation(pocoPartUsage); - - case SysML2.NET.Core.POCO.Systems.Interfaces.InterfaceUsage pocoInterfaceUsage: - var interfaceUsageTextualNotationBuilder = new InterfaceUsageTextualNotationBuilder(this); - return interfaceUsageTextualNotationBuilder.BuildTextualNotation(pocoInterfaceUsage); - - case SysML2.NET.Core.POCO.Systems.Interfaces.InterfaceDefinition pocoInterfaceDefinition: - var interfaceDefinitionTextualNotationBuilder = new InterfaceDefinitionTextualNotationBuilder(this); - return interfaceDefinitionTextualNotationBuilder.BuildTextualNotation(pocoInterfaceDefinition); - - case SysML2.NET.Core.POCO.Systems.States.StateUsage pocoStateUsage: - var stateUsageTextualNotationBuilder = new StateUsageTextualNotationBuilder(this); - return stateUsageTextualNotationBuilder.BuildTextualNotation(pocoStateUsage); - - case SysML2.NET.Core.POCO.Systems.States.StateSubactionMembership pocoStateSubactionMembership: - var stateSubactionMembershipTextualNotationBuilder = new StateSubactionMembershipTextualNotationBuilder(this); - return stateSubactionMembershipTextualNotationBuilder.BuildTextualNotation(pocoStateSubactionMembership); - - case SysML2.NET.Core.POCO.Systems.States.StateDefinition pocoStateDefinition: - var stateDefinitionTextualNotationBuilder = new StateDefinitionTextualNotationBuilder(this); - return stateDefinitionTextualNotationBuilder.BuildTextualNotation(pocoStateDefinition); - - case SysML2.NET.Core.POCO.Systems.States.TransitionUsage pocoTransitionUsage: - var transitionUsageTextualNotationBuilder = new TransitionUsageTextualNotationBuilder(this); - return transitionUsageTextualNotationBuilder.BuildTextualNotation(pocoTransitionUsage); - - case SysML2.NET.Core.POCO.Systems.States.TransitionFeatureMembership pocoTransitionFeatureMembership: - var transitionFeatureMembershipTextualNotationBuilder = new TransitionFeatureMembershipTextualNotationBuilder(this); - return transitionFeatureMembershipTextualNotationBuilder.BuildTextualNotation(pocoTransitionFeatureMembership); - - case SysML2.NET.Core.POCO.Systems.States.ExhibitStateUsage pocoExhibitStateUsage: - var exhibitStateUsageTextualNotationBuilder = new ExhibitStateUsageTextualNotationBuilder(this); - return exhibitStateUsageTextualNotationBuilder.BuildTextualNotation(pocoExhibitStateUsage); - - case SysML2.NET.Core.POCO.Systems.Constraints.ConstraintUsage pocoConstraintUsage: - var constraintUsageTextualNotationBuilder = new ConstraintUsageTextualNotationBuilder(this); - return constraintUsageTextualNotationBuilder.BuildTextualNotation(pocoConstraintUsage); - - case SysML2.NET.Core.POCO.Systems.Constraints.ConstraintDefinition pocoConstraintDefinition: - var constraintDefinitionTextualNotationBuilder = new ConstraintDefinitionTextualNotationBuilder(this); - return constraintDefinitionTextualNotationBuilder.BuildTextualNotation(pocoConstraintDefinition); - - case SysML2.NET.Core.POCO.Systems.Constraints.AssertConstraintUsage pocoAssertConstraintUsage: - var assertConstraintUsageTextualNotationBuilder = new AssertConstraintUsageTextualNotationBuilder(this); - return assertConstraintUsageTextualNotationBuilder.BuildTextualNotation(pocoAssertConstraintUsage); - - case SysML2.NET.Core.POCO.Systems.Requirements.RequirementDefinition pocoRequirementDefinition: - var requirementDefinitionTextualNotationBuilder = new RequirementDefinitionTextualNotationBuilder(this); - return requirementDefinitionTextualNotationBuilder.BuildTextualNotation(pocoRequirementDefinition); - - case SysML2.NET.Core.POCO.Systems.Requirements.SatisfyRequirementUsage pocoSatisfyRequirementUsage: - var satisfyRequirementUsageTextualNotationBuilder = new SatisfyRequirementUsageTextualNotationBuilder(this); - return satisfyRequirementUsageTextualNotationBuilder.BuildTextualNotation(pocoSatisfyRequirementUsage); - - case SysML2.NET.Core.POCO.Systems.Requirements.RequirementUsage pocoRequirementUsage: - var requirementUsageTextualNotationBuilder = new RequirementUsageTextualNotationBuilder(this); - return requirementUsageTextualNotationBuilder.BuildTextualNotation(pocoRequirementUsage); - - case SysML2.NET.Core.POCO.Systems.Requirements.RequirementConstraintMembership pocoRequirementConstraintMembership: - var requirementConstraintMembershipTextualNotationBuilder = new RequirementConstraintMembershipTextualNotationBuilder(this); - return requirementConstraintMembershipTextualNotationBuilder.BuildTextualNotation(pocoRequirementConstraintMembership); - - case SysML2.NET.Core.POCO.Systems.Requirements.SubjectMembership pocoSubjectMembership: - var subjectMembershipTextualNotationBuilder = new SubjectMembershipTextualNotationBuilder(this); - return subjectMembershipTextualNotationBuilder.BuildTextualNotation(pocoSubjectMembership); - - case SysML2.NET.Core.POCO.Systems.Requirements.FramedConcernMembership pocoFramedConcernMembership: - var framedConcernMembershipTextualNotationBuilder = new FramedConcernMembershipTextualNotationBuilder(this); - return framedConcernMembershipTextualNotationBuilder.BuildTextualNotation(pocoFramedConcernMembership); - - case SysML2.NET.Core.POCO.Systems.Requirements.ConcernDefinition pocoConcernDefinition: - var concernDefinitionTextualNotationBuilder = new ConcernDefinitionTextualNotationBuilder(this); - return concernDefinitionTextualNotationBuilder.BuildTextualNotation(pocoConcernDefinition); - - case SysML2.NET.Core.POCO.Systems.Requirements.ConcernUsage pocoConcernUsage: - var concernUsageTextualNotationBuilder = new ConcernUsageTextualNotationBuilder(this); - return concernUsageTextualNotationBuilder.BuildTextualNotation(pocoConcernUsage); - - case SysML2.NET.Core.POCO.Systems.Requirements.StakeholderMembership pocoStakeholderMembership: - var stakeholderMembershipTextualNotationBuilder = new StakeholderMembershipTextualNotationBuilder(this); - return stakeholderMembershipTextualNotationBuilder.BuildTextualNotation(pocoStakeholderMembership); - - case SysML2.NET.Core.POCO.Systems.Requirements.ActorMembership pocoActorMembership: - var actorMembershipTextualNotationBuilder = new ActorMembershipTextualNotationBuilder(this); - return actorMembershipTextualNotationBuilder.BuildTextualNotation(pocoActorMembership); - - case SysML2.NET.Core.POCO.Systems.Calculations.CalculationDefinition pocoCalculationDefinition: - var calculationDefinitionTextualNotationBuilder = new CalculationDefinitionTextualNotationBuilder(this); - return calculationDefinitionTextualNotationBuilder.BuildTextualNotation(pocoCalculationDefinition); - - case SysML2.NET.Core.POCO.Systems.Calculations.CalculationUsage pocoCalculationUsage: - var calculationUsageTextualNotationBuilder = new CalculationUsageTextualNotationBuilder(this); - return calculationUsageTextualNotationBuilder.BuildTextualNotation(pocoCalculationUsage); - - case SysML2.NET.Core.POCO.Systems.Connections.ConnectionDefinition pocoConnectionDefinition: - var connectionDefinitionTextualNotationBuilder = new ConnectionDefinitionTextualNotationBuilder(this); - return connectionDefinitionTextualNotationBuilder.BuildTextualNotation(pocoConnectionDefinition); - - case SysML2.NET.Core.POCO.Systems.Connections.ConnectionUsage pocoConnectionUsage: - var connectionUsageTextualNotationBuilder = new ConnectionUsageTextualNotationBuilder(this); - return connectionUsageTextualNotationBuilder.BuildTextualNotation(pocoConnectionUsage); - - case SysML2.NET.Core.POCO.Systems.Connections.SuccessionAsUsage pocoSuccessionAsUsage: - var successionAsUsageTextualNotationBuilder = new SuccessionAsUsageTextualNotationBuilder(this); - return successionAsUsageTextualNotationBuilder.BuildTextualNotation(pocoSuccessionAsUsage); - - case SysML2.NET.Core.POCO.Systems.Connections.BindingConnectorAsUsage pocoBindingConnectorAsUsage: - var bindingConnectorAsUsageTextualNotationBuilder = new BindingConnectorAsUsageTextualNotationBuilder(this); - return bindingConnectorAsUsageTextualNotationBuilder.BuildTextualNotation(pocoBindingConnectorAsUsage); - - case SysML2.NET.Core.POCO.Systems.Cases.CaseUsage pocoCaseUsage: - var caseUsageTextualNotationBuilder = new CaseUsageTextualNotationBuilder(this); - return caseUsageTextualNotationBuilder.BuildTextualNotation(pocoCaseUsage); - - case SysML2.NET.Core.POCO.Systems.Cases.CaseDefinition pocoCaseDefinition: - var caseDefinitionTextualNotationBuilder = new CaseDefinitionTextualNotationBuilder(this); - return caseDefinitionTextualNotationBuilder.BuildTextualNotation(pocoCaseDefinition); - - case SysML2.NET.Core.POCO.Systems.Cases.ObjectiveMembership pocoObjectiveMembership: - var objectiveMembershipTextualNotationBuilder = new ObjectiveMembershipTextualNotationBuilder(this); - return objectiveMembershipTextualNotationBuilder.BuildTextualNotation(pocoObjectiveMembership); - - case SysML2.NET.Core.POCO.Systems.AnalysisCases.AnalysisCaseUsage pocoAnalysisCaseUsage: - var analysisCaseUsageTextualNotationBuilder = new AnalysisCaseUsageTextualNotationBuilder(this); - return analysisCaseUsageTextualNotationBuilder.BuildTextualNotation(pocoAnalysisCaseUsage); - - case SysML2.NET.Core.POCO.Systems.AnalysisCases.AnalysisCaseDefinition pocoAnalysisCaseDefinition: - var analysisCaseDefinitionTextualNotationBuilder = new AnalysisCaseDefinitionTextualNotationBuilder(this); - return analysisCaseDefinitionTextualNotationBuilder.BuildTextualNotation(pocoAnalysisCaseDefinition); - - case SysML2.NET.Core.POCO.Systems.Items.ItemUsage pocoItemUsage: - var itemUsageTextualNotationBuilder = new ItemUsageTextualNotationBuilder(this); - return itemUsageTextualNotationBuilder.BuildTextualNotation(pocoItemUsage); - - case SysML2.NET.Core.POCO.Systems.Items.ItemDefinition pocoItemDefinition: - var itemDefinitionTextualNotationBuilder = new ItemDefinitionTextualNotationBuilder(this); - return itemDefinitionTextualNotationBuilder.BuildTextualNotation(pocoItemDefinition); - - case SysML2.NET.Core.POCO.Systems.Views.ViewpointDefinition pocoViewpointDefinition: - var viewpointDefinitionTextualNotationBuilder = new ViewpointDefinitionTextualNotationBuilder(this); - return viewpointDefinitionTextualNotationBuilder.BuildTextualNotation(pocoViewpointDefinition); - - case SysML2.NET.Core.POCO.Systems.Views.ViewUsage pocoViewUsage: - var viewUsageTextualNotationBuilder = new ViewUsageTextualNotationBuilder(this); - return viewUsageTextualNotationBuilder.BuildTextualNotation(pocoViewUsage); - - case SysML2.NET.Core.POCO.Systems.Views.RenderingDefinition pocoRenderingDefinition: - var renderingDefinitionTextualNotationBuilder = new RenderingDefinitionTextualNotationBuilder(this); - return renderingDefinitionTextualNotationBuilder.BuildTextualNotation(pocoRenderingDefinition); - - case SysML2.NET.Core.POCO.Systems.Views.ViewpointUsage pocoViewpointUsage: - var viewpointUsageTextualNotationBuilder = new ViewpointUsageTextualNotationBuilder(this); - return viewpointUsageTextualNotationBuilder.BuildTextualNotation(pocoViewpointUsage); - - case SysML2.NET.Core.POCO.Systems.Views.ViewDefinition pocoViewDefinition: - var viewDefinitionTextualNotationBuilder = new ViewDefinitionTextualNotationBuilder(this); - return viewDefinitionTextualNotationBuilder.BuildTextualNotation(pocoViewDefinition); - - case SysML2.NET.Core.POCO.Systems.Views.RenderingUsage pocoRenderingUsage: - var renderingUsageTextualNotationBuilder = new RenderingUsageTextualNotationBuilder(this); - return renderingUsageTextualNotationBuilder.BuildTextualNotation(pocoRenderingUsage); - - case SysML2.NET.Core.POCO.Systems.Views.ViewRenderingMembership pocoViewRenderingMembership: - var viewRenderingMembershipTextualNotationBuilder = new ViewRenderingMembershipTextualNotationBuilder(this); - return viewRenderingMembershipTextualNotationBuilder.BuildTextualNotation(pocoViewRenderingMembership); - - case SysML2.NET.Core.POCO.Systems.Views.NamespaceExpose pocoNamespaceExpose: - var namespaceExposeTextualNotationBuilder = new NamespaceExposeTextualNotationBuilder(this); - return namespaceExposeTextualNotationBuilder.BuildTextualNotation(pocoNamespaceExpose); - - case SysML2.NET.Core.POCO.Systems.Views.MembershipExpose pocoMembershipExpose: - var membershipExposeTextualNotationBuilder = new MembershipExposeTextualNotationBuilder(this); - return membershipExposeTextualNotationBuilder.BuildTextualNotation(pocoMembershipExpose); - - case SysML2.NET.Core.POCO.Systems.VerificationCases.VerificationCaseDefinition pocoVerificationCaseDefinition: - var verificationCaseDefinitionTextualNotationBuilder = new VerificationCaseDefinitionTextualNotationBuilder(this); - return verificationCaseDefinitionTextualNotationBuilder.BuildTextualNotation(pocoVerificationCaseDefinition); - - case SysML2.NET.Core.POCO.Systems.VerificationCases.VerificationCaseUsage pocoVerificationCaseUsage: - var verificationCaseUsageTextualNotationBuilder = new VerificationCaseUsageTextualNotationBuilder(this); - return verificationCaseUsageTextualNotationBuilder.BuildTextualNotation(pocoVerificationCaseUsage); - - case SysML2.NET.Core.POCO.Systems.VerificationCases.RequirementVerificationMembership pocoRequirementVerificationMembership: - var requirementVerificationMembershipTextualNotationBuilder = new RequirementVerificationMembershipTextualNotationBuilder(this); - return requirementVerificationMembershipTextualNotationBuilder.BuildTextualNotation(pocoRequirementVerificationMembership); - - case SysML2.NET.Core.POCO.Systems.Enumerations.EnumerationDefinition pocoEnumerationDefinition: - var enumerationDefinitionTextualNotationBuilder = new EnumerationDefinitionTextualNotationBuilder(this); - return enumerationDefinitionTextualNotationBuilder.BuildTextualNotation(pocoEnumerationDefinition); - - case SysML2.NET.Core.POCO.Systems.Enumerations.EnumerationUsage pocoEnumerationUsage: - var enumerationUsageTextualNotationBuilder = new EnumerationUsageTextualNotationBuilder(this); - return enumerationUsageTextualNotationBuilder.BuildTextualNotation(pocoEnumerationUsage); - - case SysML2.NET.Core.POCO.Systems.Allocations.AllocationDefinition pocoAllocationDefinition: - var allocationDefinitionTextualNotationBuilder = new AllocationDefinitionTextualNotationBuilder(this); - return allocationDefinitionTextualNotationBuilder.BuildTextualNotation(pocoAllocationDefinition); - - case SysML2.NET.Core.POCO.Systems.Allocations.AllocationUsage pocoAllocationUsage: - var allocationUsageTextualNotationBuilder = new AllocationUsageTextualNotationBuilder(this); - return allocationUsageTextualNotationBuilder.BuildTextualNotation(pocoAllocationUsage); - - case SysML2.NET.Core.POCO.Systems.Occurrences.OccurrenceUsage pocoOccurrenceUsage: - var occurrenceUsageTextualNotationBuilder = new OccurrenceUsageTextualNotationBuilder(this); - return occurrenceUsageTextualNotationBuilder.BuildTextualNotation(pocoOccurrenceUsage); - - case SysML2.NET.Core.POCO.Systems.Occurrences.OccurrenceDefinition pocoOccurrenceDefinition: - var occurrenceDefinitionTextualNotationBuilder = new OccurrenceDefinitionTextualNotationBuilder(this); - return occurrenceDefinitionTextualNotationBuilder.BuildTextualNotation(pocoOccurrenceDefinition); - - case SysML2.NET.Core.POCO.Systems.Occurrences.EventOccurrenceUsage pocoEventOccurrenceUsage: - var eventOccurrenceUsageTextualNotationBuilder = new EventOccurrenceUsageTextualNotationBuilder(this); - return eventOccurrenceUsageTextualNotationBuilder.BuildTextualNotation(pocoEventOccurrenceUsage); - - case SysML2.NET.Core.POCO.Systems.UseCases.IncludeUseCaseUsage pocoIncludeUseCaseUsage: - var includeUseCaseUsageTextualNotationBuilder = new IncludeUseCaseUsageTextualNotationBuilder(this); - return includeUseCaseUsageTextualNotationBuilder.BuildTextualNotation(pocoIncludeUseCaseUsage); - - case SysML2.NET.Core.POCO.Systems.UseCases.UseCaseUsage pocoUseCaseUsage: - var useCaseUsageTextualNotationBuilder = new UseCaseUsageTextualNotationBuilder(this); - return useCaseUsageTextualNotationBuilder.BuildTextualNotation(pocoUseCaseUsage); - - case SysML2.NET.Core.POCO.Systems.UseCases.UseCaseDefinition pocoUseCaseDefinition: - var useCaseDefinitionTextualNotationBuilder = new UseCaseDefinitionTextualNotationBuilder(this); - return useCaseDefinitionTextualNotationBuilder.BuildTextualNotation(pocoUseCaseDefinition); - - case SysML2.NET.Core.POCO.Systems.Metadata.MetadataDefinition pocoMetadataDefinition: - var metadataDefinitionTextualNotationBuilder = new MetadataDefinitionTextualNotationBuilder(this); - return metadataDefinitionTextualNotationBuilder.BuildTextualNotation(pocoMetadataDefinition); - - case SysML2.NET.Core.POCO.Systems.Metadata.MetadataUsage pocoMetadataUsage: - var metadataUsageTextualNotationBuilder = new MetadataUsageTextualNotationBuilder(this); - return metadataUsageTextualNotationBuilder.BuildTextualNotation(pocoMetadataUsage); - - case SysML2.NET.Core.POCO.Systems.Flows.FlowUsage pocoFlowUsage: - var flowUsageTextualNotationBuilder = new FlowUsageTextualNotationBuilder(this); - return flowUsageTextualNotationBuilder.BuildTextualNotation(pocoFlowUsage); - - case SysML2.NET.Core.POCO.Systems.Flows.FlowDefinition pocoFlowDefinition: - var flowDefinitionTextualNotationBuilder = new FlowDefinitionTextualNotationBuilder(this); - return flowDefinitionTextualNotationBuilder.BuildTextualNotation(pocoFlowDefinition); - - case SysML2.NET.Core.POCO.Systems.Flows.SuccessionFlowUsage pocoSuccessionFlowUsage: - var successionFlowUsageTextualNotationBuilder = new SuccessionFlowUsageTextualNotationBuilder(this); - return successionFlowUsageTextualNotationBuilder.BuildTextualNotation(pocoSuccessionFlowUsage); - - case SysML2.NET.Core.POCO.Root.Dependencies.Dependency pocoDependency: - var dependencyTextualNotationBuilder = new DependencyTextualNotationBuilder(this); - return dependencyTextualNotationBuilder.BuildTextualNotation(pocoDependency); - - case SysML2.NET.Core.POCO.Root.Annotations.Comment pocoComment: - var commentTextualNotationBuilder = new CommentTextualNotationBuilder(this); - return commentTextualNotationBuilder.BuildTextualNotation(pocoComment); - - case SysML2.NET.Core.POCO.Root.Annotations.Annotation pocoAnnotation: - var annotationTextualNotationBuilder = new AnnotationTextualNotationBuilder(this); - return annotationTextualNotationBuilder.BuildTextualNotation(pocoAnnotation); - - case SysML2.NET.Core.POCO.Root.Annotations.AnnotatingElement pocoAnnotatingElement: - var annotatingElementTextualNotationBuilder = new AnnotatingElementTextualNotationBuilder(this); - return annotatingElementTextualNotationBuilder.BuildTextualNotation(pocoAnnotatingElement); - - case SysML2.NET.Core.POCO.Root.Annotations.TextualRepresentation pocoTextualRepresentation: - var textualRepresentationTextualNotationBuilder = new TextualRepresentationTextualNotationBuilder(this); - return textualRepresentationTextualNotationBuilder.BuildTextualNotation(pocoTextualRepresentation); - - case SysML2.NET.Core.POCO.Root.Annotations.Documentation pocoDocumentation: - var documentationTextualNotationBuilder = new DocumentationTextualNotationBuilder(this); - return documentationTextualNotationBuilder.BuildTextualNotation(pocoDocumentation); - - case SysML2.NET.Core.POCO.Root.Namespaces.Namespace pocoNamespace: - var namespaceTextualNotationBuilder = new NamespaceTextualNotationBuilder(this); - return namespaceTextualNotationBuilder.BuildTextualNotation(pocoNamespace); - - case SysML2.NET.Core.POCO.Root.Namespaces.MembershipImport pocoMembershipImport: - var membershipImportTextualNotationBuilder = new MembershipImportTextualNotationBuilder(this); - return membershipImportTextualNotationBuilder.BuildTextualNotation(pocoMembershipImport); - - case SysML2.NET.Core.POCO.Root.Namespaces.NamespaceImport pocoNamespaceImport: - var namespaceImportTextualNotationBuilder = new NamespaceImportTextualNotationBuilder(this); - return namespaceImportTextualNotationBuilder.BuildTextualNotation(pocoNamespaceImport); - - case SysML2.NET.Core.POCO.Root.Namespaces.Membership pocoMembership: - var membershipTextualNotationBuilder = new MembershipTextualNotationBuilder(this); - return membershipTextualNotationBuilder.BuildTextualNotation(pocoMembership); - - case SysML2.NET.Core.POCO.Root.Namespaces.OwningMembership pocoOwningMembership: - var owningMembershipTextualNotationBuilder = new OwningMembershipTextualNotationBuilder(this); - return owningMembershipTextualNotationBuilder.BuildTextualNotation(pocoOwningMembership); - - case SysML2.NET.Core.POCO.Core.Types.Specialization pocoSpecialization: - var specializationTextualNotationBuilder = new SpecializationTextualNotationBuilder(this); - return specializationTextualNotationBuilder.BuildTextualNotation(pocoSpecialization); - - case SysML2.NET.Core.POCO.Core.Types.Type pocoType: - var typeTextualNotationBuilder = new TypeTextualNotationBuilder(this); - return typeTextualNotationBuilder.BuildTextualNotation(pocoType); - - case SysML2.NET.Core.POCO.Core.Types.FeatureMembership pocoFeatureMembership: - var featureMembershipTextualNotationBuilder = new FeatureMembershipTextualNotationBuilder(this); - return featureMembershipTextualNotationBuilder.BuildTextualNotation(pocoFeatureMembership); - - case SysML2.NET.Core.POCO.Core.Types.Conjugation pocoConjugation: - var conjugationTextualNotationBuilder = new ConjugationTextualNotationBuilder(this); - return conjugationTextualNotationBuilder.BuildTextualNotation(pocoConjugation); - - case SysML2.NET.Core.POCO.Core.Types.Multiplicity pocoMultiplicity: - var multiplicityTextualNotationBuilder = new MultiplicityTextualNotationBuilder(this); - return multiplicityTextualNotationBuilder.BuildTextualNotation(pocoMultiplicity); - - case SysML2.NET.Core.POCO.Core.Types.Disjoining pocoDisjoining: - var disjoiningTextualNotationBuilder = new DisjoiningTextualNotationBuilder(this); - return disjoiningTextualNotationBuilder.BuildTextualNotation(pocoDisjoining); - - case SysML2.NET.Core.POCO.Core.Types.Differencing pocoDifferencing: - var differencingTextualNotationBuilder = new DifferencingTextualNotationBuilder(this); - return differencingTextualNotationBuilder.BuildTextualNotation(pocoDifferencing); - - case SysML2.NET.Core.POCO.Core.Types.Unioning pocoUnioning: - var unioningTextualNotationBuilder = new UnioningTextualNotationBuilder(this); - return unioningTextualNotationBuilder.BuildTextualNotation(pocoUnioning); - - case SysML2.NET.Core.POCO.Core.Types.Intersecting pocoIntersecting: - var intersectingTextualNotationBuilder = new IntersectingTextualNotationBuilder(this); - return intersectingTextualNotationBuilder.BuildTextualNotation(pocoIntersecting); - - case SysML2.NET.Core.POCO.Core.Classifiers.Subclassification pocoSubclassification: - var subclassificationTextualNotationBuilder = new SubclassificationTextualNotationBuilder(this); - return subclassificationTextualNotationBuilder.BuildTextualNotation(pocoSubclassification); - - case SysML2.NET.Core.POCO.Core.Classifiers.Classifier pocoClassifier: - var classifierTextualNotationBuilder = new ClassifierTextualNotationBuilder(this); - return classifierTextualNotationBuilder.BuildTextualNotation(pocoClassifier); - - case SysML2.NET.Core.POCO.Core.Features.Redefinition pocoRedefinition: - var redefinitionTextualNotationBuilder = new RedefinitionTextualNotationBuilder(this); - return redefinitionTextualNotationBuilder.BuildTextualNotation(pocoRedefinition); - - case SysML2.NET.Core.POCO.Core.Features.Feature pocoFeature: - var featureTextualNotationBuilder = new FeatureTextualNotationBuilder(this); - return featureTextualNotationBuilder.BuildTextualNotation(pocoFeature); - - case SysML2.NET.Core.POCO.Core.Features.FeatureTyping pocoFeatureTyping: - var featureTypingTextualNotationBuilder = new FeatureTypingTextualNotationBuilder(this); - return featureTypingTextualNotationBuilder.BuildTextualNotation(pocoFeatureTyping); - - case SysML2.NET.Core.POCO.Core.Features.Subsetting pocoSubsetting: - var subsettingTextualNotationBuilder = new SubsettingTextualNotationBuilder(this); - return subsettingTextualNotationBuilder.BuildTextualNotation(pocoSubsetting); - - case SysML2.NET.Core.POCO.Core.Features.TypeFeaturing pocoTypeFeaturing: - var typeFeaturingTextualNotationBuilder = new TypeFeaturingTextualNotationBuilder(this); - return typeFeaturingTextualNotationBuilder.BuildTextualNotation(pocoTypeFeaturing); - - case SysML2.NET.Core.POCO.Core.Features.EndFeatureMembership pocoEndFeatureMembership: - var endFeatureMembershipTextualNotationBuilder = new EndFeatureMembershipTextualNotationBuilder(this); - return endFeatureMembershipTextualNotationBuilder.BuildTextualNotation(pocoEndFeatureMembership); - - case SysML2.NET.Core.POCO.Core.Features.FeatureChaining pocoFeatureChaining: - var featureChainingTextualNotationBuilder = new FeatureChainingTextualNotationBuilder(this); - return featureChainingTextualNotationBuilder.BuildTextualNotation(pocoFeatureChaining); - - case SysML2.NET.Core.POCO.Core.Features.FeatureInverting pocoFeatureInverting: - var featureInvertingTextualNotationBuilder = new FeatureInvertingTextualNotationBuilder(this); - return featureInvertingTextualNotationBuilder.BuildTextualNotation(pocoFeatureInverting); - - case SysML2.NET.Core.POCO.Core.Features.ReferenceSubsetting pocoReferenceSubsetting: - var referenceSubsettingTextualNotationBuilder = new ReferenceSubsettingTextualNotationBuilder(this); - return referenceSubsettingTextualNotationBuilder.BuildTextualNotation(pocoReferenceSubsetting); - - case SysML2.NET.Core.POCO.Core.Features.CrossSubsetting pocoCrossSubsetting: - var crossSubsettingTextualNotationBuilder = new CrossSubsettingTextualNotationBuilder(this); - return crossSubsettingTextualNotationBuilder.BuildTextualNotation(pocoCrossSubsetting); - - case SysML2.NET.Core.POCO.Kernel.Interactions.PayloadFeature pocoPayloadFeature: - var payloadFeatureTextualNotationBuilder = new PayloadFeatureTextualNotationBuilder(this); - return payloadFeatureTextualNotationBuilder.BuildTextualNotation(pocoPayloadFeature); - - case SysML2.NET.Core.POCO.Kernel.Interactions.Interaction pocoInteraction: - var interactionTextualNotationBuilder = new InteractionTextualNotationBuilder(this); - return interactionTextualNotationBuilder.BuildTextualNotation(pocoInteraction); - - case SysML2.NET.Core.POCO.Kernel.Interactions.SuccessionFlow pocoSuccessionFlow: - var successionFlowTextualNotationBuilder = new SuccessionFlowTextualNotationBuilder(this); - return successionFlowTextualNotationBuilder.BuildTextualNotation(pocoSuccessionFlow); - - case SysML2.NET.Core.POCO.Kernel.Interactions.Flow pocoFlow: - var flowTextualNotationBuilder = new FlowTextualNotationBuilder(this); - return flowTextualNotationBuilder.BuildTextualNotation(pocoFlow); - - case SysML2.NET.Core.POCO.Kernel.Interactions.FlowEnd pocoFlowEnd: - var flowEndTextualNotationBuilder = new FlowEndTextualNotationBuilder(this); - return flowEndTextualNotationBuilder.BuildTextualNotation(pocoFlowEnd); - - case SysML2.NET.Core.POCO.Kernel.Packages.LibraryPackage pocoLibraryPackage: - var libraryPackageTextualNotationBuilder = new LibraryPackageTextualNotationBuilder(this); - return libraryPackageTextualNotationBuilder.BuildTextualNotation(pocoLibraryPackage); - - case SysML2.NET.Core.POCO.Kernel.Packages.ElementFilterMembership pocoElementFilterMembership: - var elementFilterMembershipTextualNotationBuilder = new ElementFilterMembershipTextualNotationBuilder(this); - return elementFilterMembershipTextualNotationBuilder.BuildTextualNotation(pocoElementFilterMembership); - - case SysML2.NET.Core.POCO.Kernel.Packages.Package pocoPackage: - var packageTextualNotationBuilder = new PackageTextualNotationBuilder(this); - return packageTextualNotationBuilder.BuildTextualNotation(pocoPackage); - - case SysML2.NET.Core.POCO.Kernel.Classes.Class pocoClass: - var classTextualNotationBuilder = new ClassTextualNotationBuilder(this); - return classTextualNotationBuilder.BuildTextualNotation(pocoClass); - - case SysML2.NET.Core.POCO.Kernel.Expressions.LiteralBoolean pocoLiteralBoolean: - var literalBooleanTextualNotationBuilder = new LiteralBooleanTextualNotationBuilder(this); - return literalBooleanTextualNotationBuilder.BuildTextualNotation(pocoLiteralBoolean); - - case SysML2.NET.Core.POCO.Kernel.Expressions.LiteralExpression pocoLiteralExpression: - var literalExpressionTextualNotationBuilder = new LiteralExpressionTextualNotationBuilder(this); - return literalExpressionTextualNotationBuilder.BuildTextualNotation(pocoLiteralExpression); - - case SysML2.NET.Core.POCO.Kernel.Expressions.LiteralRational pocoLiteralRational: - var literalRationalTextualNotationBuilder = new LiteralRationalTextualNotationBuilder(this); - return literalRationalTextualNotationBuilder.BuildTextualNotation(pocoLiteralRational); - - case SysML2.NET.Core.POCO.Kernel.Expressions.LiteralInfinity pocoLiteralInfinity: - var literalInfinityTextualNotationBuilder = new LiteralInfinityTextualNotationBuilder(this); - return literalInfinityTextualNotationBuilder.BuildTextualNotation(pocoLiteralInfinity); - - case SysML2.NET.Core.POCO.Kernel.Expressions.LiteralInteger pocoLiteralInteger: - var literalIntegerTextualNotationBuilder = new LiteralIntegerTextualNotationBuilder(this); - return literalIntegerTextualNotationBuilder.BuildTextualNotation(pocoLiteralInteger); - - case SysML2.NET.Core.POCO.Kernel.Expressions.NullExpression pocoNullExpression: - var nullExpressionTextualNotationBuilder = new NullExpressionTextualNotationBuilder(this); - return nullExpressionTextualNotationBuilder.BuildTextualNotation(pocoNullExpression); - - case SysML2.NET.Core.POCO.Kernel.Expressions.LiteralString pocoLiteralString: - var literalStringTextualNotationBuilder = new LiteralStringTextualNotationBuilder(this); - return literalStringTextualNotationBuilder.BuildTextualNotation(pocoLiteralString); - - case SysML2.NET.Core.POCO.Kernel.Expressions.InvocationExpression pocoInvocationExpression: - var invocationExpressionTextualNotationBuilder = new InvocationExpressionTextualNotationBuilder(this); - return invocationExpressionTextualNotationBuilder.BuildTextualNotation(pocoInvocationExpression); - - case SysML2.NET.Core.POCO.Kernel.Expressions.FeatureReferenceExpression pocoFeatureReferenceExpression: - var featureReferenceExpressionTextualNotationBuilder = new FeatureReferenceExpressionTextualNotationBuilder(this); - return featureReferenceExpressionTextualNotationBuilder.BuildTextualNotation(pocoFeatureReferenceExpression); - - case SysML2.NET.Core.POCO.Kernel.Expressions.SelectExpression pocoSelectExpression: - var selectExpressionTextualNotationBuilder = new SelectExpressionTextualNotationBuilder(this); - return selectExpressionTextualNotationBuilder.BuildTextualNotation(pocoSelectExpression); - - case SysML2.NET.Core.POCO.Kernel.Expressions.OperatorExpression pocoOperatorExpression: - var operatorExpressionTextualNotationBuilder = new OperatorExpressionTextualNotationBuilder(this); - return operatorExpressionTextualNotationBuilder.BuildTextualNotation(pocoOperatorExpression); - - case SysML2.NET.Core.POCO.Kernel.Expressions.CollectExpression pocoCollectExpression: - var collectExpressionTextualNotationBuilder = new CollectExpressionTextualNotationBuilder(this); - return collectExpressionTextualNotationBuilder.BuildTextualNotation(pocoCollectExpression); - - case SysML2.NET.Core.POCO.Kernel.Expressions.FeatureChainExpression pocoFeatureChainExpression: - var featureChainExpressionTextualNotationBuilder = new FeatureChainExpressionTextualNotationBuilder(this); - return featureChainExpressionTextualNotationBuilder.BuildTextualNotation(pocoFeatureChainExpression); - - case SysML2.NET.Core.POCO.Kernel.Expressions.MetadataAccessExpression pocoMetadataAccessExpression: - var metadataAccessExpressionTextualNotationBuilder = new MetadataAccessExpressionTextualNotationBuilder(this); - return metadataAccessExpressionTextualNotationBuilder.BuildTextualNotation(pocoMetadataAccessExpression); - - case SysML2.NET.Core.POCO.Kernel.Expressions.IndexExpression pocoIndexExpression: - var indexExpressionTextualNotationBuilder = new IndexExpressionTextualNotationBuilder(this); - return indexExpressionTextualNotationBuilder.BuildTextualNotation(pocoIndexExpression); - - case SysML2.NET.Core.POCO.Kernel.Expressions.ConstructorExpression pocoConstructorExpression: - var constructorExpressionTextualNotationBuilder = new ConstructorExpressionTextualNotationBuilder(this); - return constructorExpressionTextualNotationBuilder.BuildTextualNotation(pocoConstructorExpression); - - case SysML2.NET.Core.POCO.Kernel.Structures.Structure pocoStructure: - var structureTextualNotationBuilder = new StructureTextualNotationBuilder(this); - return structureTextualNotationBuilder.BuildTextualNotation(pocoStructure); - - case SysML2.NET.Core.POCO.Kernel.Functions.Predicate pocoPredicate: - var predicateTextualNotationBuilder = new PredicateTextualNotationBuilder(this); - return predicateTextualNotationBuilder.BuildTextualNotation(pocoPredicate); - - case SysML2.NET.Core.POCO.Kernel.Functions.ReturnParameterMembership pocoReturnParameterMembership: - var returnParameterMembershipTextualNotationBuilder = new ReturnParameterMembershipTextualNotationBuilder(this); - return returnParameterMembershipTextualNotationBuilder.BuildTextualNotation(pocoReturnParameterMembership); - - case SysML2.NET.Core.POCO.Kernel.Functions.Invariant pocoInvariant: - var invariantTextualNotationBuilder = new InvariantTextualNotationBuilder(this); - return invariantTextualNotationBuilder.BuildTextualNotation(pocoInvariant); - - case SysML2.NET.Core.POCO.Kernel.Functions.BooleanExpression pocoBooleanExpression: - var booleanExpressionTextualNotationBuilder = new BooleanExpressionTextualNotationBuilder(this); - return booleanExpressionTextualNotationBuilder.BuildTextualNotation(pocoBooleanExpression); - - case SysML2.NET.Core.POCO.Kernel.Functions.Expression pocoExpression: - var expressionTextualNotationBuilder = new ExpressionTextualNotationBuilder(this); - return expressionTextualNotationBuilder.BuildTextualNotation(pocoExpression); - - case SysML2.NET.Core.POCO.Kernel.Functions.Function pocoFunction: - var functionTextualNotationBuilder = new FunctionTextualNotationBuilder(this); - return functionTextualNotationBuilder.BuildTextualNotation(pocoFunction); - - case SysML2.NET.Core.POCO.Kernel.Functions.ResultExpressionMembership pocoResultExpressionMembership: - var resultExpressionMembershipTextualNotationBuilder = new ResultExpressionMembershipTextualNotationBuilder(this); - return resultExpressionMembershipTextualNotationBuilder.BuildTextualNotation(pocoResultExpressionMembership); - - case SysML2.NET.Core.POCO.Kernel.Multiplicities.MultiplicityRange pocoMultiplicityRange: - var multiplicityRangeTextualNotationBuilder = new MultiplicityRangeTextualNotationBuilder(this); - return multiplicityRangeTextualNotationBuilder.BuildTextualNotation(pocoMultiplicityRange); - - case SysML2.NET.Core.POCO.Kernel.Behaviors.Step pocoStep: - var stepTextualNotationBuilder = new StepTextualNotationBuilder(this); - return stepTextualNotationBuilder.BuildTextualNotation(pocoStep); - - case SysML2.NET.Core.POCO.Kernel.Behaviors.Behavior pocoBehavior: - var behaviorTextualNotationBuilder = new BehaviorTextualNotationBuilder(this); - return behaviorTextualNotationBuilder.BuildTextualNotation(pocoBehavior); - - case SysML2.NET.Core.POCO.Kernel.Behaviors.ParameterMembership pocoParameterMembership: - var parameterMembershipTextualNotationBuilder = new ParameterMembershipTextualNotationBuilder(this); - return parameterMembershipTextualNotationBuilder.BuildTextualNotation(pocoParameterMembership); - - case SysML2.NET.Core.POCO.Kernel.Metadata.Metaclass pocoMetaclass: - var metaclassTextualNotationBuilder = new MetaclassTextualNotationBuilder(this); - return metaclassTextualNotationBuilder.BuildTextualNotation(pocoMetaclass); - - case SysML2.NET.Core.POCO.Kernel.Metadata.MetadataFeature pocoMetadataFeature: - var metadataFeatureTextualNotationBuilder = new MetadataFeatureTextualNotationBuilder(this); - return metadataFeatureTextualNotationBuilder.BuildTextualNotation(pocoMetadataFeature); - - case SysML2.NET.Core.POCO.Kernel.DataTypes.DataType pocoDataType: - var dataTypeTextualNotationBuilder = new DataTypeTextualNotationBuilder(this); - return dataTypeTextualNotationBuilder.BuildTextualNotation(pocoDataType); - - case SysML2.NET.Core.POCO.Kernel.Associations.AssociationStructure pocoAssociationStructure: - var associationStructureTextualNotationBuilder = new AssociationStructureTextualNotationBuilder(this); - return associationStructureTextualNotationBuilder.BuildTextualNotation(pocoAssociationStructure); - - case SysML2.NET.Core.POCO.Kernel.Associations.Association pocoAssociation: - var associationTextualNotationBuilder = new AssociationTextualNotationBuilder(this); - return associationTextualNotationBuilder.BuildTextualNotation(pocoAssociation); - - case SysML2.NET.Core.POCO.Kernel.FeatureValues.FeatureValue pocoFeatureValue: - var featureValueTextualNotationBuilder = new FeatureValueTextualNotationBuilder(this); - return featureValueTextualNotationBuilder.BuildTextualNotation(pocoFeatureValue); - - case SysML2.NET.Core.POCO.Kernel.Connectors.Connector pocoConnector: - var connectorTextualNotationBuilder = new ConnectorTextualNotationBuilder(this); - return connectorTextualNotationBuilder.BuildTextualNotation(pocoConnector); - - case SysML2.NET.Core.POCO.Kernel.Connectors.BindingConnector pocoBindingConnector: - var bindingConnectorTextualNotationBuilder = new BindingConnectorTextualNotationBuilder(this); - return bindingConnectorTextualNotationBuilder.BuildTextualNotation(pocoBindingConnector); - - case SysML2.NET.Core.POCO.Kernel.Connectors.Succession pocoSuccession: - var successionTextualNotationBuilder = new SuccessionTextualNotationBuilder(this); - return successionTextualNotationBuilder.BuildTextualNotation(pocoSuccession); - - 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/TextualNotation/AutoGenTextualNotationBuilder/TextualRepresentationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TextualRepresentationTextualNotationBuilder.cs index abc8bde5..cfe81735 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TextualRepresentationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TextualRepresentationTextualNotationBuilder.cs @@ -29,38 +29,29 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class TextualRepresentationTextualNotationBuilder : TextualNotationBuilder + public static partial class TextualRepresentationTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule TextualRepresentation + /// TextualRepresentation=('rep'Identification)?'language'language=STRING_VALUEbody=REGULAR_COMMENT /// - /// The used to query textual notation of referenced - public TextualRepresentationTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Root.Annotations.TextualRepresentation poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : TextualRepresentation=('rep'Identification)?'language'language=STRING_VALUEbody=REGULAR_COMMENT - - - - + // Group Element + stringBuilder.Append("rep "); + // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); - // Group Element stringBuilder.Append("language "); // Assignment Element : language = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property language value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement // Assignment Element : body = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property body value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionFeatureMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionFeatureMembershipTextualNotationBuilder.cs index a848734b..f38aff43 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionFeatureMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionFeatureMembershipTextualNotationBuilder.cs @@ -29,28 +29,53 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class TransitionFeatureMembershipTextualNotationBuilder : TextualNotationBuilder + public static partial class TransitionFeatureMembershipTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule TriggerActionMember + /// TriggerActionMember:TransitionFeatureMembership='accept'{kind='trigger'}ownedRelatedElement+=TriggerAction /// - /// The used to query textual notation of referenced - public TransitionFeatureMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + stringBuilder.Append("accept "); + // Assignment Element : kind = 'trigger' + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + stringBuilder.Append("if "); + // Assignment Element : kind = 'guard' + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule EffectBehaviorMember + /// EffectBehaviorMember:TransitionFeatureMembership='do'{kind='effect'}ownedRelatedElement+=EffectBehaviorUsage /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.States.TransitionFeatureMembership poco) + /// 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) { - var stringBuilder = new StringBuilder(); + stringBuilder.Append("do "); + // Assignment Element : kind = 'effect' + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionUsageTextualNotationBuilder.cs index d18e8571..9b7fd0e9 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionUsageTextualNotationBuilder.cs @@ -29,42 +29,124 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class TransitionUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class TransitionUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule GuardedTargetSuccession + /// GuardedTargetSuccession:TransitionUsage=ownedRelationship+=GuardExpressionMember'then'ownedRelationship+=TransitionSuccessionMember /// - /// The used to query textual notation of referenced - public TransitionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append("then "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule DefaultTargetSuccession + /// DefaultTargetSuccession:TransitionUsage='else'ownedRelationship+=TransitionSuccessionMember /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.States.TransitionUsage poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : TransitionUsage='transition'(UsageDeclaration'first')?ownedRelationship+=FeatureChainMemberownedRelationship+=EmptyParameterMember(ownedRelationship+=EmptyParameterMemberownedRelationship+=TriggerActionMember)?(ownedRelationship+=GuardExpressionMember)?(ownedRelationship+=EffectBehaviorMember)?'then'ownedRelationship+=TransitionSuccessionMemberActionBody + stringBuilder.Append("else "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - stringBuilder.Append("transition "); - // Group Element + } + + /// + /// 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) + { + // Group Element + stringBuilder.Append("succession "); + // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + + stringBuilder.Append("first "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append("then "); // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // non Terminal : UsageBody; Found rule UsageBody:Usage=DefinitionBody + 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) + { // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Group Element - // Group Element - // Group Element + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); stringBuilder.Append("then "); // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' + 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) + { + stringBuilder.Append("transition "); + // Group Element + // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + stringBuilder.Append("first "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + stringBuilder.Append("then "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' + TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TriggerInvocationExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TriggerInvocationExpressionTextualNotationBuilder.cs index e92a2caf..6d17b9a3 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TriggerInvocationExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TriggerInvocationExpressionTextualNotationBuilder.cs @@ -29,28 +29,19 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class TriggerInvocationExpressionTextualNotationBuilder : TextualNotationBuilder + public static partial class TriggerInvocationExpressionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule TriggerExpression + /// TriggerExpression:TriggerInvocationExpression=kind=('at'|'after')ownedRelationship+=ArgumentMember|kind='when'ownedRelationship+=ArgumentExpressionMember /// - /// The used to query textual notation of referenced - public TriggerInvocationExpressionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.TriggerInvocationExpression poco) - { - var stringBuilder = new StringBuilder(); - - return stringBuilder.ToString(); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeFeaturingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeFeaturingTextualNotationBuilder.cs index a6c973f2..464e8c2b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeFeaturingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeFeaturingTextualNotationBuilder.cs @@ -29,40 +29,45 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class TypeFeaturingTextualNotationBuilder : TextualNotationBuilder + public static partial class TypeFeaturingTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule OwnedTypeFeaturing + /// OwnedTypeFeaturing:TypeFeaturing=featuringType=[QualifiedName] /// - /// The used to query textual notation of referenced - public TypeFeaturingTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // Assignment Element : featuringType = SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + // If property featuringType value is set, print SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule TypeFeaturing + /// TypeFeaturing='featuring'(Identification'of')?featureOfType=[QualifiedName]'by'featuringType=[QualifiedName]RelationshipBody /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Features.TypeFeaturing poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : TypeFeaturing='featuring'(Identification'of')?featureOfType=[QualifiedName]'by'featuringType=[QualifiedName]RelationshipBody - stringBuilder.Append("featuring "); - // Group Element - // Assignment Element : featureOfType = - stringBuilder.Append("by "); - // Assignment Element : featuringType = - // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' - - - + // Group Element + // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + stringBuilder.Append("of "); + // Assignment Element : featureOfType = SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + // If property featureOfType value is set, print SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + stringBuilder.Append("by "); + // Assignment Element : featuringType = SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + // If property featuringType value is set, print SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' + RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs index aa3cc3ed..c08f980e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs @@ -29,40 +29,426 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class TypeTextualNotationBuilder : TextualNotationBuilder + public static partial class TypeTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule DefinitionBody + /// DefinitionBody:Type=';'|'{'DefinitionBodyItem*'}' /// - /// The used to query textual notation of referenced - public TypeTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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 provided + /// 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 textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Types.Type poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : Type=TypePrefix'type'TypeDeclarationTypeBody + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } - // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* + /// + /// 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"); + } - stringBuilder.Append("type "); - // non Terminal : TypeDeclaration; Found rule TypeDeclaration:Type=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SpecializationPart|ConjugationPart)+TypeRelationshipPart* + /// + /// 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) + { + // non Terminal : CalculationBodyItem; Found rule CalculationBodyItem:Type=ActionBodyItem|ownedRelationship+=ReturnParameterMember + BuildCalculationBodyItem(poco, stringBuilder); + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + } + + /// + /// 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) + { + // Group Element + // Assignment Element : isAbstract ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // If property isAbstract value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + + } + + /// + /// 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) + { + // Group Element + // Assignment Element : isSufficient ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // If property isSufficient value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + + // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // non Terminal : TypeRelationshipPart; Found rule TypeRelationshipPart:Type=DisjoiningPart|UnioningPart|IntersectingPart|DifferencingPart + 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) + { + // non Terminal : SPECIALIZES; Found rule SPECIALIZES=':>'|'specializes' + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Group Element + stringBuilder.Append(", "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + + } + + /// + /// 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) + { + // non Terminal : CONJUGATES; Found rule CONJUGATES='~'|'conjugates' + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + stringBuilder.Append("disjoint "); + stringBuilder.Append("from "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Group Element + stringBuilder.Append(", "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + + } + + /// + /// 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) + { + stringBuilder.Append("unions "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Group Element + stringBuilder.Append(", "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + + } + + /// + /// 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) + { + stringBuilder.Append("intersects "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Group Element + stringBuilder.Append(", "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + + } + + /// + /// 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) + { + stringBuilder.Append("differences "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Group Element + stringBuilder.Append(", "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + + } + + /// + /// 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) + { + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + + } + + /// + /// 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) + { + // Value Literal Element : [QualifiedName] + + } + + /// + /// 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) + { + // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* + BuildTypePrefix(poco, stringBuilder); + stringBuilder.Append("type "); + // non Terminal : TypeDeclaration; Found rule TypeDeclaration:Type=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SpecializationPart|ConjugationPart)+TypeRelationshipPart* + BuildTypeDeclaration(poco, stringBuilder); + // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + BuildTypeBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UnioningTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UnioningTextualNotationBuilder.cs index 4e722d83..184ffe9e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UnioningTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UnioningTextualNotationBuilder.cs @@ -29,32 +29,19 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class UnioningTextualNotationBuilder : TextualNotationBuilder + public static partial class UnioningTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule Unioning + /// Unioning=unioningType=[QualifiedName]|ownedRelatedElement+=OwnedFeatureChain /// - /// The used to query textual notation of referenced - public UnioningTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Core.Types.Unioning poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : Unioning=unioningType=[QualifiedName]|ownedRelatedElement+=OwnedFeatureChain - - // Assignment Element : unioningType = - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - - return stringBuilder.ToString(); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs index 484e83a5..e0c2934a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs @@ -29,36 +29,284 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class UsageTextualNotationBuilder : TextualNotationBuilder + public static partial class UsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule UsageElement + /// UsageElement:Usage=NonOccurrenceUsageElement|OccurrenceUsageElement /// - /// The used to query textual notation of referenced - public UsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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 provided + /// 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 textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.Usage poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : Usage=UsageDeclarationUsageCompletion + // Group Element + // Assignment Element : direction = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property direction value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? + // Group Element + // Assignment Element : isDerived ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // If property isDerived value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // Group Element + // Assignment Element : isConstant ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // If property isConstant value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // non Terminal : UsageCompletion; Found rule UsageCompletion:Usage=ValuePart?UsageBody + } + + /// + /// 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) + { + // non Terminal : RefPrefix; Found rule RefPrefix:Usage=(direction=FeatureDirection)?(isDerived?='derived')?(isAbstract?='abstract'|isVariation?='variation')?(isConstant?='constant')? + BuildRefPrefix(poco, stringBuilder); + // Group Element + // Assignment Element : isReference ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // If property isReference value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + + + } + + /// + /// 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) + { + // Assignment Element : isEnd ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // If property isEnd value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + // Group Element + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + + } + + /// + /// 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) + { + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + + } + + /// + /// 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) + { + // non Terminal : UnextendedUsagePrefix; Found rule UnextendedUsagePrefix:Usage=EndUsagePrefix|BasicUsagePrefix + BuildUnextendedUsagePrefix(poco, stringBuilder); + // non Terminal : UsageExtensionKeyword; Found rule UsageExtensionKeyword:Usage=ownedRelationship+=PrefixMetadataMember + 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) + { + // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + // non Terminal : FeatureSpecializationPart; Found rule FeatureSpecializationPart:Feature=FeatureSpecialization+MultiplicityPart?FeatureSpecialization*|MultiplicityPartFeatureSpecialization* + 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) + { + // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue + FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + // non Terminal : UsageBody; Found rule UsageBody:Usage=DefinitionBody + 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) + { + // non Terminal : DefinitionBody; Found rule DefinitionBody:Type=';'|'{'DefinitionBodyItem*'}' + 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) + { + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // non Terminal : UsageBody; Found rule UsageBody:Usage=DefinitionBody + 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) + { + // non Terminal : UnextendedUsagePrefix; Found rule UnextendedUsagePrefix:Usage=EndUsagePrefix|BasicUsagePrefix + BuildUnextendedUsagePrefix(poco, stringBuilder); + // non Terminal : UsageExtensionKeyword; Found rule UsageExtensionKeyword:Usage=ownedRelationship+=PrefixMetadataMember + BuildUsageExtensionKeyword(poco, stringBuilder); + // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion + 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) + { + // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? + BuildUsageDeclaration(poco, stringBuilder); + // non Terminal : UsageCompletion; Found rule UsageCompletion:Usage=ValuePart?UsageBody + BuildUsageCompletion(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseDefinitionTextualNotationBuilder.cs index c49f7b97..3d52ac55 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseDefinitionTextualNotationBuilder.cs @@ -29,42 +29,28 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class UseCaseDefinitionTextualNotationBuilder : TextualNotationBuilder + public static partial class UseCaseDefinitionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule UseCaseDefinition + /// UseCaseDefinition=OccurrenceDefinitionPrefix'use''case''def'DefinitionDeclarationCaseBody /// - /// The used to query textual notation of referenced - public UseCaseDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.UseCases.UseCaseDefinition poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : UseCaseDefinition=OccurrenceDefinitionPrefix'use''case''def'DefinitionDeclarationCaseBody - - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* - - + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("use "); stringBuilder.Append("case "); stringBuilder.Append("def "); - // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? - - - // non Terminal : CaseBody; Found rule CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' - - + // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); + // non Terminal : CaseBody; Found rule CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' + TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseUsageTextualNotationBuilder.cs index 752d5434..9193feba 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseUsageTextualNotationBuilder.cs @@ -29,45 +29,31 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class UseCaseUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class UseCaseUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule UseCaseUsage + /// UseCaseUsage=OccurrenceUsagePrefix'use''case'ConstraintUsageDeclarationCaseBody /// - /// The used to query textual notation of referenced - public UseCaseUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.UseCases.UseCaseUsage poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : UseCaseUsage=OccurrenceUsagePrefix'use''case'ConstraintUsageDeclarationCaseBody - - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* - - + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("use "); stringBuilder.Append("case "); - // non Terminal : ConstraintUsageDeclaration; Found rule ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? - - - - - - - // non Terminal : CaseBody; Found rule CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' - + // non Terminal : ConstraintUsageDeclaration; Found rule ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? + // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue + FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + // non Terminal : CaseBody; Found rule CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' + TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VariantMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VariantMembershipTextualNotationBuilder.cs index 23444e06..5a5b2134 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VariantMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VariantMembershipTextualNotationBuilder.cs @@ -29,28 +29,39 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class VariantMembershipTextualNotationBuilder : TextualNotationBuilder + public static partial class VariantMembershipTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule VariantUsageMember + /// VariantUsageMember:VariantMembership=MemberPrefix'variant'ownedVariantUsage=VariantUsageElement /// - /// The used to query textual notation of referenced - public VariantMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + stringBuilder.Append("variant "); + // Assignment Element : ownedVariantUsage = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedVariantUsage value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + } /// - /// Builds the Textual Notation string for the provided + /// Builds the Textual Notation string for the rule EnumerationUsageMember + /// EnumerationUsageMember:VariantMembership=MemberPrefixownedRelatedElement+=EnumeratedValue /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.VariantMembership poco) + /// 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) { - var stringBuilder = new StringBuilder(); + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseDefinitionTextualNotationBuilder.cs index 425defbb..10873fae 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseDefinitionTextualNotationBuilder.cs @@ -29,41 +29,27 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class VerificationCaseDefinitionTextualNotationBuilder : TextualNotationBuilder + public static partial class VerificationCaseDefinitionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule VerificationCaseDefinition + /// VerificationCaseDefinition=OccurrenceDefinitionPrefix'verification''def'DefinitionDeclarationCaseBody /// - /// The used to query textual notation of referenced - public VerificationCaseDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.VerificationCases.VerificationCaseDefinition poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : VerificationCaseDefinition=OccurrenceDefinitionPrefix'verification''def'DefinitionDeclarationCaseBody - - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* - - + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("verification "); stringBuilder.Append("def "); - // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? - - - // non Terminal : CaseBody; Found rule CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' - - + // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); + // non Terminal : CaseBody; Found rule CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' + TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseUsageTextualNotationBuilder.cs index 64bbaa09..5907aea3 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseUsageTextualNotationBuilder.cs @@ -29,44 +29,30 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class VerificationCaseUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class VerificationCaseUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule VerificationCaseUsage + /// VerificationCaseUsage=OccurrenceUsagePrefix'verification'ConstraintUsageDeclarationCaseBody /// - /// The used to query textual notation of referenced - public VerificationCaseUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.VerificationCases.VerificationCaseUsage poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : VerificationCaseUsage=OccurrenceUsagePrefix'verification'ConstraintUsageDeclarationCaseBody - - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* - - + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("verification "); - // non Terminal : ConstraintUsageDeclaration; Found rule ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? - - - - - - - // non Terminal : CaseBody; Found rule CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' - + // non Terminal : ConstraintUsageDeclaration; Found rule ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? + // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue + FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + // non Terminal : CaseBody; Found rule CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' + TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs index 0784a909..6255ccd5 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs @@ -29,41 +29,49 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class ViewDefinitionTextualNotationBuilder : TextualNotationBuilder + public static partial class ViewDefinitionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule ViewDefinitionBody + /// ViewDefinitionBody:ViewDefinition=';'|'{'ViewDefinitionBodyItem*'}' /// - /// The used to query textual notation of referenced - public ViewDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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 provided + /// Builds the Textual Notation string for the rule ViewDefinitionBodyItem + /// ViewDefinitionBodyItem:ViewDefinition=DefinitionBodyItem|ownedRelationship+=ElementFilterMember|ownedRelationship+=ViewRenderingMember /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Views.ViewDefinition poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : ViewDefinition=OccurrenceDefinitionPrefix'view''def'DefinitionDeclarationViewDefinitionBody - - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* - + 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) + { + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("view "); stringBuilder.Append("def "); - // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? - - - // non Terminal : ViewDefinitionBody; Found rule ViewDefinitionBody:ViewDefinition=';'|'{'ViewDefinitionBodyItem*'}' - - + // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); + // non Terminal : ViewDefinitionBody; Found rule ViewDefinitionBody:ViewDefinition=';'|'{'ViewDefinitionBodyItem*'}' + BuildViewDefinitionBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewRenderingMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewRenderingMembershipTextualNotationBuilder.cs index 656522e1..7745ff9c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewRenderingMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewRenderingMembershipTextualNotationBuilder.cs @@ -29,28 +29,24 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class ViewRenderingMembershipTextualNotationBuilder : TextualNotationBuilder + public static partial class ViewRenderingMembershipTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule ViewRenderingMember + /// ViewRenderingMember:ViewRenderingMembership=MemberPrefix'render'ownedRelatedElement+=ViewRenderingUsage /// - /// The used to query textual notation of referenced - public ViewRenderingMembershipTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Views.ViewRenderingMembership poco) - { - var stringBuilder = new StringBuilder(); + // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + stringBuilder.Append("render "); + // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs index 5da8be3a..5ee321f7 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs @@ -29,43 +29,50 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class ViewUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class ViewUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule ViewBody + /// ViewBody:ViewUsage=';'|'{'ViewBodyItem*'}' /// - /// The used to query textual notation of referenced - public ViewUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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 provided + /// Builds the Textual Notation string for the rule ViewBodyItem + /// ViewBodyItem:ViewUsage=DefinitionBodyItem|ownedRelationship+=ElementFilterMember|ownedRelationship+=ViewRenderingMember|ownedRelationship+=Expose /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Views.ViewUsage poco) + /// 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) { - var stringBuilder = new StringBuilder(); - // Rule definition : ViewUsage=OccurrenceUsagePrefix'view'UsageDeclaration?ValuePart?ViewBody - - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* - + 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) + { + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("view "); - // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? - - - // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue - - - // non Terminal : ViewBody; Found rule ViewBody:ViewUsage=';'|'{'ViewBodyItem*'}' - - + // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue + FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + // non Terminal : ViewBody; Found rule ViewBody:ViewUsage=';'|'{'ViewBodyItem*'}' + BuildViewBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointDefinitionTextualNotationBuilder.cs index d5646706..892b92cd 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointDefinitionTextualNotationBuilder.cs @@ -29,41 +29,27 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class ViewpointDefinitionTextualNotationBuilder : TextualNotationBuilder + public static partial class ViewpointDefinitionTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule ViewpointDefinition + /// ViewpointDefinition=OccurrenceDefinitionPrefix'viewpoint''def'DefinitionDeclarationRequirementBody /// - /// The used to query textual notation of referenced - public ViewpointDefinitionTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Views.ViewpointDefinition poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : ViewpointDefinition=OccurrenceDefinitionPrefix'viewpoint''def'DefinitionDeclarationRequirementBody - - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* - - + // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("viewpoint "); stringBuilder.Append("def "); - // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? - - - // non Terminal : RequirementBody; Found rule RequirementBody:Type=';'|'{'RequirementBodyItem*'}' - - + // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); + // non Terminal : RequirementBody; Found rule RequirementBody:Type=';'|'{'RequirementBodyItem*'}' + TypeTextualNotationBuilder.BuildRequirementBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointUsageTextualNotationBuilder.cs index 727f0287..c7f56352 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointUsageTextualNotationBuilder.cs @@ -29,46 +29,26 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class ViewpointUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class ViewpointUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule ViewpointUsage + /// ViewpointUsage=OccurrenceUsagePrefix'viewpoint'ConstraintUsageDeclarationRequirementBody /// - /// The used to query textual notation of referenced - public ViewpointUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Views.ViewpointUsage poco) - { - var stringBuilder = new StringBuilder(); - // Rule definition : ViewpointUsage=OccurrenceUsagePrefix'viewpoint'ConstraintUsageDeclarationRequirementBody - - - - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* - - + // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("viewpoint "); - // non Terminal : ConstraintUsageDeclaration; Found rule ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? - - - - - - - // non Terminal : RequirementBody; Found rule RequirementBody:Type=';'|'{'RequirementBodyItem*'}' - - + // non Terminal : ConstraintUsageDeclaration; Found rule ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? + ConstraintUsageTextualNotationBuilder.BuildConstraintUsageDeclaration(poco, stringBuilder); + // non Terminal : RequirementBody; Found rule RequirementBody:Type=';'|'{'RequirementBodyItem*'}' + TypeTextualNotationBuilder.BuildRequirementBody(poco, stringBuilder); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VisibilityKindTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VisibilityKindTextualNotationBuilder.cs new file mode 100644 index 00000000..a76da1f8 --- /dev/null +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VisibilityKindTextualNotationBuilder.cs @@ -0,0 +1,51 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// 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.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 index d4f759d4..fb835343 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/WhileLoopActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/WhileLoopActionUsageTextualNotationBuilder.cs @@ -29,28 +29,31 @@ namespace SysML2.NET.TextualNotation using SysML2.NET.Core.POCO.Root.Elements; /// - /// The provides Textual Notation Builder for the element + /// The provides Textual Notation Builder for the element /// - public class WhileLoopActionUsageTextualNotationBuilder : TextualNotationBuilder + public static partial class WhileLoopActionUsageTextualNotationBuilder { /// - /// Initializes a new instance of a + /// Builds the Textual Notation string for the rule WhileLoopNode + /// WhileLoopNode:WhileLoopActionUsage=ActionNodePrefix('while'ownedRelationship+=ExpressionParameterMember|'loop'ownedRelationship+=EmptyParameterMember)ownedRelationship+=ActionBodyParameterMember('until'ownedRelationship+=ExpressionParameterMember';')? /// - /// The used to query textual notation of referenced - public WhileLoopActionUsageTextualNotationBuilder(ITextualNotationBuilderFacade facade) : base(facade) + /// 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) { - } + // non Terminal : ActionNodePrefix; Found rule ActionNodePrefix:ActionUsage=OccurrenceUsagePrefixActionNodeUsageDeclaration? + ActionUsageTextualNotationBuilder.BuildActionNodePrefix(poco, stringBuilder); + // Group Element + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // Group Element + stringBuilder.Append("until "); + // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append("; "); - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public override string BuildTextualNotation(SysML2.NET.Core.POCO.Systems.Actions.WhileLoopActionUsage poco) - { - var stringBuilder = new StringBuilder(); - return stringBuilder.ToString(); } } } diff --git a/SysML2.NET/TextualNotation/ConjugatedPortTypingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/ConjugatedPortTypingTextualNotationBuilder.cs new file mode 100644 index 00000000..afe670eb --- /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/FeatureMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/FeatureMembershipTextualNotationBuilder.cs new file mode 100644 index 00000000..e1c0ddbf --- /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/TextualNotationBuilder.cs b/SysML2.NET/TextualNotation/TextualNotationBuilder.cs deleted file mode 100644 index 4ea1b815..00000000 --- a/SysML2.NET/TextualNotation/TextualNotationBuilder.cs +++ /dev/null @@ -1,52 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// 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.Elements; - - /// - /// Base class that provides Textual Notation string builder for a specific - /// - /// Any concrete class - public abstract class TextualNotationBuilder where TElement : class, IElement - { - /// - /// Gets the used to query textual notation of referenced - /// - protected readonly ITextualNotationBuilderFacade Facade; - - /// - /// Initializes a new instance of a - /// - /// The used to query textual notation of referenced - protected TextualNotationBuilder(ITextualNotationBuilderFacade facade) - { - this.Facade = facade; - } - - /// - /// Builds the Textual Notation string for the provided - /// - /// The from which the textual notation should be build - /// The built textual notation string - public abstract string BuildTextualNotation(TElement poco); - } -} From 2414031e0c2ee5254246399bad945674f5caebd5 Mon Sep 17 00:00:00 2001 From: atheate Date: Thu, 26 Feb 2026 13:19:17 +0100 Subject: [PATCH 08/33] Supports assignment for bool and enum --- .../Extensions/PropertyExtension.cs | 44 ++++ .../HandleBarHelpers/RulesHelper.cs | 100 +++++++- ...AcceptActionUsageTextualNotationBuilder.cs | 27 +- .../ActionDefinitionTextualNotationBuilder.cs | 3 - .../ActionUsageTextualNotationBuilder.cs | 29 +-- .../ActorMembershipTextualNotationBuilder.cs | 4 +- ...ocationDefinitionTextualNotationBuilder.cs | 2 - .../AllocationUsageTextualNotationBuilder.cs | 3 - ...sisCaseDefinitionTextualNotationBuilder.cs | 3 - ...AnalysisCaseUsageTextualNotationBuilder.cs | 5 - .../AnnotationTextualNotationBuilder.cs | 11 +- ...rtConstraintUsageTextualNotationBuilder.cs | 12 +- ...gnmentActionUsageTextualNotationBuilder.cs | 11 - ...ociationStructureTextualNotationBuilder.cs | 3 - .../AssociationTextualNotationBuilder.cs | 3 - ...tributeDefinitionTextualNotationBuilder.cs | 2 - .../AttributeUsageTextualNotationBuilder.cs | 2 - .../BehaviorTextualNotationBuilder.cs | 3 - ...gConnectorAsUsageTextualNotationBuilder.cs | 14 +- .../BindingConnectorTextualNotationBuilder.cs | 13 +- ...BooleanExpressionTextualNotationBuilder.cs | 14 +- ...ulationDefinitionTextualNotationBuilder.cs | 3 - .../CalculationUsageTextualNotationBuilder.cs | 3 - .../CaseDefinitionTextualNotationBuilder.cs | 3 - .../CaseUsageTextualNotationBuilder.cs | 5 - .../ClassTextualNotationBuilder.cs | 3 - .../ClassifierTextualNotationBuilder.cs | 50 ++-- ...CollectExpressionTextualNotationBuilder.cs | 8 +- .../CommentTextualNotationBuilder.cs | 27 +- ...ConcernDefinitionTextualNotationBuilder.cs | 3 - .../ConcernUsageTextualNotationBuilder.cs | 3 - ...tedPortDefinitionTextualNotationBuilder.cs | 3 +- ...jugatedPortTypingTextualNotationBuilder.cs | 3 +- .../ConjugationTextualNotationBuilder.cs | 10 +- ...nectionDefinitionTextualNotationBuilder.cs | 2 - .../ConnectionUsageTextualNotationBuilder.cs | 32 ++- .../ConnectorTextualNotationBuilder.cs | 44 ++-- ...straintDefinitionTextualNotationBuilder.cs | 3 - .../ConstraintUsageTextualNotationBuilder.cs | 5 - ...tructorExpressionTextualNotationBuilder.cs | 6 +- .../DataTypeTextualNotationBuilder.cs | 3 - .../DecisionNodeTextualNotationBuilder.cs | 6 +- .../DefinitionTextualNotationBuilder.cs | 12 +- .../DependencyTextualNotationBuilder.cs | 40 ++- .../DisjoiningTextualNotationBuilder.cs | 9 +- .../DocumentationTextualNotationBuilder.cs | 14 +- ...tFilterMembershipTextualNotationBuilder.cs | 13 +- .../ElementTextualNotationBuilder.cs | 20 +- ...FeatureMembershipTextualNotationBuilder.cs | 15 +- ...erationDefinitionTextualNotationBuilder.cs | 3 - .../EnumerationUsageTextualNotationBuilder.cs | 3 - ...ntOccurrenceUsageTextualNotationBuilder.cs | 7 +- ...ExhibitStateUsageTextualNotationBuilder.cs | 5 +- .../ExposeTextualNotationBuilder.cs | 3 +- .../ExpressionTextualNotationBuilder.cs | 27 +- ...reChainExpressionTextualNotationBuilder.cs | 8 +- .../FeatureChainingTextualNotationBuilder.cs | 3 +- .../FeatureInvertingTextualNotationBuilder.cs | 9 +- ...FeatureMembershipTextualNotationBuilder.cs | 93 ++----- ...ferenceExpressionTextualNotationBuilder.cs | 18 +- .../FeatureTextualNotationBuilder.cs | 237 ++++++++---------- .../FeatureTypingTextualNotationBuilder.cs | 3 +- .../FeatureValueTextualNotationBuilder.cs | 38 +-- .../FlowDefinitionTextualNotationBuilder.cs | 2 - .../FlowEndTextualNotationBuilder.cs | 11 +- .../FlowTextualNotationBuilder.cs | 13 +- .../FlowUsageTextualNotationBuilder.cs | 6 - ...orLoopActionUsageTextualNotationBuilder.cs | 10 +- .../ForkNodeTextualNotationBuilder.cs | 6 +- ...ConcernMembershipTextualNotationBuilder.cs | 4 +- .../FunctionTextualNotationBuilder.cs | 3 - .../IfActionUsageTextualNotationBuilder.cs | 17 +- .../ImportTextualNotationBuilder.cs | 13 +- ...cludeUseCaseUsageTextualNotationBuilder.cs | 5 +- .../IndexExpressionTextualNotationBuilder.cs | 12 +- .../InteractionTextualNotationBuilder.cs | 3 - ...terfaceDefinitionTextualNotationBuilder.cs | 3 - .../InterfaceUsageTextualNotationBuilder.cs | 31 +-- .../InvariantTextualNotationBuilder.cs | 15 +- ...ocationExpressionTextualNotationBuilder.cs | 18 +- .../ItemDefinitionTextualNotationBuilder.cs | 2 - .../ItemUsageTextualNotationBuilder.cs | 2 - .../JoinNodeTextualNotationBuilder.cs | 6 +- .../LibraryPackageTextualNotationBuilder.cs | 15 +- .../LiteralBooleanTextualNotationBuilder.cs | 3 +- .../LiteralInfinityTextualNotationBuilder.cs | 2 +- .../LiteralIntegerTextualNotationBuilder.cs | 3 +- .../LiteralStringTextualNotationBuilder.cs | 3 +- .../MembershipExposeTextualNotationBuilder.cs | 1 - .../MembershipImportTextualNotationBuilder.cs | 13 +- .../MembershipTextualNotationBuilder.cs | 41 +-- .../MergeNodeTextualNotationBuilder.cs | 6 +- .../MetaclassTextualNotationBuilder.cs | 3 - ...aAccessExpressionTextualNotationBuilder.cs | 8 +- ...etadataDefinitionTextualNotationBuilder.cs | 10 +- .../MetadataFeatureTextualNotationBuilder.cs | 43 ++-- .../MetadataUsageTextualNotationBuilder.cs | 36 ++- ...MultiplicityRangeTextualNotationBuilder.cs | 35 +-- .../MultiplicityTextualNotationBuilder.cs | 3 - .../NamespaceExposeTextualNotationBuilder.cs | 1 - .../NamespaceTextualNotationBuilder.cs | 12 +- ...jectiveMembershipTextualNotationBuilder.cs | 4 +- ...urrenceDefinitionTextualNotationBuilder.cs | 24 +- .../OccurrenceUsageTextualNotationBuilder.cs | 66 +++-- ...peratorExpressionTextualNotationBuilder.cs | 97 +++---- .../OwningMembershipTextualNotationBuilder.cs | 51 ++-- .../PackageTextualNotationBuilder.cs | 19 +- ...rameterMembershipTextualNotationBuilder.cs | 48 ++-- .../PartDefinitionTextualNotationBuilder.cs | 2 - .../PartUsageTextualNotationBuilder.cs | 6 - .../PayloadFeatureTextualNotationBuilder.cs | 1 - ...erformActionUsageTextualNotationBuilder.cs | 14 +- .../PortDefinitionTextualNotationBuilder.cs | 5 +- .../PortUsageTextualNotationBuilder.cs | 28 +-- .../PredicateTextualNotationBuilder.cs | 3 - .../RedefinitionTextualNotationBuilder.cs | 14 +- .../ReferenceUsageTextualNotationBuilder.cs | 73 +++--- ...nderingDefinitionTextualNotationBuilder.cs | 2 - .../RenderingUsageTextualNotationBuilder.cs | 2 - ...straintMembershipTextualNotationBuilder.cs | 5 +- ...irementDefinitionTextualNotationBuilder.cs | 3 - .../RequirementUsageTextualNotationBuilder.cs | 6 - ...icationMembershipTextualNotationBuilder.cs | 4 +- ...ressionMembershipTextualNotationBuilder.cs | 4 +- ...rameterMembershipTextualNotationBuilder.cs | 14 +- ...yRequirementUsageTextualNotationBuilder.cs | 20 +- .../SelectExpressionTextualNotationBuilder.cs | 6 +- .../SendActionUsageTextualNotationBuilder.cs | 17 +- .../SpecializationTextualNotationBuilder.cs | 9 - ...eholderMembershipTextualNotationBuilder.cs | 4 +- .../StateDefinitionTextualNotationBuilder.cs | 3 - ...bactionMembershipTextualNotationBuilder.cs | 21 +- .../StateUsageTextualNotationBuilder.cs | 3 - .../StepTextualNotationBuilder.cs | 14 +- .../StructureTextualNotationBuilder.cs | 3 - ...SubclassificationTextualNotationBuilder.cs | 15 +- ...SubjectMembershipTextualNotationBuilder.cs | 7 +- .../SubsettingTextualNotationBuilder.cs | 8 - ...SuccessionAsUsageTextualNotationBuilder.cs | 21 +- .../SuccessionFlowTextualNotationBuilder.cs | 13 +- ...ccessionFlowUsageTextualNotationBuilder.cs | 3 - .../SuccessionTextualNotationBuilder.cs | 19 +- ...minateActionUsageTextualNotationBuilder.cs | 11 +- ...ualRepresentationTextualNotationBuilder.cs | 10 +- ...FeatureMembershipTextualNotationBuilder.cs | 9 +- .../TransitionUsageTextualNotationBuilder.cs | 76 +++--- .../TypeFeaturingTextualNotationBuilder.cs | 14 +- .../TypeTextualNotationBuilder.cs | 127 +++++----- .../UsageTextualNotationBuilder.cs | 65 +++-- ...UseCaseDefinitionTextualNotationBuilder.cs | 3 - .../UseCaseUsageTextualNotationBuilder.cs | 5 - ...VariantMembershipTextualNotationBuilder.cs | 8 +- ...ionCaseDefinitionTextualNotationBuilder.cs | 3 - ...ficationCaseUsageTextualNotationBuilder.cs | 5 - .../ViewDefinitionTextualNotationBuilder.cs | 3 - ...nderingMembershipTextualNotationBuilder.cs | 4 +- .../ViewUsageTextualNotationBuilder.cs | 4 - ...ewpointDefinitionTextualNotationBuilder.cs | 3 - .../ViewpointUsageTextualNotationBuilder.cs | 3 - ...leLoopActionUsageTextualNotationBuilder.cs | 18 +- 160 files changed, 1009 insertions(+), 1576 deletions(-) diff --git a/SysML2.NET.CodeGenerator/Extensions/PropertyExtension.cs b/SysML2.NET.CodeGenerator/Extensions/PropertyExtension.cs index e9032015..b8c13754 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}.{propertyName}.Count != 0"; + } + + 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/HandleBarHelpers/RulesHelper.cs b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs index 6165d7dc..4e491089 100644 --- a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs +++ b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs @@ -81,13 +81,45 @@ public static void RegisterRulesHelper(this IHandlebars handlebars) /// The related /// The collection of alternatives to process /// A collection of all existing rules - private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClass, IReadOnlyCollection alternatives, IReadOnlyCollection rules) + /// + private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClass, IReadOnlyCollection alternatives, IReadOnlyCollection rules, bool callerElementIsOptional = false) { if (alternatives.Count == 1) { - foreach (var textualRuleElement in alternatives.ElementAt(0).Elements) + var elements = alternatives.ElementAt(0).Elements; + + if (callerElementIsOptional) { - ProcessRuleElement(writer, umlClass, rules, textualRuleElement); + var targetPropertiesName = elements.OfType().Select(x => x.Property).Distinct().ToList(); + + if (targetPropertiesName.Count > 0) + { + var allProperties = umlClass.QueryAllProperties(); + writer.WriteSafeString("if("); + + var ifStatementContent = targetPropertiesName + .Select(propertyName => allProperties.SingleOrDefault(x => string.Equals(x.Name, propertyName, StringComparison.OrdinalIgnoreCase))) + .Select(matchedProperty => matchedProperty.QueryIfStatementContentForNonEmpty("poco")).ToList(); + + writer.WriteSafeString(string.Join(" && ", ifStatementContent)); + writer.WriteSafeString($"){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + + foreach (var textualRuleElement in elements) + { + ProcessRuleElement(writer, umlClass, rules, textualRuleElement); + } + + writer.WriteSafeString($"stringBuilder.Append(' ');{Environment.NewLine}"); + writer.WriteSafeString($"}}{Environment.NewLine}"); + } + } + else + { + foreach (var textualRuleElement in elements) + { + ProcessRuleElement(writer, umlClass, rules, textualRuleElement); + } } } else @@ -109,12 +141,18 @@ private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass switch (textualRuleElement) { case TerminalElement terminalElement: - writer.WriteSafeString($"stringBuilder.Append(\"{terminalElement.Value} \");"); + var valueToAdd = terminalElement.Value; + + if (valueToAdd.Length > 1) + { + valueToAdd += ' '; + } + + writer.WriteSafeString($"stringBuilder.Append(\"{valueToAdd}\");"); break; case NonTerminalElement nonTerminalElement: var referencedRule = rules.Single(x => x.RuleName == nonTerminalElement.Name); var typeTarget = referencedRule.TargetElementName ?? referencedRule.RuleName; - writer.WriteSafeString($"// non Terminal : {nonTerminalElement.Name}; Found rule {referencedRule.RawRule} {Environment.NewLine}"); if (typeTarget != umlClass.Name) { @@ -143,17 +181,61 @@ private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass break; case GroupElement groupElement: - writer.WriteSafeString($"// Group Element{Environment.NewLine}"); - ProcessAlternatives(writer, umlClass, groupElement.Alternatives, rules); + ProcessAlternatives(writer, umlClass, groupElement.Alternatives, rules, groupElement.IsOptional); + + if (!groupElement.IsOptional) + { + writer.WriteSafeString($"{Environment.NewLine}stringBuilder.Append(' ');"); + } + break; case AssignmentElement assignmentElement: - writer.WriteSafeString($"// Assignment Element : {assignmentElement.Property} {assignmentElement.Operator} {assignmentElement.Value}{Environment.NewLine}"); var properties = umlClass.QueryAllProperties(); var targetProperty = properties.SingleOrDefault(x => string.Equals(x.Name, assignmentElement.Property, StringComparison.OrdinalIgnoreCase)); if (targetProperty != null) { - writer.WriteSafeString($"// If property {targetProperty.Name} value is set, print {assignmentElement.Value}"); + if (targetProperty.QueryIsEnumerable()) + { + writer.WriteSafeString("throw new System.NotSupportedException(\"Assigment of enumerable not supported yet\");"); + } + else + { + if (assignmentElement.IsOptional) + { + writer.WriteSafeString($"{Environment.NewLine}if({targetProperty.QueryIfStatementContentForNonEmpty("poco")}){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + writer.WriteSafeString($"{Environment.NewLine}"); + writer.WriteSafeString($"stringBuilder.Append(poco.{targetProperty.Name.CapitalizeFirstLetter()});{Environment.NewLine}"); + writer.WriteSafeString("}}"); + } + else + { + if (targetProperty.QueryIsString()) + { + writer.WriteSafeString($"stringBuilder.Append(poco.{targetProperty.Name.CapitalizeFirstLetter()});"); + } + else if(targetProperty.QueryIsBool()) + { + if (assignmentElement.Value is TerminalElement terminalElement) + { + writer.WriteSafeString($"stringBuilder.Append(\"{terminalElement.Value}\");"); + } + else + { + writer.WriteSafeString("throw new System.NotSupportedException(\"Assigment of bool with rule element value different than TerminalElement not supported\");"); + } + } + else if (targetProperty.QueryIsEnum()) + { + writer.WriteSafeString($"stringBuilder.Append(poco.{targetProperty.Name.CapitalizeFirstLetter()}.ToString().ToLower());"); + } + else + { + writer.WriteSafeString("throw new System.NotSupportedException(\"Assigment of non-string value not yet supported\");"); + } + } + } } else { diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.cs index 21bc64aa..97d150b1 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.cs @@ -41,11 +41,8 @@ public static partial class AcceptActionUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildAcceptNode(SysML2.NET.Core.POCO.Systems.Actions.IAcceptActionUsage poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); - // non Terminal : AcceptNodeDeclaration; Found rule AcceptNodeDeclaration:AcceptActionUsage=ActionNodeUsageDeclaration?'accept'AcceptParameterPart BuildAcceptNodeDeclaration(poco, stringBuilder); - // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); } @@ -58,10 +55,8 @@ public static void BuildAcceptNode(SysML2.NET.Core.POCO.Systems.Actions.IAcceptA /// The that contains the entire textual notation public static void BuildAcceptNodeDeclaration(SysML2.NET.Core.POCO.Systems.Actions.IAcceptActionUsage poco, StringBuilder stringBuilder) { - // non Terminal : ActionNodeUsageDeclaration; Found rule ActionNodeUsageDeclaration:ActionUsage='action'UsageDeclaration? ActionUsageTextualNotationBuilder.BuildActionNodeUsageDeclaration(poco, stringBuilder); stringBuilder.Append("accept "); - // non Terminal : AcceptParameterPart; Found rule AcceptParameterPart:AcceptActionUsage=ownedRelationship+=PayloadParameterMember('via'ownedRelationship+=NodeParameterMember)? BuildAcceptParameterPart(poco, stringBuilder); } @@ -74,12 +69,13 @@ public static void BuildAcceptNodeDeclaration(SysML2.NET.Core.POCO.Systems.Actio /// The that contains the entire textual notation public static void BuildAcceptParameterPart(SysML2.NET.Core.POCO.Systems.Actions.IAcceptActionUsage poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Group Element - stringBuilder.Append("via "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + if (poco.OwnedRelationship.Count != 0) + { + stringBuilder.Append("via "); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } } @@ -92,9 +88,7 @@ public static void BuildAcceptParameterPart(SysML2.NET.Core.POCO.Systems.Actions /// The that contains the entire textual notation public static void BuildStateAcceptActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IAcceptActionUsage poco, StringBuilder stringBuilder) { - // non Terminal : AcceptNodeDeclaration; Found rule AcceptNodeDeclaration:AcceptActionUsage=ActionNodeUsageDeclaration?'accept'AcceptParameterPart BuildAcceptNodeDeclaration(poco, stringBuilder); - // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); } @@ -107,7 +101,6 @@ public static void BuildStateAcceptActionUsage(SysML2.NET.Core.POCO.Systems.Acti /// The that contains the entire textual notation public static void BuildTriggerAction(SysML2.NET.Core.POCO.Systems.Actions.IAcceptActionUsage poco, StringBuilder stringBuilder) { - // non Terminal : AcceptParameterPart; Found rule AcceptParameterPart:AcceptActionUsage=ownedRelationship+=PayloadParameterMember('via'ownedRelationship+=NodeParameterMember)? BuildAcceptParameterPart(poco, stringBuilder); } @@ -120,13 +113,7 @@ public static void BuildTriggerAction(SysML2.NET.Core.POCO.Systems.Actions.IAcce /// The that contains the entire textual notation public static void BuildTransitionAcceptActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IAcceptActionUsage poco, StringBuilder stringBuilder) { - // non Terminal : AcceptNodeDeclaration; Found rule AcceptNodeDeclaration:AcceptActionUsage=ActionNodeUsageDeclaration?'accept'AcceptParameterPart BuildAcceptNodeDeclaration(poco, stringBuilder); - // Group Element - stringBuilder.Append("{ "); - // non Terminal : ActionBodyItem; Found rule ActionBodyItem:Type=NonBehaviorBodyItem|ownedRelationship+=InitialNodeMember(ownedRelationship+=ActionTargetSuccessionMember)*|(ownedRelationship+=SourceSuccessionMember)?ownedRelationship+=ActionBehaviorMember(ownedRelationship+=ActionTargetSuccessionMember)*|ownedRelationship+=GuardedSuccessionMember - TypeTextualNotationBuilder.BuildActionBodyItem(poco, stringBuilder); - stringBuilder.Append("} "); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionDefinitionTextualNotationBuilder.cs index 5dec7aa8..395ed8bb 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionDefinitionTextualNotationBuilder.cs @@ -41,13 +41,10 @@ public static partial class ActionDefinitionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildActionDefinition(SysML2.NET.Core.POCO.Systems.Actions.IActionDefinition poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("action "); stringBuilder.Append("def "); - // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); - // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs index e6d8375b..4b0a2f36 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs @@ -41,9 +41,7 @@ public static partial class ActionUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildActionUsageDeclaration(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, StringBuilder stringBuilder) { - // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); - // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); } @@ -68,7 +66,6 @@ public static void BuildActionNode(SysML2.NET.Core.POCO.Systems.Actions.IActionU public static void BuildActionNodeUsageDeclaration(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, StringBuilder stringBuilder) { stringBuilder.Append("action "); - // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); } @@ -81,9 +78,7 @@ public static void BuildActionNodeUsageDeclaration(SysML2.NET.Core.POCO.Systems. /// The that contains the entire textual notation public static void BuildActionNodePrefix(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); - // non Terminal : ActionNodeUsageDeclaration; Found rule ActionNodeUsageDeclaration:ActionUsage='action'UsageDeclaration? BuildActionNodeUsageDeclaration(poco, stringBuilder); } @@ -96,18 +91,12 @@ public static void BuildActionNodePrefix(SysML2.NET.Core.POCO.Systems.Actions.IA /// The that contains the entire textual notation public static void BuildAssignmentNodeDeclaration(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, StringBuilder stringBuilder) { - // Group Element - // non Terminal : ActionNodeUsageDeclaration; Found rule ActionNodeUsageDeclaration:ActionUsage='action'UsageDeclaration? - BuildActionNodeUsageDeclaration(poco, stringBuilder); stringBuilder.Append("assign "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); stringBuilder.Append(":= "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -119,15 +108,10 @@ public static void BuildAssignmentNodeDeclaration(SysML2.NET.Core.POCO.Systems.A /// The that contains the entire textual notation public static void BuildActionBodyParameter(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, StringBuilder stringBuilder) { - // Group Element - stringBuilder.Append("action "); - // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? - UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); - stringBuilder.Append("{ "); - // non Terminal : ActionBodyItem; Found rule ActionBodyItem:Type=NonBehaviorBodyItem|ownedRelationship+=InitialNodeMember(ownedRelationship+=ActionTargetSuccessionMember)*|(ownedRelationship+=SourceSuccessionMember)?ownedRelationship+=ActionBehaviorMember(ownedRelationship+=ActionTargetSuccessionMember)*|ownedRelationship+=GuardedSuccessionMember + stringBuilder.Append("{"); TypeTextualNotationBuilder.BuildActionBodyItem(poco, stringBuilder); - stringBuilder.Append("} "); + stringBuilder.Append("}"); } @@ -172,12 +156,9 @@ public static void BuildEffectBehaviorUsage(SysML2.NET.Core.POCO.Systems.Actions /// The that contains the entire textual notation public static void BuildActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("action "); - // non Terminal : ActionUsageDeclaration; Found rule ActionUsageDeclaration:ActionUsage=UsageDeclarationValuePart? BuildActionUsageDeclaration(poco, stringBuilder); - // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActorMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActorMembershipTextualNotationBuilder.cs index 32cc3c30..5e0d05e6 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActorMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActorMembershipTextualNotationBuilder.cs @@ -41,10 +41,8 @@ public static partial class ActorMembershipTextualNotationBuilder /// The that contains the entire textual notation public static void BuildActorMember(SysML2.NET.Core.POCO.Systems.Requirements.IActorMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationDefinitionTextualNotationBuilder.cs index 16afccf6..301b2089 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationDefinitionTextualNotationBuilder.cs @@ -41,11 +41,9 @@ public static partial class AllocationDefinitionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildAllocationDefinition(SysML2.NET.Core.POCO.Systems.Allocations.IAllocationDefinition poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("allocation "); stringBuilder.Append("def "); - // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationUsageTextualNotationBuilder.cs index 3c25ebd6..14776059 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationUsageTextualNotationBuilder.cs @@ -52,11 +52,8 @@ public static void BuildAllocationUsageDeclaration(SysML2.NET.Core.POCO.Systems. /// The that contains the entire textual notation public static void BuildAllocationUsage(SysML2.NET.Core.POCO.Systems.Allocations.IAllocationUsage poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); - // non Terminal : AllocationUsageDeclaration; Found rule AllocationUsageDeclaration:AllocationUsage='allocation'UsageDeclaration('allocate'ConnectorPart)?|'allocate'ConnectorPart BuildAllocationUsageDeclaration(poco, stringBuilder); - // non Terminal : UsageBody; Found rule UsageBody:Usage=DefinitionBody UsageTextualNotationBuilder.BuildUsageBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseDefinitionTextualNotationBuilder.cs index ad2f0689..cd54c4a4 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseDefinitionTextualNotationBuilder.cs @@ -41,13 +41,10 @@ public static partial class AnalysisCaseDefinitionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildAnalysisCaseDefinition(SysML2.NET.Core.POCO.Systems.AnalysisCases.IAnalysisCaseDefinition poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("analysis "); stringBuilder.Append("def "); - // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); - // non Terminal : CaseBody; Found rule CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseUsageTextualNotationBuilder.cs index e34b4e54..4fafd028 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseUsageTextualNotationBuilder.cs @@ -41,16 +41,11 @@ public static partial class AnalysisCaseUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildAnalysisCaseUsage(SysML2.NET.Core.POCO.Systems.AnalysisCases.IAnalysisCaseUsage poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("analysis "); - // non Terminal : ConstraintUsageDeclaration; Found rule ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? - // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); - // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); - // non Terminal : CaseBody; Found rule CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.cs index 52cc66e8..2951e78c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.cs @@ -41,8 +41,7 @@ public static partial class AnnotationTextualNotationBuilder /// The that contains the entire textual notation public static void BuildOwnedAnnotation(SysML2.NET.Core.POCO.Root.Annotations.IAnnotation poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -54,9 +53,8 @@ public static void BuildOwnedAnnotation(SysML2.NET.Core.POCO.Root.Annotations.IA /// The that contains the entire textual notation public static void BuildPrefixMetadataAnnotation(SysML2.NET.Core.POCO.Root.Annotations.IAnnotation poco, StringBuilder stringBuilder) { - stringBuilder.Append("# "); - // Assignment Element : annotatingElement = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property annotatingElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append("#"); + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); // Assignment Element : ownedRelatedElement += annotatingElement } @@ -69,8 +67,7 @@ public static void BuildPrefixMetadataAnnotation(SysML2.NET.Core.POCO.Root.Annot /// The that contains the entire textual notation public static void BuildAnnotation(SysML2.NET.Core.POCO.Root.Annotations.IAnnotation poco, StringBuilder stringBuilder) { - // Assignment Element : annotatedElement = SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement - // If property annotatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssertConstraintUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssertConstraintUsageTextualNotationBuilder.cs index aaedc496..f6b12595 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssertConstraintUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssertConstraintUsageTextualNotationBuilder.cs @@ -41,16 +41,16 @@ public static partial class AssertConstraintUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildAssertConstraintUsage(SysML2.NET.Core.POCO.Systems.Constraints.IAssertConstraintUsage poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("assert "); - // Group Element - // Assignment Element : isNegated ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // If property isNegated value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + if (poco.IsNegated) + { + stringBuilder.Append("not"); + stringBuilder.Append(' '); + } - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // non Terminal : CalculationBody; Found rule CalculationBody:Type=';'|'{'CalculationBodyPart'}' + stringBuilder.Append(' '); TypeTextualNotationBuilder.BuildCalculationBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssignmentActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssignmentActionUsageTextualNotationBuilder.cs index c5ba02b4..85486415 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssignmentActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssignmentActionUsageTextualNotationBuilder.cs @@ -41,11 +41,8 @@ public static partial class AssignmentActionUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildAssignmentNode(SysML2.NET.Core.POCO.Systems.Actions.IAssignmentActionUsage poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); - // non Terminal : AssignmentNodeDeclaration; Found rule AssignmentNodeDeclaration:ActionUsage=(ActionNodeUsageDeclaration)?'assign'ownedRelationship+=AssignmentTargetMemberownedRelationship+=FeatureChainMember':='ownedRelationship+=NodeParameterMember ActionUsageTextualNotationBuilder.BuildAssignmentNodeDeclaration(poco, stringBuilder); - // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); } @@ -58,9 +55,7 @@ public static void BuildAssignmentNode(SysML2.NET.Core.POCO.Systems.Actions.IAss /// The that contains the entire textual notation public static void BuildStateAssignmentActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IAssignmentActionUsage poco, StringBuilder stringBuilder) { - // non Terminal : AssignmentNodeDeclaration; Found rule AssignmentNodeDeclaration:ActionUsage=(ActionNodeUsageDeclaration)?'assign'ownedRelationship+=AssignmentTargetMemberownedRelationship+=FeatureChainMember':='ownedRelationship+=NodeParameterMember ActionUsageTextualNotationBuilder.BuildAssignmentNodeDeclaration(poco, stringBuilder); - // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); } @@ -73,13 +68,7 @@ public static void BuildStateAssignmentActionUsage(SysML2.NET.Core.POCO.Systems. /// The that contains the entire textual notation public static void BuildTransitionAssignmentActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IAssignmentActionUsage poco, StringBuilder stringBuilder) { - // non Terminal : AssignmentNodeDeclaration; Found rule AssignmentNodeDeclaration:ActionUsage=(ActionNodeUsageDeclaration)?'assign'ownedRelationship+=AssignmentTargetMemberownedRelationship+=FeatureChainMember':='ownedRelationship+=NodeParameterMember ActionUsageTextualNotationBuilder.BuildAssignmentNodeDeclaration(poco, stringBuilder); - // Group Element - stringBuilder.Append("{ "); - // non Terminal : ActionBodyItem; Found rule ActionBodyItem:Type=NonBehaviorBodyItem|ownedRelationship+=InitialNodeMember(ownedRelationship+=ActionTargetSuccessionMember)*|(ownedRelationship+=SourceSuccessionMember)?ownedRelationship+=ActionBehaviorMember(ownedRelationship+=ActionTargetSuccessionMember)*|ownedRelationship+=GuardedSuccessionMember - TypeTextualNotationBuilder.BuildActionBodyItem(poco, stringBuilder); - stringBuilder.Append("} "); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationStructureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationStructureTextualNotationBuilder.cs index b1528d69..accee2d9 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationStructureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationStructureTextualNotationBuilder.cs @@ -41,13 +41,10 @@ public static partial class AssociationStructureTextualNotationBuilder /// The that contains the entire textual notation public static void BuildAssociationStructure(SysML2.NET.Core.POCO.Kernel.Associations.IAssociationStructure poco, StringBuilder stringBuilder) { - // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); stringBuilder.Append("assoc "); stringBuilder.Append("struct "); - // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); - // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationTextualNotationBuilder.cs index 82923aad..e011b18c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationTextualNotationBuilder.cs @@ -41,12 +41,9 @@ public static partial class AssociationTextualNotationBuilder /// The that contains the entire textual notation public static void BuildAssociation(SysML2.NET.Core.POCO.Kernel.Associations.IAssociation poco, StringBuilder stringBuilder) { - // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); stringBuilder.Append("assoc "); - // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); - // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeDefinitionTextualNotationBuilder.cs index c79ef359..17a490ee 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeDefinitionTextualNotationBuilder.cs @@ -41,11 +41,9 @@ public static partial class AttributeDefinitionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildAttributeDefinition(SysML2.NET.Core.POCO.Systems.Attributes.IAttributeDefinition poco, StringBuilder stringBuilder) { - // non Terminal : DefinitionPrefix; Found rule DefinitionPrefix:Definition=BasicDefinitionPrefix?DefinitionExtensionKeyword* DefinitionTextualNotationBuilder.BuildDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("attribute "); stringBuilder.Append("def "); - // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeUsageTextualNotationBuilder.cs index 32677578..3e056fa8 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeUsageTextualNotationBuilder.cs @@ -41,10 +41,8 @@ public static partial class AttributeUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildAttributeUsage(SysML2.NET.Core.POCO.Systems.Attributes.IAttributeUsage poco, StringBuilder stringBuilder) { - // non Terminal : UsagePrefix; Found rule UsagePrefix:Usage=UnextendedUsagePrefixUsageExtensionKeyword* UsageTextualNotationBuilder.BuildUsagePrefix(poco, stringBuilder); stringBuilder.Append("attribute "); - // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BehaviorTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BehaviorTextualNotationBuilder.cs index 0e0fd3d1..6295f00f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BehaviorTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BehaviorTextualNotationBuilder.cs @@ -41,12 +41,9 @@ public static partial class BehaviorTextualNotationBuilder /// The that contains the entire textual notation public static void BuildBehavior(SysML2.NET.Core.POCO.Kernel.Behaviors.IBehavior poco, StringBuilder stringBuilder) { - // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); stringBuilder.Append("behavior "); - // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); - // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorAsUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorAsUsageTextualNotationBuilder.cs index 3ac18dde..4dc6ef8a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorAsUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorAsUsageTextualNotationBuilder.cs @@ -41,20 +41,12 @@ public static partial class BindingConnectorAsUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildBindingConnectorAsUsage(SysML2.NET.Core.POCO.Systems.Connections.IBindingConnectorAsUsage poco, StringBuilder stringBuilder) { - // non Terminal : UsagePrefix; Found rule UsagePrefix:Usage=UnextendedUsagePrefixUsageExtensionKeyword* UsageTextualNotationBuilder.BuildUsagePrefix(poco, stringBuilder); - // Group Element - stringBuilder.Append("binding "); - // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? - UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); stringBuilder.Append("bind "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - stringBuilder.Append("= "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // non Terminal : UsageBody; Found rule UsageBody:Usage=DefinitionBody + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append("="); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); UsageTextualNotationBuilder.BuildUsageBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorTextualNotationBuilder.cs index 484d0758..9930b1a7 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorTextualNotationBuilder.cs @@ -52,18 +52,17 @@ public static void BuildBindingConnectorDeclaration(SysML2.NET.Core.POCO.Kernel. /// The that contains the entire textual notation public static void BuildBindingConnector(SysML2.NET.Core.POCO.Kernel.Connectors.IBindingConnector poco, StringBuilder stringBuilder) { - // non Terminal : FeaturePrefix; Found rule FeaturePrefix=(EndFeaturePrefix(ownedRelationship+=OwnedCrossFeatureMember)?|BasicFeaturePrefix)(ownedRelationship+=PrefixMetadataMember)* - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // Group Element - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(' '); + if (poco.OwnedRelationship.Count != 0) + { + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } stringBuilder.Append("binding "); - // non Terminal : BindingConnectorDeclaration; Found rule BindingConnectorDeclaration:BindingConnector=FeatureDeclaration('of'ownedRelationship+=ConnectorEndMember'='ownedRelationship+=ConnectorEndMember)?|(isSufficient?='all')?('of'?ownedRelationship+=ConnectorEndMember'='ownedRelationship+=ConnectorEndMember)? BuildBindingConnectorDeclaration(poco, stringBuilder); - // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BooleanExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BooleanExpressionTextualNotationBuilder.cs index f74854e3..a598712e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BooleanExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BooleanExpressionTextualNotationBuilder.cs @@ -41,20 +41,18 @@ public static partial class BooleanExpressionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildBooleanExpression(SysML2.NET.Core.POCO.Kernel.Functions.IBooleanExpression poco, StringBuilder stringBuilder) { - // non Terminal : FeaturePrefix; Found rule FeaturePrefix=(EndFeaturePrefix(ownedRelationship+=OwnedCrossFeatureMember)?|BasicFeaturePrefix)(ownedRelationship+=PrefixMetadataMember)* - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // Group Element - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(' '); + if (poco.OwnedRelationship.Count != 0) + { + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } stringBuilder.Append("bool "); - // non Terminal : FeatureDeclaration; Found rule FeatureDeclaration:Feature=(isSufficient?='all')?(FeatureIdentification(FeatureSpecializationPart|ConjugationPart)?|FeatureSpecializationPart|ConjugationPart)FeatureRelationshipPart* FeatureTextualNotationBuilder.BuildFeatureDeclaration(poco, stringBuilder); - // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); - // non Terminal : FunctionBody; Found rule FunctionBody:Type=';'|'{'FunctionBodyPart'}' TypeTextualNotationBuilder.BuildFunctionBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationDefinitionTextualNotationBuilder.cs index 368a60c5..aa7d25b3 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationDefinitionTextualNotationBuilder.cs @@ -41,13 +41,10 @@ public static partial class CalculationDefinitionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildCalculationDefinition(SysML2.NET.Core.POCO.Systems.Calculations.ICalculationDefinition poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("calc "); stringBuilder.Append("def "); - // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); - // non Terminal : CalculationBody; Found rule CalculationBody:Type=';'|'{'CalculationBodyPart'}' TypeTextualNotationBuilder.BuildCalculationBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationUsageTextualNotationBuilder.cs index c78ff9bd..ed4e98cd 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationUsageTextualNotationBuilder.cs @@ -41,12 +41,9 @@ public static partial class CalculationUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildCalculationUsage(SysML2.NET.Core.POCO.Systems.Calculations.ICalculationUsage poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("calc "); - // non Terminal : ActionUsageDeclaration; Found rule ActionUsageDeclaration:ActionUsage=UsageDeclarationValuePart? ActionUsageTextualNotationBuilder.BuildActionUsageDeclaration(poco, stringBuilder); - // non Terminal : CalculationBody; Found rule CalculationBody:Type=';'|'{'CalculationBodyPart'}' TypeTextualNotationBuilder.BuildCalculationBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseDefinitionTextualNotationBuilder.cs index b67d14c0..f2ff8064 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseDefinitionTextualNotationBuilder.cs @@ -41,13 +41,10 @@ public static partial class CaseDefinitionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildCaseDefinition(SysML2.NET.Core.POCO.Systems.Cases.ICaseDefinition poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("case "); stringBuilder.Append("def "); - // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); - // non Terminal : CaseBody; Found rule CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseUsageTextualNotationBuilder.cs index 59599bdc..fe3a5447 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseUsageTextualNotationBuilder.cs @@ -41,16 +41,11 @@ public static partial class CaseUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildCaseUsage(SysML2.NET.Core.POCO.Systems.Cases.ICaseUsage poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("case "); - // non Terminal : ConstraintUsageDeclaration; Found rule ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? - // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); - // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); - // non Terminal : CaseBody; Found rule CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassTextualNotationBuilder.cs index 0313ea23..949a875d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassTextualNotationBuilder.cs @@ -41,12 +41,9 @@ public static partial class ClassTextualNotationBuilder /// The that contains the entire textual notation public static void BuildClass(SysML2.NET.Core.POCO.Kernel.Classes.IClass poco, StringBuilder stringBuilder) { - // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); stringBuilder.Append("class "); - // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); - // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs index 4ef89bbe..557158ec 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs @@ -41,14 +41,14 @@ public static partial class ClassifierTextualNotationBuilder /// The that contains the entire textual notation public static void BuildSubclassificationPart(SysML2.NET.Core.POCO.Core.Classifiers.IClassifier poco, StringBuilder stringBuilder) { - // non Terminal : SPECIALIZES; Found rule SPECIALIZES=':>'|'specializes' throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Group Element - stringBuilder.Append(", "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + if (poco.OwnedRelationship.Count != 0) + { + stringBuilder.Append(","); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } } @@ -61,19 +61,20 @@ public static void BuildSubclassificationPart(SysML2.NET.Core.POCO.Core.Classifi /// The that contains the entire textual notation public static void BuildClassifierDeclaration(SysML2.NET.Core.POCO.Core.Classifiers.IClassifier poco, StringBuilder stringBuilder) { - // Group Element - // Assignment Element : isSufficient ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // If property isSufficient value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + if (poco.IsSufficient) + { + stringBuilder.Append("all"); + stringBuilder.Append(' '); + } - // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); - // Group Element - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + if (poco.OwnedRelationship.Count != 0) + { + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // non Terminal : TypeRelationshipPart; Found rule TypeRelationshipPart:Type=DisjoiningPart|UnioningPart|IntersectingPart|DifferencingPart TypeTextualNotationBuilder.BuildTypeRelationshipPart(poco, stringBuilder); } @@ -86,14 +87,14 @@ public static void BuildClassifierDeclaration(SysML2.NET.Core.POCO.Core.Classifi /// The that contains the entire textual notation public static void BuildSuperclassingPart(SysML2.NET.Core.POCO.Core.Classifiers.IClassifier poco, StringBuilder stringBuilder) { - // non Terminal : SPECIALIZES; Found rule SPECIALIZES=':>'|'specializes' throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Group Element - stringBuilder.Append(", "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + if (poco.OwnedRelationship.Count != 0) + { + stringBuilder.Append(","); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } } @@ -106,12 +107,9 @@ public static void BuildSuperclassingPart(SysML2.NET.Core.POCO.Core.Classifiers. /// The that contains the entire textual notation public static void BuildClassifier(SysML2.NET.Core.POCO.Core.Classifiers.IClassifier poco, StringBuilder stringBuilder) { - // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); stringBuilder.Append("classifier "); - // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* BuildClassifierDeclaration(poco, stringBuilder); - // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CollectExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CollectExpressionTextualNotationBuilder.cs index 0b36c549..041e9a65 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CollectExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CollectExpressionTextualNotationBuilder.cs @@ -41,11 +41,9 @@ public static partial class CollectExpressionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildCollectExpression(SysML2.NET.Core.POCO.Kernel.Expressions.ICollectExpression poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - stringBuilder.Append(". "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append("."); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CommentTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CommentTextualNotationBuilder.cs index e303e66d..fcd0f63b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CommentTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CommentTextualNotationBuilder.cs @@ -41,28 +41,15 @@ public static partial class CommentTextualNotationBuilder /// The that contains the entire textual notation public static void BuildComment(SysML2.NET.Core.POCO.Root.Annotations.IComment poco, StringBuilder stringBuilder) { - // Group Element - stringBuilder.Append("comment "); - // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? - ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); - // Group Element - stringBuilder.Append("about "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Group Element - stringBuilder.Append(", "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + if (!string.IsNullOrWhiteSpace(poco.Locale)) + { + stringBuilder.Append("locale "); + stringBuilder.Append(poco.Locale); + stringBuilder.Append(' '); + } - - // Group Element - stringBuilder.Append("locale "); - // Assignment Element : locale = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property locale value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - - // Assignment Element : body = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property body value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(poco.Body); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernDefinitionTextualNotationBuilder.cs index 78e52f31..30b698bc 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernDefinitionTextualNotationBuilder.cs @@ -41,13 +41,10 @@ public static partial class ConcernDefinitionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildConcernDefinition(SysML2.NET.Core.POCO.Systems.Requirements.IConcernDefinition poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("concern "); stringBuilder.Append("def "); - // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); - // non Terminal : RequirementBody; Found rule RequirementBody:Type=';'|'{'RequirementBodyItem*'}' TypeTextualNotationBuilder.BuildRequirementBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernUsageTextualNotationBuilder.cs index 8889cd90..468db14d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernUsageTextualNotationBuilder.cs @@ -52,12 +52,9 @@ public static void BuildFramedConcernUsage(SysML2.NET.Core.POCO.Systems.Requirem /// The that contains the entire textual notation public static void BuildConcernUsage(SysML2.NET.Core.POCO.Systems.Requirements.IConcernUsage poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("concern "); - // non Terminal : ConstraintUsageDeclaration; Found rule ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? ConstraintUsageTextualNotationBuilder.BuildConstraintUsageDeclaration(poco, stringBuilder); - // non Terminal : RequirementBody; Found rule RequirementBody:Type=';'|'{'RequirementBodyItem*'}' TypeTextualNotationBuilder.BuildRequirementBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortDefinitionTextualNotationBuilder.cs index 61256e00..c28e844a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortDefinitionTextualNotationBuilder.cs @@ -41,8 +41,7 @@ public static partial class ConjugatedPortDefinitionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildConjugatedPortDefinition(SysML2.NET.Core.POCO.Systems.Ports.IConjugatedPortDefinition poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortTypingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortTypingTextualNotationBuilder.cs index 6780ddf0..14b4483e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortTypingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortTypingTextualNotationBuilder.cs @@ -41,8 +41,7 @@ public static partial class ConjugatedPortTypingTextualNotationBuilder /// The that contains the entire textual notation public static void BuildConjugatedPortTyping(SysML2.NET.Core.POCO.Systems.Ports.IConjugatedPortTyping poco, StringBuilder stringBuilder) { - stringBuilder.Append("~ "); - // Assignment Element : originalPortDefinition = SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + stringBuilder.Append("~"); BuildOriginalPortDefinition(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugationTextualNotationBuilder.cs index fe68b9ca..17a48209 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugationTextualNotationBuilder.cs @@ -52,19 +52,13 @@ public static void BuildOwnedConjugation(SysML2.NET.Core.POCO.Core.Types.IConjug /// The that contains the entire textual notation public static void BuildConjugation(SysML2.NET.Core.POCO.Core.Types.IConjugation poco, StringBuilder stringBuilder) { - // Group Element - stringBuilder.Append("conjugation "); - // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? - ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); stringBuilder.Append("conjugate "); - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // non Terminal : CONJUGATES; Found rule CONJUGATES='~'|'conjugates' + stringBuilder.Append(' '); throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' + stringBuilder.Append(' '); RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionDefinitionTextualNotationBuilder.cs index 06b4a2f7..940a3494 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionDefinitionTextualNotationBuilder.cs @@ -41,11 +41,9 @@ public static partial class ConnectionDefinitionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildConnectionDefinition(SysML2.NET.Core.POCO.Systems.Connections.IConnectionDefinition poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("connection "); stringBuilder.Append("def "); - // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs index d153424b..3b9224f6 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs @@ -52,11 +52,9 @@ public static void BuildConnectorPart(SysML2.NET.Core.POCO.Systems.Connections.I /// The that contains the entire textual notation public static void BuildBinaryConnectorPart(SysML2.NET.Core.POCO.Systems.Connections.IConnectionUsage poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); stringBuilder.Append("to "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -68,18 +66,18 @@ public static void BuildBinaryConnectorPart(SysML2.NET.Core.POCO.Systems.Connect /// The that contains the entire textual notation public static void BuildNaryConnectorPart(SysML2.NET.Core.POCO.Systems.Connections.IConnectionUsage poco, StringBuilder stringBuilder) { - stringBuilder.Append("( "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - stringBuilder.Append(", "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Group Element - stringBuilder.Append(", "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append("("); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(","); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + if (poco.OwnedRelationship.Count != 0) + { + stringBuilder.Append(","); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } - stringBuilder.Append(") "); + stringBuilder.Append(")"); } @@ -91,11 +89,9 @@ public static void BuildNaryConnectorPart(SysML2.NET.Core.POCO.Systems.Connectio /// The that contains the entire textual notation public static void BuildConnectionUsage(SysML2.NET.Core.POCO.Systems.Connections.IConnectionUsage poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // non Terminal : UsageBody; Found rule UsageBody:Usage=DefinitionBody + stringBuilder.Append(' '); UsageTextualNotationBuilder.BuildUsageBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs index e4d151c0..ebae891a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs @@ -52,13 +52,10 @@ public static void BuildConnectorDeclaration(SysML2.NET.Core.POCO.Kernel.Connect /// The that contains the entire textual notation public static void BuildBinaryConnectorDeclaration(SysML2.NET.Core.POCO.Kernel.Connectors.IConnector poco, StringBuilder stringBuilder) { - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); stringBuilder.Append("to "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -70,20 +67,19 @@ public static void BuildBinaryConnectorDeclaration(SysML2.NET.Core.POCO.Kernel.C /// The that contains the entire textual notation public static void BuildNaryConnectorDeclaration(SysML2.NET.Core.POCO.Kernel.Connectors.IConnector poco, StringBuilder stringBuilder) { - // non Terminal : FeatureDeclaration; Found rule FeatureDeclaration:Feature=(isSufficient?='all')?(FeatureIdentification(FeatureSpecializationPart|ConjugationPart)?|FeatureSpecializationPart|ConjugationPart)FeatureRelationshipPart* FeatureTextualNotationBuilder.BuildFeatureDeclaration(poco, stringBuilder); - stringBuilder.Append("( "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - stringBuilder.Append(", "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Group Element - stringBuilder.Append(", "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append("("); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(","); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + if (poco.OwnedRelationship.Count != 0) + { + stringBuilder.Append(","); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } - stringBuilder.Append(") "); + stringBuilder.Append(")"); } @@ -95,18 +91,18 @@ public static void BuildNaryConnectorDeclaration(SysML2.NET.Core.POCO.Kernel.Con /// The that contains the entire textual notation public static void BuildConnector(SysML2.NET.Core.POCO.Kernel.Connectors.IConnector poco, StringBuilder stringBuilder) { - // non Terminal : FeaturePrefix; Found rule FeaturePrefix=(EndFeaturePrefix(ownedRelationship+=OwnedCrossFeatureMember)?|BasicFeaturePrefix)(ownedRelationship+=PrefixMetadataMember)* - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // Group Element - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(' '); + if (poco.OwnedRelationship.Count != 0) + { + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } stringBuilder.Append("connector "); - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' + stringBuilder.Append(' '); TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintDefinitionTextualNotationBuilder.cs index 4ebbcdc0..71d48ba6 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintDefinitionTextualNotationBuilder.cs @@ -41,13 +41,10 @@ public static partial class ConstraintDefinitionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildConstraintDefinition(SysML2.NET.Core.POCO.Systems.Constraints.IConstraintDefinition poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("constraint "); stringBuilder.Append("def "); - // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); - // non Terminal : CalculationBody; Found rule CalculationBody:Type=';'|'{'CalculationBodyPart'}' TypeTextualNotationBuilder.BuildCalculationBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintUsageTextualNotationBuilder.cs index 60157281..1fad681d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintUsageTextualNotationBuilder.cs @@ -41,9 +41,7 @@ public static partial class ConstraintUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildConstraintUsageDeclaration(SysML2.NET.Core.POCO.Systems.Constraints.IConstraintUsage poco, StringBuilder stringBuilder) { - // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); - // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); } @@ -67,12 +65,9 @@ public static void BuildRequirementConstraintUsage(SysML2.NET.Core.POCO.Systems. /// The that contains the entire textual notation public static void BuildConstraintUsage(SysML2.NET.Core.POCO.Systems.Constraints.IConstraintUsage poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("constraint "); - // non Terminal : ConstraintUsageDeclaration; Found rule ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? BuildConstraintUsageDeclaration(poco, stringBuilder); - // non Terminal : CalculationBody; Found rule CalculationBody:Type=';'|'{'CalculationBodyPart'}' TypeTextualNotationBuilder.BuildCalculationBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstructorExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstructorExpressionTextualNotationBuilder.cs index 8e49a5e2..6abf780e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstructorExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstructorExpressionTextualNotationBuilder.cs @@ -42,10 +42,8 @@ public static partial class ConstructorExpressionTextualNotationBuilder public static void BuildConstructorExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IConstructorExpression poco, StringBuilder stringBuilder) { stringBuilder.Append("new "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DataTypeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DataTypeTextualNotationBuilder.cs index e7bd3f68..70b3ad2b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DataTypeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DataTypeTextualNotationBuilder.cs @@ -41,12 +41,9 @@ public static partial class DataTypeTextualNotationBuilder /// The that contains the entire textual notation public static void BuildDataType(SysML2.NET.Core.POCO.Kernel.DataTypes.IDataType poco, StringBuilder stringBuilder) { - // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); stringBuilder.Append("datatype "); - // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); - // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DecisionNodeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DecisionNodeTextualNotationBuilder.cs index ea487f4c..8fe13732 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DecisionNodeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DecisionNodeTextualNotationBuilder.cs @@ -41,13 +41,9 @@ public static partial class DecisionNodeTextualNotationBuilder /// The that contains the entire textual notation public static void BuildDecisionNode(SysML2.NET.Core.POCO.Systems.Actions.IDecisionNode poco, StringBuilder stringBuilder) { - // non Terminal : ControlNodePrefix; Found rule ControlNodePrefix:OccurrenceUsage=RefPrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildControlNodePrefix(poco, stringBuilder); - // Assignment Element : isComposite ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // If property isComposite value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? + stringBuilder.Append("decide"); UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); - // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs index e5ccadf7..db28a48a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs @@ -41,8 +41,7 @@ public static partial class DefinitionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildDefinitionExtensionKeyword(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IDefinition poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -54,9 +53,7 @@ public static void BuildDefinitionExtensionKeyword(SysML2.NET.Core.POCO.Systems. /// The that contains the entire textual notation public static void BuildDefinitionPrefix(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IDefinition poco, StringBuilder stringBuilder) { - // non Terminal : BasicDefinitionPrefix; Found rule BasicDefinitionPrefix=isAbstract?='abstract'|isVariation?='variation' throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // non Terminal : DefinitionExtensionKeyword; Found rule DefinitionExtensionKeyword:Definition=ownedRelationship+=PrefixMetadataMember BuildDefinitionExtensionKeyword(poco, stringBuilder); } @@ -69,9 +66,7 @@ public static void BuildDefinitionPrefix(SysML2.NET.Core.POCO.Systems.Definition /// The that contains the entire textual notation public static void BuildDefinitionDeclaration(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IDefinition poco, StringBuilder stringBuilder) { - // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); - // non Terminal : SubclassificationPart; Found rule SubclassificationPart:Classifier=SPECIALIZESownedRelationship+=OwnedSubclassification(','ownedRelationship+=OwnedSubclassification)* ClassifierTextualNotationBuilder.BuildSubclassificationPart(poco, stringBuilder); } @@ -84,12 +79,9 @@ public static void BuildDefinitionDeclaration(SysML2.NET.Core.POCO.Systems.Defin /// The that contains the entire textual notation public static void BuildExtendedDefinition(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IDefinition poco, StringBuilder stringBuilder) { - // non Terminal : BasicDefinitionPrefix; Found rule BasicDefinitionPrefix=isAbstract?='abstract'|isVariation?='variation' throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // non Terminal : DefinitionExtensionKeyword; Found rule DefinitionExtensionKeyword:Definition=ownedRelationship+=PrefixMetadataMember BuildDefinitionExtensionKeyword(poco, stringBuilder); stringBuilder.Append("def "); - // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody BuildDefinition(poco, stringBuilder); } @@ -102,9 +94,7 @@ public static void BuildExtendedDefinition(SysML2.NET.Core.POCO.Systems.Definiti /// The that contains the entire textual notation public static void BuildDefinition(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IDefinition poco, StringBuilder stringBuilder) { - // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? BuildDefinitionDeclaration(poco, stringBuilder); - // non Terminal : DefinitionBody; Found rule DefinitionBody:Type=';'|'{'DefinitionBodyItem*'}' TypeTextualNotationBuilder.BuildDefinitionBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DependencyTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DependencyTextualNotationBuilder.cs index 4c1d1f68..4f7ecba7 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DependencyTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DependencyTextualNotationBuilder.cs @@ -41,34 +41,32 @@ public static partial class DependencyTextualNotationBuilder /// The that contains the entire textual notation public static void BuildDependency(SysML2.NET.Core.POCO.Root.Dependencies.IDependency poco, StringBuilder stringBuilder) { - // Group Element - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + if (poco.OwnedRelationship.Count != 0) + { + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } stringBuilder.Append("dependency "); - // non Terminal : DependencyDeclaration; Found rule DependencyDeclaration=(Identification'from')?client+=[QualifiedName](','client+=[QualifiedName])*'to'supplier+=[QualifiedName](','supplier+=[QualifiedName])* - // Group Element - // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? - ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); - stringBuilder.Append("from "); - // Assignment Element : client += SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement - // If property client value is set, print SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement - // Group Element - stringBuilder.Append(", "); - // Assignment Element : client += SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement - // If property client value is set, print SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + if (poco.Client.Count != 0) + { + stringBuilder.Append(","); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } stringBuilder.Append("to "); - // Assignment Element : supplier += SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement - // If property supplier value is set, print SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement - // Group Element - stringBuilder.Append(", "); - // Assignment Element : supplier += SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement - // If property supplier value is set, print SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + if (poco.Supplier.Count != 0) + { + stringBuilder.Append(","); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } - // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DisjoiningTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DisjoiningTextualNotationBuilder.cs index 05c0f019..115075d1 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DisjoiningTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DisjoiningTextualNotationBuilder.cs @@ -52,18 +52,13 @@ public static void BuildOwnedDisjoining(SysML2.NET.Core.POCO.Core.Types.IDisjoin /// The that contains the entire textual notation public static void BuildDisjoining(SysML2.NET.Core.POCO.Core.Types.IDisjoining poco, StringBuilder stringBuilder) { - // Group Element - stringBuilder.Append("disjoining "); - // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? - ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); stringBuilder.Append("disjoint "); - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); stringBuilder.Append("from "); - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' + stringBuilder.Append(' '); RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DocumentationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DocumentationTextualNotationBuilder.cs index 8d6a6429..6be88e17 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DocumentationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DocumentationTextualNotationBuilder.cs @@ -42,15 +42,15 @@ public static partial class DocumentationTextualNotationBuilder public static void BuildDocumentation(SysML2.NET.Core.POCO.Root.Annotations.IDocumentation poco, StringBuilder stringBuilder) { stringBuilder.Append("doc "); - // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); - // Group Element - stringBuilder.Append("locale "); - // Assignment Element : locale = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property locale value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + if (!string.IsNullOrWhiteSpace(poco.Locale)) + { + stringBuilder.Append("locale "); + stringBuilder.Append(poco.Locale); + stringBuilder.Append(' '); + } - // Assignment Element : body = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property body value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(poco.Body); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementFilterMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementFilterMembershipTextualNotationBuilder.cs index 424a25f2..514be9fd 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementFilterMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementFilterMembershipTextualNotationBuilder.cs @@ -41,12 +41,10 @@ public static partial class ElementFilterMembershipTextualNotationBuilder /// The that contains the entire textual notation public static void BuildElementFilterMember(SysML2.NET.Core.POCO.Kernel.Packages.IElementFilterMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); stringBuilder.Append("filter "); - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - stringBuilder.Append("; "); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(";"); } @@ -58,10 +56,9 @@ public static void BuildElementFilterMember(SysML2.NET.Core.POCO.Kernel.Packages /// The that contains the entire textual notation public static void BuildFilterPackageMember(SysML2.NET.Core.POCO.Kernel.Packages.IElementFilterMembership poco, StringBuilder stringBuilder) { - stringBuilder.Append("[ "); - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - stringBuilder.Append("] "); + stringBuilder.Append("["); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append("]"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementTextualNotationBuilder.cs index f06f98ff..dc955936 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementTextualNotationBuilder.cs @@ -41,15 +41,19 @@ public static partial class ElementTextualNotationBuilder /// The that contains the entire textual notation public static void BuildIdentification(SysML2.NET.Core.POCO.Root.Elements.IElement poco, StringBuilder stringBuilder) { - // Group Element - stringBuilder.Append("< "); - // Assignment Element : declaredShortName = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property declaredShortName value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - stringBuilder.Append("> "); + if (!string.IsNullOrWhiteSpace(poco.DeclaredShortName)) + { + stringBuilder.Append("<"); + stringBuilder.Append(poco.DeclaredShortName); + stringBuilder.Append(">"); + stringBuilder.Append(' '); + } - // Group Element - // Assignment Element : declaredName = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property declaredName value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + if (!string.IsNullOrWhiteSpace(poco.DeclaredName)) + { + stringBuilder.Append(poco.DeclaredName); + stringBuilder.Append(' '); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EndFeatureMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EndFeatureMembershipTextualNotationBuilder.cs index 6b868048..42322c13 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EndFeatureMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EndFeatureMembershipTextualNotationBuilder.cs @@ -41,8 +41,7 @@ public static partial class EndFeatureMembershipTextualNotationBuilder /// The that contains the entire textual notation public static void BuildSourceEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -54,8 +53,7 @@ public static void BuildSourceEndMember(SysML2.NET.Core.POCO.Core.Features.IEndF /// The that contains the entire textual notation public static void BuildConnectorEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -67,8 +65,7 @@ public static void BuildConnectorEndMember(SysML2.NET.Core.POCO.Core.Features.IE /// The that contains the entire textual notation public static void BuildInterfaceEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -80,8 +77,7 @@ public static void BuildInterfaceEndMember(SysML2.NET.Core.POCO.Core.Features.IE /// The that contains the entire textual notation public static void BuildFlowEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -93,8 +89,7 @@ public static void BuildFlowEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFea /// The that contains the entire textual notation public static void BuildEmptyEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationDefinitionTextualNotationBuilder.cs index c89f0f5d..9262de82 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationDefinitionTextualNotationBuilder.cs @@ -52,13 +52,10 @@ public static void BuildEnumerationBody(SysML2.NET.Core.POCO.Systems.Enumeration /// The that contains the entire textual notation public static void BuildEnumerationDefinition(SysML2.NET.Core.POCO.Systems.Enumerations.IEnumerationDefinition poco, StringBuilder stringBuilder) { - // non Terminal : DefinitionExtensionKeyword; Found rule DefinitionExtensionKeyword:Definition=ownedRelationship+=PrefixMetadataMember DefinitionTextualNotationBuilder.BuildDefinitionExtensionKeyword(poco, stringBuilder); stringBuilder.Append("enum "); stringBuilder.Append("def "); - // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); - // non Terminal : EnumerationBody; Found rule EnumerationBody:EnumerationDefinition=';'|'{'(ownedRelationship+=AnnotatingMember|ownedRelationship+=EnumerationUsageMember)*'}' BuildEnumerationBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationUsageTextualNotationBuilder.cs index b81e8827..be47fe15 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationUsageTextualNotationBuilder.cs @@ -42,7 +42,6 @@ public static partial class EnumerationUsageTextualNotationBuilder public static void BuildEnumeratedValue(SysML2.NET.Core.POCO.Systems.Enumerations.IEnumerationUsage poco, StringBuilder stringBuilder) { stringBuilder.Append("enum "); - // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); } @@ -55,10 +54,8 @@ public static void BuildEnumeratedValue(SysML2.NET.Core.POCO.Systems.Enumeration /// The that contains the entire textual notation public static void BuildEnumerationUsage(SysML2.NET.Core.POCO.Systems.Enumerations.IEnumerationUsage poco, StringBuilder stringBuilder) { - // non Terminal : UsagePrefix; Found rule UsagePrefix:Usage=UnextendedUsagePrefixUsageExtensionKeyword* UsageTextualNotationBuilder.BuildUsagePrefix(poco, stringBuilder); stringBuilder.Append("enum "); - // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EventOccurrenceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EventOccurrenceUsageTextualNotationBuilder.cs index 9514b705..b7a87d9f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EventOccurrenceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EventOccurrenceUsageTextualNotationBuilder.cs @@ -41,8 +41,7 @@ public static partial class EventOccurrenceUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildMessageEvent(SysML2.NET.Core.POCO.Systems.Occurrences.IEventOccurrenceUsage poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -54,12 +53,10 @@ public static void BuildMessageEvent(SysML2.NET.Core.POCO.Systems.Occurrences.IE /// The that contains the entire textual notation public static void BuildEventOccurrenceUsage(SysML2.NET.Core.POCO.Systems.Occurrences.IEventOccurrenceUsage poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("event "); - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // non Terminal : UsageCompletion; Found rule UsageCompletion:Usage=ValuePart?UsageBody + stringBuilder.Append(' '); UsageTextualNotationBuilder.BuildUsageCompletion(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExhibitStateUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExhibitStateUsageTextualNotationBuilder.cs index 8de84ad5..af79c05d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExhibitStateUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExhibitStateUsageTextualNotationBuilder.cs @@ -41,14 +41,11 @@ public static partial class ExhibitStateUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildExhibitStateUsage(SysML2.NET.Core.POCO.Systems.States.IExhibitStateUsage poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("exhibit "); - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue + stringBuilder.Append(' '); FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); - // non Terminal : StateUsageBody; Found rule StateUsageBody:StateUsage=';'|(isParallel?='parallel')?'{'StateBodyItem*'}' StateUsageTextualNotationBuilder.BuildStateUsageBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExposeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExposeTextualNotationBuilder.cs index af3d7bf2..cbd7435e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExposeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExposeTextualNotationBuilder.cs @@ -42,9 +42,8 @@ public static partial class ExposeTextualNotationBuilder public static void BuildExpose(SysML2.NET.Core.POCO.Systems.Views.IExpose poco, StringBuilder stringBuilder) { stringBuilder.Append("expose "); - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' + stringBuilder.Append(' '); RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs index 4a1d9406..4ab27346 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs @@ -74,10 +74,9 @@ public static void BuildNonFeatureChainPrimaryExpression(SysML2.NET.Core.POCO.Ke /// The that contains the entire textual notation public static void BuildSequenceExpression(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, StringBuilder stringBuilder) { - stringBuilder.Append("( "); - // non Terminal : SequenceExpressionList; Found rule SequenceExpressionList:Expression=OwnedExpression','?|SequenceOperatorExpression + stringBuilder.Append("("); BuildSequenceExpressionList(poco, stringBuilder); - stringBuilder.Append(") "); + stringBuilder.Append(")"); } @@ -100,8 +99,7 @@ public static void BuildSequenceExpressionList(SysML2.NET.Core.POCO.Kernel.Funct /// The that contains the entire textual notation public static void BuildFunctionReference(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -124,10 +122,9 @@ public static void BuildBaseExpression(SysML2.NET.Core.POCO.Kernel.Functions.IEx /// The that contains the entire textual notation public static void BuildExpressionBody(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, StringBuilder stringBuilder) { - stringBuilder.Append("{ "); - // non Terminal : FunctionBodyPart; Found rule FunctionBodyPart:Type=(TypeBodyElement|ownedRelationship+=ReturnFeatureMember)*(ownedRelationship+=ResultExpressionMember)? + stringBuilder.Append("{"); TypeTextualNotationBuilder.BuildFunctionBodyPart(poco, stringBuilder); - stringBuilder.Append("} "); + stringBuilder.Append("}"); } @@ -139,20 +136,18 @@ public static void BuildExpressionBody(SysML2.NET.Core.POCO.Kernel.Functions.IEx /// The that contains the entire textual notation public static void BuildExpression(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, StringBuilder stringBuilder) { - // non Terminal : FeaturePrefix; Found rule FeaturePrefix=(EndFeaturePrefix(ownedRelationship+=OwnedCrossFeatureMember)?|BasicFeaturePrefix)(ownedRelationship+=PrefixMetadataMember)* - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // Group Element - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(' '); + if (poco.OwnedRelationship.Count != 0) + { + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } stringBuilder.Append("expr "); - // non Terminal : FeatureDeclaration; Found rule FeatureDeclaration:Feature=(isSufficient?='all')?(FeatureIdentification(FeatureSpecializationPart|ConjugationPart)?|FeatureSpecializationPart|ConjugationPart)FeatureRelationshipPart* FeatureTextualNotationBuilder.BuildFeatureDeclaration(poco, stringBuilder); - // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); - // non Terminal : FunctionBody; Found rule FunctionBody:Type=';'|'{'FunctionBodyPart'}' TypeTextualNotationBuilder.BuildFunctionBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainExpressionTextualNotationBuilder.cs index f4f46550..6ae602f1 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainExpressionTextualNotationBuilder.cs @@ -41,11 +41,9 @@ public static partial class FeatureChainExpressionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildFeatureChainExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureChainExpression poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - stringBuilder.Append(". "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append("."); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainingTextualNotationBuilder.cs index dd4c6b8a..4c3aa4b0 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainingTextualNotationBuilder.cs @@ -41,8 +41,7 @@ public static partial class FeatureChainingTextualNotationBuilder /// The that contains the entire textual notation public static void BuildOwnedFeatureChaining(SysML2.NET.Core.POCO.Core.Features.IFeatureChaining poco, StringBuilder stringBuilder) { - // Assignment Element : chainingFeature = SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement - // If property chainingFeature value is set, print SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureInvertingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureInvertingTextualNotationBuilder.cs index 0e3118a2..d12324ea 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureInvertingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureInvertingTextualNotationBuilder.cs @@ -52,18 +52,13 @@ public static void BuildOwnedFeatureInverting(SysML2.NET.Core.POCO.Core.Features /// The that contains the entire textual notation public static void BuildFeatureInverting(SysML2.NET.Core.POCO.Core.Features.IFeatureInverting poco, StringBuilder stringBuilder) { - // Group Element - stringBuilder.Append("inverting "); - // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? - ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); stringBuilder.Append("inverse "); - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); stringBuilder.Append("of "); - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' + stringBuilder.Append(' '); RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs index c88c60e5..894cc0c0 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs @@ -41,10 +41,8 @@ public static partial class FeatureMembershipTextualNotationBuilder /// The that contains the entire textual notation public static void BuildNonOccurrenceUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -56,10 +54,8 @@ public static void BuildNonOccurrenceUsageMember(SysML2.NET.Core.POCO.Core.Types /// The that contains the entire textual notation public static void BuildOccurrenceUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -71,10 +67,8 @@ public static void BuildOccurrenceUsageMember(SysML2.NET.Core.POCO.Core.Types.IF /// The that contains the entire textual notation public static void BuildStructureUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -86,10 +80,8 @@ public static void BuildStructureUsageMember(SysML2.NET.Core.POCO.Core.Types.IFe /// The that contains the entire textual notation public static void BuildBehaviorUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -102,8 +94,7 @@ public static void BuildBehaviorUsageMember(SysML2.NET.Core.POCO.Core.Types.IFea public static void BuildSourceSuccessionMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { stringBuilder.Append("then "); - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -115,10 +106,8 @@ public static void BuildSourceSuccessionMember(SysML2.NET.Core.POCO.Core.Types.I /// The that contains the entire textual notation public static void BuildInterfaceNonOccurrenceUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -130,10 +119,8 @@ public static void BuildInterfaceNonOccurrenceUsageMember(SysML2.NET.Core.POCO.C /// The that contains the entire textual notation public static void BuildInterfaceOccurrenceUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -145,8 +132,7 @@ public static void BuildInterfaceOccurrenceUsageMember(SysML2.NET.Core.POCO.Core /// The that contains the entire textual notation public static void BuildFlowPayloadFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -158,8 +144,7 @@ public static void BuildFlowPayloadFeatureMember(SysML2.NET.Core.POCO.Core.Types /// The that contains the entire textual notation public static void BuildFlowFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -182,12 +167,9 @@ public static void BuildActionBehaviorMember(SysML2.NET.Core.POCO.Core.Types.IFe /// The that contains the entire textual notation public static void BuildInitialNodeMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); stringBuilder.Append("first "); - // Assignment Element : memberFeature = SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement BuildMemberFeature(poco, stringBuilder); - // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); } @@ -200,10 +182,8 @@ public static void BuildInitialNodeMember(SysML2.NET.Core.POCO.Core.Types.IFeatu /// The that contains the entire textual notation public static void BuildActionNodeMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -215,10 +195,8 @@ public static void BuildActionNodeMember(SysML2.NET.Core.POCO.Core.Types.IFeatur /// The that contains the entire textual notation public static void BuildActionTargetSuccessionMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -230,10 +208,8 @@ public static void BuildActionTargetSuccessionMember(SysML2.NET.Core.POCO.Core.T /// The that contains the entire textual notation public static void BuildGuardedSuccessionMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -245,8 +221,7 @@ public static void BuildGuardedSuccessionMember(SysML2.NET.Core.POCO.Core.Types. /// The that contains the entire textual notation public static void BuildForVariableDeclarationMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -258,11 +233,10 @@ public static void BuildForVariableDeclarationMember(SysML2.NET.Core.POCO.Core.T /// The that contains the entire textual notation public static void BuildEntryTransitionMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - stringBuilder.Append("; "); + stringBuilder.Append(' '); + stringBuilder.Append(";"); } @@ -274,10 +248,8 @@ public static void BuildEntryTransitionMember(SysML2.NET.Core.POCO.Core.Types.IF /// The that contains the entire textual notation public static void BuildTransitionUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -289,10 +261,8 @@ public static void BuildTransitionUsageMember(SysML2.NET.Core.POCO.Core.Types.IF /// The that contains the entire textual notation public static void BuildTargetTransitionUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -304,8 +274,7 @@ public static void BuildTargetTransitionUsageMember(SysML2.NET.Core.POCO.Core.Ty /// The that contains the entire textual notation public static void BuildMetadataBodyUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedMemberFeature = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedMemberFeature value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); } @@ -317,10 +286,8 @@ public static void BuildMetadataBodyUsageMember(SysML2.NET.Core.POCO.Core.Types. /// The that contains the entire textual notation public static void BuildOwnedFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -332,8 +299,7 @@ public static void BuildOwnedFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFeat /// The that contains the entire textual notation public static void BuildOwnedExpressionReferenceMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -345,7 +311,6 @@ public static void BuildOwnedExpressionReferenceMember(SysML2.NET.Core.POCO.Core /// The that contains the entire textual notation public static void BuildOwnedExpressionMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedFeatureMember = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement BuildOwnedFeatureMember(poco, stringBuilder); } @@ -358,8 +323,7 @@ public static void BuildOwnedExpressionMember(SysML2.NET.Core.POCO.Core.Types.IF /// The that contains the entire textual notation public static void BuildSequenceExpressionListMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedMemberFeature = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedMemberFeature value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); } @@ -371,8 +335,7 @@ public static void BuildSequenceExpressionListMember(SysML2.NET.Core.POCO.Core.T /// The that contains the entire textual notation public static void BuildFunctionReferenceMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedMemberFeature = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedMemberFeature value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); } @@ -384,8 +347,7 @@ public static void BuildFunctionReferenceMember(SysML2.NET.Core.POCO.Core.Types. /// The that contains the entire textual notation public static void BuildNamedArgumentMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedMemberFeature = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedMemberFeature value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); } @@ -397,8 +359,7 @@ public static void BuildNamedArgumentMember(SysML2.NET.Core.POCO.Core.Types.IFea /// The that contains the entire textual notation public static void BuildExpressionBodyMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedMemberFeature = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedMemberFeature value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); } @@ -410,8 +371,7 @@ public static void BuildExpressionBodyMember(SysML2.NET.Core.POCO.Core.Types.IFe /// The that contains the entire textual notation public static void BuildPayloadFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -423,8 +383,7 @@ public static void BuildPayloadFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFe /// The that contains the entire textual notation public static void BuildMetadataBodyFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedMemberFeature = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedMemberFeature value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureReferenceExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureReferenceExpressionTextualNotationBuilder.cs index 90934ea6..6bcf48cb 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureReferenceExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureReferenceExpressionTextualNotationBuilder.cs @@ -41,8 +41,7 @@ public static partial class FeatureReferenceExpressionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildSatisfactionReferenceExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -54,8 +53,7 @@ public static void BuildSatisfactionReferenceExpression(SysML2.NET.Core.POCO.Ker /// The that contains the entire textual notation public static void BuildOwnedExpressionReference(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -67,8 +65,7 @@ public static void BuildOwnedExpressionReference(SysML2.NET.Core.POCO.Kernel.Exp /// The that contains the entire textual notation public static void BuildFunctionReferenceExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -80,10 +77,8 @@ public static void BuildFunctionReferenceExpression(SysML2.NET.Core.POCO.Kernel. /// The that contains the entire textual notation public static void BuildFeatureReferenceExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -95,8 +90,7 @@ public static void BuildFeatureReferenceExpression(SysML2.NET.Core.POCO.Kernel.E /// The that contains the entire textual notation public static void BuildBodyExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs index 53b9088e..5915679b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs @@ -41,8 +41,7 @@ public static partial class FeatureTextualNotationBuilder /// The that contains the entire textual notation public static void BuildValuePart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -76,12 +75,13 @@ public static void BuildFeatureSpecialization(SysML2.NET.Core.POCO.Core.Features /// The that contains the entire textual notation public static void BuildTypings(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - // non Terminal : TypedBy; Found rule TypedBy:Feature=DEFINED_BYownedRelationship+=FeatureTyping BuildTypedBy(poco, stringBuilder); - // Group Element - stringBuilder.Append(", "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + if (poco.OwnedRelationship.Count != 0) + { + stringBuilder.Append(","); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } } @@ -94,10 +94,8 @@ public static void BuildTypings(SysML2.NET.Core.POCO.Core.Features.IFeature poco /// The that contains the entire textual notation public static void BuildTypedBy(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - // non Terminal : DEFINED_BY; Found rule DEFINED_BY=':'|'defined''by' throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -109,12 +107,13 @@ public static void BuildTypedBy(SysML2.NET.Core.POCO.Core.Features.IFeature poco /// The that contains the entire textual notation public static void BuildSubsettings(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - // non Terminal : Subsets; Found rule Subsets:Feature=SUBSETSownedRelationship+=OwnedSubsetting BuildSubsets(poco, stringBuilder); - // Group Element - stringBuilder.Append(", "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + if (poco.OwnedRelationship.Count != 0) + { + stringBuilder.Append(","); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } } @@ -127,10 +126,8 @@ public static void BuildSubsettings(SysML2.NET.Core.POCO.Core.Features.IFeature /// The that contains the entire textual notation public static void BuildSubsets(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - // non Terminal : SUBSETS; Found rule SUBSETS=':>'|'subsets' throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -142,10 +139,8 @@ public static void BuildSubsets(SysML2.NET.Core.POCO.Core.Features.IFeature poco /// The that contains the entire textual notation public static void BuildReferences(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - // non Terminal : REFERENCES; Found rule REFERENCES='::>'|'references' throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -157,10 +152,8 @@ public static void BuildReferences(SysML2.NET.Core.POCO.Core.Features.IFeature p /// The that contains the entire textual notation public static void BuildCrosses(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - // non Terminal : CROSSES; Found rule CROSSES='=>'|'crosses' throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -172,12 +165,13 @@ public static void BuildCrosses(SysML2.NET.Core.POCO.Core.Features.IFeature poco /// The that contains the entire textual notation public static void BuildRedefinitions(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - // non Terminal : Redefines; Found rule Redefines:Feature=REDEFINESownedRelationship+=OwnedRedefinition BuildRedefines(poco, stringBuilder); - // Group Element - stringBuilder.Append(", "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + if (poco.OwnedRelationship.Count != 0) + { + stringBuilder.Append(","); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } } @@ -190,10 +184,8 @@ public static void BuildRedefinitions(SysML2.NET.Core.POCO.Core.Features.IFeatur /// The that contains the entire textual notation public static void BuildRedefines(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - // non Terminal : REDEFINES; Found rule REDEFINES=':>>'|'redefines' throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -205,13 +197,11 @@ public static void BuildRedefines(SysML2.NET.Core.POCO.Core.Features.IFeature po /// The that contains the entire textual notation public static void BuildOwnedFeatureChain(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Group Element - stringBuilder.Append(". "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append("."); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); } @@ -234,8 +224,7 @@ public static void BuildMultiplicityPart(SysML2.NET.Core.POCO.Core.Features.IFea /// The that contains the entire textual notation public static void BuildOwnedCrossMultiplicity(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -269,14 +258,12 @@ public static void BuildPayloadFeatureSpecializationPart(SysML2.NET.Core.POCO.Co /// The that contains the entire textual notation public static void BuildFeatureChainPrefix(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - // Group Element - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - stringBuilder.Append(". "); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append("."); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - stringBuilder.Append(". "); + stringBuilder.Append(' '); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append("."); } @@ -288,8 +275,7 @@ public static void BuildFeatureChainPrefix(SysML2.NET.Core.POCO.Core.Features.IF /// The that contains the entire textual notation public static void BuildTriggerValuePart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -301,8 +287,7 @@ public static void BuildTriggerValuePart(SysML2.NET.Core.POCO.Core.Features.IFea /// The that contains the entire textual notation public static void BuildArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -314,8 +299,7 @@ public static void BuildArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poc /// The that contains the entire textual notation public static void BuildArgumentExpression(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -338,13 +322,14 @@ public static void BuildFeatureElement(SysML2.NET.Core.POCO.Core.Features.IFeatu /// The that contains the entire textual notation public static void BuildEndFeaturePrefix(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - // Group Element - // Assignment Element : isConstant ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // If property isConstant value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // Assignment Element : isVariable = true + if (poco.IsConstant) + { + stringBuilder.Append("const"); + // Assignment Element : isVariable = true + stringBuilder.Append(' '); + } - // Assignment Element : isEnd ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // If property isEnd value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + stringBuilder.Append("end"); } @@ -356,21 +341,25 @@ public static void BuildEndFeaturePrefix(SysML2.NET.Core.POCO.Core.Features.IFea /// The that contains the entire textual notation public static void BuildBasicFeaturePrefix(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - // Group Element - // Assignment Element : direction = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property direction value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + if (poco.Direction.HasValue) + { + stringBuilder.Append(poco.Direction.ToString().ToLower()); + stringBuilder.Append(' '); + } - // Group Element - // Assignment Element : isDerived ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // If property isDerived value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + if (poco.IsDerived) + { + stringBuilder.Append("derived"); + stringBuilder.Append(' '); + } - // Group Element - // Assignment Element : isAbstract ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // If property isAbstract value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + if (poco.IsAbstract) + { + stringBuilder.Append("abstract"); + stringBuilder.Append(' '); + } - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); } @@ -383,13 +372,14 @@ public static void BuildBasicFeaturePrefix(SysML2.NET.Core.POCO.Core.Features.IF /// The that contains the entire textual notation public static void BuildFeatureDeclaration(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - // Group Element - // Assignment Element : isSufficient ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // If property isSufficient value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + if (poco.IsSufficient) + { + stringBuilder.Append("all"); + stringBuilder.Append(' '); + } - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // non Terminal : FeatureRelationshipPart; Found rule FeatureRelationshipPart:Feature=TypeRelationshipPart|ChainingPart|InvertingPart|TypeFeaturingPart + stringBuilder.Append(' '); BuildFeatureRelationshipPart(poco, stringBuilder); } @@ -425,8 +415,8 @@ public static void BuildFeatureRelationshipPart(SysML2.NET.Core.POCO.Core.Featur public static void BuildChainingPart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { stringBuilder.Append("chains "); - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); } @@ -440,8 +430,7 @@ public static void BuildInvertingPart(SysML2.NET.Core.POCO.Core.Features.IFeatur { stringBuilder.Append("inverse "); stringBuilder.Append("of "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -455,12 +444,13 @@ public static void BuildTypeFeaturingPart(SysML2.NET.Core.POCO.Core.Features.IFe { stringBuilder.Append("featured "); stringBuilder.Append("by "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Group Element - stringBuilder.Append(", "); - // Assignment Element : ownedTypeFeaturing += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedTypeFeaturing value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + if (poco.ownedTypeFeaturing.Count != 0) + { + stringBuilder.Append(","); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } } @@ -473,13 +463,11 @@ public static void BuildTypeFeaturingPart(SysML2.NET.Core.POCO.Core.Features.IFe /// The that contains the entire textual notation public static void BuildFeatureChain(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Group Element - stringBuilder.Append(". "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append("."); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); } @@ -491,8 +479,7 @@ public static void BuildFeatureChain(SysML2.NET.Core.POCO.Core.Features.IFeature /// The that contains the entire textual notation public static void BuildMetadataArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -504,8 +491,7 @@ public static void BuildMetadataArgument(SysML2.NET.Core.POCO.Core.Features.IFea /// The that contains the entire textual notation public static void BuildTypeReference(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -517,8 +503,7 @@ public static void BuildTypeReference(SysML2.NET.Core.POCO.Core.Features.IFeatur /// The that contains the entire textual notation public static void BuildPrimaryArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -530,8 +515,7 @@ public static void BuildPrimaryArgument(SysML2.NET.Core.POCO.Core.Features.IFeat /// The that contains the entire textual notation public static void BuildNonFeatureChainPrimaryArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -543,8 +527,7 @@ public static void BuildNonFeatureChainPrimaryArgument(SysML2.NET.Core.POCO.Core /// The that contains the entire textual notation public static void BuildBodyArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -556,8 +539,7 @@ public static void BuildBodyArgument(SysML2.NET.Core.POCO.Core.Features.IFeature /// The that contains the entire textual notation public static void BuildFunctionReferenceArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -581,7 +563,6 @@ public static void BuildFeatureReference(SysML2.NET.Core.POCO.Core.Features.IFea /// The that contains the entire textual notation public static void BuildConstructorResult(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - // non Terminal : ArgumentList; Found rule ArgumentList:Feature='('(PositionalArgumentList|NamedArgumentList)?')' BuildArgumentList(poco, stringBuilder); } @@ -594,10 +575,9 @@ public static void BuildConstructorResult(SysML2.NET.Core.POCO.Core.Features.IFe /// The that contains the entire textual notation public static void BuildArgumentList(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - stringBuilder.Append("( "); - // Group Element + stringBuilder.Append("("); throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - stringBuilder.Append(") "); + stringBuilder.Append(")"); } @@ -609,12 +589,13 @@ public static void BuildArgumentList(SysML2.NET.Core.POCO.Core.Features.IFeature /// The that contains the entire textual notation public static void BuildPositionalArgumentList(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Group Element - stringBuilder.Append(", "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + if (poco.OwnedRelationship.Count != 0) + { + stringBuilder.Append(","); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } } @@ -627,12 +608,13 @@ public static void BuildPositionalArgumentList(SysML2.NET.Core.POCO.Core.Feature /// The that contains the entire textual notation public static void BuildNamedArgumentList(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Group Element - stringBuilder.Append(", "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + if (poco.OwnedRelationship.Count != 0) + { + stringBuilder.Append(","); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } } @@ -645,11 +627,9 @@ public static void BuildNamedArgumentList(SysML2.NET.Core.POCO.Core.Features.IFe /// The that contains the entire textual notation public static void BuildNamedArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - stringBuilder.Append("= "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append("="); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -662,15 +642,10 @@ public static void BuildNamedArgument(SysML2.NET.Core.POCO.Core.Features.IFeatur public static void BuildMetadataBodyFeature(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { stringBuilder.Append("feature "); - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // non Terminal : FeatureSpecializationPart; Found rule FeatureSpecializationPart:Feature=FeatureSpecialization+MultiplicityPart?FeatureSpecialization*|MultiplicityPartFeatureSpecialization* + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); BuildFeatureSpecializationPart(poco, stringBuilder); - // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue BuildValuePart(poco, stringBuilder); - // non Terminal : MetadataBody; Found rule MetadataBody:Type=';'|'{'(ownedRelationship+=DefinitionMember|ownedRelationship+=MetadataBodyUsageMember|ownedRelationship+=AliasMember|ownedRelationship+=Import)*'}' TypeTextualNotationBuilder.BuildMetadataBody(poco, stringBuilder); } @@ -683,11 +658,9 @@ public static void BuildMetadataBodyFeature(SysML2.NET.Core.POCO.Core.Features.I /// The that contains the entire textual notation public static void BuildFeature(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue + stringBuilder.Append(' '); BuildValuePart(poco, stringBuilder); - // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs index 8a3bcb35..0ebdf2b0 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs @@ -52,8 +52,7 @@ public static void BuildOwnedFeatureTyping(SysML2.NET.Core.POCO.Core.Features.IF /// The that contains the entire textual notation public static void BuildReferenceTyping(SysML2.NET.Core.POCO.Core.Features.IFeatureTyping poco, StringBuilder stringBuilder) { - // Assignment Element : type = SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement - // If property type value is set, print SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureValueTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureValueTextualNotationBuilder.cs index d2ba52fb..788230c7 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureValueTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureValueTextualNotationBuilder.cs @@ -41,8 +41,7 @@ public static partial class FeatureValueTextualNotationBuilder /// The that contains the entire textual notation public static void BuildTriggerFeatureValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -54,8 +53,7 @@ public static void BuildTriggerFeatureValue(SysML2.NET.Core.POCO.Kernel.FeatureV /// The that contains the entire textual notation public static void BuildArgumentValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) { - // Assignment Element : value = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property value value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); } @@ -67,8 +65,7 @@ public static void BuildArgumentValue(SysML2.NET.Core.POCO.Kernel.FeatureValues. /// The that contains the entire textual notation public static void BuildArgumentExpressionValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -80,8 +77,7 @@ public static void BuildArgumentExpressionValue(SysML2.NET.Core.POCO.Kernel.Feat /// The that contains the entire textual notation public static void BuildFeatureBinding(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -93,8 +89,7 @@ public static void BuildFeatureBinding(SysML2.NET.Core.POCO.Kernel.FeatureValues /// The that contains the entire textual notation public static void BuildAssignmentTargetBinding(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -106,8 +101,7 @@ public static void BuildAssignmentTargetBinding(SysML2.NET.Core.POCO.Kernel.Feat /// The that contains the entire textual notation public static void BuildSatisfactionFeatureValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -119,8 +113,7 @@ public static void BuildSatisfactionFeatureValue(SysML2.NET.Core.POCO.Kernel.Fea /// The that contains the entire textual notation public static void BuildMetadataValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) { - // Assignment Element : value = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property value value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); } @@ -132,8 +125,7 @@ public static void BuildMetadataValue(SysML2.NET.Core.POCO.Kernel.FeatureValues. /// The that contains the entire textual notation public static void BuildPrimaryArgumentValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) { - // Assignment Element : value = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property value value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); } @@ -145,8 +137,7 @@ public static void BuildPrimaryArgumentValue(SysML2.NET.Core.POCO.Kernel.Feature /// The that contains the entire textual notation public static void BuildNonFeatureChainPrimaryArgumentValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) { - // Assignment Element : value = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property value value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); } @@ -158,8 +149,7 @@ public static void BuildNonFeatureChainPrimaryArgumentValue(SysML2.NET.Core.POCO /// The that contains the entire textual notation public static void BuildBodyArgumentValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) { - // Assignment Element : value = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property value value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); } @@ -171,8 +161,7 @@ public static void BuildBodyArgumentValue(SysML2.NET.Core.POCO.Kernel.FeatureVal /// The that contains the entire textual notation public static void BuildFunctionReferenceArgumentValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) { - // Assignment Element : value = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property value value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); } @@ -184,10 +173,9 @@ public static void BuildFunctionReferenceArgumentValue(SysML2.NET.Core.POCO.Kern /// The that contains the entire textual notation public static void BuildFeatureValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) { - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(' '); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowDefinitionTextualNotationBuilder.cs index d1bf3698..6771417c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowDefinitionTextualNotationBuilder.cs @@ -41,11 +41,9 @@ public static partial class FlowDefinitionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildFlowDefinition(SysML2.NET.Core.POCO.Systems.Flows.IFlowDefinition poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("flow "); stringBuilder.Append("def "); - // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowEndTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowEndTextualNotationBuilder.cs index 1b58aab6..2dace9da 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowEndTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowEndTextualNotationBuilder.cs @@ -41,12 +41,13 @@ public static partial class FlowEndTextualNotationBuilder /// The that contains the entire textual notation public static void BuildFlowEnd(SysML2.NET.Core.POCO.Kernel.Interactions.IFlowEnd poco, StringBuilder stringBuilder) { - // Group Element - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + if (poco.OwnedRelationship.Count != 0) + { + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowTextualNotationBuilder.cs index d76d86df..fd460f29 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowTextualNotationBuilder.cs @@ -41,18 +41,17 @@ public static partial class FlowTextualNotationBuilder /// The that contains the entire textual notation public static void BuildFlow(SysML2.NET.Core.POCO.Kernel.Interactions.IFlow poco, StringBuilder stringBuilder) { - // non Terminal : FeaturePrefix; Found rule FeaturePrefix=(EndFeaturePrefix(ownedRelationship+=OwnedCrossFeatureMember)?|BasicFeaturePrefix)(ownedRelationship+=PrefixMetadataMember)* - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // Group Element - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(' '); + if (poco.OwnedRelationship.Count != 0) + { + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } stringBuilder.Append("flow "); - // non Terminal : FlowDeclaration; Found rule FlowDeclaration:FlowUsage=UsageDeclarationValuePart?('of'ownedRelationship+=FlowPayloadFeatureMember)?('from'ownedRelationship+=FlowEndMember'to'ownedRelationship+=FlowEndMember)?|ownedRelationship+=FlowEndMember'to'ownedRelationship+=FlowEndMember throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowUsageTextualNotationBuilder.cs index 43644f24..ce5d1e7e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowUsageTextualNotationBuilder.cs @@ -41,12 +41,9 @@ public static partial class FlowUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildMessage(SysML2.NET.Core.POCO.Systems.Flows.IFlowUsage poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("message "); - // non Terminal : MessageDeclaration; Found rule MessageDeclaration:FlowUsage=UsageDeclarationValuePart?('of'ownedRelationship+=FlowPayloadFeatureMember)?('from'ownedRelationship+=MessageEventMember'to'ownedRelationship+=MessageEventMember)?|ownedRelationship+=MessageEventMember'to'ownedRelationship+=MessageEventMember BuildMessageDeclaration(poco, stringBuilder); - // non Terminal : DefinitionBody; Found rule DefinitionBody:Type=';'|'{'DefinitionBodyItem*'}' TypeTextualNotationBuilder.BuildDefinitionBody(poco, stringBuilder); // Assignment Element : isAbstract = true @@ -82,12 +79,9 @@ public static void BuildFlowDeclaration(SysML2.NET.Core.POCO.Systems.Flows.IFlow /// The that contains the entire textual notation public static void BuildFlowUsage(SysML2.NET.Core.POCO.Systems.Flows.IFlowUsage poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("flow "); - // non Terminal : FlowDeclaration; Found rule FlowDeclaration:FlowUsage=UsageDeclarationValuePart?('of'ownedRelationship+=FlowPayloadFeatureMember)?('from'ownedRelationship+=FlowEndMember'to'ownedRelationship+=FlowEndMember)?|ownedRelationship+=FlowEndMember'to'ownedRelationship+=FlowEndMember BuildFlowDeclaration(poco, stringBuilder); - // non Terminal : DefinitionBody; Found rule DefinitionBody:Type=';'|'{'DefinitionBodyItem*'}' TypeTextualNotationBuilder.BuildDefinitionBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForLoopActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForLoopActionUsageTextualNotationBuilder.cs index bba3ffc9..8e56eaa4 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForLoopActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForLoopActionUsageTextualNotationBuilder.cs @@ -41,16 +41,12 @@ public static partial class ForLoopActionUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildForLoopNode(SysML2.NET.Core.POCO.Systems.Actions.IForLoopActionUsage poco, StringBuilder stringBuilder) { - // non Terminal : ActionNodePrefix; Found rule ActionNodePrefix:ActionUsage=OccurrenceUsagePrefixActionNodeUsageDeclaration? ActionUsageTextualNotationBuilder.BuildActionNodePrefix(poco, stringBuilder); stringBuilder.Append("for "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); stringBuilder.Append("in "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForkNodeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForkNodeTextualNotationBuilder.cs index ec9f26d1..c8732103 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForkNodeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForkNodeTextualNotationBuilder.cs @@ -41,13 +41,9 @@ public static partial class ForkNodeTextualNotationBuilder /// The that contains the entire textual notation public static void BuildForkNode(SysML2.NET.Core.POCO.Systems.Actions.IForkNode poco, StringBuilder stringBuilder) { - // non Terminal : ControlNodePrefix; Found rule ControlNodePrefix:OccurrenceUsage=RefPrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildControlNodePrefix(poco, stringBuilder); - // Assignment Element : isComposite ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // If property isComposite value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? + stringBuilder.Append("fork"); UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); - // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FramedConcernMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FramedConcernMembershipTextualNotationBuilder.cs index c2d50f48..0106cd4d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FramedConcernMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FramedConcernMembershipTextualNotationBuilder.cs @@ -41,11 +41,9 @@ public static partial class FramedConcernMembershipTextualNotationBuilder /// The that contains the entire textual notation public static void BuildFramedConcernMember(SysML2.NET.Core.POCO.Systems.Requirements.IFramedConcernMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); stringBuilder.Append("frame "); - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FunctionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FunctionTextualNotationBuilder.cs index 26af9410..89e9d649 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FunctionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FunctionTextualNotationBuilder.cs @@ -41,12 +41,9 @@ public static partial class FunctionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildFunction(SysML2.NET.Core.POCO.Kernel.Functions.IFunction poco, StringBuilder stringBuilder) { - // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); stringBuilder.Append("function "); - // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); - // non Terminal : FunctionBody; Found rule FunctionBody:Type=';'|'{'FunctionBodyPart'}' TypeTextualNotationBuilder.BuildFunctionBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs index a70f729c..5f10dccf 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs @@ -41,17 +41,16 @@ public static partial class IfActionUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildIfNode(SysML2.NET.Core.POCO.Systems.Actions.IIfActionUsage poco, StringBuilder stringBuilder) { - // non Terminal : ActionNodePrefix; Found rule ActionNodePrefix:ActionUsage=OccurrenceUsagePrefixActionNodeUsageDeclaration? ActionUsageTextualNotationBuilder.BuildActionNodePrefix(poco, stringBuilder); stringBuilder.Append("if "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Group Element - stringBuilder.Append("else "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.GroupElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.GroupElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + if (poco.OwnedRelationship.Count != 0) + { + stringBuilder.Append("else "); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ImportTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ImportTextualNotationBuilder.cs index a380989d..df1e7e6d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ImportTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ImportTextualNotationBuilder.cs @@ -52,16 +52,15 @@ public static void BuildImportDeclaration(SysML2.NET.Core.POCO.Root.Namespaces.I /// The that contains the entire textual notation public static void BuildImport(SysML2.NET.Core.POCO.Root.Namespaces.IImport poco, StringBuilder stringBuilder) { - // Assignment Element : visibility = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property visibility value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(poco.Visibility.ToString().ToLower()); stringBuilder.Append("import "); - // Group Element - // Assignment Element : isImportAll ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // If property isImportAll value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + if (poco.IsImportAll) + { + stringBuilder.Append("all"); + stringBuilder.Append(' '); + } - // non Terminal : ImportDeclaration; Found rule ImportDeclaration:Import=MembershipImport|NamespaceImport BuildImportDeclaration(poco, stringBuilder); - // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IncludeUseCaseUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IncludeUseCaseUsageTextualNotationBuilder.cs index 2d195a8d..0297af1a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IncludeUseCaseUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IncludeUseCaseUsageTextualNotationBuilder.cs @@ -41,14 +41,11 @@ public static partial class IncludeUseCaseUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildIncludeUseCaseUsage(SysML2.NET.Core.POCO.Systems.UseCases.IIncludeUseCaseUsage poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("include "); - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue + stringBuilder.Append(' '); FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); - // non Terminal : CaseBody; Found rule CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IndexExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IndexExpressionTextualNotationBuilder.cs index bef87935..823e4d7e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IndexExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IndexExpressionTextualNotationBuilder.cs @@ -41,13 +41,11 @@ public static partial class IndexExpressionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildIndexExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IIndexExpression poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - stringBuilder.Append("# "); - stringBuilder.Append("( "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - stringBuilder.Append(") "); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append("#"); + stringBuilder.Append("("); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(")"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InteractionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InteractionTextualNotationBuilder.cs index 90481249..131c6eac 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InteractionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InteractionTextualNotationBuilder.cs @@ -41,12 +41,9 @@ public static partial class InteractionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildInteraction(SysML2.NET.Core.POCO.Kernel.Interactions.IInteraction poco, StringBuilder stringBuilder) { - // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); stringBuilder.Append("interaction "); - // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); - // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceDefinitionTextualNotationBuilder.cs index 2164c9aa..d855c825 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceDefinitionTextualNotationBuilder.cs @@ -41,13 +41,10 @@ public static partial class InterfaceDefinitionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildInterfaceDefinition(SysML2.NET.Core.POCO.Systems.Interfaces.IInterfaceDefinition poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("interface "); stringBuilder.Append("def "); - // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); - // non Terminal : InterfaceBody; Found rule InterfaceBody:Type=';'|'{'InterfaceBodyItem*'}' TypeTextualNotationBuilder.BuildInterfaceBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs index 8c664e03..a8edd8a2 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs @@ -63,11 +63,9 @@ public static void BuildInterfacePart(SysML2.NET.Core.POCO.Systems.Interfaces.II /// The that contains the entire textual notation public static void BuildBinaryInterfacePart(SysML2.NET.Core.POCO.Systems.Interfaces.IInterfaceUsage poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); stringBuilder.Append("to "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -79,18 +77,18 @@ public static void BuildBinaryInterfacePart(SysML2.NET.Core.POCO.Systems.Interfa /// The that contains the entire textual notation public static void BuildNaryInterfacePart(SysML2.NET.Core.POCO.Systems.Interfaces.IInterfaceUsage poco, StringBuilder stringBuilder) { - stringBuilder.Append("( "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - stringBuilder.Append(", "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Group Element - stringBuilder.Append(", "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append("("); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(","); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + if (poco.OwnedRelationship.Count != 0) + { + stringBuilder.Append(","); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } - stringBuilder.Append(") "); + stringBuilder.Append(")"); } @@ -102,12 +100,9 @@ public static void BuildNaryInterfacePart(SysML2.NET.Core.POCO.Systems.Interface /// The that contains the entire textual notation public static void BuildInterfaceUsage(SysML2.NET.Core.POCO.Systems.Interfaces.IInterfaceUsage poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("interface "); - // non Terminal : InterfaceUsageDeclaration; Found rule InterfaceUsageDeclaration:InterfaceUsage=UsageDeclarationValuePart?('connect'InterfacePart)?|InterfacePart BuildInterfaceUsageDeclaration(poco, stringBuilder); - // non Terminal : InterfaceBody; Found rule InterfaceBody:Type=';'|'{'InterfaceBodyItem*'}' TypeTextualNotationBuilder.BuildInterfaceBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs index 761ecea4..acff88ca 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs @@ -41,22 +41,19 @@ public static partial class InvariantTextualNotationBuilder /// The that contains the entire textual notation public static void BuildInvariant(SysML2.NET.Core.POCO.Kernel.Functions.IInvariant poco, StringBuilder stringBuilder) { - // non Terminal : FeaturePrefix; Found rule FeaturePrefix=(EndFeaturePrefix(ownedRelationship+=OwnedCrossFeatureMember)?|BasicFeaturePrefix)(ownedRelationship+=PrefixMetadataMember)* - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // Group Element - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(' '); + if (poco.OwnedRelationship.Count != 0) + { + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } stringBuilder.Append("inv "); - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // non Terminal : FeatureDeclaration; Found rule FeatureDeclaration:Feature=(isSufficient?='all')?(FeatureIdentification(FeatureSpecializationPart|ConjugationPart)?|FeatureSpecializationPart|ConjugationPart)FeatureRelationshipPart* FeatureTextualNotationBuilder.BuildFeatureDeclaration(poco, stringBuilder); - // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); - // non Terminal : FunctionBody; Found rule FunctionBody:Type=';'|'{'FunctionBodyPart'}' TypeTextualNotationBuilder.BuildFunctionBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs index dcbb525f..78d28bd1 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs @@ -41,15 +41,12 @@ public static partial class InvocationExpressionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildFunctionOperationExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IInvocationExpression poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); stringBuilder.Append("-> "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Group Element + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(' '); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -61,12 +58,9 @@ public static void BuildFunctionOperationExpression(SysML2.NET.Core.POCO.Kernel. /// The that contains the entire textual notation public static void BuildInvocationExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IInvocationExpression poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // non Terminal : ArgumentList; Found rule ArgumentList:Feature='('(PositionalArgumentList|NamedArgumentList)?')' + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); FeatureTextualNotationBuilder.BuildArgumentList(poco, stringBuilder); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemDefinitionTextualNotationBuilder.cs index d9459d04..e35af46e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemDefinitionTextualNotationBuilder.cs @@ -41,11 +41,9 @@ public static partial class ItemDefinitionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildItemDefinition(SysML2.NET.Core.POCO.Systems.Items.IItemDefinition poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("item "); stringBuilder.Append("def "); - // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemUsageTextualNotationBuilder.cs index 147f8534..a7b599ca 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemUsageTextualNotationBuilder.cs @@ -41,10 +41,8 @@ public static partial class ItemUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildItemUsage(SysML2.NET.Core.POCO.Systems.Items.IItemUsage poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("item "); - // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/JoinNodeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/JoinNodeTextualNotationBuilder.cs index dd822154..4f76eac2 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/JoinNodeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/JoinNodeTextualNotationBuilder.cs @@ -41,13 +41,9 @@ public static partial class JoinNodeTextualNotationBuilder /// The that contains the entire textual notation public static void BuildJoinNode(SysML2.NET.Core.POCO.Systems.Actions.IJoinNode poco, StringBuilder stringBuilder) { - // non Terminal : ControlNodePrefix; Found rule ControlNodePrefix:OccurrenceUsage=RefPrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildControlNodePrefix(poco, stringBuilder); - // Assignment Element : isComposite ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // If property isComposite value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? + stringBuilder.Append("join"); UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); - // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LibraryPackageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LibraryPackageTextualNotationBuilder.cs index 901adcce..2931b48b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LibraryPackageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LibraryPackageTextualNotationBuilder.cs @@ -41,18 +41,17 @@ public static partial class LibraryPackageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildLibraryPackage(SysML2.NET.Core.POCO.Kernel.Packages.ILibraryPackage poco, StringBuilder stringBuilder) { - // Group Element - // Assignment Element : isStandard ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // If property isStandard value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + stringBuilder.Append("standard"); + stringBuilder.Append(' '); stringBuilder.Append("library "); - // Group Element - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + if (poco.OwnedRelationship.Count != 0) + { + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } - // non Terminal : PackageDeclaration; Found rule PackageDeclaration:Package='package'Identification PackageTextualNotationBuilder.BuildPackageDeclaration(poco, stringBuilder); - // non Terminal : PackageBody; Found rule PackageBody:Package=';'|'{'PackageBodyElement*'}' PackageTextualNotationBuilder.BuildPackageBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralBooleanTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralBooleanTextualNotationBuilder.cs index 8ec970c4..eb9cb34d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralBooleanTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralBooleanTextualNotationBuilder.cs @@ -41,8 +41,7 @@ public static partial class LiteralBooleanTextualNotationBuilder /// The that contains the entire textual notation public static void BuildLiteralBoolean(SysML2.NET.Core.POCO.Kernel.Expressions.ILiteralBoolean poco, StringBuilder stringBuilder) { - // Assignment Element : value = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property value value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of bool with rule element value different than TerminalElement not supported"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralInfinityTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralInfinityTextualNotationBuilder.cs index 55ea2a17..78830938 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralInfinityTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralInfinityTextualNotationBuilder.cs @@ -41,7 +41,7 @@ public static partial class LiteralInfinityTextualNotationBuilder /// The that contains the entire textual notation public static void BuildLiteralInfinity(SysML2.NET.Core.POCO.Kernel.Expressions.ILiteralInfinity poco, StringBuilder stringBuilder) { - stringBuilder.Append("* "); + stringBuilder.Append("*"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralIntegerTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralIntegerTextualNotationBuilder.cs index 0b61f6ff..06b4bf1e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralIntegerTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralIntegerTextualNotationBuilder.cs @@ -41,8 +41,7 @@ public static partial class LiteralIntegerTextualNotationBuilder /// The that contains the entire textual notation public static void BuildLiteralInteger(SysML2.NET.Core.POCO.Kernel.Expressions.ILiteralInteger poco, StringBuilder stringBuilder) { - // Assignment Element : value = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property value value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralStringTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralStringTextualNotationBuilder.cs index 11d80c82..a1eec88a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralStringTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralStringTextualNotationBuilder.cs @@ -41,8 +41,7 @@ public static partial class LiteralStringTextualNotationBuilder /// The that contains the entire textual notation public static void BuildLiteralString(SysML2.NET.Core.POCO.Kernel.Expressions.ILiteralString poco, StringBuilder stringBuilder) { - // Assignment Element : value = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property value value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(poco.Value); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipExposeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipExposeTextualNotationBuilder.cs index c9c8ccf1..c26c9a7e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipExposeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipExposeTextualNotationBuilder.cs @@ -41,7 +41,6 @@ public static partial class MembershipExposeTextualNotationBuilder /// The that contains the entire textual notation public static void BuildMembershipExpose(SysML2.NET.Core.POCO.Systems.Views.IMembershipExpose poco, StringBuilder stringBuilder) { - // non Terminal : MembershipImport; Found rule MembershipImport=importedMembership=[QualifiedName]('::'isRecursive?='**')? MembershipImportTextualNotationBuilder.BuildMembershipImport(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.cs index 95dba6bd..30617fe2 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.cs @@ -41,12 +41,13 @@ public static partial class MembershipImportTextualNotationBuilder /// The that contains the entire textual notation public static void BuildMembershipImport(SysML2.NET.Core.POCO.Root.Namespaces.IMembershipImport poco, StringBuilder stringBuilder) { - // Assignment Element : importedMembership = SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement - // If property importedMembership value is set, print SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement - // Group Element - stringBuilder.Append(":: "); - // Assignment Element : isRecursive ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // If property isRecursive value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + if (poco.IsRecursive) + { + stringBuilder.Append(":: "); + stringBuilder.Append("**"); + stringBuilder.Append(' '); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs index f74f88d1..16910204 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs @@ -41,9 +41,11 @@ public static partial class MembershipTextualNotationBuilder /// The that contains the entire textual notation public static void BuildMemberPrefix(SysML2.NET.Core.POCO.Root.Namespaces.IMembership poco, StringBuilder stringBuilder) { - // Group Element - // Assignment Element : visibility = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property visibility value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + if (poco.Visibility != SysML2.NET.Core.Root.Namespaces.VisibilityKind.Public) + { + stringBuilder.Append(poco.Visibility.ToString().ToLower()); + stringBuilder.Append(' '); + } } @@ -56,23 +58,24 @@ public static void BuildMemberPrefix(SysML2.NET.Core.POCO.Root.Namespaces.IMembe /// The that contains the entire textual notation public static void BuildAliasMember(SysML2.NET.Core.POCO.Root.Namespaces.IMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? BuildMemberPrefix(poco, stringBuilder); stringBuilder.Append("alias "); - // Group Element - stringBuilder.Append("< "); - // Assignment Element : memberShortName = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property memberShortName value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - stringBuilder.Append("> "); - - // Group Element - // Assignment Element : memberName = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property memberName value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + 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 "); - // Assignment Element : memberElement = SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement - // If property memberElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement - // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); } @@ -96,8 +99,7 @@ public static void BuildFeatureChainMember(SysML2.NET.Core.POCO.Root.Namespaces. /// The that contains the entire textual notation public static void BuildFeatureReferenceMember(SysML2.NET.Core.POCO.Root.Namespaces.IMembership poco, StringBuilder stringBuilder) { - // Assignment Element : memberElement = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property memberElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); } @@ -109,8 +111,7 @@ public static void BuildFeatureReferenceMember(SysML2.NET.Core.POCO.Root.Namespa /// The that contains the entire textual notation public static void BuildElementReferenceMember(SysML2.NET.Core.POCO.Root.Namespaces.IMembership poco, StringBuilder stringBuilder) { - // Assignment Element : memberElement = SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement - // If property memberElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MergeNodeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MergeNodeTextualNotationBuilder.cs index f1f99737..ec77b98f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MergeNodeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MergeNodeTextualNotationBuilder.cs @@ -41,13 +41,9 @@ public static partial class MergeNodeTextualNotationBuilder /// The that contains the entire textual notation public static void BuildMergeNode(SysML2.NET.Core.POCO.Systems.Actions.IMergeNode poco, StringBuilder stringBuilder) { - // non Terminal : ControlNodePrefix; Found rule ControlNodePrefix:OccurrenceUsage=RefPrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildControlNodePrefix(poco, stringBuilder); - // Assignment Element : isComposite ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // If property isComposite value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? + stringBuilder.Append("merge"); UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); - // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetaclassTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetaclassTextualNotationBuilder.cs index 0205deb3..d0a12732 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetaclassTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetaclassTextualNotationBuilder.cs @@ -41,12 +41,9 @@ public static partial class MetaclassTextualNotationBuilder /// The that contains the entire textual notation public static void BuildMetaclass(SysML2.NET.Core.POCO.Kernel.Metadata.IMetaclass poco, StringBuilder stringBuilder) { - // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); stringBuilder.Append("metaclass "); - // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); - // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataAccessExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataAccessExpressionTextualNotationBuilder.cs index 5fa58924..6b3dc338 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataAccessExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataAccessExpressionTextualNotationBuilder.cs @@ -41,8 +41,7 @@ public static partial class MetadataAccessExpressionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildMetadataReference(SysML2.NET.Core.POCO.Kernel.Expressions.IMetadataAccessExpression poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -54,9 +53,8 @@ public static void BuildMetadataReference(SysML2.NET.Core.POCO.Kernel.Expression /// The that contains the entire textual notation public static void BuildMetadataAccessExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IMetadataAccessExpression poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - stringBuilder.Append(". "); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append("."); stringBuilder.Append("metadata "); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.cs index 8730c7f6..a1158a0f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.cs @@ -41,15 +41,15 @@ public static partial class MetadataDefinitionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildMetadataDefinition(SysML2.NET.Core.POCO.Systems.Metadata.IMetadataDefinition poco, StringBuilder stringBuilder) { - // Group Element - // Assignment Element : isAbstract ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // If property isAbstract value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + if (poco.IsAbstract) + { + stringBuilder.Append("abstract"); + stringBuilder.Append(' '); + } - // non Terminal : DefinitionExtensionKeyword; Found rule DefinitionExtensionKeyword:Definition=ownedRelationship+=PrefixMetadataMember DefinitionTextualNotationBuilder.BuildDefinitionExtensionKeyword(poco, stringBuilder); stringBuilder.Append("metadata "); stringBuilder.Append("def "); - // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs index 0828421b..38c50000 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs @@ -41,8 +41,7 @@ public static partial class MetadataFeatureTextualNotationBuilder /// The that contains the entire textual notation public static void BuildPrefixMetadataFeature(SysML2.NET.Core.POCO.Kernel.Metadata.IMetadataFeature poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -54,14 +53,8 @@ public static void BuildPrefixMetadataFeature(SysML2.NET.Core.POCO.Kernel.Metada /// The that contains the entire textual notation public static void BuildMetadataFeatureDeclaration(SysML2.NET.Core.POCO.Kernel.Metadata.IMetadataFeature poco, StringBuilder stringBuilder) { - // Group Element - // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? - ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); - // Group Element - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -73,25 +66,29 @@ public static void BuildMetadataFeatureDeclaration(SysML2.NET.Core.POCO.Kernel.M /// The that contains the entire textual notation public static void BuildMetadataFeature(SysML2.NET.Core.POCO.Kernel.Metadata.IMetadataFeature poco, StringBuilder stringBuilder) { - // Group Element - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + if (poco.OwnedRelationship.Count != 0) + { + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // non Terminal : MetadataFeatureDeclaration; Found rule MetadataFeatureDeclaration:MetadataFeature=(Identification(':'|'typed''by'))?ownedRelationship+=OwnedFeatureTyping + stringBuilder.Append(' '); BuildMetadataFeatureDeclaration(poco, stringBuilder); - // Group Element - stringBuilder.Append("about "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Group Element - stringBuilder.Append(", "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + if (poco.OwnedRelationship.Count != 0) + { + stringBuilder.Append("about "); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + if (poco.OwnedRelationship.Count != 0) + { + stringBuilder.Append(","); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } + stringBuilder.Append(' '); + } - // non Terminal : MetadataBody; Found rule MetadataBody:Type=';'|'{'(ownedRelationship+=DefinitionMember|ownedRelationship+=MetadataBodyUsageMember|ownedRelationship+=AliasMember|ownedRelationship+=Import)*'}' TypeTextualNotationBuilder.BuildMetadataBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs index e228b194..14fbe831 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs @@ -41,8 +41,7 @@ public static partial class MetadataUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildPrefixMetadataUsage(SysML2.NET.Core.POCO.Systems.Metadata.IMetadataUsage poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -54,14 +53,8 @@ public static void BuildPrefixMetadataUsage(SysML2.NET.Core.POCO.Systems.Metadat /// The that contains the entire textual notation public static void BuildMetadataUsageDeclaration(SysML2.NET.Core.POCO.Systems.Metadata.IMetadataUsage poco, StringBuilder stringBuilder) { - // Group Element - // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? - ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); - // Group Element - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -73,23 +66,24 @@ public static void BuildMetadataUsageDeclaration(SysML2.NET.Core.POCO.Systems.Me /// The that contains the entire textual notation public static void BuildMetadataUsage(SysML2.NET.Core.POCO.Systems.Metadata.IMetadataUsage poco, StringBuilder stringBuilder) { - // non Terminal : UsageExtensionKeyword; Found rule UsageExtensionKeyword:Usage=ownedRelationship+=PrefixMetadataMember UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, stringBuilder); - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // non Terminal : MetadataUsageDeclaration; Found rule MetadataUsageDeclaration:MetadataUsage=(Identification(':'|'typed''by'))?ownedRelationship+=OwnedFeatureTyping + stringBuilder.Append(' '); BuildMetadataUsageDeclaration(poco, stringBuilder); - // Group Element - stringBuilder.Append("about "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Group Element - stringBuilder.Append(", "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + if (poco.OwnedRelationship.Count != 0) + { + stringBuilder.Append("about "); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + if (poco.OwnedRelationship.Count != 0) + { + stringBuilder.Append(","); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } + stringBuilder.Append(' '); + } - // non Terminal : MetadataBody; Found rule MetadataBody:Type=';'|'{'(ownedRelationship+=DefinitionMember|ownedRelationship+=MetadataBodyUsageMember|ownedRelationship+=AliasMember|ownedRelationship+=Import)*'}' TypeTextualNotationBuilder.BuildMetadataBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityRangeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityRangeTextualNotationBuilder.cs index e71cbe8b..a4800701 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityRangeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityRangeTextualNotationBuilder.cs @@ -41,7 +41,6 @@ public static partial class MultiplicityRangeTextualNotationBuilder /// The that contains the entire textual notation public static void BuildOwnedMultiplicityRange(SysML2.NET.Core.POCO.Kernel.Multiplicities.IMultiplicityRange poco, StringBuilder stringBuilder) { - // non Terminal : MultiplicityBounds; Found rule MultiplicityBounds:MultiplicityRange='['(ownedRelationship+=MultiplicityExpressionMember'..')?ownedRelationship+=MultiplicityExpressionMember']' BuildMultiplicityBounds(poco, stringBuilder); } @@ -54,15 +53,16 @@ public static void BuildOwnedMultiplicityRange(SysML2.NET.Core.POCO.Kernel.Multi /// The that contains the entire textual notation public static void BuildMultiplicityBounds(SysML2.NET.Core.POCO.Kernel.Multiplicities.IMultiplicityRange poco, StringBuilder stringBuilder) { - stringBuilder.Append("[ "); - // Group Element - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - stringBuilder.Append(".. "); + stringBuilder.Append("["); + if (poco.OwnedRelationship.Count != 0) + { + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(".. "); + stringBuilder.Append(' '); + } - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - stringBuilder.Append("] "); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append("]"); } @@ -74,15 +74,16 @@ public static void BuildMultiplicityBounds(SysML2.NET.Core.POCO.Kernel.Multiplic /// The that contains the entire textual notation public static void BuildMultiplicityRange(SysML2.NET.Core.POCO.Kernel.Multiplicities.IMultiplicityRange poco, StringBuilder stringBuilder) { - stringBuilder.Append("[ "); - // Group Element - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - stringBuilder.Append(".. "); + stringBuilder.Append("["); + if (poco.OwnedRelationship.Count != 0) + { + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(".. "); + stringBuilder.Append(' '); + } - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - stringBuilder.Append("] "); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append("]"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityTextualNotationBuilder.cs index 488e68ed..c0f0e236 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityTextualNotationBuilder.cs @@ -53,11 +53,8 @@ public static void BuildEmptyMultiplicity(SysML2.NET.Core.POCO.Core.Types.IMulti public static void BuildMultiplicitySubset(SysML2.NET.Core.POCO.Core.Types.IMultiplicity poco, StringBuilder stringBuilder) { stringBuilder.Append("multiplicity "); - // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); - // non Terminal : Subsets; Found rule Subsets:Feature=SUBSETSownedRelationship+=OwnedSubsetting FeatureTextualNotationBuilder.BuildSubsets(poco, stringBuilder); - // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceExposeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceExposeTextualNotationBuilder.cs index 3b0da7ef..b0364f64 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceExposeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceExposeTextualNotationBuilder.cs @@ -41,7 +41,6 @@ public static partial class NamespaceExposeTextualNotationBuilder /// The that contains the entire textual notation public static void BuildNamespaceExpose(SysML2.NET.Core.POCO.Systems.Views.INamespaceExpose poco, StringBuilder stringBuilder) { - // non Terminal : NamespaceImport; Found rule NamespaceImport=importedNamespace=[QualifiedName]'::''*'('::'isRecursive?='**')?|importedNamespace=FilterPackage{ownedRelatedElement+=importedNamespace} NamespaceImportTextualNotationBuilder.BuildNamespaceImport(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs index fbd07bee..177d277a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs @@ -41,7 +41,6 @@ public static partial class NamespaceTextualNotationBuilder /// The that contains the entire textual notation public static void BuildRootNamespace(SysML2.NET.Core.POCO.Root.Namespaces.INamespace poco, StringBuilder stringBuilder) { - // non Terminal : PackageBodyElement; Found rule PackageBodyElement:Package=ownedRelationship+=PackageMember|ownedRelationship+=ElementFilterMember|ownedRelationship+=AliasMember|ownedRelationship+=Import throw new System.NotSupportedException("Multiple alternatives not implemented yet"); } @@ -55,7 +54,6 @@ public static void BuildRootNamespace(SysML2.NET.Core.POCO.Root.Namespaces.IName public static void BuildNamespaceDeclaration(SysML2.NET.Core.POCO.Root.Namespaces.INamespace poco, StringBuilder stringBuilder) { stringBuilder.Append("namespace "); - // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); } @@ -90,13 +88,13 @@ public static void BuildNamespaceBodyElement(SysML2.NET.Core.POCO.Root.Namespace /// The that contains the entire textual notation public static void BuildNamespace(SysML2.NET.Core.POCO.Root.Namespaces.INamespace poco, StringBuilder stringBuilder) { - // Group Element - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + if (poco.OwnedRelationship.Count != 0) + { + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } - // non Terminal : NamespaceDeclaration; Found rule NamespaceDeclaration:Namespace='namespace'Identification BuildNamespaceDeclaration(poco, stringBuilder); - // non Terminal : NamespaceBody; Found rule NamespaceBody:Namespace=';'|'{'NamespaceBodyElement*'}' BuildNamespaceBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ObjectiveMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ObjectiveMembershipTextualNotationBuilder.cs index a528eb54..48344b16 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ObjectiveMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ObjectiveMembershipTextualNotationBuilder.cs @@ -41,11 +41,9 @@ public static partial class ObjectiveMembershipTextualNotationBuilder /// The that contains the entire textual notation public static void BuildObjectiveMember(SysML2.NET.Core.POCO.Systems.Cases.IObjectiveMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); stringBuilder.Append("objective "); - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs index 76e5dd02..f8fecfe6 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs @@ -41,15 +41,14 @@ public static partial class OccurrenceDefinitionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildOccurrenceDefinitionPrefix(SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceDefinition poco, StringBuilder stringBuilder) { - // non Terminal : BasicDefinitionPrefix; Found rule BasicDefinitionPrefix=isAbstract?='abstract'|isVariation?='variation' throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // Group Element - // Assignment Element : isIndividual ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // If property isIndividual value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + if (poco.IsIndividual && poco.OwnedRelationship.Count != 0) + { + stringBuilder.Append("individual"); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } - // non Terminal : DefinitionExtensionKeyword; Found rule DefinitionExtensionKeyword:Definition=ownedRelationship+=PrefixMetadataMember DefinitionTextualNotationBuilder.BuildDefinitionExtensionKeyword(poco, stringBuilder); } @@ -62,17 +61,12 @@ public static void BuildOccurrenceDefinitionPrefix(SysML2.NET.Core.POCO.Systems. /// The that contains the entire textual notation public static void BuildIndividualDefinition(SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceDefinition poco, StringBuilder stringBuilder) { - // non Terminal : BasicDefinitionPrefix; Found rule BasicDefinitionPrefix=isAbstract?='abstract'|isVariation?='variation' throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // Assignment Element : isIndividual ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // If property isIndividual value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // non Terminal : DefinitionExtensionKeyword; Found rule DefinitionExtensionKeyword:Definition=ownedRelationship+=PrefixMetadataMember + stringBuilder.Append("individual"); DefinitionTextualNotationBuilder.BuildDefinitionExtensionKeyword(poco, stringBuilder); stringBuilder.Append("def "); - // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -84,11 +78,9 @@ public static void BuildIndividualDefinition(SysML2.NET.Core.POCO.Systems.Occurr /// The that contains the entire textual notation public static void BuildOccurrenceDefinition(SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceDefinition poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("occurrence "); stringBuilder.Append("def "); - // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs index b6256367..0d33beb0 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs @@ -41,18 +41,20 @@ public static partial class OccurrenceUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildOccurrenceUsagePrefix(SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceUsage poco, StringBuilder stringBuilder) { - // non Terminal : BasicUsagePrefix; Found rule BasicUsagePrefix:Usage=RefPrefix(isReference?='ref')? UsageTextualNotationBuilder.BuildBasicUsagePrefix(poco, stringBuilder); - // Group Element - // Assignment Element : isIndividual ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // If property isIndividual value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + if (poco.IsIndividual) + { + stringBuilder.Append("individual"); + stringBuilder.Append(' '); + } + + if (poco.PortionKind.HasValue) + { + stringBuilder.Append(poco.PortionKind.ToString().ToLower()); + // Assignment Element : isPortion = true + stringBuilder.Append(' '); + } - // Group Element - // Assignment Element : portionKind = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property portionKind value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Assignment Element : isPortion = true - - // non Terminal : UsageExtensionKeyword; Found rule UsageExtensionKeyword:Usage=ownedRelationship+=PrefixMetadataMember UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, stringBuilder); } @@ -65,13 +67,9 @@ public static void BuildOccurrenceUsagePrefix(SysML2.NET.Core.POCO.Systems.Occur /// The that contains the entire textual notation public static void BuildIndividualUsage(SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceUsage poco, StringBuilder stringBuilder) { - // non Terminal : BasicUsagePrefix; Found rule BasicUsagePrefix:Usage=RefPrefix(isReference?='ref')? UsageTextualNotationBuilder.BuildBasicUsagePrefix(poco, stringBuilder); - // Assignment Element : isIndividual ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // If property isIndividual value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // non Terminal : UsageExtensionKeyword; Found rule UsageExtensionKeyword:Usage=ownedRelationship+=PrefixMetadataMember + stringBuilder.Append("individual"); UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, stringBuilder); - // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); } @@ -84,17 +82,15 @@ public static void BuildIndividualUsage(SysML2.NET.Core.POCO.Systems.Occurrences /// The that contains the entire textual notation public static void BuildPortionUsage(SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceUsage poco, StringBuilder stringBuilder) { - // non Terminal : BasicUsagePrefix; Found rule BasicUsagePrefix:Usage=RefPrefix(isReference?='ref')? UsageTextualNotationBuilder.BuildBasicUsagePrefix(poco, stringBuilder); - // Group Element - // Assignment Element : isIndividual ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // If property isIndividual value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + if (poco.IsIndividual) + { + stringBuilder.Append("individual"); + stringBuilder.Append(' '); + } - // Assignment Element : portionKind = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property portionKind value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // non Terminal : UsageExtensionKeyword; Found rule UsageExtensionKeyword:Usage=ownedRelationship+=PrefixMetadataMember + stringBuilder.Append(poco.PortionKind.ToString().ToLower()); UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, stringBuilder); - // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); // Assignment Element : isPortion = true @@ -108,18 +104,20 @@ public static void BuildPortionUsage(SysML2.NET.Core.POCO.Systems.Occurrences.IO /// The that contains the entire textual notation public static void BuildControlNodePrefix(SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceUsage poco, StringBuilder stringBuilder) { - // non Terminal : RefPrefix; Found rule RefPrefix:Usage=(direction=FeatureDirection)?(isDerived?='derived')?(isAbstract?='abstract'|isVariation?='variation')?(isConstant?='constant')? UsageTextualNotationBuilder.BuildRefPrefix(poco, stringBuilder); - // Group Element - // Assignment Element : isIndividual ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // If property isIndividual value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - - // Group Element - // Assignment Element : portionKind = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property portionKind value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Assignment Element : isPortion = true + if (poco.IsIndividual) + { + stringBuilder.Append("individual"); + stringBuilder.Append(' '); + } + + if (poco.PortionKind.HasValue) + { + stringBuilder.Append(poco.PortionKind.ToString().ToLower()); + // Assignment Element : isPortion = true + stringBuilder.Append(' '); + } - // non Terminal : UsageExtensionKeyword; Found rule UsageExtensionKeyword:Usage=ownedRelationship+=PrefixMetadataMember UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, stringBuilder); } @@ -132,10 +130,8 @@ public static void BuildControlNodePrefix(SysML2.NET.Core.POCO.Systems.Occurrenc /// The that contains the entire textual notation public static void BuildOccurrenceUsage(SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceUsage poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("occurrence "); - // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OperatorExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OperatorExpressionTextualNotationBuilder.cs index d4d0d3f7..a43d6cee 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OperatorExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OperatorExpressionTextualNotationBuilder.cs @@ -41,18 +41,13 @@ public static partial class OperatorExpressionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildConditionalExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, StringBuilder stringBuilder) { - // Assignment Element : operator = SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // If property operator value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - stringBuilder.Append("? "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(poco.Operator); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append("?"); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); stringBuilder.Append("else "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -64,14 +59,10 @@ public static void BuildConditionalExpression(SysML2.NET.Core.POCO.Kernel.Expres /// The that contains the entire textual notation public static void BuildConditionalBinaryOperatorExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Assignment Element : operator = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property operator value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(poco.Operator); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -83,14 +74,10 @@ public static void BuildConditionalBinaryOperatorExpression(SysML2.NET.Core.POCO /// The that contains the entire textual notation public static void BuildBinaryOperatorExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Assignment Element : operator = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property operator value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(poco.Operator); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -102,12 +89,9 @@ public static void BuildBinaryOperatorExpression(SysML2.NET.Core.POCO.Kernel.Exp /// The that contains the entire textual notation public static void BuildUnaryOperatorExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, StringBuilder stringBuilder) { - // Assignment Element : operator = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property operator value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(poco.Operator); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -119,14 +103,15 @@ public static void BuildUnaryOperatorExpression(SysML2.NET.Core.POCO.Kernel.Expr /// The that contains the entire textual notation public static void BuildClassificationExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, StringBuilder stringBuilder) { - // Group Element - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + if (poco.OwnedRelationship.Count != 0) + { + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(' '); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -138,12 +123,10 @@ public static void BuildClassificationExpression(SysML2.NET.Core.POCO.Kernel.Exp /// The that contains the entire textual notation public static void BuildMetaclassificationExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Group Element + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(' '); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -155,10 +138,8 @@ public static void BuildMetaclassificationExpression(SysML2.NET.Core.POCO.Kernel /// The that contains the entire textual notation public static void BuildExtentExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, StringBuilder stringBuilder) { - // Assignment Element : operator = SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // If property operator value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(poco.Operator); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -170,13 +151,10 @@ public static void BuildExtentExpression(SysML2.NET.Core.POCO.Kernel.Expressions /// The that contains the entire textual notation public static void BuildBracketExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Assignment Element : operator = SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // If property operator value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - stringBuilder.Append("] "); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(poco.Operator); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append("]"); } @@ -188,12 +166,9 @@ public static void BuildBracketExpression(SysML2.NET.Core.POCO.Kernel.Expression /// The that contains the entire textual notation public static void BuildSequenceOperatorExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Assignment Element : operator = SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // If property operator value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(poco.Operator); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs index 4a4ad2e4..057b3c9f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs @@ -41,8 +41,7 @@ public static partial class OwningMembershipTextualNotationBuilder /// The that contains the entire textual notation public static void BuildAnnotatingMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -54,10 +53,9 @@ public static void BuildAnnotatingMember(SysML2.NET.Core.POCO.Root.Namespaces.IO /// The that contains the entire textual notation public static void BuildPackageMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); } @@ -69,10 +67,8 @@ public static void BuildPackageMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwni /// The that contains the entire textual notation public static void BuildDefinitionMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -84,8 +80,7 @@ public static void BuildDefinitionMember(SysML2.NET.Core.POCO.Root.Namespaces.IO /// The that contains the entire textual notation public static void BuildOwnedCrossFeatureMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -97,8 +92,7 @@ public static void BuildOwnedCrossFeatureMember(SysML2.NET.Core.POCO.Root.Namesp /// The that contains the entire textual notation public static void BuildOwnedMultiplicity(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -110,8 +104,7 @@ public static void BuildOwnedMultiplicity(SysML2.NET.Core.POCO.Root.Namespaces.I /// The that contains the entire textual notation public static void BuildMultiplicityExpressionMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.GroupElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.GroupElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -123,8 +116,7 @@ public static void BuildMultiplicityExpressionMember(SysML2.NET.Core.POCO.Root.N /// The that contains the entire textual notation public static void BuildEmptyMultiplicityMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -136,8 +128,7 @@ public static void BuildEmptyMultiplicityMember(SysML2.NET.Core.POCO.Root.Namesp /// The that contains the entire textual notation public static void BuildConjugatedPortDefinitionMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -149,8 +140,7 @@ public static void BuildConjugatedPortDefinitionMember(SysML2.NET.Core.POCO.Root /// The that contains the entire textual notation public static void BuildOwnedCrossMultiplicityMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -162,8 +152,7 @@ public static void BuildOwnedCrossMultiplicityMember(SysML2.NET.Core.POCO.Root.N /// The that contains the entire textual notation public static void BuildOwnedFeatureChainMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -175,8 +164,7 @@ public static void BuildOwnedFeatureChainMember(SysML2.NET.Core.POCO.Root.Namesp /// The that contains the entire textual notation public static void BuildTransitionSuccessionMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -188,9 +176,8 @@ public static void BuildTransitionSuccessionMember(SysML2.NET.Core.POCO.Root.Nam /// The that contains the entire textual notation public static void BuildPrefixMetadataMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) { - stringBuilder.Append("# "); - // Assignment Element : ownedRelatedElement = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append("#"); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -213,10 +200,8 @@ public static void BuildNamespaceMember(SysML2.NET.Core.POCO.Root.Namespaces.IOw /// The that contains the entire textual notation public static void BuildNonFeatureMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -228,10 +213,8 @@ public static void BuildNonFeatureMember(SysML2.NET.Core.POCO.Root.Namespaces.IO /// The that contains the entire textual notation public static void BuildNamespaceFeatureMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -254,11 +237,9 @@ public static void BuildFeatureMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwni /// The that contains the entire textual notation public static void BuildTypeFeatureMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); stringBuilder.Append("member "); - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs index 355a2a4f..408b7a1a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs @@ -42,7 +42,6 @@ public static partial class PackageTextualNotationBuilder public static void BuildPackageDeclaration(SysML2.NET.Core.POCO.Kernel.Packages.IPackage poco, StringBuilder stringBuilder) { stringBuilder.Append("package "); - // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); } @@ -77,12 +76,10 @@ public static void BuildPackageBodyElement(SysML2.NET.Core.POCO.Kernel.Packages. /// The that contains the entire textual notation public static void BuildFilterPackage(SysML2.NET.Core.POCO.Kernel.Packages.IPackage poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Group Element - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); } @@ -94,13 +91,13 @@ public static void BuildFilterPackage(SysML2.NET.Core.POCO.Kernel.Packages.IPack /// The that contains the entire textual notation public static void BuildPackage(SysML2.NET.Core.POCO.Kernel.Packages.IPackage poco, StringBuilder stringBuilder) { - // Group Element - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + if (poco.OwnedRelationship.Count != 0) + { + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } - // non Terminal : PackageDeclaration; Found rule PackageDeclaration:Package='package'Identification BuildPackageDeclaration(poco, stringBuilder); - // non Terminal : PackageBody; Found rule PackageBody:Package=';'|'{'PackageBodyElement*'}' BuildPackageBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ParameterMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ParameterMembershipTextualNotationBuilder.cs index b015f440..c2cf33c4 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ParameterMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ParameterMembershipTextualNotationBuilder.cs @@ -41,8 +41,7 @@ public static partial class ParameterMembershipTextualNotationBuilder /// The that contains the entire textual notation public static void BuildMessageEventMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -54,8 +53,7 @@ public static void BuildMessageEventMember(SysML2.NET.Core.POCO.Kernel.Behaviors /// The that contains the entire textual notation public static void BuildPayloadParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -67,8 +65,7 @@ public static void BuildPayloadParameterMember(SysML2.NET.Core.POCO.Kernel.Behav /// The that contains the entire textual notation public static void BuildArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedMemberParameter = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedMemberParameter value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); } @@ -80,8 +77,7 @@ public static void BuildArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IPa /// The that contains the entire textual notation public static void BuildArgumentExpressionMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -93,8 +89,7 @@ public static void BuildArgumentExpressionMember(SysML2.NET.Core.POCO.Kernel.Beh /// The that contains the entire textual notation public static void BuildNodeParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -106,8 +101,7 @@ public static void BuildNodeParameterMember(SysML2.NET.Core.POCO.Kernel.Behavior /// The that contains the entire textual notation public static void BuildEmptyParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -119,8 +113,7 @@ public static void BuildEmptyParameterMember(SysML2.NET.Core.POCO.Kernel.Behavio /// The that contains the entire textual notation public static void BuildAssignmentTargetMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -132,8 +125,7 @@ public static void BuildAssignmentTargetMember(SysML2.NET.Core.POCO.Kernel.Behav /// The that contains the entire textual notation public static void BuildExpressionParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -145,8 +137,7 @@ public static void BuildExpressionParameterMember(SysML2.NET.Core.POCO.Kernel.Be /// The that contains the entire textual notation public static void BuildActionBodyParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -158,8 +149,7 @@ public static void BuildActionBodyParameterMember(SysML2.NET.Core.POCO.Kernel.Be /// The that contains the entire textual notation public static void BuildIfNodeParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -171,8 +161,7 @@ public static void BuildIfNodeParameterMember(SysML2.NET.Core.POCO.Kernel.Behavi /// The that contains the entire textual notation public static void BuildMetadataArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -184,8 +173,7 @@ public static void BuildMetadataArgumentMember(SysML2.NET.Core.POCO.Kernel.Behav /// The that contains the entire textual notation public static void BuildTypeReferenceMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedMemberFeature = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedMemberFeature value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); } @@ -197,8 +185,7 @@ public static void BuildTypeReferenceMember(SysML2.NET.Core.POCO.Kernel.Behavior /// The that contains the entire textual notation public static void BuildPrimaryArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedMemberParameter = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedMemberParameter value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); } @@ -210,8 +197,7 @@ public static void BuildPrimaryArgumentMember(SysML2.NET.Core.POCO.Kernel.Behavi /// The that contains the entire textual notation public static void BuildNonFeatureChainPrimaryArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedMemberParameter = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedMemberParameter value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); } @@ -223,8 +209,7 @@ public static void BuildNonFeatureChainPrimaryArgumentMember(SysML2.NET.Core.POC /// The that contains the entire textual notation public static void BuildBodyArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedMemberParameter = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedMemberParameter value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); } @@ -236,8 +221,7 @@ public static void BuildBodyArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors /// The that contains the entire textual notation public static void BuildFunctionReferenceArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedMemberParameter = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedMemberParameter value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartDefinitionTextualNotationBuilder.cs index 2472661b..67f9a91e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartDefinitionTextualNotationBuilder.cs @@ -41,11 +41,9 @@ public static partial class PartDefinitionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildPartDefinition(SysML2.NET.Core.POCO.Systems.Parts.IPartDefinition poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("part "); stringBuilder.Append("def "); - // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartUsageTextualNotationBuilder.cs index b09bd8dc..7a07d73c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartUsageTextualNotationBuilder.cs @@ -42,9 +42,7 @@ public static partial class PartUsageTextualNotationBuilder public static void BuildActorUsage(SysML2.NET.Core.POCO.Systems.Parts.IPartUsage poco, StringBuilder stringBuilder) { stringBuilder.Append("actor "); - // non Terminal : UsageExtensionKeyword; Found rule UsageExtensionKeyword:Usage=ownedRelationship+=PrefixMetadataMember UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, stringBuilder); - // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); } @@ -58,9 +56,7 @@ public static void BuildActorUsage(SysML2.NET.Core.POCO.Systems.Parts.IPartUsage public static void BuildStakeholderUsage(SysML2.NET.Core.POCO.Systems.Parts.IPartUsage poco, StringBuilder stringBuilder) { stringBuilder.Append("stakeholder "); - // non Terminal : UsageExtensionKeyword; Found rule UsageExtensionKeyword:Usage=ownedRelationship+=PrefixMetadataMember UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, stringBuilder); - // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); } @@ -73,10 +69,8 @@ public static void BuildStakeholderUsage(SysML2.NET.Core.POCO.Systems.Parts.IPar /// The that contains the entire textual notation public static void BuildPartUsage(SysML2.NET.Core.POCO.Systems.Parts.IPartUsage poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("part "); - // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PayloadFeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PayloadFeatureTextualNotationBuilder.cs index 3192759d..35f89455 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PayloadFeatureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PayloadFeatureTextualNotationBuilder.cs @@ -41,7 +41,6 @@ public static partial class PayloadFeatureTextualNotationBuilder /// The that contains the entire textual notation public static void BuildFlowPayloadFeature(SysML2.NET.Core.POCO.Kernel.Interactions.IPayloadFeature poco, StringBuilder stringBuilder) { - // non Terminal : PayloadFeature; Found rule PayloadFeature:Feature=Identification?PayloadFeatureSpecializationPartValuePart?|ownedRelationship+=OwnedFeatureTyping(ownedRelationship+=OwnedMultiplicity)?|ownedRelationship+=OwnedMultiplicityownedRelationship+=OwnedFeatureTyping FeatureTextualNotationBuilder.BuildPayloadFeature(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PerformActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PerformActionUsageTextualNotationBuilder.cs index 546dece4..5364c23e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PerformActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PerformActionUsageTextualNotationBuilder.cs @@ -41,9 +41,8 @@ public static partial class PerformActionUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildPerformActionUsageDeclaration(SysML2.NET.Core.POCO.Systems.Actions.IPerformActionUsage poco, StringBuilder stringBuilder) { - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue + stringBuilder.Append(' '); FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); } @@ -56,9 +55,7 @@ public static void BuildPerformActionUsageDeclaration(SysML2.NET.Core.POCO.Syste /// The that contains the entire textual notation public static void BuildStatePerformActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IPerformActionUsage poco, StringBuilder stringBuilder) { - // non Terminal : PerformActionUsageDeclaration; Found rule PerformActionUsageDeclaration:PerformActionUsage=(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'action'UsageDeclaration)ValuePart? BuildPerformActionUsageDeclaration(poco, stringBuilder); - // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); } @@ -71,13 +68,7 @@ public static void BuildStatePerformActionUsage(SysML2.NET.Core.POCO.Systems.Act /// The that contains the entire textual notation public static void BuildTransitionPerformActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IPerformActionUsage poco, StringBuilder stringBuilder) { - // non Terminal : PerformActionUsageDeclaration; Found rule PerformActionUsageDeclaration:PerformActionUsage=(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'action'UsageDeclaration)ValuePart? BuildPerformActionUsageDeclaration(poco, stringBuilder); - // Group Element - stringBuilder.Append("{ "); - // non Terminal : ActionBodyItem; Found rule ActionBodyItem:Type=NonBehaviorBodyItem|ownedRelationship+=InitialNodeMember(ownedRelationship+=ActionTargetSuccessionMember)*|(ownedRelationship+=SourceSuccessionMember)?ownedRelationship+=ActionBehaviorMember(ownedRelationship+=ActionTargetSuccessionMember)*|ownedRelationship+=GuardedSuccessionMember - TypeTextualNotationBuilder.BuildActionBodyItem(poco, stringBuilder); - stringBuilder.Append("} "); } @@ -90,12 +81,9 @@ public static void BuildTransitionPerformActionUsage(SysML2.NET.Core.POCO.System /// The that contains the entire textual notation public static void BuildPerformActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IPerformActionUsage poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("perform "); - // non Terminal : PerformActionUsageDeclaration; Found rule PerformActionUsageDeclaration:PerformActionUsage=(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'action'UsageDeclaration)ValuePart? BuildPerformActionUsageDeclaration(poco, stringBuilder); - // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortDefinitionTextualNotationBuilder.cs index 17fd78ab..e5358fe6 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortDefinitionTextualNotationBuilder.cs @@ -41,14 +41,11 @@ public static partial class PortDefinitionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildPortDefinition(SysML2.NET.Core.POCO.Systems.Ports.IPortDefinition poco, StringBuilder stringBuilder) { - // non Terminal : DefinitionPrefix; Found rule DefinitionPrefix:Definition=BasicDefinitionPrefix?DefinitionExtensionKeyword* DefinitionTextualNotationBuilder.BuildDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("port "); stringBuilder.Append("def "); - // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); // Assignment Element : conjugatedPortDefinition.ownedPortConjugator.originalPortDefinition = this } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs index 07e78c98..6aee48d8 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs @@ -41,9 +41,7 @@ public static partial class PortUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildDefaultInterfaceEnd(SysML2.NET.Core.POCO.Systems.Ports.IPortUsage poco, StringBuilder stringBuilder) { - // Assignment Element : isEnd ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // If property isEnd value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion + stringBuilder.Append("end"); UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); } @@ -56,18 +54,20 @@ public static void BuildDefaultInterfaceEnd(SysML2.NET.Core.POCO.Systems.Ports.I /// The that contains the entire textual notation public static void BuildInterfaceEnd(SysML2.NET.Core.POCO.Systems.Ports.IPortUsage poco, StringBuilder stringBuilder) { - // Group Element - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + if (poco.OwnedRelationship.Count != 0) + { + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } - // Group Element - // Assignment Element : declaredName = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property declaredName value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // non Terminal : REFERENCES; Found rule REFERENCES='::>'|'references' - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + if (!string.IsNullOrWhiteSpace(poco.DeclaredName)) + { + stringBuilder.Append(poco.DeclaredName); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + } - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -79,10 +79,8 @@ public static void BuildInterfaceEnd(SysML2.NET.Core.POCO.Systems.Ports.IPortUsa /// The that contains the entire textual notation public static void BuildPortUsage(SysML2.NET.Core.POCO.Systems.Ports.IPortUsage poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("port "); - // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PredicateTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PredicateTextualNotationBuilder.cs index 6a7769ba..32ebf78c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PredicateTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PredicateTextualNotationBuilder.cs @@ -41,12 +41,9 @@ public static partial class PredicateTextualNotationBuilder /// The that contains the entire textual notation public static void BuildPredicate(SysML2.NET.Core.POCO.Kernel.Functions.IPredicate poco, StringBuilder stringBuilder) { - // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); stringBuilder.Append("predicate "); - // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); - // non Terminal : FunctionBody; Found rule FunctionBody:Type=';'|'{'FunctionBodyPart'}' TypeTextualNotationBuilder.BuildFunctionBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs index 85da06d8..c01e3ec4 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs @@ -52,8 +52,7 @@ public static void BuildOwnedRedefinition(SysML2.NET.Core.POCO.Core.Features.IRe /// The that contains the entire textual notation public static void BuildFlowFeatureRedefinition(SysML2.NET.Core.POCO.Core.Features.IRedefinition poco, StringBuilder stringBuilder) { - // Assignment Element : redefinedFeature = SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement - // If property redefinedFeature value is set, print SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); } @@ -65,8 +64,7 @@ public static void BuildFlowFeatureRedefinition(SysML2.NET.Core.POCO.Core.Featur /// The that contains the entire textual notation public static void BuildParameterRedefinition(SysML2.NET.Core.POCO.Core.Features.IRedefinition poco, StringBuilder stringBuilder) { - // Assignment Element : redefinedFeature = SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement - // If property redefinedFeature value is set, print SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); } @@ -78,19 +76,11 @@ public static void BuildParameterRedefinition(SysML2.NET.Core.POCO.Core.Features /// The that contains the entire textual notation public static void BuildRedefinition(SysML2.NET.Core.POCO.Core.Features.IRedefinition poco, StringBuilder stringBuilder) { - // Group Element - stringBuilder.Append("specialization "); - // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? - ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); stringBuilder.Append("redefinition "); - // non Terminal : SpecificType; Found rule SpecificType:Specialization=specific=[QualifiedName]|specific+=OwnedFeatureChain{ownedRelatedElement+=specific} SpecializationTextualNotationBuilder.BuildSpecificType(poco, stringBuilder); - // non Terminal : REDEFINES; Found rule REDEFINES=':>>'|'redefines' throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // non Terminal : GeneralType; Found rule GeneralType:Specialization=general=[QualifiedName]|general+=OwnedFeatureChain{ownedRelatedElement+=general} SpecializationTextualNotationBuilder.BuildGeneralType(poco, stringBuilder); - // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs index 14e9f6ad..0f8cd2fd 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs @@ -41,9 +41,7 @@ public static partial class ReferenceUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildOwnedCrossFeature(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) { - // non Terminal : BasicUsagePrefix; Found rule BasicUsagePrefix:Usage=RefPrefix(isReference?='ref')? UsageTextualNotationBuilder.BuildBasicUsagePrefix(poco, stringBuilder); - // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); } @@ -56,9 +54,7 @@ public static void BuildOwnedCrossFeature(SysML2.NET.Core.POCO.Systems.Definitio /// The that contains the entire textual notation public static void BuildDefaultReferenceUsage(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) { - // non Terminal : RefPrefix; Found rule RefPrefix:Usage=(direction=FeatureDirection)?(isDerived?='derived')?(isAbstract?='abstract'|isVariation?='variation')?(isConstant?='constant')? UsageTextualNotationBuilder.BuildRefPrefix(poco, stringBuilder); - // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); } @@ -71,11 +67,8 @@ public static void BuildDefaultReferenceUsage(SysML2.NET.Core.POCO.Systems.Defin /// The that contains the entire textual notation public static void BuildVariantReference(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // non Terminal : FeatureSpecialization; Found rule FeatureSpecialization:Feature=Typings|Subsettings|References|Crosses|Redefinitions + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); FeatureTextualNotationBuilder.BuildFeatureSpecialization(poco, stringBuilder); - // non Terminal : UsageBody; Found rule UsageBody:Usage=DefinitionBody UsageTextualNotationBuilder.BuildUsageBody(poco, stringBuilder); } @@ -88,9 +81,11 @@ public static void BuildVariantReference(SysML2.NET.Core.POCO.Systems.Definition /// The that contains the entire textual notation public static void BuildSourceEnd(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) { - // Group Element - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + if (poco.OwnedRelationship.Count != 0) + { + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } } @@ -103,18 +98,20 @@ public static void BuildSourceEnd(SysML2.NET.Core.POCO.Systems.DefinitionAndUsag /// The that contains the entire textual notation public static void BuildConnectorEnd(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) { - // Group Element - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - - // Group Element - // Assignment Element : declaredName = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property declaredName value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // non Terminal : REFERENCES; Found rule REFERENCES='::>'|'references' - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + if (poco.OwnedRelationship.Count != 0) + { + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } + + if (!string.IsNullOrWhiteSpace(poco.DeclaredName)) + { + stringBuilder.Append(poco.DeclaredName); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + } - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -126,8 +123,7 @@ public static void BuildConnectorEnd(SysML2.NET.Core.POCO.Systems.DefinitionAndU /// The that contains the entire textual notation public static void BuildFlowFeature(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -150,8 +146,7 @@ public static void BuildPayloadParameter(SysML2.NET.Core.POCO.Systems.Definition /// The that contains the entire textual notation public static void BuildNodeParameter(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -174,10 +169,12 @@ public static void BuildEmptyUsage(SysML2.NET.Core.POCO.Systems.DefinitionAndUsa /// The that contains the entire textual notation public static void BuildAssignmentTargetParameter(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) { - // Group Element - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - stringBuilder.Append(". "); + if (poco.OwnedRelationship.Count != 0) + { + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append("."); + stringBuilder.Append(' '); + } } @@ -190,7 +187,6 @@ public static void BuildAssignmentTargetParameter(SysML2.NET.Core.POCO.Systems.D /// The that contains the entire textual notation public static void BuildForVariableDeclaration(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) { - // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); } @@ -215,9 +211,7 @@ public static void BuildEmptyFeature(SysML2.NET.Core.POCO.Systems.DefinitionAndU public static void BuildSubjectUsage(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) { stringBuilder.Append("subject "); - // non Terminal : UsageExtensionKeyword; Found rule UsageExtensionKeyword:Usage=ownedRelationship+=PrefixMetadataMember UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, stringBuilder); - // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); } @@ -230,8 +224,7 @@ public static void BuildSubjectUsage(SysML2.NET.Core.POCO.Systems.DefinitionAndU /// The that contains the entire textual notation public static void BuildSatisfactionParameter(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -244,15 +237,10 @@ public static void BuildSatisfactionParameter(SysML2.NET.Core.POCO.Systems.Defin public static void BuildMetadataBodyUsage(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) { stringBuilder.Append("ref "); - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // non Terminal : FeatureSpecializationPart; Found rule FeatureSpecializationPart:Feature=FeatureSpecialization+MultiplicityPart?FeatureSpecialization*|MultiplicityPartFeatureSpecialization* + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); FeatureTextualNotationBuilder.BuildFeatureSpecializationPart(poco, stringBuilder); - // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); - // non Terminal : MetadataBody; Found rule MetadataBody:Type=';'|'{'(ownedRelationship+=DefinitionMember|ownedRelationship+=MetadataBodyUsageMember|ownedRelationship+=AliasMember|ownedRelationship+=Import)*'}' TypeTextualNotationBuilder.BuildMetadataBody(poco, stringBuilder); } @@ -265,10 +253,9 @@ public static void BuildMetadataBodyUsage(SysML2.NET.Core.POCO.Systems.Definitio /// The that contains the entire textual notation public static void BuildReferenceUsage(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) { - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); stringBuilder.Append("ref "); - // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingDefinitionTextualNotationBuilder.cs index 327438b7..acbf42cc 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingDefinitionTextualNotationBuilder.cs @@ -41,11 +41,9 @@ public static partial class RenderingDefinitionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildRenderingDefinition(SysML2.NET.Core.POCO.Systems.Views.IRenderingDefinition poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("rendering "); stringBuilder.Append("def "); - // non Terminal : Definition; Found rule Definition=DefinitionDeclarationDefinitionBody DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingUsageTextualNotationBuilder.cs index 07f3ad6a..223a99cc 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingUsageTextualNotationBuilder.cs @@ -52,10 +52,8 @@ public static void BuildViewRenderingUsage(SysML2.NET.Core.POCO.Systems.Views.IR /// The that contains the entire textual notation public static void BuildRenderingUsage(SysML2.NET.Core.POCO.Systems.Views.IRenderingUsage poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("rendering "); - // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.cs index 26a4e00a..b9ace0d9 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.cs @@ -41,12 +41,9 @@ public static partial class RequirementConstraintMembershipTextualNotationBuilde /// The that contains the entire textual notation public static void BuildRequirementConstraintMember(SysML2.NET.Core.POCO.Systems.Requirements.IRequirementConstraintMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - // non Terminal : RequirementKind; Found rule RequirementKind:RequirementConstraintMembership='assume'{kind='assumption'}|'require'{kind='requirement'} BuildRequirementKind(poco, stringBuilder); - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementDefinitionTextualNotationBuilder.cs index 9cabc030..671fb56c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementDefinitionTextualNotationBuilder.cs @@ -41,13 +41,10 @@ public static partial class RequirementDefinitionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildRequirementDefinition(SysML2.NET.Core.POCO.Systems.Requirements.IRequirementDefinition poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("requirement "); stringBuilder.Append("def "); - // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); - // non Terminal : RequirementBody; Found rule RequirementBody:Type=';'|'{'RequirementBodyItem*'}' TypeTextualNotationBuilder.BuildRequirementBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementUsageTextualNotationBuilder.cs index eac6fee0..1bfb9bea 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementUsageTextualNotationBuilder.cs @@ -41,11 +41,8 @@ public static partial class RequirementUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildObjectiveRequirementUsage(SysML2.NET.Core.POCO.Systems.Requirements.IRequirementUsage poco, StringBuilder stringBuilder) { - // non Terminal : UsageExtensionKeyword; Found rule UsageExtensionKeyword:Usage=ownedRelationship+=PrefixMetadataMember UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, stringBuilder); - // non Terminal : ConstraintUsageDeclaration; Found rule ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? ConstraintUsageTextualNotationBuilder.BuildConstraintUsageDeclaration(poco, stringBuilder); - // non Terminal : RequirementBody; Found rule RequirementBody:Type=';'|'{'RequirementBodyItem*'}' TypeTextualNotationBuilder.BuildRequirementBody(poco, stringBuilder); } @@ -69,12 +66,9 @@ public static void BuildRequirementVerificationUsage(SysML2.NET.Core.POCO.System /// The that contains the entire textual notation public static void BuildRequirementUsage(SysML2.NET.Core.POCO.Systems.Requirements.IRequirementUsage poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("requirement "); - // non Terminal : ConstraintUsageDeclaration; Found rule ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? ConstraintUsageTextualNotationBuilder.BuildConstraintUsageDeclaration(poco, stringBuilder); - // non Terminal : RequirementBody; Found rule RequirementBody:Type=';'|'{'RequirementBodyItem*'}' TypeTextualNotationBuilder.BuildRequirementBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementVerificationMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementVerificationMembershipTextualNotationBuilder.cs index eff80fd3..24d2edce 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementVerificationMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementVerificationMembershipTextualNotationBuilder.cs @@ -41,12 +41,10 @@ public static partial class RequirementVerificationMembershipTextualNotationBuil /// The that contains the entire textual notation public static void BuildRequirementVerificationMember(SysML2.NET.Core.POCO.Systems.VerificationCases.IRequirementVerificationMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); stringBuilder.Append("verify "); // Assignment Element : kind = 'requirement' - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ResultExpressionMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ResultExpressionMembershipTextualNotationBuilder.cs index f8f176bb..bd741750 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ResultExpressionMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ResultExpressionMembershipTextualNotationBuilder.cs @@ -41,10 +41,8 @@ public static partial class ResultExpressionMembershipTextualNotationBuilder /// The that contains the entire textual notation public static void BuildResultExpressionMember(SysML2.NET.Core.POCO.Kernel.Functions.IResultExpressionMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReturnParameterMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReturnParameterMembershipTextualNotationBuilder.cs index 7000f70f..fc6051a9 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReturnParameterMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReturnParameterMembershipTextualNotationBuilder.cs @@ -41,11 +41,9 @@ public static partial class ReturnParameterMembershipTextualNotationBuilder /// The that contains the entire textual notation public static void BuildReturnParameterMember(SysML2.NET.Core.POCO.Kernel.Functions.IReturnParameterMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); stringBuilder.Append("return "); - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -57,11 +55,9 @@ public static void BuildReturnParameterMember(SysML2.NET.Core.POCO.Kernel.Functi /// The that contains the entire textual notation public static void BuildReturnFeatureMember(SysML2.NET.Core.POCO.Kernel.Functions.IReturnParameterMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); stringBuilder.Append("return "); - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -73,8 +69,7 @@ public static void BuildReturnFeatureMember(SysML2.NET.Core.POCO.Kernel.Function /// The that contains the entire textual notation public static void BuildEmptyResultMember(SysML2.NET.Core.POCO.Kernel.Functions.IReturnParameterMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -86,8 +81,7 @@ public static void BuildEmptyResultMember(SysML2.NET.Core.POCO.Kernel.Functions. /// The that contains the entire textual notation public static void BuildConstructorResultMember(SysML2.NET.Core.POCO.Kernel.Functions.IReturnParameterMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.cs index d8a0820d..b7f95900 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.cs @@ -41,24 +41,22 @@ public static partial class SatisfyRequirementUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildSatisfyRequirementUsage(SysML2.NET.Core.POCO.Systems.Requirements.ISatisfyRequirementUsage poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("assert "); - // Group Element - // Assignment Element : isNegated ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // If property isNegated value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + stringBuilder.Append("not"); + stringBuilder.Append(' '); stringBuilder.Append("satisfy "); - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue + stringBuilder.Append(' '); FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); - // Group Element - stringBuilder.Append("by "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + if (poco.OwnedRelationship.Count != 0) + { + stringBuilder.Append("by "); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } - // non Terminal : RequirementBody; Found rule RequirementBody:Type=';'|'{'RequirementBodyItem*'}' TypeTextualNotationBuilder.BuildRequirementBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SelectExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SelectExpressionTextualNotationBuilder.cs index a5070298..1195b653 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SelectExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SelectExpressionTextualNotationBuilder.cs @@ -41,11 +41,9 @@ public static partial class SelectExpressionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildSelectExpression(SysML2.NET.Core.POCO.Kernel.Expressions.ISelectExpression poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); stringBuilder.Append(".? "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.cs index 1c64068f..c4829fc6 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.cs @@ -41,14 +41,10 @@ public static partial class SendActionUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildSendNode(SysML2.NET.Core.POCO.Systems.Actions.ISendActionUsage poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); - // non Terminal : ActionUsageDeclaration; Found rule ActionUsageDeclaration:ActionUsage=UsageDeclarationValuePart? ActionUsageTextualNotationBuilder.BuildActionUsageDeclaration(poco, stringBuilder); stringBuilder.Append("send "); - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); } @@ -61,12 +57,9 @@ public static void BuildSendNode(SysML2.NET.Core.POCO.Systems.Actions.ISendActio /// The that contains the entire textual notation public static void BuildSendNodeDeclaration(SysML2.NET.Core.POCO.Systems.Actions.ISendActionUsage poco, StringBuilder stringBuilder) { - // non Terminal : ActionNodeUsageDeclaration; Found rule ActionNodeUsageDeclaration:ActionUsage='action'UsageDeclaration? ActionUsageTextualNotationBuilder.BuildActionNodeUsageDeclaration(poco, stringBuilder); stringBuilder.Append("send "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // non Terminal : SenderReceiverPart; Found rule SenderReceiverPart:SendActionUsage='via'ownedRelationship+=NodeParameterMember('to'ownedRelationship+=NodeParameterMember)?|ownedRelationship+=EmptyParameterMember'to'ownedRelationship+=NodeParameterMember + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); BuildSenderReceiverPart(poco, stringBuilder); } @@ -90,9 +83,7 @@ public static void BuildSenderReceiverPart(SysML2.NET.Core.POCO.Systems.Actions. /// The that contains the entire textual notation public static void BuildStateSendActionUsage(SysML2.NET.Core.POCO.Systems.Actions.ISendActionUsage poco, StringBuilder stringBuilder) { - // non Terminal : SendNodeDeclaration; Found rule SendNodeDeclaration:SendActionUsage=ActionNodeUsageDeclaration?'send'ownedRelationship+=NodeParameterMemberSenderReceiverPart? BuildSendNodeDeclaration(poco, stringBuilder); - // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); } @@ -105,13 +96,7 @@ public static void BuildStateSendActionUsage(SysML2.NET.Core.POCO.Systems.Action /// The that contains the entire textual notation public static void BuildTransitionSendActionUsage(SysML2.NET.Core.POCO.Systems.Actions.ISendActionUsage poco, StringBuilder stringBuilder) { - // non Terminal : SendNodeDeclaration; Found rule SendNodeDeclaration:SendActionUsage=ActionNodeUsageDeclaration?'send'ownedRelationship+=NodeParameterMemberSenderReceiverPart? BuildSendNodeDeclaration(poco, stringBuilder); - // Group Element - stringBuilder.Append("{ "); - // non Terminal : ActionBodyItem; Found rule ActionBodyItem:Type=NonBehaviorBodyItem|ownedRelationship+=InitialNodeMember(ownedRelationship+=ActionTargetSuccessionMember)*|(ownedRelationship+=SourceSuccessionMember)?ownedRelationship+=ActionBehaviorMember(ownedRelationship+=ActionTargetSuccessionMember)*|ownedRelationship+=GuardedSuccessionMember - TypeTextualNotationBuilder.BuildActionBodyItem(poco, stringBuilder); - stringBuilder.Append("} "); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.cs index 37383b30..971380f3 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.cs @@ -41,7 +41,6 @@ public static partial class SpecializationTextualNotationBuilder /// The that contains the entire textual notation public static void BuildOwnedSpecialization(SysML2.NET.Core.POCO.Core.Types.ISpecialization poco, StringBuilder stringBuilder) { - // non Terminal : GeneralType; Found rule GeneralType:Specialization=general=[QualifiedName]|general+=OwnedFeatureChain{ownedRelatedElement+=general} BuildGeneralType(poco, stringBuilder); } @@ -76,19 +75,11 @@ public static void BuildGeneralType(SysML2.NET.Core.POCO.Core.Types.ISpecializat /// The that contains the entire textual notation public static void BuildSpecialization(SysML2.NET.Core.POCO.Core.Types.ISpecialization poco, StringBuilder stringBuilder) { - // Group Element - stringBuilder.Append("specialization "); - // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? - ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); stringBuilder.Append("subtype "); - // non Terminal : SpecificType; Found rule SpecificType:Specialization=specific=[QualifiedName]|specific+=OwnedFeatureChain{ownedRelatedElement+=specific} BuildSpecificType(poco, stringBuilder); - // non Terminal : SPECIALIZES; Found rule SPECIALIZES=':>'|'specializes' throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // non Terminal : GeneralType; Found rule GeneralType:Specialization=general=[QualifiedName]|general+=OwnedFeatureChain{ownedRelatedElement+=general} BuildGeneralType(poco, stringBuilder); - // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StakeholderMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StakeholderMembershipTextualNotationBuilder.cs index 22568394..56414522 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StakeholderMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StakeholderMembershipTextualNotationBuilder.cs @@ -41,10 +41,8 @@ public static partial class StakeholderMembershipTextualNotationBuilder /// The that contains the entire textual notation public static void BuildStakeholderMember(SysML2.NET.Core.POCO.Systems.Requirements.IStakeholderMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateDefinitionTextualNotationBuilder.cs index 8aefc1e5..e499d380 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateDefinitionTextualNotationBuilder.cs @@ -52,13 +52,10 @@ public static void BuildStateDefBody(SysML2.NET.Core.POCO.Systems.States.IStateD /// The that contains the entire textual notation public static void BuildStateDefinition(SysML2.NET.Core.POCO.Systems.States.IStateDefinition poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("state "); stringBuilder.Append("def "); - // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); - // non Terminal : StateDefBody; Found rule StateDefBody:StateDefinition=';'|(isParallel?='parallel')?'{'StateBodyItem*'}' BuildStateDefBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateSubactionMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateSubactionMembershipTextualNotationBuilder.cs index 3bf417c2..f715fe7f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateSubactionMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateSubactionMembershipTextualNotationBuilder.cs @@ -41,12 +41,9 @@ public static partial class StateSubactionMembershipTextualNotationBuilder /// The that contains the entire textual notation public static void BuildEntryActionMember(SysML2.NET.Core.POCO.Systems.States.IStateSubactionMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - // Assignment Element : kind = SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // If property kind value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(poco.Kind.ToString().ToLower()); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -58,12 +55,9 @@ public static void BuildEntryActionMember(SysML2.NET.Core.POCO.Systems.States.IS /// The that contains the entire textual notation public static void BuildDoActionMember(SysML2.NET.Core.POCO.Systems.States.IStateSubactionMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - // Assignment Element : kind = SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // If property kind value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(poco.Kind.ToString().ToLower()); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -75,12 +69,9 @@ public static void BuildDoActionMember(SysML2.NET.Core.POCO.Systems.States.IStat /// The that contains the entire textual notation public static void BuildExitActionMember(SysML2.NET.Core.POCO.Systems.States.IStateSubactionMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - // Assignment Element : kind = SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // If property kind value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(poco.Kind.ToString().ToLower()); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateUsageTextualNotationBuilder.cs index 4d2c2ef6..0db5fdab 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateUsageTextualNotationBuilder.cs @@ -52,12 +52,9 @@ public static void BuildStateUsageBody(SysML2.NET.Core.POCO.Systems.States.IStat /// The that contains the entire textual notation public static void BuildStateUsage(SysML2.NET.Core.POCO.Systems.States.IStateUsage poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("state "); - // non Terminal : ActionUsageDeclaration; Found rule ActionUsageDeclaration:ActionUsage=UsageDeclarationValuePart? ActionUsageTextualNotationBuilder.BuildActionUsageDeclaration(poco, stringBuilder); - // non Terminal : StateUsageBody; Found rule StateUsageBody:StateUsage=';'|(isParallel?='parallel')?'{'StateBodyItem*'}' BuildStateUsageBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StepTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StepTextualNotationBuilder.cs index f5a9d724..08d12ffd 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StepTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StepTextualNotationBuilder.cs @@ -41,20 +41,18 @@ public static partial class StepTextualNotationBuilder /// The that contains the entire textual notation public static void BuildStep(SysML2.NET.Core.POCO.Kernel.Behaviors.IStep poco, StringBuilder stringBuilder) { - // non Terminal : FeaturePrefix; Found rule FeaturePrefix=(EndFeaturePrefix(ownedRelationship+=OwnedCrossFeatureMember)?|BasicFeaturePrefix)(ownedRelationship+=PrefixMetadataMember)* - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // Group Element - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(' '); + if (poco.OwnedRelationship.Count != 0) + { + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } stringBuilder.Append("step "); - // non Terminal : FeatureDeclaration; Found rule FeatureDeclaration:Feature=(isSufficient?='all')?(FeatureIdentification(FeatureSpecializationPart|ConjugationPart)?|FeatureSpecializationPart|ConjugationPart)FeatureRelationshipPart* FeatureTextualNotationBuilder.BuildFeatureDeclaration(poco, stringBuilder); - // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); - // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StructureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StructureTextualNotationBuilder.cs index b7e1ed7a..20cb543c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StructureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StructureTextualNotationBuilder.cs @@ -41,12 +41,9 @@ public static partial class StructureTextualNotationBuilder /// The that contains the entire textual notation public static void BuildStructure(SysML2.NET.Core.POCO.Kernel.Structures.IStructure poco, StringBuilder stringBuilder) { - // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); stringBuilder.Append("struct "); - // non Terminal : ClassifierDeclaration; Found rule ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); - // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.cs index e2546bed..5b3cacf9 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.cs @@ -41,8 +41,7 @@ public static partial class SubclassificationTextualNotationBuilder /// The that contains the entire textual notation public static void BuildOwnedSubclassification(SysML2.NET.Core.POCO.Core.Classifiers.ISubclassification poco, StringBuilder stringBuilder) { - // Assignment Element : superClassifier = SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement - // If property superclassifier value is set, print SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); } @@ -54,19 +53,11 @@ public static void BuildOwnedSubclassification(SysML2.NET.Core.POCO.Core.Classif /// The that contains the entire textual notation public static void BuildSubclassification(SysML2.NET.Core.POCO.Core.Classifiers.ISubclassification poco, StringBuilder stringBuilder) { - // Group Element - stringBuilder.Append("specialization "); - // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? - ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); stringBuilder.Append("subclassifier "); - // Assignment Element : subclassifier = SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement - // If property subclassifier value is set, print SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement - // non Terminal : SPECIALIZES; Found rule SPECIALIZES=':>'|'specializes' + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // Assignment Element : superclassifier = SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement - // If property superclassifier value is set, print SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement - // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubjectMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubjectMembershipTextualNotationBuilder.cs index 405b3537..3ad8096a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubjectMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubjectMembershipTextualNotationBuilder.cs @@ -41,10 +41,8 @@ public static partial class SubjectMembershipTextualNotationBuilder /// The that contains the entire textual notation public static void BuildSubjectMember(SysML2.NET.Core.POCO.Systems.Requirements.ISubjectMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -56,8 +54,7 @@ public static void BuildSubjectMember(SysML2.NET.Core.POCO.Systems.Requirements. /// The that contains the entire textual notation public static void BuildSatisfactionSubjectMember(SysML2.NET.Core.POCO.Systems.Requirements.ISubjectMembership poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.cs index 3c1d4674..0eab1d88 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.cs @@ -52,19 +52,11 @@ public static void BuildOwnedSubsetting(SysML2.NET.Core.POCO.Core.Features.ISubs /// The that contains the entire textual notation public static void BuildSubsetting(SysML2.NET.Core.POCO.Core.Features.ISubsetting poco, StringBuilder stringBuilder) { - // Group Element - stringBuilder.Append("specialization "); - // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? - ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); stringBuilder.Append("subset "); - // non Terminal : SpecificType; Found rule SpecificType:Specialization=specific=[QualifiedName]|specific+=OwnedFeatureChain{ownedRelatedElement+=specific} SpecializationTextualNotationBuilder.BuildSpecificType(poco, stringBuilder); - // non Terminal : SUBSETS; Found rule SUBSETS=':>'|'subsets' throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // non Terminal : GeneralType; Found rule GeneralType:Specialization=general=[QualifiedName]|general+=OwnedFeatureChain{ownedRelatedElement+=general} SpecializationTextualNotationBuilder.BuildGeneralType(poco, stringBuilder); - // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionAsUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionAsUsageTextualNotationBuilder.cs index 8761e5f7..20e813c3 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionAsUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionAsUsageTextualNotationBuilder.cs @@ -41,8 +41,7 @@ public static partial class SuccessionAsUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildSourceSuccession(SysML2.NET.Core.POCO.Systems.Connections.ISuccessionAsUsage poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -54,11 +53,9 @@ public static void BuildSourceSuccession(SysML2.NET.Core.POCO.Systems.Connection /// The that contains the entire textual notation public static void BuildTargetSuccession(SysML2.NET.Core.POCO.Systems.Connections.ISuccessionAsUsage poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); stringBuilder.Append("then "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -70,20 +67,12 @@ public static void BuildTargetSuccession(SysML2.NET.Core.POCO.Systems.Connection /// The that contains the entire textual notation public static void BuildSuccessionAsUsage(SysML2.NET.Core.POCO.Systems.Connections.ISuccessionAsUsage poco, StringBuilder stringBuilder) { - // non Terminal : UsagePrefix; Found rule UsagePrefix:Usage=UnextendedUsagePrefixUsageExtensionKeyword* UsageTextualNotationBuilder.BuildUsagePrefix(poco, stringBuilder); - // Group Element - stringBuilder.Append("succession "); - // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? - UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); stringBuilder.Append("first "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); stringBuilder.Append("then "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // non Terminal : UsageBody; Found rule UsageBody:Usage=DefinitionBody + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); UsageTextualNotationBuilder.BuildUsageBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowTextualNotationBuilder.cs index cd9efa5f..4765066e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowTextualNotationBuilder.cs @@ -41,19 +41,18 @@ public static partial class SuccessionFlowTextualNotationBuilder /// The that contains the entire textual notation public static void BuildSuccessionFlow(SysML2.NET.Core.POCO.Kernel.Interactions.ISuccessionFlow poco, StringBuilder stringBuilder) { - // non Terminal : FeaturePrefix; Found rule FeaturePrefix=(EndFeaturePrefix(ownedRelationship+=OwnedCrossFeatureMember)?|BasicFeaturePrefix)(ownedRelationship+=PrefixMetadataMember)* - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // Group Element - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(' '); + if (poco.OwnedRelationship.Count != 0) + { + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } stringBuilder.Append("succession "); stringBuilder.Append("flow "); - // non Terminal : FlowDeclaration; Found rule FlowDeclaration:FlowUsage=UsageDeclarationValuePart?('of'ownedRelationship+=FlowPayloadFeatureMember)?('from'ownedRelationship+=FlowEndMember'to'ownedRelationship+=FlowEndMember)?|ownedRelationship+=FlowEndMember'to'ownedRelationship+=FlowEndMember throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowUsageTextualNotationBuilder.cs index ab339d4e..5cf15568 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowUsageTextualNotationBuilder.cs @@ -41,13 +41,10 @@ public static partial class SuccessionFlowUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildSuccessionFlowUsage(SysML2.NET.Core.POCO.Systems.Flows.ISuccessionFlowUsage poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("succession "); stringBuilder.Append("flow "); - // non Terminal : FlowDeclaration; Found rule FlowDeclaration:FlowUsage=UsageDeclarationValuePart?('of'ownedRelationship+=FlowPayloadFeatureMember)?('from'ownedRelationship+=FlowEndMember'to'ownedRelationship+=FlowEndMember)?|ownedRelationship+=FlowEndMember'to'ownedRelationship+=FlowEndMember FlowUsageTextualNotationBuilder.BuildFlowDeclaration(poco, stringBuilder); - // non Terminal : DefinitionBody; Found rule DefinitionBody:Type=';'|'{'DefinitionBodyItem*'}' TypeTextualNotationBuilder.BuildDefinitionBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionTextualNotationBuilder.cs index eea58269..da9276a0 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionTextualNotationBuilder.cs @@ -41,10 +41,8 @@ public static partial class SuccessionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildTransitionSuccession(SysML2.NET.Core.POCO.Kernel.Connectors.ISuccession poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -67,18 +65,17 @@ public static void BuildSuccessionDeclaration(SysML2.NET.Core.POCO.Kernel.Connec /// The that contains the entire textual notation public static void BuildSuccession(SysML2.NET.Core.POCO.Kernel.Connectors.ISuccession poco, StringBuilder stringBuilder) { - // non Terminal : FeaturePrefix; Found rule FeaturePrefix=(EndFeaturePrefix(ownedRelationship+=OwnedCrossFeatureMember)?|BasicFeaturePrefix)(ownedRelationship+=PrefixMetadataMember)* - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // Group Element - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(' '); + if (poco.OwnedRelationship.Count != 0) + { + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } stringBuilder.Append("succession "); - // non Terminal : SuccessionDeclaration; Found rule SuccessionDeclaration:Succession=FeatureDeclaration('first'ownedRelationship+=ConnectorEndMember'then'ownedRelationship+=ConnectorEndMember)?|(s.isSufficient?='all')?('first'?ownedRelationship+=ConnectorEndMember'then'ownedRelationship+=ConnectorEndMember)? BuildSuccessionDeclaration(poco, stringBuilder); - // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TerminateActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TerminateActionUsageTextualNotationBuilder.cs index 79445b00..3592a3ac 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TerminateActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TerminateActionUsageTextualNotationBuilder.cs @@ -41,16 +41,15 @@ public static partial class TerminateActionUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildTerminateNode(SysML2.NET.Core.POCO.Systems.Actions.ITerminateActionUsage poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); - // non Terminal : ActionNodeUsageDeclaration; Found rule ActionNodeUsageDeclaration:ActionUsage='action'UsageDeclaration? ActionUsageTextualNotationBuilder.BuildActionNodeUsageDeclaration(poco, stringBuilder); stringBuilder.Append("terminate "); - // Group Element - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + if (poco.OwnedRelationship.Count != 0) + { + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } - // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TextualRepresentationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TextualRepresentationTextualNotationBuilder.cs index cfe81735..3123697d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TextualRepresentationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TextualRepresentationTextualNotationBuilder.cs @@ -41,16 +41,10 @@ public static partial class TextualRepresentationTextualNotationBuilder /// The that contains the entire textual notation public static void BuildTextualRepresentation(SysML2.NET.Core.POCO.Root.Annotations.ITextualRepresentation poco, StringBuilder stringBuilder) { - // Group Element - stringBuilder.Append("rep "); - // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? - ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); stringBuilder.Append("language "); - // Assignment Element : language = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property language value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Assignment Element : body = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property body value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append(poco.Language); + stringBuilder.Append(poco.Body); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionFeatureMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionFeatureMembershipTextualNotationBuilder.cs index f38aff43..f9b3b079 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionFeatureMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionFeatureMembershipTextualNotationBuilder.cs @@ -43,8 +43,7 @@ public static void BuildTriggerActionMember(SysML2.NET.Core.POCO.Systems.States. { stringBuilder.Append("accept "); // Assignment Element : kind = 'trigger' - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -58,8 +57,7 @@ public static void BuildGuardExpressionMember(SysML2.NET.Core.POCO.Systems.State { stringBuilder.Append("if "); // Assignment Element : kind = 'guard' - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -73,8 +71,7 @@ public static void BuildEffectBehaviorMember(SysML2.NET.Core.POCO.Systems.States { stringBuilder.Append("do "); // Assignment Element : kind = 'effect' - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionUsageTextualNotationBuilder.cs index 9b7fd0e9..80890ab0 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionUsageTextualNotationBuilder.cs @@ -41,11 +41,9 @@ public static partial class TransitionUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildGuardedTargetSuccession(SysML2.NET.Core.POCO.Systems.States.ITransitionUsage poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); stringBuilder.Append("then "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -58,8 +56,7 @@ public static void BuildGuardedTargetSuccession(SysML2.NET.Core.POCO.Systems.Sta public static void BuildDefaultTargetSuccession(SysML2.NET.Core.POCO.Systems.States.ITransitionUsage poco, StringBuilder stringBuilder) { stringBuilder.Append("else "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -71,20 +68,12 @@ public static void BuildDefaultTargetSuccession(SysML2.NET.Core.POCO.Systems.Sta /// The that contains the entire textual notation public static void BuildGuardedSuccession(SysML2.NET.Core.POCO.Systems.States.ITransitionUsage poco, StringBuilder stringBuilder) { - // Group Element - stringBuilder.Append("succession "); - // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? - UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); stringBuilder.Append("first "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); stringBuilder.Append("then "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // non Terminal : UsageBody; Found rule UsageBody:Usage=DefinitionBody + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); UsageTextualNotationBuilder.BuildUsageBody(poco, stringBuilder); } @@ -97,14 +86,10 @@ public static void BuildGuardedSuccession(SysML2.NET.Core.POCO.Systems.States.IT /// The that contains the entire textual notation public static void BuildTargetTransitionUsage(SysML2.NET.Core.POCO.Systems.States.ITransitionUsage poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Group Element + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); throw new System.NotSupportedException("Multiple alternatives not implemented yet"); stringBuilder.Append("then "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); } @@ -118,33 +103,30 @@ public static void BuildTargetTransitionUsage(SysML2.NET.Core.POCO.Systems.State public static void BuildTransitionUsage(SysML2.NET.Core.POCO.Systems.States.ITransitionUsage poco, StringBuilder stringBuilder) { stringBuilder.Append("transition "); - // Group Element - // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? - UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); - stringBuilder.Append("first "); - - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Group Element - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - - // Group Element - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Group Element - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + if (poco.OwnedRelationship.Count != 0) + { + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } + + if (poco.OwnedRelationship.Count != 0) + { + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } + + if (poco.OwnedRelationship.Count != 0) + { + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } stringBuilder.Append("then "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // non Terminal : ActionBody; Found rule ActionBody:Type=';'|'{'ActionBodyItem*'}' + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeFeaturingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeFeaturingTextualNotationBuilder.cs index 464e8c2b..7689a67b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeFeaturingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeFeaturingTextualNotationBuilder.cs @@ -41,8 +41,7 @@ public static partial class TypeFeaturingTextualNotationBuilder /// The that contains the entire textual notation public static void BuildOwnedTypeFeaturing(SysML2.NET.Core.POCO.Core.Features.ITypeFeaturing poco, StringBuilder stringBuilder) { - // Assignment Element : featuringType = SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement - // If property featuringType value is set, print SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); } @@ -55,17 +54,10 @@ public static void BuildOwnedTypeFeaturing(SysML2.NET.Core.POCO.Core.Features.IT public static void BuildTypeFeaturing(SysML2.NET.Core.POCO.Core.Features.ITypeFeaturing poco, StringBuilder stringBuilder) { stringBuilder.Append("featuring "); - // Group Element - // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? - ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); - stringBuilder.Append("of "); - // Assignment Element : featureOfType = SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement - // If property featureOfType value is set, print SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); stringBuilder.Append("by "); - // Assignment Element : featuringType = SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement - // If property featuringType value is set, print SysML2.NET.CodeGenerator.Grammar.Model.ValueLiteralElement - // non Terminal : RelationshipBody; Found rule RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs index c08f980e..9e681d7b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs @@ -129,11 +129,12 @@ public static void BuildCalculationBody(SysML2.NET.Core.POCO.Core.Types.IType po /// The that contains the entire textual notation public static void BuildCalculationBodyPart(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) { - // non Terminal : CalculationBodyItem; Found rule CalculationBodyItem:Type=ActionBodyItem|ownedRelationship+=ReturnParameterMember BuildCalculationBodyItem(poco, stringBuilder); - // Group Element - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + if (poco.OwnedRelationship.Count != 0) + { + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } } @@ -212,13 +213,17 @@ public static void BuildMetadataBody(SysML2.NET.Core.POCO.Core.Types.IType poco, /// The that contains the entire textual notation public static void BuildTypePrefix(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) { - // Group Element - // Assignment Element : isAbstract ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // If property isAbstract value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + if (poco.IsAbstract) + { + stringBuilder.Append("abstract"); + stringBuilder.Append(' '); + } - // Group Element - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + if (poco.OwnedRelationship.Count != 0) + { + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } } @@ -231,19 +236,21 @@ public static void BuildTypePrefix(SysML2.NET.Core.POCO.Core.Types.IType poco, S /// The that contains the entire textual notation public static void BuildTypeDeclaration(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) { - // Group Element - // Assignment Element : isSufficient ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // If property isSufficient value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + if (poco.IsSufficient) + { + stringBuilder.Append("all"); + stringBuilder.Append(' '); + } - // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); - // Group Element - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + if (poco.OwnedRelationship.Count != 0) + { + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // non Terminal : TypeRelationshipPart; Found rule TypeRelationshipPart:Type=DisjoiningPart|UnioningPart|IntersectingPart|DifferencingPart + stringBuilder.Append(' '); BuildTypeRelationshipPart(poco, stringBuilder); } @@ -256,14 +263,14 @@ public static void BuildTypeDeclaration(SysML2.NET.Core.POCO.Core.Types.IType po /// The that contains the entire textual notation public static void BuildSpecializationPart(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) { - // non Terminal : SPECIALIZES; Found rule SPECIALIZES=':>'|'specializes' throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Group Element - stringBuilder.Append(", "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + if (poco.OwnedRelationship.Count != 0) + { + stringBuilder.Append(","); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } } @@ -276,10 +283,8 @@ public static void BuildSpecializationPart(SysML2.NET.Core.POCO.Core.Types.IType /// The that contains the entire textual notation public static void BuildConjugationPart(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) { - // non Terminal : CONJUGATES; Found rule CONJUGATES='~'|'conjugates' throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -304,12 +309,13 @@ public static void BuildDisjoiningPart(SysML2.NET.Core.POCO.Core.Types.IType poc { stringBuilder.Append("disjoint "); stringBuilder.Append("from "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Group Element - stringBuilder.Append(", "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + if (poco.OwnedRelationship.Count != 0) + { + stringBuilder.Append(","); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } } @@ -323,12 +329,13 @@ public static void BuildDisjoiningPart(SysML2.NET.Core.POCO.Core.Types.IType poc public static void BuildUnioningPart(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) { stringBuilder.Append("unions "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Group Element - stringBuilder.Append(", "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + if (poco.OwnedRelationship.Count != 0) + { + stringBuilder.Append(","); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } } @@ -342,12 +349,13 @@ public static void BuildUnioningPart(SysML2.NET.Core.POCO.Core.Types.IType poco, public static void BuildIntersectingPart(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) { stringBuilder.Append("intersects "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Group Element - stringBuilder.Append(", "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + if (poco.OwnedRelationship.Count != 0) + { + stringBuilder.Append(","); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } } @@ -361,12 +369,13 @@ public static void BuildIntersectingPart(SysML2.NET.Core.POCO.Core.Types.IType p public static void BuildDifferencingPart(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) { stringBuilder.Append("differences "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Group Element - stringBuilder.Append(", "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + if (poco.OwnedRelationship.Count != 0) + { + stringBuilder.Append(","); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } } @@ -412,11 +421,12 @@ public static void BuildFunctionBody(SysML2.NET.Core.POCO.Core.Types.IType poco, /// The that contains the entire textual notation public static void BuildFunctionBodyPart(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) { - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // Group Element - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + if (poco.OwnedRelationship.Count != 0) + { + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } } @@ -441,12 +451,9 @@ public static void BuildInstantiatedTypeReference(SysML2.NET.Core.POCO.Core.Type /// The that contains the entire textual notation public static void BuildType(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) { - // non Terminal : TypePrefix; Found rule TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* BuildTypePrefix(poco, stringBuilder); stringBuilder.Append("type "); - // non Terminal : TypeDeclaration; Found rule TypeDeclaration:Type=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SpecializationPart|ConjugationPart)+TypeRelationshipPart* BuildTypeDeclaration(poco, stringBuilder); - // non Terminal : TypeBody; Found rule TypeBody:Type=';'|'{'TypeBodyElement*'}' BuildTypeBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs index e0c2934a..c72a6019 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs @@ -52,19 +52,24 @@ public static void BuildUsageElement(SysML2.NET.Core.POCO.Systems.DefinitionAndU /// The that contains the entire textual notation public static void BuildRefPrefix(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) { - // Group Element - // Assignment Element : direction = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property direction value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + if (poco.Direction.HasValue) + { + stringBuilder.Append(poco.Direction.ToString().ToLower()); + stringBuilder.Append(' '); + } + + if (poco.IsDerived) + { + stringBuilder.Append("derived"); + stringBuilder.Append(' '); + } - // Group Element - // Assignment Element : isDerived ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // If property isDerived value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // Group Element - // Assignment Element : isConstant ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // If property isConstant value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + if (poco.IsConstant) + { + stringBuilder.Append("constant"); + stringBuilder.Append(' '); + } } @@ -77,11 +82,12 @@ public static void BuildRefPrefix(SysML2.NET.Core.POCO.Systems.DefinitionAndUsag /// The that contains the entire textual notation public static void BuildBasicUsagePrefix(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) { - // non Terminal : RefPrefix; Found rule RefPrefix:Usage=(direction=FeatureDirection)?(isDerived?='derived')?(isAbstract?='abstract'|isVariation?='variation')?(isConstant?='constant')? BuildRefPrefix(poco, stringBuilder); - // Group Element - // Assignment Element : isReference ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // If property isReference value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement + if (poco.isReference) + { + stringBuilder.Append("ref"); + stringBuilder.Append(' '); + } } @@ -94,11 +100,12 @@ public static void BuildBasicUsagePrefix(SysML2.NET.Core.POCO.Systems.Definition /// The that contains the entire textual notation public static void BuildEndUsagePrefix(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) { - // Assignment Element : isEnd ?= SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // If property isEnd value is set, print SysML2.NET.CodeGenerator.Grammar.Model.TerminalElement - // Group Element - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + stringBuilder.Append("end"); + if (poco.OwnedRelationship.Count != 0) + { + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(' '); + } } @@ -111,8 +118,7 @@ public static void BuildEndUsagePrefix(SysML2.NET.Core.POCO.Systems.DefinitionAn /// The that contains the entire textual notation public static void BuildUsageExtensionKeyword(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) { - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } @@ -135,9 +141,7 @@ public static void BuildUnextendedUsagePrefix(SysML2.NET.Core.POCO.Systems.Defin /// The that contains the entire textual notation public static void BuildUsagePrefix(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) { - // non Terminal : UnextendedUsagePrefix; Found rule UnextendedUsagePrefix:Usage=EndUsagePrefix|BasicUsagePrefix BuildUnextendedUsagePrefix(poco, stringBuilder); - // non Terminal : UsageExtensionKeyword; Found rule UsageExtensionKeyword:Usage=ownedRelationship+=PrefixMetadataMember BuildUsageExtensionKeyword(poco, stringBuilder); } @@ -150,9 +154,7 @@ public static void BuildUsagePrefix(SysML2.NET.Core.POCO.Systems.DefinitionAndUs /// The that contains the entire textual notation public static void BuildUsageDeclaration(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) { - // non Terminal : Identification; Found rule Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); - // non Terminal : FeatureSpecializationPart; Found rule FeatureSpecializationPart:Feature=FeatureSpecialization+MultiplicityPart?FeatureSpecialization*|MultiplicityPartFeatureSpecialization* FeatureTextualNotationBuilder.BuildFeatureSpecializationPart(poco, stringBuilder); } @@ -165,9 +167,7 @@ public static void BuildUsageDeclaration(SysML2.NET.Core.POCO.Systems.Definition /// The that contains the entire textual notation public static void BuildUsageCompletion(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) { - // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); - // non Terminal : UsageBody; Found rule UsageBody:Usage=DefinitionBody BuildUsageBody(poco, stringBuilder); } @@ -180,7 +180,6 @@ public static void BuildUsageCompletion(SysML2.NET.Core.POCO.Systems.DefinitionA /// The that contains the entire textual notation public static void BuildUsageBody(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) { - // non Terminal : DefinitionBody; Found rule DefinitionBody:Type=';'|'{'DefinitionBodyItem*'}' TypeTextualNotationBuilder.BuildDefinitionBody(poco, stringBuilder); } @@ -270,9 +269,8 @@ public static void BuildInterfaceOccurrenceUsageElement(SysML2.NET.Core.POCO.Sys /// The that contains the entire textual notation public static void BuildActionTargetSuccession(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) { - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // non Terminal : UsageBody; Found rule UsageBody:Usage=DefinitionBody + stringBuilder.Append(' '); BuildUsageBody(poco, stringBuilder); } @@ -285,11 +283,8 @@ public static void BuildActionTargetSuccession(SysML2.NET.Core.POCO.Systems.Defi /// The that contains the entire textual notation public static void BuildExtendedUsage(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) { - // non Terminal : UnextendedUsagePrefix; Found rule UnextendedUsagePrefix:Usage=EndUsagePrefix|BasicUsagePrefix BuildUnextendedUsagePrefix(poco, stringBuilder); - // non Terminal : UsageExtensionKeyword; Found rule UsageExtensionKeyword:Usage=ownedRelationship+=PrefixMetadataMember BuildUsageExtensionKeyword(poco, stringBuilder); - // non Terminal : Usage; Found rule Usage=UsageDeclarationUsageCompletion BuildUsage(poco, stringBuilder); } @@ -302,9 +297,7 @@ public static void BuildExtendedUsage(SysML2.NET.Core.POCO.Systems.DefinitionAnd /// The that contains the entire textual notation public static void BuildUsage(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) { - // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? BuildUsageDeclaration(poco, stringBuilder); - // non Terminal : UsageCompletion; Found rule UsageCompletion:Usage=ValuePart?UsageBody BuildUsageCompletion(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseDefinitionTextualNotationBuilder.cs index 3d52ac55..200bbf75 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseDefinitionTextualNotationBuilder.cs @@ -41,14 +41,11 @@ public static partial class UseCaseDefinitionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildUseCaseDefinition(SysML2.NET.Core.POCO.Systems.UseCases.IUseCaseDefinition poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("use "); stringBuilder.Append("case "); stringBuilder.Append("def "); - // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); - // non Terminal : CaseBody; Found rule CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseUsageTextualNotationBuilder.cs index 9193feba..edb9dbb8 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseUsageTextualNotationBuilder.cs @@ -41,17 +41,12 @@ public static partial class UseCaseUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildUseCaseUsage(SysML2.NET.Core.POCO.Systems.UseCases.IUseCaseUsage poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("use "); stringBuilder.Append("case "); - // non Terminal : ConstraintUsageDeclaration; Found rule ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? - // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); - // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); - // non Terminal : CaseBody; Found rule CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VariantMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VariantMembershipTextualNotationBuilder.cs index 5a5b2134..47d4575c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VariantMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VariantMembershipTextualNotationBuilder.cs @@ -41,11 +41,9 @@ public static partial class VariantMembershipTextualNotationBuilder /// The that contains the entire textual notation public static void BuildVariantUsageMember(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IVariantMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); stringBuilder.Append("variant "); - // Assignment Element : ownedVariantUsage = SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedVariantUsage value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); } @@ -57,10 +55,8 @@ public static void BuildVariantUsageMember(SysML2.NET.Core.POCO.Systems.Definiti /// The that contains the entire textual notation public static void BuildEnumerationUsageMember(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IVariantMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseDefinitionTextualNotationBuilder.cs index 10873fae..5b56142f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseDefinitionTextualNotationBuilder.cs @@ -41,13 +41,10 @@ public static partial class VerificationCaseDefinitionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildVerificationCaseDefinition(SysML2.NET.Core.POCO.Systems.VerificationCases.IVerificationCaseDefinition poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("verification "); stringBuilder.Append("def "); - // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); - // non Terminal : CaseBody; Found rule CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseUsageTextualNotationBuilder.cs index 5907aea3..00116d92 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseUsageTextualNotationBuilder.cs @@ -41,16 +41,11 @@ public static partial class VerificationCaseUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildVerificationCaseUsage(SysML2.NET.Core.POCO.Systems.VerificationCases.IVerificationCaseUsage poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("verification "); - // non Terminal : ConstraintUsageDeclaration; Found rule ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? - // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); - // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); - // non Terminal : CaseBody; Found rule CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs index 6255ccd5..8dcc0e5f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs @@ -63,13 +63,10 @@ public static void BuildViewDefinitionBodyItem(SysML2.NET.Core.POCO.Systems.View /// The that contains the entire textual notation public static void BuildViewDefinition(SysML2.NET.Core.POCO.Systems.Views.IViewDefinition poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("view "); stringBuilder.Append("def "); - // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); - // non Terminal : ViewDefinitionBody; Found rule ViewDefinitionBody:ViewDefinition=';'|'{'ViewDefinitionBodyItem*'}' BuildViewDefinitionBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewRenderingMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewRenderingMembershipTextualNotationBuilder.cs index 7745ff9c..912be900 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewRenderingMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewRenderingMembershipTextualNotationBuilder.cs @@ -41,11 +41,9 @@ public static partial class ViewRenderingMembershipTextualNotationBuilder /// The that contains the entire textual notation public static void BuildViewRenderingMember(SysML2.NET.Core.POCO.Systems.Views.IViewRenderingMembership poco, StringBuilder stringBuilder) { - // non Terminal : MemberPrefix; Found rule MemberPrefix:Membership=(visibility=VisibilityIndicator)? MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); stringBuilder.Append("render "); - // Assignment Element : ownedRelatedElement += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelatedElement value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs index 5ee321f7..1269af97 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs @@ -63,14 +63,10 @@ public static void BuildViewBodyItem(SysML2.NET.Core.POCO.Systems.Views.IViewUsa /// The that contains the entire textual notation public static void BuildViewUsage(SysML2.NET.Core.POCO.Systems.Views.IViewUsage poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("view "); - // non Terminal : UsageDeclaration; Found rule UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); - // non Terminal : ValuePart; Found rule ValuePart:Feature=ownedRelationship+=FeatureValue FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); - // non Terminal : ViewBody; Found rule ViewBody:ViewUsage=';'|'{'ViewBodyItem*'}' BuildViewBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointDefinitionTextualNotationBuilder.cs index 892b92cd..8f9952aa 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointDefinitionTextualNotationBuilder.cs @@ -41,13 +41,10 @@ public static partial class ViewpointDefinitionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildViewpointDefinition(SysML2.NET.Core.POCO.Systems.Views.IViewpointDefinition poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceDefinitionPrefix; Found rule OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); stringBuilder.Append("viewpoint "); stringBuilder.Append("def "); - // non Terminal : DefinitionDeclaration; Found rule DefinitionDeclaration:Definition=IdentificationSubclassificationPart? DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); - // non Terminal : RequirementBody; Found rule RequirementBody:Type=';'|'{'RequirementBodyItem*'}' TypeTextualNotationBuilder.BuildRequirementBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointUsageTextualNotationBuilder.cs index c7f56352..fb78fe85 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointUsageTextualNotationBuilder.cs @@ -41,12 +41,9 @@ public static partial class ViewpointUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildViewpointUsage(SysML2.NET.Core.POCO.Systems.Views.IViewpointUsage poco, StringBuilder stringBuilder) { - // non Terminal : OccurrenceUsagePrefix; Found rule OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("viewpoint "); - // non Terminal : ConstraintUsageDeclaration; Found rule ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? ConstraintUsageTextualNotationBuilder.BuildConstraintUsageDeclaration(poco, stringBuilder); - // non Terminal : RequirementBody; Found rule RequirementBody:Type=';'|'{'RequirementBodyItem*'}' TypeTextualNotationBuilder.BuildRequirementBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/WhileLoopActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/WhileLoopActionUsageTextualNotationBuilder.cs index fb835343..cccd2e57 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/WhileLoopActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/WhileLoopActionUsageTextualNotationBuilder.cs @@ -41,17 +41,17 @@ public static partial class WhileLoopActionUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildWhileLoopNode(SysML2.NET.Core.POCO.Systems.Actions.IWhileLoopActionUsage poco, StringBuilder stringBuilder) { - // non Terminal : ActionNodePrefix; Found rule ActionNodePrefix:ActionUsage=OccurrenceUsagePrefixActionNodeUsageDeclaration? ActionUsageTextualNotationBuilder.BuildActionNodePrefix(poco, stringBuilder); - // Group Element throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // Group Element - stringBuilder.Append("until "); - // Assignment Element : ownedRelationship += SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - // If property ownedRelationship value is set, print SysML2.NET.CodeGenerator.Grammar.Model.NonTerminalElement - stringBuilder.Append("; "); + stringBuilder.Append(' '); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + if (poco.OwnedRelationship.Count != 0) + { + stringBuilder.Append("until "); + throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + stringBuilder.Append(";"); + stringBuilder.Append(' '); + } } From 2860e1af2395ce67f851029358521b1b878680a4 Mon Sep 17 00:00:00 2001 From: atheate Date: Tue, 3 Mar 2026 15:49:23 +0100 Subject: [PATCH 09/33] [WIP] Most assignment case handle, including collection --- .../Extensions/PropertyExtension.cs | 2 +- .../Grammar/Model/Alternatives.cs | 11 +- .../Grammar/Model/IPartOfTextualRule.cs | 33 ++ .../Grammar/Model/RuleElement.cs | 12 +- .../TextualNotationSpecificationVisitor.cs | 43 ++- .../HandleBarHelpers/RulesHelper.cs | 355 +++++++++++++++--- ...core-textual-notation-builder-template.hbs | 1 + ...AcceptActionUsageTextualNotationBuilder.cs | 40 ++ .../ActionUsageTextualNotationBuilder.cs | 50 +++ ...gnmentActionUsageTextualNotationBuilder.cs | 40 ++ ...AcceptActionUsageTextualNotationBuilder.cs | 19 +- .../ActionDefinitionTextualNotationBuilder.cs | 1 + .../ActionUsageTextualNotationBuilder.cs | 25 +- .../ActorMembershipTextualNotationBuilder.cs | 5 +- ...ocationDefinitionTextualNotationBuilder.cs | 1 + .../AllocationUsageTextualNotationBuilder.cs | 1 + ...sisCaseDefinitionTextualNotationBuilder.cs | 1 + ...AnalysisCaseUsageTextualNotationBuilder.cs | 1 + ...AnnotatingElementTextualNotationBuilder.cs | 1 + .../AnnotationTextualNotationBuilder.cs | 5 +- ...rtConstraintUsageTextualNotationBuilder.cs | 3 + ...gnmentActionUsageTextualNotationBuilder.cs | 9 + ...ociationStructureTextualNotationBuilder.cs | 1 + .../AssociationTextualNotationBuilder.cs | 1 + ...tributeDefinitionTextualNotationBuilder.cs | 1 + .../AttributeUsageTextualNotationBuilder.cs | 1 + .../BehaviorTextualNotationBuilder.cs | 1 + ...gConnectorAsUsageTextualNotationBuilder.cs | 15 +- .../BindingConnectorTextualNotationBuilder.cs | 10 +- ...BooleanExpressionTextualNotationBuilder.cs | 10 +- ...ulationDefinitionTextualNotationBuilder.cs | 1 + .../CalculationUsageTextualNotationBuilder.cs | 1 + .../CaseDefinitionTextualNotationBuilder.cs | 1 + .../CaseUsageTextualNotationBuilder.cs | 1 + .../ClassTextualNotationBuilder.cs | 1 + .../ClassifierTextualNotationBuilder.cs | 32 +- ...CollectExpressionTextualNotationBuilder.cs | 8 +- .../CommentTextualNotationBuilder.cs | 25 ++ ...ConcernDefinitionTextualNotationBuilder.cs | 1 + .../ConcernUsageTextualNotationBuilder.cs | 1 + ...tedPortDefinitionTextualNotationBuilder.cs | 5 +- ...jugatedPortTypingTextualNotationBuilder.cs | 1 + .../ConjugationTextualNotationBuilder.cs | 8 + ...nectionDefinitionTextualNotationBuilder.cs | 1 + .../ConnectionUsageTextualNotationBuilder.cs | 23 +- .../ConnectorTextualNotationBuilder.cs | 32 +- ...straintDefinitionTextualNotationBuilder.cs | 1 + .../ConstraintUsageTextualNotationBuilder.cs | 1 + ...tructorExpressionTextualNotationBuilder.cs | 9 +- .../ControlNodeTextualNotationBuilder.cs | 1 + .../CrossSubsettingTextualNotationBuilder.cs | 1 + .../DataTypeTextualNotationBuilder.cs | 1 + .../DecisionNodeTextualNotationBuilder.cs | 1 + .../DefinitionTextualNotationBuilder.cs | 5 +- .../DependencyTextualNotationBuilder.cs | 31 +- .../DifferencingTextualNotationBuilder.cs | 1 + .../DisjoiningTextualNotationBuilder.cs | 8 + .../DocumentationTextualNotationBuilder.cs | 2 + ...tFilterMembershipTextualNotationBuilder.cs | 9 +- .../ElementTextualNotationBuilder.cs | 3 + ...FeatureMembershipTextualNotationBuilder.cs | 21 +- ...erationDefinitionTextualNotationBuilder.cs | 1 + .../EnumerationUsageTextualNotationBuilder.cs | 1 + ...ntOccurrenceUsageTextualNotationBuilder.cs | 6 +- ...ExhibitStateUsageTextualNotationBuilder.cs | 2 + .../ExposeTextualNotationBuilder.cs | 1 + .../ExpressionTextualNotationBuilder.cs | 14 +- ...reChainExpressionTextualNotationBuilder.cs | 9 +- .../FeatureChainingTextualNotationBuilder.cs | 1 + ...tureDirectionKindTextualNotationBuilder.cs | 1 + .../FeatureInvertingTextualNotationBuilder.cs | 9 + ...FeatureMembershipTextualNotationBuilder.cs | 75 +++- ...ferenceExpressionTextualNotationBuilder.cs | 25 +- .../FeatureTextualNotationBuilder.cs | 188 +++++++--- .../FeatureTypingTextualNotationBuilder.cs | 1 + .../FeatureValueTextualNotationBuilder.cs | 25 +- .../FlowDefinitionTextualNotationBuilder.cs | 1 + .../FlowEndTextualNotationBuilder.cs | 11 +- .../FlowTextualNotationBuilder.cs | 10 +- .../FlowUsageTextualNotationBuilder.cs | 1 + ...orLoopActionUsageTextualNotationBuilder.cs | 12 +- .../ForkNodeTextualNotationBuilder.cs | 1 + ...ConcernMembershipTextualNotationBuilder.cs | 5 +- .../FunctionTextualNotationBuilder.cs | 1 + .../IfActionUsageTextualNotationBuilder.cs | 13 +- .../ImportTextualNotationBuilder.cs | 2 + ...cludeUseCaseUsageTextualNotationBuilder.cs | 2 + .../IndexExpressionTextualNotationBuilder.cs | 9 +- .../InteractionTextualNotationBuilder.cs | 1 + ...terfaceDefinitionTextualNotationBuilder.cs | 1 + .../InterfaceUsageTextualNotationBuilder.cs | 23 +- .../IntersectingTextualNotationBuilder.cs | 1 + .../InvariantTextualNotationBuilder.cs | 10 +- ...ocationExpressionTextualNotationBuilder.cs | 21 +- .../ItemDefinitionTextualNotationBuilder.cs | 1 + .../ItemUsageTextualNotationBuilder.cs | 1 + .../JoinNodeTextualNotationBuilder.cs | 1 + .../LibraryPackageTextualNotationBuilder.cs | 10 +- .../LiteralBooleanTextualNotationBuilder.cs | 1 + ...LiteralExpressionTextualNotationBuilder.cs | 1 + .../LiteralInfinityTextualNotationBuilder.cs | 1 + .../LiteralIntegerTextualNotationBuilder.cs | 1 + .../LiteralStringTextualNotationBuilder.cs | 1 + .../MembershipExposeTextualNotationBuilder.cs | 1 + .../MembershipImportTextualNotationBuilder.cs | 2 + .../MembershipTextualNotationBuilder.cs | 4 + .../MergeNodeTextualNotationBuilder.cs | 1 + .../MetaclassTextualNotationBuilder.cs | 1 + ...aAccessExpressionTextualNotationBuilder.cs | 9 +- ...etadataDefinitionTextualNotationBuilder.cs | 2 + .../MetadataFeatureTextualNotationBuilder.cs | 40 +- .../MetadataUsageTextualNotationBuilder.cs | 31 +- ...MultiplicityRangeTextualNotationBuilder.cs | 19 +- .../MultiplicityTextualNotationBuilder.cs | 1 + .../NamespaceExposeTextualNotationBuilder.cs | 1 + .../NamespaceImportTextualNotationBuilder.cs | 1 + .../NamespaceTextualNotationBuilder.cs | 10 +- .../NullExpressionTextualNotationBuilder.cs | 1 + ...jectiveMembershipTextualNotationBuilder.cs | 5 +- ...urrenceDefinitionTextualNotationBuilder.cs | 11 +- .../OccurrenceUsageTextualNotationBuilder.cs | 6 + ...peratorExpressionTextualNotationBuilder.cs | 84 +++-- .../OwningMembershipTextualNotationBuilder.cs | 57 ++- .../PackageTextualNotationBuilder.cs | 21 +- ...rameterMembershipTextualNotationBuilder.cs | 41 +- .../PartDefinitionTextualNotationBuilder.cs | 1 + .../PartUsageTextualNotationBuilder.cs | 1 + .../PayloadFeatureTextualNotationBuilder.cs | 1 + ...erformActionUsageTextualNotationBuilder.cs | 10 + .../PortConjugationTextualNotationBuilder.cs | 1 + .../PortDefinitionTextualNotationBuilder.cs | 5 +- .../PortUsageTextualNotationBuilder.cs | 12 +- .../PortionKindTextualNotationBuilder.cs | 1 + .../PredicateTextualNotationBuilder.cs | 1 + .../RedefinitionTextualNotationBuilder.cs | 8 + ...ferenceSubsettingTextualNotationBuilder.cs | 1 + .../ReferenceUsageTextualNotationBuilder.cs | 44 ++- .../RelationshipTextualNotationBuilder.cs | 1 + ...nderingDefinitionTextualNotationBuilder.cs | 1 + .../RenderingUsageTextualNotationBuilder.cs | 1 + ...straintMembershipTextualNotationBuilder.cs | 5 +- ...irementDefinitionTextualNotationBuilder.cs | 1 + .../RequirementUsageTextualNotationBuilder.cs | 1 + ...icationMembershipTextualNotationBuilder.cs | 5 +- ...ressionMembershipTextualNotationBuilder.cs | 5 +- ...rameterMembershipTextualNotationBuilder.cs | 17 +- ...yRequirementUsageTextualNotationBuilder.cs | 8 +- .../SelectExpressionTextualNotationBuilder.cs | 8 +- .../SendActionUsageTextualNotationBuilder.cs | 14 +- .../SpecializationTextualNotationBuilder.cs | 8 + ...eholderMembershipTextualNotationBuilder.cs | 5 +- .../StateDefinitionTextualNotationBuilder.cs | 1 + ...bactionMembershipTextualNotationBuilder.cs | 13 +- .../StateUsageTextualNotationBuilder.cs | 1 + .../StepTextualNotationBuilder.cs | 10 +- .../StructureTextualNotationBuilder.cs | 1 + ...SubclassificationTextualNotationBuilder.cs | 8 + ...SubjectMembershipTextualNotationBuilder.cs | 9 +- .../SubsettingTextualNotationBuilder.cs | 8 + ...SuccessionAsUsageTextualNotationBuilder.cs | 26 +- .../SuccessionFlowTextualNotationBuilder.cs | 10 +- ...ccessionFlowUsageTextualNotationBuilder.cs | 1 + .../SuccessionTextualNotationBuilder.cs | 17 +- ...minateActionUsageTextualNotationBuilder.cs | 7 +- ...ualRepresentationTextualNotationBuilder.cs | 8 + ...FeatureMembershipTextualNotationBuilder.cs | 13 +- .../TransitionUsageTextualNotationBuilder.cs | 78 +++- ...ocationExpressionTextualNotationBuilder.cs | 1 + .../TypeFeaturingTextualNotationBuilder.cs | 8 + .../TypeTextualNotationBuilder.cs | 105 ++++-- .../UnioningTextualNotationBuilder.cs | 1 + .../UsageTextualNotationBuilder.cs | 15 +- ...UseCaseDefinitionTextualNotationBuilder.cs | 1 + .../UseCaseUsageTextualNotationBuilder.cs | 1 + ...VariantMembershipTextualNotationBuilder.cs | 5 +- ...ionCaseDefinitionTextualNotationBuilder.cs | 1 + ...ficationCaseUsageTextualNotationBuilder.cs | 1 + .../ViewDefinitionTextualNotationBuilder.cs | 1 + ...nderingMembershipTextualNotationBuilder.cs | 5 +- .../ViewUsageTextualNotationBuilder.cs | 1 + ...ewpointDefinitionTextualNotationBuilder.cs | 1 + .../ViewpointUsageTextualNotationBuilder.cs | 1 + .../VisibilityKindTextualNotationBuilder.cs | 1 + ...leLoopActionUsageTextualNotationBuilder.cs | 10 +- ...gConnectorAsUsageTextualNotationBuilder.cs | 40 ++ .../CommentTextualNotationBuilder.cs | 40 ++ .../ConjugationTextualNotationBuilder.cs | 40 ++ .../DependencyTextualNotationBuilder.cs | 40 ++ .../DisjoiningTextualNotationBuilder.cs | 40 ++ .../FeatureInvertingTextualNotationBuilder.cs | 40 ++ .../IfActionUsageTextualNotationBuilder.cs | 40 ++ ...ocationExpressionTextualNotationBuilder.cs | 41 ++ .../MetadataFeatureTextualNotationBuilder.cs | 40 ++ .../MetadataUsageTextualNotationBuilder.cs | 40 ++ .../PackageTextualNotationBuilder.cs | 41 ++ ...erformActionUsageTextualNotationBuilder.cs | 40 ++ .../RedefinitionTextualNotationBuilder.cs | 40 ++ .../SendActionUsageTextualNotationBuilder.cs | 40 ++ .../SpecializationTextualNotationBuilder.cs | 40 ++ ...SubclassificationTextualNotationBuilder.cs | 40 ++ .../SubsettingTextualNotationBuilder.cs | 40 ++ ...SuccessionAsUsageTextualNotationBuilder.cs | 40 ++ ...ualRepresentationTextualNotationBuilder.cs | 40 ++ .../TransitionUsageTextualNotationBuilder.cs | 50 +++ .../TypeFeaturingTextualNotationBuilder.cs | 40 ++ 205 files changed, 2698 insertions(+), 477 deletions(-) create mode 100644 SysML2.NET.CodeGenerator/Grammar/Model/IPartOfTextualRule.cs create mode 100644 SysML2.NET/TextualNotation/AcceptActionUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/ActionUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AssignmentActionUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/BindingConnectorAsUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/CommentTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/ConjugationTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/DependencyTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/DisjoiningTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/FeatureInvertingTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/IfActionUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/InvocationExpressionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/MetadataFeatureTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/MetadataUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/PackageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/PerformActionUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/RedefinitionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/SendActionUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/SpecializationTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/SubclassificationTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/SubsettingTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/SuccessionAsUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/TextualRepresentationTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/TransitionUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/TypeFeaturingTextualNotationBuilder.cs diff --git a/SysML2.NET.CodeGenerator/Extensions/PropertyExtension.cs b/SysML2.NET.CodeGenerator/Extensions/PropertyExtension.cs index b8c13754..c56b1937 100644 --- a/SysML2.NET.CodeGenerator/Extensions/PropertyExtension.cs +++ b/SysML2.NET.CodeGenerator/Extensions/PropertyExtension.cs @@ -105,7 +105,7 @@ public static string QueryIfStatementContentForNonEmpty(this IProperty property, if (property.QueryIsEnumerable()) { - return $"{variableName}.{propertyName}.Count != 0"; + return $"{variableName}.MoveNext()"; } if (property.QueryIsReferenceProperty()) diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/Alternatives.cs b/SysML2.NET.CodeGenerator/Grammar/Model/Alternatives.cs index 7ea1b61d..ff3ba663 100644 --- a/SysML2.NET.CodeGenerator/Grammar/Model/Alternatives.cs +++ b/SysML2.NET.CodeGenerator/Grammar/Model/Alternatives.cs @@ -18,20 +18,23 @@ // // ------------------------------------------------------------------------------------------------ -namespace SysML2.NET.CodeGenerator.Grammar +namespace SysML2.NET.CodeGenerator.Grammar.Model { using System.Collections.Generic; - using SysML2.NET.CodeGenerator.Grammar.Model; - /// /// Provides mapping data class for the alternative grammar part /// - public class Alternatives + 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/IPartOfTextualRule.cs b/SysML2.NET.CodeGenerator/Grammar/Model/IPartOfTextualRule.cs new file mode 100644 index 00000000..c47436d8 --- /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/RuleElement.cs b/SysML2.NET.CodeGenerator/Grammar/Model/RuleElement.cs index c7858dfb..dc937d23 100644 --- a/SysML2.NET.CodeGenerator/Grammar/Model/RuleElement.cs +++ b/SysML2.NET.CodeGenerator/Grammar/Model/RuleElement.cs @@ -25,7 +25,7 @@ namespace SysML2.NET.CodeGenerator.Grammar.Model /// /// Base class that provides information about element that is part of a rule /// - public abstract class RuleElement + public abstract class RuleElement: IPartOfTextualRule { /// /// Defines all suffix that defines optional elements @@ -51,5 +51,15 @@ public abstract class RuleElement /// 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/TextualNotationSpecificationVisitor.cs b/SysML2.NET.CodeGenerator/Grammar/TextualNotationSpecificationVisitor.cs index aeeeb1b8..2a17f4dd 100644 --- a/SysML2.NET.CodeGenerator/Grammar/TextualNotationSpecificationVisitor.cs +++ b/SysML2.NET.CodeGenerator/Grammar/TextualNotationSpecificationVisitor.cs @@ -56,6 +56,8 @@ public override object VisitRule_definition(kebnfParser.Rule_definitionContext c TargetElementName = context.target_ast?.Text, RawRule = context.GetText().Trim() }; + + this.CurrentRule = rule; if (string.IsNullOrWhiteSpace(rule.RuleName)) { @@ -74,7 +76,12 @@ public override object VisitRule_definition(kebnfParser.Rule_definitionContext c 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 . /// @@ -92,7 +99,11 @@ public override object VisitAlternatives(kebnfParser.AlternativesContext context /// The visitor result, as an . public override object VisitAlternative(kebnfParser.AlternativeContext context) { - var alternatives = new Alternatives(); + var alternatives = new Alternatives() + { + TextualNotationRule = this.CurrentRule + }; + alternatives.Elements.AddRange(context.element().Select(e => (RuleElement)this.Visit(e)).Where(x => x != null)); return alternatives; } @@ -104,14 +115,18 @@ public override object VisitAlternative(kebnfParser.AlternativeContext context) /// The visitor result, as . public override object VisitAssignment(kebnfParser.AssignmentContext context) { - return new AssignmentElement() + 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 + Prefix = context.prefix?.Text, + TextualNotationRule = this.CurrentRule }; + + assignement.Value.Container = assignement; + return assignement; } /// @@ -125,7 +140,8 @@ public override object VisitNon_parsing_assignment(kebnfParser.Non_parsing_assig { PropertyName = context.property.GetText(), Operator = context.op.Text, - Value = context.val.GetText() + Value = context.val.GetText(), + TextualNotationRule = this.CurrentRule }; } @@ -138,7 +154,8 @@ public override object VisitValue_literal(kebnfParser.Value_literalContext conte { return new ValueLiteralElement() { - Value = context.GetText() + Value = context.GetText(), + TextualNotationRule = this.CurrentRule }; } @@ -152,10 +169,16 @@ 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; } @@ -169,7 +192,8 @@ public override object VisitTerminal(kebnfParser.TerminalContext context) return new TerminalElement() { Value = context.val.Text.Trim('\''), - Suffix = context.suffix?.GetText() + Suffix = context.suffix?.GetText(), + TextualNotationRule = this.CurrentRule }; } @@ -183,7 +207,8 @@ public override object VisitNon_terminal(kebnfParser.Non_terminalContext context return new NonTerminalElement() { Name = context.name.Text, - Suffix = context.suffix?.GetText() + Suffix = context.suffix?.GetText(), + TextualNotationRule = this.CurrentRule }; } } diff --git a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs index 4e491089..55b4ae0b 100644 --- a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs +++ b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs @@ -30,6 +30,7 @@ namespace SysML2.NET.CodeGenerator.HandleBarHelpers using SysML2.NET.CodeGenerator.Grammar; using SysML2.NET.CodeGenerator.Grammar.Model; + using uml4net.Classification; using uml4net.CommonStructure; using uml4net.Extensions; using uml4net.StructuredClassifiers; @@ -69,7 +70,7 @@ public static void RegisterRulesHelper(this IHandlebars handlebars) if (namedElement is IClass umlClass) { - ProcessAlternatives(writer, umlClass, textualRule.Alternatives, allRules); + ProcessAlternatives(writer, umlClass, textualRule.Alternatives, allRules, definedIterators: null); } }); } @@ -81,25 +82,46 @@ public static void RegisterRulesHelper(this IHandlebars handlebars) /// The related /// The collection of alternatives to process /// A collection of all existing rules - /// - private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClass, IReadOnlyCollection alternatives, IReadOnlyCollection rules, bool callerElementIsOptional = false) + /// Collection of that keep tracks of defined iterator + /// An optional that is calling this function + private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClass, IReadOnlyCollection alternatives, + IReadOnlyCollection rules, List definedIterators, RuleElement callerElement = null) { + definedIterators ??= []; + if (alternatives.Count == 1) { - var elements = alternatives.ElementAt(0).Elements; + var alternative = alternatives.ElementAt(0); + var elements = alternative.Elements; + DeclareAllRequiredIterators(writer, umlClass, rules, alternative, definedIterators); - if (callerElementIsOptional) + if (callerElement is { IsOptional: true, IsCollection: false }) { var targetPropertiesName = elements.OfType().Select(x => x.Property).Distinct().ToList(); - + var allProperties = umlClass.QueryAllProperties(); + if (targetPropertiesName.Count > 0) { - var allProperties = umlClass.QueryAllProperties(); + writer.WriteSafeString(Environment.NewLine); writer.WriteSafeString("if("); - var ifStatementContent = targetPropertiesName - .Select(propertyName => allProperties.SingleOrDefault(x => string.Equals(x.Name, propertyName, StringComparison.OrdinalIgnoreCase))) - .Select(matchedProperty => matchedProperty.QueryIfStatementContentForNonEmpty("poco")).ToList(); + 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 = 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}"); @@ -107,18 +129,27 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas foreach (var textualRuleElement in elements) { - ProcessRuleElement(writer, umlClass, rules, textualRuleElement); + ProcessRuleElement(writer, umlClass, rules, textualRuleElement, definedIterators); } - - writer.WriteSafeString($"stringBuilder.Append(' ');{Environment.NewLine}"); - writer.WriteSafeString($"}}{Environment.NewLine}"); } + 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, rules, textualRuleElement, definedIterators); + } + } + + writer.WriteSafeString($"}}{Environment.NewLine}"); } else { foreach (var textualRuleElement in elements) { - ProcessRuleElement(writer, umlClass, rules, textualRuleElement); + ProcessRuleElement(writer, umlClass, rules, textualRuleElement, definedIterators); } } } @@ -128,6 +159,37 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas } } + /// + /// Declares all required iterator for all present inside an + /// + /// The used to write into output content + /// The related + /// A collection of all existing rules + /// The to process + /// Collection of that keep tracks of defined iterator + private static void DeclareAllRequiredIterators(EncodedTextWriter writer, IClass umlClass, IReadOnlyCollection rules, Alternatives alternatives, List definedIterators) + { + foreach (var ruleElement in alternatives.Elements) + { + switch (ruleElement) + { + case AssignmentElement { Value: NonTerminalElement } assignmentElement: + DeclareIteratorIfRequired(writer, umlClass, rules, assignmentElement, definedIterators); + break; + case AssignmentElement { Value: GroupElement } assignmentElement: + DeclareIteratorIfRequired(writer, umlClass, rules, assignmentElement, definedIterators); + break; + case GroupElement groupElement: + foreach (var groupElementAlternative in groupElement.Alternatives) + { + DeclareAllRequiredIterators(writer, umlClass, rules, groupElementAlternative, definedIterators); + } + + break; + } + } + } + /// /// Processes a /// @@ -135,54 +197,53 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas /// The related /// A collection of all existing rules /// The to process + /// Collection of that keep tracks of defined iterator /// If the type of the is not supported - private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass, IReadOnlyCollection rules, RuleElement textualRuleElement) + private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass, IReadOnlyCollection rules, RuleElement textualRuleElement, List definedIterators) { switch (textualRuleElement) { case TerminalElement terminalElement: var valueToAdd = terminalElement.Value; - if (valueToAdd.Length > 1) + if (valueToAdd!="<" && valueToAdd!=">") { - valueToAdd += ' '; + if (valueToAdd == "=") + { + valueToAdd = $" {valueToAdd} "; + } + else + { + valueToAdd += ' '; + } } writer.WriteSafeString($"stringBuilder.Append(\"{valueToAdd}\");"); break; case NonTerminalElement nonTerminalElement: - var referencedRule = rules.Single(x => x.RuleName == nonTerminalElement.Name); - var typeTarget = referencedRule.TargetElementName ?? referencedRule.RuleName; - - if (typeTarget != umlClass.Name) + ProcessNonTerminalElement(writer, umlClass, rules, definedIterators, nonTerminalElement, "poco"); + + break; + case GroupElement groupElement: + if (groupElement.IsCollection) { - var targetType = umlClass.Cache.Values.OfType().SingleOrDefault(x => x.Name == typeTarget); - - if (targetType != null) - { - if (targetType is IClass targetClass && umlClass.QueryAllGeneralClassifiers().Contains(targetClass)) - { - writer.WriteSafeString($"{targetType.Name}TextualNotationBuilder.Build{referencedRule.RuleName}(poco, stringBuilder);"); - } - else - { - ProcessAlternatives(writer, umlClass, referencedRule.Alternatives, rules); - } - } - else + var assignmentRule = groupElement.Alternatives.SelectMany(x => x.Elements).FirstOrDefault(x => x is AssignmentElement { Value: NonTerminalElement }); + + if (assignmentRule is AssignmentElement assignmentElement) { - ProcessAlternatives(writer, umlClass, referencedRule.Alternatives, rules); + var iteratorToUse = 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, rules, definedIterators, groupElement); + writer.WriteSafeString($"{Environment.NewLine}}}"); } else { - writer.WriteSafeString($"Build{referencedRule.RuleName}(poco, stringBuilder);"); + ProcessAlternatives(writer, umlClass, groupElement.Alternatives, rules,definedIterators, groupElement); } - break; - case GroupElement groupElement: - ProcessAlternatives(writer, umlClass, groupElement.Alternatives, rules, groupElement.IsOptional); - if (!groupElement.IsOptional) { writer.WriteSafeString($"{Environment.NewLine}stringBuilder.Append(' ');"); @@ -197,7 +258,21 @@ private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass { if (targetProperty.QueryIsEnumerable()) { - writer.WriteSafeString("throw new System.NotSupportedException(\"Assigment of enumerable not supported yet\");"); + if (assignmentElement.Value is NonTerminalElement nonTerminalElement) + { + var iteratorToUse = 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, rules, definedIterators, nonTerminalElement, $"{iteratorToUse.IteratorVariableName}.Current"); + } + else + { + writer.WriteSafeString("throw new System.NotSupportedException(\"Assigment of enumerable with non NonTerminalElement not supported yet\");"); + } } else { @@ -205,7 +280,6 @@ private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass { writer.WriteSafeString($"{Environment.NewLine}if({targetProperty.QueryIfStatementContentForNonEmpty("poco")}){Environment.NewLine}"); writer.WriteSafeString($"{{{Environment.NewLine}"); - writer.WriteSafeString($"{Environment.NewLine}"); writer.WriteSafeString($"stringBuilder.Append(poco.{targetProperty.Name.CapitalizeFirstLetter()});{Environment.NewLine}"); writer.WriteSafeString("}}"); } @@ -255,5 +329,198 @@ private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass writer.WriteSafeString(Environment.NewLine); } + + /// + /// Process a + /// + /// The used to write into output content + /// The related + /// A collection of all existing rules + /// The to process + /// Collection of that keep tracks of defined iterator + /// The name of the variable that should be used to call the non-terminal method + private static void ProcessNonTerminalElement(EncodedTextWriter writer, IClass umlClass, IReadOnlyCollection rules, List definedIterators, NonTerminalElement nonTerminalElement, string variableName) + { + var referencedRule = rules.SingleOrDefault(x => x.RuleName == nonTerminalElement.Name); + + string typeTarget; + + if (referencedRule == null) + { + typeTarget = umlClass.Name; + } + else + { + typeTarget = referencedRule.TargetElementName ?? referencedRule.RuleName; + } + + if (typeTarget != umlClass.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 != "poco")) + { + writer.WriteSafeString($"{targetType.Name}TextualNotationBuilder.Build{nonTerminalElement.Name}({variableName}, stringBuilder);"); + } + else + { + ProcessAlternatives(writer, umlClass, referencedRule!.Alternatives, rules, definedIterators); + } + } + else + { + ProcessAlternatives(writer, umlClass, referencedRule!.Alternatives, rules, definedIterators); + } + } + else + { + writer.WriteSafeString($"Build{ nonTerminalElement.Name}({variableName}, stringBuilder);"); + } + } + + /// + /// Declares an iterator to perform iteration over a collection, if required to declare it + /// + /// The used to write into output content + /// The related + /// A collection of all existing rules + /// The to process + /// Collection of that keep tracks of defined iterator + private static void DeclareIteratorIfRequired(EncodedTextWriter writer, IClass umlClass, IReadOnlyCollection rules, AssignmentElement assignmentElement, List definedIterators) + { + 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, rules, assignment, definedIterators); + } + } + + if (assignmentElement.Value is not NonTerminalElement nonTerminalElement) + { + return; + } + + var referencedRule = rules.SingleOrDefault(x => x.RuleName == nonTerminalElement.Name); + + if (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); + 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); + } + } } } 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 index ae78deaf..c92a1ed1 100644 --- a/SysML2.NET.CodeGenerator/Templates/Uml/core-textual-notation-builder-template.hbs +++ b/SysML2.NET.CodeGenerator/Templates/Uml/core-textual-notation-builder-template.hbs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AcceptActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AcceptActionUsageTextualNotationBuilder.cs new file mode 100644 index 00000000..c48d60bd --- /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 false; + } + } +} diff --git a/SysML2.NET/TextualNotation/ActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/ActionUsageTextualNotationBuilder.cs new file mode 100644 index 00000000..a35780dd --- /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 false; + } + + /// + /// Builds the conditional part for the AssignmentNodeDeclaration rule + /// + /// The + /// The assertion of the condition + private static bool BuildGroupConditionForAssignmentNodeDeclaration(IActionUsage poco) + { + return false; + } + } +} diff --git a/SysML2.NET/TextualNotation/AssignmentActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AssignmentActionUsageTextualNotationBuilder.cs new file mode 100644 index 00000000..cd8d98ae --- /dev/null +++ b/SysML2.NET/TextualNotation/AssignmentActionUsageTextualNotationBuilder.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 AssignmentActionUsageTextualNotationBuilder + { + /// + /// Builds the conditional part for the TransitionAssignmentActionUsage rule + /// + /// The + /// The assertion of the condition + private static bool BuildGroupConditionForTransitionAssignmentActionUsage(IAssignmentActionUsage poco) + { + return false; + } + } +} diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.cs index 97d150b1..35b56867 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.cs @@ -24,9 +24,11 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; + using SysML2.NET.Core.POCO.Systems.Actions; /// /// The provides Textual Notation Builder for the element @@ -69,11 +71,14 @@ public static void BuildAcceptNodeDeclaration(SysML2.NET.Core.POCO.Systems.Actio /// The that contains the entire textual notation public static void BuildAcceptParameterPart(SysML2.NET.Core.POCO.Systems.Actions.IAcceptActionUsage poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - if (poco.OwnedRelationship.Count != 0) + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + ParameterMembershipTextualNotationBuilder.BuildPayloadParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.MoveNext()) { stringBuilder.Append("via "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); stringBuilder.Append(' '); } @@ -115,6 +120,14 @@ public static void BuildTransitionAcceptActionUsage(SysML2.NET.Core.POCO.Systems { BuildAcceptNodeDeclaration(poco, stringBuilder); + if (BuildGroupConditionForTransitionAcceptActionUsage(poco)) + { + stringBuilder.Append("{"); + TypeTextualNotationBuilder.BuildActionBodyItem(poco, stringBuilder); + stringBuilder.Append("}"); + stringBuilder.Append(' '); + } + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionDefinitionTextualNotationBuilder.cs index 395ed8bb..c92602c5 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionDefinitionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs index 4b0a2f36..9f1f9a01 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -91,12 +92,23 @@ public static void BuildActionNodePrefix(SysML2.NET.Core.POCO.Systems.Actions.IA /// 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 "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + ParameterMembershipTextualNotationBuilder.BuildAssignmentTargetMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + ownedRelationshipOfMembershipIterator.MoveNext(); + MembershipTextualNotationBuilder.BuildFeatureChainMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); stringBuilder.Append(":= "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); } @@ -109,6 +121,13 @@ public static void BuildAssignmentNodeDeclaration(SysML2.NET.Core.POCO.Systems.A 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("}"); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActorMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActorMembershipTextualNotationBuilder.cs index 5e0d05e6..9472be9f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActorMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActorMembershipTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,8 +42,10 @@ public static partial class ActorMembershipTextualNotationBuilder /// 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); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfPartUsageIterator.MoveNext(); + PartUsageTextualNotationBuilder.BuildActorUsage(ownedRelatedElementOfPartUsageIterator.Current, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationDefinitionTextualNotationBuilder.cs index 301b2089..ff58ecec 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationDefinitionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationUsageTextualNotationBuilder.cs index 14776059..650f7ef7 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseDefinitionTextualNotationBuilder.cs index cd54c4a4..cfca3f93 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseDefinitionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseUsageTextualNotationBuilder.cs index 4fafd028..1d0f4015 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotatingElementTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotatingElementTextualNotationBuilder.cs index 177e3ddc..d3b6c1d1 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotatingElementTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotatingElementTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.cs index 2951e78c..90508df7 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,7 +42,9 @@ public static partial class AnnotationTextualNotationBuilder /// The that contains the entire textual notation public static void BuildOwnedAnnotation(SysML2.NET.Core.POCO.Root.Annotations.IAnnotation poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelatedElementOfAnnotatingElementIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfAnnotatingElementIterator.MoveNext(); + AnnotatingElementTextualNotationBuilder.BuildAnnotatingElement(ownedRelatedElementOfAnnotatingElementIterator.Current, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssertConstraintUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssertConstraintUsageTextualNotationBuilder.cs index f6b12595..f21db1ea 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssertConstraintUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssertConstraintUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,8 +42,10 @@ public static partial class AssertConstraintUsageTextualNotationBuilder /// 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"); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssignmentActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssignmentActionUsageTextualNotationBuilder.cs index 85486415..069d63a8 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssignmentActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssignmentActionUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -70,6 +71,14 @@ public static void BuildTransitionAssignmentActionUsage(SysML2.NET.Core.POCO.Sys { ActionUsageTextualNotationBuilder.BuildAssignmentNodeDeclaration(poco, stringBuilder); + if (BuildGroupConditionForTransitionAssignmentActionUsage(poco)) + { + stringBuilder.Append("{"); + TypeTextualNotationBuilder.BuildActionBodyItem(poco, stringBuilder); + stringBuilder.Append("}"); + stringBuilder.Append(' '); + } + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationStructureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationStructureTextualNotationBuilder.cs index accee2d9..ff949da0 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationStructureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationStructureTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationTextualNotationBuilder.cs index e011b18c..c9c173a3 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeDefinitionTextualNotationBuilder.cs index 17a490ee..5f2260a7 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeDefinitionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeUsageTextualNotationBuilder.cs index 3e056fa8..1be2d1f5 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BehaviorTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BehaviorTextualNotationBuilder.cs index 6295f00f..11522991 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BehaviorTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BehaviorTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorAsUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorAsUsageTextualNotationBuilder.cs index 4dc6ef8a..86768557 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorAsUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorAsUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,12 +42,22 @@ public static partial class BindingConnectorAsUsageTextualNotationBuilder /// 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 "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); stringBuilder.Append("="); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); UsageTextualNotationBuilder.BuildUsageBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorTextualNotationBuilder.cs index 9930b1a7..b72eaa90 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -52,14 +53,15 @@ public static void BuildBindingConnectorDeclaration(SysML2.NET.Core.POCO.Kernel. /// 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(' '); - if (poco.OwnedRelationship.Count != 0) + + while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - stringBuilder.Append(' '); - } + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } stringBuilder.Append("binding "); BuildBindingConnectorDeclaration(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BooleanExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BooleanExpressionTextualNotationBuilder.cs index a598712e..ab61cf40 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BooleanExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BooleanExpressionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,14 +42,15 @@ public static partial class BooleanExpressionTextualNotationBuilder /// 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(' '); - if (poco.OwnedRelationship.Count != 0) + + while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - stringBuilder.Append(' '); - } + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } stringBuilder.Append("bool "); FeatureTextualNotationBuilder.BuildFeatureDeclaration(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationDefinitionTextualNotationBuilder.cs index aa7d25b3..8195eecc 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationDefinitionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationUsageTextualNotationBuilder.cs index ed4e98cd..72a021ce 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseDefinitionTextualNotationBuilder.cs index f2ff8064..4a6f2971 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseDefinitionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseUsageTextualNotationBuilder.cs index fe3a5447..00ef1b6b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassTextualNotationBuilder.cs index 949a875d..4abead85 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs index 557158ec..d5b3cf56 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,15 +42,17 @@ public static partial class ClassifierTextualNotationBuilder /// 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"); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - if (poco.OwnedRelationship.Count != 0) + ownedRelationshipOfSubclassificationIterator.MoveNext(); + SubclassificationTextualNotationBuilder.BuildOwnedSubclassification(ownedRelationshipOfSubclassificationIterator.Current, stringBuilder); + + while (ownedRelationshipOfSubclassificationIterator.MoveNext()) { stringBuilder.Append(","); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - stringBuilder.Append(' '); - } + SubclassificationTextualNotationBuilder.BuildOwnedSubclassification(ownedRelationshipOfSubclassificationIterator.Current, stringBuilder); + } } @@ -61,6 +64,8 @@ public static void BuildSubclassificationPart(SysML2.NET.Core.POCO.Core.Classifi /// 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"); @@ -68,9 +73,10 @@ public static void BuildClassifierDeclaration(SysML2.NET.Core.POCO.Core.Classifi } ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); - if (poco.OwnedRelationship.Count != 0) + + if (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + OwningMembershipTextualNotationBuilder.BuildOwnedMultiplicity(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); stringBuilder.Append(' '); } @@ -87,15 +93,17 @@ public static void BuildClassifierDeclaration(SysML2.NET.Core.POCO.Core.Classifi /// 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"); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - if (poco.OwnedRelationship.Count != 0) + ownedRelationshipOfSubclassificationIterator.MoveNext(); + SubclassificationTextualNotationBuilder.BuildOwnedSubclassification(ownedRelationshipOfSubclassificationIterator.Current, stringBuilder); + + while (ownedRelationshipOfSubclassificationIterator.MoveNext()) { stringBuilder.Append(","); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - stringBuilder.Append(' '); - } + SubclassificationTextualNotationBuilder.BuildOwnedSubclassification(ownedRelationshipOfSubclassificationIterator.Current, stringBuilder); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CollectExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CollectExpressionTextualNotationBuilder.cs index 041e9a65..f15cb1ba 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CollectExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CollectExpressionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,9 +42,12 @@ public static partial class CollectExpressionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildCollectExpression(SysML2.NET.Core.POCO.Kernel.Expressions.ICollectExpression poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + ParameterMembershipTextualNotationBuilder.BuildPrimaryArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); stringBuilder.Append("."); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + ParameterMembershipTextualNotationBuilder.BuildBodyArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CommentTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CommentTextualNotationBuilder.cs index fcd0f63b..3296b9e0 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CommentTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CommentTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,6 +42,30 @@ public static partial class CommentTextualNotationBuilder /// 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 "); + AnnotationTextualNotationBuilder.BuildAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + + while (ownedRelationshipOfAnnotationIterator.MoveNext()) + { + stringBuilder.Append(","); + AnnotationTextualNotationBuilder.BuildAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + + } + stringBuilder.Append(' '); + } + + stringBuilder.Append(' '); + } + if (!string.IsNullOrWhiteSpace(poco.Locale)) { diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernDefinitionTextualNotationBuilder.cs index 30b698bc..3fefd30c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernDefinitionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernUsageTextualNotationBuilder.cs index 468db14d..993889c7 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortDefinitionTextualNotationBuilder.cs index c28e844a..e2de57b1 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortDefinitionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,7 +42,9 @@ public static partial class ConjugatedPortDefinitionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildConjugatedPortDefinition(SysML2.NET.Core.POCO.Systems.Ports.IConjugatedPortDefinition poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfPortConjugationIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfPortConjugationIterator.MoveNext(); + PortConjugationTextualNotationBuilder.BuildPortConjugation(ownedRelationshipOfPortConjugationIterator.Current, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortTypingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortTypingTextualNotationBuilder.cs index 14b4483e..6ca6cc1f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortTypingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortTypingTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugationTextualNotationBuilder.cs index 17a48209..5868a148 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugationTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -53,6 +54,13 @@ public static void BuildOwnedConjugation(SysML2.NET.Core.POCO.Core.Types.IConjug 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(' '); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionDefinitionTextualNotationBuilder.cs index 940a3494..5d1fcc6d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionDefinitionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs index 3b9224f6..5a60fe85 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -52,9 +53,12 @@ public static void BuildConnectorPart(SysML2.NET.Core.POCO.Systems.Connections.I /// The that contains the entire textual notation public static void BuildBinaryConnectorPart(SysML2.NET.Core.POCO.Systems.Connections.IConnectionUsage poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfEndFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); stringBuilder.Append("to "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); } @@ -66,17 +70,20 @@ public static void BuildBinaryConnectorPart(SysML2.NET.Core.POCO.Systems.Connect /// 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("("); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); stringBuilder.Append(","); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - if (poco.OwnedRelationship.Count != 0) + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + + while (ownedRelationshipOfEndFeatureMembershipIterator.MoveNext()) { stringBuilder.Append(","); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - stringBuilder.Append(' '); - } + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } stringBuilder.Append(")"); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs index ebae891a..a72e8e63 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -52,10 +53,13 @@ public static void BuildConnectorDeclaration(SysML2.NET.Core.POCO.Kernel.Connect /// 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"); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); stringBuilder.Append("to "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); } @@ -67,18 +71,21 @@ public static void BuildBinaryConnectorDeclaration(SysML2.NET.Core.POCO.Kernel.C /// 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("("); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); stringBuilder.Append(","); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - if (poco.OwnedRelationship.Count != 0) + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + + while (ownedRelationshipOfEndFeatureMembershipIterator.MoveNext()) { stringBuilder.Append(","); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - stringBuilder.Append(' '); - } + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } stringBuilder.Append(")"); } @@ -91,14 +98,15 @@ public static void BuildNaryConnectorDeclaration(SysML2.NET.Core.POCO.Kernel.Con /// 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(' '); - if (poco.OwnedRelationship.Count != 0) + + while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - stringBuilder.Append(' '); - } + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } stringBuilder.Append("connector "); throw new System.NotSupportedException("Multiple alternatives not implemented yet"); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintDefinitionTextualNotationBuilder.cs index 71d48ba6..e80cb7a2 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintDefinitionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintUsageTextualNotationBuilder.cs index 1fad681d..151ba9f0 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstructorExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstructorExpressionTextualNotationBuilder.cs index 6abf780e..8dd9b4e4 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstructorExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstructorExpressionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,9 +42,13 @@ public static partial class ConstructorExpressionTextualNotationBuilder /// 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 "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfMembershipIterator.MoveNext(); + MembershipTextualNotationBuilder.BuildInstantiatedTypeMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); + ReturnParameterMembershipTextualNotationBuilder.BuildConstructorResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ControlNodeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ControlNodeTextualNotationBuilder.cs index ed69bd4f..64b1f731 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ControlNodeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ControlNodeTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CrossSubsettingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CrossSubsettingTextualNotationBuilder.cs index 3401445a..b64b8cad 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CrossSubsettingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CrossSubsettingTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DataTypeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DataTypeTextualNotationBuilder.cs index 70b3ad2b..ea76f159 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DataTypeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DataTypeTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DecisionNodeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DecisionNodeTextualNotationBuilder.cs index 8fe13732..3f8b633b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DecisionNodeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DecisionNodeTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs index db28a48a..67bf804c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,7 +42,9 @@ public static partial class DefinitionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildDefinitionExtensionKeyword(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IDefinition poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfOwningMembershipIterator.MoveNext(); + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DependencyTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DependencyTextualNotationBuilder.cs index 4f7ecba7..38ba6810 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DependencyTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DependencyTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,31 +42,35 @@ public static partial class DependencyTextualNotationBuilder /// The that contains the entire textual notation public static void BuildDependency(SysML2.NET.Core.POCO.Root.Dependencies.IDependency poco, StringBuilder stringBuilder) { - if (poco.OwnedRelationship.Count != 0) + using var ownedRelationshipOfAnnotationIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + + while (ownedRelationshipOfAnnotationIterator.MoveNext()) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - stringBuilder.Append(' '); - } + AnnotationTextualNotationBuilder.BuildPrefixMetadataAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + } stringBuilder.Append("dependency "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - if (poco.Client.Count != 0) + if (BuildGroupConditionForDependencyDeclaration(poco)) { - stringBuilder.Append(","); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + stringBuilder.Append("from "); stringBuilder.Append(' '); } - stringBuilder.Append("to "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - if (poco.Supplier.Count != 0) + throw new System.NotSupportedException("Assigment of enumerable with non NonTerminalElement not supported yet"); { stringBuilder.Append(","); - throw new System.NotSupportedException("Assigment of enumerable 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); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DifferencingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DifferencingTextualNotationBuilder.cs index bc3d0f48..d45fe372 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DifferencingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DifferencingTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DisjoiningTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DisjoiningTextualNotationBuilder.cs index 115075d1..0202d5b3 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DisjoiningTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DisjoiningTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -53,6 +54,13 @@ public static void BuildOwnedDisjoining(SysML2.NET.Core.POCO.Core.Types.IDisjoin 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(' '); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DocumentationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DocumentationTextualNotationBuilder.cs index 6be88e17..faa8e2ab 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DocumentationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DocumentationTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -43,6 +44,7 @@ public static void BuildDocumentation(SysML2.NET.Core.POCO.Root.Annotations.IDoc { stringBuilder.Append("doc "); ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + if (!string.IsNullOrWhiteSpace(poco.Locale)) { stringBuilder.Append("locale "); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementFilterMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementFilterMembershipTextualNotationBuilder.cs index 514be9fd..ee7f0088 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementFilterMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementFilterMembershipTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,9 +42,11 @@ public static partial class ElementFilterMembershipTextualNotationBuilder /// 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 "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfExpressionIterator.MoveNext(); + ExpressionTextualNotationBuilder.BuildOwnedExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); stringBuilder.Append(";"); } @@ -56,8 +59,10 @@ public static void BuildElementFilterMember(SysML2.NET.Core.POCO.Kernel.Packages /// 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("["); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfExpressionIterator.MoveNext(); + ExpressionTextualNotationBuilder.BuildOwnedExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); stringBuilder.Append("]"); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementTextualNotationBuilder.cs index dc955936..9e720f52 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,6 +42,7 @@ public static partial class ElementTextualNotationBuilder /// 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("<"); @@ -49,6 +51,7 @@ public static void BuildIdentification(SysML2.NET.Core.POCO.Root.Elements.IEleme stringBuilder.Append(' '); } + if (!string.IsNullOrWhiteSpace(poco.DeclaredName)) { stringBuilder.Append(poco.DeclaredName); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EndFeatureMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EndFeatureMembershipTextualNotationBuilder.cs index 42322c13..be3e18f0 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EndFeatureMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EndFeatureMembershipTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,7 +42,9 @@ public static partial class EndFeatureMembershipTextualNotationBuilder /// The that contains the entire textual notation public static void BuildSourceEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfReferenceUsageIterator.MoveNext(); + ReferenceUsageTextualNotationBuilder.BuildSourceEnd(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); } @@ -53,7 +56,9 @@ public static void BuildSourceEndMember(SysML2.NET.Core.POCO.Core.Features.IEndF /// The that contains the entire textual notation public static void BuildConnectorEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfReferenceUsageIterator.MoveNext(); + ReferenceUsageTextualNotationBuilder.BuildConnectorEnd(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); } @@ -65,7 +70,9 @@ public static void BuildConnectorEndMember(SysML2.NET.Core.POCO.Core.Features.IE /// The that contains the entire textual notation public static void BuildInterfaceEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelatedElementOfPortUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfPortUsageIterator.MoveNext(); + PortUsageTextualNotationBuilder.BuildInterfaceEnd(ownedRelatedElementOfPortUsageIterator.Current, stringBuilder); } @@ -77,7 +84,9 @@ public static void BuildInterfaceEndMember(SysML2.NET.Core.POCO.Core.Features.IE /// The that contains the entire textual notation public static void BuildFlowEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelatedElementOfFlowEndIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfFlowEndIterator.MoveNext(); + FlowEndTextualNotationBuilder.BuildFlowEnd(ownedRelatedElementOfFlowEndIterator.Current, stringBuilder); } @@ -89,7 +98,9 @@ public static void BuildFlowEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFea /// The that contains the entire textual notation public static void BuildEmptyEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfReferenceUsageIterator.MoveNext(); + ReferenceUsageTextualNotationBuilder.BuildEmptyFeature(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationDefinitionTextualNotationBuilder.cs index 9262de82..164f20a3 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationDefinitionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationUsageTextualNotationBuilder.cs index be47fe15..9058751c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EventOccurrenceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EventOccurrenceUsageTextualNotationBuilder.cs index b7a87d9f..af4af9bc 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EventOccurrenceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EventOccurrenceUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,7 +42,9 @@ public static partial class EventOccurrenceUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildMessageEvent(SysML2.NET.Core.POCO.Systems.Occurrences.IEventOccurrenceUsage poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfReferenceSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfReferenceSubsettingIterator.MoveNext(); + ReferenceSubsettingTextualNotationBuilder.BuildOwnedReferenceSubsetting(ownedRelationshipOfReferenceSubsettingIterator.Current, stringBuilder); } @@ -53,6 +56,7 @@ public static void BuildMessageEvent(SysML2.NET.Core.POCO.Systems.Occurrences.IE /// 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"); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExhibitStateUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExhibitStateUsageTextualNotationBuilder.cs index af79c05d..6cd6147c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExhibitStateUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExhibitStateUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,6 +42,7 @@ public static partial class ExhibitStateUsageTextualNotationBuilder /// 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"); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExposeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExposeTextualNotationBuilder.cs index cbd7435e..49cd6253 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExposeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExposeTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs index 4ab27346..e162d784 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -99,7 +100,9 @@ public static void BuildSequenceExpressionList(SysML2.NET.Core.POCO.Kernel.Funct /// The that contains the entire textual notation public static void BuildFunctionReference(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfFeatureTypingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureTypingIterator.MoveNext(); + FeatureTypingTextualNotationBuilder.BuildReferenceTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); } @@ -136,14 +139,15 @@ public static void BuildExpressionBody(SysML2.NET.Core.POCO.Kernel.Functions.IEx /// 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(' '); - if (poco.OwnedRelationship.Count != 0) + + while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - stringBuilder.Append(' '); - } + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } stringBuilder.Append("expr "); FeatureTextualNotationBuilder.BuildFeatureDeclaration(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainExpressionTextualNotationBuilder.cs index 6ae602f1..c4e2d667 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainExpressionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,9 +42,13 @@ public static partial class FeatureChainExpressionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildFeatureChainExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureChainExpression poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + ParameterMembershipTextualNotationBuilder.BuildNonFeatureChainPrimaryArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); stringBuilder.Append("."); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfMembershipIterator.MoveNext(); + MembershipTextualNotationBuilder.BuildFeatureChainMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainingTextualNotationBuilder.cs index 4c3aa4b0..4ab2815e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainingTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureDirectionKindTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureDirectionKindTextualNotationBuilder.cs index 0c5a9609..78100323 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureDirectionKindTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureDirectionKindTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureInvertingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureInvertingTextualNotationBuilder.cs index d12324ea..2592aed0 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureInvertingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureInvertingTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -52,6 +53,14 @@ public static void BuildOwnedFeatureInverting(SysML2.NET.Core.POCO.Core.Features /// 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"); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs index 894cc0c0..26010af1 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,8 +42,10 @@ public static partial class FeatureMembershipTextualNotationBuilder /// 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); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfUsageIterator.MoveNext(); + UsageTextualNotationBuilder.BuildNonOccurrenceUsageElement(ownedRelatedElementOfUsageIterator.Current, stringBuilder); } @@ -54,8 +57,10 @@ public static void BuildNonOccurrenceUsageMember(SysML2.NET.Core.POCO.Core.Types /// 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); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfUsageIterator.MoveNext(); + UsageTextualNotationBuilder.BuildOccurrenceUsageElement(ownedRelatedElementOfUsageIterator.Current, stringBuilder); } @@ -67,8 +72,10 @@ public static void BuildOccurrenceUsageMember(SysML2.NET.Core.POCO.Core.Types.IF /// 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); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfUsageIterator.MoveNext(); + UsageTextualNotationBuilder.BuildStructureUsageElement(ownedRelatedElementOfUsageIterator.Current, stringBuilder); } @@ -80,8 +87,10 @@ public static void BuildStructureUsageMember(SysML2.NET.Core.POCO.Core.Types.IFe /// 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); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfUsageIterator.MoveNext(); + UsageTextualNotationBuilder.BuildBehaviorUsageElement(ownedRelatedElementOfUsageIterator.Current, stringBuilder); } @@ -93,8 +102,10 @@ public static void BuildBehaviorUsageMember(SysML2.NET.Core.POCO.Core.Types.IFea /// 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 "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfSuccessionAsUsageIterator.MoveNext(); + SuccessionAsUsageTextualNotationBuilder.BuildSourceSuccession(ownedRelatedElementOfSuccessionAsUsageIterator.Current, stringBuilder); } @@ -106,8 +117,10 @@ public static void BuildSourceSuccessionMember(SysML2.NET.Core.POCO.Core.Types.I /// 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); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfUsageIterator.MoveNext(); + UsageTextualNotationBuilder.BuildInterfaceNonOccurrenceUsageElement(ownedRelatedElementOfUsageIterator.Current, stringBuilder); } @@ -119,8 +132,10 @@ public static void BuildInterfaceNonOccurrenceUsageMember(SysML2.NET.Core.POCO.C /// 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); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfUsageIterator.MoveNext(); + UsageTextualNotationBuilder.BuildInterfaceOccurrenceUsageElement(ownedRelatedElementOfUsageIterator.Current, stringBuilder); } @@ -132,7 +147,9 @@ public static void BuildInterfaceOccurrenceUsageMember(SysML2.NET.Core.POCO.Core /// The that contains the entire textual notation public static void BuildFlowPayloadFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelatedElementOfPayloadFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfPayloadFeatureIterator.MoveNext(); + PayloadFeatureTextualNotationBuilder.BuildFlowPayloadFeature(ownedRelatedElementOfPayloadFeatureIterator.Current, stringBuilder); } @@ -144,7 +161,9 @@ public static void BuildFlowPayloadFeatureMember(SysML2.NET.Core.POCO.Core.Types /// The that contains the entire textual notation public static void BuildFlowFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfReferenceUsageIterator.MoveNext(); + ReferenceUsageTextualNotationBuilder.BuildFlowFeature(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); } @@ -182,8 +201,10 @@ public static void BuildInitialNodeMember(SysML2.NET.Core.POCO.Core.Types.IFeatu /// 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); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfActionUsageIterator.MoveNext(); + ActionUsageTextualNotationBuilder.BuildActionNode(ownedRelatedElementOfActionUsageIterator.Current, stringBuilder); } @@ -195,8 +216,10 @@ public static void BuildActionNodeMember(SysML2.NET.Core.POCO.Core.Types.IFeatur /// 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); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfUsageIterator.MoveNext(); + UsageTextualNotationBuilder.BuildActionTargetSuccession(ownedRelatedElementOfUsageIterator.Current, stringBuilder); } @@ -208,8 +231,10 @@ public static void BuildActionTargetSuccessionMember(SysML2.NET.Core.POCO.Core.T /// 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); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfTransitionUsageIterator.MoveNext(); + TransitionUsageTextualNotationBuilder.BuildGuardedSuccession(ownedRelatedElementOfTransitionUsageIterator.Current, stringBuilder); } @@ -221,7 +246,9 @@ public static void BuildGuardedSuccessionMember(SysML2.NET.Core.POCO.Core.Types. /// The that contains the entire textual notation public static void BuildForVariableDeclarationMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelatedElementOfUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfUsageIterator.MoveNext(); + UsageTextualNotationBuilder.BuildUsageDeclaration(ownedRelatedElementOfUsageIterator.Current, stringBuilder); } @@ -233,6 +260,8 @@ public static void BuildForVariableDeclarationMember(SysML2.NET.Core.POCO.Core.T /// 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(' '); @@ -248,8 +277,10 @@ public static void BuildEntryTransitionMember(SysML2.NET.Core.POCO.Core.Types.IF /// 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); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfTransitionUsageIterator.MoveNext(); + TransitionUsageTextualNotationBuilder.BuildTransitionUsage(ownedRelatedElementOfTransitionUsageIterator.Current, stringBuilder); } @@ -261,8 +292,10 @@ public static void BuildTransitionUsageMember(SysML2.NET.Core.POCO.Core.Types.IF /// 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); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfTransitionUsageIterator.MoveNext(); + TransitionUsageTextualNotationBuilder.BuildTargetTransitionUsage(ownedRelatedElementOfTransitionUsageIterator.Current, stringBuilder); } @@ -286,8 +319,10 @@ public static void BuildMetadataBodyUsageMember(SysML2.NET.Core.POCO.Core.Types. /// 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); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfFeatureIterator.MoveNext(); + FeatureTextualNotationBuilder.BuildFeatureElement(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); } @@ -299,7 +334,9 @@ public static void BuildOwnedFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFeat /// The that contains the entire textual notation public static void BuildOwnedExpressionReferenceMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfFeatureReferenceExpressionIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureReferenceExpressionIterator.MoveNext(); + FeatureReferenceExpressionTextualNotationBuilder.BuildOwnedExpressionReference(ownedRelationshipOfFeatureReferenceExpressionIterator.Current, stringBuilder); } @@ -371,7 +408,9 @@ public static void BuildExpressionBodyMember(SysML2.NET.Core.POCO.Core.Types.IFe /// The that contains the entire textual notation public static void BuildPayloadFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfFeatureIterator.MoveNext(); + FeatureTextualNotationBuilder.BuildPayloadFeature(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureReferenceExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureReferenceExpressionTextualNotationBuilder.cs index 6bcf48cb..bd53ca79 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureReferenceExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureReferenceExpressionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,7 +42,9 @@ public static partial class FeatureReferenceExpressionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildSatisfactionReferenceExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfMembershipIterator.MoveNext(); + MembershipTextualNotationBuilder.BuildFeatureChainMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); } @@ -53,7 +56,9 @@ public static void BuildSatisfactionReferenceExpression(SysML2.NET.Core.POCO.Ker /// The that contains the entire textual notation public static void BuildOwnedExpressionReference(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureMembershipIterator.MoveNext(); + FeatureMembershipTextualNotationBuilder.BuildOwnedExpressionMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); } @@ -65,7 +70,9 @@ public static void BuildOwnedExpressionReference(SysML2.NET.Core.POCO.Kernel.Exp /// The that contains the entire textual notation public static void BuildFunctionReferenceExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureMembershipIterator.MoveNext(); + FeatureMembershipTextualNotationBuilder.BuildFunctionReferenceMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); } @@ -77,8 +84,12 @@ public static void BuildFunctionReferenceExpression(SysML2.NET.Core.POCO.Kernel. /// The that contains the entire textual notation public static void BuildFeatureReferenceExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfMembershipIterator.MoveNext(); + MembershipTextualNotationBuilder.BuildFeatureReferenceMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); } @@ -90,7 +101,9 @@ public static void BuildFeatureReferenceExpression(SysML2.NET.Core.POCO.Kernel.E /// The that contains the entire textual notation public static void BuildBodyExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureMembershipIterator.MoveNext(); + FeatureMembershipTextualNotationBuilder.BuildExpressionBodyMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs index 5915679b..51edd639 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,7 +42,9 @@ public static partial class FeatureTextualNotationBuilder /// The that contains the entire textual notation public static void BuildValuePart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureValueIterator.MoveNext(); + FeatureValueTextualNotationBuilder.BuildFeatureValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); } @@ -75,14 +78,15 @@ public static void BuildFeatureSpecialization(SysML2.NET.Core.POCO.Core.Features /// 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); - if (poco.OwnedRelationship.Count != 0) + + while (ownedRelationshipOfFeatureTypingIterator.MoveNext()) { stringBuilder.Append(","); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - stringBuilder.Append(' '); - } + FeatureTypingTextualNotationBuilder.BuildFeatureTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + } } @@ -94,8 +98,10 @@ public static void BuildTypings(SysML2.NET.Core.POCO.Core.Features.IFeature poco /// 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"); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfFeatureTypingIterator.MoveNext(); + FeatureTypingTextualNotationBuilder.BuildFeatureTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); } @@ -107,14 +113,15 @@ public static void BuildTypedBy(SysML2.NET.Core.POCO.Core.Features.IFeature poco /// 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); - if (poco.OwnedRelationship.Count != 0) + + while (ownedRelationshipOfSubsettingIterator.MoveNext()) { stringBuilder.Append(","); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - stringBuilder.Append(' '); - } + SubsettingTextualNotationBuilder.BuildOwnedSubsetting(ownedRelationshipOfSubsettingIterator.Current, stringBuilder); + } } @@ -126,8 +133,10 @@ public static void BuildSubsettings(SysML2.NET.Core.POCO.Core.Features.IFeature /// 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"); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfSubsettingIterator.MoveNext(); + SubsettingTextualNotationBuilder.BuildOwnedSubsetting(ownedRelationshipOfSubsettingIterator.Current, stringBuilder); } @@ -139,8 +148,10 @@ public static void BuildSubsets(SysML2.NET.Core.POCO.Core.Features.IFeature poco /// 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"); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfReferenceSubsettingIterator.MoveNext(); + ReferenceSubsettingTextualNotationBuilder.BuildOwnedReferenceSubsetting(ownedRelationshipOfReferenceSubsettingIterator.Current, stringBuilder); } @@ -152,8 +163,10 @@ public static void BuildReferences(SysML2.NET.Core.POCO.Core.Features.IFeature p /// 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"); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfCrossSubsettingIterator.MoveNext(); + CrossSubsettingTextualNotationBuilder.BuildOwnedCrossSubsetting(ownedRelationshipOfCrossSubsettingIterator.Current, stringBuilder); } @@ -165,14 +178,15 @@ public static void BuildCrosses(SysML2.NET.Core.POCO.Core.Features.IFeature poco /// 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); - if (poco.OwnedRelationship.Count != 0) + + while (ownedRelationshipOfRedefinitionIterator.MoveNext()) { stringBuilder.Append(","); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - stringBuilder.Append(' '); - } + RedefinitionTextualNotationBuilder.BuildOwnedRedefinition(ownedRelationshipOfRedefinitionIterator.Current, stringBuilder); + } } @@ -184,8 +198,10 @@ public static void BuildRedefinitions(SysML2.NET.Core.POCO.Core.Features.IFeatur /// 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"); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfRedefinitionIterator.MoveNext(); + RedefinitionTextualNotationBuilder.BuildOwnedRedefinition(ownedRelationshipOfRedefinitionIterator.Current, stringBuilder); } @@ -197,10 +213,16 @@ public static void BuildRedefines(SysML2.NET.Core.POCO.Core.Features.IFeature po /// The that contains the entire textual notation public static void BuildOwnedFeatureChain(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - stringBuilder.Append("."); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfFeatureChainingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureChainingIterator.MoveNext(); + FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(ownedRelationshipOfFeatureChainingIterator.Current, stringBuilder); + while (ownedRelationshipOfFeatureChainingIterator.MoveNext()) + { + stringBuilder.Append("."); + FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(ownedRelationshipOfFeatureChainingIterator.Current, stringBuilder); + + } stringBuilder.Append(' '); } @@ -224,7 +246,9 @@ public static void BuildMultiplicityPart(SysML2.NET.Core.POCO.Core.Features.IFea /// The that contains the entire textual notation public static void BuildOwnedCrossMultiplicity(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfOwningMembershipIterator.MoveNext(); + OwningMembershipTextualNotationBuilder.BuildOwnedMultiplicity(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); } @@ -258,11 +282,17 @@ public static void BuildPayloadFeatureSpecializationPart(SysML2.NET.Core.POCO.Co /// The that contains the entire textual notation public static void BuildFeatureChainPrefix(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - stringBuilder.Append("."); + using var ownedRelationshipOfFeatureChainingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + + while (ownedRelationshipOfFeatureChainingIterator.MoveNext()) + { + FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(ownedRelationshipOfFeatureChainingIterator.Current, stringBuilder); + stringBuilder.Append("."); + } stringBuilder.Append(' '); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfFeatureChainingIterator.MoveNext(); + FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(ownedRelationshipOfFeatureChainingIterator.Current, stringBuilder); stringBuilder.Append("."); } @@ -275,7 +305,9 @@ public static void BuildFeatureChainPrefix(SysML2.NET.Core.POCO.Core.Features.IF /// The that contains the entire textual notation public static void BuildTriggerValuePart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureValueIterator.MoveNext(); + FeatureValueTextualNotationBuilder.BuildTriggerFeatureValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); } @@ -287,7 +319,9 @@ public static void BuildTriggerValuePart(SysML2.NET.Core.POCO.Core.Features.IFea /// The that contains the entire textual notation public static void BuildArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureValueIterator.MoveNext(); + FeatureValueTextualNotationBuilder.BuildArgumentValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); } @@ -299,7 +333,9 @@ public static void BuildArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poc /// The that contains the entire textual notation public static void BuildArgumentExpression(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureValueIterator.MoveNext(); + FeatureValueTextualNotationBuilder.BuildArgumentExpressionValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); } @@ -322,6 +358,7 @@ public static void BuildFeatureElement(SysML2.NET.Core.POCO.Core.Features.IFeatu /// 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"); @@ -341,18 +378,21 @@ public static void BuildEndFeaturePrefix(SysML2.NET.Core.POCO.Core.Features.IFea /// 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"); @@ -372,6 +412,7 @@ public static void BuildBasicFeaturePrefix(SysML2.NET.Core.POCO.Core.Features.IF /// 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"); @@ -414,6 +455,7 @@ public static void BuildFeatureRelationshipPart(SysML2.NET.Core.POCO.Core.Featur /// 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(' '); @@ -428,9 +470,11 @@ public static void BuildChainingPart(SysML2.NET.Core.POCO.Core.Features.IFeature /// 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 "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfFeatureInvertingIterator.MoveNext(); + FeatureInvertingTextualNotationBuilder.BuildOwnedFeatureInverting(ownedRelationshipOfFeatureInvertingIterator.Current, stringBuilder); } @@ -442,16 +486,19 @@ public static void BuildInvertingPart(SysML2.NET.Core.POCO.Core.Features.IFeatur /// 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 "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - if (poco.ownedTypeFeaturing.Count != 0) + ownedRelationshipOfTypeFeaturingIterator.MoveNext(); + TypeFeaturingTextualNotationBuilder.BuildOwnedTypeFeaturing(ownedRelationshipOfTypeFeaturingIterator.Current, stringBuilder); + + while (ownedTypeFeaturingIterator.MoveNext()) { stringBuilder.Append(","); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - stringBuilder.Append(' '); - } + TypeFeaturingTextualNotationBuilder.BuildOwnedTypeFeaturing(ownedTypeFeaturingIterator.Current, stringBuilder); + } } @@ -463,10 +510,16 @@ public static void BuildTypeFeaturingPart(SysML2.NET.Core.POCO.Core.Features.IFe /// The that contains the entire textual notation public static void BuildFeatureChain(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - stringBuilder.Append("."); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfFeatureChainingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureChainingIterator.MoveNext(); + FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(ownedRelationshipOfFeatureChainingIterator.Current, stringBuilder); + + while (ownedRelationshipOfFeatureChainingIterator.MoveNext()) + { + stringBuilder.Append("."); + FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(ownedRelationshipOfFeatureChainingIterator.Current, stringBuilder); + } stringBuilder.Append(' '); } @@ -479,7 +532,9 @@ public static void BuildFeatureChain(SysML2.NET.Core.POCO.Core.Features.IFeature /// The that contains the entire textual notation public static void BuildMetadataArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureValueIterator.MoveNext(); + FeatureValueTextualNotationBuilder.BuildMetadataValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); } @@ -491,7 +546,9 @@ public static void BuildMetadataArgument(SysML2.NET.Core.POCO.Core.Features.IFea /// The that contains the entire textual notation public static void BuildTypeReference(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfFeatureTypingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureTypingIterator.MoveNext(); + FeatureTypingTextualNotationBuilder.BuildReferenceTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); } @@ -503,7 +560,9 @@ public static void BuildTypeReference(SysML2.NET.Core.POCO.Core.Features.IFeatur /// The that contains the entire textual notation public static void BuildPrimaryArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureValueIterator.MoveNext(); + FeatureValueTextualNotationBuilder.BuildPrimaryArgumentValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); } @@ -515,7 +574,9 @@ public static void BuildPrimaryArgument(SysML2.NET.Core.POCO.Core.Features.IFeat /// The that contains the entire textual notation public static void BuildNonFeatureChainPrimaryArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureValueIterator.MoveNext(); + FeatureValueTextualNotationBuilder.BuildNonFeatureChainPrimaryArgumentValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); } @@ -527,7 +588,9 @@ public static void BuildNonFeatureChainPrimaryArgument(SysML2.NET.Core.POCO.Core /// The that contains the entire textual notation public static void BuildBodyArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureValueIterator.MoveNext(); + FeatureValueTextualNotationBuilder.BuildBodyArgumentValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); } @@ -539,7 +602,9 @@ public static void BuildBodyArgument(SysML2.NET.Core.POCO.Core.Features.IFeature /// The that contains the entire textual notation public static void BuildFunctionReferenceArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureValueIterator.MoveNext(); + FeatureValueTextualNotationBuilder.BuildFunctionReferenceArgumentValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); } @@ -589,14 +654,16 @@ public static void BuildArgumentList(SysML2.NET.Core.POCO.Core.Features.IFeature /// The that contains the entire textual notation public static void BuildPositionalArgumentList(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - if (poco.OwnedRelationship.Count != 0) + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + while (ownedRelationshipOfParameterMembershipIterator.MoveNext()) { stringBuilder.Append(","); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - stringBuilder.Append(' '); - } + ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } } @@ -608,14 +675,16 @@ public static void BuildPositionalArgumentList(SysML2.NET.Core.POCO.Core.Feature /// The that contains the entire textual notation public static void BuildNamedArgumentList(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - if (poco.OwnedRelationship.Count != 0) + using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureMembershipIterator.MoveNext(); + FeatureMembershipTextualNotationBuilder.BuildNamedArgumentMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + + while (ownedRelationshipOfFeatureMembershipIterator.MoveNext()) { stringBuilder.Append(","); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - stringBuilder.Append(' '); - } + FeatureMembershipTextualNotationBuilder.BuildNamedArgumentMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + } } @@ -627,9 +696,13 @@ public static void BuildNamedArgumentList(SysML2.NET.Core.POCO.Core.Features.IFe /// The that contains the entire textual notation public static void BuildNamedArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfRedefinitionIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfRedefinitionIterator.MoveNext(); + RedefinitionTextualNotationBuilder.BuildParameterRedefinition(ownedRelationshipOfRedefinitionIterator.Current, stringBuilder); stringBuilder.Append("="); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfFeatureValueIterator.MoveNext(); + FeatureValueTextualNotationBuilder.BuildArgumentValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); } @@ -641,9 +714,11 @@ public static void BuildNamedArgument(SysML2.NET.Core.POCO.Core.Features.IFeatur /// 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"); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfRedefinitionIterator.MoveNext(); + RedefinitionTextualNotationBuilder.BuildOwnedRedefinition(ownedRelationshipOfRedefinitionIterator.Current, stringBuilder); BuildFeatureSpecializationPart(poco, stringBuilder); BuildValuePart(poco, stringBuilder); TypeTextualNotationBuilder.BuildMetadataBody(poco, stringBuilder); @@ -658,6 +733,7 @@ public static void BuildMetadataBodyFeature(SysML2.NET.Core.POCO.Core.Features.I /// 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); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs index 0ebdf2b0..e2f24cdb 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureValueTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureValueTextualNotationBuilder.cs index 788230c7..2770f844 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureValueTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureValueTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,7 +42,9 @@ public static partial class FeatureValueTextualNotationBuilder /// The that contains the entire textual notation public static void BuildTriggerFeatureValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelatedElementOfTriggerInvocationExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfTriggerInvocationExpressionIterator.MoveNext(); + TriggerInvocationExpressionTextualNotationBuilder.BuildTriggerExpression(ownedRelatedElementOfTriggerInvocationExpressionIterator.Current, stringBuilder); } @@ -65,7 +68,9 @@ public static void BuildArgumentValue(SysML2.NET.Core.POCO.Kernel.FeatureValues. /// The that contains the entire textual notation public static void BuildArgumentExpressionValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelatedElementOfFeatureReferenceExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfFeatureReferenceExpressionIterator.MoveNext(); + FeatureReferenceExpressionTextualNotationBuilder.BuildOwnedExpressionReference(ownedRelatedElementOfFeatureReferenceExpressionIterator.Current, stringBuilder); } @@ -77,7 +82,9 @@ public static void BuildArgumentExpressionValue(SysML2.NET.Core.POCO.Kernel.Feat /// The that contains the entire textual notation public static void BuildFeatureBinding(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelatedElementOfExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfExpressionIterator.MoveNext(); + ExpressionTextualNotationBuilder.BuildOwnedExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); } @@ -89,7 +96,9 @@ public static void BuildFeatureBinding(SysML2.NET.Core.POCO.Kernel.FeatureValues /// The that contains the entire textual notation public static void BuildAssignmentTargetBinding(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelatedElementOfExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfExpressionIterator.MoveNext(); + ExpressionTextualNotationBuilder.BuildNonFeatureChainPrimaryExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); } @@ -101,7 +110,9 @@ public static void BuildAssignmentTargetBinding(SysML2.NET.Core.POCO.Kernel.Feat /// The that contains the entire textual notation public static void BuildSatisfactionFeatureValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelatedElementOfFeatureReferenceExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfFeatureReferenceExpressionIterator.MoveNext(); + FeatureReferenceExpressionTextualNotationBuilder.BuildSatisfactionReferenceExpression(ownedRelatedElementOfFeatureReferenceExpressionIterator.Current, stringBuilder); } @@ -173,9 +184,11 @@ public static void BuildFunctionReferenceArgumentValue(SysML2.NET.Core.POCO.Kern /// 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(' '); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfExpressionIterator.MoveNext(); + ExpressionTextualNotationBuilder.BuildOwnedExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowDefinitionTextualNotationBuilder.cs index 6771417c..8e03f5f9 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowDefinitionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowEndTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowEndTextualNotationBuilder.cs index 2dace9da..63a69b0b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowEndTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowEndTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,13 +42,17 @@ public static partial class FlowEndTextualNotationBuilder /// The that contains the entire textual notation public static void BuildFlowEnd(SysML2.NET.Core.POCO.Kernel.Interactions.IFlowEnd poco, StringBuilder stringBuilder) { - if (poco.OwnedRelationship.Count != 0) + using var ownedRelationshipOfReferenceSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + + if (ownedRelationshipOfReferenceSubsettingIterator.MoveNext()) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ReferenceSubsettingTextualNotationBuilder.BuildFlowEndSubsetting(ownedRelationshipOfReferenceSubsettingIterator.Current, stringBuilder); stringBuilder.Append(' '); } - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfFeatureMembershipIterator.MoveNext(); + FeatureMembershipTextualNotationBuilder.BuildFlowFeatureMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowTextualNotationBuilder.cs index fd460f29..40d81222 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,14 +42,15 @@ public static partial class FlowTextualNotationBuilder /// 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(' '); - if (poco.OwnedRelationship.Count != 0) + + while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - stringBuilder.Append(' '); - } + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } stringBuilder.Append("flow "); throw new System.NotSupportedException("Multiple alternatives not implemented yet"); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowUsageTextualNotationBuilder.cs index ce5d1e7e..90b3bcda 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForLoopActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForLoopActionUsageTextualNotationBuilder.cs index 8e56eaa4..0d6476e5 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForLoopActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForLoopActionUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,12 +42,17 @@ public static partial class ForLoopActionUsageTextualNotationBuilder /// 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 "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfFeatureMembershipIterator.MoveNext(); + FeatureMembershipTextualNotationBuilder.BuildForVariableDeclarationMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); stringBuilder.Append("in "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + ParameterMembershipTextualNotationBuilder.BuildActionBodyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForkNodeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForkNodeTextualNotationBuilder.cs index c8732103..0c8f6cd0 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForkNodeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForkNodeTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FramedConcernMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FramedConcernMembershipTextualNotationBuilder.cs index 0106cd4d..412fb84b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FramedConcernMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FramedConcernMembershipTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,9 +42,11 @@ public static partial class FramedConcernMembershipTextualNotationBuilder /// 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 "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfConcernUsageIterator.MoveNext(); + ConcernUsageTextualNotationBuilder.BuildFramedConcernUsage(ownedRelatedElementOfConcernUsageIterator.Current, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FunctionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FunctionTextualNotationBuilder.cs index 89e9d649..7533b9c9 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FunctionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FunctionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs index 5f10dccf..1ef429e6 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,14 +42,18 @@ public static partial class IfActionUsageTextualNotationBuilder /// 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 "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - if (poco.OwnedRelationship.Count != 0) + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + ParameterMembershipTextualNotationBuilder.BuildExpressionParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + ParameterMembershipTextualNotationBuilder.BuildActionBodyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (BuildGroupConditionForIfNode(poco)) { stringBuilder.Append("else "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + throw new System.NotSupportedException("Assigment of enumerable with non NonTerminalElement not supported yet"); stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ImportTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ImportTextualNotationBuilder.cs index df1e7e6d..f43e0d6c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ImportTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ImportTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -54,6 +55,7 @@ public static void BuildImport(SysML2.NET.Core.POCO.Root.Namespaces.IImport poco { stringBuilder.Append(poco.Visibility.ToString().ToLower()); stringBuilder.Append("import "); + if (poco.IsImportAll) { stringBuilder.Append("all"); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IncludeUseCaseUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IncludeUseCaseUsageTextualNotationBuilder.cs index 0297af1a..f6b8fbb7 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IncludeUseCaseUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IncludeUseCaseUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,6 +42,7 @@ public static partial class IncludeUseCaseUsageTextualNotationBuilder /// 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"); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IndexExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IndexExpressionTextualNotationBuilder.cs index 823e4d7e..85eb76b7 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IndexExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IndexExpressionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,10 +42,14 @@ public static partial class IndexExpressionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildIndexExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IIndexExpression poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + ParameterMembershipTextualNotationBuilder.BuildPrimaryArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); stringBuilder.Append("#"); stringBuilder.Append("("); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfFeatureMembershipIterator.MoveNext(); + FeatureMembershipTextualNotationBuilder.BuildSequenceExpressionListMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); stringBuilder.Append(")"); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InteractionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InteractionTextualNotationBuilder.cs index 131c6eac..55e47728 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InteractionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InteractionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceDefinitionTextualNotationBuilder.cs index d855c825..b1efd5bd 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceDefinitionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs index a8edd8a2..ef3162e6 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -63,9 +64,12 @@ public static void BuildInterfacePart(SysML2.NET.Core.POCO.Systems.Interfaces.II /// The that contains the entire textual notation public static void BuildBinaryInterfacePart(SysML2.NET.Core.POCO.Systems.Interfaces.IInterfaceUsage poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfEndFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); stringBuilder.Append("to "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); } @@ -77,17 +81,20 @@ public static void BuildBinaryInterfacePart(SysML2.NET.Core.POCO.Systems.Interfa /// 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("("); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); stringBuilder.Append(","); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - if (poco.OwnedRelationship.Count != 0) + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + + while (ownedRelationshipOfEndFeatureMembershipIterator.MoveNext()) { stringBuilder.Append(","); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - stringBuilder.Append(' '); - } + EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } stringBuilder.Append(")"); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IntersectingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IntersectingTextualNotationBuilder.cs index 60267aeb..e3443939 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IntersectingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IntersectingTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs index acff88ca..9d70ff06 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,14 +42,15 @@ public static partial class InvariantTextualNotationBuilder /// 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(' '); - if (poco.OwnedRelationship.Count != 0) + + while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - stringBuilder.Append(' '); - } + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } stringBuilder.Append("inv "); throw new System.NotSupportedException("Multiple alternatives not implemented yet"); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs index 78d28bd1..6ee935b4 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,12 +42,18 @@ public static partial class InvocationExpressionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildFunctionOperationExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IInvocationExpression poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfInvocationExpressionIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + ParameterMembershipTextualNotationBuilder.BuildPrimaryArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); stringBuilder.Append("-> "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfInvocationExpressionIterator.MoveNext(); + BuildInvocationTypeMember(ownedRelationshipOfInvocationExpressionIterator.Current, stringBuilder); throw new System.NotSupportedException("Multiple alternatives not implemented yet"); stringBuilder.Append(' '); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); } @@ -58,9 +65,13 @@ public static void BuildFunctionOperationExpression(SysML2.NET.Core.POCO.Kernel. /// The that contains the entire textual notation public static void BuildInvocationExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IInvocationExpression poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfMembershipIterator.MoveNext(); + MembershipTextualNotationBuilder.BuildInstantiatedTypeMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); FeatureTextualNotationBuilder.BuildArgumentList(poco, stringBuilder); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemDefinitionTextualNotationBuilder.cs index e35af46e..20e3209d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemDefinitionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemUsageTextualNotationBuilder.cs index a7b599ca..9e9772f7 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/JoinNodeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/JoinNodeTextualNotationBuilder.cs index 4f76eac2..e17813d2 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/JoinNodeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/JoinNodeTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LibraryPackageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LibraryPackageTextualNotationBuilder.cs index 2931b48b..57d5e80c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LibraryPackageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LibraryPackageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,16 +42,17 @@ public static partial class LibraryPackageTextualNotationBuilder /// 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 "); - if (poco.OwnedRelationship.Count != 0) + + while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - stringBuilder.Append(' '); - } + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } PackageTextualNotationBuilder.BuildPackageDeclaration(poco, stringBuilder); PackageTextualNotationBuilder.BuildPackageBody(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralBooleanTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralBooleanTextualNotationBuilder.cs index eb9cb34d..215bf2bf 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralBooleanTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralBooleanTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralExpressionTextualNotationBuilder.cs index 7965c644..21ab5ec6 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralExpressionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralInfinityTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralInfinityTextualNotationBuilder.cs index 78830938..e877fdf1 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralInfinityTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralInfinityTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralIntegerTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralIntegerTextualNotationBuilder.cs index 06b4bf1e..12d657bd 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralIntegerTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralIntegerTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralStringTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralStringTextualNotationBuilder.cs index a1eec88a..4e173178 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralStringTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralStringTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipExposeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipExposeTextualNotationBuilder.cs index c26c9a7e..76ef4447 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipExposeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipExposeTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.cs index 30617fe2..35812294 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -42,6 +43,7 @@ public static partial class MembershipImportTextualNotationBuilder public static void BuildMembershipImport(SysML2.NET.Core.POCO.Root.Namespaces.IMembershipImport poco, StringBuilder stringBuilder) { throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + if (poco.IsRecursive) { stringBuilder.Append(":: "); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs index 16910204..3af0d262 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,6 +42,7 @@ public static partial class MembershipTextualNotationBuilder /// 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()); @@ -60,6 +62,7 @@ public static void BuildAliasMember(SysML2.NET.Core.POCO.Root.Namespaces.IMember { BuildMemberPrefix(poco, stringBuilder); stringBuilder.Append("alias "); + if (!string.IsNullOrWhiteSpace(poco.MemberShortName)) { stringBuilder.Append("<"); @@ -68,6 +71,7 @@ public static void BuildAliasMember(SysML2.NET.Core.POCO.Root.Namespaces.IMember stringBuilder.Append(' '); } + if (!string.IsNullOrWhiteSpace(poco.MemberName)) { stringBuilder.Append(poco.MemberName); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MergeNodeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MergeNodeTextualNotationBuilder.cs index ec77b98f..d499a57c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MergeNodeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MergeNodeTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetaclassTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetaclassTextualNotationBuilder.cs index d0a12732..54c203f6 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetaclassTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetaclassTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataAccessExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataAccessExpressionTextualNotationBuilder.cs index 6b3dc338..84030eab 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataAccessExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataAccessExpressionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,7 +42,9 @@ public static partial class MetadataAccessExpressionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildMetadataReference(SysML2.NET.Core.POCO.Kernel.Expressions.IMetadataAccessExpression poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfMembershipIterator.MoveNext(); + MembershipTextualNotationBuilder.BuildElementReferenceMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); } @@ -53,7 +56,9 @@ public static void BuildMetadataReference(SysML2.NET.Core.POCO.Kernel.Expression /// The that contains the entire textual notation public static void BuildMetadataAccessExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IMetadataAccessExpression poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfMembershipIterator.MoveNext(); + MembershipTextualNotationBuilder.BuildElementReferenceMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); stringBuilder.Append("."); stringBuilder.Append("metadata "); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.cs index a1158a0f..191d4268 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,6 +42,7 @@ public static partial class MetadataDefinitionTextualNotationBuilder /// 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"); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs index 38c50000..07423665 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,7 +42,9 @@ public static partial class MetadataFeatureTextualNotationBuilder /// The that contains the entire textual notation public static void BuildPrefixMetadataFeature(SysML2.NET.Core.POCO.Kernel.Metadata.IMetadataFeature poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfFeatureTypingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureTypingIterator.MoveNext(); + FeatureTypingTextualNotationBuilder.BuildOwnedFeatureTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); } @@ -53,8 +56,18 @@ public static void BuildPrefixMetadataFeature(SysML2.NET.Core.POCO.Kernel.Metada /// 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(); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + if (BuildGroupConditionForMetadataFeatureDeclaration(poco)) + { + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + stringBuilder.Append(' '); + } + + ownedRelationshipOfFeatureTypingIterator.MoveNext(); + FeatureTypingTextualNotationBuilder.BuildOwnedFeatureTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); } @@ -66,26 +79,29 @@ public static void BuildMetadataFeatureDeclaration(SysML2.NET.Core.POCO.Kernel.M /// The that contains the entire textual notation public static void BuildMetadataFeature(SysML2.NET.Core.POCO.Kernel.Metadata.IMetadataFeature poco, StringBuilder stringBuilder) { - if (poco.OwnedRelationship.Count != 0) + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfAnnotationIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + + while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - stringBuilder.Append(' '); - } + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } throw new System.NotSupportedException("Multiple alternatives not implemented yet"); stringBuilder.Append(' '); BuildMetadataFeatureDeclaration(poco, stringBuilder); - if (poco.OwnedRelationship.Count != 0) + + if (ownedRelationshipOfAnnotationIterator.MoveNext()) { stringBuilder.Append("about "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - if (poco.OwnedRelationship.Count != 0) + AnnotationTextualNotationBuilder.BuildAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + + while (ownedRelationshipOfAnnotationIterator.MoveNext()) { stringBuilder.Append(","); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - stringBuilder.Append(' '); - } + AnnotationTextualNotationBuilder.BuildAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + } stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs index 14fbe831..8355b7c8 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,7 +42,9 @@ public static partial class MetadataUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildPrefixMetadataUsage(SysML2.NET.Core.POCO.Systems.Metadata.IMetadataUsage poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfFeatureTypingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureTypingIterator.MoveNext(); + FeatureTypingTextualNotationBuilder.BuildOwnedFeatureTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); } @@ -53,8 +56,18 @@ public static void BuildPrefixMetadataUsage(SysML2.NET.Core.POCO.Systems.Metadat /// 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(); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + if (BuildGroupConditionForMetadataUsageDeclaration(poco)) + { + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(' '); + stringBuilder.Append(' '); + } + + ownedRelationshipOfFeatureTypingIterator.MoveNext(); + FeatureTypingTextualNotationBuilder.BuildOwnedFeatureTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); } @@ -66,21 +79,23 @@ public static void BuildMetadataUsageDeclaration(SysML2.NET.Core.POCO.Systems.Me /// 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 (poco.OwnedRelationship.Count != 0) + + if (ownedRelationshipOfAnnotationIterator.MoveNext()) { stringBuilder.Append("about "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - if (poco.OwnedRelationship.Count != 0) + AnnotationTextualNotationBuilder.BuildAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + + while (ownedRelationshipOfAnnotationIterator.MoveNext()) { stringBuilder.Append(","); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - stringBuilder.Append(' '); - } + AnnotationTextualNotationBuilder.BuildAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + } stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityRangeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityRangeTextualNotationBuilder.cs index a4800701..56442a1b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityRangeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityRangeTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -53,15 +54,18 @@ public static void BuildOwnedMultiplicityRange(SysML2.NET.Core.POCO.Kernel.Multi /// 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 (poco.OwnedRelationship.Count != 0) + + if (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + OwningMembershipTextualNotationBuilder.BuildMultiplicityExpressionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); stringBuilder.Append(".. "); stringBuilder.Append(' '); } - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfOwningMembershipIterator.MoveNext(); + OwningMembershipTextualNotationBuilder.BuildMultiplicityExpressionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); stringBuilder.Append("]"); } @@ -74,15 +78,18 @@ public static void BuildMultiplicityBounds(SysML2.NET.Core.POCO.Kernel.Multiplic /// 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 (poco.OwnedRelationship.Count != 0) + + if (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + OwningMembershipTextualNotationBuilder.BuildMultiplicityExpressionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); stringBuilder.Append(".. "); stringBuilder.Append(' '); } - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfOwningMembershipIterator.MoveNext(); + OwningMembershipTextualNotationBuilder.BuildMultiplicityExpressionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); stringBuilder.Append("]"); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityTextualNotationBuilder.cs index c0f0e236..a387ceec 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceExposeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceExposeTextualNotationBuilder.cs index b0364f64..f31c167b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceExposeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceExposeTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceImportTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceImportTextualNotationBuilder.cs index 6bff3b6a..e325221f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceImportTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceImportTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs index 177d277a..b06e9455 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -88,12 +89,13 @@ public static void BuildNamespaceBodyElement(SysML2.NET.Core.POCO.Root.Namespace /// The that contains the entire textual notation public static void BuildNamespace(SysML2.NET.Core.POCO.Root.Namespaces.INamespace poco, StringBuilder stringBuilder) { - if (poco.OwnedRelationship.Count != 0) + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + + while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - stringBuilder.Append(' '); - } + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } BuildNamespaceDeclaration(poco, stringBuilder); BuildNamespaceBody(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NullExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NullExpressionTextualNotationBuilder.cs index 37b0a831..0b5aba45 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NullExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NullExpressionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ObjectiveMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ObjectiveMembershipTextualNotationBuilder.cs index 48344b16..465b6fb9 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ObjectiveMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ObjectiveMembershipTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,9 +42,11 @@ public static partial class ObjectiveMembershipTextualNotationBuilder /// 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 "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfRequirementUsageIterator.MoveNext(); + RequirementUsageTextualNotationBuilder.BuildObjectiveRequirementUsage(ownedRelatedElementOfRequirementUsageIterator.Current, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs index f8fecfe6..a595d817 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,11 +42,13 @@ public static partial class OccurrenceDefinitionTextualNotationBuilder /// 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 && poco.OwnedRelationship.Count != 0) + + if (poco.IsIndividual && ownedRelationshipOfOwningMembershipIterator.MoveNext()) { stringBuilder.Append("individual"); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + OwningMembershipTextualNotationBuilder.BuildEmptyMultiplicityMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); stringBuilder.Append(' '); } @@ -61,12 +64,14 @@ public static void BuildOccurrenceDefinitionPrefix(SysML2.NET.Core.POCO.Systems. /// 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); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfOwningMembershipIterator.MoveNext(); + OwningMembershipTextualNotationBuilder.BuildEmptyMultiplicityMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs index 0d33beb0..771d83d7 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -42,12 +43,14 @@ public static partial class OccurrenceUsageTextualNotationBuilder 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()); @@ -83,6 +86,7 @@ public static void BuildIndividualUsage(SysML2.NET.Core.POCO.Systems.Occurrences public static void BuildPortionUsage(SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceUsage poco, StringBuilder stringBuilder) { UsageTextualNotationBuilder.BuildBasicUsagePrefix(poco, stringBuilder); + if (poco.IsIndividual) { stringBuilder.Append("individual"); @@ -105,12 +109,14 @@ public static void BuildPortionUsage(SysML2.NET.Core.POCO.Systems.Occurrences.IO 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()); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OperatorExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OperatorExpressionTextualNotationBuilder.cs index a43d6cee..a8c95f03 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OperatorExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OperatorExpressionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,13 +42,19 @@ public static partial class OperatorExpressionTextualNotationBuilder /// 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); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); stringBuilder.Append("?"); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + ParameterMembershipTextualNotationBuilder.BuildArgumentExpressionMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); stringBuilder.Append("else "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + ParameterMembershipTextualNotationBuilder.BuildArgumentExpressionMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); } @@ -59,10 +66,15 @@ public static void BuildConditionalExpression(SysML2.NET.Core.POCO.Kernel.Expres /// The that contains the entire textual notation public static void BuildConditionalBinaryOperatorExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); stringBuilder.Append(poco.Operator); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + ParameterMembershipTextualNotationBuilder.BuildArgumentExpressionMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); } @@ -74,10 +86,15 @@ public static void BuildConditionalBinaryOperatorExpression(SysML2.NET.Core.POCO /// The that contains the entire textual notation public static void BuildBinaryOperatorExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); stringBuilder.Append(poco.Operator); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); } @@ -89,9 +106,13 @@ public static void BuildBinaryOperatorExpression(SysML2.NET.Core.POCO.Kernel.Exp /// 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); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); } @@ -103,15 +124,20 @@ public static void BuildUnaryOperatorExpression(SysML2.NET.Core.POCO.Kernel.Expr /// The that contains the entire textual notation public static void BuildClassificationExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, StringBuilder stringBuilder) { - if (poco.OwnedRelationship.Count != 0) + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipIterator = poco.OwnedRelationship.GetEnumerator(); + using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + + if (ownedRelationshipOfParameterMembershipIterator.MoveNext()) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); stringBuilder.Append(' '); } throw new System.NotSupportedException("Multiple alternatives not implemented yet"); stringBuilder.Append(' '); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); } @@ -123,10 +149,15 @@ public static void BuildClassificationExpression(SysML2.NET.Core.POCO.Kernel.Exp /// The that contains the entire textual notation public static void BuildMetaclassificationExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipIterator = poco.OwnedRelationship.GetEnumerator(); + using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + ParameterMembershipTextualNotationBuilder.BuildMetadataArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); throw new System.NotSupportedException("Multiple alternatives not implemented yet"); stringBuilder.Append(' '); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); } @@ -138,8 +169,10 @@ public static void BuildMetaclassificationExpression(SysML2.NET.Core.POCO.Kernel /// 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); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + ParameterMembershipTextualNotationBuilder.BuildTypeReferenceMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); } @@ -151,9 +184,13 @@ public static void BuildExtentExpression(SysML2.NET.Core.POCO.Kernel.Expressions /// The that contains the entire textual notation public static void BuildBracketExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + ParameterMembershipTextualNotationBuilder.BuildPrimaryArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); stringBuilder.Append(poco.Operator); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfFeatureMembershipIterator.MoveNext(); + FeatureMembershipTextualNotationBuilder.BuildSequenceExpressionListMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); stringBuilder.Append("]"); } @@ -166,9 +203,12 @@ public static void BuildBracketExpression(SysML2.NET.Core.POCO.Kernel.Expression /// The that contains the entire textual notation public static void BuildSequenceOperatorExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureMembershipIterator.MoveNext(); + FeatureMembershipTextualNotationBuilder.BuildOwnedExpressionMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); stringBuilder.Append(poco.Operator); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfFeatureMembershipIterator.MoveNext(); + FeatureMembershipTextualNotationBuilder.BuildSequenceExpressionListMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs index 057b3c9f..fe2a72fd 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,7 +42,9 @@ public static partial class OwningMembershipTextualNotationBuilder /// The that contains the entire textual notation public static void BuildAnnotatingMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelatedElementOfAnnotatingElementIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfAnnotatingElementIterator.MoveNext(); + AnnotatingElementTextualNotationBuilder.BuildAnnotatingElement(ownedRelatedElementOfAnnotatingElementIterator.Current, stringBuilder); } @@ -53,6 +56,8 @@ public static void BuildAnnotatingMember(SysML2.NET.Core.POCO.Root.Namespaces.IO /// 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(' '); @@ -67,8 +72,10 @@ public static void BuildPackageMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwni /// 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); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementIterator.MoveNext(); + ElementTextualNotationBuilder.BuildDefinitionElement(ownedRelatedElementIterator.Current, stringBuilder); } @@ -80,7 +87,9 @@ public static void BuildDefinitionMember(SysML2.NET.Core.POCO.Root.Namespaces.IO /// The that contains the entire textual notation public static void BuildOwnedCrossFeatureMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfReferenceUsageIterator.MoveNext(); + ReferenceUsageTextualNotationBuilder.BuildOwnedCrossFeature(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); } @@ -92,7 +101,9 @@ public static void BuildOwnedCrossFeatureMember(SysML2.NET.Core.POCO.Root.Namesp /// The that contains the entire textual notation public static void BuildOwnedMultiplicity(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelatedElementOfMultiplicityRangeIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfMultiplicityRangeIterator.MoveNext(); + MultiplicityRangeTextualNotationBuilder.BuildMultiplicityRange(ownedRelatedElementOfMultiplicityRangeIterator.Current, stringBuilder); } @@ -104,7 +115,7 @@ public static void BuildOwnedMultiplicity(SysML2.NET.Core.POCO.Root.Namespaces.I /// 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 not supported yet"); + throw new System.NotSupportedException("Assigment of enumerable with non NonTerminalElement not supported yet"); } @@ -116,7 +127,9 @@ public static void BuildMultiplicityExpressionMember(SysML2.NET.Core.POCO.Root.N /// The that contains the entire textual notation public static void BuildEmptyMultiplicityMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelatedElementOfMultiplicityIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfMultiplicityIterator.MoveNext(); + MultiplicityTextualNotationBuilder.BuildEmptyMultiplicity(ownedRelatedElementOfMultiplicityIterator.Current, stringBuilder); } @@ -128,7 +141,9 @@ public static void BuildEmptyMultiplicityMember(SysML2.NET.Core.POCO.Root.Namesp /// The that contains the entire textual notation public static void BuildConjugatedPortDefinitionMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelatedElementOfConjugatedPortDefinitionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfConjugatedPortDefinitionIterator.MoveNext(); + ConjugatedPortDefinitionTextualNotationBuilder.BuildConjugatedPortDefinition(ownedRelatedElementOfConjugatedPortDefinitionIterator.Current, stringBuilder); } @@ -140,7 +155,9 @@ public static void BuildConjugatedPortDefinitionMember(SysML2.NET.Core.POCO.Root /// The that contains the entire textual notation public static void BuildOwnedCrossMultiplicityMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfFeatureIterator.MoveNext(); + FeatureTextualNotationBuilder.BuildOwnedCrossMultiplicity(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); } @@ -152,7 +169,9 @@ public static void BuildOwnedCrossMultiplicityMember(SysML2.NET.Core.POCO.Root.N /// The that contains the entire textual notation public static void BuildOwnedFeatureChainMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfFeatureIterator.MoveNext(); + FeatureTextualNotationBuilder.BuildOwnedFeatureChain(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); } @@ -164,7 +183,9 @@ public static void BuildOwnedFeatureChainMember(SysML2.NET.Core.POCO.Root.Namesp /// The that contains the entire textual notation public static void BuildTransitionSuccessionMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelatedElementOfSuccessionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfSuccessionIterator.MoveNext(); + SuccessionTextualNotationBuilder.BuildTransitionSuccession(ownedRelatedElementOfSuccessionIterator.Current, stringBuilder); } @@ -176,8 +197,10 @@ public static void BuildTransitionSuccessionMember(SysML2.NET.Core.POCO.Root.Nam /// 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("#"); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfMetadataUsageIterator.MoveNext(); + MetadataUsageTextualNotationBuilder.BuildPrefixMetadataUsage(ownedRelatedElementOfMetadataUsageIterator.Current, stringBuilder); } @@ -200,8 +223,10 @@ public static void BuildNamespaceMember(SysML2.NET.Core.POCO.Root.Namespaces.IOw /// 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); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementIterator.MoveNext(); + ElementTextualNotationBuilder.BuildMemberElement(ownedRelatedElementIterator.Current, stringBuilder); } @@ -213,8 +238,10 @@ public static void BuildNonFeatureMember(SysML2.NET.Core.POCO.Root.Namespaces.IO /// 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); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfFeatureIterator.MoveNext(); + FeatureTextualNotationBuilder.BuildFeatureElement(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); } @@ -237,9 +264,11 @@ public static void BuildFeatureMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwni /// 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 "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfFeatureIterator.MoveNext(); + FeatureTextualNotationBuilder.BuildFeatureElement(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs index 408b7a1a..5a2a2f16 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -76,9 +77,16 @@ public static void BuildPackageBodyElement(SysML2.NET.Core.POCO.Kernel.Packages. /// The that contains the entire textual notation public static void BuildFilterPackage(SysML2.NET.Core.POCO.Kernel.Packages.IPackage poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfPackageIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfElementFilterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfPackageIterator.MoveNext(); + BuildFilterPackageImport(ownedRelationshipOfPackageIterator.Current, stringBuilder); + while (ownedRelationshipOfElementFilterMembershipIterator.MoveNext()) + { + ElementFilterMembershipTextualNotationBuilder.BuildFilterPackageMember(ownedRelationshipOfElementFilterMembershipIterator.Current, stringBuilder); + + } stringBuilder.Append(' '); } @@ -91,12 +99,13 @@ public static void BuildFilterPackage(SysML2.NET.Core.POCO.Kernel.Packages.IPack /// The that contains the entire textual notation public static void BuildPackage(SysML2.NET.Core.POCO.Kernel.Packages.IPackage poco, StringBuilder stringBuilder) { - if (poco.OwnedRelationship.Count != 0) + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + + while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - stringBuilder.Append(' '); - } + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } BuildPackageDeclaration(poco, stringBuilder); BuildPackageBody(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ParameterMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ParameterMembershipTextualNotationBuilder.cs index c2cf33c4..410a1816 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ParameterMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ParameterMembershipTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,7 +42,9 @@ public static partial class ParameterMembershipTextualNotationBuilder /// The that contains the entire textual notation public static void BuildMessageEventMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelatedElementOfEventOccurrenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfEventOccurrenceUsageIterator.MoveNext(); + EventOccurrenceUsageTextualNotationBuilder.BuildMessageEvent(ownedRelatedElementOfEventOccurrenceUsageIterator.Current, stringBuilder); } @@ -53,7 +56,9 @@ public static void BuildMessageEventMember(SysML2.NET.Core.POCO.Kernel.Behaviors /// The that contains the entire textual notation public static void BuildPayloadParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfReferenceUsageIterator.MoveNext(); + ReferenceUsageTextualNotationBuilder.BuildPayloadParameter(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); } @@ -77,7 +82,9 @@ public static void BuildArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IPa /// The that contains the entire textual notation public static void BuildArgumentExpressionMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfFeatureIterator.MoveNext(); + FeatureTextualNotationBuilder.BuildArgumentExpression(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); } @@ -89,7 +96,9 @@ public static void BuildArgumentExpressionMember(SysML2.NET.Core.POCO.Kernel.Beh /// The that contains the entire textual notation public static void BuildNodeParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfReferenceUsageIterator.MoveNext(); + ReferenceUsageTextualNotationBuilder.BuildNodeParameter(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); } @@ -101,7 +110,9 @@ public static void BuildNodeParameterMember(SysML2.NET.Core.POCO.Kernel.Behavior /// The that contains the entire textual notation public static void BuildEmptyParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfReferenceUsageIterator.MoveNext(); + ReferenceUsageTextualNotationBuilder.BuildEmptyUsage(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); } @@ -113,7 +124,9 @@ public static void BuildEmptyParameterMember(SysML2.NET.Core.POCO.Kernel.Behavio /// The that contains the entire textual notation public static void BuildAssignmentTargetMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfReferenceUsageIterator.MoveNext(); + ReferenceUsageTextualNotationBuilder.BuildAssignmentTargetParameter(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); } @@ -125,7 +138,9 @@ public static void BuildAssignmentTargetMember(SysML2.NET.Core.POCO.Kernel.Behav /// The that contains the entire textual notation public static void BuildExpressionParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelatedElementOfExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfExpressionIterator.MoveNext(); + ExpressionTextualNotationBuilder.BuildOwnedExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); } @@ -137,7 +152,9 @@ public static void BuildExpressionParameterMember(SysML2.NET.Core.POCO.Kernel.Be /// The that contains the entire textual notation public static void BuildActionBodyParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelatedElementOfActionUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfActionUsageIterator.MoveNext(); + ActionUsageTextualNotationBuilder.BuildActionBodyParameter(ownedRelatedElementOfActionUsageIterator.Current, stringBuilder); } @@ -149,7 +166,9 @@ public static void BuildActionBodyParameterMember(SysML2.NET.Core.POCO.Kernel.Be /// The that contains the entire textual notation public static void BuildIfNodeParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelatedElementOfIfActionUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfIfActionUsageIterator.MoveNext(); + IfActionUsageTextualNotationBuilder.BuildIfNode(ownedRelatedElementOfIfActionUsageIterator.Current, stringBuilder); } @@ -161,7 +180,9 @@ public static void BuildIfNodeParameterMember(SysML2.NET.Core.POCO.Kernel.Behavi /// The that contains the entire textual notation public static void BuildMetadataArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfFeatureIterator.MoveNext(); + FeatureTextualNotationBuilder.BuildMetadataArgument(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartDefinitionTextualNotationBuilder.cs index 67f9a91e..be495e17 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartDefinitionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartUsageTextualNotationBuilder.cs index 7a07d73c..f6869f2e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PayloadFeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PayloadFeatureTextualNotationBuilder.cs index 35f89455..f237689f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PayloadFeatureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PayloadFeatureTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PerformActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PerformActionUsageTextualNotationBuilder.cs index 5364c23e..f3b0b9a7 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PerformActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PerformActionUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,6 +42,7 @@ public static partial class PerformActionUsageTextualNotationBuilder /// 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); @@ -70,6 +72,14 @@ public static void BuildTransitionPerformActionUsage(SysML2.NET.Core.POCO.System { BuildPerformActionUsageDeclaration(poco, stringBuilder); + if (BuildGroupConditionForTransitionPerformActionUsage(poco)) + { + stringBuilder.Append("{"); + TypeTextualNotationBuilder.BuildActionBodyItem(poco, stringBuilder); + stringBuilder.Append("}"); + stringBuilder.Append(' '); + } + } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortConjugationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortConjugationTextualNotationBuilder.cs index 3994a9db..ec8ddda9 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortConjugationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortConjugationTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortDefinitionTextualNotationBuilder.cs index e5358fe6..c554a6ff 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortDefinitionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,11 +42,13 @@ public static partial class PortDefinitionTextualNotationBuilder /// 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); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfOwningMembershipIterator.MoveNext(); + OwningMembershipTextualNotationBuilder.BuildConjugatedPortDefinitionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); // Assignment Element : conjugatedPortDefinition.ownedPortConjugator.originalPortDefinition = this } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs index 6aee48d8..14545ef3 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -54,12 +55,16 @@ public static void BuildDefaultInterfaceEnd(SysML2.NET.Core.POCO.Systems.Ports.I /// The that contains the entire textual notation public static void BuildInterfaceEnd(SysML2.NET.Core.POCO.Systems.Ports.IPortUsage poco, StringBuilder stringBuilder) { - if (poco.OwnedRelationship.Count != 0) + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfReferenceSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + + if (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + OwningMembershipTextualNotationBuilder.BuildOwnedCrossMultiplicityMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); stringBuilder.Append(' '); } + if (!string.IsNullOrWhiteSpace(poco.DeclaredName)) { stringBuilder.Append(poco.DeclaredName); @@ -67,7 +72,8 @@ public static void BuildInterfaceEnd(SysML2.NET.Core.POCO.Systems.Ports.IPortUsa stringBuilder.Append(' '); } - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfReferenceSubsettingIterator.MoveNext(); + ReferenceSubsettingTextualNotationBuilder.BuildOwnedReferenceSubsetting(ownedRelationshipOfReferenceSubsettingIterator.Current, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortionKindTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortionKindTextualNotationBuilder.cs index 438b4df7..ff40e40e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortionKindTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortionKindTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PredicateTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PredicateTextualNotationBuilder.cs index 32ebf78c..f151f59d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PredicateTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PredicateTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs index c01e3ec4..75e6b414 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -77,6 +78,13 @@ public static void BuildParameterRedefinition(SysML2.NET.Core.POCO.Core.Features 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"); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceSubsettingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceSubsettingTextualNotationBuilder.cs index a9365bea..03dac04f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceSubsettingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceSubsettingTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs index 0f8cd2fd..3fde433d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -67,7 +68,9 @@ public static void BuildDefaultReferenceUsage(SysML2.NET.Core.POCO.Systems.Defin /// The that contains the entire textual notation public static void BuildVariantReference(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfReferenceSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfReferenceSubsettingIterator.MoveNext(); + ReferenceSubsettingTextualNotationBuilder.BuildOwnedReferenceSubsetting(ownedRelationshipOfReferenceSubsettingIterator.Current, stringBuilder); FeatureTextualNotationBuilder.BuildFeatureSpecialization(poco, stringBuilder); UsageTextualNotationBuilder.BuildUsageBody(poco, stringBuilder); @@ -81,9 +84,11 @@ public static void BuildVariantReference(SysML2.NET.Core.POCO.Systems.Definition /// The that contains the entire textual notation public static void BuildSourceEnd(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) { - if (poco.OwnedRelationship.Count != 0) + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + + if (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + OwningMembershipTextualNotationBuilder.BuildOwnedMultiplicity(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); stringBuilder.Append(' '); } @@ -98,12 +103,16 @@ public static void BuildSourceEnd(SysML2.NET.Core.POCO.Systems.DefinitionAndUsag /// The that contains the entire textual notation public static void BuildConnectorEnd(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) { - if (poco.OwnedRelationship.Count != 0) + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfReferenceSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + + if (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + OwningMembershipTextualNotationBuilder.BuildOwnedCrossMultiplicityMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); stringBuilder.Append(' '); } + if (!string.IsNullOrWhiteSpace(poco.DeclaredName)) { stringBuilder.Append(poco.DeclaredName); @@ -111,7 +120,8 @@ public static void BuildConnectorEnd(SysML2.NET.Core.POCO.Systems.DefinitionAndU stringBuilder.Append(' '); } - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfReferenceSubsettingIterator.MoveNext(); + ReferenceSubsettingTextualNotationBuilder.BuildOwnedReferenceSubsetting(ownedRelationshipOfReferenceSubsettingIterator.Current, stringBuilder); } @@ -123,7 +133,9 @@ public static void BuildConnectorEnd(SysML2.NET.Core.POCO.Systems.DefinitionAndU /// The that contains the entire textual notation public static void BuildFlowFeature(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfRedefinitionIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfRedefinitionIterator.MoveNext(); + RedefinitionTextualNotationBuilder.BuildFlowFeatureRedefinition(ownedRelationshipOfRedefinitionIterator.Current, stringBuilder); } @@ -146,7 +158,9 @@ public static void BuildPayloadParameter(SysML2.NET.Core.POCO.Systems.Definition /// The that contains the entire textual notation public static void BuildNodeParameter(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureValueIterator.MoveNext(); + FeatureValueTextualNotationBuilder.BuildFeatureBinding(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); } @@ -169,9 +183,11 @@ public static void BuildEmptyUsage(SysML2.NET.Core.POCO.Systems.DefinitionAndUsa /// The that contains the entire textual notation public static void BuildAssignmentTargetParameter(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) { - if (poco.OwnedRelationship.Count != 0) + using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + + if (ownedRelationshipOfFeatureValueIterator.MoveNext()) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + FeatureValueTextualNotationBuilder.BuildAssignmentTargetBinding(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); stringBuilder.Append("."); stringBuilder.Append(' '); } @@ -224,7 +240,9 @@ public static void BuildSubjectUsage(SysML2.NET.Core.POCO.Systems.DefinitionAndU /// The that contains the entire textual notation public static void BuildSatisfactionParameter(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureValueIterator.MoveNext(); + FeatureValueTextualNotationBuilder.BuildSatisfactionFeatureValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); } @@ -236,9 +254,11 @@ public static void BuildSatisfactionParameter(SysML2.NET.Core.POCO.Systems.Defin /// 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"); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfRedefinitionIterator.MoveNext(); + RedefinitionTextualNotationBuilder.BuildOwnedRedefinition(ownedRelationshipOfRedefinitionIterator.Current, stringBuilder); FeatureTextualNotationBuilder.BuildFeatureSpecializationPart(poco, stringBuilder); FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); TypeTextualNotationBuilder.BuildMetadataBody(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RelationshipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RelationshipTextualNotationBuilder.cs index 515cedd6..922ae253 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RelationshipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RelationshipTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingDefinitionTextualNotationBuilder.cs index acbf42cc..50209fc8 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingDefinitionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingUsageTextualNotationBuilder.cs index 223a99cc..5835570f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.cs index b9ace0d9..96bbfb04 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,9 +42,11 @@ public static partial class RequirementConstraintMembershipTextualNotationBuilde /// 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); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfConstraintUsageIterator.MoveNext(); + ConstraintUsageTextualNotationBuilder.BuildRequirementConstraintUsage(ownedRelatedElementOfConstraintUsageIterator.Current, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementDefinitionTextualNotationBuilder.cs index 671fb56c..df6dc74d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementDefinitionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementUsageTextualNotationBuilder.cs index 1bfb9bea..6afde8fd 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementVerificationMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementVerificationMembershipTextualNotationBuilder.cs index 24d2edce..acf3e3c8 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementVerificationMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementVerificationMembershipTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,10 +42,12 @@ public static partial class RequirementVerificationMembershipTextualNotationBuil /// 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 "); // Assignment Element : kind = 'requirement' - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfRequirementUsageIterator.MoveNext(); + RequirementUsageTextualNotationBuilder.BuildRequirementVerificationUsage(ownedRelatedElementOfRequirementUsageIterator.Current, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ResultExpressionMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ResultExpressionMembershipTextualNotationBuilder.cs index bd741750..82442930 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ResultExpressionMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ResultExpressionMembershipTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,8 +42,10 @@ public static partial class ResultExpressionMembershipTextualNotationBuilder /// 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); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfExpressionIterator.MoveNext(); + ExpressionTextualNotationBuilder.BuildOwnedExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReturnParameterMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReturnParameterMembershipTextualNotationBuilder.cs index fc6051a9..6cf95b1d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReturnParameterMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReturnParameterMembershipTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,9 +42,11 @@ public static partial class ReturnParameterMembershipTextualNotationBuilder /// 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 "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfUsageIterator.MoveNext(); + UsageTextualNotationBuilder.BuildUsageElement(ownedRelatedElementOfUsageIterator.Current, stringBuilder); } @@ -55,9 +58,11 @@ public static void BuildReturnParameterMember(SysML2.NET.Core.POCO.Kernel.Functi /// 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 "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfFeatureIterator.MoveNext(); + FeatureTextualNotationBuilder.BuildFeatureElement(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); } @@ -69,7 +74,9 @@ public static void BuildReturnFeatureMember(SysML2.NET.Core.POCO.Kernel.Function /// The that contains the entire textual notation public static void BuildEmptyResultMember(SysML2.NET.Core.POCO.Kernel.Functions.IReturnParameterMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfReferenceUsageIterator.MoveNext(); + ReferenceUsageTextualNotationBuilder.BuildEmptyFeature(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); } @@ -81,7 +88,9 @@ public static void BuildEmptyResultMember(SysML2.NET.Core.POCO.Kernel.Functions. /// The that contains the entire textual notation public static void BuildConstructorResultMember(SysML2.NET.Core.POCO.Kernel.Functions.IReturnParameterMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfFeatureIterator.MoveNext(); + FeatureTextualNotationBuilder.BuildConstructorResult(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.cs index b7f95900..0d6e3994 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,6 +42,8 @@ public static partial class SatisfyRequirementUsageTextualNotationBuilder /// 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"); @@ -50,10 +53,11 @@ public static void BuildSatisfyRequirementUsage(SysML2.NET.Core.POCO.Systems.Req throw new System.NotSupportedException("Multiple alternatives not implemented yet"); stringBuilder.Append(' '); FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); - if (poco.OwnedRelationship.Count != 0) + + if (ownedRelationshipOfSubjectMembershipIterator.MoveNext()) { stringBuilder.Append("by "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + SubjectMembershipTextualNotationBuilder.BuildSatisfactionSubjectMember(ownedRelationshipOfSubjectMembershipIterator.Current, stringBuilder); stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SelectExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SelectExpressionTextualNotationBuilder.cs index 1195b653..e0d1f413 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SelectExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SelectExpressionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,9 +42,12 @@ public static partial class SelectExpressionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildSelectExpression(SysML2.NET.Core.POCO.Kernel.Expressions.ISelectExpression poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + ParameterMembershipTextualNotationBuilder.BuildPrimaryArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); stringBuilder.Append(".? "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + ParameterMembershipTextualNotationBuilder.BuildBodyArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.cs index c4829fc6..075a2ce4 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,6 +42,7 @@ public static partial class SendActionUsageTextualNotationBuilder /// 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 "); @@ -57,9 +59,11 @@ public static void BuildSendNode(SysML2.NET.Core.POCO.Systems.Actions.ISendActio /// 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 "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); BuildSenderReceiverPart(poco, stringBuilder); } @@ -98,6 +102,14 @@ public static void BuildTransitionSendActionUsage(SysML2.NET.Core.POCO.Systems.A { BuildSendNodeDeclaration(poco, stringBuilder); + if (BuildGroupConditionForTransitionSendActionUsage(poco)) + { + stringBuilder.Append("{"); + TypeTextualNotationBuilder.BuildActionBodyItem(poco, stringBuilder); + stringBuilder.Append("}"); + stringBuilder.Append(' '); + } + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.cs index 971380f3..05282fd1 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -76,6 +77,13 @@ public static void BuildGeneralType(SysML2.NET.Core.POCO.Core.Types.ISpecializat 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"); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StakeholderMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StakeholderMembershipTextualNotationBuilder.cs index 56414522..f6a5d022 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StakeholderMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StakeholderMembershipTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,8 +42,10 @@ public static partial class StakeholderMembershipTextualNotationBuilder /// 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); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfPartUsageIterator.MoveNext(); + PartUsageTextualNotationBuilder.BuildStakeholderUsage(ownedRelatedElementOfPartUsageIterator.Current, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateDefinitionTextualNotationBuilder.cs index e499d380..ed74d6cf 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateDefinitionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateSubactionMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateSubactionMembershipTextualNotationBuilder.cs index f715fe7f..9b3cf0a1 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateSubactionMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateSubactionMembershipTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,9 +42,11 @@ public static partial class StateSubactionMembershipTextualNotationBuilder /// 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()); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfActionUsageIterator.MoveNext(); + ActionUsageTextualNotationBuilder.BuildStateActionUsage(ownedRelatedElementOfActionUsageIterator.Current, stringBuilder); } @@ -55,9 +58,11 @@ public static void BuildEntryActionMember(SysML2.NET.Core.POCO.Systems.States.IS /// 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()); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfActionUsageIterator.MoveNext(); + ActionUsageTextualNotationBuilder.BuildStateActionUsage(ownedRelatedElementOfActionUsageIterator.Current, stringBuilder); } @@ -69,9 +74,11 @@ public static void BuildDoActionMember(SysML2.NET.Core.POCO.Systems.States.IStat /// 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()); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfActionUsageIterator.MoveNext(); + ActionUsageTextualNotationBuilder.BuildStateActionUsage(ownedRelatedElementOfActionUsageIterator.Current, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateUsageTextualNotationBuilder.cs index 0db5fdab..3515d42c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StepTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StepTextualNotationBuilder.cs index 08d12ffd..e0552084 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StepTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StepTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,14 +42,15 @@ public static partial class StepTextualNotationBuilder /// 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(' '); - if (poco.OwnedRelationship.Count != 0) + + while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - stringBuilder.Append(' '); - } + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } stringBuilder.Append("step "); FeatureTextualNotationBuilder.BuildFeatureDeclaration(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StructureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StructureTextualNotationBuilder.cs index 20cb543c..cf7cd214 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StructureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StructureTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.cs index 5b3cacf9..01021c75 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -54,6 +55,13 @@ public static void BuildOwnedSubclassification(SysML2.NET.Core.POCO.Core.Classif 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 "); throw new System.NotSupportedException("Assigment of non-string value not yet supported"); throw new System.NotSupportedException("Multiple alternatives not implemented yet"); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubjectMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubjectMembershipTextualNotationBuilder.cs index 3ad8096a..03a9b85a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubjectMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubjectMembershipTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,8 +42,10 @@ public static partial class SubjectMembershipTextualNotationBuilder /// 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); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfReferenceUsageIterator.MoveNext(); + ReferenceUsageTextualNotationBuilder.BuildSubjectUsage(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); } @@ -54,7 +57,9 @@ public static void BuildSubjectMember(SysML2.NET.Core.POCO.Systems.Requirements. /// The that contains the entire textual notation public static void BuildSatisfactionSubjectMember(SysML2.NET.Core.POCO.Systems.Requirements.ISubjectMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfReferenceUsageIterator.MoveNext(); + ReferenceUsageTextualNotationBuilder.BuildSatisfactionParameter(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.cs index 0eab1d88..65f53846 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -53,6 +54,13 @@ public static void BuildOwnedSubsetting(SysML2.NET.Core.POCO.Core.Features.ISubs 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"); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionAsUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionAsUsageTextualNotationBuilder.cs index 20e813c3..f5d4bc4a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionAsUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionAsUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,7 +42,9 @@ public static partial class SuccessionAsUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildSourceSuccession(SysML2.NET.Core.POCO.Systems.Connections.ISuccessionAsUsage poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfEndFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + EndFeatureMembershipTextualNotationBuilder.BuildSourceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); } @@ -53,9 +56,12 @@ public static void BuildSourceSuccession(SysML2.NET.Core.POCO.Systems.Connection /// The that contains the entire textual notation public static void BuildTargetSuccession(SysML2.NET.Core.POCO.Systems.Connections.ISuccessionAsUsage poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfEndFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + EndFeatureMembershipTextualNotationBuilder.BuildSourceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); stringBuilder.Append("then "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); } @@ -67,12 +73,22 @@ public static void BuildTargetSuccession(SysML2.NET.Core.POCO.Systems.Connection /// 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 "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); stringBuilder.Append("then "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); UsageTextualNotationBuilder.BuildUsageBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowTextualNotationBuilder.cs index 4765066e..77c0e3d4 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,14 +42,15 @@ public static partial class SuccessionFlowTextualNotationBuilder /// 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(' '); - if (poco.OwnedRelationship.Count != 0) + + while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - stringBuilder.Append(' '); - } + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } stringBuilder.Append("succession "); stringBuilder.Append("flow "); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowUsageTextualNotationBuilder.cs index 5cf15568..d54f23d9 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionTextualNotationBuilder.cs index da9276a0..ee566bb7 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,8 +42,11 @@ public static partial class SuccessionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildTransitionSuccession(SysML2.NET.Core.POCO.Kernel.Connectors.ISuccession poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfEndFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + EndFeatureMembershipTextualNotationBuilder.BuildEmptyEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); } @@ -65,14 +69,15 @@ public static void BuildSuccessionDeclaration(SysML2.NET.Core.POCO.Kernel.Connec /// 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(' '); - if (poco.OwnedRelationship.Count != 0) + + while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - stringBuilder.Append(' '); - } + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } stringBuilder.Append("succession "); BuildSuccessionDeclaration(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TerminateActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TerminateActionUsageTextualNotationBuilder.cs index 3592a3ac..e9f63b7c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TerminateActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TerminateActionUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,12 +42,14 @@ public static partial class TerminateActionUsageTextualNotationBuilder /// 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 (poco.OwnedRelationship.Count != 0) + + if (ownedRelationshipOfParameterMembershipIterator.MoveNext()) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TextualRepresentationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TextualRepresentationTextualNotationBuilder.cs index 3123697d..e2fc7c20 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TextualRepresentationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TextualRepresentationTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -42,6 +43,13 @@ public static partial class TextualRepresentationTextualNotationBuilder 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); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionFeatureMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionFeatureMembershipTextualNotationBuilder.cs index f9b3b079..9ac50fa3 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionFeatureMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionFeatureMembershipTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,9 +42,11 @@ public static partial class TransitionFeatureMembershipTextualNotationBuilder /// 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 "); // Assignment Element : kind = 'trigger' - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfAcceptActionUsageIterator.MoveNext(); + AcceptActionUsageTextualNotationBuilder.BuildTriggerAction(ownedRelatedElementOfAcceptActionUsageIterator.Current, stringBuilder); } @@ -55,9 +58,11 @@ public static void BuildTriggerActionMember(SysML2.NET.Core.POCO.Systems.States. /// 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 "); // Assignment Element : kind = 'guard' - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfExpressionIterator.MoveNext(); + ExpressionTextualNotationBuilder.BuildOwnedExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); } @@ -69,9 +74,11 @@ public static void BuildGuardExpressionMember(SysML2.NET.Core.POCO.Systems.State /// 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 "); // Assignment Element : kind = 'effect' - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfActionUsageIterator.MoveNext(); + ActionUsageTextualNotationBuilder.BuildEffectBehaviorUsage(ownedRelatedElementOfActionUsageIterator.Current, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionUsageTextualNotationBuilder.cs index 80890ab0..1114b93b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,9 +42,13 @@ public static partial class TransitionUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildGuardedTargetSuccession(SysML2.NET.Core.POCO.Systems.States.ITransitionUsage poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfTransitionFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfTransitionFeatureMembershipIterator.MoveNext(); + TransitionFeatureMembershipTextualNotationBuilder.BuildGuardExpressionMember(ownedRelationshipOfTransitionFeatureMembershipIterator.Current, stringBuilder); stringBuilder.Append("then "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfOwningMembershipIterator.MoveNext(); + OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); } @@ -55,8 +60,10 @@ public static void BuildGuardedTargetSuccession(SysML2.NET.Core.POCO.Systems.Sta /// 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 "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfOwningMembershipIterator.MoveNext(); + OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); } @@ -68,12 +75,25 @@ public static void BuildDefaultTargetSuccession(SysML2.NET.Core.POCO.Systems.Sta /// 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 "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfMembershipIterator.MoveNext(); + MembershipTextualNotationBuilder.BuildFeatureChainMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + ownedRelationshipOfTransitionFeatureMembershipIterator.MoveNext(); + TransitionFeatureMembershipTextualNotationBuilder.BuildGuardExpressionMember(ownedRelationshipOfTransitionFeatureMembershipIterator.Current, stringBuilder); stringBuilder.Append("then "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfOwningMembershipIterator.MoveNext(); + OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); UsageTextualNotationBuilder.BuildUsageBody(poco, stringBuilder); } @@ -86,10 +106,15 @@ public static void BuildGuardedSuccession(SysML2.NET.Core.POCO.Systems.States.IT /// The that contains the entire textual notation public static void BuildTargetTransitionUsage(SysML2.NET.Core.POCO.Systems.States.ITransitionUsage poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfTransitionFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + ParameterMembershipTextualNotationBuilder.BuildEmptyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); throw new System.NotSupportedException("Multiple alternatives not implemented yet"); stringBuilder.Append("then "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfOwningMembershipIterator.MoveNext(); + OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); } @@ -102,31 +127,48 @@ public static void BuildTargetTransitionUsage(SysML2.NET.Core.POCO.Systems.State /// 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 "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - if (poco.OwnedRelationship.Count != 0) + if (BuildGroupConditionForTransitionUsage(poco)) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + stringBuilder.Append("first "); stringBuilder.Append(' '); } - if (poco.OwnedRelationship.Count != 0) + ownedRelationshipOfMembershipIterator.MoveNext(); + MembershipTextualNotationBuilder.BuildFeatureChainMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + ParameterMembershipTextualNotationBuilder.BuildEmptyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.MoveNext()) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ParameterMembershipTextualNotationBuilder.BuildEmptyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + TransitionFeatureMembershipTextualNotationBuilder.BuildTriggerActionMember(ownedRelationshipOfTransitionFeatureMembershipIterator.Current, stringBuilder); stringBuilder.Append(' '); } - if (poco.OwnedRelationship.Count != 0) + + if (ownedRelationshipOfTransitionFeatureMembershipIterator.MoveNext()) + { + TransitionFeatureMembershipTextualNotationBuilder.BuildGuardExpressionMember(ownedRelationshipOfTransitionFeatureMembershipIterator.Current, stringBuilder); + stringBuilder.Append(' '); + } + + + if (ownedRelationshipOfTransitionFeatureMembershipIterator.MoveNext()) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + TransitionFeatureMembershipTextualNotationBuilder.BuildEffectBehaviorMember(ownedRelationshipOfTransitionFeatureMembershipIterator.Current, stringBuilder); stringBuilder.Append(' '); } stringBuilder.Append("then "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfOwningMembershipIterator.MoveNext(); + OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TriggerInvocationExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TriggerInvocationExpressionTextualNotationBuilder.cs index 6d17b9a3..91d8ba09 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TriggerInvocationExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TriggerInvocationExpressionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeFeaturingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeFeaturingTextualNotationBuilder.cs index 7689a67b..d05381b2 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeFeaturingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeFeaturingTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -55,6 +56,13 @@ public static void BuildTypeFeaturing(SysML2.NET.Core.POCO.Core.Features.ITypeFe { stringBuilder.Append("featuring "); + if (BuildGroupConditionForTypeFeaturing(poco)) + { + ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + stringBuilder.Append("of "); + stringBuilder.Append(' '); + } + throw new System.NotSupportedException("Assigment of non-string value not yet supported"); stringBuilder.Append("by "); throw new System.NotSupportedException("Assigment of non-string value not yet supported"); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs index 9e681d7b..421ad425 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -129,10 +130,12 @@ public static void BuildCalculationBody(SysML2.NET.Core.POCO.Core.Types.IType po /// 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 (poco.OwnedRelationship.Count != 0) + + if (ownedRelationshipOfResultExpressionMembershipIterator.MoveNext()) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ResultExpressionMembershipTextualNotationBuilder.BuildResultExpressionMember(ownedRelationshipOfResultExpressionMembershipIterator.Current, stringBuilder); stringBuilder.Append(' '); } @@ -213,18 +216,20 @@ public static void BuildMetadataBody(SysML2.NET.Core.POCO.Core.Types.IType poco, /// 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(' '); } - if (poco.OwnedRelationship.Count != 0) + + while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - stringBuilder.Append(' '); - } + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } } @@ -236,6 +241,8 @@ public static void BuildTypePrefix(SysML2.NET.Core.POCO.Core.Types.IType poco, S /// 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"); @@ -243,13 +250,16 @@ public static void BuildTypeDeclaration(SysML2.NET.Core.POCO.Core.Types.IType po } ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); - if (poco.OwnedRelationship.Count != 0) + + if (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + OwningMembershipTextualNotationBuilder.BuildOwnedMultiplicity(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); stringBuilder.Append(' '); } - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } stringBuilder.Append(' '); BuildTypeRelationshipPart(poco, stringBuilder); @@ -263,15 +273,17 @@ public static void BuildTypeDeclaration(SysML2.NET.Core.POCO.Core.Types.IType po /// 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"); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - if (poco.OwnedRelationship.Count != 0) + ownedRelationshipOfSpecializationIterator.MoveNext(); + SpecializationTextualNotationBuilder.BuildOwnedSpecialization(ownedRelationshipOfSpecializationIterator.Current, stringBuilder); + + while (ownedRelationshipOfSpecializationIterator.MoveNext()) { stringBuilder.Append(","); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - stringBuilder.Append(' '); - } + SpecializationTextualNotationBuilder.BuildOwnedSpecialization(ownedRelationshipOfSpecializationIterator.Current, stringBuilder); + } } @@ -283,8 +295,10 @@ public static void BuildSpecializationPart(SysML2.NET.Core.POCO.Core.Types.IType /// 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"); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelationshipOfConjugationIterator.MoveNext(); + ConjugationTextualNotationBuilder.BuildOwnedConjugation(ownedRelationshipOfConjugationIterator.Current, stringBuilder); } @@ -307,16 +321,18 @@ public static void BuildTypeRelationshipPart(SysML2.NET.Core.POCO.Core.Types.ITy /// 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 "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - if (poco.OwnedRelationship.Count != 0) + ownedRelationshipOfDisjoiningIterator.MoveNext(); + DisjoiningTextualNotationBuilder.BuildOwnedDisjoining(ownedRelationshipOfDisjoiningIterator.Current, stringBuilder); + + while (ownedRelationshipOfDisjoiningIterator.MoveNext()) { stringBuilder.Append(","); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - stringBuilder.Append(' '); - } + DisjoiningTextualNotationBuilder.BuildOwnedDisjoining(ownedRelationshipOfDisjoiningIterator.Current, stringBuilder); + } } @@ -328,15 +344,17 @@ public static void BuildDisjoiningPart(SysML2.NET.Core.POCO.Core.Types.IType poc /// 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 "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - if (poco.OwnedRelationship.Count != 0) + ownedRelationshipOfUnioningIterator.MoveNext(); + UnioningTextualNotationBuilder.BuildUnioning(ownedRelationshipOfUnioningIterator.Current, stringBuilder); + + while (ownedRelationshipOfUnioningIterator.MoveNext()) { stringBuilder.Append(","); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - stringBuilder.Append(' '); - } + UnioningTextualNotationBuilder.BuildUnioning(ownedRelationshipOfUnioningIterator.Current, stringBuilder); + } } @@ -348,15 +366,17 @@ public static void BuildUnioningPart(SysML2.NET.Core.POCO.Core.Types.IType poco, /// 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 "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - if (poco.OwnedRelationship.Count != 0) + ownedRelationshipOfIntersectingIterator.MoveNext(); + IntersectingTextualNotationBuilder.BuildIntersecting(ownedRelationshipOfIntersectingIterator.Current, stringBuilder); + + while (ownedRelationshipOfIntersectingIterator.MoveNext()) { stringBuilder.Append(","); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - stringBuilder.Append(' '); - } + IntersectingTextualNotationBuilder.BuildIntersecting(ownedRelationshipOfIntersectingIterator.Current, stringBuilder); + } } @@ -368,15 +388,17 @@ public static void BuildIntersectingPart(SysML2.NET.Core.POCO.Core.Types.IType p /// 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 "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - if (poco.OwnedRelationship.Count != 0) + ownedRelationshipOfDifferencingIterator.MoveNext(); + DifferencingTextualNotationBuilder.BuildDifferencing(ownedRelationshipOfDifferencingIterator.Current, stringBuilder); + + while (ownedRelationshipOfDifferencingIterator.MoveNext()) { stringBuilder.Append(","); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - stringBuilder.Append(' '); - } + DifferencingTextualNotationBuilder.BuildDifferencing(ownedRelationshipOfDifferencingIterator.Current, stringBuilder); + } } @@ -421,10 +443,17 @@ public static void BuildFunctionBody(SysML2.NET.Core.POCO.Core.Types.IType poco, /// The that contains the entire textual notation public static void BuildFunctionBodyPart(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - if (poco.OwnedRelationship.Count != 0) + 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()) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ResultExpressionMembershipTextualNotationBuilder.BuildResultExpressionMember(ownedRelationshipOfResultExpressionMembershipIterator.Current, stringBuilder); stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UnioningTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UnioningTextualNotationBuilder.cs index 184ffe9e..808c514a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UnioningTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UnioningTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs index c72a6019..238a8528 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -52,12 +53,14 @@ public static void BuildUsageElement(SysML2.NET.Core.POCO.Systems.DefinitionAndU /// 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"); @@ -65,6 +68,7 @@ public static void BuildRefPrefix(SysML2.NET.Core.POCO.Systems.DefinitionAndUsag } throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + if (poco.IsConstant) { stringBuilder.Append("constant"); @@ -83,6 +87,7 @@ public static void BuildRefPrefix(SysML2.NET.Core.POCO.Systems.DefinitionAndUsag public static void BuildBasicUsagePrefix(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) { BuildRefPrefix(poco, stringBuilder); + if (poco.isReference) { stringBuilder.Append("ref"); @@ -100,10 +105,12 @@ public static void BuildBasicUsagePrefix(SysML2.NET.Core.POCO.Systems.Definition /// 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 (poco.OwnedRelationship.Count != 0) + + if (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + OwningMembershipTextualNotationBuilder.BuildOwnedCrossFeatureMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); stringBuilder.Append(' '); } @@ -118,7 +125,9 @@ public static void BuildEndUsagePrefix(SysML2.NET.Core.POCO.Systems.DefinitionAn /// The that contains the entire textual notation public static void BuildUsageExtensionKeyword(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfOwningMembershipIterator.MoveNext(); + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseDefinitionTextualNotationBuilder.cs index 200bbf75..2bff9828 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseDefinitionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseUsageTextualNotationBuilder.cs index edb9dbb8..459abd46 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VariantMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VariantMembershipTextualNotationBuilder.cs index 47d4575c..e4e42d21 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VariantMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VariantMembershipTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -55,8 +56,10 @@ public static void BuildVariantUsageMember(SysML2.NET.Core.POCO.Systems.Definiti /// 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); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfEnumerationUsageIterator.MoveNext(); + EnumerationUsageTextualNotationBuilder.BuildEnumeratedValue(ownedRelatedElementOfEnumerationUsageIterator.Current, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseDefinitionTextualNotationBuilder.cs index 5b56142f..18c99b5c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseDefinitionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseUsageTextualNotationBuilder.cs index 00116d92..699b3e55 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs index 8dcc0e5f..acad0ebd 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewRenderingMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewRenderingMembershipTextualNotationBuilder.cs index 912be900..6f679e46 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewRenderingMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewRenderingMembershipTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,9 +42,11 @@ public static partial class ViewRenderingMembershipTextualNotationBuilder /// 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 "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ownedRelatedElementOfRenderingUsageIterator.MoveNext(); + RenderingUsageTextualNotationBuilder.BuildViewRenderingUsage(ownedRelatedElementOfRenderingUsageIterator.Current, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs index 1269af97..d5f27452 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointDefinitionTextualNotationBuilder.cs index 8f9952aa..ed73cc1f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointDefinitionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointUsageTextualNotationBuilder.cs index fb78fe85..58d03e70 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VisibilityKindTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VisibilityKindTextualNotationBuilder.cs index a76da1f8..da48d0a7 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VisibilityKindTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VisibilityKindTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/WhileLoopActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/WhileLoopActionUsageTextualNotationBuilder.cs index cccd2e57..aa1baa19 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/WhileLoopActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/WhileLoopActionUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -41,14 +42,17 @@ public static partial class WhileLoopActionUsageTextualNotationBuilder /// 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(' '); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); - if (poco.OwnedRelationship.Count != 0) + ownedRelationshipOfParameterMembershipIterator.MoveNext(); + ParameterMembershipTextualNotationBuilder.BuildActionBodyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.MoveNext()) { stringBuilder.Append("until "); - throw new System.NotSupportedException("Assigment of enumerable not supported yet"); + ParameterMembershipTextualNotationBuilder.BuildExpressionParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); stringBuilder.Append(";"); stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/BindingConnectorAsUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/BindingConnectorAsUsageTextualNotationBuilder.cs new file mode 100644 index 00000000..986169e2 --- /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 false; + } + } +} diff --git a/SysML2.NET/TextualNotation/CommentTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/CommentTextualNotationBuilder.cs new file mode 100644 index 00000000..dd44157a --- /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 false; + } + } +} diff --git a/SysML2.NET/TextualNotation/ConjugationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/ConjugationTextualNotationBuilder.cs new file mode 100644 index 00000000..73a258ad --- /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 false; + } + } +} diff --git a/SysML2.NET/TextualNotation/DependencyTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/DependencyTextualNotationBuilder.cs new file mode 100644 index 00000000..d9010de3 --- /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 false; + } + } +} diff --git a/SysML2.NET/TextualNotation/DisjoiningTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/DisjoiningTextualNotationBuilder.cs new file mode 100644 index 00000000..c70de6d5 --- /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 false; + } + } +} diff --git a/SysML2.NET/TextualNotation/FeatureInvertingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/FeatureInvertingTextualNotationBuilder.cs new file mode 100644 index 00000000..35c3612b --- /dev/null +++ b/SysML2.NET/TextualNotation/FeatureInvertingTextualNotationBuilder.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 FeatureInvertingTextualNotationBuilder + { + /// + /// Builds the conditional part for the FeatureInverting rule + /// + /// The + /// The assertion of the condition + private static bool BuildGroupConditionForFeatureInverting(IFeatureInverting poco) + { + return false; + } + } +} diff --git a/SysML2.NET/TextualNotation/IfActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/IfActionUsageTextualNotationBuilder.cs new file mode 100644 index 00000000..40a398f5 --- /dev/null +++ b/SysML2.NET/TextualNotation/IfActionUsageTextualNotationBuilder.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 IfActionUsageTextualNotationBuilder + { + /// + /// Builds the conditional part for the IfNode rule + /// + /// The + /// The assertion of the condition + private static bool BuildGroupConditionForIfNode(IIfActionUsage poco) + { + return false; + } + } +} diff --git a/SysML2.NET/TextualNotation/InvocationExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/InvocationExpressionTextualNotationBuilder.cs new file mode 100644 index 00000000..8cd8fe57 --- /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 00000000..1554aab6 --- /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 false; + } + } +} diff --git a/SysML2.NET/TextualNotation/MetadataUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/MetadataUsageTextualNotationBuilder.cs new file mode 100644 index 00000000..7fd6d5a7 --- /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 false; + } + } +} diff --git a/SysML2.NET/TextualNotation/PackageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/PackageTextualNotationBuilder.cs new file mode 100644 index 00000000..0ea35d1e --- /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 00000000..313f0785 --- /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 false; + } + } +} diff --git a/SysML2.NET/TextualNotation/RedefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/RedefinitionTextualNotationBuilder.cs new file mode 100644 index 00000000..9033fc53 --- /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 false; + } + } +} diff --git a/SysML2.NET/TextualNotation/SendActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/SendActionUsageTextualNotationBuilder.cs new file mode 100644 index 00000000..67383328 --- /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 false; + } + } +} diff --git a/SysML2.NET/TextualNotation/SpecializationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/SpecializationTextualNotationBuilder.cs new file mode 100644 index 00000000..774439f3 --- /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 false; + } + } +} diff --git a/SysML2.NET/TextualNotation/SubclassificationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/SubclassificationTextualNotationBuilder.cs new file mode 100644 index 00000000..98647c2c --- /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 false; + } + } +} diff --git a/SysML2.NET/TextualNotation/SubsettingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/SubsettingTextualNotationBuilder.cs new file mode 100644 index 00000000..ddde874f --- /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 false; + } + } +} diff --git a/SysML2.NET/TextualNotation/SuccessionAsUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/SuccessionAsUsageTextualNotationBuilder.cs new file mode 100644 index 00000000..664035d7 --- /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 false; + } + } +} diff --git a/SysML2.NET/TextualNotation/TextualRepresentationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/TextualRepresentationTextualNotationBuilder.cs new file mode 100644 index 00000000..0ebcf161 --- /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 false; + } + } +} diff --git a/SysML2.NET/TextualNotation/TransitionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/TransitionUsageTextualNotationBuilder.cs new file mode 100644 index 00000000..284bced0 --- /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 false; + } + + /// + /// Builds the conditional part for the TransitionUsage rule + /// + /// The + /// The assertion of the condition + private static bool BuildGroupConditionForTransitionUsage(ITransitionUsage poco) + { + return false; + } + } +} diff --git a/SysML2.NET/TextualNotation/TypeFeaturingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/TypeFeaturingTextualNotationBuilder.cs new file mode 100644 index 00000000..8d8914da --- /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 false; + } + } +} From 7114f6cdf7befb9aa64c3608970d1641c751859a Mon Sep 17 00:00:00 2001 From: atheate Date: Wed, 4 Mar 2026 13:37:32 +0100 Subject: [PATCH 10/33] [WIP] Implementation of hand-coded conditional checks --- ...AcceptActionUsageTextualNotationBuilder.cs | 2 +- .../ActionUsageTextualNotationBuilder.cs | 4 +- ...gnmentActionUsageTextualNotationBuilder.cs | 5 +- ...gConnectorAsUsageTextualNotationBuilder.cs | 2 +- .../CommentTextualNotationBuilder.cs | 2 +- .../CommonTextualNotationBuilder.cs | 54 +++++++++++++++++++ .../ConjugationTextualNotationBuilder.cs | 2 +- .../DependencyTextualNotationBuilder.cs | 2 +- .../DisjoiningTextualNotationBuilder.cs | 2 +- .../FeatureInvertingTextualNotationBuilder.cs | 4 +- .../IfActionUsageTextualNotationBuilder.cs | 5 +- .../MetadataFeatureTextualNotationBuilder.cs | 2 +- .../MetadataUsageTextualNotationBuilder.cs | 2 +- ...erformActionUsageTextualNotationBuilder.cs | 2 +- .../RedefinitionTextualNotationBuilder.cs | 2 +- .../SendActionUsageTextualNotationBuilder.cs | 2 +- .../SpecializationTextualNotationBuilder.cs | 2 +- ...SubclassificationTextualNotationBuilder.cs | 2 +- .../SubsettingTextualNotationBuilder.cs | 2 +- ...SuccessionAsUsageTextualNotationBuilder.cs | 2 +- ...ualRepresentationTextualNotationBuilder.cs | 2 +- .../TransitionUsageTextualNotationBuilder.cs | 4 +- .../TypeFeaturingTextualNotationBuilder.cs | 2 +- 23 files changed, 86 insertions(+), 24 deletions(-) create mode 100644 SysML2.NET/TextualNotation/CommonTextualNotationBuilder.cs diff --git a/SysML2.NET/TextualNotation/AcceptActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AcceptActionUsageTextualNotationBuilder.cs index c48d60bd..4a228022 100644 --- a/SysML2.NET/TextualNotation/AcceptActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AcceptActionUsageTextualNotationBuilder.cs @@ -34,7 +34,7 @@ public static partial class AcceptActionUsageTextualNotationBuilder /// The assertion of the condition private static bool BuildGroupConditionForTransitionAcceptActionUsage(IAcceptActionUsage poco) { - return false; + return poco.OwnedRelationship.Count != 0; } } } diff --git a/SysML2.NET/TextualNotation/ActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/ActionUsageTextualNotationBuilder.cs index a35780dd..2345afd7 100644 --- a/SysML2.NET/TextualNotation/ActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/ActionUsageTextualNotationBuilder.cs @@ -34,7 +34,7 @@ public static partial class ActionUsageTextualNotationBuilder /// The assertion of the condition private static bool BuildGroupConditionForActionBodyParameter(IActionUsage poco) { - return false; + return CommonTextualNotationBuilder.DoesDefinesUsageDeclaration(poco); } /// @@ -44,7 +44,7 @@ private static bool BuildGroupConditionForActionBodyParameter(IActionUsage poco) /// The assertion of the condition private static bool BuildGroupConditionForAssignmentNodeDeclaration(IActionUsage poco) { - return false; + return CommonTextualNotationBuilder.DoesDefinesUsageDeclaration(poco); } } } diff --git a/SysML2.NET/TextualNotation/AssignmentActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AssignmentActionUsageTextualNotationBuilder.cs index cd8d98ae..a6aa6abc 100644 --- a/SysML2.NET/TextualNotation/AssignmentActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AssignmentActionUsageTextualNotationBuilder.cs @@ -20,6 +20,9 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; + + using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Core.POCO.Systems.Actions; /// @@ -34,7 +37,7 @@ public static partial class AssignmentActionUsageTextualNotationBuilder /// The assertion of the condition private static bool BuildGroupConditionForTransitionAssignmentActionUsage(IAssignmentActionUsage poco) { - return false; + return poco.OwnedRelationship.OfType().Any(); } } } diff --git a/SysML2.NET/TextualNotation/BindingConnectorAsUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/BindingConnectorAsUsageTextualNotationBuilder.cs index 986169e2..448b9cf4 100644 --- a/SysML2.NET/TextualNotation/BindingConnectorAsUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/BindingConnectorAsUsageTextualNotationBuilder.cs @@ -34,7 +34,7 @@ public static partial class BindingConnectorAsUsageTextualNotationBuilder /// The assertion of the condition private static bool BuildGroupConditionForBindingConnectorAsUsage(IBindingConnectorAsUsage poco) { - return false; + return CommonTextualNotationBuilder.DoesDefinesUsageDeclaration(poco); } } } diff --git a/SysML2.NET/TextualNotation/CommentTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/CommentTextualNotationBuilder.cs index dd44157a..02fa70d2 100644 --- a/SysML2.NET/TextualNotation/CommentTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/CommentTextualNotationBuilder.cs @@ -34,7 +34,7 @@ public static partial class CommentTextualNotationBuilder /// The assertion of the condition private static bool BuildGroupConditionForComment(IComment poco) { - return false; + 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 00000000..08b21374 --- /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/ConjugationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/ConjugationTextualNotationBuilder.cs index 73a258ad..cb62745f 100644 --- a/SysML2.NET/TextualNotation/ConjugationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/ConjugationTextualNotationBuilder.cs @@ -34,7 +34,7 @@ public static partial class ConjugationTextualNotationBuilder /// The assertion of the condition private static bool BuildGroupConditionForConjugation(IConjugation poco) { - return false; + return CommonTextualNotationBuilder.DoesDefinesIdentificationProperties(poco); } } } diff --git a/SysML2.NET/TextualNotation/DependencyTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/DependencyTextualNotationBuilder.cs index d9010de3..1c400c22 100644 --- a/SysML2.NET/TextualNotation/DependencyTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/DependencyTextualNotationBuilder.cs @@ -34,7 +34,7 @@ public static partial class DependencyTextualNotationBuilder /// The assertion of the condition private static bool BuildGroupConditionForDependencyDeclaration(IDependency poco) { - return false; + return poco.Client.Count != 0 && poco.Supplier.Count != 0; } } } diff --git a/SysML2.NET/TextualNotation/DisjoiningTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/DisjoiningTextualNotationBuilder.cs index c70de6d5..6d39056b 100644 --- a/SysML2.NET/TextualNotation/DisjoiningTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/DisjoiningTextualNotationBuilder.cs @@ -34,7 +34,7 @@ public static partial class DisjoiningTextualNotationBuilder /// The assertion of the condition private static bool BuildGroupConditionForDisjoining(IDisjoining poco) { - return false; + return CommonTextualNotationBuilder.DoesDefinesIdentificationProperties(poco); } } } diff --git a/SysML2.NET/TextualNotation/FeatureInvertingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/FeatureInvertingTextualNotationBuilder.cs index 35c3612b..d4d7a919 100644 --- a/SysML2.NET/TextualNotation/FeatureInvertingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/FeatureInvertingTextualNotationBuilder.cs @@ -20,6 +20,8 @@ namespace SysML2.NET.TextualNotation { + using System.Buffers; + using SysML2.NET.Core.POCO.Core.Features; /// @@ -34,7 +36,7 @@ public static partial class FeatureInvertingTextualNotationBuilder /// The assertion of the condition private static bool BuildGroupConditionForFeatureInverting(IFeatureInverting poco) { - return false; + return CommonTextualNotationBuilder.DoesDefinesIdentificationProperties(poco); } } } diff --git a/SysML2.NET/TextualNotation/IfActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/IfActionUsageTextualNotationBuilder.cs index 40a398f5..4639c28c 100644 --- a/SysML2.NET/TextualNotation/IfActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/IfActionUsageTextualNotationBuilder.cs @@ -20,6 +20,9 @@ namespace SysML2.NET.TextualNotation { + using System.Linq; + + using SysML2.NET.Core.POCO.Kernel.Behaviors; using SysML2.NET.Core.POCO.Systems.Actions; /// @@ -34,7 +37,7 @@ public static partial class IfActionUsageTextualNotationBuilder /// The assertion of the condition private static bool BuildGroupConditionForIfNode(IIfActionUsage poco) { - return false; + return poco.OwnedRelationship.OfType().Count() != 0; } } } diff --git a/SysML2.NET/TextualNotation/MetadataFeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/MetadataFeatureTextualNotationBuilder.cs index 1554aab6..e4f7f8f6 100644 --- a/SysML2.NET/TextualNotation/MetadataFeatureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/MetadataFeatureTextualNotationBuilder.cs @@ -34,7 +34,7 @@ public static partial class MetadataFeatureTextualNotationBuilder /// The assertion of the condition private static bool BuildGroupConditionForMetadataFeatureDeclaration(IMetadataFeature poco) { - return false; + return CommonTextualNotationBuilder.DoesDefinesIdentificationProperties(poco); } } } diff --git a/SysML2.NET/TextualNotation/MetadataUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/MetadataUsageTextualNotationBuilder.cs index 7fd6d5a7..dea71f2f 100644 --- a/SysML2.NET/TextualNotation/MetadataUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/MetadataUsageTextualNotationBuilder.cs @@ -34,7 +34,7 @@ public static partial class MetadataUsageTextualNotationBuilder /// The assertion of the condition private static bool BuildGroupConditionForMetadataUsageDeclaration(IMetadataUsage poco) { - return false; + return CommonTextualNotationBuilder.DoesDefinesIdentificationProperties(poco); } } } diff --git a/SysML2.NET/TextualNotation/PerformActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/PerformActionUsageTextualNotationBuilder.cs index 313f0785..eb43b430 100644 --- a/SysML2.NET/TextualNotation/PerformActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/PerformActionUsageTextualNotationBuilder.cs @@ -34,7 +34,7 @@ public static partial class PerformActionUsageTextualNotationBuilder /// The assertion of the condition private static bool BuildGroupConditionForTransitionPerformActionUsage(IPerformActionUsage poco) { - return false; + return poco.OwnedRelationship.Count != 0; } } } diff --git a/SysML2.NET/TextualNotation/RedefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/RedefinitionTextualNotationBuilder.cs index 9033fc53..6386e12f 100644 --- a/SysML2.NET/TextualNotation/RedefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/RedefinitionTextualNotationBuilder.cs @@ -34,7 +34,7 @@ public static partial class RedefinitionTextualNotationBuilder /// The assertion of the condition private static bool BuildGroupConditionForRedefinition(IRedefinition poco) { - return false; + return CommonTextualNotationBuilder.DoesDefinesIdentificationProperties(poco); } } } diff --git a/SysML2.NET/TextualNotation/SendActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/SendActionUsageTextualNotationBuilder.cs index 67383328..3650ac5b 100644 --- a/SysML2.NET/TextualNotation/SendActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/SendActionUsageTextualNotationBuilder.cs @@ -34,7 +34,7 @@ public static partial class SendActionUsageTextualNotationBuilder /// The assertion of the condition private static bool BuildGroupConditionForTransitionSendActionUsage(ISendActionUsage poco) { - return false; + return poco.OwnedRelationship.Count != 0; } } } diff --git a/SysML2.NET/TextualNotation/SpecializationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/SpecializationTextualNotationBuilder.cs index 774439f3..2b9367b2 100644 --- a/SysML2.NET/TextualNotation/SpecializationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/SpecializationTextualNotationBuilder.cs @@ -34,7 +34,7 @@ public static partial class SpecializationTextualNotationBuilder /// The assertion of the condition private static bool BuildGroupConditionForSpecialization(ISpecialization poco) { - return false; + return CommonTextualNotationBuilder.DoesDefinesIdentificationProperties(poco); } } } diff --git a/SysML2.NET/TextualNotation/SubclassificationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/SubclassificationTextualNotationBuilder.cs index 98647c2c..ece86941 100644 --- a/SysML2.NET/TextualNotation/SubclassificationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/SubclassificationTextualNotationBuilder.cs @@ -34,7 +34,7 @@ public static partial class SubclassificationTextualNotationBuilder /// The assertion of the condition private static bool BuildGroupConditionForSubclassification(ISubclassification poco) { - return false; + return CommonTextualNotationBuilder.DoesDefinesIdentificationProperties(poco); } } } diff --git a/SysML2.NET/TextualNotation/SubsettingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/SubsettingTextualNotationBuilder.cs index ddde874f..bda14aa0 100644 --- a/SysML2.NET/TextualNotation/SubsettingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/SubsettingTextualNotationBuilder.cs @@ -34,7 +34,7 @@ public static partial class SubsettingTextualNotationBuilder /// The assertion of the condition private static bool BuildGroupConditionForSubsetting(ISubsetting poco) { - return false; + return CommonTextualNotationBuilder.DoesDefinesIdentificationProperties(poco); } } } diff --git a/SysML2.NET/TextualNotation/SuccessionAsUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/SuccessionAsUsageTextualNotationBuilder.cs index 664035d7..6881b77d 100644 --- a/SysML2.NET/TextualNotation/SuccessionAsUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/SuccessionAsUsageTextualNotationBuilder.cs @@ -34,7 +34,7 @@ public static partial class SuccessionAsUsageTextualNotationBuilder /// The assertion of the condition private static bool BuildGroupConditionForSuccessionAsUsage(ISuccessionAsUsage poco) { - return false; + return CommonTextualNotationBuilder.DoesDefinesUsageDeclaration(poco); } } } diff --git a/SysML2.NET/TextualNotation/TextualRepresentationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/TextualRepresentationTextualNotationBuilder.cs index 0ebcf161..ce7ea3e0 100644 --- a/SysML2.NET/TextualNotation/TextualRepresentationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/TextualRepresentationTextualNotationBuilder.cs @@ -34,7 +34,7 @@ public static partial class TextualRepresentationTextualNotationBuilder /// The assertion of the condition private static bool BuildGroupConditionForTextualRepresentation(ITextualRepresentation poco) { - return false; + return CommonTextualNotationBuilder.DoesDefinesIdentificationProperties(poco); } } } diff --git a/SysML2.NET/TextualNotation/TransitionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/TransitionUsageTextualNotationBuilder.cs index 284bced0..f455d8b5 100644 --- a/SysML2.NET/TextualNotation/TransitionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/TransitionUsageTextualNotationBuilder.cs @@ -34,7 +34,7 @@ public static partial class TransitionUsageTextualNotationBuilder /// The assertion of the condition private static bool BuildGroupConditionForGuardedSuccession(ITransitionUsage poco) { - return false; + return CommonTextualNotationBuilder.DoesDefinesUsageDeclaration(poco); } /// @@ -44,7 +44,7 @@ private static bool BuildGroupConditionForGuardedSuccession(ITransitionUsage poc /// The assertion of the condition private static bool BuildGroupConditionForTransitionUsage(ITransitionUsage poco) { - return false; + return CommonTextualNotationBuilder.DoesDefinesUsageDeclaration(poco); } } } diff --git a/SysML2.NET/TextualNotation/TypeFeaturingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/TypeFeaturingTextualNotationBuilder.cs index 8d8914da..570b7fbb 100644 --- a/SysML2.NET/TextualNotation/TypeFeaturingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/TypeFeaturingTextualNotationBuilder.cs @@ -34,7 +34,7 @@ public static partial class TypeFeaturingTextualNotationBuilder /// The assertion of the condition private static bool BuildGroupConditionForTypeFeaturing(ITypeFeaturing poco) { - return false; + return CommonTextualNotationBuilder.DoesDefinesIdentificationProperties(poco); } } } From dba1e446c11606956cce3f31ad4dd8d2faf35ab3 Mon Sep 17 00:00:00 2001 From: atheate Date: Thu, 5 Mar 2026 15:18:12 +0100 Subject: [PATCH 11/33] [WIP] Enhance generaion but missing logic (FeatureMembership issue) --- .../HandleBarHelpers/RulesHelper.cs | 168 +++++++++----- ...AcceptActionUsageTextualNotationBuilder.cs | 13 +- .../ActionUsageTextualNotationBuilder.cs | 18 +- .../ActorMembershipTextualNotationBuilder.cs | 6 +- .../AnnotationTextualNotationBuilder.cs | 23 +- ...gConnectorAsUsageTextualNotationBuilder.cs | 12 +- .../BindingConnectorTextualNotationBuilder.cs | 6 +- ...BooleanExpressionTextualNotationBuilder.cs | 6 +- .../ClassifierTextualNotationBuilder.cs | 30 ++- ...CollectExpressionTextualNotationBuilder.cs | 12 +- .../CommentTextualNotationBuilder.cs | 12 +- ...tedPortDefinitionTextualNotationBuilder.cs | 6 +- .../ConnectionUsageTextualNotationBuilder.cs | 30 ++- .../ConnectorTextualNotationBuilder.cs | 36 ++- ...tructorExpressionTextualNotationBuilder.cs | 12 +- .../DefinitionTextualNotationBuilder.cs | 6 +- .../DependencyTextualNotationBuilder.cs | 6 +- ...tFilterMembershipTextualNotationBuilder.cs | 12 +- ...FeatureMembershipTextualNotationBuilder.cs | 30 ++- ...ntOccurrenceUsageTextualNotationBuilder.cs | 6 +- .../ExpressionTextualNotationBuilder.cs | 12 +- ...reChainExpressionTextualNotationBuilder.cs | 12 +- .../FeatureChainingTextualNotationBuilder.cs | 2 +- ...FeatureMembershipTextualNotationBuilder.cs | 166 ++++++++++++-- ...ferenceExpressionTextualNotationBuilder.cs | 36 ++- .../FeatureTextualNotationBuilder.cs | 214 +++++++++++++++--- .../FeatureTypingTextualNotationBuilder.cs | 2 +- .../FeatureValueTextualNotationBuilder.cs | 93 +++++++- .../FlowEndTextualNotationBuilder.cs | 12 +- .../FlowTextualNotationBuilder.cs | 6 +- .../FlowUsageTextualNotationBuilder.cs | 2 +- ...orLoopActionUsageTextualNotationBuilder.cs | 18 +- ...ConcernMembershipTextualNotationBuilder.cs | 6 +- .../IfActionUsageTextualNotationBuilder.cs | 12 +- .../IndexExpressionTextualNotationBuilder.cs | 12 +- .../InterfaceUsageTextualNotationBuilder.cs | 30 ++- .../InvariantTextualNotationBuilder.cs | 6 +- ...ocationExpressionTextualNotationBuilder.cs | 30 ++- .../LibraryPackageTextualNotationBuilder.cs | 6 +- .../LiteralBooleanTextualNotationBuilder.cs | 2 +- .../MembershipImportTextualNotationBuilder.cs | 2 +- .../MembershipTextualNotationBuilder.cs | 11 +- ...aAccessExpressionTextualNotationBuilder.cs | 12 +- .../MetadataFeatureTextualNotationBuilder.cs | 30 ++- .../MetadataUsageTextualNotationBuilder.cs | 24 +- ...MultiplicityRangeTextualNotationBuilder.cs | 24 +- .../NamespaceTextualNotationBuilder.cs | 6 +- ...jectiveMembershipTextualNotationBuilder.cs | 6 +- ...urrenceDefinitionTextualNotationBuilder.cs | 12 +- .../OccurrenceUsageTextualNotationBuilder.cs | 6 +- ...peratorExpressionTextualNotationBuilder.cs | 126 +++++++++-- .../OwningMembershipTextualNotationBuilder.cs | 78 +++++-- .../PackageTextualNotationBuilder.cs | 18 +- ...rameterMembershipTextualNotationBuilder.cs | 96 ++++++-- .../PortDefinitionTextualNotationBuilder.cs | 8 +- .../PortUsageTextualNotationBuilder.cs | 12 +- .../RedefinitionTextualNotationBuilder.cs | 4 +- .../ReferenceUsageTextualNotationBuilder.cs | 54 ++++- ...straintMembershipTextualNotationBuilder.cs | 6 +- ...icationMembershipTextualNotationBuilder.cs | 8 +- ...ressionMembershipTextualNotationBuilder.cs | 6 +- ...rameterMembershipTextualNotationBuilder.cs | 24 +- ...yRequirementUsageTextualNotationBuilder.cs | 6 +- .../SelectExpressionTextualNotationBuilder.cs | 12 +- .../SendActionUsageTextualNotationBuilder.cs | 6 +- ...eholderMembershipTextualNotationBuilder.cs | 6 +- ...bactionMembershipTextualNotationBuilder.cs | 18 +- .../StepTextualNotationBuilder.cs | 6 +- ...SubclassificationTextualNotationBuilder.cs | 6 +- ...SubjectMembershipTextualNotationBuilder.cs | 12 +- ...SuccessionAsUsageTextualNotationBuilder.cs | 30 ++- .../SuccessionFlowTextualNotationBuilder.cs | 6 +- .../SuccessionTextualNotationBuilder.cs | 18 +- ...minateActionUsageTextualNotationBuilder.cs | 6 +- ...FeatureMembershipTextualNotationBuilder.cs | 24 +- .../TransitionUsageTextualNotationBuilder.cs | 90 ++++++-- .../TypeFeaturingTextualNotationBuilder.cs | 6 +- .../TypeTextualNotationBuilder.cs | 92 ++++++-- .../UsageTextualNotationBuilder.cs | 12 +- ...VariantMembershipTextualNotationBuilder.cs | 12 +- ...nderingMembershipTextualNotationBuilder.cs | 6 +- ...leLoopActionUsageTextualNotationBuilder.cs | 12 +- 82 files changed, 1698 insertions(+), 390 deletions(-) diff --git a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs index 55b4ae0b..226423f1 100644 --- a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs +++ b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs @@ -27,7 +27,6 @@ namespace SysML2.NET.CodeGenerator.HandleBarHelpers using HandlebarsDotNet; using SysML2.NET.CodeGenerator.Extensions; - using SysML2.NET.CodeGenerator.Grammar; using SysML2.NET.CodeGenerator.Grammar.Model; using uml4net.Classification; @@ -70,7 +69,9 @@ public static void RegisterRulesHelper(this IHandlebars handlebars) if (namedElement is IClass umlClass) { - ProcessAlternatives(writer, umlClass, textualRule.Alternatives, allRules, definedIterators: null); + var ruleGenerationContext = new RuleGenerationContext(); + ruleGenerationContext.AllRules.AddRange(allRules); + ProcessAlternatives(writer, umlClass, textualRule.Alternatives, ruleGenerationContext); } }); } @@ -81,21 +82,18 @@ public static void RegisterRulesHelper(this IHandlebars handlebars) /// The used to write into output content /// The related /// The collection of alternatives to process - /// A collection of all existing rules - /// Collection of that keep tracks of defined iterator - /// An optional that is calling this function - private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClass, IReadOnlyCollection alternatives, - IReadOnlyCollection rules, List definedIterators, RuleElement callerElement = null) + /// The current + private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClass, IReadOnlyCollection alternatives, RuleGenerationContext ruleGenerationContext) { - definedIterators ??= []; + ruleGenerationContext.DefinedIterators ??= []; if (alternatives.Count == 1) { var alternative = alternatives.ElementAt(0); var elements = alternative.Elements; - DeclareAllRequiredIterators(writer, umlClass, rules, alternative, definedIterators); + DeclareAllRequiredIterators(writer, umlClass, alternative, ruleGenerationContext); - if (callerElement is { IsOptional: true, IsCollection: false }) + if (ruleGenerationContext.CallerRule is { IsOptional: true, IsCollection: false }) { var targetPropertiesName = elements.OfType().Select(x => x.Property).Distinct().ToList(); var allProperties = umlClass.QueryAllProperties(); @@ -114,7 +112,7 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas if (property.QueryIsEnumerable()) { var assigment = elements.OfType().First(x => x.Property == targetPropertyName); - var iterator = definedIterators.FirstOrDefault(x => x.ApplicableRuleElements.Contains(assigment)); + var iterator = ruleGenerationContext.DefinedIterators.FirstOrDefault(x => x.ApplicableRuleElements.Contains(assigment)); ifStatementContent.Add(iterator == null ? $"BuildGroupConditionFor{assigment.TextualNotationRule.RuleName}(poco)" : property.QueryIfStatementContentForNonEmpty(iterator.IteratorVariableName)); } else @@ -129,27 +127,32 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas foreach (var textualRuleElement in elements) { - ProcessRuleElement(writer, umlClass, rules, textualRuleElement, definedIterators); + 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, rules, textualRuleElement, definedIterators); + ProcessRuleElement(writer, umlClass, textualRuleElement, ruleGenerationContext); } } - + + writer.WriteSafeString($"stringBuilder.Append(' ');{Environment.NewLine}"); writer.WriteSafeString($"}}{Environment.NewLine}"); } else { foreach (var textualRuleElement in elements) { - ProcessRuleElement(writer, umlClass, rules, textualRuleElement, definedIterators); + var previousCaller = ruleGenerationContext.CallerRule; + ProcessRuleElement(writer, umlClass, textualRuleElement, ruleGenerationContext); + ruleGenerationContext.CallerRule = previousCaller; } } } @@ -164,25 +167,24 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas /// /// The used to write into output content /// The related - /// A collection of all existing rules /// The to process - /// Collection of that keep tracks of defined iterator - private static void DeclareAllRequiredIterators(EncodedTextWriter writer, IClass umlClass, IReadOnlyCollection rules, Alternatives alternatives, List definedIterators) + /// + 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, rules, assignmentElement, definedIterators); + DeclareIteratorIfRequired(writer, umlClass, assignmentElement, ruleGenerationContext); break; case AssignmentElement { Value: GroupElement } assignmentElement: - DeclareIteratorIfRequired(writer, umlClass, rules, assignmentElement, definedIterators); + DeclareIteratorIfRequired(writer, umlClass, assignmentElement, ruleGenerationContext); break; case GroupElement groupElement: foreach (var groupElementAlternative in groupElement.Alternatives) { - DeclareAllRequiredIterators(writer, umlClass, rules, groupElementAlternative, definedIterators); + DeclareAllRequiredIterators(writer, umlClass, groupElementAlternative, ruleGenerationContext); } break; @@ -195,53 +197,47 @@ private static void DeclareAllRequiredIterators(EncodedTextWriter writer, IClass /// /// The used to write into output content /// The related - /// A collection of all existing rules /// The to process - /// Collection of that keep tracks of defined iterator + /// /// If the type of the is not supported - private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass, IReadOnlyCollection rules, RuleElement textualRuleElement, List definedIterators) + private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass, RuleElement textualRuleElement, RuleGenerationContext ruleGenerationContext) { switch (textualRuleElement) { case TerminalElement terminalElement: var valueToAdd = terminalElement.Value; - if (valueToAdd!="<" && valueToAdd!=">") + if (valueToAdd.Length > 1) { - if (valueToAdd == "=") - { - valueToAdd = $" {valueToAdd} "; - } - else - { - valueToAdd += ' '; - } + valueToAdd += ' '; } writer.WriteSafeString($"stringBuilder.Append(\"{valueToAdd}\");"); break; case NonTerminalElement nonTerminalElement: - ProcessNonTerminalElement(writer, umlClass, rules, definedIterators, nonTerminalElement, "poco"); + ProcessNonTerminalElement(writer, umlClass, nonTerminalElement, "poco", umlClass, 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 = definedIterators.Single(x => x.ApplicableRuleElements.Contains(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, rules, definedIterators, groupElement); + ProcessAlternatives(writer, umlClass, groupElement.Alternatives, ruleGenerationContext); writer.WriteSafeString($"{Environment.NewLine}}}"); } else { - ProcessAlternatives(writer, umlClass, groupElement.Alternatives, rules,definedIterators, groupElement); + ProcessAlternatives(writer, umlClass, groupElement.Alternatives, ruleGenerationContext); } if (!groupElement.IsOptional) @@ -260,14 +256,14 @@ private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass { if (assignmentElement.Value is NonTerminalElement nonTerminalElement) { - var iteratorToUse = definedIterators.Single(x => x.ApplicableRuleElements.Contains(assignmentElement)); + 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, rules, definedIterators, nonTerminalElement, $"{iteratorToUse.IteratorVariableName}.Current"); + ProcessNonTerminalElement(writer, umlClass, nonTerminalElement, $"{iteratorToUse.IteratorVariableName}.Current", umlClass, ruleGenerationContext); } else { @@ -289,7 +285,7 @@ private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass { writer.WriteSafeString($"stringBuilder.Append(poco.{targetProperty.Name.CapitalizeFirstLetter()});"); } - else if(targetProperty.QueryIsBool()) + else if (targetProperty.QueryIsBool()) { if (assignmentElement.Value is TerminalElement terminalElement) { @@ -297,13 +293,27 @@ private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass } else { - writer.WriteSafeString("throw new System.NotSupportedException(\"Assigment of bool with rule element value different than TerminalElement not supported\");"); + writer.WriteSafeString($"stringBuilder.Append(poco.{targetProperty.QueryPropertyNameBasedOnUmlProperties()}.ToString().ToLower());"); } } else if (targetProperty.QueryIsEnum()) { writer.WriteSafeString($"stringBuilder.Append(poco.{targetProperty.Name.CapitalizeFirstLetter()}.ToString().ToLower());"); } + else if(targetProperty.QueryIsReferenceProperty()) + { + if (assignmentElement.Value is NonTerminalElement nonTerminalElement) + { + var previousCaller = ruleGenerationContext.CallerRule; + ruleGenerationContext.CallerRule = nonTerminalElement; + ProcessNonTerminalElement(writer, targetProperty.Type as IClass, nonTerminalElement, $"poco.{targetProperty.QueryPropertyNameBasedOnUmlProperties()}", umlClass, ruleGenerationContext); + ruleGenerationContext.CallerRule = previousCaller; + } + else + { + writer.WriteSafeString("throw new System.NotSupportedException(\"Assigment of reference element not supported yet for this case\");"); + } + } else { writer.WriteSafeString("throw new System.NotSupportedException(\"Assigment of non-string value not yet supported\");"); @@ -318,10 +328,11 @@ private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass break; case NonParsingAssignmentElement nonParsingAssignmentElement: - writer.WriteSafeString($"// Assignment Element : {nonParsingAssignmentElement.PropertyName} {nonParsingAssignmentElement.Operator} {nonParsingAssignmentElement.Value}"); + writer.WriteSafeString($"// NonParsing Assignment Element : {nonParsingAssignmentElement.PropertyName} {nonParsingAssignmentElement.Operator} {nonParsingAssignmentElement.Value} => Does not have to be process"); break; case ValueLiteralElement valueLiteralElement: - writer.WriteSafeString($"// Value Literal Element : {valueLiteralElement.Value}"); + writer.WriteSafeString(valueLiteralElement.Value == "[QualifiedName]" ? "stringBuilder.Append(poco.qualifiedName);" : "throw new System.NotSupportedException(\"Value Literal different than QualifiedName not supported\");"); + break; default: throw new ArgumentException("Unknown element type"); @@ -335,13 +346,13 @@ private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass /// /// The used to write into output content /// The related - /// A collection of all existing rules /// The to process - /// Collection of that keep tracks of defined iterator /// The name of the variable that should be used to call the non-terminal method - private static void ProcessNonTerminalElement(EncodedTextWriter writer, IClass umlClass, IReadOnlyCollection rules, List definedIterators, NonTerminalElement nonTerminalElement, string variableName) + /// Gets the that initially calls this function + /// + private static void ProcessNonTerminalElement(EncodedTextWriter writer, IClass umlClass, NonTerminalElement nonTerminalElement, string variableName, IClass callerClass, RuleGenerationContext ruleGenerationContext) { - var referencedRule = rules.SingleOrDefault(x => x.RuleName == nonTerminalElement.Name); + var referencedRule = ruleGenerationContext.AllRules.SingleOrDefault(x => x.RuleName == nonTerminalElement.Name); string typeTarget; @@ -353,31 +364,50 @@ private static void ProcessNonTerminalElement(EncodedTextWriter writer, IClass u { 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 != umlClass.Name) + if (typeTarget != callerClass.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 != "poco")) + if (targetType is IClass targetClass && (umlClass.QueryAllGeneralClassifiers().Contains(targetClass) || !variableName.Contains("poco"))) { writer.WriteSafeString($"{targetType.Name}TextualNotationBuilder.Build{nonTerminalElement.Name}({variableName}, stringBuilder);"); } else { - ProcessAlternatives(writer, umlClass, referencedRule!.Alternatives, rules, definedIterators); + var previousCaller = ruleGenerationContext.CallerRule; + ruleGenerationContext.CallerRule = nonTerminalElement; + ProcessAlternatives(writer, umlClass, referencedRule?.Alternatives, ruleGenerationContext); + ruleGenerationContext.CallerRule = previousCaller; } } else { - ProcessAlternatives(writer, umlClass, referencedRule!.Alternatives, rules, definedIterators); + 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}}}"); + } } /// @@ -385,10 +415,9 @@ private static void ProcessNonTerminalElement(EncodedTextWriter writer, IClass u /// /// The used to write into output content /// The related - /// A collection of all existing rules /// The to process - /// Collection of that keep tracks of defined iterator - private static void DeclareIteratorIfRequired(EncodedTextWriter writer, IClass umlClass, IReadOnlyCollection rules, AssignmentElement assignmentElement, List definedIterators) + /// + 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)); @@ -404,7 +433,7 @@ private static void DeclareIteratorIfRequired(EncodedTextWriter writer, IClass u foreach (var assignment in groupedAssignment) { - DeclareIteratorIfRequired(writer, umlClass, rules, assignment, definedIterators); + DeclareIteratorIfRequired(writer, umlClass, assignment, ruleGenerationContext); } } @@ -413,9 +442,9 @@ private static void DeclareIteratorIfRequired(EncodedTextWriter writer, IClass u return; } - var referencedRule = rules.SingleOrDefault(x => x.RuleName == nonTerminalElement.Name); + var referencedRule = ruleGenerationContext.AllRules.SingleOrDefault(x => x.RuleName == nonTerminalElement.Name); - if (definedIterators.SingleOrDefault(x => x.IsIteratorValidForProperty(targetProperty, referencedRule) || x.ApplicableRuleElements.Contains(assignmentElement)) is { } alreadyDefinedIterator) + if (ruleGenerationContext.DefinedIterators.SingleOrDefault(x => x.IsIteratorValidForProperty(targetProperty, referencedRule) || x.ApplicableRuleElements.Contains(assignmentElement)) is { } alreadyDefinedIterator) { alreadyDefinedIterator.ApplicableRuleElements.Add(assignmentElement); return; @@ -454,7 +483,7 @@ private static void DeclareIteratorIfRequired(EncodedTextWriter writer, IClass u } writer.WriteSafeString(Environment.NewLine); - definedIterators.Add(iteratorToUse); + ruleGenerationContext.DefinedIterators.Add(iteratorToUse); } /// @@ -522,5 +551,26 @@ public bool IsIteratorValidForProperty(IProperty property, TextualNotationRule t 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 or sets the that called other rule + /// + public RuleElement CallerRule { get; set; } + + /// + /// Gets the collection of all available + /// + public List AllRules { get; } = []; + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.cs index 35b56867..e7ddec66 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.cs @@ -28,7 +28,6 @@ namespace SysML2.NET.TextualNotation using System.Text; using SysML2.NET.Core.POCO.Root.Elements; - using SysML2.NET.Core.POCO.Systems.Actions; /// /// The provides Textual Notation Builder for the element @@ -73,12 +72,20 @@ public static void BuildAcceptParameterPart(SysML2.NET.Core.POCO.Systems.Actions { using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfParameterMembershipIterator.MoveNext(); - ParameterMembershipTextualNotationBuilder.BuildPayloadParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildPayloadParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } if (ownedRelationshipOfParameterMembershipIterator.MoveNext()) { stringBuilder.Append("via "); - ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs index 9f1f9a01..5e5dbbca 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs @@ -103,12 +103,24 @@ public static void BuildAssignmentNodeDeclaration(SysML2.NET.Core.POCO.Systems.A stringBuilder.Append("assign "); ownedRelationshipOfParameterMembershipIterator.MoveNext(); - ParameterMembershipTextualNotationBuilder.BuildAssignmentTargetMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildAssignmentTargetMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } ownedRelationshipOfMembershipIterator.MoveNext(); - MembershipTextualNotationBuilder.BuildFeatureChainMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfMembershipIterator.Current != null) + { + MembershipTextualNotationBuilder.BuildFeatureChainMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + } stringBuilder.Append(":= "); ownedRelationshipOfParameterMembershipIterator.MoveNext(); - ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActorMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActorMembershipTextualNotationBuilder.cs index 9472be9f..df86fc37 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActorMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActorMembershipTextualNotationBuilder.cs @@ -45,7 +45,11 @@ public static void BuildActorMember(SysML2.NET.Core.POCO.Systems.Requirements.IA using var ownedRelatedElementOfPartUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); ownedRelatedElementOfPartUsageIterator.MoveNext(); - PartUsageTextualNotationBuilder.BuildActorUsage(ownedRelatedElementOfPartUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfPartUsageIterator.Current != null) + { + PartUsageTextualNotationBuilder.BuildActorUsage(ownedRelatedElementOfPartUsageIterator.Current, stringBuilder); + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.cs index 90508df7..da8b1eb9 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.cs @@ -44,7 +44,11 @@ public static void BuildOwnedAnnotation(SysML2.NET.Core.POCO.Root.Annotations.IA { using var ownedRelatedElementOfAnnotatingElementIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); ownedRelatedElementOfAnnotatingElementIterator.MoveNext(); - AnnotatingElementTextualNotationBuilder.BuildAnnotatingElement(ownedRelatedElementOfAnnotatingElementIterator.Current, stringBuilder); + + if (ownedRelatedElementOfAnnotatingElementIterator.Current != null) + { + AnnotatingElementTextualNotationBuilder.BuildAnnotatingElement(ownedRelatedElementOfAnnotatingElementIterator.Current, stringBuilder); + } } @@ -57,8 +61,19 @@ public static void BuildOwnedAnnotation(SysML2.NET.Core.POCO.Root.Annotations.IA public static void BuildPrefixMetadataAnnotation(SysML2.NET.Core.POCO.Root.Annotations.IAnnotation poco, StringBuilder stringBuilder) { stringBuilder.Append("#"); - throw new System.NotSupportedException("Assigment of non-string value not yet supported"); - // Assignment Element : ownedRelatedElement += annotatingElement + + 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 } @@ -70,7 +85,7 @@ public static void BuildPrefixMetadataAnnotation(SysML2.NET.Core.POCO.Root.Annot /// The that contains the entire textual notation public static void BuildAnnotation(SysML2.NET.Core.POCO.Root.Annotations.IAnnotation poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + throw new System.NotSupportedException("Assigment of reference element not supported yet for this case"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorAsUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorAsUsageTextualNotationBuilder.cs index 86768557..495c3fbc 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorAsUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorAsUsageTextualNotationBuilder.cs @@ -54,10 +54,18 @@ public static void BuildBindingConnectorAsUsage(SysML2.NET.Core.POCO.Systems.Con stringBuilder.Append("bind "); ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } stringBuilder.Append("="); ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } UsageTextualNotationBuilder.BuildUsageBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorTextualNotationBuilder.cs index b72eaa90..c67e96b1 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorTextualNotationBuilder.cs @@ -59,7 +59,11 @@ public static void BuildBindingConnector(SysML2.NET.Core.POCO.Kernel.Connectors. while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BooleanExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BooleanExpressionTextualNotationBuilder.cs index ab61cf40..8f8ae380 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BooleanExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BooleanExpressionTextualNotationBuilder.cs @@ -48,7 +48,11 @@ public static void BuildBooleanExpression(SysML2.NET.Core.POCO.Kernel.Functions. while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs index d5b3cf56..9f2f6768 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs @@ -45,12 +45,20 @@ public static void BuildSubclassificationPart(SysML2.NET.Core.POCO.Core.Classifi using var ownedRelationshipOfSubclassificationIterator = poco.OwnedRelationship.OfType().GetEnumerator(); throw new System.NotSupportedException("Multiple alternatives not implemented yet"); ownedRelationshipOfSubclassificationIterator.MoveNext(); - SubclassificationTextualNotationBuilder.BuildOwnedSubclassification(ownedRelationshipOfSubclassificationIterator.Current, stringBuilder); + + if (ownedRelationshipOfSubclassificationIterator.Current != null) + { + SubclassificationTextualNotationBuilder.BuildOwnedSubclassification(ownedRelationshipOfSubclassificationIterator.Current, stringBuilder); + } while (ownedRelationshipOfSubclassificationIterator.MoveNext()) { stringBuilder.Append(","); - SubclassificationTextualNotationBuilder.BuildOwnedSubclassification(ownedRelationshipOfSubclassificationIterator.Current, stringBuilder); + + if (ownedRelationshipOfSubclassificationIterator.Current != null) + { + SubclassificationTextualNotationBuilder.BuildOwnedSubclassification(ownedRelationshipOfSubclassificationIterator.Current, stringBuilder); + } } @@ -76,7 +84,11 @@ public static void BuildClassifierDeclaration(SysML2.NET.Core.POCO.Core.Classifi if (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - OwningMembershipTextualNotationBuilder.BuildOwnedMultiplicity(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildOwnedMultiplicity(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } stringBuilder.Append(' '); } @@ -96,12 +108,20 @@ public static void BuildSuperclassingPart(SysML2.NET.Core.POCO.Core.Classifiers. using var ownedRelationshipOfSubclassificationIterator = poco.OwnedRelationship.OfType().GetEnumerator(); throw new System.NotSupportedException("Multiple alternatives not implemented yet"); ownedRelationshipOfSubclassificationIterator.MoveNext(); - SubclassificationTextualNotationBuilder.BuildOwnedSubclassification(ownedRelationshipOfSubclassificationIterator.Current, stringBuilder); + + if (ownedRelationshipOfSubclassificationIterator.Current != null) + { + SubclassificationTextualNotationBuilder.BuildOwnedSubclassification(ownedRelationshipOfSubclassificationIterator.Current, stringBuilder); + } while (ownedRelationshipOfSubclassificationIterator.MoveNext()) { stringBuilder.Append(","); - SubclassificationTextualNotationBuilder.BuildOwnedSubclassification(ownedRelationshipOfSubclassificationIterator.Current, stringBuilder); + + if (ownedRelationshipOfSubclassificationIterator.Current != null) + { + SubclassificationTextualNotationBuilder.BuildOwnedSubclassification(ownedRelationshipOfSubclassificationIterator.Current, stringBuilder); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CollectExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CollectExpressionTextualNotationBuilder.cs index f15cb1ba..0279240e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CollectExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CollectExpressionTextualNotationBuilder.cs @@ -44,10 +44,18 @@ public static void BuildCollectExpression(SysML2.NET.Core.POCO.Kernel.Expression { using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfParameterMembershipIterator.MoveNext(); - ParameterMembershipTextualNotationBuilder.BuildPrimaryArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildPrimaryArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } stringBuilder.Append("."); ownedRelationshipOfParameterMembershipIterator.MoveNext(); - ParameterMembershipTextualNotationBuilder.BuildBodyArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildBodyArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CommentTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CommentTextualNotationBuilder.cs index 3296b9e0..82475154 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CommentTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CommentTextualNotationBuilder.cs @@ -52,12 +52,20 @@ public static void BuildComment(SysML2.NET.Core.POCO.Root.Annotations.IComment p if (ownedRelationshipOfAnnotationIterator.MoveNext()) { stringBuilder.Append("about "); - AnnotationTextualNotationBuilder.BuildAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + + if (ownedRelationshipOfAnnotationIterator.Current != null) + { + AnnotationTextualNotationBuilder.BuildAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + } while (ownedRelationshipOfAnnotationIterator.MoveNext()) { stringBuilder.Append(","); - AnnotationTextualNotationBuilder.BuildAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + + if (ownedRelationshipOfAnnotationIterator.Current != null) + { + AnnotationTextualNotationBuilder.BuildAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + } } stringBuilder.Append(' '); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortDefinitionTextualNotationBuilder.cs index e2de57b1..8118e68e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortDefinitionTextualNotationBuilder.cs @@ -44,7 +44,11 @@ public static void BuildConjugatedPortDefinition(SysML2.NET.Core.POCO.Systems.Po { using var ownedRelationshipOfPortConjugationIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfPortConjugationIterator.MoveNext(); - PortConjugationTextualNotationBuilder.BuildPortConjugation(ownedRelationshipOfPortConjugationIterator.Current, stringBuilder); + + if (ownedRelationshipOfPortConjugationIterator.Current != null) + { + PortConjugationTextualNotationBuilder.BuildPortConjugation(ownedRelationshipOfPortConjugationIterator.Current, stringBuilder); + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs index 5a60fe85..52e3b062 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs @@ -55,10 +55,18 @@ public static void BuildBinaryConnectorPart(SysML2.NET.Core.POCO.Systems.Connect { using var ownedRelationshipOfEndFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } stringBuilder.Append("to "); ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } } @@ -73,15 +81,27 @@ public static void BuildNaryConnectorPart(SysML2.NET.Core.POCO.Systems.Connectio using var ownedRelationshipOfEndFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); stringBuilder.Append("("); ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } stringBuilder.Append(","); ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } while (ownedRelationshipOfEndFeatureMembershipIterator.MoveNext()) { stringBuilder.Append(","); - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } } stringBuilder.Append(")"); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs index a72e8e63..89483056 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs @@ -56,10 +56,18 @@ public static void BuildBinaryConnectorDeclaration(SysML2.NET.Core.POCO.Kernel.C using var ownedRelationshipOfEndFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); throw new System.NotSupportedException("Multiple alternatives not implemented yet"); ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } stringBuilder.Append("to "); ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } } @@ -75,15 +83,27 @@ public static void BuildNaryConnectorDeclaration(SysML2.NET.Core.POCO.Kernel.Con FeatureTextualNotationBuilder.BuildFeatureDeclaration(poco, stringBuilder); stringBuilder.Append("("); ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } stringBuilder.Append(","); ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } while (ownedRelationshipOfEndFeatureMembershipIterator.MoveNext()) { stringBuilder.Append(","); - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } } stringBuilder.Append(")"); @@ -104,7 +124,11 @@ public static void BuildConnector(SysML2.NET.Core.POCO.Kernel.Connectors.IConnec while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstructorExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstructorExpressionTextualNotationBuilder.cs index 8dd9b4e4..aa87c35b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstructorExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstructorExpressionTextualNotationBuilder.cs @@ -46,9 +46,17 @@ public static void BuildConstructorExpression(SysML2.NET.Core.POCO.Kernel.Expres using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); stringBuilder.Append("new "); ownedRelationshipOfMembershipIterator.MoveNext(); - MembershipTextualNotationBuilder.BuildInstantiatedTypeMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfMembershipIterator.Current != null) + { + MembershipTextualNotationBuilder.BuildInstantiatedTypeMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + } ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); - ReturnParameterMembershipTextualNotationBuilder.BuildConstructorResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) + { + ReturnParameterMembershipTextualNotationBuilder.BuildConstructorResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs index 67bf804c..0aeccd87 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs @@ -44,7 +44,11 @@ public static void BuildDefinitionExtensionKeyword(SysML2.NET.Core.POCO.Systems. { using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfOwningMembershipIterator.MoveNext(); - OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DependencyTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DependencyTextualNotationBuilder.cs index 38ba6810..d0e42fb3 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DependencyTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DependencyTextualNotationBuilder.cs @@ -46,7 +46,11 @@ public static void BuildDependency(SysML2.NET.Core.POCO.Root.Dependencies.IDepen while (ownedRelationshipOfAnnotationIterator.MoveNext()) { - AnnotationTextualNotationBuilder.BuildPrefixMetadataAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + + if (ownedRelationshipOfAnnotationIterator.Current != null) + { + AnnotationTextualNotationBuilder.BuildPrefixMetadataAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + } } stringBuilder.Append("dependency "); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementFilterMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementFilterMembershipTextualNotationBuilder.cs index ee7f0088..6147bf64 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementFilterMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementFilterMembershipTextualNotationBuilder.cs @@ -46,7 +46,11 @@ public static void BuildElementFilterMember(SysML2.NET.Core.POCO.Kernel.Packages MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); stringBuilder.Append("filter "); ownedRelatedElementOfExpressionIterator.MoveNext(); - ExpressionTextualNotationBuilder.BuildOwnedExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); + + if (ownedRelatedElementOfExpressionIterator.Current != null) + { + ExpressionTextualNotationBuilder.BuildOwnedExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); + } stringBuilder.Append(";"); } @@ -62,7 +66,11 @@ public static void BuildFilterPackageMember(SysML2.NET.Core.POCO.Kernel.Packages using var ownedRelatedElementOfExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); stringBuilder.Append("["); ownedRelatedElementOfExpressionIterator.MoveNext(); - ExpressionTextualNotationBuilder.BuildOwnedExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); + + if (ownedRelatedElementOfExpressionIterator.Current != null) + { + ExpressionTextualNotationBuilder.BuildOwnedExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); + } stringBuilder.Append("]"); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EndFeatureMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EndFeatureMembershipTextualNotationBuilder.cs index be3e18f0..4683a227 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EndFeatureMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EndFeatureMembershipTextualNotationBuilder.cs @@ -44,7 +44,11 @@ public static void BuildSourceEndMember(SysML2.NET.Core.POCO.Core.Features.IEndF { using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); ownedRelatedElementOfReferenceUsageIterator.MoveNext(); - ReferenceUsageTextualNotationBuilder.BuildSourceEnd(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfReferenceUsageIterator.Current != null) + { + ReferenceUsageTextualNotationBuilder.BuildSourceEnd(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + } } @@ -58,7 +62,11 @@ public static void BuildConnectorEndMember(SysML2.NET.Core.POCO.Core.Features.IE { using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); ownedRelatedElementOfReferenceUsageIterator.MoveNext(); - ReferenceUsageTextualNotationBuilder.BuildConnectorEnd(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfReferenceUsageIterator.Current != null) + { + ReferenceUsageTextualNotationBuilder.BuildConnectorEnd(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + } } @@ -72,7 +80,11 @@ public static void BuildInterfaceEndMember(SysML2.NET.Core.POCO.Core.Features.IE { using var ownedRelatedElementOfPortUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); ownedRelatedElementOfPortUsageIterator.MoveNext(); - PortUsageTextualNotationBuilder.BuildInterfaceEnd(ownedRelatedElementOfPortUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfPortUsageIterator.Current != null) + { + PortUsageTextualNotationBuilder.BuildInterfaceEnd(ownedRelatedElementOfPortUsageIterator.Current, stringBuilder); + } } @@ -86,7 +98,11 @@ public static void BuildFlowEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFea { using var ownedRelatedElementOfFlowEndIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); ownedRelatedElementOfFlowEndIterator.MoveNext(); - FlowEndTextualNotationBuilder.BuildFlowEnd(ownedRelatedElementOfFlowEndIterator.Current, stringBuilder); + + if (ownedRelatedElementOfFlowEndIterator.Current != null) + { + FlowEndTextualNotationBuilder.BuildFlowEnd(ownedRelatedElementOfFlowEndIterator.Current, stringBuilder); + } } @@ -100,7 +116,11 @@ public static void BuildEmptyEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFe { using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); ownedRelatedElementOfReferenceUsageIterator.MoveNext(); - ReferenceUsageTextualNotationBuilder.BuildEmptyFeature(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfReferenceUsageIterator.Current != null) + { + ReferenceUsageTextualNotationBuilder.BuildEmptyFeature(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EventOccurrenceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EventOccurrenceUsageTextualNotationBuilder.cs index af4af9bc..03d79240 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EventOccurrenceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EventOccurrenceUsageTextualNotationBuilder.cs @@ -44,7 +44,11 @@ public static void BuildMessageEvent(SysML2.NET.Core.POCO.Systems.Occurrences.IE { using var ownedRelationshipOfReferenceSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfReferenceSubsettingIterator.MoveNext(); - ReferenceSubsettingTextualNotationBuilder.BuildOwnedReferenceSubsetting(ownedRelationshipOfReferenceSubsettingIterator.Current, stringBuilder); + + if (ownedRelationshipOfReferenceSubsettingIterator.Current != null) + { + ReferenceSubsettingTextualNotationBuilder.BuildOwnedReferenceSubsetting(ownedRelationshipOfReferenceSubsettingIterator.Current, stringBuilder); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs index e162d784..a18f1c00 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs @@ -102,7 +102,11 @@ public static void BuildFunctionReference(SysML2.NET.Core.POCO.Kernel.Functions. { using var ownedRelationshipOfFeatureTypingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfFeatureTypingIterator.MoveNext(); - FeatureTypingTextualNotationBuilder.BuildReferenceTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureTypingIterator.Current != null) + { + FeatureTypingTextualNotationBuilder.BuildReferenceTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + } } @@ -145,7 +149,11 @@ public static void BuildExpression(SysML2.NET.Core.POCO.Kernel.Functions.IExpres while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainExpressionTextualNotationBuilder.cs index c4e2d667..316ae3e6 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainExpressionTextualNotationBuilder.cs @@ -45,10 +45,18 @@ public static void BuildFeatureChainExpression(SysML2.NET.Core.POCO.Kernel.Expre using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); using var ownedRelationshipOfMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfParameterMembershipIterator.MoveNext(); - ParameterMembershipTextualNotationBuilder.BuildNonFeatureChainPrimaryArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildNonFeatureChainPrimaryArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } stringBuilder.Append("."); ownedRelationshipOfMembershipIterator.MoveNext(); - MembershipTextualNotationBuilder.BuildFeatureChainMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfMembershipIterator.Current != null) + { + MembershipTextualNotationBuilder.BuildFeatureChainMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainingTextualNotationBuilder.cs index 4ab2815e..51c2af35 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainingTextualNotationBuilder.cs @@ -42,7 +42,7 @@ public static partial class FeatureChainingTextualNotationBuilder /// The that contains the entire textual notation public static void BuildOwnedFeatureChaining(SysML2.NET.Core.POCO.Core.Features.IFeatureChaining poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + throw new System.NotSupportedException("Assigment of reference element not supported yet for this case"); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs index 26010af1..3a780242 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs @@ -45,7 +45,11 @@ public static void BuildNonOccurrenceUsageMember(SysML2.NET.Core.POCO.Core.Types using var ownedRelatedElementOfUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); ownedRelatedElementOfUsageIterator.MoveNext(); - UsageTextualNotationBuilder.BuildNonOccurrenceUsageElement(ownedRelatedElementOfUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfUsageIterator.Current != null) + { + UsageTextualNotationBuilder.BuildNonOccurrenceUsageElement(ownedRelatedElementOfUsageIterator.Current, stringBuilder); + } } @@ -60,7 +64,11 @@ public static void BuildOccurrenceUsageMember(SysML2.NET.Core.POCO.Core.Types.IF using var ownedRelatedElementOfUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); ownedRelatedElementOfUsageIterator.MoveNext(); - UsageTextualNotationBuilder.BuildOccurrenceUsageElement(ownedRelatedElementOfUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfUsageIterator.Current != null) + { + UsageTextualNotationBuilder.BuildOccurrenceUsageElement(ownedRelatedElementOfUsageIterator.Current, stringBuilder); + } } @@ -75,7 +83,11 @@ public static void BuildStructureUsageMember(SysML2.NET.Core.POCO.Core.Types.IFe using var ownedRelatedElementOfUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); ownedRelatedElementOfUsageIterator.MoveNext(); - UsageTextualNotationBuilder.BuildStructureUsageElement(ownedRelatedElementOfUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfUsageIterator.Current != null) + { + UsageTextualNotationBuilder.BuildStructureUsageElement(ownedRelatedElementOfUsageIterator.Current, stringBuilder); + } } @@ -90,7 +102,11 @@ public static void BuildBehaviorUsageMember(SysML2.NET.Core.POCO.Core.Types.IFea using var ownedRelatedElementOfUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); ownedRelatedElementOfUsageIterator.MoveNext(); - UsageTextualNotationBuilder.BuildBehaviorUsageElement(ownedRelatedElementOfUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfUsageIterator.Current != null) + { + UsageTextualNotationBuilder.BuildBehaviorUsageElement(ownedRelatedElementOfUsageIterator.Current, stringBuilder); + } } @@ -105,7 +121,11 @@ public static void BuildSourceSuccessionMember(SysML2.NET.Core.POCO.Core.Types.I using var ownedRelatedElementOfSuccessionAsUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); stringBuilder.Append("then "); ownedRelatedElementOfSuccessionAsUsageIterator.MoveNext(); - SuccessionAsUsageTextualNotationBuilder.BuildSourceSuccession(ownedRelatedElementOfSuccessionAsUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfSuccessionAsUsageIterator.Current != null) + { + SuccessionAsUsageTextualNotationBuilder.BuildSourceSuccession(ownedRelatedElementOfSuccessionAsUsageIterator.Current, stringBuilder); + } } @@ -120,7 +140,11 @@ public static void BuildInterfaceNonOccurrenceUsageMember(SysML2.NET.Core.POCO.C using var ownedRelatedElementOfUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); ownedRelatedElementOfUsageIterator.MoveNext(); - UsageTextualNotationBuilder.BuildInterfaceNonOccurrenceUsageElement(ownedRelatedElementOfUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfUsageIterator.Current != null) + { + UsageTextualNotationBuilder.BuildInterfaceNonOccurrenceUsageElement(ownedRelatedElementOfUsageIterator.Current, stringBuilder); + } } @@ -135,7 +159,11 @@ public static void BuildInterfaceOccurrenceUsageMember(SysML2.NET.Core.POCO.Core using var ownedRelatedElementOfUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); ownedRelatedElementOfUsageIterator.MoveNext(); - UsageTextualNotationBuilder.BuildInterfaceOccurrenceUsageElement(ownedRelatedElementOfUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfUsageIterator.Current != null) + { + UsageTextualNotationBuilder.BuildInterfaceOccurrenceUsageElement(ownedRelatedElementOfUsageIterator.Current, stringBuilder); + } } @@ -149,7 +177,11 @@ public static void BuildFlowPayloadFeatureMember(SysML2.NET.Core.POCO.Core.Types { using var ownedRelatedElementOfPayloadFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); ownedRelatedElementOfPayloadFeatureIterator.MoveNext(); - PayloadFeatureTextualNotationBuilder.BuildFlowPayloadFeature(ownedRelatedElementOfPayloadFeatureIterator.Current, stringBuilder); + + if (ownedRelatedElementOfPayloadFeatureIterator.Current != null) + { + PayloadFeatureTextualNotationBuilder.BuildFlowPayloadFeature(ownedRelatedElementOfPayloadFeatureIterator.Current, stringBuilder); + } } @@ -163,7 +195,11 @@ public static void BuildFlowFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFeatu { using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); ownedRelatedElementOfReferenceUsageIterator.MoveNext(); - ReferenceUsageTextualNotationBuilder.BuildFlowFeature(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfReferenceUsageIterator.Current != null) + { + ReferenceUsageTextualNotationBuilder.BuildFlowFeature(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + } } @@ -204,7 +240,11 @@ public static void BuildActionNodeMember(SysML2.NET.Core.POCO.Core.Types.IFeatur using var ownedRelatedElementOfActionUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); ownedRelatedElementOfActionUsageIterator.MoveNext(); - ActionUsageTextualNotationBuilder.BuildActionNode(ownedRelatedElementOfActionUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfActionUsageIterator.Current != null) + { + ActionUsageTextualNotationBuilder.BuildActionNode(ownedRelatedElementOfActionUsageIterator.Current, stringBuilder); + } } @@ -219,7 +259,11 @@ public static void BuildActionTargetSuccessionMember(SysML2.NET.Core.POCO.Core.T using var ownedRelatedElementOfUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); ownedRelatedElementOfUsageIterator.MoveNext(); - UsageTextualNotationBuilder.BuildActionTargetSuccession(ownedRelatedElementOfUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfUsageIterator.Current != null) + { + UsageTextualNotationBuilder.BuildActionTargetSuccession(ownedRelatedElementOfUsageIterator.Current, stringBuilder); + } } @@ -234,7 +278,11 @@ public static void BuildGuardedSuccessionMember(SysML2.NET.Core.POCO.Core.Types. using var ownedRelatedElementOfTransitionUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); ownedRelatedElementOfTransitionUsageIterator.MoveNext(); - TransitionUsageTextualNotationBuilder.BuildGuardedSuccession(ownedRelatedElementOfTransitionUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfTransitionUsageIterator.Current != null) + { + TransitionUsageTextualNotationBuilder.BuildGuardedSuccession(ownedRelatedElementOfTransitionUsageIterator.Current, stringBuilder); + } } @@ -248,7 +296,11 @@ public static void BuildForVariableDeclarationMember(SysML2.NET.Core.POCO.Core.T { using var ownedRelatedElementOfUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); ownedRelatedElementOfUsageIterator.MoveNext(); - UsageTextualNotationBuilder.BuildUsageDeclaration(ownedRelatedElementOfUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfUsageIterator.Current != null) + { + UsageTextualNotationBuilder.BuildUsageDeclaration(ownedRelatedElementOfUsageIterator.Current, stringBuilder); + } } @@ -280,7 +332,11 @@ public static void BuildTransitionUsageMember(SysML2.NET.Core.POCO.Core.Types.IF using var ownedRelatedElementOfTransitionUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); ownedRelatedElementOfTransitionUsageIterator.MoveNext(); - TransitionUsageTextualNotationBuilder.BuildTransitionUsage(ownedRelatedElementOfTransitionUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfTransitionUsageIterator.Current != null) + { + TransitionUsageTextualNotationBuilder.BuildTransitionUsage(ownedRelatedElementOfTransitionUsageIterator.Current, stringBuilder); + } } @@ -295,7 +351,11 @@ public static void BuildTargetTransitionUsageMember(SysML2.NET.Core.POCO.Core.Ty using var ownedRelatedElementOfTransitionUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); ownedRelatedElementOfTransitionUsageIterator.MoveNext(); - TransitionUsageTextualNotationBuilder.BuildTargetTransitionUsage(ownedRelatedElementOfTransitionUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfTransitionUsageIterator.Current != null) + { + TransitionUsageTextualNotationBuilder.BuildTargetTransitionUsage(ownedRelatedElementOfTransitionUsageIterator.Current, stringBuilder); + } } @@ -307,7 +367,23 @@ public static void BuildTargetTransitionUsageMember(SysML2.NET.Core.POCO.Core.Ty /// The that contains the entire textual notation public static void BuildMetadataBodyUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + + 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); + } + BuildFeatureSpecializationPart(poco, stringBuilder); + BuildValuePart(poco, stringBuilder); + TypeTextualNotationBuilder.BuildMetadataBody(poco, stringBuilder); + + } } @@ -322,7 +398,11 @@ public static void BuildOwnedFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFeat using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); ownedRelatedElementOfFeatureIterator.MoveNext(); - FeatureTextualNotationBuilder.BuildFeatureElement(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + + if (ownedRelatedElementOfFeatureIterator.Current != null) + { + FeatureTextualNotationBuilder.BuildFeatureElement(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + } } @@ -336,7 +416,11 @@ public static void BuildOwnedExpressionReferenceMember(SysML2.NET.Core.POCO.Core { using var ownedRelationshipOfFeatureReferenceExpressionIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfFeatureReferenceExpressionIterator.MoveNext(); - FeatureReferenceExpressionTextualNotationBuilder.BuildOwnedExpressionReference(ownedRelationshipOfFeatureReferenceExpressionIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureReferenceExpressionIterator.Current != null) + { + FeatureReferenceExpressionTextualNotationBuilder.BuildOwnedExpressionReference(ownedRelationshipOfFeatureReferenceExpressionIterator.Current, stringBuilder); + } } @@ -360,7 +444,11 @@ public static void BuildOwnedExpressionMember(SysML2.NET.Core.POCO.Core.Types.IF /// The that contains the entire textual notation public static void BuildSequenceExpressionListMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + + if (poco.ownedMemberFeature != null) + { + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + } } @@ -372,7 +460,18 @@ public static void BuildSequenceExpressionListMember(SysML2.NET.Core.POCO.Core.T /// The that contains the entire textual notation public static void BuildFunctionReferenceMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + + if (poco.ownedMemberFeature != null) + { + using var ownedRelationshipOfFeatureTypingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureTypingIterator.MoveNext(); + + if (ownedRelationshipOfFeatureTypingIterator.Current != null) + { + FeatureTypingTextualNotationBuilder.BuildReferenceTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + } + + } } @@ -384,7 +483,11 @@ public static void BuildFunctionReferenceMember(SysML2.NET.Core.POCO.Core.Types. /// The that contains the entire textual notation public static void BuildNamedArgumentMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + + if (poco.ownedMemberFeature != null) + { + FeatureTextualNotationBuilder.BuildNamedArgument(poco.ownedMemberFeature, stringBuilder); + } } @@ -396,7 +499,14 @@ public static void BuildNamedArgumentMember(SysML2.NET.Core.POCO.Core.Types.IFea /// The that contains the entire textual notation public static void BuildExpressionBodyMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + + if (poco.ownedMemberFeature != null) + { + stringBuilder.Append("{"); + TypeTextualNotationBuilder.BuildFunctionBodyPart(poco, stringBuilder); + stringBuilder.Append("}"); + + } } @@ -410,7 +520,11 @@ public static void BuildPayloadFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFe { using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); ownedRelatedElementOfFeatureIterator.MoveNext(); - FeatureTextualNotationBuilder.BuildPayloadFeature(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + + if (ownedRelatedElementOfFeatureIterator.Current != null) + { + FeatureTextualNotationBuilder.BuildPayloadFeature(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + } } @@ -422,7 +536,11 @@ public static void BuildPayloadFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFe /// The that contains the entire textual notation public static void BuildMetadataBodyFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + + if (poco.ownedMemberFeature != null) + { + FeatureTextualNotationBuilder.BuildMetadataBodyFeature(poco.ownedMemberFeature, stringBuilder); + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureReferenceExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureReferenceExpressionTextualNotationBuilder.cs index bd53ca79..f11f4fd5 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureReferenceExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureReferenceExpressionTextualNotationBuilder.cs @@ -44,7 +44,11 @@ public static void BuildSatisfactionReferenceExpression(SysML2.NET.Core.POCO.Ker { using var ownedRelationshipOfMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfMembershipIterator.MoveNext(); - MembershipTextualNotationBuilder.BuildFeatureChainMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfMembershipIterator.Current != null) + { + MembershipTextualNotationBuilder.BuildFeatureChainMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + } } @@ -58,7 +62,11 @@ public static void BuildOwnedExpressionReference(SysML2.NET.Core.POCO.Kernel.Exp { using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfFeatureMembershipIterator.MoveNext(); - FeatureMembershipTextualNotationBuilder.BuildOwnedExpressionMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + { + FeatureMembershipTextualNotationBuilder.BuildOwnedExpressionMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + } } @@ -72,7 +80,11 @@ public static void BuildFunctionReferenceExpression(SysML2.NET.Core.POCO.Kernel. { using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfFeatureMembershipIterator.MoveNext(); - FeatureMembershipTextualNotationBuilder.BuildFunctionReferenceMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + { + FeatureMembershipTextualNotationBuilder.BuildFunctionReferenceMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + } } @@ -87,9 +99,17 @@ public static void BuildFeatureReferenceExpression(SysML2.NET.Core.POCO.Kernel.E using var ownedRelationshipOfMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfMembershipIterator.MoveNext(); - MembershipTextualNotationBuilder.BuildFeatureReferenceMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfMembershipIterator.Current != null) + { + MembershipTextualNotationBuilder.BuildFeatureReferenceMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + } ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); - ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) + { + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + } } @@ -103,7 +123,11 @@ public static void BuildBodyExpression(SysML2.NET.Core.POCO.Kernel.Expressions.I { using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfFeatureMembershipIterator.MoveNext(); - FeatureMembershipTextualNotationBuilder.BuildExpressionBodyMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + { + FeatureMembershipTextualNotationBuilder.BuildExpressionBodyMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs index 51edd639..cd8c73c5 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs @@ -44,7 +44,11 @@ public static void BuildValuePart(SysML2.NET.Core.POCO.Core.Features.IFeature po { using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfFeatureValueIterator.MoveNext(); - FeatureValueTextualNotationBuilder.BuildFeatureValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureValueIterator.Current != null) + { + FeatureValueTextualNotationBuilder.BuildFeatureValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + } } @@ -84,7 +88,11 @@ public static void BuildTypings(SysML2.NET.Core.POCO.Core.Features.IFeature poco while (ownedRelationshipOfFeatureTypingIterator.MoveNext()) { stringBuilder.Append(","); - FeatureTypingTextualNotationBuilder.BuildFeatureTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureTypingIterator.Current != null) + { + FeatureTypingTextualNotationBuilder.BuildFeatureTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + } } @@ -101,7 +109,11 @@ public static void BuildTypedBy(SysML2.NET.Core.POCO.Core.Features.IFeature poco using var ownedRelationshipOfFeatureTypingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); throw new System.NotSupportedException("Multiple alternatives not implemented yet"); ownedRelationshipOfFeatureTypingIterator.MoveNext(); - FeatureTypingTextualNotationBuilder.BuildFeatureTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureTypingIterator.Current != null) + { + FeatureTypingTextualNotationBuilder.BuildFeatureTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + } } @@ -119,7 +131,11 @@ public static void BuildSubsettings(SysML2.NET.Core.POCO.Core.Features.IFeature while (ownedRelationshipOfSubsettingIterator.MoveNext()) { stringBuilder.Append(","); - SubsettingTextualNotationBuilder.BuildOwnedSubsetting(ownedRelationshipOfSubsettingIterator.Current, stringBuilder); + + if (ownedRelationshipOfSubsettingIterator.Current != null) + { + SubsettingTextualNotationBuilder.BuildOwnedSubsetting(ownedRelationshipOfSubsettingIterator.Current, stringBuilder); + } } @@ -136,7 +152,11 @@ public static void BuildSubsets(SysML2.NET.Core.POCO.Core.Features.IFeature poco using var ownedRelationshipOfSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); throw new System.NotSupportedException("Multiple alternatives not implemented yet"); ownedRelationshipOfSubsettingIterator.MoveNext(); - SubsettingTextualNotationBuilder.BuildOwnedSubsetting(ownedRelationshipOfSubsettingIterator.Current, stringBuilder); + + if (ownedRelationshipOfSubsettingIterator.Current != null) + { + SubsettingTextualNotationBuilder.BuildOwnedSubsetting(ownedRelationshipOfSubsettingIterator.Current, stringBuilder); + } } @@ -151,7 +171,11 @@ public static void BuildReferences(SysML2.NET.Core.POCO.Core.Features.IFeature p using var ownedRelationshipOfReferenceSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); throw new System.NotSupportedException("Multiple alternatives not implemented yet"); ownedRelationshipOfReferenceSubsettingIterator.MoveNext(); - ReferenceSubsettingTextualNotationBuilder.BuildOwnedReferenceSubsetting(ownedRelationshipOfReferenceSubsettingIterator.Current, stringBuilder); + + if (ownedRelationshipOfReferenceSubsettingIterator.Current != null) + { + ReferenceSubsettingTextualNotationBuilder.BuildOwnedReferenceSubsetting(ownedRelationshipOfReferenceSubsettingIterator.Current, stringBuilder); + } } @@ -166,7 +190,11 @@ public static void BuildCrosses(SysML2.NET.Core.POCO.Core.Features.IFeature poco using var ownedRelationshipOfCrossSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); throw new System.NotSupportedException("Multiple alternatives not implemented yet"); ownedRelationshipOfCrossSubsettingIterator.MoveNext(); - CrossSubsettingTextualNotationBuilder.BuildOwnedCrossSubsetting(ownedRelationshipOfCrossSubsettingIterator.Current, stringBuilder); + + if (ownedRelationshipOfCrossSubsettingIterator.Current != null) + { + CrossSubsettingTextualNotationBuilder.BuildOwnedCrossSubsetting(ownedRelationshipOfCrossSubsettingIterator.Current, stringBuilder); + } } @@ -184,7 +212,11 @@ public static void BuildRedefinitions(SysML2.NET.Core.POCO.Core.Features.IFeatur while (ownedRelationshipOfRedefinitionIterator.MoveNext()) { stringBuilder.Append(","); - RedefinitionTextualNotationBuilder.BuildOwnedRedefinition(ownedRelationshipOfRedefinitionIterator.Current, stringBuilder); + + if (ownedRelationshipOfRedefinitionIterator.Current != null) + { + RedefinitionTextualNotationBuilder.BuildOwnedRedefinition(ownedRelationshipOfRedefinitionIterator.Current, stringBuilder); + } } @@ -201,7 +233,11 @@ public static void BuildRedefines(SysML2.NET.Core.POCO.Core.Features.IFeature po using var ownedRelationshipOfRedefinitionIterator = poco.OwnedRelationship.OfType().GetEnumerator(); throw new System.NotSupportedException("Multiple alternatives not implemented yet"); ownedRelationshipOfRedefinitionIterator.MoveNext(); - RedefinitionTextualNotationBuilder.BuildOwnedRedefinition(ownedRelationshipOfRedefinitionIterator.Current, stringBuilder); + + if (ownedRelationshipOfRedefinitionIterator.Current != null) + { + RedefinitionTextualNotationBuilder.BuildOwnedRedefinition(ownedRelationshipOfRedefinitionIterator.Current, stringBuilder); + } } @@ -215,12 +251,20 @@ public static void BuildOwnedFeatureChain(SysML2.NET.Core.POCO.Core.Features.IFe { using var ownedRelationshipOfFeatureChainingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfFeatureChainingIterator.MoveNext(); - FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(ownedRelationshipOfFeatureChainingIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureChainingIterator.Current != null) + { + FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(ownedRelationshipOfFeatureChainingIterator.Current, stringBuilder); + } while (ownedRelationshipOfFeatureChainingIterator.MoveNext()) { stringBuilder.Append("."); - FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(ownedRelationshipOfFeatureChainingIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureChainingIterator.Current != null) + { + FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(ownedRelationshipOfFeatureChainingIterator.Current, stringBuilder); + } } stringBuilder.Append(' '); @@ -248,7 +292,11 @@ public static void BuildOwnedCrossMultiplicity(SysML2.NET.Core.POCO.Core.Feature { using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfOwningMembershipIterator.MoveNext(); - OwningMembershipTextualNotationBuilder.BuildOwnedMultiplicity(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildOwnedMultiplicity(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } } @@ -286,13 +334,21 @@ public static void BuildFeatureChainPrefix(SysML2.NET.Core.POCO.Core.Features.IF while (ownedRelationshipOfFeatureChainingIterator.MoveNext()) { - FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(ownedRelationshipOfFeatureChainingIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureChainingIterator.Current != null) + { + FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(ownedRelationshipOfFeatureChainingIterator.Current, stringBuilder); + } stringBuilder.Append("."); } stringBuilder.Append(' '); ownedRelationshipOfFeatureChainingIterator.MoveNext(); - FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(ownedRelationshipOfFeatureChainingIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureChainingIterator.Current != null) + { + FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(ownedRelationshipOfFeatureChainingIterator.Current, stringBuilder); + } stringBuilder.Append("."); } @@ -307,7 +363,11 @@ public static void BuildTriggerValuePart(SysML2.NET.Core.POCO.Core.Features.IFea { using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfFeatureValueIterator.MoveNext(); - FeatureValueTextualNotationBuilder.BuildTriggerFeatureValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureValueIterator.Current != null) + { + FeatureValueTextualNotationBuilder.BuildTriggerFeatureValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + } } @@ -321,7 +381,11 @@ public static void BuildArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poc { using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfFeatureValueIterator.MoveNext(); - FeatureValueTextualNotationBuilder.BuildArgumentValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureValueIterator.Current != null) + { + FeatureValueTextualNotationBuilder.BuildArgumentValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + } } @@ -335,7 +399,11 @@ public static void BuildArgumentExpression(SysML2.NET.Core.POCO.Core.Features.IF { using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfFeatureValueIterator.MoveNext(); - FeatureValueTextualNotationBuilder.BuildArgumentExpressionValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureValueIterator.Current != null) + { + FeatureValueTextualNotationBuilder.BuildArgumentExpressionValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + } } @@ -362,7 +430,7 @@ public static void BuildEndFeaturePrefix(SysML2.NET.Core.POCO.Core.Features.IFea if (poco.IsConstant) { stringBuilder.Append("const"); - // Assignment Element : isVariable = true + // NonParsing Assignment Element : isVariable = true => Does not have to be process stringBuilder.Append(' '); } @@ -474,7 +542,11 @@ public static void BuildInvertingPart(SysML2.NET.Core.POCO.Core.Features.IFeatur stringBuilder.Append("inverse "); stringBuilder.Append("of "); ownedRelationshipOfFeatureInvertingIterator.MoveNext(); - FeatureInvertingTextualNotationBuilder.BuildOwnedFeatureInverting(ownedRelationshipOfFeatureInvertingIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureInvertingIterator.Current != null) + { + FeatureInvertingTextualNotationBuilder.BuildOwnedFeatureInverting(ownedRelationshipOfFeatureInvertingIterator.Current, stringBuilder); + } } @@ -491,12 +563,20 @@ public static void BuildTypeFeaturingPart(SysML2.NET.Core.POCO.Core.Features.IFe stringBuilder.Append("featured "); stringBuilder.Append("by "); ownedRelationshipOfTypeFeaturingIterator.MoveNext(); - TypeFeaturingTextualNotationBuilder.BuildOwnedTypeFeaturing(ownedRelationshipOfTypeFeaturingIterator.Current, stringBuilder); + + if (ownedRelationshipOfTypeFeaturingIterator.Current != null) + { + TypeFeaturingTextualNotationBuilder.BuildOwnedTypeFeaturing(ownedRelationshipOfTypeFeaturingIterator.Current, stringBuilder); + } while (ownedTypeFeaturingIterator.MoveNext()) { stringBuilder.Append(","); - TypeFeaturingTextualNotationBuilder.BuildOwnedTypeFeaturing(ownedTypeFeaturingIterator.Current, stringBuilder); + + if (ownedTypeFeaturingIterator.Current != null) + { + TypeFeaturingTextualNotationBuilder.BuildOwnedTypeFeaturing(ownedTypeFeaturingIterator.Current, stringBuilder); + } } @@ -512,12 +592,20 @@ public static void BuildFeatureChain(SysML2.NET.Core.POCO.Core.Features.IFeature { using var ownedRelationshipOfFeatureChainingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfFeatureChainingIterator.MoveNext(); - FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(ownedRelationshipOfFeatureChainingIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureChainingIterator.Current != null) + { + FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(ownedRelationshipOfFeatureChainingIterator.Current, stringBuilder); + } while (ownedRelationshipOfFeatureChainingIterator.MoveNext()) { stringBuilder.Append("."); - FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(ownedRelationshipOfFeatureChainingIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureChainingIterator.Current != null) + { + FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(ownedRelationshipOfFeatureChainingIterator.Current, stringBuilder); + } } stringBuilder.Append(' '); @@ -534,7 +622,11 @@ public static void BuildMetadataArgument(SysML2.NET.Core.POCO.Core.Features.IFea { using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfFeatureValueIterator.MoveNext(); - FeatureValueTextualNotationBuilder.BuildMetadataValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureValueIterator.Current != null) + { + FeatureValueTextualNotationBuilder.BuildMetadataValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + } } @@ -548,7 +640,11 @@ public static void BuildTypeReference(SysML2.NET.Core.POCO.Core.Features.IFeatur { using var ownedRelationshipOfFeatureTypingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfFeatureTypingIterator.MoveNext(); - FeatureTypingTextualNotationBuilder.BuildReferenceTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureTypingIterator.Current != null) + { + FeatureTypingTextualNotationBuilder.BuildReferenceTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + } } @@ -562,7 +658,11 @@ public static void BuildPrimaryArgument(SysML2.NET.Core.POCO.Core.Features.IFeat { using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfFeatureValueIterator.MoveNext(); - FeatureValueTextualNotationBuilder.BuildPrimaryArgumentValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureValueIterator.Current != null) + { + FeatureValueTextualNotationBuilder.BuildPrimaryArgumentValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + } } @@ -576,7 +676,11 @@ public static void BuildNonFeatureChainPrimaryArgument(SysML2.NET.Core.POCO.Core { using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfFeatureValueIterator.MoveNext(); - FeatureValueTextualNotationBuilder.BuildNonFeatureChainPrimaryArgumentValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureValueIterator.Current != null) + { + FeatureValueTextualNotationBuilder.BuildNonFeatureChainPrimaryArgumentValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + } } @@ -590,7 +694,11 @@ public static void BuildBodyArgument(SysML2.NET.Core.POCO.Core.Features.IFeature { using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfFeatureValueIterator.MoveNext(); - FeatureValueTextualNotationBuilder.BuildBodyArgumentValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureValueIterator.Current != null) + { + FeatureValueTextualNotationBuilder.BuildBodyArgumentValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + } } @@ -604,7 +712,11 @@ public static void BuildFunctionReferenceArgument(SysML2.NET.Core.POCO.Core.Feat { using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfFeatureValueIterator.MoveNext(); - FeatureValueTextualNotationBuilder.BuildFunctionReferenceArgumentValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureValueIterator.Current != null) + { + FeatureValueTextualNotationBuilder.BuildFunctionReferenceArgumentValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + } } @@ -616,7 +728,7 @@ public static void BuildFunctionReferenceArgument(SysML2.NET.Core.POCO.Core.Feat /// The that contains the entire textual notation public static void BuildFeatureReference(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { - // Value Literal Element : [QualifiedName] + stringBuilder.Append(poco.qualifiedName); } @@ -656,12 +768,20 @@ public static void BuildPositionalArgumentList(SysML2.NET.Core.POCO.Core.Feature { using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfParameterMembershipIterator.MoveNext(); - ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } while (ownedRelationshipOfParameterMembershipIterator.MoveNext()) { stringBuilder.Append(","); - ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } } @@ -677,12 +797,20 @@ public static void BuildNamedArgumentList(SysML2.NET.Core.POCO.Core.Features.IFe { using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfFeatureMembershipIterator.MoveNext(); - FeatureMembershipTextualNotationBuilder.BuildNamedArgumentMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + { + FeatureMembershipTextualNotationBuilder.BuildNamedArgumentMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + } while (ownedRelationshipOfFeatureMembershipIterator.MoveNext()) { stringBuilder.Append(","); - FeatureMembershipTextualNotationBuilder.BuildNamedArgumentMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + { + FeatureMembershipTextualNotationBuilder.BuildNamedArgumentMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + } } @@ -699,10 +827,18 @@ public static void BuildNamedArgument(SysML2.NET.Core.POCO.Core.Features.IFeatur using var ownedRelationshipOfRedefinitionIterator = poco.OwnedRelationship.OfType().GetEnumerator(); using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfRedefinitionIterator.MoveNext(); - RedefinitionTextualNotationBuilder.BuildParameterRedefinition(ownedRelationshipOfRedefinitionIterator.Current, stringBuilder); + + if (ownedRelationshipOfRedefinitionIterator.Current != null) + { + RedefinitionTextualNotationBuilder.BuildParameterRedefinition(ownedRelationshipOfRedefinitionIterator.Current, stringBuilder); + } stringBuilder.Append("="); ownedRelationshipOfFeatureValueIterator.MoveNext(); - FeatureValueTextualNotationBuilder.BuildArgumentValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureValueIterator.Current != null) + { + FeatureValueTextualNotationBuilder.BuildArgumentValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + } } @@ -718,7 +854,11 @@ public static void BuildMetadataBodyFeature(SysML2.NET.Core.POCO.Core.Features.I stringBuilder.Append("feature "); throw new System.NotSupportedException("Multiple alternatives not implemented yet"); ownedRelationshipOfRedefinitionIterator.MoveNext(); - RedefinitionTextualNotationBuilder.BuildOwnedRedefinition(ownedRelationshipOfRedefinitionIterator.Current, stringBuilder); + + if (ownedRelationshipOfRedefinitionIterator.Current != null) + { + RedefinitionTextualNotationBuilder.BuildOwnedRedefinition(ownedRelationshipOfRedefinitionIterator.Current, stringBuilder); + } BuildFeatureSpecializationPart(poco, stringBuilder); BuildValuePart(poco, stringBuilder); TypeTextualNotationBuilder.BuildMetadataBody(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs index e2f24cdb..68b13b51 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs @@ -53,7 +53,7 @@ public static void BuildOwnedFeatureTyping(SysML2.NET.Core.POCO.Core.Features.IF /// The that contains the entire textual notation public static void BuildReferenceTyping(SysML2.NET.Core.POCO.Core.Features.IFeatureTyping poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + throw new System.NotSupportedException("Assigment of reference element not supported yet for this case"); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureValueTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureValueTextualNotationBuilder.cs index 2770f844..7c3bc4ee 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureValueTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureValueTextualNotationBuilder.cs @@ -44,7 +44,11 @@ public static void BuildTriggerFeatureValue(SysML2.NET.Core.POCO.Kernel.FeatureV { using var ownedRelatedElementOfTriggerInvocationExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); ownedRelatedElementOfTriggerInvocationExpressionIterator.MoveNext(); - TriggerInvocationExpressionTextualNotationBuilder.BuildTriggerExpression(ownedRelatedElementOfTriggerInvocationExpressionIterator.Current, stringBuilder); + + if (ownedRelatedElementOfTriggerInvocationExpressionIterator.Current != null) + { + TriggerInvocationExpressionTextualNotationBuilder.BuildTriggerExpression(ownedRelatedElementOfTriggerInvocationExpressionIterator.Current, stringBuilder); + } } @@ -56,7 +60,11 @@ public static void BuildTriggerFeatureValue(SysML2.NET.Core.POCO.Kernel.FeatureV /// The that contains the entire textual notation public static void BuildArgumentValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + + if (poco.value != null) + { + ExpressionTextualNotationBuilder.BuildOwnedExpression(poco.value, stringBuilder); + } } @@ -70,7 +78,11 @@ public static void BuildArgumentExpressionValue(SysML2.NET.Core.POCO.Kernel.Feat { using var ownedRelatedElementOfFeatureReferenceExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); ownedRelatedElementOfFeatureReferenceExpressionIterator.MoveNext(); - FeatureReferenceExpressionTextualNotationBuilder.BuildOwnedExpressionReference(ownedRelatedElementOfFeatureReferenceExpressionIterator.Current, stringBuilder); + + if (ownedRelatedElementOfFeatureReferenceExpressionIterator.Current != null) + { + FeatureReferenceExpressionTextualNotationBuilder.BuildOwnedExpressionReference(ownedRelatedElementOfFeatureReferenceExpressionIterator.Current, stringBuilder); + } } @@ -84,7 +96,11 @@ public static void BuildFeatureBinding(SysML2.NET.Core.POCO.Kernel.FeatureValues { using var ownedRelatedElementOfExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); ownedRelatedElementOfExpressionIterator.MoveNext(); - ExpressionTextualNotationBuilder.BuildOwnedExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); + + if (ownedRelatedElementOfExpressionIterator.Current != null) + { + ExpressionTextualNotationBuilder.BuildOwnedExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); + } } @@ -98,7 +114,11 @@ public static void BuildAssignmentTargetBinding(SysML2.NET.Core.POCO.Kernel.Feat { using var ownedRelatedElementOfExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); ownedRelatedElementOfExpressionIterator.MoveNext(); - ExpressionTextualNotationBuilder.BuildNonFeatureChainPrimaryExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); + + if (ownedRelatedElementOfExpressionIterator.Current != null) + { + ExpressionTextualNotationBuilder.BuildNonFeatureChainPrimaryExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); + } } @@ -112,7 +132,11 @@ public static void BuildSatisfactionFeatureValue(SysML2.NET.Core.POCO.Kernel.Fea { using var ownedRelatedElementOfFeatureReferenceExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); ownedRelatedElementOfFeatureReferenceExpressionIterator.MoveNext(); - FeatureReferenceExpressionTextualNotationBuilder.BuildSatisfactionReferenceExpression(ownedRelatedElementOfFeatureReferenceExpressionIterator.Current, stringBuilder); + + if (ownedRelatedElementOfFeatureReferenceExpressionIterator.Current != null) + { + FeatureReferenceExpressionTextualNotationBuilder.BuildSatisfactionReferenceExpression(ownedRelatedElementOfFeatureReferenceExpressionIterator.Current, stringBuilder); + } } @@ -124,7 +148,18 @@ public static void BuildSatisfactionFeatureValue(SysML2.NET.Core.POCO.Kernel.Fea /// The that contains the entire textual notation public static void BuildMetadataValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + + if (poco.value != null) + { + using var ownedRelationshipOfMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfMembershipIterator.MoveNext(); + + if (ownedRelationshipOfMembershipIterator.Current != null) + { + MembershipTextualNotationBuilder.BuildElementReferenceMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + } + + } } @@ -136,7 +171,11 @@ public static void BuildMetadataValue(SysML2.NET.Core.POCO.Kernel.FeatureValues. /// The that contains the entire textual notation public static void BuildPrimaryArgumentValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + + if (poco.value != null) + { + ExpressionTextualNotationBuilder.BuildPrimaryExpression(poco.value, stringBuilder); + } } @@ -148,7 +187,11 @@ public static void BuildPrimaryArgumentValue(SysML2.NET.Core.POCO.Kernel.Feature /// The that contains the entire textual notation public static void BuildNonFeatureChainPrimaryArgumentValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + + if (poco.value != null) + { + ExpressionTextualNotationBuilder.BuildNonFeatureChainPrimaryExpression(poco.value, stringBuilder); + } } @@ -160,7 +203,18 @@ public static void BuildNonFeatureChainPrimaryArgumentValue(SysML2.NET.Core.POCO /// The that contains the entire textual notation public static void BuildBodyArgumentValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + + if (poco.value != null) + { + using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + { + FeatureMembershipTextualNotationBuilder.BuildExpressionBodyMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + } + + } } @@ -172,7 +226,18 @@ public static void BuildBodyArgumentValue(SysML2.NET.Core.POCO.Kernel.FeatureVal /// The that contains the entire textual notation public static void BuildFunctionReferenceArgumentValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + + if (poco.value != null) + { + using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + ownedRelationshipOfFeatureMembershipIterator.MoveNext(); + + if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + { + FeatureMembershipTextualNotationBuilder.BuildFunctionReferenceMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + } + + } } @@ -188,7 +253,11 @@ public static void BuildFeatureValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.I throw new System.NotSupportedException("Multiple alternatives not implemented yet"); stringBuilder.Append(' '); ownedRelatedElementOfExpressionIterator.MoveNext(); - ExpressionTextualNotationBuilder.BuildOwnedExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); + + if (ownedRelatedElementOfExpressionIterator.Current != null) + { + ExpressionTextualNotationBuilder.BuildOwnedExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowEndTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowEndTextualNotationBuilder.cs index 63a69b0b..5b7562fe 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowEndTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowEndTextualNotationBuilder.cs @@ -47,12 +47,20 @@ public static void BuildFlowEnd(SysML2.NET.Core.POCO.Kernel.Interactions.IFlowEn if (ownedRelationshipOfReferenceSubsettingIterator.MoveNext()) { - ReferenceSubsettingTextualNotationBuilder.BuildFlowEndSubsetting(ownedRelationshipOfReferenceSubsettingIterator.Current, stringBuilder); + + if (ownedRelationshipOfReferenceSubsettingIterator.Current != null) + { + ReferenceSubsettingTextualNotationBuilder.BuildFlowEndSubsetting(ownedRelationshipOfReferenceSubsettingIterator.Current, stringBuilder); + } stringBuilder.Append(' '); } ownedRelationshipOfFeatureMembershipIterator.MoveNext(); - FeatureMembershipTextualNotationBuilder.BuildFlowFeatureMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + { + FeatureMembershipTextualNotationBuilder.BuildFlowFeatureMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowTextualNotationBuilder.cs index 40d81222..2d5dd3fa 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowTextualNotationBuilder.cs @@ -48,7 +48,11 @@ public static void BuildFlow(SysML2.NET.Core.POCO.Kernel.Interactions.IFlow poco while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowUsageTextualNotationBuilder.cs index 90b3bcda..914068cb 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowUsageTextualNotationBuilder.cs @@ -46,7 +46,7 @@ public static void BuildMessage(SysML2.NET.Core.POCO.Systems.Flows.IFlowUsage po stringBuilder.Append("message "); BuildMessageDeclaration(poco, stringBuilder); TypeTextualNotationBuilder.BuildDefinitionBody(poco, stringBuilder); - // Assignment Element : isAbstract = true + // NonParsing Assignment Element : isAbstract = true => Does not have to be process } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForLoopActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForLoopActionUsageTextualNotationBuilder.cs index 0d6476e5..60fded55 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForLoopActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForLoopActionUsageTextualNotationBuilder.cs @@ -47,12 +47,24 @@ public static void BuildForLoopNode(SysML2.NET.Core.POCO.Systems.Actions.IForLoo ActionUsageTextualNotationBuilder.BuildActionNodePrefix(poco, stringBuilder); stringBuilder.Append("for "); ownedRelationshipOfFeatureMembershipIterator.MoveNext(); - FeatureMembershipTextualNotationBuilder.BuildForVariableDeclarationMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + { + FeatureMembershipTextualNotationBuilder.BuildForVariableDeclarationMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + } stringBuilder.Append("in "); ownedRelationshipOfParameterMembershipIterator.MoveNext(); - ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } ownedRelationshipOfParameterMembershipIterator.MoveNext(); - ParameterMembershipTextualNotationBuilder.BuildActionBodyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildActionBodyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FramedConcernMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FramedConcernMembershipTextualNotationBuilder.cs index 412fb84b..97edba8e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FramedConcernMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FramedConcernMembershipTextualNotationBuilder.cs @@ -46,7 +46,11 @@ public static void BuildFramedConcernMember(SysML2.NET.Core.POCO.Systems.Require MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); stringBuilder.Append("frame "); ownedRelatedElementOfConcernUsageIterator.MoveNext(); - ConcernUsageTextualNotationBuilder.BuildFramedConcernUsage(ownedRelatedElementOfConcernUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfConcernUsageIterator.Current != null) + { + ConcernUsageTextualNotationBuilder.BuildFramedConcernUsage(ownedRelatedElementOfConcernUsageIterator.Current, stringBuilder); + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs index 1ef429e6..08b23b29 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs @@ -46,9 +46,17 @@ public static void BuildIfNode(SysML2.NET.Core.POCO.Systems.Actions.IIfActionUsa ActionUsageTextualNotationBuilder.BuildActionNodePrefix(poco, stringBuilder); stringBuilder.Append("if "); ownedRelationshipOfParameterMembershipIterator.MoveNext(); - ParameterMembershipTextualNotationBuilder.BuildExpressionParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildExpressionParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } ownedRelationshipOfParameterMembershipIterator.MoveNext(); - ParameterMembershipTextualNotationBuilder.BuildActionBodyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildActionBodyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } if (BuildGroupConditionForIfNode(poco)) { diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IndexExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IndexExpressionTextualNotationBuilder.cs index 85eb76b7..3a765c76 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IndexExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IndexExpressionTextualNotationBuilder.cs @@ -45,11 +45,19 @@ public static void BuildIndexExpression(SysML2.NET.Core.POCO.Kernel.Expressions. using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfParameterMembershipIterator.MoveNext(); - ParameterMembershipTextualNotationBuilder.BuildPrimaryArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildPrimaryArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } stringBuilder.Append("#"); stringBuilder.Append("("); ownedRelationshipOfFeatureMembershipIterator.MoveNext(); - FeatureMembershipTextualNotationBuilder.BuildSequenceExpressionListMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + { + FeatureMembershipTextualNotationBuilder.BuildSequenceExpressionListMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + } stringBuilder.Append(")"); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs index ef3162e6..68942d76 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs @@ -66,10 +66,18 @@ public static void BuildBinaryInterfacePart(SysML2.NET.Core.POCO.Systems.Interfa { using var ownedRelationshipOfEndFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); - EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } stringBuilder.Append("to "); ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); - EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } } @@ -84,15 +92,27 @@ public static void BuildNaryInterfacePart(SysML2.NET.Core.POCO.Systems.Interface using var ownedRelationshipOfEndFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); stringBuilder.Append("("); ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); - EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } stringBuilder.Append(","); ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); - EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } while (ownedRelationshipOfEndFeatureMembershipIterator.MoveNext()) { stringBuilder.Append(","); - EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } } stringBuilder.Append(")"); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs index 9d70ff06..c96cd1f2 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs @@ -48,7 +48,11 @@ public static void BuildInvariant(SysML2.NET.Core.POCO.Kernel.Functions.IInvaria while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs index 6ee935b4..23af400c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs @@ -46,14 +46,26 @@ public static void BuildFunctionOperationExpression(SysML2.NET.Core.POCO.Kernel. using var ownedRelationshipOfInvocationExpressionIterator = poco.OwnedRelationship.OfType().GetEnumerator(); using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfParameterMembershipIterator.MoveNext(); - ParameterMembershipTextualNotationBuilder.BuildPrimaryArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildPrimaryArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } stringBuilder.Append("-> "); ownedRelationshipOfInvocationExpressionIterator.MoveNext(); - BuildInvocationTypeMember(ownedRelationshipOfInvocationExpressionIterator.Current, stringBuilder); + + if (ownedRelationshipOfInvocationExpressionIterator.Current != null) + { + BuildInvocationTypeMember(ownedRelationshipOfInvocationExpressionIterator.Current, stringBuilder); + } throw new System.NotSupportedException("Multiple alternatives not implemented yet"); stringBuilder.Append(' '); ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); - ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) + { + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + } } @@ -68,10 +80,18 @@ public static void BuildInvocationExpression(SysML2.NET.Core.POCO.Kernel.Express using var ownedRelationshipOfMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfMembershipIterator.MoveNext(); - MembershipTextualNotationBuilder.BuildInstantiatedTypeMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfMembershipIterator.Current != null) + { + MembershipTextualNotationBuilder.BuildInstantiatedTypeMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + } FeatureTextualNotationBuilder.BuildArgumentList(poco, stringBuilder); ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); - ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) + { + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LibraryPackageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LibraryPackageTextualNotationBuilder.cs index 57d5e80c..da98b0fe 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LibraryPackageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LibraryPackageTextualNotationBuilder.cs @@ -50,7 +50,11 @@ public static void BuildLibraryPackage(SysML2.NET.Core.POCO.Kernel.Packages.ILib while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } } PackageTextualNotationBuilder.BuildPackageDeclaration(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralBooleanTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralBooleanTextualNotationBuilder.cs index 215bf2bf..3179d442 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralBooleanTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralBooleanTextualNotationBuilder.cs @@ -42,7 +42,7 @@ public static partial class LiteralBooleanTextualNotationBuilder /// The that contains the entire textual notation public static void BuildLiteralBoolean(SysML2.NET.Core.POCO.Kernel.Expressions.ILiteralBoolean poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of bool with rule element value different than TerminalElement not supported"); + stringBuilder.Append(poco.Value.ToString().ToLower()); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.cs index 35812294..302d2da6 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.cs @@ -42,7 +42,7 @@ public static partial class MembershipImportTextualNotationBuilder /// The that contains the entire textual notation public static void BuildMembershipImport(SysML2.NET.Core.POCO.Root.Namespaces.IMembershipImport poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + throw new System.NotSupportedException("Assigment of reference element not supported yet for this case"); if (poco.IsRecursive) { diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs index 3af0d262..4cf249cf 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs @@ -79,7 +79,7 @@ public static void BuildAliasMember(SysML2.NET.Core.POCO.Root.Namespaces.IMember } stringBuilder.Append("for "); - throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + throw new System.NotSupportedException("Assigment of reference element not supported yet for this case"); RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); } @@ -103,7 +103,12 @@ public static void BuildFeatureChainMember(SysML2.NET.Core.POCO.Root.Namespaces. /// The that contains the entire textual notation public static void BuildFeatureReferenceMember(SysML2.NET.Core.POCO.Root.Namespaces.IMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + + if (poco.MemberElement != null) + { + stringBuilder.Append(poco.qualifiedName); + + } } @@ -115,7 +120,7 @@ public static void BuildFeatureReferenceMember(SysML2.NET.Core.POCO.Root.Namespa /// The that contains the entire textual notation public static void BuildElementReferenceMember(SysML2.NET.Core.POCO.Root.Namespaces.IMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + throw new System.NotSupportedException("Assigment of reference element not supported yet for this case"); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataAccessExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataAccessExpressionTextualNotationBuilder.cs index 84030eab..2a6fbfec 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataAccessExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataAccessExpressionTextualNotationBuilder.cs @@ -44,7 +44,11 @@ public static void BuildMetadataReference(SysML2.NET.Core.POCO.Kernel.Expression { using var ownedRelationshipOfMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfMembershipIterator.MoveNext(); - MembershipTextualNotationBuilder.BuildElementReferenceMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfMembershipIterator.Current != null) + { + MembershipTextualNotationBuilder.BuildElementReferenceMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + } } @@ -58,7 +62,11 @@ public static void BuildMetadataAccessExpression(SysML2.NET.Core.POCO.Kernel.Exp { using var ownedRelationshipOfMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfMembershipIterator.MoveNext(); - MembershipTextualNotationBuilder.BuildElementReferenceMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfMembershipIterator.Current != null) + { + MembershipTextualNotationBuilder.BuildElementReferenceMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + } stringBuilder.Append("."); stringBuilder.Append("metadata "); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs index 07423665..e96c9a6d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs @@ -44,7 +44,11 @@ public static void BuildPrefixMetadataFeature(SysML2.NET.Core.POCO.Kernel.Metada { using var ownedRelationshipOfFeatureTypingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfFeatureTypingIterator.MoveNext(); - FeatureTypingTextualNotationBuilder.BuildOwnedFeatureTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureTypingIterator.Current != null) + { + FeatureTypingTextualNotationBuilder.BuildOwnedFeatureTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + } } @@ -67,7 +71,11 @@ public static void BuildMetadataFeatureDeclaration(SysML2.NET.Core.POCO.Kernel.M } ownedRelationshipOfFeatureTypingIterator.MoveNext(); - FeatureTypingTextualNotationBuilder.BuildOwnedFeatureTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureTypingIterator.Current != null) + { + FeatureTypingTextualNotationBuilder.BuildOwnedFeatureTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + } } @@ -84,7 +92,11 @@ public static void BuildMetadataFeature(SysML2.NET.Core.POCO.Kernel.Metadata.IMe while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } } throw new System.NotSupportedException("Multiple alternatives not implemented yet"); @@ -94,12 +106,20 @@ public static void BuildMetadataFeature(SysML2.NET.Core.POCO.Kernel.Metadata.IMe if (ownedRelationshipOfAnnotationIterator.MoveNext()) { stringBuilder.Append("about "); - AnnotationTextualNotationBuilder.BuildAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + + if (ownedRelationshipOfAnnotationIterator.Current != null) + { + AnnotationTextualNotationBuilder.BuildAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + } while (ownedRelationshipOfAnnotationIterator.MoveNext()) { stringBuilder.Append(","); - AnnotationTextualNotationBuilder.BuildAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + + if (ownedRelationshipOfAnnotationIterator.Current != null) + { + AnnotationTextualNotationBuilder.BuildAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + } } stringBuilder.Append(' '); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs index 8355b7c8..168ac253 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs @@ -44,7 +44,11 @@ public static void BuildPrefixMetadataUsage(SysML2.NET.Core.POCO.Systems.Metadat { using var ownedRelationshipOfFeatureTypingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfFeatureTypingIterator.MoveNext(); - FeatureTypingTextualNotationBuilder.BuildOwnedFeatureTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureTypingIterator.Current != null) + { + FeatureTypingTextualNotationBuilder.BuildOwnedFeatureTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + } } @@ -67,7 +71,11 @@ public static void BuildMetadataUsageDeclaration(SysML2.NET.Core.POCO.Systems.Me } ownedRelationshipOfFeatureTypingIterator.MoveNext(); - FeatureTypingTextualNotationBuilder.BuildOwnedFeatureTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureTypingIterator.Current != null) + { + FeatureTypingTextualNotationBuilder.BuildOwnedFeatureTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + } } @@ -88,12 +96,20 @@ public static void BuildMetadataUsage(SysML2.NET.Core.POCO.Systems.Metadata.IMet if (ownedRelationshipOfAnnotationIterator.MoveNext()) { stringBuilder.Append("about "); - AnnotationTextualNotationBuilder.BuildAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + + if (ownedRelationshipOfAnnotationIterator.Current != null) + { + AnnotationTextualNotationBuilder.BuildAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + } while (ownedRelationshipOfAnnotationIterator.MoveNext()) { stringBuilder.Append(","); - AnnotationTextualNotationBuilder.BuildAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + + if (ownedRelationshipOfAnnotationIterator.Current != null) + { + AnnotationTextualNotationBuilder.BuildAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + } } stringBuilder.Append(' '); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityRangeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityRangeTextualNotationBuilder.cs index 56442a1b..dffe2bee 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityRangeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityRangeTextualNotationBuilder.cs @@ -59,13 +59,21 @@ public static void BuildMultiplicityBounds(SysML2.NET.Core.POCO.Kernel.Multiplic if (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - OwningMembershipTextualNotationBuilder.BuildMultiplicityExpressionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildMultiplicityExpressionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } stringBuilder.Append(".. "); stringBuilder.Append(' '); } ownedRelationshipOfOwningMembershipIterator.MoveNext(); - OwningMembershipTextualNotationBuilder.BuildMultiplicityExpressionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildMultiplicityExpressionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } stringBuilder.Append("]"); } @@ -83,13 +91,21 @@ public static void BuildMultiplicityRange(SysML2.NET.Core.POCO.Kernel.Multiplici if (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - OwningMembershipTextualNotationBuilder.BuildMultiplicityExpressionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildMultiplicityExpressionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } stringBuilder.Append(".. "); stringBuilder.Append(' '); } ownedRelationshipOfOwningMembershipIterator.MoveNext(); - OwningMembershipTextualNotationBuilder.BuildMultiplicityExpressionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildMultiplicityExpressionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } stringBuilder.Append("]"); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs index b06e9455..07d4b473 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs @@ -93,7 +93,11 @@ public static void BuildNamespace(SysML2.NET.Core.POCO.Root.Namespaces.INamespac while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } } BuildNamespaceDeclaration(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ObjectiveMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ObjectiveMembershipTextualNotationBuilder.cs index 465b6fb9..7a624821 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ObjectiveMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ObjectiveMembershipTextualNotationBuilder.cs @@ -46,7 +46,11 @@ public static void BuildObjectiveMember(SysML2.NET.Core.POCO.Systems.Cases.IObje MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); stringBuilder.Append("objective "); ownedRelatedElementOfRequirementUsageIterator.MoveNext(); - RequirementUsageTextualNotationBuilder.BuildObjectiveRequirementUsage(ownedRelatedElementOfRequirementUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfRequirementUsageIterator.Current != null) + { + RequirementUsageTextualNotationBuilder.BuildObjectiveRequirementUsage(ownedRelatedElementOfRequirementUsageIterator.Current, stringBuilder); + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs index a595d817..72c33c79 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs @@ -48,7 +48,11 @@ public static void BuildOccurrenceDefinitionPrefix(SysML2.NET.Core.POCO.Systems. if (poco.IsIndividual && ownedRelationshipOfOwningMembershipIterator.MoveNext()) { stringBuilder.Append("individual"); - OwningMembershipTextualNotationBuilder.BuildEmptyMultiplicityMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildEmptyMultiplicityMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } stringBuilder.Append(' '); } @@ -71,7 +75,11 @@ public static void BuildIndividualDefinition(SysML2.NET.Core.POCO.Systems.Occurr stringBuilder.Append("def "); DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); ownedRelationshipOfOwningMembershipIterator.MoveNext(); - OwningMembershipTextualNotationBuilder.BuildEmptyMultiplicityMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildEmptyMultiplicityMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs index 771d83d7..56dbad97 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs @@ -54,7 +54,7 @@ public static void BuildOccurrenceUsagePrefix(SysML2.NET.Core.POCO.Systems.Occur if (poco.PortionKind.HasValue) { stringBuilder.Append(poco.PortionKind.ToString().ToLower()); - // Assignment Element : isPortion = true + // NonParsing Assignment Element : isPortion = true => Does not have to be process stringBuilder.Append(' '); } @@ -96,7 +96,7 @@ public static void BuildPortionUsage(SysML2.NET.Core.POCO.Systems.Occurrences.IO stringBuilder.Append(poco.PortionKind.ToString().ToLower()); UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, stringBuilder); UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); - // Assignment Element : isPortion = true + // NonParsing Assignment Element : isPortion = true => Does not have to be process } @@ -120,7 +120,7 @@ public static void BuildControlNodePrefix(SysML2.NET.Core.POCO.Systems.Occurrenc if (poco.PortionKind.HasValue) { stringBuilder.Append(poco.PortionKind.ToString().ToLower()); - // Assignment Element : isPortion = true + // NonParsing Assignment Element : isPortion = true => Does not have to be process stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OperatorExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OperatorExpressionTextualNotationBuilder.cs index a8c95f03..d8fab4ba 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OperatorExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OperatorExpressionTextualNotationBuilder.cs @@ -46,15 +46,31 @@ public static void BuildConditionalExpression(SysML2.NET.Core.POCO.Kernel.Expres using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); stringBuilder.Append(poco.Operator); ownedRelationshipOfParameterMembershipIterator.MoveNext(); - ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } stringBuilder.Append("?"); ownedRelationshipOfParameterMembershipIterator.MoveNext(); - ParameterMembershipTextualNotationBuilder.BuildArgumentExpressionMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildArgumentExpressionMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } stringBuilder.Append("else "); ownedRelationshipOfParameterMembershipIterator.MoveNext(); - ParameterMembershipTextualNotationBuilder.BuildArgumentExpressionMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildArgumentExpressionMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); - ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) + { + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + } } @@ -69,12 +85,24 @@ public static void BuildConditionalBinaryOperatorExpression(SysML2.NET.Core.POCO using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfParameterMembershipIterator.MoveNext(); - ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } stringBuilder.Append(poco.Operator); ownedRelationshipOfParameterMembershipIterator.MoveNext(); - ParameterMembershipTextualNotationBuilder.BuildArgumentExpressionMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildArgumentExpressionMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); - ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) + { + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + } } @@ -89,12 +117,24 @@ public static void BuildBinaryOperatorExpression(SysML2.NET.Core.POCO.Kernel.Exp using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfParameterMembershipIterator.MoveNext(); - ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } stringBuilder.Append(poco.Operator); ownedRelationshipOfParameterMembershipIterator.MoveNext(); - ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); - ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) + { + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + } } @@ -110,9 +150,17 @@ public static void BuildUnaryOperatorExpression(SysML2.NET.Core.POCO.Kernel.Expr using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); stringBuilder.Append(poco.Operator); ownedRelationshipOfParameterMembershipIterator.MoveNext(); - ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); - ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) + { + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + } } @@ -130,14 +178,22 @@ public static void BuildClassificationExpression(SysML2.NET.Core.POCO.Kernel.Exp if (ownedRelationshipOfParameterMembershipIterator.MoveNext()) { - ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } stringBuilder.Append(' '); } throw new System.NotSupportedException("Multiple alternatives not implemented yet"); stringBuilder.Append(' '); ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); - ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) + { + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + } } @@ -153,11 +209,19 @@ public static void BuildMetaclassificationExpression(SysML2.NET.Core.POCO.Kernel using var ownedRelationshipIterator = poco.OwnedRelationship.GetEnumerator(); using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfParameterMembershipIterator.MoveNext(); - ParameterMembershipTextualNotationBuilder.BuildMetadataArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildMetadataArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } throw new System.NotSupportedException("Multiple alternatives not implemented yet"); stringBuilder.Append(' '); ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); - ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) + { + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + } } @@ -172,7 +236,11 @@ public static void BuildExtentExpression(SysML2.NET.Core.POCO.Kernel.Expressions using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); stringBuilder.Append(poco.Operator); ownedRelationshipOfParameterMembershipIterator.MoveNext(); - ParameterMembershipTextualNotationBuilder.BuildTypeReferenceMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildTypeReferenceMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } } @@ -187,10 +255,18 @@ public static void BuildBracketExpression(SysML2.NET.Core.POCO.Kernel.Expression using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfParameterMembershipIterator.MoveNext(); - ParameterMembershipTextualNotationBuilder.BuildPrimaryArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildPrimaryArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } stringBuilder.Append(poco.Operator); ownedRelationshipOfFeatureMembershipIterator.MoveNext(); - FeatureMembershipTextualNotationBuilder.BuildSequenceExpressionListMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + { + FeatureMembershipTextualNotationBuilder.BuildSequenceExpressionListMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + } stringBuilder.Append("]"); } @@ -205,10 +281,18 @@ public static void BuildSequenceOperatorExpression(SysML2.NET.Core.POCO.Kernel.E { using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfFeatureMembershipIterator.MoveNext(); - FeatureMembershipTextualNotationBuilder.BuildOwnedExpressionMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + { + FeatureMembershipTextualNotationBuilder.BuildOwnedExpressionMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + } stringBuilder.Append(poco.Operator); ownedRelationshipOfFeatureMembershipIterator.MoveNext(); - FeatureMembershipTextualNotationBuilder.BuildSequenceExpressionListMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + { + FeatureMembershipTextualNotationBuilder.BuildSequenceExpressionListMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs index fe2a72fd..5226443c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs @@ -44,7 +44,11 @@ public static void BuildAnnotatingMember(SysML2.NET.Core.POCO.Root.Namespaces.IO { using var ownedRelatedElementOfAnnotatingElementIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); ownedRelatedElementOfAnnotatingElementIterator.MoveNext(); - AnnotatingElementTextualNotationBuilder.BuildAnnotatingElement(ownedRelatedElementOfAnnotatingElementIterator.Current, stringBuilder); + + if (ownedRelatedElementOfAnnotatingElementIterator.Current != null) + { + AnnotatingElementTextualNotationBuilder.BuildAnnotatingElement(ownedRelatedElementOfAnnotatingElementIterator.Current, stringBuilder); + } } @@ -75,7 +79,11 @@ public static void BuildDefinitionMember(SysML2.NET.Core.POCO.Root.Namespaces.IO using var ownedRelatedElementIterator = poco.OwnedRelatedElement.GetEnumerator(); MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); ownedRelatedElementIterator.MoveNext(); - ElementTextualNotationBuilder.BuildDefinitionElement(ownedRelatedElementIterator.Current, stringBuilder); + + if (ownedRelatedElementIterator.Current != null) + { + ElementTextualNotationBuilder.BuildDefinitionElement(ownedRelatedElementIterator.Current, stringBuilder); + } } @@ -89,7 +97,11 @@ public static void BuildOwnedCrossFeatureMember(SysML2.NET.Core.POCO.Root.Namesp { using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); ownedRelatedElementOfReferenceUsageIterator.MoveNext(); - ReferenceUsageTextualNotationBuilder.BuildOwnedCrossFeature(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfReferenceUsageIterator.Current != null) + { + ReferenceUsageTextualNotationBuilder.BuildOwnedCrossFeature(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + } } @@ -103,7 +115,11 @@ public static void BuildOwnedMultiplicity(SysML2.NET.Core.POCO.Root.Namespaces.I { using var ownedRelatedElementOfMultiplicityRangeIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); ownedRelatedElementOfMultiplicityRangeIterator.MoveNext(); - MultiplicityRangeTextualNotationBuilder.BuildMultiplicityRange(ownedRelatedElementOfMultiplicityRangeIterator.Current, stringBuilder); + + if (ownedRelatedElementOfMultiplicityRangeIterator.Current != null) + { + MultiplicityRangeTextualNotationBuilder.BuildMultiplicityRange(ownedRelatedElementOfMultiplicityRangeIterator.Current, stringBuilder); + } } @@ -129,7 +145,11 @@ public static void BuildEmptyMultiplicityMember(SysML2.NET.Core.POCO.Root.Namesp { using var ownedRelatedElementOfMultiplicityIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); ownedRelatedElementOfMultiplicityIterator.MoveNext(); - MultiplicityTextualNotationBuilder.BuildEmptyMultiplicity(ownedRelatedElementOfMultiplicityIterator.Current, stringBuilder); + + if (ownedRelatedElementOfMultiplicityIterator.Current != null) + { + MultiplicityTextualNotationBuilder.BuildEmptyMultiplicity(ownedRelatedElementOfMultiplicityIterator.Current, stringBuilder); + } } @@ -143,7 +163,11 @@ public static void BuildConjugatedPortDefinitionMember(SysML2.NET.Core.POCO.Root { using var ownedRelatedElementOfConjugatedPortDefinitionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); ownedRelatedElementOfConjugatedPortDefinitionIterator.MoveNext(); - ConjugatedPortDefinitionTextualNotationBuilder.BuildConjugatedPortDefinition(ownedRelatedElementOfConjugatedPortDefinitionIterator.Current, stringBuilder); + + if (ownedRelatedElementOfConjugatedPortDefinitionIterator.Current != null) + { + ConjugatedPortDefinitionTextualNotationBuilder.BuildConjugatedPortDefinition(ownedRelatedElementOfConjugatedPortDefinitionIterator.Current, stringBuilder); + } } @@ -157,7 +181,11 @@ public static void BuildOwnedCrossMultiplicityMember(SysML2.NET.Core.POCO.Root.N { using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); ownedRelatedElementOfFeatureIterator.MoveNext(); - FeatureTextualNotationBuilder.BuildOwnedCrossMultiplicity(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + + if (ownedRelatedElementOfFeatureIterator.Current != null) + { + FeatureTextualNotationBuilder.BuildOwnedCrossMultiplicity(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + } } @@ -171,7 +199,11 @@ public static void BuildOwnedFeatureChainMember(SysML2.NET.Core.POCO.Root.Namesp { using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); ownedRelatedElementOfFeatureIterator.MoveNext(); - FeatureTextualNotationBuilder.BuildOwnedFeatureChain(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + + if (ownedRelatedElementOfFeatureIterator.Current != null) + { + FeatureTextualNotationBuilder.BuildOwnedFeatureChain(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + } } @@ -185,7 +217,11 @@ public static void BuildTransitionSuccessionMember(SysML2.NET.Core.POCO.Root.Nam { using var ownedRelatedElementOfSuccessionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); ownedRelatedElementOfSuccessionIterator.MoveNext(); - SuccessionTextualNotationBuilder.BuildTransitionSuccession(ownedRelatedElementOfSuccessionIterator.Current, stringBuilder); + + if (ownedRelatedElementOfSuccessionIterator.Current != null) + { + SuccessionTextualNotationBuilder.BuildTransitionSuccession(ownedRelatedElementOfSuccessionIterator.Current, stringBuilder); + } } @@ -200,7 +236,11 @@ public static void BuildPrefixMetadataMember(SysML2.NET.Core.POCO.Root.Namespace using var ownedRelatedElementOfMetadataUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); stringBuilder.Append("#"); ownedRelatedElementOfMetadataUsageIterator.MoveNext(); - MetadataUsageTextualNotationBuilder.BuildPrefixMetadataUsage(ownedRelatedElementOfMetadataUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfMetadataUsageIterator.Current != null) + { + MetadataUsageTextualNotationBuilder.BuildPrefixMetadataUsage(ownedRelatedElementOfMetadataUsageIterator.Current, stringBuilder); + } } @@ -226,7 +266,11 @@ public static void BuildNonFeatureMember(SysML2.NET.Core.POCO.Root.Namespaces.IO using var ownedRelatedElementIterator = poco.OwnedRelatedElement.GetEnumerator(); MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); ownedRelatedElementIterator.MoveNext(); - ElementTextualNotationBuilder.BuildMemberElement(ownedRelatedElementIterator.Current, stringBuilder); + + if (ownedRelatedElementIterator.Current != null) + { + ElementTextualNotationBuilder.BuildMemberElement(ownedRelatedElementIterator.Current, stringBuilder); + } } @@ -241,7 +285,11 @@ public static void BuildNamespaceFeatureMember(SysML2.NET.Core.POCO.Root.Namespa using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); ownedRelatedElementOfFeatureIterator.MoveNext(); - FeatureTextualNotationBuilder.BuildFeatureElement(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + + if (ownedRelatedElementOfFeatureIterator.Current != null) + { + FeatureTextualNotationBuilder.BuildFeatureElement(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + } } @@ -268,7 +316,11 @@ public static void BuildTypeFeatureMember(SysML2.NET.Core.POCO.Root.Namespaces.I MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); stringBuilder.Append("member "); ownedRelatedElementOfFeatureIterator.MoveNext(); - FeatureTextualNotationBuilder.BuildFeatureElement(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + + if (ownedRelatedElementOfFeatureIterator.Current != null) + { + FeatureTextualNotationBuilder.BuildFeatureElement(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs index 5a2a2f16..9f198a53 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs @@ -80,11 +80,19 @@ public static void BuildFilterPackage(SysML2.NET.Core.POCO.Kernel.Packages.IPack using var ownedRelationshipOfPackageIterator = poco.OwnedRelationship.OfType().GetEnumerator(); using var ownedRelationshipOfElementFilterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfPackageIterator.MoveNext(); - BuildFilterPackageImport(ownedRelationshipOfPackageIterator.Current, stringBuilder); + + if (ownedRelationshipOfPackageIterator.Current != null) + { + BuildFilterPackageImport(ownedRelationshipOfPackageIterator.Current, stringBuilder); + } while (ownedRelationshipOfElementFilterMembershipIterator.MoveNext()) { - ElementFilterMembershipTextualNotationBuilder.BuildFilterPackageMember(ownedRelationshipOfElementFilterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfElementFilterMembershipIterator.Current != null) + { + ElementFilterMembershipTextualNotationBuilder.BuildFilterPackageMember(ownedRelationshipOfElementFilterMembershipIterator.Current, stringBuilder); + } } stringBuilder.Append(' '); @@ -103,7 +111,11 @@ public static void BuildPackage(SysML2.NET.Core.POCO.Kernel.Packages.IPackage po while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } } BuildPackageDeclaration(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ParameterMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ParameterMembershipTextualNotationBuilder.cs index 410a1816..069f9a2f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ParameterMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ParameterMembershipTextualNotationBuilder.cs @@ -44,7 +44,11 @@ public static void BuildMessageEventMember(SysML2.NET.Core.POCO.Kernel.Behaviors { using var ownedRelatedElementOfEventOccurrenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); ownedRelatedElementOfEventOccurrenceUsageIterator.MoveNext(); - EventOccurrenceUsageTextualNotationBuilder.BuildMessageEvent(ownedRelatedElementOfEventOccurrenceUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfEventOccurrenceUsageIterator.Current != null) + { + EventOccurrenceUsageTextualNotationBuilder.BuildMessageEvent(ownedRelatedElementOfEventOccurrenceUsageIterator.Current, stringBuilder); + } } @@ -58,7 +62,11 @@ public static void BuildPayloadParameterMember(SysML2.NET.Core.POCO.Kernel.Behav { using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); ownedRelatedElementOfReferenceUsageIterator.MoveNext(); - ReferenceUsageTextualNotationBuilder.BuildPayloadParameter(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfReferenceUsageIterator.Current != null) + { + ReferenceUsageTextualNotationBuilder.BuildPayloadParameter(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + } } @@ -70,7 +78,11 @@ public static void BuildPayloadParameterMember(SysML2.NET.Core.POCO.Kernel.Behav /// The that contains the entire textual notation public static void BuildArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + + if (poco.ownedMemberParameter != null) + { + FeatureTextualNotationBuilder.BuildArgument(poco.ownedMemberParameter, stringBuilder); + } } @@ -84,7 +96,11 @@ public static void BuildArgumentExpressionMember(SysML2.NET.Core.POCO.Kernel.Beh { using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); ownedRelatedElementOfFeatureIterator.MoveNext(); - FeatureTextualNotationBuilder.BuildArgumentExpression(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + + if (ownedRelatedElementOfFeatureIterator.Current != null) + { + FeatureTextualNotationBuilder.BuildArgumentExpression(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + } } @@ -98,7 +114,11 @@ public static void BuildNodeParameterMember(SysML2.NET.Core.POCO.Kernel.Behavior { using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); ownedRelatedElementOfReferenceUsageIterator.MoveNext(); - ReferenceUsageTextualNotationBuilder.BuildNodeParameter(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfReferenceUsageIterator.Current != null) + { + ReferenceUsageTextualNotationBuilder.BuildNodeParameter(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + } } @@ -112,7 +132,11 @@ public static void BuildEmptyParameterMember(SysML2.NET.Core.POCO.Kernel.Behavio { using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); ownedRelatedElementOfReferenceUsageIterator.MoveNext(); - ReferenceUsageTextualNotationBuilder.BuildEmptyUsage(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfReferenceUsageIterator.Current != null) + { + ReferenceUsageTextualNotationBuilder.BuildEmptyUsage(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + } } @@ -126,7 +150,11 @@ public static void BuildAssignmentTargetMember(SysML2.NET.Core.POCO.Kernel.Behav { using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); ownedRelatedElementOfReferenceUsageIterator.MoveNext(); - ReferenceUsageTextualNotationBuilder.BuildAssignmentTargetParameter(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfReferenceUsageIterator.Current != null) + { + ReferenceUsageTextualNotationBuilder.BuildAssignmentTargetParameter(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + } } @@ -140,7 +168,11 @@ public static void BuildExpressionParameterMember(SysML2.NET.Core.POCO.Kernel.Be { using var ownedRelatedElementOfExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); ownedRelatedElementOfExpressionIterator.MoveNext(); - ExpressionTextualNotationBuilder.BuildOwnedExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); + + if (ownedRelatedElementOfExpressionIterator.Current != null) + { + ExpressionTextualNotationBuilder.BuildOwnedExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); + } } @@ -154,7 +186,11 @@ public static void BuildActionBodyParameterMember(SysML2.NET.Core.POCO.Kernel.Be { using var ownedRelatedElementOfActionUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); ownedRelatedElementOfActionUsageIterator.MoveNext(); - ActionUsageTextualNotationBuilder.BuildActionBodyParameter(ownedRelatedElementOfActionUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfActionUsageIterator.Current != null) + { + ActionUsageTextualNotationBuilder.BuildActionBodyParameter(ownedRelatedElementOfActionUsageIterator.Current, stringBuilder); + } } @@ -168,7 +204,11 @@ public static void BuildIfNodeParameterMember(SysML2.NET.Core.POCO.Kernel.Behavi { using var ownedRelatedElementOfIfActionUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); ownedRelatedElementOfIfActionUsageIterator.MoveNext(); - IfActionUsageTextualNotationBuilder.BuildIfNode(ownedRelatedElementOfIfActionUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfIfActionUsageIterator.Current != null) + { + IfActionUsageTextualNotationBuilder.BuildIfNode(ownedRelatedElementOfIfActionUsageIterator.Current, stringBuilder); + } } @@ -182,7 +222,11 @@ public static void BuildMetadataArgumentMember(SysML2.NET.Core.POCO.Kernel.Behav { using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); ownedRelatedElementOfFeatureIterator.MoveNext(); - FeatureTextualNotationBuilder.BuildMetadataArgument(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + + if (ownedRelatedElementOfFeatureIterator.Current != null) + { + FeatureTextualNotationBuilder.BuildMetadataArgument(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + } } @@ -194,7 +238,11 @@ public static void BuildMetadataArgumentMember(SysML2.NET.Core.POCO.Kernel.Behav /// The that contains the entire textual notation public static void BuildTypeReferenceMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + + if (poco.ownedMemberFeature != null) + { + FeatureTextualNotationBuilder.BuildTypeReference(poco.ownedMemberFeature, stringBuilder); + } } @@ -206,7 +254,11 @@ public static void BuildTypeReferenceMember(SysML2.NET.Core.POCO.Kernel.Behavior /// The that contains the entire textual notation public static void BuildPrimaryArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + + if (poco.ownedMemberParameter != null) + { + FeatureTextualNotationBuilder.BuildPrimaryArgument(poco.ownedMemberParameter, stringBuilder); + } } @@ -218,7 +270,11 @@ public static void BuildPrimaryArgumentMember(SysML2.NET.Core.POCO.Kernel.Behavi /// The that contains the entire textual notation public static void BuildNonFeatureChainPrimaryArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + + if (poco.ownedMemberParameter != null) + { + FeatureTextualNotationBuilder.BuildPrimaryArgument(poco.ownedMemberParameter, stringBuilder); + } } @@ -230,7 +286,11 @@ public static void BuildNonFeatureChainPrimaryArgumentMember(SysML2.NET.Core.POC /// The that contains the entire textual notation public static void BuildBodyArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + + if (poco.ownedMemberParameter != null) + { + FeatureTextualNotationBuilder.BuildBodyArgument(poco.ownedMemberParameter, stringBuilder); + } } @@ -242,7 +302,11 @@ public static void BuildBodyArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors /// The that contains the entire textual notation public static void BuildFunctionReferenceArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + + if (poco.ownedMemberParameter != null) + { + FeatureTextualNotationBuilder.BuildFunctionReferenceArgument(poco.ownedMemberParameter, stringBuilder); + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortDefinitionTextualNotationBuilder.cs index c554a6ff..f99f3579 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortDefinitionTextualNotationBuilder.cs @@ -48,8 +48,12 @@ public static void BuildPortDefinition(SysML2.NET.Core.POCO.Systems.Ports.IPortD stringBuilder.Append("def "); DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); ownedRelationshipOfOwningMembershipIterator.MoveNext(); - OwningMembershipTextualNotationBuilder.BuildConjugatedPortDefinitionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); - // Assignment Element : conjugatedPortDefinition.ownedPortConjugator.originalPortDefinition = this + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildConjugatedPortDefinitionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } + // NonParsing Assignment Element : conjugatedPortDefinition.ownedPortConjugator.originalPortDefinition = this => Does not have to be process } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs index 14545ef3..540b1d23 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs @@ -60,7 +60,11 @@ public static void BuildInterfaceEnd(SysML2.NET.Core.POCO.Systems.Ports.IPortUsa if (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - OwningMembershipTextualNotationBuilder.BuildOwnedCrossMultiplicityMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildOwnedCrossMultiplicityMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } stringBuilder.Append(' '); } @@ -73,7 +77,11 @@ public static void BuildInterfaceEnd(SysML2.NET.Core.POCO.Systems.Ports.IPortUsa } ownedRelationshipOfReferenceSubsettingIterator.MoveNext(); - ReferenceSubsettingTextualNotationBuilder.BuildOwnedReferenceSubsetting(ownedRelationshipOfReferenceSubsettingIterator.Current, stringBuilder); + + if (ownedRelationshipOfReferenceSubsettingIterator.Current != null) + { + ReferenceSubsettingTextualNotationBuilder.BuildOwnedReferenceSubsetting(ownedRelationshipOfReferenceSubsettingIterator.Current, stringBuilder); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs index 75e6b414..faee9cdd 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs @@ -53,7 +53,7 @@ public static void BuildOwnedRedefinition(SysML2.NET.Core.POCO.Core.Features.IRe /// The that contains the entire textual notation public static void BuildFlowFeatureRedefinition(SysML2.NET.Core.POCO.Core.Features.IRedefinition poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + throw new System.NotSupportedException("Assigment of reference element not supported yet for this case"); } @@ -65,7 +65,7 @@ public static void BuildFlowFeatureRedefinition(SysML2.NET.Core.POCO.Core.Featur /// The that contains the entire textual notation public static void BuildParameterRedefinition(SysML2.NET.Core.POCO.Core.Features.IRedefinition poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + throw new System.NotSupportedException("Assigment of reference element not supported yet for this case"); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs index 3fde433d..1e7a4cb1 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs @@ -70,7 +70,11 @@ public static void BuildVariantReference(SysML2.NET.Core.POCO.Systems.Definition { using var ownedRelationshipOfReferenceSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfReferenceSubsettingIterator.MoveNext(); - ReferenceSubsettingTextualNotationBuilder.BuildOwnedReferenceSubsetting(ownedRelationshipOfReferenceSubsettingIterator.Current, stringBuilder); + + if (ownedRelationshipOfReferenceSubsettingIterator.Current != null) + { + ReferenceSubsettingTextualNotationBuilder.BuildOwnedReferenceSubsetting(ownedRelationshipOfReferenceSubsettingIterator.Current, stringBuilder); + } FeatureTextualNotationBuilder.BuildFeatureSpecialization(poco, stringBuilder); UsageTextualNotationBuilder.BuildUsageBody(poco, stringBuilder); @@ -88,7 +92,11 @@ public static void BuildSourceEnd(SysML2.NET.Core.POCO.Systems.DefinitionAndUsag if (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - OwningMembershipTextualNotationBuilder.BuildOwnedMultiplicity(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildOwnedMultiplicity(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } stringBuilder.Append(' '); } @@ -108,7 +116,11 @@ public static void BuildConnectorEnd(SysML2.NET.Core.POCO.Systems.DefinitionAndU if (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - OwningMembershipTextualNotationBuilder.BuildOwnedCrossMultiplicityMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildOwnedCrossMultiplicityMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } stringBuilder.Append(' '); } @@ -121,7 +133,11 @@ public static void BuildConnectorEnd(SysML2.NET.Core.POCO.Systems.DefinitionAndU } ownedRelationshipOfReferenceSubsettingIterator.MoveNext(); - ReferenceSubsettingTextualNotationBuilder.BuildOwnedReferenceSubsetting(ownedRelationshipOfReferenceSubsettingIterator.Current, stringBuilder); + + if (ownedRelationshipOfReferenceSubsettingIterator.Current != null) + { + ReferenceSubsettingTextualNotationBuilder.BuildOwnedReferenceSubsetting(ownedRelationshipOfReferenceSubsettingIterator.Current, stringBuilder); + } } @@ -135,7 +151,11 @@ public static void BuildFlowFeature(SysML2.NET.Core.POCO.Systems.DefinitionAndUs { using var ownedRelationshipOfRedefinitionIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfRedefinitionIterator.MoveNext(); - RedefinitionTextualNotationBuilder.BuildFlowFeatureRedefinition(ownedRelationshipOfRedefinitionIterator.Current, stringBuilder); + + if (ownedRelationshipOfRedefinitionIterator.Current != null) + { + RedefinitionTextualNotationBuilder.BuildFlowFeatureRedefinition(ownedRelationshipOfRedefinitionIterator.Current, stringBuilder); + } } @@ -160,7 +180,11 @@ public static void BuildNodeParameter(SysML2.NET.Core.POCO.Systems.DefinitionAnd { using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfFeatureValueIterator.MoveNext(); - FeatureValueTextualNotationBuilder.BuildFeatureBinding(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureValueIterator.Current != null) + { + FeatureValueTextualNotationBuilder.BuildFeatureBinding(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + } } @@ -187,7 +211,11 @@ public static void BuildAssignmentTargetParameter(SysML2.NET.Core.POCO.Systems.D if (ownedRelationshipOfFeatureValueIterator.MoveNext()) { - FeatureValueTextualNotationBuilder.BuildAssignmentTargetBinding(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureValueIterator.Current != null) + { + FeatureValueTextualNotationBuilder.BuildAssignmentTargetBinding(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + } stringBuilder.Append("."); stringBuilder.Append(' '); } @@ -242,7 +270,11 @@ public static void BuildSatisfactionParameter(SysML2.NET.Core.POCO.Systems.Defin { using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfFeatureValueIterator.MoveNext(); - FeatureValueTextualNotationBuilder.BuildSatisfactionFeatureValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + + if (ownedRelationshipOfFeatureValueIterator.Current != null) + { + FeatureValueTextualNotationBuilder.BuildSatisfactionFeatureValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + } } @@ -258,7 +290,11 @@ public static void BuildMetadataBodyUsage(SysML2.NET.Core.POCO.Systems.Definitio stringBuilder.Append("ref "); throw new System.NotSupportedException("Multiple alternatives not implemented yet"); ownedRelationshipOfRedefinitionIterator.MoveNext(); - RedefinitionTextualNotationBuilder.BuildOwnedRedefinition(ownedRelationshipOfRedefinitionIterator.Current, stringBuilder); + + if (ownedRelationshipOfRedefinitionIterator.Current != null) + { + RedefinitionTextualNotationBuilder.BuildOwnedRedefinition(ownedRelationshipOfRedefinitionIterator.Current, stringBuilder); + } FeatureTextualNotationBuilder.BuildFeatureSpecializationPart(poco, stringBuilder); FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); TypeTextualNotationBuilder.BuildMetadataBody(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.cs index 96bbfb04..6bc28e37 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.cs @@ -46,7 +46,11 @@ public static void BuildRequirementConstraintMember(SysML2.NET.Core.POCO.Systems MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); BuildRequirementKind(poco, stringBuilder); ownedRelatedElementOfConstraintUsageIterator.MoveNext(); - ConstraintUsageTextualNotationBuilder.BuildRequirementConstraintUsage(ownedRelatedElementOfConstraintUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfConstraintUsageIterator.Current != null) + { + ConstraintUsageTextualNotationBuilder.BuildRequirementConstraintUsage(ownedRelatedElementOfConstraintUsageIterator.Current, stringBuilder); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementVerificationMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementVerificationMembershipTextualNotationBuilder.cs index acf3e3c8..9fc0e309 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementVerificationMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementVerificationMembershipTextualNotationBuilder.cs @@ -45,9 +45,13 @@ public static void BuildRequirementVerificationMember(SysML2.NET.Core.POCO.Syste using var ownedRelatedElementOfRequirementUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); stringBuilder.Append("verify "); - // Assignment Element : kind = 'requirement' + // NonParsing Assignment Element : kind = 'requirement' => Does not have to be process ownedRelatedElementOfRequirementUsageIterator.MoveNext(); - RequirementUsageTextualNotationBuilder.BuildRequirementVerificationUsage(ownedRelatedElementOfRequirementUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfRequirementUsageIterator.Current != null) + { + RequirementUsageTextualNotationBuilder.BuildRequirementVerificationUsage(ownedRelatedElementOfRequirementUsageIterator.Current, stringBuilder); + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ResultExpressionMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ResultExpressionMembershipTextualNotationBuilder.cs index 82442930..aa2417e8 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ResultExpressionMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ResultExpressionMembershipTextualNotationBuilder.cs @@ -45,7 +45,11 @@ public static void BuildResultExpressionMember(SysML2.NET.Core.POCO.Kernel.Funct using var ownedRelatedElementOfExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); ownedRelatedElementOfExpressionIterator.MoveNext(); - ExpressionTextualNotationBuilder.BuildOwnedExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); + + if (ownedRelatedElementOfExpressionIterator.Current != null) + { + ExpressionTextualNotationBuilder.BuildOwnedExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReturnParameterMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReturnParameterMembershipTextualNotationBuilder.cs index 6cf95b1d..1daf515f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReturnParameterMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReturnParameterMembershipTextualNotationBuilder.cs @@ -46,7 +46,11 @@ public static void BuildReturnParameterMember(SysML2.NET.Core.POCO.Kernel.Functi MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); stringBuilder.Append("return "); ownedRelatedElementOfUsageIterator.MoveNext(); - UsageTextualNotationBuilder.BuildUsageElement(ownedRelatedElementOfUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfUsageIterator.Current != null) + { + UsageTextualNotationBuilder.BuildUsageElement(ownedRelatedElementOfUsageIterator.Current, stringBuilder); + } } @@ -62,7 +66,11 @@ public static void BuildReturnFeatureMember(SysML2.NET.Core.POCO.Kernel.Function MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); stringBuilder.Append("return "); ownedRelatedElementOfFeatureIterator.MoveNext(); - FeatureTextualNotationBuilder.BuildFeatureElement(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + + if (ownedRelatedElementOfFeatureIterator.Current != null) + { + FeatureTextualNotationBuilder.BuildFeatureElement(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + } } @@ -76,7 +84,11 @@ public static void BuildEmptyResultMember(SysML2.NET.Core.POCO.Kernel.Functions. { using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); ownedRelatedElementOfReferenceUsageIterator.MoveNext(); - ReferenceUsageTextualNotationBuilder.BuildEmptyFeature(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfReferenceUsageIterator.Current != null) + { + ReferenceUsageTextualNotationBuilder.BuildEmptyFeature(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + } } @@ -90,7 +102,11 @@ public static void BuildConstructorResultMember(SysML2.NET.Core.POCO.Kernel.Func { using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); ownedRelatedElementOfFeatureIterator.MoveNext(); - FeatureTextualNotationBuilder.BuildConstructorResult(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + + if (ownedRelatedElementOfFeatureIterator.Current != null) + { + FeatureTextualNotationBuilder.BuildConstructorResult(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.cs index 0d6e3994..20dab291 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.cs @@ -57,7 +57,11 @@ public static void BuildSatisfyRequirementUsage(SysML2.NET.Core.POCO.Systems.Req if (ownedRelationshipOfSubjectMembershipIterator.MoveNext()) { stringBuilder.Append("by "); - SubjectMembershipTextualNotationBuilder.BuildSatisfactionSubjectMember(ownedRelationshipOfSubjectMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfSubjectMembershipIterator.Current != null) + { + SubjectMembershipTextualNotationBuilder.BuildSatisfactionSubjectMember(ownedRelationshipOfSubjectMembershipIterator.Current, stringBuilder); + } stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SelectExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SelectExpressionTextualNotationBuilder.cs index e0d1f413..c0276adc 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SelectExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SelectExpressionTextualNotationBuilder.cs @@ -44,10 +44,18 @@ public static void BuildSelectExpression(SysML2.NET.Core.POCO.Kernel.Expressions { using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfParameterMembershipIterator.MoveNext(); - ParameterMembershipTextualNotationBuilder.BuildPrimaryArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildPrimaryArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } stringBuilder.Append(".? "); ownedRelationshipOfParameterMembershipIterator.MoveNext(); - ParameterMembershipTextualNotationBuilder.BuildBodyArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildBodyArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.cs index 075a2ce4..f319cd25 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.cs @@ -63,7 +63,11 @@ public static void BuildSendNodeDeclaration(SysML2.NET.Core.POCO.Systems.Actions ActionUsageTextualNotationBuilder.BuildActionNodeUsageDeclaration(poco, stringBuilder); stringBuilder.Append("send "); ownedRelationshipOfParameterMembershipIterator.MoveNext(); - ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } BuildSenderReceiverPart(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StakeholderMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StakeholderMembershipTextualNotationBuilder.cs index f6a5d022..93c35b22 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StakeholderMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StakeholderMembershipTextualNotationBuilder.cs @@ -45,7 +45,11 @@ public static void BuildStakeholderMember(SysML2.NET.Core.POCO.Systems.Requireme using var ownedRelatedElementOfPartUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); ownedRelatedElementOfPartUsageIterator.MoveNext(); - PartUsageTextualNotationBuilder.BuildStakeholderUsage(ownedRelatedElementOfPartUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfPartUsageIterator.Current != null) + { + PartUsageTextualNotationBuilder.BuildStakeholderUsage(ownedRelatedElementOfPartUsageIterator.Current, stringBuilder); + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateSubactionMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateSubactionMembershipTextualNotationBuilder.cs index 9b3cf0a1..9f7ea384 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateSubactionMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateSubactionMembershipTextualNotationBuilder.cs @@ -46,7 +46,11 @@ public static void BuildEntryActionMember(SysML2.NET.Core.POCO.Systems.States.IS MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); stringBuilder.Append(poco.Kind.ToString().ToLower()); ownedRelatedElementOfActionUsageIterator.MoveNext(); - ActionUsageTextualNotationBuilder.BuildStateActionUsage(ownedRelatedElementOfActionUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfActionUsageIterator.Current != null) + { + ActionUsageTextualNotationBuilder.BuildStateActionUsage(ownedRelatedElementOfActionUsageIterator.Current, stringBuilder); + } } @@ -62,7 +66,11 @@ public static void BuildDoActionMember(SysML2.NET.Core.POCO.Systems.States.IStat MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); stringBuilder.Append(poco.Kind.ToString().ToLower()); ownedRelatedElementOfActionUsageIterator.MoveNext(); - ActionUsageTextualNotationBuilder.BuildStateActionUsage(ownedRelatedElementOfActionUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfActionUsageIterator.Current != null) + { + ActionUsageTextualNotationBuilder.BuildStateActionUsage(ownedRelatedElementOfActionUsageIterator.Current, stringBuilder); + } } @@ -78,7 +86,11 @@ public static void BuildExitActionMember(SysML2.NET.Core.POCO.Systems.States.ISt MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); stringBuilder.Append(poco.Kind.ToString().ToLower()); ownedRelatedElementOfActionUsageIterator.MoveNext(); - ActionUsageTextualNotationBuilder.BuildStateActionUsage(ownedRelatedElementOfActionUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfActionUsageIterator.Current != null) + { + ActionUsageTextualNotationBuilder.BuildStateActionUsage(ownedRelatedElementOfActionUsageIterator.Current, stringBuilder); + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StepTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StepTextualNotationBuilder.cs index e0552084..e6aedc8d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StepTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StepTextualNotationBuilder.cs @@ -48,7 +48,11 @@ public static void BuildStep(SysML2.NET.Core.POCO.Kernel.Behaviors.IStep poco, S while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.cs index 01021c75..5ad75a00 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.cs @@ -42,7 +42,7 @@ public static partial class SubclassificationTextualNotationBuilder /// The that contains the entire textual notation public static void BuildOwnedSubclassification(SysML2.NET.Core.POCO.Core.Classifiers.ISubclassification poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + throw new System.NotSupportedException("Assigment of reference element not supported yet for this case"); } @@ -63,9 +63,9 @@ public static void BuildSubclassification(SysML2.NET.Core.POCO.Core.Classifiers. } stringBuilder.Append("subclassifier "); - throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + throw new System.NotSupportedException("Assigment of reference element not supported yet for this case"); throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + throw new System.NotSupportedException("Assigment of reference element not supported yet for this case"); RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubjectMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubjectMembershipTextualNotationBuilder.cs index 03a9b85a..9be7c4ee 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubjectMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubjectMembershipTextualNotationBuilder.cs @@ -45,7 +45,11 @@ public static void BuildSubjectMember(SysML2.NET.Core.POCO.Systems.Requirements. using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); ownedRelatedElementOfReferenceUsageIterator.MoveNext(); - ReferenceUsageTextualNotationBuilder.BuildSubjectUsage(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfReferenceUsageIterator.Current != null) + { + ReferenceUsageTextualNotationBuilder.BuildSubjectUsage(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + } } @@ -59,7 +63,11 @@ public static void BuildSatisfactionSubjectMember(SysML2.NET.Core.POCO.Systems.R { using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); ownedRelatedElementOfReferenceUsageIterator.MoveNext(); - ReferenceUsageTextualNotationBuilder.BuildSatisfactionParameter(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfReferenceUsageIterator.Current != null) + { + ReferenceUsageTextualNotationBuilder.BuildSatisfactionParameter(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionAsUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionAsUsageTextualNotationBuilder.cs index f5d4bc4a..37e7c62b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionAsUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionAsUsageTextualNotationBuilder.cs @@ -44,7 +44,11 @@ public static void BuildSourceSuccession(SysML2.NET.Core.POCO.Systems.Connection { using var ownedRelationshipOfEndFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); - EndFeatureMembershipTextualNotationBuilder.BuildSourceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildSourceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } } @@ -58,10 +62,18 @@ public static void BuildTargetSuccession(SysML2.NET.Core.POCO.Systems.Connection { using var ownedRelationshipOfEndFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); - EndFeatureMembershipTextualNotationBuilder.BuildSourceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildSourceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } stringBuilder.Append("then "); ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } } @@ -85,10 +97,18 @@ public static void BuildSuccessionAsUsage(SysML2.NET.Core.POCO.Systems.Connectio stringBuilder.Append("first "); ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } stringBuilder.Append("then "); ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } UsageTextualNotationBuilder.BuildUsageBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowTextualNotationBuilder.cs index 77c0e3d4..31051b1d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowTextualNotationBuilder.cs @@ -48,7 +48,11 @@ public static void BuildSuccessionFlow(SysML2.NET.Core.POCO.Kernel.Interactions. while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionTextualNotationBuilder.cs index ee566bb7..6e4febc5 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionTextualNotationBuilder.cs @@ -44,9 +44,17 @@ public static void BuildTransitionSuccession(SysML2.NET.Core.POCO.Kernel.Connect { using var ownedRelationshipOfEndFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); - EndFeatureMembershipTextualNotationBuilder.BuildEmptyEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildEmptyEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + } } @@ -75,7 +83,11 @@ public static void BuildSuccession(SysML2.NET.Core.POCO.Kernel.Connectors.ISucce while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TerminateActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TerminateActionUsageTextualNotationBuilder.cs index e9f63b7c..a361fe09 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TerminateActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TerminateActionUsageTextualNotationBuilder.cs @@ -49,7 +49,11 @@ public static void BuildTerminateNode(SysML2.NET.Core.POCO.Systems.Actions.ITerm if (ownedRelationshipOfParameterMembershipIterator.MoveNext()) { - ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionFeatureMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionFeatureMembershipTextualNotationBuilder.cs index 9ac50fa3..554f93de 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionFeatureMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionFeatureMembershipTextualNotationBuilder.cs @@ -44,9 +44,13 @@ public static void BuildTriggerActionMember(SysML2.NET.Core.POCO.Systems.States. { using var ownedRelatedElementOfAcceptActionUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); stringBuilder.Append("accept "); - // Assignment Element : kind = 'trigger' + // NonParsing Assignment Element : kind = 'trigger' => Does not have to be process ownedRelatedElementOfAcceptActionUsageIterator.MoveNext(); - AcceptActionUsageTextualNotationBuilder.BuildTriggerAction(ownedRelatedElementOfAcceptActionUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfAcceptActionUsageIterator.Current != null) + { + AcceptActionUsageTextualNotationBuilder.BuildTriggerAction(ownedRelatedElementOfAcceptActionUsageIterator.Current, stringBuilder); + } } @@ -60,9 +64,13 @@ public static void BuildGuardExpressionMember(SysML2.NET.Core.POCO.Systems.State { using var ownedRelatedElementOfExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); stringBuilder.Append("if "); - // Assignment Element : kind = 'guard' + // NonParsing Assignment Element : kind = 'guard' => Does not have to be process ownedRelatedElementOfExpressionIterator.MoveNext(); - ExpressionTextualNotationBuilder.BuildOwnedExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); + + if (ownedRelatedElementOfExpressionIterator.Current != null) + { + ExpressionTextualNotationBuilder.BuildOwnedExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); + } } @@ -76,9 +84,13 @@ public static void BuildEffectBehaviorMember(SysML2.NET.Core.POCO.Systems.States { using var ownedRelatedElementOfActionUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); stringBuilder.Append("do "); - // Assignment Element : kind = 'effect' + // NonParsing Assignment Element : kind = 'effect' => Does not have to be process ownedRelatedElementOfActionUsageIterator.MoveNext(); - ActionUsageTextualNotationBuilder.BuildEffectBehaviorUsage(ownedRelatedElementOfActionUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfActionUsageIterator.Current != null) + { + ActionUsageTextualNotationBuilder.BuildEffectBehaviorUsage(ownedRelatedElementOfActionUsageIterator.Current, stringBuilder); + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionUsageTextualNotationBuilder.cs index 1114b93b..aec0cca0 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionUsageTextualNotationBuilder.cs @@ -45,10 +45,18 @@ public static void BuildGuardedTargetSuccession(SysML2.NET.Core.POCO.Systems.Sta using var ownedRelationshipOfTransitionFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfTransitionFeatureMembershipIterator.MoveNext(); - TransitionFeatureMembershipTextualNotationBuilder.BuildGuardExpressionMember(ownedRelationshipOfTransitionFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfTransitionFeatureMembershipIterator.Current != null) + { + TransitionFeatureMembershipTextualNotationBuilder.BuildGuardExpressionMember(ownedRelationshipOfTransitionFeatureMembershipIterator.Current, stringBuilder); + } stringBuilder.Append("then "); ownedRelationshipOfOwningMembershipIterator.MoveNext(); - OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } } @@ -63,7 +71,11 @@ public static void BuildDefaultTargetSuccession(SysML2.NET.Core.POCO.Systems.Sta using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); stringBuilder.Append("else "); ownedRelationshipOfOwningMembershipIterator.MoveNext(); - OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } } @@ -88,12 +100,24 @@ public static void BuildGuardedSuccession(SysML2.NET.Core.POCO.Systems.States.IT stringBuilder.Append("first "); ownedRelationshipOfMembershipIterator.MoveNext(); - MembershipTextualNotationBuilder.BuildFeatureChainMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfMembershipIterator.Current != null) + { + MembershipTextualNotationBuilder.BuildFeatureChainMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + } ownedRelationshipOfTransitionFeatureMembershipIterator.MoveNext(); - TransitionFeatureMembershipTextualNotationBuilder.BuildGuardExpressionMember(ownedRelationshipOfTransitionFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfTransitionFeatureMembershipIterator.Current != null) + { + TransitionFeatureMembershipTextualNotationBuilder.BuildGuardExpressionMember(ownedRelationshipOfTransitionFeatureMembershipIterator.Current, stringBuilder); + } stringBuilder.Append("then "); ownedRelationshipOfOwningMembershipIterator.MoveNext(); - OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } UsageTextualNotationBuilder.BuildUsageBody(poco, stringBuilder); } @@ -110,11 +134,19 @@ public static void BuildTargetTransitionUsage(SysML2.NET.Core.POCO.Systems.State using var ownedRelationshipOfTransitionFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfParameterMembershipIterator.MoveNext(); - ParameterMembershipTextualNotationBuilder.BuildEmptyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildEmptyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } throw new System.NotSupportedException("Multiple alternatives not implemented yet"); stringBuilder.Append("then "); ownedRelationshipOfOwningMembershipIterator.MoveNext(); - OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); } @@ -141,34 +173,62 @@ public static void BuildTransitionUsage(SysML2.NET.Core.POCO.Systems.States.ITra } ownedRelationshipOfMembershipIterator.MoveNext(); - MembershipTextualNotationBuilder.BuildFeatureChainMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfMembershipIterator.Current != null) + { + MembershipTextualNotationBuilder.BuildFeatureChainMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + } ownedRelationshipOfParameterMembershipIterator.MoveNext(); - ParameterMembershipTextualNotationBuilder.BuildEmptyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); - if (ownedRelationshipOfParameterMembershipIterator.MoveNext()) + if (ownedRelationshipOfParameterMembershipIterator.Current != null) { ParameterMembershipTextualNotationBuilder.BuildEmptyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); - TransitionFeatureMembershipTextualNotationBuilder.BuildTriggerActionMember(ownedRelationshipOfTransitionFeatureMembershipIterator.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()) { - TransitionFeatureMembershipTextualNotationBuilder.BuildGuardExpressionMember(ownedRelationshipOfTransitionFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfTransitionFeatureMembershipIterator.Current != null) + { + TransitionFeatureMembershipTextualNotationBuilder.BuildGuardExpressionMember(ownedRelationshipOfTransitionFeatureMembershipIterator.Current, stringBuilder); + } stringBuilder.Append(' '); } if (ownedRelationshipOfTransitionFeatureMembershipIterator.MoveNext()) { - TransitionFeatureMembershipTextualNotationBuilder.BuildEffectBehaviorMember(ownedRelationshipOfTransitionFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfTransitionFeatureMembershipIterator.Current != null) + { + TransitionFeatureMembershipTextualNotationBuilder.BuildEffectBehaviorMember(ownedRelationshipOfTransitionFeatureMembershipIterator.Current, stringBuilder); + } stringBuilder.Append(' '); } stringBuilder.Append("then "); ownedRelationshipOfOwningMembershipIterator.MoveNext(); - OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeFeaturingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeFeaturingTextualNotationBuilder.cs index d05381b2..af40eab9 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeFeaturingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeFeaturingTextualNotationBuilder.cs @@ -42,7 +42,7 @@ public static partial class TypeFeaturingTextualNotationBuilder /// The that contains the entire textual notation public static void BuildOwnedTypeFeaturing(SysML2.NET.Core.POCO.Core.Features.ITypeFeaturing poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + throw new System.NotSupportedException("Assigment of reference element not supported yet for this case"); } @@ -63,9 +63,9 @@ public static void BuildTypeFeaturing(SysML2.NET.Core.POCO.Core.Features.ITypeFe stringBuilder.Append(' '); } - throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + throw new System.NotSupportedException("Assigment of reference element not supported yet for this case"); stringBuilder.Append("by "); - throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + throw new System.NotSupportedException("Assigment of reference element not supported yet for this case"); RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs index 421ad425..defced6a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs @@ -135,7 +135,11 @@ public static void BuildCalculationBodyPart(SysML2.NET.Core.POCO.Core.Types.ITyp if (ownedRelationshipOfResultExpressionMembershipIterator.MoveNext()) { - ResultExpressionMembershipTextualNotationBuilder.BuildResultExpressionMember(ownedRelationshipOfResultExpressionMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfResultExpressionMembershipIterator.Current != null) + { + ResultExpressionMembershipTextualNotationBuilder.BuildResultExpressionMember(ownedRelationshipOfResultExpressionMembershipIterator.Current, stringBuilder); + } stringBuilder.Append(' '); } @@ -227,7 +231,11 @@ public static void BuildTypePrefix(SysML2.NET.Core.POCO.Core.Types.IType poco, S while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } } @@ -253,7 +261,11 @@ public static void BuildTypeDeclaration(SysML2.NET.Core.POCO.Core.Types.IType po if (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - OwningMembershipTextualNotationBuilder.BuildOwnedMultiplicity(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildOwnedMultiplicity(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } stringBuilder.Append(' '); } @@ -276,12 +288,20 @@ public static void BuildSpecializationPart(SysML2.NET.Core.POCO.Core.Types.IType using var ownedRelationshipOfSpecializationIterator = poco.OwnedRelationship.OfType().GetEnumerator(); throw new System.NotSupportedException("Multiple alternatives not implemented yet"); ownedRelationshipOfSpecializationIterator.MoveNext(); - SpecializationTextualNotationBuilder.BuildOwnedSpecialization(ownedRelationshipOfSpecializationIterator.Current, stringBuilder); + + if (ownedRelationshipOfSpecializationIterator.Current != null) + { + SpecializationTextualNotationBuilder.BuildOwnedSpecialization(ownedRelationshipOfSpecializationIterator.Current, stringBuilder); + } while (ownedRelationshipOfSpecializationIterator.MoveNext()) { stringBuilder.Append(","); - SpecializationTextualNotationBuilder.BuildOwnedSpecialization(ownedRelationshipOfSpecializationIterator.Current, stringBuilder); + + if (ownedRelationshipOfSpecializationIterator.Current != null) + { + SpecializationTextualNotationBuilder.BuildOwnedSpecialization(ownedRelationshipOfSpecializationIterator.Current, stringBuilder); + } } @@ -298,7 +318,11 @@ public static void BuildConjugationPart(SysML2.NET.Core.POCO.Core.Types.IType po using var ownedRelationshipOfConjugationIterator = poco.OwnedRelationship.OfType().GetEnumerator(); throw new System.NotSupportedException("Multiple alternatives not implemented yet"); ownedRelationshipOfConjugationIterator.MoveNext(); - ConjugationTextualNotationBuilder.BuildOwnedConjugation(ownedRelationshipOfConjugationIterator.Current, stringBuilder); + + if (ownedRelationshipOfConjugationIterator.Current != null) + { + ConjugationTextualNotationBuilder.BuildOwnedConjugation(ownedRelationshipOfConjugationIterator.Current, stringBuilder); + } } @@ -325,12 +349,20 @@ public static void BuildDisjoiningPart(SysML2.NET.Core.POCO.Core.Types.IType poc stringBuilder.Append("disjoint "); stringBuilder.Append("from "); ownedRelationshipOfDisjoiningIterator.MoveNext(); - DisjoiningTextualNotationBuilder.BuildOwnedDisjoining(ownedRelationshipOfDisjoiningIterator.Current, stringBuilder); + + if (ownedRelationshipOfDisjoiningIterator.Current != null) + { + DisjoiningTextualNotationBuilder.BuildOwnedDisjoining(ownedRelationshipOfDisjoiningIterator.Current, stringBuilder); + } while (ownedRelationshipOfDisjoiningIterator.MoveNext()) { stringBuilder.Append(","); - DisjoiningTextualNotationBuilder.BuildOwnedDisjoining(ownedRelationshipOfDisjoiningIterator.Current, stringBuilder); + + if (ownedRelationshipOfDisjoiningIterator.Current != null) + { + DisjoiningTextualNotationBuilder.BuildOwnedDisjoining(ownedRelationshipOfDisjoiningIterator.Current, stringBuilder); + } } @@ -347,12 +379,20 @@ public static void BuildUnioningPart(SysML2.NET.Core.POCO.Core.Types.IType poco, using var ownedRelationshipOfUnioningIterator = poco.OwnedRelationship.OfType().GetEnumerator(); stringBuilder.Append("unions "); ownedRelationshipOfUnioningIterator.MoveNext(); - UnioningTextualNotationBuilder.BuildUnioning(ownedRelationshipOfUnioningIterator.Current, stringBuilder); + + if (ownedRelationshipOfUnioningIterator.Current != null) + { + UnioningTextualNotationBuilder.BuildUnioning(ownedRelationshipOfUnioningIterator.Current, stringBuilder); + } while (ownedRelationshipOfUnioningIterator.MoveNext()) { stringBuilder.Append(","); - UnioningTextualNotationBuilder.BuildUnioning(ownedRelationshipOfUnioningIterator.Current, stringBuilder); + + if (ownedRelationshipOfUnioningIterator.Current != null) + { + UnioningTextualNotationBuilder.BuildUnioning(ownedRelationshipOfUnioningIterator.Current, stringBuilder); + } } @@ -369,12 +409,20 @@ public static void BuildIntersectingPart(SysML2.NET.Core.POCO.Core.Types.IType p using var ownedRelationshipOfIntersectingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); stringBuilder.Append("intersects "); ownedRelationshipOfIntersectingIterator.MoveNext(); - IntersectingTextualNotationBuilder.BuildIntersecting(ownedRelationshipOfIntersectingIterator.Current, stringBuilder); + + if (ownedRelationshipOfIntersectingIterator.Current != null) + { + IntersectingTextualNotationBuilder.BuildIntersecting(ownedRelationshipOfIntersectingIterator.Current, stringBuilder); + } while (ownedRelationshipOfIntersectingIterator.MoveNext()) { stringBuilder.Append(","); - IntersectingTextualNotationBuilder.BuildIntersecting(ownedRelationshipOfIntersectingIterator.Current, stringBuilder); + + if (ownedRelationshipOfIntersectingIterator.Current != null) + { + IntersectingTextualNotationBuilder.BuildIntersecting(ownedRelationshipOfIntersectingIterator.Current, stringBuilder); + } } @@ -391,12 +439,20 @@ public static void BuildDifferencingPart(SysML2.NET.Core.POCO.Core.Types.IType p using var ownedRelationshipOfDifferencingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); stringBuilder.Append("differences "); ownedRelationshipOfDifferencingIterator.MoveNext(); - DifferencingTextualNotationBuilder.BuildDifferencing(ownedRelationshipOfDifferencingIterator.Current, stringBuilder); + + if (ownedRelationshipOfDifferencingIterator.Current != null) + { + DifferencingTextualNotationBuilder.BuildDifferencing(ownedRelationshipOfDifferencingIterator.Current, stringBuilder); + } while (ownedRelationshipOfDifferencingIterator.MoveNext()) { stringBuilder.Append(","); - DifferencingTextualNotationBuilder.BuildDifferencing(ownedRelationshipOfDifferencingIterator.Current, stringBuilder); + + if (ownedRelationshipOfDifferencingIterator.Current != null) + { + DifferencingTextualNotationBuilder.BuildDifferencing(ownedRelationshipOfDifferencingIterator.Current, stringBuilder); + } } @@ -453,7 +509,11 @@ public static void BuildFunctionBodyPart(SysML2.NET.Core.POCO.Core.Types.IType p if (ownedRelationshipOfResultExpressionMembershipIterator.MoveNext()) { - ResultExpressionMembershipTextualNotationBuilder.BuildResultExpressionMember(ownedRelationshipOfResultExpressionMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfResultExpressionMembershipIterator.Current != null) + { + ResultExpressionMembershipTextualNotationBuilder.BuildResultExpressionMember(ownedRelationshipOfResultExpressionMembershipIterator.Current, stringBuilder); + } stringBuilder.Append(' '); } @@ -468,7 +528,7 @@ public static void BuildFunctionBodyPart(SysML2.NET.Core.POCO.Core.Types.IType p /// The that contains the entire textual notation public static void BuildInstantiatedTypeReference(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) { - // Value Literal Element : [QualifiedName] + stringBuilder.Append(poco.qualifiedName); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs index 238a8528..6609d26f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs @@ -110,7 +110,11 @@ public static void BuildEndUsagePrefix(SysML2.NET.Core.POCO.Systems.DefinitionAn if (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - OwningMembershipTextualNotationBuilder.BuildOwnedCrossFeatureMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildOwnedCrossFeatureMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } stringBuilder.Append(' '); } @@ -127,7 +131,11 @@ public static void BuildUsageExtensionKeyword(SysML2.NET.Core.POCO.Systems.Defin { using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); ownedRelationshipOfOwningMembershipIterator.MoveNext(); - OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfOwningMembershipIterator.Current != null) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VariantMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VariantMembershipTextualNotationBuilder.cs index e4e42d21..779cd53e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VariantMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VariantMembershipTextualNotationBuilder.cs @@ -44,7 +44,11 @@ public static void BuildVariantUsageMember(SysML2.NET.Core.POCO.Systems.Definiti { MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); stringBuilder.Append("variant "); - throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + + if (poco.ownedVariantUsage != null) + { + UsageTextualNotationBuilder.BuildVariantUsageElement(poco.ownedVariantUsage, stringBuilder); + } } @@ -59,7 +63,11 @@ public static void BuildEnumerationUsageMember(SysML2.NET.Core.POCO.Systems.Defi using var ownedRelatedElementOfEnumerationUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); ownedRelatedElementOfEnumerationUsageIterator.MoveNext(); - EnumerationUsageTextualNotationBuilder.BuildEnumeratedValue(ownedRelatedElementOfEnumerationUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfEnumerationUsageIterator.Current != null) + { + EnumerationUsageTextualNotationBuilder.BuildEnumeratedValue(ownedRelatedElementOfEnumerationUsageIterator.Current, stringBuilder); + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewRenderingMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewRenderingMembershipTextualNotationBuilder.cs index 6f679e46..d94ba091 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewRenderingMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewRenderingMembershipTextualNotationBuilder.cs @@ -46,7 +46,11 @@ public static void BuildViewRenderingMember(SysML2.NET.Core.POCO.Systems.Views.I MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); stringBuilder.Append("render "); ownedRelatedElementOfRenderingUsageIterator.MoveNext(); - RenderingUsageTextualNotationBuilder.BuildViewRenderingUsage(ownedRelatedElementOfRenderingUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementOfRenderingUsageIterator.Current != null) + { + RenderingUsageTextualNotationBuilder.BuildViewRenderingUsage(ownedRelatedElementOfRenderingUsageIterator.Current, stringBuilder); + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/WhileLoopActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/WhileLoopActionUsageTextualNotationBuilder.cs index aa1baa19..89684b3b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/WhileLoopActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/WhileLoopActionUsageTextualNotationBuilder.cs @@ -47,12 +47,20 @@ public static void BuildWhileLoopNode(SysML2.NET.Core.POCO.Systems.Actions.IWhil throw new System.NotSupportedException("Multiple alternatives not implemented yet"); stringBuilder.Append(' '); ownedRelationshipOfParameterMembershipIterator.MoveNext(); - ParameterMembershipTextualNotationBuilder.BuildActionBodyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildActionBodyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } if (ownedRelationshipOfParameterMembershipIterator.MoveNext()) { stringBuilder.Append("until "); - ParameterMembershipTextualNotationBuilder.BuildExpressionParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildExpressionParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } stringBuilder.Append(";"); stringBuilder.Append(' '); } From 483b484c3132fd62be0906938d457137a7ec4751 Mon Sep 17 00:00:00 2001 From: atheate Date: Thu, 5 Mar 2026 17:18:54 +0100 Subject: [PATCH 12/33] [WIP] ix FeatureMembershipTextualNotationBuilder --- .../HandleBarHelpers/RulesHelper.cs | 74 +++++++++++++------ ...FeatureMembershipTextualNotationBuilder.cs | 38 +++++++++- 2 files changed, 86 insertions(+), 26 deletions(-) diff --git a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs index 226423f1..9974460b 100644 --- a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs +++ b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs @@ -93,7 +93,7 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas var elements = alternative.Elements; DeclareAllRequiredIterators(writer, umlClass, alternative, ruleGenerationContext); - if (ruleGenerationContext.CallerRule is { IsOptional: true, IsCollection: false }) + if (ruleGenerationContext.CallerContext?.CallerRule is { IsOptional: true, IsCollection: false }) { var targetPropertiesName = elements.OfType().Select(x => x.Property).Distinct().ToList(); var allProperties = umlClass.QueryAllProperties(); @@ -127,9 +127,9 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas foreach (var textualRuleElement in elements) { - var previousCaller = ruleGenerationContext.CallerRule; + var previousCaller = ruleGenerationContext.CallerContext; ProcessRuleElement(writer, umlClass, textualRuleElement, ruleGenerationContext); - ruleGenerationContext.CallerRule = previousCaller; + ruleGenerationContext.CallerContext = previousCaller; } } else @@ -150,9 +150,9 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas { foreach (var textualRuleElement in elements) { - var previousCaller = ruleGenerationContext.CallerRule; + var previousCaller = ruleGenerationContext.CallerContext; ProcessRuleElement(writer, umlClass, textualRuleElement, ruleGenerationContext); - ruleGenerationContext.CallerRule = previousCaller; + ruleGenerationContext.CallerContext = previousCaller; } } } @@ -215,11 +215,18 @@ private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass writer.WriteSafeString($"stringBuilder.Append(\"{valueToAdd}\");"); break; case NonTerminalElement nonTerminalElement: - ProcessNonTerminalElement(writer, umlClass, nonTerminalElement, "poco", umlClass, ruleGenerationContext); + if (ruleGenerationContext.CallerContext?.CallerRule is NonTerminalElement callerNonTerminalElement && callerNonTerminalElement.Container is AssignmentElement) + { + ProcessNonTerminalElement(writer, umlClass, nonTerminalElement, "poco", ruleGenerationContext.CallerContext.CallerClassContext, ruleGenerationContext); + } + else + { + ProcessNonTerminalElement(writer, umlClass, nonTerminalElement, "poco", umlClass, ruleGenerationContext); + } break; case GroupElement groupElement: - ruleGenerationContext.CallerRule = groupElement; + ruleGenerationContext.CallerContext = new CallerContext(groupElement); if (groupElement.IsCollection) { @@ -304,10 +311,10 @@ private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass { if (assignmentElement.Value is NonTerminalElement nonTerminalElement) { - var previousCaller = ruleGenerationContext.CallerRule; - ruleGenerationContext.CallerRule = nonTerminalElement; + var previousCaller = ruleGenerationContext.CallerContext; + ruleGenerationContext.CallerContext = new CallerContext(nonTerminalElement); ProcessNonTerminalElement(writer, targetProperty.Type as IClass, nonTerminalElement, $"poco.{targetProperty.QueryPropertyNameBasedOnUmlProperties()}", umlClass, ruleGenerationContext); - ruleGenerationContext.CallerRule = previousCaller; + ruleGenerationContext.CallerContext = previousCaller; } else { @@ -385,18 +392,18 @@ private static void ProcessNonTerminalElement(EncodedTextWriter writer, IClass u } else { - var previousCaller = ruleGenerationContext.CallerRule; - ruleGenerationContext.CallerRule = nonTerminalElement; - ProcessAlternatives(writer, umlClass, referencedRule?.Alternatives, ruleGenerationContext); - ruleGenerationContext.CallerRule = previousCaller; + var previousCaller = ruleGenerationContext.CallerContext; + ruleGenerationContext.CallerContext = new CallerContext(nonTerminalElement, targetType as IClass); + ProcessAlternatives(writer, callerClass, referencedRule?.Alternatives, ruleGenerationContext); + ruleGenerationContext.CallerContext = previousCaller; } } else { - var previousCaller = ruleGenerationContext.CallerRule; - ruleGenerationContext.CallerRule = nonTerminalElement; - ProcessAlternatives(writer, umlClass, referencedRule?.Alternatives, ruleGenerationContext); - ruleGenerationContext.CallerRule = previousCaller; + var previousCaller = ruleGenerationContext.CallerContext; + ruleGenerationContext.CallerContext = new CallerContext(nonTerminalElement); + ProcessAlternatives(writer, callerClass, referencedRule?.Alternatives, ruleGenerationContext); + ruleGenerationContext.CallerContext = previousCaller; } } else @@ -552,6 +559,29 @@ public bool IsIteratorValidForProperty(IProperty property, TextualNotationRule t } } + /// + /// Provide context about the caller context + /// + private class CallerContext + { + /// Initializes a new instance of the class. + public CallerContext(RuleElement callerRule, IClass callerClassContext = null) + { + this.CallerRule = callerRule; + this.CallerClassContext = callerClassContext; + } + + /// + /// Gets or sets the that called other rule + /// + public RuleElement CallerRule { get; } + + /// + /// Gets or sets the used during the caller rule + /// + public IClass CallerClassContext { get; } + } + /// /// Provides context over the rule generation history /// @@ -563,14 +593,14 @@ private class RuleGenerationContext public List DefinedIterators { get; set; } /// - /// Gets or sets the that called other rule + /// Gets the collection of all available /// - public RuleElement CallerRule { get; set; } + public List AllRules { get; } = []; /// - /// Gets the collection of all available + /// Gets or sets the /// - public List AllRules { get; } = []; + public CallerContext CallerContext { get; set; } } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs index 3a780242..b4f6549b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs @@ -379,9 +379,21 @@ public static void BuildMetadataBodyUsageMember(SysML2.NET.Core.POCO.Core.Types. { RedefinitionTextualNotationBuilder.BuildOwnedRedefinition(ownedRelationshipOfRedefinitionIterator.Current, stringBuilder); } - BuildFeatureSpecializationPart(poco, stringBuilder); - BuildValuePart(poco, stringBuilder); - TypeTextualNotationBuilder.BuildMetadataBody(poco, stringBuilder); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + + if (ownedRelationshipOfFeatureValueIterator.MoveNext()) + { + ownedRelationshipOfFeatureValueIterator.MoveNext(); + + if (ownedRelationshipOfFeatureValueIterator.Current != null) + { + FeatureValueTextualNotationBuilder.BuildFeatureValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + } + stringBuilder.Append(' '); + } + + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); } @@ -503,7 +515,25 @@ public static void BuildExpressionBodyMember(SysML2.NET.Core.POCO.Core.Types.IFe if (poco.ownedMemberFeature != null) { stringBuilder.Append("{"); - TypeTextualNotationBuilder.BuildFunctionBodyPart(poco, 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(' '); + } + + stringBuilder.Append("}"); } From c0f1b6680b03e60d656b89741a729a8f6d0fb2cf Mon Sep 17 00:00:00 2001 From: atheate Date: Fri, 6 Mar 2026 09:37:44 +0100 Subject: [PATCH 13/33] [WIP] Correctly implemented reference assignement --- ...tualNotationBuilderGeneratorTestFixture.cs | 2 + .../HandleBarHelpers/RulesHelper.cs | 91 ++++++++----------- ...FeatureMembershipTextualNotationBuilder.cs | 38 +++----- 3 files changed, 54 insertions(+), 77 deletions(-) diff --git a/SysML2.NET.CodeGenerator.Tests/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGeneratorTestFixture.cs b/SysML2.NET.CodeGenerator.Tests/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGeneratorTestFixture.cs index 373705c5..6cd7b17e 100644 --- a/SysML2.NET.CodeGenerator.Tests/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGeneratorTestFixture.cs +++ b/SysML2.NET.CodeGenerator.Tests/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGeneratorTestFixture.cs @@ -30,6 +30,8 @@ namespace SysML2.NET.CodeGenerator.Tests.Generators.UmlHandleBarsGenerators using SysML2.NET.CodeGenerator.Grammar; using SysML2.NET.CodeGenerator.Grammar.Model; + using uml4net.CommonStructure; + [TestFixture] public class UmlCoreTextualNotationBuilderGeneratorTestFixture { diff --git a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs index 9974460b..0ec75555 100644 --- a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs +++ b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs @@ -69,7 +69,7 @@ public static void RegisterRulesHelper(this IHandlebars handlebars) if (namedElement is IClass umlClass) { - var ruleGenerationContext = new RuleGenerationContext(); + var ruleGenerationContext = new RuleGenerationContext(namedElement); ruleGenerationContext.AllRules.AddRange(allRules); ProcessAlternatives(writer, umlClass, textualRule.Alternatives, ruleGenerationContext); } @@ -93,7 +93,7 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas var elements = alternative.Elements; DeclareAllRequiredIterators(writer, umlClass, alternative, ruleGenerationContext); - if (ruleGenerationContext.CallerContext?.CallerRule is { IsOptional: true, IsCollection: false }) + if (ruleGenerationContext.CallerRule is { IsOptional: true, IsCollection: false }) { var targetPropertiesName = elements.OfType().Select(x => x.Property).Distinct().ToList(); var allProperties = umlClass.QueryAllProperties(); @@ -127,9 +127,9 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas foreach (var textualRuleElement in elements) { - var previousCaller = ruleGenerationContext.CallerContext; + var previousCaller = ruleGenerationContext.CallerRule; ProcessRuleElement(writer, umlClass, textualRuleElement, ruleGenerationContext); - ruleGenerationContext.CallerContext = previousCaller; + ruleGenerationContext.CallerRule = previousCaller; } } else @@ -150,9 +150,9 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas { foreach (var textualRuleElement in elements) { - var previousCaller = ruleGenerationContext.CallerContext; + var previousCaller = ruleGenerationContext.CallerRule; ProcessRuleElement(writer, umlClass, textualRuleElement, ruleGenerationContext); - ruleGenerationContext.CallerContext = previousCaller; + ruleGenerationContext.CallerRule = previousCaller; } } } @@ -215,18 +215,20 @@ private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass writer.WriteSafeString($"stringBuilder.Append(\"{valueToAdd}\");"); break; case NonTerminalElement nonTerminalElement: - if (ruleGenerationContext.CallerContext?.CallerRule is NonTerminalElement callerNonTerminalElement && callerNonTerminalElement.Container is AssignmentElement) + if (ruleGenerationContext.CallerRule is NonTerminalElement { Container: AssignmentElement assignmentElementContainer }) { - ProcessNonTerminalElement(writer, umlClass, nonTerminalElement, "poco", ruleGenerationContext.CallerContext.CallerClassContext, ruleGenerationContext); + 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", umlClass, ruleGenerationContext); + ProcessNonTerminalElement(writer, umlClass, nonTerminalElement, "poco", ruleGenerationContext); } break; case GroupElement groupElement: - ruleGenerationContext.CallerContext = new CallerContext(groupElement); + ruleGenerationContext.CallerRule = groupElement ; if (groupElement.IsCollection) { @@ -270,7 +272,7 @@ private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass writer.WriteSafeString($"{iteratorToUse.IteratorVariableName}.MoveNext();{Environment.NewLine}"); } - ProcessNonTerminalElement(writer, umlClass, nonTerminalElement, $"{iteratorToUse.IteratorVariableName}.Current", umlClass, ruleGenerationContext); + ProcessNonTerminalElement(writer, umlClass, nonTerminalElement, $"{iteratorToUse.IteratorVariableName}.Current", ruleGenerationContext); } else { @@ -311,10 +313,10 @@ private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass { if (assignmentElement.Value is NonTerminalElement nonTerminalElement) { - var previousCaller = ruleGenerationContext.CallerContext; - ruleGenerationContext.CallerContext = new CallerContext(nonTerminalElement); - ProcessNonTerminalElement(writer, targetProperty.Type as IClass, nonTerminalElement, $"poco.{targetProperty.QueryPropertyNameBasedOnUmlProperties()}", umlClass, ruleGenerationContext); - ruleGenerationContext.CallerContext = previousCaller; + var previousCaller = ruleGenerationContext.CallerRule; + ruleGenerationContext.CallerRule = nonTerminalElement; + ProcessNonTerminalElement(writer, targetProperty.Type as IClass, nonTerminalElement, $"poco.{targetProperty.QueryPropertyNameBasedOnUmlProperties()}", ruleGenerationContext); + ruleGenerationContext.CallerRule = previousCaller; } else { @@ -355,9 +357,8 @@ private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass /// The related /// The to process /// The name of the variable that should be used to call the non-terminal method - /// Gets the that initially calls this function /// - private static void ProcessNonTerminalElement(EncodedTextWriter writer, IClass umlClass, NonTerminalElement nonTerminalElement, string variableName, IClass callerClass, RuleGenerationContext ruleGenerationContext) + private static void ProcessNonTerminalElement(EncodedTextWriter writer, IClass umlClass, NonTerminalElement nonTerminalElement, string variableName, RuleGenerationContext ruleGenerationContext) { var referencedRule = ruleGenerationContext.AllRules.SingleOrDefault(x => x.RuleName == nonTerminalElement.Name); @@ -380,7 +381,7 @@ private static void ProcessNonTerminalElement(EncodedTextWriter writer, IClass u writer.WriteSafeString($"{{{Environment.NewLine}"); } - if (typeTarget != callerClass.Name) + if (typeTarget != ruleGenerationContext.NamedElementToGenerate.Name) { var targetType = umlClass.Cache.Values.OfType().SingleOrDefault(x => x.Name == typeTarget); @@ -392,18 +393,18 @@ private static void ProcessNonTerminalElement(EncodedTextWriter writer, IClass u } else { - var previousCaller = ruleGenerationContext.CallerContext; - ruleGenerationContext.CallerContext = new CallerContext(nonTerminalElement, targetType as IClass); - ProcessAlternatives(writer, callerClass, referencedRule?.Alternatives, ruleGenerationContext); - ruleGenerationContext.CallerContext = previousCaller; + var previousCaller = ruleGenerationContext.CallerRule; + ruleGenerationContext.CallerRule = nonTerminalElement; + ProcessAlternatives(writer, umlClass, referencedRule?.Alternatives, ruleGenerationContext); + ruleGenerationContext.CallerRule = previousCaller; } } else { - var previousCaller = ruleGenerationContext.CallerContext; - ruleGenerationContext.CallerContext = new CallerContext(nonTerminalElement); - ProcessAlternatives(writer, callerClass, referencedRule?.Alternatives, ruleGenerationContext); - ruleGenerationContext.CallerContext = previousCaller; + var previousCaller = ruleGenerationContext.CallerRule; + ruleGenerationContext.CallerRule = nonTerminalElement; + ProcessAlternatives(writer, umlClass, referencedRule?.Alternatives, ruleGenerationContext); + ruleGenerationContext.CallerRule = previousCaller; } } else @@ -559,29 +560,6 @@ public bool IsIteratorValidForProperty(IProperty property, TextualNotationRule t } } - /// - /// Provide context about the caller context - /// - private class CallerContext - { - /// Initializes a new instance of the class. - public CallerContext(RuleElement callerRule, IClass callerClassContext = null) - { - this.CallerRule = callerRule; - this.CallerClassContext = callerClassContext; - } - - /// - /// Gets or sets the that called other rule - /// - public RuleElement CallerRule { get; } - - /// - /// Gets or sets the used during the caller rule - /// - public IClass CallerClassContext { get; } - } - /// /// Provides context over the rule generation history /// @@ -598,9 +576,20 @@ private class RuleGenerationContext public List AllRules { get; } = []; /// - /// Gets or sets the + /// 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 CallerContext CallerContext { get; set; } + public INamedElement NamedElementToGenerate { get; } } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs index b4f6549b..6a6dab0b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs @@ -379,21 +379,21 @@ public static void BuildMetadataBodyUsageMember(SysML2.NET.Core.POCO.Core.Types. { RedefinitionTextualNotationBuilder.BuildOwnedRedefinition(ownedRelationshipOfRedefinitionIterator.Current, stringBuilder); } - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - if (ownedRelationshipOfFeatureValueIterator.MoveNext()) + if (poco.ownedMemberFeature != null) { - ownedRelationshipOfFeatureValueIterator.MoveNext(); + FeatureTextualNotationBuilder.BuildFeatureSpecializationPart(poco.ownedMemberFeature, stringBuilder); + } - if (ownedRelationshipOfFeatureValueIterator.Current != null) - { - FeatureValueTextualNotationBuilder.BuildFeatureValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); - } - stringBuilder.Append(' '); + if (poco.ownedMemberFeature != null) + { + FeatureTextualNotationBuilder.BuildValuePart(poco.ownedMemberFeature, stringBuilder); } - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + if (poco.ownedMemberFeature != null) + { + TypeTextualNotationBuilder.BuildMetadataBody(poco.ownedMemberFeature, stringBuilder); + } } @@ -515,25 +515,11 @@ public static void BuildExpressionBodyMember(SysML2.NET.Core.POCO.Core.Types.IFe if (poco.ownedMemberFeature != null) { stringBuilder.Append("{"); - using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - using var ownedRelationshipOfResultExpressionMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - while (ownedRelationshipOfReturnParameterMembershipIterator.MoveNext()) + if (poco.ownedMemberFeature != null) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + TypeTextualNotationBuilder.BuildFunctionBodyPart(poco.ownedMemberFeature, stringBuilder); } - - if (ownedRelationshipOfResultExpressionMembershipIterator.MoveNext()) - { - - if (ownedRelationshipOfResultExpressionMembershipIterator.Current != null) - { - ResultExpressionMembershipTextualNotationBuilder.BuildResultExpressionMember(ownedRelationshipOfResultExpressionMembershipIterator.Current, stringBuilder); - } - stringBuilder.Append(' '); - } - - stringBuilder.Append("}"); } From 4ba3773fa5b6de310d30a5a4b19bb6560d373423 Mon Sep 17 00:00:00 2001 From: atheate Date: Fri, 6 Mar 2026 11:05:46 +0100 Subject: [PATCH 14/33] [WIP] Reference property with ValueLiteral supported --- ...tualNotationBuilderGeneratorTestFixture.cs | 2 -- .../Grammar/Model/ValueLiteralElement.cs | 8 +++++- .../HandleBarHelpers/RulesHelper.cs | 28 +++++++++++++++---- .../AnnotationTextualNotationBuilder.cs | 7 ++++- .../FeatureChainingTextualNotationBuilder.cs | 7 ++++- .../FeatureTextualNotationBuilder.cs | 1 + .../FeatureTypingTextualNotationBuilder.cs | 7 ++++- .../MembershipImportTextualNotationBuilder.cs | 7 ++++- .../MembershipTextualNotationBuilder.cs | 15 ++++++++-- .../RedefinitionTextualNotationBuilder.cs | 14 ++++++++-- ...SubclassificationTextualNotationBuilder.cs | 21 ++++++++++++-- .../TypeFeaturingTextualNotationBuilder.cs | 21 ++++++++++++-- .../TypeTextualNotationBuilder.cs | 1 + 13 files changed, 117 insertions(+), 22 deletions(-) diff --git a/SysML2.NET.CodeGenerator.Tests/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGeneratorTestFixture.cs b/SysML2.NET.CodeGenerator.Tests/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGeneratorTestFixture.cs index 6cd7b17e..373705c5 100644 --- a/SysML2.NET.CodeGenerator.Tests/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGeneratorTestFixture.cs +++ b/SysML2.NET.CodeGenerator.Tests/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGeneratorTestFixture.cs @@ -30,8 +30,6 @@ namespace SysML2.NET.CodeGenerator.Tests.Generators.UmlHandleBarsGenerators using SysML2.NET.CodeGenerator.Grammar; using SysML2.NET.CodeGenerator.Grammar.Model; - using uml4net.CommonStructure; - [TestFixture] public class UmlCoreTextualNotationBuilderGeneratorTestFixture { diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/ValueLiteralElement.cs b/SysML2.NET.CodeGenerator/Grammar/Model/ValueLiteralElement.cs index e85b673a..1bf51879 100644 --- a/SysML2.NET.CodeGenerator/Grammar/Model/ValueLiteralElement.cs +++ b/SysML2.NET.CodeGenerator/Grammar/Model/ValueLiteralElement.cs @@ -28,6 +28,12 @@ public class ValueLiteralElement: RuleElement /// /// Gets or sets the literal value /// - public string Value { get; set; } + public string Value { get; init; } + + /// + /// Asserts that this value literal is to + /// + /// + public bool QueryIsQualifiedName() => this.Value == "[QualifiedName]"; } } diff --git a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs index 0ec75555..a0d48bc0 100644 --- a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs +++ b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs @@ -290,9 +290,11 @@ private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass } else { + var targetPropertyName = targetProperty.QueryPropertyNameBasedOnUmlProperties(); + if (targetProperty.QueryIsString()) { - writer.WriteSafeString($"stringBuilder.Append(poco.{targetProperty.Name.CapitalizeFirstLetter()});"); + writer.WriteSafeString($"stringBuilder.Append(poco.{targetPropertyName});"); } else if (targetProperty.QueryIsBool()) { @@ -302,12 +304,12 @@ private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass } else { - writer.WriteSafeString($"stringBuilder.Append(poco.{targetProperty.QueryPropertyNameBasedOnUmlProperties()}.ToString().ToLower());"); + writer.WriteSafeString($"stringBuilder.Append(poco.{targetPropertyName}.ToString().ToLower());"); } } else if (targetProperty.QueryIsEnum()) { - writer.WriteSafeString($"stringBuilder.Append(poco.{targetProperty.Name.CapitalizeFirstLetter()}.ToString().ToLower());"); + writer.WriteSafeString($"stringBuilder.Append(poco.{targetPropertyName}.ToString().ToLower());"); } else if(targetProperty.QueryIsReferenceProperty()) { @@ -315,9 +317,17 @@ private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass { var previousCaller = ruleGenerationContext.CallerRule; ruleGenerationContext.CallerRule = nonTerminalElement; - ProcessNonTerminalElement(writer, targetProperty.Type as IClass, nonTerminalElement, $"poco.{targetProperty.QueryPropertyNameBasedOnUmlProperties()}", ruleGenerationContext); + ProcessNonTerminalElement(writer, targetProperty.Type as IClass, nonTerminalElement, $"poco.{targetPropertyName}", ruleGenerationContext); ruleGenerationContext.CallerRule = previousCaller; } + else if (assignmentElement.Value is ValueLiteralElement valueLiteralElement && 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}}}"); + } else { writer.WriteSafeString("throw new System.NotSupportedException(\"Assigment of reference element not supported yet for this case\");"); @@ -340,7 +350,15 @@ private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass writer.WriteSafeString($"// NonParsing Assignment Element : {nonParsingAssignmentElement.PropertyName} {nonParsingAssignmentElement.Operator} {nonParsingAssignmentElement.Value} => Does not have to be process"); break; case ValueLiteralElement valueLiteralElement: - writer.WriteSafeString(valueLiteralElement.Value == "[QualifiedName]" ? "stringBuilder.Append(poco.qualifiedName);" : "throw new System.NotSupportedException(\"Value Literal different than QualifiedName not supported\");"); + 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: diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.cs index da8b1eb9..7f894330 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.cs @@ -85,7 +85,12 @@ public static void BuildPrefixMetadataAnnotation(SysML2.NET.Core.POCO.Root.Annot /// The that contains the entire textual notation public static void BuildAnnotation(SysML2.NET.Core.POCO.Root.Annotations.IAnnotation poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of reference element not supported yet for this case"); + + if (poco.AnnotatedElement != null) + { + stringBuilder.Append(poco.AnnotatedElement.qualifiedName); + stringBuilder.Append(' '); + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainingTextualNotationBuilder.cs index 51c2af35..795d9f87 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainingTextualNotationBuilder.cs @@ -42,7 +42,12 @@ public static partial class FeatureChainingTextualNotationBuilder /// The that contains the entire textual notation public static void BuildOwnedFeatureChaining(SysML2.NET.Core.POCO.Core.Features.IFeatureChaining poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of reference element not supported yet for this case"); + + if (poco.ChainingFeature != null) + { + stringBuilder.Append(poco.ChainingFeature.qualifiedName); + stringBuilder.Append(' '); + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs index cd8c73c5..74b34c46 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs @@ -729,6 +729,7 @@ public static void BuildFunctionReferenceArgument(SysML2.NET.Core.POCO.Core.Feat public static void BuildFeatureReference(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { stringBuilder.Append(poco.qualifiedName); + stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs index 68b13b51..6c4f74df 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs @@ -53,7 +53,12 @@ public static void BuildOwnedFeatureTyping(SysML2.NET.Core.POCO.Core.Features.IF /// The that contains the entire textual notation public static void BuildReferenceTyping(SysML2.NET.Core.POCO.Core.Features.IFeatureTyping poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of reference element not supported yet for this case"); + + if (poco.Type != null) + { + stringBuilder.Append(poco.Type.qualifiedName); + stringBuilder.Append(' '); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.cs index 302d2da6..253583cf 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.cs @@ -42,7 +42,12 @@ public static partial class MembershipImportTextualNotationBuilder /// The that contains the entire textual notation public static void BuildMembershipImport(SysML2.NET.Core.POCO.Root.Namespaces.IMembershipImport poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of reference element not supported yet for this case"); + + if (poco.ImportedMembership != null) + { + stringBuilder.Append(poco.ImportedMembership.qualifiedName); + stringBuilder.Append(' '); + } if (poco.IsRecursive) { diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs index 4cf249cf..3d03d171 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs @@ -79,7 +79,12 @@ public static void BuildAliasMember(SysML2.NET.Core.POCO.Root.Namespaces.IMember } stringBuilder.Append("for "); - throw new System.NotSupportedException("Assigment of reference element not supported yet for this case"); + + if (poco.MemberElement != null) + { + stringBuilder.Append(poco.MemberElement.qualifiedName); + stringBuilder.Append(' '); + } RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); } @@ -107,6 +112,7 @@ public static void BuildFeatureReferenceMember(SysML2.NET.Core.POCO.Root.Namespa if (poco.MemberElement != null) { stringBuilder.Append(poco.qualifiedName); + stringBuilder.Append(' '); } @@ -120,7 +126,12 @@ public static void BuildFeatureReferenceMember(SysML2.NET.Core.POCO.Root.Namespa /// The that contains the entire textual notation public static void BuildElementReferenceMember(SysML2.NET.Core.POCO.Root.Namespaces.IMembership poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of reference element not supported yet for this case"); + + if (poco.MemberElement != null) + { + stringBuilder.Append(poco.MemberElement.qualifiedName); + stringBuilder.Append(' '); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs index faee9cdd..4cb5deb2 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs @@ -53,7 +53,12 @@ public static void BuildOwnedRedefinition(SysML2.NET.Core.POCO.Core.Features.IRe /// The that contains the entire textual notation public static void BuildFlowFeatureRedefinition(SysML2.NET.Core.POCO.Core.Features.IRedefinition poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of reference element not supported yet for this case"); + + if (poco.RedefinedFeature != null) + { + stringBuilder.Append(poco.RedefinedFeature.qualifiedName); + stringBuilder.Append(' '); + } } @@ -65,7 +70,12 @@ public static void BuildFlowFeatureRedefinition(SysML2.NET.Core.POCO.Core.Featur /// The that contains the entire textual notation public static void BuildParameterRedefinition(SysML2.NET.Core.POCO.Core.Features.IRedefinition poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of reference element not supported yet for this case"); + + if (poco.RedefinedFeature != null) + { + stringBuilder.Append(poco.RedefinedFeature.qualifiedName); + stringBuilder.Append(' '); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.cs index 5ad75a00..0f1d4956 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.cs @@ -42,7 +42,12 @@ public static partial class SubclassificationTextualNotationBuilder /// The that contains the entire textual notation public static void BuildOwnedSubclassification(SysML2.NET.Core.POCO.Core.Classifiers.ISubclassification poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of reference element not supported yet for this case"); + + if (poco.Superclassifier != null) + { + stringBuilder.Append(poco.Superclassifier.qualifiedName); + stringBuilder.Append(' '); + } } @@ -63,9 +68,19 @@ public static void BuildSubclassification(SysML2.NET.Core.POCO.Core.Classifiers. } stringBuilder.Append("subclassifier "); - throw new System.NotSupportedException("Assigment of reference element not supported yet for this case"); + + if (poco.Subclassifier != null) + { + stringBuilder.Append(poco.Subclassifier.qualifiedName); + stringBuilder.Append(' '); + } throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - throw new System.NotSupportedException("Assigment of reference element not supported yet for this case"); + + if (poco.Superclassifier != null) + { + stringBuilder.Append(poco.Superclassifier.qualifiedName); + stringBuilder.Append(' '); + } RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeFeaturingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeFeaturingTextualNotationBuilder.cs index af40eab9..19d95abc 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeFeaturingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeFeaturingTextualNotationBuilder.cs @@ -42,7 +42,12 @@ public static partial class TypeFeaturingTextualNotationBuilder /// The that contains the entire textual notation public static void BuildOwnedTypeFeaturing(SysML2.NET.Core.POCO.Core.Features.ITypeFeaturing poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of reference element not supported yet for this case"); + + if (poco.FeaturingType != null) + { + stringBuilder.Append(poco.FeaturingType.qualifiedName); + stringBuilder.Append(' '); + } } @@ -63,9 +68,19 @@ public static void BuildTypeFeaturing(SysML2.NET.Core.POCO.Core.Features.ITypeFe stringBuilder.Append(' '); } - throw new System.NotSupportedException("Assigment of reference element not supported yet for this case"); + + if (poco.FeatureOfType != null) + { + stringBuilder.Append(poco.FeatureOfType.qualifiedName); + stringBuilder.Append(' '); + } stringBuilder.Append("by "); - throw new System.NotSupportedException("Assigment of reference element not supported yet for this case"); + + if (poco.FeaturingType != null) + { + stringBuilder.Append(poco.FeaturingType.qualifiedName); + stringBuilder.Append(' '); + } RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs index defced6a..74c5151f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs @@ -529,6 +529,7 @@ public static void BuildFunctionBodyPart(SysML2.NET.Core.POCO.Core.Types.IType p public static void BuildInstantiatedTypeReference(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) { stringBuilder.Append(poco.qualifiedName); + stringBuilder.Append(' '); } From eafd67a576e1fa0192edd42ea85050f6c8fa2f1b Mon Sep 17 00:00:00 2001 From: atheate Date: Fri, 6 Mar 2026 11:16:44 +0100 Subject: [PATCH 15/33] [WIP] Supports last assignement case --- .../HandleBarHelpers/RulesHelper.cs | 38 ++++++++++--------- .../LiteralIntegerTextualNotationBuilder.cs | 2 +- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs index a0d48bc0..2fdf0d5d 100644 --- a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs +++ b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs @@ -313,29 +313,31 @@ private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass } else if(targetProperty.QueryIsReferenceProperty()) { - if (assignmentElement.Value is NonTerminalElement nonTerminalElement) + switch (assignmentElement.Value) { - var previousCaller = ruleGenerationContext.CallerRule; - ruleGenerationContext.CallerRule = nonTerminalElement; - ProcessNonTerminalElement(writer, targetProperty.Type as IClass, nonTerminalElement, $"poco.{targetPropertyName}", ruleGenerationContext); - ruleGenerationContext.CallerRule = previousCaller; - } - else if (assignmentElement.Value is ValueLiteralElement valueLiteralElement && 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}}}"); - } - else - { - writer.WriteSafeString("throw new System.NotSupportedException(\"Assigment of reference element not supported yet for this case\");"); + 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("throw new System.NotSupportedException(\"Assigment of non-string value not yet supported\");"); + writer.WriteSafeString($"stringBuilder.Append(poco.{targetPropertyName}.ToString());"); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralIntegerTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralIntegerTextualNotationBuilder.cs index 12d657bd..55e8bf07 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralIntegerTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralIntegerTextualNotationBuilder.cs @@ -42,7 +42,7 @@ public static partial class LiteralIntegerTextualNotationBuilder /// The that contains the entire textual notation public static void BuildLiteralInteger(SysML2.NET.Core.POCO.Kernel.Expressions.ILiteralInteger poco, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Assigment of non-string value not yet supported"); + stringBuilder.Append(poco.Value.ToString()); } } From 337e60ce66ec302d51f70561800700c3ec20f8cf Mon Sep 17 00:00:00 2001 From: atheate Date: Fri, 6 Mar 2026 12:39:01 +0100 Subject: [PATCH 16/33] [WIP] Supports everything except Multiple Alternatives --- .../HandleBarHelpers/RulesHelper.cs | 130 +++++++++++------- .../DependencyTextualNotationBuilder.cs | 32 ++++- .../IfActionUsageTextualNotationBuilder.cs | 2 +- .../OwningMembershipTextualNotationBuilder.cs | 2 +- 4 files changed, 114 insertions(+), 52 deletions(-) diff --git a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs index 2fdf0d5d..ae95def5 100644 --- a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs +++ b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs @@ -175,10 +175,7 @@ private static void DeclareAllRequiredIterators(EncodedTextWriter writer, IClass { switch (ruleElement) { - case AssignmentElement { Value: NonTerminalElement } assignmentElement: - DeclareIteratorIfRequired(writer, umlClass, assignmentElement, ruleGenerationContext); - break; - case AssignmentElement { Value: GroupElement } assignmentElement: + case AssignmentElement assignmentElement: DeclareIteratorIfRequired(writer, umlClass, assignmentElement, ruleGenerationContext); break; case GroupElement groupElement: @@ -232,7 +229,7 @@ private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass if (groupElement.IsCollection) { - var assignmentRule = groupElement.Alternatives.SelectMany(x => x.Elements).FirstOrDefault(x => x is AssignmentElement { Value: NonTerminalElement }); + var assignmentRule = groupElement.Alternatives.SelectMany(x => x.Elements).FirstOrDefault(x => x is AssignmentElement { Value: NonTerminalElement } || x is AssignmentElement {Value: ValueLiteralElement}); if (assignmentRule is AssignmentElement assignmentElement) { @@ -274,6 +271,27 @@ private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass ProcessNonTerminalElement(writer, umlClass, nonTerminalElement, $"{iteratorToUse.IteratorVariableName}.Current", ruleGenerationContext); } + else if(assignmentElement.Value is GroupElement groupElement) + { + var previousCaller = ruleGenerationContext.CallerRule; + ruleGenerationContext.CallerRule = assignmentElement; + ProcessAlternatives(writer, umlClass, groupElement.Alternatives, ruleGenerationContext); + ruleGenerationContext.CallerRule = previousCaller; + } + else if(assignmentElement.Value is ValueLiteralElement valueLiteralElement && valueLiteralElement.QueryIsQualifiedName()) + { + 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}"); + } + + writer.WriteSafeString($"{Environment.NewLine}if({iteratorToUse.IteratorVariableName}.Current != null){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + writer.WriteSafeString($"stringBuilder.Append({iteratorToUse.IteratorVariableName}.Current.qualifiedName);{Environment.NewLine}"); + writer.WriteSafeString("}"); + } else { writer.WriteSafeString("throw new System.NotSupportedException(\"Assigment of enumerable with non NonTerminalElement not supported yet\");"); @@ -286,7 +304,7 @@ private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass 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("}}"); + writer.WriteSafeString("}"); } else { @@ -463,55 +481,75 @@ private static void DeclareIteratorIfRequired(EncodedTextWriter writer, IClass u { 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) + switch (assignmentElement.Value) { - alreadyDefinedIterator.ApplicableRuleElements.Add(assignmentElement); - return; - } + case NonTerminalElement nonTerminalElement: + 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); + var iteratorToUse = new IteratorDefinition + { + DefinedForProperty = targetProperty + }; + + iteratorToUse.ApplicableRuleElements.Add(assignmentElement); - string typeTarget; - - if (referencedRule == null) - { - typeTarget = umlClass.Name; - } - else - { - typeTarget = referencedRule.TargetElementName ?? referencedRule.RuleName; - } + 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; + 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(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); + break; + case ValueLiteralElement: + if (ruleGenerationContext.DefinedIterators.SingleOrDefault(x => x.IsIteratorValidForProperty(targetProperty, null) || x.ApplicableRuleElements.Contains(assignmentElement)) is { } existingValueLiteralIterator) + { + existingValueLiteralIterator.ApplicableRuleElements.Add(assignmentElement); + return; + } + + var valueLiteralIterator = new IteratorDefinition + { + DefinedForProperty = targetProperty + }; + + valueLiteralIterator.ApplicableRuleElements.Add(assignmentElement); + writer.WriteSafeString($"using var {valueLiteralIterator.IteratorVariableName} = poco.{targetProperty.QueryPropertyNameBasedOnUmlProperties()}.GetEnumerator();"); + writer.WriteSafeString(Environment.NewLine); + ruleGenerationContext.DefinedIterators.Add(valueLiteralIterator); + + break; } - - writer.WriteSafeString(Environment.NewLine); - ruleGenerationContext.DefinedIterators.Add(iteratorToUse); } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DependencyTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DependencyTextualNotationBuilder.cs index d0e42fb3..8babaf4d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DependencyTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DependencyTextualNotationBuilder.cs @@ -54,6 +54,8 @@ public static void BuildDependency(SysML2.NET.Core.POCO.Root.Dependencies.IDepen } stringBuilder.Append("dependency "); + using var clientIterator = poco.Client.GetEnumerator(); + using var supplierIterator = poco.Supplier.GetEnumerator(); if (BuildGroupConditionForDependencyDeclaration(poco)) { @@ -62,17 +64,39 @@ public static void BuildDependency(SysML2.NET.Core.POCO.Root.Dependencies.IDepen stringBuilder.Append(' '); } - throw new System.NotSupportedException("Assigment of enumerable with non NonTerminalElement not supported yet"); + clientIterator.MoveNext(); + + if (clientIterator.Current != null) + { + stringBuilder.Append(clientIterator.Current.qualifiedName); + } + + while (clientIterator.MoveNext()) { stringBuilder.Append(","); - throw new System.NotSupportedException("Assigment of enumerable with non NonTerminalElement not supported yet"); + + if (clientIterator.Current != null) + { + stringBuilder.Append(clientIterator.Current.qualifiedName); + } } stringBuilder.Append("to "); - throw new System.NotSupportedException("Assigment of enumerable with non NonTerminalElement not supported yet"); + supplierIterator.MoveNext(); + + if (supplierIterator.Current != null) + { + stringBuilder.Append(supplierIterator.Current.qualifiedName); + } + + while (supplierIterator.MoveNext()) { stringBuilder.Append(","); - throw new System.NotSupportedException("Assigment of enumerable with non NonTerminalElement not supported yet"); + + if (supplierIterator.Current != null) + { + stringBuilder.Append(supplierIterator.Current.qualifiedName); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs index 08b23b29..27a9ec90 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs @@ -61,7 +61,7 @@ public static void BuildIfNode(SysML2.NET.Core.POCO.Systems.Actions.IIfActionUsa if (BuildGroupConditionForIfNode(poco)) { stringBuilder.Append("else "); - throw new System.NotSupportedException("Assigment of enumerable with non NonTerminalElement not supported yet"); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs index 5226443c..4ec05fb3 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs @@ -131,7 +131,7 @@ public static void BuildOwnedMultiplicity(SysML2.NET.Core.POCO.Root.Namespaces.I /// 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"); + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); } From 553b4cc2966b1bb2fee99179ab91e6c206d55186 Mon Sep 17 00:00:00 2001 From: atheate Date: Mon, 9 Mar 2026 14:16:40 +0100 Subject: [PATCH 17/33] [WIP] Supports alternatives composed of all TerminalElement --- .../HandleBarHelpers/RulesHelper.cs | 33 ++++++++++++++++++- .../ActionUsageTextualNotationBuilder.cs | 4 +-- ...AnnotatingElementTextualNotationBuilder.cs | 2 +- .../ClassifierTextualNotationBuilder.cs | 6 ++-- .../ConjugationTextualNotationBuilder.cs | 2 +- .../ConnectionUsageTextualNotationBuilder.cs | 2 +- .../ConnectorTextualNotationBuilder.cs | 2 +- .../ControlNodeTextualNotationBuilder.cs | 2 +- .../DefinitionTextualNotationBuilder.cs | 4 +-- .../DifferencingTextualNotationBuilder.cs | 2 +- .../ElementTextualNotationBuilder.cs | 8 ++--- .../ExposeTextualNotationBuilder.cs | 2 +- .../ExpressionTextualNotationBuilder.cs | 8 ++--- ...FeatureMembershipTextualNotationBuilder.cs | 4 +-- .../FeatureTextualNotationBuilder.cs | 22 ++++++------- .../FeatureTypingTextualNotationBuilder.cs | 2 +- .../IfActionUsageTextualNotationBuilder.cs | 2 +- .../ImportTextualNotationBuilder.cs | 2 +- .../InterfaceUsageTextualNotationBuilder.cs | 2 +- .../IntersectingTextualNotationBuilder.cs | 2 +- .../InvariantTextualNotationBuilder.cs | 2 +- ...ocationExpressionTextualNotationBuilder.cs | 2 +- ...LiteralExpressionTextualNotationBuilder.cs | 2 +- .../MembershipTextualNotationBuilder.cs | 6 ++-- .../MetadataFeatureTextualNotationBuilder.cs | 2 +- .../MetadataUsageTextualNotationBuilder.cs | 2 +- .../MultiplicityTextualNotationBuilder.cs | 2 +- .../NamespaceTextualNotationBuilder.cs | 4 +-- ...urrenceDefinitionTextualNotationBuilder.cs | 4 +-- .../OwningMembershipTextualNotationBuilder.cs | 8 ++--- .../PackageTextualNotationBuilder.cs | 2 +- .../PortUsageTextualNotationBuilder.cs | 2 +- .../RedefinitionTextualNotationBuilder.cs | 2 +- .../ReferenceUsageTextualNotationBuilder.cs | 6 ++-- .../RelationshipTextualNotationBuilder.cs | 2 +- .../SpecializationTextualNotationBuilder.cs | 2 +- ...SubclassificationTextualNotationBuilder.cs | 2 +- .../SubsettingTextualNotationBuilder.cs | 2 +- .../TypeTextualNotationBuilder.cs | 18 +++++----- .../UnioningTextualNotationBuilder.cs | 2 +- .../UsageTextualNotationBuilder.cs | 22 ++++++------- .../ViewDefinitionTextualNotationBuilder.cs | 2 +- .../ViewUsageTextualNotationBuilder.cs | 2 +- 43 files changed, 122 insertions(+), 91 deletions(-) diff --git a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs index ae95def5..5ae54105 100644 --- a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs +++ b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs @@ -158,7 +158,38 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas } else { - writer.WriteSafeString("throw new System.NotSupportedException(\"Multiple alternatives not implemented yet\");"); + if (alternatives.All(x => x.Elements.Count == 1)) + { + var types = alternatives.SelectMany(x => x.Elements).Select(x => x.GetType()).Distinct().ToList(); + + if(types.Count == 1) + { + ProcessUnitypedAlternativesWithOneElement(writer, umlClass, alternatives, ruleGenerationContext); + } + else + { + writer.WriteSafeString($"throw new System.NotSupportedException(\"Multiple alternatives with only one of the different type not implemented yet - {string.Join(',', types.Select(x => x.Name))}\");"); + } + } + else + { + writer.WriteSafeString("throw new System.NotSupportedException(\"Multiple alternatives not implemented yet\");"); + } + } + } + + private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter writer, IClass umlClass, IReadOnlyCollection alternatives, RuleGenerationContext ruleGenerationContext) + { + var firstRuleElement = alternatives.ElementAt(0).Elements[0]; + + switch (firstRuleElement) + { + case TerminalElement terminalElement: + writer.WriteSafeString($"stringBuilder.Append(\" {terminalElement.Value} \");"); + break; + default: + writer.WriteSafeString($"throw new System.NotSupportedException(\"Multiple alternatives with only {firstRuleElement.GetType().Name} not implemented yet\");"); + break; } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs index 5e5dbbca..d550d30a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs @@ -55,7 +55,7 @@ public static void BuildActionUsageDeclaration(SysML2.NET.Core.POCO.Systems.Acti /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } /// @@ -176,7 +176,7 @@ public static void BuildEmptyActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IA /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotatingElementTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotatingElementTextualNotationBuilder.cs index d3b6c1d1..785aeae3 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotatingElementTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotatingElementTextualNotationBuilder.cs @@ -42,7 +42,7 @@ public static partial class AnnotatingElementTextualNotationBuilder /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs index 9f2f6768..3184b8d9 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs @@ -43,7 +43,7 @@ public static partial class ClassifierTextualNotationBuilder 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"); + stringBuilder.Append(" :> "); ownedRelationshipOfSubclassificationIterator.MoveNext(); if (ownedRelationshipOfSubclassificationIterator.Current != null) @@ -92,7 +92,7 @@ public static void BuildClassifierDeclaration(SysML2.NET.Core.POCO.Core.Classifi stringBuilder.Append(' '); } - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); TypeTextualNotationBuilder.BuildTypeRelationshipPart(poco, stringBuilder); } @@ -106,7 +106,7 @@ public static void BuildClassifierDeclaration(SysML2.NET.Core.POCO.Core.Classifi 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"); + stringBuilder.Append(" :> "); ownedRelationshipOfSubclassificationIterator.MoveNext(); if (ownedRelationshipOfSubclassificationIterator.Current != null) diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugationTextualNotationBuilder.cs index 5868a148..bcb12733 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugationTextualNotationBuilder.cs @@ -64,7 +64,7 @@ public static void BuildConjugation(SysML2.NET.Core.POCO.Core.Types.IConjugation stringBuilder.Append("conjugate "); throw new System.NotSupportedException("Multiple alternatives not implemented yet"); stringBuilder.Append(' '); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(" ~ "); throw new System.NotSupportedException("Multiple alternatives not implemented yet"); stringBuilder.Append(' '); RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs index 52e3b062..053568a4 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs @@ -42,7 +42,7 @@ public static partial class ConnectionUsageTextualNotationBuilder /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs index 89483056..7d6d6c3b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs @@ -42,7 +42,7 @@ public static partial class ConnectorTextualNotationBuilder /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ControlNodeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ControlNodeTextualNotationBuilder.cs index 64b1f731..961cb835 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ControlNodeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ControlNodeTextualNotationBuilder.cs @@ -42,7 +42,7 @@ public static partial class ControlNodeTextualNotationBuilder /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs index 0aeccd87..9379af5b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs @@ -60,7 +60,7 @@ public static void BuildDefinitionExtensionKeyword(SysML2.NET.Core.POCO.Systems. /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only AssignmentElement not implemented yet"); BuildDefinitionExtensionKeyword(poco, stringBuilder); } @@ -86,7 +86,7 @@ public static void BuildDefinitionDeclaration(SysML2.NET.Core.POCO.Systems.Defin /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only AssignmentElement not implemented yet"); BuildDefinitionExtensionKeyword(poco, stringBuilder); stringBuilder.Append("def "); BuildDefinition(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DifferencingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DifferencingTextualNotationBuilder.cs index d45fe372..7c58a022 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DifferencingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DifferencingTextualNotationBuilder.cs @@ -42,7 +42,7 @@ public static partial class DifferencingTextualNotationBuilder /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only AssignmentElement not implemented yet"); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementTextualNotationBuilder.cs index 9e720f52..e6b5b0ba 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementTextualNotationBuilder.cs @@ -69,7 +69,7 @@ public static void BuildIdentification(SysML2.NET.Core.POCO.Root.Elements.IEleme /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } /// @@ -80,7 +80,7 @@ public static void BuildDefinitionElement(SysML2.NET.Core.POCO.Root.Elements.IEl /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } /// @@ -91,7 +91,7 @@ public static void BuildOwnedRelatedElement(SysML2.NET.Core.POCO.Root.Elements.I /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } /// @@ -102,7 +102,7 @@ public static void BuildMemberElement(SysML2.NET.Core.POCO.Root.Elements.IElemen /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExposeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExposeTextualNotationBuilder.cs index 49cd6253..5eddd677 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExposeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExposeTextualNotationBuilder.cs @@ -43,7 +43,7 @@ public static partial class ExposeTextualNotationBuilder 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); stringBuilder.Append(' '); RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs index a18f1c00..9b2e1cdf 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs @@ -42,7 +42,7 @@ public static partial class ExpressionTextualNotationBuilder /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } /// @@ -53,7 +53,7 @@ public static void BuildOwnedExpression(SysML2.NET.Core.POCO.Kernel.Functions.IE /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } /// @@ -64,7 +64,7 @@ public static void BuildPrimaryExpression(SysML2.NET.Core.POCO.Kernel.Functions. /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } /// @@ -118,7 +118,7 @@ public static void BuildFunctionReference(SysML2.NET.Core.POCO.Kernel.Functions. /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs index 6a6dab0b..e413e972 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs @@ -211,7 +211,7 @@ public static void BuildFlowFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFeatu /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } /// @@ -372,7 +372,7 @@ public static void BuildMetadataBodyUsageMember(SysML2.NET.Core.POCO.Core.Types. { using var ownedRelationshipOfRedefinitionIterator = poco.OwnedRelationship.OfType().GetEnumerator(); stringBuilder.Append("ref "); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(" :>> "); ownedRelationshipOfRedefinitionIterator.MoveNext(); if (ownedRelationshipOfRedefinitionIterator.Current != null) diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs index 74b34c46..d99231b6 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs @@ -71,7 +71,7 @@ public static void BuildFeatureSpecializationPart(SysML2.NET.Core.POCO.Core.Feat /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } /// @@ -150,7 +150,7 @@ public static void BuildSubsettings(SysML2.NET.Core.POCO.Core.Features.IFeature 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"); + stringBuilder.Append(" :> "); ownedRelationshipOfSubsettingIterator.MoveNext(); if (ownedRelationshipOfSubsettingIterator.Current != null) @@ -169,7 +169,7 @@ public static void BuildSubsets(SysML2.NET.Core.POCO.Core.Features.IFeature poco 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"); + stringBuilder.Append(" ::> "); ownedRelationshipOfReferenceSubsettingIterator.MoveNext(); if (ownedRelationshipOfReferenceSubsettingIterator.Current != null) @@ -188,7 +188,7 @@ public static void BuildReferences(SysML2.NET.Core.POCO.Core.Features.IFeature p 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"); + stringBuilder.Append(" => "); ownedRelationshipOfCrossSubsettingIterator.MoveNext(); if (ownedRelationshipOfCrossSubsettingIterator.Current != null) @@ -231,7 +231,7 @@ public static void BuildRedefinitions(SysML2.NET.Core.POCO.Core.Features.IFeatur 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"); + stringBuilder.Append(" :>> "); ownedRelationshipOfRedefinitionIterator.MoveNext(); if (ownedRelationshipOfRedefinitionIterator.Current != null) @@ -415,7 +415,7 @@ public static void BuildArgumentExpression(SysML2.NET.Core.POCO.Core.Features.IF /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } /// @@ -467,7 +467,7 @@ public static void BuildBasicFeaturePrefix(SysML2.NET.Core.POCO.Core.Features.IF stringBuilder.Append(' '); } - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives with only AssignmentElement not implemented yet"); throw new System.NotSupportedException("Multiple alternatives not implemented yet"); } @@ -512,7 +512,7 @@ public static void BuildFeatureIdentification(SysML2.NET.Core.POCO.Core.Features /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } /// @@ -525,7 +525,7 @@ public static void BuildChainingPart(SysML2.NET.Core.POCO.Core.Features.IFeature { using var ownedRelationshipOfFeatureChainingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); stringBuilder.Append("chains "); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives with only one of the different type not implemented yet - AssignmentElement,NonTerminalElement"); stringBuilder.Append(' '); } @@ -754,7 +754,7 @@ public static void BuildConstructorResult(SysML2.NET.Core.POCO.Core.Features.IFe 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); stringBuilder.Append(")"); } @@ -853,7 +853,7 @@ public static void BuildMetadataBodyFeature(SysML2.NET.Core.POCO.Core.Features.I { using var ownedRelationshipOfRedefinitionIterator = poco.OwnedRelationship.OfType().GetEnumerator(); stringBuilder.Append("feature "); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(" :>> "); ownedRelationshipOfRedefinitionIterator.MoveNext(); if (ownedRelationshipOfRedefinitionIterator.Current != null) diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs index 6c4f74df..b1fcb650 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs @@ -70,7 +70,7 @@ public static void BuildReferenceTyping(SysML2.NET.Core.POCO.Core.Features.IFeat /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs index 27a9ec90..d06cdda1 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs @@ -61,7 +61,7 @@ public static void BuildIfNode(SysML2.NET.Core.POCO.Systems.Actions.IIfActionUsa if (BuildGroupConditionForIfNode(poco)) { stringBuilder.Append("else "); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ImportTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ImportTextualNotationBuilder.cs index f43e0d6c..1803409e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ImportTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ImportTextualNotationBuilder.cs @@ -42,7 +42,7 @@ public static partial class ImportTextualNotationBuilder /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs index 68942d76..fb4d8491 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs @@ -53,7 +53,7 @@ public static void BuildInterfaceUsageDeclaration(SysML2.NET.Core.POCO.Systems.I /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IntersectingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IntersectingTextualNotationBuilder.cs index e3443939..32b47164 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IntersectingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IntersectingTextualNotationBuilder.cs @@ -42,7 +42,7 @@ public static partial class IntersectingTextualNotationBuilder /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only AssignmentElement not implemented yet"); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs index c96cd1f2..d0b57165 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs @@ -57,7 +57,7 @@ public static void BuildInvariant(SysML2.NET.Core.POCO.Kernel.Functions.IInvaria } stringBuilder.Append("inv "); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives with only one of the different type not implemented yet - TerminalElement,AssignmentElement"); FeatureTextualNotationBuilder.BuildFeatureDeclaration(poco, stringBuilder); FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); TypeTextualNotationBuilder.BuildFunctionBody(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs index 23af400c..da4a1e48 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs @@ -58,7 +58,7 @@ public static void BuildFunctionOperationExpression(SysML2.NET.Core.POCO.Kernel. { BuildInvocationTypeMember(ownedRelationshipOfInvocationExpressionIterator.Current, stringBuilder); } - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives with only one of the different type not implemented yet - AssignmentElement,NonTerminalElement"); stringBuilder.Append(' '); ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralExpressionTextualNotationBuilder.cs index 21ab5ec6..52164d28 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralExpressionTextualNotationBuilder.cs @@ -42,7 +42,7 @@ public static partial class LiteralExpressionTextualNotationBuilder /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs index 3d03d171..4753dcbc 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs @@ -97,7 +97,7 @@ public static void BuildAliasMember(SysML2.NET.Core.POCO.Root.Namespaces.IMember /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only one of the different type not implemented yet - AssignmentElement,NonTerminalElement"); } /// @@ -143,7 +143,7 @@ public static void BuildElementReferenceMember(SysML2.NET.Core.POCO.Root.Namespa /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only one of the different type not implemented yet - AssignmentElement,NonTerminalElement"); } /// @@ -154,7 +154,7 @@ public static void BuildInstantiatedTypeMember(SysML2.NET.Core.POCO.Root.Namespa /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs index e96c9a6d..f51e57ea 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs @@ -99,7 +99,7 @@ public static void BuildMetadataFeature(SysML2.NET.Core.POCO.Kernel.Metadata.IMe } } - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(" @ "); stringBuilder.Append(' '); BuildMetadataFeatureDeclaration(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs index 168ac253..2e37a617 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs @@ -89,7 +89,7 @@ public static void BuildMetadataUsage(SysML2.NET.Core.POCO.Systems.Metadata.IMet { using var ownedRelationshipOfAnnotationIterator = poco.OwnedRelationship.OfType().GetEnumerator(); UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, stringBuilder); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(" @ "); stringBuilder.Append(' '); BuildMetadataUsageDeclaration(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityTextualNotationBuilder.cs index a387ceec..70833e1f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityTextualNotationBuilder.cs @@ -68,7 +68,7 @@ public static void BuildMultiplicitySubset(SysML2.NET.Core.POCO.Core.Types.IMult /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs index 07d4b473..b80881ac 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs @@ -42,7 +42,7 @@ public static partial class NamespaceTextualNotationBuilder /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only AssignmentElement not implemented yet"); } @@ -78,7 +78,7 @@ public static void BuildNamespaceBody(SysML2.NET.Core.POCO.Root.Namespaces.IName /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only AssignmentElement not implemented yet"); } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs index 72c33c79..3ac9da78 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs @@ -43,7 +43,7 @@ public static partial class OccurrenceDefinitionTextualNotationBuilder 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"); + throw new System.NotSupportedException("Multiple alternatives with only AssignmentElement not implemented yet"); if (poco.IsIndividual && ownedRelationshipOfOwningMembershipIterator.MoveNext()) { @@ -69,7 +69,7 @@ public static void BuildOccurrenceDefinitionPrefix(SysML2.NET.Core.POCO.Systems. 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"); + throw new System.NotSupportedException("Multiple alternatives with only AssignmentElement not implemented yet"); stringBuilder.Append("individual"); DefinitionTextualNotationBuilder.BuildDefinitionExtensionKeyword(poco, stringBuilder); stringBuilder.Append("def "); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs index 4ec05fb3..29dcba97 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs @@ -63,7 +63,7 @@ public static void BuildPackageMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwni 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"); + throw new System.NotSupportedException("Multiple alternatives with only AssignmentElement not implemented yet"); stringBuilder.Append(' '); } @@ -131,7 +131,7 @@ public static void BuildOwnedMultiplicity(SysML2.NET.Core.POCO.Root.Namespaces.I /// 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("Multiple alternatives not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } @@ -252,7 +252,7 @@ public static void BuildPrefixMetadataMember(SysML2.NET.Core.POCO.Root.Namespace /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } /// @@ -301,7 +301,7 @@ public static void BuildNamespaceFeatureMember(SysML2.NET.Core.POCO.Root.Namespa /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs index 9f198a53..a4b3d9f2 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs @@ -66,7 +66,7 @@ public static void BuildPackageBody(SysML2.NET.Core.POCO.Kernel.Packages.IPackag /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only AssignmentElement not implemented yet"); } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs index 540b1d23..3ea3a6d1 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs @@ -72,7 +72,7 @@ public static void BuildInterfaceEnd(SysML2.NET.Core.POCO.Systems.Ports.IPortUsa if (!string.IsNullOrWhiteSpace(poco.DeclaredName)) { stringBuilder.Append(poco.DeclaredName); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(" ::> "); stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs index 4cb5deb2..fd29e1da 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs @@ -97,7 +97,7 @@ public static void BuildRedefinition(SysML2.NET.Core.POCO.Core.Features.IRedefin stringBuilder.Append("redefinition "); SpecializationTextualNotationBuilder.BuildSpecificType(poco, stringBuilder); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(" :>> "); SpecializationTextualNotationBuilder.BuildGeneralType(poco, stringBuilder); RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs index 1e7a4cb1..08c25841 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs @@ -128,7 +128,7 @@ public static void BuildConnectorEnd(SysML2.NET.Core.POCO.Systems.DefinitionAndU if (!string.IsNullOrWhiteSpace(poco.DeclaredName)) { stringBuilder.Append(poco.DeclaredName); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(" ::> "); stringBuilder.Append(' '); } @@ -288,7 +288,7 @@ public static void BuildMetadataBodyUsage(SysML2.NET.Core.POCO.Systems.Definitio { using var ownedRelationshipOfRedefinitionIterator = poco.OwnedRelationship.OfType().GetEnumerator(); stringBuilder.Append("ref "); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(" :>> "); ownedRelationshipOfRedefinitionIterator.MoveNext(); if (ownedRelationshipOfRedefinitionIterator.Current != null) @@ -309,7 +309,7 @@ public static void BuildMetadataBodyUsage(SysML2.NET.Core.POCO.Systems.Definitio /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); stringBuilder.Append(' '); stringBuilder.Append("ref "); UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RelationshipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RelationshipTextualNotationBuilder.cs index 922ae253..18377280 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RelationshipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RelationshipTextualNotationBuilder.cs @@ -53,7 +53,7 @@ public static void BuildRelationshipBody(SysML2.NET.Core.POCO.Root.Elements.IRel /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only AssignmentElement not implemented yet"); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.cs index 05282fd1..54a07b37 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.cs @@ -86,7 +86,7 @@ public static void BuildSpecialization(SysML2.NET.Core.POCO.Core.Types.ISpeciali stringBuilder.Append("subtype "); BuildSpecificType(poco, stringBuilder); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(" :> "); BuildGeneralType(poco, stringBuilder); RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.cs index 0f1d4956..f6dca58b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.cs @@ -74,7 +74,7 @@ public static void BuildSubclassification(SysML2.NET.Core.POCO.Core.Classifiers. stringBuilder.Append(poco.Subclassifier.qualifiedName); stringBuilder.Append(' '); } - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(" :> "); if (poco.Superclassifier != null) { diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.cs index 65f53846..78f3f830 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.cs @@ -63,7 +63,7 @@ public static void BuildSubsetting(SysML2.NET.Core.POCO.Core.Features.ISubsettin stringBuilder.Append("subset "); SpecializationTextualNotationBuilder.BuildSpecificType(poco, stringBuilder); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(" :> "); SpecializationTextualNotationBuilder.BuildGeneralType(poco, stringBuilder); RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs index 74c5151f..eb687f6a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs @@ -154,7 +154,7 @@ public static void BuildCalculationBodyPart(SysML2.NET.Core.POCO.Core.Types.ITyp /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only one of the different type not implemented yet - NonTerminalElement,AssignmentElement"); } /// @@ -176,7 +176,7 @@ public static void BuildRequirementBody(SysML2.NET.Core.POCO.Core.Types.IType po /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only one of the different type not implemented yet - NonTerminalElement,AssignmentElement"); } /// @@ -198,7 +198,7 @@ public static void BuildCaseBody(SysML2.NET.Core.POCO.Core.Types.IType poco, Str /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only one of the different type not implemented yet - NonTerminalElement,AssignmentElement"); } /// @@ -270,7 +270,7 @@ public static void BuildTypeDeclaration(SysML2.NET.Core.POCO.Core.Types.IType po } { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } stringBuilder.Append(' '); BuildTypeRelationshipPart(poco, stringBuilder); @@ -286,7 +286,7 @@ public static void BuildTypeDeclaration(SysML2.NET.Core.POCO.Core.Types.IType po 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"); + stringBuilder.Append(" :> "); ownedRelationshipOfSpecializationIterator.MoveNext(); if (ownedRelationshipOfSpecializationIterator.Current != null) @@ -316,7 +316,7 @@ public static void BuildSpecializationPart(SysML2.NET.Core.POCO.Core.Types.IType 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"); + stringBuilder.Append(" ~ "); ownedRelationshipOfConjugationIterator.MoveNext(); if (ownedRelationshipOfConjugationIterator.Current != null) @@ -334,7 +334,7 @@ public static void BuildConjugationPart(SysML2.NET.Core.POCO.Core.Types.IType po /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } /// @@ -477,7 +477,7 @@ public static void BuildTypeBody(SysML2.NET.Core.POCO.Core.Types.IType poco, Str /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only AssignmentElement not implemented yet"); } /// @@ -504,7 +504,7 @@ public static void BuildFunctionBodyPart(SysML2.NET.Core.POCO.Core.Types.IType p while (ownedRelationshipOfReturnParameterMembershipIterator.MoveNext()) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives with only one of the different type not implemented yet - NonTerminalElement,AssignmentElement"); } if (ownedRelationshipOfResultExpressionMembershipIterator.MoveNext()) diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UnioningTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UnioningTextualNotationBuilder.cs index 808c514a..49175bea 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UnioningTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UnioningTextualNotationBuilder.cs @@ -42,7 +42,7 @@ public static partial class UnioningTextualNotationBuilder /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only AssignmentElement not implemented yet"); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs index 6609d26f..154ee194 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs @@ -42,7 +42,7 @@ public static partial class UsageTextualNotationBuilder /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } /// @@ -67,7 +67,7 @@ public static void BuildRefPrefix(SysML2.NET.Core.POCO.Systems.DefinitionAndUsag stringBuilder.Append(' '); } - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives with only AssignmentElement not implemented yet"); if (poco.IsConstant) { @@ -147,7 +147,7 @@ public static void BuildUsageExtensionKeyword(SysML2.NET.Core.POCO.Systems.Defin /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } /// @@ -209,7 +209,7 @@ public static void BuildUsageBody(SysML2.NET.Core.POCO.Systems.DefinitionAndUsag /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } /// @@ -220,7 +220,7 @@ public static void BuildNonOccurrenceUsageElement(SysML2.NET.Core.POCO.Systems.D /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } /// @@ -231,7 +231,7 @@ public static void BuildOccurrenceUsageElement(SysML2.NET.Core.POCO.Systems.Defi /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } /// @@ -242,7 +242,7 @@ public static void BuildStructureUsageElement(SysML2.NET.Core.POCO.Systems.Defin /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } /// @@ -253,7 +253,7 @@ public static void BuildBehaviorUsageElement(SysML2.NET.Core.POCO.Systems.Defini /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } /// @@ -264,7 +264,7 @@ public static void BuildVariantUsageElement(SysML2.NET.Core.POCO.Systems.Definit /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } /// @@ -275,7 +275,7 @@ public static void BuildInterfaceNonOccurrenceUsageElement(SysML2.NET.Core.POCO. /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); } /// @@ -286,7 +286,7 @@ public static void BuildInterfaceOccurrenceUsageElement(SysML2.NET.Core.POCO.Sys /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); stringBuilder.Append(' '); BuildUsageBody(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs index acad0ebd..58c54b43 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs @@ -53,7 +53,7 @@ public static void BuildViewDefinitionBody(SysML2.NET.Core.POCO.Systems.Views.IV /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only one of the different type not implemented yet - NonTerminalElement,AssignmentElement"); } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs index d5f27452..ac454a77 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs @@ -53,7 +53,7 @@ public static void BuildViewBody(SysML2.NET.Core.POCO.Systems.Views.IViewUsage p /// 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"); + throw new System.NotSupportedException("Multiple alternatives with only one of the different type not implemented yet - NonTerminalElement,AssignmentElement"); } /// From 4f4cd3510963cc3e81094b8994bc56594b54ebcf Mon Sep 17 00:00:00 2001 From: atheate Date: Tue, 10 Mar 2026 12:33:42 +0100 Subject: [PATCH 18/33] [WIP] Switch case for NonTerminalElement while multiple alternative implemented --- .../Extensions/ClassExtensions.cs | 41 ++++--- .../HandleBarHelpers/RulesHelper.cs | 78 ++++++++++++- .../ActionUsageTextualNotationBuilder.cs | 49 +++++++- ...AnnotatingElementTextualNotationBuilder.cs | 17 ++- .../ClassifierTextualNotationBuilder.cs | 11 +- .../ConnectionUsageTextualNotationBuilder.cs | 2 +- .../ConnectorTextualNotationBuilder.cs | 2 +- .../ControlNodeTextualNotationBuilder.cs | 17 ++- .../ElementTextualNotationBuilder.cs | 107 +++++++++++++++++- .../ExposeTextualNotationBuilder.cs | 11 +- .../ExpressionTextualNotationBuilder.cs | 17 ++- ...FeatureMembershipTextualNotationBuilder.cs | 2 +- .../FeatureTextualNotationBuilder.cs | 41 ++++++- .../FeatureTypingTextualNotationBuilder.cs | 11 +- .../IfActionUsageTextualNotationBuilder.cs | 2 +- .../ImportTextualNotationBuilder.cs | 11 +- .../InterfaceUsageTextualNotationBuilder.cs | 2 +- ...LiteralExpressionTextualNotationBuilder.cs | 21 +++- .../MembershipTextualNotationBuilder.cs | 17 ++- .../MultiplicityTextualNotationBuilder.cs | 11 +- .../OwningMembershipTextualNotationBuilder.cs | 15 ++- .../ReferenceUsageTextualNotationBuilder.cs | 2 +- .../TypeTextualNotationBuilder.cs | 4 +- .../UsageTextualNotationBuilder.cs | 89 +++++++++++++-- ...LiteralExpressionTextualNotationBuilder.cs | 41 +++++++ 25 files changed, 562 insertions(+), 59 deletions(-) create mode 100644 SysML2.NET/TextualNotation/LiteralExpressionTextualNotationBuilder.cs diff --git a/SysML2.NET.CodeGenerator/Extensions/ClassExtensions.cs b/SysML2.NET.CodeGenerator/Extensions/ClassExtensions.cs index a59fea30..3eadb42b 100644 --- a/SysML2.NET.CodeGenerator/Extensions/ClassExtensions.cs +++ b/SysML2.NET.CodeGenerator/Extensions/ClassExtensions.cs @@ -20,18 +20,15 @@ namespace SysML2.NET.CodeGenerator.Extensions { - using System; - using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using uml4net.Classification; using uml4net.Extensions; - using uml4net.Packages; using uml4net.StructuredClassifiers; /// - /// Extension methods for interface + /// Extension methods for interface /// public static class ClassExtensions { @@ -40,10 +37,10 @@ public static class ClassExtensions /// or interface implementations EXCLUDING IsDerived /// /// - /// The from which to query the properties + /// The from which to query the properties /// /// - /// A of + /// A of /// public static ReadOnlyCollection QueryAllNonDerivedProperties(this IClass @class) { @@ -59,10 +56,10 @@ public static ReadOnlyCollection QueryAllNonDerivedProperties(this IC /// redefined in the context of the current class /// /// - /// The from which to query the properties + /// The from which to query the properties /// /// - /// A of + /// A of /// public static ReadOnlyCollection QueryAllNonDerivedNonRedefinedProperties(this IClass @class) { @@ -78,7 +75,7 @@ public static ReadOnlyCollection QueryAllNonDerivedNonRedefinedProper /// Counts and returns to amount of non derived properties /// /// - /// The subject + /// The subject /// /// /// the amount of non derived properties @@ -92,7 +89,7 @@ public static int CountAllNonDerivedProperties(this IClass @class) /// Counts and returns to amount of non derived properties /// /// - /// The subject + /// The subject /// /// /// the amount of non derived properties @@ -103,20 +100,36 @@ public static int CountAllNonDerivedNonRedefinedProperties(this IClass @class) } /// - /// Query the name of the internal interface to implement for an + /// Query the name of the internal interface to implement for an /// - /// The + /// The /// The name of the internal interface to implement, if any public static string QueryInternalInterfaceName(this IClass umlClass) { var classifiers = umlClass.QueryAllGeneralClassifiers(); - + if (classifiers.Any(x => x.Name == "Relationship")) { return "IContainedRelationship"; } - + return classifiers.Any(x => x.Name == "Element") ? "IContainedElement" : string.Empty; } + + /// + /// Asserts that an is a subclass of another + /// + /// The to check + /// + /// The that is potentially a super class of + /// + /// + /// + /// True if the is a super class of the + /// + public static bool QueryIsSubclassOf(this IClass umlClass, IClass potentialSuperClass) + { + return umlClass.QueryAllGeneralClassifiers().Contains(potentialSuperClass); + } } } diff --git a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs index 5ae54105..c5d6609a 100644 --- a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs +++ b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs @@ -29,6 +29,7 @@ namespace SysML2.NET.CodeGenerator.HandleBarHelpers using SysML2.NET.CodeGenerator.Extensions; using SysML2.NET.CodeGenerator.Grammar.Model; + using uml4net; using uml4net.Classification; using uml4net.CommonStructure; using uml4net.Extensions; @@ -164,7 +165,14 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas if(types.Count == 1) { - ProcessUnitypedAlternativesWithOneElement(writer, umlClass, alternatives, ruleGenerationContext); + if (ruleGenerationContext.CallerRule is not AssignmentElement) + { + ProcessUnitypedAlternativesWithOneElement(writer, umlClass, alternatives, ruleGenerationContext); + } + else + { + writer.WriteSafeString($"throw new System.NotSupportedException(\"Multiple alternatives with only not implemented yet for caller as AssignmentElement\");"); + } } else { @@ -186,6 +194,38 @@ private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter { case TerminalElement terminalElement: writer.WriteSafeString($"stringBuilder.Append(\" {terminalElement.Value} \");"); + break; + case NonTerminalElement: + var nonTerminalElements = alternatives.SelectMany(x => x.Elements).OfType().ToList(); + var mappedNonTerminalElements = OrderElementsByInheritance(nonTerminalElements, umlClass.Cache, ruleGenerationContext); + + if (mappedNonTerminalElements.Select(x => x.UmlClass).Distinct().Count() != mappedNonTerminalElements.Count) + { + writer.WriteSafeString("throw new System.NotSupportedException(\"Multiple alternatives with same referenced rule type not implemented yet\");"); + break; + } + + writer.WriteSafeString($"switch(poco){Environment.NewLine}"); + writer.WriteSafeString("{"); + + foreach (var orderedNonTerminalElement in mappedNonTerminalElements) + { + if (orderedNonTerminalElement.UmlClass == ruleGenerationContext.NamedElementToGenerate) + { + writer.WriteSafeString($"default:{Environment.NewLine}"); + ProcessNonTerminalElement(writer, orderedNonTerminalElement.UmlClass, orderedNonTerminalElement.RuleElement, "poco",ruleGenerationContext); + } + else + { + writer.WriteSafeString($"case {orderedNonTerminalElement.UmlClass.QueryFullyQualifiedTypeName(targetInterface: orderedNonTerminalElement.UmlClass.IsAbstract)} poco{orderedNonTerminalElement.UmlClass.Name}:{Environment.NewLine}"); + ProcessNonTerminalElement(writer, orderedNonTerminalElement.UmlClass, orderedNonTerminalElement.RuleElement, $"poco{orderedNonTerminalElement.UmlClass.Name}",ruleGenerationContext); + } + + writer.WriteSafeString($"{Environment.NewLine}break;{Environment.NewLine}"); + } + + writer.WriteSafeString($"}}{Environment.NewLine}"); + break; default: writer.WriteSafeString($"throw new System.NotSupportedException(\"Multiple alternatives with only {firstRuleElement.GetType().Name} not implemented yet\");"); @@ -193,6 +233,42 @@ private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter } } + private static List<(NonTerminalElement RuleElement, IClass UmlClass)> OrderElementsByInheritance(List nonTerminalElements, IXmiElementCache cache, RuleGenerationContext ruleGenerationContext) + { + var mapping = new List<(NonTerminalElement RuleElement, IClass UmlClass)>(); + var elementClass = cache.Values.Single(x => x is IClass { Name: "Element" }); + + foreach (var nonTerminalElement in nonTerminalElements) + { + var referencedRule = ruleGenerationContext.AllRules.Single(x => x.RuleName == nonTerminalElement.Name); + var referencedClassName = referencedRule.TargetElementName ?? referencedRule.RuleName; + var referencedClass =(IClass)(cache.Values.SingleOrDefault(x => x is IClass umlClass && umlClass.Name == referencedClassName)?? elementClass); + mapping.Add((nonTerminalElement, referencedClass)); + } + + mapping.Sort((a, b) => + { + if (a.UmlClass == ruleGenerationContext.NamedElementToGenerate) + { + return 1; + } + + if (a.UmlClass == b.UmlClass) + { + return 0; + } + + if (a.UmlClass.QueryIsSubclassOf(b.UmlClass)) + { + return -1; + } + + return b.UmlClass.QueryIsSubclassOf(a.UmlClass) ? 1 : 0; + }); + + return mapping; + } + /// /// Declares all required iterator for all present inside an /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs index d550d30a..1f5d1fcf 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs @@ -55,7 +55,34 @@ public static void BuildActionUsageDeclaration(SysML2.NET.Core.POCO.Systems.Acti /// 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 with only NonTerminalElement not implemented yet"); + switch (poco) + { + case SysML2.NET.Core.POCO.Systems.Actions.IControlNode pocoControlNode: + ControlNodeTextualNotationBuilder.BuildControlNode(pocoControlNode, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Actions.SendActionUsage pocoSendActionUsage: + SendActionUsageTextualNotationBuilder.BuildSendNode(pocoSendActionUsage, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Actions.AcceptActionUsage pocoAcceptActionUsage: + AcceptActionUsageTextualNotationBuilder.BuildAcceptNode(pocoAcceptActionUsage, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Actions.AssignmentActionUsage pocoAssignmentActionUsage: + AssignmentActionUsageTextualNotationBuilder.BuildAssignmentNode(pocoAssignmentActionUsage, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Actions.TerminateActionUsage pocoTerminateActionUsage: + TerminateActionUsageTextualNotationBuilder.BuildTerminateNode(pocoTerminateActionUsage, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Actions.IfActionUsage pocoIfActionUsage: + IfActionUsageTextualNotationBuilder.BuildIfNode(pocoIfActionUsage, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Actions.WhileLoopActionUsage pocoWhileLoopActionUsage: + WhileLoopActionUsageTextualNotationBuilder.BuildWhileLoopNode(pocoWhileLoopActionUsage, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Actions.ForLoopActionUsage pocoForLoopActionUsage: + ForLoopActionUsageTextualNotationBuilder.BuildForLoopNode(pocoForLoopActionUsage, stringBuilder); + break; + } + } /// @@ -176,7 +203,25 @@ public static void BuildEmptyActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IA /// 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 with only NonTerminalElement not implemented yet"); + switch (poco) + { + case SysML2.NET.Core.POCO.Systems.Actions.PerformActionUsage pocoPerformActionUsage: + PerformActionUsageTextualNotationBuilder.BuildTransitionPerformActionUsage(pocoPerformActionUsage, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Actions.AcceptActionUsage pocoAcceptActionUsage: + AcceptActionUsageTextualNotationBuilder.BuildTransitionAcceptActionUsage(pocoAcceptActionUsage, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Actions.SendActionUsage pocoSendActionUsage: + SendActionUsageTextualNotationBuilder.BuildTransitionSendActionUsage(pocoSendActionUsage, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Actions.AssignmentActionUsage pocoAssignmentActionUsage: + AssignmentActionUsageTextualNotationBuilder.BuildTransitionAssignmentActionUsage(pocoAssignmentActionUsage, stringBuilder); + break; + default: + BuildEmptyActionUsage(poco, stringBuilder); + break; + } + } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotatingElementTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotatingElementTextualNotationBuilder.cs index 785aeae3..59aebfaa 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotatingElementTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotatingElementTextualNotationBuilder.cs @@ -42,7 +42,22 @@ public static partial class AnnotatingElementTextualNotationBuilder /// 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 with only NonTerminalElement not implemented yet"); + switch (poco) + { + case SysML2.NET.Core.POCO.Root.Annotations.Documentation pocoDocumentation: + DocumentationTextualNotationBuilder.BuildDocumentation(pocoDocumentation, stringBuilder); + break; + case SysML2.NET.Core.POCO.Root.Annotations.Comment pocoComment: + CommentTextualNotationBuilder.BuildComment(pocoComment, stringBuilder); + break; + case SysML2.NET.Core.POCO.Root.Annotations.TextualRepresentation pocoTextualRepresentation: + TextualRepresentationTextualNotationBuilder.BuildTextualRepresentation(pocoTextualRepresentation, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Metadata.MetadataFeature pocoMetadataFeature: + MetadataFeatureTextualNotationBuilder.BuildMetadataFeature(pocoMetadataFeature, stringBuilder); + break; + } + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs index 3184b8d9..00001785 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs @@ -92,7 +92,16 @@ public static void BuildClassifierDeclaration(SysML2.NET.Core.POCO.Core.Classifi stringBuilder.Append(' '); } - throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); + switch (poco) + { + case SysML2.NET.Core.POCO.Core.Types.Type pocoType: + TypeTextualNotationBuilder.BuildConjugationPart(pocoType, stringBuilder); + break; + default: + BuildSuperclassingPart(poco, stringBuilder); + break; + } + TypeTextualNotationBuilder.BuildTypeRelationshipPart(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs index 053568a4..5f08745e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs @@ -42,7 +42,7 @@ public static partial class ConnectionUsageTextualNotationBuilder /// 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 with only NonTerminalElement not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs index 7d6d6c3b..90838db7 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs @@ -42,7 +42,7 @@ public static partial class ConnectorTextualNotationBuilder /// 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 with only NonTerminalElement not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ControlNodeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ControlNodeTextualNotationBuilder.cs index 961cb835..4250e67d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ControlNodeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ControlNodeTextualNotationBuilder.cs @@ -42,7 +42,22 @@ public static partial class ControlNodeTextualNotationBuilder /// 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 with only NonTerminalElement not implemented yet"); + switch (poco) + { + case SysML2.NET.Core.POCO.Systems.Actions.MergeNode pocoMergeNode: + MergeNodeTextualNotationBuilder.BuildMergeNode(pocoMergeNode, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Actions.DecisionNode pocoDecisionNode: + DecisionNodeTextualNotationBuilder.BuildDecisionNode(pocoDecisionNode, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Actions.JoinNode pocoJoinNode: + JoinNodeTextualNotationBuilder.BuildJoinNode(pocoJoinNode, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Actions.ForkNode pocoForkNode: + ForkNodeTextualNotationBuilder.BuildForkNode(pocoForkNode, stringBuilder); + break; + } + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementTextualNotationBuilder.cs index e6b5b0ba..a1ccdc7a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementTextualNotationBuilder.cs @@ -69,7 +69,7 @@ public static void BuildIdentification(SysML2.NET.Core.POCO.Root.Elements.IEleme /// 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 with only NonTerminalElement not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); } /// @@ -80,7 +80,16 @@ public static void BuildDefinitionElement(SysML2.NET.Core.POCO.Root.Elements.IEl /// 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 with only NonTerminalElement not implemented yet"); + switch (poco) + { + case SysML2.NET.Core.POCO.Core.Features.Feature pocoFeature: + FeatureTextualNotationBuilder.BuildFeatureElement(pocoFeature, stringBuilder); + break; + default: + BuildNonFeatureElement(poco, stringBuilder); + break; + } + } /// @@ -91,7 +100,16 @@ public static void BuildOwnedRelatedElement(SysML2.NET.Core.POCO.Root.Elements.I /// 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 with only NonTerminalElement not implemented yet"); + switch (poco) + { + case SysML2.NET.Core.POCO.Root.Annotations.AnnotatingElement pocoAnnotatingElement: + AnnotatingElementTextualNotationBuilder.BuildAnnotatingElement(pocoAnnotatingElement, stringBuilder); + break; + default: + BuildNonFeatureElement(poco, stringBuilder); + break; + } + } /// @@ -102,7 +120,88 @@ public static void BuildMemberElement(SysML2.NET.Core.POCO.Root.Elements.IElemen /// 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 with only NonTerminalElement not implemented yet"); + switch (poco) + { + case SysML2.NET.Core.POCO.Root.Dependencies.Dependency pocoDependency: + DependencyTextualNotationBuilder.BuildDependency(pocoDependency, stringBuilder); + break; + case SysML2.NET.Core.POCO.Core.Features.Subsetting pocoSubsetting: + SubsettingTextualNotationBuilder.BuildSubsetting(pocoSubsetting, stringBuilder); + break; + case SysML2.NET.Core.POCO.Core.Features.FeatureTyping pocoFeatureTyping: + FeatureTypingTextualNotationBuilder.BuildFeatureTyping(pocoFeatureTyping, stringBuilder); + break; + case SysML2.NET.Core.POCO.Core.Features.FeatureInverting pocoFeatureInverting: + FeatureInvertingTextualNotationBuilder.BuildFeatureInverting(pocoFeatureInverting, stringBuilder); + break; + case SysML2.NET.Core.POCO.Core.Types.Disjoining pocoDisjoining: + DisjoiningTextualNotationBuilder.BuildDisjoining(pocoDisjoining, stringBuilder); + break; + case SysML2.NET.Core.POCO.Core.Classifiers.Subclassification pocoSubclassification: + SubclassificationTextualNotationBuilder.BuildSubclassification(pocoSubclassification, stringBuilder); + break; + case SysML2.NET.Core.POCO.Core.Types.Conjugation pocoConjugation: + ConjugationTextualNotationBuilder.BuildConjugation(pocoConjugation, stringBuilder); + break; + case SysML2.NET.Core.POCO.Core.Types.Specialization pocoSpecialization: + SpecializationTextualNotationBuilder.BuildSpecialization(pocoSpecialization, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Packages.LibraryPackage pocoLibraryPackage: + LibraryPackageTextualNotationBuilder.BuildLibraryPackage(pocoLibraryPackage, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Packages.Package pocoPackage: + PackageTextualNotationBuilder.BuildPackage(pocoPackage, stringBuilder); + break; + case SysML2.NET.Core.POCO.Core.Types.Multiplicity pocoMultiplicity: + MultiplicityTextualNotationBuilder.BuildMultiplicity(pocoMultiplicity, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Functions.Predicate pocoPredicate: + PredicateTextualNotationBuilder.BuildPredicate(pocoPredicate, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Functions.Function pocoFunction: + FunctionTextualNotationBuilder.BuildFunction(pocoFunction, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Interactions.Interaction pocoInteraction: + InteractionTextualNotationBuilder.BuildInteraction(pocoInteraction, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Behaviors.Behavior pocoBehavior: + BehaviorTextualNotationBuilder.BuildBehavior(pocoBehavior, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Associations.AssociationStructure pocoAssociationStructure: + AssociationStructureTextualNotationBuilder.BuildAssociationStructure(pocoAssociationStructure, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Associations.Association pocoAssociation: + AssociationTextualNotationBuilder.BuildAssociation(pocoAssociation, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Metadata.Metaclass pocoMetaclass: + MetaclassTextualNotationBuilder.BuildMetaclass(pocoMetaclass, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Structures.Structure pocoStructure: + StructureTextualNotationBuilder.BuildStructure(pocoStructure, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Classes.Class pocoClass: + ClassTextualNotationBuilder.BuildClass(pocoClass, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.DataTypes.DataType pocoDataType: + DataTypeTextualNotationBuilder.BuildDataType(pocoDataType, stringBuilder); + break; + case SysML2.NET.Core.POCO.Core.Classifiers.Classifier pocoClassifier: + ClassifierTextualNotationBuilder.BuildClassifier(pocoClassifier, stringBuilder); + break; + case SysML2.NET.Core.POCO.Core.Types.Type pocoType: + TypeTextualNotationBuilder.BuildType(pocoType, stringBuilder); + break; + case SysML2.NET.Core.POCO.Root.Namespaces.Namespace pocoNamespace: + NamespaceTextualNotationBuilder.BuildNamespace(pocoNamespace, stringBuilder); + break; + case SysML2.NET.Core.POCO.Core.Features.Redefinition pocoRedefinition: + RedefinitionTextualNotationBuilder.BuildRedefinition(pocoRedefinition, stringBuilder); + break; + case SysML2.NET.Core.POCO.Core.Features.TypeFeaturing pocoTypeFeaturing: + TypeFeaturingTextualNotationBuilder.BuildTypeFeaturing(pocoTypeFeaturing, stringBuilder); + break; + } + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExposeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExposeTextualNotationBuilder.cs index 5eddd677..cbae110f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExposeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExposeTextualNotationBuilder.cs @@ -43,7 +43,16 @@ public static partial class ExposeTextualNotationBuilder public static void BuildExpose(SysML2.NET.Core.POCO.Systems.Views.IExpose poco, StringBuilder stringBuilder) { stringBuilder.Append("expose "); - throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); + switch (poco) + { + case SysML2.NET.Core.POCO.Systems.Views.MembershipExpose pocoMembershipExpose: + MembershipExposeTextualNotationBuilder.BuildMembershipExpose(pocoMembershipExpose, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Views.NamespaceExpose pocoNamespaceExpose: + NamespaceExposeTextualNotationBuilder.BuildNamespaceExpose(pocoNamespaceExpose, stringBuilder); + break; + } + stringBuilder.Append(' '); RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs index 9b2e1cdf..3a7226e9 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs @@ -42,7 +42,7 @@ public static partial class ExpressionTextualNotationBuilder /// 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 with only NonTerminalElement not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); } /// @@ -53,7 +53,16 @@ public static void BuildOwnedExpression(SysML2.NET.Core.POCO.Kernel.Functions.IE /// 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 with only NonTerminalElement not implemented yet"); + switch (poco) + { + case SysML2.NET.Core.POCO.Kernel.Expressions.FeatureChainExpression pocoFeatureChainExpression: + FeatureChainExpressionTextualNotationBuilder.BuildFeatureChainExpression(pocoFeatureChainExpression, stringBuilder); + break; + default: + BuildNonFeatureChainPrimaryExpression(poco, stringBuilder); + break; + } + } /// @@ -64,7 +73,7 @@ public static void BuildPrimaryExpression(SysML2.NET.Core.POCO.Kernel.Functions. /// 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 with only NonTerminalElement not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); } /// @@ -118,7 +127,7 @@ public static void BuildFunctionReference(SysML2.NET.Core.POCO.Kernel.Functions. /// 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 with only NonTerminalElement not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs index e413e972..03d538f3 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs @@ -211,7 +211,7 @@ public static void BuildFlowFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFeatu /// 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 with only NonTerminalElement not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs index d99231b6..49e407dc 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs @@ -71,7 +71,7 @@ public static void BuildFeatureSpecializationPart(SysML2.NET.Core.POCO.Core.Feat /// 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 with only NonTerminalElement not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); } /// @@ -415,7 +415,40 @@ public static void BuildArgumentExpression(SysML2.NET.Core.POCO.Core.Features.IF /// 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 with only NonTerminalElement not implemented yet"); + switch (poco) + { + case SysML2.NET.Core.POCO.Kernel.Functions.Invariant pocoInvariant: + InvariantTextualNotationBuilder.BuildInvariant(pocoInvariant, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Functions.BooleanExpression pocoBooleanExpression: + BooleanExpressionTextualNotationBuilder.BuildBooleanExpression(pocoBooleanExpression, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Functions.Expression pocoExpression: + ExpressionTextualNotationBuilder.BuildExpression(pocoExpression, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Behaviors.Step pocoStep: + StepTextualNotationBuilder.BuildStep(pocoStep, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Connectors.BindingConnector pocoBindingConnector: + BindingConnectorTextualNotationBuilder.BuildBindingConnector(pocoBindingConnector, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Interactions.SuccessionFlow pocoSuccessionFlow: + SuccessionFlowTextualNotationBuilder.BuildSuccessionFlow(pocoSuccessionFlow, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Connectors.Succession pocoSuccession: + SuccessionTextualNotationBuilder.BuildSuccession(pocoSuccession, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Interactions.Flow pocoFlow: + FlowTextualNotationBuilder.BuildFlow(pocoFlow, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Connectors.Connector pocoConnector: + ConnectorTextualNotationBuilder.BuildConnector(pocoConnector, stringBuilder); + break; + default: + BuildFeature(poco, stringBuilder); + break; + } + } /// @@ -512,7 +545,7 @@ public static void BuildFeatureIdentification(SysML2.NET.Core.POCO.Core.Features /// 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 with only NonTerminalElement not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); } /// @@ -754,7 +787,7 @@ public static void BuildConstructorResult(SysML2.NET.Core.POCO.Core.Features.IFe public static void BuildArgumentList(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) { stringBuilder.Append("("); - throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); stringBuilder.Append(")"); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs index b1fcb650..308c9c10 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs @@ -70,7 +70,16 @@ public static void BuildReferenceTyping(SysML2.NET.Core.POCO.Core.Features.IFeat /// 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 with only NonTerminalElement not implemented yet"); + switch (poco) + { + case SysML2.NET.Core.POCO.Systems.Ports.ConjugatedPortTyping pocoConjugatedPortTyping: + ConjugatedPortTypingTextualNotationBuilder.BuildConjugatedPortTyping(pocoConjugatedPortTyping, stringBuilder); + break; + default: + BuildOwnedFeatureTyping(poco, stringBuilder); + break; + } + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs index d06cdda1..136472f7 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs @@ -61,7 +61,7 @@ public static void BuildIfNode(SysML2.NET.Core.POCO.Systems.Actions.IIfActionUsa if (BuildGroupConditionForIfNode(poco)) { stringBuilder.Append("else "); - throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives with only not implemented yet for caller as AssignmentElement"); stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ImportTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ImportTextualNotationBuilder.cs index 1803409e..4a7e1fb1 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ImportTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ImportTextualNotationBuilder.cs @@ -42,7 +42,16 @@ public static partial class ImportTextualNotationBuilder /// 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 with only NonTerminalElement not implemented yet"); + switch (poco) + { + case SysML2.NET.Core.POCO.Root.Namespaces.MembershipImport pocoMembershipImport: + MembershipImportTextualNotationBuilder.BuildMembershipImport(pocoMembershipImport, stringBuilder); + break; + case SysML2.NET.Core.POCO.Root.Namespaces.NamespaceImport pocoNamespaceImport: + NamespaceImportTextualNotationBuilder.BuildNamespaceImport(pocoNamespaceImport, stringBuilder); + break; + } + } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs index fb4d8491..abed5a26 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs @@ -53,7 +53,7 @@ public static void BuildInterfaceUsageDeclaration(SysML2.NET.Core.POCO.Systems.I /// 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 with only NonTerminalElement not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralExpressionTextualNotationBuilder.cs index 52164d28..e6cd3e41 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralExpressionTextualNotationBuilder.cs @@ -42,7 +42,26 @@ public static partial class LiteralExpressionTextualNotationBuilder /// 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 with only NonTerminalElement not implemented yet"); + switch (poco) + { + case SysML2.NET.Core.POCO.Kernel.Expressions.LiteralBoolean pocoLiteralBoolean: + LiteralBooleanTextualNotationBuilder.BuildLiteralBoolean(pocoLiteralBoolean, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Expressions.LiteralString pocoLiteralString: + LiteralStringTextualNotationBuilder.BuildLiteralString(pocoLiteralString, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Expressions.LiteralInteger pocoLiteralInteger: + LiteralIntegerTextualNotationBuilder.BuildLiteralInteger(pocoLiteralInteger, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Expressions.LiteralInfinity pocoLiteralInfinity: + LiteralInfinityTextualNotationBuilder.BuildLiteralInfinity(pocoLiteralInfinity, stringBuilder); + break; + case SysML2.NET.Core.POCO.Root.Elements.IElement pocoElement: + BuildValue(poco, stringBuilder); + + break; + } + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs index 4753dcbc..dc05199f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs @@ -154,7 +154,22 @@ public static void BuildInstantiatedTypeMember(SysML2.NET.Core.POCO.Root.Namespa /// 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 with only NonTerminalElement not implemented yet"); + switch (poco) + { + case SysML2.NET.Core.POCO.Core.Types.FeatureMembership pocoFeatureMembership: + FeatureMembershipTextualNotationBuilder.BuildMetadataBodyFeatureMember(pocoFeatureMembership, stringBuilder); + break; + case SysML2.NET.Core.POCO.Root.Namespaces.OwningMembership pocoOwningMembership: + OwningMembershipTextualNotationBuilder.BuildNonFeatureMember(pocoOwningMembership, stringBuilder); + break; + default: + BuildAliasMember(poco, stringBuilder); + break; + case SysML2.NET.Core.POCO.Root.Namespaces.IImport pocoImport: + ImportTextualNotationBuilder.BuildImport(pocoImport, stringBuilder); + break; + } + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityTextualNotationBuilder.cs index 70833e1f..2050a00e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityTextualNotationBuilder.cs @@ -68,7 +68,16 @@ public static void BuildMultiplicitySubset(SysML2.NET.Core.POCO.Core.Types.IMult /// 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 with only NonTerminalElement not implemented yet"); + switch (poco) + { + case SysML2.NET.Core.POCO.Kernel.Multiplicities.MultiplicityRange pocoMultiplicityRange: + MultiplicityRangeTextualNotationBuilder.BuildMultiplicityRange(pocoMultiplicityRange, stringBuilder); + break; + default: + BuildMultiplicitySubset(poco, stringBuilder); + break; + } + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs index 29dcba97..5b5d09b3 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs @@ -131,7 +131,7 @@ public static void BuildOwnedMultiplicity(SysML2.NET.Core.POCO.Root.Namespaces.I /// 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("Multiple alternatives with only NonTerminalElement not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives with only not implemented yet for caller as AssignmentElement"); } @@ -252,7 +252,7 @@ public static void BuildPrefixMetadataMember(SysML2.NET.Core.POCO.Root.Namespace /// 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 with only NonTerminalElement not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); } /// @@ -301,7 +301,16 @@ public static void BuildNamespaceFeatureMember(SysML2.NET.Core.POCO.Root.Namespa /// 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 with only NonTerminalElement not implemented yet"); + switch (poco) + { + case SysML2.NET.Core.POCO.Core.Types.FeatureMembership pocoFeatureMembership: + FeatureMembershipTextualNotationBuilder.BuildOwnedFeatureMember(pocoFeatureMembership, stringBuilder); + break; + default: + BuildTypeFeatureMember(poco, stringBuilder); + break; + } + } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs index 08c25841..6f652613 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs @@ -309,7 +309,7 @@ public static void BuildMetadataBodyUsage(SysML2.NET.Core.POCO.Systems.Definitio /// 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 with only NonTerminalElement not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); stringBuilder.Append(' '); stringBuilder.Append("ref "); UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs index eb687f6a..dfb786bc 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs @@ -270,7 +270,7 @@ public static void BuildTypeDeclaration(SysML2.NET.Core.POCO.Core.Types.IType po } { - throw new System.NotSupportedException("Multiple alternatives with only NonTerminalElement not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); } stringBuilder.Append(' '); BuildTypeRelationshipPart(poco, stringBuilder); @@ -334,7 +334,7 @@ public static void BuildConjugationPart(SysML2.NET.Core.POCO.Core.Types.IType po /// 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 with only NonTerminalElement not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs index 154ee194..e4e29d0c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs @@ -42,7 +42,7 @@ public static partial class UsageTextualNotationBuilder /// 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 with only NonTerminalElement not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); } /// @@ -147,7 +147,7 @@ public static void BuildUsageExtensionKeyword(SysML2.NET.Core.POCO.Systems.Defin /// 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 with only NonTerminalElement not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); } /// @@ -209,7 +209,7 @@ public static void BuildUsageBody(SysML2.NET.Core.POCO.Systems.DefinitionAndUsag /// 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 with only NonTerminalElement not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); } /// @@ -220,7 +220,7 @@ public static void BuildNonOccurrenceUsageElement(SysML2.NET.Core.POCO.Systems.D /// 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 with only NonTerminalElement not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); } /// @@ -231,7 +231,7 @@ public static void BuildOccurrenceUsageElement(SysML2.NET.Core.POCO.Systems.Defi /// 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 with only NonTerminalElement not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); } /// @@ -242,7 +242,58 @@ public static void BuildStructureUsageElement(SysML2.NET.Core.POCO.Systems.Defin /// 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 with only NonTerminalElement not implemented yet"); + switch (poco) + { + case SysML2.NET.Core.POCO.Systems.Calculations.CalculationUsage pocoCalculationUsage: + CalculationUsageTextualNotationBuilder.BuildCalculationUsage(pocoCalculationUsage, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.States.StateUsage pocoStateUsage: + StateUsageTextualNotationBuilder.BuildStateUsage(pocoStateUsage, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Actions.ActionUsage pocoActionUsage: + ActionUsageTextualNotationBuilder.BuildActionUsage(pocoActionUsage, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Requirements.ConcernUsage pocoConcernUsage: + ConcernUsageTextualNotationBuilder.BuildConcernUsage(pocoConcernUsage, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Requirements.RequirementUsage pocoRequirementUsage: + RequirementUsageTextualNotationBuilder.BuildRequirementUsage(pocoRequirementUsage, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Constraints.ConstraintUsage pocoConstraintUsage: + ConstraintUsageTextualNotationBuilder.BuildConstraintUsage(pocoConstraintUsage, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.AnalysisCases.AnalysisCaseUsage pocoAnalysisCaseUsage: + AnalysisCaseUsageTextualNotationBuilder.BuildAnalysisCaseUsage(pocoAnalysisCaseUsage, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.VerificationCases.VerificationCaseUsage pocoVerificationCaseUsage: + VerificationCaseUsageTextualNotationBuilder.BuildVerificationCaseUsage(pocoVerificationCaseUsage, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.UseCases.UseCaseUsage pocoUseCaseUsage: + UseCaseUsageTextualNotationBuilder.BuildUseCaseUsage(pocoUseCaseUsage, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Cases.CaseUsage pocoCaseUsage: + CaseUsageTextualNotationBuilder.BuildCaseUsage(pocoCaseUsage, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Views.ViewpointUsage pocoViewpointUsage: + ViewpointUsageTextualNotationBuilder.BuildViewpointUsage(pocoViewpointUsage, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.States.ExhibitStateUsage pocoExhibitStateUsage: + ExhibitStateUsageTextualNotationBuilder.BuildExhibitStateUsage(pocoExhibitStateUsage, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.UseCases.IncludeUseCaseUsage pocoIncludeUseCaseUsage: + IncludeUseCaseUsageTextualNotationBuilder.BuildIncludeUseCaseUsage(pocoIncludeUseCaseUsage, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Actions.PerformActionUsage pocoPerformActionUsage: + PerformActionUsageTextualNotationBuilder.BuildPerformActionUsage(pocoPerformActionUsage, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Requirements.SatisfyRequirementUsage pocoSatisfyRequirementUsage: + SatisfyRequirementUsageTextualNotationBuilder.BuildSatisfyRequirementUsage(pocoSatisfyRequirementUsage, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Constraints.AssertConstraintUsage pocoAssertConstraintUsage: + AssertConstraintUsageTextualNotationBuilder.BuildAssertConstraintUsage(pocoAssertConstraintUsage, stringBuilder); + break; + } + } /// @@ -253,7 +304,7 @@ public static void BuildBehaviorUsageElement(SysML2.NET.Core.POCO.Systems.Defini /// 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 with only NonTerminalElement not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); } /// @@ -264,7 +315,25 @@ public static void BuildVariantUsageElement(SysML2.NET.Core.POCO.Systems.Definit /// 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 with only NonTerminalElement not implemented yet"); + switch (poco) + { + case SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.ReferenceUsage pocoReferenceUsage: + ReferenceUsageTextualNotationBuilder.BuildReferenceUsage(pocoReferenceUsage, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Enumerations.EnumerationUsage pocoEnumerationUsage: + EnumerationUsageTextualNotationBuilder.BuildEnumerationUsage(pocoEnumerationUsage, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Attributes.AttributeUsage pocoAttributeUsage: + AttributeUsageTextualNotationBuilder.BuildAttributeUsage(pocoAttributeUsage, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Connections.BindingConnectorAsUsage pocoBindingConnectorAsUsage: + BindingConnectorAsUsageTextualNotationBuilder.BuildBindingConnectorAsUsage(pocoBindingConnectorAsUsage, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Connections.SuccessionAsUsage pocoSuccessionAsUsage: + SuccessionAsUsageTextualNotationBuilder.BuildSuccessionAsUsage(pocoSuccessionAsUsage, stringBuilder); + break; + } + } /// @@ -275,7 +344,7 @@ public static void BuildInterfaceNonOccurrenceUsageElement(SysML2.NET.Core.POCO. /// 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 with only NonTerminalElement not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); } /// @@ -286,7 +355,7 @@ public static void BuildInterfaceOccurrenceUsageElement(SysML2.NET.Core.POCO.Sys /// 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 with only NonTerminalElement not implemented yet"); + throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); stringBuilder.Append(' '); BuildUsageBody(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/LiteralExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/LiteralExpressionTextualNotationBuilder.cs new file mode 100644 index 00000000..c70afaab --- /dev/null +++ b/SysML2.NET/TextualNotation/LiteralExpressionTextualNotationBuilder.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 LiteralExpressionTextualNotationBuilder + { + /// + /// Build the Value rule for real + /// + /// The + /// The + private static void BuildValue(ILiteralExpression poco, StringBuilder stringBuilder) + { + } + } +} From 101ec13ae2ff82d28c3d4d097f5c12e042706387 Mon Sep 17 00:00:00 2001 From: atheate Date: Wed, 11 Mar 2026 09:31:19 +0100 Subject: [PATCH 19/33] [WIP] Supports assigment with groupElement --- .../HandleBarHelpers/RulesHelper.cs | 114 +++++++++++++----- .../EnumerableExtensions.cs} | 25 ++-- .../IfActionUsageTextualNotationBuilder.cs | 4 +- .../OwningMembershipTextualNotationBuilder.cs | 14 ++- 4 files changed, 113 insertions(+), 44 deletions(-) rename SysML2.NET/{TextualNotation/IfActionUsageTextualNotationBuilder.cs => Extensions/EnumerableExtensions.cs} (50%) diff --git a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs index c5d6609a..eba097af 100644 --- a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs +++ b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs @@ -165,14 +165,7 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas if(types.Count == 1) { - if (ruleGenerationContext.CallerRule is not AssignmentElement) - { - ProcessUnitypedAlternativesWithOneElement(writer, umlClass, alternatives, ruleGenerationContext); - } - else - { - writer.WriteSafeString($"throw new System.NotSupportedException(\"Multiple alternatives with only not implemented yet for caller as AssignmentElement\");"); - } + ProcessUnitypedAlternativesWithOneElement(writer, umlClass, alternatives, ruleGenerationContext); } else { @@ -186,6 +179,13 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas } } + /// + /// Process multiple when all of them only have one + /// + /// The used to write into output content + /// The related + /// The collection of alternatives to process + /// The current private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter writer, IClass umlClass, IReadOnlyCollection alternatives, RuleGenerationContext ruleGenerationContext) { var firstRuleElement = alternatives.ElementAt(0).Elements[0]; @@ -205,7 +205,16 @@ private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter break; } - writer.WriteSafeString($"switch(poco){Environment.NewLine}"); + var variableName = "poco"; + + if (ruleGenerationContext.CallerRule is AssignmentElement assignmentElement) + { + var iteratorToUse = ruleGenerationContext.DefinedIterators.Single(x => x.ApplicableRuleElements.Contains(assignmentElement)); + variableName = $"{iteratorToUse.IteratorVariableName}.Current"; + writer.WriteSafeString($"{iteratorToUse.IteratorVariableName}.MoveNext();{Environment.NewLine}{Environment.NewLine}"); + } + + writer.WriteSafeString($"switch({variableName}){Environment.NewLine}"); writer.WriteSafeString("{"); foreach (var orderedNonTerminalElement in mappedNonTerminalElements) @@ -213,7 +222,7 @@ private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter if (orderedNonTerminalElement.UmlClass == ruleGenerationContext.NamedElementToGenerate) { writer.WriteSafeString($"default:{Environment.NewLine}"); - ProcessNonTerminalElement(writer, orderedNonTerminalElement.UmlClass, orderedNonTerminalElement.RuleElement, "poco",ruleGenerationContext); + ProcessNonTerminalElement(writer, orderedNonTerminalElement.UmlClass, orderedNonTerminalElement.RuleElement, variableName,ruleGenerationContext); } else { @@ -233,6 +242,13 @@ private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter } } + /// + /// Orders a collection of based on the inheritance ordering, to build switch expression + /// + /// The collection of to order + /// The + /// The current + /// The collection of ordered with the associated private static List<(NonTerminalElement RuleElement, IClass UmlClass)> OrderElementsByInheritance(List nonTerminalElements, IXmiElementCache cache, RuleGenerationContext ruleGenerationContext) { var mapping = new List<(NonTerminalElement RuleElement, IClass UmlClass)>(); @@ -580,23 +596,12 @@ private static void DeclareIteratorIfRequired(EncodedTextWriter writer, IClass u 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); - } - - return; - } - switch (assignmentElement.Value) { case NonTerminalElement nonTerminalElement: + { 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); @@ -607,14 +612,14 @@ private static void DeclareIteratorIfRequired(EncodedTextWriter writer, IClass u { DefinedForProperty = targetProperty }; - + iteratorToUse.ApplicableRuleElements.Add(assignmentElement); string typeTarget; - + if (referencedRule == null) { - typeTarget = umlClass.Name; + typeTarget = umlClass.Name; } else { @@ -626,18 +631,19 @@ private static void DeclareIteratorIfRequired(EncodedTextWriter writer, IClass u 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();" + 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); - break; + break; + } case ValueLiteralElement: if (ruleGenerationContext.DefinedIterators.SingleOrDefault(x => x.IsIteratorValidForProperty(targetProperty, null) || x.ApplicableRuleElements.Contains(assignmentElement)) is { } existingValueLiteralIterator) { @@ -655,6 +661,54 @@ private static void DeclareIteratorIfRequired(EncodedTextWriter writer, IClass u writer.WriteSafeString(Environment.NewLine); ruleGenerationContext.DefinedIterators.Add(valueLiteralIterator); + break; + case AssignmentElement containedAssignment: + DeclareIteratorIfRequired(writer, umlClass, containedAssignment, ruleGenerationContext); + break; + case GroupElement groupElement: + var nonTerminalRules = groupElement.Alternatives.SelectMany(x => x.Elements).OfType().ToList(); + + if (ruleGenerationContext.DefinedIterators.Any(x => x.ApplicableRuleElements.Contains(assignmentElement))) + { + return; + } + + var referencedTypes = new HashSet(); + + foreach (var nonTerminalElement in nonTerminalRules) + { + var referencedRule = ruleGenerationContext.AllRules.SingleOrDefault(x => x.RuleName == nonTerminalElement.Name); + + if (ruleGenerationContext.DefinedIterators.SingleOrDefault(x => x.IsIteratorValidForProperty(targetProperty, referencedRule)) is { } alreadyDefined) + { + alreadyDefined.ApplicableRuleElements.Add(assignmentElement); + return; + } + + string typeTarget; + + if (referencedRule == null) + { + typeTarget = umlClass.Name; + } + else + { + typeTarget = referencedRule.TargetElementName ?? referencedRule.RuleName; + } + + referencedTypes.Add(umlClass.Cache.Values.OfType().Single(x => x.Name == typeTarget)); + } + + var iteratorToUseForGroup = new IteratorDefinition + { + DefinedForProperty = targetProperty + }; + + var typesFilter = string.Join(", ", referencedTypes.Select(x => $"typeof({x.QueryFullyQualifiedTypeName(targetInterface: false)})")); + writer.WriteSafeString($"using var {iteratorToUseForGroup.IteratorVariableName} = SysML2.NET.Extensions.EnumerableExtensions.GetElementsOfType(poco.{targetProperty.QueryPropertyNameBasedOnUmlProperties()}, {typesFilter}).GetEnumerator();{Environment.NewLine}"); + + iteratorToUseForGroup.ApplicableRuleElements.Add(assignmentElement); + ruleGenerationContext.DefinedIterators.Add(iteratorToUseForGroup); break; } } diff --git a/SysML2.NET/TextualNotation/IfActionUsageTextualNotationBuilder.cs b/SysML2.NET/Extensions/EnumerableExtensions.cs similarity index 50% rename from SysML2.NET/TextualNotation/IfActionUsageTextualNotationBuilder.cs rename to SysML2.NET/Extensions/EnumerableExtensions.cs index 4639c28c..57bd6961 100644 --- a/SysML2.NET/TextualNotation/IfActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/Extensions/EnumerableExtensions.cs @@ -1,5 +1,5 @@ // ------------------------------------------------------------------------------------------------- -// +// // // Copyright 2022-2026 Starion Group S.A. // @@ -18,26 +18,29 @@ // // ------------------------------------------------------------------------------------------------ -namespace SysML2.NET.TextualNotation +namespace SysML2.NET.Extensions { + using System; + using System.Collections; + using System.Collections.Generic; using System.Linq; - using SysML2.NET.Core.POCO.Kernel.Behaviors; - using SysML2.NET.Core.POCO.Systems.Actions; + using SysML2.NET.Core.POCO.Root.Elements; /// - /// Hand-coded part of the + /// Extension methods for the interface /// - public static partial class IfActionUsageTextualNotationBuilder + internal static class EnumerableExtensions { /// - /// Builds the conditional part for the IfNode rule + /// Filters out all where the type matches one of the requested /// - /// The - /// The assertion of the condition - private static bool BuildGroupConditionForIfNode(IIfActionUsage poco) + /// The collection to filters + /// A collection of that should be used for filtering + /// A collection of + internal static IEnumerable GetElementsOfType(this IEnumerable collection, params Type[] elementTypes) { - return poco.OwnedRelationship.OfType().Count() != 0; + return from object element in collection where elementTypes.Contains(element.GetType()) select element as IElement; } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs index 136472f7..98c8aca5 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs @@ -58,10 +58,10 @@ public static void BuildIfNode(SysML2.NET.Core.POCO.Systems.Actions.IIfActionUsa ParameterMembershipTextualNotationBuilder.BuildActionBodyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); } - if (BuildGroupConditionForIfNode(poco)) + if (ownedRelationshipOfParameterMembershipIterator.MoveNext()) { stringBuilder.Append("else "); - throw new System.NotSupportedException("Multiple alternatives with only not implemented yet for caller as AssignmentElement"); + throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs index 5b5d09b3..812fcbf0 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs @@ -131,7 +131,19 @@ public static void BuildOwnedMultiplicity(SysML2.NET.Core.POCO.Root.Namespaces.I /// 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("Multiple alternatives with only not implemented yet for caller as AssignmentElement"); + using var ownedRelatedElementIterator = SysML2.NET.Extensions.EnumerableExtensions.GetElementsOfType(poco.OwnedRelatedElement, typeof(SysML2.NET.Core.POCO.Kernel.Expressions.LiteralExpression), typeof(SysML2.NET.Core.POCO.Kernel.Expressions.FeatureReferenceExpression)).GetEnumerator(); + ownedRelatedElementIterator.MoveNext(); + + switch (ownedRelatedElementIterator.Current) + { + case SysML2.NET.Core.POCO.Kernel.Expressions.LiteralExpression pocoLiteralExpression: + LiteralExpressionTextualNotationBuilder.BuildLiteralExpression(pocoLiteralExpression, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Expressions.FeatureReferenceExpression pocoFeatureReferenceExpression: + FeatureReferenceExpressionTextualNotationBuilder.BuildFeatureReferenceExpression(pocoFeatureReferenceExpression, stringBuilder); + break; + } + } From cf0e800f0aaaee4c4d2fa639c8aad98a20dd50a7 Mon Sep 17 00:00:00 2001 From: atheate Date: Wed, 11 Mar 2026 15:57:32 +0100 Subject: [PATCH 20/33] [WIP] All Assignment cases supported in multiple alternatives --- .../HandleBarHelpers/RulesHelper.cs | 352 ++++++++++++------ ...rtConstraintUsageTextualNotationBuilder.cs | 2 +- .../ClassifierTextualNotationBuilder.cs | 2 +- .../DecisionNodeTextualNotationBuilder.cs | 5 +- .../DefinitionTextualNotationBuilder.cs | 20 +- .../DifferencingTextualNotationBuilder.cs | 16 +- .../FeatureTextualNotationBuilder.cs | 23 +- .../ForkNodeTextualNotationBuilder.cs | 5 +- .../ImportTextualNotationBuilder.cs | 2 +- .../IntersectingTextualNotationBuilder.cs | 16 +- .../JoinNodeTextualNotationBuilder.cs | 5 +- .../LibraryPackageTextualNotationBuilder.cs | 2 +- .../MembershipImportTextualNotationBuilder.cs | 2 +- .../MergeNodeTextualNotationBuilder.cs | 5 +- ...etadataDefinitionTextualNotationBuilder.cs | 2 +- .../NamespaceTextualNotationBuilder.cs | 37 +- ...urrenceDefinitionTextualNotationBuilder.cs | 27 +- .../OccurrenceUsageTextualNotationBuilder.cs | 11 +- .../OwningMembershipTextualNotationBuilder.cs | 17 +- .../PackageTextualNotationBuilder.cs | 20 +- .../PortUsageTextualNotationBuilder.cs | 5 +- .../RelationshipTextualNotationBuilder.cs | 20 +- ...yRequirementUsageTextualNotationBuilder.cs | 2 +- .../TypeTextualNotationBuilder.cs | 6 +- .../UnioningTextualNotationBuilder.cs | 16 +- .../UsageTextualNotationBuilder.cs | 21 +- .../TypeTextualNotationBuilder.cs | 60 +++ 27 files changed, 544 insertions(+), 157 deletions(-) create mode 100644 SysML2.NET/TextualNotation/TypeTextualNotationBuilder.cs diff --git a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs index eba097af..5001ba0d 100644 --- a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs +++ b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs @@ -169,6 +169,7 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas } else { + writer.WriteSafeString($"throw new System.NotSupportedException(\"Multiple alternatives with only one of the different type not implemented yet - {string.Join(',', types.Select(x => x.Name))}\");"); } } @@ -196,6 +197,7 @@ private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter writer.WriteSafeString($"stringBuilder.Append(\" {terminalElement.Value} \");"); break; case NonTerminalElement: + { var nonTerminalElements = alternatives.SelectMany(x => x.Elements).OfType().ToList(); var mappedNonTerminalElements = OrderElementsByInheritance(nonTerminalElements, umlClass.Cache, ruleGenerationContext); @@ -222,19 +224,112 @@ private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter if (orderedNonTerminalElement.UmlClass == ruleGenerationContext.NamedElementToGenerate) { writer.WriteSafeString($"default:{Environment.NewLine}"); - ProcessNonTerminalElement(writer, orderedNonTerminalElement.UmlClass, orderedNonTerminalElement.RuleElement, variableName,ruleGenerationContext); + ProcessNonTerminalElement(writer, orderedNonTerminalElement.UmlClass, orderedNonTerminalElement.RuleElement, variableName, ruleGenerationContext); } else { writer.WriteSafeString($"case {orderedNonTerminalElement.UmlClass.QueryFullyQualifiedTypeName(targetInterface: orderedNonTerminalElement.UmlClass.IsAbstract)} poco{orderedNonTerminalElement.UmlClass.Name}:{Environment.NewLine}"); - ProcessNonTerminalElement(writer, orderedNonTerminalElement.UmlClass, orderedNonTerminalElement.RuleElement, $"poco{orderedNonTerminalElement.UmlClass.Name}",ruleGenerationContext); + ProcessNonTerminalElement(writer, orderedNonTerminalElement.UmlClass, orderedNonTerminalElement.RuleElement, $"poco{orderedNonTerminalElement.UmlClass.Name}", ruleGenerationContext); } writer.WriteSafeString($"{Environment.NewLine}break;{Environment.NewLine}"); } - + writer.WriteSafeString($"}}{Environment.NewLine}"); - + + break; + } + case AssignmentElement: + var assignmentElements = alternatives.SelectMany(x => x.Elements).OfType().ToList(); + var propertiesTarget = assignmentElements.Select(x => x.Property).Distinct().ToList(); + + if (propertiesTarget.Count == 1) + { + var targetProperty = umlClass.QueryAllProperties().Single(x => string.Equals(x.Name, propertiesTarget[0])); + + var orderElementsByInheritance = OrderElementsByInheritance(assignmentElements.Select(x => x.Value).OfType().ToList(), umlClass.Cache, ruleGenerationContext); + + if (assignmentElements.All(x => x.Operator == "+=") && assignmentElements.All(x => x.Value is NonTerminalElement)) + { + if (orderElementsByInheritance.Select(x => x.UmlClass).Distinct().Count() != orderElementsByInheritance.Count) + { + writer.WriteSafeString($"Build{alternatives.ElementAt(0).TextualNotationRule.RuleName}Alternatives(poco, stringBuilder);"); + } + else + { + writer.WriteSafeString($"foreach(var elementIn{targetProperty.Name.CapitalizeFirstLetter()} in poco.{targetProperty.QueryPropertyNameBasedOnUmlProperties()}){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + writer.WriteSafeString($"switch(elementIn{targetProperty.Name.CapitalizeFirstLetter()}){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + + foreach (var orderedElement in orderElementsByInheritance) + { + writer.WriteSafeString($"case {orderedElement.UmlClass.QueryFullyQualifiedTypeName(targetInterface:orderedElement.UmlClass.IsAbstract)} {orderedElement.UmlClass.Name.LowerCaseFirstLetter()}:{Environment.NewLine}"); + ProcessNonTerminalElement(writer, orderedElement.UmlClass, orderedElement.RuleElement, orderedElement.UmlClass.Name.LowerCaseFirstLetter(), ruleGenerationContext); + writer.WriteSafeString($"{Environment.NewLine}break;{Environment.NewLine}"); + } + + writer.WriteSafeString($"}}{Environment.NewLine}"); + writer.WriteSafeString($"}}{Environment.NewLine}"); + } + } + else + { + var typeFiltering = string.Join(", ", orderElementsByInheritance.Select(x => $"typeof({x.UmlClass.QueryFullyQualifiedTypeName(targetInterface: x.UmlClass.IsAbstract)})")); + writer.WriteSafeString($"using var iterator = SysML2.NET.Extensions.EnumerableExtensions.GetElementsOfType(poco.{targetProperty.QueryPropertyNameBasedOnUmlProperties()}, {typeFiltering}).GetEnumerator();{Environment.NewLine}"); + writer.WriteSafeString($"iterator.MoveNext();{Environment.NewLine}{Environment.NewLine}"); + writer.WriteSafeString("if(iterator.Current != null)"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + + writer.WriteSafeString($"switch(iterator.Current){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + + foreach (var orderedElement in orderElementsByInheritance) + { + if (orderedElement.UmlClass.Name == "Element") + { + writer.WriteSafeString($"case {{ }} {orderedElement.UmlClass.Name.LowerCaseFirstLetter()}:{Environment.NewLine}"); + } + else + { + writer.WriteSafeString($"case {orderedElement.UmlClass.QueryFullyQualifiedTypeName(targetInterface:orderedElement.UmlClass.IsAbstract)} {orderedElement.UmlClass.Name.LowerCaseFirstLetter()}:{Environment.NewLine}"); + } + + ProcessNonTerminalElement(writer, orderedElement.UmlClass, orderedElement.RuleElement, orderedElement.UmlClass.Name.LowerCaseFirstLetter(), ruleGenerationContext); + writer.WriteSafeString($"{Environment.NewLine}break;{Environment.NewLine}"); + } + + writer.WriteSafeString($"}}{Environment.NewLine}"); + writer.WriteSafeString($"}}{Environment.NewLine}"); + } + } + else + { + foreach (var alternative in alternatives) + { + DeclareAllRequiredIterators(writer, umlClass, alternative, ruleGenerationContext); + } + + var properties = umlClass.QueryAllProperties(); + + for (var alternativeIndex = 0; alternativeIndex < alternatives.Count; alternativeIndex++) + { + if (alternativeIndex != 0) + { + writer.WriteSafeString("else "); + } + + var assignment =assignmentElements[alternativeIndex]; + var targetProperty = properties.Single(x => string.Equals(x.Name, assignment.Property)); + + var iterator = ruleGenerationContext.DefinedIterators.SingleOrDefault(x => x.ApplicableRuleElements.Contains(assignment)); + writer.WriteSafeString($"if({targetProperty.QueryIfStatementContentForNonEmpty(iterator?.IteratorVariableName ?? "poco")}){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + ProcessAssignmentElement(writer, umlClass, ruleGenerationContext, assignment, true); + writer.WriteSafeString($"{Environment.NewLine}}}{Environment.NewLine}"); + } + } + break; default: writer.WriteSafeString($"throw new System.NotSupportedException(\"Multiple alternatives with only {firstRuleElement.GetType().Name} not implemented yet\");"); @@ -291,7 +386,7 @@ private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter /// The used to write into output content /// The related /// The to process - /// + /// The current private static void DeclareAllRequiredIterators(EncodedTextWriter writer, IClass umlClass, Alternatives alternatives, RuleGenerationContext ruleGenerationContext) { foreach (var ruleElement in alternatives.Elements) @@ -318,7 +413,7 @@ private static void DeclareAllRequiredIterators(EncodedTextWriter writer, IClass /// The used to write into output content /// The related /// The to process - /// + /// The current /// If the type of the is not supported private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass, RuleElement textualRuleElement, RuleGenerationContext ruleGenerationContext) { @@ -376,139 +471,170 @@ private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass break; case AssignmentElement assignmentElement: - var properties = umlClass.QueryAllProperties(); - var targetProperty = properties.SingleOrDefault(x => string.Equals(x.Name, assignmentElement.Property, StringComparison.OrdinalIgnoreCase)); + ProcessAssignmentElement(writer, umlClass, ruleGenerationContext, assignmentElement); + 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); + } - if (targetProperty != null) + /// + /// Processes an + /// + /// The used to write into output content + /// The related + /// The to process + /// The current + /// + private static void ProcessAssignmentElement(EncodedTextWriter writer, IClass umlClass, RuleGenerationContext ruleGenerationContext, AssignmentElement assignmentElement, bool isPartOfMultipleAlternative = false) + { + 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) { - if (targetProperty.QueryIsEnumerable()) + var iteratorToUse = ruleGenerationContext.DefinedIterators.Single(x => x.ApplicableRuleElements.Contains(assignmentElement)); + + if (!isPartOfMultipleAlternative && assignmentElement.Container is not GroupElement { IsCollection: true } && assignmentElement.Container is not GroupElement { IsOptional: true }) { - if (assignmentElement.Value is NonTerminalElement nonTerminalElement) - { - var iteratorToUse = ruleGenerationContext.DefinedIterators.Single(x => x.ApplicableRuleElements.Contains(assignmentElement)); + writer.WriteSafeString($"{iteratorToUse.IteratorVariableName}.MoveNext();{Environment.NewLine}"); + } + + ProcessNonTerminalElement(writer, umlClass, nonTerminalElement, $"{iteratorToUse.IteratorVariableName}.Current", ruleGenerationContext); + } + else if(assignmentElement.Value is GroupElement groupElement) + { + var previousCaller = ruleGenerationContext.CallerRule; + ruleGenerationContext.CallerRule = assignmentElement; + ProcessAlternatives(writer, umlClass, groupElement.Alternatives, ruleGenerationContext); + ruleGenerationContext.CallerRule = previousCaller; + } + else if(assignmentElement.Value is ValueLiteralElement valueLiteralElement && valueLiteralElement.QueryIsQualifiedName()) + { + 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}"); + } + + writer.WriteSafeString($"{Environment.NewLine}if({iteratorToUse.IteratorVariableName}.Current != null){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + writer.WriteSafeString($"stringBuilder.Append({iteratorToUse.IteratorVariableName}.Current.qualifiedName);{Environment.NewLine}"); + writer.WriteSafeString("}"); + } + 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 (assignmentElement.Container is not GroupElement { IsCollection: true } && assignmentElement.Container is not GroupElement { IsOptional: true }) + if (targetProperty.QueryIsString()) + { + writer.WriteSafeString($"stringBuilder.Append(poco.{targetPropertyName});"); + } + else if (targetProperty.QueryIsBool()) + { + if (assignmentElement.Value is TerminalElement terminalElement) + { + if (!isPartOfMultipleAlternative && assignmentElement.Container is not GroupElement) { - writer.WriteSafeString($"{iteratorToUse.IteratorVariableName}.MoveNext();{Environment.NewLine}"); + writer.WriteSafeString($"if({targetProperty.QueryIfStatementContentForNonEmpty("poco")}){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + writer.WriteSafeString($"stringBuilder.Append(\" {terminalElement.Value} \");{Environment.NewLine}"); + writer.WriteSafeString('}'); } - - ProcessNonTerminalElement(writer, umlClass, nonTerminalElement, $"{iteratorToUse.IteratorVariableName}.Current", ruleGenerationContext); - } - else if(assignmentElement.Value is GroupElement groupElement) - { - var previousCaller = ruleGenerationContext.CallerRule; - ruleGenerationContext.CallerRule = assignmentElement; - ProcessAlternatives(writer, umlClass, groupElement.Alternatives, ruleGenerationContext); - ruleGenerationContext.CallerRule = previousCaller; - } - else if(assignmentElement.Value is ValueLiteralElement valueLiteralElement && valueLiteralElement.QueryIsQualifiedName()) - { - 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 }) + else { - writer.WriteSafeString($"{iteratorToUse.IteratorVariableName}.MoveNext();{Environment.NewLine}"); + writer.WriteSafeString($"stringBuilder.Append(\" {terminalElement.Value} \");"); } - - writer.WriteSafeString($"{Environment.NewLine}if({iteratorToUse.IteratorVariableName}.Current != null){Environment.NewLine}"); - writer.WriteSafeString($"{{{Environment.NewLine}"); - writer.WriteSafeString($"stringBuilder.Append({iteratorToUse.IteratorVariableName}.Current.qualifiedName);{Environment.NewLine}"); - writer.WriteSafeString("}"); } else { - writer.WriteSafeString("throw new System.NotSupportedException(\"Assigment of enumerable with non NonTerminalElement not supported yet\");"); + writer.WriteSafeString($"stringBuilder.Append(poco.{targetPropertyName}.ToString().ToLower());"); } } - else + else if (targetProperty.QueryIsEnum()) { - 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 + writer.WriteSafeString($"stringBuilder.Append(poco.{targetPropertyName}.ToString().ToLower());"); + } + else if(targetProperty.QueryIsReferenceProperty()) + { + switch (assignmentElement.Value) { - var targetPropertyName = targetProperty.QueryPropertyNameBasedOnUmlProperties(); - - if (targetProperty.QueryIsString()) + case NonTerminalElement nonTerminalElement: { - writer.WriteSafeString($"stringBuilder.Append(poco.{targetPropertyName});"); + var previousCaller = ruleGenerationContext.CallerRule; + ruleGenerationContext.CallerRule = nonTerminalElement; + ProcessNonTerminalElement(writer, targetProperty.Type as IClass, nonTerminalElement, $"poco.{targetPropertyName}", ruleGenerationContext); + ruleGenerationContext.CallerRule = previousCaller; + break; } - else if (targetProperty.QueryIsBool()) - { - if (assignmentElement.Value is TerminalElement terminalElement) + case ValueLiteralElement valueLiteralElement when valueLiteralElement.QueryIsQualifiedName(): + if (isPartOfMultipleAlternative) { - writer.WriteSafeString($"stringBuilder.Append(\"{terminalElement.Value}\");"); + writer.WriteSafeString($"stringBuilder.Append(poco.{targetPropertyName}.qualifiedName);{Environment.NewLine}"); + writer.WriteSafeString("stringBuilder.Append(' ');"); } 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; + 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}}}"); } - } - else - { - writer.WriteSafeString($"stringBuilder.Append(poco.{targetPropertyName}.ToString());"); - } + + 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"); + } + } + else + { + writer.WriteSafeString($"Build{assignmentElement.Property.CapitalizeFirstLetter()}(poco, stringBuilder);"); } - - writer.WriteSafeString(Environment.NewLine); } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssertConstraintUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssertConstraintUsageTextualNotationBuilder.cs index f21db1ea..b970704c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssertConstraintUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssertConstraintUsageTextualNotationBuilder.cs @@ -48,7 +48,7 @@ public static void BuildAssertConstraintUsage(SysML2.NET.Core.POCO.Systems.Const if (poco.IsNegated) { - stringBuilder.Append("not"); + stringBuilder.Append(" not "); stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs index 00001785..7aadbfdd 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs @@ -76,7 +76,7 @@ public static void BuildClassifierDeclaration(SysML2.NET.Core.POCO.Core.Classifi if (poco.IsSufficient) { - stringBuilder.Append("all"); + stringBuilder.Append(" all "); stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DecisionNodeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DecisionNodeTextualNotationBuilder.cs index 3f8b633b..303a7fce 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DecisionNodeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DecisionNodeTextualNotationBuilder.cs @@ -43,7 +43,10 @@ public static partial class DecisionNodeTextualNotationBuilder public static void BuildDecisionNode(SysML2.NET.Core.POCO.Systems.Actions.IDecisionNode poco, StringBuilder stringBuilder) { OccurrenceUsageTextualNotationBuilder.BuildControlNodePrefix(poco, stringBuilder); - stringBuilder.Append("decide"); + if (poco.IsComposite) + { + stringBuilder.Append(" decide "); + } UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs index 9379af5b..a6f44863 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs @@ -60,7 +60,15 @@ public static void BuildDefinitionExtensionKeyword(SysML2.NET.Core.POCO.Systems. /// 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 with only AssignmentElement not implemented yet"); + if (poco.IsAbstract) + { + stringBuilder.Append(" abstract "); + } + else if (poco.IsVariation) + { + stringBuilder.Append(" variation "); + } + BuildDefinitionExtensionKeyword(poco, stringBuilder); } @@ -86,7 +94,15 @@ public static void BuildDefinitionDeclaration(SysML2.NET.Core.POCO.Systems.Defin /// 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 with only AssignmentElement not implemented yet"); + if (poco.IsAbstract) + { + stringBuilder.Append(" abstract "); + } + else if (poco.IsVariation) + { + stringBuilder.Append(" variation "); + } + BuildDefinitionExtensionKeyword(poco, stringBuilder); stringBuilder.Append("def "); BuildDefinition(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DifferencingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DifferencingTextualNotationBuilder.cs index 7c58a022..8ef24835 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DifferencingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DifferencingTextualNotationBuilder.cs @@ -42,7 +42,21 @@ public static partial class DifferencingTextualNotationBuilder /// 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 with only AssignmentElement not implemented yet"); + using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + if (poco.DifferencingType != null) + { + stringBuilder.Append(poco.DifferencingType.qualifiedName); + stringBuilder.Append(' '); + } + else if (ownedRelatedElementOfFeatureIterator.MoveNext()) + { + + if (ownedRelatedElementOfFeatureIterator.Current != null) + { + FeatureTextualNotationBuilder.BuildOwnedFeatureChain(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + } + } + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs index 49e407dc..218a04f0 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs @@ -462,12 +462,15 @@ public static void BuildEndFeaturePrefix(SysML2.NET.Core.POCO.Core.Features.IFea if (poco.IsConstant) { - stringBuilder.Append("const"); + stringBuilder.Append(" const "); // NonParsing Assignment Element : isVariable = true => Does not have to be process stringBuilder.Append(' '); } - stringBuilder.Append("end"); + if (poco.IsEnd) + { + stringBuilder.Append(" end "); + } } @@ -489,18 +492,26 @@ public static void BuildBasicFeaturePrefix(SysML2.NET.Core.POCO.Core.Features.IF if (poco.IsDerived) { - stringBuilder.Append("derived"); + stringBuilder.Append(" derived "); stringBuilder.Append(' '); } if (poco.IsAbstract) { - stringBuilder.Append("abstract"); + stringBuilder.Append(" abstract "); stringBuilder.Append(' '); } - throw new System.NotSupportedException("Multiple alternatives with only AssignmentElement not implemented yet"); + if (poco.IsComposite) + { + stringBuilder.Append(" composite "); + } + else if (poco.IsPortion) + { + stringBuilder.Append(" portion "); + } + throw new System.NotSupportedException("Multiple alternatives not implemented yet"); } @@ -516,7 +527,7 @@ public static void BuildFeatureDeclaration(SysML2.NET.Core.POCO.Core.Features.IF if (poco.IsSufficient) { - stringBuilder.Append("all"); + stringBuilder.Append(" all "); stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForkNodeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForkNodeTextualNotationBuilder.cs index 0c8f6cd0..2faff843 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForkNodeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForkNodeTextualNotationBuilder.cs @@ -43,7 +43,10 @@ public static partial class ForkNodeTextualNotationBuilder public static void BuildForkNode(SysML2.NET.Core.POCO.Systems.Actions.IForkNode poco, StringBuilder stringBuilder) { OccurrenceUsageTextualNotationBuilder.BuildControlNodePrefix(poco, stringBuilder); - stringBuilder.Append("fork"); + if (poco.IsComposite) + { + stringBuilder.Append(" fork "); + } UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ImportTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ImportTextualNotationBuilder.cs index 4a7e1fb1..eec9b291 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ImportTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ImportTextualNotationBuilder.cs @@ -67,7 +67,7 @@ public static void BuildImport(SysML2.NET.Core.POCO.Root.Namespaces.IImport poco if (poco.IsImportAll) { - stringBuilder.Append("all"); + stringBuilder.Append(" all "); stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IntersectingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IntersectingTextualNotationBuilder.cs index 32b47164..132cc870 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IntersectingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IntersectingTextualNotationBuilder.cs @@ -42,7 +42,21 @@ public static partial class IntersectingTextualNotationBuilder /// 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 with only AssignmentElement not implemented yet"); + using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + if (poco.IntersectingType != null) + { + stringBuilder.Append(poco.IntersectingType.qualifiedName); + stringBuilder.Append(' '); + } + else if (ownedRelatedElementOfFeatureIterator.MoveNext()) + { + + if (ownedRelatedElementOfFeatureIterator.Current != null) + { + FeatureTextualNotationBuilder.BuildOwnedFeatureChain(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + } + } + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/JoinNodeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/JoinNodeTextualNotationBuilder.cs index e17813d2..1755fd7a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/JoinNodeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/JoinNodeTextualNotationBuilder.cs @@ -43,7 +43,10 @@ public static partial class JoinNodeTextualNotationBuilder public static void BuildJoinNode(SysML2.NET.Core.POCO.Systems.Actions.IJoinNode poco, StringBuilder stringBuilder) { OccurrenceUsageTextualNotationBuilder.BuildControlNodePrefix(poco, stringBuilder); - stringBuilder.Append("join"); + if (poco.IsComposite) + { + stringBuilder.Append(" join "); + } UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LibraryPackageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LibraryPackageTextualNotationBuilder.cs index da98b0fe..9273a246 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LibraryPackageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LibraryPackageTextualNotationBuilder.cs @@ -43,7 +43,7 @@ public static partial class LibraryPackageTextualNotationBuilder 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(" standard "); stringBuilder.Append(' '); stringBuilder.Append("library "); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.cs index 253583cf..f9cf6028 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.cs @@ -52,7 +52,7 @@ public static void BuildMembershipImport(SysML2.NET.Core.POCO.Root.Namespaces.IM if (poco.IsRecursive) { stringBuilder.Append(":: "); - stringBuilder.Append("**"); + stringBuilder.Append(" ** "); stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MergeNodeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MergeNodeTextualNotationBuilder.cs index d499a57c..d1084bc7 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MergeNodeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MergeNodeTextualNotationBuilder.cs @@ -43,7 +43,10 @@ public static partial class MergeNodeTextualNotationBuilder public static void BuildMergeNode(SysML2.NET.Core.POCO.Systems.Actions.IMergeNode poco, StringBuilder stringBuilder) { OccurrenceUsageTextualNotationBuilder.BuildControlNodePrefix(poco, stringBuilder); - stringBuilder.Append("merge"); + if (poco.IsComposite) + { + stringBuilder.Append(" merge "); + } UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.cs index 191d4268..a4964d3c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.cs @@ -45,7 +45,7 @@ public static void BuildMetadataDefinition(SysML2.NET.Core.POCO.Systems.Metadata if (poco.IsAbstract) { - stringBuilder.Append("abstract"); + stringBuilder.Append(" abstract "); stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs index b80881ac..fd65b05a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs @@ -42,7 +42,25 @@ public static partial class NamespaceTextualNotationBuilder /// 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 with only AssignmentElement not implemented yet"); + foreach (var elementInOwnedRelationship in poco.OwnedRelationship) + { + switch (elementInOwnedRelationship) + { + case SysML2.NET.Core.POCO.Kernel.Packages.ElementFilterMembership elementFilterMembership: + ElementFilterMembershipTextualNotationBuilder.BuildElementFilterMember(elementFilterMembership, stringBuilder); + break; + case SysML2.NET.Core.POCO.Root.Namespaces.OwningMembership owningMembership: + OwningMembershipTextualNotationBuilder.BuildPackageMember(owningMembership, stringBuilder); + break; + case SysML2.NET.Core.POCO.Root.Namespaces.Membership membership: + MembershipTextualNotationBuilder.BuildAliasMember(membership, stringBuilder); + break; + case SysML2.NET.Core.POCO.Root.Namespaces.IImport import: + ImportTextualNotationBuilder.BuildImport(import, stringBuilder); + break; + } + } + } @@ -78,7 +96,22 @@ public static void BuildNamespaceBody(SysML2.NET.Core.POCO.Root.Namespaces.IName /// 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 with only AssignmentElement not implemented yet"); + foreach (var elementInOwnedRelationship in poco.OwnedRelationship) + { + switch (elementInOwnedRelationship) + { + case SysML2.NET.Core.POCO.Root.Namespaces.OwningMembership owningMembership: + OwningMembershipTextualNotationBuilder.BuildNamespaceMember(owningMembership, stringBuilder); + break; + case SysML2.NET.Core.POCO.Root.Namespaces.Membership membership: + MembershipTextualNotationBuilder.BuildAliasMember(membership, stringBuilder); + break; + case SysML2.NET.Core.POCO.Root.Namespaces.IImport import: + ImportTextualNotationBuilder.BuildImport(import, stringBuilder); + break; + } + } + } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs index 3ac9da78..603a7477 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs @@ -43,11 +43,19 @@ public static partial class OccurrenceDefinitionTextualNotationBuilder 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 with only AssignmentElement not implemented yet"); + if (poco.IsAbstract) + { + stringBuilder.Append(" abstract "); + } + else if (poco.IsVariation) + { + stringBuilder.Append(" variation "); + } + if (poco.IsIndividual && ownedRelationshipOfOwningMembershipIterator.MoveNext()) { - stringBuilder.Append("individual"); + stringBuilder.Append(" individual "); if (ownedRelationshipOfOwningMembershipIterator.Current != null) { @@ -69,8 +77,19 @@ public static void BuildOccurrenceDefinitionPrefix(SysML2.NET.Core.POCO.Systems. 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 with only AssignmentElement not implemented yet"); - stringBuilder.Append("individual"); + if (poco.IsAbstract) + { + stringBuilder.Append(" abstract "); + } + else if (poco.IsVariation) + { + stringBuilder.Append(" variation "); + } + + if (poco.IsIndividual) + { + stringBuilder.Append(" individual "); + } DefinitionTextualNotationBuilder.BuildDefinitionExtensionKeyword(poco, stringBuilder); stringBuilder.Append("def "); DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs index 56dbad97..e602a83b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs @@ -46,7 +46,7 @@ public static void BuildOccurrenceUsagePrefix(SysML2.NET.Core.POCO.Systems.Occur if (poco.IsIndividual) { - stringBuilder.Append("individual"); + stringBuilder.Append(" individual "); stringBuilder.Append(' '); } @@ -71,7 +71,10 @@ public static void BuildOccurrenceUsagePrefix(SysML2.NET.Core.POCO.Systems.Occur public static void BuildIndividualUsage(SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceUsage poco, StringBuilder stringBuilder) { UsageTextualNotationBuilder.BuildBasicUsagePrefix(poco, stringBuilder); - stringBuilder.Append("individual"); + if (poco.IsIndividual) + { + stringBuilder.Append(" individual "); + } UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, stringBuilder); UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); @@ -89,7 +92,7 @@ public static void BuildPortionUsage(SysML2.NET.Core.POCO.Systems.Occurrences.IO if (poco.IsIndividual) { - stringBuilder.Append("individual"); + stringBuilder.Append(" individual "); stringBuilder.Append(' '); } @@ -112,7 +115,7 @@ public static void BuildControlNodePrefix(SysML2.NET.Core.POCO.Systems.Occurrenc if (poco.IsIndividual) { - stringBuilder.Append("individual"); + stringBuilder.Append(" individual "); stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs index 812fcbf0..a021cac6 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs @@ -63,7 +63,22 @@ public static void BuildPackageMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwni using var ownedRelatedElementIterator = poco.OwnedRelatedElement.GetEnumerator(); using var ownedRelatedElementOfUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - throw new System.NotSupportedException("Multiple alternatives with only AssignmentElement not implemented yet"); + using var iterator = SysML2.NET.Extensions.EnumerableExtensions.GetElementsOfType(poco.OwnedRelatedElement, typeof(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.Usage), typeof(SysML2.NET.Core.POCO.Root.Elements.IElement)).GetEnumerator(); + iterator.MoveNext(); + + if (iterator.Current != null) + { + switch (iterator.Current) + { + case SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.Usage usage: + UsageTextualNotationBuilder.BuildUsageElement(usage, stringBuilder); + break; + case { } element: + ElementTextualNotationBuilder.BuildDefinitionElement(element, stringBuilder); + break; + } + } + stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs index a4b3d9f2..dd79d421 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs @@ -66,7 +66,25 @@ public static void BuildPackageBody(SysML2.NET.Core.POCO.Kernel.Packages.IPackag /// 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 with only AssignmentElement not implemented yet"); + foreach (var elementInOwnedRelationship in poco.OwnedRelationship) + { + switch (elementInOwnedRelationship) + { + case SysML2.NET.Core.POCO.Kernel.Packages.ElementFilterMembership elementFilterMembership: + ElementFilterMembershipTextualNotationBuilder.BuildElementFilterMember(elementFilterMembership, stringBuilder); + break; + case SysML2.NET.Core.POCO.Root.Namespaces.OwningMembership owningMembership: + OwningMembershipTextualNotationBuilder.BuildPackageMember(owningMembership, stringBuilder); + break; + case SysML2.NET.Core.POCO.Root.Namespaces.Membership membership: + MembershipTextualNotationBuilder.BuildAliasMember(membership, stringBuilder); + break; + case SysML2.NET.Core.POCO.Root.Namespaces.IImport import: + ImportTextualNotationBuilder.BuildImport(import, stringBuilder); + break; + } + } + } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs index 3ea3a6d1..beda5456 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs @@ -42,7 +42,10 @@ public static partial class PortUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildDefaultInterfaceEnd(SysML2.NET.Core.POCO.Systems.Ports.IPortUsage poco, StringBuilder stringBuilder) { - stringBuilder.Append("end"); + if (poco.IsEnd) + { + stringBuilder.Append(" end "); + } UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RelationshipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RelationshipTextualNotationBuilder.cs index 18377280..9b8a7c1e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RelationshipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RelationshipTextualNotationBuilder.cs @@ -53,7 +53,25 @@ public static void BuildRelationshipBody(SysML2.NET.Core.POCO.Root.Elements.IRel /// 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 with only AssignmentElement not implemented yet"); + using var ownedRelatedElementIterator = poco.OwnedRelatedElement.GetEnumerator(); + using var ownedRelationshipOfAnnotationIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + if (ownedRelatedElementIterator.MoveNext()) + { + + if (ownedRelatedElementIterator.Current != null) + { + ElementTextualNotationBuilder.BuildOwnedRelatedElement(ownedRelatedElementIterator.Current, stringBuilder); + } + } + else if (ownedRelationshipOfAnnotationIterator.MoveNext()) + { + + if (ownedRelationshipOfAnnotationIterator.Current != null) + { + AnnotationTextualNotationBuilder.BuildOwnedAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + } + } + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.cs index 20dab291..e21f0e77 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.cs @@ -46,7 +46,7 @@ public static void BuildSatisfyRequirementUsage(SysML2.NET.Core.POCO.Systems.Req using var ownedRelationshipOfSubjectMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("assert "); - stringBuilder.Append("not"); + stringBuilder.Append(" not "); stringBuilder.Append(' '); stringBuilder.Append("satisfy "); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs index dfb786bc..c0f25b79 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs @@ -224,7 +224,7 @@ public static void BuildTypePrefix(SysML2.NET.Core.POCO.Core.Types.IType poco, S if (poco.IsAbstract) { - stringBuilder.Append("abstract"); + stringBuilder.Append(" abstract "); stringBuilder.Append(' '); } @@ -253,7 +253,7 @@ public static void BuildTypeDeclaration(SysML2.NET.Core.POCO.Core.Types.IType po if (poco.IsSufficient) { - stringBuilder.Append("all"); + stringBuilder.Append(" all "); stringBuilder.Append(' '); } @@ -477,7 +477,7 @@ public static void BuildTypeBody(SysML2.NET.Core.POCO.Core.Types.IType poco, Str /// 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 with only AssignmentElement not implemented yet"); + BuildTypeBodyElementAlternatives(poco, stringBuilder); } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UnioningTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UnioningTextualNotationBuilder.cs index 49175bea..7176ac25 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UnioningTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UnioningTextualNotationBuilder.cs @@ -42,7 +42,21 @@ public static partial class UnioningTextualNotationBuilder /// 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 with only AssignmentElement not implemented yet"); + using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + if (poco.UnioningType != null) + { + stringBuilder.Append(poco.UnioningType.qualifiedName); + stringBuilder.Append(' '); + } + else if (ownedRelatedElementOfFeatureIterator.MoveNext()) + { + + if (ownedRelatedElementOfFeatureIterator.Current != null) + { + FeatureTextualNotationBuilder.BuildOwnedFeatureChain(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + } + } + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs index e4e29d0c..6a0fb4a1 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs @@ -63,15 +63,23 @@ public static void BuildRefPrefix(SysML2.NET.Core.POCO.Systems.DefinitionAndUsag if (poco.IsDerived) { - stringBuilder.Append("derived"); + stringBuilder.Append(" derived "); stringBuilder.Append(' '); } - throw new System.NotSupportedException("Multiple alternatives with only AssignmentElement not implemented yet"); + if (poco.IsAbstract) + { + stringBuilder.Append(" abstract "); + } + else if (poco.IsVariation) + { + stringBuilder.Append(" variation "); + } + if (poco.IsConstant) { - stringBuilder.Append("constant"); + stringBuilder.Append(" constant "); stringBuilder.Append(' '); } @@ -90,7 +98,7 @@ public static void BuildBasicUsagePrefix(SysML2.NET.Core.POCO.Systems.Definition if (poco.isReference) { - stringBuilder.Append("ref"); + stringBuilder.Append(" ref "); stringBuilder.Append(' '); } @@ -106,7 +114,10 @@ public static void BuildBasicUsagePrefix(SysML2.NET.Core.POCO.Systems.Definition 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 (poco.IsEnd) + { + stringBuilder.Append(" end "); + } if (ownedRelationshipOfOwningMembershipIterator.MoveNext()) { diff --git a/SysML2.NET/TextualNotation/TypeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/TypeTextualNotationBuilder.cs new file mode 100644 index 00000000..a4738311 --- /dev/null +++ b/SysML2.NET/TextualNotation/TypeTextualNotationBuilder.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. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Text; + + using SysML2.NET.Core.POCO.Core.Types; + using SysML2.NET.Core.POCO.Root.Namespaces; + + /// + /// Hand-coded part of the + /// + public static partial class TypeTextualNotationBuilder + { + /// + /// Build the TypeBodyElement alternatives part since used NonTerminal target same type + /// + /// The + /// The + private static void BuildTypeBodyElementAlternatives(IType poco, StringBuilder stringBuilder) + { + foreach (var ownedRelationship in poco.OwnedRelationship) + { + switch (ownedRelationship) + { + case OwningMembership owningMembership: + OwningMembershipTextualNotationBuilder.BuildNonFeatureMember(owningMembership, stringBuilder); + break; + case FeatureMembership featureMembership: + OwningMembershipTextualNotationBuilder.BuildFeatureMember(featureMembership, stringBuilder); + break; + case Membership membership: + MembershipTextualNotationBuilder.BuildAliasMember(membership, stringBuilder); + break; + case IImport import: + ImportTextualNotationBuilder.BuildImport(import, stringBuilder); + break; + } + } + } + } +} From 4aea7c68afa6227ab81598d6cfb7fce594c58c98 Mon Sep 17 00:00:00 2001 From: atheate Date: Thu, 12 Mar 2026 11:01:16 +0100 Subject: [PATCH 21/33] [WIP] Supports Alternative with Assignment|NonTerminalElement --- .../HandleBarHelpers/RulesHelper.cs | 117 +++++++++++++----- .../FeatureTextualNotationBuilder.cs | 14 ++- .../MembershipTextualNotationBuilder.cs | 39 +++++- 3 files changed, 137 insertions(+), 33 deletions(-) diff --git a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs index 5001ba0d..f3778fa9 100644 --- a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs +++ b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs @@ -70,7 +70,11 @@ public static void RegisterRulesHelper(this IHandlebars handlebars) if (namedElement is IClass umlClass) { - var ruleGenerationContext = new RuleGenerationContext(namedElement); + var ruleGenerationContext = new RuleGenerationContext(namedElement) + { + CurrentVariableName = "poco" + }; + ruleGenerationContext.AllRules.AddRange(allRules); ProcessAlternatives(writer, umlClass, textualRule.Alternatives, ruleGenerationContext); } @@ -84,7 +88,8 @@ public static void RegisterRulesHelper(this IHandlebars handlebars) /// The related /// The collection of alternatives to process /// The current - private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClass, IReadOnlyCollection alternatives, RuleGenerationContext ruleGenerationContext) + /// Asserts that the current is part of a multiple alternative process + private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClass, IReadOnlyCollection alternatives, RuleGenerationContext ruleGenerationContext, bool isPartOfMultipleAlternative = false) { ruleGenerationContext.DefinedIterators ??= []; @@ -152,7 +157,7 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas foreach (var textualRuleElement in elements) { var previousCaller = ruleGenerationContext.CallerRule; - ProcessRuleElement(writer, umlClass, textualRuleElement, ruleGenerationContext); + ProcessRuleElement(writer, umlClass, textualRuleElement, ruleGenerationContext, isPartOfMultipleAlternative); ruleGenerationContext.CallerRule = previousCaller; } } @@ -169,8 +174,38 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas } else { - - writer.WriteSafeString($"throw new System.NotSupportedException(\"Multiple alternatives with only one of the different type not implemented yet - {string.Join(',', types.Select(x => x.Name))}\");"); + if (alternatives.ElementAt(0).Elements[0] is AssignmentElement assignmentElement && alternatives.ElementAt(1).Elements[0] is NonTerminalElement nonTerminalElement) + { + var targetProperty = umlClass.QueryAllProperties().Single(x => string.Equals(x.Name, assignmentElement.Property)); + + if (targetProperty.QueryIsEnumerable()) + { + DeclareAllRequiredIterators(writer, umlClass, alternatives.ElementAt(0), ruleGenerationContext); + + var iterator = ruleGenerationContext.DefinedIterators.Single(x => x.ApplicableRuleElements.Contains(assignmentElement)); + + writer.WriteSafeString($"{Environment.NewLine}if({targetProperty.QueryIfStatementContentForNonEmpty(iterator.IteratorVariableName)}){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + } + else + { + writer.WriteSafeString($"{Environment.NewLine}if({targetProperty.QueryIfStatementContentForNonEmpty("poco")}){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + } + + ProcessAssignmentElement(writer, umlClass, ruleGenerationContext, assignmentElement, true); + + writer.WriteSafeString($"{Environment.NewLine}}}"); + + writer.WriteSafeString($"else{Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + ProcessNonTerminalElement(writer, umlClass, nonTerminalElement, ruleGenerationContext); + writer.WriteSafeString($"{Environment.NewLine}}}"); + } + else + { + writer.WriteSafeString($"throw new System.NotSupportedException(\"Multiple alternatives with only one of the different type not implemented yet - {string.Join(',', types.Select(x => x.Name))}\");"); + } } } else @@ -221,17 +256,22 @@ private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter foreach (var orderedNonTerminalElement in mappedNonTerminalElements) { + var previousVariableName = ruleGenerationContext.CurrentVariableName; + if (orderedNonTerminalElement.UmlClass == ruleGenerationContext.NamedElementToGenerate) { writer.WriteSafeString($"default:{Environment.NewLine}"); - ProcessNonTerminalElement(writer, orderedNonTerminalElement.UmlClass, orderedNonTerminalElement.RuleElement, variableName, ruleGenerationContext); + ruleGenerationContext.CurrentVariableName = variableName; + ProcessNonTerminalElement(writer, orderedNonTerminalElement.UmlClass, orderedNonTerminalElement.RuleElement, ruleGenerationContext); } else { writer.WriteSafeString($"case {orderedNonTerminalElement.UmlClass.QueryFullyQualifiedTypeName(targetInterface: orderedNonTerminalElement.UmlClass.IsAbstract)} poco{orderedNonTerminalElement.UmlClass.Name}:{Environment.NewLine}"); - ProcessNonTerminalElement(writer, orderedNonTerminalElement.UmlClass, orderedNonTerminalElement.RuleElement, $"poco{orderedNonTerminalElement.UmlClass.Name}", ruleGenerationContext); + ruleGenerationContext.CurrentVariableName = $"poco{orderedNonTerminalElement.UmlClass.Name}"; + ProcessNonTerminalElement(writer, orderedNonTerminalElement.UmlClass, orderedNonTerminalElement.RuleElement, ruleGenerationContext); } + ruleGenerationContext.CurrentVariableName = previousVariableName; writer.WriteSafeString($"{Environment.NewLine}break;{Environment.NewLine}"); } @@ -265,7 +305,10 @@ private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter foreach (var orderedElement in orderElementsByInheritance) { writer.WriteSafeString($"case {orderedElement.UmlClass.QueryFullyQualifiedTypeName(targetInterface:orderedElement.UmlClass.IsAbstract)} {orderedElement.UmlClass.Name.LowerCaseFirstLetter()}:{Environment.NewLine}"); - ProcessNonTerminalElement(writer, orderedElement.UmlClass, orderedElement.RuleElement, orderedElement.UmlClass.Name.LowerCaseFirstLetter(), ruleGenerationContext); + var previousVariableName = ruleGenerationContext.CurrentVariableName; + ruleGenerationContext.CurrentVariableName = orderedElement.UmlClass.Name.LowerCaseFirstLetter(); + ProcessNonTerminalElement(writer, orderedElement.UmlClass, orderedElement.RuleElement, ruleGenerationContext); + ruleGenerationContext.CurrentVariableName = previousVariableName; writer.WriteSafeString($"{Environment.NewLine}break;{Environment.NewLine}"); } @@ -295,7 +338,10 @@ private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter writer.WriteSafeString($"case {orderedElement.UmlClass.QueryFullyQualifiedTypeName(targetInterface:orderedElement.UmlClass.IsAbstract)} {orderedElement.UmlClass.Name.LowerCaseFirstLetter()}:{Environment.NewLine}"); } - ProcessNonTerminalElement(writer, orderedElement.UmlClass, orderedElement.RuleElement, orderedElement.UmlClass.Name.LowerCaseFirstLetter(), ruleGenerationContext); + var previousVariableName = ruleGenerationContext.CurrentVariableName; + ruleGenerationContext.CurrentVariableName = orderedElement.UmlClass.Name.LowerCaseFirstLetter(); + ProcessNonTerminalElement(writer, orderedElement.UmlClass, orderedElement.RuleElement, ruleGenerationContext); + ruleGenerationContext.CurrentVariableName = previousVariableName; writer.WriteSafeString($"{Environment.NewLine}break;{Environment.NewLine}"); } @@ -414,8 +460,9 @@ private static void DeclareAllRequiredIterators(EncodedTextWriter writer, IClass /// The related /// The to process /// The current + /// /// If the type of the is not supported - private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass, RuleElement textualRuleElement, RuleGenerationContext ruleGenerationContext) + private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass, RuleElement textualRuleElement, RuleGenerationContext ruleGenerationContext, bool isPartOfMultipleAlternative = false) { switch (textualRuleElement) { @@ -434,13 +481,15 @@ private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass { 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); + ruleGenerationContext.CurrentVariableName = assignedProperty == null ? "poco" : $"poco.{assignedProperty.QueryPropertyNameBasedOnUmlProperties()}"; } else { - ProcessNonTerminalElement(writer, umlClass, nonTerminalElement, "poco", ruleGenerationContext); + ruleGenerationContext.CurrentVariableName = "poco"; } + ProcessNonTerminalElement(writer, umlClass, nonTerminalElement,ruleGenerationContext, isPartOfMultipleAlternative); + break; case GroupElement groupElement: ruleGenerationContext.CallerRule = groupElement ; @@ -471,7 +520,7 @@ private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass break; case AssignmentElement assignmentElement: - ProcessAssignmentElement(writer, umlClass, ruleGenerationContext, assignmentElement); + ProcessAssignmentElement(writer, umlClass, ruleGenerationContext, assignmentElement, isPartOfMultipleAlternative); break; case NonParsingAssignmentElement nonParsingAssignmentElement: writer.WriteSafeString($"// NonParsing Assignment Element : {nonParsingAssignmentElement.PropertyName} {nonParsingAssignmentElement.Operator} {nonParsingAssignmentElement.Value} => Does not have to be process"); @@ -479,7 +528,7 @@ private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass case ValueLiteralElement valueLiteralElement: if (valueLiteralElement.QueryIsQualifiedName()) { - writer.WriteSafeString($"stringBuilder.Append(poco.qualifiedName);{Environment.NewLine}"); + writer.WriteSafeString($"stringBuilder.Append({ruleGenerationContext.CurrentVariableName}.qualifiedName);{Environment.NewLine}"); writer.WriteSafeString("stringBuilder.Append(' ');"); } else @@ -502,7 +551,7 @@ private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass /// The related /// The to process /// The current - /// + /// Asserts that the current is part of a multiple alternative process private static void ProcessAssignmentElement(EncodedTextWriter writer, IClass umlClass, RuleGenerationContext ruleGenerationContext, AssignmentElement assignmentElement, bool isPartOfMultipleAlternative = false) { var properties = umlClass.QueryAllProperties(); @@ -521,7 +570,10 @@ private static void ProcessAssignmentElement(EncodedTextWriter writer, IClass um writer.WriteSafeString($"{iteratorToUse.IteratorVariableName}.MoveNext();{Environment.NewLine}"); } - ProcessNonTerminalElement(writer, umlClass, nonTerminalElement, $"{iteratorToUse.IteratorVariableName}.Current", ruleGenerationContext); + var previousVariableName = ruleGenerationContext.CurrentVariableName; + ruleGenerationContext.CurrentVariableName = $"{iteratorToUse.IteratorVariableName}.Current"; + ProcessNonTerminalElement(writer, umlClass, nonTerminalElement, ruleGenerationContext); + ruleGenerationContext.CurrentVariableName = previousVariableName; } else if(assignmentElement.Value is GroupElement groupElement) { @@ -599,7 +651,9 @@ private static void ProcessAssignmentElement(EncodedTextWriter writer, IClass um { var previousCaller = ruleGenerationContext.CallerRule; ruleGenerationContext.CallerRule = nonTerminalElement; - ProcessNonTerminalElement(writer, targetProperty.Type as IClass, nonTerminalElement, $"poco.{targetPropertyName}", ruleGenerationContext); + ruleGenerationContext.CurrentVariableName = $"poco.{targetPropertyName}"; + ProcessNonTerminalElement(writer, targetProperty.Type as IClass, nonTerminalElement, ruleGenerationContext, isPartOfMultipleAlternative); + ruleGenerationContext.CurrentVariableName = "poco"; ruleGenerationContext.CallerRule = previousCaller; break; } @@ -643,9 +697,9 @@ private static void ProcessAssignmentElement(EncodedTextWriter writer, IClass um /// 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) + /// The current + /// Asserts that the current is part of a multiple alternative process + private static void ProcessNonTerminalElement(EncodedTextWriter writer, IClass umlClass, NonTerminalElement nonTerminalElement, RuleGenerationContext ruleGenerationContext, bool isPartOfMultipleAlternative = false) { var referencedRule = ruleGenerationContext.AllRules.SingleOrDefault(x => x.RuleName == nonTerminalElement.Name); @@ -660,11 +714,11 @@ private static void ProcessNonTerminalElement(EncodedTextWriter writer, IClass u typeTarget = referencedRule.TargetElementName ?? referencedRule.RuleName; } - var isForProperty = variableName.Contains('.'); + var isForProperty = ruleGenerationContext.CurrentVariableName.Contains('.'); - if (isForProperty) + if (isForProperty && !isPartOfMultipleAlternative) { - writer.WriteSafeString($"{Environment.NewLine}if ({variableName} != null){Environment.NewLine}"); + writer.WriteSafeString($"{Environment.NewLine}if ({ruleGenerationContext.CurrentVariableName} != null){Environment.NewLine}"); writer.WriteSafeString($"{{{Environment.NewLine}"); } @@ -674,15 +728,15 @@ private static void ProcessNonTerminalElement(EncodedTextWriter writer, IClass u if (targetType != null) { - if (targetType is IClass targetClass && (umlClass.QueryAllGeneralClassifiers().Contains(targetClass) || !variableName.Contains("poco"))) + if (targetType is IClass targetClass && (umlClass.QueryAllGeneralClassifiers().Contains(targetClass) || !ruleGenerationContext.CurrentVariableName.Contains("poco"))) { - writer.WriteSafeString($"{targetType.Name}TextualNotationBuilder.Build{nonTerminalElement.Name}({variableName}, stringBuilder);"); + writer.WriteSafeString($"{targetType.Name}TextualNotationBuilder.Build{nonTerminalElement.Name}({ruleGenerationContext.CurrentVariableName}, stringBuilder);"); } else { var previousCaller = ruleGenerationContext.CallerRule; ruleGenerationContext.CallerRule = nonTerminalElement; - ProcessAlternatives(writer, umlClass, referencedRule?.Alternatives, ruleGenerationContext); + ProcessAlternatives(writer, umlClass, referencedRule?.Alternatives, ruleGenerationContext, isPartOfMultipleAlternative); ruleGenerationContext.CallerRule = previousCaller; } } @@ -690,16 +744,16 @@ private static void ProcessNonTerminalElement(EncodedTextWriter writer, IClass u { var previousCaller = ruleGenerationContext.CallerRule; ruleGenerationContext.CallerRule = nonTerminalElement; - ProcessAlternatives(writer, umlClass, referencedRule?.Alternatives, ruleGenerationContext); + ProcessAlternatives(writer, umlClass, referencedRule?.Alternatives, ruleGenerationContext, isPartOfMultipleAlternative); ruleGenerationContext.CallerRule = previousCaller; } } else { - writer.WriteSafeString($"Build{ nonTerminalElement.Name}({variableName}, stringBuilder);"); + writer.WriteSafeString($"Build{ nonTerminalElement.Name}({ruleGenerationContext.CurrentVariableName}, stringBuilder);"); } - if (isForProperty) + if (isForProperty && !isPartOfMultipleAlternative) { writer.WriteSafeString($"{Environment.NewLine}}}"); } @@ -935,6 +989,11 @@ public RuleGenerationContext(INamedElement namedElementToGenerate) /// Gets the that is used in the current generation /// public INamedElement NamedElementToGenerate { get; } + + /// + /// Gets or sets the current name of the variable to process + /// + public string CurrentVariableName { get; set; } } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs index 218a04f0..69bd63f4 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs @@ -569,7 +569,19 @@ public static void BuildChainingPart(SysML2.NET.Core.POCO.Core.Features.IFeature { using var ownedRelationshipOfFeatureChainingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); stringBuilder.Append("chains "); - throw new System.NotSupportedException("Multiple alternatives with only one of the different type not implemented yet - AssignmentElement,NonTerminalElement"); + + if (ownedRelationshipOfFeatureChainingIterator.MoveNext()) + { + + if (ownedRelationshipOfFeatureChainingIterator.Current != null) + { + FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(ownedRelationshipOfFeatureChainingIterator.Current, stringBuilder); + } + } + else + { + BuildFeatureChain(poco, stringBuilder); + } stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs index dc05199f..7b88f653 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs @@ -97,7 +97,23 @@ public static void BuildAliasMember(SysML2.NET.Core.POCO.Root.Namespaces.IMember /// 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 with only one of the different type not implemented yet - AssignmentElement,NonTerminalElement"); + + if (poco.MemberElement != null) + { + stringBuilder.Append(poco.MemberElement.qualifiedName); + stringBuilder.Append(' '); + } + else + { + using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfFeatureIterator.MoveNext(); + + if (ownedRelatedElementOfFeatureIterator.Current != null) + { + FeatureTextualNotationBuilder.BuildOwnedFeatureChain(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + } + + } } /// @@ -111,7 +127,7 @@ public static void BuildFeatureReferenceMember(SysML2.NET.Core.POCO.Root.Namespa if (poco.MemberElement != null) { - stringBuilder.Append(poco.qualifiedName); + stringBuilder.Append(poco.MemberElement.qualifiedName); stringBuilder.Append(' '); } @@ -143,7 +159,24 @@ public static void BuildElementReferenceMember(SysML2.NET.Core.POCO.Root.Namespa /// 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 with only one of the different type not implemented yet - AssignmentElement,NonTerminalElement"); + + if (poco.MemberElement != null) + { + stringBuilder.Append(poco.MemberElement.qualifiedName); + stringBuilder.Append(' '); + + } + else + { + using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + ownedRelatedElementOfFeatureIterator.MoveNext(); + + if (ownedRelatedElementOfFeatureIterator.Current != null) + { + FeatureTextualNotationBuilder.BuildOwnedFeatureChain(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + } + + } } /// From b595fcfc6d1d4675297098c2fe305e8d3806bb5c Mon Sep 17 00:00:00 2001 From: atheate Date: Fri, 13 Mar 2026 15:36:08 +0100 Subject: [PATCH 22/33] [WIP] Supports multiple alternatives with NonTerminal & Assignment + Terminal & Assignment --- .../HandleBarHelpers/RulesHelper.cs | 176 ++++++++++++++---- SysML2.NET/Core/Poco/FeatureMembership.cs | 79 ++++++++ SysML2.NET/Core/Poco/OwningMembership.cs | 51 +++++ .../FeatureTextualNotationBuilder.cs | 1 - .../InvariantTextualNotationBuilder.cs | 10 +- ...ocationExpressionTextualNotationBuilder.cs | 21 ++- .../TypeTextualNotationBuilder.cs | 104 ++++++++++- .../ViewDefinitionTextualNotationBuilder.cs | 19 +- .../ViewUsageTextualNotationBuilder.cs | 21 ++- .../TypeTextualNotationBuilder.cs | 129 +++++++++++-- 10 files changed, 540 insertions(+), 71 deletions(-) create mode 100644 SysML2.NET/Core/Poco/FeatureMembership.cs create mode 100644 SysML2.NET/Core/Poco/OwningMembership.cs diff --git a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs index f3778fa9..c7cd6142 100644 --- a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs +++ b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs @@ -174,37 +174,133 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas } else { - if (alternatives.ElementAt(0).Elements[0] is AssignmentElement assignmentElement && alternatives.ElementAt(1).Elements[0] is NonTerminalElement nonTerminalElement) + if (types.SequenceEqual([typeof(AssignmentElement), typeof(NonTerminalElement)])) { - var targetProperty = umlClass.QueryAllProperties().Single(x => string.Equals(x.Name, assignmentElement.Property)); + foreach (var alternative in alternatives) + { + DeclareAllRequiredIterators(writer, umlClass, alternative, ruleGenerationContext); + } - if (targetProperty.QueryIsEnumerable()) + for (var alternativeIndex = 0; alternativeIndex < alternatives.Count; alternativeIndex++) { - DeclareAllRequiredIterators(writer, umlClass, alternatives.ElementAt(0), ruleGenerationContext); + var ruleElement = alternatives.ElementAt(alternativeIndex).Elements[0]; + + if (alternativeIndex != 0) + { + writer.WriteSafeString("else"); + } + + switch (ruleElement) + { + case AssignmentElement assignmentElement: + var targetProperty = umlClass.QueryAllProperties().Single(x => string.Equals(x.Name, assignmentElement.Property)); + + if (alternativeIndex != 0) + { + writer.WriteSafeString(" "); + } + + if (targetProperty.QueryIsEnumerable()) + { + DeclareAllRequiredIterators(writer, umlClass, alternatives.ElementAt(0), ruleGenerationContext); - var iterator = ruleGenerationContext.DefinedIterators.Single(x => x.ApplicableRuleElements.Contains(assignmentElement)); + var iterator = ruleGenerationContext.DefinedIterators.Single(x => x.ApplicableRuleElements.Contains(assignmentElement)); + + writer.WriteSafeString($"if({targetProperty.QueryIfStatementContentForNonEmpty(iterator.IteratorVariableName)}){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + } + else + { + writer.WriteSafeString($"{Environment.NewLine}if({targetProperty.QueryIfStatementContentForNonEmpty("poco")}){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + } + + ProcessAssignmentElement(writer, umlClass, ruleGenerationContext, assignmentElement, true); + + writer.WriteSafeString($"{Environment.NewLine}}}"); + break; + + case NonTerminalElement nonTerminalElement: + writer.WriteSafeString($"{{{Environment.NewLine}"); + ProcessNonTerminalElement(writer, umlClass, nonTerminalElement, ruleGenerationContext); + writer.WriteSafeString($"{Environment.NewLine}}}"); + break; + } + } + } + else if (types.SequenceEqual([typeof(NonTerminalElement), typeof(AssignmentElement)])) + { + var nonTerminalElement = (NonTerminalElement)alternatives.ElementAt(0).Elements[0]; + var assignmentElements = alternatives.SelectMany(x => x.Elements).OfType().ToList(); + + var referencedTerminalElement = assignmentElements.Select(x => x.Value).OfType().ToList(); - writer.WriteSafeString($"{Environment.NewLine}if({targetProperty.QueryIfStatementContentForNonEmpty(iterator.IteratorVariableName)}){Environment.NewLine}"); - writer.WriteSafeString($"{{{Environment.NewLine}"); - } - else + if (referencedTerminalElement.Count != assignmentElements.Count) { - writer.WriteSafeString($"{Environment.NewLine}if({targetProperty.QueryIfStatementContentForNonEmpty("poco")}){Environment.NewLine}"); - writer.WriteSafeString($"{{{Environment.NewLine}"); + writer.WriteSafeString("throw new System.NotSupportedException(\"Assignment Element with something else than NonTerminalElement not supported\");"); + return; } + + referencedTerminalElement.Add(nonTerminalElement); - ProcessAssignmentElement(writer, umlClass, ruleGenerationContext, assignmentElement, true); + var targetProperty = umlClass.QueryAllProperties().Single(x => string.Equals(x.Name, assignmentElements[0].Property)); + + var indexName = $"{targetProperty.Name.LowerCaseFirstLetter()}Index"; + var variableName = targetProperty.Name.LowerCaseFirstLetter(); + var elementName = $"{variableName}Element"; + + writer.WriteSafeString($"var {targetProperty.Name.LowerCaseFirstLetter()} = poco.{targetProperty.QueryPropertyNameBasedOnUmlProperties()}.ToList();{Environment.NewLine}"); + writer.WriteSafeString($"{Environment.NewLine}for(var {indexName} = 0; {indexName} < {variableName}.Count; {indexName}++){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + writer.WriteSafeString($"var {elementName} = {variableName}[{indexName}];{Environment.NewLine}"); + writer.WriteSafeString($"{Environment.NewLine}switch({elementName}){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + + var mappedElements = OrderElementsByInheritance(referencedTerminalElement, umlClass.Cache, ruleGenerationContext); + foreach (var assignmentElement in assignmentElements) + { + var mappedElement = mappedElements.Single(x => x.RuleElement == assignmentElement.Value); + + writer.WriteSafeString($"case {mappedElement.UmlClass.QueryFullyQualifiedTypeName(targetInterface:mappedElement.UmlClass.IsAbstract)} {mappedElement.UmlClass.Name.LowerCaseFirstLetter()}:{Environment.NewLine}"); + ruleGenerationContext.CurrentVariableName = mappedElement.UmlClass.Name.LowerCaseFirstLetter(); + ProcessNonTerminalElement(writer, mappedElement.UmlClass, mappedElement.RuleElement, ruleGenerationContext); + writer.WriteSafeString($"break;{Environment.NewLine}"); + } + + writer.WriteSafeString($"default:{Environment.NewLine}"); + + var mappedElementForNonTerminal = mappedElements.Single(x => x.RuleElement == nonTerminalElement); + + if (mappedElementForNonTerminal.UmlClass == umlClass) + { + writer.WriteSafeString($"{indexName} = Build{nonTerminalElement.Name}({indexName}, {variableName}, stringBuilder);"); + } + else + { + writer.WriteSafeString($"{indexName} = {mappedElementForNonTerminal.UmlClass.Name}TextualNotationBuilder.Build{nonTerminalElement.Name}({indexName}, {variableName}, stringBuilder);"); + } + + writer.WriteSafeString($"{Environment.NewLine}break;{Environment.NewLine}"); + writer.WriteSafeString($"{Environment.NewLine}}}"); writer.WriteSafeString($"{Environment.NewLine}}}"); + } + else if (alternatives.ElementAt(0).Elements[0] is TerminalElement terminalElement && alternatives.ElementAt(1).Elements[0] is AssignmentElement assignmentElement) + { + var targetProperty = umlClass.QueryAllProperties().Single(x => string.Equals(x.Name, assignmentElement.Property)); - writer.WriteSafeString($"else{Environment.NewLine}"); + writer.WriteSafeString($"if(!{targetProperty.QueryIfStatementContentForNonEmpty("poco")}){Environment.NewLine}"); writer.WriteSafeString($"{{{Environment.NewLine}"); - ProcessNonTerminalElement(writer, umlClass, nonTerminalElement, ruleGenerationContext); + ProcessRuleElement(writer, umlClass, terminalElement, ruleGenerationContext); + writer.WriteSafeString($"{Environment.NewLine}}}"); + writer.WriteSafeString("else"); + writer.WriteSafeString($"{Environment.NewLine}{{{Environment.NewLine}"); + ProcessAssignmentElement(writer, umlClass, ruleGenerationContext, assignmentElement, true); writer.WriteSafeString($"{Environment.NewLine}}}"); } else { - writer.WriteSafeString($"throw new System.NotSupportedException(\"Multiple alternatives with only one of the different type not implemented yet - {string.Join(',', types.Select(x => x.Name))}\");"); + writer.WriteSafeString($"throw new System.NotSupportedException(\"Multiple alternatives processing {string.Join(',', types.Select(x => x.Name))} not implemented yet\");"); } } } @@ -262,15 +358,15 @@ private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter { writer.WriteSafeString($"default:{Environment.NewLine}"); ruleGenerationContext.CurrentVariableName = variableName; - ProcessNonTerminalElement(writer, orderedNonTerminalElement.UmlClass, orderedNonTerminalElement.RuleElement, ruleGenerationContext); } else { writer.WriteSafeString($"case {orderedNonTerminalElement.UmlClass.QueryFullyQualifiedTypeName(targetInterface: orderedNonTerminalElement.UmlClass.IsAbstract)} poco{orderedNonTerminalElement.UmlClass.Name}:{Environment.NewLine}"); ruleGenerationContext.CurrentVariableName = $"poco{orderedNonTerminalElement.UmlClass.Name}"; - ProcessNonTerminalElement(writer, orderedNonTerminalElement.UmlClass, orderedNonTerminalElement.RuleElement, ruleGenerationContext); } + ProcessNonTerminalElement(writer, orderedNonTerminalElement.UmlClass, orderedNonTerminalElement.RuleElement, ruleGenerationContext); + ruleGenerationContext.CurrentVariableName = previousVariableName; writer.WriteSafeString($"{Environment.NewLine}break;{Environment.NewLine}"); } @@ -291,30 +387,34 @@ private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter if (assignmentElements.All(x => x.Operator == "+=") && assignmentElements.All(x => x.Value is NonTerminalElement)) { - if (orderElementsByInheritance.Select(x => x.UmlClass).Distinct().Count() != orderElementsByInheritance.Count) - { - writer.WriteSafeString($"Build{alternatives.ElementAt(0).TextualNotationRule.RuleName}Alternatives(poco, stringBuilder);"); - } - else + + writer.WriteSafeString($"foreach(var elementIn{targetProperty.Name.CapitalizeFirstLetter()} in poco.{targetProperty.QueryPropertyNameBasedOnUmlProperties()}){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + writer.WriteSafeString($"switch(elementIn{targetProperty.Name.CapitalizeFirstLetter()}){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + + foreach (var orderedElement in orderElementsByInheritance) { - writer.WriteSafeString($"foreach(var elementIn{targetProperty.Name.CapitalizeFirstLetter()} in poco.{targetProperty.QueryPropertyNameBasedOnUmlProperties()}){Environment.NewLine}"); - writer.WriteSafeString($"{{{Environment.NewLine}"); - writer.WriteSafeString($"switch(elementIn{targetProperty.Name.CapitalizeFirstLetter()}){Environment.NewLine}"); - writer.WriteSafeString($"{{{Environment.NewLine}"); + var numberOfElementOfSameType = orderElementsByInheritance.Count(x => x.UmlClass == orderedElement.UmlClass); - foreach (var orderedElement in orderElementsByInheritance) - { + if (numberOfElementOfSameType == 1) + { writer.WriteSafeString($"case {orderedElement.UmlClass.QueryFullyQualifiedTypeName(targetInterface:orderedElement.UmlClass.IsAbstract)} {orderedElement.UmlClass.Name.LowerCaseFirstLetter()}:{Environment.NewLine}"); - var previousVariableName = ruleGenerationContext.CurrentVariableName; - ruleGenerationContext.CurrentVariableName = orderedElement.UmlClass.Name.LowerCaseFirstLetter(); - ProcessNonTerminalElement(writer, orderedElement.UmlClass, orderedElement.RuleElement, ruleGenerationContext); - ruleGenerationContext.CurrentVariableName = previousVariableName; - writer.WriteSafeString($"{Environment.NewLine}break;{Environment.NewLine}"); } - - writer.WriteSafeString($"}}{Environment.NewLine}"); - writer.WriteSafeString($"}}{Environment.NewLine}"); + else + { + writer.WriteSafeString($"case {orderedElement.UmlClass.QueryFullyQualifiedTypeName(targetInterface:orderedElement.UmlClass.IsAbstract)} {orderedElement.UmlClass.Name.LowerCaseFirstLetter()} when {orderedElement.UmlClass.Name.LowerCaseFirstLetter()}.IsValidFor{orderedElement.RuleElement.Name}():{Environment.NewLine}"); + } + + var previousVariableName = ruleGenerationContext.CurrentVariableName; + ruleGenerationContext.CurrentVariableName = orderedElement.UmlClass.Name.LowerCaseFirstLetter(); + ProcessNonTerminalElement(writer, orderedElement.UmlClass, orderedElement.RuleElement, ruleGenerationContext); + ruleGenerationContext.CurrentVariableName = previousVariableName; + writer.WriteSafeString($"{Environment.NewLine}break;{Environment.NewLine}"); } + + writer.WriteSafeString($"}}{Environment.NewLine}"); + writer.WriteSafeString($"}}{Environment.NewLine}"); } else { @@ -493,8 +593,8 @@ private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass break; case GroupElement groupElement: ruleGenerationContext.CallerRule = groupElement ; - - if (groupElement.IsCollection) + + if (groupElement.IsCollection && groupElement.Alternatives.Count == 1) { var assignmentRule = groupElement.Alternatives.SelectMany(x => x.Elements).FirstOrDefault(x => x is AssignmentElement { Value: NonTerminalElement } || x is AssignmentElement {Value: ValueLiteralElement}); diff --git a/SysML2.NET/Core/Poco/FeatureMembership.cs b/SysML2.NET/Core/Poco/FeatureMembership.cs new file mode 100644 index 00000000..41663a87 --- /dev/null +++ b/SysML2.NET/Core/Poco/FeatureMembership.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. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Core.POCO.Core.Types +{ + using System.Linq; + + using SysML2.NET.Core.POCO.Root.Elements; + using SysML2.NET.Core.POCO.Systems.Connections; + using SysML2.NET.Core.POCO.Systems.DefinitionAndUsage; + using SysML2.NET.Core.POCO.Systems.Occurrences; + + /// + /// A FeatureMembership is an OwningMembership between an ownedMemberFeature and an owningType. If the + /// ownedMemberFeature has isVariable = false, then the FeatureMembership implies that the owningType is + /// also a featuringType of the ownedMemberFeature. If the ownedMemberFeature has isVariable = true, + /// then the FeatureMembership implies that the ownedMemberFeature is featured by the snapshots of the + /// owningType, which must specialize the Kernel Semantic Library base class Occurrence. + /// + public partial class FeatureMembership + { + /// + /// Asserts that this contais at least element into the + /// collection + /// + /// True if it contains one + internal bool IsValidForSourceSuccessionMember() + { + return this.HasRelatedElementOfType(); + } + + /// + /// Asserts that this contais at least element into the + /// collection but none of them are + /// + /// True if it contains one but no + internal bool IsValidForNonOccurrenceUsageMember() + { + return !this.IsValidForOccurrenceUsageMember() && this.HasRelatedElementOfType(); + } + + /// + /// Asserts that this contais at least element into the + /// collection + /// + /// True if it contains one + internal bool IsValidForOccurrenceUsageMember() + { + return this.HasRelatedElementOfType(); + } + + /// + /// Asserts that the contains at least one element + /// + /// Any + /// True if the contains one element + private bool HasRelatedElementOfType() where T : IElement + { + return this.OwnedRelatedElement.OfType().Any(); + } + } +} diff --git a/SysML2.NET/Core/Poco/OwningMembership.cs b/SysML2.NET/Core/Poco/OwningMembership.cs new file mode 100644 index 00000000..e41b2fc4 --- /dev/null +++ b/SysML2.NET/Core/Poco/OwningMembership.cs @@ -0,0 +1,51 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// 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.Core.POCO.Root.Namespaces +{ + using System.Linq; + + using SysML2.NET.Core.POCO.Core.Features; + + /// + /// An OwningMembership is a Membership that owns its memberElement as a ownedRelatedElement. The + /// ownedMemberElement becomes an ownedMember of the membershipOwningNamespace. + /// + public partial class OwningMembership + { + /// + /// Asserts that the current contains at least one inside the collection + /// + /// True if one is contained into the + internal bool IsValidForNonFeatureMember() + { + return this.OwnedRelatedElement.OfType().Any(); + } + + /// + /// Asserts that the current does not contains any inside the collection + /// + /// True if none is contained into the + internal bool IsValidForFeatureMember() + { + return !this.IsValidForNonFeatureMember(); + } + } +} diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs index 69bd63f4..2985ce14 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs @@ -569,7 +569,6 @@ public static void BuildChainingPart(SysML2.NET.Core.POCO.Core.Features.IFeature { using var ownedRelationshipOfFeatureChainingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); stringBuilder.Append("chains "); - if (ownedRelationshipOfFeatureChainingIterator.MoveNext()) { diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs index d0b57165..2ab929c7 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs @@ -57,7 +57,15 @@ public static void BuildInvariant(SysML2.NET.Core.POCO.Kernel.Functions.IInvaria } stringBuilder.Append("inv "); - throw new System.NotSupportedException("Multiple alternatives with only one of the different type not implemented yet - TerminalElement,AssignmentElement"); + if (!poco.IsNegated) + { + stringBuilder.Append("true "); + + } + else + { + stringBuilder.Append(" false "); + } FeatureTextualNotationBuilder.BuildFeatureDeclaration(poco, stringBuilder); FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); TypeTextualNotationBuilder.BuildFunctionBody(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs index da4a1e48..687bb6ca 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs @@ -58,7 +58,26 @@ public static void BuildFunctionOperationExpression(SysML2.NET.Core.POCO.Kernel. { BuildInvocationTypeMember(ownedRelationshipOfInvocationExpressionIterator.Current, stringBuilder); } - throw new System.NotSupportedException("Multiple alternatives with only one of the different type not implemented yet - AssignmentElement,NonTerminalElement"); + if (ownedRelationshipOfParameterMembershipIterator.MoveNext()) + { + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildBodyArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + } + else if (ownedRelationshipOfParameterMembershipIterator.MoveNext()) + { + + if (ownedRelationshipOfParameterMembershipIterator.Current != null) + { + ParameterMembershipTextualNotationBuilder.BuildFunctionReferenceArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + } + } + else + { + FeatureTextualNotationBuilder.BuildArgumentList(poco, stringBuilder); + } stringBuilder.Append(' '); ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs index c0f25b79..864238ab 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs @@ -154,7 +154,22 @@ public static void BuildCalculationBodyPart(SysML2.NET.Core.POCO.Core.Types.ITyp /// 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 with only one of the different type not implemented yet - NonTerminalElement,AssignmentElement"); + var ownedRelationship = poco.OwnedRelationship.ToList(); + + for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < ownedRelationship.Count; ownedRelationshipIndex++) + { + var ownedRelationshipElement = ownedRelationship[ownedRelationshipIndex]; + + switch (ownedRelationshipElement) + { + case SysML2.NET.Core.POCO.Kernel.Functions.ReturnParameterMembership returnParameterMembership: + ReturnParameterMembershipTextualNotationBuilder.BuildReturnParameterMember(returnParameterMembership, stringBuilder); break; + default: + ownedRelationshipIndex = BuildActionBodyItem(ownedRelationshipIndex, ownedRelationship, stringBuilder); + break; + + } + } } /// @@ -176,7 +191,32 @@ public static void BuildRequirementBody(SysML2.NET.Core.POCO.Core.Types.IType po /// 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 with only one of the different type not implemented yet - NonTerminalElement,AssignmentElement"); + var ownedRelationship = poco.OwnedRelationship.ToList(); + + for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < ownedRelationship.Count; ownedRelationshipIndex++) + { + var ownedRelationshipElement = ownedRelationship[ownedRelationshipIndex]; + + switch (ownedRelationshipElement) + { + case SysML2.NET.Core.POCO.Systems.Requirements.SubjectMembership subjectMembership: + SubjectMembershipTextualNotationBuilder.BuildSubjectMember(subjectMembership, stringBuilder); break; + case SysML2.NET.Core.POCO.Systems.Requirements.RequirementConstraintMembership requirementConstraintMembership: + RequirementConstraintMembershipTextualNotationBuilder.BuildRequirementConstraintMember(requirementConstraintMembership, stringBuilder); break; + case SysML2.NET.Core.POCO.Systems.Requirements.FramedConcernMembership framedConcernMembership: + FramedConcernMembershipTextualNotationBuilder.BuildFramedConcernMember(framedConcernMembership, stringBuilder); break; + case SysML2.NET.Core.POCO.Systems.VerificationCases.RequirementVerificationMembership requirementVerificationMembership: + RequirementVerificationMembershipTextualNotationBuilder.BuildRequirementVerificationMember(requirementVerificationMembership, stringBuilder); break; + case SysML2.NET.Core.POCO.Systems.Requirements.ActorMembership actorMembership: + ActorMembershipTextualNotationBuilder.BuildActorMember(actorMembership, stringBuilder); break; + case SysML2.NET.Core.POCO.Systems.Requirements.StakeholderMembership stakeholderMembership: + StakeholderMembershipTextualNotationBuilder.BuildStakeholderMember(stakeholderMembership, stringBuilder); break; + default: + ownedRelationshipIndex = BuildDefinitionBodyItem(ownedRelationshipIndex, ownedRelationship, stringBuilder); + break; + + } + } } /// @@ -198,7 +238,26 @@ public static void BuildCaseBody(SysML2.NET.Core.POCO.Core.Types.IType poco, Str /// 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 with only one of the different type not implemented yet - NonTerminalElement,AssignmentElement"); + var ownedRelationship = poco.OwnedRelationship.ToList(); + + for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < ownedRelationship.Count; ownedRelationshipIndex++) + { + var ownedRelationshipElement = ownedRelationship[ownedRelationshipIndex]; + + switch (ownedRelationshipElement) + { + case SysML2.NET.Core.POCO.Systems.Requirements.SubjectMembership subjectMembership: + SubjectMembershipTextualNotationBuilder.BuildSubjectMember(subjectMembership, stringBuilder); break; + case SysML2.NET.Core.POCO.Systems.Requirements.ActorMembership actorMembership: + ActorMembershipTextualNotationBuilder.BuildActorMember(actorMembership, stringBuilder); break; + case SysML2.NET.Core.POCO.Systems.Cases.ObjectiveMembership objectiveMembership: + ObjectiveMembershipTextualNotationBuilder.BuildObjectiveMember(objectiveMembership, stringBuilder); break; + default: + ownedRelationshipIndex = BuildActionBodyItem(ownedRelationshipIndex, ownedRelationship, stringBuilder); + break; + + } + } } /// @@ -269,9 +328,7 @@ public static void BuildTypeDeclaration(SysML2.NET.Core.POCO.Core.Types.IType po stringBuilder.Append(' '); } - { - throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); - } + throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); stringBuilder.Append(' '); BuildTypeRelationshipPart(poco, stringBuilder); @@ -477,7 +534,25 @@ public static void BuildTypeBody(SysML2.NET.Core.POCO.Core.Types.IType poco, Str /// The that contains the entire textual notation public static void BuildTypeBodyElement(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) { - BuildTypeBodyElementAlternatives(poco, stringBuilder); + foreach (var elementInOwnedRelationship in poco.OwnedRelationship) + { + switch (elementInOwnedRelationship) + { + case SysML2.NET.Core.POCO.Root.Namespaces.OwningMembership owningMembership when owningMembership.IsValidForNonFeatureMember(): + OwningMembershipTextualNotationBuilder.BuildNonFeatureMember(owningMembership, stringBuilder); + break; + case SysML2.NET.Core.POCO.Root.Namespaces.OwningMembership owningMembership when owningMembership.IsValidForFeatureMember(): + OwningMembershipTextualNotationBuilder.BuildFeatureMember(owningMembership, stringBuilder); + break; + case SysML2.NET.Core.POCO.Root.Namespaces.Membership membership: + MembershipTextualNotationBuilder.BuildAliasMember(membership, stringBuilder); + break; + case SysML2.NET.Core.POCO.Root.Namespaces.IImport import: + ImportTextualNotationBuilder.BuildImport(import, stringBuilder); + break; + } + } + } /// @@ -501,10 +576,21 @@ public static void BuildFunctionBodyPart(SysML2.NET.Core.POCO.Core.Types.IType p { using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); using var ownedRelationshipOfResultExpressionMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationship = poco.OwnedRelationship.ToList(); - while (ownedRelationshipOfReturnParameterMembershipIterator.MoveNext()) + for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < ownedRelationship.Count; ownedRelationshipIndex++) { - throw new System.NotSupportedException("Multiple alternatives with only one of the different type not implemented yet - NonTerminalElement,AssignmentElement"); + var ownedRelationshipElement = ownedRelationship[ownedRelationshipIndex]; + + switch (ownedRelationshipElement) + { + case SysML2.NET.Core.POCO.Kernel.Functions.ReturnParameterMembership returnParameterMembership: + ReturnParameterMembershipTextualNotationBuilder.BuildReturnFeatureMember(returnParameterMembership, stringBuilder); break; + default: + ownedRelationshipIndex = BuildTypeBodyElement(ownedRelationshipIndex, ownedRelationship, stringBuilder); + break; + + } } if (ownedRelationshipOfResultExpressionMembershipIterator.MoveNext()) diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs index 58c54b43..6ff88183 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs @@ -53,7 +53,24 @@ public static void BuildViewDefinitionBody(SysML2.NET.Core.POCO.Systems.Views.IV /// 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 with only one of the different type not implemented yet - NonTerminalElement,AssignmentElement"); + var ownedRelationship = poco.OwnedRelationship.ToList(); + + for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < ownedRelationship.Count; ownedRelationshipIndex++) + { + var ownedRelationshipElement = ownedRelationship[ownedRelationshipIndex]; + + switch (ownedRelationshipElement) + { + case SysML2.NET.Core.POCO.Kernel.Packages.ElementFilterMembership elementFilterMembership: + ElementFilterMembershipTextualNotationBuilder.BuildElementFilterMember(elementFilterMembership, stringBuilder); break; + case SysML2.NET.Core.POCO.Systems.Views.ViewRenderingMembership viewRenderingMembership: + ViewRenderingMembershipTextualNotationBuilder.BuildViewRenderingMember(viewRenderingMembership, stringBuilder); break; + default: + ownedRelationshipIndex = TypeTextualNotationBuilder.BuildDefinitionBodyItem(ownedRelationshipIndex, ownedRelationship, stringBuilder); + break; + + } + } } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs index ac454a77..b3b99e23 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs @@ -53,7 +53,26 @@ public static void BuildViewBody(SysML2.NET.Core.POCO.Systems.Views.IViewUsage p /// 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 with only one of the different type not implemented yet - NonTerminalElement,AssignmentElement"); + var ownedRelationship = poco.OwnedRelationship.ToList(); + + for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < ownedRelationship.Count; ownedRelationshipIndex++) + { + var ownedRelationshipElement = ownedRelationship[ownedRelationshipIndex]; + + switch (ownedRelationshipElement) + { + case SysML2.NET.Core.POCO.Kernel.Packages.ElementFilterMembership elementFilterMembership: + ElementFilterMembershipTextualNotationBuilder.BuildElementFilterMember(elementFilterMembership, stringBuilder); break; + case SysML2.NET.Core.POCO.Systems.Views.ViewRenderingMembership viewRenderingMembership: + ViewRenderingMembershipTextualNotationBuilder.BuildViewRenderingMember(viewRenderingMembership, stringBuilder); break; + case SysML2.NET.Core.POCO.Systems.Views.IExpose expose: + ExposeTextualNotationBuilder.BuildExpose(expose, stringBuilder); break; + default: + ownedRelationshipIndex = TypeTextualNotationBuilder.BuildDefinitionBodyItem(ownedRelationshipIndex, ownedRelationship, stringBuilder); + break; + + } + } } /// diff --git a/SysML2.NET/TextualNotation/TypeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/TypeTextualNotationBuilder.cs index a4738311..f1236682 100644 --- a/SysML2.NET/TextualNotation/TypeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/TypeTextualNotationBuilder.cs @@ -20,41 +20,132 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Core.Types; + using SysML2.NET.Core.POCO.Root.Elements; using SysML2.NET.Core.POCO.Root.Namespaces; + using SysML2.NET.Core.POCO.Systems.DefinitionAndUsage; /// - /// Hand-coded part of the + /// Hand-coded part of the /// public static partial class TypeTextualNotationBuilder { /// - /// Build the TypeBodyElement alternatives part since used NonTerminal target same type + /// Build the complex DefinitionBodyItem:Type=ownedRelationship+=DefinitionMember|ownedRelationship+=VariantUsageMember|ownedRelationship+=NonOccurrenceUsageMember|(ownedRelationship+=SourceSuccessionMember)?ownedRelationship+=OccurrenceUsageMember|ownedRelationship+=AliasMember|ownedRelationship+=Import rule /// - /// The - /// The - private static void BuildTypeBodyElementAlternatives(IType poco, StringBuilder stringBuilder) + /// The + /// The + internal static void BuildDefinitionBodyItemInternal(IType poco, StringBuilder stringBuilder) { - foreach (var ownedRelationship in poco.OwnedRelationship) + var relationships = poco.OwnedRelationship.ToList(); + + for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < relationships.Count; ownedRelationshipIndex++) { - switch (ownedRelationship) + ownedRelationshipIndex = BuildDefinitionBodyItem(ownedRelationshipIndex, relationships, stringBuilder); + } + } + + /// + /// Build the logic for the DefinitionBodyItem:Type=ownedRelationship+=DefinitionMember|ownedRelationship+=VariantUsageMember|ownedRelationship+=NonOccurrenceUsageMember| + /// (ownedRelationship+=SourceSuccessionMember)?ownedRelationship+=OccurrenceUsageMember|ownedRelationship+=AliasMember|ownedRelationship+=Import rule + /// + /// The index of the inside the to process + /// A collection of to process + /// The + /// The current index that could have been modified during the process + internal static int BuildDefinitionBodyItem(int relationshipIndex, IReadOnlyList relationships, StringBuilder stringBuilder) + { + var ownedRelationship = relationships[relationshipIndex]; + + switch (ownedRelationship) + { + case OwningMembership owningMembership: + OwningMembershipTextualNotationBuilder.BuildDefinitionMember(owningMembership, stringBuilder); + break; + + case VariantMembership variantMembership: + VariantMembershipTextualNotationBuilder.BuildVariantUsageMember(variantMembership, stringBuilder); + break; + + case FeatureMembership featureMembershipForSuccession when featureMembershipForSuccession.IsValidForSourceSuccessionMember(): { - case OwningMembership owningMembership: - OwningMembershipTextualNotationBuilder.BuildNonFeatureMember(owningMembership, stringBuilder); - break; - case FeatureMembership featureMembership: - OwningMembershipTextualNotationBuilder.BuildFeatureMember(featureMembership, stringBuilder); - break; - case Membership membership: - MembershipTextualNotationBuilder.BuildAliasMember(membership, stringBuilder); - break; - case IImport import: - ImportTextualNotationBuilder.BuildImport(import, stringBuilder); - break; + var nextElement = relationshipIndex + 1 < relationships.Count ? relationships[relationshipIndex + 1] : null; + + if (nextElement is FeatureMembership featureMembership && featureMembership.IsValidForOccurrenceUsageMember()) + { + FeatureMembershipTextualNotationBuilder.BuildSourceSuccessionMember(featureMembershipForSuccession, stringBuilder); + FeatureMembershipTextualNotationBuilder.BuildOccurrenceUsageMember(featureMembership, stringBuilder); + return relationshipIndex + 1; + } + + break; } + + case FeatureMembership featureMembershipForOccurenceUsageMember when featureMembershipForOccurenceUsageMember.IsValidForOccurrenceUsageMember(): + FeatureMembershipTextualNotationBuilder.BuildOccurrenceUsageMember(featureMembershipForOccurenceUsageMember, stringBuilder); + break; + + case FeatureMembership featureMembershipForNonOccurenceUsageMember when featureMembershipForNonOccurenceUsageMember.IsValidForNonOccurrenceUsageMember(): + FeatureMembershipTextualNotationBuilder.BuildNonOccurrenceUsageMember(featureMembershipForNonOccurenceUsageMember, stringBuilder); + break; + + case Membership membership: + MembershipTextualNotationBuilder.BuildAliasMember(membership, stringBuilder); + break; + + case IImport import: + ImportTextualNotationBuilder.BuildImport(import, stringBuilder); + break; + } + + return relationshipIndex; + } + + /// + /// Build the logic for the ActionBodyItem:Type=NonBehaviorBodyItem|ownedRelationship+=InitialNodeMember(ownedRelationship+=ActionTargetSuccessionMember)*|(ownedRelationship+=SourceSuccessionMember)?ownedRelationship+=ActionBehaviorMember(ownedRelationship+=ActionTargetSuccessionMember)*|ownedRelationship+=GuardedSuccessionMember rule + /// + /// The index of the inside the to process + /// A collection of to process + /// The + /// The current index that could have been modified during the process + private static int BuildActionBodyItem(int relationshipIndex, List relationships, StringBuilder stringBuilder) + { + return relationshipIndex; + } + + /// + /// Build the logic for the ypeBodyElement:Type=ownedRelationship+=NonFeatureMember|ownedRelationship+=FeatureMember|ownedRelationship+=AliasMember|ownedRelationship+=Import rule + /// This implementation is a copy paste from the other one but required for Other rules + /// + /// The index of the inside the to process + /// A collection of to process + /// The + /// The current index that could have been modified during the process + private static int BuildTypeBodyElement(int relationshipIndex, List relationships, StringBuilder stringBuilder) + { + var elementInOwnedRelationship = relationships[relationshipIndex]; + + switch (elementInOwnedRelationship) + { + case SysML2.NET.Core.POCO.Root.Namespaces.OwningMembership owningMembership when owningMembership.IsValidForNonFeatureMember(): + OwningMembershipTextualNotationBuilder.BuildNonFeatureMember(owningMembership, stringBuilder); + break; + case SysML2.NET.Core.POCO.Root.Namespaces.OwningMembership owningMembership when owningMembership.IsValidForFeatureMember(): + OwningMembershipTextualNotationBuilder.BuildFeatureMember(owningMembership, stringBuilder); + break; + case SysML2.NET.Core.POCO.Root.Namespaces.Membership membership: + MembershipTextualNotationBuilder.BuildAliasMember(membership, stringBuilder); + break; + case SysML2.NET.Core.POCO.Root.Namespaces.IImport import: + ImportTextualNotationBuilder.BuildImport(import, stringBuilder); + break; } + + return relationshipIndex; } } } From aab90e8705bad60225c58d588c7a66847dc7a404 Mon Sep 17 00:00:00 2001 From: atheate Date: Fri, 13 Mar 2026 16:24:12 +0100 Subject: [PATCH 23/33] [WIP] Implemented the NonBehaviorBodyItem rule --- SysML2.NET/Core/Poco/FeatureMembership.cs | 28 ++++++++++ .../TypeTextualNotationBuilder.cs | 52 +++++++++++++++++++ 2 files changed, 80 insertions(+) diff --git a/SysML2.NET/Core/Poco/FeatureMembership.cs b/SysML2.NET/Core/Poco/FeatureMembership.cs index 41663a87..c2183e63 100644 --- a/SysML2.NET/Core/Poco/FeatureMembership.cs +++ b/SysML2.NET/Core/Poco/FeatureMembership.cs @@ -23,9 +23,16 @@ namespace SysML2.NET.Core.POCO.Core.Types using System.Linq; using SysML2.NET.Core.POCO.Root.Elements; + using SysML2.NET.Core.POCO.Systems.Allocations; using SysML2.NET.Core.POCO.Systems.Connections; using SysML2.NET.Core.POCO.Systems.DefinitionAndUsage; + using SysML2.NET.Core.POCO.Systems.Flows; + using SysML2.NET.Core.POCO.Systems.Interfaces; + using SysML2.NET.Core.POCO.Systems.Items; using SysML2.NET.Core.POCO.Systems.Occurrences; + using SysML2.NET.Core.POCO.Systems.Parts; + using SysML2.NET.Core.POCO.Systems.Ports; + using SysML2.NET.Core.POCO.Systems.Views; /// /// A FeatureMembership is an OwningMembership between an ownedMemberFeature and an owningType. If the @@ -75,5 +82,26 @@ private bool HasRelatedElementOfType() where T : IElement { return this.OwnedRelatedElement.OfType().Any(); } + + /// + /// Asserts that the current have valid typeinto the + /// collection for the StructureUsageMember + /// + /// True if contains any of the required element type + internal bool IsValidForStructureUsageMember() + { + return this.HasRelatedElementOfType() + || this.HasRelatedElementOfType() + || this.HasRelatedElementOfType() + || this.HasRelatedElementOfType() + || this.HasRelatedElementOfType() + || this.HasRelatedElementOfType() + || this.HasRelatedElementOfType() + || this.HasRelatedElementOfType() + || this.HasRelatedElementOfType() + || this.HasRelatedElementOfType() + || this.HasRelatedElementOfType() + || this.HasRelatedElementOfType(); + } } } diff --git a/SysML2.NET/TextualNotation/TypeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/TypeTextualNotationBuilder.cs index f1236682..fdce017c 100644 --- a/SysML2.NET/TextualNotation/TypeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/TypeTextualNotationBuilder.cs @@ -117,6 +117,58 @@ private static int BuildActionBodyItem(int relationshipIndex, List + /// Build the logic for the NonBehaviorBodyItem =ownedRelationship+=Import|ownedRelationship+=AliasMember|ownedRelationship+=DefinitionMember|ownedRelationship+=VariantUsageMember|ownedRelationship+=NonOccurrenceUsageMember|(ownedRelationship+=SourceSuccessionMember)?ownedRelationship+=StructureUsageMember rule + /// + /// The index of the inside the to process + /// A collection of to process + /// The + /// The current index that could have been modified during the process + private static int BuildNonBehaviorBodyItem(int relationshipIndex, List relationships, StringBuilder stringBuilder) + { + var elementInOwnedRelationship = relationships[relationshipIndex]; + + switch (elementInOwnedRelationship) + { + case IImport import: + ImportTextualNotationBuilder.BuildImport(import, stringBuilder); + break; + case Membership membership: + MembershipTextualNotationBuilder.BuildAliasMember(membership, stringBuilder); + break; + case OwningMembership owningMembership: + OwningMembershipTextualNotationBuilder.BuildDefinitionMember(owningMembership, stringBuilder); + break; + case VariantMembership variantMembership: + VariantMembershipTextualNotationBuilder.BuildVariantUsageMember(variantMembership, stringBuilder); + break; + + case FeatureMembership featureMembershipForSuccession when featureMembershipForSuccession.IsValidForSourceSuccessionMember(): + { + var nextElement = relationshipIndex + 1 < relationships.Count ? relationships[relationshipIndex + 1] : null; + + if (nextElement is FeatureMembership featureMembership && featureMembership.IsValidForStructureUsageMember()) + { + FeatureMembershipTextualNotationBuilder.BuildSourceSuccessionMember(featureMembershipForSuccession, stringBuilder); + FeatureMembershipTextualNotationBuilder.BuildStructureUsageMember(featureMembership, stringBuilder); + return relationshipIndex + 1; + } + + break; + } + + case FeatureMembership featureMembershipForOccurenceUsageMember when featureMembershipForOccurenceUsageMember.IsValidForStructureUsageMember(): + FeatureMembershipTextualNotationBuilder.BuildStructureUsageMember(featureMembershipForOccurenceUsageMember, stringBuilder); + break; + + case FeatureMembership featureMembershipForNonOccurenceUsageMember when featureMembershipForNonOccurenceUsageMember.IsValidForNonOccurrenceUsageMember(): + FeatureMembershipTextualNotationBuilder.BuildNonOccurrenceUsageMember(featureMembershipForNonOccurenceUsageMember, stringBuilder); + break; + } + + return relationshipIndex; + } + /// /// Build the logic for the ypeBodyElement:Type=ownedRelationship+=NonFeatureMember|ownedRelationship+=FeatureMember|ownedRelationship+=AliasMember|ownedRelationship+=Import rule /// This implementation is a copy paste from the other one but required for Other rules From 202ca9588c217ad9a2dfb81ac3b64e8d15cba07d Mon Sep 17 00:00:00 2001 From: atheate Date: Wed, 18 Mar 2026 11:13:20 +0100 Subject: [PATCH 24/33] [WIP] in the middle of refactor on correct handling of collection. The CollectionCursor class has to be used all over to not loose collection context position --- .../Grammar/Model/Alternatives.cs | 19 ++ .../Grammar/Model/AssignmentElement.cs | 2 +- .../Grammar/Model/TextualNotationRule.cs | 70 ++++++ .../HandleBarHelpers/RulesHelper.cs | 228 +++++++++++++++--- ...core-textual-notation-builder-template.hbs | 51 +++- ...AcceptActionUsageTextualNotationBuilder.cs | 10 +- .../ActionUsageTextualNotationBuilder.cs | 12 +- ...AnalysisCaseUsageTextualNotationBuilder.cs | 2 +- .../AnnotationTextualNotationBuilder.cs | 25 +- ...gnmentActionUsageTextualNotationBuilder.cs | 6 +- ...gConnectorAsUsageTextualNotationBuilder.cs | 4 +- ...BooleanExpressionTextualNotationBuilder.cs | 2 +- .../CaseUsageTextualNotationBuilder.cs | 2 +- .../ClassifierTextualNotationBuilder.cs | 5 +- .../ConcernUsageTextualNotationBuilder.cs | 6 +- ...tedPortDefinitionTextualNotationBuilder.cs | 18 +- .../ConnectionUsageTextualNotationBuilder.cs | 10 +- .../ConnectorTextualNotationBuilder.cs | 10 +- .../ConstraintUsageTextualNotationBuilder.cs | 8 +- ...tructorExpressionTextualNotationBuilder.cs | 2 +- .../DefinitionTextualNotationBuilder.cs | 30 ++- .../DifferencingTextualNotationBuilder.cs | 19 +- ...FeatureMembershipTextualNotationBuilder.cs | 86 ++++--- ...erationDefinitionTextualNotationBuilder.cs | 6 +- ...ntOccurrenceUsageTextualNotationBuilder.cs | 18 +- ...ExhibitStateUsageTextualNotationBuilder.cs | 2 +- .../ExpressionTextualNotationBuilder.cs | 20 +- ...FeatureMembershipTextualNotationBuilder.cs | 82 ++++--- ...ferenceExpressionTextualNotationBuilder.cs | 71 ++++-- .../FeatureTextualNotationBuilder.cs | 205 ++++++++++------ .../FeatureValueTextualNotationBuilder.cs | 107 ++++---- .../FlowEndTextualNotationBuilder.cs | 2 +- .../FlowUsageTextualNotationBuilder.cs | 15 +- ...orLoopActionUsageTextualNotationBuilder.cs | 6 +- ...ConcernMembershipTextualNotationBuilder.cs | 2 +- .../IfActionUsageTextualNotationBuilder.cs | 4 +- ...cludeUseCaseUsageTextualNotationBuilder.cs | 2 +- .../InterfaceUsageTextualNotationBuilder.cs | 10 +- .../IntersectingTextualNotationBuilder.cs | 19 +- .../InvariantTextualNotationBuilder.cs | 2 +- ...ocationExpressionTextualNotationBuilder.cs | 4 +- .../MembershipTextualNotationBuilder.cs | 14 +- ...aAccessExpressionTextualNotationBuilder.cs | 18 +- ...etadataDefinitionTextualNotationBuilder.cs | 6 +- .../MetadataFeatureTextualNotationBuilder.cs | 18 +- .../MetadataUsageTextualNotationBuilder.cs | 24 +- ...MultiplicityRangeTextualNotationBuilder.cs | 8 +- .../NamespaceTextualNotationBuilder.cs | 34 +-- ...urrenceDefinitionTextualNotationBuilder.cs | 16 +- .../OccurrenceUsageTextualNotationBuilder.cs | 24 +- ...peratorExpressionTextualNotationBuilder.cs | 20 +- .../OwningMembershipTextualNotationBuilder.cs | 162 ++++++++----- .../PackageTextualNotationBuilder.cs | 35 +-- ...rameterMembershipTextualNotationBuilder.cs | 183 +++++++++----- .../PartUsageTextualNotationBuilder.cs | 12 +- .../PayloadFeatureTextualNotationBuilder.cs | 2 +- ...erformActionUsageTextualNotationBuilder.cs | 8 +- .../PortDefinitionTextualNotationBuilder.cs | 2 +- .../PortUsageTextualNotationBuilder.cs | 2 +- .../RedefinitionTextualNotationBuilder.cs | 4 +- .../ReferenceUsageTextualNotationBuilder.cs | 69 ++++-- .../RelationshipTextualNotationBuilder.cs | 31 ++- .../RenderingUsageTextualNotationBuilder.cs | 6 +- ...straintMembershipTextualNotationBuilder.cs | 2 +- .../RequirementUsageTextualNotationBuilder.cs | 12 +- ...icationMembershipTextualNotationBuilder.cs | 2 +- ...rameterMembershipTextualNotationBuilder.cs | 35 ++- ...yRequirementUsageTextualNotationBuilder.cs | 4 +- .../SendActionUsageTextualNotationBuilder.cs | 16 +- .../SpecializationTextualNotationBuilder.cs | 17 +- .../StepTextualNotationBuilder.cs | 2 +- ...SubjectMembershipTextualNotationBuilder.cs | 18 +- .../SubsettingTextualNotationBuilder.cs | 4 +- ...SuccessionAsUsageTextualNotationBuilder.cs | 26 +- ...ccessionFlowUsageTextualNotationBuilder.cs | 2 +- .../SuccessionTextualNotationBuilder.cs | 4 +- ...minateActionUsageTextualNotationBuilder.cs | 2 +- .../TransitionUsageTextualNotationBuilder.cs | 16 +- ...ocationExpressionTextualNotationBuilder.cs | 6 +- .../TypeTextualNotationBuilder.cs | 197 ++++++++------- .../UnioningTextualNotationBuilder.cs | 19 +- .../UsageTextualNotationBuilder.cs | 34 ++- .../UseCaseUsageTextualNotationBuilder.cs | 2 +- ...ficationCaseUsageTextualNotationBuilder.cs | 2 +- .../ViewDefinitionTextualNotationBuilder.cs | 29 ++- ...nderingMembershipTextualNotationBuilder.cs | 2 +- .../ViewUsageTextualNotationBuilder.cs | 35 ++- ...leLoopActionUsageTextualNotationBuilder.cs | 4 +- .../TextualNotation/CollectionCursor.cs | 121 ++++++++++ 89 files changed, 1710 insertions(+), 805 deletions(-) create mode 100644 SysML2.NET/TextualNotation/CollectionCursor.cs diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/Alternatives.cs b/SysML2.NET.CodeGenerator/Grammar/Model/Alternatives.cs index ff3ba663..37fb9503 100644 --- a/SysML2.NET.CodeGenerator/Grammar/Model/Alternatives.cs +++ b/SysML2.NET.CodeGenerator/Grammar/Model/Alternatives.cs @@ -21,6 +21,7 @@ namespace SysML2.NET.CodeGenerator.Grammar.Model { using System.Collections.Generic; + using System.Linq; /// /// Provides mapping data class for the alternative grammar part @@ -36,5 +37,23 @@ public class Alternatives: IPartOfTextualRule /// Gets the /// public TextualNotationRule TextualNotationRule { get; init; } + + /// + /// Asserts that the current contains that are part of a collection iteration that could be called from + /// another rule + /// + /// The computation of the assertion + internal bool ContainsAssignmentRequiringDispatch() + { + var assignments = this.Elements.OfType().Where(x => x.Operator == "+=").ToList(); + var groupElements = this.Elements.OfType().Where(x => x.IsCollection).ToList(); + + if (assignments.Count == 0) + { + return false; + } + + return groupElements.Count == 0; + } } } diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/AssignmentElement.cs b/SysML2.NET.CodeGenerator/Grammar/Model/AssignmentElement.cs index 32219bc4..719dd5d2 100644 --- a/SysML2.NET.CodeGenerator/Grammar/Model/AssignmentElement.cs +++ b/SysML2.NET.CodeGenerator/Grammar/Model/AssignmentElement.cs @@ -43,6 +43,6 @@ public class AssignmentElement: RuleElement /// /// Gets or sets an optional prefix /// - public string Prefix { get; set; } + public string Prefix { get; set; } } } diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/TextualNotationRule.cs b/SysML2.NET.CodeGenerator/Grammar/Model/TextualNotationRule.cs index 22811eac..e5791d4b 100644 --- a/SysML2.NET.CodeGenerator/Grammar/Model/TextualNotationRule.cs +++ b/SysML2.NET.CodeGenerator/Grammar/Model/TextualNotationRule.cs @@ -21,6 +21,7 @@ namespace SysML2.NET.CodeGenerator.Grammar.Model { using System.Collections.Generic; + using System.Linq; /// /// Describe the content of a rule @@ -51,5 +52,74 @@ public class TextualNotationRule /// Gets or the collection of defined by the rule /// public List Alternatives { get; } = []; + + /// + /// Asserts that the current Rule acts has a dispatcher or not. A dispatcher needs to have index access to access element into a collection. + /// + public bool IsDispatcherRule => this.ComputeIsDispatcherRule(); + + /// + /// Asserts that the rule described assignment of multiple collection + /// + public bool IsMultiCollectionAssignment => this.ComputeIsMultiCollectionAssigment(); + + /// + /// Gets names of property that a multicollection assignment defines + /// + /// The collection of property names + public IReadOnlyCollection QueryMultiCollectionPropertiesName() + { + if (!this.IsMultiCollectionAssignment) + { + return Enumerable.Empty().ToList(); + } + + var assignments = this.Alternatives.SelectMany(x => x.Elements).OfType(); + return assignments.Where(x => x.Operator == "+=").DistinctBy(x => x.Property).Select(x => x.Property).ToList(); + } + + /// + /// Computes the value of the + /// + /// The result of the assertion computation + private bool ComputeIsMultiCollectionAssigment() + { + if (this.Alternatives.Count == 1) + { + return false; + } + + var assignments = this.Alternatives.SelectMany(x => x.Elements).OfType(); + return assignments.Where(x => x.Operator == "+=").DistinctBy(x => x.Property).Count() > 1; + } + + /// + /// Computes the assertion that the is a dispatcher or not + /// + /// The result of the assertion computation + private bool ComputeIsDispatcherRule() + { + return this.Alternatives.Count > 1 && this.Alternatives.Any(x => x.Elements.OfType().Any(a => a.Operator == "+=")) + || this.Alternatives.Count == 1 && this.Alternatives[0].Elements.Count == 1 && this.Alternatives[0].Elements[0] is AssignmentElement { Operator: "+="}; + } + + /// + /// Gets the that requires a dispatcher + /// + /// The + public AssignmentElement GetAssignmentElementNeedingDispatcher() + { + if (!this.IsDispatcherRule) + { + return null; + } + + if (this.Alternatives.Count == 1) + { + return this.Alternatives[0].Elements[0] as AssignmentElement; + } + + return this.Alternatives.SelectMany(x => x.Elements).OfType().FirstOrDefault(x => x.Operator == "+="); + } } } diff --git a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs index c7cd6142..e02fc39a 100644 --- a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs +++ b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs @@ -46,6 +46,18 @@ public static class RulesHelper /// The context with which the helper needs to be registered public static void RegisterRulesHelper(this IHandlebars handlebars) { + handlebars.RegisterHelper("RulesHelper.ContainsAnyDispatcherRules", (_, arguments) => + { + if (arguments.Length != 1) + { + throw new ArgumentException("RulesHelper.ContainsAnyDispatcherRules expects to have 3 arguments"); + } + + return arguments[0] is not List allRules + ? throw new ArgumentException("RulesHelper.ContainsAnyDispatcherRules expects a list of TextualNotationRule as only argument") + : allRules.Any(x => x.IsDispatcherRule); + }); + handlebars.RegisterHelper("RulesHelper.WriteRule", (writer, _, arguments) => { if (arguments.Length != 3) @@ -166,6 +178,12 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas { if (alternatives.All(x => x.Elements.Count == 1)) { + if (alternatives.ElementAt(0).Elements[0].TextualNotationRule.IsMultiCollectionAssignment) + { + ProcessMultiCollectionAssignment(writer, umlClass, alternatives, ruleGenerationContext); + return; + } + var types = alternatives.SelectMany(x => x.Elements).Select(x => x.GetType()).Distinct().ToList(); if(types.Count == 1) @@ -245,14 +263,11 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas var targetProperty = umlClass.QueryAllProperties().Single(x => string.Equals(x.Name, assignmentElements[0].Property)); - var indexName = $"{targetProperty.Name.LowerCaseFirstLetter()}Index"; - var variableName = targetProperty.Name.LowerCaseFirstLetter(); - var elementName = $"{variableName}Element"; + const string indexName = "elementIndex"; + const string variableName = "elements"; + const string elementName = $"{variableName}Element"; - writer.WriteSafeString($"var {targetProperty.Name.LowerCaseFirstLetter()} = poco.{targetProperty.QueryPropertyNameBasedOnUmlProperties()}.ToList();{Environment.NewLine}"); - writer.WriteSafeString($"{Environment.NewLine}for(var {indexName} = 0; {indexName} < {variableName}.Count; {indexName}++){Environment.NewLine}"); - writer.WriteSafeString($"{{{Environment.NewLine}"); - writer.WriteSafeString($"var {elementName} = {variableName}[{indexName}];{Environment.NewLine}"); + writer.WriteSafeString($"var {elementName} = poco.{targetProperty.QueryPropertyNameBasedOnUmlProperties()}[{indexName}];{Environment.NewLine}"); writer.WriteSafeString($"{Environment.NewLine}switch({elementName}){Environment.NewLine}"); writer.WriteSafeString($"{{{Environment.NewLine}"); @@ -268,22 +283,20 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas writer.WriteSafeString($"break;{Environment.NewLine}"); } - writer.WriteSafeString($"default:{Environment.NewLine}"); - var mappedElementForNonTerminal = mappedElements.Single(x => x.RuleElement == nonTerminalElement); + writer.WriteSafeString($"case {mappedElementForNonTerminal.UmlClass.QueryFullyQualifiedTypeName()} {mappedElementForNonTerminal.UmlClass.Name.LowerCaseFirstLetter()}:{Environment.NewLine}"); if (mappedElementForNonTerminal.UmlClass == umlClass) { - writer.WriteSafeString($"{indexName} = Build{nonTerminalElement.Name}({indexName}, {variableName}, stringBuilder);"); + writer.WriteSafeString($"{indexName} = Build{nonTerminalElement.Name}({mappedElementForNonTerminal.UmlClass.Name.LowerCaseFirstLetter()}, {indexName}, stringBuilder);"); } else { - writer.WriteSafeString($"{indexName} = {mappedElementForNonTerminal.UmlClass.Name}TextualNotationBuilder.Build{nonTerminalElement.Name}({indexName}, {variableName}, stringBuilder);"); + writer.WriteSafeString($"{indexName} = {mappedElementForNonTerminal.UmlClass.Name}TextualNotationBuilder.Build{nonTerminalElement.Name}({mappedElementForNonTerminal.UmlClass.Name.LowerCaseFirstLetter()}, {indexName}, stringBuilder);"); } writer.WriteSafeString($"{Environment.NewLine}break;{Environment.NewLine}"); writer.WriteSafeString($"{Environment.NewLine}}}"); - writer.WriteSafeString($"{Environment.NewLine}}}"); } else if (alternatives.ElementAt(0).Elements[0] is TerminalElement terminalElement && alternatives.ElementAt(1).Elements[0] is AssignmentElement assignmentElement) { @@ -311,6 +324,18 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas } } + /// + /// Processes for a that is a multicollection assignment + /// + /// The used to write into output content + /// The related + /// The collection of alternatives to process + /// The current + private static void ProcessMultiCollectionAssignment(EncodedTextWriter writer, IClass umlClass, IReadOnlyCollection alternatives, RuleGenerationContext ruleGenerationContext) + { + + } + /// /// Process multiple when all of them only have one /// @@ -342,9 +367,17 @@ private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter if (ruleGenerationContext.CallerRule is AssignmentElement assignmentElement) { - var iteratorToUse = ruleGenerationContext.DefinedIterators.Single(x => x.ApplicableRuleElements.Contains(assignmentElement)); - variableName = $"{iteratorToUse.IteratorVariableName}.Current"; - writer.WriteSafeString($"{iteratorToUse.IteratorVariableName}.MoveNext();{Environment.NewLine}{Environment.NewLine}"); + if (assignmentElement.TextualNotationRule.IsDispatcherRule) + { + variableName = $"elementFor{assignmentElement.Property.CapitalizeFirstLetter()}"; + writer.WriteSafeString($"var elementFor{assignmentElement.Property.CapitalizeFirstLetter()} = {ruleGenerationContext.CurrentVariableName}.{assignmentElement.Property.CapitalizeFirstLetter()}[elementIndex];{Environment.NewLine}"); + } + else + { + var iteratorToUse = ruleGenerationContext.DefinedIterators.Single(x => x.ApplicableRuleElements.Contains(assignmentElement)); + variableName = $"{iteratorToUse.IteratorVariableName}.Current"; + writer.WriteSafeString($"{iteratorToUse.IteratorVariableName}.MoveNext();{Environment.NewLine}{Environment.NewLine}"); + } } writer.WriteSafeString($"switch({variableName}){Environment.NewLine}"); @@ -387,9 +420,6 @@ private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter if (assignmentElements.All(x => x.Operator == "+=") && assignmentElements.All(x => x.Value is NonTerminalElement)) { - - writer.WriteSafeString($"foreach(var elementIn{targetProperty.Name.CapitalizeFirstLetter()} in poco.{targetProperty.QueryPropertyNameBasedOnUmlProperties()}){Environment.NewLine}"); - writer.WriteSafeString($"{{{Environment.NewLine}"); writer.WriteSafeString($"switch(elementIn{targetProperty.Name.CapitalizeFirstLetter()}){Environment.NewLine}"); writer.WriteSafeString($"{{{Environment.NewLine}"); @@ -414,7 +444,6 @@ private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter } writer.WriteSafeString($"}}{Environment.NewLine}"); - writer.WriteSafeString($"}}{Environment.NewLine}"); } else { @@ -457,19 +486,24 @@ private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter } var properties = umlClass.QueryAllProperties(); - + for (var alternativeIndex = 0; alternativeIndex < alternatives.Count; alternativeIndex++) { if (alternativeIndex != 0) { writer.WriteSafeString("else "); } - - var assignment =assignmentElements[alternativeIndex]; + + var assignment = assignmentElements[alternativeIndex]; var targetProperty = properties.Single(x => string.Equals(x.Name, assignment.Property)); - + var iterator = ruleGenerationContext.DefinedIterators.SingleOrDefault(x => x.ApplicableRuleElements.Contains(assignment)); - writer.WriteSafeString($"if({targetProperty.QueryIfStatementContentForNonEmpty(iterator?.IteratorVariableName ?? "poco")}){Environment.NewLine}"); + + if (assignment.Operator != "+=") + { + writer.WriteSafeString($"if({targetProperty.QueryIfStatementContentForNonEmpty(iterator?.IteratorVariableName ?? "poco")}){Environment.NewLine}"); + } + writer.WriteSafeString($"{{{Environment.NewLine}"); ProcessAssignmentElement(writer, umlClass, ruleGenerationContext, assignment, true); writer.WriteSafeString($"{Environment.NewLine}}}{Environment.NewLine}"); @@ -608,6 +642,10 @@ private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass ProcessAlternatives(writer, umlClass, groupElement.Alternatives, ruleGenerationContext); writer.WriteSafeString($"{Environment.NewLine}}}"); } + else if (groupElement.IsCollection) + { + writer.WriteSafeString("// Have to handle group collection"); // => hand code ! + } else { ProcessAlternatives(writer, umlClass, groupElement.Alternatives, ruleGenerationContext); @@ -663,17 +701,51 @@ private static void ProcessAssignmentElement(EncodedTextWriter writer, IClass um { if (assignmentElement.Value is NonTerminalElement nonTerminalElement) { - var iteratorToUse = ruleGenerationContext.DefinedIterators.Single(x => x.ApplicableRuleElements.Contains(assignmentElement)); - - if (!isPartOfMultipleAlternative && assignmentElement.Container is not GroupElement { IsCollection: true } && assignmentElement.Container is not GroupElement { IsOptional: true }) + string usedVariable; + + if (assignmentElement.TextualNotationRule.IsDispatcherRule) { - writer.WriteSafeString($"{iteratorToUse.IteratorVariableName}.MoveNext();{Environment.NewLine}"); + usedVariable = $"elementFor{assignmentElement.Property.CapitalizeFirstLetter()}"; + + var collectionName = ruleGenerationContext.CurrentVariableName.EndsWith(assignmentElement.Property, StringComparison.InvariantCultureIgnoreCase) + ? ruleGenerationContext.CurrentVariableName + : $"{ruleGenerationContext.CurrentVariableName}.{targetProperty.QueryPropertyNameBasedOnUmlProperties()}"; + + if (ruleGenerationContext.CallerRule is not NonTerminalElement { IsCollection: false }) + { + writer.WriteSafeString($"if(elementIndex < {collectionName}.Count){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + writer.WriteSafeString($"var {usedVariable} = {collectionName}[elementIndex];{Environment.NewLine}"); + } + else + { + writer.WriteSafeString($"var {usedVariable} = {collectionName}[0];{Environment.NewLine}"); + } + } + else + { + var iteratorToUse = ruleGenerationContext.DefinedIterators.Single(x => x.ApplicableRuleElements.Contains(assignmentElement)); + + if (!isPartOfMultipleAlternative && assignmentElement.Container is not GroupElement { IsCollection: true } && assignmentElement.Container is not GroupElement { IsOptional: true }) + { + writer.WriteSafeString($"{iteratorToUse.IteratorVariableName}.MoveNext();{Environment.NewLine}"); + } + + usedVariable = $"{iteratorToUse.IteratorVariableName}.Current"; } var previousVariableName = ruleGenerationContext.CurrentVariableName; - ruleGenerationContext.CurrentVariableName = $"{iteratorToUse.IteratorVariableName}.Current"; + ruleGenerationContext.CurrentVariableName = usedVariable; + var previousCaller = ruleGenerationContext.CallerRule; + ruleGenerationContext.CallerRule = assignmentElement; ProcessNonTerminalElement(writer, umlClass, nonTerminalElement, ruleGenerationContext); ruleGenerationContext.CurrentVariableName = previousVariableName; + ruleGenerationContext.CallerRule = previousCaller; + + if (assignmentElement.TextualNotationRule.IsDispatcherRule && ruleGenerationContext.CallerRule is not NonTerminalElement { IsCollection: false }) + { + writer.WriteSafeString("}"); + } } else if(assignmentElement.Value is GroupElement groupElement) { @@ -821,7 +893,31 @@ private static void ProcessNonTerminalElement(EncodedTextWriter writer, IClass u writer.WriteSafeString($"{Environment.NewLine}if ({ruleGenerationContext.CurrentVariableName} != null){Environment.NewLine}"); writer.WriteSafeString($"{{{Environment.NewLine}"); } - + + if (nonTerminalElement.IsCollection) + { + writer.WriteSafeString($"// Handle collection Non Terminal {Environment.NewLine}"); + + if (referencedRule is not { IsDispatcherRule: true }) + { + if (nonTerminalElement.TextualNotationRule.IsDispatcherRule) + { + writer.WriteSafeString($"Build{ nonTerminalElement.Name}Internal({ruleGenerationContext.CurrentVariableName}, elementIndex, stringBuilder);"); + } + else + { + writer.WriteSafeString($"Build{ nonTerminalElement.Name}Internal({ruleGenerationContext.CurrentVariableName}, stringBuilder);"); + } + } + else + { + var assignmentProperty = referencedRule.GetAssignmentElementNeedingDispatcher().Property; + + writer.WriteSafeString($"for(var {assignmentProperty}Index = 0; {assignmentProperty}Index < {ruleGenerationContext.CurrentVariableName}.{assignmentProperty.CapitalizeFirstLetter()}.Count; {assignmentProperty}Index++){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + } + } + if (typeTarget != ruleGenerationContext.NamedElementToGenerate.Name) { var targetType = umlClass.Cache.Values.OfType().SingleOrDefault(x => x.Name == typeTarget); @@ -830,27 +926,91 @@ private static void ProcessNonTerminalElement(EncodedTextWriter writer, IClass u { if (targetType is IClass targetClass && (umlClass.QueryAllGeneralClassifiers().Contains(targetClass) || !ruleGenerationContext.CurrentVariableName.Contains("poco"))) { - writer.WriteSafeString($"{targetType.Name}TextualNotationBuilder.Build{nonTerminalElement.Name}({ruleGenerationContext.CurrentVariableName}, stringBuilder);"); + if (ruleGenerationContext.CallerRule is AssignmentElement assignmentElement && assignmentElement.TextualNotationRule.IsDispatcherRule) + { + var castedVariableName = $"elementAs{targetClass.Name}"; + writer.WriteSafeString($"{Environment.NewLine}if ({ruleGenerationContext.CurrentVariableName} is {targetClass.QueryFullyQualifiedTypeName()} {castedVariableName}){Environment.NewLine}"); + ruleGenerationContext.CurrentVariableName = castedVariableName; + writer.WriteSafeString($"{{{Environment.NewLine}"); + } + + if (referencedRule?.IsDispatcherRule == true) + { + if (nonTerminalElement.IsCollection) + { + var indexName = $"{referencedRule.GetAssignmentElementNeedingDispatcher().Property}Index"; + writer.WriteSafeString($"{indexName} = {targetType.Name}TextualNotationBuilder.Build{nonTerminalElement.Name}({ruleGenerationContext.CurrentVariableName}, {indexName}, stringBuilder);"); + } + else + { + writer.WriteSafeString($"{targetType.Name}TextualNotationBuilder.Build{nonTerminalElement.Name}({ruleGenerationContext.CurrentVariableName}, 0, stringBuilder);"); + } + } + else + { + writer.WriteSafeString($"{targetType.Name}TextualNotationBuilder.Build{nonTerminalElement.Name}({ruleGenerationContext.CurrentVariableName}, stringBuilder);"); + } + + if (ruleGenerationContext.CallerRule is AssignmentElement { TextualNotationRule: {IsDispatcherRule: true} }) + { + writer.WriteSafeString($"{Environment.NewLine}}}"); + } } else { var previousCaller = ruleGenerationContext.CallerRule; ruleGenerationContext.CallerRule = nonTerminalElement; + var previousName = ruleGenerationContext.CurrentVariableName; + + if (referencedRule?.IsDispatcherRule == true) + { + ruleGenerationContext.CurrentVariableName = $"{previousName}.{referencedRule.GetAssignmentElementNeedingDispatcher().Property.CapitalizeFirstLetter()}"; + } + ProcessAlternatives(writer, umlClass, referencedRule?.Alternatives, ruleGenerationContext, isPartOfMultipleAlternative); ruleGenerationContext.CallerRule = previousCaller; + ruleGenerationContext.CurrentVariableName = previousName; } } else { var previousCaller = ruleGenerationContext.CallerRule; ruleGenerationContext.CallerRule = nonTerminalElement; + var previousName = ruleGenerationContext.CurrentVariableName; + + if (referencedRule?.IsDispatcherRule == true) + { + ruleGenerationContext.CurrentVariableName = $"{previousName}.{referencedRule.GetAssignmentElementNeedingDispatcher().Property.CapitalizeFirstLetter()}"; + } + ProcessAlternatives(writer, umlClass, referencedRule?.Alternatives, ruleGenerationContext, isPartOfMultipleAlternative); ruleGenerationContext.CallerRule = previousCaller; + ruleGenerationContext.CurrentVariableName = previousName; } } else { - writer.WriteSafeString($"Build{ nonTerminalElement.Name}({ruleGenerationContext.CurrentVariableName}, stringBuilder);"); + if (referencedRule?.IsDispatcherRule == true) + { + if (nonTerminalElement.IsCollection) + { + var indexName = $"{referencedRule.GetAssignmentElementNeedingDispatcher().Property}Index"; + writer.WriteSafeString($"{indexName} = Build{nonTerminalElement.Name}({ruleGenerationContext.CurrentVariableName}, {indexName}, stringBuilder);"); + } + else + { + writer.WriteSafeString($"Build{nonTerminalElement.Name}({ruleGenerationContext.CurrentVariableName}, 0, stringBuilder);"); + } + } + else + { + writer.WriteSafeString($"Build{ nonTerminalElement.Name}({ruleGenerationContext.CurrentVariableName}, stringBuilder);"); + } + } + + if (nonTerminalElement.IsCollection && referencedRule?.IsDispatcherRule == true) + { + writer.WriteSafeString($"{Environment.NewLine}}}"); } if (isForProperty && !isPartOfMultipleAlternative) @@ -871,7 +1031,7 @@ private static void DeclareIteratorIfRequired(EncodedTextWriter writer, IClass u var allProperties = umlClass.QueryAllProperties(); var targetProperty = allProperties.SingleOrDefault(x => string.Equals(x.Name, assignmentElement.Property, StringComparison.OrdinalIgnoreCase)); - if (targetProperty == null || !targetProperty.QueryIsEnumerable()) + if (targetProperty == null || !targetProperty.QueryIsEnumerable() || assignmentElement.TextualNotationRule.IsDispatcherRule) { return; } @@ -911,7 +1071,7 @@ private static void DeclareIteratorIfRequired(EncodedTextWriter writer, IClass u var targetType = umlClass.Cache.Values.OfType().SingleOrDefault(x => x.Name == typeTarget); iteratorToUse.ConstrainedType = targetType; - writer.WriteSafeString(targetType != null + 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();"); } 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 index c92a1ed1..130efcaa 100644 --- a/SysML2.NET.CodeGenerator/Templates/Uml/core-textual-notation-builder-template.hbs +++ b/SysML2.NET.CodeGenerator/Templates/Uml/core-textual-notation-builder-template.hbs @@ -24,6 +24,9 @@ namespace SysML2.NET.TextualNotation { +{{#if (RulesHelper.ContainsAnyDispatcherRules this.Rules)}} + using System.Collections.Generic; +{{~/if}} using System.Linq; using System.Text; @@ -35,13 +38,46 @@ namespace SysML2.NET.TextualNotation 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) + {{#if rule.IsDispatcherRule}} + {{#unless rule.IsMultiCollectionAssignment}} + /// + /// Builds the Textual Notation string for the rule {{Rule.RuleName}} + /// {{Rule.RawRule}} + /// + /// The from which the rule should be build + /// The index of the to process inside a specific collection + /// The that contains the entire textual notation + /// The index of the next to be processed inside the collection + public static int Build{{rule.RuleName}}({{ #NamedElement.WriteFullyQualifiedTypeName ../this.Context }} poco, int elementIndex, StringBuilder stringBuilder) + { + {{RulesHelper.WriteRule rule ../this.Context ../this.AllRules}} + return elementIndex; + } + {{else}} + /// + /// Builds the Textual Notation string for the rule {{Rule.RuleName}} + /// {{Rule.RawRule}} + /// + /// The from which the rule should be build + /// The collection of to process + /// The index of the to process inside the collection defined + /// The that contains the entire textual notation + /// The index of the next to be processed inside the collection + public static int Build{{rule.RuleName}}({{ #NamedElement.WriteFullyQualifiedTypeName ../this.Context }} poco, string propertyName, int elementIndex, StringBuilder stringBuilder) + { + {{RulesHelper.WriteRule rule ../this.Context ../this.AllRules}} + return elementIndex; + } + {{/unless}} + {{else}} + /// + /// 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) + {{/if}} { {{RulesHelper.WriteRule rule ../this.Context ../this.AllRules}} } @@ -55,4 +91,3 @@ namespace SysML2.NET.TextualNotation // ------------------------------------------------------------------------------------------------ // --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- // ------------------------------------------------------------------------------------------------ - \ No newline at end of file diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.cs index e7ddec66..b2b2cd5d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.cs @@ -75,7 +75,7 @@ public static void BuildAcceptParameterPart(SysML2.NET.Core.POCO.Systems.Actions if (ownedRelationshipOfParameterMembershipIterator.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildPayloadParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + ParameterMembershipTextualNotationBuilder.BuildPayloadParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); } if (ownedRelationshipOfParameterMembershipIterator.MoveNext()) @@ -84,7 +84,7 @@ public static void BuildAcceptParameterPart(SysML2.NET.Core.POCO.Systems.Actions if (ownedRelationshipOfParameterMembershipIterator.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); } stringBuilder.Append(' '); } @@ -130,7 +130,11 @@ public static void BuildTransitionAcceptActionUsage(SysML2.NET.Core.POCO.Systems if (BuildGroupConditionForTransitionAcceptActionUsage(poco)) { stringBuilder.Append("{"); - TypeTextualNotationBuilder.BuildActionBodyItem(poco, stringBuilder); + // Handle collection Non Terminal + for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + { + ownedRelationshipIndex = TypeTextualNotationBuilder.BuildActionBodyItem(poco, ownedRelationshipIndex, stringBuilder); + } stringBuilder.Append("}"); stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs index 1f5d1fcf..a8681f46 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs @@ -43,7 +43,7 @@ public static partial class ActionUsageTextualNotationBuilder public static void BuildActionUsageDeclaration(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, StringBuilder stringBuilder) { UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); - FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + FeatureTextualNotationBuilder.BuildValuePart(poco, 0, stringBuilder); } @@ -133,7 +133,7 @@ public static void BuildAssignmentNodeDeclaration(SysML2.NET.Core.POCO.Systems.A if (ownedRelationshipOfParameterMembershipIterator.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildAssignmentTargetMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + ParameterMembershipTextualNotationBuilder.BuildAssignmentTargetMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); } ownedRelationshipOfMembershipIterator.MoveNext(); @@ -146,7 +146,7 @@ public static void BuildAssignmentNodeDeclaration(SysML2.NET.Core.POCO.Systems.A if (ownedRelationshipOfParameterMembershipIterator.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); } } @@ -168,7 +168,11 @@ public static void BuildActionBodyParameter(SysML2.NET.Core.POCO.Systems.Actions } stringBuilder.Append("{"); - TypeTextualNotationBuilder.BuildActionBodyItem(poco, stringBuilder); + // Handle collection Non Terminal + for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + { + ownedRelationshipIndex = TypeTextualNotationBuilder.BuildActionBodyItem(poco, ownedRelationshipIndex, stringBuilder); + } stringBuilder.Append("}"); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseUsageTextualNotationBuilder.cs index 1d0f4015..ee7d8077 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseUsageTextualNotationBuilder.cs @@ -45,7 +45,7 @@ public static void BuildAnalysisCaseUsage(SysML2.NET.Core.POCO.Systems.AnalysisC OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("analysis "); UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); - FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + FeatureTextualNotationBuilder.BuildValuePart(poco, 0, stringBuilder); TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.cs index 7f894330..7b70bec2 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -39,17 +40,22 @@ public static partial class AnnotationTextualNotationBuilder /// OwnedAnnotation:Annotation=ownedRelatedElement+=AnnotatingElement /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildOwnedAnnotation(SysML2.NET.Core.POCO.Root.Annotations.IAnnotation poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildOwnedAnnotation(SysML2.NET.Core.POCO.Root.Annotations.IAnnotation poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfAnnotatingElementIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfAnnotatingElementIterator.MoveNext(); - - if (ownedRelatedElementOfAnnotatingElementIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - AnnotatingElementTextualNotationBuilder.BuildAnnotatingElement(ownedRelatedElementOfAnnotatingElementIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Root.Annotations.IAnnotatingElement elementAsAnnotatingElement) + { + AnnotatingElementTextualNotationBuilder.BuildAnnotatingElement(elementAsAnnotatingElement, stringBuilder); + } } + return elementIndex; } /// @@ -64,12 +70,11 @@ public static void BuildPrefixMetadataAnnotation(SysML2.NET.Core.POCO.Root.Annot if (poco.annotatingElement != null) { - using var ownedRelationshipOfFeatureTypingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfFeatureTypingIterator.MoveNext(); + var elementForOwnedRelationship = poco.annotatingElement.OwnedRelationship[0]; - if (ownedRelationshipOfFeatureTypingIterator.Current != null) + if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Core.Features.IFeatureTyping elementAsFeatureTyping) { - FeatureTypingTextualNotationBuilder.BuildOwnedFeatureTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + FeatureTypingTextualNotationBuilder.BuildOwnedFeatureTyping(elementAsFeatureTyping, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssignmentActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssignmentActionUsageTextualNotationBuilder.cs index 069d63a8..b592c9e3 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssignmentActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssignmentActionUsageTextualNotationBuilder.cs @@ -74,7 +74,11 @@ public static void BuildTransitionAssignmentActionUsage(SysML2.NET.Core.POCO.Sys if (BuildGroupConditionForTransitionAssignmentActionUsage(poco)) { stringBuilder.Append("{"); - TypeTextualNotationBuilder.BuildActionBodyItem(poco, stringBuilder); + // Handle collection Non Terminal + for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + { + ownedRelationshipIndex = TypeTextualNotationBuilder.BuildActionBodyItem(poco, ownedRelationshipIndex, stringBuilder); + } stringBuilder.Append("}"); stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorAsUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorAsUsageTextualNotationBuilder.cs index 495c3fbc..58e83d54 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorAsUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorAsUsageTextualNotationBuilder.cs @@ -57,14 +57,14 @@ public static void BuildBindingConnectorAsUsage(SysML2.NET.Core.POCO.Systems.Con if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); } stringBuilder.Append("="); ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); } UsageTextualNotationBuilder.BuildUsageBody(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BooleanExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BooleanExpressionTextualNotationBuilder.cs index 8f8ae380..3bff4040 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BooleanExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BooleanExpressionTextualNotationBuilder.cs @@ -58,7 +58,7 @@ public static void BuildBooleanExpression(SysML2.NET.Core.POCO.Kernel.Functions. stringBuilder.Append("bool "); FeatureTextualNotationBuilder.BuildFeatureDeclaration(poco, stringBuilder); - FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + FeatureTextualNotationBuilder.BuildValuePart(poco, 0, stringBuilder); TypeTextualNotationBuilder.BuildFunctionBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseUsageTextualNotationBuilder.cs index 00ef1b6b..c67d2877 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseUsageTextualNotationBuilder.cs @@ -45,7 +45,7 @@ public static void BuildCaseUsage(SysML2.NET.Core.POCO.Systems.Cases.ICaseUsage OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("case "); UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); - FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + FeatureTextualNotationBuilder.BuildValuePart(poco, 0, stringBuilder); TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs index 7aadbfdd..7ed17253 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs @@ -87,7 +87,7 @@ public static void BuildClassifierDeclaration(SysML2.NET.Core.POCO.Core.Classifi if (ownedRelationshipOfOwningMembershipIterator.Current != null) { - OwningMembershipTextualNotationBuilder.BuildOwnedMultiplicity(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + OwningMembershipTextualNotationBuilder.BuildOwnedMultiplicity(ownedRelationshipOfOwningMembershipIterator.Current, 0, stringBuilder); } stringBuilder.Append(' '); } @@ -102,7 +102,8 @@ public static void BuildClassifierDeclaration(SysML2.NET.Core.POCO.Core.Classifi break; } - TypeTextualNotationBuilder.BuildTypeRelationshipPart(poco, stringBuilder); + // Handle collection Non Terminal + BuildTypeRelationshipPartInternal(poco, stringBuilder); TypeTextualNotationBuilder.BuildTypeRelationshipPart(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernUsageTextualNotationBuilder.cs index 993889c7..1a59e35d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -39,10 +40,13 @@ public static partial class ConcernUsageTextualNotationBuilder /// FramedConcernUsage:ConcernUsage=ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?CalculationBody|(UsageExtensionKeyword*'concern'|UsageExtensionKeyword+)CalculationUsageDeclarationCalculationBody /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildFramedConcernUsage(SysML2.NET.Core.POCO.Systems.Requirements.IConcernUsage poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildFramedConcernUsage(SysML2.NET.Core.POCO.Systems.Requirements.IConcernUsage poco, int elementIndex, StringBuilder stringBuilder) { throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + return elementIndex; } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortDefinitionTextualNotationBuilder.cs index 8118e68e..154d73f6 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortDefinitionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -39,17 +40,22 @@ public static partial class ConjugatedPortDefinitionTextualNotationBuilder /// ConjugatedPortDefinition=ownedRelationship+=PortConjugation /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildConjugatedPortDefinition(SysML2.NET.Core.POCO.Systems.Ports.IConjugatedPortDefinition poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildConjugatedPortDefinition(SysML2.NET.Core.POCO.Systems.Ports.IConjugatedPortDefinition poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelationshipOfPortConjugationIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfPortConjugationIterator.MoveNext(); - - if (ownedRelationshipOfPortConjugationIterator.Current != null) + if (elementIndex < poco.OwnedRelationship.Count) { - PortConjugationTextualNotationBuilder.BuildPortConjugation(ownedRelationshipOfPortConjugationIterator.Current, stringBuilder); + var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; + + if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Systems.Ports.IPortConjugation elementAsPortConjugation) + { + PortConjugationTextualNotationBuilder.BuildPortConjugation(elementAsPortConjugation, stringBuilder); + } } + return elementIndex; } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs index 5f08745e..76390744 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs @@ -58,14 +58,14 @@ public static void BuildBinaryConnectorPart(SysML2.NET.Core.POCO.Systems.Connect if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); } stringBuilder.Append("to "); ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); } } @@ -84,14 +84,14 @@ public static void BuildNaryConnectorPart(SysML2.NET.Core.POCO.Systems.Connectio if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); } stringBuilder.Append(","); ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); } while (ownedRelationshipOfEndFeatureMembershipIterator.MoveNext()) @@ -100,7 +100,7 @@ public static void BuildNaryConnectorPart(SysML2.NET.Core.POCO.Systems.Connectio if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs index 90838db7..76f6be80 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs @@ -59,14 +59,14 @@ public static void BuildBinaryConnectorDeclaration(SysML2.NET.Core.POCO.Kernel.C if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); } stringBuilder.Append("to "); ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); } } @@ -86,14 +86,14 @@ public static void BuildNaryConnectorDeclaration(SysML2.NET.Core.POCO.Kernel.Con if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); } stringBuilder.Append(","); ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); } while (ownedRelationshipOfEndFeatureMembershipIterator.MoveNext()) @@ -102,7 +102,7 @@ public static void BuildNaryConnectorDeclaration(SysML2.NET.Core.POCO.Kernel.Con if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintUsageTextualNotationBuilder.cs index 151ba9f0..54cfc663 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -43,7 +44,7 @@ public static partial class ConstraintUsageTextualNotationBuilder public static void BuildConstraintUsageDeclaration(SysML2.NET.Core.POCO.Systems.Constraints.IConstraintUsage poco, StringBuilder stringBuilder) { UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); - FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + FeatureTextualNotationBuilder.BuildValuePart(poco, 0, stringBuilder); } @@ -52,10 +53,13 @@ public static void BuildConstraintUsageDeclaration(SysML2.NET.Core.POCO.Systems. /// RequirementConstraintUsage:ConstraintUsage=ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?RequirementBody|(UsageExtensionKeyword*'constraint'|UsageExtensionKeyword+)ConstraintUsageDeclarationCalculationBody /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildRequirementConstraintUsage(SysML2.NET.Core.POCO.Systems.Constraints.IConstraintUsage poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildRequirementConstraintUsage(SysML2.NET.Core.POCO.Systems.Constraints.IConstraintUsage poco, int elementIndex, StringBuilder stringBuilder) { throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + return elementIndex; } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstructorExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstructorExpressionTextualNotationBuilder.cs index aa87c35b..80092661 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstructorExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstructorExpressionTextualNotationBuilder.cs @@ -55,7 +55,7 @@ public static void BuildConstructorExpression(SysML2.NET.Core.POCO.Kernel.Expres if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) { - ReturnParameterMembershipTextualNotationBuilder.BuildConstructorResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + ReturnParameterMembershipTextualNotationBuilder.BuildConstructorResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, 0, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs index a6f44863..aec5ca1d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -39,17 +40,22 @@ public static partial class DefinitionTextualNotationBuilder /// DefinitionExtensionKeyword:Definition=ownedRelationship+=PrefixMetadataMember /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildDefinitionExtensionKeyword(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IDefinition poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildDefinitionExtensionKeyword(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IDefinition poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfOwningMembershipIterator.MoveNext(); - - if (ownedRelationshipOfOwningMembershipIterator.Current != null) + if (elementIndex < poco.OwnedRelationship.Count) { - OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; + + if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(elementAsOwningMembership, stringBuilder); + } } + return elementIndex; } /// @@ -69,7 +75,11 @@ public static void BuildDefinitionPrefix(SysML2.NET.Core.POCO.Systems.Definition stringBuilder.Append(" variation "); } - BuildDefinitionExtensionKeyword(poco, stringBuilder); + // Handle collection Non Terminal + for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + { + ownedRelationshipIndex = BuildDefinitionExtensionKeyword(poco, ownedRelationshipIndex, stringBuilder); + } } @@ -103,7 +113,11 @@ public static void BuildExtendedDefinition(SysML2.NET.Core.POCO.Systems.Definiti stringBuilder.Append(" variation "); } - BuildDefinitionExtensionKeyword(poco, stringBuilder); + // Handle collection Non Terminal + for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + { + ownedRelationshipIndex = BuildDefinitionExtensionKeyword(poco, ownedRelationshipIndex, stringBuilder); + } stringBuilder.Append("def "); BuildDefinition(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DifferencingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DifferencingTextualNotationBuilder.cs index 8ef24835..91ed2310 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DifferencingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DifferencingTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -39,24 +40,30 @@ public static partial class DifferencingTextualNotationBuilder /// Differencing=differencingType=[QualifiedName]|ownedRelatedElement+=OwnedFeatureChain /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildDifferencing(SysML2.NET.Core.POCO.Core.Types.IDifferencing poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildDifferencing(SysML2.NET.Core.POCO.Core.Types.IDifferencing poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); if (poco.DifferencingType != null) { stringBuilder.Append(poco.DifferencingType.qualifiedName); stringBuilder.Append(' '); } - else if (ownedRelatedElementOfFeatureIterator.MoveNext()) + else { - - if (ownedRelatedElementOfFeatureIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - FeatureTextualNotationBuilder.BuildOwnedFeatureChain(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Core.Features.IFeature elementAsFeature) + { + FeatureTextualNotationBuilder.BuildOwnedFeatureChain(elementAsFeature, stringBuilder); + } } } + return elementIndex; } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EndFeatureMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EndFeatureMembershipTextualNotationBuilder.cs index 4683a227..45e0c3a9 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EndFeatureMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EndFeatureMembershipTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -39,17 +40,22 @@ public static partial class EndFeatureMembershipTextualNotationBuilder /// SourceEndMember:EndFeatureMembership=ownedRelatedElement+=SourceEnd /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildSourceEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildSourceEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfReferenceUsageIterator.MoveNext(); - - if (ownedRelatedElementOfReferenceUsageIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - ReferenceUsageTextualNotationBuilder.BuildSourceEnd(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage elementAsReferenceUsage) + { + ReferenceUsageTextualNotationBuilder.BuildSourceEnd(elementAsReferenceUsage, stringBuilder); + } } + return elementIndex; } /// @@ -57,17 +63,22 @@ public static void BuildSourceEndMember(SysML2.NET.Core.POCO.Core.Features.IEndF /// ConnectorEndMember:EndFeatureMembership=ownedRelatedElement+=ConnectorEnd /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildConnectorEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildConnectorEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfReferenceUsageIterator.MoveNext(); - - if (ownedRelatedElementOfReferenceUsageIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - ReferenceUsageTextualNotationBuilder.BuildConnectorEnd(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage elementAsReferenceUsage) + { + ReferenceUsageTextualNotationBuilder.BuildConnectorEnd(elementAsReferenceUsage, stringBuilder); + } } + return elementIndex; } /// @@ -75,17 +86,22 @@ public static void BuildConnectorEndMember(SysML2.NET.Core.POCO.Core.Features.IE /// InterfaceEndMember:EndFeatureMembership=ownedRelatedElement+=InterfaceEnd /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildInterfaceEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildInterfaceEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfPortUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfPortUsageIterator.MoveNext(); - - if (ownedRelatedElementOfPortUsageIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - PortUsageTextualNotationBuilder.BuildInterfaceEnd(ownedRelatedElementOfPortUsageIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Systems.Ports.IPortUsage elementAsPortUsage) + { + PortUsageTextualNotationBuilder.BuildInterfaceEnd(elementAsPortUsage, stringBuilder); + } } + return elementIndex; } /// @@ -93,17 +109,22 @@ public static void BuildInterfaceEndMember(SysML2.NET.Core.POCO.Core.Features.IE /// FlowEndMember:EndFeatureMembership=ownedRelatedElement+=FlowEnd /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildFlowEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildFlowEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfFlowEndIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfFlowEndIterator.MoveNext(); - - if (ownedRelatedElementOfFlowEndIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - FlowEndTextualNotationBuilder.BuildFlowEnd(ownedRelatedElementOfFlowEndIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Kernel.Interactions.IFlowEnd elementAsFlowEnd) + { + FlowEndTextualNotationBuilder.BuildFlowEnd(elementAsFlowEnd, stringBuilder); + } } + return elementIndex; } /// @@ -111,17 +132,22 @@ public static void BuildFlowEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFea /// EmptyEndMember:EndFeatureMembership=ownedRelatedElement+=EmptyFeature /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildEmptyEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildEmptyEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfReferenceUsageIterator.MoveNext(); - - if (ownedRelatedElementOfReferenceUsageIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - ReferenceUsageTextualNotationBuilder.BuildEmptyFeature(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage elementAsReferenceUsage) + { + ReferenceUsageTextualNotationBuilder.BuildEmptyFeature(elementAsReferenceUsage, stringBuilder); + } } + return elementIndex; } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationDefinitionTextualNotationBuilder.cs index 164f20a3..de05297a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationDefinitionTextualNotationBuilder.cs @@ -53,7 +53,11 @@ public static void BuildEnumerationBody(SysML2.NET.Core.POCO.Systems.Enumeration /// 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); + // Handle collection Non Terminal + for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + { + ownedRelationshipIndex = DefinitionTextualNotationBuilder.BuildDefinitionExtensionKeyword(poco, ownedRelationshipIndex, stringBuilder); + } stringBuilder.Append("enum "); stringBuilder.Append("def "); DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EventOccurrenceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EventOccurrenceUsageTextualNotationBuilder.cs index 03d79240..317e9911 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EventOccurrenceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EventOccurrenceUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -39,17 +40,22 @@ public static partial class EventOccurrenceUsageTextualNotationBuilder /// MessageEvent:EventOccurrenceUsage=ownedRelationship+=OwnedReferenceSubsetting /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildMessageEvent(SysML2.NET.Core.POCO.Systems.Occurrences.IEventOccurrenceUsage poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildMessageEvent(SysML2.NET.Core.POCO.Systems.Occurrences.IEventOccurrenceUsage poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelationshipOfReferenceSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfReferenceSubsettingIterator.MoveNext(); - - if (ownedRelationshipOfReferenceSubsettingIterator.Current != null) + if (elementIndex < poco.OwnedRelationship.Count) { - ReferenceSubsettingTextualNotationBuilder.BuildOwnedReferenceSubsetting(ownedRelationshipOfReferenceSubsettingIterator.Current, stringBuilder); + var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; + + if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Core.Features.IReferenceSubsetting elementAsReferenceSubsetting) + { + ReferenceSubsettingTextualNotationBuilder.BuildOwnedReferenceSubsetting(elementAsReferenceSubsetting, stringBuilder); + } } + return elementIndex; } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExhibitStateUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExhibitStateUsageTextualNotationBuilder.cs index 6cd6147c..ac50e248 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExhibitStateUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExhibitStateUsageTextualNotationBuilder.cs @@ -47,7 +47,7 @@ public static void BuildExhibitStateUsage(SysML2.NET.Core.POCO.Systems.States.IE stringBuilder.Append("exhibit "); throw new System.NotSupportedException("Multiple alternatives not implemented yet"); stringBuilder.Append(' '); - FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + FeatureTextualNotationBuilder.BuildValuePart(poco, 0, stringBuilder); StateUsageTextualNotationBuilder.BuildStateUsageBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs index 3a7226e9..2c89626f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -106,17 +107,22 @@ public static void BuildSequenceExpressionList(SysML2.NET.Core.POCO.Kernel.Funct /// FunctionReference:Expression=ownedRelationship+=ReferenceTyping /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildFunctionReference(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildFunctionReference(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelationshipOfFeatureTypingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfFeatureTypingIterator.MoveNext(); - - if (ownedRelationshipOfFeatureTypingIterator.Current != null) + if (elementIndex < poco.OwnedRelationship.Count) { - FeatureTypingTextualNotationBuilder.BuildReferenceTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; + + if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Core.Features.IFeatureTyping elementAsFeatureTyping) + { + FeatureTypingTextualNotationBuilder.BuildReferenceTyping(elementAsFeatureTyping, stringBuilder); + } } + return elementIndex; } /// @@ -168,7 +174,7 @@ public static void BuildExpression(SysML2.NET.Core.POCO.Kernel.Functions.IExpres stringBuilder.Append("expr "); FeatureTextualNotationBuilder.BuildFeatureDeclaration(poco, stringBuilder); - FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + FeatureTextualNotationBuilder.BuildValuePart(poco, 0, stringBuilder); TypeTextualNotationBuilder.BuildFunctionBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs index 03d538f3..f91845e9 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -124,7 +125,7 @@ public static void BuildSourceSuccessionMember(SysML2.NET.Core.POCO.Core.Types.I if (ownedRelatedElementOfSuccessionAsUsageIterator.Current != null) { - SuccessionAsUsageTextualNotationBuilder.BuildSourceSuccession(ownedRelatedElementOfSuccessionAsUsageIterator.Current, stringBuilder); + SuccessionAsUsageTextualNotationBuilder.BuildSourceSuccession(ownedRelatedElementOfSuccessionAsUsageIterator.Current, 0, stringBuilder); } } @@ -172,17 +173,22 @@ public static void BuildInterfaceOccurrenceUsageMember(SysML2.NET.Core.POCO.Core /// FlowPayloadFeatureMember:FeatureMembership=ownedRelatedElement+=FlowPayloadFeature /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildFlowPayloadFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildFlowPayloadFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfPayloadFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfPayloadFeatureIterator.MoveNext(); - - if (ownedRelatedElementOfPayloadFeatureIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - PayloadFeatureTextualNotationBuilder.BuildFlowPayloadFeature(ownedRelatedElementOfPayloadFeatureIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Kernel.Interactions.IPayloadFeature elementAsPayloadFeature) + { + PayloadFeatureTextualNotationBuilder.BuildFlowPayloadFeature(elementAsPayloadFeature, stringBuilder); + } } + return elementIndex; } /// @@ -190,17 +196,22 @@ public static void BuildFlowPayloadFeatureMember(SysML2.NET.Core.POCO.Core.Types /// FlowFeatureMember:FeatureMembership=ownedRelatedElement+=FlowFeature /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildFlowFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildFlowFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfReferenceUsageIterator.MoveNext(); - - if (ownedRelatedElementOfReferenceUsageIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - ReferenceUsageTextualNotationBuilder.BuildFlowFeature(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage elementAsReferenceUsage) + { + ReferenceUsageTextualNotationBuilder.BuildFlowFeature(elementAsReferenceUsage, 0, stringBuilder); + } } + return elementIndex; } /// @@ -291,17 +302,22 @@ public static void BuildGuardedSuccessionMember(SysML2.NET.Core.POCO.Core.Types. /// ForVariableDeclarationMember:FeatureMembership=ownedRelatedElement+=UsageDeclaration /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildForVariableDeclarationMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildForVariableDeclarationMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfUsageIterator.MoveNext(); - - if (ownedRelatedElementOfUsageIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - UsageTextualNotationBuilder.BuildUsageDeclaration(ownedRelatedElementOfUsageIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage elementAsUsage) + { + UsageTextualNotationBuilder.BuildUsageDeclaration(elementAsUsage, stringBuilder); + } } + return elementIndex; } /// @@ -387,7 +403,7 @@ public static void BuildMetadataBodyUsageMember(SysML2.NET.Core.POCO.Core.Types. if (poco.ownedMemberFeature != null) { - FeatureTextualNotationBuilder.BuildValuePart(poco.ownedMemberFeature, stringBuilder); + FeatureTextualNotationBuilder.BuildValuePart(poco.ownedMemberFeature, 0, stringBuilder); } if (poco.ownedMemberFeature != null) @@ -423,17 +439,22 @@ public static void BuildOwnedFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFeat /// OwnedExpressionReferenceMember:FeatureMembership=ownedRelationship+=OwnedExpressionReference /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildOwnedExpressionReferenceMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildOwnedExpressionReferenceMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelationshipOfFeatureReferenceExpressionIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfFeatureReferenceExpressionIterator.MoveNext(); - - if (ownedRelationshipOfFeatureReferenceExpressionIterator.Current != null) + if (elementIndex < poco.OwnedRelationship.Count) { - FeatureReferenceExpressionTextualNotationBuilder.BuildOwnedExpressionReference(ownedRelationshipOfFeatureReferenceExpressionIterator.Current, stringBuilder); + var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; + + if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression elementAsFeatureReferenceExpression) + { + FeatureReferenceExpressionTextualNotationBuilder.BuildOwnedExpressionReference(elementAsFeatureReferenceExpression, 0, stringBuilder); + } } + return elementIndex; } /// @@ -475,12 +496,11 @@ public static void BuildFunctionReferenceMember(SysML2.NET.Core.POCO.Core.Types. if (poco.ownedMemberFeature != null) { - using var ownedRelationshipOfFeatureTypingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfFeatureTypingIterator.MoveNext(); + var elementForOwnedRelationship = poco.ownedMemberFeature.OwnedRelationship[0]; - if (ownedRelationshipOfFeatureTypingIterator.Current != null) + if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Core.Features.IFeatureTyping elementAsFeatureTyping) { - FeatureTypingTextualNotationBuilder.BuildReferenceTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + FeatureTypingTextualNotationBuilder.BuildReferenceTyping(elementAsFeatureTyping, stringBuilder); } } @@ -539,7 +559,7 @@ public static void BuildPayloadFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFe if (ownedRelatedElementOfFeatureIterator.Current != null) { - FeatureTextualNotationBuilder.BuildPayloadFeature(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + FeatureTextualNotationBuilder.BuildPayloadFeature(ownedRelatedElementOfFeatureIterator.Current, 0, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureReferenceExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureReferenceExpressionTextualNotationBuilder.cs index f11f4fd5..c9e7d951 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureReferenceExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureReferenceExpressionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -39,17 +40,22 @@ public static partial class FeatureReferenceExpressionTextualNotationBuilder /// SatisfactionReferenceExpression:FeatureReferenceExpression=ownedRelationship+=FeatureChainMember /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildSatisfactionReferenceExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildSatisfactionReferenceExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelationshipOfMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfMembershipIterator.MoveNext(); - - if (ownedRelationshipOfMembershipIterator.Current != null) + if (elementIndex < poco.OwnedRelationship.Count) { - MembershipTextualNotationBuilder.BuildFeatureChainMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; + + if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Root.Namespaces.IMembership elementAsMembership) + { + MembershipTextualNotationBuilder.BuildFeatureChainMember(elementAsMembership, stringBuilder); + } } + return elementIndex; } /// @@ -57,17 +63,22 @@ public static void BuildSatisfactionReferenceExpression(SysML2.NET.Core.POCO.Ker /// OwnedExpressionReference:FeatureReferenceExpression=ownedRelationship+=OwnedExpressionMember /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildOwnedExpressionReference(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildOwnedExpressionReference(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfFeatureMembershipIterator.MoveNext(); - - if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + if (elementIndex < poco.OwnedRelationship.Count) { - FeatureMembershipTextualNotationBuilder.BuildOwnedExpressionMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; + + if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Core.Types.IFeatureMembership elementAsFeatureMembership) + { + FeatureMembershipTextualNotationBuilder.BuildOwnedExpressionMember(elementAsFeatureMembership, stringBuilder); + } } + return elementIndex; } /// @@ -75,17 +86,22 @@ public static void BuildOwnedExpressionReference(SysML2.NET.Core.POCO.Kernel.Exp /// FunctionReferenceExpression:FeatureReferenceExpression=ownedRelationship+=FunctionReferenceMember /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildFunctionReferenceExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildFunctionReferenceExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfFeatureMembershipIterator.MoveNext(); - - if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + if (elementIndex < poco.OwnedRelationship.Count) { - FeatureMembershipTextualNotationBuilder.BuildFunctionReferenceMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; + + if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Core.Types.IFeatureMembership elementAsFeatureMembership) + { + FeatureMembershipTextualNotationBuilder.BuildFunctionReferenceMember(elementAsFeatureMembership, stringBuilder); + } } + return elementIndex; } /// @@ -108,7 +124,7 @@ public static void BuildFeatureReferenceExpression(SysML2.NET.Core.POCO.Kernel.E if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) { - ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, 0, stringBuilder); } } @@ -118,17 +134,22 @@ public static void BuildFeatureReferenceExpression(SysML2.NET.Core.POCO.Kernel.E /// BodyExpression:FeatureReferenceExpression=ownedRelationship+=ExpressionBodyMember /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildBodyExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildBodyExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfFeatureMembershipIterator.MoveNext(); - - if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + if (elementIndex < poco.OwnedRelationship.Count) { - FeatureMembershipTextualNotationBuilder.BuildExpressionBodyMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; + + if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Core.Types.IFeatureMembership elementAsFeatureMembership) + { + FeatureMembershipTextualNotationBuilder.BuildExpressionBodyMember(elementAsFeatureMembership, stringBuilder); + } } + return elementIndex; } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs index 2985ce14..3718f27e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -39,17 +40,22 @@ public static partial class FeatureTextualNotationBuilder /// ValuePart:Feature=ownedRelationship+=FeatureValue /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildValuePart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildValuePart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfFeatureValueIterator.MoveNext(); - - if (ownedRelationshipOfFeatureValueIterator.Current != null) + if (elementIndex < poco.OwnedRelationship.Count) { - FeatureValueTextualNotationBuilder.BuildFeatureValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; + + if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue elementAsFeatureValue) + { + FeatureValueTextualNotationBuilder.BuildFeatureValue(elementAsFeatureValue, stringBuilder); + } } + return elementIndex; } /// @@ -276,10 +282,13 @@ public static void BuildOwnedFeatureChain(SysML2.NET.Core.POCO.Core.Features.IFe /// 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 index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildMultiplicityPart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildMultiplicityPart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, int elementIndex, StringBuilder stringBuilder) { throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + return elementIndex; } /// @@ -287,17 +296,22 @@ public static void BuildMultiplicityPart(SysML2.NET.Core.POCO.Core.Features.IFea /// OwnedCrossMultiplicity:Feature=ownedRelationship+=OwnedMultiplicity /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildOwnedCrossMultiplicity(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildOwnedCrossMultiplicity(SysML2.NET.Core.POCO.Core.Features.IFeature poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfOwningMembershipIterator.MoveNext(); - - if (ownedRelationshipOfOwningMembershipIterator.Current != null) + if (elementIndex < poco.OwnedRelationship.Count) { - OwningMembershipTextualNotationBuilder.BuildOwnedMultiplicity(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; + + if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + { + OwningMembershipTextualNotationBuilder.BuildOwnedMultiplicity(elementAsOwningMembership, 0, stringBuilder); + } } + return elementIndex; } /// @@ -305,10 +319,13 @@ public static void BuildOwnedCrossMultiplicity(SysML2.NET.Core.POCO.Core.Feature /// PayloadFeature:Feature=Identification?PayloadFeatureSpecializationPartValuePart?|ownedRelationship+=OwnedFeatureTyping(ownedRelationship+=OwnedMultiplicity)?|ownedRelationship+=OwnedMultiplicityownedRelationship+=OwnedFeatureTyping /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildPayloadFeature(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildPayloadFeature(SysML2.NET.Core.POCO.Core.Features.IFeature poco, int elementIndex, StringBuilder stringBuilder) { throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + return elementIndex; } /// @@ -358,17 +375,22 @@ public static void BuildFeatureChainPrefix(SysML2.NET.Core.POCO.Core.Features.IF /// TriggerValuePart:Feature=ownedRelationship+=TriggerFeatureValue /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildTriggerValuePart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildTriggerValuePart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfFeatureValueIterator.MoveNext(); - - if (ownedRelationshipOfFeatureValueIterator.Current != null) + if (elementIndex < poco.OwnedRelationship.Count) { - FeatureValueTextualNotationBuilder.BuildTriggerFeatureValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; + + if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue elementAsFeatureValue) + { + FeatureValueTextualNotationBuilder.BuildTriggerFeatureValue(elementAsFeatureValue, 0, stringBuilder); + } } + return elementIndex; } /// @@ -376,17 +398,22 @@ public static void BuildTriggerValuePart(SysML2.NET.Core.POCO.Core.Features.IFea /// Argument:Feature=ownedRelationship+=ArgumentValue /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfFeatureValueIterator.MoveNext(); - - if (ownedRelationshipOfFeatureValueIterator.Current != null) + if (elementIndex < poco.OwnedRelationship.Count) { - FeatureValueTextualNotationBuilder.BuildArgumentValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; + + if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue elementAsFeatureValue) + { + FeatureValueTextualNotationBuilder.BuildArgumentValue(elementAsFeatureValue, stringBuilder); + } } + return elementIndex; } /// @@ -394,17 +421,22 @@ public static void BuildArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poc /// ArgumentExpression:Feature=ownedRelationship+=ArgumentExpressionValue /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildArgumentExpression(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildArgumentExpression(SysML2.NET.Core.POCO.Core.Features.IFeature poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfFeatureValueIterator.MoveNext(); - - if (ownedRelationshipOfFeatureValueIterator.Current != null) + if (elementIndex < poco.OwnedRelationship.Count) { - FeatureValueTextualNotationBuilder.BuildArgumentExpressionValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; + + if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue elementAsFeatureValue) + { + FeatureValueTextualNotationBuilder.BuildArgumentExpressionValue(elementAsFeatureValue, 0, stringBuilder); + } } + return elementIndex; } /// @@ -533,7 +565,8 @@ public static void BuildFeatureDeclaration(SysML2.NET.Core.POCO.Core.Features.IF throw new System.NotSupportedException("Multiple alternatives not implemented yet"); stringBuilder.Append(' '); - BuildFeatureRelationshipPart(poco, stringBuilder); + // Handle collection Non Terminal + BuildFeatureRelationshipPartInternal(poco, stringBuilder); BuildFeatureRelationshipPart(poco, stringBuilder); } @@ -672,17 +705,22 @@ public static void BuildFeatureChain(SysML2.NET.Core.POCO.Core.Features.IFeature /// MetadataArgument:Feature=ownedRelationship+=MetadataValue /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildMetadataArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildMetadataArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfFeatureValueIterator.MoveNext(); - - if (ownedRelationshipOfFeatureValueIterator.Current != null) + if (elementIndex < poco.OwnedRelationship.Count) { - FeatureValueTextualNotationBuilder.BuildMetadataValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; + + if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue elementAsFeatureValue) + { + FeatureValueTextualNotationBuilder.BuildMetadataValue(elementAsFeatureValue, stringBuilder); + } } + return elementIndex; } /// @@ -690,17 +728,22 @@ public static void BuildMetadataArgument(SysML2.NET.Core.POCO.Core.Features.IFea /// TypeReference:Feature=ownedRelationship+=ReferenceTyping /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildTypeReference(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildTypeReference(SysML2.NET.Core.POCO.Core.Features.IFeature poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelationshipOfFeatureTypingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfFeatureTypingIterator.MoveNext(); - - if (ownedRelationshipOfFeatureTypingIterator.Current != null) + if (elementIndex < poco.OwnedRelationship.Count) { - FeatureTypingTextualNotationBuilder.BuildReferenceTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; + + if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Core.Features.IFeatureTyping elementAsFeatureTyping) + { + FeatureTypingTextualNotationBuilder.BuildReferenceTyping(elementAsFeatureTyping, stringBuilder); + } } + return elementIndex; } /// @@ -708,17 +751,22 @@ public static void BuildTypeReference(SysML2.NET.Core.POCO.Core.Features.IFeatur /// PrimaryArgument:Feature=ownedRelationship+=PrimaryArgumentValue /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildPrimaryArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildPrimaryArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfFeatureValueIterator.MoveNext(); - - if (ownedRelationshipOfFeatureValueIterator.Current != null) + if (elementIndex < poco.OwnedRelationship.Count) { - FeatureValueTextualNotationBuilder.BuildPrimaryArgumentValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; + + if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue elementAsFeatureValue) + { + FeatureValueTextualNotationBuilder.BuildPrimaryArgumentValue(elementAsFeatureValue, stringBuilder); + } } + return elementIndex; } /// @@ -726,17 +774,22 @@ public static void BuildPrimaryArgument(SysML2.NET.Core.POCO.Core.Features.IFeat /// NonFeatureChainPrimaryArgument:Feature=ownedRelationship+=NonFeatureChainPrimaryArgumentValue /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildNonFeatureChainPrimaryArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildNonFeatureChainPrimaryArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfFeatureValueIterator.MoveNext(); - - if (ownedRelationshipOfFeatureValueIterator.Current != null) + if (elementIndex < poco.OwnedRelationship.Count) { - FeatureValueTextualNotationBuilder.BuildNonFeatureChainPrimaryArgumentValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; + + if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue elementAsFeatureValue) + { + FeatureValueTextualNotationBuilder.BuildNonFeatureChainPrimaryArgumentValue(elementAsFeatureValue, stringBuilder); + } } + return elementIndex; } /// @@ -744,17 +797,22 @@ public static void BuildNonFeatureChainPrimaryArgument(SysML2.NET.Core.POCO.Core /// BodyArgument:Feature=ownedRelationship+=BodyArgumentValue /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildBodyArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildBodyArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfFeatureValueIterator.MoveNext(); - - if (ownedRelationshipOfFeatureValueIterator.Current != null) + if (elementIndex < poco.OwnedRelationship.Count) { - FeatureValueTextualNotationBuilder.BuildBodyArgumentValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; + + if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue elementAsFeatureValue) + { + FeatureValueTextualNotationBuilder.BuildBodyArgumentValue(elementAsFeatureValue, stringBuilder); + } } + return elementIndex; } /// @@ -762,17 +820,22 @@ public static void BuildBodyArgument(SysML2.NET.Core.POCO.Core.Features.IFeature /// FunctionReferenceArgument:Feature=ownedRelationship+=FunctionReferenceArgumentValue /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildFunctionReferenceArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildFunctionReferenceArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfFeatureValueIterator.MoveNext(); - - if (ownedRelationshipOfFeatureValueIterator.Current != null) + if (elementIndex < poco.OwnedRelationship.Count) { - FeatureValueTextualNotationBuilder.BuildFunctionReferenceArgumentValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; + + if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue elementAsFeatureValue) + { + FeatureValueTextualNotationBuilder.BuildFunctionReferenceArgumentValue(elementAsFeatureValue, stringBuilder); + } } + return elementIndex; } /// @@ -916,7 +979,7 @@ public static void BuildMetadataBodyFeature(SysML2.NET.Core.POCO.Core.Features.I RedefinitionTextualNotationBuilder.BuildOwnedRedefinition(ownedRelationshipOfRedefinitionIterator.Current, stringBuilder); } BuildFeatureSpecializationPart(poco, stringBuilder); - BuildValuePart(poco, stringBuilder); + BuildValuePart(poco, 0, stringBuilder); TypeTextualNotationBuilder.BuildMetadataBody(poco, stringBuilder); } @@ -932,7 +995,7 @@ public static void BuildFeature(SysML2.NET.Core.POCO.Core.Features.IFeature poco using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); throw new System.NotSupportedException("Multiple alternatives not implemented yet"); stringBuilder.Append(' '); - BuildValuePart(poco, stringBuilder); + BuildValuePart(poco, 0, stringBuilder); TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureValueTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureValueTextualNotationBuilder.cs index 7c3bc4ee..7711e570 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureValueTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureValueTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -39,17 +40,22 @@ public static partial class FeatureValueTextualNotationBuilder /// TriggerFeatureValue:FeatureValue=ownedRelatedElement+=TriggerExpression /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildTriggerFeatureValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildTriggerFeatureValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfTriggerInvocationExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfTriggerInvocationExpressionIterator.MoveNext(); - - if (ownedRelatedElementOfTriggerInvocationExpressionIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - TriggerInvocationExpressionTextualNotationBuilder.BuildTriggerExpression(ownedRelatedElementOfTriggerInvocationExpressionIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Systems.Actions.ITriggerInvocationExpression elementAsTriggerInvocationExpression) + { + TriggerInvocationExpressionTextualNotationBuilder.BuildTriggerExpression(elementAsTriggerInvocationExpression, 0, stringBuilder); + } } + return elementIndex; } /// @@ -73,17 +79,22 @@ public static void BuildArgumentValue(SysML2.NET.Core.POCO.Kernel.FeatureValues. /// ArgumentExpressionValue:FeatureValue=ownedRelatedElement+=OwnedExpressionReference /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildArgumentExpressionValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildArgumentExpressionValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfFeatureReferenceExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfFeatureReferenceExpressionIterator.MoveNext(); - - if (ownedRelatedElementOfFeatureReferenceExpressionIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - FeatureReferenceExpressionTextualNotationBuilder.BuildOwnedExpressionReference(ownedRelatedElementOfFeatureReferenceExpressionIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression elementAsFeatureReferenceExpression) + { + FeatureReferenceExpressionTextualNotationBuilder.BuildOwnedExpressionReference(elementAsFeatureReferenceExpression, 0, stringBuilder); + } } + return elementIndex; } /// @@ -91,17 +102,22 @@ public static void BuildArgumentExpressionValue(SysML2.NET.Core.POCO.Kernel.Feat /// FeatureBinding:FeatureValue=ownedRelatedElement+=OwnedExpression /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildFeatureBinding(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildFeatureBinding(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfExpressionIterator.MoveNext(); - - if (ownedRelatedElementOfExpressionIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - ExpressionTextualNotationBuilder.BuildOwnedExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Kernel.Functions.IExpression elementAsExpression) + { + ExpressionTextualNotationBuilder.BuildOwnedExpression(elementAsExpression, stringBuilder); + } } + return elementIndex; } /// @@ -109,17 +125,22 @@ public static void BuildFeatureBinding(SysML2.NET.Core.POCO.Kernel.FeatureValues /// AssignmentTargetBinding:FeatureValue=ownedRelatedElement+=NonFeatureChainPrimaryExpression /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildAssignmentTargetBinding(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildAssignmentTargetBinding(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfExpressionIterator.MoveNext(); - - if (ownedRelatedElementOfExpressionIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - ExpressionTextualNotationBuilder.BuildNonFeatureChainPrimaryExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Kernel.Functions.IExpression elementAsExpression) + { + ExpressionTextualNotationBuilder.BuildNonFeatureChainPrimaryExpression(elementAsExpression, stringBuilder); + } } + return elementIndex; } /// @@ -127,17 +148,22 @@ public static void BuildAssignmentTargetBinding(SysML2.NET.Core.POCO.Kernel.Feat /// SatisfactionFeatureValue:FeatureValue=ownedRelatedElement+=SatisfactionReferenceExpression /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildSatisfactionFeatureValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildSatisfactionFeatureValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfFeatureReferenceExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfFeatureReferenceExpressionIterator.MoveNext(); - - if (ownedRelatedElementOfFeatureReferenceExpressionIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - FeatureReferenceExpressionTextualNotationBuilder.BuildSatisfactionReferenceExpression(ownedRelatedElementOfFeatureReferenceExpressionIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression elementAsFeatureReferenceExpression) + { + FeatureReferenceExpressionTextualNotationBuilder.BuildSatisfactionReferenceExpression(elementAsFeatureReferenceExpression, 0, stringBuilder); + } } + return elementIndex; } /// @@ -151,12 +177,11 @@ public static void BuildMetadataValue(SysML2.NET.Core.POCO.Kernel.FeatureValues. if (poco.value != null) { - using var ownedRelationshipOfMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfMembershipIterator.MoveNext(); + var elementForOwnedRelationship = poco.value.OwnedRelationship[0]; - if (ownedRelationshipOfMembershipIterator.Current != null) + if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Root.Namespaces.IMembership elementAsMembership) { - MembershipTextualNotationBuilder.BuildElementReferenceMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + MembershipTextualNotationBuilder.BuildElementReferenceMember(elementAsMembership, stringBuilder); } } @@ -206,12 +231,11 @@ public static void BuildBodyArgumentValue(SysML2.NET.Core.POCO.Kernel.FeatureVal if (poco.value != null) { - using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfFeatureMembershipIterator.MoveNext(); + var elementForOwnedRelationship = poco.value.OwnedRelationship[0]; - if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Core.Types.IFeatureMembership elementAsFeatureMembership) { - FeatureMembershipTextualNotationBuilder.BuildExpressionBodyMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + FeatureMembershipTextualNotationBuilder.BuildExpressionBodyMember(elementAsFeatureMembership, stringBuilder); } } @@ -229,12 +253,11 @@ public static void BuildFunctionReferenceArgumentValue(SysML2.NET.Core.POCO.Kern if (poco.value != null) { - using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfFeatureMembershipIterator.MoveNext(); + var elementForOwnedRelationship = poco.value.OwnedRelationship[0]; - if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Core.Types.IFeatureMembership elementAsFeatureMembership) { - FeatureMembershipTextualNotationBuilder.BuildFunctionReferenceMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + FeatureMembershipTextualNotationBuilder.BuildFunctionReferenceMember(elementAsFeatureMembership, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowEndTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowEndTextualNotationBuilder.cs index 5b7562fe..b5cbf9db 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowEndTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowEndTextualNotationBuilder.cs @@ -59,7 +59,7 @@ public static void BuildFlowEnd(SysML2.NET.Core.POCO.Kernel.Interactions.IFlowEn if (ownedRelationshipOfFeatureMembershipIterator.Current != null) { - FeatureMembershipTextualNotationBuilder.BuildFlowFeatureMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + FeatureMembershipTextualNotationBuilder.BuildFlowFeatureMember(ownedRelationshipOfFeatureMembershipIterator.Current, 0, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowUsageTextualNotationBuilder.cs index 914068cb..ea478d7b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -44,7 +45,7 @@ public static void BuildMessage(SysML2.NET.Core.POCO.Systems.Flows.IFlowUsage po { OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("message "); - BuildMessageDeclaration(poco, stringBuilder); + BuildMessageDeclaration(poco, 0, stringBuilder); TypeTextualNotationBuilder.BuildDefinitionBody(poco, stringBuilder); // NonParsing Assignment Element : isAbstract = true => Does not have to be process @@ -55,10 +56,13 @@ public static void BuildMessage(SysML2.NET.Core.POCO.Systems.Flows.IFlowUsage po /// 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 index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildMessageDeclaration(SysML2.NET.Core.POCO.Systems.Flows.IFlowUsage poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildMessageDeclaration(SysML2.NET.Core.POCO.Systems.Flows.IFlowUsage poco, int elementIndex, StringBuilder stringBuilder) { throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + return elementIndex; } /// @@ -66,10 +70,13 @@ public static void BuildMessageDeclaration(SysML2.NET.Core.POCO.Systems.Flows.IF /// 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 index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildFlowDeclaration(SysML2.NET.Core.POCO.Systems.Flows.IFlowUsage poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildFlowDeclaration(SysML2.NET.Core.POCO.Systems.Flows.IFlowUsage poco, int elementIndex, StringBuilder stringBuilder) { throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + return elementIndex; } /// @@ -82,7 +89,7 @@ public static void BuildFlowUsage(SysML2.NET.Core.POCO.Systems.Flows.IFlowUsage { OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("flow "); - BuildFlowDeclaration(poco, stringBuilder); + BuildFlowDeclaration(poco, 0, stringBuilder); TypeTextualNotationBuilder.BuildDefinitionBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForLoopActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForLoopActionUsageTextualNotationBuilder.cs index 60fded55..5fcdee0b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForLoopActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForLoopActionUsageTextualNotationBuilder.cs @@ -50,20 +50,20 @@ public static void BuildForLoopNode(SysML2.NET.Core.POCO.Systems.Actions.IForLoo if (ownedRelationshipOfFeatureMembershipIterator.Current != null) { - FeatureMembershipTextualNotationBuilder.BuildForVariableDeclarationMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + FeatureMembershipTextualNotationBuilder.BuildForVariableDeclarationMember(ownedRelationshipOfFeatureMembershipIterator.Current, 0, stringBuilder); } stringBuilder.Append("in "); ownedRelationshipOfParameterMembershipIterator.MoveNext(); if (ownedRelationshipOfParameterMembershipIterator.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); } ownedRelationshipOfParameterMembershipIterator.MoveNext(); if (ownedRelationshipOfParameterMembershipIterator.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildActionBodyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + ParameterMembershipTextualNotationBuilder.BuildActionBodyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FramedConcernMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FramedConcernMembershipTextualNotationBuilder.cs index 97edba8e..1ccc9b46 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FramedConcernMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FramedConcernMembershipTextualNotationBuilder.cs @@ -49,7 +49,7 @@ public static void BuildFramedConcernMember(SysML2.NET.Core.POCO.Systems.Require if (ownedRelatedElementOfConcernUsageIterator.Current != null) { - ConcernUsageTextualNotationBuilder.BuildFramedConcernUsage(ownedRelatedElementOfConcernUsageIterator.Current, stringBuilder); + ConcernUsageTextualNotationBuilder.BuildFramedConcernUsage(ownedRelatedElementOfConcernUsageIterator.Current, 0, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs index 98c8aca5..671d029f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs @@ -49,13 +49,13 @@ public static void BuildIfNode(SysML2.NET.Core.POCO.Systems.Actions.IIfActionUsa if (ownedRelationshipOfParameterMembershipIterator.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildExpressionParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + ParameterMembershipTextualNotationBuilder.BuildExpressionParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); } ownedRelationshipOfParameterMembershipIterator.MoveNext(); if (ownedRelationshipOfParameterMembershipIterator.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildActionBodyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + ParameterMembershipTextualNotationBuilder.BuildActionBodyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); } if (ownedRelationshipOfParameterMembershipIterator.MoveNext()) diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IncludeUseCaseUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IncludeUseCaseUsageTextualNotationBuilder.cs index f6b8fbb7..007ad859 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IncludeUseCaseUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IncludeUseCaseUsageTextualNotationBuilder.cs @@ -47,7 +47,7 @@ public static void BuildIncludeUseCaseUsage(SysML2.NET.Core.POCO.Systems.UseCase stringBuilder.Append("include "); throw new System.NotSupportedException("Multiple alternatives not implemented yet"); stringBuilder.Append(' '); - FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + FeatureTextualNotationBuilder.BuildValuePart(poco, 0, stringBuilder); TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs index abed5a26..465955ba 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs @@ -69,14 +69,14 @@ public static void BuildBinaryInterfacePart(SysML2.NET.Core.POCO.Systems.Interfa if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); } stringBuilder.Append("to "); ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); } } @@ -95,14 +95,14 @@ public static void BuildNaryInterfacePart(SysML2.NET.Core.POCO.Systems.Interface if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); } stringBuilder.Append(","); ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); } while (ownedRelationshipOfEndFeatureMembershipIterator.MoveNext()) @@ -111,7 +111,7 @@ public static void BuildNaryInterfacePart(SysML2.NET.Core.POCO.Systems.Interface if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IntersectingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IntersectingTextualNotationBuilder.cs index 132cc870..68dca93d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IntersectingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IntersectingTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -39,24 +40,30 @@ public static partial class IntersectingTextualNotationBuilder /// Intersecting=intersectingType=[QualifiedName]|ownedRelatedElement+=OwnedFeatureChain /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildIntersecting(SysML2.NET.Core.POCO.Core.Types.IIntersecting poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildIntersecting(SysML2.NET.Core.POCO.Core.Types.IIntersecting poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); if (poco.IntersectingType != null) { stringBuilder.Append(poco.IntersectingType.qualifiedName); stringBuilder.Append(' '); } - else if (ownedRelatedElementOfFeatureIterator.MoveNext()) + else { - - if (ownedRelatedElementOfFeatureIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - FeatureTextualNotationBuilder.BuildOwnedFeatureChain(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Core.Features.IFeature elementAsFeature) + { + FeatureTextualNotationBuilder.BuildOwnedFeatureChain(elementAsFeature, stringBuilder); + } } } + return elementIndex; } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs index 2ab929c7..a50203ff 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs @@ -67,7 +67,7 @@ public static void BuildInvariant(SysML2.NET.Core.POCO.Kernel.Functions.IInvaria stringBuilder.Append(" false "); } FeatureTextualNotationBuilder.BuildFeatureDeclaration(poco, stringBuilder); - FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + FeatureTextualNotationBuilder.BuildValuePart(poco, 0, stringBuilder); TypeTextualNotationBuilder.BuildFunctionBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs index 687bb6ca..d0be9db9 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs @@ -83,7 +83,7 @@ public static void BuildFunctionOperationExpression(SysML2.NET.Core.POCO.Kernel. if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) { - ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, 0, stringBuilder); } } @@ -109,7 +109,7 @@ public static void BuildInvocationExpression(SysML2.NET.Core.POCO.Kernel.Express if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) { - ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, 0, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs index 7b88f653..e0729761 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs @@ -105,12 +105,11 @@ public static void BuildFeatureChainMember(SysML2.NET.Core.POCO.Root.Namespaces. } else { - using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfFeatureIterator.MoveNext(); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[0]; - if (ownedRelatedElementOfFeatureIterator.Current != null) + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Core.Features.IFeature elementAsFeature) { - FeatureTextualNotationBuilder.BuildOwnedFeatureChain(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + FeatureTextualNotationBuilder.BuildOwnedFeatureChain(elementAsFeature, stringBuilder); } } @@ -168,12 +167,11 @@ public static void BuildInstantiatedTypeMember(SysML2.NET.Core.POCO.Root.Namespa } else { - using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfFeatureIterator.MoveNext(); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[0]; - if (ownedRelatedElementOfFeatureIterator.Current != null) + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Core.Features.IFeature elementAsFeature) { - FeatureTextualNotationBuilder.BuildOwnedFeatureChain(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + FeatureTextualNotationBuilder.BuildOwnedFeatureChain(elementAsFeature, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataAccessExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataAccessExpressionTextualNotationBuilder.cs index 2a6fbfec..a7cfffeb 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataAccessExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataAccessExpressionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -39,17 +40,22 @@ public static partial class MetadataAccessExpressionTextualNotationBuilder /// MetadataReference:MetadataAccessExpression=ownedRelationship+=ElementReferenceMember /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildMetadataReference(SysML2.NET.Core.POCO.Kernel.Expressions.IMetadataAccessExpression poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildMetadataReference(SysML2.NET.Core.POCO.Kernel.Expressions.IMetadataAccessExpression poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelationshipOfMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfMembershipIterator.MoveNext(); - - if (ownedRelationshipOfMembershipIterator.Current != null) + if (elementIndex < poco.OwnedRelationship.Count) { - MembershipTextualNotationBuilder.BuildElementReferenceMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; + + if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Root.Namespaces.IMembership elementAsMembership) + { + MembershipTextualNotationBuilder.BuildElementReferenceMember(elementAsMembership, stringBuilder); + } } + return elementIndex; } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.cs index a4964d3c..d65e7d2c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.cs @@ -49,7 +49,11 @@ public static void BuildMetadataDefinition(SysML2.NET.Core.POCO.Systems.Metadata stringBuilder.Append(' '); } - DefinitionTextualNotationBuilder.BuildDefinitionExtensionKeyword(poco, stringBuilder); + // Handle collection Non Terminal + for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + { + ownedRelationshipIndex = DefinitionTextualNotationBuilder.BuildDefinitionExtensionKeyword(poco, ownedRelationshipIndex, stringBuilder); + } stringBuilder.Append("metadata "); stringBuilder.Append("def "); DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs index f51e57ea..b11d9697 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -39,17 +40,22 @@ public static partial class MetadataFeatureTextualNotationBuilder /// PrefixMetadataFeature:MetadataFeature=ownedRelationship+=OwnedFeatureTyping /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildPrefixMetadataFeature(SysML2.NET.Core.POCO.Kernel.Metadata.IMetadataFeature poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildPrefixMetadataFeature(SysML2.NET.Core.POCO.Kernel.Metadata.IMetadataFeature poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelationshipOfFeatureTypingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfFeatureTypingIterator.MoveNext(); - - if (ownedRelationshipOfFeatureTypingIterator.Current != null) + if (elementIndex < poco.OwnedRelationship.Count) { - FeatureTypingTextualNotationBuilder.BuildOwnedFeatureTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; + + if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Core.Features.IFeatureTyping elementAsFeatureTyping) + { + FeatureTypingTextualNotationBuilder.BuildOwnedFeatureTyping(elementAsFeatureTyping, stringBuilder); + } } + return elementIndex; } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs index 2e37a617..a8a6258b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -39,17 +40,22 @@ public static partial class MetadataUsageTextualNotationBuilder /// PrefixMetadataUsage:MetadataUsage=ownedRelationship+=OwnedFeatureTyping /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildPrefixMetadataUsage(SysML2.NET.Core.POCO.Systems.Metadata.IMetadataUsage poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildPrefixMetadataUsage(SysML2.NET.Core.POCO.Systems.Metadata.IMetadataUsage poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelationshipOfFeatureTypingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfFeatureTypingIterator.MoveNext(); - - if (ownedRelationshipOfFeatureTypingIterator.Current != null) + if (elementIndex < poco.OwnedRelationship.Count) { - FeatureTypingTextualNotationBuilder.BuildOwnedFeatureTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; + + if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Core.Features.IFeatureTyping elementAsFeatureTyping) + { + FeatureTypingTextualNotationBuilder.BuildOwnedFeatureTyping(elementAsFeatureTyping, stringBuilder); + } } + return elementIndex; } /// @@ -88,7 +94,11 @@ public static void BuildMetadataUsageDeclaration(SysML2.NET.Core.POCO.Systems.Me 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); + // Handle collection Non Terminal + for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + { + ownedRelationshipIndex = UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, ownedRelationshipIndex, stringBuilder); + } stringBuilder.Append(" @ "); stringBuilder.Append(' '); BuildMetadataUsageDeclaration(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityRangeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityRangeTextualNotationBuilder.cs index dffe2bee..bee17481 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityRangeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityRangeTextualNotationBuilder.cs @@ -62,7 +62,7 @@ public static void BuildMultiplicityBounds(SysML2.NET.Core.POCO.Kernel.Multiplic if (ownedRelationshipOfOwningMembershipIterator.Current != null) { - OwningMembershipTextualNotationBuilder.BuildMultiplicityExpressionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + OwningMembershipTextualNotationBuilder.BuildMultiplicityExpressionMember(ownedRelationshipOfOwningMembershipIterator.Current, 0, stringBuilder); } stringBuilder.Append(".. "); stringBuilder.Append(' '); @@ -72,7 +72,7 @@ public static void BuildMultiplicityBounds(SysML2.NET.Core.POCO.Kernel.Multiplic if (ownedRelationshipOfOwningMembershipIterator.Current != null) { - OwningMembershipTextualNotationBuilder.BuildMultiplicityExpressionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + OwningMembershipTextualNotationBuilder.BuildMultiplicityExpressionMember(ownedRelationshipOfOwningMembershipIterator.Current, 0, stringBuilder); } stringBuilder.Append("]"); @@ -94,7 +94,7 @@ public static void BuildMultiplicityRange(SysML2.NET.Core.POCO.Kernel.Multiplici if (ownedRelationshipOfOwningMembershipIterator.Current != null) { - OwningMembershipTextualNotationBuilder.BuildMultiplicityExpressionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + OwningMembershipTextualNotationBuilder.BuildMultiplicityExpressionMember(ownedRelationshipOfOwningMembershipIterator.Current, 0, stringBuilder); } stringBuilder.Append(".. "); stringBuilder.Append(' '); @@ -104,7 +104,7 @@ public static void BuildMultiplicityRange(SysML2.NET.Core.POCO.Kernel.Multiplici if (ownedRelationshipOfOwningMembershipIterator.Current != null) { - OwningMembershipTextualNotationBuilder.BuildMultiplicityExpressionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + OwningMembershipTextualNotationBuilder.BuildMultiplicityExpressionMember(ownedRelationshipOfOwningMembershipIterator.Current, 0, stringBuilder); } stringBuilder.Append("]"); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs index fd65b05a..f313142f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -42,7 +43,8 @@ public static partial class NamespaceTextualNotationBuilder /// The that contains the entire textual notation public static void BuildRootNamespace(SysML2.NET.Core.POCO.Root.Namespaces.INamespace poco, StringBuilder stringBuilder) { - foreach (var elementInOwnedRelationship in poco.OwnedRelationship) + // Handle collection Non Terminal + for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) { switch (elementInOwnedRelationship) { @@ -59,8 +61,8 @@ public static void BuildRootNamespace(SysML2.NET.Core.POCO.Root.Namespaces.IName ImportTextualNotationBuilder.BuildImport(import, stringBuilder); break; } - } + } } @@ -93,25 +95,25 @@ public static void BuildNamespaceBody(SysML2.NET.Core.POCO.Root.Namespaces.IName /// NamespaceBodyElement:Namespace=ownedRelationship+=NamespaceMember|ownedRelationship+=AliasMember|ownedRelationship+=Import /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildNamespaceBodyElement(SysML2.NET.Core.POCO.Root.Namespaces.INamespace poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildNamespaceBodyElement(SysML2.NET.Core.POCO.Root.Namespaces.INamespace poco, int elementIndex, StringBuilder stringBuilder) { - foreach (var elementInOwnedRelationship in poco.OwnedRelationship) + switch (elementInOwnedRelationship) { - switch (elementInOwnedRelationship) - { - case SysML2.NET.Core.POCO.Root.Namespaces.OwningMembership owningMembership: - OwningMembershipTextualNotationBuilder.BuildNamespaceMember(owningMembership, stringBuilder); - break; - case SysML2.NET.Core.POCO.Root.Namespaces.Membership membership: - MembershipTextualNotationBuilder.BuildAliasMember(membership, stringBuilder); - break; - case SysML2.NET.Core.POCO.Root.Namespaces.IImport import: - ImportTextualNotationBuilder.BuildImport(import, stringBuilder); - break; - } + case SysML2.NET.Core.POCO.Root.Namespaces.OwningMembership owningMembership: + OwningMembershipTextualNotationBuilder.BuildNamespaceMember(owningMembership, stringBuilder); + break; + case SysML2.NET.Core.POCO.Root.Namespaces.Membership membership: + MembershipTextualNotationBuilder.BuildAliasMember(membership, stringBuilder); + break; + case SysML2.NET.Core.POCO.Root.Namespaces.IImport import: + ImportTextualNotationBuilder.BuildImport(import, stringBuilder); + break; } + return elementIndex; } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs index 603a7477..07cabf69 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs @@ -59,12 +59,16 @@ public static void BuildOccurrenceDefinitionPrefix(SysML2.NET.Core.POCO.Systems. if (ownedRelationshipOfOwningMembershipIterator.Current != null) { - OwningMembershipTextualNotationBuilder.BuildEmptyMultiplicityMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + OwningMembershipTextualNotationBuilder.BuildEmptyMultiplicityMember(ownedRelationshipOfOwningMembershipIterator.Current, 0, stringBuilder); } stringBuilder.Append(' '); } - DefinitionTextualNotationBuilder.BuildDefinitionExtensionKeyword(poco, stringBuilder); + // Handle collection Non Terminal + for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + { + ownedRelationshipIndex = DefinitionTextualNotationBuilder.BuildDefinitionExtensionKeyword(poco, ownedRelationshipIndex, stringBuilder); + } } @@ -90,14 +94,18 @@ public static void BuildIndividualDefinition(SysML2.NET.Core.POCO.Systems.Occurr { stringBuilder.Append(" individual "); } - DefinitionTextualNotationBuilder.BuildDefinitionExtensionKeyword(poco, stringBuilder); + // Handle collection Non Terminal + for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + { + ownedRelationshipIndex = DefinitionTextualNotationBuilder.BuildDefinitionExtensionKeyword(poco, ownedRelationshipIndex, stringBuilder); + } stringBuilder.Append("def "); DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); ownedRelationshipOfOwningMembershipIterator.MoveNext(); if (ownedRelationshipOfOwningMembershipIterator.Current != null) { - OwningMembershipTextualNotationBuilder.BuildEmptyMultiplicityMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + OwningMembershipTextualNotationBuilder.BuildEmptyMultiplicityMember(ownedRelationshipOfOwningMembershipIterator.Current, 0, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs index e602a83b..44571d68 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs @@ -58,7 +58,11 @@ public static void BuildOccurrenceUsagePrefix(SysML2.NET.Core.POCO.Systems.Occur stringBuilder.Append(' '); } - UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, stringBuilder); + // Handle collection Non Terminal + for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + { + ownedRelationshipIndex = UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, ownedRelationshipIndex, stringBuilder); + } } @@ -75,7 +79,11 @@ public static void BuildIndividualUsage(SysML2.NET.Core.POCO.Systems.Occurrences { stringBuilder.Append(" individual "); } - UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, stringBuilder); + // Handle collection Non Terminal + for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + { + ownedRelationshipIndex = UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, ownedRelationshipIndex, stringBuilder); + } UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); } @@ -97,7 +105,11 @@ public static void BuildPortionUsage(SysML2.NET.Core.POCO.Systems.Occurrences.IO } stringBuilder.Append(poco.PortionKind.ToString().ToLower()); - UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, stringBuilder); + // Handle collection Non Terminal + for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + { + ownedRelationshipIndex = UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, ownedRelationshipIndex, stringBuilder); + } UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); // NonParsing Assignment Element : isPortion = true => Does not have to be process @@ -127,7 +139,11 @@ public static void BuildControlNodePrefix(SysML2.NET.Core.POCO.Systems.Occurrenc stringBuilder.Append(' '); } - UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, stringBuilder); + // Handle collection Non Terminal + for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + { + ownedRelationshipIndex = UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, ownedRelationshipIndex, stringBuilder); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OperatorExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OperatorExpressionTextualNotationBuilder.cs index d8fab4ba..589ac01e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OperatorExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OperatorExpressionTextualNotationBuilder.cs @@ -56,20 +56,20 @@ public static void BuildConditionalExpression(SysML2.NET.Core.POCO.Kernel.Expres if (ownedRelationshipOfParameterMembershipIterator.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildArgumentExpressionMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + ParameterMembershipTextualNotationBuilder.BuildArgumentExpressionMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); } stringBuilder.Append("else "); ownedRelationshipOfParameterMembershipIterator.MoveNext(); if (ownedRelationshipOfParameterMembershipIterator.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildArgumentExpressionMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + ParameterMembershipTextualNotationBuilder.BuildArgumentExpressionMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); } ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) { - ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, 0, stringBuilder); } } @@ -95,13 +95,13 @@ public static void BuildConditionalBinaryOperatorExpression(SysML2.NET.Core.POCO if (ownedRelationshipOfParameterMembershipIterator.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildArgumentExpressionMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + ParameterMembershipTextualNotationBuilder.BuildArgumentExpressionMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); } ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) { - ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, 0, stringBuilder); } } @@ -133,7 +133,7 @@ public static void BuildBinaryOperatorExpression(SysML2.NET.Core.POCO.Kernel.Exp if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) { - ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, 0, stringBuilder); } } @@ -159,7 +159,7 @@ public static void BuildUnaryOperatorExpression(SysML2.NET.Core.POCO.Kernel.Expr if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) { - ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, 0, stringBuilder); } } @@ -192,7 +192,7 @@ public static void BuildClassificationExpression(SysML2.NET.Core.POCO.Kernel.Exp if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) { - ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, 0, stringBuilder); } } @@ -212,7 +212,7 @@ public static void BuildMetaclassificationExpression(SysML2.NET.Core.POCO.Kernel if (ownedRelationshipOfParameterMembershipIterator.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildMetadataArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + ParameterMembershipTextualNotationBuilder.BuildMetadataArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); } throw new System.NotSupportedException("Multiple alternatives not implemented yet"); stringBuilder.Append(' '); @@ -220,7 +220,7 @@ public static void BuildMetaclassificationExpression(SysML2.NET.Core.POCO.Kernel if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) { - ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, stringBuilder); + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, 0, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs index a021cac6..58a26856 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -39,17 +40,22 @@ public static partial class OwningMembershipTextualNotationBuilder /// AnnotatingMember:OwningMembership=ownedRelatedElement+=AnnotatingElement /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildAnnotatingMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildAnnotatingMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfAnnotatingElementIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfAnnotatingElementIterator.MoveNext(); - - if (ownedRelatedElementOfAnnotatingElementIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - AnnotatingElementTextualNotationBuilder.BuildAnnotatingElement(ownedRelatedElementOfAnnotatingElementIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Root.Annotations.IAnnotatingElement elementAsAnnotatingElement) + { + AnnotatingElementTextualNotationBuilder.BuildAnnotatingElement(elementAsAnnotatingElement, stringBuilder); + } } + return elementIndex; } /// @@ -107,17 +113,22 @@ public static void BuildDefinitionMember(SysML2.NET.Core.POCO.Root.Namespaces.IO /// OwnedCrossFeatureMember:OwningMembership=ownedRelatedElement+=OwnedCrossFeature /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildOwnedCrossFeatureMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildOwnedCrossFeatureMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfReferenceUsageIterator.MoveNext(); - - if (ownedRelatedElementOfReferenceUsageIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - ReferenceUsageTextualNotationBuilder.BuildOwnedCrossFeature(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage elementAsReferenceUsage) + { + ReferenceUsageTextualNotationBuilder.BuildOwnedCrossFeature(elementAsReferenceUsage, stringBuilder); + } } + return elementIndex; } /// @@ -125,17 +136,22 @@ public static void BuildOwnedCrossFeatureMember(SysML2.NET.Core.POCO.Root.Namesp /// OwnedMultiplicity:OwningMembership=ownedRelatedElement+=MultiplicityRange /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildOwnedMultiplicity(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildOwnedMultiplicity(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfMultiplicityRangeIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfMultiplicityRangeIterator.MoveNext(); - - if (ownedRelatedElementOfMultiplicityRangeIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - MultiplicityRangeTextualNotationBuilder.BuildMultiplicityRange(ownedRelatedElementOfMultiplicityRangeIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Kernel.Multiplicities.IMultiplicityRange elementAsMultiplicityRange) + { + MultiplicityRangeTextualNotationBuilder.BuildMultiplicityRange(elementAsMultiplicityRange, stringBuilder); + } } + return elementIndex; } /// @@ -143,23 +159,32 @@ public static void BuildOwnedMultiplicity(SysML2.NET.Core.POCO.Root.Namespaces.I /// MultiplicityExpressionMember:OwningMembership=ownedRelatedElement+=(LiteralExpression|FeatureReferenceExpression) /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildMultiplicityExpressionMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildMultiplicityExpressionMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementIterator = SysML2.NET.Extensions.EnumerableExtensions.GetElementsOfType(poco.OwnedRelatedElement, typeof(SysML2.NET.Core.POCO.Kernel.Expressions.LiteralExpression), typeof(SysML2.NET.Core.POCO.Kernel.Expressions.FeatureReferenceExpression)).GetEnumerator(); - ownedRelatedElementIterator.MoveNext(); - - switch (ownedRelatedElementIterator.Current) + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + switch (elementForOwnedRelatedElement) { case SysML2.NET.Core.POCO.Kernel.Expressions.LiteralExpression pocoLiteralExpression: - LiteralExpressionTextualNotationBuilder.BuildLiteralExpression(pocoLiteralExpression, stringBuilder); + + if (pocoLiteralExpression is SysML2.NET.Core.POCO.Kernel.Expressions.ILiteralExpression elementAsLiteralExpression) + { + LiteralExpressionTextualNotationBuilder.BuildLiteralExpression(elementAsLiteralExpression, stringBuilder); + } break; case SysML2.NET.Core.POCO.Kernel.Expressions.FeatureReferenceExpression pocoFeatureReferenceExpression: - FeatureReferenceExpressionTextualNotationBuilder.BuildFeatureReferenceExpression(pocoFeatureReferenceExpression, stringBuilder); + + if (pocoFeatureReferenceExpression is SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression elementAsFeatureReferenceExpression) + { + FeatureReferenceExpressionTextualNotationBuilder.BuildFeatureReferenceExpression(elementAsFeatureReferenceExpression, stringBuilder); + } break; } + return elementIndex; } /// @@ -167,17 +192,22 @@ public static void BuildMultiplicityExpressionMember(SysML2.NET.Core.POCO.Root.N /// EmptyMultiplicityMember:OwningMembership=ownedRelatedElement+=EmptyMultiplicity /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildEmptyMultiplicityMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildEmptyMultiplicityMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfMultiplicityIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfMultiplicityIterator.MoveNext(); - - if (ownedRelatedElementOfMultiplicityIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - MultiplicityTextualNotationBuilder.BuildEmptyMultiplicity(ownedRelatedElementOfMultiplicityIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Core.Types.IMultiplicity elementAsMultiplicity) + { + MultiplicityTextualNotationBuilder.BuildEmptyMultiplicity(elementAsMultiplicity, stringBuilder); + } } + return elementIndex; } /// @@ -185,17 +215,22 @@ public static void BuildEmptyMultiplicityMember(SysML2.NET.Core.POCO.Root.Namesp /// ConjugatedPortDefinitionMember:OwningMembership=ownedRelatedElement+=ConjugatedPortDefinition /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildConjugatedPortDefinitionMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildConjugatedPortDefinitionMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfConjugatedPortDefinitionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfConjugatedPortDefinitionIterator.MoveNext(); - - if (ownedRelatedElementOfConjugatedPortDefinitionIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - ConjugatedPortDefinitionTextualNotationBuilder.BuildConjugatedPortDefinition(ownedRelatedElementOfConjugatedPortDefinitionIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Systems.Ports.IConjugatedPortDefinition elementAsConjugatedPortDefinition) + { + ConjugatedPortDefinitionTextualNotationBuilder.BuildConjugatedPortDefinition(elementAsConjugatedPortDefinition, 0, stringBuilder); + } } + return elementIndex; } /// @@ -203,17 +238,22 @@ public static void BuildConjugatedPortDefinitionMember(SysML2.NET.Core.POCO.Root /// OwnedCrossMultiplicityMember:OwningMembership=ownedRelatedElement+=OwnedCrossMultiplicity /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildOwnedCrossMultiplicityMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildOwnedCrossMultiplicityMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfFeatureIterator.MoveNext(); - - if (ownedRelatedElementOfFeatureIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - FeatureTextualNotationBuilder.BuildOwnedCrossMultiplicity(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Core.Features.IFeature elementAsFeature) + { + FeatureTextualNotationBuilder.BuildOwnedCrossMultiplicity(elementAsFeature, 0, stringBuilder); + } } + return elementIndex; } /// @@ -221,17 +261,22 @@ public static void BuildOwnedCrossMultiplicityMember(SysML2.NET.Core.POCO.Root.N /// OwnedFeatureChainMember:OwningMembership=ownedRelatedElement+=OwnedFeatureChain /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildOwnedFeatureChainMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildOwnedFeatureChainMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfFeatureIterator.MoveNext(); - - if (ownedRelatedElementOfFeatureIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - FeatureTextualNotationBuilder.BuildOwnedFeatureChain(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Core.Features.IFeature elementAsFeature) + { + FeatureTextualNotationBuilder.BuildOwnedFeatureChain(elementAsFeature, stringBuilder); + } } + return elementIndex; } /// @@ -239,17 +284,22 @@ public static void BuildOwnedFeatureChainMember(SysML2.NET.Core.POCO.Root.Namesp /// TransitionSuccessionMember:OwningMembership=ownedRelatedElement+=TransitionSuccession /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildTransitionSuccessionMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildTransitionSuccessionMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfSuccessionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfSuccessionIterator.MoveNext(); - - if (ownedRelatedElementOfSuccessionIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - SuccessionTextualNotationBuilder.BuildTransitionSuccession(ownedRelatedElementOfSuccessionIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Kernel.Connectors.ISuccession elementAsSuccession) + { + SuccessionTextualNotationBuilder.BuildTransitionSuccession(elementAsSuccession, stringBuilder); + } } + return elementIndex; } /// @@ -266,7 +316,7 @@ public static void BuildPrefixMetadataMember(SysML2.NET.Core.POCO.Root.Namespace if (ownedRelatedElementOfMetadataUsageIterator.Current != null) { - MetadataUsageTextualNotationBuilder.BuildPrefixMetadataUsage(ownedRelatedElementOfMetadataUsageIterator.Current, stringBuilder); + MetadataUsageTextualNotationBuilder.BuildPrefixMetadataUsage(ownedRelatedElementOfMetadataUsageIterator.Current, 0, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs index dd79d421..e1d2be34 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -63,28 +64,28 @@ public static void BuildPackageBody(SysML2.NET.Core.POCO.Kernel.Packages.IPackag /// PackageBodyElement:Package=ownedRelationship+=PackageMember|ownedRelationship+=ElementFilterMember|ownedRelationship+=AliasMember|ownedRelationship+=Import /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildPackageBodyElement(SysML2.NET.Core.POCO.Kernel.Packages.IPackage poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildPackageBodyElement(SysML2.NET.Core.POCO.Kernel.Packages.IPackage poco, int elementIndex, StringBuilder stringBuilder) { - foreach (var elementInOwnedRelationship in poco.OwnedRelationship) + switch (elementInOwnedRelationship) { - switch (elementInOwnedRelationship) - { - case SysML2.NET.Core.POCO.Kernel.Packages.ElementFilterMembership elementFilterMembership: - ElementFilterMembershipTextualNotationBuilder.BuildElementFilterMember(elementFilterMembership, stringBuilder); - break; - case SysML2.NET.Core.POCO.Root.Namespaces.OwningMembership owningMembership: - OwningMembershipTextualNotationBuilder.BuildPackageMember(owningMembership, stringBuilder); - break; - case SysML2.NET.Core.POCO.Root.Namespaces.Membership membership: - MembershipTextualNotationBuilder.BuildAliasMember(membership, stringBuilder); - break; - case SysML2.NET.Core.POCO.Root.Namespaces.IImport import: - ImportTextualNotationBuilder.BuildImport(import, stringBuilder); - break; - } + case SysML2.NET.Core.POCO.Kernel.Packages.ElementFilterMembership elementFilterMembership: + ElementFilterMembershipTextualNotationBuilder.BuildElementFilterMember(elementFilterMembership, stringBuilder); + break; + case SysML2.NET.Core.POCO.Root.Namespaces.OwningMembership owningMembership: + OwningMembershipTextualNotationBuilder.BuildPackageMember(owningMembership, stringBuilder); + break; + case SysML2.NET.Core.POCO.Root.Namespaces.Membership membership: + MembershipTextualNotationBuilder.BuildAliasMember(membership, stringBuilder); + break; + case SysML2.NET.Core.POCO.Root.Namespaces.IImport import: + ImportTextualNotationBuilder.BuildImport(import, stringBuilder); + break; } + return elementIndex; } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ParameterMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ParameterMembershipTextualNotationBuilder.cs index 069f9a2f..56e81790 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ParameterMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ParameterMembershipTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -39,17 +40,22 @@ public static partial class ParameterMembershipTextualNotationBuilder /// MessageEventMember:ParameterMembership=ownedRelatedElement+=MessageEvent /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildMessageEventMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildMessageEventMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfEventOccurrenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfEventOccurrenceUsageIterator.MoveNext(); - - if (ownedRelatedElementOfEventOccurrenceUsageIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - EventOccurrenceUsageTextualNotationBuilder.BuildMessageEvent(ownedRelatedElementOfEventOccurrenceUsageIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Systems.Occurrences.IEventOccurrenceUsage elementAsEventOccurrenceUsage) + { + EventOccurrenceUsageTextualNotationBuilder.BuildMessageEvent(elementAsEventOccurrenceUsage, 0, stringBuilder); + } } + return elementIndex; } /// @@ -57,17 +63,22 @@ public static void BuildMessageEventMember(SysML2.NET.Core.POCO.Kernel.Behaviors /// PayloadParameterMember:ParameterMembership=ownedRelatedElement+=PayloadParameter /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildPayloadParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildPayloadParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfReferenceUsageIterator.MoveNext(); - - if (ownedRelatedElementOfReferenceUsageIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - ReferenceUsageTextualNotationBuilder.BuildPayloadParameter(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage elementAsReferenceUsage) + { + ReferenceUsageTextualNotationBuilder.BuildPayloadParameter(elementAsReferenceUsage, stringBuilder); + } } + return elementIndex; } /// @@ -81,7 +92,7 @@ public static void BuildArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IPa if (poco.ownedMemberParameter != null) { - FeatureTextualNotationBuilder.BuildArgument(poco.ownedMemberParameter, stringBuilder); + FeatureTextualNotationBuilder.BuildArgument(poco.ownedMemberParameter, 0, stringBuilder); } } @@ -91,17 +102,22 @@ public static void BuildArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IPa /// ArgumentExpressionMember:ParameterMembership=ownedRelatedElement+=ArgumentExpression /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildArgumentExpressionMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildArgumentExpressionMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfFeatureIterator.MoveNext(); - - if (ownedRelatedElementOfFeatureIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - FeatureTextualNotationBuilder.BuildArgumentExpression(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Core.Features.IFeature elementAsFeature) + { + FeatureTextualNotationBuilder.BuildArgumentExpression(elementAsFeature, 0, stringBuilder); + } } + return elementIndex; } /// @@ -109,17 +125,22 @@ public static void BuildArgumentExpressionMember(SysML2.NET.Core.POCO.Kernel.Beh /// NodeParameterMember:ParameterMembership=ownedRelatedElement+=NodeParameter /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildNodeParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildNodeParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfReferenceUsageIterator.MoveNext(); - - if (ownedRelatedElementOfReferenceUsageIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - ReferenceUsageTextualNotationBuilder.BuildNodeParameter(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage elementAsReferenceUsage) + { + ReferenceUsageTextualNotationBuilder.BuildNodeParameter(elementAsReferenceUsage, 0, stringBuilder); + } } + return elementIndex; } /// @@ -127,17 +148,22 @@ public static void BuildNodeParameterMember(SysML2.NET.Core.POCO.Kernel.Behavior /// EmptyParameterMember:ParameterMembership=ownedRelatedElement+=EmptyUsage /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildEmptyParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildEmptyParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfReferenceUsageIterator.MoveNext(); - - if (ownedRelatedElementOfReferenceUsageIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - ReferenceUsageTextualNotationBuilder.BuildEmptyUsage(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage elementAsReferenceUsage) + { + ReferenceUsageTextualNotationBuilder.BuildEmptyUsage(elementAsReferenceUsage, stringBuilder); + } } + return elementIndex; } /// @@ -145,17 +171,22 @@ public static void BuildEmptyParameterMember(SysML2.NET.Core.POCO.Kernel.Behavio /// AssignmentTargetMember:ParameterMembership=ownedRelatedElement+=AssignmentTargetParameter /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildAssignmentTargetMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildAssignmentTargetMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfReferenceUsageIterator.MoveNext(); - - if (ownedRelatedElementOfReferenceUsageIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - ReferenceUsageTextualNotationBuilder.BuildAssignmentTargetParameter(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage elementAsReferenceUsage) + { + ReferenceUsageTextualNotationBuilder.BuildAssignmentTargetParameter(elementAsReferenceUsage, stringBuilder); + } } + return elementIndex; } /// @@ -163,17 +194,22 @@ public static void BuildAssignmentTargetMember(SysML2.NET.Core.POCO.Kernel.Behav /// ExpressionParameterMember:ParameterMembership=ownedRelatedElement+=OwnedExpression /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildExpressionParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildExpressionParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfExpressionIterator.MoveNext(); - - if (ownedRelatedElementOfExpressionIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - ExpressionTextualNotationBuilder.BuildOwnedExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Kernel.Functions.IExpression elementAsExpression) + { + ExpressionTextualNotationBuilder.BuildOwnedExpression(elementAsExpression, stringBuilder); + } } + return elementIndex; } /// @@ -181,17 +217,22 @@ public static void BuildExpressionParameterMember(SysML2.NET.Core.POCO.Kernel.Be /// ActionBodyParameterMember:ParameterMembership=ownedRelatedElement+=ActionBodyParameter /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildActionBodyParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildActionBodyParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfActionUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfActionUsageIterator.MoveNext(); - - if (ownedRelatedElementOfActionUsageIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - ActionUsageTextualNotationBuilder.BuildActionBodyParameter(ownedRelatedElementOfActionUsageIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Systems.Actions.IActionUsage elementAsActionUsage) + { + ActionUsageTextualNotationBuilder.BuildActionBodyParameter(elementAsActionUsage, stringBuilder); + } } + return elementIndex; } /// @@ -199,17 +240,22 @@ public static void BuildActionBodyParameterMember(SysML2.NET.Core.POCO.Kernel.Be /// IfNodeParameterMember:ParameterMembership=ownedRelatedElement+=IfNode /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildIfNodeParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildIfNodeParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfIfActionUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfIfActionUsageIterator.MoveNext(); - - if (ownedRelatedElementOfIfActionUsageIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - IfActionUsageTextualNotationBuilder.BuildIfNode(ownedRelatedElementOfIfActionUsageIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Systems.Actions.IIfActionUsage elementAsIfActionUsage) + { + IfActionUsageTextualNotationBuilder.BuildIfNode(elementAsIfActionUsage, stringBuilder); + } } + return elementIndex; } /// @@ -217,17 +263,22 @@ public static void BuildIfNodeParameterMember(SysML2.NET.Core.POCO.Kernel.Behavi /// MetadataArgumentMember:ParameterMembership=ownedRelatedElement+=MetadataArgument /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildMetadataArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildMetadataArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfFeatureIterator.MoveNext(); - - if (ownedRelatedElementOfFeatureIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - FeatureTextualNotationBuilder.BuildMetadataArgument(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Core.Features.IFeature elementAsFeature) + { + FeatureTextualNotationBuilder.BuildMetadataArgument(elementAsFeature, 0, stringBuilder); + } } + return elementIndex; } /// @@ -241,7 +292,7 @@ public static void BuildTypeReferenceMember(SysML2.NET.Core.POCO.Kernel.Behavior if (poco.ownedMemberFeature != null) { - FeatureTextualNotationBuilder.BuildTypeReference(poco.ownedMemberFeature, stringBuilder); + FeatureTextualNotationBuilder.BuildTypeReference(poco.ownedMemberFeature, 0, stringBuilder); } } @@ -257,7 +308,7 @@ public static void BuildPrimaryArgumentMember(SysML2.NET.Core.POCO.Kernel.Behavi if (poco.ownedMemberParameter != null) { - FeatureTextualNotationBuilder.BuildPrimaryArgument(poco.ownedMemberParameter, stringBuilder); + FeatureTextualNotationBuilder.BuildPrimaryArgument(poco.ownedMemberParameter, 0, stringBuilder); } } @@ -273,7 +324,7 @@ public static void BuildNonFeatureChainPrimaryArgumentMember(SysML2.NET.Core.POC if (poco.ownedMemberParameter != null) { - FeatureTextualNotationBuilder.BuildPrimaryArgument(poco.ownedMemberParameter, stringBuilder); + FeatureTextualNotationBuilder.BuildPrimaryArgument(poco.ownedMemberParameter, 0, stringBuilder); } } @@ -289,7 +340,7 @@ public static void BuildBodyArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors if (poco.ownedMemberParameter != null) { - FeatureTextualNotationBuilder.BuildBodyArgument(poco.ownedMemberParameter, stringBuilder); + FeatureTextualNotationBuilder.BuildBodyArgument(poco.ownedMemberParameter, 0, stringBuilder); } } @@ -305,7 +356,7 @@ public static void BuildFunctionReferenceArgumentMember(SysML2.NET.Core.POCO.Ker if (poco.ownedMemberParameter != null) { - FeatureTextualNotationBuilder.BuildFunctionReferenceArgument(poco.ownedMemberParameter, stringBuilder); + FeatureTextualNotationBuilder.BuildFunctionReferenceArgument(poco.ownedMemberParameter, 0, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartUsageTextualNotationBuilder.cs index f6869f2e..5b4a2481 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartUsageTextualNotationBuilder.cs @@ -43,7 +43,11 @@ public static partial class PartUsageTextualNotationBuilder public static void BuildActorUsage(SysML2.NET.Core.POCO.Systems.Parts.IPartUsage poco, StringBuilder stringBuilder) { stringBuilder.Append("actor "); - UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, stringBuilder); + // Handle collection Non Terminal + for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + { + ownedRelationshipIndex = UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, ownedRelationshipIndex, stringBuilder); + } UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); } @@ -57,7 +61,11 @@ public static void BuildActorUsage(SysML2.NET.Core.POCO.Systems.Parts.IPartUsage public static void BuildStakeholderUsage(SysML2.NET.Core.POCO.Systems.Parts.IPartUsage poco, StringBuilder stringBuilder) { stringBuilder.Append("stakeholder "); - UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, stringBuilder); + // Handle collection Non Terminal + for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + { + ownedRelationshipIndex = UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, ownedRelationshipIndex, stringBuilder); + } UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PayloadFeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PayloadFeatureTextualNotationBuilder.cs index f237689f..d6afd029 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PayloadFeatureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PayloadFeatureTextualNotationBuilder.cs @@ -42,7 +42,7 @@ public static partial class PayloadFeatureTextualNotationBuilder /// 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); + FeatureTextualNotationBuilder.BuildPayloadFeature(poco, 0, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PerformActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PerformActionUsageTextualNotationBuilder.cs index f3b0b9a7..c630d665 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PerformActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PerformActionUsageTextualNotationBuilder.cs @@ -45,7 +45,7 @@ public static void BuildPerformActionUsageDeclaration(SysML2.NET.Core.POCO.Syste using var ownedRelationshipOfReferenceSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); throw new System.NotSupportedException("Multiple alternatives not implemented yet"); stringBuilder.Append(' '); - FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + FeatureTextualNotationBuilder.BuildValuePart(poco, 0, stringBuilder); } @@ -75,7 +75,11 @@ public static void BuildTransitionPerformActionUsage(SysML2.NET.Core.POCO.System if (BuildGroupConditionForTransitionPerformActionUsage(poco)) { stringBuilder.Append("{"); - TypeTextualNotationBuilder.BuildActionBodyItem(poco, stringBuilder); + // Handle collection Non Terminal + for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + { + ownedRelationshipIndex = TypeTextualNotationBuilder.BuildActionBodyItem(poco, ownedRelationshipIndex, stringBuilder); + } stringBuilder.Append("}"); stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortDefinitionTextualNotationBuilder.cs index f99f3579..3fb22863 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortDefinitionTextualNotationBuilder.cs @@ -51,7 +51,7 @@ public static void BuildPortDefinition(SysML2.NET.Core.POCO.Systems.Ports.IPortD if (ownedRelationshipOfOwningMembershipIterator.Current != null) { - OwningMembershipTextualNotationBuilder.BuildConjugatedPortDefinitionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + OwningMembershipTextualNotationBuilder.BuildConjugatedPortDefinitionMember(ownedRelationshipOfOwningMembershipIterator.Current, 0, stringBuilder); } // NonParsing Assignment Element : conjugatedPortDefinition.ownedPortConjugator.originalPortDefinition = this => Does not have to be process diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs index beda5456..afb38505 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs @@ -66,7 +66,7 @@ public static void BuildInterfaceEnd(SysML2.NET.Core.POCO.Systems.Ports.IPortUsa if (ownedRelationshipOfOwningMembershipIterator.Current != null) { - OwningMembershipTextualNotationBuilder.BuildOwnedCrossMultiplicityMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + OwningMembershipTextualNotationBuilder.BuildOwnedCrossMultiplicityMember(ownedRelationshipOfOwningMembershipIterator.Current, 0, stringBuilder); } stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs index fd29e1da..fb4cf048 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs @@ -96,9 +96,9 @@ public static void BuildRedefinition(SysML2.NET.Core.POCO.Core.Features.IRedefin } stringBuilder.Append("redefinition "); - SpecializationTextualNotationBuilder.BuildSpecificType(poco, stringBuilder); + SpecializationTextualNotationBuilder.BuildSpecificType(poco, 0, stringBuilder); stringBuilder.Append(" :>> "); - SpecializationTextualNotationBuilder.BuildGeneralType(poco, stringBuilder); + SpecializationTextualNotationBuilder.BuildGeneralType(poco, 0, stringBuilder); RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs index 6f652613..ea54d1a5 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -75,7 +76,8 @@ public static void BuildVariantReference(SysML2.NET.Core.POCO.Systems.Definition { ReferenceSubsettingTextualNotationBuilder.BuildOwnedReferenceSubsetting(ownedRelationshipOfReferenceSubsettingIterator.Current, stringBuilder); } - FeatureTextualNotationBuilder.BuildFeatureSpecialization(poco, stringBuilder); + // Handle collection Non Terminal + BuildFeatureSpecializationInternal(poco, stringBuilder); FeatureTextualNotationBuilder.BuildFeatureSpecialization(poco, stringBuilder); UsageTextualNotationBuilder.BuildUsageBody(poco, stringBuilder); } @@ -95,7 +97,7 @@ public static void BuildSourceEnd(SysML2.NET.Core.POCO.Systems.DefinitionAndUsag if (ownedRelationshipOfOwningMembershipIterator.Current != null) { - OwningMembershipTextualNotationBuilder.BuildOwnedMultiplicity(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + OwningMembershipTextualNotationBuilder.BuildOwnedMultiplicity(ownedRelationshipOfOwningMembershipIterator.Current, 0, stringBuilder); } stringBuilder.Append(' '); } @@ -119,7 +121,7 @@ public static void BuildConnectorEnd(SysML2.NET.Core.POCO.Systems.DefinitionAndU if (ownedRelationshipOfOwningMembershipIterator.Current != null) { - OwningMembershipTextualNotationBuilder.BuildOwnedCrossMultiplicityMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + OwningMembershipTextualNotationBuilder.BuildOwnedCrossMultiplicityMember(ownedRelationshipOfOwningMembershipIterator.Current, 0, stringBuilder); } stringBuilder.Append(' '); } @@ -146,17 +148,22 @@ public static void BuildConnectorEnd(SysML2.NET.Core.POCO.Systems.DefinitionAndU /// FlowFeature:ReferenceUsage=ownedRelationship+=FlowFeatureRedefinition /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildFlowFeature(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildFlowFeature(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelationshipOfRedefinitionIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfRedefinitionIterator.MoveNext(); - - if (ownedRelationshipOfRedefinitionIterator.Current != null) + if (elementIndex < poco.OwnedRelationship.Count) { - RedefinitionTextualNotationBuilder.BuildFlowFeatureRedefinition(ownedRelationshipOfRedefinitionIterator.Current, stringBuilder); + var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; + + if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Core.Features.IRedefinition elementAsRedefinition) + { + RedefinitionTextualNotationBuilder.BuildFlowFeatureRedefinition(elementAsRedefinition, stringBuilder); + } } + return elementIndex; } /// @@ -175,17 +182,22 @@ public static void BuildPayloadParameter(SysML2.NET.Core.POCO.Systems.Definition /// NodeParameter:ReferenceUsage=ownedRelationship+=FeatureBinding /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildNodeParameter(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildNodeParameter(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfFeatureValueIterator.MoveNext(); - - if (ownedRelationshipOfFeatureValueIterator.Current != null) + if (elementIndex < poco.OwnedRelationship.Count) { - FeatureValueTextualNotationBuilder.BuildFeatureBinding(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; + + if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue elementAsFeatureValue) + { + FeatureValueTextualNotationBuilder.BuildFeatureBinding(elementAsFeatureValue, 0, stringBuilder); + } } + return elementIndex; } /// @@ -214,7 +226,7 @@ public static void BuildAssignmentTargetParameter(SysML2.NET.Core.POCO.Systems.D if (ownedRelationshipOfFeatureValueIterator.Current != null) { - FeatureValueTextualNotationBuilder.BuildAssignmentTargetBinding(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + FeatureValueTextualNotationBuilder.BuildAssignmentTargetBinding(ownedRelationshipOfFeatureValueIterator.Current, 0, stringBuilder); } stringBuilder.Append("."); stringBuilder.Append(' '); @@ -255,7 +267,11 @@ public static void BuildEmptyFeature(SysML2.NET.Core.POCO.Systems.DefinitionAndU public static void BuildSubjectUsage(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) { stringBuilder.Append("subject "); - UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, stringBuilder); + // Handle collection Non Terminal + for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + { + ownedRelationshipIndex = UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, ownedRelationshipIndex, stringBuilder); + } UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); } @@ -265,17 +281,22 @@ public static void BuildSubjectUsage(SysML2.NET.Core.POCO.Systems.DefinitionAndU /// SatisfactionParameter:ReferenceUsage=ownedRelationship+=SatisfactionFeatureValue /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildSatisfactionParameter(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildSatisfactionParameter(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfFeatureValueIterator.MoveNext(); - - if (ownedRelationshipOfFeatureValueIterator.Current != null) + if (elementIndex < poco.OwnedRelationship.Count) { - FeatureValueTextualNotationBuilder.BuildSatisfactionFeatureValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; + + if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue elementAsFeatureValue) + { + FeatureValueTextualNotationBuilder.BuildSatisfactionFeatureValue(elementAsFeatureValue, 0, stringBuilder); + } } + return elementIndex; } /// @@ -296,7 +317,7 @@ public static void BuildMetadataBodyUsage(SysML2.NET.Core.POCO.Systems.Definitio RedefinitionTextualNotationBuilder.BuildOwnedRedefinition(ownedRelationshipOfRedefinitionIterator.Current, stringBuilder); } FeatureTextualNotationBuilder.BuildFeatureSpecializationPart(poco, stringBuilder); - FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + FeatureTextualNotationBuilder.BuildValuePart(poco, 0, stringBuilder); TypeTextualNotationBuilder.BuildMetadataBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RelationshipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RelationshipTextualNotationBuilder.cs index 9b8a7c1e..e402e140 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RelationshipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RelationshipTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -50,28 +51,36 @@ public static void BuildRelationshipBody(SysML2.NET.Core.POCO.Root.Elements.IRel /// RelationshipOwnedElement:Relationship=ownedRelatedElement+=OwnedRelatedElement|ownedRelationship+=OwnedAnnotation /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildRelationshipOwnedElement(SysML2.NET.Core.POCO.Root.Elements.IRelationship poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildRelationshipOwnedElement(SysML2.NET.Core.POCO.Root.Elements.IRelationship poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementIterator = poco.OwnedRelatedElement.GetEnumerator(); - using var ownedRelationshipOfAnnotationIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - if (ownedRelatedElementIterator.MoveNext()) { - - if (ownedRelatedElementIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - ElementTextualNotationBuilder.BuildOwnedRelatedElement(ownedRelatedElementIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Root.Elements.IElement elementAsElement) + { + ElementTextualNotationBuilder.BuildOwnedRelatedElement(elementAsElement, stringBuilder); + } } } - else if (ownedRelationshipOfAnnotationIterator.MoveNext()) +else { - - if (ownedRelationshipOfAnnotationIterator.Current != null) + if (elementIndex < poco.OwnedRelationship.Count) { - AnnotationTextualNotationBuilder.BuildOwnedAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; + + if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Root.Annotations.IAnnotation elementAsAnnotation) + { + AnnotationTextualNotationBuilder.BuildOwnedAnnotation(elementAsAnnotation, 0, stringBuilder); + } } } + return elementIndex; } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingUsageTextualNotationBuilder.cs index 5835570f..3dc595cd 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -39,10 +40,13 @@ public static partial class RenderingUsageTextualNotationBuilder /// ViewRenderingUsage:RenderingUsage=ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?UsageBody|(UsageExtensionKeyword*'rendering'|UsageExtensionKeyword+)Usage /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildViewRenderingUsage(SysML2.NET.Core.POCO.Systems.Views.IRenderingUsage poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildViewRenderingUsage(SysML2.NET.Core.POCO.Systems.Views.IRenderingUsage poco, int elementIndex, StringBuilder stringBuilder) { throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + return elementIndex; } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.cs index 6bc28e37..786063c3 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.cs @@ -49,7 +49,7 @@ public static void BuildRequirementConstraintMember(SysML2.NET.Core.POCO.Systems if (ownedRelatedElementOfConstraintUsageIterator.Current != null) { - ConstraintUsageTextualNotationBuilder.BuildRequirementConstraintUsage(ownedRelatedElementOfConstraintUsageIterator.Current, stringBuilder); + ConstraintUsageTextualNotationBuilder.BuildRequirementConstraintUsage(ownedRelatedElementOfConstraintUsageIterator.Current, 0, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementUsageTextualNotationBuilder.cs index 6afde8fd..09ae173c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -42,7 +43,11 @@ public static partial class RequirementUsageTextualNotationBuilder /// 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); + // Handle collection Non Terminal + for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + { + ownedRelationshipIndex = UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, ownedRelationshipIndex, stringBuilder); + } ConstraintUsageTextualNotationBuilder.BuildConstraintUsageDeclaration(poco, stringBuilder); TypeTextualNotationBuilder.BuildRequirementBody(poco, stringBuilder); @@ -53,10 +58,13 @@ public static void BuildObjectiveRequirementUsage(SysML2.NET.Core.POCO.Systems.R /// RequirementVerificationUsage:RequirementUsage=ownedRelationship+=OwnedReferenceSubsettingFeatureSpecialization*RequirementBody|(UsageExtensionKeyword*'requirement'|UsageExtensionKeyword+)ConstraintUsageDeclarationRequirementBody /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildRequirementVerificationUsage(SysML2.NET.Core.POCO.Systems.Requirements.IRequirementUsage poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildRequirementVerificationUsage(SysML2.NET.Core.POCO.Systems.Requirements.IRequirementUsage poco, int elementIndex, StringBuilder stringBuilder) { throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + return elementIndex; } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementVerificationMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementVerificationMembershipTextualNotationBuilder.cs index 9fc0e309..f05e179d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementVerificationMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementVerificationMembershipTextualNotationBuilder.cs @@ -50,7 +50,7 @@ public static void BuildRequirementVerificationMember(SysML2.NET.Core.POCO.Syste if (ownedRelatedElementOfRequirementUsageIterator.Current != null) { - RequirementUsageTextualNotationBuilder.BuildRequirementVerificationUsage(ownedRelatedElementOfRequirementUsageIterator.Current, stringBuilder); + RequirementUsageTextualNotationBuilder.BuildRequirementVerificationUsage(ownedRelatedElementOfRequirementUsageIterator.Current, 0, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReturnParameterMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReturnParameterMembershipTextualNotationBuilder.cs index 1daf515f..ba67efc3 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReturnParameterMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReturnParameterMembershipTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -79,17 +80,22 @@ public static void BuildReturnFeatureMember(SysML2.NET.Core.POCO.Kernel.Function /// EmptyResultMember:ReturnParameterMembership=ownedRelatedElement+=EmptyFeature /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildEmptyResultMember(SysML2.NET.Core.POCO.Kernel.Functions.IReturnParameterMembership poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildEmptyResultMember(SysML2.NET.Core.POCO.Kernel.Functions.IReturnParameterMembership poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfReferenceUsageIterator.MoveNext(); - - if (ownedRelatedElementOfReferenceUsageIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - ReferenceUsageTextualNotationBuilder.BuildEmptyFeature(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage elementAsReferenceUsage) + { + ReferenceUsageTextualNotationBuilder.BuildEmptyFeature(elementAsReferenceUsage, stringBuilder); + } } + return elementIndex; } /// @@ -97,17 +103,22 @@ public static void BuildEmptyResultMember(SysML2.NET.Core.POCO.Kernel.Functions. /// ConstructorResultMember:ReturnParameterMembership=ownedRelatedElement+=ConstructorResult /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildConstructorResultMember(SysML2.NET.Core.POCO.Kernel.Functions.IReturnParameterMembership poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildConstructorResultMember(SysML2.NET.Core.POCO.Kernel.Functions.IReturnParameterMembership poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfFeatureIterator.MoveNext(); - - if (ownedRelatedElementOfFeatureIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - FeatureTextualNotationBuilder.BuildConstructorResult(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Core.Features.IFeature elementAsFeature) + { + FeatureTextualNotationBuilder.BuildConstructorResult(elementAsFeature, stringBuilder); + } } + return elementIndex; } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.cs index e21f0e77..18847f9b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.cs @@ -52,7 +52,7 @@ public static void BuildSatisfyRequirementUsage(SysML2.NET.Core.POCO.Systems.Req stringBuilder.Append("satisfy "); throw new System.NotSupportedException("Multiple alternatives not implemented yet"); stringBuilder.Append(' '); - FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + FeatureTextualNotationBuilder.BuildValuePart(poco, 0, stringBuilder); if (ownedRelationshipOfSubjectMembershipIterator.MoveNext()) { @@ -60,7 +60,7 @@ public static void BuildSatisfyRequirementUsage(SysML2.NET.Core.POCO.Systems.Req if (ownedRelationshipOfSubjectMembershipIterator.Current != null) { - SubjectMembershipTextualNotationBuilder.BuildSatisfactionSubjectMember(ownedRelationshipOfSubjectMembershipIterator.Current, stringBuilder); + SubjectMembershipTextualNotationBuilder.BuildSatisfactionSubjectMember(ownedRelationshipOfSubjectMembershipIterator.Current, 0, stringBuilder); } stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.cs index f319cd25..f2cb2315 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -66,9 +67,9 @@ public static void BuildSendNodeDeclaration(SysML2.NET.Core.POCO.Systems.Actions if (ownedRelationshipOfParameterMembershipIterator.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); } - BuildSenderReceiverPart(poco, stringBuilder); + BuildSenderReceiverPart(poco, 0, stringBuilder); } @@ -77,10 +78,13 @@ public static void BuildSendNodeDeclaration(SysML2.NET.Core.POCO.Systems.Actions /// SenderReceiverPart:SendActionUsage='via'ownedRelationship+=NodeParameterMember('to'ownedRelationship+=NodeParameterMember)?|ownedRelationship+=EmptyParameterMember'to'ownedRelationship+=NodeParameterMember /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildSenderReceiverPart(SysML2.NET.Core.POCO.Systems.Actions.ISendActionUsage poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildSenderReceiverPart(SysML2.NET.Core.POCO.Systems.Actions.ISendActionUsage poco, int elementIndex, StringBuilder stringBuilder) { throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + return elementIndex; } /// @@ -109,7 +113,11 @@ public static void BuildTransitionSendActionUsage(SysML2.NET.Core.POCO.Systems.A if (BuildGroupConditionForTransitionSendActionUsage(poco)) { stringBuilder.Append("{"); - TypeTextualNotationBuilder.BuildActionBodyItem(poco, stringBuilder); + // Handle collection Non Terminal + for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + { + ownedRelationshipIndex = TypeTextualNotationBuilder.BuildActionBodyItem(poco, ownedRelationshipIndex, stringBuilder); + } stringBuilder.Append("}"); stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.cs index 54a07b37..06481f54 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -42,7 +43,7 @@ public static partial class SpecializationTextualNotationBuilder /// The that contains the entire textual notation public static void BuildOwnedSpecialization(SysML2.NET.Core.POCO.Core.Types.ISpecialization poco, StringBuilder stringBuilder) { - BuildGeneralType(poco, stringBuilder); + BuildGeneralType(poco, 0, stringBuilder); } @@ -51,10 +52,13 @@ public static void BuildOwnedSpecialization(SysML2.NET.Core.POCO.Core.Types.ISpe /// SpecificType:Specialization=specific=[QualifiedName]|specific+=OwnedFeatureChain{ownedRelatedElement+=specific} /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildSpecificType(SysML2.NET.Core.POCO.Core.Types.ISpecialization poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildSpecificType(SysML2.NET.Core.POCO.Core.Types.ISpecialization poco, int elementIndex, StringBuilder stringBuilder) { throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + return elementIndex; } /// @@ -62,10 +66,13 @@ public static void BuildSpecificType(SysML2.NET.Core.POCO.Core.Types.ISpecializa /// GeneralType:Specialization=general=[QualifiedName]|general+=OwnedFeatureChain{ownedRelatedElement+=general} /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildGeneralType(SysML2.NET.Core.POCO.Core.Types.ISpecialization poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildGeneralType(SysML2.NET.Core.POCO.Core.Types.ISpecialization poco, int elementIndex, StringBuilder stringBuilder) { throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + return elementIndex; } /// @@ -85,9 +92,9 @@ public static void BuildSpecialization(SysML2.NET.Core.POCO.Core.Types.ISpeciali } stringBuilder.Append("subtype "); - BuildSpecificType(poco, stringBuilder); + BuildSpecificType(poco, 0, stringBuilder); stringBuilder.Append(" :> "); - BuildGeneralType(poco, stringBuilder); + BuildGeneralType(poco, 0, stringBuilder); RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StepTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StepTextualNotationBuilder.cs index e6aedc8d..35d18497 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StepTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StepTextualNotationBuilder.cs @@ -58,7 +58,7 @@ public static void BuildStep(SysML2.NET.Core.POCO.Kernel.Behaviors.IStep poco, S stringBuilder.Append("step "); FeatureTextualNotationBuilder.BuildFeatureDeclaration(poco, stringBuilder); - FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + FeatureTextualNotationBuilder.BuildValuePart(poco, 0, stringBuilder); TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubjectMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubjectMembershipTextualNotationBuilder.cs index 9be7c4ee..d2c0415d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubjectMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubjectMembershipTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -58,17 +59,22 @@ public static void BuildSubjectMember(SysML2.NET.Core.POCO.Systems.Requirements. /// SatisfactionSubjectMember:SubjectMembership=ownedRelatedElement+=SatisfactionParameter /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildSatisfactionSubjectMember(SysML2.NET.Core.POCO.Systems.Requirements.ISubjectMembership poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildSatisfactionSubjectMember(SysML2.NET.Core.POCO.Systems.Requirements.ISubjectMembership poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfReferenceUsageIterator.MoveNext(); - - if (ownedRelatedElementOfReferenceUsageIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - ReferenceUsageTextualNotationBuilder.BuildSatisfactionParameter(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage elementAsReferenceUsage) + { + ReferenceUsageTextualNotationBuilder.BuildSatisfactionParameter(elementAsReferenceUsage, 0, stringBuilder); + } } + return elementIndex; } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.cs index 78f3f830..7d3d4c8d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.cs @@ -62,9 +62,9 @@ public static void BuildSubsetting(SysML2.NET.Core.POCO.Core.Features.ISubsettin } stringBuilder.Append("subset "); - SpecializationTextualNotationBuilder.BuildSpecificType(poco, stringBuilder); + SpecializationTextualNotationBuilder.BuildSpecificType(poco, 0, stringBuilder); stringBuilder.Append(" :> "); - SpecializationTextualNotationBuilder.BuildGeneralType(poco, stringBuilder); + SpecializationTextualNotationBuilder.BuildGeneralType(poco, 0, stringBuilder); RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionAsUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionAsUsageTextualNotationBuilder.cs index 37e7c62b..c24ffba1 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionAsUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionAsUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -39,17 +40,22 @@ public static partial class SuccessionAsUsageTextualNotationBuilder /// SourceSuccession:SuccessionAsUsage=ownedRelationship+=SourceEndMember /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildSourceSuccession(SysML2.NET.Core.POCO.Systems.Connections.ISuccessionAsUsage poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildSourceSuccession(SysML2.NET.Core.POCO.Systems.Connections.ISuccessionAsUsage poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelationshipOfEndFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); - - if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + if (elementIndex < poco.OwnedRelationship.Count) { - EndFeatureMembershipTextualNotationBuilder.BuildSourceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; + + if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership elementAsEndFeatureMembership) + { + EndFeatureMembershipTextualNotationBuilder.BuildSourceEndMember(elementAsEndFeatureMembership, 0, stringBuilder); + } } + return elementIndex; } /// @@ -65,14 +71,14 @@ public static void BuildTargetSuccession(SysML2.NET.Core.POCO.Systems.Connection if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildSourceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + EndFeatureMembershipTextualNotationBuilder.BuildSourceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); } stringBuilder.Append("then "); ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); } } @@ -100,14 +106,14 @@ public static void BuildSuccessionAsUsage(SysML2.NET.Core.POCO.Systems.Connectio if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); } stringBuilder.Append("then "); ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); } UsageTextualNotationBuilder.BuildUsageBody(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowUsageTextualNotationBuilder.cs index d54f23d9..f7dd5718 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowUsageTextualNotationBuilder.cs @@ -45,7 +45,7 @@ public static void BuildSuccessionFlowUsage(SysML2.NET.Core.POCO.Systems.Flows.I OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("succession "); stringBuilder.Append("flow "); - FlowUsageTextualNotationBuilder.BuildFlowDeclaration(poco, stringBuilder); + FlowUsageTextualNotationBuilder.BuildFlowDeclaration(poco, 0, stringBuilder); TypeTextualNotationBuilder.BuildDefinitionBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionTextualNotationBuilder.cs index 6e4febc5..0328df9f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionTextualNotationBuilder.cs @@ -47,13 +47,13 @@ public static void BuildTransitionSuccession(SysML2.NET.Core.POCO.Kernel.Connect if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildEmptyEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + EndFeatureMembershipTextualNotationBuilder.BuildEmptyEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); } ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, stringBuilder); + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TerminateActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TerminateActionUsageTextualNotationBuilder.cs index a361fe09..07427c55 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TerminateActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TerminateActionUsageTextualNotationBuilder.cs @@ -52,7 +52,7 @@ public static void BuildTerminateNode(SysML2.NET.Core.POCO.Systems.Actions.ITerm if (ownedRelationshipOfParameterMembershipIterator.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); } stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionUsageTextualNotationBuilder.cs index aec0cca0..14a695a5 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionUsageTextualNotationBuilder.cs @@ -55,7 +55,7 @@ public static void BuildGuardedTargetSuccession(SysML2.NET.Core.POCO.Systems.Sta if (ownedRelationshipOfOwningMembershipIterator.Current != null) { - OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(ownedRelationshipOfOwningMembershipIterator.Current, 0, stringBuilder); } } @@ -74,7 +74,7 @@ public static void BuildDefaultTargetSuccession(SysML2.NET.Core.POCO.Systems.Sta if (ownedRelationshipOfOwningMembershipIterator.Current != null) { - OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(ownedRelationshipOfOwningMembershipIterator.Current, 0, stringBuilder); } } @@ -116,7 +116,7 @@ public static void BuildGuardedSuccession(SysML2.NET.Core.POCO.Systems.States.IT if (ownedRelationshipOfOwningMembershipIterator.Current != null) { - OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(ownedRelationshipOfOwningMembershipIterator.Current, 0, stringBuilder); } UsageTextualNotationBuilder.BuildUsageBody(poco, stringBuilder); @@ -137,7 +137,7 @@ public static void BuildTargetTransitionUsage(SysML2.NET.Core.POCO.Systems.State if (ownedRelationshipOfParameterMembershipIterator.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildEmptyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + ParameterMembershipTextualNotationBuilder.BuildEmptyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); } throw new System.NotSupportedException("Multiple alternatives not implemented yet"); stringBuilder.Append("then "); @@ -145,7 +145,7 @@ public static void BuildTargetTransitionUsage(SysML2.NET.Core.POCO.Systems.State if (ownedRelationshipOfOwningMembershipIterator.Current != null) { - OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(ownedRelationshipOfOwningMembershipIterator.Current, 0, stringBuilder); } TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); @@ -182,7 +182,7 @@ public static void BuildTransitionUsage(SysML2.NET.Core.POCO.Systems.States.ITra if (ownedRelationshipOfParameterMembershipIterator.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildEmptyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + ParameterMembershipTextualNotationBuilder.BuildEmptyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); } if (ownedRelationshipOfParameterMembershipIterator.MoveNext()) @@ -190,7 +190,7 @@ public static void BuildTransitionUsage(SysML2.NET.Core.POCO.Systems.States.ITra if (ownedRelationshipOfParameterMembershipIterator.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildEmptyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + ParameterMembershipTextualNotationBuilder.BuildEmptyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); } if (ownedRelationshipOfTransitionFeatureMembershipIterator.Current != null) @@ -227,7 +227,7 @@ public static void BuildTransitionUsage(SysML2.NET.Core.POCO.Systems.States.ITra if (ownedRelationshipOfOwningMembershipIterator.Current != null) { - OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(ownedRelationshipOfOwningMembershipIterator.Current, 0, stringBuilder); } TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TriggerInvocationExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TriggerInvocationExpressionTextualNotationBuilder.cs index 91d8ba09..9d1e38c8 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TriggerInvocationExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TriggerInvocationExpressionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -39,10 +40,13 @@ public static partial class TriggerInvocationExpressionTextualNotationBuilder /// TriggerExpression:TriggerInvocationExpression=kind=('at'|'after')ownedRelationship+=ArgumentMember|kind='when'ownedRelationship+=ArgumentExpressionMember /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildTriggerExpression(SysML2.NET.Core.POCO.Systems.Actions.ITriggerInvocationExpression poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildTriggerExpression(SysML2.NET.Core.POCO.Systems.Actions.ITriggerInvocationExpression poco, int elementIndex, StringBuilder stringBuilder) { throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + return elementIndex; } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs index 864238ab..31c86230 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -50,10 +51,13 @@ public static void BuildDefinitionBody(SysML2.NET.Core.POCO.Core.Types.IType poc /// 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 index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildDefinitionBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildDefinitionBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, int elementIndex, StringBuilder stringBuilder) { throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + return elementIndex; } /// @@ -72,10 +76,13 @@ public static void BuildInterfaceBody(SysML2.NET.Core.POCO.Core.Types.IType poco /// 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 index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildInterfaceBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildInterfaceBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, int elementIndex, StringBuilder stringBuilder) { throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + return elementIndex; } /// @@ -94,10 +101,13 @@ public static void BuildActionBody(SysML2.NET.Core.POCO.Core.Types.IType poco, S /// ActionBodyItem:Type=NonBehaviorBodyItem|ownedRelationship+=InitialNodeMember(ownedRelationship+=ActionTargetSuccessionMember)*|(ownedRelationship+=SourceSuccessionMember)?ownedRelationship+=ActionBehaviorMember(ownedRelationship+=ActionTargetSuccessionMember)*|ownedRelationship+=GuardedSuccessionMember /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildActionBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildActionBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, int elementIndex, StringBuilder stringBuilder) { throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + return elementIndex; } /// @@ -105,10 +115,13 @@ public static void BuildActionBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poc /// 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 index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildStateBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildStateBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, int elementIndex, StringBuilder stringBuilder) { throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + return elementIndex; } /// @@ -131,7 +144,11 @@ public static void BuildCalculationBody(SysML2.NET.Core.POCO.Core.Types.IType po public static void BuildCalculationBodyPart(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) { using var ownedRelationshipOfResultExpressionMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - BuildCalculationBodyItem(poco, stringBuilder); + // Handle collection Non Terminal + for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + { + ownedRelationshipIndex = BuildCalculationBodyItem(poco, ownedRelationshipIndex, stringBuilder); + } if (ownedRelationshipOfResultExpressionMembershipIterator.MoveNext()) { @@ -151,25 +168,23 @@ public static void BuildCalculationBodyPart(SysML2.NET.Core.POCO.Core.Types.ITyp /// CalculationBodyItem:Type=ActionBodyItem|ownedRelationship+=ReturnParameterMember /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildCalculationBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildCalculationBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, int elementIndex, StringBuilder stringBuilder) { - var ownedRelationship = poco.OwnedRelationship.ToList(); + var elementsElement = poco.OwnedRelationship[elementIndex]; - for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < ownedRelationship.Count; ownedRelationshipIndex++) + switch (elementsElement) { - var ownedRelationshipElement = ownedRelationship[ownedRelationshipIndex]; - - switch (ownedRelationshipElement) - { - case SysML2.NET.Core.POCO.Kernel.Functions.ReturnParameterMembership returnParameterMembership: - ReturnParameterMembershipTextualNotationBuilder.BuildReturnParameterMember(returnParameterMembership, stringBuilder); break; - default: - ownedRelationshipIndex = BuildActionBodyItem(ownedRelationshipIndex, ownedRelationship, stringBuilder); - break; + case SysML2.NET.Core.POCO.Kernel.Functions.ReturnParameterMembership returnParameterMembership: + ReturnParameterMembershipTextualNotationBuilder.BuildReturnParameterMember(returnParameterMembership, stringBuilder); break; + case SysML2.NET.Core.POCO.Core.Types.IType type: + elementIndex = BuildActionBodyItem(type, elementIndex, stringBuilder); + break; - } } + return elementIndex; } /// @@ -188,35 +203,33 @@ public static void BuildRequirementBody(SysML2.NET.Core.POCO.Core.Types.IType po /// RequirementBodyItem:Type=DefinitionBodyItem|ownedRelationship+=SubjectMember|ownedRelationship+=RequirementConstraintMember|ownedRelationship+=FramedConcernMember|ownedRelationship+=RequirementVerificationMember|ownedRelationship+=ActorMember|ownedRelationship+=StakeholderMember /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildRequirementBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildRequirementBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, int elementIndex, StringBuilder stringBuilder) { - var ownedRelationship = poco.OwnedRelationship.ToList(); + var elementsElement = poco.OwnedRelationship[elementIndex]; - for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < ownedRelationship.Count; ownedRelationshipIndex++) + switch (elementsElement) { - var ownedRelationshipElement = ownedRelationship[ownedRelationshipIndex]; + case SysML2.NET.Core.POCO.Systems.Requirements.SubjectMembership subjectMembership: + SubjectMembershipTextualNotationBuilder.BuildSubjectMember(subjectMembership, stringBuilder); break; + case SysML2.NET.Core.POCO.Systems.Requirements.RequirementConstraintMembership requirementConstraintMembership: + RequirementConstraintMembershipTextualNotationBuilder.BuildRequirementConstraintMember(requirementConstraintMembership, stringBuilder); break; + case SysML2.NET.Core.POCO.Systems.Requirements.FramedConcernMembership framedConcernMembership: + FramedConcernMembershipTextualNotationBuilder.BuildFramedConcernMember(framedConcernMembership, stringBuilder); break; + case SysML2.NET.Core.POCO.Systems.VerificationCases.RequirementVerificationMembership requirementVerificationMembership: + RequirementVerificationMembershipTextualNotationBuilder.BuildRequirementVerificationMember(requirementVerificationMembership, stringBuilder); break; + case SysML2.NET.Core.POCO.Systems.Requirements.ActorMembership actorMembership: + ActorMembershipTextualNotationBuilder.BuildActorMember(actorMembership, stringBuilder); break; + case SysML2.NET.Core.POCO.Systems.Requirements.StakeholderMembership stakeholderMembership: + StakeholderMembershipTextualNotationBuilder.BuildStakeholderMember(stakeholderMembership, stringBuilder); break; + case SysML2.NET.Core.POCO.Core.Types.IType type: + elementIndex = BuildDefinitionBodyItem(type, elementIndex, stringBuilder); + break; - switch (ownedRelationshipElement) - { - case SysML2.NET.Core.POCO.Systems.Requirements.SubjectMembership subjectMembership: - SubjectMembershipTextualNotationBuilder.BuildSubjectMember(subjectMembership, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Requirements.RequirementConstraintMembership requirementConstraintMembership: - RequirementConstraintMembershipTextualNotationBuilder.BuildRequirementConstraintMember(requirementConstraintMembership, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Requirements.FramedConcernMembership framedConcernMembership: - FramedConcernMembershipTextualNotationBuilder.BuildFramedConcernMember(framedConcernMembership, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.VerificationCases.RequirementVerificationMembership requirementVerificationMembership: - RequirementVerificationMembershipTextualNotationBuilder.BuildRequirementVerificationMember(requirementVerificationMembership, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Requirements.ActorMembership actorMembership: - ActorMembershipTextualNotationBuilder.BuildActorMember(actorMembership, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Requirements.StakeholderMembership stakeholderMembership: - StakeholderMembershipTextualNotationBuilder.BuildStakeholderMember(stakeholderMembership, stringBuilder); break; - default: - ownedRelationshipIndex = BuildDefinitionBodyItem(ownedRelationshipIndex, ownedRelationship, stringBuilder); - break; - - } } + return elementIndex; } /// @@ -235,29 +248,27 @@ public static void BuildCaseBody(SysML2.NET.Core.POCO.Core.Types.IType poco, Str /// CaseBodyItem:Type=ActionBodyItem|ownedRelationship+=SubjectMember|ownedRelationship+=ActorMember|ownedRelationship+=ObjectiveMember /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildCaseBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildCaseBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, int elementIndex, StringBuilder stringBuilder) { - var ownedRelationship = poco.OwnedRelationship.ToList(); + var elementsElement = poco.OwnedRelationship[elementIndex]; - for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < ownedRelationship.Count; ownedRelationshipIndex++) + switch (elementsElement) { - var ownedRelationshipElement = ownedRelationship[ownedRelationshipIndex]; + case SysML2.NET.Core.POCO.Systems.Requirements.SubjectMembership subjectMembership: + SubjectMembershipTextualNotationBuilder.BuildSubjectMember(subjectMembership, stringBuilder); break; + case SysML2.NET.Core.POCO.Systems.Requirements.ActorMembership actorMembership: + ActorMembershipTextualNotationBuilder.BuildActorMember(actorMembership, stringBuilder); break; + case SysML2.NET.Core.POCO.Systems.Cases.ObjectiveMembership objectiveMembership: + ObjectiveMembershipTextualNotationBuilder.BuildObjectiveMember(objectiveMembership, stringBuilder); break; + case SysML2.NET.Core.POCO.Core.Types.IType type: + elementIndex = BuildActionBodyItem(type, elementIndex, stringBuilder); + break; - switch (ownedRelationshipElement) - { - case SysML2.NET.Core.POCO.Systems.Requirements.SubjectMembership subjectMembership: - SubjectMembershipTextualNotationBuilder.BuildSubjectMember(subjectMembership, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Requirements.ActorMembership actorMembership: - ActorMembershipTextualNotationBuilder.BuildActorMember(actorMembership, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Cases.ObjectiveMembership objectiveMembership: - ObjectiveMembershipTextualNotationBuilder.BuildObjectiveMember(objectiveMembership, stringBuilder); break; - default: - ownedRelationshipIndex = BuildActionBodyItem(ownedRelationshipIndex, ownedRelationship, stringBuilder); - break; - - } } + return elementIndex; } /// @@ -323,14 +334,15 @@ public static void BuildTypeDeclaration(SysML2.NET.Core.POCO.Core.Types.IType po if (ownedRelationshipOfOwningMembershipIterator.Current != null) { - OwningMembershipTextualNotationBuilder.BuildOwnedMultiplicity(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + OwningMembershipTextualNotationBuilder.BuildOwnedMultiplicity(ownedRelationshipOfOwningMembershipIterator.Current, 0, stringBuilder); } stringBuilder.Append(' '); } - throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); + // Have to handle group collection stringBuilder.Append(' '); - BuildTypeRelationshipPart(poco, stringBuilder); + // Handle collection Non Terminal + BuildTypeRelationshipPartInternal(poco, stringBuilder); BuildTypeRelationshipPart(poco, stringBuilder); } @@ -439,7 +451,7 @@ public static void BuildUnioningPart(SysML2.NET.Core.POCO.Core.Types.IType poco, if (ownedRelationshipOfUnioningIterator.Current != null) { - UnioningTextualNotationBuilder.BuildUnioning(ownedRelationshipOfUnioningIterator.Current, stringBuilder); + UnioningTextualNotationBuilder.BuildUnioning(ownedRelationshipOfUnioningIterator.Current, 0, stringBuilder); } while (ownedRelationshipOfUnioningIterator.MoveNext()) @@ -448,7 +460,7 @@ public static void BuildUnioningPart(SysML2.NET.Core.POCO.Core.Types.IType poco, if (ownedRelationshipOfUnioningIterator.Current != null) { - UnioningTextualNotationBuilder.BuildUnioning(ownedRelationshipOfUnioningIterator.Current, stringBuilder); + UnioningTextualNotationBuilder.BuildUnioning(ownedRelationshipOfUnioningIterator.Current, 0, stringBuilder); } } @@ -469,7 +481,7 @@ public static void BuildIntersectingPart(SysML2.NET.Core.POCO.Core.Types.IType p if (ownedRelationshipOfIntersectingIterator.Current != null) { - IntersectingTextualNotationBuilder.BuildIntersecting(ownedRelationshipOfIntersectingIterator.Current, stringBuilder); + IntersectingTextualNotationBuilder.BuildIntersecting(ownedRelationshipOfIntersectingIterator.Current, 0, stringBuilder); } while (ownedRelationshipOfIntersectingIterator.MoveNext()) @@ -478,7 +490,7 @@ public static void BuildIntersectingPart(SysML2.NET.Core.POCO.Core.Types.IType p if (ownedRelationshipOfIntersectingIterator.Current != null) { - IntersectingTextualNotationBuilder.BuildIntersecting(ownedRelationshipOfIntersectingIterator.Current, stringBuilder); + IntersectingTextualNotationBuilder.BuildIntersecting(ownedRelationshipOfIntersectingIterator.Current, 0, stringBuilder); } } @@ -499,7 +511,7 @@ public static void BuildDifferencingPart(SysML2.NET.Core.POCO.Core.Types.IType p if (ownedRelationshipOfDifferencingIterator.Current != null) { - DifferencingTextualNotationBuilder.BuildDifferencing(ownedRelationshipOfDifferencingIterator.Current, stringBuilder); + DifferencingTextualNotationBuilder.BuildDifferencing(ownedRelationshipOfDifferencingIterator.Current, 0, stringBuilder); } while (ownedRelationshipOfDifferencingIterator.MoveNext()) @@ -508,7 +520,7 @@ public static void BuildDifferencingPart(SysML2.NET.Core.POCO.Core.Types.IType p if (ownedRelationshipOfDifferencingIterator.Current != null) { - DifferencingTextualNotationBuilder.BuildDifferencing(ownedRelationshipOfDifferencingIterator.Current, stringBuilder); + DifferencingTextualNotationBuilder.BuildDifferencing(ownedRelationshipOfDifferencingIterator.Current, 0, stringBuilder); } } @@ -531,28 +543,28 @@ public static void BuildTypeBody(SysML2.NET.Core.POCO.Core.Types.IType poco, Str /// TypeBodyElement:Type=ownedRelationship+=NonFeatureMember|ownedRelationship+=FeatureMember|ownedRelationship+=AliasMember|ownedRelationship+=Import /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildTypeBodyElement(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildTypeBodyElement(SysML2.NET.Core.POCO.Core.Types.IType poco, int elementIndex, StringBuilder stringBuilder) { - foreach (var elementInOwnedRelationship in poco.OwnedRelationship) + switch (elementInOwnedRelationship) { - switch (elementInOwnedRelationship) - { - case SysML2.NET.Core.POCO.Root.Namespaces.OwningMembership owningMembership when owningMembership.IsValidForNonFeatureMember(): - OwningMembershipTextualNotationBuilder.BuildNonFeatureMember(owningMembership, stringBuilder); - break; - case SysML2.NET.Core.POCO.Root.Namespaces.OwningMembership owningMembership when owningMembership.IsValidForFeatureMember(): - OwningMembershipTextualNotationBuilder.BuildFeatureMember(owningMembership, stringBuilder); - break; - case SysML2.NET.Core.POCO.Root.Namespaces.Membership membership: - MembershipTextualNotationBuilder.BuildAliasMember(membership, stringBuilder); - break; - case SysML2.NET.Core.POCO.Root.Namespaces.IImport import: - ImportTextualNotationBuilder.BuildImport(import, stringBuilder); - break; - } + case SysML2.NET.Core.POCO.Root.Namespaces.OwningMembership owningMembership when owningMembership.IsValidForNonFeatureMember(): + OwningMembershipTextualNotationBuilder.BuildNonFeatureMember(owningMembership, stringBuilder); + break; + case SysML2.NET.Core.POCO.Root.Namespaces.OwningMembership owningMembership when owningMembership.IsValidForFeatureMember(): + OwningMembershipTextualNotationBuilder.BuildFeatureMember(owningMembership, stringBuilder); + break; + case SysML2.NET.Core.POCO.Root.Namespaces.Membership membership: + MembershipTextualNotationBuilder.BuildAliasMember(membership, stringBuilder); + break; + case SysML2.NET.Core.POCO.Root.Namespaces.IImport import: + ImportTextualNotationBuilder.BuildImport(import, stringBuilder); + break; } + return elementIndex; } /// @@ -576,22 +588,7 @@ public static void BuildFunctionBodyPart(SysML2.NET.Core.POCO.Core.Types.IType p { using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); using var ownedRelationshipOfResultExpressionMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - var ownedRelationship = poco.OwnedRelationship.ToList(); - - for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < ownedRelationship.Count; ownedRelationshipIndex++) - { - var ownedRelationshipElement = ownedRelationship[ownedRelationshipIndex]; - - switch (ownedRelationshipElement) - { - case SysML2.NET.Core.POCO.Kernel.Functions.ReturnParameterMembership returnParameterMembership: - ReturnParameterMembershipTextualNotationBuilder.BuildReturnFeatureMember(returnParameterMembership, stringBuilder); break; - default: - ownedRelationshipIndex = BuildTypeBodyElement(ownedRelationshipIndex, ownedRelationship, stringBuilder); - break; - - } - } + // Have to handle group collection if (ownedRelationshipOfResultExpressionMembershipIterator.MoveNext()) { diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UnioningTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UnioningTextualNotationBuilder.cs index 7176ac25..73c1d403 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UnioningTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UnioningTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -39,24 +40,30 @@ public static partial class UnioningTextualNotationBuilder /// Unioning=unioningType=[QualifiedName]|ownedRelatedElement+=OwnedFeatureChain /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildUnioning(SysML2.NET.Core.POCO.Core.Types.IUnioning poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildUnioning(SysML2.NET.Core.POCO.Core.Types.IUnioning poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); if (poco.UnioningType != null) { stringBuilder.Append(poco.UnioningType.qualifiedName); stringBuilder.Append(' '); } - else if (ownedRelatedElementOfFeatureIterator.MoveNext()) + else { - - if (ownedRelatedElementOfFeatureIterator.Current != null) + if (elementIndex < poco.OwnedRelatedElement.Count) { - FeatureTextualNotationBuilder.BuildOwnedFeatureChain(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; + + if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Core.Features.IFeature elementAsFeature) + { + FeatureTextualNotationBuilder.BuildOwnedFeatureChain(elementAsFeature, stringBuilder); + } } } + return elementIndex; } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs index 6a0fb4a1..4742b7b2 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -124,7 +125,7 @@ public static void BuildEndUsagePrefix(SysML2.NET.Core.POCO.Systems.DefinitionAn if (ownedRelationshipOfOwningMembershipIterator.Current != null) { - OwningMembershipTextualNotationBuilder.BuildOwnedCrossFeatureMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + OwningMembershipTextualNotationBuilder.BuildOwnedCrossFeatureMember(ownedRelationshipOfOwningMembershipIterator.Current, 0, stringBuilder); } stringBuilder.Append(' '); } @@ -137,17 +138,22 @@ public static void BuildEndUsagePrefix(SysML2.NET.Core.POCO.Systems.DefinitionAn /// UsageExtensionKeyword:Usage=ownedRelationship+=PrefixMetadataMember /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildUsageExtensionKeyword(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildUsageExtensionKeyword(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, int elementIndex, StringBuilder stringBuilder) { - using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfOwningMembershipIterator.MoveNext(); - - if (ownedRelationshipOfOwningMembershipIterator.Current != null) + if (elementIndex < poco.OwnedRelationship.Count) { - OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; + + if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(elementAsOwningMembership, stringBuilder); + } } + return elementIndex; } /// @@ -170,7 +176,11 @@ public static void BuildUnextendedUsagePrefix(SysML2.NET.Core.POCO.Systems.Defin public static void BuildUsagePrefix(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) { BuildUnextendedUsagePrefix(poco, stringBuilder); - BuildUsageExtensionKeyword(poco, stringBuilder); + // Handle collection Non Terminal + for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + { + ownedRelationshipIndex = BuildUsageExtensionKeyword(poco, ownedRelationshipIndex, stringBuilder); + } } @@ -195,7 +205,7 @@ public static void BuildUsageDeclaration(SysML2.NET.Core.POCO.Systems.Definition /// 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); + FeatureTextualNotationBuilder.BuildValuePart(poco, 0, stringBuilder); BuildUsageBody(poco, stringBuilder); } @@ -381,7 +391,11 @@ public static void BuildActionTargetSuccession(SysML2.NET.Core.POCO.Systems.Defi public static void BuildExtendedUsage(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) { BuildUnextendedUsagePrefix(poco, stringBuilder); - BuildUsageExtensionKeyword(poco, stringBuilder); + // Handle collection Non Terminal + for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + { + ownedRelationshipIndex = BuildUsageExtensionKeyword(poco, ownedRelationshipIndex, stringBuilder); + } BuildUsage(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseUsageTextualNotationBuilder.cs index 459abd46..db106a74 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseUsageTextualNotationBuilder.cs @@ -46,7 +46,7 @@ public static void BuildUseCaseUsage(SysML2.NET.Core.POCO.Systems.UseCases.IUseC stringBuilder.Append("use "); stringBuilder.Append("case "); UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); - FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + FeatureTextualNotationBuilder.BuildValuePart(poco, 0, stringBuilder); TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseUsageTextualNotationBuilder.cs index 699b3e55..8ac0c477 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseUsageTextualNotationBuilder.cs @@ -45,7 +45,7 @@ public static void BuildVerificationCaseUsage(SysML2.NET.Core.POCO.Systems.Verif OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("verification "); UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); - FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + FeatureTextualNotationBuilder.BuildValuePart(poco, 0, stringBuilder); TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs index 6ff88183..4f3c2bde 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -50,27 +51,25 @@ public static void BuildViewDefinitionBody(SysML2.NET.Core.POCO.Systems.Views.IV /// ViewDefinitionBodyItem:ViewDefinition=DefinitionBodyItem|ownedRelationship+=ElementFilterMember|ownedRelationship+=ViewRenderingMember /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildViewDefinitionBodyItem(SysML2.NET.Core.POCO.Systems.Views.IViewDefinition poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildViewDefinitionBodyItem(SysML2.NET.Core.POCO.Systems.Views.IViewDefinition poco, int elementIndex, StringBuilder stringBuilder) { - var ownedRelationship = poco.OwnedRelationship.ToList(); + var elementsElement = poco.OwnedRelationship[elementIndex]; - for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < ownedRelationship.Count; ownedRelationshipIndex++) + switch (elementsElement) { - var ownedRelationshipElement = ownedRelationship[ownedRelationshipIndex]; + case SysML2.NET.Core.POCO.Kernel.Packages.ElementFilterMembership elementFilterMembership: + ElementFilterMembershipTextualNotationBuilder.BuildElementFilterMember(elementFilterMembership, stringBuilder); break; + case SysML2.NET.Core.POCO.Systems.Views.ViewRenderingMembership viewRenderingMembership: + ViewRenderingMembershipTextualNotationBuilder.BuildViewRenderingMember(viewRenderingMembership, stringBuilder); break; + case SysML2.NET.Core.POCO.Core.Types.IType type: + elementIndex = TypeTextualNotationBuilder.BuildDefinitionBodyItem(type, elementIndex, stringBuilder); + break; - switch (ownedRelationshipElement) - { - case SysML2.NET.Core.POCO.Kernel.Packages.ElementFilterMembership elementFilterMembership: - ElementFilterMembershipTextualNotationBuilder.BuildElementFilterMember(elementFilterMembership, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Views.ViewRenderingMembership viewRenderingMembership: - ViewRenderingMembershipTextualNotationBuilder.BuildViewRenderingMember(viewRenderingMembership, stringBuilder); break; - default: - ownedRelationshipIndex = TypeTextualNotationBuilder.BuildDefinitionBodyItem(ownedRelationshipIndex, ownedRelationship, stringBuilder); - break; - - } } + return elementIndex; } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewRenderingMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewRenderingMembershipTextualNotationBuilder.cs index d94ba091..9a42180b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewRenderingMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewRenderingMembershipTextualNotationBuilder.cs @@ -49,7 +49,7 @@ public static void BuildViewRenderingMember(SysML2.NET.Core.POCO.Systems.Views.I if (ownedRelatedElementOfRenderingUsageIterator.Current != null) { - RenderingUsageTextualNotationBuilder.BuildViewRenderingUsage(ownedRelatedElementOfRenderingUsageIterator.Current, stringBuilder); + RenderingUsageTextualNotationBuilder.BuildViewRenderingUsage(ownedRelatedElementOfRenderingUsageIterator.Current, 0, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs index b3b99e23..6b0343cb 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs @@ -24,6 +24,7 @@ namespace SysML2.NET.TextualNotation { + using System.Collections.Generic; using System.Linq; using System.Text; @@ -50,29 +51,27 @@ public static void BuildViewBody(SysML2.NET.Core.POCO.Systems.Views.IViewUsage p /// ViewBodyItem:ViewUsage=DefinitionBodyItem|ownedRelationship+=ElementFilterMember|ownedRelationship+=ViewRenderingMember|ownedRelationship+=Expose /// /// The from which the rule should be build + /// The index of the to process inside the collection /// The that contains the entire textual notation - public static void BuildViewBodyItem(SysML2.NET.Core.POCO.Systems.Views.IViewUsage poco, StringBuilder stringBuilder) + /// The index of the next to be processed inside the collection + public static int BuildViewBodyItem(SysML2.NET.Core.POCO.Systems.Views.IViewUsage poco, int elementIndex, StringBuilder stringBuilder) { - var ownedRelationship = poco.OwnedRelationship.ToList(); + var elementsElement = poco.OwnedRelationship[elementIndex]; - for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < ownedRelationship.Count; ownedRelationshipIndex++) + switch (elementsElement) { - var ownedRelationshipElement = ownedRelationship[ownedRelationshipIndex]; + case SysML2.NET.Core.POCO.Kernel.Packages.ElementFilterMembership elementFilterMembership: + ElementFilterMembershipTextualNotationBuilder.BuildElementFilterMember(elementFilterMembership, stringBuilder); break; + case SysML2.NET.Core.POCO.Systems.Views.ViewRenderingMembership viewRenderingMembership: + ViewRenderingMembershipTextualNotationBuilder.BuildViewRenderingMember(viewRenderingMembership, stringBuilder); break; + case SysML2.NET.Core.POCO.Systems.Views.IExpose expose: + ExposeTextualNotationBuilder.BuildExpose(expose, stringBuilder); break; + case SysML2.NET.Core.POCO.Core.Types.IType type: + elementIndex = TypeTextualNotationBuilder.BuildDefinitionBodyItem(type, elementIndex, stringBuilder); + break; - switch (ownedRelationshipElement) - { - case SysML2.NET.Core.POCO.Kernel.Packages.ElementFilterMembership elementFilterMembership: - ElementFilterMembershipTextualNotationBuilder.BuildElementFilterMember(elementFilterMembership, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Views.ViewRenderingMembership viewRenderingMembership: - ViewRenderingMembershipTextualNotationBuilder.BuildViewRenderingMember(viewRenderingMembership, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Views.IExpose expose: - ExposeTextualNotationBuilder.BuildExpose(expose, stringBuilder); break; - default: - ownedRelationshipIndex = TypeTextualNotationBuilder.BuildDefinitionBodyItem(ownedRelationshipIndex, ownedRelationship, stringBuilder); - break; - - } } + return elementIndex; } /// @@ -86,7 +85,7 @@ public static void BuildViewUsage(SysML2.NET.Core.POCO.Systems.Views.IViewUsage OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); stringBuilder.Append("view "); UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); - FeatureTextualNotationBuilder.BuildValuePart(poco, stringBuilder); + FeatureTextualNotationBuilder.BuildValuePart(poco, 0, stringBuilder); BuildViewBody(poco, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/WhileLoopActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/WhileLoopActionUsageTextualNotationBuilder.cs index 89684b3b..b8688b8e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/WhileLoopActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/WhileLoopActionUsageTextualNotationBuilder.cs @@ -50,7 +50,7 @@ public static void BuildWhileLoopNode(SysML2.NET.Core.POCO.Systems.Actions.IWhil if (ownedRelationshipOfParameterMembershipIterator.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildActionBodyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + ParameterMembershipTextualNotationBuilder.BuildActionBodyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); } if (ownedRelationshipOfParameterMembershipIterator.MoveNext()) @@ -59,7 +59,7 @@ public static void BuildWhileLoopNode(SysML2.NET.Core.POCO.Systems.Actions.IWhil if (ownedRelationshipOfParameterMembershipIterator.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildExpressionParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + ParameterMembershipTextualNotationBuilder.BuildExpressionParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); } stringBuilder.Append(";"); stringBuilder.Append(' '); diff --git a/SysML2.NET/TextualNotation/CollectionCursor.cs b/SysML2.NET/TextualNotation/CollectionCursor.cs new file mode 100644 index 00000000..098c44e4 --- /dev/null +++ b/SysML2.NET/TextualNotation/CollectionCursor.cs @@ -0,0 +1,121 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// 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; + using System.Collections.Generic; + + /// + /// Represents a cursor over a read-only collection that allows sequential, + /// forward-only traversal of elements. This class is primarily used to + /// simulate grammar-driven consumption of elements. + /// + /// The type of elements in the collection. + public class CollectionCursor where T : class + { + /// + /// Gets the collection that is currently traversed. + /// + private readonly IReadOnlyList elements; + + /// + /// Gets the value of the current index. + /// + private int index; + + /// + /// Initializes a new instance of the class. + /// + /// The collection to iterate over. + public CollectionCursor(IReadOnlyList elements) + { + this.elements = elements ?? throw new ArgumentNullException(nameof(elements)); + } + + /// + /// Gets the current element at the cursor position. + /// Returns default if the cursor is out of range. + /// + public T Current => this.GetCurrent(this.index); + + /// + /// Gets the element at a specific index without modifying the cursor position. + /// + /// The index to read from. + /// + /// The element at the given index, or default if the index is out of bounds. + /// + private T GetCurrent(int indexToUse) + { + return indexToUse >= this.elements.Count || indexToUse < 0 ? default : this.elements[indexToUse]; + } + + /// + /// Peeks ahead in the collection without advancing the cursor. + /// + /// + /// The number of positions to look ahead. Must be greater than or equal to zero. + /// + /// + /// The element located at the current index plus the specified offset, + /// or default if the resulting index is out of bounds. + /// + /// + /// Thrown when is negative. + /// + public T GetNext(int amount) + { + return amount < 0 ? throw new ArgumentException("Not able to get previous element in the collection") : this.GetCurrent(this.index + amount); + } + + /// + /// Advances the cursor to the next element in the collection. + /// + /// The amount to move-on the cursor position. + /// + /// true if the cursor successfully moved to the next element; + /// false if the end of the collection has been reached. + /// + public void Move(int amount = 1) + { + if (amount < 0) + { + throw new ArgumentOutOfRangeException(nameof(amount)); + } + + this.index = Math.Min(this.index + amount, this.elements.Count); + } + + /// + /// Tries to get the current element as . + /// + /// The retrieved element, if applicable + /// Any class inheriting from + /// + /// true if the could be assigned to + /// false otherwise + public bool TryGetCurrent(out TDerived value) where TDerived : class, T + { + value = this.Current as TDerived; + return value != null; + } + } +} From 3884b71dc9707309b3e379911080564c8c082879 Mon Sep 17 00:00:00 2001 From: atheate Date: Mon, 20 Apr 2026 15:19:56 +0200 Subject: [PATCH 25/33] WIP --- .../Extensions/PropertyExtension.cs | 4 +- .../HandleBarHelpers/RulesHelper.cs | 402 +++++++----------- .../SysML2.NET.CodeGenerator.csproj | 2 +- ...core-textual-notation-builder-template.hbs | 52 +-- ...tFilterMembershipTextualNotationBuilder.cs | 4 +- .../ElementTextualNotationBuilder.cs | 3 +- .../ImportTextualNotationBuilder.cs | 4 +- .../MembershipTextualNotationBuilder.cs | 7 +- .../NamespaceTextualNotationBuilder.cs | 37 +- .../OwningMembershipTextualNotationBuilder.cs | 33 +- .../UsageTextualNotationBuilder.cs | 4 +- SysML2.NET/TextualNotation/CursorCache.cs | 71 ++++ .../NamespaceTextualNotationBuilder.cs | 238 +++++++++++ SysML2.NET/TextualNotation/ICursorCache.cs | 42 ++ 14 files changed, 566 insertions(+), 337 deletions(-) create mode 100644 SysML2.NET/TextualNotation/CursorCache.cs create mode 100644 SysML2.NET/TextualNotation/HandCoded/NamespaceTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/ICursorCache.cs diff --git a/SysML2.NET.CodeGenerator/Extensions/PropertyExtension.cs b/SysML2.NET.CodeGenerator/Extensions/PropertyExtension.cs index c56b1937..28759163 100644 --- a/SysML2.NET.CodeGenerator/Extensions/PropertyExtension.cs +++ b/SysML2.NET.CodeGenerator/Extensions/PropertyExtension.cs @@ -105,10 +105,10 @@ public static string QueryIfStatementContentForNonEmpty(this IProperty property, if (property.QueryIsEnumerable()) { - return $"{variableName}.MoveNext()"; + return $"{variableName}.Current != null"; } - if (property.QueryIsReferenceProperty()) + if (property.QueryIsReferenceType()) { return $"{variableName}.{propertyName} != null"; } diff --git a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs index e02fc39a..7b967a11 100644 --- a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs +++ b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs @@ -103,13 +103,13 @@ public static void RegisterRulesHelper(this IHandlebars handlebars) /// Asserts that the current is part of a multiple alternative process private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClass, IReadOnlyCollection alternatives, RuleGenerationContext ruleGenerationContext, bool isPartOfMultipleAlternative = false) { - ruleGenerationContext.DefinedIterators ??= []; + ruleGenerationContext.DefinedCursors ??= []; if (alternatives.Count == 1) { var alternative = alternatives.ElementAt(0); var elements = alternative.Elements; - DeclareAllRequiredIterators(writer, umlClass, alternative, ruleGenerationContext); + DeclareAllRequiredCursors(writer, umlClass, alternative, ruleGenerationContext); if (ruleGenerationContext.CallerRule is { IsOptional: true, IsCollection: false }) { @@ -130,8 +130,8 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas 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)); + var iterator = ruleGenerationContext.DefinedCursors.FirstOrDefault(x => x.ApplicableRuleElements.Contains(assigment)); + ifStatementContent.Add(iterator == null ? $"BuildGroupConditionFor{assigment.TextualNotationRule.RuleName}(poco)" : property.QueryIfStatementContentForNonEmpty(iterator.CursorVariableName)); } else { @@ -196,7 +196,7 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas { foreach (var alternative in alternatives) { - DeclareAllRequiredIterators(writer, umlClass, alternative, ruleGenerationContext); + DeclareAllRequiredCursors(writer, umlClass, alternative, ruleGenerationContext); } for (var alternativeIndex = 0; alternativeIndex < alternatives.Count; alternativeIndex++) @@ -220,11 +220,11 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas if (targetProperty.QueryIsEnumerable()) { - DeclareAllRequiredIterators(writer, umlClass, alternatives.ElementAt(0), ruleGenerationContext); + DeclareAllRequiredCursors(writer, umlClass, alternatives.ElementAt(0), ruleGenerationContext); - var iterator = ruleGenerationContext.DefinedIterators.Single(x => x.ApplicableRuleElements.Contains(assignmentElement)); + var iterator = ruleGenerationContext.DefinedCursors.Single(x => x.ApplicableRuleElements.Contains(assignmentElement)); - writer.WriteSafeString($"if({targetProperty.QueryIfStatementContentForNonEmpty(iterator.IteratorVariableName)}){Environment.NewLine}"); + writer.WriteSafeString($"if({targetProperty.QueryIfStatementContentForNonEmpty(iterator.CursorVariableName)}){Environment.NewLine}"); writer.WriteSafeString($"{{{Environment.NewLine}"); } else @@ -367,17 +367,8 @@ private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter if (ruleGenerationContext.CallerRule is AssignmentElement assignmentElement) { - if (assignmentElement.TextualNotationRule.IsDispatcherRule) - { - variableName = $"elementFor{assignmentElement.Property.CapitalizeFirstLetter()}"; - writer.WriteSafeString($"var elementFor{assignmentElement.Property.CapitalizeFirstLetter()} = {ruleGenerationContext.CurrentVariableName}.{assignmentElement.Property.CapitalizeFirstLetter()}[elementIndex];{Environment.NewLine}"); - } - else - { - var iteratorToUse = ruleGenerationContext.DefinedIterators.Single(x => x.ApplicableRuleElements.Contains(assignmentElement)); - variableName = $"{iteratorToUse.IteratorVariableName}.Current"; - writer.WriteSafeString($"{iteratorToUse.IteratorVariableName}.MoveNext();{Environment.NewLine}{Environment.NewLine}"); - } + var cursorToUse = ruleGenerationContext.DefinedCursors.Single(x => x.ApplicableRuleElements.Contains(assignmentElement)); + variableName = $"{cursorToUse.CursorVariableName}.Current"; } writer.WriteSafeString($"switch({variableName}){Environment.NewLine}"); @@ -386,7 +377,7 @@ private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter foreach (var orderedNonTerminalElement in mappedNonTerminalElements) { var previousVariableName = ruleGenerationContext.CurrentVariableName; - + if (orderedNonTerminalElement.UmlClass == ruleGenerationContext.NamedElementToGenerate) { writer.WriteSafeString($"default:{Environment.NewLine}"); @@ -406,6 +397,12 @@ private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter writer.WriteSafeString($"}}{Environment.NewLine}"); + if (ruleGenerationContext.CallerRule is AssignmentElement assignmentElementForMove) + { + var cursorForMove = ruleGenerationContext.DefinedCursors.Single(x => x.ApplicableRuleElements.Contains(assignmentElementForMove)); + writer.WriteSafeString($"{cursorForMove.CursorVariableName}.Move();{Environment.NewLine}"); + } + break; } case AssignmentElement: @@ -416,11 +413,39 @@ private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter { var targetProperty = umlClass.QueryAllProperties().Single(x => string.Equals(x.Name, propertiesTarget[0])); - var orderElementsByInheritance = OrderElementsByInheritance(assignmentElements.Select(x => x.Value).OfType().ToList(), umlClass.Cache, ruleGenerationContext); - if (assignmentElements.All(x => x.Operator == "+=") && assignmentElements.All(x => x.Value is NonTerminalElement)) { - writer.WriteSafeString($"switch(elementIn{targetProperty.Name.CapitalizeFirstLetter()}){Environment.NewLine}"); + // Dispatcher rule: multiple alternatives all += to same property + // Use cursor-based switch on cursor.Current type + var orderElementsByInheritance = OrderElementsByInheritance(assignmentElements.Select(x => x.Value).OfType().ToList(), umlClass.Cache, ruleGenerationContext); + + // Declare cursor for this property via cursorCache + var cursorVarName = $"{targetProperty.Name.LowerCaseFirstLetter()}Cursor"; + var existingCursor = ruleGenerationContext.DefinedCursors.FirstOrDefault(x => x.IsCursorValidForProperty(targetProperty)); + + if (existingCursor == null) + { + writer.WriteSafeString($"var {cursorVarName} = cursorCache.GetOrCreateCursor(poco.Id, \"{targetProperty.Name}\", poco.{targetProperty.QueryPropertyNameBasedOnUmlProperties()});{Environment.NewLine}"); + var cursorDef = new CursorDefinition { DefinedForProperty = targetProperty }; + + foreach (var assignmentElement in assignmentElements) + { + cursorDef.ApplicableRuleElements.Add(assignmentElement); + } + + ruleGenerationContext.DefinedCursors.Add(cursorDef); + } + else + { + cursorVarName = existingCursor.CursorVariableName; + + foreach (var assignmentElement in assignmentElements) + { + existingCursor.ApplicableRuleElements.Add(assignmentElement); + } + } + + writer.WriteSafeString($"switch({cursorVarName}.Current){Environment.NewLine}"); writer.WriteSafeString($"{{{Environment.NewLine}"); foreach (var orderedElement in orderElementsByInheritance) @@ -428,53 +453,74 @@ private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter var numberOfElementOfSameType = orderElementsByInheritance.Count(x => x.UmlClass == orderedElement.UmlClass); if (numberOfElementOfSameType == 1) - { - writer.WriteSafeString($"case {orderedElement.UmlClass.QueryFullyQualifiedTypeName(targetInterface:orderedElement.UmlClass.IsAbstract)} {orderedElement.UmlClass.Name.LowerCaseFirstLetter()}:{Environment.NewLine}"); + { + writer.WriteSafeString($"case {orderedElement.UmlClass.QueryFullyQualifiedTypeName(targetInterface: orderedElement.UmlClass.IsAbstract)} {orderedElement.UmlClass.Name.LowerCaseFirstLetter()}:{Environment.NewLine}"); } else { - writer.WriteSafeString($"case {orderedElement.UmlClass.QueryFullyQualifiedTypeName(targetInterface:orderedElement.UmlClass.IsAbstract)} {orderedElement.UmlClass.Name.LowerCaseFirstLetter()} when {orderedElement.UmlClass.Name.LowerCaseFirstLetter()}.IsValidFor{orderedElement.RuleElement.Name}():{Environment.NewLine}"); + writer.WriteSafeString($"case {orderedElement.UmlClass.QueryFullyQualifiedTypeName(targetInterface: orderedElement.UmlClass.IsAbstract)} {orderedElement.UmlClass.Name.LowerCaseFirstLetter()} when {orderedElement.UmlClass.Name.LowerCaseFirstLetter()}.IsValidFor{orderedElement.RuleElement.Name}():{Environment.NewLine}"); } var previousVariableName = ruleGenerationContext.CurrentVariableName; ruleGenerationContext.CurrentVariableName = orderedElement.UmlClass.Name.LowerCaseFirstLetter(); - ProcessNonTerminalElement(writer, orderedElement.UmlClass, orderedElement.RuleElement, ruleGenerationContext); + ProcessNonTerminalElement(writer, orderedElement.UmlClass, orderedElement.RuleElement, ruleGenerationContext); ruleGenerationContext.CurrentVariableName = previousVariableName; - writer.WriteSafeString($"{Environment.NewLine}break;{Environment.NewLine}"); + writer.WriteSafeString($"{Environment.NewLine}{cursorVarName}.Move();{Environment.NewLine}"); + writer.WriteSafeString($"break;{Environment.NewLine}"); } - + writer.WriteSafeString($"}}{Environment.NewLine}"); } else { - var typeFiltering = string.Join(", ", orderElementsByInheritance.Select(x => $"typeof({x.UmlClass.QueryFullyQualifiedTypeName(targetInterface: x.UmlClass.IsAbstract)})")); - writer.WriteSafeString($"using var iterator = SysML2.NET.Extensions.EnumerableExtensions.GetElementsOfType(poco.{targetProperty.QueryPropertyNameBasedOnUmlProperties()}, {typeFiltering}).GetEnumerator();{Environment.NewLine}"); - writer.WriteSafeString($"iterator.MoveNext();{Environment.NewLine}{Environment.NewLine}"); - writer.WriteSafeString("if(iterator.Current != null)"); + // Mixed operator alternatives on same property - use cursor-based switch + var orderElementsByInheritance = OrderElementsByInheritance(assignmentElements.Select(x => x.Value).OfType().ToList(), umlClass.Cache, ruleGenerationContext); + + var cursorVarName = $"{targetProperty.Name.LowerCaseFirstLetter()}Cursor"; + var existingCursor = ruleGenerationContext.DefinedCursors.FirstOrDefault(x => x.IsCursorValidForProperty(targetProperty)); + + if (existingCursor == null) + { + writer.WriteSafeString($"var {cursorVarName} = cursorCache.GetOrCreateCursor(poco.Id, \"{targetProperty.Name}\", poco.{targetProperty.QueryPropertyNameBasedOnUmlProperties()});{Environment.NewLine}"); + var cursorDef = new CursorDefinition { DefinedForProperty = targetProperty }; + + foreach (var assignmentElement in assignmentElements) + { + cursorDef.ApplicableRuleElements.Add(assignmentElement); + } + + ruleGenerationContext.DefinedCursors.Add(cursorDef); + } + else + { + cursorVarName = existingCursor.CursorVariableName; + } + + writer.WriteSafeString($"if({cursorVarName}.Current != null){Environment.NewLine}"); writer.WriteSafeString($"{{{Environment.NewLine}"); - - writer.WriteSafeString($"switch(iterator.Current){Environment.NewLine}"); + writer.WriteSafeString($"switch({cursorVarName}.Current){Environment.NewLine}"); writer.WriteSafeString($"{{{Environment.NewLine}"); foreach (var orderedElement in orderElementsByInheritance) { if (orderedElement.UmlClass.Name == "Element") { - writer.WriteSafeString($"case {{ }} {orderedElement.UmlClass.Name.LowerCaseFirstLetter()}:{Environment.NewLine}"); + writer.WriteSafeString($"case {{ }} {orderedElement.UmlClass.Name.LowerCaseFirstLetter()}:{Environment.NewLine}"); } else { - writer.WriteSafeString($"case {orderedElement.UmlClass.QueryFullyQualifiedTypeName(targetInterface:orderedElement.UmlClass.IsAbstract)} {orderedElement.UmlClass.Name.LowerCaseFirstLetter()}:{Environment.NewLine}"); + writer.WriteSafeString($"case {orderedElement.UmlClass.QueryFullyQualifiedTypeName(targetInterface: orderedElement.UmlClass.IsAbstract)} {orderedElement.UmlClass.Name.LowerCaseFirstLetter()}:{Environment.NewLine}"); } var previousVariableName = ruleGenerationContext.CurrentVariableName; ruleGenerationContext.CurrentVariableName = orderedElement.UmlClass.Name.LowerCaseFirstLetter(); - ProcessNonTerminalElement(writer, orderedElement.UmlClass, orderedElement.RuleElement, ruleGenerationContext); + ProcessNonTerminalElement(writer, orderedElement.UmlClass, orderedElement.RuleElement, ruleGenerationContext); ruleGenerationContext.CurrentVariableName = previousVariableName; writer.WriteSafeString($"{Environment.NewLine}break;{Environment.NewLine}"); } - + writer.WriteSafeString($"}}{Environment.NewLine}"); + writer.WriteSafeString($"{cursorVarName}.Move();{Environment.NewLine}"); writer.WriteSafeString($"}}{Environment.NewLine}"); } } @@ -482,7 +528,7 @@ private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter { foreach (var alternative in alternatives) { - DeclareAllRequiredIterators(writer, umlClass, alternative, ruleGenerationContext); + DeclareAllRequiredCursors(writer, umlClass, alternative, ruleGenerationContext); } var properties = umlClass.QueryAllProperties(); @@ -497,11 +543,11 @@ private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter var assignment = assignmentElements[alternativeIndex]; var targetProperty = properties.Single(x => string.Equals(x.Name, assignment.Property)); - var iterator = ruleGenerationContext.DefinedIterators.SingleOrDefault(x => x.ApplicableRuleElements.Contains(assignment)); + var iterator = ruleGenerationContext.DefinedCursors.SingleOrDefault(x => x.ApplicableRuleElements.Contains(assignment)); if (assignment.Operator != "+=") { - writer.WriteSafeString($"if({targetProperty.QueryIfStatementContentForNonEmpty(iterator?.IteratorVariableName ?? "poco")}){Environment.NewLine}"); + writer.WriteSafeString($"if({targetProperty.QueryIfStatementContentForNonEmpty(iterator?.CursorVariableName ?? "poco")}){Environment.NewLine}"); } writer.WriteSafeString($"{{{Environment.NewLine}"); @@ -561,25 +607,25 @@ private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter } /// - /// Declares all required iterator for all present inside an + /// Declares all required cursors for all present inside an /// /// The used to write into output content /// The related /// The to process /// The current - private static void DeclareAllRequiredIterators(EncodedTextWriter writer, IClass umlClass, Alternatives alternatives, RuleGenerationContext ruleGenerationContext) + private static void DeclareAllRequiredCursors(EncodedTextWriter writer, IClass umlClass, Alternatives alternatives, RuleGenerationContext ruleGenerationContext) { foreach (var ruleElement in alternatives.Elements) { switch (ruleElement) { case AssignmentElement assignmentElement: - DeclareIteratorIfRequired(writer, umlClass, assignmentElement, ruleGenerationContext); + DeclareCursorIfRequired(writer, umlClass, assignmentElement, ruleGenerationContext); break; case GroupElement groupElement: foreach (var groupElementAlternative in groupElement.Alternatives) { - DeclareAllRequiredIterators(writer, umlClass, groupElementAlternative, ruleGenerationContext); + DeclareAllRequiredCursors(writer, umlClass, groupElementAlternative, ruleGenerationContext); } break; @@ -634,12 +680,19 @@ private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass 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}"); + var cursorToUse = ruleGenerationContext.DefinedCursors.Single(x => x.ApplicableRuleElements.Contains(assignmentElement)); + writer.WriteSafeString($"{Environment.NewLine}while({cursorToUse.CursorVariableName}.Current != null){Environment.NewLine}"); } writer.WriteSafeString($"{{{Environment.NewLine}"); ProcessAlternatives(writer, umlClass, groupElement.Alternatives, ruleGenerationContext); + + if (assignmentRule is AssignmentElement assignmentElementForMove) + { + var cursorToUse = ruleGenerationContext.DefinedCursors.Single(x => x.ApplicableRuleElements.Contains(assignmentElementForMove)); + writer.WriteSafeString($"{cursorToUse.CursorVariableName}.Move();{Environment.NewLine}"); + } + writer.WriteSafeString($"{Environment.NewLine}}}"); } else if (groupElement.IsCollection) @@ -701,38 +754,8 @@ private static void ProcessAssignmentElement(EncodedTextWriter writer, IClass um { if (assignmentElement.Value is NonTerminalElement nonTerminalElement) { - string usedVariable; - - if (assignmentElement.TextualNotationRule.IsDispatcherRule) - { - usedVariable = $"elementFor{assignmentElement.Property.CapitalizeFirstLetter()}"; - - var collectionName = ruleGenerationContext.CurrentVariableName.EndsWith(assignmentElement.Property, StringComparison.InvariantCultureIgnoreCase) - ? ruleGenerationContext.CurrentVariableName - : $"{ruleGenerationContext.CurrentVariableName}.{targetProperty.QueryPropertyNameBasedOnUmlProperties()}"; - - if (ruleGenerationContext.CallerRule is not NonTerminalElement { IsCollection: false }) - { - writer.WriteSafeString($"if(elementIndex < {collectionName}.Count){Environment.NewLine}"); - writer.WriteSafeString($"{{{Environment.NewLine}"); - writer.WriteSafeString($"var {usedVariable} = {collectionName}[elementIndex];{Environment.NewLine}"); - } - else - { - writer.WriteSafeString($"var {usedVariable} = {collectionName}[0];{Environment.NewLine}"); - } - } - else - { - var iteratorToUse = ruleGenerationContext.DefinedIterators.Single(x => x.ApplicableRuleElements.Contains(assignmentElement)); - - if (!isPartOfMultipleAlternative && assignmentElement.Container is not GroupElement { IsCollection: true } && assignmentElement.Container is not GroupElement { IsOptional: true }) - { - writer.WriteSafeString($"{iteratorToUse.IteratorVariableName}.MoveNext();{Environment.NewLine}"); - } - - usedVariable = $"{iteratorToUse.IteratorVariableName}.Current"; - } + var cursorToUse = ruleGenerationContext.DefinedCursors.Single(x => x.ApplicableRuleElements.Contains(assignmentElement)); + var usedVariable = $"{cursorToUse.CursorVariableName}.Current"; var previousVariableName = ruleGenerationContext.CurrentVariableName; ruleGenerationContext.CurrentVariableName = usedVariable; @@ -742,31 +765,27 @@ private static void ProcessAssignmentElement(EncodedTextWriter writer, IClass um ruleGenerationContext.CurrentVariableName = previousVariableName; ruleGenerationContext.CallerRule = previousCaller; - if (assignmentElement.TextualNotationRule.IsDispatcherRule && ruleGenerationContext.CallerRule is not NonTerminalElement { IsCollection: false }) + if (!isPartOfMultipleAlternative && assignmentElement.Container is not GroupElement { IsCollection: true } && assignmentElement.Container is not GroupElement { IsOptional: true }) { - writer.WriteSafeString("}"); + writer.WriteSafeString($"{cursorToUse.CursorVariableName}.Move();{Environment.NewLine}"); } } - else if(assignmentElement.Value is GroupElement groupElement) + else if (assignmentElement.Value is GroupElement groupElement) { var previousCaller = ruleGenerationContext.CallerRule; ruleGenerationContext.CallerRule = assignmentElement; ProcessAlternatives(writer, umlClass, groupElement.Alternatives, ruleGenerationContext); ruleGenerationContext.CallerRule = previousCaller; } - else if(assignmentElement.Value is ValueLiteralElement valueLiteralElement && valueLiteralElement.QueryIsQualifiedName()) + else if (assignmentElement.Value is ValueLiteralElement valueLiteralElement && valueLiteralElement.QueryIsQualifiedName()) { - var iteratorToUse = ruleGenerationContext.DefinedIterators.Single(x => x.ApplicableRuleElements.Contains(assignmentElement)); + var cursorToUse = ruleGenerationContext.DefinedCursors.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}"); - } - - writer.WriteSafeString($"{Environment.NewLine}if({iteratorToUse.IteratorVariableName}.Current != null){Environment.NewLine}"); + writer.WriteSafeString($"{Environment.NewLine}if({cursorToUse.CursorVariableName}.Current != null){Environment.NewLine}"); writer.WriteSafeString($"{{{Environment.NewLine}"); - writer.WriteSafeString($"stringBuilder.Append({iteratorToUse.IteratorVariableName}.Current.qualifiedName);{Environment.NewLine}"); - writer.WriteSafeString("}"); + writer.WriteSafeString($"stringBuilder.Append({cursorToUse.CursorVariableName}.Current.qualifiedName);{Environment.NewLine}"); + writer.WriteSafeString($"{cursorToUse.CursorVariableName}.Move();{Environment.NewLine}"); + writer.WriteSafeString("}"); } else { @@ -785,7 +804,7 @@ private static void ProcessAssignmentElement(EncodedTextWriter writer, IClass um else { var targetPropertyName = targetProperty.QueryPropertyNameBasedOnUmlProperties(); - + if (targetProperty.QueryIsString()) { writer.WriteSafeString($"stringBuilder.Append(poco.{targetPropertyName});"); @@ -815,7 +834,7 @@ private static void ProcessAssignmentElement(EncodedTextWriter writer, IClass um { writer.WriteSafeString($"stringBuilder.Append(poco.{targetPropertyName}.ToString().ToLower());"); } - else if(targetProperty.QueryIsReferenceProperty()) + else if (targetProperty.QueryIsReferenceType()) { switch (assignmentElement.Value) { @@ -843,7 +862,7 @@ private static void ProcessAssignmentElement(EncodedTextWriter writer, IClass um 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\");"); @@ -859,7 +878,7 @@ private static void ProcessAssignmentElement(EncodedTextWriter writer, IClass um } else { - writer.WriteSafeString($"Build{assignmentElement.Property.CapitalizeFirstLetter()}(poco, stringBuilder);"); + writer.WriteSafeString($"Build{assignmentElement.Property.CapitalizeFirstLetter()}(poco, cursorCache, stringBuilder);"); } } @@ -1020,202 +1039,83 @@ private static void ProcessNonTerminalElement(EncodedTextWriter writer, IClass u } /// - /// Declares an iterator to perform iteration over a collection, if required to declare it + /// Declares a cursor to perform iteration over a collection, if required to declare it. + /// Uses cursorCache.GetOrCreateCursor to share cursor state across method calls. /// /// The used to write into output content /// The related /// The to process - /// - private static void DeclareIteratorIfRequired(EncodedTextWriter writer, IClass umlClass, AssignmentElement assignmentElement, RuleGenerationContext ruleGenerationContext) + /// The current + private static void DeclareCursorIfRequired(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() || assignmentElement.TextualNotationRule.IsDispatcherRule) + var targetProperty = allProperties.SingleOrDefault(x => string.Equals(x.Name, assignmentElement.Property, StringComparison.OrdinalIgnoreCase)); + + if (targetProperty == null || !targetProperty.QueryIsEnumerable()) + { + return; + } + + // Check if a cursor already exists for this property + if (ruleGenerationContext.DefinedCursors.SingleOrDefault(x => x.IsCursorValidForProperty(targetProperty) || x.ApplicableRuleElements.Contains(assignmentElement)) is { } alreadyDefinedCursor) { + alreadyDefinedCursor.ApplicableRuleElements.Add(assignmentElement); return; } switch (assignmentElement.Value) { - case NonTerminalElement nonTerminalElement: + case NonTerminalElement: + case ValueLiteralElement: + case GroupElement: { - 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 + var cursorToUse = new CursorDefinition { 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();"); - } + cursorToUse.ApplicableRuleElements.Add(assignmentElement); + var propertyAccessName = targetProperty.QueryPropertyNameBasedOnUmlProperties(); + writer.WriteSafeString($"var {cursorToUse.CursorVariableName} = cursorCache.GetOrCreateCursor(poco.Id, \"{targetProperty.Name}\", poco.{propertyAccessName});"); writer.WriteSafeString(Environment.NewLine); - ruleGenerationContext.DefinedIterators.Add(iteratorToUse); + ruleGenerationContext.DefinedCursors.Add(cursorToUse); break; } - case ValueLiteralElement: - if (ruleGenerationContext.DefinedIterators.SingleOrDefault(x => x.IsIteratorValidForProperty(targetProperty, null) || x.ApplicableRuleElements.Contains(assignmentElement)) is { } existingValueLiteralIterator) - { - existingValueLiteralIterator.ApplicableRuleElements.Add(assignmentElement); - return; - } - - var valueLiteralIterator = new IteratorDefinition - { - DefinedForProperty = targetProperty - }; - - valueLiteralIterator.ApplicableRuleElements.Add(assignmentElement); - writer.WriteSafeString($"using var {valueLiteralIterator.IteratorVariableName} = poco.{targetProperty.QueryPropertyNameBasedOnUmlProperties()}.GetEnumerator();"); - writer.WriteSafeString(Environment.NewLine); - ruleGenerationContext.DefinedIterators.Add(valueLiteralIterator); - - break; case AssignmentElement containedAssignment: - DeclareIteratorIfRequired(writer, umlClass, containedAssignment, ruleGenerationContext); - break; - case GroupElement groupElement: - var nonTerminalRules = groupElement.Alternatives.SelectMany(x => x.Elements).OfType().ToList(); - - if (ruleGenerationContext.DefinedIterators.Any(x => x.ApplicableRuleElements.Contains(assignmentElement))) - { - return; - } - - var referencedTypes = new HashSet(); - - foreach (var nonTerminalElement in nonTerminalRules) - { - var referencedRule = ruleGenerationContext.AllRules.SingleOrDefault(x => x.RuleName == nonTerminalElement.Name); - - if (ruleGenerationContext.DefinedIterators.SingleOrDefault(x => x.IsIteratorValidForProperty(targetProperty, referencedRule)) is { } alreadyDefined) - { - alreadyDefined.ApplicableRuleElements.Add(assignmentElement); - return; - } - - string typeTarget; - - if (referencedRule == null) - { - typeTarget = umlClass.Name; - } - else - { - typeTarget = referencedRule.TargetElementName ?? referencedRule.RuleName; - } - - referencedTypes.Add(umlClass.Cache.Values.OfType().Single(x => x.Name == typeTarget)); - } - - var iteratorToUseForGroup = new IteratorDefinition - { - DefinedForProperty = targetProperty - }; - - var typesFilter = string.Join(", ", referencedTypes.Select(x => $"typeof({x.QueryFullyQualifiedTypeName(targetInterface: false)})")); - writer.WriteSafeString($"using var {iteratorToUseForGroup.IteratorVariableName} = SysML2.NET.Extensions.EnumerableExtensions.GetElementsOfType(poco.{targetProperty.QueryPropertyNameBasedOnUmlProperties()}, {typesFilter}).GetEnumerator();{Environment.NewLine}"); - - iteratorToUseForGroup.ApplicableRuleElements.Add(assignmentElement); - ruleGenerationContext.DefinedIterators.Add(iteratorToUseForGroup); + DeclareCursorIfRequired(writer, umlClass, containedAssignment, ruleGenerationContext); break; } } /// - /// Keeps tracks of defined iterator for enumerable + /// Keeps tracks of defined cursor for enumerable /// - private class IteratorDefinition + private class CursorDefinition { /// - /// Gets or sets the that have to have an iterator defined + /// Gets or sets the that have to have a cursor defined /// public IProperty DefinedForProperty { get; init; } /// - /// Gets or sets the that should be + /// Gets the name of the variable defined for the cursor /// - public INamedElement ConstrainedType { get; set; } + public string CursorVariableName => $"{this.DefinedForProperty.Name.LowerCaseFirstLetter()}Cursor"; /// - /// 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 + /// Provides a collection of that will use the defined cursor /// 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 + /// Asserts that the current is valid for an /// /// 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) + /// True if the is valid for the provided property + public bool IsCursorValidForProperty(IProperty property) { - 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); + return property == this.DefinedForProperty; } } @@ -1225,9 +1125,9 @@ public bool IsIteratorValidForProperty(IProperty property, TextualNotationRule t private class RuleGenerationContext { /// - /// Gets or sets the collection of + /// Gets or sets the collection of /// - public List DefinedIterators { get; set; } + public List DefinedCursors { get; set; } /// /// Gets the collection of all available diff --git a/SysML2.NET.CodeGenerator/SysML2.NET.CodeGenerator.csproj b/SysML2.NET.CodeGenerator/SysML2.NET.CodeGenerator.csproj index 2f8d0b3e..d223f7e0 100644 --- a/SysML2.NET.CodeGenerator/SysML2.NET.CodeGenerator.csproj +++ b/SysML2.NET.CodeGenerator/SysML2.NET.CodeGenerator.csproj @@ -21,7 +21,7 @@ - + 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 index 130efcaa..ce810be5 100644 --- a/SysML2.NET.CodeGenerator/Templates/Uml/core-textual-notation-builder-template.hbs +++ b/SysML2.NET.CodeGenerator/Templates/Uml/core-textual-notation-builder-template.hbs @@ -24,10 +24,7 @@ namespace SysML2.NET.TextualNotation { -{{#if (RulesHelper.ContainsAnyDispatcherRules this.Rules)}} - using System.Collections.Generic; -{{~/if}} - using System.Linq; + using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; @@ -38,46 +35,13 @@ namespace SysML2.NET.TextualNotation public static partial class {{this.Context.Name}}TextualNotationBuilder { {{#each this.Rules as | rule | }} - {{#if rule.IsDispatcherRule}} - {{#unless rule.IsMultiCollectionAssignment}} - /// - /// Builds the Textual Notation string for the rule {{Rule.RuleName}} - /// {{Rule.RawRule}} - /// - /// The from which the rule should be build - /// The index of the to process inside a specific collection - /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int Build{{rule.RuleName}}({{ #NamedElement.WriteFullyQualifiedTypeName ../this.Context }} poco, int elementIndex, StringBuilder stringBuilder) - { - {{RulesHelper.WriteRule rule ../this.Context ../this.AllRules}} - return elementIndex; - } - {{else}} - /// - /// Builds the Textual Notation string for the rule {{Rule.RuleName}} - /// {{Rule.RawRule}} - /// - /// The from which the rule should be build - /// The collection of to process - /// The index of the to process inside the collection defined - /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int Build{{rule.RuleName}}({{ #NamedElement.WriteFullyQualifiedTypeName ../this.Context }} poco, string propertyName, int elementIndex, StringBuilder stringBuilder) - { - {{RulesHelper.WriteRule rule ../this.Context ../this.AllRules}} - return elementIndex; - } - {{/unless}} - {{else}} - /// - /// 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) - {{/if}} + /// + /// 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, ICursorCache cursorCache, StringBuilder stringBuilder) { {{RulesHelper.WriteRule rule ../this.Context ../this.AllRules}} } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementFilterMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementFilterMembershipTextualNotationBuilder.cs index 6147bf64..0ceda220 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementFilterMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementFilterMembershipTextualNotationBuilder.cs @@ -27,6 +27,7 @@ namespace SysML2.NET.TextualNotation using System.Linq; using System.Text; + using SysML2.NET.Core.POCO.Kernel.Packages; using SysML2.NET.Core.POCO.Root.Elements; /// @@ -39,8 +40,9 @@ public static partial class ElementFilterMembershipTextualNotationBuilder /// 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) + public static void BuildElementFilterMember(IElementFilterMembership poco, ICursorCache cursor, StringBuilder stringBuilder) { using var ownedRelatedElementOfExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementTextualNotationBuilder.cs index a1ccdc7a..dd403606 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementTextualNotationBuilder.cs @@ -66,8 +66,9 @@ public static void BuildIdentification(SysML2.NET.Core.POCO.Root.Elements.IEleme /// 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) + public static void BuildDefinitionElement(IElement poco, ICursorCache cursor, StringBuilder stringBuilder) { throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ImportTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ImportTextualNotationBuilder.cs index eec9b291..f36887d4 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ImportTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ImportTextualNotationBuilder.cs @@ -28,6 +28,7 @@ namespace SysML2.NET.TextualNotation using System.Text; using SysML2.NET.Core.POCO.Root.Elements; + using SysML2.NET.Core.POCO.Root.Namespaces; /// /// The provides Textual Notation Builder for the element @@ -59,8 +60,9 @@ public static void BuildImportDeclaration(SysML2.NET.Core.POCO.Root.Namespaces.I /// 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) + public static void BuildImport(IImport poco, ICursorCache cursor, StringBuilder stringBuilder) { stringBuilder.Append(poco.Visibility.ToString().ToLower()); stringBuilder.Append("import "); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs index e0729761..ad6d7b94 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs @@ -28,6 +28,7 @@ namespace SysML2.NET.TextualNotation using System.Text; using SysML2.NET.Core.POCO.Root.Elements; + using SysML2.NET.Core.POCO.Root.Namespaces; /// /// The provides Textual Notation Builder for the element @@ -39,8 +40,9 @@ public static partial class MembershipTextualNotationBuilder /// 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) + public static void BuildMemberPrefix(IMembership poco, ICursorCache cursor, StringBuilder stringBuilder) { if (poco.Visibility != SysML2.NET.Core.Root.Namespaces.VisibilityKind.Public) @@ -57,8 +59,9 @@ public static void BuildMemberPrefix(SysML2.NET.Core.POCO.Root.Namespaces.IMembe /// 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) + public static void BuildAliasMember(IMembership poco, ICursorCache cursor, StringBuilder stringBuilder) { BuildMemberPrefix(poco, stringBuilder); stringBuilder.Append("alias "); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs index f313142f..dba9176b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs @@ -41,29 +41,38 @@ public static partial class NamespaceTextualNotationBuilder /// /// 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) + public static void BuildRootNamespace(SysML2.NET.Core.POCO.Root.Namespaces.INamespace poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - // Handle collection Non Terminal - for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + // Should call the PackageBodyElement but since the rule focus on a Package type, have to grab the rule body + // Getting cursor since assignment with += on the ownedRelationship + var cursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + + // While loop since calling with '*' + + while (cursor.Current != null) { - switch (elementInOwnedRelationship) + switch (cursor.Current) { - case SysML2.NET.Core.POCO.Kernel.Packages.ElementFilterMembership elementFilterMembership: - ElementFilterMembershipTextualNotationBuilder.BuildElementFilterMember(elementFilterMembership, stringBuilder); + // Order based on inheritance + case SysML2.NET.Core.POCO.Kernel.Packages.IElementFilterMembership elementFilterMembership: + ElementFilterMembershipTextualNotationBuilder.BuildElementFilterMember(elementFilterMembership, cursorCache, stringBuilder); + // Cursor.Move since we do have += + cursor.Move(); break; - case SysML2.NET.Core.POCO.Root.Namespaces.OwningMembership owningMembership: - OwningMembershipTextualNotationBuilder.BuildPackageMember(owningMembership, stringBuilder); + case SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership owningMembership: + OwningMembershipTextualNotationBuilder.BuildPackageMember(owningMembership, cursorCache, stringBuilder); + cursor.Move(); break; - case SysML2.NET.Core.POCO.Root.Namespaces.Membership membership: - MembershipTextualNotationBuilder.BuildAliasMember(membership, stringBuilder); + case SysML2.NET.Core.POCO.Root.Namespaces.IMembership membership: + MembershipTextualNotationBuilder.BuildAliasMember(membership,cursorCache, stringBuilder); + cursor.Move(); break; case SysML2.NET.Core.POCO.Root.Namespaces.IImport import: - ImportTextualNotationBuilder.BuildImport(import, stringBuilder); - break; + ImportTextualNotationBuilder.BuildImport(import, cursorCache, stringBuilder); + cursor.Move(); + break; } - } - } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs index 58a26856..a9f72f4c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs @@ -29,6 +29,7 @@ namespace SysML2.NET.TextualNotation using System.Text; using SysML2.NET.Core.POCO.Root.Elements; + using SysML2.NET.Core.POCO.Root.Namespaces; /// /// The provides Textual Notation Builder for the element @@ -63,30 +64,24 @@ public static int BuildAnnotatingMember(SysML2.NET.Core.POCO.Root.Namespaces.IOw /// 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) + public static void BuildPackageMember(IOwningMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementIterator = poco.OwnedRelatedElement.GetEnumerator(); - using var ownedRelatedElementOfUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - using var iterator = SysML2.NET.Extensions.EnumerableExtensions.GetElementsOfType(poco.OwnedRelatedElement, typeof(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.Usage), typeof(SysML2.NET.Core.POCO.Root.Elements.IElement)).GetEnumerator(); - iterator.MoveNext(); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); - if (iterator.Current != null) + var cursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + switch (cursor.Current) { - switch (iterator.Current) - { - case SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.Usage usage: - UsageTextualNotationBuilder.BuildUsageElement(usage, stringBuilder); - break; - case { } element: - ElementTextualNotationBuilder.BuildDefinitionElement(element, stringBuilder); - break; - } + case SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage usage: + UsageTextualNotationBuilder.BuildUsageElement(usage, cursorCache, stringBuilder); + break; + case { } element: + ElementTextualNotationBuilder.BuildDefinitionElement(element, cursorCache, stringBuilder); + cursor.Move(); + break; } - - stringBuilder.Append(' '); - } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs index 4742b7b2..fd9f7245 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs @@ -29,6 +29,7 @@ namespace SysML2.NET.TextualNotation using System.Text; using SysML2.NET.Core.POCO.Root.Elements; + using SysML2.NET.Core.POCO.Systems.DefinitionAndUsage; /// /// The provides Textual Notation Builder for the element @@ -40,8 +41,9 @@ public static partial class UsageTextualNotationBuilder /// 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) + public static void BuildUsageElement(IUsage poco, ICursorCache cursor, StringBuilder stringBuilder) { throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); } diff --git a/SysML2.NET/TextualNotation/CursorCache.cs b/SysML2.NET/TextualNotation/CursorCache.cs new file mode 100644 index 00000000..e775ab1e --- /dev/null +++ b/SysML2.NET/TextualNotation/CursorCache.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.TextualNotation +{ + using System; + using System.Collections.Concurrent; + using System.Collections.Generic; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides caching and new cursor creation feature + /// + public class CursorCache: ICursorCache + { + /// + /// Gets the caching that keeps track of all initialized CollectionCursor per + /// + private readonly ConcurrentDictionary>> cache = new(); + + /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + public void Dispose() + { + this.cache.Clear(); + } + + /// + /// Gets or create a new cursor an identified by its based on collection identified by the given . + /// + /// The of the + /// The name the related collection + /// The collection of that is used if the is not yet created + /// The + public CollectionCursor GetOrCreateCursor(Guid elementId, string collectionName, IReadOnlyList elements) + { + if (this.cache.TryGetValue(elementId, out var cursorsPerCollection)) + { + if (cursorsPerCollection.TryGetValue(collectionName, out var cursor)) + { + return cursor; + } + + cursor = new CollectionCursor(elements); + cursorsPerCollection[collectionName] = cursor; + return cursor; + } + + var newCursor = new CollectionCursor(elements); + this.cache[elementId] = new Dictionary>() { { collectionName, newCursor } }; + return newCursor; + } + } +} diff --git a/SysML2.NET/TextualNotation/HandCoded/NamespaceTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/HandCoded/NamespaceTextualNotationBuilder.cs new file mode 100644 index 00000000..ffe6677c --- /dev/null +++ b/SysML2.NET/TextualNotation/HandCoded/NamespaceTextualNotationBuilder.cs @@ -0,0 +1,238 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// 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.HandCoded +{ + using System.Text; + + using SysML2.NET.Core.POCO.Kernel.Functions; + using SysML2.NET.Core.POCO.Kernel.Metadata; + using SysML2.NET.Core.POCO.Kernel.Packages; + using SysML2.NET.Core.POCO.Root.Annotations; + using SysML2.NET.Core.POCO.Root.Elements; + using SysML2.NET.Core.POCO.Root.Namespaces; + using SysML2.NET.Core.POCO.Systems.DefinitionAndUsage; + + public static 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, ICursorCache cursorCache, StringBuilder stringBuilder) + { + // Should call the PackageBodyElement but since the rule focus on a Package type, have to grab the rule body + // Getting cursor since assignment with += on the ownedRelationship (on next rule since we do have do it multiple times since the '*') + var cursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + + // While loop since calling with '*' + + while (cursor.Current != null) + { + // Order based on inheritance + + switch (cursor.Current) + { + case SysML2.NET.Core.POCO.Kernel.Packages.IElementFilterMembership elementFilterMembership: + BuildElementFilterMember(elementFilterMembership, cursorCache, stringBuilder); + // Cursor.Move since we do have += + cursor.Move(); + break; + case SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership owningMembership: + BuildPackageMember(owningMembership, cursorCache, stringBuilder); + // Cursor.Move since we do have += + cursor.Move(); + break; + case SysML2.NET.Core.POCO.Root.Namespaces.IMembership membership: + BuildAliasMember(membership,cursorCache, stringBuilder); + // Cursor.Move since we do have += + cursor.Move(); + break; + case SysML2.NET.Core.POCO.Root.Namespaces.IImport import: + BuildImport(import, cursorCache, stringBuilder); + // Cursor.Move since we do have += + cursor.Move(); + break; + } + } + } + + private static void BuildImport(IImport poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + + } + + private static void BuildAliasMember(IMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); + stringBuilder.Append("alias"); + stringBuilder.Append(' '); + + if (!string.IsNullOrEmpty(poco.MemberShortName)) + { + // no white space since it's '<' + stringBuilder.Append("<"); + stringBuilder.Append(poco.MemberShortName); + stringBuilder.Append(">"); + stringBuilder.Append(' '); + } + + if (!string.IsNullOrEmpty(poco.MemberName)) + { + stringBuilder.Append(poco.MemberName); + stringBuilder.Append(' '); + } + + stringBuilder.Append("for"); + stringBuilder.Append(' '); + + stringBuilder.Append(poco.MemberElement.qualifiedName); + stringBuilder.Append(' '); + + BuildRelationshipBody(poco, cursorCache, stringBuilder); + } + + private static void BuildRelationshipBody(IRelationship poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + // Having an alternate case : condition is defined because the second part have to loop through all ownedRelationship + if (poco.OwnedRelationship.Count == 0) + { + stringBuilder.AppendLine(";"); + } + else + { + stringBuilder.AppendLine("{"); + + var cursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + + while (cursor.Current != null) + { + if (cursor.Current is IAnnotation annotation) + { + BuildOwnedAnnotation(annotation, cursorCache, stringBuilder); + } + + cursor.Move(); + } + + stringBuilder.AppendLine("}"); + } + } + + private static void BuildOwnedAnnotation(IAnnotation annotation, ICursorCache cursorCache, StringBuilder stringBuilder) + { + var cursor = cursorCache.GetOrCreateCursor(annotation.Id, "ownedRelatedElement", annotation.OwnedRelatedElement); + + if (cursor.TryGetCurrent(out var annotatingElement)) + { + BuildAnnotatingElement(annotatingElement , cursorCache, stringBuilder); + } + + cursor.Move(); + } + + private static void BuildAnnotatingElement(IAnnotatingElement poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + // Order based on inheritance + + switch (poco) + { + case IDocumentation documentation: + BuildDocumentation(documentation, cursorCache, stringBuilder); + break; + case IComment comment: + BuildComment(comment, cursorCache, stringBuilder); + break; + case ITextualRepresentation textualRepresentation: + BuildTextualRepresentation(textualRepresentation, cursorCache, stringBuilder); + break; + case IMetadataFeature metadataFeature: + BuildMetadataFeature(metadataFeature, cursorCache, stringBuilder); + break; + } + } + + private static void BuildMetadataFeature(IMetadataFeature metadataFeature, ICursorCache cursorCache, StringBuilder stringBuilder) + { + } + + private static void BuildTextualRepresentation(ITextualRepresentation textualRepresentation, ICursorCache cursorCache, StringBuilder stringBuilder) + { + } + + private static void BuildComment(IComment comment, ICursorCache cursorCache, StringBuilder stringBuilder) + { + } + + private static void BuildDocumentation(IDocumentation documentation, ICursorCache cursorCache, StringBuilder stringBuilder) + { + } + + private static void BuildPackageMember(IOwningMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); + + var cursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + switch (cursor.Current) + { + case SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage usage: + BuildUsageElement(usage, cursorCache, stringBuilder); + break; + case { } element: + BuildDefinitionElement(element, cursorCache, stringBuilder); + cursor.Move(); + break; + } + } + + private static void BuildDefinitionElement(IElement poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + } + + private static void BuildUsageElement(IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + } + + private static void BuildElementFilterMember(IElementFilterMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); + stringBuilder.Append("filter"); + stringBuilder.Append(' '); + + var cursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (cursor.Current is IExpression expression) + { + BuildOwnedExpression(expression, cursorCache, stringBuilder); + cursor.Move(); + } + + // Append line since it's one of : ';', '{', '}' + stringBuilder.AppendLine(";"); + } + + private static void BuildOwnedExpression(IExpression expression, ICursorCache cursorCache, StringBuilder stringBuilder) + { + } + } +} diff --git a/SysML2.NET/TextualNotation/ICursorCache.cs b/SysML2.NET/TextualNotation/ICursorCache.cs new file mode 100644 index 00000000..2d9d021d --- /dev/null +++ b/SysML2.NET/TextualNotation/ICursorCache.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; + using System.Collections.Generic; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// The provides caching and new cursor creation feature + /// + public interface ICursorCache: IDisposable + { + /// + /// Gets or create a new cursor an identified by its based on collection identified by the given . + /// + /// The of the + /// The name the related collection + /// The collection of that is used if the is not yet created + /// The + CollectionCursor GetOrCreateCursor(Guid elementId, string collectionName, IReadOnlyList elements); + } +} From e870cdfc2529cc1bb9575d11be02d96503bdb767 Mon Sep 17 00:00:00 2001 From: atheate Date: Wed, 22 Apr 2026 08:39:54 +0200 Subject: [PATCH 26/33] [WIP] Most cases handle, need to cover methods that van not be code-gen --- .../Grammar/Model/TextualNotationRule.cs | 152 ++- .../HandleBarHelpers/RulesHelper.cs | 889 +++++++++++++++--- ...core-textual-notation-builder-template.hbs | 1 + ...AcceptActionUsageTextualNotationBuilder.cs | 40 - .../ActionUsageTextualNotationBuilder.cs | 27 +- .../AllocationUsageTextualNotationBuilder.cs | 43 + ...rtConstraintUsageTextualNotationBuilder.cs | 43 + ...gnmentActionUsageTextualNotationBuilder.cs | 43 - ...AcceptActionUsageTextualNotationBuilder.cs | 90 +- .../ActionDefinitionTextualNotationBuilder.cs | 11 +- .../ActionUsageTextualNotationBuilder.cs | 190 ++-- .../ActorMembershipTextualNotationBuilder.cs | 20 +- ...ocationDefinitionTextualNotationBuilder.cs | 9 +- .../AllocationUsageTextualNotationBuilder.cs | 18 +- ...sisCaseDefinitionTextualNotationBuilder.cs | 11 +- ...AnalysisCaseUsageTextualNotationBuilder.cs | 17 +- ...AnnotatingElementTextualNotationBuilder.cs | 21 +- .../AnnotationTextualNotationBuilder.cs | 42 +- ...rtConstraintUsageTextualNotationBuilder.cs | 13 +- ...gnmentActionUsageTextualNotationBuilder.cs | 41 +- ...ociationStructureTextualNotationBuilder.cs | 11 +- .../AssociationTextualNotationBuilder.cs | 11 +- ...tributeDefinitionTextualNotationBuilder.cs | 9 +- .../AttributeUsageTextualNotationBuilder.cs | 9 +- .../BehaviorTextualNotationBuilder.cs | 11 +- ...gConnectorAsUsageTextualNotationBuilder.cs | 37 +- .../BindingConnectorTextualNotationBuilder.cs | 31 +- ...BooleanExpressionTextualNotationBuilder.cs | 30 +- ...ulationDefinitionTextualNotationBuilder.cs | 11 +- .../CalculationUsageTextualNotationBuilder.cs | 11 +- .../CaseDefinitionTextualNotationBuilder.cs | 11 +- .../CaseUsageTextualNotationBuilder.cs | 17 +- .../ClassTextualNotationBuilder.cs | 11 +- .../ClassifierTextualNotationBuilder.cs | 105 ++- ...CollectExpressionTextualNotationBuilder.cs | 29 +- .../CommentTextualNotationBuilder.cs | 35 +- ...ConcernDefinitionTextualNotationBuilder.cs | 11 +- .../ConcernUsageTextualNotationBuilder.cs | 22 +- ...tedPortDefinitionTextualNotationBuilder.cs | 20 +- ...jugatedPortTypingTextualNotationBuilder.cs | 7 +- .../ConjugationTextualNotationBuilder.cs | 24 +- ...nectionDefinitionTextualNotationBuilder.cs | 9 +- .../ConnectionUsageTextualNotationBuilder.cs | 91 +- .../ConnectorTextualNotationBuilder.cs | 112 ++- ...straintDefinitionTextualNotationBuilder.cs | 11 +- .../ConstraintUsageTextualNotationBuilder.cs | 35 +- ...tructorExpressionTextualNotationBuilder.cs | 30 +- .../ControlNodeTextualNotationBuilder.cs | 21 +- .../CrossSubsettingTextualNotationBuilder.cs | 7 +- .../DataTypeTextualNotationBuilder.cs | 11 +- .../DecisionNodeTextualNotationBuilder.cs | 11 +- .../DefinitionTextualNotationBuilder.cs | 68 +- .../DependencyTextualNotationBuilder.cs | 60 +- .../DifferencingTextualNotationBuilder.cs | 18 +- .../DisjoiningTextualNotationBuilder.cs | 22 +- .../DocumentationTextualNotationBuilder.cs | 7 +- ...tFilterMembershipTextualNotationBuilder.cs | 42 +- .../ElementTextualNotationBuilder.cs | 145 +-- ...FeatureMembershipTextualNotationBuilder.cs | 96 +- ...erationDefinitionTextualNotationBuilder.cs | 34 +- .../EnumerationUsageTextualNotationBuilder.cs | 16 +- ...ntOccurrenceUsageTextualNotationBuilder.cs | 33 +- ...ExhibitStateUsageTextualNotationBuilder.cs | 19 +- .../ExposeTextualNotationBuilder.cs | 15 +- .../ExpressionTextualNotationBuilder.cs | 107 ++- ...reChainExpressionTextualNotationBuilder.cs | 30 +- .../FeatureChainingTextualNotationBuilder.cs | 5 +- ...tureDirectionKindTextualNotationBuilder.cs | 5 +- .../FeatureInvertingTextualNotationBuilder.cs | 28 +- ...FeatureMembershipTextualNotationBuilder.cs | 474 ++++++---- ...ferenceExpressionTextualNotationBuilder.cs | 107 ++- .../FeatureTextualNotationBuilder.cs | 806 +++++++++------- .../FeatureTypingTextualNotationBuilder.cs | 23 +- .../FeatureValueTextualNotationBuilder.cs | 188 ++-- .../FlowDefinitionTextualNotationBuilder.cs | 9 +- .../FlowEndTextualNotationBuilder.cs | 29 +- .../FlowTextualNotationBuilder.cs | 24 +- .../FlowUsageTextualNotationBuilder.cs | 43 +- ...orLoopActionUsageTextualNotationBuilder.cs | 43 +- .../ForkNodeTextualNotationBuilder.cs | 11 +- ...ConcernMembershipTextualNotationBuilder.cs | 24 +- .../FunctionTextualNotationBuilder.cs | 11 +- .../IfActionUsageTextualNotationBuilder.cs | 36 +- .../ImportTextualNotationBuilder.cs | 24 +- ...cludeUseCaseUsageTextualNotationBuilder.cs | 19 +- .../IndexExpressionTextualNotationBuilder.cs | 30 +- .../InteractionTextualNotationBuilder.cs | 11 +- ...terfaceDefinitionTextualNotationBuilder.cs | 11 +- .../InterfaceUsageTextualNotationBuilder.cs | 98 +- .../IntersectingTextualNotationBuilder.cs | 18 +- .../InvariantTextualNotationBuilder.cs | 30 +- ...ocationExpressionTextualNotationBuilder.cs | 92 +- .../ItemDefinitionTextualNotationBuilder.cs | 9 +- .../ItemUsageTextualNotationBuilder.cs | 9 +- .../JoinNodeTextualNotationBuilder.cs | 11 +- .../LibraryPackageTextualNotationBuilder.cs | 22 +- .../LiteralBooleanTextualNotationBuilder.cs | 5 +- ...LiteralExpressionTextualNotationBuilder.cs | 23 +- .../LiteralInfinityTextualNotationBuilder.cs | 5 +- .../LiteralIntegerTextualNotationBuilder.cs | 5 +- .../LiteralStringTextualNotationBuilder.cs | 5 +- .../MembershipExposeTextualNotationBuilder.cs | 7 +- .../MembershipImportTextualNotationBuilder.cs | 6 +- .../MembershipTextualNotationBuilder.cs | 83 +- .../MergeNodeTextualNotationBuilder.cs | 11 +- .../MetaclassTextualNotationBuilder.cs | 11 +- ...aAccessExpressionTextualNotationBuilder.cs | 38 +- ...etadataDefinitionTextualNotationBuilder.cs | 14 +- .../MetadataFeatureTextualNotationBuilder.cs | 90 +- .../MetadataUsageTextualNotationBuilder.cs | 84 +- ...MultiplicityRangeTextualNotationBuilder.cs | 63 +- .../MultiplicityTextualNotationBuilder.cs | 27 +- .../NamespaceExposeTextualNotationBuilder.cs | 7 +- .../NamespaceImportTextualNotationBuilder.cs | 7 +- .../NamespaceTextualNotationBuilder.cs | 92 +- .../NullExpressionTextualNotationBuilder.cs | 7 +- ...jectiveMembershipTextualNotationBuilder.cs | 20 +- ...urrenceDefinitionTextualNotationBuilder.cs | 58 +- .../OccurrenceUsageTextualNotationBuilder.cs | 69 +- ...peratorExpressionTextualNotationBuilder.cs | 306 ++++-- .../OwningMembershipTextualNotationBuilder.cs | 323 ++++--- .../PackageTextualNotationBuilder.cs | 92 +- ...rameterMembershipTextualNotationBuilder.cs | 233 ++--- .../PartDefinitionTextualNotationBuilder.cs | 9 +- .../PartUsageTextualNotationBuilder.cs | 37 +- .../PayloadFeatureTextualNotationBuilder.cs | 7 +- ...erformActionUsageTextualNotationBuilder.cs | 56 +- .../PortConjugationTextualNotationBuilder.cs | 5 +- .../PortDefinitionTextualNotationBuilder.cs | 22 +- .../PortUsageTextualNotationBuilder.cs | 45 +- .../PortionKindTextualNotationBuilder.cs | 5 +- .../PredicateTextualNotationBuilder.cs | 11 +- .../RedefinitionTextualNotationBuilder.cs | 32 +- ...ferenceSubsettingTextualNotationBuilder.cs | 14 +- .../ReferenceUsageTextualNotationBuilder.cs | 256 +++-- .../RelationshipTextualNotationBuilder.cs | 62 +- ...nderingDefinitionTextualNotationBuilder.cs | 9 +- .../RenderingUsageTextualNotationBuilder.cs | 20 +- ...straintMembershipTextualNotationBuilder.cs | 33 +- ...irementDefinitionTextualNotationBuilder.cs | 11 +- .../RequirementUsageTextualNotationBuilder.cs | 38 +- ...icationMembershipTextualNotationBuilder.cs | 20 +- ...ressionMembershipTextualNotationBuilder.cs | 24 +- ...rameterMembershipTextualNotationBuilder.cs | 83 +- ...yRequirementUsageTextualNotationBuilder.cs | 30 +- .../SelectExpressionTextualNotationBuilder.cs | 29 +- .../SendActionUsageTextualNotationBuilder.cs | 90 +- .../SpecializationTextualNotationBuilder.cs | 43 +- ...eholderMembershipTextualNotationBuilder.cs | 20 +- .../StateDefinitionTextualNotationBuilder.cs | 18 +- ...bactionMembershipTextualNotationBuilder.cs | 60 +- .../StateUsageTextualNotationBuilder.cs | 18 +- .../StepTextualNotationBuilder.cs | 30 +- .../StructureTextualNotationBuilder.cs | 11 +- ...SubclassificationTextualNotationBuilder.cs | 16 +- ...SubjectMembershipTextualNotationBuilder.cs | 40 +- .../SubsettingTextualNotationBuilder.cs | 22 +- ...SuccessionAsUsageTextualNotationBuilder.cs | 86 +- .../SuccessionFlowTextualNotationBuilder.cs | 24 +- ...ccessionFlowUsageTextualNotationBuilder.cs | 11 +- .../SuccessionTextualNotationBuilder.cs | 60 +- ...minateActionUsageTextualNotationBuilder.cs | 27 +- ...ualRepresentationTextualNotationBuilder.cs | 9 +- ...FeatureMembershipTextualNotationBuilder.cs | 54 +- .../TransitionUsageTextualNotationBuilder.cs | 218 +++-- ...ocationExpressionTextualNotationBuilder.cs | 11 +- .../TypeFeaturingTextualNotationBuilder.cs | 16 +- .../TypeTextualNotationBuilder.cs | 547 ++++++----- .../UnioningTextualNotationBuilder.cs | 18 +- .../UsageTextualNotationBuilder.cs | 320 ++++--- ...UseCaseDefinitionTextualNotationBuilder.cs | 11 +- .../UseCaseUsageTextualNotationBuilder.cs | 17 +- ...VariantMembershipTextualNotationBuilder.cs | 29 +- ...ionCaseDefinitionTextualNotationBuilder.cs | 11 +- ...ficationCaseUsageTextualNotationBuilder.cs | 17 +- .../ViewDefinitionTextualNotationBuilder.cs | 43 +- ...nderingMembershipTextualNotationBuilder.cs | 20 +- .../ViewUsageTextualNotationBuilder.cs | 55 +- ...ewpointDefinitionTextualNotationBuilder.cs | 11 +- .../ViewpointUsageTextualNotationBuilder.cs | 11 +- .../VisibilityKindTextualNotationBuilder.cs | 5 +- ...leLoopActionUsageTextualNotationBuilder.cs | 35 +- ...gConnectorAsUsageTextualNotationBuilder.cs | 40 - .../BindingConnectorTextualNotationBuilder.cs | 54 ++ ...BooleanExpressionTextualNotationBuilder.cs | 43 + .../CommentTextualNotationBuilder.cs | 40 - .../CommonTextualNotationBuilder.cs | 54 -- .../ConcernUsageTextualNotationBuilder.cs | 43 + ...jugatedPortTypingTextualNotationBuilder.cs | 3 +- .../ConjugationTextualNotationBuilder.cs | 28 +- .../ConnectionUsageTextualNotationBuilder.cs | 54 ++ .../ConnectorTextualNotationBuilder.cs | 76 ++ .../ConstraintUsageTextualNotationBuilder.cs | 43 + .../CrossSubsettingTextualNotationBuilder.cs | 43 + .../DependencyTextualNotationBuilder.cs | 40 - .../DisjoiningTextualNotationBuilder.cs | 28 +- .../ElementTextualNotationBuilder.cs | 43 + ...ntOccurrenceUsageTextualNotationBuilder.cs | 43 + ...ExhibitStateUsageTextualNotationBuilder.cs | 43 + .../ExpressionTextualNotationBuilder.cs | 87 ++ .../FeatureInvertingTextualNotationBuilder.cs | 28 +- ...FeatureMembershipTextualNotationBuilder.cs | 37 +- .../FeatureTextualNotationBuilder.cs | 164 ++++ .../FeatureTypingTextualNotationBuilder.cs | 43 + .../FeatureValueTextualNotationBuilder.cs | 43 + .../FlowTextualNotationBuilder.cs | 54 ++ .../FlowUsageTextualNotationBuilder.cs | 54 ++ .../NamespaceTextualNotationBuilder.cs | 238 ----- .../IfActionUsageTextualNotationBuilder.cs | 43 + ...cludeUseCaseUsageTextualNotationBuilder.cs | 43 + .../InterfaceUsageTextualNotationBuilder.cs | 54 ++ .../InvariantTextualNotationBuilder.cs | 43 + ...ocationExpressionTextualNotationBuilder.cs | 5 +- ...LiteralExpressionTextualNotationBuilder.cs | 3 +- .../MembershipValidationExtensions.cs | 123 +++ .../MetadataFeatureTextualNotationBuilder.cs | 17 +- .../MetadataUsageTextualNotationBuilder.cs | 17 +- .../NamespaceImportTextualNotationBuilder.cs | 43 + .../NamespaceTextualNotationBuilder.cs | 43 + .../NullExpressionTextualNotationBuilder.cs | 43 + ...peratorExpressionTextualNotationBuilder.cs | 54 ++ .../OwningMembershipTextualNotationBuilder.cs | 43 + .../PackageTextualNotationBuilder.cs | 16 +- ...erformActionUsageTextualNotationBuilder.cs | 17 +- .../RedefinitionTextualNotationBuilder.cs | 17 +- ...ferenceSubsettingTextualNotationBuilder.cs | 54 ++ .../ReferenceUsageTextualNotationBuilder.cs | 43 + .../RelationshipTextualNotationBuilder.cs | 43 + .../RenderingUsageTextualNotationBuilder.cs | 43 + ...straintMembershipTextualNotationBuilder.cs | 43 + .../RequirementUsageTextualNotationBuilder.cs | 43 + ...yRequirementUsageTextualNotationBuilder.cs | 43 + .../SendActionUsageTextualNotationBuilder.cs | 28 +- .../SpecializationTextualNotationBuilder.cs | 28 +- .../StateDefinitionTextualNotationBuilder.cs | 43 + .../StateUsageTextualNotationBuilder.cs | 43 + .../StepTextualNotationBuilder.cs | 43 + ...SubclassificationTextualNotationBuilder.cs | 40 - .../SubsettingTextualNotationBuilder.cs | 17 +- ...SuccessionAsUsageTextualNotationBuilder.cs | 40 - .../SuccessionFlowTextualNotationBuilder.cs | 54 ++ .../SuccessionTextualNotationBuilder.cs | 54 ++ ...ualRepresentationTextualNotationBuilder.cs | 40 - .../TransitionUsageTextualNotationBuilder.cs | 27 +- ...ocationExpressionTextualNotationBuilder.cs | 43 + .../TypeFeaturingTextualNotationBuilder.cs | 40 - .../TypeTextualNotationBuilder.cs | 340 ++++--- .../UsageTextualNotationBuilder.cs | 87 ++ .../ViewDefinitionTextualNotationBuilder.cs | 43 + .../ViewUsageTextualNotationBuilder.cs | 43 + ...leLoopActionUsageTextualNotationBuilder.cs | 43 + 251 files changed, 8990 insertions(+), 4575 deletions(-) delete mode 100644 SysML2.NET/TextualNotation/AcceptActionUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AllocationUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/AssertConstraintUsageTextualNotationBuilder.cs delete mode 100644 SysML2.NET/TextualNotation/AssignmentActionUsageTextualNotationBuilder.cs delete mode 100644 SysML2.NET/TextualNotation/BindingConnectorAsUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/BindingConnectorTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/BooleanExpressionTextualNotationBuilder.cs delete mode 100644 SysML2.NET/TextualNotation/CommentTextualNotationBuilder.cs delete mode 100644 SysML2.NET/TextualNotation/CommonTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/ConcernUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/ConnectionUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/ConnectorTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/ConstraintUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/CrossSubsettingTextualNotationBuilder.cs delete mode 100644 SysML2.NET/TextualNotation/DependencyTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/ElementTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/EventOccurrenceUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/ExhibitStateUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/ExpressionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/FeatureTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/FeatureTypingTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/FeatureValueTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/FlowTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/FlowUsageTextualNotationBuilder.cs delete mode 100644 SysML2.NET/TextualNotation/HandCoded/NamespaceTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/IfActionUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/IncludeUseCaseUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/InterfaceUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/InvariantTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/MembershipValidationExtensions.cs create mode 100644 SysML2.NET/TextualNotation/NamespaceImportTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/NamespaceTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/NullExpressionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/OperatorExpressionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/OwningMembershipTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/ReferenceSubsettingTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/ReferenceUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/RelationshipTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/RenderingUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/RequirementConstraintMembershipTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/RequirementUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/SatisfyRequirementUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/StateDefinitionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/StateUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/StepTextualNotationBuilder.cs delete mode 100644 SysML2.NET/TextualNotation/SubclassificationTextualNotationBuilder.cs delete mode 100644 SysML2.NET/TextualNotation/SuccessionAsUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/SuccessionFlowTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/SuccessionTextualNotationBuilder.cs delete mode 100644 SysML2.NET/TextualNotation/TextualRepresentationTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/TriggerInvocationExpressionTextualNotationBuilder.cs delete mode 100644 SysML2.NET/TextualNotation/TypeFeaturingTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/UsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/ViewDefinitionTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/ViewUsageTextualNotationBuilder.cs create mode 100644 SysML2.NET/TextualNotation/WhileLoopActionUsageTextualNotationBuilder.cs diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/TextualNotationRule.cs b/SysML2.NET.CodeGenerator/Grammar/Model/TextualNotationRule.cs index e5791d4b..720ab8de 100644 --- a/SysML2.NET.CodeGenerator/Grammar/Model/TextualNotationRule.cs +++ b/SysML2.NET.CodeGenerator/Grammar/Model/TextualNotationRule.cs @@ -104,7 +104,7 @@ private bool ComputeIsDispatcherRule() } /// - /// Gets the that requires a dispatcher + /// Gets the that requires a dispatcher /// /// The public AssignmentElement GetAssignmentElementNeedingDispatcher() @@ -121,5 +121,155 @@ public AssignmentElement GetAssignmentElementNeedingDispatcher() return this.Alternatives.SelectMany(x => x.Elements).OfType().FirstOrDefault(x => x.Operator == "+="); } + + /// + /// Recursively resolves the collection property names (properties used with the += operator) + /// that this rule and any referenced NonTerminal rules ultimately consume. + /// + /// All available rules for resolving NonTerminal references + /// A distinct set of collection property names (e.g., {"ownedRelationship"}) + public IReadOnlyCollection QueryCollectionPropertyNames(IReadOnlyList allRules) + { + var result = new HashSet(); + var visited = new HashSet(); + CollectCollectionPropertyNames(this, allRules, result, visited); + return result; + } + + /// + /// Recursively collects collection property names from a rule and its referenced NonTerminal rules + /// + /// The rule to inspect + /// All available rules for resolving NonTerminal references + /// The accumulated set of property names + /// Set of already-visited rule names to prevent infinite recursion + private static void CollectCollectionPropertyNames(TextualNotationRule rule, IReadOnlyList allRules, HashSet result, HashSet visited) + { + if (!visited.Add(rule.RuleName)) + { + return; + } + + foreach (var alternative in rule.Alternatives) + { + CollectCollectionPropertyNamesFromElements(alternative.Elements, allRules, result, visited); + } + } + + /// + /// Recursively collects collection property names from a list of + /// + /// The elements to inspect + /// All available rules for resolving NonTerminal references + /// The accumulated set of property names + /// Set of already-visited rule names to prevent infinite recursion + private static void CollectCollectionPropertyNamesFromElements(IEnumerable elements, IReadOnlyList allRules, HashSet result, HashSet visited) + { + foreach (var element in elements) + { + switch (element) + { + case AssignmentElement { Operator: "+=" } assignmentElement: + result.Add(assignmentElement.Property); + break; + case NonTerminalElement nonTerminalElement: + var referencedRule = allRules.SingleOrDefault(x => x.RuleName == nonTerminalElement.Name); + if (referencedRule != null) + { + CollectCollectionPropertyNames(referencedRule, allRules, result, visited); + } + + break; + case GroupElement groupElement: + foreach (var groupAlternative in groupElement.Alternatives) + { + CollectCollectionPropertyNamesFromElements(groupAlternative.Elements, allRules, result, visited); + } + + break; + } + } + } + + /// + /// Recursively resolves all property names (both scalar = and collection += assignments) + /// that this rule and any referenced NonTerminal rules consume. + /// + /// All available rules for resolving NonTerminal references + /// A distinct set of property names referenced by this rule tree + public IReadOnlyCollection QueryAllReferencedPropertyNames(IReadOnlyList allRules) + { + var result = new HashSet(); + var visited = new HashSet(); + CollectAllReferencedPropertyNames(this, allRules, result, visited); + return result; + } + + /// + /// Recursively collects all property names from a rule and its referenced NonTerminal rules + /// + /// The rule to inspect + /// All available rules for resolving NonTerminal references + /// The accumulated set of property names + /// Set of already-visited rule names to prevent infinite recursion + private static void CollectAllReferencedPropertyNames(TextualNotationRule rule, IReadOnlyList allRules, HashSet result, HashSet visited) + { + if (!visited.Add(rule.RuleName)) + { + return; + } + + foreach (var alternative in rule.Alternatives) + { + CollectAllReferencedPropertyNamesFromElements(alternative.Elements, allRules, result, visited); + } + } + + /// + /// Recursively collects all property names from a list of + /// + /// The elements to inspect + /// All available rules for resolving NonTerminal references + /// The accumulated set of property names + /// Set of already-visited rule names to prevent infinite recursion + private static void CollectAllReferencedPropertyNamesFromElements(IEnumerable elements, IReadOnlyList allRules, HashSet result, HashSet visited) + { + foreach (var element in elements) + { + switch (element) + { + case AssignmentElement assignmentElement: + result.Add(assignmentElement.Property); + + if (assignmentElement.Value is NonTerminalElement valueNonTerminal) + { + var valueRule = allRules.SingleOrDefault(x => x.RuleName == valueNonTerminal.Name); + + if (valueRule != null) + { + CollectAllReferencedPropertyNames(valueRule, allRules, result, visited); + } + } + + break; + case NonTerminalElement nonTerminalElement: + var referencedRule = allRules.SingleOrDefault(x => x.RuleName == nonTerminalElement.Name); + + if (referencedRule != null) + { + CollectAllReferencedPropertyNames(referencedRule, allRules, result, visited); + } + + break; + case GroupElement groupElement: + foreach (var groupAlternative in groupElement.Alternatives) + { + CollectAllReferencedPropertyNamesFromElements(groupAlternative.Elements, allRules, result, visited); + } + + break; + } + } + } } } diff --git a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs index 7b967a11..f48a2546 100644 --- a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs +++ b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs @@ -138,40 +138,94 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas ifStatementContent.Add(property.QueryIfStatementContentForNonEmpty("poco")); } } - + writer.WriteSafeString(string.Join(" && ", ifStatementContent)); writer.WriteSafeString($"){Environment.NewLine}"); writer.WriteSafeString($"{{{Environment.NewLine}"); - foreach (var textualRuleElement in elements) + var previousSiblings = ruleGenerationContext.CurrentSiblingElements; + var previousIndex = ruleGenerationContext.CurrentElementIndex; + ruleGenerationContext.CurrentSiblingElements = elements; + + for (var elementIndex = 0; elementIndex < elements.Count; elementIndex++) { + ruleGenerationContext.CurrentElementIndex = elementIndex; var previousCaller = ruleGenerationContext.CallerRule; - ProcessRuleElement(writer, umlClass, textualRuleElement, ruleGenerationContext); + ProcessRuleElement(writer, umlClass, elements[elementIndex], ruleGenerationContext); ruleGenerationContext.CallerRule = previousCaller; } + + ruleGenerationContext.CurrentSiblingElements = previousSiblings; + ruleGenerationContext.CurrentElementIndex = previousIndex; } else - { - writer.WriteSafeString($"{Environment.NewLine}if(BuildGroupConditionFor{alternative.TextualNotationRule.RuleName}(poco))"); - writer.WriteSafeString($"{Environment.NewLine}{{{Environment.NewLine}"); + { + var nonTerminalElements = elements.OfType().ToList(); + var inlineConditionParts = new List(); + + foreach (var nonTerminal in nonTerminalElements) + { + var referencedRule = ruleGenerationContext.AllRules.SingleOrDefault(x => x.RuleName == nonTerminal.Name); + + if (referencedRule != null) + { + var condition = GenerateInlineOptionalCondition(referencedRule, umlClass, ruleGenerationContext.AllRules, "poco"); + + if (condition != null) + { + inlineConditionParts.Add(condition); + } + } + } - foreach (var textualRuleElement in elements) + if (inlineConditionParts.Count > 0) + { + writer.WriteSafeString($"{Environment.NewLine}if ({string.Join(" || ", inlineConditionParts)}){Environment.NewLine}"); + } + else { - ProcessRuleElement(writer, umlClass, textualRuleElement, ruleGenerationContext); + writer.WriteSafeString($"{Environment.NewLine}if (BuildGroupConditionFor{alternative.TextualNotationRule.RuleName}(poco)){Environment.NewLine}"); } + + writer.WriteSafeString($"{{{Environment.NewLine}"); + + var previousSiblings = ruleGenerationContext.CurrentSiblingElements; + var previousIndex = ruleGenerationContext.CurrentElementIndex; + ruleGenerationContext.CurrentSiblingElements = elements; + + for (var elementIndex = 0; elementIndex < elements.Count; elementIndex++) + { + ruleGenerationContext.CurrentElementIndex = elementIndex; + ProcessRuleElement(writer, umlClass, elements[elementIndex], ruleGenerationContext); + } + + ruleGenerationContext.CurrentSiblingElements = previousSiblings; + ruleGenerationContext.CurrentElementIndex = previousIndex; } - - writer.WriteSafeString($"stringBuilder.Append(' ');{Environment.NewLine}"); + + if (!ruleGenerationContext.IsNextElementNewLineTerminal() && !ruleGenerationContext.IsLastElement()) + { + writer.WriteSafeString($"stringBuilder.Append(' ');{Environment.NewLine}"); + } + writer.WriteSafeString($"}}{Environment.NewLine}"); } else { - foreach (var textualRuleElement in elements) + var previousSiblings = ruleGenerationContext.CurrentSiblingElements; + var previousIndex = ruleGenerationContext.CurrentElementIndex; + ruleGenerationContext.CurrentSiblingElements = elements; + + for (var elementIndex = 0; elementIndex < elements.Count; elementIndex++) { + ruleGenerationContext.CurrentElementIndex = elementIndex; var previousCaller = ruleGenerationContext.CallerRule; - ProcessRuleElement(writer, umlClass, textualRuleElement, ruleGenerationContext, isPartOfMultipleAlternative); + ProcessRuleElement(writer, umlClass, elements[elementIndex], ruleGenerationContext, isPartOfMultipleAlternative); ruleGenerationContext.CallerRule = previousCaller; - } + } + + ruleGenerationContext.CurrentSiblingElements = previousSiblings; + ruleGenerationContext.CurrentElementIndex = previousIndex; } } else @@ -252,50 +306,50 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas var assignmentElements = alternatives.SelectMany(x => x.Elements).OfType().ToList(); var referencedTerminalElement = assignmentElements.Select(x => x.Value).OfType().ToList(); - + if (referencedTerminalElement.Count != assignmentElements.Count) { - writer.WriteSafeString("throw new System.NotSupportedException(\"Assignment Element with something else than NonTerminalElement not supported\");"); + var handCodedRuleName = alternatives.ElementAt(0).TextualNotationRule.RuleName; + writer.WriteSafeString($"Build{handCodedRuleName}HandCoded({ruleGenerationContext.CurrentVariableName ?? "poco"}, cursorCache, stringBuilder);"); return; } referencedTerminalElement.Add(nonTerminalElement); - + var targetProperty = umlClass.QueryAllProperties().Single(x => string.Equals(x.Name, assignmentElements[0].Property)); + var cursorVarName = $"{targetProperty.Name.LowerCaseFirstLetter()}Cursor"; + var existingCursor = ruleGenerationContext.DefinedCursors.FirstOrDefault(x => x.IsCursorValidForProperty(targetProperty)); - const string indexName = "elementIndex"; - const string variableName = "elements"; - const string elementName = $"{variableName}Element"; - - writer.WriteSafeString($"var {elementName} = poco.{targetProperty.QueryPropertyNameBasedOnUmlProperties()}[{indexName}];{Environment.NewLine}"); - writer.WriteSafeString($"{Environment.NewLine}switch({elementName}){Environment.NewLine}"); - writer.WriteSafeString($"{{{Environment.NewLine}"); + if (existingCursor == null) + { + writer.WriteSafeString($"var {cursorVarName} = cursorCache.GetOrCreateCursor(poco.Id, \"{targetProperty.Name}\", poco.{targetProperty.QueryPropertyNameBasedOnUmlProperties()});{Environment.NewLine}"); + var cursorDef = new CursorDefinition { DefinedForProperty = targetProperty }; + + foreach (var assignmentElement in assignmentElements) + { + cursorDef.ApplicableRuleElements.Add(assignmentElement); + } + + ruleGenerationContext.DefinedCursors.Add(cursorDef); + } + else + { + cursorVarName = existingCursor.CursorVariableName; + } var mappedElements = OrderElementsByInheritance(referencedTerminalElement, umlClass.Cache, ruleGenerationContext); - - foreach (var assignmentElement in assignmentElements) + + writer.WriteSafeString($"switch({cursorVarName}.Current){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + + foreach (var mappedElement in mappedElements) { - var mappedElement = mappedElements.Single(x => x.RuleElement == assignmentElement.Value); - - writer.WriteSafeString($"case {mappedElement.UmlClass.QueryFullyQualifiedTypeName(targetInterface:mappedElement.UmlClass.IsAbstract)} {mappedElement.UmlClass.Name.LowerCaseFirstLetter()}:{Environment.NewLine}"); + writer.WriteSafeString($"case {mappedElement.UmlClass.QueryFullyQualifiedTypeName()} {mappedElement.UmlClass.Name.LowerCaseFirstLetter()}:{Environment.NewLine}"); ruleGenerationContext.CurrentVariableName = mappedElement.UmlClass.Name.LowerCaseFirstLetter(); ProcessNonTerminalElement(writer, mappedElement.UmlClass, mappedElement.RuleElement, ruleGenerationContext); writer.WriteSafeString($"break;{Environment.NewLine}"); } - - var mappedElementForNonTerminal = mappedElements.Single(x => x.RuleElement == nonTerminalElement); - writer.WriteSafeString($"case {mappedElementForNonTerminal.UmlClass.QueryFullyQualifiedTypeName()} {mappedElementForNonTerminal.UmlClass.Name.LowerCaseFirstLetter()}:{Environment.NewLine}"); - if (mappedElementForNonTerminal.UmlClass == umlClass) - { - writer.WriteSafeString($"{indexName} = Build{nonTerminalElement.Name}({mappedElementForNonTerminal.UmlClass.Name.LowerCaseFirstLetter()}, {indexName}, stringBuilder);"); - } - else - { - writer.WriteSafeString($"{indexName} = {mappedElementForNonTerminal.UmlClass.Name}TextualNotationBuilder.Build{nonTerminalElement.Name}({mappedElementForNonTerminal.UmlClass.Name.LowerCaseFirstLetter()}, {indexName}, stringBuilder);"); - } - - writer.WriteSafeString($"{Environment.NewLine}break;{Environment.NewLine}"); writer.WriteSafeString($"{Environment.NewLine}}}"); } else if (alternatives.ElementAt(0).Elements[0] is TerminalElement terminalElement && alternatives.ElementAt(1).Elements[0] is AssignmentElement assignmentElement) @@ -313,13 +367,71 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas } else { - writer.WriteSafeString($"throw new System.NotSupportedException(\"Multiple alternatives processing {string.Join(',', types.Select(x => x.Name))} not implemented yet\");"); + var handCodedRuleName = alternatives.ElementAt(0).TextualNotationRule.RuleName; + writer.WriteSafeString($"Build{handCodedRuleName}HandCoded({ruleGenerationContext.CurrentVariableName ?? "poco"}, cursorCache, stringBuilder);"); } } } else { - writer.WriteSafeString("throw new System.NotSupportedException(\"Multiple alternatives not implemented yet\");"); + // Multi-element alternatives (e.g., ';' | '{' NamespaceBodyElement* '}') + // Detect pattern: first alternative is terminal-only, second has collection assignment + var firstAlt = alternatives.ElementAt(0); + var hasTerminalOnlyFirstAlt = firstAlt.Elements.Count == 1 && firstAlt.Elements[0] is TerminalElement; + + if (hasTerminalOnlyFirstAlt && alternatives.Count == 2) + { + var secondAlt = alternatives.ElementAt(1); + var collectionAssignments = secondAlt.Elements.OfType().Where(x => x.Operator == "+=").ToList(); + var groupsWithCollectionAssignments = secondAlt.Elements.OfType() + .SelectMany(g => g.Alternatives.SelectMany(a => a.Elements.OfType().Where(x => x.Operator == "+="))) + .ToList(); + + var allCollectionAssignments = collectionAssignments.Concat(groupsWithCollectionAssignments).ToList(); + + if (allCollectionAssignments.Count > 0) + { + // Determine the collection property to check for emptiness + var collectionProperty = allCollectionAssignments[0].Property; + var targetProperty = umlClass.QueryAllProperties().SingleOrDefault(x => string.Equals(x.Name, collectionProperty, StringComparison.OrdinalIgnoreCase)); + var terminalValue = ((TerminalElement)firstAlt.Elements[0]).Value; + + if (targetProperty != null) + { + writer.WriteSafeString($"if(poco.{targetProperty.QueryPropertyNameBasedOnUmlProperties()}.Count == 0){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + writer.WriteSafeString($"stringBuilder.AppendLine(\"{terminalValue}\");{Environment.NewLine}"); + writer.WriteSafeString($"}}{Environment.NewLine}"); + writer.WriteSafeString($"else{Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + + // Process the second alternative elements + DeclareAllRequiredCursors(writer, umlClass, secondAlt, ruleGenerationContext); + + foreach (var element in secondAlt.Elements) + { + ProcessRuleElement(writer, umlClass, element, ruleGenerationContext); + } + + writer.WriteSafeString($"}}{Environment.NewLine}"); + } + else + { + var handCodedRuleName = alternatives.ElementAt(0).TextualNotationRule.RuleName; + writer.WriteSafeString($"Build{handCodedRuleName}HandCoded({ruleGenerationContext.CurrentVariableName ?? "poco"}, cursorCache, stringBuilder);"); + } + } + else + { + var handCodedRuleName = alternatives.ElementAt(0).TextualNotationRule.RuleName; + writer.WriteSafeString($"Build{handCodedRuleName}HandCoded({ruleGenerationContext.CurrentVariableName ?? "poco"}, cursorCache, stringBuilder);"); + } + } + else + { + var handCodedRuleName = alternatives.ElementAt(0).TextualNotationRule.RuleName; + writer.WriteSafeString($"Build{handCodedRuleName}HandCoded({ruleGenerationContext.CurrentVariableName ?? "poco"}, cursorCache, stringBuilder);"); + } } } } @@ -333,7 +445,10 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas /// The current private static void ProcessMultiCollectionAssignment(EncodedTextWriter writer, IClass umlClass, IReadOnlyCollection alternatives, RuleGenerationContext ruleGenerationContext) { - + // Multi-collection assignment: alternatives assign += to different properties + // Each alternative is processed with cursor-based access on its respective property + var handCodedRuleName = alternatives.ElementAt(0).TextualNotationRule.RuleName; + writer.WriteSafeString($"Build{handCodedRuleName}HandCoded({ruleGenerationContext.CurrentVariableName ?? "poco"}, cursorCache, stringBuilder);"); } /// @@ -350,19 +465,137 @@ private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter switch (firstRuleElement) { case TerminalElement terminalElement: - writer.WriteSafeString($"stringBuilder.Append(\" {terminalElement.Value} \");"); + WriteTerminalAppendWithLeadingSpace(writer, terminalElement.Value); break; case NonTerminalElement: { var nonTerminalElements = alternatives.SelectMany(x => x.Elements).OfType().ToList(); var mappedNonTerminalElements = OrderElementsByInheritance(nonTerminalElements, umlClass.Cache, ruleGenerationContext); - if (mappedNonTerminalElements.Select(x => x.UmlClass).Distinct().Count() != mappedNonTerminalElements.Count) + // Build a lookup of duplicate UML classes to determine which cases need when guards + var duplicateClasses = mappedNonTerminalElements + .GroupBy(x => x.UmlClass) + .Where(g => g.Count() > 1) + .ToDictionary(g => g.Key, g => g.ToList()); + + // For each duplicate group, resolve boolean ?= properties to use as when guards. + // Compute properties unique to each element vs all others in the group. + var whenGuards = new Dictionary(); + + foreach (var duplicateGroup in duplicateClasses) + { + var allProperties = duplicateGroup.Key.QueryAllProperties(); + + // Compute boolean ?= properties for each element in the group + var elementBoolProps = new List<(NonTerminalElement RuleElement, List BoolProps)>(); + + foreach (var element in duplicateGroup.Value) + { + var referencedRule = ruleGenerationContext.AllRules.Single(x => x.RuleName == element.RuleElement.Name); + var booleanProperties = QueryBooleanAssignmentProperties(referencedRule, ruleGenerationContext.AllRules); + elementBoolProps.Add((element.RuleElement, booleanProperties)); + } + + // Build the union of all other elements' properties for each element + for (var elementIndex = 0; elementIndex < elementBoolProps.Count; elementIndex++) + { + var current = elementBoolProps[elementIndex]; + var othersProperties = new HashSet(StringComparer.OrdinalIgnoreCase); + + for (var otherIndex = 0; otherIndex < elementBoolProps.Count; otherIndex++) + { + if (otherIndex != elementIndex) + { + foreach (var prop in elementBoolProps[otherIndex].BoolProps) + { + othersProperties.Add(prop); + } + } + } + + var uniqueProperties = current.BoolProps.Where(p => !othersProperties.Contains(p)).ToList(); + + if (uniqueProperties.Count > 0) + { + var guardParts = new List(); + + foreach (var boolProp in uniqueProperties) + { + var umlProperty = allProperties.FirstOrDefault(x => string.Equals(x.Name, boolProp, StringComparison.OrdinalIgnoreCase)); + + if (umlProperty != null) + { + guardParts.Add($"{{0}}.{umlProperty.QueryPropertyNameBasedOnUmlProperties()}"); + } + } + + if (guardParts.Count > 0) + { + whenGuards[current.RuleElement] = guardParts[0]; + } + } + } + + // Ensure exactly one element in the group has no when guard (the fallback). + // If all elements have guards, remove the guard from the one with the most unique properties + // (the most general rule, which should match when no specific guard applies). + var elementsWithGuards = duplicateGroup.Value.Where(e => whenGuards.ContainsKey(e.RuleElement)).ToList(); + + if (elementsWithGuards.Count == duplicateGroup.Value.Count) + { + // All elements have guards — remove the guard from the element with fewest boolean properties (most generic) + var fallbackElement = duplicateGroup.Value + .OrderBy(element => elementBoolProps + .Single(bp => bp.RuleElement == element.RuleElement).BoolProps.Count) + .First(); + whenGuards.Remove(fallbackElement.RuleElement); + } + + // Reorder the duplicate group: elements with when guards first, general (no guard) last + duplicateGroup.Value.Sort((a, b) => + { + var aHasGuard = whenGuards.ContainsKey(a.RuleElement); + var bHasGuard = whenGuards.ContainsKey(b.RuleElement); + + if (aHasGuard && !bHasGuard) return -1; + if (!aHasGuard && bHasGuard) return 1; + return 0; + }); + } + + // Check for unresolvable duplicates: more than one element without a when guard in a group + var hasUnresolvableDuplicates = duplicateClasses.Any(group => + group.Value.Count(element => !whenGuards.ContainsKey(element.RuleElement)) > 1); + + if (hasUnresolvableDuplicates) { - writer.WriteSafeString("throw new System.NotSupportedException(\"Multiple alternatives with same referenced rule type not implemented yet\");"); + var handCodedRuleName = alternatives.ElementAt(0).TextualNotationRule.RuleName; + writer.WriteSafeString($"Build{handCodedRuleName}HandCoded({ruleGenerationContext.CurrentVariableName ?? "poco"}, cursorCache, stringBuilder);"); break; } + // Rebuild the overall ordered list respecting the reordered duplicate groups + var reorderedElements = new List<(NonTerminalElement RuleElement, IClass UmlClass)>(); + var processedDuplicateClasses = new HashSet(); + + foreach (var element in mappedNonTerminalElements) + { + if (duplicateClasses.TryGetValue(element.UmlClass, out var duplicateGroup)) + { + if (processedDuplicateClasses.Add(element.UmlClass)) + { + // Insert all elements of this duplicate group in their reordered sequence + reorderedElements.AddRange(duplicateGroup); + } + } + else + { + reorderedElements.Add(element); + } + } + + mappedNonTerminalElements = reorderedElements; + var variableName = "poco"; if (ruleGenerationContext.CallerRule is AssignmentElement assignmentElement) @@ -374,19 +607,33 @@ private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter writer.WriteSafeString($"switch({variableName}){Environment.NewLine}"); writer.WriteSafeString("{"); + // Determine the last element that would be a default case (only one default allowed) + var defaultElement = mappedNonTerminalElements + .LastOrDefault(x => x.UmlClass == ruleGenerationContext.NamedElementToGenerate && !whenGuards.ContainsKey(x.RuleElement)); + foreach (var orderedNonTerminalElement in mappedNonTerminalElements) { var previousVariableName = ruleGenerationContext.CurrentVariableName; + var hasWhenGuard = whenGuards.TryGetValue(orderedNonTerminalElement.RuleElement, out var guardTemplate); - if (orderedNonTerminalElement.UmlClass == ruleGenerationContext.NamedElementToGenerate) + if (orderedNonTerminalElement.RuleElement == defaultElement.RuleElement && !hasWhenGuard) { writer.WriteSafeString($"default:{Environment.NewLine}"); ruleGenerationContext.CurrentVariableName = variableName; } + else if (hasWhenGuard) + { + // Case with when guard for disambiguation + var guardVarName = $"poco{orderedNonTerminalElement.UmlClass.Name}{orderedNonTerminalElement.RuleElement.Name}"; + var resolvedGuard = string.Format(guardTemplate, guardVarName); + writer.WriteSafeString($"case {orderedNonTerminalElement.UmlClass.QueryFullyQualifiedTypeName()} {guardVarName} when {resolvedGuard}:{Environment.NewLine}"); + ruleGenerationContext.CurrentVariableName = guardVarName; + } else { - writer.WriteSafeString($"case {orderedNonTerminalElement.UmlClass.QueryFullyQualifiedTypeName(targetInterface: orderedNonTerminalElement.UmlClass.IsAbstract)} poco{orderedNonTerminalElement.UmlClass.Name}:{Environment.NewLine}"); - ruleGenerationContext.CurrentVariableName = $"poco{orderedNonTerminalElement.UmlClass.Name}"; + var caseVarName = $"poco{orderedNonTerminalElement.UmlClass.Name}"; + writer.WriteSafeString($"case {orderedNonTerminalElement.UmlClass.QueryFullyQualifiedTypeName()} {caseVarName}:{Environment.NewLine}"); + ruleGenerationContext.CurrentVariableName = caseVarName; } ProcessNonTerminalElement(writer, orderedNonTerminalElement.UmlClass, orderedNonTerminalElement.RuleElement, ruleGenerationContext); @@ -454,11 +701,11 @@ private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter if (numberOfElementOfSameType == 1) { - writer.WriteSafeString($"case {orderedElement.UmlClass.QueryFullyQualifiedTypeName(targetInterface: orderedElement.UmlClass.IsAbstract)} {orderedElement.UmlClass.Name.LowerCaseFirstLetter()}:{Environment.NewLine}"); + writer.WriteSafeString($"case {orderedElement.UmlClass.QueryFullyQualifiedTypeName()} {orderedElement.UmlClass.Name.LowerCaseFirstLetter()}:{Environment.NewLine}"); } else { - writer.WriteSafeString($"case {orderedElement.UmlClass.QueryFullyQualifiedTypeName(targetInterface: orderedElement.UmlClass.IsAbstract)} {orderedElement.UmlClass.Name.LowerCaseFirstLetter()} when {orderedElement.UmlClass.Name.LowerCaseFirstLetter()}.IsValidFor{orderedElement.RuleElement.Name}():{Environment.NewLine}"); + writer.WriteSafeString($"case {orderedElement.UmlClass.QueryFullyQualifiedTypeName()} {orderedElement.UmlClass.Name.LowerCaseFirstLetter()} when {orderedElement.UmlClass.Name.LowerCaseFirstLetter()}.IsValidFor{orderedElement.RuleElement.Name}():{Environment.NewLine}"); } var previousVariableName = ruleGenerationContext.CurrentVariableName; @@ -509,7 +756,7 @@ private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter } else { - writer.WriteSafeString($"case {orderedElement.UmlClass.QueryFullyQualifiedTypeName(targetInterface: orderedElement.UmlClass.IsAbstract)} {orderedElement.UmlClass.Name.LowerCaseFirstLetter()}:{Environment.NewLine}"); + writer.WriteSafeString($"case {orderedElement.UmlClass.QueryFullyQualifiedTypeName()} {orderedElement.UmlClass.Name.LowerCaseFirstLetter()}:{Environment.NewLine}"); } var previousVariableName = ruleGenerationContext.CurrentVariableName; @@ -558,8 +805,61 @@ private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter break; default: - writer.WriteSafeString($"throw new System.NotSupportedException(\"Multiple alternatives with only {firstRuleElement.GetType().Name} not implemented yet\");"); + { + var defaultHandCodedRuleName = alternatives.ElementAt(0).TextualNotationRule.RuleName; + writer.WriteSafeString($"Build{defaultHandCodedRuleName}HandCoded({ruleGenerationContext.CurrentVariableName ?? "poco"}, cursorCache, stringBuilder);"); break; + } + } + } + + /// + /// Extracts all boolean property names (assigned via ?=) from the elements of a grammar rule. + /// These properties can be used as when guards to disambiguate switch cases that share the same UML class type. + /// + /// The to inspect + /// All available rules for recursive resolution of NonTerminal elements + /// A list of property names that are boolean-assigned in this rule + private static List QueryBooleanAssignmentProperties(TextualNotationRule rule, IReadOnlyList allRules) + { + var result = new List(); + CollectBooleanAssignmentProperties(rule.Alternatives.SelectMany(x => x.Elements).ToList(), allRules, result, new HashSet()); + return result; + } + + /// + /// Recursively collects boolean ?= assignment property names from a list of + /// + /// The elements to inspect + /// All available rules for resolving NonTerminal references + /// The accumulated list of boolean property names + /// Set of already-visited rule names to prevent infinite recursion + private static void CollectBooleanAssignmentProperties(IReadOnlyList elements, IReadOnlyList allRules, List result, HashSet visited) + { + foreach (var element in elements) + { + switch (element) + { + case AssignmentElement { Operator: "?=" } assignment: + result.Add(assignment.Property); + break; + case GroupElement groupElement: + foreach (var groupAlternative in groupElement.Alternatives) + { + CollectBooleanAssignmentProperties(groupAlternative.Elements, allRules, result, visited); + } + + break; + case NonTerminalElement nonTerminal: + var referencedRule = allRules.SingleOrDefault(x => x.RuleName == nonTerminal.Name); + + if (referencedRule != null && visited.Add(referencedRule.RuleName)) + { + CollectBooleanAssignmentProperties(referencedRule.Alternatives.SelectMany(x => x.Elements).ToList(), allRules, result, visited); + } + + break; + } } } @@ -583,24 +883,34 @@ private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter mapping.Add((nonTerminalElement, referencedClass)); } + // Capture original indices for stable tie-breaking before sorting + var originalIndices = mapping.Select((item, itemIndex) => (item.RuleElement, itemIndex)) + .ToDictionary(x => x.RuleElement, x => x.itemIndex); + mapping.Sort((a, b) => { - if (a.UmlClass == ruleGenerationContext.NamedElementToGenerate) - { - return 1; - } + // Push the current class to the end (used as default case) + var aIsNamed = a.UmlClass == ruleGenerationContext.NamedElementToGenerate; + var bIsNamed = b.UmlClass == ruleGenerationContext.NamedElementToGenerate; - if (a.UmlClass == b.UmlClass) - { - return 0; - } + if (aIsNamed && !bIsNamed) return 1; + if (bIsNamed && !aIsNamed) return -1; + + if (a.UmlClass == b.UmlClass) return 0; - if (a.UmlClass.QueryIsSubclassOf(b.UmlClass)) + // Sort by inheritance depth (more specific types first). + // Any subclass has strictly more ancestors than its superclass, + // so depth-based ordering is transitive and correct for switch case ordering. + var depthA = a.UmlClass.QueryAllGeneralClassifiers().Count(); + var depthB = b.UmlClass.QueryAllGeneralClassifiers().Count(); + + if (depthA != depthB) { - return -1; + return depthB.CompareTo(depthA); } - return b.UmlClass.QueryIsSubclassOf(a.UmlClass) ? 1 : 0; + // Same depth: preserve original grammar order for stability + return originalIndices[a.RuleElement].CompareTo(originalIndices[b.RuleElement]); }); return mapping; @@ -647,14 +957,7 @@ private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass switch (textualRuleElement) { case TerminalElement terminalElement: - var valueToAdd = terminalElement.Value; - - if (valueToAdd.Length > 1) - { - valueToAdd += ' '; - } - - writer.WriteSafeString($"stringBuilder.Append(\"{valueToAdd}\");"); + WriteTerminalAppend(writer, terminalElement.Value); break; case NonTerminalElement nonTerminalElement: if (ruleGenerationContext.CallerRule is NonTerminalElement { Container: AssignmentElement assignmentElementContainer }) @@ -704,7 +1007,7 @@ private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass ProcessAlternatives(writer, umlClass, groupElement.Alternatives, ruleGenerationContext); } - if (!groupElement.IsOptional) + if (!groupElement.IsOptional && !ruleGenerationContext.IsNextElementNewLineTerminal()) { writer.WriteSafeString($"{Environment.NewLine}stringBuilder.Append(' ');"); } @@ -720,11 +1023,16 @@ private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass if (valueLiteralElement.QueryIsQualifiedName()) { writer.WriteSafeString($"stringBuilder.Append({ruleGenerationContext.CurrentVariableName}.qualifiedName);{Environment.NewLine}"); - writer.WriteSafeString("stringBuilder.Append(' ');"); + + if (!ruleGenerationContext.IsNextElementNewLineTerminal()) + { + writer.WriteSafeString("stringBuilder.Append(' ');"); + } } else { - writer.WriteSafeString("throw new System.NotSupportedException(\"Value Literal different than QualifiedName not supported\");"); + var handCodedRuleName = textualRuleElement.TextualNotationRule?.RuleName ?? "Unknown"; + writer.WriteSafeString($"Build{handCodedRuleName}HandCoded({ruleGenerationContext.CurrentVariableName ?? "poco"}, cursorCache, stringBuilder);"); } break; @@ -789,7 +1097,8 @@ private static void ProcessAssignmentElement(EncodedTextWriter writer, IClass um } else { - writer.WriteSafeString("throw new System.NotSupportedException(\"Assigment of enumerable with non NonTerminalElement not supported yet\");"); + var handCodedRuleName = assignmentElement.TextualNotationRule?.RuleName ?? "Unknown"; + writer.WriteSafeString($"Build{handCodedRuleName}HandCoded({ruleGenerationContext.CurrentVariableName ?? "poco"}, cursorCache, stringBuilder);"); } } else @@ -852,20 +1161,29 @@ private static void ProcessAssignmentElement(EncodedTextWriter writer, IClass um if (isPartOfMultipleAlternative) { writer.WriteSafeString($"stringBuilder.Append(poco.{targetPropertyName}.qualifiedName);{Environment.NewLine}"); - writer.WriteSafeString("stringBuilder.Append(' ');"); + + if (!ruleGenerationContext.IsNextElementNewLineTerminal()) + { + writer.WriteSafeString("stringBuilder.Append(' ');"); + } } else { 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(' ');"); + + if (!ruleGenerationContext.IsNextElementNewLineTerminal()) + { + 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\");"); + var handCodedRuleName = assignmentElement.TextualNotationRule?.RuleName ?? "Unknown"; + writer.WriteSafeString($"Build{handCodedRuleName}HandCoded({ruleGenerationContext.CurrentVariableName ?? "poco"}, cursorCache, stringBuilder);"); break; } } @@ -895,10 +1213,10 @@ private static void ProcessNonTerminalElement(EncodedTextWriter writer, IClass u var referencedRule = ruleGenerationContext.AllRules.SingleOrDefault(x => x.RuleName == nonTerminalElement.Name); string typeTarget; - + if (referencedRule == null) { - typeTarget = umlClass.Name; + typeTarget = umlClass.Name; } else { @@ -906,7 +1224,7 @@ private static void ProcessNonTerminalElement(EncodedTextWriter writer, IClass u } var isForProperty = ruleGenerationContext.CurrentVariableName.Contains('.'); - + if (isForProperty && !isPartOfMultipleAlternative) { writer.WriteSafeString($"{Environment.NewLine}if ({ruleGenerationContext.CurrentVariableName} != null){Environment.NewLine}"); @@ -915,37 +1233,25 @@ private static void ProcessNonTerminalElement(EncodedTextWriter writer, IClass u if (nonTerminalElement.IsCollection) { - writer.WriteSafeString($"// Handle collection Non Terminal {Environment.NewLine}"); - - if (referencedRule is not { IsDispatcherRule: true }) - { - if (nonTerminalElement.TextualNotationRule.IsDispatcherRule) - { - writer.WriteSafeString($"Build{ nonTerminalElement.Name}Internal({ruleGenerationContext.CurrentVariableName}, elementIndex, stringBuilder);"); - } - else - { - writer.WriteSafeString($"Build{ nonTerminalElement.Name}Internal({ruleGenerationContext.CurrentVariableName}, stringBuilder);"); - } - } - else + EmitCollectionNonTerminalLoop(writer, umlClass, nonTerminalElement, referencedRule, typeTarget, ruleGenerationContext); + + if (isForProperty && !isPartOfMultipleAlternative) { - var assignmentProperty = referencedRule.GetAssignmentElementNeedingDispatcher().Property; - - writer.WriteSafeString($"for(var {assignmentProperty}Index = 0; {assignmentProperty}Index < {ruleGenerationContext.CurrentVariableName}.{assignmentProperty.CapitalizeFirstLetter()}.Count; {assignmentProperty}Index++){Environment.NewLine}"); - writer.WriteSafeString($"{{{Environment.NewLine}"); + writer.WriteSafeString($"{Environment.NewLine}}}"); } + + return; } 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) || !ruleGenerationContext.CurrentVariableName.Contains("poco"))) { - if (ruleGenerationContext.CallerRule is AssignmentElement assignmentElement && assignmentElement.TextualNotationRule.IsDispatcherRule) + if (ruleGenerationContext.CallerRule is AssignmentElement ) { var castedVariableName = $"elementAs{targetClass.Name}"; writer.WriteSafeString($"{Environment.NewLine}if ({ruleGenerationContext.CurrentVariableName} is {targetClass.QueryFullyQualifiedTypeName()} {castedVariableName}){Environment.NewLine}"); @@ -953,24 +1259,16 @@ private static void ProcessNonTerminalElement(EncodedTextWriter writer, IClass u writer.WriteSafeString($"{{{Environment.NewLine}"); } - if (referencedRule?.IsDispatcherRule == true) - { - if (nonTerminalElement.IsCollection) - { - var indexName = $"{referencedRule.GetAssignmentElementNeedingDispatcher().Property}Index"; - writer.WriteSafeString($"{indexName} = {targetType.Name}TextualNotationBuilder.Build{nonTerminalElement.Name}({ruleGenerationContext.CurrentVariableName}, {indexName}, stringBuilder);"); - } - else - { - writer.WriteSafeString($"{targetType.Name}TextualNotationBuilder.Build{nonTerminalElement.Name}({ruleGenerationContext.CurrentVariableName}, 0, stringBuilder);"); - } - } - else + var emittedCondition = TryEmitOptionalCondition(writer, nonTerminalElement, referencedRule, targetClass, ruleGenerationContext, ruleGenerationContext.CurrentVariableName); + + writer.WriteSafeString($"{targetType.Name}TextualNotationBuilder.Build{nonTerminalElement.Name}({ruleGenerationContext.CurrentVariableName}, cursorCache, stringBuilder);"); + + if (emittedCondition) { - writer.WriteSafeString($"{targetType.Name}TextualNotationBuilder.Build{nonTerminalElement.Name}({ruleGenerationContext.CurrentVariableName}, stringBuilder);"); + writer.WriteSafeString($"{Environment.NewLine}}}"); } - if (ruleGenerationContext.CallerRule is AssignmentElement { TextualNotationRule: {IsDispatcherRule: true} }) + if (ruleGenerationContext.CallerRule is AssignmentElement) { writer.WriteSafeString($"{Environment.NewLine}}}"); } @@ -981,11 +1279,6 @@ private static void ProcessNonTerminalElement(EncodedTextWriter writer, IClass u ruleGenerationContext.CallerRule = nonTerminalElement; var previousName = ruleGenerationContext.CurrentVariableName; - if (referencedRule?.IsDispatcherRule == true) - { - ruleGenerationContext.CurrentVariableName = $"{previousName}.{referencedRule.GetAssignmentElementNeedingDispatcher().Property.CapitalizeFirstLetter()}"; - } - ProcessAlternatives(writer, umlClass, referencedRule?.Alternatives, ruleGenerationContext, isPartOfMultipleAlternative); ruleGenerationContext.CallerRule = previousCaller; ruleGenerationContext.CurrentVariableName = previousName; @@ -997,11 +1290,6 @@ private static void ProcessNonTerminalElement(EncodedTextWriter writer, IClass u ruleGenerationContext.CallerRule = nonTerminalElement; var previousName = ruleGenerationContext.CurrentVariableName; - if (referencedRule?.IsDispatcherRule == true) - { - ruleGenerationContext.CurrentVariableName = $"{previousName}.{referencedRule.GetAssignmentElementNeedingDispatcher().Property.CapitalizeFirstLetter()}"; - } - ProcessAlternatives(writer, umlClass, referencedRule?.Alternatives, ruleGenerationContext, isPartOfMultipleAlternative); ruleGenerationContext.CallerRule = previousCaller; ruleGenerationContext.CurrentVariableName = previousName; @@ -1009,33 +1297,143 @@ private static void ProcessNonTerminalElement(EncodedTextWriter writer, IClass u } else { - if (referencedRule?.IsDispatcherRule == true) + // When referencedRule is null, this is a handcoded stub (non-existing grammar rule). + // Handcoded stubs take the parent POCO, not the cursor element. + var variableToUse = referencedRule != null ? ruleGenerationContext.CurrentVariableName : "poco"; + + var emittedSameClassCondition = TryEmitOptionalCondition(writer, nonTerminalElement, referencedRule, umlClass, ruleGenerationContext, variableToUse); + + writer.WriteSafeString($"Build{nonTerminalElement.Name}({variableToUse}, cursorCache, stringBuilder);"); + + if (emittedSameClassCondition) { - if (nonTerminalElement.IsCollection) - { - var indexName = $"{referencedRule.GetAssignmentElementNeedingDispatcher().Property}Index"; - writer.WriteSafeString($"{indexName} = Build{nonTerminalElement.Name}({ruleGenerationContext.CurrentVariableName}, {indexName}, stringBuilder);"); - } - else - { - writer.WriteSafeString($"Build{nonTerminalElement.Name}({ruleGenerationContext.CurrentVariableName}, 0, stringBuilder);"); - } + writer.WriteSafeString($"{Environment.NewLine}}}"); } - else + } + + if (isForProperty && !isPartOfMultipleAlternative) + { + writer.WriteSafeString($"{Environment.NewLine}}}"); + } + } + + /// + /// Emits a while loop for a collection NonTerminal (e.g., ActionBodyItem*). + /// Resolves which POCO collection property the rule consumes by recursively tracing through + /// NonTerminal references, then emits cursor creation + while loop + per-item builder call. + /// + /// The used to write into output content + /// The related + /// The with * or + suffix + /// The resolved for the NonTerminal, or null + /// The resolved target type name for the builder class + /// The current + private static void EmitCollectionNonTerminalLoop(EncodedTextWriter writer, IClass umlClass, NonTerminalElement nonTerminalElement, TextualNotationRule referencedRule, string typeTarget, RuleGenerationContext ruleGenerationContext) + { + // Resolve which collection property this NonTerminal ultimately consumes + if (referencedRule != null) + { + var collectionPropertyNames = referencedRule.QueryCollectionPropertyNames(ruleGenerationContext.AllRules); + + if (collectionPropertyNames.Count == 1) { - writer.WriteSafeString($"Build{ nonTerminalElement.Name}({ruleGenerationContext.CurrentVariableName}, stringBuilder);"); + var propertyName = collectionPropertyNames.Single(); + var allProperties = umlClass.QueryAllProperties(); + var targetProperty = allProperties.SingleOrDefault(x => string.Equals(x.Name, propertyName, StringComparison.OrdinalIgnoreCase)); + + if (targetProperty != null && targetProperty.QueryIsEnumerable()) + { + // Ensure cursor is declared + var existingCursor = ruleGenerationContext.DefinedCursors.SingleOrDefault(x => x.IsCursorValidForProperty(targetProperty)); + string cursorVariableName; + + if (existingCursor != null) + { + cursorVariableName = existingCursor.CursorVariableName; + } + else + { + var cursorDefinition = new CursorDefinition { DefinedForProperty = targetProperty }; + var propertyAccessName = targetProperty.QueryPropertyNameBasedOnUmlProperties(); + writer.WriteSafeString($"var {cursorDefinition.CursorVariableName} = cursorCache.GetOrCreateCursor({ruleGenerationContext.CurrentVariableName}.Id, \"{targetProperty.Name}\", {ruleGenerationContext.CurrentVariableName}.{propertyAccessName});{Environment.NewLine}"); + ruleGenerationContext.DefinedCursors.Add(cursorDefinition); + cursorVariableName = cursorDefinition.CursorVariableName; + } + + // Resolve the correct builder class name for the per-item call + var perItemCall = ResolveBuilderCall(umlClass, nonTerminalElement, typeTarget, ruleGenerationContext); + + if (perItemCall != null) + { + // Emit while loop calling the per-item builder method + writer.WriteSafeString($"while ({cursorVariableName}.Current != null){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + writer.WriteSafeString(perItemCall); + writer.WriteSafeString($"{Environment.NewLine}}}{Environment.NewLine}"); + } + else + { + // Type incompatible: inline the referenced rule's alternatives inside the while loop + writer.WriteSafeString($"while ({cursorVariableName}.Current != null){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + + var previousCaller = ruleGenerationContext.CallerRule; + var previousName = ruleGenerationContext.CurrentVariableName; + ruleGenerationContext.CallerRule = nonTerminalElement; + + ProcessAlternatives(writer, umlClass, referencedRule.Alternatives, ruleGenerationContext); + + ruleGenerationContext.CallerRule = previousCaller; + ruleGenerationContext.CurrentVariableName = previousName; + + writer.WriteSafeString($"{Environment.NewLine}}}{Environment.NewLine}"); + } + + return; + } } } - if (nonTerminalElement.IsCollection && referencedRule?.IsDispatcherRule == true) + // Fallback for unresolvable cases — delegate to handcoded method + var handCodedRuleName = nonTerminalElement.TextualNotationRule?.RuleName ?? nonTerminalElement.Name; + writer.WriteSafeString($"Build{handCodedRuleName}HandCoded({ruleGenerationContext.CurrentVariableName ?? "poco"}, cursorCache, stringBuilder);{Environment.NewLine}"); + } + + /// + /// Resolves the builder method call string for a NonTerminal element, handling type targeting + /// (e.g., when ActionBodyItem : Type = means the builder lives on TypeTextualNotationBuilder). + /// Returns null when the target type is not compatible with the current poco variable + /// (e.g., when the rule targets a subclass like Package but poco is INamespace). + /// + /// The related + /// The to resolve + /// The resolved target type name + /// The current + /// A C# call expression string, or null if the types are incompatible + private static string ResolveBuilderCall(IClass umlClass, NonTerminalElement nonTerminalElement, string typeTarget, RuleGenerationContext ruleGenerationContext) + { + if (typeTarget == ruleGenerationContext.NamedElementToGenerate.Name) { - writer.WriteSafeString($"{Environment.NewLine}}}"); + return $"Build{nonTerminalElement.Name}({ruleGenerationContext.CurrentVariableName}, cursorCache, stringBuilder);"; } - if (isForProperty && !isPartOfMultipleAlternative) + var targetType = umlClass.Cache.Values.OfType().SingleOrDefault(x => x.Name == typeTarget); + + if (targetType is IClass targetClass) { - writer.WriteSafeString($"{Environment.NewLine}}}"); + // Check type compatibility: the target class must be the same as or a superclass of the current class + // e.g., Type is a superclass of AcceptActionUsage → compatible (IAcceptActionUsage IS an IType) + // e.g., Package is a subclass of Namespace → NOT compatible (INamespace is NOT an IPackage) + if (umlClass.QueryAllGeneralClassifiers().Contains(targetClass)) + { + return $"{targetType.Name}TextualNotationBuilder.Build{nonTerminalElement.Name}({ruleGenerationContext.CurrentVariableName}, cursorCache, stringBuilder);"; + } + + // Type is not compatible — caller should inline the rule alternatives + return null; } + + return $"Build{nonTerminalElement.Name}({ruleGenerationContext.CurrentVariableName}, cursorCache, stringBuilder);"; } /// @@ -1088,6 +1486,160 @@ private static void DeclareCursorIfRequired(EncodedTextWriter writer, IClass uml } } + /// + /// Terminals that should be emitted using AppendLine instead of Append, + /// because they represent structural delimiters that end a line in the textual notation. + /// + private static readonly HashSet NewLineTerminals = ["{", "}", ";"]; + + /// + /// Terminals after which no trailing space should be emitted, + /// because the next element is directly adjacent (e.g., content inside angle brackets, closing angle bracket, or the ~ prefix operator). + /// + private static readonly HashSet NoTrailingSpaceTerminals = ["<", ">", "~"]; + + /// + /// Writes the stringBuilder.Append or stringBuilder.AppendLine call for a terminal value, + /// applying formatting rules derived from the SysML v2 textual notation conventions: + /// + /// {, }, ; are emitted with AppendLine (newline after) + /// <, >, and ~ are emitted with no trailing space (adjacent to surrounding content) + /// , is emitted with a trailing space + /// Multi-character terminals (keywords) are emitted with a trailing space + /// Other single-character terminals are emitted as-is + /// + /// + /// The used to write into output content + /// The terminal string value to emit + private static void WriteTerminalAppend(EncodedTextWriter writer, string terminalValue) + { + if (NewLineTerminals.Contains(terminalValue)) + { + writer.WriteSafeString($"stringBuilder.AppendLine(\"{terminalValue}\");"); + return; + } + + if (NoTrailingSpaceTerminals.Contains(terminalValue)) + { + writer.WriteSafeString($"stringBuilder.Append(\"{terminalValue}\");"); + return; + } + + if (terminalValue.Length > 1 || terminalValue == ",") + { + writer.WriteSafeString($"stringBuilder.Append(\"{terminalValue} \");"); + return; + } + + writer.WriteSafeString($"stringBuilder.Append(\"{terminalValue}\");"); + } + + /// + /// Writes a terminal value with a leading space, used for keyword-like terminals that appear + /// as alternatives in untyped multi-alternative rules (e.g., '~' | 'conjugates'). + /// The leading space ensures visual separation from the preceding element. + /// Structural terminals ({, }, ;) still use AppendLine. + /// + /// The used to write into output content + /// The terminal string value to emit + private static void WriteTerminalAppendWithLeadingSpace(EncodedTextWriter writer, string terminalValue) + { + if (NewLineTerminals.Contains(terminalValue)) + { + writer.WriteSafeString($"stringBuilder.AppendLine(\"{terminalValue}\");"); + return; + } + + if (NoTrailingSpaceTerminals.Contains(terminalValue)) + { + writer.WriteSafeString($"stringBuilder.Append(\" {terminalValue}\");"); + return; + } + + writer.WriteSafeString($"stringBuilder.Append(\" {terminalValue} \");"); + } + + /// + /// Generates an inline condition string for an optional NonTerminal by recursively resolving + /// the referenced rule's property references and building a compound boolean expression. + /// + /// The that the optional NonTerminal references + /// The on which properties are resolved (the class the referenced rule targets) + /// All available rules for recursive resolution + /// The variable name to use in the condition (e.g., poco or poco.ownedMemberFeature) + /// The condition string (e.g., !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.OwnedRelationship.Count != 0), or null if no properties could be resolved + private static string GenerateInlineOptionalCondition(TextualNotationRule referencedRule, IClass targetClass, IReadOnlyList allRules, string variableName) + { + var propertyNames = referencedRule.QueryAllReferencedPropertyNames(allRules); + + if (propertyNames.Count == 0) + { + return null; + } + + var allProperties = targetClass.QueryAllProperties(); + var conditionParts = new List(); + + foreach (var propertyName in propertyNames) + { + var property = allProperties.FirstOrDefault(x => string.Equals(x.Name, propertyName, StringComparison.OrdinalIgnoreCase)); + + if (property == null) + { + continue; + } + + var umlPropertyName = property.QueryPropertyNameBasedOnUmlProperties(); + + if (property.QueryIsEnumerable()) + { + conditionParts.Add($"{variableName}.{umlPropertyName}.Count != 0"); + } + else + { + conditionParts.Add(property.QueryIfStatementContentForNonEmpty(variableName)); + } + } + + return conditionParts.Count != 0 ? string.Join(" || ", conditionParts) : null; + } + + /// + /// Emits an optional condition wrapping block for an optional NonTerminal element. + /// When the referenced rule has resolvable properties, emits an inline condition. + /// Otherwise emits no condition (the call proceeds unconditionally). + /// + /// The used to write into output content + /// The optional + /// The resolved , or null for handcoded stubs + /// The on which properties are resolved (the class the referenced rule targets) + /// The current + /// The variable name to use in the condition (e.g., poco or poco.ownedMemberFeature) + /// true if a condition block was opened (caller must close it), false otherwise + private static bool TryEmitOptionalCondition(EncodedTextWriter writer, NonTerminalElement nonTerminalElement, TextualNotationRule referencedRule, IClass targetClass, RuleGenerationContext ruleGenerationContext, string variableName) + { + if (!nonTerminalElement.IsOptional || nonTerminalElement.IsCollection) + { + return false; + } + + if (referencedRule == null) + { + return false; + } + + var condition = GenerateInlineOptionalCondition(referencedRule, targetClass, ruleGenerationContext.AllRules, variableName); + + if (condition == null) + { + return false; + } + + writer.WriteSafeString($"{Environment.NewLine}if ({condition}){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + return true; + } + /// /// Keeps tracks of defined cursor for enumerable /// @@ -1154,6 +1706,55 @@ public RuleGenerationContext(INamedElement namedElementToGenerate) /// Gets or sets the current name of the variable to process /// public string CurrentVariableName { get; set; } + + /// + /// Gets or sets the sibling elements of the current processing context, + /// used to determine whether a trailing space should be suppressed. + /// + public IReadOnlyList CurrentSiblingElements { get; set; } + + /// + /// Gets or sets the index of the element currently being processed + /// within . + /// + public int CurrentElementIndex { get; set; } + + /// + /// Determines whether the next sibling element is a terminal that uses AppendLine + /// (e.g., {, }, ;), in which case a trailing space would be unnecessary. + /// + /// true if the next sibling is a newline terminal; false otherwise + public bool IsNextElementNewLineTerminal() + { + if (this.CurrentSiblingElements == null) + { + return false; + } + + var nextIndex = this.CurrentElementIndex + 1; + + if (nextIndex >= this.CurrentSiblingElements.Count) + { + return false; + } + + return this.CurrentSiblingElements[nextIndex] is TerminalElement { Value: "{" or "}" or ";" }; + } + + /// + /// Determines whether the current element is the last in the sibling list, + /// meaning no more content follows and a trailing space would be unnecessary. + /// + /// true if this is the last element; false otherwise + public bool IsLastElement() + { + if (this.CurrentSiblingElements == null) + { + return false; + } + + return this.CurrentElementIndex + 1 >= this.CurrentSiblingElements.Count; + } } } } 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 index ce810be5..6c4504ed 100644 --- a/SysML2.NET.CodeGenerator/Templates/Uml/core-textual-notation-builder-template.hbs +++ b/SysML2.NET.CodeGenerator/Templates/Uml/core-textual-notation-builder-template.hbs @@ -40,6 +40,7 @@ namespace SysML2.NET.TextualNotation /// {{Rule.RawRule}} /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation public static void Build{{rule.RuleName}}({{ #NamedElement.WriteFullyQualifiedTypeName ../this.Context }} poco, ICursorCache cursorCache, StringBuilder stringBuilder) { diff --git a/SysML2.NET/TextualNotation/AcceptActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AcceptActionUsageTextualNotationBuilder.cs deleted file mode 100644 index 4a228022..00000000 --- a/SysML2.NET/TextualNotation/AcceptActionUsageTextualNotationBuilder.cs +++ /dev/null @@ -1,40 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// 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 index 2345afd7..f1cff7c3 100644 --- a/SysML2.NET/TextualNotation/ActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/ActionUsageTextualNotationBuilder.cs @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // // // Copyright 2022-2026 Starion Group S.A. @@ -20,31 +20,24 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Systems.Actions; /// - /// Hand-coded part of + /// Hand-coded part of the /// 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 + /// Builds the Textual Notation string for the rule StateActionUsage /// - /// The - /// The assertion of the condition - private static bool BuildGroupConditionForAssignmentNodeDeclaration(IActionUsage poco) + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildStateActionUsageHandCoded(IActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - return CommonTextualNotationBuilder.DoesDefinesUsageDeclaration(poco); + throw new System.NotSupportedException("BuildStateActionUsageHandCoded requires manual implementation"); } } } diff --git a/SysML2.NET/TextualNotation/AllocationUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AllocationUsageTextualNotationBuilder.cs new file mode 100644 index 00000000..0b0c695d --- /dev/null +++ b/SysML2.NET/TextualNotation/AllocationUsageTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Systems.Allocations; + + /// + /// Hand-coded part of the + /// + public static partial class AllocationUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule AllocationUsageDeclaration + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildAllocationUsageDeclarationHandCoded(IAllocationUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildAllocationUsageDeclarationHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/AssertConstraintUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AssertConstraintUsageTextualNotationBuilder.cs new file mode 100644 index 00000000..4ef2fc36 --- /dev/null +++ b/SysML2.NET/TextualNotation/AssertConstraintUsageTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Systems.Constraints; + + /// + /// Hand-coded part of the + /// + public static partial class AssertConstraintUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule AssertConstraintUsage + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildAssertConstraintUsageHandCoded(IAssertConstraintUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildAssertConstraintUsageHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/AssignmentActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AssignmentActionUsageTextualNotationBuilder.cs deleted file mode 100644 index a6aa6abc..00000000 --- a/SysML2.NET/TextualNotation/AssignmentActionUsageTextualNotationBuilder.cs +++ /dev/null @@ -1,43 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// 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 index b2b2cd5d..24491272 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.cs @@ -36,57 +36,72 @@ public static partial class AcceptActionUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule AcceptNode - /// AcceptNode:AcceptActionUsage=OccurrenceUsagePrefixAcceptNodeDeclarationActionBody + /// AcceptNode:AcceptActionUsage=OccurrenceUsagePrefixAcceptNodeDeclarationActionBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildAcceptNode(SysML2.NET.Core.POCO.Systems.Actions.IAcceptActionUsage poco, StringBuilder stringBuilder) + public static void BuildAcceptNode(SysML2.NET.Core.POCO.Systems.Actions.IAcceptActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); - BuildAcceptNodeDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, cursorCache, stringBuilder); + BuildAcceptNodeDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildActionBody(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule AcceptNodeDeclaration - /// AcceptNodeDeclaration:AcceptActionUsage=ActionNodeUsageDeclaration?'accept'AcceptParameterPart + /// AcceptNodeDeclaration:AcceptActionUsage=ActionNodeUsageDeclaration?'accept'AcceptParameterPart /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildAcceptNodeDeclaration(SysML2.NET.Core.POCO.Systems.Actions.IAcceptActionUsage poco, StringBuilder stringBuilder) + public static void BuildAcceptNodeDeclaration(SysML2.NET.Core.POCO.Systems.Actions.IAcceptActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - ActionUsageTextualNotationBuilder.BuildActionNodeUsageDeclaration(poco, stringBuilder); + + if (!string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || poco.IsOrdered) + { + ActionUsageTextualNotationBuilder.BuildActionNodeUsageDeclaration(poco, cursorCache, stringBuilder); + } stringBuilder.Append("accept "); - BuildAcceptParameterPart(poco, stringBuilder); + BuildAcceptParameterPart(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule AcceptParameterPart - /// AcceptParameterPart:AcceptActionUsage=ownedRelationship+=PayloadParameterMember('via'ownedRelationship+=NodeParameterMember)? + /// AcceptParameterPart:AcceptActionUsage=ownedRelationship+=PayloadParameterMember('via'ownedRelationship+=NodeParameterMember)? /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildAcceptParameterPart(SysML2.NET.Core.POCO.Systems.Actions.IAcceptActionUsage poco, StringBuilder stringBuilder) + public static void BuildAcceptParameterPart(SysML2.NET.Core.POCO.Systems.Actions.IAcceptActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfParameterMembershipIterator.MoveNext(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildPayloadParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildPayloadParameterMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + - if (ownedRelationshipOfParameterMembershipIterator.MoveNext()) + if (ownedRelationshipCursor.Current != null) { stringBuilder.Append("via "); - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } - stringBuilder.Append(' '); } @@ -94,49 +109,52 @@ public static void BuildAcceptParameterPart(SysML2.NET.Core.POCO.Systems.Actions /// /// Builds the Textual Notation string for the rule StateAcceptActionUsage - /// StateAcceptActionUsage:AcceptActionUsage=AcceptNodeDeclarationActionBody + /// StateAcceptActionUsage:AcceptActionUsage=AcceptNodeDeclarationActionBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildStateAcceptActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IAcceptActionUsage poco, StringBuilder stringBuilder) + public static void BuildStateAcceptActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IAcceptActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildAcceptNodeDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); + BuildAcceptNodeDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildActionBody(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule TriggerAction - /// TriggerAction:AcceptActionUsage=AcceptParameterPart + /// TriggerAction:AcceptActionUsage=AcceptParameterPart /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildTriggerAction(SysML2.NET.Core.POCO.Systems.Actions.IAcceptActionUsage poco, StringBuilder stringBuilder) + public static void BuildTriggerAction(SysML2.NET.Core.POCO.Systems.Actions.IAcceptActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildAcceptParameterPart(poco, stringBuilder); + BuildAcceptParameterPart(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule TransitionAcceptActionUsage - /// TransitionAcceptActionUsage:AcceptActionUsage=AcceptNodeDeclaration('{'ActionBodyItem*'}')? + /// TransitionAcceptActionUsage:AcceptActionUsage=AcceptNodeDeclaration('{'ActionBodyItem*'}')? /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildTransitionAcceptActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IAcceptActionUsage poco, StringBuilder stringBuilder) + public static void BuildTransitionAcceptActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IAcceptActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildAcceptNodeDeclaration(poco, stringBuilder); + BuildAcceptNodeDeclaration(poco, cursorCache, stringBuilder); - if (BuildGroupConditionForTransitionAcceptActionUsage(poco)) + if (poco.OwnedRelationship.Count != 0 || poco.importedMembership.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || !string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.Direction.HasValue || poco.IsDerived || poco.IsAbstract || poco.IsVariation || poco.IsConstant || poco.IsOrdered || poco.IsEnd || poco.isReference || poco.IsIndividual || poco.PortionKind.HasValue || poco.IsComposite || poco.IsPortion || poco.IsVariable || poco.IsSufficient || poco.unioningType.Count != 0 || poco.intersectingType.Count != 0 || poco.differencingType.Count != 0 || poco.featuringType.Count != 0 || poco.ownedTypeFeaturing.Count != 0) { - stringBuilder.Append("{"); - // Handle collection Non Terminal - for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + stringBuilder.AppendLine("{"); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + while (ownedRelationshipCursor.Current != null) { - ownedRelationshipIndex = TypeTextualNotationBuilder.BuildActionBodyItem(poco, ownedRelationshipIndex, stringBuilder); + TypeTextualNotationBuilder.BuildActionBodyItem(poco, cursorCache, stringBuilder); } - stringBuilder.Append("}"); - stringBuilder.Append(' '); + + stringBuilder.AppendLine("}"); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionDefinitionTextualNotationBuilder.cs index c92602c5..6e107d0b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionDefinitionTextualNotationBuilder.cs @@ -36,17 +36,18 @@ public static partial class ActionDefinitionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule ActionDefinition - /// ActionDefinition=OccurrenceDefinitionPrefix'action''def'DefinitionDeclarationActionBody + /// ActionDefinition=OccurrenceDefinitionPrefix'action''def'DefinitionDeclarationActionBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildActionDefinition(SysML2.NET.Core.POCO.Systems.Actions.IActionDefinition poco, StringBuilder stringBuilder) + public static void BuildActionDefinition(SysML2.NET.Core.POCO.Systems.Actions.IActionDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("action "); stringBuilder.Append("def "); - DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildActionBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs index a8681f46..501a7491 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs @@ -36,50 +36,56 @@ public static partial class ActionUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule ActionUsageDeclaration - /// ActionUsageDeclaration:ActionUsage=UsageDeclarationValuePart? + /// ActionUsageDeclaration:ActionUsage=UsageDeclarationValuePart? /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildActionUsageDeclaration(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, StringBuilder stringBuilder) + public static void BuildActionUsageDeclaration(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); - FeatureTextualNotationBuilder.BuildValuePart(poco, 0, stringBuilder); + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, cursorCache, stringBuilder); + + if (poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || !string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.Direction.HasValue || poco.IsDerived || poco.IsAbstract || poco.IsConstant || poco.IsOrdered || poco.IsEnd || poco.importedMembership.Count != 0 || poco.IsComposite || poco.IsPortion || poco.IsVariable || poco.IsSufficient || poco.unioningType.Count != 0 || poco.intersectingType.Count != 0 || poco.differencingType.Count != 0 || poco.featuringType.Count != 0 || poco.ownedTypeFeaturing.Count != 0) + { + FeatureTextualNotationBuilder.BuildValuePart(poco, cursorCache, stringBuilder); + } } /// /// Builds the Textual Notation string for the rule ActionNode - /// ActionNode:ActionUsage=ControlNode|SendNode|AcceptNode|AssignmentNode|TerminateNode|IfNode|WhileLoopNode|ForLoopNode + /// ActionNode:ActionUsage=ControlNode|SendNode|AcceptNode|AssignmentNode|TerminateNode|IfNode|WhileLoopNode|ForLoopNode /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildActionNode(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, StringBuilder stringBuilder) + public static void BuildActionNode(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { switch (poco) { - case SysML2.NET.Core.POCO.Systems.Actions.IControlNode pocoControlNode: - ControlNodeTextualNotationBuilder.BuildControlNode(pocoControlNode, stringBuilder); + case SysML2.NET.Core.POCO.Systems.Actions.IWhileLoopActionUsage pocoWhileLoopActionUsage: + WhileLoopActionUsageTextualNotationBuilder.BuildWhileLoopNode(pocoWhileLoopActionUsage, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Actions.SendActionUsage pocoSendActionUsage: - SendActionUsageTextualNotationBuilder.BuildSendNode(pocoSendActionUsage, stringBuilder); + case SysML2.NET.Core.POCO.Systems.Actions.IForLoopActionUsage pocoForLoopActionUsage: + ForLoopActionUsageTextualNotationBuilder.BuildForLoopNode(pocoForLoopActionUsage, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Actions.AcceptActionUsage pocoAcceptActionUsage: - AcceptActionUsageTextualNotationBuilder.BuildAcceptNode(pocoAcceptActionUsage, stringBuilder); + case SysML2.NET.Core.POCO.Systems.Actions.IControlNode pocoControlNode: + ControlNodeTextualNotationBuilder.BuildControlNode(pocoControlNode, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Actions.AssignmentActionUsage pocoAssignmentActionUsage: - AssignmentActionUsageTextualNotationBuilder.BuildAssignmentNode(pocoAssignmentActionUsage, stringBuilder); + case SysML2.NET.Core.POCO.Systems.Actions.ISendActionUsage pocoSendActionUsage: + SendActionUsageTextualNotationBuilder.BuildSendNode(pocoSendActionUsage, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Actions.TerminateActionUsage pocoTerminateActionUsage: - TerminateActionUsageTextualNotationBuilder.BuildTerminateNode(pocoTerminateActionUsage, stringBuilder); + case SysML2.NET.Core.POCO.Systems.Actions.IAcceptActionUsage pocoAcceptActionUsage: + AcceptActionUsageTextualNotationBuilder.BuildAcceptNode(pocoAcceptActionUsage, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Actions.IfActionUsage pocoIfActionUsage: - IfActionUsageTextualNotationBuilder.BuildIfNode(pocoIfActionUsage, stringBuilder); + case SysML2.NET.Core.POCO.Systems.Actions.IAssignmentActionUsage pocoAssignmentActionUsage: + AssignmentActionUsageTextualNotationBuilder.BuildAssignmentNode(pocoAssignmentActionUsage, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Actions.WhileLoopActionUsage pocoWhileLoopActionUsage: - WhileLoopActionUsageTextualNotationBuilder.BuildWhileLoopNode(pocoWhileLoopActionUsage, stringBuilder); + case SysML2.NET.Core.POCO.Systems.Actions.ITerminateActionUsage pocoTerminateActionUsage: + TerminateActionUsageTextualNotationBuilder.BuildTerminateNode(pocoTerminateActionUsage, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Actions.ForLoopActionUsage pocoForLoopActionUsage: - ForLoopActionUsageTextualNotationBuilder.BuildForLoopNode(pocoForLoopActionUsage, stringBuilder); + case SysML2.NET.Core.POCO.Systems.Actions.IIfActionUsage pocoIfActionUsage: + IfActionUsageTextualNotationBuilder.BuildIfNode(pocoIfActionUsage, cursorCache, stringBuilder); break; } @@ -87,142 +93,175 @@ public static void BuildActionNode(SysML2.NET.Core.POCO.Systems.Actions.IActionU /// /// Builds the Textual Notation string for the rule ActionNodeUsageDeclaration - /// ActionNodeUsageDeclaration:ActionUsage='action'UsageDeclaration? + /// ActionNodeUsageDeclaration:ActionUsage='action'UsageDeclaration? /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildActionNodeUsageDeclaration(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, StringBuilder stringBuilder) + public static void BuildActionNodeUsageDeclaration(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { stringBuilder.Append("action "); - UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + + if (!string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || poco.IsOrdered) + { + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, cursorCache, stringBuilder); + } } /// /// Builds the Textual Notation string for the rule ActionNodePrefix - /// ActionNodePrefix:ActionUsage=OccurrenceUsagePrefixActionNodeUsageDeclaration? + /// ActionNodePrefix:ActionUsage=OccurrenceUsagePrefixActionNodeUsageDeclaration? /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildActionNodePrefix(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, StringBuilder stringBuilder) + public static void BuildActionNodePrefix(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); - BuildActionNodeUsageDeclaration(poco, stringBuilder); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, cursorCache, stringBuilder); + + if (!string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || poco.IsOrdered) + { + BuildActionNodeUsageDeclaration(poco, cursorCache, stringBuilder); + } } /// /// Builds the Textual Notation string for the rule AssignmentNodeDeclaration - /// AssignmentNodeDeclaration:ActionUsage=(ActionNodeUsageDeclaration)?'assign'ownedRelationship+=AssignmentTargetMemberownedRelationship+=FeatureChainMember':='ownedRelationship+=NodeParameterMember + /// AssignmentNodeDeclaration:ActionUsage=(ActionNodeUsageDeclaration)?'assign'ownedRelationship+=AssignmentTargetMemberownedRelationship+=FeatureChainMember':='ownedRelationship+=NodeParameterMember /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildAssignmentNodeDeclaration(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, StringBuilder stringBuilder) + public static void BuildAssignmentNodeDeclaration(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - using var ownedRelationshipOfMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (BuildGroupConditionForAssignmentNodeDeclaration(poco)) + if (!string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || poco.IsOrdered) { - BuildActionNodeUsageDeclaration(poco, stringBuilder); + BuildActionNodeUsageDeclaration(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); } stringBuilder.Append("assign "); - ownedRelationshipOfParameterMembershipIterator.MoveNext(); - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildAssignmentTargetMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildAssignmentTargetMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } - ownedRelationshipOfMembershipIterator.MoveNext(); + ownedRelationshipCursor.Move(); + - if (ownedRelationshipOfMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - MembershipTextualNotationBuilder.BuildFeatureChainMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IMembership elementAsMembership) + { + MembershipTextualNotationBuilder.BuildFeatureChainMember(elementAsMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + stringBuilder.Append(":= "); - ownedRelationshipOfParameterMembershipIterator.MoveNext(); - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } /// /// Builds the Textual Notation string for the rule ActionBodyParameter - /// ActionBodyParameter:ActionUsage=('action'UsageDeclaration?)?'{'ActionBodyItem*'}' + /// ActionBodyParameter:ActionUsage=('action'UsageDeclaration?)?'{'ActionBodyItem*'}' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildActionBodyParameter(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, StringBuilder stringBuilder) + public static void BuildActionBodyParameter(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (BuildGroupConditionForActionBodyParameter(poco)) + if (!string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || poco.IsOrdered) { stringBuilder.Append("action "); - UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); - stringBuilder.Append(' '); + + if (!string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || poco.IsOrdered) + { + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, cursorCache, stringBuilder); + } } - stringBuilder.Append("{"); - // Handle collection Non Terminal - for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + stringBuilder.AppendLine("{"); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + while (ownedRelationshipCursor.Current != null) { - ownedRelationshipIndex = TypeTextualNotationBuilder.BuildActionBodyItem(poco, ownedRelationshipIndex, stringBuilder); + TypeTextualNotationBuilder.BuildActionBodyItem(poco, cursorCache, stringBuilder); } - stringBuilder.Append("}"); + + stringBuilder.AppendLine("}"); } /// /// Builds the Textual Notation string for the rule StateActionUsage - /// StateActionUsage:ActionUsage=EmptyActionUsage';'|StatePerformActionUsage|StateAcceptActionUsage|StateSendActionUsage|StateAssignmentActionUsage + /// StateActionUsage:ActionUsage=EmptyActionUsage';'|StatePerformActionUsage|StateAcceptActionUsage|StateSendActionUsage|StateAssignmentActionUsage /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildStateActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, StringBuilder stringBuilder) + public static void BuildStateActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildStateActionUsageHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule EmptyActionUsage - /// EmptyActionUsage:ActionUsage={} + /// EmptyActionUsage:ActionUsage={} /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildEmptyActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, StringBuilder stringBuilder) + public static void BuildEmptyActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { } /// /// Builds the Textual Notation string for the rule EffectBehaviorUsage - /// EffectBehaviorUsage:ActionUsage=EmptyActionUsage|TransitionPerformActionUsage|TransitionAcceptActionUsage|TransitionSendActionUsage|TransitionAssignmentActionUsage + /// EffectBehaviorUsage:ActionUsage=EmptyActionUsage|TransitionPerformActionUsage|TransitionAcceptActionUsage|TransitionSendActionUsage|TransitionAssignmentActionUsage /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildEffectBehaviorUsage(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, StringBuilder stringBuilder) + public static void BuildEffectBehaviorUsage(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { switch (poco) { - case SysML2.NET.Core.POCO.Systems.Actions.PerformActionUsage pocoPerformActionUsage: - PerformActionUsageTextualNotationBuilder.BuildTransitionPerformActionUsage(pocoPerformActionUsage, stringBuilder); + case SysML2.NET.Core.POCO.Systems.Actions.IPerformActionUsage pocoPerformActionUsage: + PerformActionUsageTextualNotationBuilder.BuildTransitionPerformActionUsage(pocoPerformActionUsage, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Actions.AcceptActionUsage pocoAcceptActionUsage: - AcceptActionUsageTextualNotationBuilder.BuildTransitionAcceptActionUsage(pocoAcceptActionUsage, stringBuilder); + case SysML2.NET.Core.POCO.Systems.Actions.IAcceptActionUsage pocoAcceptActionUsage: + AcceptActionUsageTextualNotationBuilder.BuildTransitionAcceptActionUsage(pocoAcceptActionUsage, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Actions.SendActionUsage pocoSendActionUsage: - SendActionUsageTextualNotationBuilder.BuildTransitionSendActionUsage(pocoSendActionUsage, stringBuilder); + case SysML2.NET.Core.POCO.Systems.Actions.ISendActionUsage pocoSendActionUsage: + SendActionUsageTextualNotationBuilder.BuildTransitionSendActionUsage(pocoSendActionUsage, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Actions.AssignmentActionUsage pocoAssignmentActionUsage: - AssignmentActionUsageTextualNotationBuilder.BuildTransitionAssignmentActionUsage(pocoAssignmentActionUsage, stringBuilder); + case SysML2.NET.Core.POCO.Systems.Actions.IAssignmentActionUsage pocoAssignmentActionUsage: + AssignmentActionUsageTextualNotationBuilder.BuildTransitionAssignmentActionUsage(pocoAssignmentActionUsage, cursorCache, stringBuilder); break; default: - BuildEmptyActionUsage(poco, stringBuilder); + BuildEmptyActionUsage(poco, cursorCache, stringBuilder); break; } @@ -230,16 +269,17 @@ public static void BuildEffectBehaviorUsage(SysML2.NET.Core.POCO.Systems.Actions /// /// Builds the Textual Notation string for the rule ActionUsage - /// ActionUsage=OccurrenceUsagePrefix'action'ActionUsageDeclarationActionBody + /// ActionUsage=OccurrenceUsagePrefix'action'ActionUsageDeclarationActionBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, StringBuilder stringBuilder) + public static void BuildActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("action "); - BuildActionUsageDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); + BuildActionUsageDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildActionBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActorMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActorMembershipTextualNotationBuilder.cs index df86fc37..f1818e57 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActorMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActorMembershipTextualNotationBuilder.cs @@ -36,20 +36,26 @@ public static partial class ActorMembershipTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule ActorMember - /// ActorMember:ActorMembership=MemberPrefixownedRelatedElement+=ActorUsage + /// ActorMember:ActorMembership=MemberPrefixownedRelatedElement+=ActorUsage /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildActorMember(SysML2.NET.Core.POCO.Systems.Requirements.IActorMembership poco, StringBuilder stringBuilder) + public static void BuildActorMember(SysML2.NET.Core.POCO.Systems.Requirements.IActorMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfPartUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - ownedRelatedElementOfPartUsageIterator.MoveNext(); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); - if (ownedRelatedElementOfPartUsageIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - PartUsageTextualNotationBuilder.BuildActorUsage(ownedRelatedElementOfPartUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.Parts.IPartUsage elementAsPartUsage) + { + PartUsageTextualNotationBuilder.BuildActorUsage(elementAsPartUsage, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationDefinitionTextualNotationBuilder.cs index ff58ecec..b01fce0c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationDefinitionTextualNotationBuilder.cs @@ -36,16 +36,17 @@ public static partial class AllocationDefinitionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule AllocationDefinition - /// AllocationDefinition=OccurrenceDefinitionPrefix'allocation''def'Definition + /// AllocationDefinition=OccurrenceDefinitionPrefix'allocation''def'Definition /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildAllocationDefinition(SysML2.NET.Core.POCO.Systems.Allocations.IAllocationDefinition poco, StringBuilder stringBuilder) + public static void BuildAllocationDefinition(SysML2.NET.Core.POCO.Systems.Allocations.IAllocationDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("allocation "); stringBuilder.Append("def "); - DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); + DefinitionTextualNotationBuilder.BuildDefinition(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationUsageTextualNotationBuilder.cs index 650f7ef7..730751e6 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AllocationUsageTextualNotationBuilder.cs @@ -36,26 +36,28 @@ public static partial class AllocationUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule AllocationUsageDeclaration - /// AllocationUsageDeclaration:AllocationUsage='allocation'UsageDeclaration('allocate'ConnectorPart)?|'allocate'ConnectorPart + /// AllocationUsageDeclaration:AllocationUsage='allocation'UsageDeclaration('allocate'ConnectorPart)?|'allocate'ConnectorPart /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildAllocationUsageDeclaration(SysML2.NET.Core.POCO.Systems.Allocations.IAllocationUsage poco, StringBuilder stringBuilder) + public static void BuildAllocationUsageDeclaration(SysML2.NET.Core.POCO.Systems.Allocations.IAllocationUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildAllocationUsageDeclarationHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule AllocationUsage - /// AllocationUsage=OccurrenceUsagePrefixAllocationUsageDeclarationUsageBody + /// AllocationUsage=OccurrenceUsagePrefixAllocationUsageDeclarationUsageBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildAllocationUsage(SysML2.NET.Core.POCO.Systems.Allocations.IAllocationUsage poco, StringBuilder stringBuilder) + public static void BuildAllocationUsage(SysML2.NET.Core.POCO.Systems.Allocations.IAllocationUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); - BuildAllocationUsageDeclaration(poco, stringBuilder); - UsageTextualNotationBuilder.BuildUsageBody(poco, stringBuilder); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, cursorCache, stringBuilder); + BuildAllocationUsageDeclaration(poco, cursorCache, stringBuilder); + UsageTextualNotationBuilder.BuildUsageBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseDefinitionTextualNotationBuilder.cs index cfca3f93..ec6dd16c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseDefinitionTextualNotationBuilder.cs @@ -36,17 +36,18 @@ public static partial class AnalysisCaseDefinitionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule AnalysisCaseDefinition - /// AnalysisCaseDefinition=OccurrenceDefinitionPrefix'analysis''def'DefinitionDeclarationCaseBody + /// AnalysisCaseDefinition=OccurrenceDefinitionPrefix'analysis''def'DefinitionDeclarationCaseBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildAnalysisCaseDefinition(SysML2.NET.Core.POCO.Systems.AnalysisCases.IAnalysisCaseDefinition poco, StringBuilder stringBuilder) + public static void BuildAnalysisCaseDefinition(SysML2.NET.Core.POCO.Systems.AnalysisCases.IAnalysisCaseDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("analysis "); stringBuilder.Append("def "); - DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildCaseBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseUsageTextualNotationBuilder.cs index ee7d8077..3ac1df36 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnalysisCaseUsageTextualNotationBuilder.cs @@ -36,18 +36,23 @@ public static partial class AnalysisCaseUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule AnalysisCaseUsage - /// AnalysisCaseUsage=OccurrenceUsagePrefix'analysis'ConstraintUsageDeclarationCaseBody + /// AnalysisCaseUsage=OccurrenceUsagePrefix'analysis'ConstraintUsageDeclarationCaseBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildAnalysisCaseUsage(SysML2.NET.Core.POCO.Systems.AnalysisCases.IAnalysisCaseUsage poco, StringBuilder stringBuilder) + public static void BuildAnalysisCaseUsage(SysML2.NET.Core.POCO.Systems.AnalysisCases.IAnalysisCaseUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("analysis "); - UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); - FeatureTextualNotationBuilder.BuildValuePart(poco, 0, stringBuilder); + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, cursorCache, stringBuilder); - TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); + if (poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || !string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.Direction.HasValue || poco.IsDerived || poco.IsAbstract || poco.IsConstant || poco.IsOrdered || poco.IsEnd || poco.importedMembership.Count != 0 || poco.IsComposite || poco.IsPortion || poco.IsVariable || poco.IsSufficient || poco.unioningType.Count != 0 || poco.intersectingType.Count != 0 || poco.differencingType.Count != 0 || poco.featuringType.Count != 0 || poco.ownedTypeFeaturing.Count != 0) + { + FeatureTextualNotationBuilder.BuildValuePart(poco, cursorCache, stringBuilder); + } + + TypeTextualNotationBuilder.BuildCaseBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotatingElementTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotatingElementTextualNotationBuilder.cs index 59aebfaa..d29bccc5 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotatingElementTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotatingElementTextualNotationBuilder.cs @@ -36,25 +36,26 @@ public static partial class AnnotatingElementTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule AnnotatingElement - /// AnnotatingElement=Comment|Documentation|TextualRepresentation|MetadataFeature + /// AnnotatingElement=Comment|Documentation|TextualRepresentation|MetadataFeature /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildAnnotatingElement(SysML2.NET.Core.POCO.Root.Annotations.IAnnotatingElement poco, StringBuilder stringBuilder) + public static void BuildAnnotatingElement(SysML2.NET.Core.POCO.Root.Annotations.IAnnotatingElement poco, ICursorCache cursorCache, StringBuilder stringBuilder) { switch (poco) { - case SysML2.NET.Core.POCO.Root.Annotations.Documentation pocoDocumentation: - DocumentationTextualNotationBuilder.BuildDocumentation(pocoDocumentation, stringBuilder); + case SysML2.NET.Core.POCO.Kernel.Metadata.IMetadataFeature pocoMetadataFeature: + MetadataFeatureTextualNotationBuilder.BuildMetadataFeature(pocoMetadataFeature, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Root.Annotations.Comment pocoComment: - CommentTextualNotationBuilder.BuildComment(pocoComment, stringBuilder); + case SysML2.NET.Core.POCO.Root.Annotations.IDocumentation pocoDocumentation: + DocumentationTextualNotationBuilder.BuildDocumentation(pocoDocumentation, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Root.Annotations.TextualRepresentation pocoTextualRepresentation: - TextualRepresentationTextualNotationBuilder.BuildTextualRepresentation(pocoTextualRepresentation, stringBuilder); + case SysML2.NET.Core.POCO.Root.Annotations.IComment pocoComment: + CommentTextualNotationBuilder.BuildComment(pocoComment, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Kernel.Metadata.MetadataFeature pocoMetadataFeature: - MetadataFeatureTextualNotationBuilder.BuildMetadataFeature(pocoMetadataFeature, stringBuilder); + case SysML2.NET.Core.POCO.Root.Annotations.ITextualRepresentation pocoTextualRepresentation: + TextualRepresentationTextualNotationBuilder.BuildTextualRepresentation(pocoTextualRepresentation, cursorCache, stringBuilder); break; } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.cs index 7b70bec2..d61c95cc 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AnnotationTextualNotationBuilder.cs @@ -24,7 +24,6 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; @@ -37,45 +36,53 @@ public static partial class AnnotationTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule OwnedAnnotation - /// OwnedAnnotation:Annotation=ownedRelatedElement+=AnnotatingElement + /// OwnedAnnotation:Annotation=ownedRelatedElement+=AnnotatingElement /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildOwnedAnnotation(SysML2.NET.Core.POCO.Root.Annotations.IAnnotation poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildOwnedAnnotation(SysML2.NET.Core.POCO.Root.Annotations.IAnnotation poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelatedElement.Count) + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Root.Annotations.IAnnotatingElement elementAsAnnotatingElement) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Root.Annotations.IAnnotatingElement elementAsAnnotatingElement) { - AnnotatingElementTextualNotationBuilder.BuildAnnotatingElement(elementAsAnnotatingElement, stringBuilder); + AnnotatingElementTextualNotationBuilder.BuildAnnotatingElement(elementAsAnnotatingElement, cursorCache, stringBuilder); } } + ownedRelatedElementCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule PrefixMetadataAnnotation - /// PrefixMetadataAnnotation:Annotation='#'annotatingElement=PrefixMetadataUsage{ownedRelatedElement+=annotatingElement} + /// PrefixMetadataAnnotation:Annotation='#'annotatingElement=PrefixMetadataUsage{ownedRelatedElement+=annotatingElement} /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildPrefixMetadataAnnotation(SysML2.NET.Core.POCO.Root.Annotations.IAnnotation poco, StringBuilder stringBuilder) + public static void BuildPrefixMetadataAnnotation(SysML2.NET.Core.POCO.Root.Annotations.IAnnotation poco, ICursorCache cursorCache, StringBuilder stringBuilder) { stringBuilder.Append("#"); if (poco.annotatingElement != null) { - var elementForOwnedRelationship = poco.annotatingElement.OwnedRelationship[0]; + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Core.Features.IFeatureTyping elementAsFeatureTyping) + if (ownedRelationshipCursor.Current != null) { - FeatureTypingTextualNotationBuilder.BuildOwnedFeatureTyping(elementAsFeatureTyping, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IFeatureTyping elementAsFeatureTyping) + { + FeatureTypingTextualNotationBuilder.BuildOwnedFeatureTyping(elementAsFeatureTyping, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } // NonParsing Assignment Element : ownedRelatedElement += annotatingElement => Does not have to be process @@ -84,11 +91,12 @@ public static void BuildPrefixMetadataAnnotation(SysML2.NET.Core.POCO.Root.Annot /// /// Builds the Textual Notation string for the rule Annotation - /// Annotation=annotatedElement=[QualifiedName] + /// Annotation=annotatedElement=[QualifiedName] /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildAnnotation(SysML2.NET.Core.POCO.Root.Annotations.IAnnotation poco, StringBuilder stringBuilder) + public static void BuildAnnotation(SysML2.NET.Core.POCO.Root.Annotations.IAnnotation poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.AnnotatedElement != null) diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssertConstraintUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssertConstraintUsageTextualNotationBuilder.cs index b970704c..dcb1dea9 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssertConstraintUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssertConstraintUsageTextualNotationBuilder.cs @@ -36,14 +36,15 @@ public static partial class AssertConstraintUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule AssertConstraintUsage - /// AssertConstraintUsage=OccurrenceUsagePrefix'assert'(isNegated?='not')?(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'constraint'ConstraintUsageDeclaration)CalculationBody + /// AssertConstraintUsage=OccurrenceUsagePrefix'assert'(isNegated?='not')?(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'constraint'ConstraintUsageDeclaration)CalculationBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildAssertConstraintUsage(SysML2.NET.Core.POCO.Systems.Constraints.IAssertConstraintUsage poco, StringBuilder stringBuilder) + public static void BuildAssertConstraintUsage(SysML2.NET.Core.POCO.Systems.Constraints.IAssertConstraintUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfReferenceSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("assert "); if (poco.IsNegated) @@ -52,9 +53,9 @@ public static void BuildAssertConstraintUsage(SysML2.NET.Core.POCO.Systems.Const stringBuilder.Append(' '); } - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildAssertConstraintUsageHandCoded(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); - TypeTextualNotationBuilder.BuildCalculationBody(poco, stringBuilder); + TypeTextualNotationBuilder.BuildCalculationBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssignmentActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssignmentActionUsageTextualNotationBuilder.cs index b592c9e3..b74269dc 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssignmentActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssignmentActionUsageTextualNotationBuilder.cs @@ -36,51 +36,54 @@ public static partial class AssignmentActionUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule AssignmentNode - /// AssignmentNode:AssignmentActionUsage=OccurrenceUsagePrefixAssignmentNodeDeclarationActionBody + /// AssignmentNode:AssignmentActionUsage=OccurrenceUsagePrefixAssignmentNodeDeclarationActionBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildAssignmentNode(SysML2.NET.Core.POCO.Systems.Actions.IAssignmentActionUsage poco, StringBuilder stringBuilder) + public static void BuildAssignmentNode(SysML2.NET.Core.POCO.Systems.Actions.IAssignmentActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); - ActionUsageTextualNotationBuilder.BuildAssignmentNodeDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, cursorCache, stringBuilder); + ActionUsageTextualNotationBuilder.BuildAssignmentNodeDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildActionBody(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule StateAssignmentActionUsage - /// StateAssignmentActionUsage:AssignmentActionUsage=AssignmentNodeDeclarationActionBody + /// StateAssignmentActionUsage:AssignmentActionUsage=AssignmentNodeDeclarationActionBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildStateAssignmentActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IAssignmentActionUsage poco, StringBuilder stringBuilder) + public static void BuildStateAssignmentActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IAssignmentActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - ActionUsageTextualNotationBuilder.BuildAssignmentNodeDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); + ActionUsageTextualNotationBuilder.BuildAssignmentNodeDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildActionBody(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule TransitionAssignmentActionUsage - /// TransitionAssignmentActionUsage:AssignmentActionUsage=AssignmentNodeDeclaration('{'ActionBodyItem*'}')? + /// TransitionAssignmentActionUsage:AssignmentActionUsage=AssignmentNodeDeclaration('{'ActionBodyItem*'}')? /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildTransitionAssignmentActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IAssignmentActionUsage poco, StringBuilder stringBuilder) + public static void BuildTransitionAssignmentActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IAssignmentActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - ActionUsageTextualNotationBuilder.BuildAssignmentNodeDeclaration(poco, stringBuilder); + ActionUsageTextualNotationBuilder.BuildAssignmentNodeDeclaration(poco, cursorCache, stringBuilder); - if (BuildGroupConditionForTransitionAssignmentActionUsage(poco)) + if (poco.OwnedRelationship.Count != 0 || poco.importedMembership.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || !string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.Direction.HasValue || poco.IsDerived || poco.IsAbstract || poco.IsVariation || poco.IsConstant || poco.IsOrdered || poco.IsEnd || poco.isReference || poco.IsIndividual || poco.PortionKind.HasValue || poco.IsComposite || poco.IsPortion || poco.IsVariable || poco.IsSufficient || poco.unioningType.Count != 0 || poco.intersectingType.Count != 0 || poco.differencingType.Count != 0 || poco.featuringType.Count != 0 || poco.ownedTypeFeaturing.Count != 0) { - stringBuilder.Append("{"); - // Handle collection Non Terminal - for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + stringBuilder.AppendLine("{"); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + while (ownedRelationshipCursor.Current != null) { - ownedRelationshipIndex = TypeTextualNotationBuilder.BuildActionBodyItem(poco, ownedRelationshipIndex, stringBuilder); + TypeTextualNotationBuilder.BuildActionBodyItem(poco, cursorCache, stringBuilder); } - stringBuilder.Append("}"); - stringBuilder.Append(' '); + + stringBuilder.AppendLine("}"); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationStructureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationStructureTextualNotationBuilder.cs index ff949da0..d325de65 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationStructureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationStructureTextualNotationBuilder.cs @@ -36,17 +36,18 @@ public static partial class AssociationStructureTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule AssociationStructure - /// AssociationStructure=TypePrefix'assoc''struct'ClassifierDeclarationTypeBody + /// AssociationStructure=TypePrefix'assoc''struct'ClassifierDeclarationTypeBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildAssociationStructure(SysML2.NET.Core.POCO.Kernel.Associations.IAssociationStructure poco, StringBuilder stringBuilder) + public static void BuildAssociationStructure(SysML2.NET.Core.POCO.Kernel.Associations.IAssociationStructure poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); + TypeTextualNotationBuilder.BuildTypePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("assoc "); stringBuilder.Append("struct "); - ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); + ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildTypeBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationTextualNotationBuilder.cs index c9c173a3..94eddcf7 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssociationTextualNotationBuilder.cs @@ -36,16 +36,17 @@ public static partial class AssociationTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule Association - /// Association=TypePrefix'assoc'ClassifierDeclarationTypeBody + /// Association=TypePrefix'assoc'ClassifierDeclarationTypeBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildAssociation(SysML2.NET.Core.POCO.Kernel.Associations.IAssociation poco, StringBuilder stringBuilder) + public static void BuildAssociation(SysML2.NET.Core.POCO.Kernel.Associations.IAssociation poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); + TypeTextualNotationBuilder.BuildTypePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("assoc "); - ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); + ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildTypeBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeDefinitionTextualNotationBuilder.cs index 5f2260a7..fd645a85 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeDefinitionTextualNotationBuilder.cs @@ -36,16 +36,17 @@ public static partial class AttributeDefinitionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule AttributeDefinition - /// AttributeDefinition:AttributeDefinition=DefinitionPrefix'attribute''def'Definition + /// AttributeDefinition:AttributeDefinition=DefinitionPrefix'attribute''def'Definition /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildAttributeDefinition(SysML2.NET.Core.POCO.Systems.Attributes.IAttributeDefinition poco, StringBuilder stringBuilder) + public static void BuildAttributeDefinition(SysML2.NET.Core.POCO.Systems.Attributes.IAttributeDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - DefinitionTextualNotationBuilder.BuildDefinitionPrefix(poco, stringBuilder); + DefinitionTextualNotationBuilder.BuildDefinitionPrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("attribute "); stringBuilder.Append("def "); - DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); + DefinitionTextualNotationBuilder.BuildDefinition(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeUsageTextualNotationBuilder.cs index 1be2d1f5..903a2b11 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AttributeUsageTextualNotationBuilder.cs @@ -36,15 +36,16 @@ public static partial class AttributeUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule AttributeUsage - /// AttributeUsage:AttributeUsage=UsagePrefix'attribute'Usage + /// AttributeUsage:AttributeUsage=UsagePrefix'attribute'Usage /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildAttributeUsage(SysML2.NET.Core.POCO.Systems.Attributes.IAttributeUsage poco, StringBuilder stringBuilder) + public static void BuildAttributeUsage(SysML2.NET.Core.POCO.Systems.Attributes.IAttributeUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - UsageTextualNotationBuilder.BuildUsagePrefix(poco, stringBuilder); + UsageTextualNotationBuilder.BuildUsagePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("attribute "); - UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); + UsageTextualNotationBuilder.BuildUsage(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BehaviorTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BehaviorTextualNotationBuilder.cs index 11522991..f591dcf6 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BehaviorTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BehaviorTextualNotationBuilder.cs @@ -36,16 +36,17 @@ public static partial class BehaviorTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule Behavior - /// Behavior=TypePrefix'behavior'ClassifierDeclarationTypeBody + /// Behavior=TypePrefix'behavior'ClassifierDeclarationTypeBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildBehavior(SysML2.NET.Core.POCO.Kernel.Behaviors.IBehavior poco, StringBuilder stringBuilder) + public static void BuildBehavior(SysML2.NET.Core.POCO.Kernel.Behaviors.IBehavior poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); + TypeTextualNotationBuilder.BuildTypePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("behavior "); - ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); + ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildTypeBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorAsUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorAsUsageTextualNotationBuilder.cs index 58e83d54..d6dfed39 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorAsUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorAsUsageTextualNotationBuilder.cs @@ -36,37 +36,48 @@ public static partial class BindingConnectorAsUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule BindingConnectorAsUsage - /// BindingConnectorAsUsage=UsagePrefix('binding'UsageDeclaration)?'bind'ownedRelationship+=ConnectorEndMember'='ownedRelationship+=ConnectorEndMemberUsageBody + /// BindingConnectorAsUsage=UsagePrefix('binding'UsageDeclaration)?'bind'ownedRelationship+=ConnectorEndMember'='ownedRelationship+=ConnectorEndMemberUsageBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildBindingConnectorAsUsage(SysML2.NET.Core.POCO.Systems.Connections.IBindingConnectorAsUsage poco, StringBuilder stringBuilder) + public static void BuildBindingConnectorAsUsage(SysML2.NET.Core.POCO.Systems.Connections.IBindingConnectorAsUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfEndFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - UsageTextualNotationBuilder.BuildUsagePrefix(poco, stringBuilder); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + UsageTextualNotationBuilder.BuildUsagePrefix(poco, cursorCache, stringBuilder); - if (BuildGroupConditionForBindingConnectorAsUsage(poco)) + if (!string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || poco.OwnedRelatedElement.Count != 0 || poco.IsOrdered) { stringBuilder.Append("binding "); - UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); } stringBuilder.Append("bind "); - ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); - if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership elementAsEndFeatureMembership) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(elementAsEndFeatureMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + stringBuilder.Append("="); - ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); - if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership elementAsEndFeatureMembership) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(elementAsEndFeatureMembership, cursorCache, stringBuilder); + } } - UsageTextualNotationBuilder.BuildUsageBody(poco, stringBuilder); + ownedRelationshipCursor.Move(); + + UsageTextualNotationBuilder.BuildUsageBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorTextualNotationBuilder.cs index c67e96b1..ab8c85c3 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BindingConnectorTextualNotationBuilder.cs @@ -36,40 +36,47 @@ 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)? + /// BindingConnectorDeclaration:BindingConnector=FeatureDeclaration('of'ownedRelationship+=ConnectorEndMember'='ownedRelationship+=ConnectorEndMember)?|(isSufficient?='all')?('of'?ownedRelationship+=ConnectorEndMember'='ownedRelationship+=ConnectorEndMember)? /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildBindingConnectorDeclaration(SysML2.NET.Core.POCO.Kernel.Connectors.IBindingConnector poco, StringBuilder stringBuilder) + public static void BuildBindingConnectorDeclaration(SysML2.NET.Core.POCO.Kernel.Connectors.IBindingConnector poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildBindingConnectorDeclarationHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule BindingConnector - /// BindingConnector=FeaturePrefix'binding'BindingConnectorDeclarationTypeBody + /// BindingConnector=FeaturePrefix'binding'BindingConnectorDeclarationTypeBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildBindingConnector(SysML2.NET.Core.POCO.Kernel.Connectors.IBindingConnector poco, StringBuilder stringBuilder) + public static void BuildBindingConnector(SysML2.NET.Core.POCO.Kernel.Connectors.IBindingConnector poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + BuildFeaturePrefixHandCoded(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); - while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + while (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfOwningMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(elementAsOwningMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); } stringBuilder.Append("binding "); - BuildBindingConnectorDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); + BuildBindingConnectorDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildTypeBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BooleanExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BooleanExpressionTextualNotationBuilder.cs index 3bff4040..d6f4de7b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BooleanExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/BooleanExpressionTextualNotationBuilder.cs @@ -36,30 +36,40 @@ public static partial class BooleanExpressionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule BooleanExpression - /// BooleanExpression=FeaturePrefix'bool'FeatureDeclarationValuePart?FunctionBody + /// BooleanExpression=FeaturePrefix'bool'FeatureDeclarationValuePart?FunctionBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildBooleanExpression(SysML2.NET.Core.POCO.Kernel.Functions.IBooleanExpression poco, StringBuilder stringBuilder) + public static void BuildBooleanExpression(SysML2.NET.Core.POCO.Kernel.Functions.IBooleanExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + BuildFeaturePrefixHandCoded(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); - while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + while (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfOwningMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(elementAsOwningMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); } stringBuilder.Append("bool "); - FeatureTextualNotationBuilder.BuildFeatureDeclaration(poco, stringBuilder); - FeatureTextualNotationBuilder.BuildValuePart(poco, 0, stringBuilder); - TypeTextualNotationBuilder.BuildFunctionBody(poco, stringBuilder); + FeatureTextualNotationBuilder.BuildFeatureDeclaration(poco, cursorCache, stringBuilder); + + if (poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || !string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.Direction.HasValue || poco.IsDerived || poco.IsAbstract || poco.IsConstant || poco.IsOrdered || poco.IsEnd || poco.importedMembership.Count != 0 || poco.IsComposite || poco.IsPortion || poco.IsVariable || poco.IsSufficient || poco.unioningType.Count != 0 || poco.intersectingType.Count != 0 || poco.differencingType.Count != 0 || poco.featuringType.Count != 0 || poco.ownedTypeFeaturing.Count != 0) + { + FeatureTextualNotationBuilder.BuildValuePart(poco, cursorCache, stringBuilder); + } + TypeTextualNotationBuilder.BuildFunctionBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationDefinitionTextualNotationBuilder.cs index 8195eecc..9ae93a4e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationDefinitionTextualNotationBuilder.cs @@ -36,17 +36,18 @@ public static partial class CalculationDefinitionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule CalculationDefinition - /// CalculationDefinition=OccurrenceDefinitionPrefix'calc''def'DefinitionDeclarationCalculationBody + /// CalculationDefinition=OccurrenceDefinitionPrefix'calc''def'DefinitionDeclarationCalculationBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildCalculationDefinition(SysML2.NET.Core.POCO.Systems.Calculations.ICalculationDefinition poco, StringBuilder stringBuilder) + public static void BuildCalculationDefinition(SysML2.NET.Core.POCO.Systems.Calculations.ICalculationDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("calc "); stringBuilder.Append("def "); - DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildCalculationBody(poco, stringBuilder); + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildCalculationBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationUsageTextualNotationBuilder.cs index 72a021ce..c2e48cfc 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CalculationUsageTextualNotationBuilder.cs @@ -36,16 +36,17 @@ public static partial class CalculationUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule CalculationUsage - /// CalculationUsage:CalculationUsage=OccurrenceUsagePrefix'calc'ActionUsageDeclarationCalculationBody + /// CalculationUsage:CalculationUsage=OccurrenceUsagePrefix'calc'ActionUsageDeclarationCalculationBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildCalculationUsage(SysML2.NET.Core.POCO.Systems.Calculations.ICalculationUsage poco, StringBuilder stringBuilder) + public static void BuildCalculationUsage(SysML2.NET.Core.POCO.Systems.Calculations.ICalculationUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("calc "); - ActionUsageTextualNotationBuilder.BuildActionUsageDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildCalculationBody(poco, stringBuilder); + ActionUsageTextualNotationBuilder.BuildActionUsageDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildCalculationBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseDefinitionTextualNotationBuilder.cs index 4a6f2971..46a623db 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseDefinitionTextualNotationBuilder.cs @@ -36,17 +36,18 @@ public static partial class CaseDefinitionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule CaseDefinition - /// CaseDefinition=OccurrenceDefinitionPrefix'case''def'DefinitionDeclarationCaseBody + /// CaseDefinition=OccurrenceDefinitionPrefix'case''def'DefinitionDeclarationCaseBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildCaseDefinition(SysML2.NET.Core.POCO.Systems.Cases.ICaseDefinition poco, StringBuilder stringBuilder) + public static void BuildCaseDefinition(SysML2.NET.Core.POCO.Systems.Cases.ICaseDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("case "); stringBuilder.Append("def "); - DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildCaseBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseUsageTextualNotationBuilder.cs index c67d2877..c9c8b22b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CaseUsageTextualNotationBuilder.cs @@ -36,18 +36,23 @@ public static partial class CaseUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule CaseUsage - /// CaseUsage=OccurrenceUsagePrefix'case'ConstraintUsageDeclarationCaseBody + /// CaseUsage=OccurrenceUsagePrefix'case'ConstraintUsageDeclarationCaseBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildCaseUsage(SysML2.NET.Core.POCO.Systems.Cases.ICaseUsage poco, StringBuilder stringBuilder) + public static void BuildCaseUsage(SysML2.NET.Core.POCO.Systems.Cases.ICaseUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("case "); - UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); - FeatureTextualNotationBuilder.BuildValuePart(poco, 0, stringBuilder); + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, cursorCache, stringBuilder); - TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); + if (poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || !string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.Direction.HasValue || poco.IsDerived || poco.IsAbstract || poco.IsConstant || poco.IsOrdered || poco.IsEnd || poco.importedMembership.Count != 0 || poco.IsComposite || poco.IsPortion || poco.IsVariable || poco.IsSufficient || poco.unioningType.Count != 0 || poco.intersectingType.Count != 0 || poco.differencingType.Count != 0 || poco.featuringType.Count != 0 || poco.ownedTypeFeaturing.Count != 0) + { + FeatureTextualNotationBuilder.BuildValuePart(poco, cursorCache, stringBuilder); + } + + TypeTextualNotationBuilder.BuildCaseBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassTextualNotationBuilder.cs index 4abead85..b9d7d4ad 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassTextualNotationBuilder.cs @@ -36,16 +36,17 @@ public static partial class ClassTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule Class - /// Class=TypePrefix'class'ClassifierDeclarationTypeBody + /// Class=TypePrefix'class'ClassifierDeclarationTypeBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildClass(SysML2.NET.Core.POCO.Kernel.Classes.IClass poco, StringBuilder stringBuilder) + public static void BuildClass(SysML2.NET.Core.POCO.Kernel.Classes.IClass poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); + TypeTextualNotationBuilder.BuildTypePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("class "); - ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); + ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildTypeBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs index 7ed17253..1544f121 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs @@ -36,29 +36,40 @@ public static partial class ClassifierTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule SubclassificationPart - /// SubclassificationPart:Classifier=SPECIALIZESownedRelationship+=OwnedSubclassification(','ownedRelationship+=OwnedSubclassification)* + /// SubclassificationPart:Classifier=SPECIALIZESownedRelationship+=OwnedSubclassification(','ownedRelationship+=OwnedSubclassification)* /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildSubclassificationPart(SysML2.NET.Core.POCO.Core.Classifiers.IClassifier poco, StringBuilder stringBuilder) + public static void BuildSubclassificationPart(SysML2.NET.Core.POCO.Core.Classifiers.IClassifier poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfSubclassificationIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); stringBuilder.Append(" :> "); - ownedRelationshipOfSubclassificationIterator.MoveNext(); - if (ownedRelationshipOfSubclassificationIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - SubclassificationTextualNotationBuilder.BuildOwnedSubclassification(ownedRelationshipOfSubclassificationIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Classifiers.ISubclassification elementAsSubclassification) + { + SubclassificationTextualNotationBuilder.BuildOwnedSubclassification(elementAsSubclassification, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + - while (ownedRelationshipOfSubclassificationIterator.MoveNext()) + while (ownedRelationshipCursor.Current != null) { - stringBuilder.Append(","); + stringBuilder.Append(", "); - if (ownedRelationshipOfSubclassificationIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - SubclassificationTextualNotationBuilder.BuildOwnedSubclassification(ownedRelationshipOfSubclassificationIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Classifiers.ISubclassification elementAsSubclassification) + { + SubclassificationTextualNotationBuilder.BuildOwnedSubclassification(elementAsSubclassification, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); } @@ -66,13 +77,14 @@ public static void BuildSubclassificationPart(SysML2.NET.Core.POCO.Core.Classifi /// /// Builds the Textual Notation string for the rule ClassifierDeclaration - /// ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* + /// ClassifierDeclaration:Classifier=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SuperclassingPart|ConjugationPart)?TypeRelationshipPart* /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildClassifierDeclaration(SysML2.NET.Core.POCO.Core.Classifiers.IClassifier poco, StringBuilder stringBuilder) + public static void BuildClassifierDeclaration(SysML2.NET.Core.POCO.Core.Classifiers.IClassifier poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); if (poco.IsSufficient) { @@ -80,58 +92,76 @@ public static void BuildClassifierDeclaration(SysML2.NET.Core.POCO.Core.Classifi stringBuilder.Append(' '); } - ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + ElementTextualNotationBuilder.BuildIdentification(poco, cursorCache, stringBuilder); - if (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + if (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfOwningMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - OwningMembershipTextualNotationBuilder.BuildOwnedMultiplicity(ownedRelationshipOfOwningMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + { + OwningMembershipTextualNotationBuilder.BuildOwnedMultiplicity(elementAsOwningMembership, cursorCache, stringBuilder); + } } stringBuilder.Append(' '); } switch (poco) { - case SysML2.NET.Core.POCO.Core.Types.Type pocoType: - TypeTextualNotationBuilder.BuildConjugationPart(pocoType, stringBuilder); + case SysML2.NET.Core.POCO.Core.Types.IType pocoType: + TypeTextualNotationBuilder.BuildConjugationPart(pocoType, cursorCache, stringBuilder); break; default: - BuildSuperclassingPart(poco, stringBuilder); + BuildSuperclassingPart(poco, cursorCache, stringBuilder); break; } - // Handle collection Non Terminal - BuildTypeRelationshipPartInternal(poco, stringBuilder); TypeTextualNotationBuilder.BuildTypeRelationshipPart(poco, stringBuilder); + while (ownedRelationshipCursor.Current != null) + { + TypeTextualNotationBuilder.BuildTypeRelationshipPart(poco, cursorCache, stringBuilder); + } + } /// /// Builds the Textual Notation string for the rule SuperclassingPart - /// SuperclassingPart:Classifier=SPECIALIZESownedRelationship+=OwnedSubclassification(','ownedRelationship+=OwnedSubclassification)* + /// SuperclassingPart:Classifier=SPECIALIZESownedRelationship+=OwnedSubclassification(','ownedRelationship+=OwnedSubclassification)* /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildSuperclassingPart(SysML2.NET.Core.POCO.Core.Classifiers.IClassifier poco, StringBuilder stringBuilder) + public static void BuildSuperclassingPart(SysML2.NET.Core.POCO.Core.Classifiers.IClassifier poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfSubclassificationIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); stringBuilder.Append(" :> "); - ownedRelationshipOfSubclassificationIterator.MoveNext(); - if (ownedRelationshipOfSubclassificationIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - SubclassificationTextualNotationBuilder.BuildOwnedSubclassification(ownedRelationshipOfSubclassificationIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Classifiers.ISubclassification elementAsSubclassification) + { + SubclassificationTextualNotationBuilder.BuildOwnedSubclassification(elementAsSubclassification, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + - while (ownedRelationshipOfSubclassificationIterator.MoveNext()) + while (ownedRelationshipCursor.Current != null) { - stringBuilder.Append(","); + stringBuilder.Append(", "); - if (ownedRelationshipOfSubclassificationIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - SubclassificationTextualNotationBuilder.BuildOwnedSubclassification(ownedRelationshipOfSubclassificationIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Classifiers.ISubclassification elementAsSubclassification) + { + SubclassificationTextualNotationBuilder.BuildOwnedSubclassification(elementAsSubclassification, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); } @@ -139,16 +169,17 @@ public static void BuildSuperclassingPart(SysML2.NET.Core.POCO.Core.Classifiers. /// /// Builds the Textual Notation string for the rule Classifier - /// Classifier=TypePrefix'classifier'ClassifierDeclarationTypeBody + /// Classifier=TypePrefix'classifier'ClassifierDeclarationTypeBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildClassifier(SysML2.NET.Core.POCO.Core.Classifiers.IClassifier poco, StringBuilder stringBuilder) + public static void BuildClassifier(SysML2.NET.Core.POCO.Core.Classifiers.IClassifier poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); + TypeTextualNotationBuilder.BuildTypePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("classifier "); - BuildClassifierDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); + BuildClassifierDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildTypeBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CollectExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CollectExpressionTextualNotationBuilder.cs index 0279240e..e6a9aacf 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CollectExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CollectExpressionTextualNotationBuilder.cs @@ -36,26 +36,37 @@ public static partial class CollectExpressionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule CollectExpression - /// CollectExpression=ownedRelationship+=PrimaryArgumentMember'.'ownedRelationship+=BodyArgumentMember + /// CollectExpression=ownedRelationship+=PrimaryArgumentMember'.'ownedRelationship+=BodyArgumentMember /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildCollectExpression(SysML2.NET.Core.POCO.Kernel.Expressions.ICollectExpression poco, StringBuilder stringBuilder) + public static void BuildCollectExpression(SysML2.NET.Core.POCO.Kernel.Expressions.ICollectExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfParameterMembershipIterator.MoveNext(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildPrimaryArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildPrimaryArgumentMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + stringBuilder.Append("."); - ownedRelationshipOfParameterMembershipIterator.MoveNext(); - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildBodyArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildBodyArgumentMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CommentTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CommentTextualNotationBuilder.cs index 82475154..781ecc00 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CommentTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CommentTextualNotationBuilder.cs @@ -36,39 +36,48 @@ 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 + /// Comment=('comment'Identification('about'ownedRelationship+=Annotation(','ownedRelationship+=Annotation)*)?)?('locale'locale=STRING_VALUE)?body=REGULAR_COMMENT /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildComment(SysML2.NET.Core.POCO.Root.Annotations.IComment poco, StringBuilder stringBuilder) + public static void BuildComment(SysML2.NET.Core.POCO.Root.Annotations.IComment poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfAnnotationIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (BuildGroupConditionForComment(poco)) + if (!string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName)) { stringBuilder.Append("comment "); - ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + ElementTextualNotationBuilder.BuildIdentification(poco, cursorCache, stringBuilder); - if (ownedRelationshipOfAnnotationIterator.MoveNext()) + if (ownedRelationshipCursor.Current != null) { stringBuilder.Append("about "); - if (ownedRelationshipOfAnnotationIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - AnnotationTextualNotationBuilder.BuildAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Annotations.IAnnotation elementAsAnnotation) + { + AnnotationTextualNotationBuilder.BuildAnnotation(elementAsAnnotation, cursorCache, stringBuilder); + } } - while (ownedRelationshipOfAnnotationIterator.MoveNext()) + while (ownedRelationshipCursor.Current != null) { - stringBuilder.Append(","); + stringBuilder.Append(", "); - if (ownedRelationshipOfAnnotationIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - AnnotationTextualNotationBuilder.BuildAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Annotations.IAnnotation elementAsAnnotation) + { + AnnotationTextualNotationBuilder.BuildAnnotation(elementAsAnnotation, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); } - stringBuilder.Append(' '); } stringBuilder.Append(' '); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernDefinitionTextualNotationBuilder.cs index 3fefd30c..4fe21009 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernDefinitionTextualNotationBuilder.cs @@ -36,17 +36,18 @@ public static partial class ConcernDefinitionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule ConcernDefinition - /// ConcernDefinition=OccurrenceDefinitionPrefix'concern''def'DefinitionDeclarationRequirementBody + /// ConcernDefinition=OccurrenceDefinitionPrefix'concern''def'DefinitionDeclarationRequirementBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildConcernDefinition(SysML2.NET.Core.POCO.Systems.Requirements.IConcernDefinition poco, StringBuilder stringBuilder) + public static void BuildConcernDefinition(SysML2.NET.Core.POCO.Systems.Requirements.IConcernDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("concern "); stringBuilder.Append("def "); - DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildRequirementBody(poco, stringBuilder); + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildRequirementBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernUsageTextualNotationBuilder.cs index 1a59e35d..13a98961 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConcernUsageTextualNotationBuilder.cs @@ -24,7 +24,6 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; @@ -37,30 +36,29 @@ public static partial class ConcernUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule FramedConcernUsage - /// FramedConcernUsage:ConcernUsage=ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?CalculationBody|(UsageExtensionKeyword*'concern'|UsageExtensionKeyword+)CalculationUsageDeclarationCalculationBody + /// FramedConcernUsage:ConcernUsage=ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?CalculationBody|(UsageExtensionKeyword*'concern'|UsageExtensionKeyword+)CalculationUsageDeclarationCalculationBody /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildFramedConcernUsage(SysML2.NET.Core.POCO.Systems.Requirements.IConcernUsage poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildFramedConcernUsage(SysML2.NET.Core.POCO.Systems.Requirements.IConcernUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - return elementIndex; + BuildFramedConcernUsageHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule ConcernUsage - /// ConcernUsage=OccurrenceUsagePrefix'concern'ConstraintUsageDeclarationRequirementBody + /// ConcernUsage=OccurrenceUsagePrefix'concern'ConstraintUsageDeclarationRequirementBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildConcernUsage(SysML2.NET.Core.POCO.Systems.Requirements.IConcernUsage poco, StringBuilder stringBuilder) + public static void BuildConcernUsage(SysML2.NET.Core.POCO.Systems.Requirements.IConcernUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("concern "); - ConstraintUsageTextualNotationBuilder.BuildConstraintUsageDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildRequirementBody(poco, stringBuilder); + ConstraintUsageTextualNotationBuilder.BuildConstraintUsageDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildRequirementBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortDefinitionTextualNotationBuilder.cs index 154d73f6..371c458f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortDefinitionTextualNotationBuilder.cs @@ -24,7 +24,6 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; @@ -37,25 +36,26 @@ public static partial class ConjugatedPortDefinitionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule ConjugatedPortDefinition - /// ConjugatedPortDefinition=ownedRelationship+=PortConjugation + /// ConjugatedPortDefinition=ownedRelationship+=PortConjugation /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildConjugatedPortDefinition(SysML2.NET.Core.POCO.Systems.Ports.IConjugatedPortDefinition poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildConjugatedPortDefinition(SysML2.NET.Core.POCO.Systems.Ports.IConjugatedPortDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelationship.Count) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + + if (ownedRelationshipCursor.Current != null) { - var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; - if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Systems.Ports.IPortConjugation elementAsPortConjugation) + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Systems.Ports.IPortConjugation elementAsPortConjugation) { - PortConjugationTextualNotationBuilder.BuildPortConjugation(elementAsPortConjugation, stringBuilder); + PortConjugationTextualNotationBuilder.BuildPortConjugation(elementAsPortConjugation, cursorCache, stringBuilder); } } + ownedRelationshipCursor.Move(); + - return elementIndex; } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortTypingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortTypingTextualNotationBuilder.cs index 6ca6cc1f..550c255a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortTypingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugatedPortTypingTextualNotationBuilder.cs @@ -36,14 +36,15 @@ public static partial class ConjugatedPortTypingTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule ConjugatedPortTyping - /// ConjugatedPortTyping:ConjugatedPortTyping='~'originalPortDefinition=~[QualifiedName] + /// ConjugatedPortTyping:ConjugatedPortTyping='~'originalPortDefinition=~[QualifiedName] /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildConjugatedPortTyping(SysML2.NET.Core.POCO.Systems.Ports.IConjugatedPortTyping poco, StringBuilder stringBuilder) + public static void BuildConjugatedPortTyping(SysML2.NET.Core.POCO.Systems.Ports.IConjugatedPortTyping poco, ICursorCache cursorCache, StringBuilder stringBuilder) { stringBuilder.Append("~"); - BuildOriginalPortDefinition(poco, stringBuilder); + BuildOriginalPortDefinition(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugationTextualNotationBuilder.cs index bcb12733..b9c9c55e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugationTextualNotationBuilder.cs @@ -36,38 +36,40 @@ public static partial class ConjugationTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule OwnedConjugation - /// OwnedConjugation:Conjugation=originalType=[QualifiedName]|originalType=FeatureChain{ownedRelatedElement+=originalType} + /// OwnedConjugation:Conjugation=originalType=[QualifiedName]|originalType=FeatureChain{ownedRelatedElement+=originalType} /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildOwnedConjugation(SysML2.NET.Core.POCO.Core.Types.IConjugation poco, StringBuilder stringBuilder) + public static void BuildOwnedConjugation(SysML2.NET.Core.POCO.Core.Types.IConjugation poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildOwnedConjugationHandCoded(poco, cursorCache, stringBuilder); } /// /// 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 + /// 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 used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildConjugation(SysML2.NET.Core.POCO.Core.Types.IConjugation poco, StringBuilder stringBuilder) + public static void BuildConjugation(SysML2.NET.Core.POCO.Core.Types.IConjugation poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (BuildGroupConditionForConjugation(poco)) + if (!string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName)) { stringBuilder.Append("conjugation "); - ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + ElementTextualNotationBuilder.BuildIdentification(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); } stringBuilder.Append("conjugate "); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildConjugationHandCoded(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); - stringBuilder.Append(" ~ "); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + stringBuilder.Append(" ~"); + BuildConjugationHandCoded(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); - RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); + RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionDefinitionTextualNotationBuilder.cs index 5d1fcc6d..973f5640 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionDefinitionTextualNotationBuilder.cs @@ -36,16 +36,17 @@ public static partial class ConnectionDefinitionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule ConnectionDefinition - /// ConnectionDefinition=OccurrenceDefinitionPrefix'connection''def'Definition + /// ConnectionDefinition=OccurrenceDefinitionPrefix'connection''def'Definition /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildConnectionDefinition(SysML2.NET.Core.POCO.Systems.Connections.IConnectionDefinition poco, StringBuilder stringBuilder) + public static void BuildConnectionDefinition(SysML2.NET.Core.POCO.Systems.Connections.IConnectionDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("connection "); stringBuilder.Append("def "); - DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); + DefinitionTextualNotationBuilder.BuildDefinition(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs index 76390744..02767c94 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs @@ -36,72 +36,100 @@ public static partial class ConnectionUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule ConnectorPart - /// ConnectorPart:ConnectionUsage=BinaryConnectorPart|NaryConnectorPart + /// ConnectorPart:ConnectionUsage=BinaryConnectorPart|NaryConnectorPart /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildConnectorPart(SysML2.NET.Core.POCO.Systems.Connections.IConnectionUsage poco, StringBuilder stringBuilder) + public static void BuildConnectorPart(SysML2.NET.Core.POCO.Systems.Connections.IConnectionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); + BuildConnectorPartHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule BinaryConnectorPart - /// BinaryConnectorPart:ConnectionUsage=ownedRelationship+=ConnectorEndMember'to'ownedRelationship+=ConnectorEndMember + /// BinaryConnectorPart:ConnectionUsage=ownedRelationship+=ConnectorEndMember'to'ownedRelationship+=ConnectorEndMember /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildBinaryConnectorPart(SysML2.NET.Core.POCO.Systems.Connections.IConnectionUsage poco, StringBuilder stringBuilder) + public static void BuildBinaryConnectorPart(SysML2.NET.Core.POCO.Systems.Connections.IConnectionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfEndFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership elementAsEndFeatureMembership) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(elementAsEndFeatureMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + stringBuilder.Append("to "); - ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); - if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership elementAsEndFeatureMembership) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(elementAsEndFeatureMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } /// /// Builds the Textual Notation string for the rule NaryConnectorPart - /// NaryConnectorPart:ConnectionUsage='('ownedRelationship+=ConnectorEndMember','ownedRelationship+=ConnectorEndMember(','ownedRelationship+=ConnectorEndMember)*')' + /// NaryConnectorPart:ConnectionUsage='('ownedRelationship+=ConnectorEndMember','ownedRelationship+=ConnectorEndMember(','ownedRelationship+=ConnectorEndMember)*')' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildNaryConnectorPart(SysML2.NET.Core.POCO.Systems.Connections.IConnectionUsage poco, StringBuilder stringBuilder) + public static void BuildNaryConnectorPart(SysML2.NET.Core.POCO.Systems.Connections.IConnectionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfEndFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); stringBuilder.Append("("); - ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); - if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership elementAsEndFeatureMembership) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(elementAsEndFeatureMembership, cursorCache, stringBuilder); + } } - stringBuilder.Append(","); - ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + ownedRelationshipCursor.Move(); - if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + stringBuilder.Append(", "); + + if (ownedRelationshipCursor.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership elementAsEndFeatureMembership) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(elementAsEndFeatureMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); - while (ownedRelationshipOfEndFeatureMembershipIterator.MoveNext()) + + while (ownedRelationshipCursor.Current != null) { - stringBuilder.Append(","); + stringBuilder.Append(", "); - if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership elementAsEndFeatureMembership) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(elementAsEndFeatureMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); } stringBuilder.Append(")"); @@ -110,16 +138,17 @@ public static void BuildNaryConnectorPart(SysML2.NET.Core.POCO.Systems.Connectio /// /// Builds the Textual Notation string for the rule ConnectionUsage - /// ConnectionUsage=OccurrenceUsagePrefix('connection'UsageDeclarationValuePart?('connect'ConnectorPart)?|'connect'ConnectorPart)UsageBody + /// ConnectionUsage=OccurrenceUsagePrefix('connection'UsageDeclarationValuePart?('connect'ConnectorPart)?|'connect'ConnectorPart)UsageBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildConnectionUsage(SysML2.NET.Core.POCO.Systems.Connections.IConnectionUsage poco, StringBuilder stringBuilder) + public static void BuildConnectionUsage(SysML2.NET.Core.POCO.Systems.Connections.IConnectionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, cursorCache, stringBuilder); + BuildConnectionUsageHandCoded(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); - UsageTextualNotationBuilder.BuildUsageBody(poco, stringBuilder); + UsageTextualNotationBuilder.BuildUsageBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs index 76f6be80..35ed1ef6 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs @@ -36,74 +36,106 @@ public static partial class ConnectorTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule ConnectorDeclaration - /// ConnectorDeclaration:Connector=BinaryConnectorDeclaration|NaryConnectorDeclaration + /// ConnectorDeclaration:Connector=BinaryConnectorDeclaration|NaryConnectorDeclaration /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildConnectorDeclaration(SysML2.NET.Core.POCO.Kernel.Connectors.IConnector poco, StringBuilder stringBuilder) + public static void BuildConnectorDeclaration(SysML2.NET.Core.POCO.Kernel.Connectors.IConnector poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); + BuildConnectorDeclarationHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule BinaryConnectorDeclaration - /// BinaryConnectorDeclaration:Connector=(FeatureDeclaration?'from'|isSufficient?='all''from'?)?ownedRelationship+=ConnectorEndMember'to'ownedRelationship+=ConnectorEndMember + /// BinaryConnectorDeclaration:Connector=(FeatureDeclaration?'from'|isSufficient?='all''from'?)?ownedRelationship+=ConnectorEndMember'to'ownedRelationship+=ConnectorEndMember /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildBinaryConnectorDeclaration(SysML2.NET.Core.POCO.Kernel.Connectors.IConnector poco, StringBuilder stringBuilder) + public static void BuildBinaryConnectorDeclaration(SysML2.NET.Core.POCO.Kernel.Connectors.IConnector poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfEndFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + BuildBinaryConnectorDeclarationHandCoded(poco, cursorCache, stringBuilder); - if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership elementAsEndFeatureMembership) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(elementAsEndFeatureMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + stringBuilder.Append("to "); - ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); - if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership elementAsEndFeatureMembership) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(elementAsEndFeatureMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } /// /// Builds the Textual Notation string for the rule NaryConnectorDeclaration - /// NaryConnectorDeclaration:Connector=FeatureDeclaration?'('ownedRelationship+=ConnectorEndMember','ownedRelationship+=ConnectorEndMember(','ownedRelationship+=ConnectorEndMember)*')' + /// NaryConnectorDeclaration:Connector=FeatureDeclaration?'('ownedRelationship+=ConnectorEndMember','ownedRelationship+=ConnectorEndMember(','ownedRelationship+=ConnectorEndMember)*')' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildNaryConnectorDeclaration(SysML2.NET.Core.POCO.Kernel.Connectors.IConnector poco, StringBuilder stringBuilder) + public static void BuildNaryConnectorDeclaration(SysML2.NET.Core.POCO.Kernel.Connectors.IConnector poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfEndFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - FeatureTextualNotationBuilder.BuildFeatureDeclaration(poco, stringBuilder); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + + if (poco.IsSufficient || !string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || poco.IsOrdered || poco.unioningType.Count != 0 || poco.intersectingType.Count != 0 || poco.differencingType.Count != 0 || poco.featuringType.Count != 0 || poco.ownedTypeFeaturing.Count != 0) + { + FeatureTextualNotationBuilder.BuildFeatureDeclaration(poco, cursorCache, stringBuilder); + } stringBuilder.Append("("); - ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); - if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership elementAsEndFeatureMembership) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(elementAsEndFeatureMembership, cursorCache, stringBuilder); + } } - stringBuilder.Append(","); - ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + ownedRelationshipCursor.Move(); - if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + stringBuilder.Append(", "); + + if (ownedRelationshipCursor.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership elementAsEndFeatureMembership) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(elementAsEndFeatureMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + - while (ownedRelationshipOfEndFeatureMembershipIterator.MoveNext()) + while (ownedRelationshipCursor.Current != null) { - stringBuilder.Append(","); + stringBuilder.Append(", "); - if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership elementAsEndFeatureMembership) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(elementAsEndFeatureMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); } stringBuilder.Append(")"); @@ -112,30 +144,36 @@ public static void BuildNaryConnectorDeclaration(SysML2.NET.Core.POCO.Kernel.Con /// /// Builds the Textual Notation string for the rule Connector - /// Connector=FeaturePrefix'connector'(FeatureDeclaration?ValuePart?|ConnectorDeclaration)TypeBody + /// Connector=FeaturePrefix'connector'(FeatureDeclaration?ValuePart?|ConnectorDeclaration)TypeBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildConnector(SysML2.NET.Core.POCO.Kernel.Connectors.IConnector poco, StringBuilder stringBuilder) + public static void BuildConnector(SysML2.NET.Core.POCO.Kernel.Connectors.IConnector poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + BuildFeaturePrefixHandCoded(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); - while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + while (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfOwningMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(elementAsOwningMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); } stringBuilder.Append("connector "); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildConnectorHandCoded(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); - TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); + TypeTextualNotationBuilder.BuildTypeBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintDefinitionTextualNotationBuilder.cs index e80cb7a2..e8c45c3d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintDefinitionTextualNotationBuilder.cs @@ -36,17 +36,18 @@ public static partial class ConstraintDefinitionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule ConstraintDefinition - /// ConstraintDefinition=OccurrenceDefinitionPrefix'constraint''def'DefinitionDeclarationCalculationBody + /// ConstraintDefinition=OccurrenceDefinitionPrefix'constraint''def'DefinitionDeclarationCalculationBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildConstraintDefinition(SysML2.NET.Core.POCO.Systems.Constraints.IConstraintDefinition poco, StringBuilder stringBuilder) + public static void BuildConstraintDefinition(SysML2.NET.Core.POCO.Systems.Constraints.IConstraintDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("constraint "); stringBuilder.Append("def "); - DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildCalculationBody(poco, stringBuilder); + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildCalculationBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintUsageTextualNotationBuilder.cs index 54cfc663..1ebfae1e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstraintUsageTextualNotationBuilder.cs @@ -24,7 +24,6 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; @@ -37,43 +36,47 @@ public static partial class ConstraintUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule ConstraintUsageDeclaration - /// ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? + /// ConstraintUsageDeclaration:ConstraintUsage=UsageDeclarationValuePart? /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildConstraintUsageDeclaration(SysML2.NET.Core.POCO.Systems.Constraints.IConstraintUsage poco, StringBuilder stringBuilder) + public static void BuildConstraintUsageDeclaration(SysML2.NET.Core.POCO.Systems.Constraints.IConstraintUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); - FeatureTextualNotationBuilder.BuildValuePart(poco, 0, stringBuilder); + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, cursorCache, stringBuilder); + + if (poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || !string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.Direction.HasValue || poco.IsDerived || poco.IsAbstract || poco.IsConstant || poco.IsOrdered || poco.IsEnd || poco.importedMembership.Count != 0 || poco.IsComposite || poco.IsPortion || poco.IsVariable || poco.IsSufficient || poco.unioningType.Count != 0 || poco.intersectingType.Count != 0 || poco.differencingType.Count != 0 || poco.featuringType.Count != 0 || poco.ownedTypeFeaturing.Count != 0) + { + FeatureTextualNotationBuilder.BuildValuePart(poco, cursorCache, stringBuilder); + } } /// /// Builds the Textual Notation string for the rule RequirementConstraintUsage - /// RequirementConstraintUsage:ConstraintUsage=ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?RequirementBody|(UsageExtensionKeyword*'constraint'|UsageExtensionKeyword+)ConstraintUsageDeclarationCalculationBody + /// RequirementConstraintUsage:ConstraintUsage=ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?RequirementBody|(UsageExtensionKeyword*'constraint'|UsageExtensionKeyword+)ConstraintUsageDeclarationCalculationBody /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildRequirementConstraintUsage(SysML2.NET.Core.POCO.Systems.Constraints.IConstraintUsage poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildRequirementConstraintUsage(SysML2.NET.Core.POCO.Systems.Constraints.IConstraintUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - return elementIndex; + BuildRequirementConstraintUsageHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule ConstraintUsage - /// ConstraintUsage=OccurrenceUsagePrefix'constraint'ConstraintUsageDeclarationCalculationBody + /// ConstraintUsage=OccurrenceUsagePrefix'constraint'ConstraintUsageDeclarationCalculationBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildConstraintUsage(SysML2.NET.Core.POCO.Systems.Constraints.IConstraintUsage poco, StringBuilder stringBuilder) + public static void BuildConstraintUsage(SysML2.NET.Core.POCO.Systems.Constraints.IConstraintUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("constraint "); - BuildConstraintUsageDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildCalculationBody(poco, stringBuilder); + BuildConstraintUsageDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildCalculationBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstructorExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstructorExpressionTextualNotationBuilder.cs index 80092661..5d17dced 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstructorExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConstructorExpressionTextualNotationBuilder.cs @@ -36,27 +36,37 @@ public static partial class ConstructorExpressionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule ConstructorExpression - /// ConstructorExpression='new'ownedRelationship+=InstantiatedTypeMemberownedRelationship+=ConstructorResultMember + /// ConstructorExpression='new'ownedRelationship+=InstantiatedTypeMemberownedRelationship+=ConstructorResultMember /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildConstructorExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IConstructorExpression poco, StringBuilder stringBuilder) + public static void BuildConstructorExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IConstructorExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); stringBuilder.Append("new "); - ownedRelationshipOfMembershipIterator.MoveNext(); - if (ownedRelationshipOfMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - MembershipTextualNotationBuilder.BuildInstantiatedTypeMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IMembership elementAsMembership) + { + MembershipTextualNotationBuilder.BuildInstantiatedTypeMember(elementAsMembership, cursorCache, stringBuilder); + } } - ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); + ownedRelationshipCursor.Move(); + - if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ReturnParameterMembershipTextualNotationBuilder.BuildConstructorResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Functions.IReturnParameterMembership elementAsReturnParameterMembership) + { + ReturnParameterMembershipTextualNotationBuilder.BuildConstructorResultMember(elementAsReturnParameterMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ControlNodeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ControlNodeTextualNotationBuilder.cs index 4250e67d..37ca2d23 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ControlNodeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ControlNodeTextualNotationBuilder.cs @@ -36,25 +36,26 @@ public static partial class ControlNodeTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule ControlNode - /// ControlNode=MergeNode|DecisionNode|JoinNode|ForkNode + /// ControlNode=MergeNode|DecisionNode|JoinNode|ForkNode /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildControlNode(SysML2.NET.Core.POCO.Systems.Actions.IControlNode poco, StringBuilder stringBuilder) + public static void BuildControlNode(SysML2.NET.Core.POCO.Systems.Actions.IControlNode poco, ICursorCache cursorCache, StringBuilder stringBuilder) { switch (poco) { - case SysML2.NET.Core.POCO.Systems.Actions.MergeNode pocoMergeNode: - MergeNodeTextualNotationBuilder.BuildMergeNode(pocoMergeNode, stringBuilder); + case SysML2.NET.Core.POCO.Systems.Actions.IMergeNode pocoMergeNode: + MergeNodeTextualNotationBuilder.BuildMergeNode(pocoMergeNode, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Actions.DecisionNode pocoDecisionNode: - DecisionNodeTextualNotationBuilder.BuildDecisionNode(pocoDecisionNode, stringBuilder); + case SysML2.NET.Core.POCO.Systems.Actions.IDecisionNode pocoDecisionNode: + DecisionNodeTextualNotationBuilder.BuildDecisionNode(pocoDecisionNode, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Actions.JoinNode pocoJoinNode: - JoinNodeTextualNotationBuilder.BuildJoinNode(pocoJoinNode, stringBuilder); + case SysML2.NET.Core.POCO.Systems.Actions.IJoinNode pocoJoinNode: + JoinNodeTextualNotationBuilder.BuildJoinNode(pocoJoinNode, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Actions.ForkNode pocoForkNode: - ForkNodeTextualNotationBuilder.BuildForkNode(pocoForkNode, stringBuilder); + case SysML2.NET.Core.POCO.Systems.Actions.IForkNode pocoForkNode: + ForkNodeTextualNotationBuilder.BuildForkNode(pocoForkNode, cursorCache, stringBuilder); break; } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CrossSubsettingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CrossSubsettingTextualNotationBuilder.cs index b64b8cad..208884c4 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CrossSubsettingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CrossSubsettingTextualNotationBuilder.cs @@ -36,13 +36,14 @@ public static partial class CrossSubsettingTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule OwnedCrossSubsetting - /// OwnedCrossSubsetting:CrossSubsetting=crossedFeature=[QualifiedName]|crossedFeature=OwnedFeatureChain{ownedRelatedElement+=crossedFeature} + /// OwnedCrossSubsetting:CrossSubsetting=crossedFeature=[QualifiedName]|crossedFeature=OwnedFeatureChain{ownedRelatedElement+=crossedFeature} /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildOwnedCrossSubsetting(SysML2.NET.Core.POCO.Core.Features.ICrossSubsetting poco, StringBuilder stringBuilder) + public static void BuildOwnedCrossSubsetting(SysML2.NET.Core.POCO.Core.Features.ICrossSubsetting poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildOwnedCrossSubsettingHandCoded(poco, cursorCache, stringBuilder); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DataTypeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DataTypeTextualNotationBuilder.cs index ea76f159..c3219f05 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DataTypeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DataTypeTextualNotationBuilder.cs @@ -36,16 +36,17 @@ public static partial class DataTypeTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule DataType - /// DataType=TypePrefix'datatype'ClassifierDeclarationTypeBody + /// DataType=TypePrefix'datatype'ClassifierDeclarationTypeBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildDataType(SysML2.NET.Core.POCO.Kernel.DataTypes.IDataType poco, StringBuilder stringBuilder) + public static void BuildDataType(SysML2.NET.Core.POCO.Kernel.DataTypes.IDataType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); + TypeTextualNotationBuilder.BuildTypePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("datatype "); - ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); + ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildTypeBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DecisionNodeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DecisionNodeTextualNotationBuilder.cs index 303a7fce..e1c19e4b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DecisionNodeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DecisionNodeTextualNotationBuilder.cs @@ -36,19 +36,20 @@ public static partial class DecisionNodeTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule DecisionNode - /// DecisionNode=ControlNodePrefixisComposite?='decide'UsageDeclarationActionBody + /// DecisionNode=ControlNodePrefixisComposite?='decide'UsageDeclarationActionBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildDecisionNode(SysML2.NET.Core.POCO.Systems.Actions.IDecisionNode poco, StringBuilder stringBuilder) + public static void BuildDecisionNode(SysML2.NET.Core.POCO.Systems.Actions.IDecisionNode poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceUsageTextualNotationBuilder.BuildControlNodePrefix(poco, stringBuilder); + OccurrenceUsageTextualNotationBuilder.BuildControlNodePrefix(poco, cursorCache, stringBuilder); if (poco.IsComposite) { stringBuilder.Append(" decide "); } - UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildActionBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs index aec5ca1d..21db6e23 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs @@ -24,7 +24,6 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; @@ -37,34 +36,36 @@ public static partial class DefinitionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule DefinitionExtensionKeyword - /// DefinitionExtensionKeyword:Definition=ownedRelationship+=PrefixMetadataMember + /// DefinitionExtensionKeyword:Definition=ownedRelationship+=PrefixMetadataMember /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildDefinitionExtensionKeyword(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IDefinition poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildDefinitionExtensionKeyword(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelationship.Count) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + + if (ownedRelationshipCursor.Current != null) { - var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; - if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) { - OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(elementAsOwningMembership, stringBuilder); + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(elementAsOwningMembership, cursorCache, stringBuilder); } } + ownedRelationshipCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule DefinitionPrefix - /// DefinitionPrefix:Definition=BasicDefinitionPrefix?DefinitionExtensionKeyword* + /// DefinitionPrefix:Definition=BasicDefinitionPrefix?DefinitionExtensionKeyword* /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildDefinitionPrefix(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IDefinition poco, StringBuilder stringBuilder) + public static void BuildDefinitionPrefix(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.IsAbstract) { @@ -75,34 +76,41 @@ public static void BuildDefinitionPrefix(SysML2.NET.Core.POCO.Systems.Definition stringBuilder.Append(" variation "); } - // Handle collection Non Terminal - for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + while (ownedRelationshipCursor.Current != null) { - ownedRelationshipIndex = BuildDefinitionExtensionKeyword(poco, ownedRelationshipIndex, stringBuilder); + BuildDefinitionExtensionKeyword(poco, cursorCache, stringBuilder); } + } /// /// Builds the Textual Notation string for the rule DefinitionDeclaration - /// DefinitionDeclaration:Definition=IdentificationSubclassificationPart? + /// DefinitionDeclaration:Definition=IdentificationSubclassificationPart? /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildDefinitionDeclaration(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IDefinition poco, StringBuilder stringBuilder) + public static void BuildDefinitionDeclaration(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); - ClassifierTextualNotationBuilder.BuildSubclassificationPart(poco, stringBuilder); + ElementTextualNotationBuilder.BuildIdentification(poco, cursorCache, stringBuilder); + + if (poco.OwnedRelationship.Count != 0) + { + ClassifierTextualNotationBuilder.BuildSubclassificationPart(poco, cursorCache, stringBuilder); + } } /// /// Builds the Textual Notation string for the rule ExtendedDefinition - /// ExtendedDefinition:Definition=BasicDefinitionPrefix?DefinitionExtensionKeyword+'def'Definition + /// ExtendedDefinition:Definition=BasicDefinitionPrefix?DefinitionExtensionKeyword+'def'Definition /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildExtendedDefinition(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IDefinition poco, StringBuilder stringBuilder) + public static void BuildExtendedDefinition(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.IsAbstract) { @@ -113,26 +121,28 @@ public static void BuildExtendedDefinition(SysML2.NET.Core.POCO.Systems.Definiti stringBuilder.Append(" variation "); } - // Handle collection Non Terminal - for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + while (ownedRelationshipCursor.Current != null) { - ownedRelationshipIndex = BuildDefinitionExtensionKeyword(poco, ownedRelationshipIndex, stringBuilder); + BuildDefinitionExtensionKeyword(poco, cursorCache, stringBuilder); } + stringBuilder.Append("def "); - BuildDefinition(poco, stringBuilder); + BuildDefinition(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule Definition - /// Definition=DefinitionDeclarationDefinitionBody + /// Definition=DefinitionDeclarationDefinitionBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildDefinition(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IDefinition poco, StringBuilder stringBuilder) + public static void BuildDefinition(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildDefinitionDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildDefinitionBody(poco, stringBuilder); + BuildDefinitionDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildDefinitionBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DependencyTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DependencyTextualNotationBuilder.cs index 8babaf4d..a3a40873 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DependencyTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DependencyTextualNotationBuilder.cs @@ -36,71 +36,81 @@ public static partial class DependencyTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule Dependency - /// Dependency=(ownedRelationship+=PrefixMetadataAnnotation)*'dependency'DependencyDeclarationRelationshipBody + /// Dependency=(ownedRelationship+=PrefixMetadataAnnotation)*'dependency'DependencyDeclarationRelationshipBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildDependency(SysML2.NET.Core.POCO.Root.Dependencies.IDependency poco, StringBuilder stringBuilder) + public static void BuildDependency(SysML2.NET.Core.POCO.Root.Dependencies.IDependency poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfAnnotationIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - while (ownedRelationshipOfAnnotationIterator.MoveNext()) + while (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfAnnotationIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - AnnotationTextualNotationBuilder.BuildPrefixMetadataAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Annotations.IAnnotation elementAsAnnotation) + { + AnnotationTextualNotationBuilder.BuildPrefixMetadataAnnotation(elementAsAnnotation, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); } stringBuilder.Append("dependency "); - using var clientIterator = poco.Client.GetEnumerator(); - using var supplierIterator = poco.Supplier.GetEnumerator(); + var clientCursor = cursorCache.GetOrCreateCursor(poco.Id, "client", poco.Client); + var supplierCursor = cursorCache.GetOrCreateCursor(poco.Id, "supplier", poco.Supplier); - if (BuildGroupConditionForDependencyDeclaration(poco)) + if (!string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName)) { - ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + ElementTextualNotationBuilder.BuildIdentification(poco, cursorCache, stringBuilder); stringBuilder.Append("from "); stringBuilder.Append(' '); } - clientIterator.MoveNext(); - if (clientIterator.Current != null) + if (clientCursor.Current != null) { - stringBuilder.Append(clientIterator.Current.qualifiedName); + stringBuilder.Append(clientCursor.Current.qualifiedName); + clientCursor.Move(); } - while (clientIterator.MoveNext()) + while (clientCursor.Current != null) { - stringBuilder.Append(","); + stringBuilder.Append(", "); - if (clientIterator.Current != null) + if (clientCursor.Current != null) { - stringBuilder.Append(clientIterator.Current.qualifiedName); + stringBuilder.Append(clientCursor.Current.qualifiedName); + clientCursor.Move(); } + clientCursor.Move(); } stringBuilder.Append("to "); - supplierIterator.MoveNext(); - if (supplierIterator.Current != null) + if (supplierCursor.Current != null) { - stringBuilder.Append(supplierIterator.Current.qualifiedName); + stringBuilder.Append(supplierCursor.Current.qualifiedName); + supplierCursor.Move(); } - while (supplierIterator.MoveNext()) + while (supplierCursor.Current != null) { - stringBuilder.Append(","); + stringBuilder.Append(", "); - if (supplierIterator.Current != null) + if (supplierCursor.Current != null) { - stringBuilder.Append(supplierIterator.Current.qualifiedName); + stringBuilder.Append(supplierCursor.Current.qualifiedName); + supplierCursor.Move(); } + supplierCursor.Move(); } - RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); + RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DifferencingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DifferencingTextualNotationBuilder.cs index 91ed2310..4288f521 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DifferencingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DifferencingTextualNotationBuilder.cs @@ -24,7 +24,6 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; @@ -37,14 +36,14 @@ public static partial class DifferencingTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule Differencing - /// Differencing=differencingType=[QualifiedName]|ownedRelatedElement+=OwnedFeatureChain + /// Differencing=differencingType=[QualifiedName]|ownedRelatedElement+=OwnedFeatureChain /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildDifferencing(SysML2.NET.Core.POCO.Core.Types.IDifferencing poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildDifferencing(SysML2.NET.Core.POCO.Core.Types.IDifferencing poco, ICursorCache cursorCache, StringBuilder stringBuilder) { + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); if (poco.DifferencingType != null) { stringBuilder.Append(poco.DifferencingType.qualifiedName); @@ -52,18 +51,17 @@ public static int BuildDifferencing(SysML2.NET.Core.POCO.Core.Types.IDifferencin } else { - if (elementIndex < poco.OwnedRelatedElement.Count) + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Core.Features.IFeature elementAsFeature) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Core.Features.IFeature elementAsFeature) { - FeatureTextualNotationBuilder.BuildOwnedFeatureChain(elementAsFeature, stringBuilder); + FeatureTextualNotationBuilder.BuildOwnedFeatureChain(elementAsFeature, cursorCache, stringBuilder); } } } - return elementIndex; } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DisjoiningTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DisjoiningTextualNotationBuilder.cs index 0202d5b3..ba59b1d2 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DisjoiningTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DisjoiningTextualNotationBuilder.cs @@ -36,38 +36,40 @@ public static partial class DisjoiningTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule OwnedDisjoining - /// OwnedDisjoining:Disjoining=disjoiningType=[QualifiedName]|disjoiningType=FeatureChain{ownedRelatedElement+=disjoiningType} + /// OwnedDisjoining:Disjoining=disjoiningType=[QualifiedName]|disjoiningType=FeatureChain{ownedRelatedElement+=disjoiningType} /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildOwnedDisjoining(SysML2.NET.Core.POCO.Core.Types.IDisjoining poco, StringBuilder stringBuilder) + public static void BuildOwnedDisjoining(SysML2.NET.Core.POCO.Core.Types.IDisjoining poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildOwnedDisjoiningHandCoded(poco, cursorCache, stringBuilder); } /// /// 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 + /// 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 used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildDisjoining(SysML2.NET.Core.POCO.Core.Types.IDisjoining poco, StringBuilder stringBuilder) + public static void BuildDisjoining(SysML2.NET.Core.POCO.Core.Types.IDisjoining poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (BuildGroupConditionForDisjoining(poco)) + if (!string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName)) { stringBuilder.Append("disjoining "); - ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + ElementTextualNotationBuilder.BuildIdentification(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); } stringBuilder.Append("disjoint "); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildDisjoiningHandCoded(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); stringBuilder.Append("from "); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildDisjoiningHandCoded(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); - RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); + RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DocumentationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DocumentationTextualNotationBuilder.cs index faa8e2ab..8f96b881 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DocumentationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DocumentationTextualNotationBuilder.cs @@ -36,14 +36,15 @@ public static partial class DocumentationTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule Documentation - /// Documentation='doc'Identification('locale'locale=STRING_VALUE)?body=REGULAR_COMMENT + /// Documentation='doc'Identification('locale'locale=STRING_VALUE)?body=REGULAR_COMMENT /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildDocumentation(SysML2.NET.Core.POCO.Root.Annotations.IDocumentation poco, StringBuilder stringBuilder) + public static void BuildDocumentation(SysML2.NET.Core.POCO.Root.Annotations.IDocumentation poco, ICursorCache cursorCache, StringBuilder stringBuilder) { stringBuilder.Append("doc "); - ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + ElementTextualNotationBuilder.BuildIdentification(poco, cursorCache, stringBuilder); if (!string.IsNullOrWhiteSpace(poco.Locale)) { diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementFilterMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementFilterMembershipTextualNotationBuilder.cs index 0ceda220..199fc143 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementFilterMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementFilterMembershipTextualNotationBuilder.cs @@ -27,7 +27,6 @@ namespace SysML2.NET.TextualNotation using System.Linq; using System.Text; - using SysML2.NET.Core.POCO.Kernel.Packages; using SysML2.NET.Core.POCO.Root.Elements; /// @@ -37,42 +36,53 @@ public static partial class ElementFilterMembershipTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule ElementFilterMember - /// ElementFilterMember:ElementFilterMembership=MemberPrefix'filter'ownedRelatedElement+=OwnedExpression';' + /// ElementFilterMember:ElementFilterMembership=MemberPrefix'filter'ownedRelatedElement+=OwnedExpression';' /// /// The from which the rule should be build - /// + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildElementFilterMember(IElementFilterMembership poco, ICursorCache cursor, StringBuilder stringBuilder) + public static void BuildElementFilterMember(SysML2.NET.Core.POCO.Kernel.Packages.IElementFilterMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("filter "); - ownedRelatedElementOfExpressionIterator.MoveNext(); - if (ownedRelatedElementOfExpressionIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - ExpressionTextualNotationBuilder.BuildOwnedExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Kernel.Functions.IExpression elementAsExpression) + { + ExpressionTextualNotationBuilder.BuildOwnedExpression(elementAsExpression, cursorCache, stringBuilder); + } } - stringBuilder.Append(";"); + ownedRelatedElementCursor.Move(); + + stringBuilder.AppendLine(";"); } /// /// Builds the Textual Notation string for the rule FilterPackageMember - /// FilterPackageMember:ElementFilterMembership='['ownedRelatedElement+=OwnedExpression']' + /// FilterPackageMember:ElementFilterMembership='['ownedRelatedElement+=OwnedExpression']' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildFilterPackageMember(SysML2.NET.Core.POCO.Kernel.Packages.IElementFilterMembership poco, StringBuilder stringBuilder) + public static void BuildFilterPackageMember(SysML2.NET.Core.POCO.Kernel.Packages.IElementFilterMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); stringBuilder.Append("["); - ownedRelatedElementOfExpressionIterator.MoveNext(); - if (ownedRelatedElementOfExpressionIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - ExpressionTextualNotationBuilder.BuildOwnedExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Kernel.Functions.IExpression elementAsExpression) + { + ExpressionTextualNotationBuilder.BuildOwnedExpression(elementAsExpression, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + stringBuilder.Append("]"); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementTextualNotationBuilder.cs index dd403606..d151f56a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementTextualNotationBuilder.cs @@ -36,11 +36,12 @@ public static partial class ElementTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule Identification - /// Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? + /// Identification:Element=('<'declaredShortName=NAME'>')?(declaredName=NAME)? /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildIdentification(SysML2.NET.Core.POCO.Root.Elements.IElement poco, StringBuilder stringBuilder) + public static void BuildIdentification(SysML2.NET.Core.POCO.Root.Elements.IElement poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (!string.IsNullOrWhiteSpace(poco.DeclaredShortName)) @@ -55,7 +56,6 @@ public static void BuildIdentification(SysML2.NET.Core.POCO.Root.Elements.IEleme if (!string.IsNullOrWhiteSpace(poco.DeclaredName)) { stringBuilder.Append(poco.DeclaredName); - stringBuilder.Append(' '); } @@ -63,31 +63,32 @@ public static void BuildIdentification(SysML2.NET.Core.POCO.Root.Elements.IEleme /// /// 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 + /// 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 used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildDefinitionElement(IElement poco, ICursorCache cursor, StringBuilder stringBuilder) + public static void BuildDefinitionElement(SysML2.NET.Core.POCO.Root.Elements.IElement poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); + BuildDefinitionElementHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule OwnedRelatedElement - /// OwnedRelatedElement:Element=NonFeatureElement|FeatureElement + /// OwnedRelatedElement:Element=NonFeatureElement|FeatureElement /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildOwnedRelatedElement(SysML2.NET.Core.POCO.Root.Elements.IElement poco, StringBuilder stringBuilder) + public static void BuildOwnedRelatedElement(SysML2.NET.Core.POCO.Root.Elements.IElement poco, ICursorCache cursorCache, StringBuilder stringBuilder) { switch (poco) { - case SysML2.NET.Core.POCO.Core.Features.Feature pocoFeature: - FeatureTextualNotationBuilder.BuildFeatureElement(pocoFeature, stringBuilder); + case SysML2.NET.Core.POCO.Core.Features.IFeature pocoFeature: + FeatureTextualNotationBuilder.BuildFeatureElement(pocoFeature, cursorCache, stringBuilder); break; default: - BuildNonFeatureElement(poco, stringBuilder); + BuildNonFeatureElement(poco, cursorCache, stringBuilder); break; } @@ -95,19 +96,20 @@ public static void BuildOwnedRelatedElement(SysML2.NET.Core.POCO.Root.Elements.I /// /// Builds the Textual Notation string for the rule MemberElement - /// MemberElement:Element=AnnotatingElement|NonFeatureElement + /// MemberElement:Element=AnnotatingElement|NonFeatureElement /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildMemberElement(SysML2.NET.Core.POCO.Root.Elements.IElement poco, StringBuilder stringBuilder) + public static void BuildMemberElement(SysML2.NET.Core.POCO.Root.Elements.IElement poco, ICursorCache cursorCache, StringBuilder stringBuilder) { switch (poco) { - case SysML2.NET.Core.POCO.Root.Annotations.AnnotatingElement pocoAnnotatingElement: - AnnotatingElementTextualNotationBuilder.BuildAnnotatingElement(pocoAnnotatingElement, stringBuilder); + case SysML2.NET.Core.POCO.Root.Annotations.IAnnotatingElement pocoAnnotatingElement: + AnnotatingElementTextualNotationBuilder.BuildAnnotatingElement(pocoAnnotatingElement, cursorCache, stringBuilder); break; default: - BuildNonFeatureElement(poco, stringBuilder); + BuildNonFeatureElement(poco, cursorCache, stringBuilder); break; } @@ -115,91 +117,92 @@ public static void BuildMemberElement(SysML2.NET.Core.POCO.Root.Elements.IElemen /// /// 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 + /// 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 used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildNonFeatureElement(SysML2.NET.Core.POCO.Root.Elements.IElement poco, StringBuilder stringBuilder) + public static void BuildNonFeatureElement(SysML2.NET.Core.POCO.Root.Elements.IElement poco, ICursorCache cursorCache, StringBuilder stringBuilder) { switch (poco) { - case SysML2.NET.Core.POCO.Root.Dependencies.Dependency pocoDependency: - DependencyTextualNotationBuilder.BuildDependency(pocoDependency, stringBuilder); + case SysML2.NET.Core.POCO.Kernel.Associations.IAssociationStructure pocoAssociationStructure: + AssociationStructureTextualNotationBuilder.BuildAssociationStructure(pocoAssociationStructure, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Core.Features.Subsetting pocoSubsetting: - SubsettingTextualNotationBuilder.BuildSubsetting(pocoSubsetting, stringBuilder); + case SysML2.NET.Core.POCO.Kernel.Interactions.IInteraction pocoInteraction: + InteractionTextualNotationBuilder.BuildInteraction(pocoInteraction, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Core.Features.FeatureTyping pocoFeatureTyping: - FeatureTypingTextualNotationBuilder.BuildFeatureTyping(pocoFeatureTyping, stringBuilder); + case SysML2.NET.Core.POCO.Kernel.Functions.IPredicate pocoPredicate: + PredicateTextualNotationBuilder.BuildPredicate(pocoPredicate, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Core.Features.FeatureInverting pocoFeatureInverting: - FeatureInvertingTextualNotationBuilder.BuildFeatureInverting(pocoFeatureInverting, stringBuilder); + case SysML2.NET.Core.POCO.Kernel.Metadata.IMetaclass pocoMetaclass: + MetaclassTextualNotationBuilder.BuildMetaclass(pocoMetaclass, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Core.Types.Disjoining pocoDisjoining: - DisjoiningTextualNotationBuilder.BuildDisjoining(pocoDisjoining, stringBuilder); + case SysML2.NET.Core.POCO.Kernel.Functions.IFunction pocoFunction: + FunctionTextualNotationBuilder.BuildFunction(pocoFunction, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Core.Classifiers.Subclassification pocoSubclassification: - SubclassificationTextualNotationBuilder.BuildSubclassification(pocoSubclassification, stringBuilder); + case SysML2.NET.Core.POCO.Kernel.Structures.IStructure pocoStructure: + StructureTextualNotationBuilder.BuildStructure(pocoStructure, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Core.Types.Conjugation pocoConjugation: - ConjugationTextualNotationBuilder.BuildConjugation(pocoConjugation, stringBuilder); + case SysML2.NET.Core.POCO.Kernel.Associations.IAssociation pocoAssociation: + AssociationTextualNotationBuilder.BuildAssociation(pocoAssociation, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Core.Types.Specialization pocoSpecialization: - SpecializationTextualNotationBuilder.BuildSpecialization(pocoSpecialization, stringBuilder); + case SysML2.NET.Core.POCO.Kernel.Behaviors.IBehavior pocoBehavior: + BehaviorTextualNotationBuilder.BuildBehavior(pocoBehavior, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Kernel.Packages.LibraryPackage pocoLibraryPackage: - LibraryPackageTextualNotationBuilder.BuildLibraryPackage(pocoLibraryPackage, stringBuilder); + case SysML2.NET.Core.POCO.Kernel.DataTypes.IDataType pocoDataType: + DataTypeTextualNotationBuilder.BuildDataType(pocoDataType, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Kernel.Packages.Package pocoPackage: - PackageTextualNotationBuilder.BuildPackage(pocoPackage, stringBuilder); + case SysML2.NET.Core.POCO.Kernel.Classes.IClass pocoClass: + ClassTextualNotationBuilder.BuildClass(pocoClass, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Core.Types.Multiplicity pocoMultiplicity: - MultiplicityTextualNotationBuilder.BuildMultiplicity(pocoMultiplicity, stringBuilder); + case SysML2.NET.Core.POCO.Core.Types.IMultiplicity pocoMultiplicity: + MultiplicityTextualNotationBuilder.BuildMultiplicity(pocoMultiplicity, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Kernel.Functions.Predicate pocoPredicate: - PredicateTextualNotationBuilder.BuildPredicate(pocoPredicate, stringBuilder); + case SysML2.NET.Core.POCO.Core.Features.IRedefinition pocoRedefinition: + RedefinitionTextualNotationBuilder.BuildRedefinition(pocoRedefinition, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Kernel.Functions.Function pocoFunction: - FunctionTextualNotationBuilder.BuildFunction(pocoFunction, stringBuilder); + case SysML2.NET.Core.POCO.Core.Classifiers.IClassifier pocoClassifier: + ClassifierTextualNotationBuilder.BuildClassifier(pocoClassifier, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Kernel.Interactions.Interaction pocoInteraction: - InteractionTextualNotationBuilder.BuildInteraction(pocoInteraction, stringBuilder); + case SysML2.NET.Core.POCO.Kernel.Packages.ILibraryPackage pocoLibraryPackage: + LibraryPackageTextualNotationBuilder.BuildLibraryPackage(pocoLibraryPackage, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Kernel.Behaviors.Behavior pocoBehavior: - BehaviorTextualNotationBuilder.BuildBehavior(pocoBehavior, stringBuilder); + case SysML2.NET.Core.POCO.Core.Classifiers.ISubclassification pocoSubclassification: + SubclassificationTextualNotationBuilder.BuildSubclassification(pocoSubclassification, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Kernel.Associations.AssociationStructure pocoAssociationStructure: - AssociationStructureTextualNotationBuilder.BuildAssociationStructure(pocoAssociationStructure, stringBuilder); + case SysML2.NET.Core.POCO.Core.Features.IFeatureTyping pocoFeatureTyping: + FeatureTypingTextualNotationBuilder.BuildFeatureTyping(pocoFeatureTyping, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Kernel.Associations.Association pocoAssociation: - AssociationTextualNotationBuilder.BuildAssociation(pocoAssociation, stringBuilder); + case SysML2.NET.Core.POCO.Core.Features.ISubsetting pocoSubsetting: + SubsettingTextualNotationBuilder.BuildSubsetting(pocoSubsetting, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Kernel.Metadata.Metaclass pocoMetaclass: - MetaclassTextualNotationBuilder.BuildMetaclass(pocoMetaclass, stringBuilder); + case SysML2.NET.Core.POCO.Root.Dependencies.IDependency pocoDependency: + DependencyTextualNotationBuilder.BuildDependency(pocoDependency, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Kernel.Structures.Structure pocoStructure: - StructureTextualNotationBuilder.BuildStructure(pocoStructure, stringBuilder); + case SysML2.NET.Core.POCO.Core.Types.IType pocoType: + TypeTextualNotationBuilder.BuildType(pocoType, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Kernel.Classes.Class pocoClass: - ClassTextualNotationBuilder.BuildClass(pocoClass, stringBuilder); + case SysML2.NET.Core.POCO.Kernel.Packages.IPackage pocoPackage: + PackageTextualNotationBuilder.BuildPackage(pocoPackage, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Kernel.DataTypes.DataType pocoDataType: - DataTypeTextualNotationBuilder.BuildDataType(pocoDataType, stringBuilder); + case SysML2.NET.Core.POCO.Core.Types.ISpecialization pocoSpecialization: + SpecializationTextualNotationBuilder.BuildSpecialization(pocoSpecialization, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Core.Classifiers.Classifier pocoClassifier: - ClassifierTextualNotationBuilder.BuildClassifier(pocoClassifier, stringBuilder); + case SysML2.NET.Core.POCO.Core.Types.IConjugation pocoConjugation: + ConjugationTextualNotationBuilder.BuildConjugation(pocoConjugation, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Core.Types.Type pocoType: - TypeTextualNotationBuilder.BuildType(pocoType, stringBuilder); + case SysML2.NET.Core.POCO.Core.Types.IDisjoining pocoDisjoining: + DisjoiningTextualNotationBuilder.BuildDisjoining(pocoDisjoining, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Root.Namespaces.Namespace pocoNamespace: - NamespaceTextualNotationBuilder.BuildNamespace(pocoNamespace, stringBuilder); + case SysML2.NET.Core.POCO.Core.Features.IFeatureInverting pocoFeatureInverting: + FeatureInvertingTextualNotationBuilder.BuildFeatureInverting(pocoFeatureInverting, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Core.Features.Redefinition pocoRedefinition: - RedefinitionTextualNotationBuilder.BuildRedefinition(pocoRedefinition, stringBuilder); + case SysML2.NET.Core.POCO.Core.Features.ITypeFeaturing pocoTypeFeaturing: + TypeFeaturingTextualNotationBuilder.BuildTypeFeaturing(pocoTypeFeaturing, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Core.Features.TypeFeaturing pocoTypeFeaturing: - TypeFeaturingTextualNotationBuilder.BuildTypeFeaturing(pocoTypeFeaturing, stringBuilder); + case SysML2.NET.Core.POCO.Root.Namespaces.INamespace pocoNamespace: + NamespaceTextualNotationBuilder.BuildNamespace(pocoNamespace, cursorCache, stringBuilder); break; } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EndFeatureMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EndFeatureMembershipTextualNotationBuilder.cs index 45e0c3a9..38e7de22 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EndFeatureMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EndFeatureMembershipTextualNotationBuilder.cs @@ -24,7 +24,6 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; @@ -37,117 +36,122 @@ public static partial class EndFeatureMembershipTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule SourceEndMember - /// SourceEndMember:EndFeatureMembership=ownedRelatedElement+=SourceEnd + /// SourceEndMember:EndFeatureMembership=ownedRelatedElement+=SourceEnd /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildSourceEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildSourceEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelatedElement.Count) + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage elementAsReferenceUsage) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage elementAsReferenceUsage) { - ReferenceUsageTextualNotationBuilder.BuildSourceEnd(elementAsReferenceUsage, stringBuilder); + ReferenceUsageTextualNotationBuilder.BuildSourceEnd(elementAsReferenceUsage, cursorCache, stringBuilder); } } + ownedRelatedElementCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule ConnectorEndMember - /// ConnectorEndMember:EndFeatureMembership=ownedRelatedElement+=ConnectorEnd + /// ConnectorEndMember:EndFeatureMembership=ownedRelatedElement+=ConnectorEnd /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildConnectorEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildConnectorEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelatedElement.Count) + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage elementAsReferenceUsage) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage elementAsReferenceUsage) { - ReferenceUsageTextualNotationBuilder.BuildConnectorEnd(elementAsReferenceUsage, stringBuilder); + ReferenceUsageTextualNotationBuilder.BuildConnectorEnd(elementAsReferenceUsage, cursorCache, stringBuilder); } } + ownedRelatedElementCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule InterfaceEndMember - /// InterfaceEndMember:EndFeatureMembership=ownedRelatedElement+=InterfaceEnd + /// InterfaceEndMember:EndFeatureMembership=ownedRelatedElement+=InterfaceEnd /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildInterfaceEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildInterfaceEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelatedElement.Count) + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Systems.Ports.IPortUsage elementAsPortUsage) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.Ports.IPortUsage elementAsPortUsage) { - PortUsageTextualNotationBuilder.BuildInterfaceEnd(elementAsPortUsage, stringBuilder); + PortUsageTextualNotationBuilder.BuildInterfaceEnd(elementAsPortUsage, cursorCache, stringBuilder); } } + ownedRelatedElementCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule FlowEndMember - /// FlowEndMember:EndFeatureMembership=ownedRelatedElement+=FlowEnd + /// FlowEndMember:EndFeatureMembership=ownedRelatedElement+=FlowEnd /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildFlowEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildFlowEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelatedElement.Count) + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Kernel.Interactions.IFlowEnd elementAsFlowEnd) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Kernel.Interactions.IFlowEnd elementAsFlowEnd) { - FlowEndTextualNotationBuilder.BuildFlowEnd(elementAsFlowEnd, stringBuilder); + FlowEndTextualNotationBuilder.BuildFlowEnd(elementAsFlowEnd, cursorCache, stringBuilder); } } + ownedRelatedElementCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule EmptyEndMember - /// EmptyEndMember:EndFeatureMembership=ownedRelatedElement+=EmptyFeature + /// EmptyEndMember:EndFeatureMembership=ownedRelatedElement+=EmptyFeature /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildEmptyEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildEmptyEndMember(SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelatedElement.Count) + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage elementAsReferenceUsage) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage elementAsReferenceUsage) { - ReferenceUsageTextualNotationBuilder.BuildEmptyFeature(elementAsReferenceUsage, stringBuilder); + ReferenceUsageTextualNotationBuilder.BuildEmptyFeature(elementAsReferenceUsage, cursorCache, stringBuilder); } } + ownedRelatedElementCursor.Move(); + - return elementIndex; } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationDefinitionTextualNotationBuilder.cs index de05297a..0e68fd89 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationDefinitionTextualNotationBuilder.cs @@ -36,32 +36,46 @@ public static partial class EnumerationDefinitionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule EnumerationBody - /// EnumerationBody:EnumerationDefinition=';'|'{'(ownedRelationship+=AnnotatingMember|ownedRelationship+=EnumerationUsageMember)*'}' + /// EnumerationBody:EnumerationDefinition=';'|'{'(ownedRelationship+=AnnotatingMember|ownedRelationship+=EnumerationUsageMember)*'}' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildEnumerationBody(SysML2.NET.Core.POCO.Systems.Enumerations.IEnumerationDefinition poco, StringBuilder stringBuilder) + public static void BuildEnumerationBody(SysML2.NET.Core.POCO.Systems.Enumerations.IEnumerationDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + if (poco.OwnedRelationship.Count == 0) + { + stringBuilder.AppendLine(";"); + } + else + { + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + stringBuilder.AppendLine("{"); + // Have to handle group collection + stringBuilder.AppendLine("}"); + } + } /// /// Builds the Textual Notation string for the rule EnumerationDefinition - /// EnumerationDefinition=DefinitionExtensionKeyword*'enum''def'DefinitionDeclarationEnumerationBody + /// EnumerationDefinition=DefinitionExtensionKeyword*'enum''def'DefinitionDeclarationEnumerationBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildEnumerationDefinition(SysML2.NET.Core.POCO.Systems.Enumerations.IEnumerationDefinition poco, StringBuilder stringBuilder) + public static void BuildEnumerationDefinition(SysML2.NET.Core.POCO.Systems.Enumerations.IEnumerationDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - // Handle collection Non Terminal - for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + while (ownedRelationshipCursor.Current != null) { - ownedRelationshipIndex = DefinitionTextualNotationBuilder.BuildDefinitionExtensionKeyword(poco, ownedRelationshipIndex, stringBuilder); + DefinitionTextualNotationBuilder.BuildDefinitionExtensionKeyword(poco, cursorCache, stringBuilder); } + stringBuilder.Append("enum "); stringBuilder.Append("def "); - DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); - BuildEnumerationBody(poco, stringBuilder); + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, cursorCache, stringBuilder); + BuildEnumerationBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationUsageTextualNotationBuilder.cs index 9058751c..6897410e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationUsageTextualNotationBuilder.cs @@ -36,28 +36,30 @@ public static partial class EnumerationUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule EnumeratedValue - /// EnumeratedValue:EnumerationUsage='enum'?Usage + /// EnumeratedValue:EnumerationUsage='enum'?Usage /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildEnumeratedValue(SysML2.NET.Core.POCO.Systems.Enumerations.IEnumerationUsage poco, StringBuilder stringBuilder) + public static void BuildEnumeratedValue(SysML2.NET.Core.POCO.Systems.Enumerations.IEnumerationUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { stringBuilder.Append("enum "); - UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); + UsageTextualNotationBuilder.BuildUsage(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule EnumerationUsage - /// EnumerationUsage:EnumerationUsage=UsagePrefix'enum'Usage + /// EnumerationUsage:EnumerationUsage=UsagePrefix'enum'Usage /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildEnumerationUsage(SysML2.NET.Core.POCO.Systems.Enumerations.IEnumerationUsage poco, StringBuilder stringBuilder) + public static void BuildEnumerationUsage(SysML2.NET.Core.POCO.Systems.Enumerations.IEnumerationUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - UsageTextualNotationBuilder.BuildUsagePrefix(poco, stringBuilder); + UsageTextualNotationBuilder.BuildUsagePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("enum "); - UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); + UsageTextualNotationBuilder.BuildUsage(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EventOccurrenceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EventOccurrenceUsageTextualNotationBuilder.cs index 317e9911..8bda58fa 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EventOccurrenceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EventOccurrenceUsageTextualNotationBuilder.cs @@ -24,7 +24,6 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; @@ -37,41 +36,43 @@ public static partial class EventOccurrenceUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule MessageEvent - /// MessageEvent:EventOccurrenceUsage=ownedRelationship+=OwnedReferenceSubsetting + /// MessageEvent:EventOccurrenceUsage=ownedRelationship+=OwnedReferenceSubsetting /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildMessageEvent(SysML2.NET.Core.POCO.Systems.Occurrences.IEventOccurrenceUsage poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildMessageEvent(SysML2.NET.Core.POCO.Systems.Occurrences.IEventOccurrenceUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelationship.Count) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + + if (ownedRelationshipCursor.Current != null) { - var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; - if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Core.Features.IReferenceSubsetting elementAsReferenceSubsetting) + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IReferenceSubsetting elementAsReferenceSubsetting) { - ReferenceSubsettingTextualNotationBuilder.BuildOwnedReferenceSubsetting(elementAsReferenceSubsetting, stringBuilder); + ReferenceSubsettingTextualNotationBuilder.BuildOwnedReferenceSubsetting(elementAsReferenceSubsetting, cursorCache, stringBuilder); } } + ownedRelationshipCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule EventOccurrenceUsage - /// EventOccurrenceUsage=OccurrenceUsagePrefix'event'(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'occurrence'UsageDeclaration?)UsageCompletion + /// EventOccurrenceUsage=OccurrenceUsagePrefix'event'(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'occurrence'UsageDeclaration?)UsageCompletion /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildEventOccurrenceUsage(SysML2.NET.Core.POCO.Systems.Occurrences.IEventOccurrenceUsage poco, StringBuilder stringBuilder) + public static void BuildEventOccurrenceUsage(SysML2.NET.Core.POCO.Systems.Occurrences.IEventOccurrenceUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfReferenceSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("event "); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildEventOccurrenceUsageHandCoded(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); - UsageTextualNotationBuilder.BuildUsageCompletion(poco, stringBuilder); + UsageTextualNotationBuilder.BuildUsageCompletion(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExhibitStateUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExhibitStateUsageTextualNotationBuilder.cs index ac50e248..e4025a5b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExhibitStateUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExhibitStateUsageTextualNotationBuilder.cs @@ -36,19 +36,24 @@ public static partial class ExhibitStateUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule ExhibitStateUsage - /// ExhibitStateUsage=OccurrenceUsagePrefix'exhibit'(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'state'UsageDeclaration)ValuePart?StateUsageBody + /// ExhibitStateUsage=OccurrenceUsagePrefix'exhibit'(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'state'UsageDeclaration)ValuePart?StateUsageBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildExhibitStateUsage(SysML2.NET.Core.POCO.Systems.States.IExhibitStateUsage poco, StringBuilder stringBuilder) + public static void BuildExhibitStateUsage(SysML2.NET.Core.POCO.Systems.States.IExhibitStateUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfReferenceSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("exhibit "); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildExhibitStateUsageHandCoded(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); - FeatureTextualNotationBuilder.BuildValuePart(poco, 0, stringBuilder); - StateUsageTextualNotationBuilder.BuildStateUsageBody(poco, stringBuilder); + + if (poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || !string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.Direction.HasValue || poco.IsDerived || poco.IsAbstract || poco.IsConstant || poco.IsOrdered || poco.IsEnd || poco.importedMembership.Count != 0 || poco.IsComposite || poco.IsPortion || poco.IsVariable || poco.IsSufficient || poco.unioningType.Count != 0 || poco.intersectingType.Count != 0 || poco.differencingType.Count != 0 || poco.featuringType.Count != 0 || poco.ownedTypeFeaturing.Count != 0) + { + FeatureTextualNotationBuilder.BuildValuePart(poco, cursorCache, stringBuilder); + } + StateUsageTextualNotationBuilder.BuildStateUsageBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExposeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExposeTextualNotationBuilder.cs index cbae110f..392956e5 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExposeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExposeTextualNotationBuilder.cs @@ -36,25 +36,26 @@ public static partial class ExposeTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule Expose - /// Expose='expose'(MembershipExpose|NamespaceExpose)RelationshipBody + /// Expose='expose'(MembershipExpose|NamespaceExpose)RelationshipBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildExpose(SysML2.NET.Core.POCO.Systems.Views.IExpose poco, StringBuilder stringBuilder) + public static void BuildExpose(SysML2.NET.Core.POCO.Systems.Views.IExpose poco, ICursorCache cursorCache, StringBuilder stringBuilder) { stringBuilder.Append("expose "); switch (poco) { - case SysML2.NET.Core.POCO.Systems.Views.MembershipExpose pocoMembershipExpose: - MembershipExposeTextualNotationBuilder.BuildMembershipExpose(pocoMembershipExpose, stringBuilder); + case SysML2.NET.Core.POCO.Systems.Views.IMembershipExpose pocoMembershipExpose: + MembershipExposeTextualNotationBuilder.BuildMembershipExpose(pocoMembershipExpose, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Views.NamespaceExpose pocoNamespaceExpose: - NamespaceExposeTextualNotationBuilder.BuildNamespaceExpose(pocoNamespaceExpose, stringBuilder); + case SysML2.NET.Core.POCO.Systems.Views.INamespaceExpose pocoNamespaceExpose: + NamespaceExposeTextualNotationBuilder.BuildNamespaceExpose(pocoNamespaceExpose, cursorCache, stringBuilder); break; } stringBuilder.Append(' '); - RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); + RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs index 2c89626f..81f9fa10 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs @@ -24,7 +24,6 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; @@ -37,30 +36,32 @@ public static partial class ExpressionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule OwnedExpression - /// OwnedExpression:Expression=ConditionalExpression|ConditionalBinaryOperatorExpression|BinaryOperatorExpression|UnaryOperatorExpression|ClassificationExpression|MetaclassificationExpression|ExtentExpression|PrimaryExpression + /// OwnedExpression:Expression=ConditionalExpression|ConditionalBinaryOperatorExpression|BinaryOperatorExpression|UnaryOperatorExpression|ClassificationExpression|MetaclassificationExpression|ExtentExpression|PrimaryExpression /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildOwnedExpression(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, StringBuilder stringBuilder) + public static void BuildOwnedExpression(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); + BuildOwnedExpressionHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule PrimaryExpression - /// PrimaryExpression:Expression=FeatureChainExpression|NonFeatureChainPrimaryExpression + /// PrimaryExpression:Expression=FeatureChainExpression|NonFeatureChainPrimaryExpression /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildPrimaryExpression(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, StringBuilder stringBuilder) + public static void BuildPrimaryExpression(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { switch (poco) { - case SysML2.NET.Core.POCO.Kernel.Expressions.FeatureChainExpression pocoFeatureChainExpression: - FeatureChainExpressionTextualNotationBuilder.BuildFeatureChainExpression(pocoFeatureChainExpression, stringBuilder); + case SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureChainExpression pocoFeatureChainExpression: + FeatureChainExpressionTextualNotationBuilder.BuildFeatureChainExpression(pocoFeatureChainExpression, cursorCache, stringBuilder); break; default: - BuildNonFeatureChainPrimaryExpression(poco, stringBuilder); + BuildNonFeatureChainPrimaryExpression(poco, cursorCache, stringBuilder); break; } @@ -68,114 +69,130 @@ public static void BuildPrimaryExpression(SysML2.NET.Core.POCO.Kernel.Functions. /// /// Builds the Textual Notation string for the rule NonFeatureChainPrimaryExpression - /// NonFeatureChainPrimaryExpression:Expression=BracketExpression|IndexExpression|SequenceExpression|SelectExpression|CollectExpression|FunctionOperationExpression|BaseExpression + /// NonFeatureChainPrimaryExpression:Expression=BracketExpression|IndexExpression|SequenceExpression|SelectExpression|CollectExpression|FunctionOperationExpression|BaseExpression /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildNonFeatureChainPrimaryExpression(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, StringBuilder stringBuilder) + public static void BuildNonFeatureChainPrimaryExpression(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); + BuildNonFeatureChainPrimaryExpressionHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule SequenceExpression - /// SequenceExpression:Expression='('SequenceExpressionList')' + /// SequenceExpression:Expression='('SequenceExpressionList')' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildSequenceExpression(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, StringBuilder stringBuilder) + public static void BuildSequenceExpression(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { stringBuilder.Append("("); - BuildSequenceExpressionList(poco, stringBuilder); + BuildSequenceExpressionList(poco, cursorCache, stringBuilder); stringBuilder.Append(")"); } /// /// Builds the Textual Notation string for the rule SequenceExpressionList - /// SequenceExpressionList:Expression=OwnedExpression','?|SequenceOperatorExpression + /// SequenceExpressionList:Expression=OwnedExpression','?|SequenceOperatorExpression /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildSequenceExpressionList(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, StringBuilder stringBuilder) + public static void BuildSequenceExpressionList(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildSequenceExpressionListHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule FunctionReference - /// FunctionReference:Expression=ownedRelationship+=ReferenceTyping + /// FunctionReference:Expression=ownedRelationship+=ReferenceTyping /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildFunctionReference(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildFunctionReference(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelationship.Count) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + + if (ownedRelationshipCursor.Current != null) { - var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; - if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Core.Features.IFeatureTyping elementAsFeatureTyping) + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IFeatureTyping elementAsFeatureTyping) { - FeatureTypingTextualNotationBuilder.BuildReferenceTyping(elementAsFeatureTyping, stringBuilder); + FeatureTypingTextualNotationBuilder.BuildReferenceTyping(elementAsFeatureTyping, cursorCache, stringBuilder); } } + ownedRelationshipCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule BaseExpression - /// BaseExpression:Expression=NullExpression|LiteralExpression|FeatureReferenceExpression|MetadataAccessExpression|InvocationExpression|ConstructorExpression|BodyExpression + /// BaseExpression:Expression=NullExpression|LiteralExpression|FeatureReferenceExpression|MetadataAccessExpression|InvocationExpression|ConstructorExpression|BodyExpression /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildBaseExpression(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, StringBuilder stringBuilder) + public static void BuildBaseExpression(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); + BuildBaseExpressionHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule ExpressionBody - /// ExpressionBody:Expression='{'FunctionBodyPart'}' + /// ExpressionBody:Expression='{'FunctionBodyPart'}' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildExpressionBody(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, StringBuilder stringBuilder) + public static void BuildExpressionBody(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - stringBuilder.Append("{"); - TypeTextualNotationBuilder.BuildFunctionBodyPart(poco, stringBuilder); - stringBuilder.Append("}"); + stringBuilder.AppendLine("{"); + TypeTextualNotationBuilder.BuildFunctionBodyPart(poco, cursorCache, stringBuilder); + stringBuilder.AppendLine("}"); } /// /// Builds the Textual Notation string for the rule Expression - /// Expression=FeaturePrefix'expr'FeatureDeclarationValuePart?FunctionBody + /// Expression=FeaturePrefix'expr'FeatureDeclarationValuePart?FunctionBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildExpression(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, StringBuilder stringBuilder) + public static void BuildExpression(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + BuildFeaturePrefixHandCoded(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); - while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + while (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfOwningMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(elementAsOwningMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); } stringBuilder.Append("expr "); - FeatureTextualNotationBuilder.BuildFeatureDeclaration(poco, stringBuilder); - FeatureTextualNotationBuilder.BuildValuePart(poco, 0, stringBuilder); - TypeTextualNotationBuilder.BuildFunctionBody(poco, stringBuilder); + FeatureTextualNotationBuilder.BuildFeatureDeclaration(poco, cursorCache, stringBuilder); + + if (poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || !string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.Direction.HasValue || poco.IsDerived || poco.IsAbstract || poco.IsConstant || poco.IsOrdered || poco.IsEnd || poco.importedMembership.Count != 0 || poco.IsComposite || poco.IsPortion || poco.IsVariable || poco.IsSufficient || poco.unioningType.Count != 0 || poco.intersectingType.Count != 0 || poco.differencingType.Count != 0 || poco.featuringType.Count != 0 || poco.ownedTypeFeaturing.Count != 0) + { + FeatureTextualNotationBuilder.BuildValuePart(poco, cursorCache, stringBuilder); + } + TypeTextualNotationBuilder.BuildFunctionBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainExpressionTextualNotationBuilder.cs index 316ae3e6..1528ecbc 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainExpressionTextualNotationBuilder.cs @@ -36,27 +36,37 @@ public static partial class FeatureChainExpressionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule FeatureChainExpression - /// FeatureChainExpression=ownedRelationship+=NonFeatureChainPrimaryArgumentMember'.'ownedRelationship+=FeatureChainMember + /// FeatureChainExpression=ownedRelationship+=NonFeatureChainPrimaryArgumentMember'.'ownedRelationship+=FeatureChainMember /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildFeatureChainExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureChainExpression poco, StringBuilder stringBuilder) + public static void BuildFeatureChainExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureChainExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - using var ownedRelationshipOfMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfParameterMembershipIterator.MoveNext(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildNonFeatureChainPrimaryArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildNonFeatureChainPrimaryArgumentMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + stringBuilder.Append("."); - ownedRelationshipOfMembershipIterator.MoveNext(); - if (ownedRelationshipOfMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - MembershipTextualNotationBuilder.BuildFeatureChainMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IMembership elementAsMembership) + { + MembershipTextualNotationBuilder.BuildFeatureChainMember(elementAsMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainingTextualNotationBuilder.cs index 795d9f87..e86a0fe6 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureChainingTextualNotationBuilder.cs @@ -36,11 +36,12 @@ public static partial class FeatureChainingTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule OwnedFeatureChaining - /// OwnedFeatureChaining:FeatureChaining=chainingFeature=[QualifiedName] + /// OwnedFeatureChaining:FeatureChaining=chainingFeature=[QualifiedName] /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildOwnedFeatureChaining(SysML2.NET.Core.POCO.Core.Features.IFeatureChaining poco, StringBuilder stringBuilder) + public static void BuildOwnedFeatureChaining(SysML2.NET.Core.POCO.Core.Features.IFeatureChaining poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.ChainingFeature != null) diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureDirectionKindTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureDirectionKindTextualNotationBuilder.cs index 78100323..b9d6903f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureDirectionKindTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureDirectionKindTextualNotationBuilder.cs @@ -36,11 +36,12 @@ public static partial class FeatureDirectionKindTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule FeatureDirection - /// FeatureDirection:FeatureDirectionKind='in'|'out'|'inout' + /// FeatureDirection:FeatureDirectionKind='in'|'out'|'inout' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildFeatureDirection(SysML2.NET.Core.Core.Types.FeatureDirectionKind poco, StringBuilder stringBuilder) + public static void BuildFeatureDirection(SysML2.NET.Core.Core.Types.FeatureDirectionKind poco, ICursorCache cursorCache, StringBuilder stringBuilder) { } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureInvertingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureInvertingTextualNotationBuilder.cs index 2592aed0..2de47221 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureInvertingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureInvertingTextualNotationBuilder.cs @@ -36,39 +36,45 @@ public static partial class FeatureInvertingTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule OwnedFeatureInverting - /// OwnedFeatureInverting:FeatureInverting=invertingFeature=[QualifiedName]|invertingFeature=OwnedFeatureChain{ownedRelatedElement+=invertingFeature} + /// OwnedFeatureInverting:FeatureInverting=invertingFeature=[QualifiedName]|invertingFeature=OwnedFeatureChain{ownedRelatedElement+=invertingFeature} /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildOwnedFeatureInverting(SysML2.NET.Core.POCO.Core.Features.IFeatureInverting poco, StringBuilder stringBuilder) + public static void BuildOwnedFeatureInverting(SysML2.NET.Core.POCO.Core.Features.IFeatureInverting poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildOwnedFeatureInvertingHandCoded(poco, cursorCache, stringBuilder); } /// /// 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 + /// 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 used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildFeatureInverting(SysML2.NET.Core.POCO.Core.Features.IFeatureInverting poco, StringBuilder stringBuilder) + public static void BuildFeatureInverting(SysML2.NET.Core.POCO.Core.Features.IFeatureInverting poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); - if (BuildGroupConditionForFeatureInverting(poco)) + if (!string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName)) { stringBuilder.Append("inverting "); - ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + + if (!string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName)) + { + ElementTextualNotationBuilder.BuildIdentification(poco, cursorCache, stringBuilder); + } stringBuilder.Append(' '); } stringBuilder.Append("inverse "); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildFeatureInvertingHandCoded(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); stringBuilder.Append("of "); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildFeatureInvertingHandCoded(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); - RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); + RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs index f91845e9..5af1bfe2 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs @@ -24,7 +24,6 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; @@ -37,378 +36,468 @@ public static partial class FeatureMembershipTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule NonOccurrenceUsageMember - /// NonOccurrenceUsageMember:FeatureMembership=MemberPrefixownedRelatedElement+=NonOccurrenceUsageElement + /// NonOccurrenceUsageMember:FeatureMembership=MemberPrefixownedRelatedElement+=NonOccurrenceUsageElement /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildNonOccurrenceUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + public static void BuildNonOccurrenceUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - ownedRelatedElementOfUsageIterator.MoveNext(); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); - if (ownedRelatedElementOfUsageIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - UsageTextualNotationBuilder.BuildNonOccurrenceUsageElement(ownedRelatedElementOfUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage elementAsUsage) + { + UsageTextualNotationBuilder.BuildNonOccurrenceUsageElement(elementAsUsage, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } /// /// Builds the Textual Notation string for the rule OccurrenceUsageMember - /// OccurrenceUsageMember:FeatureMembership=MemberPrefixownedRelatedElement+=OccurrenceUsageElement + /// OccurrenceUsageMember:FeatureMembership=MemberPrefixownedRelatedElement+=OccurrenceUsageElement /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildOccurrenceUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + public static void BuildOccurrenceUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - ownedRelatedElementOfUsageIterator.MoveNext(); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); - if (ownedRelatedElementOfUsageIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - UsageTextualNotationBuilder.BuildOccurrenceUsageElement(ownedRelatedElementOfUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage elementAsUsage) + { + UsageTextualNotationBuilder.BuildOccurrenceUsageElement(elementAsUsage, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } /// /// Builds the Textual Notation string for the rule StructureUsageMember - /// StructureUsageMember:FeatureMembership=MemberPrefixownedRelatedElement+=StructureUsageElement + /// StructureUsageMember:FeatureMembership=MemberPrefixownedRelatedElement+=StructureUsageElement /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildStructureUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + public static void BuildStructureUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - ownedRelatedElementOfUsageIterator.MoveNext(); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); - if (ownedRelatedElementOfUsageIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - UsageTextualNotationBuilder.BuildStructureUsageElement(ownedRelatedElementOfUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage elementAsUsage) + { + UsageTextualNotationBuilder.BuildStructureUsageElement(elementAsUsage, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } /// /// Builds the Textual Notation string for the rule BehaviorUsageMember - /// BehaviorUsageMember:FeatureMembership=MemberPrefixownedRelatedElement+=BehaviorUsageElement + /// BehaviorUsageMember:FeatureMembership=MemberPrefixownedRelatedElement+=BehaviorUsageElement /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildBehaviorUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + public static void BuildBehaviorUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - ownedRelatedElementOfUsageIterator.MoveNext(); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); - if (ownedRelatedElementOfUsageIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - UsageTextualNotationBuilder.BuildBehaviorUsageElement(ownedRelatedElementOfUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage elementAsUsage) + { + UsageTextualNotationBuilder.BuildBehaviorUsageElement(elementAsUsage, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } /// /// Builds the Textual Notation string for the rule SourceSuccessionMember - /// SourceSuccessionMember:FeatureMembership='then'ownedRelatedElement+=SourceSuccession + /// SourceSuccessionMember:FeatureMembership='then'ownedRelatedElement+=SourceSuccession /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildSourceSuccessionMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + public static void BuildSourceSuccessionMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfSuccessionAsUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); stringBuilder.Append("then "); - ownedRelatedElementOfSuccessionAsUsageIterator.MoveNext(); - if (ownedRelatedElementOfSuccessionAsUsageIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - SuccessionAsUsageTextualNotationBuilder.BuildSourceSuccession(ownedRelatedElementOfSuccessionAsUsageIterator.Current, 0, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.Connections.ISuccessionAsUsage elementAsSuccessionAsUsage) + { + SuccessionAsUsageTextualNotationBuilder.BuildSourceSuccession(elementAsSuccessionAsUsage, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } /// /// Builds the Textual Notation string for the rule InterfaceNonOccurrenceUsageMember - /// InterfaceNonOccurrenceUsageMember:FeatureMembership=MemberPrefixownedRelatedElement+=InterfaceNonOccurrenceUsageElement + /// InterfaceNonOccurrenceUsageMember:FeatureMembership=MemberPrefixownedRelatedElement+=InterfaceNonOccurrenceUsageElement /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildInterfaceNonOccurrenceUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + public static void BuildInterfaceNonOccurrenceUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - ownedRelatedElementOfUsageIterator.MoveNext(); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); - if (ownedRelatedElementOfUsageIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - UsageTextualNotationBuilder.BuildInterfaceNonOccurrenceUsageElement(ownedRelatedElementOfUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage elementAsUsage) + { + UsageTextualNotationBuilder.BuildInterfaceNonOccurrenceUsageElement(elementAsUsage, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } /// /// Builds the Textual Notation string for the rule InterfaceOccurrenceUsageMember - /// InterfaceOccurrenceUsageMember:FeatureMembership=MemberPrefixownedRelatedElement+=InterfaceOccurrenceUsageElement + /// InterfaceOccurrenceUsageMember:FeatureMembership=MemberPrefixownedRelatedElement+=InterfaceOccurrenceUsageElement /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildInterfaceOccurrenceUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + public static void BuildInterfaceOccurrenceUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - ownedRelatedElementOfUsageIterator.MoveNext(); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); - if (ownedRelatedElementOfUsageIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - UsageTextualNotationBuilder.BuildInterfaceOccurrenceUsageElement(ownedRelatedElementOfUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage elementAsUsage) + { + UsageTextualNotationBuilder.BuildInterfaceOccurrenceUsageElement(elementAsUsage, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } /// /// Builds the Textual Notation string for the rule FlowPayloadFeatureMember - /// FlowPayloadFeatureMember:FeatureMembership=ownedRelatedElement+=FlowPayloadFeature + /// FlowPayloadFeatureMember:FeatureMembership=ownedRelatedElement+=FlowPayloadFeature /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildFlowPayloadFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildFlowPayloadFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelatedElement.Count) + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Kernel.Interactions.IPayloadFeature elementAsPayloadFeature) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Kernel.Interactions.IPayloadFeature elementAsPayloadFeature) { - PayloadFeatureTextualNotationBuilder.BuildFlowPayloadFeature(elementAsPayloadFeature, stringBuilder); + PayloadFeatureTextualNotationBuilder.BuildFlowPayloadFeature(elementAsPayloadFeature, cursorCache, stringBuilder); } } + ownedRelatedElementCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule FlowFeatureMember - /// FlowFeatureMember:FeatureMembership=ownedRelatedElement+=FlowFeature + /// FlowFeatureMember:FeatureMembership=ownedRelatedElement+=FlowFeature /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildFlowFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildFlowFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelatedElement.Count) + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage elementAsReferenceUsage) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage elementAsReferenceUsage) { - ReferenceUsageTextualNotationBuilder.BuildFlowFeature(elementAsReferenceUsage, 0, stringBuilder); + ReferenceUsageTextualNotationBuilder.BuildFlowFeature(elementAsReferenceUsage, cursorCache, stringBuilder); } } + ownedRelatedElementCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule ActionBehaviorMember - /// ActionBehaviorMember:FeatureMembership=BehaviorUsageMember|ActionNodeMember + /// ActionBehaviorMember:FeatureMembership=BehaviorUsageMember|ActionNodeMember /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildActionBehaviorMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + public static void BuildActionBehaviorMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); + BuildActionBehaviorMemberHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule InitialNodeMember - /// InitialNodeMember:FeatureMembership=MemberPrefix'first'memberFeature=[QualifiedName]RelationshipBody + /// InitialNodeMember:FeatureMembership=MemberPrefix'first'memberFeature=[QualifiedName]RelationshipBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildInitialNodeMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + public static void BuildInitialNodeMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("first "); - BuildMemberFeature(poco, stringBuilder); - RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); + BuildMemberFeature(poco, cursorCache, stringBuilder); + RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule ActionNodeMember - /// ActionNodeMember:FeatureMembership=MemberPrefixownedRelatedElement+=ActionNode + /// ActionNodeMember:FeatureMembership=MemberPrefixownedRelatedElement+=ActionNode /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildActionNodeMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + public static void BuildActionNodeMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfActionUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - ownedRelatedElementOfActionUsageIterator.MoveNext(); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); - if (ownedRelatedElementOfActionUsageIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - ActionUsageTextualNotationBuilder.BuildActionNode(ownedRelatedElementOfActionUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.Actions.IActionUsage elementAsActionUsage) + { + ActionUsageTextualNotationBuilder.BuildActionNode(elementAsActionUsage, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } /// /// Builds the Textual Notation string for the rule ActionTargetSuccessionMember - /// ActionTargetSuccessionMember:FeatureMembership=MemberPrefixownedRelatedElement+=ActionTargetSuccession + /// ActionTargetSuccessionMember:FeatureMembership=MemberPrefixownedRelatedElement+=ActionTargetSuccession /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildActionTargetSuccessionMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + public static void BuildActionTargetSuccessionMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - ownedRelatedElementOfUsageIterator.MoveNext(); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); - if (ownedRelatedElementOfUsageIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - UsageTextualNotationBuilder.BuildActionTargetSuccession(ownedRelatedElementOfUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage elementAsUsage) + { + UsageTextualNotationBuilder.BuildActionTargetSuccession(elementAsUsage, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } /// /// Builds the Textual Notation string for the rule GuardedSuccessionMember - /// GuardedSuccessionMember:FeatureMembership=MemberPrefixownedRelatedElement+=GuardedSuccession + /// GuardedSuccessionMember:FeatureMembership=MemberPrefixownedRelatedElement+=GuardedSuccession /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildGuardedSuccessionMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + public static void BuildGuardedSuccessionMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfTransitionUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - ownedRelatedElementOfTransitionUsageIterator.MoveNext(); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); - if (ownedRelatedElementOfTransitionUsageIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - TransitionUsageTextualNotationBuilder.BuildGuardedSuccession(ownedRelatedElementOfTransitionUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.States.ITransitionUsage elementAsTransitionUsage) + { + TransitionUsageTextualNotationBuilder.BuildGuardedSuccession(elementAsTransitionUsage, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } /// /// Builds the Textual Notation string for the rule ForVariableDeclarationMember - /// ForVariableDeclarationMember:FeatureMembership=ownedRelatedElement+=UsageDeclaration + /// ForVariableDeclarationMember:FeatureMembership=ownedRelatedElement+=UsageDeclaration /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildForVariableDeclarationMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildForVariableDeclarationMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelatedElement.Count) + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage elementAsUsage) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage elementAsUsage) { - UsageTextualNotationBuilder.BuildUsageDeclaration(elementAsUsage, stringBuilder); + UsageTextualNotationBuilder.BuildUsageDeclaration(elementAsUsage, cursorCache, stringBuilder); } } + ownedRelatedElementCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule EntryTransitionMember - /// EntryTransitionMember:FeatureMembership=MemberPrefix(ownedRelatedElement+=GuardedTargetSuccession|'then'ownedRelatedElement+=TargetSuccession)';' + /// EntryTransitionMember:FeatureMembership=MemberPrefix(ownedRelatedElement+=GuardedTargetSuccession|'then'ownedRelatedElement+=TargetSuccession)';' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildEntryTransitionMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + public static void BuildEntryTransitionMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, ICursorCache cursorCache, 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(";"); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); + BuildEntryTransitionMemberHandCoded(poco, cursorCache, stringBuilder); + stringBuilder.AppendLine(";"); } /// /// Builds the Textual Notation string for the rule TransitionUsageMember - /// TransitionUsageMember:FeatureMembership=MemberPrefixownedRelatedElement+=TransitionUsage + /// TransitionUsageMember:FeatureMembership=MemberPrefixownedRelatedElement+=TransitionUsage /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildTransitionUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + public static void BuildTransitionUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfTransitionUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - ownedRelatedElementOfTransitionUsageIterator.MoveNext(); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); - if (ownedRelatedElementOfTransitionUsageIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - TransitionUsageTextualNotationBuilder.BuildTransitionUsage(ownedRelatedElementOfTransitionUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.States.ITransitionUsage elementAsTransitionUsage) + { + TransitionUsageTextualNotationBuilder.BuildTransitionUsage(elementAsTransitionUsage, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } /// /// Builds the Textual Notation string for the rule TargetTransitionUsageMember - /// TargetTransitionUsageMember:FeatureMembership=MemberPrefixownedRelatedElement+=TargetTransitionUsage + /// TargetTransitionUsageMember:FeatureMembership=MemberPrefixownedRelatedElement+=TargetTransitionUsage /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildTargetTransitionUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + public static void BuildTargetTransitionUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfTransitionUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - ownedRelatedElementOfTransitionUsageIterator.MoveNext(); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); - if (ownedRelatedElementOfTransitionUsageIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - TransitionUsageTextualNotationBuilder.BuildTargetTransitionUsage(ownedRelatedElementOfTransitionUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.States.ITransitionUsage elementAsTransitionUsage) + { + TransitionUsageTextualNotationBuilder.BuildTargetTransitionUsage(elementAsTransitionUsage, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } /// /// Builds the Textual Notation string for the rule MetadataBodyUsageMember - /// MetadataBodyUsageMember:FeatureMembership=ownedMemberFeature=MetadataBodyUsage + /// MetadataBodyUsageMember:FeatureMembership=ownedMemberFeature=MetadataBodyUsage /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildMetadataBodyUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + public static void BuildMetadataBodyUsageMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.ownedMemberFeature != null) { - using var ownedRelationshipOfRedefinitionIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); stringBuilder.Append("ref "); stringBuilder.Append(" :>> "); - ownedRelationshipOfRedefinitionIterator.MoveNext(); - if (ownedRelationshipOfRedefinitionIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - RedefinitionTextualNotationBuilder.BuildOwnedRedefinition(ownedRelationshipOfRedefinitionIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IRedefinition elementAsRedefinition) + { + RedefinitionTextualNotationBuilder.BuildOwnedRedefinition(elementAsRedefinition, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + if (poco.ownedMemberFeature != null) { - FeatureTextualNotationBuilder.BuildFeatureSpecializationPart(poco.ownedMemberFeature, stringBuilder); + + if (poco.ownedMemberFeature.OwnedRelationship.Count != 0 || poco.ownedMemberFeature.type.Count != 0 || poco.ownedMemberFeature.chainingFeature.Count != 0 || poco.ownedMemberFeature.IsOrdered) + { + FeatureTextualNotationBuilder.BuildFeatureSpecializationPart(poco.ownedMemberFeature, cursorCache, stringBuilder); + } } if (poco.ownedMemberFeature != null) { - FeatureTextualNotationBuilder.BuildValuePart(poco.ownedMemberFeature, 0, stringBuilder); + + if (poco.ownedMemberFeature.OwnedRelationship.Count != 0 || poco.ownedMemberFeature.type.Count != 0 || poco.ownedMemberFeature.chainingFeature.Count != 0 || !string.IsNullOrWhiteSpace(poco.ownedMemberFeature.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.ownedMemberFeature.DeclaredName) || poco.ownedMemberFeature.Direction.HasValue || poco.ownedMemberFeature.IsDerived || poco.ownedMemberFeature.IsAbstract || poco.ownedMemberFeature.IsConstant || poco.ownedMemberFeature.IsOrdered || poco.ownedMemberFeature.IsEnd || poco.ownedMemberFeature.importedMembership.Count != 0 || poco.ownedMemberFeature.IsComposite || poco.ownedMemberFeature.IsPortion || poco.ownedMemberFeature.IsVariable || poco.ownedMemberFeature.IsSufficient || poco.ownedMemberFeature.unioningType.Count != 0 || poco.ownedMemberFeature.intersectingType.Count != 0 || poco.ownedMemberFeature.differencingType.Count != 0 || poco.ownedMemberFeature.featuringType.Count != 0 || poco.ownedMemberFeature.ownedTypeFeaturing.Count != 0) + { + FeatureTextualNotationBuilder.BuildValuePart(poco.ownedMemberFeature, cursorCache, stringBuilder); + } } if (poco.ownedMemberFeature != null) { - TypeTextualNotationBuilder.BuildMetadataBody(poco.ownedMemberFeature, stringBuilder); + TypeTextualNotationBuilder.BuildMetadataBody(poco.ownedMemberFeature, cursorCache, stringBuilder); } } @@ -417,91 +506,107 @@ public static void BuildMetadataBodyUsageMember(SysML2.NET.Core.POCO.Core.Types. /// /// Builds the Textual Notation string for the rule OwnedFeatureMember - /// OwnedFeatureMember:FeatureMembership=MemberPrefixownedRelatedElement+=FeatureElement + /// OwnedFeatureMember:FeatureMembership=MemberPrefixownedRelatedElement+=FeatureElement /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildOwnedFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + public static void BuildOwnedFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - ownedRelatedElementOfFeatureIterator.MoveNext(); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); - if (ownedRelatedElementOfFeatureIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - FeatureTextualNotationBuilder.BuildFeatureElement(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Core.Features.IFeature elementAsFeature) + { + FeatureTextualNotationBuilder.BuildFeatureElement(elementAsFeature, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } /// /// Builds the Textual Notation string for the rule OwnedExpressionReferenceMember - /// OwnedExpressionReferenceMember:FeatureMembership=ownedRelationship+=OwnedExpressionReference + /// OwnedExpressionReferenceMember:FeatureMembership=ownedRelationship+=OwnedExpressionReference /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildOwnedExpressionReferenceMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildOwnedExpressionReferenceMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelationship.Count) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + + if (ownedRelationshipCursor.Current != null) { - var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; - if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression elementAsFeatureReferenceExpression) + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression elementAsFeatureReferenceExpression) { - FeatureReferenceExpressionTextualNotationBuilder.BuildOwnedExpressionReference(elementAsFeatureReferenceExpression, 0, stringBuilder); + FeatureReferenceExpressionTextualNotationBuilder.BuildOwnedExpressionReference(elementAsFeatureReferenceExpression, cursorCache, stringBuilder); } } + ownedRelationshipCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule OwnedExpressionMember - /// OwnedExpressionMember:FeatureMembership=ownedFeatureMember=OwnedExpression + /// OwnedExpressionMember:FeatureMembership=ownedFeatureMember=OwnedExpression /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildOwnedExpressionMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + public static void BuildOwnedExpressionMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildOwnedFeatureMember(poco, stringBuilder); + BuildOwnedFeatureMember(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule SequenceExpressionListMember - /// SequenceExpressionListMember:FeatureMembership=ownedMemberFeature=SequenceExpressionList + /// SequenceExpressionListMember:FeatureMembership=ownedMemberFeature=SequenceExpressionList /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildSequenceExpressionListMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + public static void BuildSequenceExpressionListMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.ownedMemberFeature != null) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildSequenceExpressionListHandCoded(poco.ownedMemberFeature, cursorCache, stringBuilder); } } /// /// Builds the Textual Notation string for the rule FunctionReferenceMember - /// FunctionReferenceMember:FeatureMembership=ownedMemberFeature=FunctionReference + /// FunctionReferenceMember:FeatureMembership=ownedMemberFeature=FunctionReference /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildFunctionReferenceMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + public static void BuildFunctionReferenceMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.ownedMemberFeature != null) { - var elementForOwnedRelationship = poco.ownedMemberFeature.OwnedRelationship[0]; + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Core.Features.IFeatureTyping elementAsFeatureTyping) + if (ownedRelationshipCursor.Current != null) { - FeatureTypingTextualNotationBuilder.BuildReferenceTyping(elementAsFeatureTyping, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IFeatureTyping elementAsFeatureTyping) + { + FeatureTypingTextualNotationBuilder.BuildReferenceTyping(elementAsFeatureTyping, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } @@ -509,38 +614,40 @@ public static void BuildFunctionReferenceMember(SysML2.NET.Core.POCO.Core.Types. /// /// Builds the Textual Notation string for the rule NamedArgumentMember - /// NamedArgumentMember:FeatureMembership=ownedMemberFeature=NamedArgument + /// NamedArgumentMember:FeatureMembership=ownedMemberFeature=NamedArgument /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildNamedArgumentMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + public static void BuildNamedArgumentMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.ownedMemberFeature != null) { - FeatureTextualNotationBuilder.BuildNamedArgument(poco.ownedMemberFeature, stringBuilder); + FeatureTextualNotationBuilder.BuildNamedArgument(poco.ownedMemberFeature, cursorCache, stringBuilder); } } /// /// Builds the Textual Notation string for the rule ExpressionBodyMember - /// ExpressionBodyMember:FeatureMembership=ownedMemberFeature=ExpressionBody + /// ExpressionBodyMember:FeatureMembership=ownedMemberFeature=ExpressionBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildExpressionBodyMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + public static void BuildExpressionBodyMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.ownedMemberFeature != null) { - stringBuilder.Append("{"); + stringBuilder.AppendLine("{"); if (poco.ownedMemberFeature != null) { - TypeTextualNotationBuilder.BuildFunctionBodyPart(poco.ownedMemberFeature, stringBuilder); + TypeTextualNotationBuilder.BuildFunctionBodyPart(poco.ownedMemberFeature, cursorCache, stringBuilder); } - stringBuilder.Append("}"); + stringBuilder.AppendLine("}"); } @@ -548,34 +655,41 @@ public static void BuildExpressionBodyMember(SysML2.NET.Core.POCO.Core.Types.IFe /// /// Builds the Textual Notation string for the rule PayloadFeatureMember - /// PayloadFeatureMember:FeatureMembership=ownedRelatedElement=PayloadFeature + /// PayloadFeatureMember:FeatureMembership=ownedRelatedElement=PayloadFeature /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildPayloadFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + public static void BuildPayloadFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - ownedRelatedElementOfFeatureIterator.MoveNext(); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); - if (ownedRelatedElementOfFeatureIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - FeatureTextualNotationBuilder.BuildPayloadFeature(ownedRelatedElementOfFeatureIterator.Current, 0, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Core.Features.IFeature elementAsFeature) + { + FeatureTextualNotationBuilder.BuildPayloadFeature(elementAsFeature, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } /// /// Builds the Textual Notation string for the rule MetadataBodyFeatureMember - /// MetadataBodyFeatureMember:FeatureMembership=ownedMemberFeature=MetadataBodyFeature + /// MetadataBodyFeatureMember:FeatureMembership=ownedMemberFeature=MetadataBodyFeature /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildMetadataBodyFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, StringBuilder stringBuilder) + public static void BuildMetadataBodyFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.ownedMemberFeature != null) { - FeatureTextualNotationBuilder.BuildMetadataBodyFeature(poco.ownedMemberFeature, stringBuilder); + FeatureTextualNotationBuilder.BuildMetadataBodyFeature(poco.ownedMemberFeature, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureReferenceExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureReferenceExpressionTextualNotationBuilder.cs index c9e7d951..353e4676 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureReferenceExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureReferenceExpressionTextualNotationBuilder.cs @@ -24,7 +24,6 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; @@ -37,119 +36,133 @@ public static partial class FeatureReferenceExpressionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule SatisfactionReferenceExpression - /// SatisfactionReferenceExpression:FeatureReferenceExpression=ownedRelationship+=FeatureChainMember + /// SatisfactionReferenceExpression:FeatureReferenceExpression=ownedRelationship+=FeatureChainMember /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildSatisfactionReferenceExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildSatisfactionReferenceExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelationship.Count) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + + if (ownedRelationshipCursor.Current != null) { - var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; - if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Root.Namespaces.IMembership elementAsMembership) + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IMembership elementAsMembership) { - MembershipTextualNotationBuilder.BuildFeatureChainMember(elementAsMembership, stringBuilder); + MembershipTextualNotationBuilder.BuildFeatureChainMember(elementAsMembership, cursorCache, stringBuilder); } } + ownedRelationshipCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule OwnedExpressionReference - /// OwnedExpressionReference:FeatureReferenceExpression=ownedRelationship+=OwnedExpressionMember + /// OwnedExpressionReference:FeatureReferenceExpression=ownedRelationship+=OwnedExpressionMember /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildOwnedExpressionReference(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildOwnedExpressionReference(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelationship.Count) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + + if (ownedRelationshipCursor.Current != null) { - var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; - if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Core.Types.IFeatureMembership elementAsFeatureMembership) + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Types.IFeatureMembership elementAsFeatureMembership) { - FeatureMembershipTextualNotationBuilder.BuildOwnedExpressionMember(elementAsFeatureMembership, stringBuilder); + FeatureMembershipTextualNotationBuilder.BuildOwnedExpressionMember(elementAsFeatureMembership, cursorCache, stringBuilder); } } + ownedRelationshipCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule FunctionReferenceExpression - /// FunctionReferenceExpression:FeatureReferenceExpression=ownedRelationship+=FunctionReferenceMember + /// FunctionReferenceExpression:FeatureReferenceExpression=ownedRelationship+=FunctionReferenceMember /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildFunctionReferenceExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildFunctionReferenceExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelationship.Count) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + + if (ownedRelationshipCursor.Current != null) { - var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; - if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Core.Types.IFeatureMembership elementAsFeatureMembership) + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Types.IFeatureMembership elementAsFeatureMembership) { - FeatureMembershipTextualNotationBuilder.BuildFunctionReferenceMember(elementAsFeatureMembership, stringBuilder); + FeatureMembershipTextualNotationBuilder.BuildFunctionReferenceMember(elementAsFeatureMembership, cursorCache, stringBuilder); } } + ownedRelationshipCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule FeatureReferenceExpression - /// FeatureReferenceExpression:FeatureReferenceExpression=ownedRelationship+=FeatureReferenceMemberownedRelationship+=EmptyResultMember + /// FeatureReferenceExpression:FeatureReferenceExpression=ownedRelationship+=FeatureReferenceMemberownedRelationship+=EmptyResultMember /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildFeatureReferenceExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression poco, StringBuilder stringBuilder) + public static void BuildFeatureReferenceExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfMembershipIterator.MoveNext(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (ownedRelationshipOfMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - MembershipTextualNotationBuilder.BuildFeatureReferenceMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IMembership elementAsMembership) + { + MembershipTextualNotationBuilder.BuildFeatureReferenceMember(elementAsMembership, cursorCache, stringBuilder); + } } - ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); + ownedRelationshipCursor.Move(); + - if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Functions.IReturnParameterMembership elementAsReturnParameterMembership) + { + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(elementAsReturnParameterMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } /// /// Builds the Textual Notation string for the rule BodyExpression - /// BodyExpression:FeatureReferenceExpression=ownedRelationship+=ExpressionBodyMember + /// BodyExpression:FeatureReferenceExpression=ownedRelationship+=ExpressionBodyMember /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildBodyExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildBodyExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelationship.Count) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + + if (ownedRelationshipCursor.Current != null) { - var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; - if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Core.Types.IFeatureMembership elementAsFeatureMembership) + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Types.IFeatureMembership elementAsFeatureMembership) { - FeatureMembershipTextualNotationBuilder.BuildExpressionBodyMember(elementAsFeatureMembership, stringBuilder); + FeatureMembershipTextualNotationBuilder.BuildExpressionBodyMember(elementAsFeatureMembership, cursorCache, stringBuilder); } } + ownedRelationshipCursor.Move(); + - return elementIndex; } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs index 3718f27e..83cbe123 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs @@ -24,7 +24,6 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; @@ -37,68 +36,77 @@ public static partial class FeatureTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule ValuePart - /// ValuePart:Feature=ownedRelationship+=FeatureValue + /// ValuePart:Feature=ownedRelationship+=FeatureValue /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildValuePart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildValuePart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelationship.Count) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + + if (ownedRelationshipCursor.Current != null) { - var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; - if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue elementAsFeatureValue) + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue elementAsFeatureValue) { - FeatureValueTextualNotationBuilder.BuildFeatureValue(elementAsFeatureValue, stringBuilder); + FeatureValueTextualNotationBuilder.BuildFeatureValue(elementAsFeatureValue, cursorCache, stringBuilder); } } + ownedRelationshipCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule FeatureSpecializationPart - /// FeatureSpecializationPart:Feature=FeatureSpecialization+MultiplicityPart?FeatureSpecialization*|MultiplicityPartFeatureSpecialization* + /// FeatureSpecializationPart:Feature=FeatureSpecialization+MultiplicityPart?FeatureSpecialization*|MultiplicityPartFeatureSpecialization* /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildFeatureSpecializationPart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + public static void BuildFeatureSpecializationPart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildFeatureSpecializationPartHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule FeatureSpecialization - /// FeatureSpecialization:Feature=Typings|Subsettings|References|Crosses|Redefinitions + /// FeatureSpecialization:Feature=Typings|Subsettings|References|Crosses|Redefinitions /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildFeatureSpecialization(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + public static void BuildFeatureSpecialization(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); + BuildFeatureSpecializationHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule Typings - /// Typings:Feature=TypedBy(','ownedRelationship+=FeatureTyping)* + /// Typings:Feature=TypedBy(','ownedRelationship+=FeatureTyping)* /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildTypings(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + public static void BuildTypings(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfFeatureTypingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - BuildTypedBy(poco, stringBuilder); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + BuildTypedBy(poco, cursorCache, stringBuilder); - while (ownedRelationshipOfFeatureTypingIterator.MoveNext()) + while (ownedRelationshipCursor.Current != null) { - stringBuilder.Append(","); + stringBuilder.Append(", "); - if (ownedRelationshipOfFeatureTypingIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - FeatureTypingTextualNotationBuilder.BuildFeatureTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IFeatureTyping elementAsFeatureTyping) + { + FeatureTypingTextualNotationBuilder.BuildFeatureTyping(elementAsFeatureTyping, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); } @@ -106,42 +114,54 @@ public static void BuildTypings(SysML2.NET.Core.POCO.Core.Features.IFeature poco /// /// Builds the Textual Notation string for the rule TypedBy - /// TypedBy:Feature=DEFINED_BYownedRelationship+=FeatureTyping + /// TypedBy:Feature=DEFINED_BYownedRelationship+=FeatureTyping /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildTypedBy(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + public static void BuildTypedBy(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfFeatureTypingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - ownedRelationshipOfFeatureTypingIterator.MoveNext(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + BuildDEFINED_BYHandCoded(poco, cursorCache, stringBuilder); - if (ownedRelationshipOfFeatureTypingIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - FeatureTypingTextualNotationBuilder.BuildFeatureTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IFeatureTyping elementAsFeatureTyping) + { + FeatureTypingTextualNotationBuilder.BuildFeatureTyping(elementAsFeatureTyping, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } /// /// Builds the Textual Notation string for the rule Subsettings - /// Subsettings:Feature=Subsets(','ownedRelationship+=OwnedSubsetting)* + /// Subsettings:Feature=Subsets(','ownedRelationship+=OwnedSubsetting)* /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildSubsettings(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + public static void BuildSubsettings(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - BuildSubsets(poco, stringBuilder); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + BuildSubsets(poco, cursorCache, stringBuilder); - while (ownedRelationshipOfSubsettingIterator.MoveNext()) + while (ownedRelationshipCursor.Current != null) { - stringBuilder.Append(","); + stringBuilder.Append(", "); - if (ownedRelationshipOfSubsettingIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - SubsettingTextualNotationBuilder.BuildOwnedSubsetting(ownedRelationshipOfSubsettingIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.ISubsetting elementAsSubsetting) + { + SubsettingTextualNotationBuilder.BuildOwnedSubsetting(elementAsSubsetting, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); } @@ -149,80 +169,104 @@ public static void BuildSubsettings(SysML2.NET.Core.POCO.Core.Features.IFeature /// /// Builds the Textual Notation string for the rule Subsets - /// Subsets:Feature=SUBSETSownedRelationship+=OwnedSubsetting + /// Subsets:Feature=SUBSETSownedRelationship+=OwnedSubsetting /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildSubsets(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + public static void BuildSubsets(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); stringBuilder.Append(" :> "); - ownedRelationshipOfSubsettingIterator.MoveNext(); - if (ownedRelationshipOfSubsettingIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - SubsettingTextualNotationBuilder.BuildOwnedSubsetting(ownedRelationshipOfSubsettingIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.ISubsetting elementAsSubsetting) + { + SubsettingTextualNotationBuilder.BuildOwnedSubsetting(elementAsSubsetting, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } /// /// Builds the Textual Notation string for the rule References - /// References:Feature=REFERENCESownedRelationship+=OwnedReferenceSubsetting + /// References:Feature=REFERENCESownedRelationship+=OwnedReferenceSubsetting /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildReferences(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + public static void BuildReferences(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfReferenceSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); stringBuilder.Append(" ::> "); - ownedRelationshipOfReferenceSubsettingIterator.MoveNext(); - if (ownedRelationshipOfReferenceSubsettingIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ReferenceSubsettingTextualNotationBuilder.BuildOwnedReferenceSubsetting(ownedRelationshipOfReferenceSubsettingIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IReferenceSubsetting elementAsReferenceSubsetting) + { + ReferenceSubsettingTextualNotationBuilder.BuildOwnedReferenceSubsetting(elementAsReferenceSubsetting, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } /// /// Builds the Textual Notation string for the rule Crosses - /// Crosses:Feature=CROSSESownedRelationship+=OwnedCrossSubsetting + /// Crosses:Feature=CROSSESownedRelationship+=OwnedCrossSubsetting /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildCrosses(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + public static void BuildCrosses(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfCrossSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); stringBuilder.Append(" => "); - ownedRelationshipOfCrossSubsettingIterator.MoveNext(); - if (ownedRelationshipOfCrossSubsettingIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - CrossSubsettingTextualNotationBuilder.BuildOwnedCrossSubsetting(ownedRelationshipOfCrossSubsettingIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.ICrossSubsetting elementAsCrossSubsetting) + { + CrossSubsettingTextualNotationBuilder.BuildOwnedCrossSubsetting(elementAsCrossSubsetting, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } /// /// Builds the Textual Notation string for the rule Redefinitions - /// Redefinitions:Feature=Redefines(','ownedRelationship+=OwnedRedefinition)* + /// Redefinitions:Feature=Redefines(','ownedRelationship+=OwnedRedefinition)* /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildRedefinitions(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + public static void BuildRedefinitions(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfRedefinitionIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - BuildRedefines(poco, stringBuilder); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + BuildRedefines(poco, cursorCache, stringBuilder); - while (ownedRelationshipOfRedefinitionIterator.MoveNext()) + while (ownedRelationshipCursor.Current != null) { - stringBuilder.Append(","); + stringBuilder.Append(", "); - if (ownedRelationshipOfRedefinitionIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - RedefinitionTextualNotationBuilder.BuildOwnedRedefinition(ownedRelationshipOfRedefinitionIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IRedefinition elementAsRedefinition) + { + RedefinitionTextualNotationBuilder.BuildOwnedRedefinition(elementAsRedefinition, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); } @@ -230,47 +274,64 @@ public static void BuildRedefinitions(SysML2.NET.Core.POCO.Core.Features.IFeatur /// /// Builds the Textual Notation string for the rule Redefines - /// Redefines:Feature=REDEFINESownedRelationship+=OwnedRedefinition + /// Redefines:Feature=REDEFINESownedRelationship+=OwnedRedefinition /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildRedefines(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + public static void BuildRedefines(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfRedefinitionIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); stringBuilder.Append(" :>> "); - ownedRelationshipOfRedefinitionIterator.MoveNext(); - if (ownedRelationshipOfRedefinitionIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - RedefinitionTextualNotationBuilder.BuildOwnedRedefinition(ownedRelationshipOfRedefinitionIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IRedefinition elementAsRedefinition) + { + RedefinitionTextualNotationBuilder.BuildOwnedRedefinition(elementAsRedefinition, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } /// /// Builds the Textual Notation string for the rule OwnedFeatureChain - /// OwnedFeatureChain:Feature=ownedRelationship+=OwnedFeatureChaining('.'ownedRelationship+=OwnedFeatureChaining)+ + /// OwnedFeatureChain:Feature=ownedRelationship+=OwnedFeatureChaining('.'ownedRelationship+=OwnedFeatureChaining)+ /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildOwnedFeatureChain(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + public static void BuildOwnedFeatureChain(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfFeatureChainingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfFeatureChainingIterator.MoveNext(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (ownedRelationshipOfFeatureChainingIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(ownedRelationshipOfFeatureChainingIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IFeatureChaining elementAsFeatureChaining) + { + FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(elementAsFeatureChaining, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); - while (ownedRelationshipOfFeatureChainingIterator.MoveNext()) + + while (ownedRelationshipCursor.Current != null) { stringBuilder.Append("."); - if (ownedRelationshipOfFeatureChainingIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(ownedRelationshipOfFeatureChainingIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IFeatureChaining elementAsFeatureChaining) + { + FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(elementAsFeatureChaining, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); } stringBuilder.Append(' '); @@ -279,205 +340,218 @@ public static void BuildOwnedFeatureChain(SysML2.NET.Core.POCO.Core.Features.IFe /// /// 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')?) + /// 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 index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildMultiplicityPart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildMultiplicityPart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - return elementIndex; + BuildMultiplicityPartHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule OwnedCrossMultiplicity - /// OwnedCrossMultiplicity:Feature=ownedRelationship+=OwnedMultiplicity + /// OwnedCrossMultiplicity:Feature=ownedRelationship+=OwnedMultiplicity /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildOwnedCrossMultiplicity(SysML2.NET.Core.POCO.Core.Features.IFeature poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildOwnedCrossMultiplicity(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelationship.Count) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + + if (ownedRelationshipCursor.Current != null) { - var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; - if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) { - OwningMembershipTextualNotationBuilder.BuildOwnedMultiplicity(elementAsOwningMembership, 0, stringBuilder); + OwningMembershipTextualNotationBuilder.BuildOwnedMultiplicity(elementAsOwningMembership, cursorCache, stringBuilder); } } + ownedRelationshipCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule PayloadFeature - /// PayloadFeature:Feature=Identification?PayloadFeatureSpecializationPartValuePart?|ownedRelationship+=OwnedFeatureTyping(ownedRelationship+=OwnedMultiplicity)?|ownedRelationship+=OwnedMultiplicityownedRelationship+=OwnedFeatureTyping + /// PayloadFeature:Feature=Identification?PayloadFeatureSpecializationPartValuePart?|ownedRelationship+=OwnedFeatureTyping(ownedRelationship+=OwnedMultiplicity)?|ownedRelationship+=OwnedMultiplicityownedRelationship+=OwnedFeatureTyping /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildPayloadFeature(SysML2.NET.Core.POCO.Core.Features.IFeature poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildPayloadFeature(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - return elementIndex; + BuildPayloadFeatureHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule PayloadFeatureSpecializationPart - /// PayloadFeatureSpecializationPart:Feature=(FeatureSpecialization)+MultiplicityPart?FeatureSpecialization*|MultiplicityPartFeatureSpecialization+ + /// PayloadFeatureSpecializationPart:Feature=(FeatureSpecialization)+MultiplicityPart?FeatureSpecialization*|MultiplicityPartFeatureSpecialization+ /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildPayloadFeatureSpecializationPart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + public static void BuildPayloadFeatureSpecializationPart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildPayloadFeatureSpecializationPartHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule FeatureChainPrefix - /// FeatureChainPrefix:Feature=(ownedRelationship+=OwnedFeatureChaining'.')+ownedRelationship+=OwnedFeatureChaining'.' + /// FeatureChainPrefix:Feature=(ownedRelationship+=OwnedFeatureChaining'.')+ownedRelationship+=OwnedFeatureChaining'.' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildFeatureChainPrefix(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + public static void BuildFeatureChainPrefix(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfFeatureChainingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - while (ownedRelationshipOfFeatureChainingIterator.MoveNext()) + while (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfFeatureChainingIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(ownedRelationshipOfFeatureChainingIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IFeatureChaining elementAsFeatureChaining) + { + FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(elementAsFeatureChaining, cursorCache, stringBuilder); + } } stringBuilder.Append("."); + ownedRelationshipCursor.Move(); } stringBuilder.Append(' '); - ownedRelationshipOfFeatureChainingIterator.MoveNext(); - if (ownedRelationshipOfFeatureChainingIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(ownedRelationshipOfFeatureChainingIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IFeatureChaining elementAsFeatureChaining) + { + FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(elementAsFeatureChaining, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + stringBuilder.Append("."); } /// /// Builds the Textual Notation string for the rule TriggerValuePart - /// TriggerValuePart:Feature=ownedRelationship+=TriggerFeatureValue + /// TriggerValuePart:Feature=ownedRelationship+=TriggerFeatureValue /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildTriggerValuePart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildTriggerValuePart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelationship.Count) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + + if (ownedRelationshipCursor.Current != null) { - var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; - if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue elementAsFeatureValue) + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue elementAsFeatureValue) { - FeatureValueTextualNotationBuilder.BuildTriggerFeatureValue(elementAsFeatureValue, 0, stringBuilder); + FeatureValueTextualNotationBuilder.BuildTriggerFeatureValue(elementAsFeatureValue, cursorCache, stringBuilder); } } + ownedRelationshipCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule Argument - /// Argument:Feature=ownedRelationship+=ArgumentValue + /// Argument:Feature=ownedRelationship+=ArgumentValue /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelationship.Count) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + + if (ownedRelationshipCursor.Current != null) { - var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; - if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue elementAsFeatureValue) + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue elementAsFeatureValue) { - FeatureValueTextualNotationBuilder.BuildArgumentValue(elementAsFeatureValue, stringBuilder); + FeatureValueTextualNotationBuilder.BuildArgumentValue(elementAsFeatureValue, cursorCache, stringBuilder); } } + ownedRelationshipCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule ArgumentExpression - /// ArgumentExpression:Feature=ownedRelationship+=ArgumentExpressionValue + /// ArgumentExpression:Feature=ownedRelationship+=ArgumentExpressionValue /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildArgumentExpression(SysML2.NET.Core.POCO.Core.Features.IFeature poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildArgumentExpression(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelationship.Count) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + + if (ownedRelationshipCursor.Current != null) { - var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; - if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue elementAsFeatureValue) + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue elementAsFeatureValue) { - FeatureValueTextualNotationBuilder.BuildArgumentExpressionValue(elementAsFeatureValue, 0, stringBuilder); + FeatureValueTextualNotationBuilder.BuildArgumentExpressionValue(elementAsFeatureValue, cursorCache, stringBuilder); } } + ownedRelationshipCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule FeatureElement - /// FeatureElement:Feature=Feature|Step|Expression|BooleanExpression|Invariant|Connector|BindingConnector|Succession|Flow|SuccessionFlow + /// FeatureElement:Feature=Feature|Step|Expression|BooleanExpression|Invariant|Connector|BindingConnector|Succession|Flow|SuccessionFlow /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildFeatureElement(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + public static void BuildFeatureElement(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { switch (poco) { - case SysML2.NET.Core.POCO.Kernel.Functions.Invariant pocoInvariant: - InvariantTextualNotationBuilder.BuildInvariant(pocoInvariant, stringBuilder); + case SysML2.NET.Core.POCO.Kernel.Interactions.ISuccessionFlow pocoSuccessionFlow: + SuccessionFlowTextualNotationBuilder.BuildSuccessionFlow(pocoSuccessionFlow, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Kernel.Functions.BooleanExpression pocoBooleanExpression: - BooleanExpressionTextualNotationBuilder.BuildBooleanExpression(pocoBooleanExpression, stringBuilder); + case SysML2.NET.Core.POCO.Kernel.Functions.IInvariant pocoInvariant: + InvariantTextualNotationBuilder.BuildInvariant(pocoInvariant, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Kernel.Functions.Expression pocoExpression: - ExpressionTextualNotationBuilder.BuildExpression(pocoExpression, stringBuilder); + case SysML2.NET.Core.POCO.Kernel.Interactions.IFlow pocoFlow: + FlowTextualNotationBuilder.BuildFlow(pocoFlow, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Kernel.Behaviors.Step pocoStep: - StepTextualNotationBuilder.BuildStep(pocoStep, stringBuilder); + case SysML2.NET.Core.POCO.Kernel.Functions.IBooleanExpression pocoBooleanExpression: + BooleanExpressionTextualNotationBuilder.BuildBooleanExpression(pocoBooleanExpression, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Kernel.Connectors.BindingConnector pocoBindingConnector: - BindingConnectorTextualNotationBuilder.BuildBindingConnector(pocoBindingConnector, stringBuilder); + case SysML2.NET.Core.POCO.Kernel.Connectors.IBindingConnector pocoBindingConnector: + BindingConnectorTextualNotationBuilder.BuildBindingConnector(pocoBindingConnector, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Kernel.Interactions.SuccessionFlow pocoSuccessionFlow: - SuccessionFlowTextualNotationBuilder.BuildSuccessionFlow(pocoSuccessionFlow, stringBuilder); + case SysML2.NET.Core.POCO.Kernel.Connectors.ISuccession pocoSuccession: + SuccessionTextualNotationBuilder.BuildSuccession(pocoSuccession, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Kernel.Connectors.Succession pocoSuccession: - SuccessionTextualNotationBuilder.BuildSuccession(pocoSuccession, stringBuilder); + case SysML2.NET.Core.POCO.Kernel.Functions.IExpression pocoExpression: + ExpressionTextualNotationBuilder.BuildExpression(pocoExpression, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Kernel.Interactions.Flow pocoFlow: - FlowTextualNotationBuilder.BuildFlow(pocoFlow, stringBuilder); + case SysML2.NET.Core.POCO.Kernel.Connectors.IConnector pocoConnector: + ConnectorTextualNotationBuilder.BuildConnector(pocoConnector, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Kernel.Connectors.Connector pocoConnector: - ConnectorTextualNotationBuilder.BuildConnector(pocoConnector, stringBuilder); + case SysML2.NET.Core.POCO.Kernel.Behaviors.IStep pocoStep: + StepTextualNotationBuilder.BuildStep(pocoStep, cursorCache, stringBuilder); break; default: - BuildFeature(poco, stringBuilder); + BuildFeature(poco, cursorCache, stringBuilder); break; } @@ -485,11 +559,12 @@ public static void BuildFeatureElement(SysML2.NET.Core.POCO.Core.Features.IFeatu /// /// Builds the Textual Notation string for the rule EndFeaturePrefix - /// EndFeaturePrefix:Feature=(isConstant?='const'{isVariable=true})?isEnd?='end' + /// EndFeaturePrefix:Feature=(isConstant?='const'{isVariable=true})?isEnd?='end' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildEndFeaturePrefix(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + public static void BuildEndFeaturePrefix(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.IsConstant) @@ -508,11 +583,12 @@ public static void BuildEndFeaturePrefix(SysML2.NET.Core.POCO.Core.Features.IFea /// /// 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})? + /// 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 used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildBasicFeaturePrefix(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + public static void BuildBasicFeaturePrefix(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.Direction.HasValue) @@ -544,17 +620,18 @@ public static void BuildBasicFeaturePrefix(SysML2.NET.Core.POCO.Core.Features.IF stringBuilder.Append(" portion "); } - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildBasicFeaturePrefixHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule FeatureDeclaration - /// FeatureDeclaration:Feature=(isSufficient?='all')?(FeatureIdentification(FeatureSpecializationPart|ConjugationPart)?|FeatureSpecializationPart|ConjugationPart)FeatureRelationshipPart* + /// FeatureDeclaration:Feature=(isSufficient?='all')?(FeatureIdentification(FeatureSpecializationPart|ConjugationPart)?|FeatureSpecializationPart|ConjugationPart)FeatureRelationshipPart* /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildFeatureDeclaration(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + public static void BuildFeatureDeclaration(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.IsSufficient) @@ -563,56 +640,63 @@ public static void BuildFeatureDeclaration(SysML2.NET.Core.POCO.Core.Features.IF stringBuilder.Append(' '); } - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildFeatureDeclarationHandCoded(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); - // Handle collection Non Terminal - BuildFeatureRelationshipPartInternal(poco, stringBuilder); BuildFeatureRelationshipPart(poco, stringBuilder); + BuildFeatureDeclarationHandCoded(poco, cursorCache, stringBuilder); + } /// /// Builds the Textual Notation string for the rule FeatureIdentification - /// FeatureIdentification:Feature='<'declaredShortName=NAME'>'(declaredName=NAME)?|declaredName=NAME + /// FeatureIdentification:Feature='<'declaredShortName=NAME'>'(declaredName=NAME)?|declaredName=NAME /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildFeatureIdentification(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + public static void BuildFeatureIdentification(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildFeatureIdentificationHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule FeatureRelationshipPart - /// FeatureRelationshipPart:Feature=TypeRelationshipPart|ChainingPart|InvertingPart|TypeFeaturingPart + /// FeatureRelationshipPart:Feature=TypeRelationshipPart|ChainingPart|InvertingPart|TypeFeaturingPart /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildFeatureRelationshipPart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + public static void BuildFeatureRelationshipPart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); + BuildFeatureRelationshipPartHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule ChainingPart - /// ChainingPart:Feature='chains'(ownedRelationship+=OwnedFeatureChaining|FeatureChain) + /// ChainingPart:Feature='chains'(ownedRelationship+=OwnedFeatureChaining|FeatureChain) /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildChainingPart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + public static void BuildChainingPart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfFeatureChainingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); stringBuilder.Append("chains "); - if (ownedRelationshipOfFeatureChainingIterator.MoveNext()) + if (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfFeatureChainingIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(ownedRelationshipOfFeatureChainingIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IFeatureChaining elementAsFeatureChaining) + { + FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(elementAsFeatureChaining, cursorCache, stringBuilder); + } } } else { - BuildFeatureChain(poco, stringBuilder); + BuildFeatureChain(poco, cursorCache, stringBuilder); } stringBuilder.Append(' '); @@ -620,51 +704,68 @@ public static void BuildChainingPart(SysML2.NET.Core.POCO.Core.Features.IFeature /// /// Builds the Textual Notation string for the rule InvertingPart - /// InvertingPart:Feature='inverse''of'ownedRelationship+=OwnedFeatureInverting + /// InvertingPart:Feature='inverse''of'ownedRelationship+=OwnedFeatureInverting /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildInvertingPart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + public static void BuildInvertingPart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfFeatureInvertingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); stringBuilder.Append("inverse "); stringBuilder.Append("of "); - ownedRelationshipOfFeatureInvertingIterator.MoveNext(); - if (ownedRelationshipOfFeatureInvertingIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - FeatureInvertingTextualNotationBuilder.BuildOwnedFeatureInverting(ownedRelationshipOfFeatureInvertingIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IFeatureInverting elementAsFeatureInverting) + { + FeatureInvertingTextualNotationBuilder.BuildOwnedFeatureInverting(elementAsFeatureInverting, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } /// /// Builds the Textual Notation string for the rule TypeFeaturingPart - /// TypeFeaturingPart:Feature='featured''by'ownedRelationship+=OwnedTypeFeaturing(','ownedTypeFeaturing+=OwnedTypeFeaturing)* + /// TypeFeaturingPart:Feature='featured''by'ownedRelationship+=OwnedTypeFeaturing(','ownedTypeFeaturing+=OwnedTypeFeaturing)* /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildTypeFeaturingPart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + public static void BuildTypeFeaturingPart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfTypeFeaturingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - using var ownedTypeFeaturingIterator = poco.ownedTypeFeaturing.GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + var ownedTypeFeaturingCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedTypeFeaturing", poco.ownedTypeFeaturing); stringBuilder.Append("featured "); stringBuilder.Append("by "); - ownedRelationshipOfTypeFeaturingIterator.MoveNext(); - if (ownedRelationshipOfTypeFeaturingIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - TypeFeaturingTextualNotationBuilder.BuildOwnedTypeFeaturing(ownedRelationshipOfTypeFeaturingIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.ITypeFeaturing elementAsTypeFeaturing) + { + TypeFeaturingTextualNotationBuilder.BuildOwnedTypeFeaturing(elementAsTypeFeaturing, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + - while (ownedTypeFeaturingIterator.MoveNext()) + while (ownedTypeFeaturingCursor.Current != null) { - stringBuilder.Append(","); + stringBuilder.Append(", "); - if (ownedTypeFeaturingIterator.Current != null) + if (ownedTypeFeaturingCursor.Current != null) { - TypeFeaturingTextualNotationBuilder.BuildOwnedTypeFeaturing(ownedTypeFeaturingIterator.Current, stringBuilder); + + if (ownedTypeFeaturingCursor.Current is SysML2.NET.Core.POCO.Core.Features.ITypeFeaturing elementAsTypeFeaturing) + { + TypeFeaturingTextualNotationBuilder.BuildOwnedTypeFeaturing(elementAsTypeFeaturing, cursorCache, stringBuilder); + } } + ownedTypeFeaturingCursor.Move(); } @@ -672,28 +773,39 @@ public static void BuildTypeFeaturingPart(SysML2.NET.Core.POCO.Core.Features.IFe /// /// Builds the Textual Notation string for the rule FeatureChain - /// FeatureChain:Feature=ownedRelationship+=OwnedFeatureChaining('.'ownedRelationship+=OwnedFeatureChaining)+ + /// FeatureChain:Feature=ownedRelationship+=OwnedFeatureChaining('.'ownedRelationship+=OwnedFeatureChaining)+ /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildFeatureChain(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + public static void BuildFeatureChain(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfFeatureChainingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfFeatureChainingIterator.MoveNext(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (ownedRelationshipOfFeatureChainingIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(ownedRelationshipOfFeatureChainingIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IFeatureChaining elementAsFeatureChaining) + { + FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(elementAsFeatureChaining, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + - while (ownedRelationshipOfFeatureChainingIterator.MoveNext()) + while (ownedRelationshipCursor.Current != null) { stringBuilder.Append("."); - if (ownedRelationshipOfFeatureChainingIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(ownedRelationshipOfFeatureChainingIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IFeatureChaining elementAsFeatureChaining) + { + FeatureChainingTextualNotationBuilder.BuildOwnedFeatureChaining(elementAsFeatureChaining, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); } stringBuilder.Append(' '); @@ -702,149 +814,156 @@ public static void BuildFeatureChain(SysML2.NET.Core.POCO.Core.Features.IFeature /// /// Builds the Textual Notation string for the rule MetadataArgument - /// MetadataArgument:Feature=ownedRelationship+=MetadataValue + /// MetadataArgument:Feature=ownedRelationship+=MetadataValue /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildMetadataArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildMetadataArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelationship.Count) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + + if (ownedRelationshipCursor.Current != null) { - var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; - if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue elementAsFeatureValue) + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue elementAsFeatureValue) { - FeatureValueTextualNotationBuilder.BuildMetadataValue(elementAsFeatureValue, stringBuilder); + FeatureValueTextualNotationBuilder.BuildMetadataValue(elementAsFeatureValue, cursorCache, stringBuilder); } } + ownedRelationshipCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule TypeReference - /// TypeReference:Feature=ownedRelationship+=ReferenceTyping + /// TypeReference:Feature=ownedRelationship+=ReferenceTyping /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildTypeReference(SysML2.NET.Core.POCO.Core.Features.IFeature poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildTypeReference(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelationship.Count) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + + if (ownedRelationshipCursor.Current != null) { - var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; - if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Core.Features.IFeatureTyping elementAsFeatureTyping) + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IFeatureTyping elementAsFeatureTyping) { - FeatureTypingTextualNotationBuilder.BuildReferenceTyping(elementAsFeatureTyping, stringBuilder); + FeatureTypingTextualNotationBuilder.BuildReferenceTyping(elementAsFeatureTyping, cursorCache, stringBuilder); } } + ownedRelationshipCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule PrimaryArgument - /// PrimaryArgument:Feature=ownedRelationship+=PrimaryArgumentValue + /// PrimaryArgument:Feature=ownedRelationship+=PrimaryArgumentValue /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildPrimaryArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildPrimaryArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelationship.Count) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + + if (ownedRelationshipCursor.Current != null) { - var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; - if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue elementAsFeatureValue) + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue elementAsFeatureValue) { - FeatureValueTextualNotationBuilder.BuildPrimaryArgumentValue(elementAsFeatureValue, stringBuilder); + FeatureValueTextualNotationBuilder.BuildPrimaryArgumentValue(elementAsFeatureValue, cursorCache, stringBuilder); } } + ownedRelationshipCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule NonFeatureChainPrimaryArgument - /// NonFeatureChainPrimaryArgument:Feature=ownedRelationship+=NonFeatureChainPrimaryArgumentValue + /// NonFeatureChainPrimaryArgument:Feature=ownedRelationship+=NonFeatureChainPrimaryArgumentValue /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildNonFeatureChainPrimaryArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildNonFeatureChainPrimaryArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelationship.Count) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + + if (ownedRelationshipCursor.Current != null) { - var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; - if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue elementAsFeatureValue) + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue elementAsFeatureValue) { - FeatureValueTextualNotationBuilder.BuildNonFeatureChainPrimaryArgumentValue(elementAsFeatureValue, stringBuilder); + FeatureValueTextualNotationBuilder.BuildNonFeatureChainPrimaryArgumentValue(elementAsFeatureValue, cursorCache, stringBuilder); } } + ownedRelationshipCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule BodyArgument - /// BodyArgument:Feature=ownedRelationship+=BodyArgumentValue + /// BodyArgument:Feature=ownedRelationship+=BodyArgumentValue /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildBodyArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildBodyArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelationship.Count) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + + if (ownedRelationshipCursor.Current != null) { - var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; - if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue elementAsFeatureValue) + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue elementAsFeatureValue) { - FeatureValueTextualNotationBuilder.BuildBodyArgumentValue(elementAsFeatureValue, stringBuilder); + FeatureValueTextualNotationBuilder.BuildBodyArgumentValue(elementAsFeatureValue, cursorCache, stringBuilder); } } + ownedRelationshipCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule FunctionReferenceArgument - /// FunctionReferenceArgument:Feature=ownedRelationship+=FunctionReferenceArgumentValue + /// FunctionReferenceArgument:Feature=ownedRelationship+=FunctionReferenceArgumentValue /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildFunctionReferenceArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildFunctionReferenceArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelationship.Count) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + + if (ownedRelationshipCursor.Current != null) { - var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; - if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue elementAsFeatureValue) + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue elementAsFeatureValue) { - FeatureValueTextualNotationBuilder.BuildFunctionReferenceArgumentValue(elementAsFeatureValue, stringBuilder); + FeatureValueTextualNotationBuilder.BuildFunctionReferenceArgumentValue(elementAsFeatureValue, cursorCache, stringBuilder); } } + ownedRelationshipCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule FeatureReference - /// FeatureReference:Feature=[QualifiedName] + /// FeatureReference:Feature=[QualifiedName] /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildFeatureReference(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + public static void BuildFeatureReference(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { stringBuilder.Append(poco.qualifiedName); stringBuilder.Append(' '); @@ -853,54 +972,67 @@ public static void BuildFeatureReference(SysML2.NET.Core.POCO.Core.Features.IFea /// /// Builds the Textual Notation string for the rule ConstructorResult - /// ConstructorResult:Feature=ArgumentList + /// ConstructorResult:Feature=ArgumentList /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildConstructorResult(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + public static void BuildConstructorResult(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildArgumentList(poco, stringBuilder); + BuildArgumentList(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule ArgumentList - /// ArgumentList:Feature='('(PositionalArgumentList|NamedArgumentList)?')' + /// ArgumentList:Feature='('(PositionalArgumentList|NamedArgumentList)?')' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildArgumentList(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + public static void BuildArgumentList(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { stringBuilder.Append("("); - throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); + BuildArgumentListHandCoded(poco, cursorCache, stringBuilder); stringBuilder.Append(")"); } /// /// Builds the Textual Notation string for the rule PositionalArgumentList - /// PositionalArgumentList:Feature=e.ownedRelationship+=ArgumentMember(','e.ownedRelationship+=ArgumentMember)* + /// PositionalArgumentList:Feature=e.ownedRelationship+=ArgumentMember(','e.ownedRelationship+=ArgumentMember)* /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildPositionalArgumentList(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + public static void BuildPositionalArgumentList(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfParameterMembershipIterator.MoveNext(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildArgumentMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); - while (ownedRelationshipOfParameterMembershipIterator.MoveNext()) + + while (ownedRelationshipCursor.Current != null) { - stringBuilder.Append(","); + stringBuilder.Append(", "); - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildArgumentMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); } @@ -908,28 +1040,39 @@ public static void BuildPositionalArgumentList(SysML2.NET.Core.POCO.Core.Feature /// /// Builds the Textual Notation string for the rule NamedArgumentList - /// NamedArgumentList:Feature=ownedRelationship+=NamedArgumentMember(','ownedRelationship+=NamedArgumentMember)* + /// NamedArgumentList:Feature=ownedRelationship+=NamedArgumentMember(','ownedRelationship+=NamedArgumentMember)* /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildNamedArgumentList(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + public static void BuildNamedArgumentList(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfFeatureMembershipIterator.MoveNext(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - FeatureMembershipTextualNotationBuilder.BuildNamedArgumentMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Types.IFeatureMembership elementAsFeatureMembership) + { + FeatureMembershipTextualNotationBuilder.BuildNamedArgumentMember(elementAsFeatureMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); - while (ownedRelationshipOfFeatureMembershipIterator.MoveNext()) + + while (ownedRelationshipCursor.Current != null) { - stringBuilder.Append(","); + stringBuilder.Append(", "); - if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - FeatureMembershipTextualNotationBuilder.BuildNamedArgumentMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Types.IFeatureMembership elementAsFeatureMembership) + { + FeatureMembershipTextualNotationBuilder.BuildNamedArgumentMember(elementAsFeatureMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); } @@ -937,66 +1080,95 @@ public static void BuildNamedArgumentList(SysML2.NET.Core.POCO.Core.Features.IFe /// /// Builds the Textual Notation string for the rule NamedArgument - /// NamedArgument:Feature=ownedRelationship+=ParameterRedefinition'='ownedRelationship+=ArgumentValue + /// NamedArgument:Feature=ownedRelationship+=ParameterRedefinition'='ownedRelationship+=ArgumentValue /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildNamedArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + public static void BuildNamedArgument(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfRedefinitionIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfRedefinitionIterator.MoveNext(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (ownedRelationshipOfRedefinitionIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - RedefinitionTextualNotationBuilder.BuildParameterRedefinition(ownedRelationshipOfRedefinitionIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IRedefinition elementAsRedefinition) + { + RedefinitionTextualNotationBuilder.BuildParameterRedefinition(elementAsRedefinition, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + stringBuilder.Append("="); - ownedRelationshipOfFeatureValueIterator.MoveNext(); - if (ownedRelationshipOfFeatureValueIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - FeatureValueTextualNotationBuilder.BuildArgumentValue(ownedRelationshipOfFeatureValueIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue elementAsFeatureValue) + { + FeatureValueTextualNotationBuilder.BuildArgumentValue(elementAsFeatureValue, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } /// /// Builds the Textual Notation string for the rule MetadataBodyFeature - /// MetadataBodyFeature:Feature='feature'?(':>>'|'redefines')?ownedRelationship+=OwnedRedefinitionFeatureSpecializationPart?ValuePart?MetadataBody + /// MetadataBodyFeature:Feature='feature'?(':>>'|'redefines')?ownedRelationship+=OwnedRedefinitionFeatureSpecializationPart?ValuePart?MetadataBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildMetadataBodyFeature(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + public static void BuildMetadataBodyFeature(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfRedefinitionIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); stringBuilder.Append("feature "); stringBuilder.Append(" :>> "); - ownedRelationshipOfRedefinitionIterator.MoveNext(); - if (ownedRelationshipOfRedefinitionIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - RedefinitionTextualNotationBuilder.BuildOwnedRedefinition(ownedRelationshipOfRedefinitionIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IRedefinition elementAsRedefinition) + { + RedefinitionTextualNotationBuilder.BuildOwnedRedefinition(elementAsRedefinition, cursorCache, stringBuilder); + } + } + ownedRelationshipCursor.Move(); + + + if (poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || poco.IsOrdered) + { + BuildFeatureSpecializationPart(poco, cursorCache, stringBuilder); } - BuildFeatureSpecializationPart(poco, stringBuilder); - BuildValuePart(poco, 0, stringBuilder); - TypeTextualNotationBuilder.BuildMetadataBody(poco, stringBuilder); + + if (poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || !string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.Direction.HasValue || poco.IsDerived || poco.IsAbstract || poco.IsConstant || poco.IsOrdered || poco.IsEnd || poco.importedMembership.Count != 0 || poco.IsComposite || poco.IsPortion || poco.IsVariable || poco.IsSufficient || poco.unioningType.Count != 0 || poco.intersectingType.Count != 0 || poco.differencingType.Count != 0 || poco.featuringType.Count != 0 || poco.ownedTypeFeaturing.Count != 0) + { + BuildValuePart(poco, cursorCache, stringBuilder); + } + TypeTextualNotationBuilder.BuildMetadataBody(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule Feature - /// Feature=(FeaturePrefix('feature'|ownedRelationship+=PrefixMetadataMember)FeatureDeclaration?|(EndFeaturePrefix|BasicFeaturePrefix)FeatureDeclaration)ValuePart?TypeBody + /// Feature=(FeaturePrefix('feature'|ownedRelationship+=PrefixMetadataMember)FeatureDeclaration?|(EndFeaturePrefix|BasicFeaturePrefix)FeatureDeclaration)ValuePart?TypeBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildFeature(SysML2.NET.Core.POCO.Core.Features.IFeature poco, StringBuilder stringBuilder) + public static void BuildFeature(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + BuildFeatureHandCoded(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); - BuildValuePart(poco, 0, stringBuilder); - TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); + + if (poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || !string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.Direction.HasValue || poco.IsDerived || poco.IsAbstract || poco.IsConstant || poco.IsOrdered || poco.IsEnd || poco.importedMembership.Count != 0 || poco.IsComposite || poco.IsPortion || poco.IsVariable || poco.IsSufficient || poco.unioningType.Count != 0 || poco.intersectingType.Count != 0 || poco.differencingType.Count != 0 || poco.featuringType.Count != 0 || poco.ownedTypeFeaturing.Count != 0) + { + BuildValuePart(poco, cursorCache, stringBuilder); + } + TypeTextualNotationBuilder.BuildTypeBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs index 308c9c10..cee6d593 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs @@ -36,22 +36,24 @@ public static partial class FeatureTypingTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule OwnedFeatureTyping - /// OwnedFeatureTyping:FeatureTyping=type=[QualifiedName]|type=OwnedFeatureChain{ownedRelatedElement+=type} + /// OwnedFeatureTyping:FeatureTyping=type=[QualifiedName]|type=OwnedFeatureChain{ownedRelatedElement+=type} /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildOwnedFeatureTyping(SysML2.NET.Core.POCO.Core.Features.IFeatureTyping poco, StringBuilder stringBuilder) + public static void BuildOwnedFeatureTyping(SysML2.NET.Core.POCO.Core.Features.IFeatureTyping poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildOwnedFeatureTypingHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule ReferenceTyping - /// ReferenceTyping:FeatureTyping=type=[QualifiedName] + /// ReferenceTyping:FeatureTyping=type=[QualifiedName] /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildReferenceTyping(SysML2.NET.Core.POCO.Core.Features.IFeatureTyping poco, StringBuilder stringBuilder) + public static void BuildReferenceTyping(SysML2.NET.Core.POCO.Core.Features.IFeatureTyping poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.Type != null) @@ -64,19 +66,20 @@ public static void BuildReferenceTyping(SysML2.NET.Core.POCO.Core.Features.IFeat /// /// Builds the Textual Notation string for the rule FeatureTyping - /// FeatureTyping=OwnedFeatureTyping|ConjugatedPortTyping + /// FeatureTyping=OwnedFeatureTyping|ConjugatedPortTyping /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildFeatureTyping(SysML2.NET.Core.POCO.Core.Features.IFeatureTyping poco, StringBuilder stringBuilder) + public static void BuildFeatureTyping(SysML2.NET.Core.POCO.Core.Features.IFeatureTyping poco, ICursorCache cursorCache, StringBuilder stringBuilder) { switch (poco) { - case SysML2.NET.Core.POCO.Systems.Ports.ConjugatedPortTyping pocoConjugatedPortTyping: - ConjugatedPortTypingTextualNotationBuilder.BuildConjugatedPortTyping(pocoConjugatedPortTyping, stringBuilder); + case SysML2.NET.Core.POCO.Systems.Ports.IConjugatedPortTyping pocoConjugatedPortTyping: + ConjugatedPortTypingTextualNotationBuilder.BuildConjugatedPortTyping(pocoConjugatedPortTyping, cursorCache, stringBuilder); break; default: - BuildOwnedFeatureTyping(poco, stringBuilder); + BuildOwnedFeatureTyping(poco, cursorCache, stringBuilder); break; } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureValueTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureValueTextualNotationBuilder.cs index 7711e570..df118211 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureValueTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureValueTextualNotationBuilder.cs @@ -24,7 +24,6 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; @@ -37,152 +36,165 @@ public static partial class FeatureValueTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule TriggerFeatureValue - /// TriggerFeatureValue:FeatureValue=ownedRelatedElement+=TriggerExpression + /// TriggerFeatureValue:FeatureValue=ownedRelatedElement+=TriggerExpression /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildTriggerFeatureValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildTriggerFeatureValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelatedElement.Count) + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Systems.Actions.ITriggerInvocationExpression elementAsTriggerInvocationExpression) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.Actions.ITriggerInvocationExpression elementAsTriggerInvocationExpression) { - TriggerInvocationExpressionTextualNotationBuilder.BuildTriggerExpression(elementAsTriggerInvocationExpression, 0, stringBuilder); + TriggerInvocationExpressionTextualNotationBuilder.BuildTriggerExpression(elementAsTriggerInvocationExpression, cursorCache, stringBuilder); } } + ownedRelatedElementCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule ArgumentValue - /// ArgumentValue:FeatureValue=value=OwnedExpression + /// ArgumentValue:FeatureValue=value=OwnedExpression /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildArgumentValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) + public static void BuildArgumentValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.value != null) { - ExpressionTextualNotationBuilder.BuildOwnedExpression(poco.value, stringBuilder); + ExpressionTextualNotationBuilder.BuildOwnedExpression(poco.value, cursorCache, stringBuilder); } } /// /// Builds the Textual Notation string for the rule ArgumentExpressionValue - /// ArgumentExpressionValue:FeatureValue=ownedRelatedElement+=OwnedExpressionReference + /// ArgumentExpressionValue:FeatureValue=ownedRelatedElement+=OwnedExpressionReference /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildArgumentExpressionValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildArgumentExpressionValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelatedElement.Count) + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression elementAsFeatureReferenceExpression) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression elementAsFeatureReferenceExpression) { - FeatureReferenceExpressionTextualNotationBuilder.BuildOwnedExpressionReference(elementAsFeatureReferenceExpression, 0, stringBuilder); + FeatureReferenceExpressionTextualNotationBuilder.BuildOwnedExpressionReference(elementAsFeatureReferenceExpression, cursorCache, stringBuilder); } } + ownedRelatedElementCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule FeatureBinding - /// FeatureBinding:FeatureValue=ownedRelatedElement+=OwnedExpression + /// FeatureBinding:FeatureValue=ownedRelatedElement+=OwnedExpression /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildFeatureBinding(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildFeatureBinding(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelatedElement.Count) + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Kernel.Functions.IExpression elementAsExpression) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Kernel.Functions.IExpression elementAsExpression) { - ExpressionTextualNotationBuilder.BuildOwnedExpression(elementAsExpression, stringBuilder); + ExpressionTextualNotationBuilder.BuildOwnedExpression(elementAsExpression, cursorCache, stringBuilder); } } + ownedRelatedElementCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule AssignmentTargetBinding - /// AssignmentTargetBinding:FeatureValue=ownedRelatedElement+=NonFeatureChainPrimaryExpression + /// AssignmentTargetBinding:FeatureValue=ownedRelatedElement+=NonFeatureChainPrimaryExpression /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildAssignmentTargetBinding(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildAssignmentTargetBinding(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelatedElement.Count) + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Kernel.Functions.IExpression elementAsExpression) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Kernel.Functions.IExpression elementAsExpression) { - ExpressionTextualNotationBuilder.BuildNonFeatureChainPrimaryExpression(elementAsExpression, stringBuilder); + ExpressionTextualNotationBuilder.BuildNonFeatureChainPrimaryExpression(elementAsExpression, cursorCache, stringBuilder); } } + ownedRelatedElementCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule SatisfactionFeatureValue - /// SatisfactionFeatureValue:FeatureValue=ownedRelatedElement+=SatisfactionReferenceExpression + /// SatisfactionFeatureValue:FeatureValue=ownedRelatedElement+=SatisfactionReferenceExpression /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildSatisfactionFeatureValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildSatisfactionFeatureValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelatedElement.Count) + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression elementAsFeatureReferenceExpression) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression elementAsFeatureReferenceExpression) { - FeatureReferenceExpressionTextualNotationBuilder.BuildSatisfactionReferenceExpression(elementAsFeatureReferenceExpression, 0, stringBuilder); + FeatureReferenceExpressionTextualNotationBuilder.BuildSatisfactionReferenceExpression(elementAsFeatureReferenceExpression, cursorCache, stringBuilder); } } + ownedRelatedElementCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule MetadataValue - /// MetadataValue:FeatureValue=value=MetadataReference + /// MetadataValue:FeatureValue=value=MetadataReference /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildMetadataValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) + public static void BuildMetadataValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.value != null) { - var elementForOwnedRelationship = poco.value.OwnedRelationship[0]; + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Root.Namespaces.IMembership elementAsMembership) + if (ownedRelationshipCursor.Current != null) { - MembershipTextualNotationBuilder.BuildElementReferenceMember(elementAsMembership, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IMembership elementAsMembership) + { + MembershipTextualNotationBuilder.BuildElementReferenceMember(elementAsMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } @@ -190,53 +202,62 @@ public static void BuildMetadataValue(SysML2.NET.Core.POCO.Kernel.FeatureValues. /// /// Builds the Textual Notation string for the rule PrimaryArgumentValue - /// PrimaryArgumentValue:FeatureValue=value=PrimaryExpression + /// PrimaryArgumentValue:FeatureValue=value=PrimaryExpression /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildPrimaryArgumentValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) + public static void BuildPrimaryArgumentValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.value != null) { - ExpressionTextualNotationBuilder.BuildPrimaryExpression(poco.value, stringBuilder); + ExpressionTextualNotationBuilder.BuildPrimaryExpression(poco.value, cursorCache, stringBuilder); } } /// /// Builds the Textual Notation string for the rule NonFeatureChainPrimaryArgumentValue - /// NonFeatureChainPrimaryArgumentValue:FeatureValue=value=NonFeatureChainPrimaryExpression + /// NonFeatureChainPrimaryArgumentValue:FeatureValue=value=NonFeatureChainPrimaryExpression /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildNonFeatureChainPrimaryArgumentValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) + public static void BuildNonFeatureChainPrimaryArgumentValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.value != null) { - ExpressionTextualNotationBuilder.BuildNonFeatureChainPrimaryExpression(poco.value, stringBuilder); + ExpressionTextualNotationBuilder.BuildNonFeatureChainPrimaryExpression(poco.value, cursorCache, stringBuilder); } } /// /// Builds the Textual Notation string for the rule BodyArgumentValue - /// BodyArgumentValue:FeatureValue=value=BodyExpression + /// BodyArgumentValue:FeatureValue=value=BodyExpression /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildBodyArgumentValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) + public static void BuildBodyArgumentValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.value != null) { - var elementForOwnedRelationship = poco.value.OwnedRelationship[0]; + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Core.Types.IFeatureMembership elementAsFeatureMembership) + if (ownedRelationshipCursor.Current != null) { - FeatureMembershipTextualNotationBuilder.BuildExpressionBodyMember(elementAsFeatureMembership, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Types.IFeatureMembership elementAsFeatureMembership) + { + FeatureMembershipTextualNotationBuilder.BuildExpressionBodyMember(elementAsFeatureMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } @@ -244,21 +265,28 @@ public static void BuildBodyArgumentValue(SysML2.NET.Core.POCO.Kernel.FeatureVal /// /// Builds the Textual Notation string for the rule FunctionReferenceArgumentValue - /// FunctionReferenceArgumentValue:FeatureValue=value=FunctionReferenceExpression + /// FunctionReferenceArgumentValue:FeatureValue=value=FunctionReferenceExpression /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildFunctionReferenceArgumentValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) + public static void BuildFunctionReferenceArgumentValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.value != null) { - var elementForOwnedRelationship = poco.value.OwnedRelationship[0]; + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Core.Types.IFeatureMembership elementAsFeatureMembership) + if (ownedRelationshipCursor.Current != null) { - FeatureMembershipTextualNotationBuilder.BuildFunctionReferenceMember(elementAsFeatureMembership, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Types.IFeatureMembership elementAsFeatureMembership) + { + FeatureMembershipTextualNotationBuilder.BuildFunctionReferenceMember(elementAsFeatureMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } @@ -266,21 +294,27 @@ public static void BuildFunctionReferenceArgumentValue(SysML2.NET.Core.POCO.Kern /// /// Builds the Textual Notation string for the rule FeatureValue - /// FeatureValue=('='|isInitial?=':='|isDefault?='default'('='|isInitial?=':=')?)ownedRelatedElement+=OwnedExpression + /// FeatureValue=('='|isInitial?=':='|isDefault?='default'('='|isInitial?=':=')?)ownedRelatedElement+=OwnedExpression /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildFeatureValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, StringBuilder stringBuilder) + public static void BuildFeatureValue(SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + BuildFeatureValueHandCoded(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); - ownedRelatedElementOfExpressionIterator.MoveNext(); - if (ownedRelatedElementOfExpressionIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - ExpressionTextualNotationBuilder.BuildOwnedExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Kernel.Functions.IExpression elementAsExpression) + { + ExpressionTextualNotationBuilder.BuildOwnedExpression(elementAsExpression, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowDefinitionTextualNotationBuilder.cs index 8e03f5f9..347aff53 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowDefinitionTextualNotationBuilder.cs @@ -36,16 +36,17 @@ public static partial class FlowDefinitionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule FlowDefinition - /// FlowDefinition=OccurrenceDefinitionPrefix'flow''def'Definition + /// FlowDefinition=OccurrenceDefinitionPrefix'flow''def'Definition /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildFlowDefinition(SysML2.NET.Core.POCO.Systems.Flows.IFlowDefinition poco, StringBuilder stringBuilder) + public static void BuildFlowDefinition(SysML2.NET.Core.POCO.Systems.Flows.IFlowDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("flow "); stringBuilder.Append("def "); - DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); + DefinitionTextualNotationBuilder.BuildDefinition(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowEndTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowEndTextualNotationBuilder.cs index b5cbf9db..1a769668 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowEndTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowEndTextualNotationBuilder.cs @@ -36,31 +36,40 @@ public static partial class FlowEndTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule FlowEnd - /// FlowEnd=(ownedRelationship+=FlowEndSubsetting)?ownedRelationship+=FlowFeatureMember + /// FlowEnd=(ownedRelationship+=FlowEndSubsetting)?ownedRelationship+=FlowFeatureMember /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildFlowEnd(SysML2.NET.Core.POCO.Kernel.Interactions.IFlowEnd poco, StringBuilder stringBuilder) + public static void BuildFlowEnd(SysML2.NET.Core.POCO.Kernel.Interactions.IFlowEnd poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfReferenceSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (ownedRelationshipOfReferenceSubsettingIterator.MoveNext()) + if (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfReferenceSubsettingIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ReferenceSubsettingTextualNotationBuilder.BuildFlowEndSubsetting(ownedRelationshipOfReferenceSubsettingIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IReferenceSubsetting elementAsReferenceSubsetting) + { + ReferenceSubsettingTextualNotationBuilder.BuildFlowEndSubsetting(elementAsReferenceSubsetting, cursorCache, stringBuilder); + } } stringBuilder.Append(' '); } - ownedRelationshipOfFeatureMembershipIterator.MoveNext(); - if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - FeatureMembershipTextualNotationBuilder.BuildFlowFeatureMember(ownedRelationshipOfFeatureMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Types.IFeatureMembership elementAsFeatureMembership) + { + FeatureMembershipTextualNotationBuilder.BuildFlowFeatureMember(elementAsFeatureMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowTextualNotationBuilder.cs index 2d5dd3fa..f6fdf20c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowTextualNotationBuilder.cs @@ -36,29 +36,35 @@ public static partial class FlowTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule Flow - /// Flow=FeaturePrefix'flow'FlowDeclarationTypeBody + /// Flow=FeaturePrefix'flow'FlowDeclarationTypeBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildFlow(SysML2.NET.Core.POCO.Kernel.Interactions.IFlow poco, StringBuilder stringBuilder) + public static void BuildFlow(SysML2.NET.Core.POCO.Kernel.Interactions.IFlow poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + BuildFeaturePrefixHandCoded(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); - while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + while (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfOwningMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(elementAsOwningMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); } stringBuilder.Append("flow "); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); + BuildFlowDeclarationHandCoded(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildTypeBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowUsageTextualNotationBuilder.cs index ea478d7b..e485d9d9 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FlowUsageTextualNotationBuilder.cs @@ -24,7 +24,6 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; @@ -37,60 +36,58 @@ public static partial class FlowUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule Message - /// Message:FlowUsage=OccurrenceUsagePrefix'message'MessageDeclarationDefinitionBody{isAbstract=true} + /// Message:FlowUsage=OccurrenceUsagePrefix'message'MessageDeclarationDefinitionBody{isAbstract=true} /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildMessage(SysML2.NET.Core.POCO.Systems.Flows.IFlowUsage poco, StringBuilder stringBuilder) + public static void BuildMessage(SysML2.NET.Core.POCO.Systems.Flows.IFlowUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("message "); - BuildMessageDeclaration(poco, 0, stringBuilder); - TypeTextualNotationBuilder.BuildDefinitionBody(poco, stringBuilder); + BuildMessageDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildDefinitionBody(poco, cursorCache, 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 + /// 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 index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildMessageDeclaration(SysML2.NET.Core.POCO.Systems.Flows.IFlowUsage poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildMessageDeclaration(SysML2.NET.Core.POCO.Systems.Flows.IFlowUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - return elementIndex; + BuildMessageDeclarationHandCoded(poco, cursorCache, stringBuilder); } /// /// 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 + /// 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 index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildFlowDeclaration(SysML2.NET.Core.POCO.Systems.Flows.IFlowUsage poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildFlowDeclaration(SysML2.NET.Core.POCO.Systems.Flows.IFlowUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - return elementIndex; + BuildFlowDeclarationHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule FlowUsage - /// FlowUsage=OccurrenceUsagePrefix'flow'FlowDeclarationDefinitionBody + /// FlowUsage=OccurrenceUsagePrefix'flow'FlowDeclarationDefinitionBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildFlowUsage(SysML2.NET.Core.POCO.Systems.Flows.IFlowUsage poco, StringBuilder stringBuilder) + public static void BuildFlowUsage(SysML2.NET.Core.POCO.Systems.Flows.IFlowUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("flow "); - BuildFlowDeclaration(poco, 0, stringBuilder); - TypeTextualNotationBuilder.BuildDefinitionBody(poco, stringBuilder); + BuildFlowDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildDefinitionBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForLoopActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForLoopActionUsageTextualNotationBuilder.cs index 5fcdee0b..07ad083b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForLoopActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForLoopActionUsageTextualNotationBuilder.cs @@ -36,35 +36,50 @@ public static partial class ForLoopActionUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule ForLoopNode - /// ForLoopNode:ForLoopActionUsage=ActionNodePrefix'for'ownedRelationship+=ForVariableDeclarationMember'in'ownedRelationship+=NodeParameterMemberownedRelationship+=ActionBodyParameterMember + /// ForLoopNode:ForLoopActionUsage=ActionNodePrefix'for'ownedRelationship+=ForVariableDeclarationMember'in'ownedRelationship+=NodeParameterMemberownedRelationship+=ActionBodyParameterMember /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildForLoopNode(SysML2.NET.Core.POCO.Systems.Actions.IForLoopActionUsage poco, StringBuilder stringBuilder) + public static void BuildForLoopNode(SysML2.NET.Core.POCO.Systems.Actions.IForLoopActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ActionUsageTextualNotationBuilder.BuildActionNodePrefix(poco, stringBuilder); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + ActionUsageTextualNotationBuilder.BuildActionNodePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("for "); - ownedRelationshipOfFeatureMembershipIterator.MoveNext(); - if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - FeatureMembershipTextualNotationBuilder.BuildForVariableDeclarationMember(ownedRelationshipOfFeatureMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Types.IFeatureMembership elementAsFeatureMembership) + { + FeatureMembershipTextualNotationBuilder.BuildForVariableDeclarationMember(elementAsFeatureMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + stringBuilder.Append("in "); - ownedRelationshipOfParameterMembershipIterator.MoveNext(); - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } - ownedRelationshipOfParameterMembershipIterator.MoveNext(); + ownedRelationshipCursor.Move(); - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildActionBodyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildActionBodyParameterMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForkNodeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForkNodeTextualNotationBuilder.cs index 2faff843..f80f4aaa 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForkNodeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ForkNodeTextualNotationBuilder.cs @@ -36,19 +36,20 @@ public static partial class ForkNodeTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule ForkNode - /// ForkNode=ControlNodePrefixisComposite?='fork'UsageDeclarationActionBody + /// ForkNode=ControlNodePrefixisComposite?='fork'UsageDeclarationActionBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildForkNode(SysML2.NET.Core.POCO.Systems.Actions.IForkNode poco, StringBuilder stringBuilder) + public static void BuildForkNode(SysML2.NET.Core.POCO.Systems.Actions.IForkNode poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceUsageTextualNotationBuilder.BuildControlNodePrefix(poco, stringBuilder); + OccurrenceUsageTextualNotationBuilder.BuildControlNodePrefix(poco, cursorCache, stringBuilder); if (poco.IsComposite) { stringBuilder.Append(" fork "); } - UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildActionBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FramedConcernMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FramedConcernMembershipTextualNotationBuilder.cs index 1ccc9b46..34643805 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FramedConcernMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FramedConcernMembershipTextualNotationBuilder.cs @@ -36,21 +36,31 @@ public static partial class FramedConcernMembershipTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule FramedConcernMember - /// FramedConcernMember:FramedConcernMembership=MemberPrefix?'frame'ownedRelatedElement+=FramedConcernUsage + /// FramedConcernMember:FramedConcernMembership=MemberPrefix?'frame'ownedRelatedElement+=FramedConcernUsage /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildFramedConcernMember(SysML2.NET.Core.POCO.Systems.Requirements.IFramedConcernMembership poco, StringBuilder stringBuilder) + public static void BuildFramedConcernMember(SysML2.NET.Core.POCO.Systems.Requirements.IFramedConcernMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfConcernUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (poco.Visibility != SysML2.NET.Core.Root.Namespaces.VisibilityKind.Public) + { + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); + } stringBuilder.Append("frame "); - ownedRelatedElementOfConcernUsageIterator.MoveNext(); - if (ownedRelatedElementOfConcernUsageIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - ConcernUsageTextualNotationBuilder.BuildFramedConcernUsage(ownedRelatedElementOfConcernUsageIterator.Current, 0, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.Requirements.IConcernUsage elementAsConcernUsage) + { + ConcernUsageTextualNotationBuilder.BuildFramedConcernUsage(elementAsConcernUsage, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FunctionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FunctionTextualNotationBuilder.cs index 7533b9c9..da4b1e03 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FunctionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FunctionTextualNotationBuilder.cs @@ -36,16 +36,17 @@ public static partial class FunctionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule Function - /// Function=TypePrefix'function'ClassifierDeclarationFunctionBody + /// Function=TypePrefix'function'ClassifierDeclarationFunctionBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildFunction(SysML2.NET.Core.POCO.Kernel.Functions.IFunction poco, StringBuilder stringBuilder) + public static void BuildFunction(SysML2.NET.Core.POCO.Kernel.Functions.IFunction poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); + TypeTextualNotationBuilder.BuildTypePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("function "); - ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildFunctionBody(poco, stringBuilder); + ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildFunctionBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs index 671d029f..4a8e4ada 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs @@ -36,33 +36,43 @@ 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))? + /// IfNode:IfActionUsage=ActionNodePrefix'if'ownedRelationship+=ExpressionParameterMemberownedRelationship+=ActionBodyParameterMember('else'ownedRelationship+=(ActionBodyParameterMember|IfNodeParameterMember))? /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildIfNode(SysML2.NET.Core.POCO.Systems.Actions.IIfActionUsage poco, StringBuilder stringBuilder) + public static void BuildIfNode(SysML2.NET.Core.POCO.Systems.Actions.IIfActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ActionUsageTextualNotationBuilder.BuildActionNodePrefix(poco, stringBuilder); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + ActionUsageTextualNotationBuilder.BuildActionNodePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("if "); - ownedRelationshipOfParameterMembershipIterator.MoveNext(); - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildExpressionParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildExpressionParameterMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } - ownedRelationshipOfParameterMembershipIterator.MoveNext(); + ownedRelationshipCursor.Move(); + - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildActionBodyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildActionBodyParameterMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + - if (ownedRelationshipOfParameterMembershipIterator.MoveNext()) + if (ownedRelationshipCursor.Current != null) { stringBuilder.Append("else "); - throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); - stringBuilder.Append(' '); + BuildIfNodeHandCoded(poco, cursorCache, stringBuilder); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ImportTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ImportTextualNotationBuilder.cs index f36887d4..1d98639c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ImportTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ImportTextualNotationBuilder.cs @@ -28,7 +28,6 @@ namespace SysML2.NET.TextualNotation using System.Text; using SysML2.NET.Core.POCO.Root.Elements; - using SysML2.NET.Core.POCO.Root.Namespaces; /// /// The provides Textual Notation Builder for the element @@ -37,19 +36,20 @@ public static partial class ImportTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule ImportDeclaration - /// ImportDeclaration:Import=MembershipImport|NamespaceImport + /// ImportDeclaration:Import=MembershipImport|NamespaceImport /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildImportDeclaration(SysML2.NET.Core.POCO.Root.Namespaces.IImport poco, StringBuilder stringBuilder) + public static void BuildImportDeclaration(SysML2.NET.Core.POCO.Root.Namespaces.IImport poco, ICursorCache cursorCache, StringBuilder stringBuilder) { switch (poco) { - case SysML2.NET.Core.POCO.Root.Namespaces.MembershipImport pocoMembershipImport: - MembershipImportTextualNotationBuilder.BuildMembershipImport(pocoMembershipImport, stringBuilder); + case SysML2.NET.Core.POCO.Root.Namespaces.IMembershipImport pocoMembershipImport: + MembershipImportTextualNotationBuilder.BuildMembershipImport(pocoMembershipImport, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Root.Namespaces.NamespaceImport pocoNamespaceImport: - NamespaceImportTextualNotationBuilder.BuildNamespaceImport(pocoNamespaceImport, stringBuilder); + case SysML2.NET.Core.POCO.Root.Namespaces.INamespaceImport pocoNamespaceImport: + NamespaceImportTextualNotationBuilder.BuildNamespaceImport(pocoNamespaceImport, cursorCache, stringBuilder); break; } @@ -57,12 +57,12 @@ public static void BuildImportDeclaration(SysML2.NET.Core.POCO.Root.Namespaces.I /// /// Builds the Textual Notation string for the rule Import - /// Import=visibility=VisibilityIndicator'import'(isImportAll?='all')?ImportDeclarationRelationshipBody + /// Import=visibility=VisibilityIndicator'import'(isImportAll?='all')?ImportDeclarationRelationshipBody /// /// The from which the rule should be build - /// + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildImport(IImport poco, ICursorCache cursor, StringBuilder stringBuilder) + public static void BuildImport(SysML2.NET.Core.POCO.Root.Namespaces.IImport poco, ICursorCache cursorCache, StringBuilder stringBuilder) { stringBuilder.Append(poco.Visibility.ToString().ToLower()); stringBuilder.Append("import "); @@ -73,8 +73,8 @@ public static void BuildImport(IImport poco, ICursorCache cursor, StringBuilder stringBuilder.Append(' '); } - BuildImportDeclaration(poco, stringBuilder); - RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); + BuildImportDeclaration(poco, cursorCache, stringBuilder); + RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IncludeUseCaseUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IncludeUseCaseUsageTextualNotationBuilder.cs index 007ad859..939b6ebd 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IncludeUseCaseUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IncludeUseCaseUsageTextualNotationBuilder.cs @@ -36,19 +36,24 @@ public static partial class IncludeUseCaseUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule IncludeUseCaseUsage - /// IncludeUseCaseUsage=OccurrenceUsagePrefix'include'(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'use''case'UsageDeclaration)ValuePart?CaseBody + /// IncludeUseCaseUsage=OccurrenceUsagePrefix'include'(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'use''case'UsageDeclaration)ValuePart?CaseBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildIncludeUseCaseUsage(SysML2.NET.Core.POCO.Systems.UseCases.IIncludeUseCaseUsage poco, StringBuilder stringBuilder) + public static void BuildIncludeUseCaseUsage(SysML2.NET.Core.POCO.Systems.UseCases.IIncludeUseCaseUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfReferenceSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("include "); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildIncludeUseCaseUsageHandCoded(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); - FeatureTextualNotationBuilder.BuildValuePart(poco, 0, stringBuilder); - TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); + + if (poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || !string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.Direction.HasValue || poco.IsDerived || poco.IsAbstract || poco.IsConstant || poco.IsOrdered || poco.IsEnd || poco.importedMembership.Count != 0 || poco.IsComposite || poco.IsPortion || poco.IsVariable || poco.IsSufficient || poco.unioningType.Count != 0 || poco.intersectingType.Count != 0 || poco.differencingType.Count != 0 || poco.featuringType.Count != 0 || poco.ownedTypeFeaturing.Count != 0) + { + FeatureTextualNotationBuilder.BuildValuePart(poco, cursorCache, stringBuilder); + } + TypeTextualNotationBuilder.BuildCaseBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IndexExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IndexExpressionTextualNotationBuilder.cs index 3a765c76..cbc2991f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IndexExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IndexExpressionTextualNotationBuilder.cs @@ -36,28 +36,38 @@ public static partial class IndexExpressionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule IndexExpression - /// IndexExpression=ownedRelationship+=PrimaryArgumentMember'#''('ownedRelationship+=SequenceExpressionListMember')' + /// IndexExpression=ownedRelationship+=PrimaryArgumentMember'#''('ownedRelationship+=SequenceExpressionListMember')' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildIndexExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IIndexExpression poco, StringBuilder stringBuilder) + public static void BuildIndexExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IIndexExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfParameterMembershipIterator.MoveNext(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildPrimaryArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildPrimaryArgumentMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + stringBuilder.Append("#"); stringBuilder.Append("("); - ownedRelationshipOfFeatureMembershipIterator.MoveNext(); - if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - FeatureMembershipTextualNotationBuilder.BuildSequenceExpressionListMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Types.IFeatureMembership elementAsFeatureMembership) + { + FeatureMembershipTextualNotationBuilder.BuildSequenceExpressionListMember(elementAsFeatureMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + stringBuilder.Append(")"); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InteractionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InteractionTextualNotationBuilder.cs index 55e47728..ad15d1af 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InteractionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InteractionTextualNotationBuilder.cs @@ -36,16 +36,17 @@ public static partial class InteractionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule Interaction - /// Interaction=TypePrefix'interaction'ClassifierDeclarationTypeBody + /// Interaction=TypePrefix'interaction'ClassifierDeclarationTypeBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildInteraction(SysML2.NET.Core.POCO.Kernel.Interactions.IInteraction poco, StringBuilder stringBuilder) + public static void BuildInteraction(SysML2.NET.Core.POCO.Kernel.Interactions.IInteraction poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); + TypeTextualNotationBuilder.BuildTypePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("interaction "); - ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); + ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildTypeBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceDefinitionTextualNotationBuilder.cs index b1efd5bd..7703a413 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceDefinitionTextualNotationBuilder.cs @@ -36,17 +36,18 @@ public static partial class InterfaceDefinitionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule InterfaceDefinition - /// InterfaceDefinition=OccurrenceDefinitionPrefix'interface''def'DefinitionDeclarationInterfaceBody + /// InterfaceDefinition=OccurrenceDefinitionPrefix'interface''def'DefinitionDeclarationInterfaceBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildInterfaceDefinition(SysML2.NET.Core.POCO.Systems.Interfaces.IInterfaceDefinition poco, StringBuilder stringBuilder) + public static void BuildInterfaceDefinition(SysML2.NET.Core.POCO.Systems.Interfaces.IInterfaceDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("interface "); stringBuilder.Append("def "); - DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildInterfaceBody(poco, stringBuilder); + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildInterfaceBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs index 465955ba..ca2c287a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs @@ -36,83 +36,112 @@ public static partial class InterfaceUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule InterfaceUsageDeclaration - /// InterfaceUsageDeclaration:InterfaceUsage=UsageDeclarationValuePart?('connect'InterfacePart)?|InterfacePart + /// InterfaceUsageDeclaration:InterfaceUsage=UsageDeclarationValuePart?('connect'InterfacePart)?|InterfacePart /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildInterfaceUsageDeclaration(SysML2.NET.Core.POCO.Systems.Interfaces.IInterfaceUsage poco, StringBuilder stringBuilder) + public static void BuildInterfaceUsageDeclaration(SysML2.NET.Core.POCO.Systems.Interfaces.IInterfaceUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildInterfaceUsageDeclarationHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule InterfacePart - /// InterfacePart:InterfaceUsage=BinaryInterfacePart|NaryInterfacePart + /// InterfacePart:InterfaceUsage=BinaryInterfacePart|NaryInterfacePart /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildInterfacePart(SysML2.NET.Core.POCO.Systems.Interfaces.IInterfaceUsage poco, StringBuilder stringBuilder) + public static void BuildInterfacePart(SysML2.NET.Core.POCO.Systems.Interfaces.IInterfaceUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); + BuildInterfacePartHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule BinaryInterfacePart - /// BinaryInterfacePart:InterfaceUsage=ownedRelationship+=InterfaceEndMember'to'ownedRelationship+=InterfaceEndMember + /// BinaryInterfacePart:InterfaceUsage=ownedRelationship+=InterfaceEndMember'to'ownedRelationship+=InterfaceEndMember /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildBinaryInterfacePart(SysML2.NET.Core.POCO.Systems.Interfaces.IInterfaceUsage poco, StringBuilder stringBuilder) + public static void BuildBinaryInterfacePart(SysML2.NET.Core.POCO.Systems.Interfaces.IInterfaceUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfEndFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership elementAsEndFeatureMembership) + { + EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(elementAsEndFeatureMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + stringBuilder.Append("to "); - ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); - if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership elementAsEndFeatureMembership) + { + EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(elementAsEndFeatureMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } /// /// Builds the Textual Notation string for the rule NaryInterfacePart - /// NaryInterfacePart:InterfaceUsage='('ownedRelationship+=InterfaceEndMember','ownedRelationship+=InterfaceEndMember(','ownedRelationship+=InterfaceEndMember)*')' + /// NaryInterfacePart:InterfaceUsage='('ownedRelationship+=InterfaceEndMember','ownedRelationship+=InterfaceEndMember(','ownedRelationship+=InterfaceEndMember)*')' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildNaryInterfacePart(SysML2.NET.Core.POCO.Systems.Interfaces.IInterfaceUsage poco, StringBuilder stringBuilder) + public static void BuildNaryInterfacePart(SysML2.NET.Core.POCO.Systems.Interfaces.IInterfaceUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfEndFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); stringBuilder.Append("("); - ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); - if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership elementAsEndFeatureMembership) + { + EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(elementAsEndFeatureMembership, cursorCache, stringBuilder); + } } - stringBuilder.Append(","); - ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + ownedRelationshipCursor.Move(); - if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + stringBuilder.Append(", "); + + if (ownedRelationshipCursor.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership elementAsEndFeatureMembership) + { + EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(elementAsEndFeatureMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); - while (ownedRelationshipOfEndFeatureMembershipIterator.MoveNext()) + + while (ownedRelationshipCursor.Current != null) { - stringBuilder.Append(","); + stringBuilder.Append(", "); - if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership elementAsEndFeatureMembership) + { + EndFeatureMembershipTextualNotationBuilder.BuildInterfaceEndMember(elementAsEndFeatureMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); } stringBuilder.Append(")"); @@ -121,16 +150,17 @@ public static void BuildNaryInterfacePart(SysML2.NET.Core.POCO.Systems.Interface /// /// Builds the Textual Notation string for the rule InterfaceUsage - /// InterfaceUsage=OccurrenceUsagePrefix'interface'InterfaceUsageDeclarationInterfaceBody + /// InterfaceUsage=OccurrenceUsagePrefix'interface'InterfaceUsageDeclarationInterfaceBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildInterfaceUsage(SysML2.NET.Core.POCO.Systems.Interfaces.IInterfaceUsage poco, StringBuilder stringBuilder) + public static void BuildInterfaceUsage(SysML2.NET.Core.POCO.Systems.Interfaces.IInterfaceUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("interface "); - BuildInterfaceUsageDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildInterfaceBody(poco, stringBuilder); + BuildInterfaceUsageDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildInterfaceBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IntersectingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IntersectingTextualNotationBuilder.cs index 68dca93d..c3496707 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IntersectingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IntersectingTextualNotationBuilder.cs @@ -24,7 +24,6 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; @@ -37,14 +36,14 @@ public static partial class IntersectingTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule Intersecting - /// Intersecting=intersectingType=[QualifiedName]|ownedRelatedElement+=OwnedFeatureChain + /// Intersecting=intersectingType=[QualifiedName]|ownedRelatedElement+=OwnedFeatureChain /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildIntersecting(SysML2.NET.Core.POCO.Core.Types.IIntersecting poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildIntersecting(SysML2.NET.Core.POCO.Core.Types.IIntersecting poco, ICursorCache cursorCache, StringBuilder stringBuilder) { + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); if (poco.IntersectingType != null) { stringBuilder.Append(poco.IntersectingType.qualifiedName); @@ -52,18 +51,17 @@ public static int BuildIntersecting(SysML2.NET.Core.POCO.Core.Types.IIntersectin } else { - if (elementIndex < poco.OwnedRelatedElement.Count) + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Core.Features.IFeature elementAsFeature) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Core.Features.IFeature elementAsFeature) { - FeatureTextualNotationBuilder.BuildOwnedFeatureChain(elementAsFeature, stringBuilder); + FeatureTextualNotationBuilder.BuildOwnedFeatureChain(elementAsFeature, cursorCache, stringBuilder); } } } - return elementIndex; } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs index a50203ff..4bbfe37e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvariantTextualNotationBuilder.cs @@ -36,23 +36,29 @@ public static partial class InvariantTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule Invariant - /// Invariant=FeaturePrefix'inv'('true'|isNegated?='false')?FeatureDeclarationValuePart?FunctionBody + /// Invariant=FeaturePrefix'inv'('true'|isNegated?='false')?FeatureDeclarationValuePart?FunctionBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildInvariant(SysML2.NET.Core.POCO.Kernel.Functions.IInvariant poco, StringBuilder stringBuilder) + public static void BuildInvariant(SysML2.NET.Core.POCO.Kernel.Functions.IInvariant poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + BuildFeaturePrefixHandCoded(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); - while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + while (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfOwningMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(elementAsOwningMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); } @@ -66,9 +72,13 @@ public static void BuildInvariant(SysML2.NET.Core.POCO.Kernel.Functions.IInvaria { stringBuilder.Append(" false "); } - FeatureTextualNotationBuilder.BuildFeatureDeclaration(poco, stringBuilder); - FeatureTextualNotationBuilder.BuildValuePart(poco, 0, stringBuilder); - TypeTextualNotationBuilder.BuildFunctionBody(poco, stringBuilder); + FeatureTextualNotationBuilder.BuildFeatureDeclaration(poco, cursorCache, stringBuilder); + + if (poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || !string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.Direction.HasValue || poco.IsDerived || poco.IsAbstract || poco.IsConstant || poco.IsOrdered || poco.IsEnd || poco.importedMembership.Count != 0 || poco.IsComposite || poco.IsPortion || poco.IsVariable || poco.IsSufficient || poco.unioningType.Count != 0 || poco.intersectingType.Count != 0 || poco.differencingType.Count != 0 || poco.featuringType.Count != 0 || poco.ownedTypeFeaturing.Count != 0) + { + FeatureTextualNotationBuilder.BuildValuePart(poco, cursorCache, stringBuilder); + } + TypeTextualNotationBuilder.BuildFunctionBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs index d0be9db9..949b18fa 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InvocationExpressionTextualNotationBuilder.cs @@ -36,81 +36,109 @@ 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 + /// FunctionOperationExpression:InvocationExpression=ownedRelationship+=PrimaryArgumentMember'->'ownedRelationship+=InvocationTypeMember(ownedRelationship+=BodyArgumentMember|ownedRelationship+=FunctionReferenceArgumentMember|ArgumentList)ownedRelationship+=EmptyResultMember /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildFunctionOperationExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IInvocationExpression poco, StringBuilder stringBuilder) + public static void BuildFunctionOperationExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IInvocationExpression poco, ICursorCache cursorCache, 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(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildPrimaryArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildPrimaryArgumentMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + stringBuilder.Append("-> "); - ownedRelationshipOfInvocationExpressionIterator.MoveNext(); - if (ownedRelationshipOfInvocationExpressionIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - BuildInvocationTypeMember(ownedRelationshipOfInvocationExpressionIterator.Current, stringBuilder); + BuildInvocationTypeMember(poco, cursorCache, stringBuilder); } - if (ownedRelationshipOfParameterMembershipIterator.MoveNext()) + ownedRelationshipCursor.Move(); + + if (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildBodyArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildBodyArgumentMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } } - else if (ownedRelationshipOfParameterMembershipIterator.MoveNext()) + else if (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildFunctionReferenceArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildFunctionReferenceArgumentMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } } else { - FeatureTextualNotationBuilder.BuildArgumentList(poco, stringBuilder); + FeatureTextualNotationBuilder.BuildArgumentList(poco, cursorCache, stringBuilder); } stringBuilder.Append(' '); - ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); - if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Functions.IReturnParameterMembership elementAsReturnParameterMembership) + { + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(elementAsReturnParameterMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } /// /// Builds the Textual Notation string for the rule InvocationExpression - /// InvocationExpression:InvocationExpression=ownedRelationship+=InstantiatedTypeMemberArgumentListownedRelationship+=EmptyResultMember + /// InvocationExpression:InvocationExpression=ownedRelationship+=InstantiatedTypeMemberArgumentListownedRelationship+=EmptyResultMember /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildInvocationExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IInvocationExpression poco, StringBuilder stringBuilder) + public static void BuildInvocationExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IInvocationExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfMembershipIterator.MoveNext(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (ownedRelationshipOfMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - MembershipTextualNotationBuilder.BuildInstantiatedTypeMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IMembership elementAsMembership) + { + MembershipTextualNotationBuilder.BuildInstantiatedTypeMember(elementAsMembership, cursorCache, stringBuilder); + } } - FeatureTextualNotationBuilder.BuildArgumentList(poco, stringBuilder); - ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); + ownedRelationshipCursor.Move(); + + FeatureTextualNotationBuilder.BuildArgumentList(poco, cursorCache, stringBuilder); - if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Functions.IReturnParameterMembership elementAsReturnParameterMembership) + { + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(elementAsReturnParameterMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemDefinitionTextualNotationBuilder.cs index 20e3209d..182f1709 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemDefinitionTextualNotationBuilder.cs @@ -36,16 +36,17 @@ public static partial class ItemDefinitionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule ItemDefinition - /// ItemDefinition=OccurrenceDefinitionPrefix'item''def'Definition + /// ItemDefinition=OccurrenceDefinitionPrefix'item''def'Definition /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildItemDefinition(SysML2.NET.Core.POCO.Systems.Items.IItemDefinition poco, StringBuilder stringBuilder) + public static void BuildItemDefinition(SysML2.NET.Core.POCO.Systems.Items.IItemDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("item "); stringBuilder.Append("def "); - DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); + DefinitionTextualNotationBuilder.BuildDefinition(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemUsageTextualNotationBuilder.cs index 9e9772f7..136b2d6c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ItemUsageTextualNotationBuilder.cs @@ -36,15 +36,16 @@ public static partial class ItemUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule ItemUsage - /// ItemUsage=OccurrenceUsagePrefix'item'Usage + /// ItemUsage=OccurrenceUsagePrefix'item'Usage /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildItemUsage(SysML2.NET.Core.POCO.Systems.Items.IItemUsage poco, StringBuilder stringBuilder) + public static void BuildItemUsage(SysML2.NET.Core.POCO.Systems.Items.IItemUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("item "); - UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); + UsageTextualNotationBuilder.BuildUsage(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/JoinNodeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/JoinNodeTextualNotationBuilder.cs index 1755fd7a..86bcb5ce 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/JoinNodeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/JoinNodeTextualNotationBuilder.cs @@ -36,19 +36,20 @@ public static partial class JoinNodeTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule JoinNode - /// JoinNode=ControlNodePrefixisComposite?='join'UsageDeclarationActionBody + /// JoinNode=ControlNodePrefixisComposite?='join'UsageDeclarationActionBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildJoinNode(SysML2.NET.Core.POCO.Systems.Actions.IJoinNode poco, StringBuilder stringBuilder) + public static void BuildJoinNode(SysML2.NET.Core.POCO.Systems.Actions.IJoinNode poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceUsageTextualNotationBuilder.BuildControlNodePrefix(poco, stringBuilder); + OccurrenceUsageTextualNotationBuilder.BuildControlNodePrefix(poco, cursorCache, stringBuilder); if (poco.IsComposite) { stringBuilder.Append(" join "); } - UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildActionBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LibraryPackageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LibraryPackageTextualNotationBuilder.cs index 9273a246..51479aba 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LibraryPackageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LibraryPackageTextualNotationBuilder.cs @@ -36,29 +36,35 @@ public static partial class LibraryPackageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule LibraryPackage - /// LibraryPackage=(isStandard?='standard')'library'(ownedRelationship+=PrefixMetadataMember)*PackageDeclarationPackageBody + /// LibraryPackage=(isStandard?='standard')'library'(ownedRelationship+=PrefixMetadataMember)*PackageDeclarationPackageBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildLibraryPackage(SysML2.NET.Core.POCO.Kernel.Packages.ILibraryPackage poco, StringBuilder stringBuilder) + public static void BuildLibraryPackage(SysML2.NET.Core.POCO.Kernel.Packages.ILibraryPackage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); stringBuilder.Append(" standard "); stringBuilder.Append(' '); stringBuilder.Append("library "); - while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + while (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfOwningMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(elementAsOwningMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); } - PackageTextualNotationBuilder.BuildPackageDeclaration(poco, stringBuilder); - PackageTextualNotationBuilder.BuildPackageBody(poco, stringBuilder); + PackageTextualNotationBuilder.BuildPackageDeclaration(poco, cursorCache, stringBuilder); + PackageTextualNotationBuilder.BuildPackageBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralBooleanTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralBooleanTextualNotationBuilder.cs index 3179d442..e407468b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralBooleanTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralBooleanTextualNotationBuilder.cs @@ -36,11 +36,12 @@ public static partial class LiteralBooleanTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule LiteralBoolean - /// LiteralBoolean=value=BooleanValue + /// LiteralBoolean=value=BooleanValue /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildLiteralBoolean(SysML2.NET.Core.POCO.Kernel.Expressions.ILiteralBoolean poco, StringBuilder stringBuilder) + public static void BuildLiteralBoolean(SysML2.NET.Core.POCO.Kernel.Expressions.ILiteralBoolean poco, ICursorCache cursorCache, StringBuilder stringBuilder) { stringBuilder.Append(poco.Value.ToString().ToLower()); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralExpressionTextualNotationBuilder.cs index e6cd3e41..4eeed7d0 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralExpressionTextualNotationBuilder.cs @@ -36,28 +36,29 @@ public static partial class LiteralExpressionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule LiteralExpression - /// LiteralExpression=LiteralBoolean|LiteralString|LiteralInteger|LiteralReal|LiteralInfinity + /// LiteralExpression=LiteralBoolean|LiteralString|LiteralInteger|LiteralReal|LiteralInfinity /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildLiteralExpression(SysML2.NET.Core.POCO.Kernel.Expressions.ILiteralExpression poco, StringBuilder stringBuilder) + public static void BuildLiteralExpression(SysML2.NET.Core.POCO.Kernel.Expressions.ILiteralExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { switch (poco) { - case SysML2.NET.Core.POCO.Kernel.Expressions.LiteralBoolean pocoLiteralBoolean: - LiteralBooleanTextualNotationBuilder.BuildLiteralBoolean(pocoLiteralBoolean, stringBuilder); + case SysML2.NET.Core.POCO.Kernel.Expressions.ILiteralBoolean pocoLiteralBoolean: + LiteralBooleanTextualNotationBuilder.BuildLiteralBoolean(pocoLiteralBoolean, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Kernel.Expressions.LiteralString pocoLiteralString: - LiteralStringTextualNotationBuilder.BuildLiteralString(pocoLiteralString, stringBuilder); + case SysML2.NET.Core.POCO.Kernel.Expressions.ILiteralString pocoLiteralString: + LiteralStringTextualNotationBuilder.BuildLiteralString(pocoLiteralString, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Kernel.Expressions.LiteralInteger pocoLiteralInteger: - LiteralIntegerTextualNotationBuilder.BuildLiteralInteger(pocoLiteralInteger, stringBuilder); + case SysML2.NET.Core.POCO.Kernel.Expressions.ILiteralInteger pocoLiteralInteger: + LiteralIntegerTextualNotationBuilder.BuildLiteralInteger(pocoLiteralInteger, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Kernel.Expressions.LiteralInfinity pocoLiteralInfinity: - LiteralInfinityTextualNotationBuilder.BuildLiteralInfinity(pocoLiteralInfinity, stringBuilder); + case SysML2.NET.Core.POCO.Kernel.Expressions.ILiteralInfinity pocoLiteralInfinity: + LiteralInfinityTextualNotationBuilder.BuildLiteralInfinity(pocoLiteralInfinity, cursorCache, stringBuilder); break; case SysML2.NET.Core.POCO.Root.Elements.IElement pocoElement: - BuildValue(poco, stringBuilder); + BuildValue(poco, cursorCache, stringBuilder); break; } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralInfinityTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralInfinityTextualNotationBuilder.cs index e877fdf1..3770b1c9 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralInfinityTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralInfinityTextualNotationBuilder.cs @@ -36,11 +36,12 @@ public static partial class LiteralInfinityTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule LiteralInfinity - /// LiteralInfinity='*' + /// LiteralInfinity='*' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildLiteralInfinity(SysML2.NET.Core.POCO.Kernel.Expressions.ILiteralInfinity poco, StringBuilder stringBuilder) + public static void BuildLiteralInfinity(SysML2.NET.Core.POCO.Kernel.Expressions.ILiteralInfinity poco, ICursorCache cursorCache, StringBuilder stringBuilder) { stringBuilder.Append("*"); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralIntegerTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralIntegerTextualNotationBuilder.cs index 55e8bf07..ffc6cf00 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralIntegerTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralIntegerTextualNotationBuilder.cs @@ -36,11 +36,12 @@ public static partial class LiteralIntegerTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule LiteralInteger - /// LiteralInteger=value=DECIMAL_VALUE + /// LiteralInteger=value=DECIMAL_VALUE /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildLiteralInteger(SysML2.NET.Core.POCO.Kernel.Expressions.ILiteralInteger poco, StringBuilder stringBuilder) + public static void BuildLiteralInteger(SysML2.NET.Core.POCO.Kernel.Expressions.ILiteralInteger poco, ICursorCache cursorCache, StringBuilder stringBuilder) { stringBuilder.Append(poco.Value.ToString()); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralStringTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralStringTextualNotationBuilder.cs index 4e173178..efac7cc1 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralStringTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/LiteralStringTextualNotationBuilder.cs @@ -36,11 +36,12 @@ public static partial class LiteralStringTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule LiteralString - /// LiteralString=value=STRING_VALUE + /// LiteralString=value=STRING_VALUE /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildLiteralString(SysML2.NET.Core.POCO.Kernel.Expressions.ILiteralString poco, StringBuilder stringBuilder) + public static void BuildLiteralString(SysML2.NET.Core.POCO.Kernel.Expressions.ILiteralString poco, ICursorCache cursorCache, StringBuilder stringBuilder) { stringBuilder.Append(poco.Value); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipExposeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipExposeTextualNotationBuilder.cs index 76ef4447..39cb2b5d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipExposeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipExposeTextualNotationBuilder.cs @@ -36,13 +36,14 @@ public static partial class MembershipExposeTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule MembershipExpose - /// MembershipExpose=MembershipImport + /// MembershipExpose=MembershipImport /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildMembershipExpose(SysML2.NET.Core.POCO.Systems.Views.IMembershipExpose poco, StringBuilder stringBuilder) + public static void BuildMembershipExpose(SysML2.NET.Core.POCO.Systems.Views.IMembershipExpose poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - MembershipImportTextualNotationBuilder.BuildMembershipImport(poco, stringBuilder); + MembershipImportTextualNotationBuilder.BuildMembershipImport(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.cs index f9cf6028..6d6bc531 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipImportTextualNotationBuilder.cs @@ -36,11 +36,12 @@ public static partial class MembershipImportTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule MembershipImport - /// MembershipImport=importedMembership=[QualifiedName]('::'isRecursive?='**')? + /// MembershipImport=importedMembership=[QualifiedName]('::'isRecursive?='**')? /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildMembershipImport(SysML2.NET.Core.POCO.Root.Namespaces.IMembershipImport poco, StringBuilder stringBuilder) + public static void BuildMembershipImport(SysML2.NET.Core.POCO.Root.Namespaces.IMembershipImport poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.ImportedMembership != null) @@ -53,7 +54,6 @@ public static void BuildMembershipImport(SysML2.NET.Core.POCO.Root.Namespaces.IM { stringBuilder.Append(":: "); stringBuilder.Append(" ** "); - stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs index ad6d7b94..6f78e827 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MembershipTextualNotationBuilder.cs @@ -28,7 +28,6 @@ namespace SysML2.NET.TextualNotation using System.Text; using SysML2.NET.Core.POCO.Root.Elements; - using SysML2.NET.Core.POCO.Root.Namespaces; /// /// The provides Textual Notation Builder for the element @@ -37,18 +36,17 @@ public static partial class MembershipTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule MemberPrefix - /// MemberPrefix:Membership=(visibility=VisibilityIndicator)? + /// MemberPrefix:Membership=(visibility=VisibilityIndicator)? /// /// The from which the rule should be build - /// + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildMemberPrefix(IMembership poco, ICursorCache cursor, StringBuilder stringBuilder) + public static void BuildMemberPrefix(SysML2.NET.Core.POCO.Root.Namespaces.IMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.Visibility != SysML2.NET.Core.Root.Namespaces.VisibilityKind.Public) { stringBuilder.Append(poco.Visibility.ToString().ToLower()); - stringBuilder.Append(' '); } @@ -56,14 +54,14 @@ public static void BuildMemberPrefix(IMembership poco, ICursorCache cursor, Stri /// /// Builds the Textual Notation string for the rule AliasMember - /// AliasMember:Membership=MemberPrefix'alias'('<'memberShortName=NAME'>')?(memberName=NAME)?'for'memberElement=[QualifiedName]RelationshipBody + /// AliasMember:Membership=MemberPrefix'alias'('<'memberShortName=NAME'>')?(memberName=NAME)?'for'memberElement=[QualifiedName]RelationshipBody /// /// The from which the rule should be build - /// + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildAliasMember(IMembership poco, ICursorCache cursor, StringBuilder stringBuilder) + public static void BuildAliasMember(SysML2.NET.Core.POCO.Root.Namespaces.IMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildMemberPrefix(poco, stringBuilder); + BuildMemberPrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("alias "); if (!string.IsNullOrWhiteSpace(poco.MemberShortName)) @@ -88,17 +86,18 @@ public static void BuildAliasMember(IMembership poco, ICursorCache cursor, Strin stringBuilder.Append(poco.MemberElement.qualifiedName); stringBuilder.Append(' '); } - RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); + RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule FeatureChainMember - /// FeatureChainMember:Membership=memberElement=[QualifiedName]|OwnedFeatureChainMember + /// FeatureChainMember:Membership=memberElement=[QualifiedName]|OwnedFeatureChainMember /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildFeatureChainMember(SysML2.NET.Core.POCO.Root.Namespaces.IMembership poco, StringBuilder stringBuilder) + public static void BuildFeatureChainMember(SysML2.NET.Core.POCO.Root.Namespaces.IMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.MemberElement != null) @@ -108,23 +107,30 @@ public static void BuildFeatureChainMember(SysML2.NET.Core.POCO.Root.Namespaces. } else { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[0]; + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Core.Features.IFeature elementAsFeature) + if (ownedRelatedElementCursor.Current != null) { - FeatureTextualNotationBuilder.BuildOwnedFeatureChain(elementAsFeature, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Core.Features.IFeature elementAsFeature) + { + FeatureTextualNotationBuilder.BuildOwnedFeatureChain(elementAsFeature, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } } /// /// Builds the Textual Notation string for the rule FeatureReferenceMember - /// FeatureReferenceMember:Membership=memberElement=FeatureReference + /// FeatureReferenceMember:Membership=memberElement=FeatureReference /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildFeatureReferenceMember(SysML2.NET.Core.POCO.Root.Namespaces.IMembership poco, StringBuilder stringBuilder) + public static void BuildFeatureReferenceMember(SysML2.NET.Core.POCO.Root.Namespaces.IMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.MemberElement != null) @@ -138,11 +144,12 @@ public static void BuildFeatureReferenceMember(SysML2.NET.Core.POCO.Root.Namespa /// /// Builds the Textual Notation string for the rule ElementReferenceMember - /// ElementReferenceMember:Membership=memberElement=[QualifiedName] + /// ElementReferenceMember:Membership=memberElement=[QualifiedName] /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildElementReferenceMember(SysML2.NET.Core.POCO.Root.Namespaces.IMembership poco, StringBuilder stringBuilder) + public static void BuildElementReferenceMember(SysML2.NET.Core.POCO.Root.Namespaces.IMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.MemberElement != null) @@ -155,11 +162,12 @@ public static void BuildElementReferenceMember(SysML2.NET.Core.POCO.Root.Namespa /// /// Builds the Textual Notation string for the rule InstantiatedTypeMember - /// InstantiatedTypeMember:Membership=memberElement=InstantiatedTypeReference|OwnedFeatureChainMember + /// InstantiatedTypeMember:Membership=memberElement=InstantiatedTypeReference|OwnedFeatureChainMember /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildInstantiatedTypeMember(SysML2.NET.Core.POCO.Root.Namespaces.IMembership poco, StringBuilder stringBuilder) + public static void BuildInstantiatedTypeMember(SysML2.NET.Core.POCO.Root.Namespaces.IMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.MemberElement != null) @@ -170,37 +178,44 @@ public static void BuildInstantiatedTypeMember(SysML2.NET.Core.POCO.Root.Namespa } else { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[0]; + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Core.Features.IFeature elementAsFeature) + if (ownedRelatedElementCursor.Current != null) { - FeatureTextualNotationBuilder.BuildOwnedFeatureChain(elementAsFeature, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Core.Features.IFeature elementAsFeature) + { + FeatureTextualNotationBuilder.BuildOwnedFeatureChain(elementAsFeature, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } } /// /// Builds the Textual Notation string for the rule MetadataBodyElement - /// MetadataBodyElement:Membership=NonFeatureMember|MetadataBodyFeatureMember|AliasMember|Import + /// MetadataBodyElement:Membership=NonFeatureMember|MetadataBodyFeatureMember|AliasMember|Import /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildMetadataBodyElement(SysML2.NET.Core.POCO.Root.Namespaces.IMembership poco, StringBuilder stringBuilder) + public static void BuildMetadataBodyElement(SysML2.NET.Core.POCO.Root.Namespaces.IMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { switch (poco) { - case SysML2.NET.Core.POCO.Core.Types.FeatureMembership pocoFeatureMembership: - FeatureMembershipTextualNotationBuilder.BuildMetadataBodyFeatureMember(pocoFeatureMembership, stringBuilder); + case SysML2.NET.Core.POCO.Core.Types.IFeatureMembership pocoFeatureMembership: + FeatureMembershipTextualNotationBuilder.BuildMetadataBodyFeatureMember(pocoFeatureMembership, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Root.Namespaces.OwningMembership pocoOwningMembership: - OwningMembershipTextualNotationBuilder.BuildNonFeatureMember(pocoOwningMembership, stringBuilder); - break; - default: - BuildAliasMember(poco, stringBuilder); + case SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership pocoOwningMembership: + OwningMembershipTextualNotationBuilder.BuildNonFeatureMember(pocoOwningMembership, cursorCache, stringBuilder); break; case SysML2.NET.Core.POCO.Root.Namespaces.IImport pocoImport: - ImportTextualNotationBuilder.BuildImport(pocoImport, stringBuilder); + ImportTextualNotationBuilder.BuildImport(pocoImport, cursorCache, stringBuilder); + break; + default: + BuildAliasMember(poco, cursorCache, stringBuilder); break; } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MergeNodeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MergeNodeTextualNotationBuilder.cs index d1084bc7..3df8baa3 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MergeNodeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MergeNodeTextualNotationBuilder.cs @@ -36,19 +36,20 @@ public static partial class MergeNodeTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule MergeNode - /// MergeNode=ControlNodePrefixisComposite?='merge'UsageDeclarationActionBody + /// MergeNode=ControlNodePrefixisComposite?='merge'UsageDeclarationActionBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildMergeNode(SysML2.NET.Core.POCO.Systems.Actions.IMergeNode poco, StringBuilder stringBuilder) + public static void BuildMergeNode(SysML2.NET.Core.POCO.Systems.Actions.IMergeNode poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceUsageTextualNotationBuilder.BuildControlNodePrefix(poco, stringBuilder); + OccurrenceUsageTextualNotationBuilder.BuildControlNodePrefix(poco, cursorCache, stringBuilder); if (poco.IsComposite) { stringBuilder.Append(" merge "); } - UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildActionBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetaclassTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetaclassTextualNotationBuilder.cs index 54c203f6..aee7a1f5 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetaclassTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetaclassTextualNotationBuilder.cs @@ -36,16 +36,17 @@ public static partial class MetaclassTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule Metaclass - /// Metaclass=TypePrefix'metaclass'ClassifierDeclarationTypeBody + /// Metaclass=TypePrefix'metaclass'ClassifierDeclarationTypeBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildMetaclass(SysML2.NET.Core.POCO.Kernel.Metadata.IMetaclass poco, StringBuilder stringBuilder) + public static void BuildMetaclass(SysML2.NET.Core.POCO.Kernel.Metadata.IMetaclass poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); + TypeTextualNotationBuilder.BuildTypePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("metaclass "); - ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); + ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildTypeBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataAccessExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataAccessExpressionTextualNotationBuilder.cs index a7cfffeb..3c514f73 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataAccessExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataAccessExpressionTextualNotationBuilder.cs @@ -24,7 +24,6 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; @@ -37,42 +36,49 @@ public static partial class MetadataAccessExpressionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule MetadataReference - /// MetadataReference:MetadataAccessExpression=ownedRelationship+=ElementReferenceMember + /// MetadataReference:MetadataAccessExpression=ownedRelationship+=ElementReferenceMember /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildMetadataReference(SysML2.NET.Core.POCO.Kernel.Expressions.IMetadataAccessExpression poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildMetadataReference(SysML2.NET.Core.POCO.Kernel.Expressions.IMetadataAccessExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelationship.Count) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + + if (ownedRelationshipCursor.Current != null) { - var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; - if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Root.Namespaces.IMembership elementAsMembership) + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IMembership elementAsMembership) { - MembershipTextualNotationBuilder.BuildElementReferenceMember(elementAsMembership, stringBuilder); + MembershipTextualNotationBuilder.BuildElementReferenceMember(elementAsMembership, cursorCache, stringBuilder); } } + ownedRelationshipCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule MetadataAccessExpression - /// MetadataAccessExpression=ownedRelationship+=ElementReferenceMember'.''metadata' + /// MetadataAccessExpression=ownedRelationship+=ElementReferenceMember'.''metadata' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildMetadataAccessExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IMetadataAccessExpression poco, StringBuilder stringBuilder) + public static void BuildMetadataAccessExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IMetadataAccessExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfMembershipIterator.MoveNext(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (ownedRelationshipOfMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - MembershipTextualNotationBuilder.BuildElementReferenceMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IMembership elementAsMembership) + { + MembershipTextualNotationBuilder.BuildElementReferenceMember(elementAsMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + stringBuilder.Append("."); stringBuilder.Append("metadata "); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.cs index d65e7d2c..64a05ffd 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.cs @@ -36,11 +36,12 @@ public static partial class MetadataDefinitionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule MetadataDefinition - /// MetadataDefinition=(isAbstract?='abstract')?DefinitionExtensionKeyword*'metadata''def'Definition + /// MetadataDefinition=(isAbstract?='abstract')?DefinitionExtensionKeyword*'metadata''def'Definition /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildMetadataDefinition(SysML2.NET.Core.POCO.Systems.Metadata.IMetadataDefinition poco, StringBuilder stringBuilder) + public static void BuildMetadataDefinition(SysML2.NET.Core.POCO.Systems.Metadata.IMetadataDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.IsAbstract) @@ -49,14 +50,15 @@ public static void BuildMetadataDefinition(SysML2.NET.Core.POCO.Systems.Metadata stringBuilder.Append(' '); } - // Handle collection Non Terminal - for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + while (ownedRelationshipCursor.Current != null) { - ownedRelationshipIndex = DefinitionTextualNotationBuilder.BuildDefinitionExtensionKeyword(poco, ownedRelationshipIndex, stringBuilder); + DefinitionTextualNotationBuilder.BuildDefinitionExtensionKeyword(poco, cursorCache, stringBuilder); } + stringBuilder.Append("metadata "); stringBuilder.Append("def "); - DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); + DefinitionTextualNotationBuilder.BuildDefinition(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs index b11d9697..934e3df8 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs @@ -24,7 +24,6 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; @@ -37,101 +36,122 @@ public static partial class MetadataFeatureTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule PrefixMetadataFeature - /// PrefixMetadataFeature:MetadataFeature=ownedRelationship+=OwnedFeatureTyping + /// PrefixMetadataFeature:MetadataFeature=ownedRelationship+=OwnedFeatureTyping /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildPrefixMetadataFeature(SysML2.NET.Core.POCO.Kernel.Metadata.IMetadataFeature poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildPrefixMetadataFeature(SysML2.NET.Core.POCO.Kernel.Metadata.IMetadataFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelationship.Count) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + + if (ownedRelationshipCursor.Current != null) { - var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; - if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Core.Features.IFeatureTyping elementAsFeatureTyping) + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IFeatureTyping elementAsFeatureTyping) { - FeatureTypingTextualNotationBuilder.BuildOwnedFeatureTyping(elementAsFeatureTyping, stringBuilder); + FeatureTypingTextualNotationBuilder.BuildOwnedFeatureTyping(elementAsFeatureTyping, cursorCache, stringBuilder); } } + ownedRelationshipCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule MetadataFeatureDeclaration - /// MetadataFeatureDeclaration:MetadataFeature=(Identification(':'|'typed''by'))?ownedRelationship+=OwnedFeatureTyping + /// MetadataFeatureDeclaration:MetadataFeature=(Identification(':'|'typed''by'))?ownedRelationship+=OwnedFeatureTyping /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildMetadataFeatureDeclaration(SysML2.NET.Core.POCO.Kernel.Metadata.IMetadataFeature poco, StringBuilder stringBuilder) + public static void BuildMetadataFeatureDeclaration(SysML2.NET.Core.POCO.Kernel.Metadata.IMetadataFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfFeatureTypingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (BuildGroupConditionForMetadataFeatureDeclaration(poco)) + if (!string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName)) { - ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + ElementTextualNotationBuilder.BuildIdentification(poco, cursorCache, stringBuilder); + BuildMetadataFeatureDeclarationHandCoded(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); stringBuilder.Append(' '); } - ownedRelationshipOfFeatureTypingIterator.MoveNext(); - if (ownedRelationshipOfFeatureTypingIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - FeatureTypingTextualNotationBuilder.BuildOwnedFeatureTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IFeatureTyping elementAsFeatureTyping) + { + FeatureTypingTextualNotationBuilder.BuildOwnedFeatureTyping(elementAsFeatureTyping, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } /// /// Builds the Textual Notation string for the rule MetadataFeature - /// MetadataFeature=(ownedRelationship+=PrefixMetadataMember)*('@'|'metadata')MetadataFeatureDeclaration('about'ownedRelationship+=Annotation(','ownedRelationship+=Annotation)*)?MetadataBody + /// MetadataFeature=(ownedRelationship+=PrefixMetadataMember)*('@'|'metadata')MetadataFeatureDeclaration('about'ownedRelationship+=Annotation(','ownedRelationship+=Annotation)*)?MetadataBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildMetadataFeature(SysML2.NET.Core.POCO.Kernel.Metadata.IMetadataFeature poco, StringBuilder stringBuilder) + public static void BuildMetadataFeature(SysML2.NET.Core.POCO.Kernel.Metadata.IMetadataFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - using var ownedRelationshipOfAnnotationIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + while (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfOwningMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(elementAsOwningMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); } stringBuilder.Append(" @ "); stringBuilder.Append(' '); - BuildMetadataFeatureDeclaration(poco, stringBuilder); + BuildMetadataFeatureDeclaration(poco, cursorCache, stringBuilder); - if (ownedRelationshipOfAnnotationIterator.MoveNext()) + if (ownedRelationshipCursor.Current != null) { stringBuilder.Append("about "); - if (ownedRelationshipOfAnnotationIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - AnnotationTextualNotationBuilder.BuildAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Annotations.IAnnotation elementAsAnnotation) + { + AnnotationTextualNotationBuilder.BuildAnnotation(elementAsAnnotation, cursorCache, stringBuilder); + } } - while (ownedRelationshipOfAnnotationIterator.MoveNext()) + while (ownedRelationshipCursor.Current != null) { - stringBuilder.Append(","); + stringBuilder.Append(", "); - if (ownedRelationshipOfAnnotationIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - AnnotationTextualNotationBuilder.BuildAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Annotations.IAnnotation elementAsAnnotation) + { + AnnotationTextualNotationBuilder.BuildAnnotation(elementAsAnnotation, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); } stringBuilder.Append(' '); } - TypeTextualNotationBuilder.BuildMetadataBody(poco, stringBuilder); + TypeTextualNotationBuilder.BuildMetadataBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs index a8a6258b..fed4aeaa 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs @@ -24,7 +24,6 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; @@ -37,95 +36,112 @@ public static partial class MetadataUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule PrefixMetadataUsage - /// PrefixMetadataUsage:MetadataUsage=ownedRelationship+=OwnedFeatureTyping + /// PrefixMetadataUsage:MetadataUsage=ownedRelationship+=OwnedFeatureTyping /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildPrefixMetadataUsage(SysML2.NET.Core.POCO.Systems.Metadata.IMetadataUsage poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildPrefixMetadataUsage(SysML2.NET.Core.POCO.Systems.Metadata.IMetadataUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelationship.Count) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + + if (ownedRelationshipCursor.Current != null) { - var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; - if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Core.Features.IFeatureTyping elementAsFeatureTyping) + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IFeatureTyping elementAsFeatureTyping) { - FeatureTypingTextualNotationBuilder.BuildOwnedFeatureTyping(elementAsFeatureTyping, stringBuilder); + FeatureTypingTextualNotationBuilder.BuildOwnedFeatureTyping(elementAsFeatureTyping, cursorCache, stringBuilder); } } + ownedRelationshipCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule MetadataUsageDeclaration - /// MetadataUsageDeclaration:MetadataUsage=(Identification(':'|'typed''by'))?ownedRelationship+=OwnedFeatureTyping + /// MetadataUsageDeclaration:MetadataUsage=(Identification(':'|'typed''by'))?ownedRelationship+=OwnedFeatureTyping /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildMetadataUsageDeclaration(SysML2.NET.Core.POCO.Systems.Metadata.IMetadataUsage poco, StringBuilder stringBuilder) + public static void BuildMetadataUsageDeclaration(SysML2.NET.Core.POCO.Systems.Metadata.IMetadataUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfFeatureTypingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (BuildGroupConditionForMetadataUsageDeclaration(poco)) + if (!string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName)) { - ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + ElementTextualNotationBuilder.BuildIdentification(poco, cursorCache, stringBuilder); + BuildMetadataUsageDeclarationHandCoded(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); stringBuilder.Append(' '); } - ownedRelationshipOfFeatureTypingIterator.MoveNext(); - if (ownedRelationshipOfFeatureTypingIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - FeatureTypingTextualNotationBuilder.BuildOwnedFeatureTyping(ownedRelationshipOfFeatureTypingIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IFeatureTyping elementAsFeatureTyping) + { + FeatureTypingTextualNotationBuilder.BuildOwnedFeatureTyping(elementAsFeatureTyping, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } /// /// Builds the Textual Notation string for the rule MetadataUsage - /// MetadataUsage=UsageExtensionKeyword*('@'|'metadata')MetadataUsageDeclaration('about'ownedRelationship+=Annotation(','ownedRelationship+=Annotation)*)?MetadataBody + /// MetadataUsage=UsageExtensionKeyword*('@'|'metadata')MetadataUsageDeclaration('about'ownedRelationship+=Annotation(','ownedRelationship+=Annotation)*)?MetadataBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildMetadataUsage(SysML2.NET.Core.POCO.Systems.Metadata.IMetadataUsage poco, StringBuilder stringBuilder) + public static void BuildMetadataUsage(SysML2.NET.Core.POCO.Systems.Metadata.IMetadataUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfAnnotationIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - // Handle collection Non Terminal - for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + while (ownedRelationshipCursor.Current != null) { - ownedRelationshipIndex = UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, ownedRelationshipIndex, stringBuilder); + UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, cursorCache, stringBuilder); } + stringBuilder.Append(" @ "); stringBuilder.Append(' '); - BuildMetadataUsageDeclaration(poco, stringBuilder); + BuildMetadataUsageDeclaration(poco, cursorCache, stringBuilder); - if (ownedRelationshipOfAnnotationIterator.MoveNext()) + if (ownedRelationshipCursor.Current != null) { stringBuilder.Append("about "); - if (ownedRelationshipOfAnnotationIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - AnnotationTextualNotationBuilder.BuildAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Annotations.IAnnotation elementAsAnnotation) + { + AnnotationTextualNotationBuilder.BuildAnnotation(elementAsAnnotation, cursorCache, stringBuilder); + } } - while (ownedRelationshipOfAnnotationIterator.MoveNext()) + while (ownedRelationshipCursor.Current != null) { - stringBuilder.Append(","); + stringBuilder.Append(", "); - if (ownedRelationshipOfAnnotationIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - AnnotationTextualNotationBuilder.BuildAnnotation(ownedRelationshipOfAnnotationIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Annotations.IAnnotation elementAsAnnotation) + { + AnnotationTextualNotationBuilder.BuildAnnotation(elementAsAnnotation, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); } stringBuilder.Append(' '); } - TypeTextualNotationBuilder.BuildMetadataBody(poco, stringBuilder); + TypeTextualNotationBuilder.BuildMetadataBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityRangeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityRangeTextualNotationBuilder.cs index bee17481..5e018ae7 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityRangeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityRangeTextualNotationBuilder.cs @@ -36,76 +36,97 @@ public static partial class MultiplicityRangeTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule OwnedMultiplicityRange - /// OwnedMultiplicityRange:MultiplicityRange=MultiplicityBounds + /// OwnedMultiplicityRange:MultiplicityRange=MultiplicityBounds /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildOwnedMultiplicityRange(SysML2.NET.Core.POCO.Kernel.Multiplicities.IMultiplicityRange poco, StringBuilder stringBuilder) + public static void BuildOwnedMultiplicityRange(SysML2.NET.Core.POCO.Kernel.Multiplicities.IMultiplicityRange poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildMultiplicityBounds(poco, stringBuilder); + BuildMultiplicityBounds(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule MultiplicityBounds - /// MultiplicityBounds:MultiplicityRange='['(ownedRelationship+=MultiplicityExpressionMember'..')?ownedRelationship+=MultiplicityExpressionMember']' + /// MultiplicityBounds:MultiplicityRange='['(ownedRelationship+=MultiplicityExpressionMember'..')?ownedRelationship+=MultiplicityExpressionMember']' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildMultiplicityBounds(SysML2.NET.Core.POCO.Kernel.Multiplicities.IMultiplicityRange poco, StringBuilder stringBuilder) + public static void BuildMultiplicityBounds(SysML2.NET.Core.POCO.Kernel.Multiplicities.IMultiplicityRange poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); stringBuilder.Append("["); - if (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + if (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfOwningMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - OwningMembershipTextualNotationBuilder.BuildMultiplicityExpressionMember(ownedRelationshipOfOwningMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + { + OwningMembershipTextualNotationBuilder.BuildMultiplicityExpressionMember(elementAsOwningMembership, cursorCache, stringBuilder); + } } stringBuilder.Append(".. "); stringBuilder.Append(' '); } - ownedRelationshipOfOwningMembershipIterator.MoveNext(); - if (ownedRelationshipOfOwningMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - OwningMembershipTextualNotationBuilder.BuildMultiplicityExpressionMember(ownedRelationshipOfOwningMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + { + OwningMembershipTextualNotationBuilder.BuildMultiplicityExpressionMember(elementAsOwningMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + stringBuilder.Append("]"); } /// /// Builds the Textual Notation string for the rule MultiplicityRange - /// MultiplicityRange='['(ownedRelationship+=MultiplicityExpressionMember'..')?ownedRelationship+=MultiplicityExpressionMember']' + /// MultiplicityRange='['(ownedRelationship+=MultiplicityExpressionMember'..')?ownedRelationship+=MultiplicityExpressionMember']' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildMultiplicityRange(SysML2.NET.Core.POCO.Kernel.Multiplicities.IMultiplicityRange poco, StringBuilder stringBuilder) + public static void BuildMultiplicityRange(SysML2.NET.Core.POCO.Kernel.Multiplicities.IMultiplicityRange poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); stringBuilder.Append("["); - if (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + if (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfOwningMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - OwningMembershipTextualNotationBuilder.BuildMultiplicityExpressionMember(ownedRelationshipOfOwningMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + { + OwningMembershipTextualNotationBuilder.BuildMultiplicityExpressionMember(elementAsOwningMembership, cursorCache, stringBuilder); + } } stringBuilder.Append(".. "); stringBuilder.Append(' '); } - ownedRelationshipOfOwningMembershipIterator.MoveNext(); - if (ownedRelationshipOfOwningMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - OwningMembershipTextualNotationBuilder.BuildMultiplicityExpressionMember(ownedRelationshipOfOwningMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + { + OwningMembershipTextualNotationBuilder.BuildMultiplicityExpressionMember(elementAsOwningMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + stringBuilder.Append("]"); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityTextualNotationBuilder.cs index 2050a00e..d05463ba 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MultiplicityTextualNotationBuilder.cs @@ -36,45 +36,48 @@ public static partial class MultiplicityTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule EmptyMultiplicity - /// EmptyMultiplicity:Multiplicity={} + /// EmptyMultiplicity:Multiplicity={} /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildEmptyMultiplicity(SysML2.NET.Core.POCO.Core.Types.IMultiplicity poco, StringBuilder stringBuilder) + public static void BuildEmptyMultiplicity(SysML2.NET.Core.POCO.Core.Types.IMultiplicity poco, ICursorCache cursorCache, StringBuilder stringBuilder) { } /// /// Builds the Textual Notation string for the rule MultiplicitySubset - /// MultiplicitySubset:Multiplicity='multiplicity'IdentificationSubsetsTypeBody + /// MultiplicitySubset:Multiplicity='multiplicity'IdentificationSubsetsTypeBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildMultiplicitySubset(SysML2.NET.Core.POCO.Core.Types.IMultiplicity poco, StringBuilder stringBuilder) + public static void BuildMultiplicitySubset(SysML2.NET.Core.POCO.Core.Types.IMultiplicity poco, ICursorCache cursorCache, StringBuilder stringBuilder) { stringBuilder.Append("multiplicity "); - ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); - FeatureTextualNotationBuilder.BuildSubsets(poco, stringBuilder); - TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); + ElementTextualNotationBuilder.BuildIdentification(poco, cursorCache, stringBuilder); + FeatureTextualNotationBuilder.BuildSubsets(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildTypeBody(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule Multiplicity - /// Multiplicity=MultiplicitySubset|MultiplicityRange + /// Multiplicity=MultiplicitySubset|MultiplicityRange /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildMultiplicity(SysML2.NET.Core.POCO.Core.Types.IMultiplicity poco, StringBuilder stringBuilder) + public static void BuildMultiplicity(SysML2.NET.Core.POCO.Core.Types.IMultiplicity poco, ICursorCache cursorCache, StringBuilder stringBuilder) { switch (poco) { - case SysML2.NET.Core.POCO.Kernel.Multiplicities.MultiplicityRange pocoMultiplicityRange: - MultiplicityRangeTextualNotationBuilder.BuildMultiplicityRange(pocoMultiplicityRange, stringBuilder); + case SysML2.NET.Core.POCO.Kernel.Multiplicities.IMultiplicityRange pocoMultiplicityRange: + MultiplicityRangeTextualNotationBuilder.BuildMultiplicityRange(pocoMultiplicityRange, cursorCache, stringBuilder); break; default: - BuildMultiplicitySubset(poco, stringBuilder); + BuildMultiplicitySubset(poco, cursorCache, stringBuilder); break; } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceExposeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceExposeTextualNotationBuilder.cs index f31c167b..3c2cd39d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceExposeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceExposeTextualNotationBuilder.cs @@ -36,13 +36,14 @@ public static partial class NamespaceExposeTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule NamespaceExpose - /// NamespaceExpose=NamespaceImport + /// NamespaceExpose=NamespaceImport /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildNamespaceExpose(SysML2.NET.Core.POCO.Systems.Views.INamespaceExpose poco, StringBuilder stringBuilder) + public static void BuildNamespaceExpose(SysML2.NET.Core.POCO.Systems.Views.INamespaceExpose poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - NamespaceImportTextualNotationBuilder.BuildNamespaceImport(poco, stringBuilder); + NamespaceImportTextualNotationBuilder.BuildNamespaceImport(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceImportTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceImportTextualNotationBuilder.cs index e325221f..f18d4eeb 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceImportTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceImportTextualNotationBuilder.cs @@ -36,13 +36,14 @@ public static partial class NamespaceImportTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule NamespaceImport - /// NamespaceImport=importedNamespace=[QualifiedName]'::''*'('::'isRecursive?='**')?|importedNamespace=FilterPackage{ownedRelatedElement+=importedNamespace} + /// NamespaceImport=importedNamespace=[QualifiedName]'::''*'('::'isRecursive?='**')?|importedNamespace=FilterPackage{ownedRelatedElement+=importedNamespace} /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildNamespaceImport(SysML2.NET.Core.POCO.Root.Namespaces.INamespaceImport poco, StringBuilder stringBuilder) + public static void BuildNamespaceImport(SysML2.NET.Core.POCO.Root.Namespaces.INamespaceImport poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildNamespaceImportHandCoded(poco, cursorCache, stringBuilder); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs index dba9176b..06a360c1 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs @@ -24,7 +24,6 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; @@ -37,115 +36,122 @@ public static partial class NamespaceTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule RootNamespace - /// RootNamespace:Namespace=PackageBodyElement* + /// RootNamespace:Namespace=PackageBodyElement* /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation public static void BuildRootNamespace(SysML2.NET.Core.POCO.Root.Namespaces.INamespace poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - // Should call the PackageBodyElement but since the rule focus on a Package type, have to grab the rule body - // Getting cursor since assignment with += on the ownedRelationship - var cursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - - // While loop since calling with '*' - - while (cursor.Current != null) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + while (ownedRelationshipCursor.Current != null) { - switch (cursor.Current) + switch (ownedRelationshipCursor.Current) { - // Order based on inheritance case SysML2.NET.Core.POCO.Kernel.Packages.IElementFilterMembership elementFilterMembership: ElementFilterMembershipTextualNotationBuilder.BuildElementFilterMember(elementFilterMembership, cursorCache, stringBuilder); - // Cursor.Move since we do have += - cursor.Move(); + ownedRelationshipCursor.Move(); break; case SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership owningMembership: OwningMembershipTextualNotationBuilder.BuildPackageMember(owningMembership, cursorCache, stringBuilder); - cursor.Move(); + ownedRelationshipCursor.Move(); break; case SysML2.NET.Core.POCO.Root.Namespaces.IMembership membership: - MembershipTextualNotationBuilder.BuildAliasMember(membership,cursorCache, stringBuilder); - cursor.Move(); + MembershipTextualNotationBuilder.BuildAliasMember(membership, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); break; case SysML2.NET.Core.POCO.Root.Namespaces.IImport import: ImportTextualNotationBuilder.BuildImport(import, cursorCache, stringBuilder); - cursor.Move(); - break; + ownedRelationshipCursor.Move(); + break; } + } + + } /// /// Builds the Textual Notation string for the rule NamespaceDeclaration - /// NamespaceDeclaration:Namespace='namespace'Identification + /// NamespaceDeclaration:Namespace='namespace'Identification /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildNamespaceDeclaration(SysML2.NET.Core.POCO.Root.Namespaces.INamespace poco, StringBuilder stringBuilder) + public static void BuildNamespaceDeclaration(SysML2.NET.Core.POCO.Root.Namespaces.INamespace poco, ICursorCache cursorCache, StringBuilder stringBuilder) { stringBuilder.Append("namespace "); - ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + ElementTextualNotationBuilder.BuildIdentification(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule NamespaceBody - /// NamespaceBody:Namespace=';'|'{'NamespaceBodyElement*'}' + /// NamespaceBody:Namespace=';'|'{'NamespaceBodyElement*'}' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildNamespaceBody(SysML2.NET.Core.POCO.Root.Namespaces.INamespace poco, StringBuilder stringBuilder) + public static void BuildNamespaceBody(SysML2.NET.Core.POCO.Root.Namespaces.INamespace poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildNamespaceBodyHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule NamespaceBodyElement - /// NamespaceBodyElement:Namespace=ownedRelationship+=NamespaceMember|ownedRelationship+=AliasMember|ownedRelationship+=Import + /// NamespaceBodyElement:Namespace=ownedRelationship+=NamespaceMember|ownedRelationship+=AliasMember|ownedRelationship+=Import /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildNamespaceBodyElement(SysML2.NET.Core.POCO.Root.Namespaces.INamespace poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildNamespaceBodyElement(SysML2.NET.Core.POCO.Root.Namespaces.INamespace poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - switch (elementInOwnedRelationship) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + switch (ownedRelationshipCursor.Current) { - case SysML2.NET.Core.POCO.Root.Namespaces.OwningMembership owningMembership: - OwningMembershipTextualNotationBuilder.BuildNamespaceMember(owningMembership, stringBuilder); + case SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership owningMembership: + OwningMembershipTextualNotationBuilder.BuildNamespaceMember(owningMembership, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); break; - case SysML2.NET.Core.POCO.Root.Namespaces.Membership membership: - MembershipTextualNotationBuilder.BuildAliasMember(membership, stringBuilder); + case SysML2.NET.Core.POCO.Root.Namespaces.IMembership membership: + MembershipTextualNotationBuilder.BuildAliasMember(membership, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); break; case SysML2.NET.Core.POCO.Root.Namespaces.IImport import: - ImportTextualNotationBuilder.BuildImport(import, stringBuilder); + ImportTextualNotationBuilder.BuildImport(import, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); break; } - return elementIndex; } /// /// Builds the Textual Notation string for the rule Namespace - /// Namespace=(ownedRelationship+=PrefixMetadataMember)*NamespaceDeclarationNamespaceBody + /// Namespace=(ownedRelationship+=PrefixMetadataMember)*NamespaceDeclarationNamespaceBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildNamespace(SysML2.NET.Core.POCO.Root.Namespaces.INamespace poco, StringBuilder stringBuilder) + public static void BuildNamespace(SysML2.NET.Core.POCO.Root.Namespaces.INamespace poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + while (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfOwningMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(elementAsOwningMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); } - BuildNamespaceDeclaration(poco, stringBuilder); - BuildNamespaceBody(poco, stringBuilder); + BuildNamespaceDeclaration(poco, cursorCache, stringBuilder); + BuildNamespaceBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NullExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NullExpressionTextualNotationBuilder.cs index 0b5aba45..7cc99aa6 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NullExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NullExpressionTextualNotationBuilder.cs @@ -36,13 +36,14 @@ public static partial class NullExpressionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule NullExpression - /// NullExpression:NullExpression='null'|'('')' + /// NullExpression:NullExpression='null'|'('')' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildNullExpression(SysML2.NET.Core.POCO.Kernel.Expressions.INullExpression poco, StringBuilder stringBuilder) + public static void BuildNullExpression(SysML2.NET.Core.POCO.Kernel.Expressions.INullExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildNullExpressionHandCoded(poco, cursorCache, stringBuilder); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ObjectiveMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ObjectiveMembershipTextualNotationBuilder.cs index 7a624821..28169797 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ObjectiveMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ObjectiveMembershipTextualNotationBuilder.cs @@ -36,21 +36,27 @@ public static partial class ObjectiveMembershipTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule ObjectiveMember - /// ObjectiveMember:ObjectiveMembership=MemberPrefix'objective'ownedRelatedElement+=ObjectiveRequirementUsage + /// ObjectiveMember:ObjectiveMembership=MemberPrefix'objective'ownedRelatedElement+=ObjectiveRequirementUsage /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildObjectiveMember(SysML2.NET.Core.POCO.Systems.Cases.IObjectiveMembership poco, StringBuilder stringBuilder) + public static void BuildObjectiveMember(SysML2.NET.Core.POCO.Systems.Cases.IObjectiveMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfRequirementUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("objective "); - ownedRelatedElementOfRequirementUsageIterator.MoveNext(); - if (ownedRelatedElementOfRequirementUsageIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - RequirementUsageTextualNotationBuilder.BuildObjectiveRequirementUsage(ownedRelatedElementOfRequirementUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.Requirements.IRequirementUsage elementAsRequirementUsage) + { + RequirementUsageTextualNotationBuilder.BuildObjectiveRequirementUsage(elementAsRequirementUsage, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs index 07cabf69..843a7e9f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs @@ -36,13 +36,14 @@ public static partial class OccurrenceDefinitionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule OccurrenceDefinitionPrefix - /// OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* + /// OccurrenceDefinitionPrefix:OccurrenceDefinition=BasicDefinitionPrefix?(isIndividual?='individual'ownedRelationship+=EmptyMultiplicityMember)?DefinitionExtensionKeyword* /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildOccurrenceDefinitionPrefix(SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceDefinition poco, StringBuilder stringBuilder) + public static void BuildOccurrenceDefinitionPrefix(SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); if (poco.IsAbstract) { stringBuilder.Append(" abstract "); @@ -53,34 +54,39 @@ public static void BuildOccurrenceDefinitionPrefix(SysML2.NET.Core.POCO.Systems. } - if (poco.IsIndividual && ownedRelationshipOfOwningMembershipIterator.MoveNext()) + if (poco.IsIndividual && ownedRelationshipCursor.Current != null) { stringBuilder.Append(" individual "); - if (ownedRelationshipOfOwningMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - OwningMembershipTextualNotationBuilder.BuildEmptyMultiplicityMember(ownedRelationshipOfOwningMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + { + OwningMembershipTextualNotationBuilder.BuildEmptyMultiplicityMember(elementAsOwningMembership, cursorCache, stringBuilder); + } } stringBuilder.Append(' '); } - // Handle collection Non Terminal - for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + while (ownedRelationshipCursor.Current != null) { - ownedRelationshipIndex = DefinitionTextualNotationBuilder.BuildDefinitionExtensionKeyword(poco, ownedRelationshipIndex, stringBuilder); + DefinitionTextualNotationBuilder.BuildDefinitionExtensionKeyword(poco, cursorCache, stringBuilder); } + } /// /// Builds the Textual Notation string for the rule IndividualDefinition - /// IndividualDefinition:OccurrenceDefinition=BasicDefinitionPrefix?isIndividual?='individual'DefinitionExtensionKeyword*'def'DefinitionownedRelationship+=EmptyMultiplicityMember + /// IndividualDefinition:OccurrenceDefinition=BasicDefinitionPrefix?isIndividual?='individual'DefinitionExtensionKeyword*'def'DefinitionownedRelationship+=EmptyMultiplicityMember /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildIndividualDefinition(SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceDefinition poco, StringBuilder stringBuilder) + public static void BuildIndividualDefinition(SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); if (poco.IsAbstract) { stringBuilder.Append(" abstract "); @@ -94,34 +100,40 @@ public static void BuildIndividualDefinition(SysML2.NET.Core.POCO.Systems.Occurr { stringBuilder.Append(" individual "); } - // Handle collection Non Terminal - for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + while (ownedRelationshipCursor.Current != null) { - ownedRelationshipIndex = DefinitionTextualNotationBuilder.BuildDefinitionExtensionKeyword(poco, ownedRelationshipIndex, stringBuilder); + DefinitionTextualNotationBuilder.BuildDefinitionExtensionKeyword(poco, cursorCache, stringBuilder); } + stringBuilder.Append("def "); - DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); - ownedRelationshipOfOwningMembershipIterator.MoveNext(); + DefinitionTextualNotationBuilder.BuildDefinition(poco, cursorCache, stringBuilder); - if (ownedRelationshipOfOwningMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - OwningMembershipTextualNotationBuilder.BuildEmptyMultiplicityMember(ownedRelationshipOfOwningMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + { + OwningMembershipTextualNotationBuilder.BuildEmptyMultiplicityMember(elementAsOwningMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } /// /// Builds the Textual Notation string for the rule OccurrenceDefinition - /// OccurrenceDefinition=OccurrenceDefinitionPrefix'occurrence''def'Definition + /// OccurrenceDefinition=OccurrenceDefinitionPrefix'occurrence''def'Definition /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildOccurrenceDefinition(SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceDefinition poco, StringBuilder stringBuilder) + public static void BuildOccurrenceDefinition(SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + BuildOccurrenceDefinitionPrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("occurrence "); stringBuilder.Append("def "); - DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); + DefinitionTextualNotationBuilder.BuildDefinition(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs index 44571d68..5f259af5 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs @@ -36,13 +36,14 @@ public static partial class OccurrenceUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule OccurrenceUsagePrefix - /// OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* + /// OccurrenceUsagePrefix:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildOccurrenceUsagePrefix(SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceUsage poco, StringBuilder stringBuilder) + public static void BuildOccurrenceUsagePrefix(SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - UsageTextualNotationBuilder.BuildBasicUsagePrefix(poco, stringBuilder); + UsageTextualNotationBuilder.BuildBasicUsagePrefix(poco, cursorCache, stringBuilder); if (poco.IsIndividual) { @@ -58,45 +59,49 @@ public static void BuildOccurrenceUsagePrefix(SysML2.NET.Core.POCO.Systems.Occur stringBuilder.Append(' '); } - // Handle collection Non Terminal - for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + while (ownedRelationshipCursor.Current != null) { - ownedRelationshipIndex = UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, ownedRelationshipIndex, stringBuilder); + UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, cursorCache, stringBuilder); } + } /// /// Builds the Textual Notation string for the rule IndividualUsage - /// IndividualUsage:OccurrenceUsage=BasicUsagePrefixisIndividual?='individual'UsageExtensionKeyword*Usage + /// IndividualUsage:OccurrenceUsage=BasicUsagePrefixisIndividual?='individual'UsageExtensionKeyword*Usage /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildIndividualUsage(SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceUsage poco, StringBuilder stringBuilder) + public static void BuildIndividualUsage(SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - UsageTextualNotationBuilder.BuildBasicUsagePrefix(poco, stringBuilder); + UsageTextualNotationBuilder.BuildBasicUsagePrefix(poco, cursorCache, stringBuilder); if (poco.IsIndividual) { stringBuilder.Append(" individual "); } - // Handle collection Non Terminal - for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + while (ownedRelationshipCursor.Current != null) { - ownedRelationshipIndex = UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, ownedRelationshipIndex, stringBuilder); + UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, cursorCache, stringBuilder); } - UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); + + UsageTextualNotationBuilder.BuildUsage(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule PortionUsage - /// PortionUsage:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?portionKind=PortionKindUsageExtensionKeyword*Usage{isPortion=true} + /// PortionUsage:OccurrenceUsage=BasicUsagePrefix(isIndividual?='individual')?portionKind=PortionKindUsageExtensionKeyword*Usage{isPortion=true} /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildPortionUsage(SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceUsage poco, StringBuilder stringBuilder) + public static void BuildPortionUsage(SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - UsageTextualNotationBuilder.BuildBasicUsagePrefix(poco, stringBuilder); + UsageTextualNotationBuilder.BuildBasicUsagePrefix(poco, cursorCache, stringBuilder); if (poco.IsIndividual) { @@ -105,25 +110,27 @@ public static void BuildPortionUsage(SysML2.NET.Core.POCO.Systems.Occurrences.IO } stringBuilder.Append(poco.PortionKind.ToString().ToLower()); - // Handle collection Non Terminal - for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + while (ownedRelationshipCursor.Current != null) { - ownedRelationshipIndex = UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, ownedRelationshipIndex, stringBuilder); + UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, cursorCache, stringBuilder); } - UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); + + UsageTextualNotationBuilder.BuildUsage(poco, cursorCache, 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* + /// ControlNodePrefix:OccurrenceUsage=RefPrefix(isIndividual?='individual')?(portionKind=PortionKind{isPortion=true})?UsageExtensionKeyword* /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildControlNodePrefix(SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceUsage poco, StringBuilder stringBuilder) + public static void BuildControlNodePrefix(SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - UsageTextualNotationBuilder.BuildRefPrefix(poco, stringBuilder); + UsageTextualNotationBuilder.BuildRefPrefix(poco, cursorCache, stringBuilder); if (poco.IsIndividual) { @@ -139,25 +146,27 @@ public static void BuildControlNodePrefix(SysML2.NET.Core.POCO.Systems.Occurrenc stringBuilder.Append(' '); } - // Handle collection Non Terminal - for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + while (ownedRelationshipCursor.Current != null) { - ownedRelationshipIndex = UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, ownedRelationshipIndex, stringBuilder); + UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, cursorCache, stringBuilder); } + } /// /// Builds the Textual Notation string for the rule OccurrenceUsage - /// OccurrenceUsage=OccurrenceUsagePrefix'occurrence'Usage + /// OccurrenceUsage=OccurrenceUsagePrefix'occurrence'Usage /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildOccurrenceUsage(SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceUsage poco, StringBuilder stringBuilder) + public static void BuildOccurrenceUsage(SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildOccurrenceUsagePrefix(poco, stringBuilder); + BuildOccurrenceUsagePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("occurrence "); - UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); + UsageTextualNotationBuilder.BuildUsage(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OperatorExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OperatorExpressionTextualNotationBuilder.cs index 589ac01e..8a488311 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OperatorExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OperatorExpressionTextualNotationBuilder.cs @@ -36,263 +36,367 @@ 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 + /// ConditionalExpression:OperatorExpression=operator='if'ownedRelationship+=ArgumentMember'?'ownedRelationship+=ArgumentExpressionMember'else'ownedRelationship+=ArgumentExpressionMemberownedRelationship+=EmptyResultMember /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildConditionalExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, StringBuilder stringBuilder) + public static void BuildConditionalExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); stringBuilder.Append(poco.Operator); - ownedRelationshipOfParameterMembershipIterator.MoveNext(); - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildArgumentMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + stringBuilder.Append("?"); - ownedRelationshipOfParameterMembershipIterator.MoveNext(); - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildArgumentExpressionMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildArgumentExpressionMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + stringBuilder.Append("else "); - ownedRelationshipOfParameterMembershipIterator.MoveNext(); - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildArgumentExpressionMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildArgumentExpressionMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } - ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); + ownedRelationshipCursor.Move(); - if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) + + if (ownedRelationshipCursor.Current != null) { - ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Functions.IReturnParameterMembership elementAsReturnParameterMembership) + { + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(elementAsReturnParameterMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } /// /// Builds the Textual Notation string for the rule ConditionalBinaryOperatorExpression - /// ConditionalBinaryOperatorExpression:OperatorExpression=ownedRelationship+=ArgumentMemberoperator=ConditionalBinaryOperatorownedRelationship+=ArgumentExpressionMemberownedRelationship+=EmptyResultMember + /// ConditionalBinaryOperatorExpression:OperatorExpression=ownedRelationship+=ArgumentMemberoperator=ConditionalBinaryOperatorownedRelationship+=ArgumentExpressionMemberownedRelationship+=EmptyResultMember /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildConditionalBinaryOperatorExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, StringBuilder stringBuilder) + public static void BuildConditionalBinaryOperatorExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfParameterMembershipIterator.MoveNext(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildArgumentMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + stringBuilder.Append(poco.Operator); - ownedRelationshipOfParameterMembershipIterator.MoveNext(); - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildArgumentExpressionMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildArgumentExpressionMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } - ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); + ownedRelationshipCursor.Move(); + - if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Functions.IReturnParameterMembership elementAsReturnParameterMembership) + { + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(elementAsReturnParameterMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } /// /// Builds the Textual Notation string for the rule BinaryOperatorExpression - /// BinaryOperatorExpression:OperatorExpression=ownedRelationship+=ArgumentMemberoperator=BinaryOperatorownedRelationship+=ArgumentMemberownedRelationship+=EmptyResultMember + /// BinaryOperatorExpression:OperatorExpression=ownedRelationship+=ArgumentMemberoperator=BinaryOperatorownedRelationship+=ArgumentMemberownedRelationship+=EmptyResultMember /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildBinaryOperatorExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, StringBuilder stringBuilder) + public static void BuildBinaryOperatorExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfParameterMembershipIterator.MoveNext(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildArgumentMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + stringBuilder.Append(poco.Operator); - ownedRelationshipOfParameterMembershipIterator.MoveNext(); - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildArgumentMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } - ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); + ownedRelationshipCursor.Move(); + - if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Functions.IReturnParameterMembership elementAsReturnParameterMembership) + { + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(elementAsReturnParameterMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } /// /// Builds the Textual Notation string for the rule UnaryOperatorExpression - /// UnaryOperatorExpression:OperatorExpression=operator=UnaryOperatorownedRelationship+=ArgumentMemberownedRelationship+=EmptyResultMember + /// UnaryOperatorExpression:OperatorExpression=operator=UnaryOperatorownedRelationship+=ArgumentMemberownedRelationship+=EmptyResultMember /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildUnaryOperatorExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, StringBuilder stringBuilder) + public static void BuildUnaryOperatorExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); stringBuilder.Append(poco.Operator); - ownedRelationshipOfParameterMembershipIterator.MoveNext(); - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildArgumentMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } - ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); + ownedRelationshipCursor.Move(); + - if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Functions.IReturnParameterMembership elementAsReturnParameterMembership) + { + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(elementAsReturnParameterMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } /// /// Builds the Textual Notation string for the rule ClassificationExpression - /// ClassificationExpression:OperatorExpression=(ownedRelationship+=ArgumentMember)?(operator=ClassificationTestOperatorownedRelationship+=TypeReferenceMember|operator=CastOperatorownedRelationship+=TypeResultMember)ownedRelationship+=EmptyResultMember + /// ClassificationExpression:OperatorExpression=(ownedRelationship+=ArgumentMember)?(operator=ClassificationTestOperatorownedRelationship+=TypeReferenceMember|operator=CastOperatorownedRelationship+=TypeResultMember)ownedRelationship+=EmptyResultMember /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildClassificationExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, StringBuilder stringBuilder) + public static void BuildClassificationExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - using var ownedRelationshipIterator = poco.OwnedRelationship.GetEnumerator(); - using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (ownedRelationshipOfParameterMembershipIterator.MoveNext()) + if (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildArgumentMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } stringBuilder.Append(' '); } - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildClassificationExpressionHandCoded(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); - ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); - if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Functions.IReturnParameterMembership elementAsReturnParameterMembership) + { + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(elementAsReturnParameterMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } /// /// Builds the Textual Notation string for the rule MetaclassificationExpression - /// MetaclassificationExpression:OperatorExpression=ownedRelationship+=MetadataArgumentMember(operator=ClassificationTestOperatorownedRelationship+=TypeReferenceMember|operator=MetaCastOperatorownedRelationship+=TypeResultMember)ownedRelationship+=EmptyResultMember + /// MetaclassificationExpression:OperatorExpression=ownedRelationship+=MetadataArgumentMember(operator=ClassificationTestOperatorownedRelationship+=TypeReferenceMember|operator=MetaCastOperatorownedRelationship+=TypeResultMember)ownedRelationship+=EmptyResultMember /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildMetaclassificationExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, StringBuilder stringBuilder) + public static void BuildMetaclassificationExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - using var ownedRelationshipIterator = poco.OwnedRelationship.GetEnumerator(); - using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfParameterMembershipIterator.MoveNext(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildMetadataArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildMetadataArgumentMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + ownedRelationshipCursor.Move(); + + BuildMetaclassificationExpressionHandCoded(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); - ownedRelationshipOfReturnParameterMembershipIterator.MoveNext(); - if (ownedRelationshipOfReturnParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(ownedRelationshipOfReturnParameterMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Functions.IReturnParameterMembership elementAsReturnParameterMembership) + { + ReturnParameterMembershipTextualNotationBuilder.BuildEmptyResultMember(elementAsReturnParameterMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } /// /// Builds the Textual Notation string for the rule ExtentExpression - /// ExtentExpression:OperatorExpression=operator='all'ownedRelationship+=TypeReferenceMember + /// ExtentExpression:OperatorExpression=operator='all'ownedRelationship+=TypeReferenceMember /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildExtentExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, StringBuilder stringBuilder) + public static void BuildExtentExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); stringBuilder.Append(poco.Operator); - ownedRelationshipOfParameterMembershipIterator.MoveNext(); - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildTypeReferenceMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildTypeReferenceMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } /// /// Builds the Textual Notation string for the rule BracketExpression - /// BracketExpression:OperatorExpression=ownedRelationship+=PrimaryArgumentMemberoperator='['ownedRelationship+=SequenceExpressionListMember']' + /// BracketExpression:OperatorExpression=ownedRelationship+=PrimaryArgumentMemberoperator='['ownedRelationship+=SequenceExpressionListMember']' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildBracketExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, StringBuilder stringBuilder) + public static void BuildBracketExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfParameterMembershipIterator.MoveNext(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildPrimaryArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildPrimaryArgumentMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + stringBuilder.Append(poco.Operator); - ownedRelationshipOfFeatureMembershipIterator.MoveNext(); - if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - FeatureMembershipTextualNotationBuilder.BuildSequenceExpressionListMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Types.IFeatureMembership elementAsFeatureMembership) + { + FeatureMembershipTextualNotationBuilder.BuildSequenceExpressionListMember(elementAsFeatureMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + stringBuilder.Append("]"); } /// /// Builds the Textual Notation string for the rule SequenceOperatorExpression - /// SequenceOperatorExpression:OperatorExpression=ownedRelationship+=OwnedExpressionMemberoperator=','ownedRelationship+=SequenceExpressionListMember + /// SequenceOperatorExpression:OperatorExpression=ownedRelationship+=OwnedExpressionMemberoperator=','ownedRelationship+=SequenceExpressionListMember /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildSequenceOperatorExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, StringBuilder stringBuilder) + public static void BuildSequenceOperatorExpression(SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfFeatureMembershipIterator.MoveNext(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - FeatureMembershipTextualNotationBuilder.BuildOwnedExpressionMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Types.IFeatureMembership elementAsFeatureMembership) + { + FeatureMembershipTextualNotationBuilder.BuildOwnedExpressionMember(elementAsFeatureMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + stringBuilder.Append(poco.Operator); - ownedRelationshipOfFeatureMembershipIterator.MoveNext(); - if (ownedRelationshipOfFeatureMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - FeatureMembershipTextualNotationBuilder.BuildSequenceExpressionListMember(ownedRelationshipOfFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Types.IFeatureMembership elementAsFeatureMembership) + { + FeatureMembershipTextualNotationBuilder.BuildSequenceExpressionListMember(elementAsFeatureMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs index a9f72f4c..303b0551 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs @@ -24,12 +24,10 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; - using SysML2.NET.Core.POCO.Root.Namespaces; /// /// The provides Textual Notation Builder for the element @@ -38,348 +36,385 @@ public static partial class OwningMembershipTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule AnnotatingMember - /// AnnotatingMember:OwningMembership=ownedRelatedElement+=AnnotatingElement + /// AnnotatingMember:OwningMembership=ownedRelatedElement+=AnnotatingElement /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildAnnotatingMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildAnnotatingMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelatedElement.Count) + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Root.Annotations.IAnnotatingElement elementAsAnnotatingElement) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Root.Annotations.IAnnotatingElement elementAsAnnotatingElement) { - AnnotatingElementTextualNotationBuilder.BuildAnnotatingElement(elementAsAnnotatingElement, stringBuilder); + AnnotatingElementTextualNotationBuilder.BuildAnnotatingElement(elementAsAnnotatingElement, cursorCache, stringBuilder); } } + ownedRelatedElementCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule PackageMember - /// PackageMember:OwningMembership=MemberPrefix(ownedRelatedElement+=DefinitionElement|ownedRelatedElement=UsageElement) + /// PackageMember:OwningMembership=MemberPrefix(ownedRelatedElement+=DefinitionElement|ownedRelatedElement=UsageElement) /// /// The from which the rule should be build - /// + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildPackageMember(IOwningMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) + public static void BuildPackageMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); - - var cursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); - - switch (cursor.Current) + if (ownedRelatedElementCursor.Current != null) { - case SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage usage: - UsageTextualNotationBuilder.BuildUsageElement(usage, cursorCache, stringBuilder); - break; - case { } element: - ElementTextualNotationBuilder.BuildDefinitionElement(element, cursorCache, stringBuilder); - cursor.Move(); - break; + switch (ownedRelatedElementCursor.Current) + { + case SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage usage: + UsageTextualNotationBuilder.BuildUsageElement(usage, cursorCache, stringBuilder); + break; + case { } element: + ElementTextualNotationBuilder.BuildDefinitionElement(element, cursorCache, stringBuilder); + break; + } + ownedRelatedElementCursor.Move(); } + + stringBuilder.Append(' '); + } /// /// Builds the Textual Notation string for the rule DefinitionMember - /// DefinitionMember:OwningMembership=MemberPrefixownedRelatedElement+=DefinitionElement + /// DefinitionMember:OwningMembership=MemberPrefixownedRelatedElement+=DefinitionElement /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildDefinitionMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) + public static void BuildDefinitionMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementIterator = poco.OwnedRelatedElement.GetEnumerator(); - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - ownedRelatedElementIterator.MoveNext(); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); - if (ownedRelatedElementIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - ElementTextualNotationBuilder.BuildDefinitionElement(ownedRelatedElementIterator.Current, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Root.Elements.IElement elementAsElement) + { + ElementTextualNotationBuilder.BuildDefinitionElement(elementAsElement, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } /// /// Builds the Textual Notation string for the rule OwnedCrossFeatureMember - /// OwnedCrossFeatureMember:OwningMembership=ownedRelatedElement+=OwnedCrossFeature + /// OwnedCrossFeatureMember:OwningMembership=ownedRelatedElement+=OwnedCrossFeature /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildOwnedCrossFeatureMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildOwnedCrossFeatureMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelatedElement.Count) + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage elementAsReferenceUsage) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage elementAsReferenceUsage) { - ReferenceUsageTextualNotationBuilder.BuildOwnedCrossFeature(elementAsReferenceUsage, stringBuilder); + ReferenceUsageTextualNotationBuilder.BuildOwnedCrossFeature(elementAsReferenceUsage, cursorCache, stringBuilder); } } + ownedRelatedElementCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule OwnedMultiplicity - /// OwnedMultiplicity:OwningMembership=ownedRelatedElement+=MultiplicityRange + /// OwnedMultiplicity:OwningMembership=ownedRelatedElement+=MultiplicityRange /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildOwnedMultiplicity(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildOwnedMultiplicity(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelatedElement.Count) + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Kernel.Multiplicities.IMultiplicityRange elementAsMultiplicityRange) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Kernel.Multiplicities.IMultiplicityRange elementAsMultiplicityRange) { - MultiplicityRangeTextualNotationBuilder.BuildMultiplicityRange(elementAsMultiplicityRange, stringBuilder); + MultiplicityRangeTextualNotationBuilder.BuildMultiplicityRange(elementAsMultiplicityRange, cursorCache, stringBuilder); } } + ownedRelatedElementCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule MultiplicityExpressionMember - /// MultiplicityExpressionMember:OwningMembership=ownedRelatedElement+=(LiteralExpression|FeatureReferenceExpression) + /// MultiplicityExpressionMember:OwningMembership=ownedRelatedElement+=(LiteralExpression|FeatureReferenceExpression) /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildMultiplicityExpressionMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildMultiplicityExpressionMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - switch (elementForOwnedRelatedElement) + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + switch (ownedRelatedElementCursor.Current) { - case SysML2.NET.Core.POCO.Kernel.Expressions.LiteralExpression pocoLiteralExpression: + case SysML2.NET.Core.POCO.Kernel.Expressions.ILiteralExpression pocoLiteralExpression: if (pocoLiteralExpression is SysML2.NET.Core.POCO.Kernel.Expressions.ILiteralExpression elementAsLiteralExpression) { - LiteralExpressionTextualNotationBuilder.BuildLiteralExpression(elementAsLiteralExpression, stringBuilder); + LiteralExpressionTextualNotationBuilder.BuildLiteralExpression(elementAsLiteralExpression, cursorCache, stringBuilder); } break; - case SysML2.NET.Core.POCO.Kernel.Expressions.FeatureReferenceExpression pocoFeatureReferenceExpression: + case SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression pocoFeatureReferenceExpression: if (pocoFeatureReferenceExpression is SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression elementAsFeatureReferenceExpression) { - FeatureReferenceExpressionTextualNotationBuilder.BuildFeatureReferenceExpression(elementAsFeatureReferenceExpression, stringBuilder); + FeatureReferenceExpressionTextualNotationBuilder.BuildFeatureReferenceExpression(elementAsFeatureReferenceExpression, cursorCache, stringBuilder); } break; } + ownedRelatedElementCursor.Move(); - return elementIndex; } /// /// Builds the Textual Notation string for the rule EmptyMultiplicityMember - /// EmptyMultiplicityMember:OwningMembership=ownedRelatedElement+=EmptyMultiplicity + /// EmptyMultiplicityMember:OwningMembership=ownedRelatedElement+=EmptyMultiplicity /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildEmptyMultiplicityMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildEmptyMultiplicityMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelatedElement.Count) + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Core.Types.IMultiplicity elementAsMultiplicity) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Core.Types.IMultiplicity elementAsMultiplicity) { - MultiplicityTextualNotationBuilder.BuildEmptyMultiplicity(elementAsMultiplicity, stringBuilder); + MultiplicityTextualNotationBuilder.BuildEmptyMultiplicity(elementAsMultiplicity, cursorCache, stringBuilder); } } + ownedRelatedElementCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule ConjugatedPortDefinitionMember - /// ConjugatedPortDefinitionMember:OwningMembership=ownedRelatedElement+=ConjugatedPortDefinition + /// ConjugatedPortDefinitionMember:OwningMembership=ownedRelatedElement+=ConjugatedPortDefinition /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildConjugatedPortDefinitionMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildConjugatedPortDefinitionMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelatedElement.Count) + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Systems.Ports.IConjugatedPortDefinition elementAsConjugatedPortDefinition) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.Ports.IConjugatedPortDefinition elementAsConjugatedPortDefinition) { - ConjugatedPortDefinitionTextualNotationBuilder.BuildConjugatedPortDefinition(elementAsConjugatedPortDefinition, 0, stringBuilder); + ConjugatedPortDefinitionTextualNotationBuilder.BuildConjugatedPortDefinition(elementAsConjugatedPortDefinition, cursorCache, stringBuilder); } } + ownedRelatedElementCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule OwnedCrossMultiplicityMember - /// OwnedCrossMultiplicityMember:OwningMembership=ownedRelatedElement+=OwnedCrossMultiplicity + /// OwnedCrossMultiplicityMember:OwningMembership=ownedRelatedElement+=OwnedCrossMultiplicity /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildOwnedCrossMultiplicityMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildOwnedCrossMultiplicityMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelatedElement.Count) + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Core.Features.IFeature elementAsFeature) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Core.Features.IFeature elementAsFeature) { - FeatureTextualNotationBuilder.BuildOwnedCrossMultiplicity(elementAsFeature, 0, stringBuilder); + FeatureTextualNotationBuilder.BuildOwnedCrossMultiplicity(elementAsFeature, cursorCache, stringBuilder); } } + ownedRelatedElementCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule OwnedFeatureChainMember - /// OwnedFeatureChainMember:OwningMembership=ownedRelatedElement+=OwnedFeatureChain + /// OwnedFeatureChainMember:OwningMembership=ownedRelatedElement+=OwnedFeatureChain /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildOwnedFeatureChainMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildOwnedFeatureChainMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelatedElement.Count) + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Core.Features.IFeature elementAsFeature) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Core.Features.IFeature elementAsFeature) { - FeatureTextualNotationBuilder.BuildOwnedFeatureChain(elementAsFeature, stringBuilder); + FeatureTextualNotationBuilder.BuildOwnedFeatureChain(elementAsFeature, cursorCache, stringBuilder); } } + ownedRelatedElementCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule TransitionSuccessionMember - /// TransitionSuccessionMember:OwningMembership=ownedRelatedElement+=TransitionSuccession + /// TransitionSuccessionMember:OwningMembership=ownedRelatedElement+=TransitionSuccession /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildTransitionSuccessionMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildTransitionSuccessionMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelatedElement.Count) + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Kernel.Connectors.ISuccession elementAsSuccession) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Kernel.Connectors.ISuccession elementAsSuccession) { - SuccessionTextualNotationBuilder.BuildTransitionSuccession(elementAsSuccession, stringBuilder); + SuccessionTextualNotationBuilder.BuildTransitionSuccession(elementAsSuccession, cursorCache, stringBuilder); } } + ownedRelatedElementCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule PrefixMetadataMember - /// PrefixMetadataMember:OwningMembership='#'ownedRelatedElement=PrefixMetadataUsage + /// PrefixMetadataMember:OwningMembership='#'ownedRelatedElement=PrefixMetadataUsage /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildPrefixMetadataMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) + public static void BuildPrefixMetadataMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfMetadataUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); stringBuilder.Append("#"); - ownedRelatedElementOfMetadataUsageIterator.MoveNext(); - if (ownedRelatedElementOfMetadataUsageIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - MetadataUsageTextualNotationBuilder.BuildPrefixMetadataUsage(ownedRelatedElementOfMetadataUsageIterator.Current, 0, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.Metadata.IMetadataUsage elementAsMetadataUsage) + { + MetadataUsageTextualNotationBuilder.BuildPrefixMetadataUsage(elementAsMetadataUsage, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } /// /// Builds the Textual Notation string for the rule NamespaceMember - /// NamespaceMember:OwningMembership=NonFeatureMember|NamespaceFeatureMember + /// NamespaceMember:OwningMembership=NonFeatureMember|NamespaceFeatureMember /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildNamespaceMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) + public static void BuildNamespaceMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); + BuildNamespaceMemberHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule NonFeatureMember - /// NonFeatureMember:OwningMembership=MemberPrefixownedRelatedElement+=MemberElement + /// NonFeatureMember:OwningMembership=MemberPrefixownedRelatedElement+=MemberElement /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildNonFeatureMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) + public static void BuildNonFeatureMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementIterator = poco.OwnedRelatedElement.GetEnumerator(); - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - ownedRelatedElementIterator.MoveNext(); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); - if (ownedRelatedElementIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - ElementTextualNotationBuilder.BuildMemberElement(ownedRelatedElementIterator.Current, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Root.Elements.IElement elementAsElement) + { + ElementTextualNotationBuilder.BuildMemberElement(elementAsElement, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } /// /// Builds the Textual Notation string for the rule NamespaceFeatureMember - /// NamespaceFeatureMember:OwningMembership=MemberPrefixownedRelatedElement+=FeatureElement + /// NamespaceFeatureMember:OwningMembership=MemberPrefixownedRelatedElement+=FeatureElement /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildNamespaceFeatureMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) + public static void BuildNamespaceFeatureMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - ownedRelatedElementOfFeatureIterator.MoveNext(); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); - if (ownedRelatedElementOfFeatureIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - FeatureTextualNotationBuilder.BuildFeatureElement(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Core.Features.IFeature elementAsFeature) + { + FeatureTextualNotationBuilder.BuildFeatureElement(elementAsFeature, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } /// /// Builds the Textual Notation string for the rule FeatureMember - /// FeatureMember:OwningMembership=TypeFeatureMember|OwnedFeatureMember + /// FeatureMember:OwningMembership=TypeFeatureMember|OwnedFeatureMember /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildFeatureMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) + public static void BuildFeatureMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { switch (poco) { - case SysML2.NET.Core.POCO.Core.Types.FeatureMembership pocoFeatureMembership: - FeatureMembershipTextualNotationBuilder.BuildOwnedFeatureMember(pocoFeatureMembership, stringBuilder); + case SysML2.NET.Core.POCO.Core.Types.IFeatureMembership pocoFeatureMembership: + FeatureMembershipTextualNotationBuilder.BuildOwnedFeatureMember(pocoFeatureMembership, cursorCache, stringBuilder); break; default: - BuildTypeFeatureMember(poco, stringBuilder); + BuildTypeFeatureMember(poco, cursorCache, stringBuilder); break; } @@ -387,21 +422,27 @@ public static void BuildFeatureMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwni /// /// Builds the Textual Notation string for the rule TypeFeatureMember - /// TypeFeatureMember:OwningMembership=MemberPrefix'member'ownedRelatedElement+=FeatureElement + /// TypeFeatureMember:OwningMembership=MemberPrefix'member'ownedRelatedElement+=FeatureElement /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildTypeFeatureMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, StringBuilder stringBuilder) + public static void BuildTypeFeatureMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("member "); - ownedRelatedElementOfFeatureIterator.MoveNext(); - if (ownedRelatedElementOfFeatureIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - FeatureTextualNotationBuilder.BuildFeatureElement(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Core.Features.IFeature elementAsFeature) + { + FeatureTextualNotationBuilder.BuildFeatureElement(elementAsFeature, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs index e1d2be34..32bce40e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs @@ -24,7 +24,6 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; @@ -37,81 +36,92 @@ public static partial class PackageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule PackageDeclaration - /// PackageDeclaration:Package='package'Identification + /// PackageDeclaration:Package='package'Identification /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildPackageDeclaration(SysML2.NET.Core.POCO.Kernel.Packages.IPackage poco, StringBuilder stringBuilder) + public static void BuildPackageDeclaration(SysML2.NET.Core.POCO.Kernel.Packages.IPackage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { stringBuilder.Append("package "); - ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + ElementTextualNotationBuilder.BuildIdentification(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule PackageBody - /// PackageBody:Package=';'|'{'PackageBodyElement*'}' + /// PackageBody:Package=';'|'{'PackageBodyElement*'}' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildPackageBody(SysML2.NET.Core.POCO.Kernel.Packages.IPackage poco, StringBuilder stringBuilder) + public static void BuildPackageBody(SysML2.NET.Core.POCO.Kernel.Packages.IPackage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildPackageBodyHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule PackageBodyElement - /// PackageBodyElement:Package=ownedRelationship+=PackageMember|ownedRelationship+=ElementFilterMember|ownedRelationship+=AliasMember|ownedRelationship+=Import + /// PackageBodyElement:Package=ownedRelationship+=PackageMember|ownedRelationship+=ElementFilterMember|ownedRelationship+=AliasMember|ownedRelationship+=Import /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildPackageBodyElement(SysML2.NET.Core.POCO.Kernel.Packages.IPackage poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildPackageBodyElement(SysML2.NET.Core.POCO.Kernel.Packages.IPackage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - switch (elementInOwnedRelationship) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + switch (ownedRelationshipCursor.Current) { - case SysML2.NET.Core.POCO.Kernel.Packages.ElementFilterMembership elementFilterMembership: - ElementFilterMembershipTextualNotationBuilder.BuildElementFilterMember(elementFilterMembership, stringBuilder); + case SysML2.NET.Core.POCO.Kernel.Packages.IElementFilterMembership elementFilterMembership: + ElementFilterMembershipTextualNotationBuilder.BuildElementFilterMember(elementFilterMembership, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); break; - case SysML2.NET.Core.POCO.Root.Namespaces.OwningMembership owningMembership: - OwningMembershipTextualNotationBuilder.BuildPackageMember(owningMembership, stringBuilder); + case SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership owningMembership: + OwningMembershipTextualNotationBuilder.BuildPackageMember(owningMembership, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); break; - case SysML2.NET.Core.POCO.Root.Namespaces.Membership membership: - MembershipTextualNotationBuilder.BuildAliasMember(membership, stringBuilder); + case SysML2.NET.Core.POCO.Root.Namespaces.IMembership membership: + MembershipTextualNotationBuilder.BuildAliasMember(membership, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); break; case SysML2.NET.Core.POCO.Root.Namespaces.IImport import: - ImportTextualNotationBuilder.BuildImport(import, stringBuilder); + ImportTextualNotationBuilder.BuildImport(import, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); break; } - return elementIndex; } /// /// Builds the Textual Notation string for the rule FilterPackage - /// FilterPackage:Package=ownedRelationship+=FilterPackageImport(ownedRelationship+=FilterPackageMember)+ + /// FilterPackage:Package=ownedRelationship+=FilterPackageImport(ownedRelationship+=FilterPackageMember)+ /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildFilterPackage(SysML2.NET.Core.POCO.Kernel.Packages.IPackage poco, StringBuilder stringBuilder) + public static void BuildFilterPackage(SysML2.NET.Core.POCO.Kernel.Packages.IPackage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfPackageIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - using var ownedRelationshipOfElementFilterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfPackageIterator.MoveNext(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (ownedRelationshipOfPackageIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - BuildFilterPackageImport(ownedRelationshipOfPackageIterator.Current, stringBuilder); + BuildFilterPackageImport(poco, cursorCache, stringBuilder); } + ownedRelationshipCursor.Move(); - while (ownedRelationshipOfElementFilterMembershipIterator.MoveNext()) + + while (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfElementFilterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ElementFilterMembershipTextualNotationBuilder.BuildFilterPackageMember(ownedRelationshipOfElementFilterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Packages.IElementFilterMembership elementAsElementFilterMembership) + { + ElementFilterMembershipTextualNotationBuilder.BuildFilterPackageMember(elementAsElementFilterMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); } stringBuilder.Append(' '); @@ -120,25 +130,31 @@ public static void BuildFilterPackage(SysML2.NET.Core.POCO.Kernel.Packages.IPack /// /// Builds the Textual Notation string for the rule Package - /// Package=(ownedRelationship+=PrefixMetadataMember)*PackageDeclarationPackageBody + /// Package=(ownedRelationship+=PrefixMetadataMember)*PackageDeclarationPackageBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildPackage(SysML2.NET.Core.POCO.Kernel.Packages.IPackage poco, StringBuilder stringBuilder) + public static void BuildPackage(SysML2.NET.Core.POCO.Kernel.Packages.IPackage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + while (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfOwningMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(elementAsOwningMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); } - BuildPackageDeclaration(poco, stringBuilder); - BuildPackageBody(poco, stringBuilder); + BuildPackageDeclaration(poco, cursorCache, stringBuilder); + BuildPackageBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ParameterMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ParameterMembershipTextualNotationBuilder.cs index 56e81790..10bc1187 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ParameterMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ParameterMembershipTextualNotationBuilder.cs @@ -24,7 +24,6 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; @@ -37,326 +36,342 @@ public static partial class ParameterMembershipTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule MessageEventMember - /// MessageEventMember:ParameterMembership=ownedRelatedElement+=MessageEvent + /// MessageEventMember:ParameterMembership=ownedRelatedElement+=MessageEvent /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildMessageEventMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildMessageEventMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelatedElement.Count) + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Systems.Occurrences.IEventOccurrenceUsage elementAsEventOccurrenceUsage) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.Occurrences.IEventOccurrenceUsage elementAsEventOccurrenceUsage) { - EventOccurrenceUsageTextualNotationBuilder.BuildMessageEvent(elementAsEventOccurrenceUsage, 0, stringBuilder); + EventOccurrenceUsageTextualNotationBuilder.BuildMessageEvent(elementAsEventOccurrenceUsage, cursorCache, stringBuilder); } } + ownedRelatedElementCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule PayloadParameterMember - /// PayloadParameterMember:ParameterMembership=ownedRelatedElement+=PayloadParameter + /// PayloadParameterMember:ParameterMembership=ownedRelatedElement+=PayloadParameter /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildPayloadParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildPayloadParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelatedElement.Count) + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage elementAsReferenceUsage) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage elementAsReferenceUsage) { - ReferenceUsageTextualNotationBuilder.BuildPayloadParameter(elementAsReferenceUsage, stringBuilder); + ReferenceUsageTextualNotationBuilder.BuildPayloadParameter(elementAsReferenceUsage, cursorCache, stringBuilder); } } + ownedRelatedElementCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule ArgumentMember - /// ArgumentMember:ParameterMembership=ownedMemberParameter=Argument + /// ArgumentMember:ParameterMembership=ownedMemberParameter=Argument /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) + public static void BuildArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.ownedMemberParameter != null) { - FeatureTextualNotationBuilder.BuildArgument(poco.ownedMemberParameter, 0, stringBuilder); + FeatureTextualNotationBuilder.BuildArgument(poco.ownedMemberParameter, cursorCache, stringBuilder); } } /// /// Builds the Textual Notation string for the rule ArgumentExpressionMember - /// ArgumentExpressionMember:ParameterMembership=ownedRelatedElement+=ArgumentExpression + /// ArgumentExpressionMember:ParameterMembership=ownedRelatedElement+=ArgumentExpression /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildArgumentExpressionMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildArgumentExpressionMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelatedElement.Count) + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Core.Features.IFeature elementAsFeature) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Core.Features.IFeature elementAsFeature) { - FeatureTextualNotationBuilder.BuildArgumentExpression(elementAsFeature, 0, stringBuilder); + FeatureTextualNotationBuilder.BuildArgumentExpression(elementAsFeature, cursorCache, stringBuilder); } } + ownedRelatedElementCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule NodeParameterMember - /// NodeParameterMember:ParameterMembership=ownedRelatedElement+=NodeParameter + /// NodeParameterMember:ParameterMembership=ownedRelatedElement+=NodeParameter /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildNodeParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildNodeParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelatedElement.Count) + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage elementAsReferenceUsage) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage elementAsReferenceUsage) { - ReferenceUsageTextualNotationBuilder.BuildNodeParameter(elementAsReferenceUsage, 0, stringBuilder); + ReferenceUsageTextualNotationBuilder.BuildNodeParameter(elementAsReferenceUsage, cursorCache, stringBuilder); } } + ownedRelatedElementCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule EmptyParameterMember - /// EmptyParameterMember:ParameterMembership=ownedRelatedElement+=EmptyUsage + /// EmptyParameterMember:ParameterMembership=ownedRelatedElement+=EmptyUsage /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildEmptyParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildEmptyParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelatedElement.Count) + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage elementAsReferenceUsage) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage elementAsReferenceUsage) { - ReferenceUsageTextualNotationBuilder.BuildEmptyUsage(elementAsReferenceUsage, stringBuilder); + ReferenceUsageTextualNotationBuilder.BuildEmptyUsage(elementAsReferenceUsage, cursorCache, stringBuilder); } } + ownedRelatedElementCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule AssignmentTargetMember - /// AssignmentTargetMember:ParameterMembership=ownedRelatedElement+=AssignmentTargetParameter + /// AssignmentTargetMember:ParameterMembership=ownedRelatedElement+=AssignmentTargetParameter /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildAssignmentTargetMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildAssignmentTargetMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelatedElement.Count) + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage elementAsReferenceUsage) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage elementAsReferenceUsage) { - ReferenceUsageTextualNotationBuilder.BuildAssignmentTargetParameter(elementAsReferenceUsage, stringBuilder); + ReferenceUsageTextualNotationBuilder.BuildAssignmentTargetParameter(elementAsReferenceUsage, cursorCache, stringBuilder); } } + ownedRelatedElementCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule ExpressionParameterMember - /// ExpressionParameterMember:ParameterMembership=ownedRelatedElement+=OwnedExpression + /// ExpressionParameterMember:ParameterMembership=ownedRelatedElement+=OwnedExpression /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildExpressionParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildExpressionParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelatedElement.Count) + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Kernel.Functions.IExpression elementAsExpression) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Kernel.Functions.IExpression elementAsExpression) { - ExpressionTextualNotationBuilder.BuildOwnedExpression(elementAsExpression, stringBuilder); + ExpressionTextualNotationBuilder.BuildOwnedExpression(elementAsExpression, cursorCache, stringBuilder); } } + ownedRelatedElementCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule ActionBodyParameterMember - /// ActionBodyParameterMember:ParameterMembership=ownedRelatedElement+=ActionBodyParameter + /// ActionBodyParameterMember:ParameterMembership=ownedRelatedElement+=ActionBodyParameter /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildActionBodyParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildActionBodyParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelatedElement.Count) + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Systems.Actions.IActionUsage elementAsActionUsage) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.Actions.IActionUsage elementAsActionUsage) { - ActionUsageTextualNotationBuilder.BuildActionBodyParameter(elementAsActionUsage, stringBuilder); + ActionUsageTextualNotationBuilder.BuildActionBodyParameter(elementAsActionUsage, cursorCache, stringBuilder); } } + ownedRelatedElementCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule IfNodeParameterMember - /// IfNodeParameterMember:ParameterMembership=ownedRelatedElement+=IfNode + /// IfNodeParameterMember:ParameterMembership=ownedRelatedElement+=IfNode /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildIfNodeParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildIfNodeParameterMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelatedElement.Count) + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Systems.Actions.IIfActionUsage elementAsIfActionUsage) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.Actions.IIfActionUsage elementAsIfActionUsage) { - IfActionUsageTextualNotationBuilder.BuildIfNode(elementAsIfActionUsage, stringBuilder); + IfActionUsageTextualNotationBuilder.BuildIfNode(elementAsIfActionUsage, cursorCache, stringBuilder); } } + ownedRelatedElementCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule MetadataArgumentMember - /// MetadataArgumentMember:ParameterMembership=ownedRelatedElement+=MetadataArgument + /// MetadataArgumentMember:ParameterMembership=ownedRelatedElement+=MetadataArgument /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildMetadataArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildMetadataArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelatedElement.Count) + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Core.Features.IFeature elementAsFeature) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Core.Features.IFeature elementAsFeature) { - FeatureTextualNotationBuilder.BuildMetadataArgument(elementAsFeature, 0, stringBuilder); + FeatureTextualNotationBuilder.BuildMetadataArgument(elementAsFeature, cursorCache, stringBuilder); } } + ownedRelatedElementCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule TypeReferenceMember - /// TypeReferenceMember:ParameterMembership=ownedMemberFeature=TypeReference + /// TypeReferenceMember:ParameterMembership=ownedMemberFeature=TypeReference /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildTypeReferenceMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) + public static void BuildTypeReferenceMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.ownedMemberFeature != null) { - FeatureTextualNotationBuilder.BuildTypeReference(poco.ownedMemberFeature, 0, stringBuilder); + FeatureTextualNotationBuilder.BuildTypeReference(poco.ownedMemberFeature, cursorCache, stringBuilder); } } /// /// Builds the Textual Notation string for the rule PrimaryArgumentMember - /// PrimaryArgumentMember:ParameterMembership=ownedMemberParameter=PrimaryArgument + /// PrimaryArgumentMember:ParameterMembership=ownedMemberParameter=PrimaryArgument /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildPrimaryArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) + public static void BuildPrimaryArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.ownedMemberParameter != null) { - FeatureTextualNotationBuilder.BuildPrimaryArgument(poco.ownedMemberParameter, 0, stringBuilder); + FeatureTextualNotationBuilder.BuildPrimaryArgument(poco.ownedMemberParameter, cursorCache, stringBuilder); } } /// /// Builds the Textual Notation string for the rule NonFeatureChainPrimaryArgumentMember - /// NonFeatureChainPrimaryArgumentMember:ParameterMembership=ownedMemberParameter=PrimaryArgument + /// NonFeatureChainPrimaryArgumentMember:ParameterMembership=ownedMemberParameter=PrimaryArgument /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildNonFeatureChainPrimaryArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) + public static void BuildNonFeatureChainPrimaryArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.ownedMemberParameter != null) { - FeatureTextualNotationBuilder.BuildPrimaryArgument(poco.ownedMemberParameter, 0, stringBuilder); + FeatureTextualNotationBuilder.BuildPrimaryArgument(poco.ownedMemberParameter, cursorCache, stringBuilder); } } /// /// Builds the Textual Notation string for the rule BodyArgumentMember - /// BodyArgumentMember:ParameterMembership=ownedMemberParameter=BodyArgument + /// BodyArgumentMember:ParameterMembership=ownedMemberParameter=BodyArgument /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildBodyArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) + public static void BuildBodyArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.ownedMemberParameter != null) { - FeatureTextualNotationBuilder.BuildBodyArgument(poco.ownedMemberParameter, 0, stringBuilder); + FeatureTextualNotationBuilder.BuildBodyArgument(poco.ownedMemberParameter, cursorCache, stringBuilder); } } /// /// Builds the Textual Notation string for the rule FunctionReferenceArgumentMember - /// FunctionReferenceArgumentMember:ParameterMembership=ownedMemberParameter=FunctionReferenceArgument + /// FunctionReferenceArgumentMember:ParameterMembership=ownedMemberParameter=FunctionReferenceArgument /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildFunctionReferenceArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, StringBuilder stringBuilder) + public static void BuildFunctionReferenceArgumentMember(SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.ownedMemberParameter != null) { - FeatureTextualNotationBuilder.BuildFunctionReferenceArgument(poco.ownedMemberParameter, 0, stringBuilder); + FeatureTextualNotationBuilder.BuildFunctionReferenceArgument(poco.ownedMemberParameter, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartDefinitionTextualNotationBuilder.cs index be495e17..bbcfc8cf 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartDefinitionTextualNotationBuilder.cs @@ -36,16 +36,17 @@ public static partial class PartDefinitionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule PartDefinition - /// PartDefinition=OccurrenceDefinitionPrefix'part''def'Definition + /// PartDefinition=OccurrenceDefinitionPrefix'part''def'Definition /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildPartDefinition(SysML2.NET.Core.POCO.Systems.Parts.IPartDefinition poco, StringBuilder stringBuilder) + public static void BuildPartDefinition(SysML2.NET.Core.POCO.Systems.Parts.IPartDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("part "); stringBuilder.Append("def "); - DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); + DefinitionTextualNotationBuilder.BuildDefinition(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartUsageTextualNotationBuilder.cs index 5b4a2481..0343b0b8 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartUsageTextualNotationBuilder.cs @@ -36,51 +36,56 @@ public static partial class PartUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule ActorUsage - /// ActorUsage:PartUsage='actor'UsageExtensionKeyword*Usage + /// ActorUsage:PartUsage='actor'UsageExtensionKeyword*Usage /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildActorUsage(SysML2.NET.Core.POCO.Systems.Parts.IPartUsage poco, StringBuilder stringBuilder) + public static void BuildActorUsage(SysML2.NET.Core.POCO.Systems.Parts.IPartUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { stringBuilder.Append("actor "); - // Handle collection Non Terminal - for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + while (ownedRelationshipCursor.Current != null) { - ownedRelationshipIndex = UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, ownedRelationshipIndex, stringBuilder); + UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, cursorCache, stringBuilder); } - UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); + + UsageTextualNotationBuilder.BuildUsage(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule StakeholderUsage - /// StakeholderUsage:PartUsage='stakeholder'UsageExtensionKeyword*Usage + /// StakeholderUsage:PartUsage='stakeholder'UsageExtensionKeyword*Usage /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildStakeholderUsage(SysML2.NET.Core.POCO.Systems.Parts.IPartUsage poco, StringBuilder stringBuilder) + public static void BuildStakeholderUsage(SysML2.NET.Core.POCO.Systems.Parts.IPartUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { stringBuilder.Append("stakeholder "); - // Handle collection Non Terminal - for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + while (ownedRelationshipCursor.Current != null) { - ownedRelationshipIndex = UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, ownedRelationshipIndex, stringBuilder); + UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, cursorCache, stringBuilder); } - UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); + + UsageTextualNotationBuilder.BuildUsage(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule PartUsage - /// PartUsage=OccurrenceUsagePrefix'part'Usage + /// PartUsage=OccurrenceUsagePrefix'part'Usage /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildPartUsage(SysML2.NET.Core.POCO.Systems.Parts.IPartUsage poco, StringBuilder stringBuilder) + public static void BuildPartUsage(SysML2.NET.Core.POCO.Systems.Parts.IPartUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("part "); - UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); + UsageTextualNotationBuilder.BuildUsage(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PayloadFeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PayloadFeatureTextualNotationBuilder.cs index d6afd029..a09fe8cc 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PayloadFeatureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PayloadFeatureTextualNotationBuilder.cs @@ -36,13 +36,14 @@ public static partial class PayloadFeatureTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule FlowPayloadFeature - /// FlowPayloadFeature:PayloadFeature=PayloadFeature + /// FlowPayloadFeature:PayloadFeature=PayloadFeature /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildFlowPayloadFeature(SysML2.NET.Core.POCO.Kernel.Interactions.IPayloadFeature poco, StringBuilder stringBuilder) + public static void BuildFlowPayloadFeature(SysML2.NET.Core.POCO.Kernel.Interactions.IPayloadFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - FeatureTextualNotationBuilder.BuildPayloadFeature(poco, 0, stringBuilder); + FeatureTextualNotationBuilder.BuildPayloadFeature(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PerformActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PerformActionUsageTextualNotationBuilder.cs index c630d665..a0c2ff6e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PerformActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PerformActionUsageTextualNotationBuilder.cs @@ -36,52 +36,59 @@ public static partial class PerformActionUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule PerformActionUsageDeclaration - /// PerformActionUsageDeclaration:PerformActionUsage=(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'action'UsageDeclaration)ValuePart? + /// PerformActionUsageDeclaration:PerformActionUsage=(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'action'UsageDeclaration)ValuePart? /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildPerformActionUsageDeclaration(SysML2.NET.Core.POCO.Systems.Actions.IPerformActionUsage poco, StringBuilder stringBuilder) + public static void BuildPerformActionUsageDeclaration(SysML2.NET.Core.POCO.Systems.Actions.IPerformActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfReferenceSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + BuildPerformActionUsageDeclarationHandCoded(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); - FeatureTextualNotationBuilder.BuildValuePart(poco, 0, stringBuilder); + + if (poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || !string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.Direction.HasValue || poco.IsDerived || poco.IsAbstract || poco.IsConstant || poco.IsOrdered || poco.IsEnd || poco.importedMembership.Count != 0 || poco.IsComposite || poco.IsPortion || poco.IsVariable || poco.IsSufficient || poco.unioningType.Count != 0 || poco.intersectingType.Count != 0 || poco.differencingType.Count != 0 || poco.featuringType.Count != 0 || poco.ownedTypeFeaturing.Count != 0) + { + FeatureTextualNotationBuilder.BuildValuePart(poco, cursorCache, stringBuilder); + } } /// /// Builds the Textual Notation string for the rule StatePerformActionUsage - /// StatePerformActionUsage:PerformActionUsage=PerformActionUsageDeclarationActionBody + /// StatePerformActionUsage:PerformActionUsage=PerformActionUsageDeclarationActionBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildStatePerformActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IPerformActionUsage poco, StringBuilder stringBuilder) + public static void BuildStatePerformActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IPerformActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildPerformActionUsageDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); + BuildPerformActionUsageDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildActionBody(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule TransitionPerformActionUsage - /// TransitionPerformActionUsage:PerformActionUsage=PerformActionUsageDeclaration('{'ActionBodyItem*'}')? + /// TransitionPerformActionUsage:PerformActionUsage=PerformActionUsageDeclaration('{'ActionBodyItem*'}')? /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildTransitionPerformActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IPerformActionUsage poco, StringBuilder stringBuilder) + public static void BuildTransitionPerformActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IPerformActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildPerformActionUsageDeclaration(poco, stringBuilder); + BuildPerformActionUsageDeclaration(poco, cursorCache, stringBuilder); - if (BuildGroupConditionForTransitionPerformActionUsage(poco)) + if (poco.OwnedRelationship.Count != 0 || poco.importedMembership.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || !string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.Direction.HasValue || poco.IsDerived || poco.IsAbstract || poco.IsVariation || poco.IsConstant || poco.IsOrdered || poco.IsEnd || poco.isReference || poco.IsIndividual || poco.PortionKind.HasValue || poco.IsComposite || poco.IsPortion || poco.IsVariable || poco.IsSufficient || poco.unioningType.Count != 0 || poco.intersectingType.Count != 0 || poco.differencingType.Count != 0 || poco.featuringType.Count != 0 || poco.ownedTypeFeaturing.Count != 0) { - stringBuilder.Append("{"); - // Handle collection Non Terminal - for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + stringBuilder.AppendLine("{"); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + while (ownedRelationshipCursor.Current != null) { - ownedRelationshipIndex = TypeTextualNotationBuilder.BuildActionBodyItem(poco, ownedRelationshipIndex, stringBuilder); + TypeTextualNotationBuilder.BuildActionBodyItem(poco, cursorCache, stringBuilder); } - stringBuilder.Append("}"); - stringBuilder.Append(' '); + + stringBuilder.AppendLine("}"); } @@ -89,16 +96,17 @@ public static void BuildTransitionPerformActionUsage(SysML2.NET.Core.POCO.System /// /// Builds the Textual Notation string for the rule PerformActionUsage - /// PerformActionUsage=OccurrenceUsagePrefix'perform'PerformActionUsageDeclarationActionBody + /// PerformActionUsage=OccurrenceUsagePrefix'perform'PerformActionUsageDeclarationActionBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildPerformActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IPerformActionUsage poco, StringBuilder stringBuilder) + public static void BuildPerformActionUsage(SysML2.NET.Core.POCO.Systems.Actions.IPerformActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("perform "); - BuildPerformActionUsageDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); + BuildPerformActionUsageDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildActionBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortConjugationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortConjugationTextualNotationBuilder.cs index ec8ddda9..ecd35fe2 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortConjugationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortConjugationTextualNotationBuilder.cs @@ -36,11 +36,12 @@ public static partial class PortConjugationTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule PortConjugation - /// PortConjugation={} + /// PortConjugation={} /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildPortConjugation(SysML2.NET.Core.POCO.Systems.Ports.IPortConjugation poco, StringBuilder stringBuilder) + public static void BuildPortConjugation(SysML2.NET.Core.POCO.Systems.Ports.IPortConjugation poco, ICursorCache cursorCache, StringBuilder stringBuilder) { } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortDefinitionTextualNotationBuilder.cs index 3fb22863..cc593801 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortDefinitionTextualNotationBuilder.cs @@ -36,23 +36,29 @@ public static partial class PortDefinitionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule PortDefinition - /// PortDefinition=DefinitionPrefix'port''def'DefinitionownedRelationship+=ConjugatedPortDefinitionMember{conjugatedPortDefinition.ownedPortConjugator.originalPortDefinition=this} + /// PortDefinition=DefinitionPrefix'port''def'DefinitionownedRelationship+=ConjugatedPortDefinitionMember{conjugatedPortDefinition.ownedPortConjugator.originalPortDefinition=this} /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildPortDefinition(SysML2.NET.Core.POCO.Systems.Ports.IPortDefinition poco, StringBuilder stringBuilder) + public static void BuildPortDefinition(SysML2.NET.Core.POCO.Systems.Ports.IPortDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - DefinitionTextualNotationBuilder.BuildDefinitionPrefix(poco, stringBuilder); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + DefinitionTextualNotationBuilder.BuildDefinitionPrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("port "); stringBuilder.Append("def "); - DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); - ownedRelationshipOfOwningMembershipIterator.MoveNext(); + DefinitionTextualNotationBuilder.BuildDefinition(poco, cursorCache, stringBuilder); - if (ownedRelationshipOfOwningMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - OwningMembershipTextualNotationBuilder.BuildConjugatedPortDefinitionMember(ownedRelationshipOfOwningMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + { + OwningMembershipTextualNotationBuilder.BuildConjugatedPortDefinitionMember(elementAsOwningMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + // NonParsing Assignment Element : conjugatedPortDefinition.ownedPortConjugator.originalPortDefinition = this => Does not have to be process } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs index afb38505..585f17d3 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortUsageTextualNotationBuilder.cs @@ -36,37 +36,42 @@ public static partial class PortUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule DefaultInterfaceEnd - /// DefaultInterfaceEnd:PortUsage=isEnd?='end'Usage + /// DefaultInterfaceEnd:PortUsage=isEnd?='end'Usage /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildDefaultInterfaceEnd(SysML2.NET.Core.POCO.Systems.Ports.IPortUsage poco, StringBuilder stringBuilder) + public static void BuildDefaultInterfaceEnd(SysML2.NET.Core.POCO.Systems.Ports.IPortUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.IsEnd) { stringBuilder.Append(" end "); } - UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); + UsageTextualNotationBuilder.BuildUsage(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule InterfaceEnd - /// InterfaceEnd:PortUsage=(ownedRelationship+=OwnedCrossMultiplicityMember)?(declaredName=NAMEREFERENCES)?ownedRelationship+=OwnedReferenceSubsetting + /// InterfaceEnd:PortUsage=(ownedRelationship+=OwnedCrossMultiplicityMember)?(declaredName=NAMEREFERENCES)?ownedRelationship+=OwnedReferenceSubsetting /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildInterfaceEnd(SysML2.NET.Core.POCO.Systems.Ports.IPortUsage poco, StringBuilder stringBuilder) + public static void BuildInterfaceEnd(SysML2.NET.Core.POCO.Systems.Ports.IPortUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - using var ownedRelationshipOfReferenceSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + if (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfOwningMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - OwningMembershipTextualNotationBuilder.BuildOwnedCrossMultiplicityMember(ownedRelationshipOfOwningMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + { + OwningMembershipTextualNotationBuilder.BuildOwnedCrossMultiplicityMember(elementAsOwningMembership, cursorCache, stringBuilder); + } } stringBuilder.Append(' '); } @@ -79,26 +84,32 @@ public static void BuildInterfaceEnd(SysML2.NET.Core.POCO.Systems.Ports.IPortUsa stringBuilder.Append(' '); } - ownedRelationshipOfReferenceSubsettingIterator.MoveNext(); - if (ownedRelationshipOfReferenceSubsettingIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ReferenceSubsettingTextualNotationBuilder.BuildOwnedReferenceSubsetting(ownedRelationshipOfReferenceSubsettingIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IReferenceSubsetting elementAsReferenceSubsetting) + { + ReferenceSubsettingTextualNotationBuilder.BuildOwnedReferenceSubsetting(elementAsReferenceSubsetting, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } /// /// Builds the Textual Notation string for the rule PortUsage - /// PortUsage=OccurrenceUsagePrefix'port'Usage + /// PortUsage=OccurrenceUsagePrefix'port'Usage /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildPortUsage(SysML2.NET.Core.POCO.Systems.Ports.IPortUsage poco, StringBuilder stringBuilder) + public static void BuildPortUsage(SysML2.NET.Core.POCO.Systems.Ports.IPortUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("port "); - UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); + UsageTextualNotationBuilder.BuildUsage(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortionKindTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortionKindTextualNotationBuilder.cs index ff40e40e..e460904b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortionKindTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PortionKindTextualNotationBuilder.cs @@ -36,11 +36,12 @@ public static partial class PortionKindTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule PortionKind - /// PortionKind='snapshot'|'timeslice' + /// PortionKind='snapshot'|'timeslice' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildPortionKind(SysML2.NET.Core.Systems.Occurrences.PortionKind poco, StringBuilder stringBuilder) + public static void BuildPortionKind(SysML2.NET.Core.Systems.Occurrences.PortionKind poco, ICursorCache cursorCache, StringBuilder stringBuilder) { } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PredicateTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PredicateTextualNotationBuilder.cs index f151f59d..fb839a5c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PredicateTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PredicateTextualNotationBuilder.cs @@ -36,16 +36,17 @@ public static partial class PredicateTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule Predicate - /// Predicate=TypePrefix'predicate'ClassifierDeclarationFunctionBody + /// Predicate=TypePrefix'predicate'ClassifierDeclarationFunctionBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildPredicate(SysML2.NET.Core.POCO.Kernel.Functions.IPredicate poco, StringBuilder stringBuilder) + public static void BuildPredicate(SysML2.NET.Core.POCO.Kernel.Functions.IPredicate poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); + TypeTextualNotationBuilder.BuildTypePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("predicate "); - ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildFunctionBody(poco, stringBuilder); + ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildFunctionBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs index fb4cf048..b5bbeea6 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs @@ -36,22 +36,24 @@ public static partial class RedefinitionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule OwnedRedefinition - /// OwnedRedefinition:Redefinition=redefinedFeature=[QualifiedName]|redefinedFeature=OwnedFeatureChain{ownedRelatedElement+=redefinedFeature} + /// OwnedRedefinition:Redefinition=redefinedFeature=[QualifiedName]|redefinedFeature=OwnedFeatureChain{ownedRelatedElement+=redefinedFeature} /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildOwnedRedefinition(SysML2.NET.Core.POCO.Core.Features.IRedefinition poco, StringBuilder stringBuilder) + public static void BuildOwnedRedefinition(SysML2.NET.Core.POCO.Core.Features.IRedefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildOwnedRedefinitionHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule FlowFeatureRedefinition - /// FlowFeatureRedefinition:Redefinition=redefinedFeature=[QualifiedName] + /// FlowFeatureRedefinition:Redefinition=redefinedFeature=[QualifiedName] /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildFlowFeatureRedefinition(SysML2.NET.Core.POCO.Core.Features.IRedefinition poco, StringBuilder stringBuilder) + public static void BuildFlowFeatureRedefinition(SysML2.NET.Core.POCO.Core.Features.IRedefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.RedefinedFeature != null) @@ -64,11 +66,12 @@ public static void BuildFlowFeatureRedefinition(SysML2.NET.Core.POCO.Core.Featur /// /// Builds the Textual Notation string for the rule ParameterRedefinition - /// ParameterRedefinition:Redefinition=redefinedFeature=[QualifiedName] + /// ParameterRedefinition:Redefinition=redefinedFeature=[QualifiedName] /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildParameterRedefinition(SysML2.NET.Core.POCO.Core.Features.IRedefinition poco, StringBuilder stringBuilder) + public static void BuildParameterRedefinition(SysML2.NET.Core.POCO.Core.Features.IRedefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.RedefinedFeature != null) @@ -81,25 +84,26 @@ public static void BuildParameterRedefinition(SysML2.NET.Core.POCO.Core.Features /// /// Builds the Textual Notation string for the rule Redefinition - /// Redefinition=('specialization'Identification)?'redefinition'SpecificTypeREDEFINESGeneralTypeRelationshipBody + /// Redefinition=('specialization'Identification)?'redefinition'SpecificTypeREDEFINESGeneralTypeRelationshipBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildRedefinition(SysML2.NET.Core.POCO.Core.Features.IRedefinition poco, StringBuilder stringBuilder) + public static void BuildRedefinition(SysML2.NET.Core.POCO.Core.Features.IRedefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (BuildGroupConditionForRedefinition(poco)) + if (!string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName)) { stringBuilder.Append("specialization "); - ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + ElementTextualNotationBuilder.BuildIdentification(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); } stringBuilder.Append("redefinition "); - SpecializationTextualNotationBuilder.BuildSpecificType(poco, 0, stringBuilder); + SpecializationTextualNotationBuilder.BuildSpecificType(poco, cursorCache, stringBuilder); stringBuilder.Append(" :>> "); - SpecializationTextualNotationBuilder.BuildGeneralType(poco, 0, stringBuilder); - RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); + SpecializationTextualNotationBuilder.BuildGeneralType(poco, cursorCache, stringBuilder); + RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceSubsettingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceSubsettingTextualNotationBuilder.cs index 03dac04f..b0262a0d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceSubsettingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceSubsettingTextualNotationBuilder.cs @@ -36,24 +36,26 @@ public static partial class ReferenceSubsettingTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule OwnedReferenceSubsetting - /// OwnedReferenceSubsetting:ReferenceSubsetting=referencedFeature=[QualifiedName]|referencedFeature=OwnedFeatureChain{ownedRelatedElement+=referenceFeature} + /// OwnedReferenceSubsetting:ReferenceSubsetting=referencedFeature=[QualifiedName]|referencedFeature=OwnedFeatureChain{ownedRelatedElement+=referenceFeature} /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildOwnedReferenceSubsetting(SysML2.NET.Core.POCO.Core.Features.IReferenceSubsetting poco, StringBuilder stringBuilder) + public static void BuildOwnedReferenceSubsetting(SysML2.NET.Core.POCO.Core.Features.IReferenceSubsetting poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildOwnedReferenceSubsettingHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule FlowEndSubsetting - /// FlowEndSubsetting:ReferenceSubsetting=referencedFeature=[QualifiedName]|referencedFeature=FeatureChainPrefix{ownedRelatedElement+=referencedFeature} + /// FlowEndSubsetting:ReferenceSubsetting=referencedFeature=[QualifiedName]|referencedFeature=FeatureChainPrefix{ownedRelatedElement+=referencedFeature} /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildFlowEndSubsetting(SysML2.NET.Core.POCO.Core.Features.IReferenceSubsetting poco, StringBuilder stringBuilder) + public static void BuildFlowEndSubsetting(SysML2.NET.Core.POCO.Core.Features.IReferenceSubsetting poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildFlowEndSubsettingHandCoded(poco, cursorCache, stringBuilder); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs index ea54d1a5..6e498b5e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs @@ -24,7 +24,6 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; @@ -37,69 +36,84 @@ public static partial class ReferenceUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule OwnedCrossFeature - /// OwnedCrossFeature:ReferenceUsage=BasicUsagePrefixUsageDeclaration + /// OwnedCrossFeature:ReferenceUsage=BasicUsagePrefixUsageDeclaration /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildOwnedCrossFeature(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) + public static void BuildOwnedCrossFeature(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - UsageTextualNotationBuilder.BuildBasicUsagePrefix(poco, stringBuilder); - UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + UsageTextualNotationBuilder.BuildBasicUsagePrefix(poco, cursorCache, stringBuilder); + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule DefaultReferenceUsage - /// DefaultReferenceUsage:ReferenceUsage=RefPrefixUsage + /// DefaultReferenceUsage:ReferenceUsage=RefPrefixUsage /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildDefaultReferenceUsage(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) + public static void BuildDefaultReferenceUsage(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - UsageTextualNotationBuilder.BuildRefPrefix(poco, stringBuilder); - UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); + UsageTextualNotationBuilder.BuildRefPrefix(poco, cursorCache, stringBuilder); + UsageTextualNotationBuilder.BuildUsage(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule VariantReference - /// VariantReference:ReferenceUsage=ownedRelationship+=OwnedReferenceSubsettingFeatureSpecialization*UsageBody + /// VariantReference:ReferenceUsage=ownedRelationship+=OwnedReferenceSubsettingFeatureSpecialization*UsageBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildVariantReference(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) + public static void BuildVariantReference(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfReferenceSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfReferenceSubsettingIterator.MoveNext(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (ownedRelationshipOfReferenceSubsettingIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ReferenceSubsettingTextualNotationBuilder.BuildOwnedReferenceSubsetting(ownedRelationshipOfReferenceSubsettingIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IReferenceSubsetting elementAsReferenceSubsetting) + { + ReferenceSubsettingTextualNotationBuilder.BuildOwnedReferenceSubsetting(elementAsReferenceSubsetting, cursorCache, stringBuilder); + } } - // Handle collection Non Terminal - BuildFeatureSpecializationInternal(poco, stringBuilder); FeatureTextualNotationBuilder.BuildFeatureSpecialization(poco, stringBuilder); - UsageTextualNotationBuilder.BuildUsageBody(poco, stringBuilder); + ownedRelationshipCursor.Move(); + + while (ownedRelationshipCursor.Current != null) + { + FeatureTextualNotationBuilder.BuildFeatureSpecialization(poco, cursorCache, stringBuilder); + } + + UsageTextualNotationBuilder.BuildUsageBody(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule SourceEnd - /// SourceEnd:ReferenceUsage=(ownedRelationship+=OwnedMultiplicity)? + /// SourceEnd:ReferenceUsage=(ownedRelationship+=OwnedMultiplicity)? /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildSourceEnd(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) + public static void BuildSourceEnd(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + if (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfOwningMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - OwningMembershipTextualNotationBuilder.BuildOwnedMultiplicity(ownedRelationshipOfOwningMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + { + OwningMembershipTextualNotationBuilder.BuildOwnedMultiplicity(elementAsOwningMembership, cursorCache, stringBuilder); + } } - stringBuilder.Append(' '); } @@ -107,21 +121,25 @@ public static void BuildSourceEnd(SysML2.NET.Core.POCO.Systems.DefinitionAndUsag /// /// Builds the Textual Notation string for the rule ConnectorEnd - /// ConnectorEnd:ReferenceUsage=(ownedRelationship+=OwnedCrossMultiplicityMember)?(declaredName=NAMEREFERENCES)?ownedRelationship+=OwnedReferenceSubsetting + /// ConnectorEnd:ReferenceUsage=(ownedRelationship+=OwnedCrossMultiplicityMember)?(declaredName=NAMEREFERENCES)?ownedRelationship+=OwnedReferenceSubsetting /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildConnectorEnd(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) + public static void BuildConnectorEnd(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - using var ownedRelationshipOfReferenceSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + if (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfOwningMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - OwningMembershipTextualNotationBuilder.BuildOwnedCrossMultiplicityMember(ownedRelationshipOfOwningMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + { + OwningMembershipTextualNotationBuilder.BuildOwnedCrossMultiplicityMember(elementAsOwningMembership, cursorCache, stringBuilder); + } } stringBuilder.Append(' '); } @@ -134,102 +152,115 @@ public static void BuildConnectorEnd(SysML2.NET.Core.POCO.Systems.DefinitionAndU stringBuilder.Append(' '); } - ownedRelationshipOfReferenceSubsettingIterator.MoveNext(); - if (ownedRelationshipOfReferenceSubsettingIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ReferenceSubsettingTextualNotationBuilder.BuildOwnedReferenceSubsetting(ownedRelationshipOfReferenceSubsettingIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IReferenceSubsetting elementAsReferenceSubsetting) + { + ReferenceSubsettingTextualNotationBuilder.BuildOwnedReferenceSubsetting(elementAsReferenceSubsetting, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } /// /// Builds the Textual Notation string for the rule FlowFeature - /// FlowFeature:ReferenceUsage=ownedRelationship+=FlowFeatureRedefinition + /// FlowFeature:ReferenceUsage=ownedRelationship+=FlowFeatureRedefinition /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildFlowFeature(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildFlowFeature(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelationship.Count) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + + if (ownedRelationshipCursor.Current != null) { - var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; - if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Core.Features.IRedefinition elementAsRedefinition) + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IRedefinition elementAsRedefinition) { - RedefinitionTextualNotationBuilder.BuildFlowFeatureRedefinition(elementAsRedefinition, stringBuilder); + RedefinitionTextualNotationBuilder.BuildFlowFeatureRedefinition(elementAsRedefinition, cursorCache, stringBuilder); } } + ownedRelationshipCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule PayloadParameter - /// PayloadParameter:ReferenceUsage=PayloadFeature|IdentificationPayloadFeatureSpecializationPart?TriggerValuePart + /// PayloadParameter:ReferenceUsage=PayloadFeature|IdentificationPayloadFeatureSpecializationPart?TriggerValuePart /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildPayloadParameter(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) + public static void BuildPayloadParameter(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildPayloadParameterHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule NodeParameter - /// NodeParameter:ReferenceUsage=ownedRelationship+=FeatureBinding + /// NodeParameter:ReferenceUsage=ownedRelationship+=FeatureBinding /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildNodeParameter(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildNodeParameter(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelationship.Count) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + + if (ownedRelationshipCursor.Current != null) { - var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; - if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue elementAsFeatureValue) + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue elementAsFeatureValue) { - FeatureValueTextualNotationBuilder.BuildFeatureBinding(elementAsFeatureValue, 0, stringBuilder); + FeatureValueTextualNotationBuilder.BuildFeatureBinding(elementAsFeatureValue, cursorCache, stringBuilder); } } + ownedRelationshipCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule EmptyUsage - /// EmptyUsage:ReferenceUsage={} + /// EmptyUsage:ReferenceUsage={} /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildEmptyUsage(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) + public static void BuildEmptyUsage(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { } /// /// Builds the Textual Notation string for the rule AssignmentTargetParameter - /// AssignmentTargetParameter:ReferenceUsage=(ownedRelationship+=AssignmentTargetBinding'.')? + /// AssignmentTargetParameter:ReferenceUsage=(ownedRelationship+=AssignmentTargetBinding'.')? /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildAssignmentTargetParameter(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) + public static void BuildAssignmentTargetParameter(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfFeatureValueIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (ownedRelationshipOfFeatureValueIterator.MoveNext()) + if (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfFeatureValueIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - FeatureValueTextualNotationBuilder.BuildAssignmentTargetBinding(ownedRelationshipOfFeatureValueIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue elementAsFeatureValue) + { + FeatureValueTextualNotationBuilder.BuildAssignmentTargetBinding(elementAsFeatureValue, cursorCache, stringBuilder); + } } stringBuilder.Append("."); - stringBuilder.Append(' '); } @@ -237,103 +268,132 @@ public static void BuildAssignmentTargetParameter(SysML2.NET.Core.POCO.Systems.D /// /// Builds the Textual Notation string for the rule ForVariableDeclaration - /// ForVariableDeclaration:ReferenceUsage=UsageDeclaration + /// ForVariableDeclaration:ReferenceUsage=UsageDeclaration /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildForVariableDeclaration(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) + public static void BuildForVariableDeclaration(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule EmptyFeature - /// EmptyFeature:ReferenceUsage={} + /// EmptyFeature:ReferenceUsage={} /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildEmptyFeature(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) + public static void BuildEmptyFeature(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { } /// /// Builds the Textual Notation string for the rule SubjectUsage - /// SubjectUsage:ReferenceUsage='subject'UsageExtensionKeyword*Usage + /// SubjectUsage:ReferenceUsage='subject'UsageExtensionKeyword*Usage /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildSubjectUsage(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) + public static void BuildSubjectUsage(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { stringBuilder.Append("subject "); - // Handle collection Non Terminal - for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + while (ownedRelationshipCursor.Current != null) { - ownedRelationshipIndex = UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, ownedRelationshipIndex, stringBuilder); + UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, cursorCache, stringBuilder); } - UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); + + UsageTextualNotationBuilder.BuildUsage(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule SatisfactionParameter - /// SatisfactionParameter:ReferenceUsage=ownedRelationship+=SatisfactionFeatureValue + /// SatisfactionParameter:ReferenceUsage=ownedRelationship+=SatisfactionFeatureValue /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildSatisfactionParameter(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildSatisfactionParameter(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelationship.Count) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + + if (ownedRelationshipCursor.Current != null) { - var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; - if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue elementAsFeatureValue) + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.FeatureValues.IFeatureValue elementAsFeatureValue) { - FeatureValueTextualNotationBuilder.BuildSatisfactionFeatureValue(elementAsFeatureValue, 0, stringBuilder); + FeatureValueTextualNotationBuilder.BuildSatisfactionFeatureValue(elementAsFeatureValue, cursorCache, stringBuilder); } } + ownedRelationshipCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule MetadataBodyUsage - /// MetadataBodyUsage:ReferenceUsage='ref'?(':>>'|'redefines')?ownedRelationship+=OwnedRedefinitionFeatureSpecializationPart?ValuePart?MetadataBody + /// MetadataBodyUsage:ReferenceUsage='ref'?(':>>'|'redefines')?ownedRelationship+=OwnedRedefinitionFeatureSpecializationPart?ValuePart?MetadataBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildMetadataBodyUsage(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) + public static void BuildMetadataBodyUsage(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfRedefinitionIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); stringBuilder.Append("ref "); stringBuilder.Append(" :>> "); - ownedRelationshipOfRedefinitionIterator.MoveNext(); - if (ownedRelationshipOfRedefinitionIterator.Current != null) + if (ownedRelationshipCursor.Current != null) + { + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IRedefinition elementAsRedefinition) + { + RedefinitionTextualNotationBuilder.BuildOwnedRedefinition(elementAsRedefinition, cursorCache, stringBuilder); + } + } + ownedRelationshipCursor.Move(); + + + if (poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || poco.IsOrdered) { - RedefinitionTextualNotationBuilder.BuildOwnedRedefinition(ownedRelationshipOfRedefinitionIterator.Current, stringBuilder); + FeatureTextualNotationBuilder.BuildFeatureSpecializationPart(poco, cursorCache, stringBuilder); } - FeatureTextualNotationBuilder.BuildFeatureSpecializationPart(poco, stringBuilder); - FeatureTextualNotationBuilder.BuildValuePart(poco, 0, stringBuilder); - TypeTextualNotationBuilder.BuildMetadataBody(poco, stringBuilder); + + if (poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || !string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.Direction.HasValue || poco.IsDerived || poco.IsAbstract || poco.IsConstant || poco.IsOrdered || poco.IsEnd || poco.importedMembership.Count != 0 || poco.IsComposite || poco.IsPortion || poco.IsVariable || poco.IsSufficient || poco.unioningType.Count != 0 || poco.intersectingType.Count != 0 || poco.differencingType.Count != 0 || poco.featuringType.Count != 0 || poco.ownedTypeFeaturing.Count != 0) + { + FeatureTextualNotationBuilder.BuildValuePart(poco, cursorCache, stringBuilder); + } + TypeTextualNotationBuilder.BuildMetadataBody(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule ReferenceUsage - /// ReferenceUsage=(EndUsagePrefix|RefPrefix)'ref'Usage + /// ReferenceUsage=(EndUsagePrefix|RefPrefix)'ref'Usage /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildReferenceUsage(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, StringBuilder stringBuilder) + public static void BuildReferenceUsage(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); + switch (poco) + { + case SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage pocoUsageRefPrefix when pocoUsageRefPrefix.IsDerived: + UsageTextualNotationBuilder.BuildRefPrefix(pocoUsageRefPrefix, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage pocoUsage: + UsageTextualNotationBuilder.BuildEndUsagePrefix(pocoUsage, cursorCache, stringBuilder); + break; + } + stringBuilder.Append(' '); stringBuilder.Append("ref "); - UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); + UsageTextualNotationBuilder.BuildUsage(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RelationshipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RelationshipTextualNotationBuilder.cs index e402e140..5f2b2d62 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RelationshipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RelationshipTextualNotationBuilder.cs @@ -24,7 +24,6 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; @@ -37,50 +36,51 @@ public static partial class RelationshipTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule RelationshipBody - /// RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' + /// RelationshipBody:Relationship=';'|'{'(ownedRelationship+=OwnedAnnotation)*'}' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// 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 index of the to process inside the collection - /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildRelationshipOwnedElement(SysML2.NET.Core.POCO.Root.Elements.IRelationship poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildRelationshipBody(SysML2.NET.Core.POCO.Root.Elements.IRelationship poco, ICursorCache cursorCache, StringBuilder stringBuilder) { + if (poco.OwnedRelationship.Count == 0) { - if (elementIndex < poco.OwnedRelatedElement.Count) - { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Root.Elements.IElement elementAsElement) - { - ElementTextualNotationBuilder.BuildOwnedRelatedElement(elementAsElement, stringBuilder); - } - } + stringBuilder.AppendLine(";"); } -else + else { - if (elementIndex < poco.OwnedRelationship.Count) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + stringBuilder.AppendLine("{"); + + while (ownedRelationshipCursor.Current != null) { - var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; - if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Root.Annotations.IAnnotation elementAsAnnotation) + if (ownedRelationshipCursor.Current != null) { - AnnotationTextualNotationBuilder.BuildOwnedAnnotation(elementAsAnnotation, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Annotations.IAnnotation elementAsAnnotation) + { + AnnotationTextualNotationBuilder.BuildOwnedAnnotation(elementAsAnnotation, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } + stringBuilder.AppendLine("}"); } - return elementIndex; + } + + /// + /// Builds the Textual Notation string for the rule RelationshipOwnedElement + /// RelationshipOwnedElement:Relationship=ownedRelatedElement+=OwnedRelatedElement|ownedRelationship+=OwnedAnnotation + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + public static void BuildRelationshipOwnedElement(SysML2.NET.Core.POCO.Root.Elements.IRelationship poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + BuildRelationshipOwnedElementHandCoded(poco, cursorCache, stringBuilder); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingDefinitionTextualNotationBuilder.cs index 50209fc8..adc81b9d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingDefinitionTextualNotationBuilder.cs @@ -36,16 +36,17 @@ public static partial class RenderingDefinitionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule RenderingDefinition - /// RenderingDefinition=OccurrenceDefinitionPrefix'rendering''def'Definition + /// RenderingDefinition=OccurrenceDefinitionPrefix'rendering''def'Definition /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildRenderingDefinition(SysML2.NET.Core.POCO.Systems.Views.IRenderingDefinition poco, StringBuilder stringBuilder) + public static void BuildRenderingDefinition(SysML2.NET.Core.POCO.Systems.Views.IRenderingDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("rendering "); stringBuilder.Append("def "); - DefinitionTextualNotationBuilder.BuildDefinition(poco, stringBuilder); + DefinitionTextualNotationBuilder.BuildDefinition(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingUsageTextualNotationBuilder.cs index 3dc595cd..518f1e91 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RenderingUsageTextualNotationBuilder.cs @@ -24,7 +24,6 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; @@ -37,29 +36,28 @@ public static partial class RenderingUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule ViewRenderingUsage - /// ViewRenderingUsage:RenderingUsage=ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?UsageBody|(UsageExtensionKeyword*'rendering'|UsageExtensionKeyword+)Usage + /// ViewRenderingUsage:RenderingUsage=ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?UsageBody|(UsageExtensionKeyword*'rendering'|UsageExtensionKeyword+)Usage /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildViewRenderingUsage(SysML2.NET.Core.POCO.Systems.Views.IRenderingUsage poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildViewRenderingUsage(SysML2.NET.Core.POCO.Systems.Views.IRenderingUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - return elementIndex; + BuildViewRenderingUsageHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule RenderingUsage - /// RenderingUsage=OccurrenceUsagePrefix'rendering'Usage + /// RenderingUsage=OccurrenceUsagePrefix'rendering'Usage /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildRenderingUsage(SysML2.NET.Core.POCO.Systems.Views.IRenderingUsage poco, StringBuilder stringBuilder) + public static void BuildRenderingUsage(SysML2.NET.Core.POCO.Systems.Views.IRenderingUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("rendering "); - UsageTextualNotationBuilder.BuildUsage(poco, stringBuilder); + UsageTextualNotationBuilder.BuildUsage(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.cs index 786063c3..2492bc04 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.cs @@ -36,33 +36,44 @@ public static partial class RequirementConstraintMembershipTextualNotationBuilde { /// /// Builds the Textual Notation string for the rule RequirementConstraintMember - /// RequirementConstraintMember:RequirementConstraintMembership=MemberPrefix?RequirementKindownedRelatedElement+=RequirementConstraintUsage + /// RequirementConstraintMember:RequirementConstraintMembership=MemberPrefix?RequirementKindownedRelatedElement+=RequirementConstraintUsage /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildRequirementConstraintMember(SysML2.NET.Core.POCO.Systems.Requirements.IRequirementConstraintMembership poco, StringBuilder stringBuilder) + public static void BuildRequirementConstraintMember(SysML2.NET.Core.POCO.Systems.Requirements.IRequirementConstraintMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfConstraintUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - BuildRequirementKind(poco, stringBuilder); - ownedRelatedElementOfConstraintUsageIterator.MoveNext(); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); - if (ownedRelatedElementOfConstraintUsageIterator.Current != null) + if (poco.Visibility != SysML2.NET.Core.Root.Namespaces.VisibilityKind.Public) { - ConstraintUsageTextualNotationBuilder.BuildRequirementConstraintUsage(ownedRelatedElementOfConstraintUsageIterator.Current, 0, stringBuilder); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); } + BuildRequirementKind(poco, cursorCache, stringBuilder); + + if (ownedRelatedElementCursor.Current != null) + { + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.Constraints.IConstraintUsage elementAsConstraintUsage) + { + ConstraintUsageTextualNotationBuilder.BuildRequirementConstraintUsage(elementAsConstraintUsage, cursorCache, stringBuilder); + } + } + ownedRelatedElementCursor.Move(); + } /// /// Builds the Textual Notation string for the rule RequirementKind - /// RequirementKind:RequirementConstraintMembership='assume'{kind='assumption'}|'require'{kind='requirement'} + /// RequirementKind:RequirementConstraintMembership='assume'{kind='assumption'}|'require'{kind='requirement'} /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildRequirementKind(SysML2.NET.Core.POCO.Systems.Requirements.IRequirementConstraintMembership poco, StringBuilder stringBuilder) + public static void BuildRequirementKind(SysML2.NET.Core.POCO.Systems.Requirements.IRequirementConstraintMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildRequirementKindHandCoded(poco, cursorCache, stringBuilder); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementDefinitionTextualNotationBuilder.cs index df6dc74d..39e22bcd 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementDefinitionTextualNotationBuilder.cs @@ -36,17 +36,18 @@ public static partial class RequirementDefinitionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule RequirementDefinition - /// RequirementDefinition=OccurrenceDefinitionPrefix'requirement''def'DefinitionDeclarationRequirementBody + /// RequirementDefinition=OccurrenceDefinitionPrefix'requirement''def'DefinitionDeclarationRequirementBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildRequirementDefinition(SysML2.NET.Core.POCO.Systems.Requirements.IRequirementDefinition poco, StringBuilder stringBuilder) + public static void BuildRequirementDefinition(SysML2.NET.Core.POCO.Systems.Requirements.IRequirementDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("requirement "); stringBuilder.Append("def "); - DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildRequirementBody(poco, stringBuilder); + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildRequirementBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementUsageTextualNotationBuilder.cs index 09ae173c..b4405bff 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementUsageTextualNotationBuilder.cs @@ -24,7 +24,6 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; @@ -37,48 +36,49 @@ public static partial class RequirementUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule ObjectiveRequirementUsage - /// ObjectiveRequirementUsage:RequirementUsage=UsageExtensionKeyword*ConstraintUsageDeclarationRequirementBody + /// ObjectiveRequirementUsage:RequirementUsage=UsageExtensionKeyword*ConstraintUsageDeclarationRequirementBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildObjectiveRequirementUsage(SysML2.NET.Core.POCO.Systems.Requirements.IRequirementUsage poco, StringBuilder stringBuilder) + public static void BuildObjectiveRequirementUsage(SysML2.NET.Core.POCO.Systems.Requirements.IRequirementUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - // Handle collection Non Terminal - for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + while (ownedRelationshipCursor.Current != null) { - ownedRelationshipIndex = UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, ownedRelationshipIndex, stringBuilder); + UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, cursorCache, stringBuilder); } - ConstraintUsageTextualNotationBuilder.BuildConstraintUsageDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildRequirementBody(poco, stringBuilder); + + ConstraintUsageTextualNotationBuilder.BuildConstraintUsageDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildRequirementBody(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule RequirementVerificationUsage - /// RequirementVerificationUsage:RequirementUsage=ownedRelationship+=OwnedReferenceSubsettingFeatureSpecialization*RequirementBody|(UsageExtensionKeyword*'requirement'|UsageExtensionKeyword+)ConstraintUsageDeclarationRequirementBody + /// RequirementVerificationUsage:RequirementUsage=ownedRelationship+=OwnedReferenceSubsettingFeatureSpecialization*RequirementBody|(UsageExtensionKeyword*'requirement'|UsageExtensionKeyword+)ConstraintUsageDeclarationRequirementBody /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildRequirementVerificationUsage(SysML2.NET.Core.POCO.Systems.Requirements.IRequirementUsage poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildRequirementVerificationUsage(SysML2.NET.Core.POCO.Systems.Requirements.IRequirementUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - return elementIndex; + BuildRequirementVerificationUsageHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule RequirementUsage - /// RequirementUsage=OccurrenceUsagePrefix'requirement'ConstraintUsageDeclarationRequirementBody + /// RequirementUsage=OccurrenceUsagePrefix'requirement'ConstraintUsageDeclarationRequirementBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildRequirementUsage(SysML2.NET.Core.POCO.Systems.Requirements.IRequirementUsage poco, StringBuilder stringBuilder) + public static void BuildRequirementUsage(SysML2.NET.Core.POCO.Systems.Requirements.IRequirementUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("requirement "); - ConstraintUsageTextualNotationBuilder.BuildConstraintUsageDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildRequirementBody(poco, stringBuilder); + ConstraintUsageTextualNotationBuilder.BuildConstraintUsageDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildRequirementBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementVerificationMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementVerificationMembershipTextualNotationBuilder.cs index f05e179d..24b94a20 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementVerificationMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementVerificationMembershipTextualNotationBuilder.cs @@ -36,22 +36,28 @@ public static partial class RequirementVerificationMembershipTextualNotationBuil { /// /// Builds the Textual Notation string for the rule RequirementVerificationMember - /// RequirementVerificationMember:RequirementVerificationMembership=MemberPrefix'verify'{kind='requirement'}ownedRelatedElement+=RequirementVerificationUsage + /// RequirementVerificationMember:RequirementVerificationMembership=MemberPrefix'verify'{kind='requirement'}ownedRelatedElement+=RequirementVerificationUsage /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildRequirementVerificationMember(SysML2.NET.Core.POCO.Systems.VerificationCases.IRequirementVerificationMembership poco, StringBuilder stringBuilder) + public static void BuildRequirementVerificationMember(SysML2.NET.Core.POCO.Systems.VerificationCases.IRequirementVerificationMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfRequirementUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("verify "); // NonParsing Assignment Element : kind = 'requirement' => Does not have to be process - ownedRelatedElementOfRequirementUsageIterator.MoveNext(); - if (ownedRelatedElementOfRequirementUsageIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - RequirementUsageTextualNotationBuilder.BuildRequirementVerificationUsage(ownedRelatedElementOfRequirementUsageIterator.Current, 0, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.Requirements.IRequirementUsage elementAsRequirementUsage) + { + RequirementUsageTextualNotationBuilder.BuildRequirementVerificationUsage(elementAsRequirementUsage, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ResultExpressionMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ResultExpressionMembershipTextualNotationBuilder.cs index aa2417e8..6538bc01 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ResultExpressionMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ResultExpressionMembershipTextualNotationBuilder.cs @@ -36,21 +36,31 @@ public static partial class ResultExpressionMembershipTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule ResultExpressionMember - /// ResultExpressionMember:ResultExpressionMembership=MemberPrefix?ownedRelatedElement+=OwnedExpression + /// ResultExpressionMember:ResultExpressionMembership=MemberPrefix?ownedRelatedElement+=OwnedExpression /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildResultExpressionMember(SysML2.NET.Core.POCO.Kernel.Functions.IResultExpressionMembership poco, StringBuilder stringBuilder) + public static void BuildResultExpressionMember(SysML2.NET.Core.POCO.Kernel.Functions.IResultExpressionMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - ownedRelatedElementOfExpressionIterator.MoveNext(); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); - if (ownedRelatedElementOfExpressionIterator.Current != null) + if (poco.Visibility != SysML2.NET.Core.Root.Namespaces.VisibilityKind.Public) { - ExpressionTextualNotationBuilder.BuildOwnedExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); } + if (ownedRelatedElementCursor.Current != null) + { + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Kernel.Functions.IExpression elementAsExpression) + { + ExpressionTextualNotationBuilder.BuildOwnedExpression(elementAsExpression, cursorCache, stringBuilder); + } + } + ownedRelatedElementCursor.Move(); + + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReturnParameterMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReturnParameterMembershipTextualNotationBuilder.cs index ba67efc3..7d5ae9db 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReturnParameterMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReturnParameterMembershipTextualNotationBuilder.cs @@ -24,7 +24,6 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; @@ -37,88 +36,106 @@ public static partial class ReturnParameterMembershipTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule ReturnParameterMember - /// ReturnParameterMember:ReturnParameterMembership=MemberPrefix?'return'ownedRelatedElement+=UsageElement + /// ReturnParameterMember:ReturnParameterMembership=MemberPrefix?'return'ownedRelatedElement+=UsageElement /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildReturnParameterMember(SysML2.NET.Core.POCO.Kernel.Functions.IReturnParameterMembership poco, StringBuilder stringBuilder) + public static void BuildReturnParameterMember(SysML2.NET.Core.POCO.Kernel.Functions.IReturnParameterMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (poco.Visibility != SysML2.NET.Core.Root.Namespaces.VisibilityKind.Public) + { + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); + } stringBuilder.Append("return "); - ownedRelatedElementOfUsageIterator.MoveNext(); - if (ownedRelatedElementOfUsageIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - UsageTextualNotationBuilder.BuildUsageElement(ownedRelatedElementOfUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage elementAsUsage) + { + UsageTextualNotationBuilder.BuildUsageElement(elementAsUsage, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } /// /// Builds the Textual Notation string for the rule ReturnFeatureMember - /// ReturnFeatureMember:ReturnParameterMembership=MemberPrefix'return'ownedRelatedElement+=FeatureElement + /// ReturnFeatureMember:ReturnParameterMembership=MemberPrefix'return'ownedRelatedElement+=FeatureElement /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildReturnFeatureMember(SysML2.NET.Core.POCO.Kernel.Functions.IReturnParameterMembership poco, StringBuilder stringBuilder) + public static void BuildReturnFeatureMember(SysML2.NET.Core.POCO.Kernel.Functions.IReturnParameterMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfFeatureIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("return "); - ownedRelatedElementOfFeatureIterator.MoveNext(); - if (ownedRelatedElementOfFeatureIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - FeatureTextualNotationBuilder.BuildFeatureElement(ownedRelatedElementOfFeatureIterator.Current, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Core.Features.IFeature elementAsFeature) + { + FeatureTextualNotationBuilder.BuildFeatureElement(elementAsFeature, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } /// /// Builds the Textual Notation string for the rule EmptyResultMember - /// EmptyResultMember:ReturnParameterMembership=ownedRelatedElement+=EmptyFeature + /// EmptyResultMember:ReturnParameterMembership=ownedRelatedElement+=EmptyFeature /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildEmptyResultMember(SysML2.NET.Core.POCO.Kernel.Functions.IReturnParameterMembership poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildEmptyResultMember(SysML2.NET.Core.POCO.Kernel.Functions.IReturnParameterMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelatedElement.Count) + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage elementAsReferenceUsage) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage elementAsReferenceUsage) { - ReferenceUsageTextualNotationBuilder.BuildEmptyFeature(elementAsReferenceUsage, stringBuilder); + ReferenceUsageTextualNotationBuilder.BuildEmptyFeature(elementAsReferenceUsage, cursorCache, stringBuilder); } } + ownedRelatedElementCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule ConstructorResultMember - /// ConstructorResultMember:ReturnParameterMembership=ownedRelatedElement+=ConstructorResult + /// ConstructorResultMember:ReturnParameterMembership=ownedRelatedElement+=ConstructorResult /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildConstructorResultMember(SysML2.NET.Core.POCO.Kernel.Functions.IReturnParameterMembership poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildConstructorResultMember(SysML2.NET.Core.POCO.Kernel.Functions.IReturnParameterMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelatedElement.Count) + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Core.Features.IFeature elementAsFeature) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Core.Features.IFeature elementAsFeature) { - FeatureTextualNotationBuilder.BuildConstructorResult(elementAsFeature, stringBuilder); + FeatureTextualNotationBuilder.BuildConstructorResult(elementAsFeature, cursorCache, stringBuilder); } } + ownedRelatedElementCursor.Move(); + - return elementIndex; } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.cs index 18847f9b..81bffbeb 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SatisfyRequirementUsageTextualNotationBuilder.cs @@ -36,36 +36,44 @@ 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 + /// SatisfyRequirementUsage=OccurrenceUsagePrefix'assert'(isNegated?='not')'satisfy'(ownedRelationship+=OwnedReferenceSubsettingFeatureSpecializationPart?|'requirement'UsageDeclaration)ValuePart?('by'ownedRelationship+=SatisfactionSubjectMember)?RequirementBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildSatisfyRequirementUsage(SysML2.NET.Core.POCO.Systems.Requirements.ISatisfyRequirementUsage poco, StringBuilder stringBuilder) + public static void BuildSatisfyRequirementUsage(SysML2.NET.Core.POCO.Systems.Requirements.ISatisfyRequirementUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfReferenceSubsettingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - using var ownedRelationshipOfSubjectMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("assert "); stringBuilder.Append(" not "); stringBuilder.Append(' '); stringBuilder.Append("satisfy "); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildSatisfyRequirementUsageHandCoded(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); - FeatureTextualNotationBuilder.BuildValuePart(poco, 0, stringBuilder); - if (ownedRelationshipOfSubjectMembershipIterator.MoveNext()) + if (poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || !string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.Direction.HasValue || poco.IsDerived || poco.IsAbstract || poco.IsConstant || poco.IsOrdered || poco.IsEnd || poco.importedMembership.Count != 0 || poco.IsComposite || poco.IsPortion || poco.IsVariable || poco.IsSufficient || poco.unioningType.Count != 0 || poco.intersectingType.Count != 0 || poco.differencingType.Count != 0 || poco.featuringType.Count != 0 || poco.ownedTypeFeaturing.Count != 0) + { + FeatureTextualNotationBuilder.BuildValuePart(poco, cursorCache, stringBuilder); + } + + if (ownedRelationshipCursor.Current != null) { stringBuilder.Append("by "); - if (ownedRelationshipOfSubjectMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - SubjectMembershipTextualNotationBuilder.BuildSatisfactionSubjectMember(ownedRelationshipOfSubjectMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Systems.Requirements.ISubjectMembership elementAsSubjectMembership) + { + SubjectMembershipTextualNotationBuilder.BuildSatisfactionSubjectMember(elementAsSubjectMembership, cursorCache, stringBuilder); + } } stringBuilder.Append(' '); } - TypeTextualNotationBuilder.BuildRequirementBody(poco, stringBuilder); + TypeTextualNotationBuilder.BuildRequirementBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SelectExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SelectExpressionTextualNotationBuilder.cs index c0276adc..fa9232d8 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SelectExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SelectExpressionTextualNotationBuilder.cs @@ -36,26 +36,37 @@ public static partial class SelectExpressionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule SelectExpression - /// SelectExpression=ownedRelationship+=PrimaryArgumentMember'.?'ownedRelationship+=BodyArgumentMember + /// SelectExpression=ownedRelationship+=PrimaryArgumentMember'.?'ownedRelationship+=BodyArgumentMember /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildSelectExpression(SysML2.NET.Core.POCO.Kernel.Expressions.ISelectExpression poco, StringBuilder stringBuilder) + public static void BuildSelectExpression(SysML2.NET.Core.POCO.Kernel.Expressions.ISelectExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfParameterMembershipIterator.MoveNext(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildPrimaryArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildPrimaryArgumentMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + stringBuilder.Append(".? "); - ownedRelationshipOfParameterMembershipIterator.MoveNext(); - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildBodyArgumentMember(ownedRelationshipOfParameterMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildBodyArgumentMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.cs index f2cb2315..88e5b66a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.cs @@ -24,7 +24,6 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; @@ -37,89 +36,108 @@ public static partial class SendActionUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule SendNode - /// SendNode:SendActionUsage=OccurrenceUsagePrefixActionUsageDeclaration?'send'(ownedRelationship+=NodeParameterMemberSenderReceiverPart?|ownedRelationship+=EmptyParameterMemberSenderReceiverPart)?ActionBody + /// SendNode:SendActionUsage=OccurrenceUsagePrefixActionUsageDeclaration?'send'(ownedRelationship+=NodeParameterMemberSenderReceiverPart?|ownedRelationship+=EmptyParameterMemberSenderReceiverPart)?ActionBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildSendNode(SysML2.NET.Core.POCO.Systems.Actions.ISendActionUsage poco, StringBuilder stringBuilder) + public static void BuildSendNode(SysML2.NET.Core.POCO.Systems.Actions.ISendActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); - ActionUsageTextualNotationBuilder.BuildActionUsageDeclaration(poco, stringBuilder); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, cursorCache, stringBuilder); + + if (!string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || poco.IsOrdered || poco.Direction.HasValue || poco.IsDerived || poco.IsAbstract || poco.IsVariation || poco.IsConstant || poco.IsEnd || poco.isReference || poco.IsIndividual || poco.PortionKind.HasValue || poco.importedMembership.Count != 0 || poco.IsComposite || poco.IsPortion || poco.IsVariable || poco.IsSufficient || poco.unioningType.Count != 0 || poco.intersectingType.Count != 0 || poco.differencingType.Count != 0 || poco.featuringType.Count != 0 || poco.ownedTypeFeaturing.Count != 0) + { + ActionUsageTextualNotationBuilder.BuildActionUsageDeclaration(poco, cursorCache, stringBuilder); + } stringBuilder.Append("send "); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); + BuildSendNodeHandCoded(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildActionBody(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule SendNodeDeclaration - /// SendNodeDeclaration:SendActionUsage=ActionNodeUsageDeclaration?'send'ownedRelationship+=NodeParameterMemberSenderReceiverPart? + /// SendNodeDeclaration:SendActionUsage=ActionNodeUsageDeclaration?'send'ownedRelationship+=NodeParameterMemberSenderReceiverPart? /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildSendNodeDeclaration(SysML2.NET.Core.POCO.Systems.Actions.ISendActionUsage poco, StringBuilder stringBuilder) + public static void BuildSendNodeDeclaration(SysML2.NET.Core.POCO.Systems.Actions.ISendActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ActionUsageTextualNotationBuilder.BuildActionNodeUsageDeclaration(poco, stringBuilder); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + + if (!string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || poco.IsOrdered) + { + ActionUsageTextualNotationBuilder.BuildActionNodeUsageDeclaration(poco, cursorCache, stringBuilder); + } stringBuilder.Append("send "); - ownedRelationshipOfParameterMembershipIterator.MoveNext(); - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) + { + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(elementAsParameterMembership, cursorCache, stringBuilder); + } + } + ownedRelationshipCursor.Move(); + + + if (poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || !string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.Direction.HasValue || poco.IsDerived || poco.IsAbstract || poco.IsVariation || poco.IsConstant || poco.IsOrdered || poco.IsEnd || poco.isReference || poco.IsIndividual || poco.PortionKind.HasValue || poco.importedMembership.Count != 0 || poco.IsComposite || poco.IsPortion || poco.IsVariable || poco.IsSufficient || poco.unioningType.Count != 0 || poco.intersectingType.Count != 0 || poco.differencingType.Count != 0 || poco.featuringType.Count != 0 || poco.ownedTypeFeaturing.Count != 0) { - ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); + BuildSenderReceiverPart(poco, cursorCache, stringBuilder); } - BuildSenderReceiverPart(poco, 0, stringBuilder); } /// /// Builds the Textual Notation string for the rule SenderReceiverPart - /// SenderReceiverPart:SendActionUsage='via'ownedRelationship+=NodeParameterMember('to'ownedRelationship+=NodeParameterMember)?|ownedRelationship+=EmptyParameterMember'to'ownedRelationship+=NodeParameterMember + /// SenderReceiverPart:SendActionUsage='via'ownedRelationship+=NodeParameterMember('to'ownedRelationship+=NodeParameterMember)?|ownedRelationship+=EmptyParameterMember'to'ownedRelationship+=NodeParameterMember /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildSenderReceiverPart(SysML2.NET.Core.POCO.Systems.Actions.ISendActionUsage poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildSenderReceiverPart(SysML2.NET.Core.POCO.Systems.Actions.ISendActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - return elementIndex; + BuildSenderReceiverPartHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule StateSendActionUsage - /// StateSendActionUsage:SendActionUsage=SendNodeDeclarationActionBody + /// StateSendActionUsage:SendActionUsage=SendNodeDeclarationActionBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildStateSendActionUsage(SysML2.NET.Core.POCO.Systems.Actions.ISendActionUsage poco, StringBuilder stringBuilder) + public static void BuildStateSendActionUsage(SysML2.NET.Core.POCO.Systems.Actions.ISendActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildSendNodeDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); + BuildSendNodeDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildActionBody(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule TransitionSendActionUsage - /// TransitionSendActionUsage:SendActionUsage=SendNodeDeclaration('{'ActionBodyItem*'}')? + /// TransitionSendActionUsage:SendActionUsage=SendNodeDeclaration('{'ActionBodyItem*'}')? /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildTransitionSendActionUsage(SysML2.NET.Core.POCO.Systems.Actions.ISendActionUsage poco, StringBuilder stringBuilder) + public static void BuildTransitionSendActionUsage(SysML2.NET.Core.POCO.Systems.Actions.ISendActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildSendNodeDeclaration(poco, stringBuilder); + BuildSendNodeDeclaration(poco, cursorCache, stringBuilder); - if (BuildGroupConditionForTransitionSendActionUsage(poco)) + if (poco.OwnedRelationship.Count != 0 || poco.importedMembership.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || !string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.Direction.HasValue || poco.IsDerived || poco.IsAbstract || poco.IsVariation || poco.IsConstant || poco.IsOrdered || poco.IsEnd || poco.isReference || poco.IsIndividual || poco.PortionKind.HasValue || poco.IsComposite || poco.IsPortion || poco.IsVariable || poco.IsSufficient || poco.unioningType.Count != 0 || poco.intersectingType.Count != 0 || poco.differencingType.Count != 0 || poco.featuringType.Count != 0 || poco.ownedTypeFeaturing.Count != 0) { - stringBuilder.Append("{"); - // Handle collection Non Terminal - for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + stringBuilder.AppendLine("{"); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + while (ownedRelationshipCursor.Current != null) { - ownedRelationshipIndex = TypeTextualNotationBuilder.BuildActionBodyItem(poco, ownedRelationshipIndex, stringBuilder); + TypeTextualNotationBuilder.BuildActionBodyItem(poco, cursorCache, stringBuilder); } - stringBuilder.Append("}"); - stringBuilder.Append(' '); + + stringBuilder.AppendLine("}"); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.cs index 06481f54..d49aed34 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.cs @@ -24,7 +24,6 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; @@ -37,65 +36,63 @@ public static partial class SpecializationTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule OwnedSpecialization - /// OwnedSpecialization:Specialization=GeneralType + /// OwnedSpecialization:Specialization=GeneralType /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildOwnedSpecialization(SysML2.NET.Core.POCO.Core.Types.ISpecialization poco, StringBuilder stringBuilder) + public static void BuildOwnedSpecialization(SysML2.NET.Core.POCO.Core.Types.ISpecialization poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildGeneralType(poco, 0, stringBuilder); + BuildGeneralType(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule SpecificType - /// SpecificType:Specialization=specific=[QualifiedName]|specific+=OwnedFeatureChain{ownedRelatedElement+=specific} + /// SpecificType:Specialization=specific=[QualifiedName]|specific+=OwnedFeatureChain{ownedRelatedElement+=specific} /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildSpecificType(SysML2.NET.Core.POCO.Core.Types.ISpecialization poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildSpecificType(SysML2.NET.Core.POCO.Core.Types.ISpecialization poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - return elementIndex; + BuildSpecificTypeHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule GeneralType - /// GeneralType:Specialization=general=[QualifiedName]|general+=OwnedFeatureChain{ownedRelatedElement+=general} + /// GeneralType:Specialization=general=[QualifiedName]|general+=OwnedFeatureChain{ownedRelatedElement+=general} /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildGeneralType(SysML2.NET.Core.POCO.Core.Types.ISpecialization poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildGeneralType(SysML2.NET.Core.POCO.Core.Types.ISpecialization poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - return elementIndex; + BuildGeneralTypeHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule Specialization - /// Specialization=('specialization'Identification)?'subtype'SpecificTypeSPECIALIZESGeneralTypeRelationshipBody + /// Specialization=('specialization'Identification)?'subtype'SpecificTypeSPECIALIZESGeneralTypeRelationshipBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildSpecialization(SysML2.NET.Core.POCO.Core.Types.ISpecialization poco, StringBuilder stringBuilder) + public static void BuildSpecialization(SysML2.NET.Core.POCO.Core.Types.ISpecialization poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (BuildGroupConditionForSpecialization(poco)) + if (!string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName)) { stringBuilder.Append("specialization "); - ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + ElementTextualNotationBuilder.BuildIdentification(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); } stringBuilder.Append("subtype "); - BuildSpecificType(poco, 0, stringBuilder); + BuildSpecificType(poco, cursorCache, stringBuilder); stringBuilder.Append(" :> "); - BuildGeneralType(poco, 0, stringBuilder); - RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); + BuildGeneralType(poco, cursorCache, stringBuilder); + RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StakeholderMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StakeholderMembershipTextualNotationBuilder.cs index 93c35b22..60bc3e9c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StakeholderMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StakeholderMembershipTextualNotationBuilder.cs @@ -36,20 +36,26 @@ public static partial class StakeholderMembershipTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule StakeholderMember - /// StakeholderMember:StakeholderMembership=MemberPrefixownedRelatedElement+=StakeholderUsage + /// StakeholderMember:StakeholderMembership=MemberPrefixownedRelatedElement+=StakeholderUsage /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildStakeholderMember(SysML2.NET.Core.POCO.Systems.Requirements.IStakeholderMembership poco, StringBuilder stringBuilder) + public static void BuildStakeholderMember(SysML2.NET.Core.POCO.Systems.Requirements.IStakeholderMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfPartUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - ownedRelatedElementOfPartUsageIterator.MoveNext(); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); - if (ownedRelatedElementOfPartUsageIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - PartUsageTextualNotationBuilder.BuildStakeholderUsage(ownedRelatedElementOfPartUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.Parts.IPartUsage elementAsPartUsage) + { + PartUsageTextualNotationBuilder.BuildStakeholderUsage(elementAsPartUsage, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateDefinitionTextualNotationBuilder.cs index ed74d6cf..9a0e71e7 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateDefinitionTextualNotationBuilder.cs @@ -36,28 +36,30 @@ public static partial class StateDefinitionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule StateDefBody - /// StateDefBody:StateDefinition=';'|(isParallel?='parallel')?'{'StateBodyItem*'}' + /// StateDefBody:StateDefinition=';'|(isParallel?='parallel')?'{'StateBodyItem*'}' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildStateDefBody(SysML2.NET.Core.POCO.Systems.States.IStateDefinition poco, StringBuilder stringBuilder) + public static void BuildStateDefBody(SysML2.NET.Core.POCO.Systems.States.IStateDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildStateDefBodyHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule StateDefinition - /// StateDefinition=OccurrenceDefinitionPrefix'state''def'DefinitionDeclarationStateDefBody + /// StateDefinition=OccurrenceDefinitionPrefix'state''def'DefinitionDeclarationStateDefBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildStateDefinition(SysML2.NET.Core.POCO.Systems.States.IStateDefinition poco, StringBuilder stringBuilder) + public static void BuildStateDefinition(SysML2.NET.Core.POCO.Systems.States.IStateDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("state "); stringBuilder.Append("def "); - DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); - BuildStateDefBody(poco, stringBuilder); + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, cursorCache, stringBuilder); + BuildStateDefBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateSubactionMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateSubactionMembershipTextualNotationBuilder.cs index 9f7ea384..9a556d49 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateSubactionMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateSubactionMembershipTextualNotationBuilder.cs @@ -36,61 +36,79 @@ public static partial class StateSubactionMembershipTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule EntryActionMember - /// EntryActionMember:StateSubactionMembership=MemberPrefixkind='entry'ownedRelatedElement+=StateActionUsage + /// EntryActionMember:StateSubactionMembership=MemberPrefixkind='entry'ownedRelatedElement+=StateActionUsage /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildEntryActionMember(SysML2.NET.Core.POCO.Systems.States.IStateSubactionMembership poco, StringBuilder stringBuilder) + public static void BuildEntryActionMember(SysML2.NET.Core.POCO.Systems.States.IStateSubactionMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfActionUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); stringBuilder.Append(poco.Kind.ToString().ToLower()); - ownedRelatedElementOfActionUsageIterator.MoveNext(); - if (ownedRelatedElementOfActionUsageIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - ActionUsageTextualNotationBuilder.BuildStateActionUsage(ownedRelatedElementOfActionUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.Actions.IActionUsage elementAsActionUsage) + { + ActionUsageTextualNotationBuilder.BuildStateActionUsage(elementAsActionUsage, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } /// /// Builds the Textual Notation string for the rule DoActionMember - /// DoActionMember:StateSubactionMembership=MemberPrefixkind='do'ownedRelatedElement+=StateActionUsage + /// DoActionMember:StateSubactionMembership=MemberPrefixkind='do'ownedRelatedElement+=StateActionUsage /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildDoActionMember(SysML2.NET.Core.POCO.Systems.States.IStateSubactionMembership poco, StringBuilder stringBuilder) + public static void BuildDoActionMember(SysML2.NET.Core.POCO.Systems.States.IStateSubactionMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfActionUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); stringBuilder.Append(poco.Kind.ToString().ToLower()); - ownedRelatedElementOfActionUsageIterator.MoveNext(); - if (ownedRelatedElementOfActionUsageIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - ActionUsageTextualNotationBuilder.BuildStateActionUsage(ownedRelatedElementOfActionUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.Actions.IActionUsage elementAsActionUsage) + { + ActionUsageTextualNotationBuilder.BuildStateActionUsage(elementAsActionUsage, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } /// /// Builds the Textual Notation string for the rule ExitActionMember - /// ExitActionMember:StateSubactionMembership=MemberPrefixkind='exit'ownedRelatedElement+=StateActionUsage + /// ExitActionMember:StateSubactionMembership=MemberPrefixkind='exit'ownedRelatedElement+=StateActionUsage /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildExitActionMember(SysML2.NET.Core.POCO.Systems.States.IStateSubactionMembership poco, StringBuilder stringBuilder) + public static void BuildExitActionMember(SysML2.NET.Core.POCO.Systems.States.IStateSubactionMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfActionUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); stringBuilder.Append(poco.Kind.ToString().ToLower()); - ownedRelatedElementOfActionUsageIterator.MoveNext(); - if (ownedRelatedElementOfActionUsageIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - ActionUsageTextualNotationBuilder.BuildStateActionUsage(ownedRelatedElementOfActionUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.Actions.IActionUsage elementAsActionUsage) + { + ActionUsageTextualNotationBuilder.BuildStateActionUsage(elementAsActionUsage, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateUsageTextualNotationBuilder.cs index 3515d42c..4ccb63b1 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateUsageTextualNotationBuilder.cs @@ -36,27 +36,29 @@ public static partial class StateUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule StateUsageBody - /// StateUsageBody:StateUsage=';'|(isParallel?='parallel')?'{'StateBodyItem*'}' + /// StateUsageBody:StateUsage=';'|(isParallel?='parallel')?'{'StateBodyItem*'}' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildStateUsageBody(SysML2.NET.Core.POCO.Systems.States.IStateUsage poco, StringBuilder stringBuilder) + public static void BuildStateUsageBody(SysML2.NET.Core.POCO.Systems.States.IStateUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildStateUsageBodyHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule StateUsage - /// StateUsage=OccurrenceUsagePrefix'state'ActionUsageDeclarationStateUsageBody + /// StateUsage=OccurrenceUsagePrefix'state'ActionUsageDeclarationStateUsageBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildStateUsage(SysML2.NET.Core.POCO.Systems.States.IStateUsage poco, StringBuilder stringBuilder) + public static void BuildStateUsage(SysML2.NET.Core.POCO.Systems.States.IStateUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("state "); - ActionUsageTextualNotationBuilder.BuildActionUsageDeclaration(poco, stringBuilder); - BuildStateUsageBody(poco, stringBuilder); + ActionUsageTextualNotationBuilder.BuildActionUsageDeclaration(poco, cursorCache, stringBuilder); + BuildStateUsageBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StepTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StepTextualNotationBuilder.cs index 35d18497..747963d4 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StepTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StepTextualNotationBuilder.cs @@ -36,30 +36,40 @@ public static partial class StepTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule Step - /// Step=FeaturePrefix'step'FeatureDeclarationValuePart?TypeBody + /// Step=FeaturePrefix'step'FeatureDeclarationValuePart?TypeBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildStep(SysML2.NET.Core.POCO.Kernel.Behaviors.IStep poco, StringBuilder stringBuilder) + public static void BuildStep(SysML2.NET.Core.POCO.Kernel.Behaviors.IStep poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + BuildFeaturePrefixHandCoded(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); - while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + while (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfOwningMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(elementAsOwningMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); } stringBuilder.Append("step "); - FeatureTextualNotationBuilder.BuildFeatureDeclaration(poco, stringBuilder); - FeatureTextualNotationBuilder.BuildValuePart(poco, 0, stringBuilder); - TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); + FeatureTextualNotationBuilder.BuildFeatureDeclaration(poco, cursorCache, stringBuilder); + + if (poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || !string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.Direction.HasValue || poco.IsDerived || poco.IsAbstract || poco.IsConstant || poco.IsOrdered || poco.IsEnd || poco.importedMembership.Count != 0 || poco.IsComposite || poco.IsPortion || poco.IsVariable || poco.IsSufficient || poco.unioningType.Count != 0 || poco.intersectingType.Count != 0 || poco.differencingType.Count != 0 || poco.featuringType.Count != 0 || poco.ownedTypeFeaturing.Count != 0) + { + FeatureTextualNotationBuilder.BuildValuePart(poco, cursorCache, stringBuilder); + } + TypeTextualNotationBuilder.BuildTypeBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StructureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StructureTextualNotationBuilder.cs index cf7cd214..97caa43e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StructureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StructureTextualNotationBuilder.cs @@ -36,16 +36,17 @@ public static partial class StructureTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule Structure - /// Structure=TypePrefix'struct'ClassifierDeclarationTypeBody + /// Structure=TypePrefix'struct'ClassifierDeclarationTypeBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildStructure(SysML2.NET.Core.POCO.Kernel.Structures.IStructure poco, StringBuilder stringBuilder) + public static void BuildStructure(SysML2.NET.Core.POCO.Kernel.Structures.IStructure poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - TypeTextualNotationBuilder.BuildTypePrefix(poco, stringBuilder); + TypeTextualNotationBuilder.BuildTypePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("struct "); - ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); + ClassifierTextualNotationBuilder.BuildClassifierDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildTypeBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.cs index f6dca58b..3f740536 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubclassificationTextualNotationBuilder.cs @@ -36,11 +36,12 @@ public static partial class SubclassificationTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule OwnedSubclassification - /// OwnedSubclassification:Subclassification=superClassifier=[QualifiedName] + /// OwnedSubclassification:Subclassification=superClassifier=[QualifiedName] /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildOwnedSubclassification(SysML2.NET.Core.POCO.Core.Classifiers.ISubclassification poco, StringBuilder stringBuilder) + public static void BuildOwnedSubclassification(SysML2.NET.Core.POCO.Core.Classifiers.ISubclassification poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.Superclassifier != null) @@ -53,17 +54,18 @@ public static void BuildOwnedSubclassification(SysML2.NET.Core.POCO.Core.Classif /// /// Builds the Textual Notation string for the rule Subclassification - /// Subclassification=('specialization'Identification)?'subclassifier'subclassifier=[QualifiedName]SPECIALIZESsuperclassifier=[QualifiedName]RelationshipBody + /// Subclassification=('specialization'Identification)?'subclassifier'subclassifier=[QualifiedName]SPECIALIZESsuperclassifier=[QualifiedName]RelationshipBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildSubclassification(SysML2.NET.Core.POCO.Core.Classifiers.ISubclassification poco, StringBuilder stringBuilder) + public static void BuildSubclassification(SysML2.NET.Core.POCO.Core.Classifiers.ISubclassification poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (BuildGroupConditionForSubclassification(poco)) + if (!string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName)) { stringBuilder.Append("specialization "); - ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + ElementTextualNotationBuilder.BuildIdentification(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); } @@ -81,7 +83,7 @@ public static void BuildSubclassification(SysML2.NET.Core.POCO.Core.Classifiers. stringBuilder.Append(poco.Superclassifier.qualifiedName); stringBuilder.Append(' '); } - RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); + RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubjectMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubjectMembershipTextualNotationBuilder.cs index d2c0415d..4a14fc5d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubjectMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubjectMembershipTextualNotationBuilder.cs @@ -24,7 +24,6 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; @@ -37,44 +36,51 @@ public static partial class SubjectMembershipTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule SubjectMember - /// SubjectMember:SubjectMembership=MemberPrefixownedRelatedElement+=SubjectUsage + /// SubjectMember:SubjectMembership=MemberPrefixownedRelatedElement+=SubjectUsage /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildSubjectMember(SysML2.NET.Core.POCO.Systems.Requirements.ISubjectMembership poco, StringBuilder stringBuilder) + public static void BuildSubjectMember(SysML2.NET.Core.POCO.Systems.Requirements.ISubjectMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfReferenceUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - ownedRelatedElementOfReferenceUsageIterator.MoveNext(); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); - if (ownedRelatedElementOfReferenceUsageIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - ReferenceUsageTextualNotationBuilder.BuildSubjectUsage(ownedRelatedElementOfReferenceUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage elementAsReferenceUsage) + { + ReferenceUsageTextualNotationBuilder.BuildSubjectUsage(elementAsReferenceUsage, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } /// /// Builds the Textual Notation string for the rule SatisfactionSubjectMember - /// SatisfactionSubjectMember:SubjectMembership=ownedRelatedElement+=SatisfactionParameter + /// SatisfactionSubjectMember:SubjectMembership=ownedRelatedElement+=SatisfactionParameter /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildSatisfactionSubjectMember(SysML2.NET.Core.POCO.Systems.Requirements.ISubjectMembership poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildSatisfactionSubjectMember(SysML2.NET.Core.POCO.Systems.Requirements.ISubjectMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelatedElement.Count) + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage elementAsReferenceUsage) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage elementAsReferenceUsage) { - ReferenceUsageTextualNotationBuilder.BuildSatisfactionParameter(elementAsReferenceUsage, 0, stringBuilder); + ReferenceUsageTextualNotationBuilder.BuildSatisfactionParameter(elementAsReferenceUsage, cursorCache, stringBuilder); } } + ownedRelatedElementCursor.Move(); + - return elementIndex; } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.cs index 7d3d4c8d..c46a5f1a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.cs @@ -36,36 +36,38 @@ public static partial class SubsettingTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule OwnedSubsetting - /// OwnedSubsetting:Subsetting=subsettedFeature=[QualifiedName]|subsettedFeature=OwnedFeatureChain{ownedRelatedElement+=subsettedFeature} + /// OwnedSubsetting:Subsetting=subsettedFeature=[QualifiedName]|subsettedFeature=OwnedFeatureChain{ownedRelatedElement+=subsettedFeature} /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildOwnedSubsetting(SysML2.NET.Core.POCO.Core.Features.ISubsetting poco, StringBuilder stringBuilder) + public static void BuildOwnedSubsetting(SysML2.NET.Core.POCO.Core.Features.ISubsetting poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildOwnedSubsettingHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule Subsetting - /// Subsetting=('specialization'Identification)?'subset'SpecificTypeSUBSETSGeneralTypeRelationshipBody + /// Subsetting=('specialization'Identification)?'subset'SpecificTypeSUBSETSGeneralTypeRelationshipBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildSubsetting(SysML2.NET.Core.POCO.Core.Features.ISubsetting poco, StringBuilder stringBuilder) + public static void BuildSubsetting(SysML2.NET.Core.POCO.Core.Features.ISubsetting poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (BuildGroupConditionForSubsetting(poco)) + if (!string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName)) { stringBuilder.Append("specialization "); - ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + ElementTextualNotationBuilder.BuildIdentification(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); } stringBuilder.Append("subset "); - SpecializationTextualNotationBuilder.BuildSpecificType(poco, 0, stringBuilder); + SpecializationTextualNotationBuilder.BuildSpecificType(poco, cursorCache, stringBuilder); stringBuilder.Append(" :> "); - SpecializationTextualNotationBuilder.BuildGeneralType(poco, 0, stringBuilder); - RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); + SpecializationTextualNotationBuilder.BuildGeneralType(poco, cursorCache, stringBuilder); + RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionAsUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionAsUsageTextualNotationBuilder.cs index c24ffba1..fe2c42c5 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionAsUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionAsUsageTextualNotationBuilder.cs @@ -24,7 +24,6 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; @@ -37,85 +36,108 @@ public static partial class SuccessionAsUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule SourceSuccession - /// SourceSuccession:SuccessionAsUsage=ownedRelationship+=SourceEndMember + /// SourceSuccession:SuccessionAsUsage=ownedRelationship+=SourceEndMember /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildSourceSuccession(SysML2.NET.Core.POCO.Systems.Connections.ISuccessionAsUsage poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildSourceSuccession(SysML2.NET.Core.POCO.Systems.Connections.ISuccessionAsUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelationship.Count) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + + if (ownedRelationshipCursor.Current != null) { - var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; - if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership elementAsEndFeatureMembership) + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership elementAsEndFeatureMembership) { - EndFeatureMembershipTextualNotationBuilder.BuildSourceEndMember(elementAsEndFeatureMembership, 0, stringBuilder); + EndFeatureMembershipTextualNotationBuilder.BuildSourceEndMember(elementAsEndFeatureMembership, cursorCache, stringBuilder); } } + ownedRelationshipCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule TargetSuccession - /// TargetSuccession:SuccessionAsUsage=ownedRelationship+=SourceEndMember'then'ownedRelationship+=ConnectorEndMember + /// TargetSuccession:SuccessionAsUsage=ownedRelationship+=SourceEndMember'then'ownedRelationship+=ConnectorEndMember /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildTargetSuccession(SysML2.NET.Core.POCO.Systems.Connections.ISuccessionAsUsage poco, StringBuilder stringBuilder) + public static void BuildTargetSuccession(SysML2.NET.Core.POCO.Systems.Connections.ISuccessionAsUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfEndFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildSourceEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership elementAsEndFeatureMembership) + { + EndFeatureMembershipTextualNotationBuilder.BuildSourceEndMember(elementAsEndFeatureMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + stringBuilder.Append("then "); - ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); - if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership elementAsEndFeatureMembership) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(elementAsEndFeatureMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } /// /// Builds the Textual Notation string for the rule SuccessionAsUsage - /// SuccessionAsUsage=UsagePrefix('succession'UsageDeclaration)?'first's.ownedRelationship+=ConnectorEndMember'then's.ownedRelationship+=ConnectorEndMemberUsageBody + /// SuccessionAsUsage=UsagePrefix('succession'UsageDeclaration)?'first's.ownedRelationship+=ConnectorEndMember'then's.ownedRelationship+=ConnectorEndMemberUsageBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildSuccessionAsUsage(SysML2.NET.Core.POCO.Systems.Connections.ISuccessionAsUsage poco, StringBuilder stringBuilder) + public static void BuildSuccessionAsUsage(SysML2.NET.Core.POCO.Systems.Connections.ISuccessionAsUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfEndFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - UsageTextualNotationBuilder.BuildUsagePrefix(poco, stringBuilder); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + UsageTextualNotationBuilder.BuildUsagePrefix(poco, cursorCache, stringBuilder); - if (BuildGroupConditionForSuccessionAsUsage(poco)) + if (!string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || poco.OwnedRelatedElement.Count != 0 || poco.IsOrdered) { stringBuilder.Append("succession "); - UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); } stringBuilder.Append("first "); - ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); - if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership elementAsEndFeatureMembership) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(elementAsEndFeatureMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + stringBuilder.Append("then "); - ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); - if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership elementAsEndFeatureMembership) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(elementAsEndFeatureMembership, cursorCache, stringBuilder); + } } - UsageTextualNotationBuilder.BuildUsageBody(poco, stringBuilder); + ownedRelationshipCursor.Move(); + + UsageTextualNotationBuilder.BuildUsageBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowTextualNotationBuilder.cs index 31051b1d..e4ea55f9 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowTextualNotationBuilder.cs @@ -36,30 +36,36 @@ public static partial class SuccessionFlowTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule SuccessionFlow - /// SuccessionFlow=FeaturePrefix'succession''flow'FlowDeclarationTypeBody + /// SuccessionFlow=FeaturePrefix'succession''flow'FlowDeclarationTypeBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildSuccessionFlow(SysML2.NET.Core.POCO.Kernel.Interactions.ISuccessionFlow poco, StringBuilder stringBuilder) + public static void BuildSuccessionFlow(SysML2.NET.Core.POCO.Kernel.Interactions.ISuccessionFlow poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + BuildFeaturePrefixHandCoded(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); - while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + while (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfOwningMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(elementAsOwningMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); } stringBuilder.Append("succession "); stringBuilder.Append("flow "); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); + BuildFlowDeclarationHandCoded(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildTypeBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowUsageTextualNotationBuilder.cs index f7dd5718..1a7036f2 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionFlowUsageTextualNotationBuilder.cs @@ -36,17 +36,18 @@ public static partial class SuccessionFlowUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule SuccessionFlowUsage - /// SuccessionFlowUsage=OccurrenceUsagePrefix'succession''flow'FlowDeclarationDefinitionBody + /// SuccessionFlowUsage=OccurrenceUsagePrefix'succession''flow'FlowDeclarationDefinitionBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildSuccessionFlowUsage(SysML2.NET.Core.POCO.Systems.Flows.ISuccessionFlowUsage poco, StringBuilder stringBuilder) + public static void BuildSuccessionFlowUsage(SysML2.NET.Core.POCO.Systems.Flows.ISuccessionFlowUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("succession "); stringBuilder.Append("flow "); - FlowUsageTextualNotationBuilder.BuildFlowDeclaration(poco, 0, stringBuilder); - TypeTextualNotationBuilder.BuildDefinitionBody(poco, stringBuilder); + FlowUsageTextualNotationBuilder.BuildFlowDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildDefinitionBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionTextualNotationBuilder.cs index 0328df9f..8db6bad4 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SuccessionTextualNotationBuilder.cs @@ -36,64 +36,82 @@ public static partial class SuccessionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule TransitionSuccession - /// TransitionSuccession:Succession=ownedRelationship+=EmptyEndMemberownedRelationship+=ConnectorEndMember + /// TransitionSuccession:Succession=ownedRelationship+=EmptyEndMemberownedRelationship+=ConnectorEndMember /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildTransitionSuccession(SysML2.NET.Core.POCO.Kernel.Connectors.ISuccession poco, StringBuilder stringBuilder) + public static void BuildTransitionSuccession(SysML2.NET.Core.POCO.Kernel.Connectors.ISuccession poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfEndFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildEmptyEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership elementAsEndFeatureMembership) + { + EndFeatureMembershipTextualNotationBuilder.BuildEmptyEndMember(elementAsEndFeatureMembership, cursorCache, stringBuilder); + } } - ownedRelationshipOfEndFeatureMembershipIterator.MoveNext(); + ownedRelationshipCursor.Move(); - if (ownedRelationshipOfEndFeatureMembershipIterator.Current != null) + + if (ownedRelationshipCursor.Current != null) { - EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(ownedRelationshipOfEndFeatureMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Features.IEndFeatureMembership elementAsEndFeatureMembership) + { + EndFeatureMembershipTextualNotationBuilder.BuildConnectorEndMember(elementAsEndFeatureMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } /// /// 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)? + /// 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 used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildSuccessionDeclaration(SysML2.NET.Core.POCO.Kernel.Connectors.ISuccession poco, StringBuilder stringBuilder) + public static void BuildSuccessionDeclaration(SysML2.NET.Core.POCO.Kernel.Connectors.ISuccession poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildSuccessionDeclarationHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule Succession - /// Succession=FeaturePrefix'succession'SuccessionDeclarationTypeBody + /// Succession=FeaturePrefix'succession'SuccessionDeclarationTypeBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildSuccession(SysML2.NET.Core.POCO.Kernel.Connectors.ISuccession poco, StringBuilder stringBuilder) + public static void BuildSuccession(SysML2.NET.Core.POCO.Kernel.Connectors.ISuccession poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + BuildFeaturePrefixHandCoded(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); - while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + while (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfOwningMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(elementAsOwningMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); } stringBuilder.Append("succession "); - BuildSuccessionDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildTypeBody(poco, stringBuilder); + BuildSuccessionDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildTypeBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TerminateActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TerminateActionUsageTextualNotationBuilder.cs index 07427c55..a0419286 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TerminateActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TerminateActionUsageTextualNotationBuilder.cs @@ -36,28 +36,37 @@ public static partial class TerminateActionUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule TerminateNode - /// TerminateNode:TerminateActionUsage=OccurrenceUsagePrefixActionNodeUsageDeclaration?'terminate'(ownedRelationship+=NodeParameterMember)?ActionBody + /// TerminateNode:TerminateActionUsage=OccurrenceUsagePrefixActionNodeUsageDeclaration?'terminate'(ownedRelationship+=NodeParameterMember)?ActionBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildTerminateNode(SysML2.NET.Core.POCO.Systems.Actions.ITerminateActionUsage poco, StringBuilder stringBuilder) + public static void BuildTerminateNode(SysML2.NET.Core.POCO.Systems.Actions.ITerminateActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); - ActionUsageTextualNotationBuilder.BuildActionNodeUsageDeclaration(poco, stringBuilder); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, cursorCache, stringBuilder); + + if (!string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || poco.IsOrdered) + { + ActionUsageTextualNotationBuilder.BuildActionNodeUsageDeclaration(poco, cursorCache, stringBuilder); + } stringBuilder.Append("terminate "); - if (ownedRelationshipOfParameterMembershipIterator.MoveNext()) + if (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildNodeParameterMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } stringBuilder.Append(' '); } - TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); + TypeTextualNotationBuilder.BuildActionBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TextualRepresentationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TextualRepresentationTextualNotationBuilder.cs index e2fc7c20..84fa8bbf 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TextualRepresentationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TextualRepresentationTextualNotationBuilder.cs @@ -36,17 +36,18 @@ public static partial class TextualRepresentationTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule TextualRepresentation - /// TextualRepresentation=('rep'Identification)?'language'language=STRING_VALUEbody=REGULAR_COMMENT + /// TextualRepresentation=('rep'Identification)?'language'language=STRING_VALUEbody=REGULAR_COMMENT /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildTextualRepresentation(SysML2.NET.Core.POCO.Root.Annotations.ITextualRepresentation poco, StringBuilder stringBuilder) + public static void BuildTextualRepresentation(SysML2.NET.Core.POCO.Root.Annotations.ITextualRepresentation poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (BuildGroupConditionForTextualRepresentation(poco)) + if (!string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName)) { stringBuilder.Append("rep "); - ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + ElementTextualNotationBuilder.BuildIdentification(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionFeatureMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionFeatureMembershipTextualNotationBuilder.cs index 554f93de..3541786a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionFeatureMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionFeatureMembershipTextualNotationBuilder.cs @@ -36,61 +36,79 @@ public static partial class TransitionFeatureMembershipTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule TriggerActionMember - /// TriggerActionMember:TransitionFeatureMembership='accept'{kind='trigger'}ownedRelatedElement+=TriggerAction + /// TriggerActionMember:TransitionFeatureMembership='accept'{kind='trigger'}ownedRelatedElement+=TriggerAction /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildTriggerActionMember(SysML2.NET.Core.POCO.Systems.States.ITransitionFeatureMembership poco, StringBuilder stringBuilder) + public static void BuildTriggerActionMember(SysML2.NET.Core.POCO.Systems.States.ITransitionFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfAcceptActionUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); stringBuilder.Append("accept "); // NonParsing Assignment Element : kind = 'trigger' => Does not have to be process - ownedRelatedElementOfAcceptActionUsageIterator.MoveNext(); - if (ownedRelatedElementOfAcceptActionUsageIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - AcceptActionUsageTextualNotationBuilder.BuildTriggerAction(ownedRelatedElementOfAcceptActionUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.Actions.IAcceptActionUsage elementAsAcceptActionUsage) + { + AcceptActionUsageTextualNotationBuilder.BuildTriggerAction(elementAsAcceptActionUsage, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } /// /// Builds the Textual Notation string for the rule GuardExpressionMember - /// GuardExpressionMember:TransitionFeatureMembership='if'{kind='guard'}ownedRelatedElement+=OwnedExpression + /// GuardExpressionMember:TransitionFeatureMembership='if'{kind='guard'}ownedRelatedElement+=OwnedExpression /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildGuardExpressionMember(SysML2.NET.Core.POCO.Systems.States.ITransitionFeatureMembership poco, StringBuilder stringBuilder) + public static void BuildGuardExpressionMember(SysML2.NET.Core.POCO.Systems.States.ITransitionFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfExpressionIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); stringBuilder.Append("if "); // NonParsing Assignment Element : kind = 'guard' => Does not have to be process - ownedRelatedElementOfExpressionIterator.MoveNext(); - if (ownedRelatedElementOfExpressionIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - ExpressionTextualNotationBuilder.BuildOwnedExpression(ownedRelatedElementOfExpressionIterator.Current, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Kernel.Functions.IExpression elementAsExpression) + { + ExpressionTextualNotationBuilder.BuildOwnedExpression(elementAsExpression, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } /// /// Builds the Textual Notation string for the rule EffectBehaviorMember - /// EffectBehaviorMember:TransitionFeatureMembership='do'{kind='effect'}ownedRelatedElement+=EffectBehaviorUsage + /// EffectBehaviorMember:TransitionFeatureMembership='do'{kind='effect'}ownedRelatedElement+=EffectBehaviorUsage /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildEffectBehaviorMember(SysML2.NET.Core.POCO.Systems.States.ITransitionFeatureMembership poco, StringBuilder stringBuilder) + public static void BuildEffectBehaviorMember(SysML2.NET.Core.POCO.Systems.States.ITransitionFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfActionUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); stringBuilder.Append("do "); // NonParsing Assignment Element : kind = 'effect' => Does not have to be process - ownedRelatedElementOfActionUsageIterator.MoveNext(); - if (ownedRelatedElementOfActionUsageIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - ActionUsageTextualNotationBuilder.BuildEffectBehaviorUsage(ownedRelatedElementOfActionUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.Actions.IActionUsage elementAsActionUsage) + { + ActionUsageTextualNotationBuilder.BuildEffectBehaviorUsage(elementAsActionUsage, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionUsageTextualNotationBuilder.cs index 14a695a5..8ad1bf44 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TransitionUsageTextualNotationBuilder.cs @@ -36,200 +36,268 @@ public static partial class TransitionUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule GuardedTargetSuccession - /// GuardedTargetSuccession:TransitionUsage=ownedRelationship+=GuardExpressionMember'then'ownedRelationship+=TransitionSuccessionMember + /// GuardedTargetSuccession:TransitionUsage=ownedRelationship+=GuardExpressionMember'then'ownedRelationship+=TransitionSuccessionMember /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildGuardedTargetSuccession(SysML2.NET.Core.POCO.Systems.States.ITransitionUsage poco, StringBuilder stringBuilder) + public static void BuildGuardedTargetSuccession(SysML2.NET.Core.POCO.Systems.States.ITransitionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfTransitionFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ownedRelationshipOfTransitionFeatureMembershipIterator.MoveNext(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (ownedRelationshipOfTransitionFeatureMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - TransitionFeatureMembershipTextualNotationBuilder.BuildGuardExpressionMember(ownedRelationshipOfTransitionFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Systems.States.ITransitionFeatureMembership elementAsTransitionFeatureMembership) + { + TransitionFeatureMembershipTextualNotationBuilder.BuildGuardExpressionMember(elementAsTransitionFeatureMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + stringBuilder.Append("then "); - ownedRelationshipOfOwningMembershipIterator.MoveNext(); - if (ownedRelationshipOfOwningMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(ownedRelationshipOfOwningMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + { + OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(elementAsOwningMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } /// /// Builds the Textual Notation string for the rule DefaultTargetSuccession - /// DefaultTargetSuccession:TransitionUsage='else'ownedRelationship+=TransitionSuccessionMember + /// DefaultTargetSuccession:TransitionUsage='else'ownedRelationship+=TransitionSuccessionMember /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildDefaultTargetSuccession(SysML2.NET.Core.POCO.Systems.States.ITransitionUsage poco, StringBuilder stringBuilder) + public static void BuildDefaultTargetSuccession(SysML2.NET.Core.POCO.Systems.States.ITransitionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); stringBuilder.Append("else "); - ownedRelationshipOfOwningMembershipIterator.MoveNext(); - if (ownedRelationshipOfOwningMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(ownedRelationshipOfOwningMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + { + OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(elementAsOwningMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } /// /// Builds the Textual Notation string for the rule GuardedSuccession - /// GuardedSuccession:TransitionUsage=('succession'UsageDeclaration)?'first'ownedRelationship+=FeatureChainMemberownedRelationship+=GuardExpressionMember'then'ownedRelationship+=TransitionSuccessionMemberUsageBody + /// GuardedSuccession:TransitionUsage=('succession'UsageDeclaration)?'first'ownedRelationship+=FeatureChainMemberownedRelationship+=GuardExpressionMember'then'ownedRelationship+=TransitionSuccessionMemberUsageBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildGuardedSuccession(SysML2.NET.Core.POCO.Systems.States.ITransitionUsage poco, StringBuilder stringBuilder) + public static void BuildGuardedSuccession(SysML2.NET.Core.POCO.Systems.States.ITransitionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - using var ownedRelationshipOfTransitionFeatureMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (BuildGroupConditionForGuardedSuccession(poco)) + if (!string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || poco.IsOrdered) { stringBuilder.Append("succession "); - UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); } stringBuilder.Append("first "); - ownedRelationshipOfMembershipIterator.MoveNext(); - if (ownedRelationshipOfMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - MembershipTextualNotationBuilder.BuildFeatureChainMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IMembership elementAsMembership) + { + MembershipTextualNotationBuilder.BuildFeatureChainMember(elementAsMembership, cursorCache, stringBuilder); + } } - ownedRelationshipOfTransitionFeatureMembershipIterator.MoveNext(); + ownedRelationshipCursor.Move(); - if (ownedRelationshipOfTransitionFeatureMembershipIterator.Current != null) + + if (ownedRelationshipCursor.Current != null) { - TransitionFeatureMembershipTextualNotationBuilder.BuildGuardExpressionMember(ownedRelationshipOfTransitionFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Systems.States.ITransitionFeatureMembership elementAsTransitionFeatureMembership) + { + TransitionFeatureMembershipTextualNotationBuilder.BuildGuardExpressionMember(elementAsTransitionFeatureMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + stringBuilder.Append("then "); - ownedRelationshipOfOwningMembershipIterator.MoveNext(); - if (ownedRelationshipOfOwningMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(ownedRelationshipOfOwningMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + { + OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(elementAsOwningMembership, cursorCache, stringBuilder); + } } - UsageTextualNotationBuilder.BuildUsageBody(poco, stringBuilder); + ownedRelationshipCursor.Move(); + + UsageTextualNotationBuilder.BuildUsageBody(poco, cursorCache, 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 + /// 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 used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildTargetTransitionUsage(SysML2.NET.Core.POCO.Systems.States.ITransitionUsage poco, StringBuilder stringBuilder) + public static void BuildTargetTransitionUsage(SysML2.NET.Core.POCO.Systems.States.ITransitionUsage poco, ICursorCache cursorCache, 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(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildEmptyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildEmptyParameterMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + ownedRelationshipCursor.Move(); + + BuildTargetTransitionUsageHandCoded(poco, cursorCache, stringBuilder); stringBuilder.Append("then "); - ownedRelationshipOfOwningMembershipIterator.MoveNext(); - if (ownedRelationshipOfOwningMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(ownedRelationshipOfOwningMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + { + OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(elementAsOwningMembership, cursorCache, stringBuilder); + } } - TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); + ownedRelationshipCursor.Move(); + + TypeTextualNotationBuilder.BuildActionBody(poco, cursorCache, 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 + /// 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 used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildTransitionUsage(SysML2.NET.Core.POCO.Systems.States.ITransitionUsage poco, StringBuilder stringBuilder) + public static void BuildTransitionUsage(SysML2.NET.Core.POCO.Systems.States.ITransitionUsage poco, ICursorCache cursorCache, 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(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); stringBuilder.Append("transition "); - if (BuildGroupConditionForTransitionUsage(poco)) + if (!string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || poco.IsOrdered) { - UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, cursorCache, stringBuilder); stringBuilder.Append("first "); stringBuilder.Append(' '); } - ownedRelationshipOfMembershipIterator.MoveNext(); - if (ownedRelationshipOfMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - MembershipTextualNotationBuilder.BuildFeatureChainMember(ownedRelationshipOfMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IMembership elementAsMembership) + { + MembershipTextualNotationBuilder.BuildFeatureChainMember(elementAsMembership, cursorCache, stringBuilder); + } } - ownedRelationshipOfParameterMembershipIterator.MoveNext(); + ownedRelationshipCursor.Move(); + - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildEmptyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildEmptyParameterMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); - if (ownedRelationshipOfParameterMembershipIterator.MoveNext()) + + if (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildEmptyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildEmptyParameterMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } - if (ownedRelationshipOfTransitionFeatureMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - TransitionFeatureMembershipTextualNotationBuilder.BuildTriggerActionMember(ownedRelationshipOfTransitionFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Systems.States.ITransitionFeatureMembership elementAsTransitionFeatureMembership) + { + TransitionFeatureMembershipTextualNotationBuilder.BuildTriggerActionMember(elementAsTransitionFeatureMembership, cursorCache, stringBuilder); + } } stringBuilder.Append(' '); } - if (ownedRelationshipOfTransitionFeatureMembershipIterator.MoveNext()) + if (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfTransitionFeatureMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - TransitionFeatureMembershipTextualNotationBuilder.BuildGuardExpressionMember(ownedRelationshipOfTransitionFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Systems.States.ITransitionFeatureMembership elementAsTransitionFeatureMembership) + { + TransitionFeatureMembershipTextualNotationBuilder.BuildGuardExpressionMember(elementAsTransitionFeatureMembership, cursorCache, stringBuilder); + } } stringBuilder.Append(' '); } - if (ownedRelationshipOfTransitionFeatureMembershipIterator.MoveNext()) + if (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfTransitionFeatureMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - TransitionFeatureMembershipTextualNotationBuilder.BuildEffectBehaviorMember(ownedRelationshipOfTransitionFeatureMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Systems.States.ITransitionFeatureMembership elementAsTransitionFeatureMembership) + { + TransitionFeatureMembershipTextualNotationBuilder.BuildEffectBehaviorMember(elementAsTransitionFeatureMembership, cursorCache, stringBuilder); + } } stringBuilder.Append(' '); } stringBuilder.Append("then "); - ownedRelationshipOfOwningMembershipIterator.MoveNext(); - if (ownedRelationshipOfOwningMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(ownedRelationshipOfOwningMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + { + OwningMembershipTextualNotationBuilder.BuildTransitionSuccessionMember(elementAsOwningMembership, cursorCache, stringBuilder); + } } - TypeTextualNotationBuilder.BuildActionBody(poco, stringBuilder); + ownedRelationshipCursor.Move(); + + TypeTextualNotationBuilder.BuildActionBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TriggerInvocationExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TriggerInvocationExpressionTextualNotationBuilder.cs index 9d1e38c8..e565a275 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TriggerInvocationExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TriggerInvocationExpressionTextualNotationBuilder.cs @@ -24,7 +24,6 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; @@ -37,16 +36,14 @@ 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 + /// TriggerExpression:TriggerInvocationExpression=kind=('at'|'after')ownedRelationship+=ArgumentMember|kind='when'ownedRelationship+=ArgumentExpressionMember /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildTriggerExpression(SysML2.NET.Core.POCO.Systems.Actions.ITriggerInvocationExpression poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildTriggerExpression(SysML2.NET.Core.POCO.Systems.Actions.ITriggerInvocationExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - return elementIndex; + BuildTriggerExpressionHandCoded(poco, cursorCache, stringBuilder); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeFeaturingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeFeaturingTextualNotationBuilder.cs index 19d95abc..9c7bc427 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeFeaturingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeFeaturingTextualNotationBuilder.cs @@ -36,11 +36,12 @@ public static partial class TypeFeaturingTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule OwnedTypeFeaturing - /// OwnedTypeFeaturing:TypeFeaturing=featuringType=[QualifiedName] + /// OwnedTypeFeaturing:TypeFeaturing=featuringType=[QualifiedName] /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildOwnedTypeFeaturing(SysML2.NET.Core.POCO.Core.Features.ITypeFeaturing poco, StringBuilder stringBuilder) + public static void BuildOwnedTypeFeaturing(SysML2.NET.Core.POCO.Core.Features.ITypeFeaturing poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.FeaturingType != null) @@ -53,17 +54,18 @@ public static void BuildOwnedTypeFeaturing(SysML2.NET.Core.POCO.Core.Features.IT /// /// Builds the Textual Notation string for the rule TypeFeaturing - /// TypeFeaturing='featuring'(Identification'of')?featureOfType=[QualifiedName]'by'featuringType=[QualifiedName]RelationshipBody + /// TypeFeaturing='featuring'(Identification'of')?featureOfType=[QualifiedName]'by'featuringType=[QualifiedName]RelationshipBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildTypeFeaturing(SysML2.NET.Core.POCO.Core.Features.ITypeFeaturing poco, StringBuilder stringBuilder) + public static void BuildTypeFeaturing(SysML2.NET.Core.POCO.Core.Features.ITypeFeaturing poco, ICursorCache cursorCache, StringBuilder stringBuilder) { stringBuilder.Append("featuring "); - if (BuildGroupConditionForTypeFeaturing(poco)) + if (!string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName)) { - ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + ElementTextualNotationBuilder.BuildIdentification(poco, cursorCache, stringBuilder); stringBuilder.Append("of "); stringBuilder.Append(' '); } @@ -81,7 +83,7 @@ public static void BuildTypeFeaturing(SysML2.NET.Core.POCO.Core.Features.ITypeFe stringBuilder.Append(poco.FeaturingType.qualifiedName); stringBuilder.Append(' '); } - RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, stringBuilder); + RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs index 31c86230..7ef506a2 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs @@ -24,7 +24,6 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; @@ -37,127 +36,127 @@ public static partial class TypeTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule DefinitionBody - /// DefinitionBody:Type=';'|'{'DefinitionBodyItem*'}' + /// DefinitionBody:Type=';'|'{'DefinitionBodyItem*'}' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildDefinitionBody(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + public static void BuildDefinitionBody(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildDefinitionBodyHandCoded(poco, cursorCache, stringBuilder); } /// /// 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 + /// 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 index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildDefinitionBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildDefinitionBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - return elementIndex; + BuildDefinitionBodyItemHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule InterfaceBody - /// InterfaceBody:Type=';'|'{'InterfaceBodyItem*'}' + /// InterfaceBody:Type=';'|'{'InterfaceBodyItem*'}' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildInterfaceBody(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + public static void BuildInterfaceBody(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildInterfaceBodyHandCoded(poco, cursorCache, stringBuilder); } /// /// 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 + /// 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 index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildInterfaceBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildInterfaceBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - return elementIndex; + BuildInterfaceBodyItemHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule ActionBody - /// ActionBody:Type=';'|'{'ActionBodyItem*'}' + /// ActionBody:Type=';'|'{'ActionBodyItem*'}' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildActionBody(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + public static void BuildActionBody(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildActionBodyHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule ActionBodyItem - /// ActionBodyItem:Type=NonBehaviorBodyItem|ownedRelationship+=InitialNodeMember(ownedRelationship+=ActionTargetSuccessionMember)*|(ownedRelationship+=SourceSuccessionMember)?ownedRelationship+=ActionBehaviorMember(ownedRelationship+=ActionTargetSuccessionMember)*|ownedRelationship+=GuardedSuccessionMember + /// ActionBodyItem:Type=NonBehaviorBodyItem|ownedRelationship+=InitialNodeMember(ownedRelationship+=ActionTargetSuccessionMember)*|(ownedRelationship+=SourceSuccessionMember)?ownedRelationship+=ActionBehaviorMember(ownedRelationship+=ActionTargetSuccessionMember)*|ownedRelationship+=GuardedSuccessionMember /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildActionBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildActionBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - return elementIndex; + BuildActionBodyItemHandCoded(poco, cursorCache, stringBuilder); } /// /// 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 + /// 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 index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildStateBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildStateBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); - return elementIndex; + BuildStateBodyItemHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule CalculationBody - /// CalculationBody:Type=';'|'{'CalculationBodyPart'}' + /// CalculationBody:Type=';'|'{'CalculationBodyPart'}' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildCalculationBody(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + public static void BuildCalculationBody(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildCalculationBodyHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule CalculationBodyPart - /// CalculationBodyPart:Type=CalculationBodyItem*(ownedRelationship+=ResultExpressionMember)? + /// CalculationBodyPart:Type=CalculationBodyItem*(ownedRelationship+=ResultExpressionMember)? /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildCalculationBodyPart(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + public static void BuildCalculationBodyPart(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfResultExpressionMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - // Handle collection Non Terminal - for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + while (ownedRelationshipCursor.Current != null) { - ownedRelationshipIndex = BuildCalculationBodyItem(poco, ownedRelationshipIndex, stringBuilder); + BuildCalculationBodyItem(poco, cursorCache, stringBuilder); } - if (ownedRelationshipOfResultExpressionMembershipIterator.MoveNext()) + + if (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfResultExpressionMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ResultExpressionMembershipTextualNotationBuilder.BuildResultExpressionMember(ownedRelationshipOfResultExpressionMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Functions.IResultExpressionMembership elementAsResultExpressionMembership) + { + ResultExpressionMembershipTextualNotationBuilder.BuildResultExpressionMember(elementAsResultExpressionMembership, cursorCache, stringBuilder); + } } - stringBuilder.Append(' '); } @@ -165,132 +164,165 @@ public static void BuildCalculationBodyPart(SysML2.NET.Core.POCO.Core.Types.ITyp /// /// Builds the Textual Notation string for the rule CalculationBodyItem - /// CalculationBodyItem:Type=ActionBodyItem|ownedRelationship+=ReturnParameterMember + /// CalculationBodyItem:Type=ActionBodyItem|ownedRelationship+=ReturnParameterMember /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildCalculationBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildCalculationBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - var elementsElement = poco.OwnedRelationship[elementIndex]; - - switch (elementsElement) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + switch (ownedRelationshipCursor.Current) { - case SysML2.NET.Core.POCO.Kernel.Functions.ReturnParameterMembership returnParameterMembership: - ReturnParameterMembershipTextualNotationBuilder.BuildReturnParameterMember(returnParameterMembership, stringBuilder); break; + case SysML2.NET.Core.POCO.Kernel.Functions.IReturnParameterMembership returnParameterMembership: + ReturnParameterMembershipTextualNotationBuilder.BuildReturnParameterMember(returnParameterMembership, cursorCache, stringBuilder); break; case SysML2.NET.Core.POCO.Core.Types.IType type: - elementIndex = BuildActionBodyItem(type, elementIndex, stringBuilder); - break; + BuildActionBodyItem(type, cursorCache, stringBuilder); break; } - return elementIndex; } /// /// Builds the Textual Notation string for the rule RequirementBody - /// RequirementBody:Type=';'|'{'RequirementBodyItem*'}' + /// RequirementBody:Type=';'|'{'RequirementBodyItem*'}' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildRequirementBody(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + public static void BuildRequirementBody(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildRequirementBodyHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule RequirementBodyItem - /// RequirementBodyItem:Type=DefinitionBodyItem|ownedRelationship+=SubjectMember|ownedRelationship+=RequirementConstraintMember|ownedRelationship+=FramedConcernMember|ownedRelationship+=RequirementVerificationMember|ownedRelationship+=ActorMember|ownedRelationship+=StakeholderMember + /// RequirementBodyItem:Type=DefinitionBodyItem|ownedRelationship+=SubjectMember|ownedRelationship+=RequirementConstraintMember|ownedRelationship+=FramedConcernMember|ownedRelationship+=RequirementVerificationMember|ownedRelationship+=ActorMember|ownedRelationship+=StakeholderMember /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildRequirementBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildRequirementBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - var elementsElement = poco.OwnedRelationship[elementIndex]; - - switch (elementsElement) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + switch (ownedRelationshipCursor.Current) { - case SysML2.NET.Core.POCO.Systems.Requirements.SubjectMembership subjectMembership: - SubjectMembershipTextualNotationBuilder.BuildSubjectMember(subjectMembership, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Requirements.RequirementConstraintMembership requirementConstraintMembership: - RequirementConstraintMembershipTextualNotationBuilder.BuildRequirementConstraintMember(requirementConstraintMembership, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Requirements.FramedConcernMembership framedConcernMembership: - FramedConcernMembershipTextualNotationBuilder.BuildFramedConcernMember(framedConcernMembership, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.VerificationCases.RequirementVerificationMembership requirementVerificationMembership: - RequirementVerificationMembershipTextualNotationBuilder.BuildRequirementVerificationMember(requirementVerificationMembership, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Requirements.ActorMembership actorMembership: - ActorMembershipTextualNotationBuilder.BuildActorMember(actorMembership, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Requirements.StakeholderMembership stakeholderMembership: - StakeholderMembershipTextualNotationBuilder.BuildStakeholderMember(stakeholderMembership, stringBuilder); break; + case SysML2.NET.Core.POCO.Systems.Requirements.ISubjectMembership subjectMembership: + SubjectMembershipTextualNotationBuilder.BuildSubjectMember(subjectMembership, cursorCache, stringBuilder); break; + case SysML2.NET.Core.POCO.Systems.Requirements.IFramedConcernMembership framedConcernMembership: + FramedConcernMembershipTextualNotationBuilder.BuildFramedConcernMember(framedConcernMembership, cursorCache, stringBuilder); break; + case SysML2.NET.Core.POCO.Systems.VerificationCases.IRequirementVerificationMembership requirementVerificationMembership: + RequirementVerificationMembershipTextualNotationBuilder.BuildRequirementVerificationMember(requirementVerificationMembership, cursorCache, stringBuilder); break; + case SysML2.NET.Core.POCO.Systems.Requirements.IActorMembership actorMembership: + ActorMembershipTextualNotationBuilder.BuildActorMember(actorMembership, cursorCache, stringBuilder); break; + case SysML2.NET.Core.POCO.Systems.Requirements.IStakeholderMembership stakeholderMembership: + StakeholderMembershipTextualNotationBuilder.BuildStakeholderMember(stakeholderMembership, cursorCache, stringBuilder); break; + case SysML2.NET.Core.POCO.Systems.Requirements.IRequirementConstraintMembership requirementConstraintMembership: + RequirementConstraintMembershipTextualNotationBuilder.BuildRequirementConstraintMember(requirementConstraintMembership, cursorCache, stringBuilder); break; case SysML2.NET.Core.POCO.Core.Types.IType type: - elementIndex = BuildDefinitionBodyItem(type, elementIndex, stringBuilder); - break; + BuildDefinitionBodyItem(type, cursorCache, stringBuilder); break; } - return elementIndex; } /// /// Builds the Textual Notation string for the rule CaseBody - /// CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' + /// CaseBody:Type=';'|'{'CaseBodyItem*(ownedRelationship+=ResultExpressionMember)?'}' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildCaseBody(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + public static void BuildCaseBody(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + if (poco.OwnedRelationship.Count == 0) + { + stringBuilder.AppendLine(";"); + } + else + { + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + stringBuilder.AppendLine("{"); + while (ownedRelationshipCursor.Current != null) + { + BuildCaseBodyItem(poco, cursorCache, stringBuilder); + } + + + if (ownedRelationshipCursor.Current != null) + { + + if (ownedRelationshipCursor.Current != null) + { + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Functions.IResultExpressionMembership elementAsResultExpressionMembership) + { + ResultExpressionMembershipTextualNotationBuilder.BuildResultExpressionMember(elementAsResultExpressionMembership, cursorCache, stringBuilder); + } + } + stringBuilder.Append(' '); + } + + stringBuilder.AppendLine("}"); + } + } /// /// Builds the Textual Notation string for the rule CaseBodyItem - /// CaseBodyItem:Type=ActionBodyItem|ownedRelationship+=SubjectMember|ownedRelationship+=ActorMember|ownedRelationship+=ObjectiveMember + /// CaseBodyItem:Type=ActionBodyItem|ownedRelationship+=SubjectMember|ownedRelationship+=ActorMember|ownedRelationship+=ObjectiveMember /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildCaseBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildCaseBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - var elementsElement = poco.OwnedRelationship[elementIndex]; - - switch (elementsElement) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + switch (ownedRelationshipCursor.Current) { - case SysML2.NET.Core.POCO.Systems.Requirements.SubjectMembership subjectMembership: - SubjectMembershipTextualNotationBuilder.BuildSubjectMember(subjectMembership, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Requirements.ActorMembership actorMembership: - ActorMembershipTextualNotationBuilder.BuildActorMember(actorMembership, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Cases.ObjectiveMembership objectiveMembership: - ObjectiveMembershipTextualNotationBuilder.BuildObjectiveMember(objectiveMembership, stringBuilder); break; + case SysML2.NET.Core.POCO.Systems.Requirements.ISubjectMembership subjectMembership: + SubjectMembershipTextualNotationBuilder.BuildSubjectMember(subjectMembership, cursorCache, stringBuilder); break; + case SysML2.NET.Core.POCO.Systems.Requirements.IActorMembership actorMembership: + ActorMembershipTextualNotationBuilder.BuildActorMember(actorMembership, cursorCache, stringBuilder); break; + case SysML2.NET.Core.POCO.Systems.Cases.IObjectiveMembership objectiveMembership: + ObjectiveMembershipTextualNotationBuilder.BuildObjectiveMember(objectiveMembership, cursorCache, stringBuilder); break; case SysML2.NET.Core.POCO.Core.Types.IType type: - elementIndex = BuildActionBodyItem(type, elementIndex, stringBuilder); - break; + BuildActionBodyItem(type, cursorCache, stringBuilder); break; } - return elementIndex; } /// /// Builds the Textual Notation string for the rule MetadataBody - /// MetadataBody:Type=';'|'{'(ownedRelationship+=DefinitionMember|ownedRelationship+=MetadataBodyUsageMember|ownedRelationship+=AliasMember|ownedRelationship+=Import)*'}' + /// MetadataBody:Type=';'|'{'(ownedRelationship+=DefinitionMember|ownedRelationship+=MetadataBodyUsageMember|ownedRelationship+=AliasMember|ownedRelationship+=Import)*'}' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildMetadataBody(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + public static void BuildMetadataBody(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + if (poco.OwnedRelationship.Count == 0) + { + stringBuilder.AppendLine(";"); + } + else + { + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + stringBuilder.AppendLine("{"); + // Have to handle group collection + stringBuilder.AppendLine("}"); + } + } /// /// Builds the Textual Notation string for the rule TypePrefix - /// TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* + /// TypePrefix:Type=(isAbstract?='abstract')?(ownedRelationship+=PrefixMetadataMember)* /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildTypePrefix(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + public static void BuildTypePrefix(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); if (poco.IsAbstract) { @@ -299,13 +331,18 @@ public static void BuildTypePrefix(SysML2.NET.Core.POCO.Core.Types.IType poco, S } - while (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + while (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfOwningMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(ownedRelationshipOfOwningMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + { + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(elementAsOwningMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); } @@ -313,13 +350,14 @@ public static void BuildTypePrefix(SysML2.NET.Core.POCO.Core.Types.IType poco, S /// /// Builds the Textual Notation string for the rule TypeDeclaration - /// TypeDeclaration:Type=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SpecializationPart|ConjugationPart)+TypeRelationshipPart* + /// TypeDeclaration:Type=(isSufficient?='all')?Identification(ownedRelationship+=OwnedMultiplicity)?(SpecializationPart|ConjugationPart)+TypeRelationshipPart* /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildTypeDeclaration(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + public static void BuildTypeDeclaration(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); if (poco.IsSufficient) { @@ -327,50 +365,68 @@ public static void BuildTypeDeclaration(SysML2.NET.Core.POCO.Core.Types.IType po stringBuilder.Append(' '); } - ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); + ElementTextualNotationBuilder.BuildIdentification(poco, cursorCache, stringBuilder); - if (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + if (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfOwningMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - OwningMembershipTextualNotationBuilder.BuildOwnedMultiplicity(ownedRelationshipOfOwningMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + { + OwningMembershipTextualNotationBuilder.BuildOwnedMultiplicity(elementAsOwningMembership, cursorCache, stringBuilder); + } } stringBuilder.Append(' '); } // Have to handle group collection stringBuilder.Append(' '); - // Handle collection Non Terminal - BuildTypeRelationshipPartInternal(poco, stringBuilder); BuildTypeRelationshipPart(poco, stringBuilder); + while (ownedRelationshipCursor.Current != null) + { + BuildTypeRelationshipPart(poco, cursorCache, stringBuilder); + } + } /// /// Builds the Textual Notation string for the rule SpecializationPart - /// SpecializationPart:Type=SPECIALIZESownedRelationship+=OwnedSpecialization(','ownedRelationship+=OwnedSpecialization)* + /// SpecializationPart:Type=SPECIALIZESownedRelationship+=OwnedSpecialization(','ownedRelationship+=OwnedSpecialization)* /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildSpecializationPart(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + public static void BuildSpecializationPart(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfSpecializationIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); stringBuilder.Append(" :> "); - ownedRelationshipOfSpecializationIterator.MoveNext(); - if (ownedRelationshipOfSpecializationIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - SpecializationTextualNotationBuilder.BuildOwnedSpecialization(ownedRelationshipOfSpecializationIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Types.ISpecialization elementAsSpecialization) + { + SpecializationTextualNotationBuilder.BuildOwnedSpecialization(elementAsSpecialization, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); - while (ownedRelationshipOfSpecializationIterator.MoveNext()) + + while (ownedRelationshipCursor.Current != null) { - stringBuilder.Append(","); + stringBuilder.Append(", "); - if (ownedRelationshipOfSpecializationIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - SpecializationTextualNotationBuilder.BuildOwnedSpecialization(ownedRelationshipOfSpecializationIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Types.ISpecialization elementAsSpecialization) + { + SpecializationTextualNotationBuilder.BuildOwnedSpecialization(elementAsSpecialization, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); } @@ -378,60 +434,78 @@ public static void BuildSpecializationPart(SysML2.NET.Core.POCO.Core.Types.IType /// /// Builds the Textual Notation string for the rule ConjugationPart - /// ConjugationPart:Type=CONJUGATESownedRelationship+=OwnedConjugation + /// ConjugationPart:Type=CONJUGATESownedRelationship+=OwnedConjugation /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildConjugationPart(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + public static void BuildConjugationPart(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfConjugationIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - stringBuilder.Append(" ~ "); - ownedRelationshipOfConjugationIterator.MoveNext(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + stringBuilder.Append(" ~"); - if (ownedRelationshipOfConjugationIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ConjugationTextualNotationBuilder.BuildOwnedConjugation(ownedRelationshipOfConjugationIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Types.IConjugation elementAsConjugation) + { + ConjugationTextualNotationBuilder.BuildOwnedConjugation(elementAsConjugation, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + } /// /// Builds the Textual Notation string for the rule TypeRelationshipPart - /// TypeRelationshipPart:Type=DisjoiningPart|UnioningPart|IntersectingPart|DifferencingPart + /// TypeRelationshipPart:Type=DisjoiningPart|UnioningPart|IntersectingPart|DifferencingPart /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildTypeRelationshipPart(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + public static void BuildTypeRelationshipPart(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); + BuildTypeRelationshipPartHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule DisjoiningPart - /// DisjoiningPart:Type='disjoint''from'ownedRelationship+=OwnedDisjoining(','ownedRelationship+=OwnedDisjoining)* + /// DisjoiningPart:Type='disjoint''from'ownedRelationship+=OwnedDisjoining(','ownedRelationship+=OwnedDisjoining)* /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildDisjoiningPart(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + public static void BuildDisjoiningPart(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfDisjoiningIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); stringBuilder.Append("disjoint "); stringBuilder.Append("from "); - ownedRelationshipOfDisjoiningIterator.MoveNext(); - if (ownedRelationshipOfDisjoiningIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - DisjoiningTextualNotationBuilder.BuildOwnedDisjoining(ownedRelationshipOfDisjoiningIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Types.IDisjoining elementAsDisjoining) + { + DisjoiningTextualNotationBuilder.BuildOwnedDisjoining(elementAsDisjoining, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + - while (ownedRelationshipOfDisjoiningIterator.MoveNext()) + while (ownedRelationshipCursor.Current != null) { - stringBuilder.Append(","); + stringBuilder.Append(", "); - if (ownedRelationshipOfDisjoiningIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - DisjoiningTextualNotationBuilder.BuildOwnedDisjoining(ownedRelationshipOfDisjoiningIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Types.IDisjoining elementAsDisjoining) + { + DisjoiningTextualNotationBuilder.BuildOwnedDisjoining(elementAsDisjoining, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); } @@ -439,29 +513,40 @@ public static void BuildDisjoiningPart(SysML2.NET.Core.POCO.Core.Types.IType poc /// /// Builds the Textual Notation string for the rule UnioningPart - /// UnioningPart:Type='unions'ownedRelationship+=Unioning(','ownedRelationship+=Unioning)* + /// UnioningPart:Type='unions'ownedRelationship+=Unioning(','ownedRelationship+=Unioning)* /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildUnioningPart(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + public static void BuildUnioningPart(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfUnioningIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); stringBuilder.Append("unions "); - ownedRelationshipOfUnioningIterator.MoveNext(); - if (ownedRelationshipOfUnioningIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - UnioningTextualNotationBuilder.BuildUnioning(ownedRelationshipOfUnioningIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Types.IUnioning elementAsUnioning) + { + UnioningTextualNotationBuilder.BuildUnioning(elementAsUnioning, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); - while (ownedRelationshipOfUnioningIterator.MoveNext()) + + while (ownedRelationshipCursor.Current != null) { - stringBuilder.Append(","); + stringBuilder.Append(", "); - if (ownedRelationshipOfUnioningIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - UnioningTextualNotationBuilder.BuildUnioning(ownedRelationshipOfUnioningIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Types.IUnioning elementAsUnioning) + { + UnioningTextualNotationBuilder.BuildUnioning(elementAsUnioning, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); } @@ -469,29 +554,40 @@ public static void BuildUnioningPart(SysML2.NET.Core.POCO.Core.Types.IType poco, /// /// Builds the Textual Notation string for the rule IntersectingPart - /// IntersectingPart:Type='intersects'ownedRelationship+=Intersecting(','ownedRelationship+=Intersecting)* + /// IntersectingPart:Type='intersects'ownedRelationship+=Intersecting(','ownedRelationship+=Intersecting)* /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildIntersectingPart(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + public static void BuildIntersectingPart(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfIntersectingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); stringBuilder.Append("intersects "); - ownedRelationshipOfIntersectingIterator.MoveNext(); - if (ownedRelationshipOfIntersectingIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - IntersectingTextualNotationBuilder.BuildIntersecting(ownedRelationshipOfIntersectingIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Types.IIntersecting elementAsIntersecting) + { + IntersectingTextualNotationBuilder.BuildIntersecting(elementAsIntersecting, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); + - while (ownedRelationshipOfIntersectingIterator.MoveNext()) + while (ownedRelationshipCursor.Current != null) { - stringBuilder.Append(","); + stringBuilder.Append(", "); - if (ownedRelationshipOfIntersectingIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - IntersectingTextualNotationBuilder.BuildIntersecting(ownedRelationshipOfIntersectingIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Types.IIntersecting elementAsIntersecting) + { + IntersectingTextualNotationBuilder.BuildIntersecting(elementAsIntersecting, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); } @@ -499,29 +595,40 @@ public static void BuildIntersectingPart(SysML2.NET.Core.POCO.Core.Types.IType p /// /// Builds the Textual Notation string for the rule DifferencingPart - /// DifferencingPart:Type='differences'ownedRelationship+=Differencing(','ownedRelationship+=Differencing)* + /// DifferencingPart:Type='differences'ownedRelationship+=Differencing(','ownedRelationship+=Differencing)* /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildDifferencingPart(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + public static void BuildDifferencingPart(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfDifferencingIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); stringBuilder.Append("differences "); - ownedRelationshipOfDifferencingIterator.MoveNext(); - if (ownedRelationshipOfDifferencingIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - DifferencingTextualNotationBuilder.BuildDifferencing(ownedRelationshipOfDifferencingIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Types.IDifferencing elementAsDifferencing) + { + DifferencingTextualNotationBuilder.BuildDifferencing(elementAsDifferencing, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); - while (ownedRelationshipOfDifferencingIterator.MoveNext()) + + while (ownedRelationshipCursor.Current != null) { - stringBuilder.Append(","); + stringBuilder.Append(", "); - if (ownedRelationshipOfDifferencingIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - DifferencingTextualNotationBuilder.BuildDifferencing(ownedRelationshipOfDifferencingIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Core.Types.IDifferencing elementAsDifferencing) + { + DifferencingTextualNotationBuilder.BuildDifferencing(elementAsDifferencing, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); } @@ -529,75 +636,83 @@ public static void BuildDifferencingPart(SysML2.NET.Core.POCO.Core.Types.IType p /// /// Builds the Textual Notation string for the rule TypeBody - /// TypeBody:Type=';'|'{'TypeBodyElement*'}' + /// TypeBody:Type=';'|'{'TypeBodyElement*'}' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildTypeBody(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + public static void BuildTypeBody(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildTypeBodyHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule TypeBodyElement - /// TypeBodyElement:Type=ownedRelationship+=NonFeatureMember|ownedRelationship+=FeatureMember|ownedRelationship+=AliasMember|ownedRelationship+=Import + /// TypeBodyElement:Type=ownedRelationship+=NonFeatureMember|ownedRelationship+=FeatureMember|ownedRelationship+=AliasMember|ownedRelationship+=Import /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildTypeBodyElement(SysML2.NET.Core.POCO.Core.Types.IType poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildTypeBodyElement(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - switch (elementInOwnedRelationship) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + switch (ownedRelationshipCursor.Current) { - case SysML2.NET.Core.POCO.Root.Namespaces.OwningMembership owningMembership when owningMembership.IsValidForNonFeatureMember(): - OwningMembershipTextualNotationBuilder.BuildNonFeatureMember(owningMembership, stringBuilder); + case SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership owningMembership when owningMembership.IsValidForNonFeatureMember(): + OwningMembershipTextualNotationBuilder.BuildNonFeatureMember(owningMembership, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); break; - case SysML2.NET.Core.POCO.Root.Namespaces.OwningMembership owningMembership when owningMembership.IsValidForFeatureMember(): - OwningMembershipTextualNotationBuilder.BuildFeatureMember(owningMembership, stringBuilder); + case SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership owningMembership when owningMembership.IsValidForFeatureMember(): + OwningMembershipTextualNotationBuilder.BuildFeatureMember(owningMembership, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); break; - case SysML2.NET.Core.POCO.Root.Namespaces.Membership membership: - MembershipTextualNotationBuilder.BuildAliasMember(membership, stringBuilder); + case SysML2.NET.Core.POCO.Root.Namespaces.IMembership membership: + MembershipTextualNotationBuilder.BuildAliasMember(membership, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); break; case SysML2.NET.Core.POCO.Root.Namespaces.IImport import: - ImportTextualNotationBuilder.BuildImport(import, stringBuilder); + ImportTextualNotationBuilder.BuildImport(import, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); break; } - return elementIndex; } /// /// Builds the Textual Notation string for the rule FunctionBody - /// FunctionBody:Type=';'|'{'FunctionBodyPart'}' + /// FunctionBody:Type=';'|'{'FunctionBodyPart'}' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildFunctionBody(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + public static void BuildFunctionBody(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildFunctionBodyHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule FunctionBodyPart - /// FunctionBodyPart:Type=(TypeBodyElement|ownedRelationship+=ReturnFeatureMember)*(ownedRelationship+=ResultExpressionMember)? + /// FunctionBodyPart:Type=(TypeBodyElement|ownedRelationship+=ReturnFeatureMember)*(ownedRelationship+=ResultExpressionMember)? /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildFunctionBodyPart(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + public static void BuildFunctionBodyPart(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfReturnParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - using var ownedRelationshipOfResultExpressionMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); // Have to handle group collection - if (ownedRelationshipOfResultExpressionMembershipIterator.MoveNext()) + if (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfResultExpressionMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ResultExpressionMembershipTextualNotationBuilder.BuildResultExpressionMember(ownedRelationshipOfResultExpressionMembershipIterator.Current, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Functions.IResultExpressionMembership elementAsResultExpressionMembership) + { + ResultExpressionMembershipTextualNotationBuilder.BuildResultExpressionMember(elementAsResultExpressionMembership, cursorCache, stringBuilder); + } } - stringBuilder.Append(' '); } @@ -605,11 +720,12 @@ public static void BuildFunctionBodyPart(SysML2.NET.Core.POCO.Core.Types.IType p /// /// Builds the Textual Notation string for the rule InstantiatedTypeReference - /// InstantiatedTypeReference:Type=[QualifiedName] + /// InstantiatedTypeReference:Type=[QualifiedName] /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildInstantiatedTypeReference(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + public static void BuildInstantiatedTypeReference(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { stringBuilder.Append(poco.qualifiedName); stringBuilder.Append(' '); @@ -618,16 +734,17 @@ public static void BuildInstantiatedTypeReference(SysML2.NET.Core.POCO.Core.Type /// /// Builds the Textual Notation string for the rule Type - /// Type=TypePrefix'type'TypeDeclarationTypeBody + /// Type=TypePrefix'type'TypeDeclarationTypeBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildType(SysML2.NET.Core.POCO.Core.Types.IType poco, StringBuilder stringBuilder) + public static void BuildType(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildTypePrefix(poco, stringBuilder); + BuildTypePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("type "); - BuildTypeDeclaration(poco, stringBuilder); - BuildTypeBody(poco, stringBuilder); + BuildTypeDeclaration(poco, cursorCache, stringBuilder); + BuildTypeBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UnioningTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UnioningTextualNotationBuilder.cs index 73c1d403..4a6476c8 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UnioningTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UnioningTextualNotationBuilder.cs @@ -24,7 +24,6 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; @@ -37,14 +36,14 @@ public static partial class UnioningTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule Unioning - /// Unioning=unioningType=[QualifiedName]|ownedRelatedElement+=OwnedFeatureChain + /// Unioning=unioningType=[QualifiedName]|ownedRelatedElement+=OwnedFeatureChain /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildUnioning(SysML2.NET.Core.POCO.Core.Types.IUnioning poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildUnioning(SysML2.NET.Core.POCO.Core.Types.IUnioning poco, ICursorCache cursorCache, StringBuilder stringBuilder) { + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); if (poco.UnioningType != null) { stringBuilder.Append(poco.UnioningType.qualifiedName); @@ -52,18 +51,17 @@ public static int BuildUnioning(SysML2.NET.Core.POCO.Core.Types.IUnioning poco, } else { - if (elementIndex < poco.OwnedRelatedElement.Count) + + if (ownedRelatedElementCursor.Current != null) { - var elementForOwnedRelatedElement = poco.OwnedRelatedElement[elementIndex]; - if (elementForOwnedRelatedElement is SysML2.NET.Core.POCO.Core.Features.IFeature elementAsFeature) + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Core.Features.IFeature elementAsFeature) { - FeatureTextualNotationBuilder.BuildOwnedFeatureChain(elementAsFeature, stringBuilder); + FeatureTextualNotationBuilder.BuildOwnedFeatureChain(elementAsFeature, cursorCache, stringBuilder); } } } - return elementIndex; } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs index fd9f7245..c7b0f56d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs @@ -24,12 +24,10 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Root.Elements; - using SysML2.NET.Core.POCO.Systems.DefinitionAndUsage; /// /// The provides Textual Notation Builder for the element @@ -38,23 +36,33 @@ public static partial class UsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule UsageElement - /// UsageElement:Usage=NonOccurrenceUsageElement|OccurrenceUsageElement + /// UsageElement:Usage=NonOccurrenceUsageElement|OccurrenceUsageElement /// /// The from which the rule should be build - /// + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildUsageElement(IUsage poco, ICursorCache cursor, StringBuilder stringBuilder) + public static void BuildUsageElement(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); + switch (poco) + { + case SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage pocoUsageNonOccurrenceUsageElement when pocoUsageNonOccurrenceUsageElement.IsEnd: + BuildNonOccurrenceUsageElement(pocoUsageNonOccurrenceUsageElement, cursorCache, stringBuilder); + break; + default: + BuildOccurrenceUsageElement(poco, cursorCache, stringBuilder); + break; + } + } /// /// Builds the Textual Notation string for the rule RefPrefix - /// RefPrefix:Usage=(direction=FeatureDirection)?(isDerived?='derived')?(isAbstract?='abstract'|isVariation?='variation')?(isConstant?='constant')? + /// RefPrefix:Usage=(direction=FeatureDirection)?(isDerived?='derived')?(isAbstract?='abstract'|isVariation?='variation')?(isConstant?='constant')? /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildRefPrefix(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + public static void BuildRefPrefix(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { if (poco.Direction.HasValue) @@ -83,7 +91,6 @@ public static void BuildRefPrefix(SysML2.NET.Core.POCO.Systems.DefinitionAndUsag if (poco.IsConstant) { stringBuilder.Append(" constant "); - stringBuilder.Append(' '); } @@ -91,18 +98,18 @@ public static void BuildRefPrefix(SysML2.NET.Core.POCO.Systems.DefinitionAndUsag /// /// Builds the Textual Notation string for the rule BasicUsagePrefix - /// BasicUsagePrefix:Usage=RefPrefix(isReference?='ref')? + /// BasicUsagePrefix:Usage=RefPrefix(isReference?='ref')? /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildBasicUsagePrefix(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + public static void BuildBasicUsagePrefix(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildRefPrefix(poco, stringBuilder); + BuildRefPrefix(poco, cursorCache, stringBuilder); if (poco.isReference) { stringBuilder.Append(" ref "); - stringBuilder.Append(' '); } @@ -110,26 +117,30 @@ public static void BuildBasicUsagePrefix(SysML2.NET.Core.POCO.Systems.Definition /// /// Builds the Textual Notation string for the rule EndUsagePrefix - /// EndUsagePrefix:Usage=isEnd?='end'(ownedRelationship+=OwnedCrossFeatureMember)? + /// EndUsagePrefix:Usage=isEnd?='end'(ownedRelationship+=OwnedCrossFeatureMember)? /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildEndUsagePrefix(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + public static void BuildEndUsagePrefix(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfOwningMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); if (poco.IsEnd) { stringBuilder.Append(" end "); } - if (ownedRelationshipOfOwningMembershipIterator.MoveNext()) + if (ownedRelationshipCursor.Current != null) { - if (ownedRelationshipOfOwningMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - OwningMembershipTextualNotationBuilder.BuildOwnedCrossFeatureMember(ownedRelationshipOfOwningMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + { + OwningMembershipTextualNotationBuilder.BuildOwnedCrossFeatureMember(elementAsOwningMembership, cursorCache, stringBuilder); + } } - stringBuilder.Append(' '); } @@ -137,183 +148,235 @@ public static void BuildEndUsagePrefix(SysML2.NET.Core.POCO.Systems.DefinitionAn /// /// Builds the Textual Notation string for the rule UsageExtensionKeyword - /// UsageExtensionKeyword:Usage=ownedRelationship+=PrefixMetadataMember + /// UsageExtensionKeyword:Usage=ownedRelationship+=PrefixMetadataMember /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildUsageExtensionKeyword(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildUsageExtensionKeyword(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - if (elementIndex < poco.OwnedRelationship.Count) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + + if (ownedRelationshipCursor.Current != null) { - var elementForOwnedRelationship = poco.OwnedRelationship[elementIndex]; - if (elementForOwnedRelationship is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership elementAsOwningMembership) { - OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(elementAsOwningMembership, stringBuilder); + OwningMembershipTextualNotationBuilder.BuildPrefixMetadataMember(elementAsOwningMembership, cursorCache, stringBuilder); } } + ownedRelationshipCursor.Move(); + - return elementIndex; } /// /// Builds the Textual Notation string for the rule UnextendedUsagePrefix - /// UnextendedUsagePrefix:Usage=EndUsagePrefix|BasicUsagePrefix + /// UnextendedUsagePrefix:Usage=EndUsagePrefix|BasicUsagePrefix /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildUnextendedUsagePrefix(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + public static void BuildUnextendedUsagePrefix(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); + switch (poco) + { + case SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage pocoUsageBasicUsagePrefix when pocoUsageBasicUsagePrefix.IsDerived: + BuildBasicUsagePrefix(pocoUsageBasicUsagePrefix, cursorCache, stringBuilder); + break; + default: + BuildEndUsagePrefix(poco, cursorCache, stringBuilder); + break; + } + } /// /// Builds the Textual Notation string for the rule UsagePrefix - /// UsagePrefix:Usage=UnextendedUsagePrefixUsageExtensionKeyword* + /// UsagePrefix:Usage=UnextendedUsagePrefixUsageExtensionKeyword* /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildUsagePrefix(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + public static void BuildUsagePrefix(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildUnextendedUsagePrefix(poco, stringBuilder); - // Handle collection Non Terminal - for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + BuildUnextendedUsagePrefix(poco, cursorCache, stringBuilder); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + while (ownedRelationshipCursor.Current != null) { - ownedRelationshipIndex = BuildUsageExtensionKeyword(poco, ownedRelationshipIndex, stringBuilder); + BuildUsageExtensionKeyword(poco, cursorCache, stringBuilder); } + } /// /// Builds the Textual Notation string for the rule UsageDeclaration - /// UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? + /// UsageDeclaration:Usage=IdentificationFeatureSpecializationPart? /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildUsageDeclaration(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + public static void BuildUsageDeclaration(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - ElementTextualNotationBuilder.BuildIdentification(poco, stringBuilder); - FeatureTextualNotationBuilder.BuildFeatureSpecializationPart(poco, stringBuilder); + ElementTextualNotationBuilder.BuildIdentification(poco, cursorCache, stringBuilder); + + if (poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || poco.IsOrdered) + { + FeatureTextualNotationBuilder.BuildFeatureSpecializationPart(poco, cursorCache, stringBuilder); + } } /// /// Builds the Textual Notation string for the rule UsageCompletion - /// UsageCompletion:Usage=ValuePart?UsageBody + /// UsageCompletion:Usage=ValuePart?UsageBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildUsageCompletion(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + public static void BuildUsageCompletion(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - FeatureTextualNotationBuilder.BuildValuePart(poco, 0, stringBuilder); - BuildUsageBody(poco, stringBuilder); + + if (poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || !string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.Direction.HasValue || poco.IsDerived || poco.IsAbstract || poco.IsConstant || poco.IsOrdered || poco.IsEnd || poco.importedMembership.Count != 0 || poco.IsComposite || poco.IsPortion || poco.IsVariable || poco.IsSufficient || poco.unioningType.Count != 0 || poco.intersectingType.Count != 0 || poco.differencingType.Count != 0 || poco.featuringType.Count != 0 || poco.ownedTypeFeaturing.Count != 0) + { + FeatureTextualNotationBuilder.BuildValuePart(poco, cursorCache, stringBuilder); + } + BuildUsageBody(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule UsageBody - /// UsageBody:Usage=DefinitionBody + /// UsageBody:Usage=DefinitionBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildUsageBody(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + public static void BuildUsageBody(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - TypeTextualNotationBuilder.BuildDefinitionBody(poco, stringBuilder); + TypeTextualNotationBuilder.BuildDefinitionBody(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule NonOccurrenceUsageElement - /// NonOccurrenceUsageElement:Usage=DefaultReferenceUsage|ReferenceUsage|AttributeUsage|EnumerationUsage|BindingConnectorAsUsage|SuccessionAsUsage|ExtendedUsage + /// NonOccurrenceUsageElement:Usage=DefaultReferenceUsage|ReferenceUsage|AttributeUsage|EnumerationUsage|BindingConnectorAsUsage|SuccessionAsUsage|ExtendedUsage /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildNonOccurrenceUsageElement(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + public static void BuildNonOccurrenceUsageElement(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); + switch (poco) + { + case SysML2.NET.Core.POCO.Systems.Connections.IBindingConnectorAsUsage pocoBindingConnectorAsUsage: + BindingConnectorAsUsageTextualNotationBuilder.BuildBindingConnectorAsUsage(pocoBindingConnectorAsUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Connections.ISuccessionAsUsage pocoSuccessionAsUsage: + SuccessionAsUsageTextualNotationBuilder.BuildSuccessionAsUsage(pocoSuccessionAsUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Enumerations.IEnumerationUsage pocoEnumerationUsage: + EnumerationUsageTextualNotationBuilder.BuildEnumerationUsage(pocoEnumerationUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage pocoReferenceUsageReferenceUsage when pocoReferenceUsageReferenceUsage.IsEnd: + ReferenceUsageTextualNotationBuilder.BuildReferenceUsage(pocoReferenceUsageReferenceUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage pocoReferenceUsage: + ReferenceUsageTextualNotationBuilder.BuildDefaultReferenceUsage(pocoReferenceUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Attributes.IAttributeUsage pocoAttributeUsage: + AttributeUsageTextualNotationBuilder.BuildAttributeUsage(pocoAttributeUsage, cursorCache, stringBuilder); + break; + default: + BuildExtendedUsage(poco, cursorCache, stringBuilder); + break; + } + } /// /// Builds the Textual Notation string for the rule OccurrenceUsageElement - /// OccurrenceUsageElement:Usage=StructureUsageElement|BehaviorUsageElement + /// OccurrenceUsageElement:Usage=StructureUsageElement|BehaviorUsageElement /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildOccurrenceUsageElement(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + public static void BuildOccurrenceUsageElement(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); + BuildOccurrenceUsageElementHandCoded(poco, cursorCache, stringBuilder); } /// /// 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 + /// 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 used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildStructureUsageElement(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + public static void BuildStructureUsageElement(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); + BuildStructureUsageElementHandCoded(poco, cursorCache, stringBuilder); } /// /// 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 + /// 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 used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildBehaviorUsageElement(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + public static void BuildBehaviorUsageElement(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { switch (poco) { - case SysML2.NET.Core.POCO.Systems.Calculations.CalculationUsage pocoCalculationUsage: - CalculationUsageTextualNotationBuilder.BuildCalculationUsage(pocoCalculationUsage, stringBuilder); + case SysML2.NET.Core.POCO.Systems.UseCases.IIncludeUseCaseUsage pocoIncludeUseCaseUsage: + IncludeUseCaseUsageTextualNotationBuilder.BuildIncludeUseCaseUsage(pocoIncludeUseCaseUsage, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.States.StateUsage pocoStateUsage: - StateUsageTextualNotationBuilder.BuildStateUsage(pocoStateUsage, stringBuilder); + case SysML2.NET.Core.POCO.Systems.Requirements.ISatisfyRequirementUsage pocoSatisfyRequirementUsage: + SatisfyRequirementUsageTextualNotationBuilder.BuildSatisfyRequirementUsage(pocoSatisfyRequirementUsage, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Actions.ActionUsage pocoActionUsage: - ActionUsageTextualNotationBuilder.BuildActionUsage(pocoActionUsage, stringBuilder); + case SysML2.NET.Core.POCO.Systems.Requirements.IConcernUsage pocoConcernUsage: + ConcernUsageTextualNotationBuilder.BuildConcernUsage(pocoConcernUsage, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Requirements.ConcernUsage pocoConcernUsage: - ConcernUsageTextualNotationBuilder.BuildConcernUsage(pocoConcernUsage, stringBuilder); + case SysML2.NET.Core.POCO.Systems.AnalysisCases.IAnalysisCaseUsage pocoAnalysisCaseUsage: + AnalysisCaseUsageTextualNotationBuilder.BuildAnalysisCaseUsage(pocoAnalysisCaseUsage, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Requirements.RequirementUsage pocoRequirementUsage: - RequirementUsageTextualNotationBuilder.BuildRequirementUsage(pocoRequirementUsage, stringBuilder); + case SysML2.NET.Core.POCO.Systems.VerificationCases.IVerificationCaseUsage pocoVerificationCaseUsage: + VerificationCaseUsageTextualNotationBuilder.BuildVerificationCaseUsage(pocoVerificationCaseUsage, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Constraints.ConstraintUsage pocoConstraintUsage: - ConstraintUsageTextualNotationBuilder.BuildConstraintUsage(pocoConstraintUsage, stringBuilder); + case SysML2.NET.Core.POCO.Systems.UseCases.IUseCaseUsage pocoUseCaseUsage: + UseCaseUsageTextualNotationBuilder.BuildUseCaseUsage(pocoUseCaseUsage, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.AnalysisCases.AnalysisCaseUsage pocoAnalysisCaseUsage: - AnalysisCaseUsageTextualNotationBuilder.BuildAnalysisCaseUsage(pocoAnalysisCaseUsage, stringBuilder); + case SysML2.NET.Core.POCO.Systems.Views.IViewpointUsage pocoViewpointUsage: + ViewpointUsageTextualNotationBuilder.BuildViewpointUsage(pocoViewpointUsage, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.VerificationCases.VerificationCaseUsage pocoVerificationCaseUsage: - VerificationCaseUsageTextualNotationBuilder.BuildVerificationCaseUsage(pocoVerificationCaseUsage, stringBuilder); + case SysML2.NET.Core.POCO.Systems.States.IExhibitStateUsage pocoExhibitStateUsage: + ExhibitStateUsageTextualNotationBuilder.BuildExhibitStateUsage(pocoExhibitStateUsage, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.UseCases.UseCaseUsage pocoUseCaseUsage: - UseCaseUsageTextualNotationBuilder.BuildUseCaseUsage(pocoUseCaseUsage, stringBuilder); + case SysML2.NET.Core.POCO.Systems.Constraints.IAssertConstraintUsage pocoAssertConstraintUsage: + AssertConstraintUsageTextualNotationBuilder.BuildAssertConstraintUsage(pocoAssertConstraintUsage, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Cases.CaseUsage pocoCaseUsage: - CaseUsageTextualNotationBuilder.BuildCaseUsage(pocoCaseUsage, stringBuilder); + case SysML2.NET.Core.POCO.Systems.Requirements.IRequirementUsage pocoRequirementUsage: + RequirementUsageTextualNotationBuilder.BuildRequirementUsage(pocoRequirementUsage, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Views.ViewpointUsage pocoViewpointUsage: - ViewpointUsageTextualNotationBuilder.BuildViewpointUsage(pocoViewpointUsage, stringBuilder); + case SysML2.NET.Core.POCO.Systems.Cases.ICaseUsage pocoCaseUsage: + CaseUsageTextualNotationBuilder.BuildCaseUsage(pocoCaseUsage, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.States.ExhibitStateUsage pocoExhibitStateUsage: - ExhibitStateUsageTextualNotationBuilder.BuildExhibitStateUsage(pocoExhibitStateUsage, stringBuilder); + case SysML2.NET.Core.POCO.Systems.Calculations.ICalculationUsage pocoCalculationUsage: + CalculationUsageTextualNotationBuilder.BuildCalculationUsage(pocoCalculationUsage, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.UseCases.IncludeUseCaseUsage pocoIncludeUseCaseUsage: - IncludeUseCaseUsageTextualNotationBuilder.BuildIncludeUseCaseUsage(pocoIncludeUseCaseUsage, stringBuilder); + case SysML2.NET.Core.POCO.Systems.Constraints.IConstraintUsage pocoConstraintUsage: + ConstraintUsageTextualNotationBuilder.BuildConstraintUsage(pocoConstraintUsage, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Actions.PerformActionUsage pocoPerformActionUsage: - PerformActionUsageTextualNotationBuilder.BuildPerformActionUsage(pocoPerformActionUsage, stringBuilder); + case SysML2.NET.Core.POCO.Systems.Actions.IPerformActionUsage pocoPerformActionUsage: + PerformActionUsageTextualNotationBuilder.BuildPerformActionUsage(pocoPerformActionUsage, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Requirements.SatisfyRequirementUsage pocoSatisfyRequirementUsage: - SatisfyRequirementUsageTextualNotationBuilder.BuildSatisfyRequirementUsage(pocoSatisfyRequirementUsage, stringBuilder); + case SysML2.NET.Core.POCO.Systems.States.IStateUsage pocoStateUsage: + StateUsageTextualNotationBuilder.BuildStateUsage(pocoStateUsage, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Constraints.AssertConstraintUsage pocoAssertConstraintUsage: - AssertConstraintUsageTextualNotationBuilder.BuildAssertConstraintUsage(pocoAssertConstraintUsage, stringBuilder); + case SysML2.NET.Core.POCO.Systems.Actions.IActionUsage pocoActionUsage: + ActionUsageTextualNotationBuilder.BuildActionUsage(pocoActionUsage, cursorCache, stringBuilder); break; } @@ -321,39 +384,41 @@ public static void BuildBehaviorUsageElement(SysML2.NET.Core.POCO.Systems.Defini /// /// 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 + /// 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 used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildVariantUsageElement(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + public static void BuildVariantUsageElement(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); + BuildVariantUsageElementHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule InterfaceNonOccurrenceUsageElement - /// InterfaceNonOccurrenceUsageElement:Usage=ReferenceUsage|AttributeUsage|EnumerationUsage|BindingConnectorAsUsage|SuccessionAsUsage + /// InterfaceNonOccurrenceUsageElement:Usage=ReferenceUsage|AttributeUsage|EnumerationUsage|BindingConnectorAsUsage|SuccessionAsUsage /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildInterfaceNonOccurrenceUsageElement(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + public static void BuildInterfaceNonOccurrenceUsageElement(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { switch (poco) { - case SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.ReferenceUsage pocoReferenceUsage: - ReferenceUsageTextualNotationBuilder.BuildReferenceUsage(pocoReferenceUsage, stringBuilder); + case SysML2.NET.Core.POCO.Systems.Connections.IBindingConnectorAsUsage pocoBindingConnectorAsUsage: + BindingConnectorAsUsageTextualNotationBuilder.BuildBindingConnectorAsUsage(pocoBindingConnectorAsUsage, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Enumerations.EnumerationUsage pocoEnumerationUsage: - EnumerationUsageTextualNotationBuilder.BuildEnumerationUsage(pocoEnumerationUsage, stringBuilder); + case SysML2.NET.Core.POCO.Systems.Connections.ISuccessionAsUsage pocoSuccessionAsUsage: + SuccessionAsUsageTextualNotationBuilder.BuildSuccessionAsUsage(pocoSuccessionAsUsage, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Attributes.AttributeUsage pocoAttributeUsage: - AttributeUsageTextualNotationBuilder.BuildAttributeUsage(pocoAttributeUsage, stringBuilder); + case SysML2.NET.Core.POCO.Systems.Enumerations.IEnumerationUsage pocoEnumerationUsage: + EnumerationUsageTextualNotationBuilder.BuildEnumerationUsage(pocoEnumerationUsage, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Connections.BindingConnectorAsUsage pocoBindingConnectorAsUsage: - BindingConnectorAsUsageTextualNotationBuilder.BuildBindingConnectorAsUsage(pocoBindingConnectorAsUsage, stringBuilder); + case SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage pocoReferenceUsage: + ReferenceUsageTextualNotationBuilder.BuildReferenceUsage(pocoReferenceUsage, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Connections.SuccessionAsUsage pocoSuccessionAsUsage: - SuccessionAsUsageTextualNotationBuilder.BuildSuccessionAsUsage(pocoSuccessionAsUsage, stringBuilder); + case SysML2.NET.Core.POCO.Systems.Attributes.IAttributeUsage pocoAttributeUsage: + AttributeUsageTextualNotationBuilder.BuildAttributeUsage(pocoAttributeUsage, cursorCache, stringBuilder); break; } @@ -361,57 +426,62 @@ public static void BuildInterfaceNonOccurrenceUsageElement(SysML2.NET.Core.POCO. /// /// Builds the Textual Notation string for the rule InterfaceOccurrenceUsageElement - /// InterfaceOccurrenceUsageElement:Usage=DefaultInterfaceEnd|StructureUsageElement|BehaviorUsageElement + /// InterfaceOccurrenceUsageElement:Usage=DefaultInterfaceEnd|StructureUsageElement|BehaviorUsageElement /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildInterfaceOccurrenceUsageElement(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + public static void BuildInterfaceOccurrenceUsageElement(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); + BuildInterfaceOccurrenceUsageElementHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule ActionTargetSuccession - /// ActionTargetSuccession:Usage=(TargetSuccession|GuardedTargetSuccession|DefaultTargetSuccession)UsageBody + /// ActionTargetSuccession:Usage=(TargetSuccession|GuardedTargetSuccession|DefaultTargetSuccession)UsageBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildActionTargetSuccession(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + public static void BuildActionTargetSuccession(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives with same referenced rule type not implemented yet"); + BuildActionTargetSuccessionHandCoded(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); - BuildUsageBody(poco, stringBuilder); + BuildUsageBody(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule ExtendedUsage - /// ExtendedUsage:Usage=UnextendedUsagePrefixUsageExtensionKeyword+Usage + /// ExtendedUsage:Usage=UnextendedUsagePrefixUsageExtensionKeyword+Usage /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildExtendedUsage(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + public static void BuildExtendedUsage(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildUnextendedUsagePrefix(poco, stringBuilder); - // Handle collection Non Terminal - for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < poco.OwnedRelationship.Count; ownedRelationshipIndex++) + BuildUnextendedUsagePrefix(poco, cursorCache, stringBuilder); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + while (ownedRelationshipCursor.Current != null) { - ownedRelationshipIndex = BuildUsageExtensionKeyword(poco, ownedRelationshipIndex, stringBuilder); + BuildUsageExtensionKeyword(poco, cursorCache, stringBuilder); } - BuildUsage(poco, stringBuilder); + + BuildUsage(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule Usage - /// Usage=UsageDeclarationUsageCompletion + /// Usage=UsageDeclarationUsageCompletion /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildUsage(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, StringBuilder stringBuilder) + public static void BuildUsage(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildUsageDeclaration(poco, stringBuilder); - BuildUsageCompletion(poco, stringBuilder); + BuildUsageDeclaration(poco, cursorCache, stringBuilder); + BuildUsageCompletion(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseDefinitionTextualNotationBuilder.cs index 2bff9828..d9ff0d45 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseDefinitionTextualNotationBuilder.cs @@ -36,18 +36,19 @@ public static partial class UseCaseDefinitionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule UseCaseDefinition - /// UseCaseDefinition=OccurrenceDefinitionPrefix'use''case''def'DefinitionDeclarationCaseBody + /// UseCaseDefinition=OccurrenceDefinitionPrefix'use''case''def'DefinitionDeclarationCaseBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildUseCaseDefinition(SysML2.NET.Core.POCO.Systems.UseCases.IUseCaseDefinition poco, StringBuilder stringBuilder) + public static void BuildUseCaseDefinition(SysML2.NET.Core.POCO.Systems.UseCases.IUseCaseDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("use "); stringBuilder.Append("case "); stringBuilder.Append("def "); - DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildCaseBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseUsageTextualNotationBuilder.cs index db106a74..03d329b5 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UseCaseUsageTextualNotationBuilder.cs @@ -36,19 +36,24 @@ public static partial class UseCaseUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule UseCaseUsage - /// UseCaseUsage=OccurrenceUsagePrefix'use''case'ConstraintUsageDeclarationCaseBody + /// UseCaseUsage=OccurrenceUsagePrefix'use''case'ConstraintUsageDeclarationCaseBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildUseCaseUsage(SysML2.NET.Core.POCO.Systems.UseCases.IUseCaseUsage poco, StringBuilder stringBuilder) + public static void BuildUseCaseUsage(SysML2.NET.Core.POCO.Systems.UseCases.IUseCaseUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("use "); stringBuilder.Append("case "); - UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); - FeatureTextualNotationBuilder.BuildValuePart(poco, 0, stringBuilder); + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, cursorCache, stringBuilder); - TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); + if (poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || !string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.Direction.HasValue || poco.IsDerived || poco.IsAbstract || poco.IsConstant || poco.IsOrdered || poco.IsEnd || poco.importedMembership.Count != 0 || poco.IsComposite || poco.IsPortion || poco.IsVariable || poco.IsSufficient || poco.unioningType.Count != 0 || poco.intersectingType.Count != 0 || poco.differencingType.Count != 0 || poco.featuringType.Count != 0 || poco.ownedTypeFeaturing.Count != 0) + { + FeatureTextualNotationBuilder.BuildValuePart(poco, cursorCache, stringBuilder); + } + + TypeTextualNotationBuilder.BuildCaseBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VariantMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VariantMembershipTextualNotationBuilder.cs index 779cd53e..7394daf1 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VariantMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VariantMembershipTextualNotationBuilder.cs @@ -36,38 +36,45 @@ public static partial class VariantMembershipTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule VariantUsageMember - /// VariantUsageMember:VariantMembership=MemberPrefix'variant'ownedVariantUsage=VariantUsageElement + /// VariantUsageMember:VariantMembership=MemberPrefix'variant'ownedVariantUsage=VariantUsageElement /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildVariantUsageMember(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IVariantMembership poco, StringBuilder stringBuilder) + public static void BuildVariantUsageMember(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IVariantMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("variant "); if (poco.ownedVariantUsage != null) { - UsageTextualNotationBuilder.BuildVariantUsageElement(poco.ownedVariantUsage, stringBuilder); + UsageTextualNotationBuilder.BuildVariantUsageElement(poco.ownedVariantUsage, cursorCache, stringBuilder); } } /// /// Builds the Textual Notation string for the rule EnumerationUsageMember - /// EnumerationUsageMember:VariantMembership=MemberPrefixownedRelatedElement+=EnumeratedValue + /// EnumerationUsageMember:VariantMembership=MemberPrefixownedRelatedElement+=EnumeratedValue /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildEnumerationUsageMember(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IVariantMembership poco, StringBuilder stringBuilder) + public static void BuildEnumerationUsageMember(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IVariantMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfEnumerationUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); - ownedRelatedElementOfEnumerationUsageIterator.MoveNext(); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); - if (ownedRelatedElementOfEnumerationUsageIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - EnumerationUsageTextualNotationBuilder.BuildEnumeratedValue(ownedRelatedElementOfEnumerationUsageIterator.Current, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.Enumerations.IEnumerationUsage elementAsEnumerationUsage) + { + EnumerationUsageTextualNotationBuilder.BuildEnumeratedValue(elementAsEnumerationUsage, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseDefinitionTextualNotationBuilder.cs index 18c99b5c..55dd3b6e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseDefinitionTextualNotationBuilder.cs @@ -36,17 +36,18 @@ public static partial class VerificationCaseDefinitionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule VerificationCaseDefinition - /// VerificationCaseDefinition=OccurrenceDefinitionPrefix'verification''def'DefinitionDeclarationCaseBody + /// VerificationCaseDefinition=OccurrenceDefinitionPrefix'verification''def'DefinitionDeclarationCaseBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildVerificationCaseDefinition(SysML2.NET.Core.POCO.Systems.VerificationCases.IVerificationCaseDefinition poco, StringBuilder stringBuilder) + public static void BuildVerificationCaseDefinition(SysML2.NET.Core.POCO.Systems.VerificationCases.IVerificationCaseDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("verification "); stringBuilder.Append("def "); - DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildCaseBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseUsageTextualNotationBuilder.cs index 8ac0c477..c163bc20 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VerificationCaseUsageTextualNotationBuilder.cs @@ -36,18 +36,23 @@ public static partial class VerificationCaseUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule VerificationCaseUsage - /// VerificationCaseUsage=OccurrenceUsagePrefix'verification'ConstraintUsageDeclarationCaseBody + /// VerificationCaseUsage=OccurrenceUsagePrefix'verification'ConstraintUsageDeclarationCaseBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildVerificationCaseUsage(SysML2.NET.Core.POCO.Systems.VerificationCases.IVerificationCaseUsage poco, StringBuilder stringBuilder) + public static void BuildVerificationCaseUsage(SysML2.NET.Core.POCO.Systems.VerificationCases.IVerificationCaseUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("verification "); - UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); - FeatureTextualNotationBuilder.BuildValuePart(poco, 0, stringBuilder); + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, cursorCache, stringBuilder); - TypeTextualNotationBuilder.BuildCaseBody(poco, stringBuilder); + if (poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || !string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.Direction.HasValue || poco.IsDerived || poco.IsAbstract || poco.IsConstant || poco.IsOrdered || poco.IsEnd || poco.importedMembership.Count != 0 || poco.IsComposite || poco.IsPortion || poco.IsVariable || poco.IsSufficient || poco.unioningType.Count != 0 || poco.intersectingType.Count != 0 || poco.differencingType.Count != 0 || poco.featuringType.Count != 0 || poco.ownedTypeFeaturing.Count != 0) + { + FeatureTextualNotationBuilder.BuildValuePart(poco, cursorCache, stringBuilder); + } + + TypeTextualNotationBuilder.BuildCaseBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs index 4f3c2bde..5df62f02 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs @@ -24,7 +24,6 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; @@ -37,54 +36,52 @@ public static partial class ViewDefinitionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule ViewDefinitionBody - /// ViewDefinitionBody:ViewDefinition=';'|'{'ViewDefinitionBodyItem*'}' + /// ViewDefinitionBody:ViewDefinition=';'|'{'ViewDefinitionBodyItem*'}' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildViewDefinitionBody(SysML2.NET.Core.POCO.Systems.Views.IViewDefinition poco, StringBuilder stringBuilder) + public static void BuildViewDefinitionBody(SysML2.NET.Core.POCO.Systems.Views.IViewDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildViewDefinitionBodyHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule ViewDefinitionBodyItem - /// ViewDefinitionBodyItem:ViewDefinition=DefinitionBodyItem|ownedRelationship+=ElementFilterMember|ownedRelationship+=ViewRenderingMember + /// ViewDefinitionBodyItem:ViewDefinition=DefinitionBodyItem|ownedRelationship+=ElementFilterMember|ownedRelationship+=ViewRenderingMember /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildViewDefinitionBodyItem(SysML2.NET.Core.POCO.Systems.Views.IViewDefinition poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildViewDefinitionBodyItem(SysML2.NET.Core.POCO.Systems.Views.IViewDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - var elementsElement = poco.OwnedRelationship[elementIndex]; - - switch (elementsElement) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + switch (ownedRelationshipCursor.Current) { - case SysML2.NET.Core.POCO.Kernel.Packages.ElementFilterMembership elementFilterMembership: - ElementFilterMembershipTextualNotationBuilder.BuildElementFilterMember(elementFilterMembership, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Views.ViewRenderingMembership viewRenderingMembership: - ViewRenderingMembershipTextualNotationBuilder.BuildViewRenderingMember(viewRenderingMembership, stringBuilder); break; + case SysML2.NET.Core.POCO.Systems.Views.IViewRenderingMembership viewRenderingMembership: + ViewRenderingMembershipTextualNotationBuilder.BuildViewRenderingMember(viewRenderingMembership, cursorCache, stringBuilder); break; + case SysML2.NET.Core.POCO.Kernel.Packages.IElementFilterMembership elementFilterMembership: + ElementFilterMembershipTextualNotationBuilder.BuildElementFilterMember(elementFilterMembership, cursorCache, stringBuilder); break; case SysML2.NET.Core.POCO.Core.Types.IType type: - elementIndex = TypeTextualNotationBuilder.BuildDefinitionBodyItem(type, elementIndex, stringBuilder); - break; + TypeTextualNotationBuilder.BuildDefinitionBodyItem(type, cursorCache, stringBuilder); break; } - return elementIndex; } /// /// Builds the Textual Notation string for the rule ViewDefinition - /// ViewDefinition=OccurrenceDefinitionPrefix'view''def'DefinitionDeclarationViewDefinitionBody + /// ViewDefinition=OccurrenceDefinitionPrefix'view''def'DefinitionDeclarationViewDefinitionBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildViewDefinition(SysML2.NET.Core.POCO.Systems.Views.IViewDefinition poco, StringBuilder stringBuilder) + public static void BuildViewDefinition(SysML2.NET.Core.POCO.Systems.Views.IViewDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("view "); stringBuilder.Append("def "); - DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); - BuildViewDefinitionBody(poco, stringBuilder); + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, cursorCache, stringBuilder); + BuildViewDefinitionBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewRenderingMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewRenderingMembershipTextualNotationBuilder.cs index 9a42180b..ccbcd43e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewRenderingMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewRenderingMembershipTextualNotationBuilder.cs @@ -36,21 +36,27 @@ public static partial class ViewRenderingMembershipTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule ViewRenderingMember - /// ViewRenderingMember:ViewRenderingMembership=MemberPrefix'render'ownedRelatedElement+=ViewRenderingUsage + /// ViewRenderingMember:ViewRenderingMembership=MemberPrefix'render'ownedRelatedElement+=ViewRenderingUsage /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildViewRenderingMember(SysML2.NET.Core.POCO.Systems.Views.IViewRenderingMembership poco, StringBuilder stringBuilder) + public static void BuildViewRenderingMember(SysML2.NET.Core.POCO.Systems.Views.IViewRenderingMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelatedElementOfRenderingUsageIterator = poco.OwnedRelatedElement.OfType().GetEnumerator(); - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, stringBuilder); + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("render "); - ownedRelatedElementOfRenderingUsageIterator.MoveNext(); - if (ownedRelatedElementOfRenderingUsageIterator.Current != null) + if (ownedRelatedElementCursor.Current != null) { - RenderingUsageTextualNotationBuilder.BuildViewRenderingUsage(ownedRelatedElementOfRenderingUsageIterator.Current, 0, stringBuilder); + + if (ownedRelatedElementCursor.Current is SysML2.NET.Core.POCO.Systems.Views.IRenderingUsage elementAsRenderingUsage) + { + RenderingUsageTextualNotationBuilder.BuildViewRenderingUsage(elementAsRenderingUsage, cursorCache, stringBuilder); + } } + ownedRelatedElementCursor.Move(); + } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs index 6b0343cb..8bb7ca0d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs @@ -24,7 +24,6 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; using System.Linq; using System.Text; @@ -37,56 +36,62 @@ public static partial class ViewUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule ViewBody - /// ViewBody:ViewUsage=';'|'{'ViewBodyItem*'}' + /// ViewBody:ViewUsage=';'|'{'ViewBodyItem*'}' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildViewBody(SysML2.NET.Core.POCO.Systems.Views.IViewUsage poco, StringBuilder stringBuilder) + public static void BuildViewBody(SysML2.NET.Core.POCO.Systems.Views.IViewUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + BuildViewBodyHandCoded(poco, cursorCache, stringBuilder); } /// /// Builds the Textual Notation string for the rule ViewBodyItem - /// ViewBodyItem:ViewUsage=DefinitionBodyItem|ownedRelationship+=ElementFilterMember|ownedRelationship+=ViewRenderingMember|ownedRelationship+=Expose + /// ViewBodyItem:ViewUsage=DefinitionBodyItem|ownedRelationship+=ElementFilterMember|ownedRelationship+=ViewRenderingMember|ownedRelationship+=Expose /// /// The from which the rule should be build - /// The index of the to process inside the collection + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - /// The index of the next to be processed inside the collection - public static int BuildViewBodyItem(SysML2.NET.Core.POCO.Systems.Views.IViewUsage poco, int elementIndex, StringBuilder stringBuilder) + public static void BuildViewBodyItem(SysML2.NET.Core.POCO.Systems.Views.IViewUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - var elementsElement = poco.OwnedRelationship[elementIndex]; - - switch (elementsElement) + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + switch (ownedRelationshipCursor.Current) { - case SysML2.NET.Core.POCO.Kernel.Packages.ElementFilterMembership elementFilterMembership: - ElementFilterMembershipTextualNotationBuilder.BuildElementFilterMember(elementFilterMembership, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Views.ViewRenderingMembership viewRenderingMembership: - ViewRenderingMembershipTextualNotationBuilder.BuildViewRenderingMember(viewRenderingMembership, stringBuilder); break; + case SysML2.NET.Core.POCO.Systems.Views.IViewRenderingMembership viewRenderingMembership: + ViewRenderingMembershipTextualNotationBuilder.BuildViewRenderingMember(viewRenderingMembership, cursorCache, stringBuilder); break; + case SysML2.NET.Core.POCO.Kernel.Packages.IElementFilterMembership elementFilterMembership: + ElementFilterMembershipTextualNotationBuilder.BuildElementFilterMember(elementFilterMembership, cursorCache, stringBuilder); break; case SysML2.NET.Core.POCO.Systems.Views.IExpose expose: - ExposeTextualNotationBuilder.BuildExpose(expose, stringBuilder); break; + ExposeTextualNotationBuilder.BuildExpose(expose, cursorCache, stringBuilder); break; case SysML2.NET.Core.POCO.Core.Types.IType type: - elementIndex = TypeTextualNotationBuilder.BuildDefinitionBodyItem(type, elementIndex, stringBuilder); - break; + TypeTextualNotationBuilder.BuildDefinitionBodyItem(type, cursorCache, stringBuilder); break; } - return elementIndex; } /// /// Builds the Textual Notation string for the rule ViewUsage - /// ViewUsage=OccurrenceUsagePrefix'view'UsageDeclaration?ValuePart?ViewBody + /// ViewUsage=OccurrenceUsagePrefix'view'UsageDeclaration?ValuePart?ViewBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildViewUsage(SysML2.NET.Core.POCO.Systems.Views.IViewUsage poco, StringBuilder stringBuilder) + public static void BuildViewUsage(SysML2.NET.Core.POCO.Systems.Views.IViewUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("view "); - UsageTextualNotationBuilder.BuildUsageDeclaration(poco, stringBuilder); - FeatureTextualNotationBuilder.BuildValuePart(poco, 0, stringBuilder); - BuildViewBody(poco, stringBuilder); + + if (!string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || poco.IsOrdered) + { + UsageTextualNotationBuilder.BuildUsageDeclaration(poco, cursorCache, stringBuilder); + } + + if (poco.OwnedRelationship.Count != 0 || poco.type.Count != 0 || poco.chainingFeature.Count != 0 || !string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName) || poco.Direction.HasValue || poco.IsDerived || poco.IsAbstract || poco.IsConstant || poco.IsOrdered || poco.IsEnd || poco.importedMembership.Count != 0 || poco.IsComposite || poco.IsPortion || poco.IsVariable || poco.IsSufficient || poco.unioningType.Count != 0 || poco.intersectingType.Count != 0 || poco.differencingType.Count != 0 || poco.featuringType.Count != 0 || poco.ownedTypeFeaturing.Count != 0) + { + FeatureTextualNotationBuilder.BuildValuePart(poco, cursorCache, stringBuilder); + } + BuildViewBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointDefinitionTextualNotationBuilder.cs index ed73cc1f..729b6641 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointDefinitionTextualNotationBuilder.cs @@ -36,17 +36,18 @@ public static partial class ViewpointDefinitionTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule ViewpointDefinition - /// ViewpointDefinition=OccurrenceDefinitionPrefix'viewpoint''def'DefinitionDeclarationRequirementBody + /// ViewpointDefinition=OccurrenceDefinitionPrefix'viewpoint''def'DefinitionDeclarationRequirementBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildViewpointDefinition(SysML2.NET.Core.POCO.Systems.Views.IViewpointDefinition poco, StringBuilder stringBuilder) + public static void BuildViewpointDefinition(SysML2.NET.Core.POCO.Systems.Views.IViewpointDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, stringBuilder); + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinitionPrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("viewpoint "); stringBuilder.Append("def "); - DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildRequirementBody(poco, stringBuilder); + DefinitionTextualNotationBuilder.BuildDefinitionDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildRequirementBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointUsageTextualNotationBuilder.cs index 58d03e70..560d8ee2 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewpointUsageTextualNotationBuilder.cs @@ -36,16 +36,17 @@ public static partial class ViewpointUsageTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule ViewpointUsage - /// ViewpointUsage=OccurrenceUsagePrefix'viewpoint'ConstraintUsageDeclarationRequirementBody + /// ViewpointUsage=OccurrenceUsagePrefix'viewpoint'ConstraintUsageDeclarationRequirementBody /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildViewpointUsage(SysML2.NET.Core.POCO.Systems.Views.IViewpointUsage poco, StringBuilder stringBuilder) + public static void BuildViewpointUsage(SysML2.NET.Core.POCO.Systems.Views.IViewpointUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, stringBuilder); + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsagePrefix(poco, cursorCache, stringBuilder); stringBuilder.Append("viewpoint "); - ConstraintUsageTextualNotationBuilder.BuildConstraintUsageDeclaration(poco, stringBuilder); - TypeTextualNotationBuilder.BuildRequirementBody(poco, stringBuilder); + ConstraintUsageTextualNotationBuilder.BuildConstraintUsageDeclaration(poco, cursorCache, stringBuilder); + TypeTextualNotationBuilder.BuildRequirementBody(poco, cursorCache, stringBuilder); } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VisibilityKindTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VisibilityKindTextualNotationBuilder.cs index da48d0a7..26ddc2d4 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VisibilityKindTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/VisibilityKindTextualNotationBuilder.cs @@ -36,11 +36,12 @@ public static partial class VisibilityKindTextualNotationBuilder { /// /// Builds the Textual Notation string for the rule VisibilityIndicator - /// VisibilityIndicator:VisibilityKind='public'|'private'|'protected' + /// VisibilityIndicator:VisibilityKind='public'|'private'|'protected' /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildVisibilityIndicator(SysML2.NET.Core.Root.Namespaces.VisibilityKind poco, StringBuilder stringBuilder) + public static void BuildVisibilityIndicator(SysML2.NET.Core.Root.Namespaces.VisibilityKind poco, ICursorCache cursorCache, StringBuilder stringBuilder) { } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/WhileLoopActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/WhileLoopActionUsageTextualNotationBuilder.cs index b8688b8e..63cfd79d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/WhileLoopActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/WhileLoopActionUsageTextualNotationBuilder.cs @@ -36,33 +36,42 @@ 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';')? + /// WhileLoopNode:WhileLoopActionUsage=ActionNodePrefix('while'ownedRelationship+=ExpressionParameterMember|'loop'ownedRelationship+=EmptyParameterMember)ownedRelationship+=ActionBodyParameterMember('until'ownedRelationship+=ExpressionParameterMember';')? /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - public static void BuildWhileLoopNode(SysML2.NET.Core.POCO.Systems.Actions.IWhileLoopActionUsage poco, StringBuilder stringBuilder) + public static void BuildWhileLoopNode(SysML2.NET.Core.POCO.Systems.Actions.IWhileLoopActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - using var ownedRelationshipOfParameterMembershipIterator = poco.OwnedRelationship.OfType().GetEnumerator(); - ActionUsageTextualNotationBuilder.BuildActionNodePrefix(poco, stringBuilder); - throw new System.NotSupportedException("Multiple alternatives not implemented yet"); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + ActionUsageTextualNotationBuilder.BuildActionNodePrefix(poco, cursorCache, stringBuilder); + BuildWhileLoopNodeHandCoded(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); - ownedRelationshipOfParameterMembershipIterator.MoveNext(); - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildActionBodyParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildActionBodyParameterMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } + ownedRelationshipCursor.Move(); - if (ownedRelationshipOfParameterMembershipIterator.MoveNext()) + + if (ownedRelationshipCursor.Current != null) { stringBuilder.Append("until "); - if (ownedRelationshipOfParameterMembershipIterator.Current != null) + if (ownedRelationshipCursor.Current != null) { - ParameterMembershipTextualNotationBuilder.BuildExpressionParameterMember(ownedRelationshipOfParameterMembershipIterator.Current, 0, stringBuilder); + + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership elementAsParameterMembership) + { + ParameterMembershipTextualNotationBuilder.BuildExpressionParameterMember(elementAsParameterMembership, cursorCache, stringBuilder); + } } - stringBuilder.Append(";"); - stringBuilder.Append(' '); + stringBuilder.AppendLine(";"); } diff --git a/SysML2.NET/TextualNotation/BindingConnectorAsUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/BindingConnectorAsUsageTextualNotationBuilder.cs deleted file mode 100644 index 448b9cf4..00000000 --- a/SysML2.NET/TextualNotation/BindingConnectorAsUsageTextualNotationBuilder.cs +++ /dev/null @@ -1,40 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// 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/BindingConnectorTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/BindingConnectorTextualNotationBuilder.cs new file mode 100644 index 00000000..85087067 --- /dev/null +++ b/SysML2.NET/TextualNotation/BindingConnectorTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Kernel.Connectors; + + /// + /// Hand-coded part of the + /// + public static partial class BindingConnectorTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule BindingConnectorDeclaration + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildBindingConnectorDeclarationHandCoded(IBindingConnector poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildBindingConnectorDeclarationHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule FeaturePrefix + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildFeaturePrefixHandCoded(IBindingConnector poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildFeaturePrefixHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/BooleanExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/BooleanExpressionTextualNotationBuilder.cs new file mode 100644 index 00000000..db335954 --- /dev/null +++ b/SysML2.NET/TextualNotation/BooleanExpressionTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Kernel.Functions; + + /// + /// Hand-coded part of the + /// + public static partial class BooleanExpressionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule FeaturePrefix + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildFeaturePrefixHandCoded(IBooleanExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildFeaturePrefixHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/CommentTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/CommentTextualNotationBuilder.cs deleted file mode 100644 index 02fa70d2..00000000 --- a/SysML2.NET/TextualNotation/CommentTextualNotationBuilder.cs +++ /dev/null @@ -1,40 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// 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 deleted file mode 100644 index 08b21374..00000000 --- a/SysML2.NET/TextualNotation/CommonTextualNotationBuilder.cs +++ /dev/null @@ -1,54 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// 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/ConcernUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/ConcernUsageTextualNotationBuilder.cs new file mode 100644 index 00000000..143191f6 --- /dev/null +++ b/SysML2.NET/TextualNotation/ConcernUsageTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Systems.Requirements; + + /// + /// Hand-coded part of the + /// + public static partial class ConcernUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule FramedConcernUsage + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildFramedConcernUsageHandCoded(IConcernUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildFramedConcernUsageHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/ConjugatedPortTypingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/ConjugatedPortTypingTextualNotationBuilder.cs index afe670eb..79217c93 100644 --- a/SysML2.NET/TextualNotation/ConjugatedPortTypingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/ConjugatedPortTypingTextualNotationBuilder.cs @@ -33,8 +33,9 @@ public static partial class ConjugatedPortTypingTextualNotationBuilder /// Build the originalPortDefinition=~[QualifiedName] rule part /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - private static void BuildOriginalPortDefinition(IConjugatedPortTyping poco, StringBuilder stringBuilder) + private static void BuildOriginalPortDefinition(IConjugatedPortTyping poco, ICursorCache cursorCache, StringBuilder stringBuilder) { } } diff --git a/SysML2.NET/TextualNotation/ConjugationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/ConjugationTextualNotationBuilder.cs index cb62745f..6fed8912 100644 --- a/SysML2.NET/TextualNotation/ConjugationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/ConjugationTextualNotationBuilder.cs @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // // // Copyright 2022-2026 Starion Group S.A. @@ -20,21 +20,35 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Core.Types; /// - /// Hand-coded part of the + /// Hand-coded part of the /// public static partial class ConjugationTextualNotationBuilder { /// - /// Builds the conditional part for the Conjugation rule + /// Builds the Textual Notation string for the rule Conjugation + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildConjugationHandCoded(IConjugation poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildConjugationHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule OwnedConjugation /// - /// The - /// The assertion of the condition - private static bool BuildGroupConditionForConjugation(IConjugation poco) + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildOwnedConjugationHandCoded(IConjugation poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - return CommonTextualNotationBuilder.DoesDefinesIdentificationProperties(poco); + throw new System.NotSupportedException("BuildOwnedConjugationHandCoded requires manual implementation"); } } } diff --git a/SysML2.NET/TextualNotation/ConnectionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/ConnectionUsageTextualNotationBuilder.cs new file mode 100644 index 00000000..7bb94bfe --- /dev/null +++ b/SysML2.NET/TextualNotation/ConnectionUsageTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Systems.Connections; + + /// + /// Hand-coded part of the + /// + public static partial class ConnectionUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ConnectionUsage + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildConnectionUsageHandCoded(IConnectionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildConnectionUsageHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule ConnectorPart + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildConnectorPartHandCoded(IConnectionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildConnectorPartHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/ConnectorTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/ConnectorTextualNotationBuilder.cs new file mode 100644 index 00000000..d4ea2b31 --- /dev/null +++ b/SysML2.NET/TextualNotation/ConnectorTextualNotationBuilder.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. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Text; + + using SysML2.NET.Core.POCO.Kernel.Connectors; + + /// + /// Hand-coded part of the + /// + public static partial class ConnectorTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule BinaryConnectorDeclaration + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildBinaryConnectorDeclarationHandCoded(IConnector poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildBinaryConnectorDeclarationHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule ConnectorDeclaration + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildConnectorDeclarationHandCoded(IConnector poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildConnectorDeclarationHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule Connector + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildConnectorHandCoded(IConnector poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildConnectorHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule FeaturePrefix + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildFeaturePrefixHandCoded(IConnector poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildFeaturePrefixHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/ConstraintUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/ConstraintUsageTextualNotationBuilder.cs new file mode 100644 index 00000000..3ee988a1 --- /dev/null +++ b/SysML2.NET/TextualNotation/ConstraintUsageTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Systems.Constraints; + + /// + /// Hand-coded part of the + /// + public static partial class ConstraintUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule RequirementConstraintUsage + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildRequirementConstraintUsageHandCoded(IConstraintUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildRequirementConstraintUsageHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/CrossSubsettingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/CrossSubsettingTextualNotationBuilder.cs new file mode 100644 index 00000000..5a6144a3 --- /dev/null +++ b/SysML2.NET/TextualNotation/CrossSubsettingTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Core.Features; + + /// + /// Hand-coded part of the + /// + public static partial class CrossSubsettingTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule OwnedCrossSubsetting + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildOwnedCrossSubsettingHandCoded(ICrossSubsetting poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildOwnedCrossSubsettingHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/DependencyTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/DependencyTextualNotationBuilder.cs deleted file mode 100644 index 1c400c22..00000000 --- a/SysML2.NET/TextualNotation/DependencyTextualNotationBuilder.cs +++ /dev/null @@ -1,40 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// 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 index 6d39056b..743d4a8c 100644 --- a/SysML2.NET/TextualNotation/DisjoiningTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/DisjoiningTextualNotationBuilder.cs @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // // // Copyright 2022-2026 Starion Group S.A. @@ -20,21 +20,35 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Core.Types; /// - /// Hand-coded part of the + /// Hand-coded part of the /// public static partial class DisjoiningTextualNotationBuilder { /// - /// Builds the conditional part for the Disjoining rule + /// Builds the Textual Notation string for the rule Disjoining + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildDisjoiningHandCoded(IDisjoining poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildDisjoiningHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule OwnedDisjoining /// - /// The - /// The assertion of the condition - private static bool BuildGroupConditionForDisjoining(IDisjoining poco) + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildOwnedDisjoiningHandCoded(IDisjoining poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - return CommonTextualNotationBuilder.DoesDefinesIdentificationProperties(poco); + throw new System.NotSupportedException("BuildOwnedDisjoiningHandCoded requires manual implementation"); } } } diff --git a/SysML2.NET/TextualNotation/ElementTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/ElementTextualNotationBuilder.cs new file mode 100644 index 00000000..0d3e8ada --- /dev/null +++ b/SysML2.NET/TextualNotation/ElementTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// Hand-coded part of the + /// + public static partial class ElementTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule DefinitionElement + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildDefinitionElementHandCoded(IElement poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildDefinitionElementHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/EventOccurrenceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/EventOccurrenceUsageTextualNotationBuilder.cs new file mode 100644 index 00000000..70051e45 --- /dev/null +++ b/SysML2.NET/TextualNotation/EventOccurrenceUsageTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Systems.Occurrences; + + /// + /// Hand-coded part of the + /// + public static partial class EventOccurrenceUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule EventOccurrenceUsage + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildEventOccurrenceUsageHandCoded(IEventOccurrenceUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildEventOccurrenceUsageHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/ExhibitStateUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/ExhibitStateUsageTextualNotationBuilder.cs new file mode 100644 index 00000000..82998363 --- /dev/null +++ b/SysML2.NET/TextualNotation/ExhibitStateUsageTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Systems.States; + + /// + /// Hand-coded part of the + /// + public static partial class ExhibitStateUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ExhibitStateUsage + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildExhibitStateUsageHandCoded(IExhibitStateUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildExhibitStateUsageHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/ExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/ExpressionTextualNotationBuilder.cs new file mode 100644 index 00000000..07b61b66 --- /dev/null +++ b/SysML2.NET/TextualNotation/ExpressionTextualNotationBuilder.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. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Text; + + using SysML2.NET.Core.POCO.Kernel.Functions; + + /// + /// Hand-coded part of the + /// + public static partial class ExpressionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule BaseExpression + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildBaseExpressionHandCoded(IExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildBaseExpressionHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule FeaturePrefix + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildFeaturePrefixHandCoded(IExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildFeaturePrefixHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule NonFeatureChainPrimaryExpression + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildNonFeatureChainPrimaryExpressionHandCoded(IExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildNonFeatureChainPrimaryExpressionHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule OwnedExpression + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildOwnedExpressionHandCoded(IExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildOwnedExpressionHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule SequenceExpressionList + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildSequenceExpressionListHandCoded(IExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildSequenceExpressionListHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/FeatureInvertingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/FeatureInvertingTextualNotationBuilder.cs index d4d7a919..57be40cf 100644 --- a/SysML2.NET/TextualNotation/FeatureInvertingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/FeatureInvertingTextualNotationBuilder.cs @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // // // Copyright 2022-2026 Starion Group S.A. @@ -20,23 +20,35 @@ namespace SysML2.NET.TextualNotation { - using System.Buffers; + using System.Text; using SysML2.NET.Core.POCO.Core.Features; /// - /// Hand-coded part of the + /// Hand-coded part of the /// public static partial class FeatureInvertingTextualNotationBuilder { /// - /// Builds the conditional part for the FeatureInverting rule + /// Builds the Textual Notation string for the rule FeatureInverting /// - /// The - /// The assertion of the condition - private static bool BuildGroupConditionForFeatureInverting(IFeatureInverting poco) + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildFeatureInvertingHandCoded(IFeatureInverting poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - return CommonTextualNotationBuilder.DoesDefinesIdentificationProperties(poco); + throw new System.NotSupportedException("BuildFeatureInvertingHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule OwnedFeatureInverting + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildOwnedFeatureInvertingHandCoded(IFeatureInverting poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildOwnedFeatureInvertingHandCoded requires manual implementation"); } } } diff --git a/SysML2.NET/TextualNotation/FeatureMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/FeatureMembershipTextualNotationBuilder.cs index e1c0ddbf..56c95c69 100644 --- a/SysML2.NET/TextualNotation/FeatureMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/FeatureMembershipTextualNotationBuilder.cs @@ -22,6 +22,7 @@ namespace SysML2.NET.TextualNotation { using System.Text; + using SysML2.NET.Core.POCO.Core.Features; using SysML2.NET.Core.POCO.Core.Types; /// @@ -33,9 +34,43 @@ public static partial class FeatureMembershipTextualNotationBuilder /// Build the memberFeature=[QualifiedName] of the rule /// /// The from which the rule should be build + /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - private static void BuildMemberFeature(IFeatureMembership poco, StringBuilder stringBuilder) + private static void BuildMemberFeature(IFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { } + + /// + /// Builds the Textual Notation string for the rule ActionBehaviorMember + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildActionBehaviorMemberHandCoded(IFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildActionBehaviorMemberHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule EntryTransitionMember + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildEntryTransitionMemberHandCoded(IFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildEntryTransitionMemberHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule SequenceExpressionList + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildSequenceExpressionListHandCoded(IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildSequenceExpressionListHandCoded requires manual implementation"); + } } } diff --git a/SysML2.NET/TextualNotation/FeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/FeatureTextualNotationBuilder.cs new file mode 100644 index 00000000..2b2df1b2 --- /dev/null +++ b/SysML2.NET/TextualNotation/FeatureTextualNotationBuilder.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. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Text; + + using SysML2.NET.Core.POCO.Core.Features; + + /// + /// Hand-coded part of the + /// + public static partial class FeatureTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ArgumentList + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildArgumentListHandCoded(IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildArgumentListHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule BasicFeaturePrefix + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildBasicFeaturePrefixHandCoded(IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildBasicFeaturePrefixHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule DEFINED_BY + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildDEFINED_BYHandCoded(IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildDEFINED_BYHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule FeatureDeclaration + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildFeatureDeclarationHandCoded(IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildFeatureDeclarationHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule Feature + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildFeatureHandCoded(IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildFeatureHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule FeatureIdentification + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildFeatureIdentificationHandCoded(IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildFeatureIdentificationHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule FeatureRelationshipPart + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildFeatureRelationshipPartHandCoded(IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildFeatureRelationshipPartHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule FeatureSpecialization + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildFeatureSpecializationHandCoded(IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildFeatureSpecializationHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule FeatureSpecializationPart + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildFeatureSpecializationPartHandCoded(IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildFeatureSpecializationPartHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule MultiplicityPart + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildMultiplicityPartHandCoded(IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildMultiplicityPartHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule PayloadFeature + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildPayloadFeatureHandCoded(IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildPayloadFeatureHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule PayloadFeatureSpecializationPart + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildPayloadFeatureSpecializationPartHandCoded(IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildPayloadFeatureSpecializationPartHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/FeatureTypingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/FeatureTypingTextualNotationBuilder.cs new file mode 100644 index 00000000..5b52a836 --- /dev/null +++ b/SysML2.NET/TextualNotation/FeatureTypingTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Core.Features; + + /// + /// Hand-coded part of the + /// + public static partial class FeatureTypingTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule OwnedFeatureTyping + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildOwnedFeatureTypingHandCoded(IFeatureTyping poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildOwnedFeatureTypingHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/FeatureValueTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/FeatureValueTextualNotationBuilder.cs new file mode 100644 index 00000000..10d3c9e3 --- /dev/null +++ b/SysML2.NET/TextualNotation/FeatureValueTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Kernel.FeatureValues; + + /// + /// Hand-coded part of the + /// + public static partial class FeatureValueTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule FeatureValue + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildFeatureValueHandCoded(IFeatureValue poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildFeatureValueHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/FlowTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/FlowTextualNotationBuilder.cs new file mode 100644 index 00000000..b944faf7 --- /dev/null +++ b/SysML2.NET/TextualNotation/FlowTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Kernel.Interactions; + + /// + /// Hand-coded part of the + /// + public static partial class FlowTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule FeaturePrefix + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildFeaturePrefixHandCoded(IFlow poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildFeaturePrefixHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule FlowDeclaration + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildFlowDeclarationHandCoded(IFlow poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildFlowDeclarationHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/FlowUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/FlowUsageTextualNotationBuilder.cs new file mode 100644 index 00000000..3e835536 --- /dev/null +++ b/SysML2.NET/TextualNotation/FlowUsageTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Systems.Flows; + + /// + /// Hand-coded part of the + /// + public static partial class FlowUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule FlowDeclaration + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildFlowDeclarationHandCoded(IFlowUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildFlowDeclarationHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule MessageDeclaration + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildMessageDeclarationHandCoded(IFlowUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildMessageDeclarationHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/HandCoded/NamespaceTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/HandCoded/NamespaceTextualNotationBuilder.cs deleted file mode 100644 index ffe6677c..00000000 --- a/SysML2.NET/TextualNotation/HandCoded/NamespaceTextualNotationBuilder.cs +++ /dev/null @@ -1,238 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// 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.HandCoded -{ - using System.Text; - - using SysML2.NET.Core.POCO.Kernel.Functions; - using SysML2.NET.Core.POCO.Kernel.Metadata; - using SysML2.NET.Core.POCO.Kernel.Packages; - using SysML2.NET.Core.POCO.Root.Annotations; - using SysML2.NET.Core.POCO.Root.Elements; - using SysML2.NET.Core.POCO.Root.Namespaces; - using SysML2.NET.Core.POCO.Systems.DefinitionAndUsage; - - public static 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, ICursorCache cursorCache, StringBuilder stringBuilder) - { - // Should call the PackageBodyElement but since the rule focus on a Package type, have to grab the rule body - // Getting cursor since assignment with += on the ownedRelationship (on next rule since we do have do it multiple times since the '*') - var cursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - - // While loop since calling with '*' - - while (cursor.Current != null) - { - // Order based on inheritance - - switch (cursor.Current) - { - case SysML2.NET.Core.POCO.Kernel.Packages.IElementFilterMembership elementFilterMembership: - BuildElementFilterMember(elementFilterMembership, cursorCache, stringBuilder); - // Cursor.Move since we do have += - cursor.Move(); - break; - case SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership owningMembership: - BuildPackageMember(owningMembership, cursorCache, stringBuilder); - // Cursor.Move since we do have += - cursor.Move(); - break; - case SysML2.NET.Core.POCO.Root.Namespaces.IMembership membership: - BuildAliasMember(membership,cursorCache, stringBuilder); - // Cursor.Move since we do have += - cursor.Move(); - break; - case SysML2.NET.Core.POCO.Root.Namespaces.IImport import: - BuildImport(import, cursorCache, stringBuilder); - // Cursor.Move since we do have += - cursor.Move(); - break; - } - } - } - - private static void BuildImport(IImport poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - - } - - private static void BuildAliasMember(IMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); - stringBuilder.Append("alias"); - stringBuilder.Append(' '); - - if (!string.IsNullOrEmpty(poco.MemberShortName)) - { - // no white space since it's '<' - stringBuilder.Append("<"); - stringBuilder.Append(poco.MemberShortName); - stringBuilder.Append(">"); - stringBuilder.Append(' '); - } - - if (!string.IsNullOrEmpty(poco.MemberName)) - { - stringBuilder.Append(poco.MemberName); - stringBuilder.Append(' '); - } - - stringBuilder.Append("for"); - stringBuilder.Append(' '); - - stringBuilder.Append(poco.MemberElement.qualifiedName); - stringBuilder.Append(' '); - - BuildRelationshipBody(poco, cursorCache, stringBuilder); - } - - private static void BuildRelationshipBody(IRelationship poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - // Having an alternate case : condition is defined because the second part have to loop through all ownedRelationship - if (poco.OwnedRelationship.Count == 0) - { - stringBuilder.AppendLine(";"); - } - else - { - stringBuilder.AppendLine("{"); - - var cursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - - while (cursor.Current != null) - { - if (cursor.Current is IAnnotation annotation) - { - BuildOwnedAnnotation(annotation, cursorCache, stringBuilder); - } - - cursor.Move(); - } - - stringBuilder.AppendLine("}"); - } - } - - private static void BuildOwnedAnnotation(IAnnotation annotation, ICursorCache cursorCache, StringBuilder stringBuilder) - { - var cursor = cursorCache.GetOrCreateCursor(annotation.Id, "ownedRelatedElement", annotation.OwnedRelatedElement); - - if (cursor.TryGetCurrent(out var annotatingElement)) - { - BuildAnnotatingElement(annotatingElement , cursorCache, stringBuilder); - } - - cursor.Move(); - } - - private static void BuildAnnotatingElement(IAnnotatingElement poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - // Order based on inheritance - - switch (poco) - { - case IDocumentation documentation: - BuildDocumentation(documentation, cursorCache, stringBuilder); - break; - case IComment comment: - BuildComment(comment, cursorCache, stringBuilder); - break; - case ITextualRepresentation textualRepresentation: - BuildTextualRepresentation(textualRepresentation, cursorCache, stringBuilder); - break; - case IMetadataFeature metadataFeature: - BuildMetadataFeature(metadataFeature, cursorCache, stringBuilder); - break; - } - } - - private static void BuildMetadataFeature(IMetadataFeature metadataFeature, ICursorCache cursorCache, StringBuilder stringBuilder) - { - } - - private static void BuildTextualRepresentation(ITextualRepresentation textualRepresentation, ICursorCache cursorCache, StringBuilder stringBuilder) - { - } - - private static void BuildComment(IComment comment, ICursorCache cursorCache, StringBuilder stringBuilder) - { - } - - private static void BuildDocumentation(IDocumentation documentation, ICursorCache cursorCache, StringBuilder stringBuilder) - { - } - - private static void BuildPackageMember(IOwningMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); - - var cursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); - - switch (cursor.Current) - { - case SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage usage: - BuildUsageElement(usage, cursorCache, stringBuilder); - break; - case { } element: - BuildDefinitionElement(element, cursorCache, stringBuilder); - cursor.Move(); - break; - } - } - - private static void BuildDefinitionElement(IElement poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - } - - private static void BuildUsageElement(IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - } - - private static void BuildElementFilterMember(IElementFilterMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - MembershipTextualNotationBuilder.BuildMemberPrefix(poco, cursorCache, stringBuilder); - stringBuilder.Append("filter"); - stringBuilder.Append(' '); - - var cursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); - - if (cursor.Current is IExpression expression) - { - BuildOwnedExpression(expression, cursorCache, stringBuilder); - cursor.Move(); - } - - // Append line since it's one of : ';', '{', '}' - stringBuilder.AppendLine(";"); - } - - private static void BuildOwnedExpression(IExpression expression, ICursorCache cursorCache, StringBuilder stringBuilder) - { - } - } -} diff --git a/SysML2.NET/TextualNotation/IfActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/IfActionUsageTextualNotationBuilder.cs new file mode 100644 index 00000000..5de94c10 --- /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.Text; + + using SysML2.NET.Core.POCO.Systems.Actions; + + /// + /// Hand-coded part of the + /// + public static partial class IfActionUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule IfNode + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildIfNodeHandCoded(IIfActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildIfNodeHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/IncludeUseCaseUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/IncludeUseCaseUsageTextualNotationBuilder.cs new file mode 100644 index 00000000..2e73a8c4 --- /dev/null +++ b/SysML2.NET/TextualNotation/IncludeUseCaseUsageTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Systems.UseCases; + + /// + /// Hand-coded part of the + /// + public static partial class IncludeUseCaseUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule IncludeUseCaseUsage + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildIncludeUseCaseUsageHandCoded(IIncludeUseCaseUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildIncludeUseCaseUsageHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/InterfaceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/InterfaceUsageTextualNotationBuilder.cs new file mode 100644 index 00000000..c884c5f1 --- /dev/null +++ b/SysML2.NET/TextualNotation/InterfaceUsageTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Systems.Interfaces; + + /// + /// Hand-coded part of the + /// + public static partial class InterfaceUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule InterfacePart + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildInterfacePartHandCoded(IInterfaceUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildInterfacePartHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule InterfaceUsageDeclaration + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildInterfaceUsageDeclarationHandCoded(IInterfaceUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildInterfaceUsageDeclarationHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/InvariantTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/InvariantTextualNotationBuilder.cs new file mode 100644 index 00000000..3564fe43 --- /dev/null +++ b/SysML2.NET/TextualNotation/InvariantTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Kernel.Functions; + + /// + /// Hand-coded part of the + /// + public static partial class InvariantTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule FeaturePrefix + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildFeaturePrefixHandCoded(IInvariant poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildFeaturePrefixHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/InvocationExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/InvocationExpressionTextualNotationBuilder.cs index 8cd8fe57..5fca3771 100644 --- a/SysML2.NET/TextualNotation/InvocationExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/InvocationExpressionTextualNotationBuilder.cs @@ -32,9 +32,10 @@ public static partial class InvocationExpressionTextualNotationBuilder /// /// Build the non-existing InvocationTypeMember rule /// - /// The + /// The from which the rule should be built + /// The /// The - private static void BuildInvocationTypeMember(InvocationExpression invocationExpression, StringBuilder stringBuilder) + private static void BuildInvocationTypeMember(IInvocationExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { } } diff --git a/SysML2.NET/TextualNotation/LiteralExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/LiteralExpressionTextualNotationBuilder.cs index c70afaab..80c4e9df 100644 --- a/SysML2.NET/TextualNotation/LiteralExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/LiteralExpressionTextualNotationBuilder.cs @@ -33,8 +33,9 @@ public static partial class LiteralExpressionTextualNotationBuilder /// Build the Value rule for real /// /// The + /// The used to get access to CursorCollection for the current /// The - private static void BuildValue(ILiteralExpression poco, StringBuilder stringBuilder) + private static void BuildValue(ILiteralExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { } } diff --git a/SysML2.NET/TextualNotation/MembershipValidationExtensions.cs b/SysML2.NET/TextualNotation/MembershipValidationExtensions.cs new file mode 100644 index 00000000..2b480bd7 --- /dev/null +++ b/SysML2.NET/TextualNotation/MembershipValidationExtensions.cs @@ -0,0 +1,123 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// 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.Core.Types; + using SysML2.NET.Core.POCO.Root.Elements; + using SysML2.NET.Core.POCO.Root.Namespaces; + using SysML2.NET.Core.POCO.Systems.Allocations; + using SysML2.NET.Core.POCO.Systems.Connections; + using SysML2.NET.Core.POCO.Systems.DefinitionAndUsage; + using SysML2.NET.Core.POCO.Systems.Flows; + using SysML2.NET.Core.POCO.Systems.Interfaces; + using SysML2.NET.Core.POCO.Systems.Items; + using SysML2.NET.Core.POCO.Systems.Occurrences; + using SysML2.NET.Core.POCO.Systems.Parts; + using SysML2.NET.Core.POCO.Systems.Ports; + using SysML2.NET.Core.POCO.Systems.Views; + + /// + /// Extension methods for membership interfaces used in textual notation switch guards. + /// These provide the same validation logic as the concrete class methods but operate on interfaces. + /// + public static class MembershipValidationExtensions + { + /// + /// Asserts that the contains at least one + /// inside the collection + /// + /// The + /// True if one is contained in the + public static bool IsValidForNonFeatureMember(this IOwningMembership owningMembership) + { + return owningMembership.OwnedRelatedElement.OfType().Any(); + } + + /// + /// Asserts that the does not contain any + /// inside the collection + /// + /// The + /// True if no is contained in the + public static bool IsValidForFeatureMember(this IOwningMembership owningMembership) + { + return !owningMembership.IsValidForNonFeatureMember(); + } + + /// + /// Asserts that the contains at least one + /// inside the collection + /// + /// The + /// True if it contains one + public static bool IsValidForSourceSuccessionMember(this IFeatureMembership featureMembership) + { + return featureMembership.OwnedRelatedElement.OfType().Any(); + } + + /// + /// Asserts that the contains at least one + /// inside the collection + /// + /// The + /// True if it contains one + public static bool IsValidForOccurrenceUsageMember(this IFeatureMembership featureMembership) + { + return featureMembership.OwnedRelatedElement.OfType().Any(); + } + + /// + /// Asserts that the contains at least one + /// but no inside the collection + /// + /// The + /// True if it contains one but no + public static bool IsValidForNonOccurrenceUsageMember(this IFeatureMembership featureMembership) + { + return !featureMembership.IsValidForOccurrenceUsageMember() && featureMembership.OwnedRelatedElement.OfType().Any(); + } + + /// + /// Asserts that the has valid element types for StructureUsageMember + /// inside the collection + /// + /// The + /// True if contains any of the required element types + public static bool IsValidForStructureUsageMember(this IFeatureMembership featureMembership) + { + return featureMembership.OwnedRelatedElement.OfType().Any() + || featureMembership.OwnedRelatedElement.OfType().Any() + || featureMembership.OwnedRelatedElement.OfType().Any() + || featureMembership.OwnedRelatedElement.OfType().Any() + || featureMembership.OwnedRelatedElement.OfType().Any() + || featureMembership.OwnedRelatedElement.OfType().Any() + || featureMembership.OwnedRelatedElement.OfType().Any() + || featureMembership.OwnedRelatedElement.OfType().Any() + || featureMembership.OwnedRelatedElement.OfType().Any() + || featureMembership.OwnedRelatedElement.OfType().Any() + || featureMembership.OwnedRelatedElement.OfType().Any() + || featureMembership.OwnedRelatedElement.OfType().Any(); + } + } +} diff --git a/SysML2.NET/TextualNotation/MetadataFeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/MetadataFeatureTextualNotationBuilder.cs index e4f7f8f6..a9f2eda0 100644 --- a/SysML2.NET/TextualNotation/MetadataFeatureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/MetadataFeatureTextualNotationBuilder.cs @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // // // Copyright 2022-2026 Starion Group S.A. @@ -20,21 +20,24 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Kernel.Metadata; /// - /// Hand-coded part of the + /// Hand-coded part of the /// public static partial class MetadataFeatureTextualNotationBuilder { /// - /// Builds the conditional part for the MetadataFeatureDeclaration rule + /// Builds the Textual Notation string for the rule MetadataFeatureDeclaration /// - /// The - /// The assertion of the condition - private static bool BuildGroupConditionForMetadataFeatureDeclaration(IMetadataFeature poco) + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildMetadataFeatureDeclarationHandCoded(IMetadataFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - return CommonTextualNotationBuilder.DoesDefinesIdentificationProperties(poco); + throw new System.NotSupportedException("BuildMetadataFeatureDeclarationHandCoded requires manual implementation"); } } } diff --git a/SysML2.NET/TextualNotation/MetadataUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/MetadataUsageTextualNotationBuilder.cs index dea71f2f..b9b13082 100644 --- a/SysML2.NET/TextualNotation/MetadataUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/MetadataUsageTextualNotationBuilder.cs @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // // // Copyright 2022-2026 Starion Group S.A. @@ -20,21 +20,24 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Systems.Metadata; /// - /// Hand-coded part of the + /// Hand-coded part of the /// public static partial class MetadataUsageTextualNotationBuilder { /// - /// Builds the conditional part for the MetadataUsageDeclaration rule + /// Builds the Textual Notation string for the rule MetadataUsageDeclaration /// - /// The - /// The assertion of the condition - private static bool BuildGroupConditionForMetadataUsageDeclaration(IMetadataUsage poco) + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildMetadataUsageDeclarationHandCoded(IMetadataUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - return CommonTextualNotationBuilder.DoesDefinesIdentificationProperties(poco); + throw new System.NotSupportedException("BuildMetadataUsageDeclarationHandCoded requires manual implementation"); } } } diff --git a/SysML2.NET/TextualNotation/NamespaceImportTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/NamespaceImportTextualNotationBuilder.cs new file mode 100644 index 00000000..990eb34c --- /dev/null +++ b/SysML2.NET/TextualNotation/NamespaceImportTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Root.Namespaces; + + /// + /// Hand-coded part of the + /// + public static partial class NamespaceImportTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule NamespaceImport + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildNamespaceImportHandCoded(INamespaceImport poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildNamespaceImportHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/NamespaceTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/NamespaceTextualNotationBuilder.cs new file mode 100644 index 00000000..ffe623b9 --- /dev/null +++ b/SysML2.NET/TextualNotation/NamespaceTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Root.Namespaces; + + /// + /// Hand-coded part of the + /// + public static partial class NamespaceTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule NamespaceBody + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildNamespaceBodyHandCoded(INamespace poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildNamespaceBodyHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/NullExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/NullExpressionTextualNotationBuilder.cs new file mode 100644 index 00000000..6d0cb261 --- /dev/null +++ b/SysML2.NET/TextualNotation/NullExpressionTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Kernel.Expressions; + + /// + /// Hand-coded part of the + /// + public static partial class NullExpressionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule NullExpression + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildNullExpressionHandCoded(INullExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildNullExpressionHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/OperatorExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/OperatorExpressionTextualNotationBuilder.cs new file mode 100644 index 00000000..de4a43ca --- /dev/null +++ b/SysML2.NET/TextualNotation/OperatorExpressionTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Kernel.Expressions; + + /// + /// Hand-coded part of the + /// + public static partial class OperatorExpressionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ClassificationExpression + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildClassificationExpressionHandCoded(IOperatorExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildClassificationExpressionHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule MetaclassificationExpression + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildMetaclassificationExpressionHandCoded(IOperatorExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildMetaclassificationExpressionHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/OwningMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/OwningMembershipTextualNotationBuilder.cs new file mode 100644 index 00000000..e7ef52e4 --- /dev/null +++ b/SysML2.NET/TextualNotation/OwningMembershipTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Root.Namespaces; + + /// + /// Hand-coded part of the + /// + public static partial class OwningMembershipTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule NamespaceMember + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildNamespaceMemberHandCoded(IOwningMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildNamespaceMemberHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/PackageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/PackageTextualNotationBuilder.cs index 0ea35d1e..9ee90986 100644 --- a/SysML2.NET/TextualNotation/PackageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/PackageTextualNotationBuilder.cs @@ -32,10 +32,22 @@ public static partial class PackageTextualNotationBuilder /// /// Build the non-existing Filter Package import rule /// - /// The package + /// The from which the rule should be built + /// The /// The - private static void BuildFilterPackageImport(Package package, StringBuilder stringBuilder) + private static void BuildFilterPackageImport(IPackage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { } + + /// + /// Builds the Textual Notation string for the rule PackageBody + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildPackageBodyHandCoded(IPackage poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildPackageBodyHandCoded requires manual implementation"); + } } } diff --git a/SysML2.NET/TextualNotation/PerformActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/PerformActionUsageTextualNotationBuilder.cs index eb43b430..b887c9ab 100644 --- a/SysML2.NET/TextualNotation/PerformActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/PerformActionUsageTextualNotationBuilder.cs @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // // // Copyright 2022-2026 Starion Group S.A. @@ -20,21 +20,24 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Systems.Actions; /// - /// Hand-coded part of + /// Hand-coded part of the /// public static partial class PerformActionUsageTextualNotationBuilder { /// - /// Builds the conditional part for the TransitionPerformActionUsage rule + /// Builds the Textual Notation string for the rule PerformActionUsageDeclaration /// - /// The - /// The assertion of the condition - private static bool BuildGroupConditionForTransitionPerformActionUsage(IPerformActionUsage poco) + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildPerformActionUsageDeclarationHandCoded(IPerformActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - return poco.OwnedRelationship.Count != 0; + throw new System.NotSupportedException("BuildPerformActionUsageDeclarationHandCoded requires manual implementation"); } } } diff --git a/SysML2.NET/TextualNotation/RedefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/RedefinitionTextualNotationBuilder.cs index 6386e12f..9196f5d6 100644 --- a/SysML2.NET/TextualNotation/RedefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/RedefinitionTextualNotationBuilder.cs @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // // // Copyright 2022-2026 Starion Group S.A. @@ -20,21 +20,24 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Core.Features; /// - /// Hand-coded part of the + /// Hand-coded part of the /// public static partial class RedefinitionTextualNotationBuilder { /// - /// Builds the conditional part for the Redefinition rule + /// Builds the Textual Notation string for the rule OwnedRedefinition /// - /// The - /// The assertion of the condition - private static bool BuildGroupConditionForRedefinition(IRedefinition poco) + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildOwnedRedefinitionHandCoded(IRedefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - return CommonTextualNotationBuilder.DoesDefinesIdentificationProperties(poco); + throw new System.NotSupportedException("BuildOwnedRedefinitionHandCoded requires manual implementation"); } } } diff --git a/SysML2.NET/TextualNotation/ReferenceSubsettingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/ReferenceSubsettingTextualNotationBuilder.cs new file mode 100644 index 00000000..ccc12fb5 --- /dev/null +++ b/SysML2.NET/TextualNotation/ReferenceSubsettingTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Core.Features; + + /// + /// Hand-coded part of the + /// + public static partial class ReferenceSubsettingTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule FlowEndSubsetting + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildFlowEndSubsettingHandCoded(IReferenceSubsetting poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildFlowEndSubsettingHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule OwnedReferenceSubsetting + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildOwnedReferenceSubsettingHandCoded(IReferenceSubsetting poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildOwnedReferenceSubsettingHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/ReferenceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/ReferenceUsageTextualNotationBuilder.cs new file mode 100644 index 00000000..40ae79bd --- /dev/null +++ b/SysML2.NET/TextualNotation/ReferenceUsageTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Systems.DefinitionAndUsage; + + /// + /// Hand-coded part of the + /// + public static partial class ReferenceUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule PayloadParameter + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildPayloadParameterHandCoded(IReferenceUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildPayloadParameterHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/RelationshipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/RelationshipTextualNotationBuilder.cs new file mode 100644 index 00000000..090ba963 --- /dev/null +++ b/SysML2.NET/TextualNotation/RelationshipTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Root.Elements; + + /// + /// Hand-coded part of the + /// + public static partial class RelationshipTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule RelationshipOwnedElement + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildRelationshipOwnedElementHandCoded(IRelationship poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildRelationshipOwnedElementHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/RenderingUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/RenderingUsageTextualNotationBuilder.cs new file mode 100644 index 00000000..22962d6e --- /dev/null +++ b/SysML2.NET/TextualNotation/RenderingUsageTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Systems.Views; + + /// + /// Hand-coded part of the + /// + public static partial class RenderingUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ViewRenderingUsage + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildViewRenderingUsageHandCoded(IRenderingUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildViewRenderingUsageHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/RequirementConstraintMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/RequirementConstraintMembershipTextualNotationBuilder.cs new file mode 100644 index 00000000..e1221416 --- /dev/null +++ b/SysML2.NET/TextualNotation/RequirementConstraintMembershipTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Systems.Requirements; + + /// + /// Hand-coded part of the + /// + public static partial class RequirementConstraintMembershipTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule RequirementKind + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildRequirementKindHandCoded(IRequirementConstraintMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildRequirementKindHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/RequirementUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/RequirementUsageTextualNotationBuilder.cs new file mode 100644 index 00000000..40061316 --- /dev/null +++ b/SysML2.NET/TextualNotation/RequirementUsageTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Systems.Requirements; + + /// + /// Hand-coded part of the + /// + public static partial class RequirementUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule RequirementVerificationUsage + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildRequirementVerificationUsageHandCoded(IRequirementUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildRequirementVerificationUsageHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/SatisfyRequirementUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/SatisfyRequirementUsageTextualNotationBuilder.cs new file mode 100644 index 00000000..160c34f8 --- /dev/null +++ b/SysML2.NET/TextualNotation/SatisfyRequirementUsageTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Systems.Requirements; + + /// + /// Hand-coded part of the + /// + public static partial class SatisfyRequirementUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule SatisfyRequirementUsage + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildSatisfyRequirementUsageHandCoded(ISatisfyRequirementUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildSatisfyRequirementUsageHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/SendActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/SendActionUsageTextualNotationBuilder.cs index 3650ac5b..fd52eb66 100644 --- a/SysML2.NET/TextualNotation/SendActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/SendActionUsageTextualNotationBuilder.cs @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // // // Copyright 2022-2026 Starion Group S.A. @@ -20,21 +20,35 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Systems.Actions; /// - /// Hand-coded part of the + /// Hand-coded part of the /// public static partial class SendActionUsageTextualNotationBuilder { /// - /// Builds the conditional part for the TransitionSendActionUsage rule + /// Builds the Textual Notation string for the rule SendNode + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildSendNodeHandCoded(ISendActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildSendNodeHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule SenderReceiverPart /// - /// The - /// The assertion of the condition - private static bool BuildGroupConditionForTransitionSendActionUsage(ISendActionUsage poco) + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildSenderReceiverPartHandCoded(ISendActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - return poco.OwnedRelationship.Count != 0; + throw new System.NotSupportedException("BuildSenderReceiverPartHandCoded requires manual implementation"); } } } diff --git a/SysML2.NET/TextualNotation/SpecializationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/SpecializationTextualNotationBuilder.cs index 2b9367b2..14b675eb 100644 --- a/SysML2.NET/TextualNotation/SpecializationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/SpecializationTextualNotationBuilder.cs @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // // // Copyright 2022-2026 Starion Group S.A. @@ -20,21 +20,35 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Core.Types; /// - /// Hand-coded part of the + /// Hand-coded part of the /// public static partial class SpecializationTextualNotationBuilder { /// - /// Builds the conditional part for the Specialization rule + /// Builds the Textual Notation string for the rule GeneralType + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildGeneralTypeHandCoded(ISpecialization poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildGeneralTypeHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule SpecificType /// - /// The - /// The assertion of the condition - private static bool BuildGroupConditionForSpecialization(ISpecialization poco) + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildSpecificTypeHandCoded(ISpecialization poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - return CommonTextualNotationBuilder.DoesDefinesIdentificationProperties(poco); + throw new System.NotSupportedException("BuildSpecificTypeHandCoded requires manual implementation"); } } } diff --git a/SysML2.NET/TextualNotation/StateDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/StateDefinitionTextualNotationBuilder.cs new file mode 100644 index 00000000..ba440826 --- /dev/null +++ b/SysML2.NET/TextualNotation/StateDefinitionTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Systems.States; + + /// + /// Hand-coded part of the + /// + public static partial class StateDefinitionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule StateDefBody + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildStateDefBodyHandCoded(IStateDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildStateDefBodyHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/StateUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/StateUsageTextualNotationBuilder.cs new file mode 100644 index 00000000..e33bc58c --- /dev/null +++ b/SysML2.NET/TextualNotation/StateUsageTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Systems.States; + + /// + /// Hand-coded part of the + /// + public static partial class StateUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule StateUsageBody + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildStateUsageBodyHandCoded(IStateUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildStateUsageBodyHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/StepTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/StepTextualNotationBuilder.cs new file mode 100644 index 00000000..851a4efe --- /dev/null +++ b/SysML2.NET/TextualNotation/StepTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Kernel.Behaviors; + + /// + /// Hand-coded part of the + /// + public static partial class StepTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule FeaturePrefix + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildFeaturePrefixHandCoded(IStep poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildFeaturePrefixHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/SubclassificationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/SubclassificationTextualNotationBuilder.cs deleted file mode 100644 index ece86941..00000000 --- a/SysML2.NET/TextualNotation/SubclassificationTextualNotationBuilder.cs +++ /dev/null @@ -1,40 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// 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 index bda14aa0..5748c1d4 100644 --- a/SysML2.NET/TextualNotation/SubsettingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/SubsettingTextualNotationBuilder.cs @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // // // Copyright 2022-2026 Starion Group S.A. @@ -20,21 +20,24 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Core.Features; /// - /// Hand-coded part of the + /// Hand-coded part of the /// public static partial class SubsettingTextualNotationBuilder { /// - /// Builds the conditional part for the Subsetting rule + /// Builds the Textual Notation string for the rule OwnedSubsetting /// - /// The - /// The assertion of the condition - private static bool BuildGroupConditionForSubsetting(ISubsetting poco) + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildOwnedSubsettingHandCoded(ISubsetting poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - return CommonTextualNotationBuilder.DoesDefinesIdentificationProperties(poco); + throw new System.NotSupportedException("BuildOwnedSubsettingHandCoded requires manual implementation"); } } } diff --git a/SysML2.NET/TextualNotation/SuccessionAsUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/SuccessionAsUsageTextualNotationBuilder.cs deleted file mode 100644 index 6881b77d..00000000 --- a/SysML2.NET/TextualNotation/SuccessionAsUsageTextualNotationBuilder.cs +++ /dev/null @@ -1,40 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// 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/SuccessionFlowTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/SuccessionFlowTextualNotationBuilder.cs new file mode 100644 index 00000000..ab1bcae7 --- /dev/null +++ b/SysML2.NET/TextualNotation/SuccessionFlowTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Kernel.Interactions; + + /// + /// Hand-coded part of the + /// + public static partial class SuccessionFlowTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule FeaturePrefix + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildFeaturePrefixHandCoded(ISuccessionFlow poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildFeaturePrefixHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule FlowDeclaration + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildFlowDeclarationHandCoded(ISuccessionFlow poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildFlowDeclarationHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/SuccessionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/SuccessionTextualNotationBuilder.cs new file mode 100644 index 00000000..b50bc54d --- /dev/null +++ b/SysML2.NET/TextualNotation/SuccessionTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Kernel.Connectors; + + /// + /// Hand-coded part of the + /// + public static partial class SuccessionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule FeaturePrefix + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildFeaturePrefixHandCoded(ISuccession poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildFeaturePrefixHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule SuccessionDeclaration + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildSuccessionDeclarationHandCoded(ISuccession poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildSuccessionDeclarationHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/TextualRepresentationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/TextualRepresentationTextualNotationBuilder.cs deleted file mode 100644 index ce7ea3e0..00000000 --- a/SysML2.NET/TextualNotation/TextualRepresentationTextualNotationBuilder.cs +++ /dev/null @@ -1,40 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// 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 index f455d8b5..f3de2797 100644 --- a/SysML2.NET/TextualNotation/TransitionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/TransitionUsageTextualNotationBuilder.cs @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // // // Copyright 2022-2026 Starion Group S.A. @@ -20,31 +20,24 @@ namespace SysML2.NET.TextualNotation { + using System.Text; + using SysML2.NET.Core.POCO.Systems.States; /// - /// Hand-coded part of the + /// 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 + /// Builds the Textual Notation string for the rule TargetTransitionUsage /// - /// The - /// The assertion of the condition - private static bool BuildGroupConditionForTransitionUsage(ITransitionUsage poco) + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildTargetTransitionUsageHandCoded(ITransitionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - return CommonTextualNotationBuilder.DoesDefinesUsageDeclaration(poco); + throw new System.NotSupportedException("BuildTargetTransitionUsageHandCoded requires manual implementation"); } } } diff --git a/SysML2.NET/TextualNotation/TriggerInvocationExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/TriggerInvocationExpressionTextualNotationBuilder.cs new file mode 100644 index 00000000..b38cceca --- /dev/null +++ b/SysML2.NET/TextualNotation/TriggerInvocationExpressionTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Systems.Actions; + + /// + /// Hand-coded part of the + /// + public static partial class TriggerInvocationExpressionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule TriggerExpression + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildTriggerExpressionHandCoded(ITriggerInvocationExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildTriggerExpressionHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/TypeFeaturingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/TypeFeaturingTextualNotationBuilder.cs deleted file mode 100644 index 570b7fbb..00000000 --- a/SysML2.NET/TextualNotation/TypeFeaturingTextualNotationBuilder.cs +++ /dev/null @@ -1,40 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// 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); - } - } -} diff --git a/SysML2.NET/TextualNotation/TypeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/TypeTextualNotationBuilder.cs index fdce017c..25064c3b 100644 --- a/SysML2.NET/TextualNotation/TypeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/TypeTextualNotationBuilder.cs @@ -20,8 +20,6 @@ namespace SysML2.NET.TextualNotation { - using System.Collections.Generic; - using System.Linq; using System.Text; using SysML2.NET.Core.POCO.Core.Types; @@ -38,166 +36,272 @@ public static partial class TypeTextualNotationBuilder /// Build the complex DefinitionBodyItem:Type=ownedRelationship+=DefinitionMember|ownedRelationship+=VariantUsageMember|ownedRelationship+=NonOccurrenceUsageMember|(ownedRelationship+=SourceSuccessionMember)?ownedRelationship+=OccurrenceUsageMember|ownedRelationship+=AliasMember|ownedRelationship+=Import rule /// /// The + /// The used to get access to CursorCollection for the current /// The - internal static void BuildDefinitionBodyItemInternal(IType poco, StringBuilder stringBuilder) + internal static void BuildDefinitionBodyItemInternal(IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - var relationships = poco.OwnedRelationship.ToList(); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - for (var ownedRelationshipIndex = 0; ownedRelationshipIndex < relationships.Count; ownedRelationshipIndex++) + while (ownedRelationshipCursor.Current != null) { - ownedRelationshipIndex = BuildDefinitionBodyItem(ownedRelationshipIndex, relationships, stringBuilder); + switch (ownedRelationshipCursor.Current) + { + case IVariantMembership variantMembership: + VariantMembershipTextualNotationBuilder.BuildVariantUsageMember(variantMembership, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + break; + + case FeatureMembership featureMembershipForSuccession when featureMembershipForSuccession.IsValidForSourceSuccessionMember(): + { + var nextElement = ownedRelationshipCursor.GetNext(1); + + if (nextElement is FeatureMembership nextFeatureMembership && nextFeatureMembership.IsValidForOccurrenceUsageMember()) + { + FeatureMembershipTextualNotationBuilder.BuildSourceSuccessionMember(featureMembershipForSuccession, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + FeatureMembershipTextualNotationBuilder.BuildOccurrenceUsageMember((IFeatureMembership)ownedRelationshipCursor.Current, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + } + else + { + ownedRelationshipCursor.Move(); + } + + break; + } + + case FeatureMembership featureMembershipForOccurrence when featureMembershipForOccurrence.IsValidForOccurrenceUsageMember(): + FeatureMembershipTextualNotationBuilder.BuildOccurrenceUsageMember(featureMembershipForOccurrence, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + break; + + case FeatureMembership featureMembershipForNonOccurrence when featureMembershipForNonOccurrence.IsValidForNonOccurrenceUsageMember(): + FeatureMembershipTextualNotationBuilder.BuildNonOccurrenceUsageMember(featureMembershipForNonOccurrence, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + break; + + case IOwningMembership owningMembership: + OwningMembershipTextualNotationBuilder.BuildDefinitionMember(owningMembership, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + break; + + case IMembership membership: + MembershipTextualNotationBuilder.BuildAliasMember(membership, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + break; + + case IImport import: + ImportTextualNotationBuilder.BuildImport(import, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + break; + + default: + ownedRelationshipCursor.Move(); + break; + } } } /// - /// Build the logic for the DefinitionBodyItem:Type=ownedRelationship+=DefinitionMember|ownedRelationship+=VariantUsageMember|ownedRelationship+=NonOccurrenceUsageMember| - /// (ownedRelationship+=SourceSuccessionMember)?ownedRelationship+=OccurrenceUsageMember|ownedRelationship+=AliasMember|ownedRelationship+=Import rule + /// Build the logic for the NonBehaviorBodyItem =ownedRelationship+=Import|ownedRelationship+=AliasMember|ownedRelationship+=DefinitionMember|ownedRelationship+=VariantUsageMember|ownedRelationship+=NonOccurrenceUsageMember|(ownedRelationship+=SourceSuccessionMember)?ownedRelationship+=StructureUsageMember rule /// - /// The index of the inside the to process - /// A collection of to process + /// The + /// The used to get access to CursorCollection for the current /// The - /// The current index that could have been modified during the process - internal static int BuildDefinitionBodyItem(int relationshipIndex, IReadOnlyList relationships, StringBuilder stringBuilder) + internal static void BuildNonBehaviorBodyItemInternal(IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - var ownedRelationship = relationships[relationshipIndex]; + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - switch (ownedRelationship) + while (ownedRelationshipCursor.Current != null) { - case OwningMembership owningMembership: - OwningMembershipTextualNotationBuilder.BuildDefinitionMember(owningMembership, stringBuilder); - break; - - case VariantMembership variantMembership: - VariantMembershipTextualNotationBuilder.BuildVariantUsageMember(variantMembership, stringBuilder); - break; - - case FeatureMembership featureMembershipForSuccession when featureMembershipForSuccession.IsValidForSourceSuccessionMember(): + switch (ownedRelationshipCursor.Current) { - var nextElement = relationshipIndex + 1 < relationships.Count ? relationships[relationshipIndex + 1] : null; + case IImport import: + ImportTextualNotationBuilder.BuildImport(import, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + break; - if (nextElement is FeatureMembership featureMembership && featureMembership.IsValidForOccurrenceUsageMember()) + case IVariantMembership variantMembership: + VariantMembershipTextualNotationBuilder.BuildVariantUsageMember(variantMembership, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + break; + + case FeatureMembership featureMembershipForSuccession when featureMembershipForSuccession.IsValidForSourceSuccessionMember(): { - FeatureMembershipTextualNotationBuilder.BuildSourceSuccessionMember(featureMembershipForSuccession, stringBuilder); - FeatureMembershipTextualNotationBuilder.BuildOccurrenceUsageMember(featureMembership, stringBuilder); - return relationshipIndex + 1; + var nextElement = ownedRelationshipCursor.GetNext(1); + + if (nextElement is FeatureMembership nextFeatureMembership && nextFeatureMembership.IsValidForStructureUsageMember()) + { + FeatureMembershipTextualNotationBuilder.BuildSourceSuccessionMember(featureMembershipForSuccession, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + FeatureMembershipTextualNotationBuilder.BuildStructureUsageMember((IFeatureMembership)ownedRelationshipCursor.Current, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + } + else + { + ownedRelationshipCursor.Move(); + } + + break; } - break; - } + case FeatureMembership featureMembershipForStructure when featureMembershipForStructure.IsValidForStructureUsageMember(): + FeatureMembershipTextualNotationBuilder.BuildStructureUsageMember(featureMembershipForStructure, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + break; - case FeatureMembership featureMembershipForOccurenceUsageMember when featureMembershipForOccurenceUsageMember.IsValidForOccurrenceUsageMember(): - FeatureMembershipTextualNotationBuilder.BuildOccurrenceUsageMember(featureMembershipForOccurenceUsageMember, stringBuilder); - break; + case FeatureMembership featureMembershipForNonOccurrence when featureMembershipForNonOccurrence.IsValidForNonOccurrenceUsageMember(): + FeatureMembershipTextualNotationBuilder.BuildNonOccurrenceUsageMember(featureMembershipForNonOccurrence, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + break; - case FeatureMembership featureMembershipForNonOccurenceUsageMember when featureMembershipForNonOccurenceUsageMember.IsValidForNonOccurrenceUsageMember(): - FeatureMembershipTextualNotationBuilder.BuildNonOccurrenceUsageMember(featureMembershipForNonOccurenceUsageMember, stringBuilder); - break; + case IOwningMembership owningMembership: + OwningMembershipTextualNotationBuilder.BuildDefinitionMember(owningMembership, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + break; - case Membership membership: - MembershipTextualNotationBuilder.BuildAliasMember(membership, stringBuilder); - break; + case IMembership membership: + MembershipTextualNotationBuilder.BuildAliasMember(membership, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + break; - case IImport import: - ImportTextualNotationBuilder.BuildImport(import, stringBuilder); - break; + default: + ownedRelationshipCursor.Move(); + break; + } } + } - return relationshipIndex; + /// + /// Builds the Textual Notation string for the rule ActionBody + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildActionBodyHandCoded(IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildActionBodyHandCoded requires manual implementation"); } /// - /// Build the logic for the ActionBodyItem:Type=NonBehaviorBodyItem|ownedRelationship+=InitialNodeMember(ownedRelationship+=ActionTargetSuccessionMember)*|(ownedRelationship+=SourceSuccessionMember)?ownedRelationship+=ActionBehaviorMember(ownedRelationship+=ActionTargetSuccessionMember)*|ownedRelationship+=GuardedSuccessionMember rule + /// Builds the Textual Notation string for the rule ActionBodyItem /// - /// The index of the inside the to process - /// A collection of to process - /// The - /// The current index that could have been modified during the process - private static int BuildActionBodyItem(int relationshipIndex, List relationships, StringBuilder stringBuilder) + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildActionBodyItemHandCoded(IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - return relationshipIndex; + throw new System.NotSupportedException("BuildActionBodyItemHandCoded requires manual implementation"); } /// - /// Build the logic for the NonBehaviorBodyItem =ownedRelationship+=Import|ownedRelationship+=AliasMember|ownedRelationship+=DefinitionMember|ownedRelationship+=VariantUsageMember|ownedRelationship+=NonOccurrenceUsageMember|(ownedRelationship+=SourceSuccessionMember)?ownedRelationship+=StructureUsageMember rule + /// Builds the Textual Notation string for the rule CalculationBody /// - /// The index of the inside the to process - /// A collection of to process - /// The - /// The current index that could have been modified during the process - private static int BuildNonBehaviorBodyItem(int relationshipIndex, List relationships, StringBuilder stringBuilder) + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildCalculationBodyHandCoded(IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - var elementInOwnedRelationship = relationships[relationshipIndex]; + throw new System.NotSupportedException("BuildCalculationBodyHandCoded requires manual implementation"); + } - switch (elementInOwnedRelationship) - { - case IImport import: - ImportTextualNotationBuilder.BuildImport(import, stringBuilder); - break; - case Membership membership: - MembershipTextualNotationBuilder.BuildAliasMember(membership, stringBuilder); - break; - case OwningMembership owningMembership: - OwningMembershipTextualNotationBuilder.BuildDefinitionMember(owningMembership, stringBuilder); - break; - case VariantMembership variantMembership: - VariantMembershipTextualNotationBuilder.BuildVariantUsageMember(variantMembership, stringBuilder); - break; - - case FeatureMembership featureMembershipForSuccession when featureMembershipForSuccession.IsValidForSourceSuccessionMember(): - { - var nextElement = relationshipIndex + 1 < relationships.Count ? relationships[relationshipIndex + 1] : null; + /// + /// Builds the Textual Notation string for the rule DefinitionBody + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildDefinitionBodyHandCoded(IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildDefinitionBodyHandCoded requires manual implementation"); + } - if (nextElement is FeatureMembership featureMembership && featureMembership.IsValidForStructureUsageMember()) - { - FeatureMembershipTextualNotationBuilder.BuildSourceSuccessionMember(featureMembershipForSuccession, stringBuilder); - FeatureMembershipTextualNotationBuilder.BuildStructureUsageMember(featureMembership, stringBuilder); - return relationshipIndex + 1; - } + /// + /// Builds the Textual Notation string for the rule DefinitionBodyItem + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildDefinitionBodyItemHandCoded(IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildDefinitionBodyItemHandCoded requires manual implementation"); + } - break; - } + /// + /// Builds the Textual Notation string for the rule FunctionBody + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildFunctionBodyHandCoded(IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildFunctionBodyHandCoded requires manual implementation"); + } - case FeatureMembership featureMembershipForOccurenceUsageMember when featureMembershipForOccurenceUsageMember.IsValidForStructureUsageMember(): - FeatureMembershipTextualNotationBuilder.BuildStructureUsageMember(featureMembershipForOccurenceUsageMember, stringBuilder); - break; + /// + /// Builds the Textual Notation string for the rule InterfaceBody + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildInterfaceBodyHandCoded(IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildInterfaceBodyHandCoded requires manual implementation"); + } - case FeatureMembership featureMembershipForNonOccurenceUsageMember when featureMembershipForNonOccurenceUsageMember.IsValidForNonOccurrenceUsageMember(): - FeatureMembershipTextualNotationBuilder.BuildNonOccurrenceUsageMember(featureMembershipForNonOccurenceUsageMember, stringBuilder); - break; - } - - return relationshipIndex; + /// + /// Builds the Textual Notation string for the rule InterfaceBodyItem + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildInterfaceBodyItemHandCoded(IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildInterfaceBodyItemHandCoded requires manual implementation"); } /// - /// Build the logic for the ypeBodyElement:Type=ownedRelationship+=NonFeatureMember|ownedRelationship+=FeatureMember|ownedRelationship+=AliasMember|ownedRelationship+=Import rule - /// This implementation is a copy paste from the other one but required for Other rules + /// Builds the Textual Notation string for the rule RequirementBody /// - /// The index of the inside the to process - /// A collection of to process - /// The - /// The current index that could have been modified during the process - private static int BuildTypeBodyElement(int relationshipIndex, List relationships, StringBuilder stringBuilder) + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildRequirementBodyHandCoded(IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - var elementInOwnedRelationship = relationships[relationshipIndex]; - - switch (elementInOwnedRelationship) - { - case SysML2.NET.Core.POCO.Root.Namespaces.OwningMembership owningMembership when owningMembership.IsValidForNonFeatureMember(): - OwningMembershipTextualNotationBuilder.BuildNonFeatureMember(owningMembership, stringBuilder); - break; - case SysML2.NET.Core.POCO.Root.Namespaces.OwningMembership owningMembership when owningMembership.IsValidForFeatureMember(): - OwningMembershipTextualNotationBuilder.BuildFeatureMember(owningMembership, stringBuilder); - break; - case SysML2.NET.Core.POCO.Root.Namespaces.Membership membership: - MembershipTextualNotationBuilder.BuildAliasMember(membership, stringBuilder); - break; - case SysML2.NET.Core.POCO.Root.Namespaces.IImport import: - ImportTextualNotationBuilder.BuildImport(import, stringBuilder); - break; - } - - return relationshipIndex; + throw new System.NotSupportedException("BuildRequirementBodyHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule StateBodyItem + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildStateBodyItemHandCoded(IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildStateBodyItemHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule TypeBody + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildTypeBodyHandCoded(IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildTypeBodyHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule TypeRelationshipPart + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildTypeRelationshipPartHandCoded(IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildTypeRelationshipPartHandCoded requires manual implementation"); } } } diff --git a/SysML2.NET/TextualNotation/UsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/UsageTextualNotationBuilder.cs new file mode 100644 index 00000000..9f1698bc --- /dev/null +++ b/SysML2.NET/TextualNotation/UsageTextualNotationBuilder.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. +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.TextualNotation +{ + using System.Text; + + using SysML2.NET.Core.POCO.Systems.DefinitionAndUsage; + + /// + /// Hand-coded part of the + /// + public static partial class UsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ActionTargetSuccession + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildActionTargetSuccessionHandCoded(IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildActionTargetSuccessionHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule InterfaceOccurrenceUsageElement + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildInterfaceOccurrenceUsageElementHandCoded(IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildInterfaceOccurrenceUsageElementHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule OccurrenceUsageElement + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildOccurrenceUsageElementHandCoded(IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildOccurrenceUsageElementHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule StructureUsageElement + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildStructureUsageElementHandCoded(IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildStructureUsageElementHandCoded requires manual implementation"); + } + + /// + /// Builds the Textual Notation string for the rule VariantUsageElement + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildVariantUsageElementHandCoded(IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildVariantUsageElementHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/ViewDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/ViewDefinitionTextualNotationBuilder.cs new file mode 100644 index 00000000..9cf5f14d --- /dev/null +++ b/SysML2.NET/TextualNotation/ViewDefinitionTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Systems.Views; + + /// + /// Hand-coded part of the + /// + public static partial class ViewDefinitionTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ViewDefinitionBody + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildViewDefinitionBodyHandCoded(IViewDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildViewDefinitionBodyHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/ViewUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/ViewUsageTextualNotationBuilder.cs new file mode 100644 index 00000000..86502be5 --- /dev/null +++ b/SysML2.NET/TextualNotation/ViewUsageTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Systems.Views; + + /// + /// Hand-coded part of the + /// + public static partial class ViewUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule ViewBody + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildViewBodyHandCoded(IViewUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildViewBodyHandCoded requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/WhileLoopActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/WhileLoopActionUsageTextualNotationBuilder.cs new file mode 100644 index 00000000..fa801ee5 --- /dev/null +++ b/SysML2.NET/TextualNotation/WhileLoopActionUsageTextualNotationBuilder.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.Text; + + using SysML2.NET.Core.POCO.Systems.Actions; + + /// + /// Hand-coded part of the + /// + public static partial class WhileLoopActionUsageTextualNotationBuilder + { + /// + /// Builds the Textual Notation string for the rule WhileLoopNode + /// + /// The from which the rule should be build + /// The used to get access to CursorCollection for the current + /// The that contains the entire textual notation + private static void BuildWhileLoopNodeHandCoded(IWhileLoopActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) + { + throw new System.NotSupportedException("BuildWhileLoopNodeHandCoded requires manual implementation"); + } + } +} From fdb5e3a70e8db47b2752cf84b7114d0a07c913ed Mon Sep 17 00:00:00 2001 From: atheate Date: Wed, 22 Apr 2026 09:11:18 +0200 Subject: [PATCH 27/33] [WIP] Covers multiple terminal element cases --- .../HandleBarHelpers/RulesHelper.cs | 63 +++++++++++++++++++ .../FeatureTextualNotationBuilder.cs | 2 +- .../MetadataFeatureTextualNotationBuilder.cs | 2 +- .../MetadataUsageTextualNotationBuilder.cs | 2 +- .../NullExpressionTextualNotationBuilder.cs | 2 +- ...straintMembershipTextualNotationBuilder.cs | 11 +++- .../FeatureTextualNotationBuilder.cs | 11 ---- .../MetadataFeatureTextualNotationBuilder.cs | 43 ------------- .../MetadataUsageTextualNotationBuilder.cs | 43 ------------- .../NullExpressionTextualNotationBuilder.cs | 43 ------------- ...straintMembershipTextualNotationBuilder.cs | 43 ------------- 11 files changed, 77 insertions(+), 188 deletions(-) delete mode 100644 SysML2.NET/TextualNotation/MetadataFeatureTextualNotationBuilder.cs delete mode 100644 SysML2.NET/TextualNotation/MetadataUsageTextualNotationBuilder.cs delete mode 100644 SysML2.NET/TextualNotation/NullExpressionTextualNotationBuilder.cs delete mode 100644 SysML2.NET/TextualNotation/RequirementConstraintMembershipTextualNotationBuilder.cs diff --git a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs index f48a2546..17113677 100644 --- a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs +++ b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs @@ -374,6 +374,69 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas } else { + // When all alternatives consist exclusively of terminal elements (and optionally non-parsing assignments), handle via code-gen + if (alternatives.All(alt => alt.Elements.Count > 0 && alt.Elements.All(element => element is TerminalElement or NonParsingAssignmentElement))) + { + var nonParsingAssignments = alternatives + .SelectMany(alt => alt.Elements.OfType()) + .ToList(); + + if (nonParsingAssignments.Count == 0) + { + // Pure terminal alternatives — emit the first alternative + var firstAlternative = alternatives.ElementAt(0); + + foreach (var terminalOnly in firstAlternative.Elements.Cast()) + { + WriteTerminalAppend(writer, terminalOnly.Value); + } + } + else + { + // Terminal + non-parsing assignment alternatives — generate a switch on the assigned property + var assignmentPropertyName = nonParsingAssignments[0].PropertyName; + var targetProperty = umlClass.QueryAllProperties().SingleOrDefault(x => string.Equals(x.Name, assignmentPropertyName, StringComparison.OrdinalIgnoreCase)); + + if (targetProperty != null) + { + var targetPropertyName = targetProperty.QueryPropertyNameBasedOnUmlProperties(); + + writer.WriteSafeString($"switch ({ruleGenerationContext.CurrentVariableName ?? "poco"}.{targetPropertyName}){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + + foreach (var alternative in alternatives) + { + var nonParsingAssignment = alternative.Elements.OfType().Single(); + var terminals = alternative.Elements.OfType().ToList(); + var enumValueName = nonParsingAssignment.Value.Trim('\'').CapitalizeFirstLetter(); + + writer.WriteSafeString($"case {targetProperty.Type.QueryFullyQualifiedTypeName()}.{enumValueName}:{Environment.NewLine}"); + + foreach (var terminal in terminals) + { + WriteTerminalAppend(writer, terminal.Value); + } + + writer.WriteSafeString($"{Environment.NewLine}break;{Environment.NewLine}"); + } + + writer.WriteSafeString($"}}{Environment.NewLine}"); + } + else + { + // Fallback: emit first alternative terminals + var firstAlternative = alternatives.ElementAt(0); + + foreach (var terminalOnly in firstAlternative.Elements.OfType()) + { + WriteTerminalAppend(writer, terminalOnly.Value); + } + } + } + + return; + } + // Multi-element alternatives (e.g., ';' | '{' NamespaceBodyElement* '}') // Detect pattern: first alternative is terminal-only, second has collection assignment var firstAlt = alternatives.ElementAt(0); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs index 83cbe123..21f548af 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs @@ -122,7 +122,7 @@ public static void BuildTypings(SysML2.NET.Core.POCO.Core.Features.IFeature poco public static void BuildTypedBy(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - BuildDEFINED_BYHandCoded(poco, cursorCache, stringBuilder); + stringBuilder.Append(":"); if (ownedRelationshipCursor.Current != null) { diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs index 934e3df8..97bf0489 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataFeatureTextualNotationBuilder.cs @@ -72,7 +72,7 @@ public static void BuildMetadataFeatureDeclaration(SysML2.NET.Core.POCO.Kernel.M if (!string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName)) { ElementTextualNotationBuilder.BuildIdentification(poco, cursorCache, stringBuilder); - BuildMetadataFeatureDeclarationHandCoded(poco, cursorCache, stringBuilder); + stringBuilder.Append(":"); stringBuilder.Append(' '); stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs index fed4aeaa..e47cdc69 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs @@ -72,7 +72,7 @@ public static void BuildMetadataUsageDeclaration(SysML2.NET.Core.POCO.Systems.Me if (!string.IsNullOrWhiteSpace(poco.DeclaredShortName) || !string.IsNullOrWhiteSpace(poco.DeclaredName)) { ElementTextualNotationBuilder.BuildIdentification(poco, cursorCache, stringBuilder); - BuildMetadataUsageDeclarationHandCoded(poco, cursorCache, stringBuilder); + stringBuilder.Append(":"); stringBuilder.Append(' '); stringBuilder.Append(' '); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NullExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NullExpressionTextualNotationBuilder.cs index 7cc99aa6..ffc2417c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NullExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NullExpressionTextualNotationBuilder.cs @@ -43,7 +43,7 @@ public static partial class NullExpressionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildNullExpression(SysML2.NET.Core.POCO.Kernel.Expressions.INullExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildNullExpressionHandCoded(poco, cursorCache, stringBuilder); + stringBuilder.Append("null "); } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.cs index 2492bc04..7248623e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementConstraintMembershipTextualNotationBuilder.cs @@ -73,7 +73,16 @@ public static void BuildRequirementConstraintMember(SysML2.NET.Core.POCO.Systems /// The that contains the entire textual notation public static void BuildRequirementKind(SysML2.NET.Core.POCO.Systems.Requirements.IRequirementConstraintMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildRequirementKindHandCoded(poco, cursorCache, stringBuilder); + switch (poco.Kind) + { + case SysML2.NET.Core.Systems.Requirements.RequirementConstraintKind.Assumption: + stringBuilder.Append("assume "); + break; + case SysML2.NET.Core.Systems.Requirements.RequirementConstraintKind.Requirement: + stringBuilder.Append("require "); + break; + } + } } } diff --git a/SysML2.NET/TextualNotation/FeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/FeatureTextualNotationBuilder.cs index 2b2df1b2..afa1622d 100644 --- a/SysML2.NET/TextualNotation/FeatureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/FeatureTextualNotationBuilder.cs @@ -51,17 +51,6 @@ private static void BuildBasicFeaturePrefixHandCoded(IFeature poco, ICursorCache throw new System.NotSupportedException("BuildBasicFeaturePrefixHandCoded requires manual implementation"); } - /// - /// Builds the Textual Notation string for the rule DEFINED_BY - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildDEFINED_BYHandCoded(IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildDEFINED_BYHandCoded requires manual implementation"); - } - /// /// Builds the Textual Notation string for the rule FeatureDeclaration /// diff --git a/SysML2.NET/TextualNotation/MetadataFeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/MetadataFeatureTextualNotationBuilder.cs deleted file mode 100644 index a9f2eda0..00000000 --- a/SysML2.NET/TextualNotation/MetadataFeatureTextualNotationBuilder.cs +++ /dev/null @@ -1,43 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// 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.Metadata; - - /// - /// Hand-coded part of the - /// - public static partial class MetadataFeatureTextualNotationBuilder - { - /// - /// Builds the Textual Notation string for the rule MetadataFeatureDeclaration - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildMetadataFeatureDeclarationHandCoded(IMetadataFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildMetadataFeatureDeclarationHandCoded requires manual implementation"); - } - } -} diff --git a/SysML2.NET/TextualNotation/MetadataUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/MetadataUsageTextualNotationBuilder.cs deleted file mode 100644 index b9b13082..00000000 --- a/SysML2.NET/TextualNotation/MetadataUsageTextualNotationBuilder.cs +++ /dev/null @@ -1,43 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// 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.Metadata; - - /// - /// Hand-coded part of the - /// - public static partial class MetadataUsageTextualNotationBuilder - { - /// - /// Builds the Textual Notation string for the rule MetadataUsageDeclaration - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildMetadataUsageDeclarationHandCoded(IMetadataUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildMetadataUsageDeclarationHandCoded requires manual implementation"); - } - } -} diff --git a/SysML2.NET/TextualNotation/NullExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/NullExpressionTextualNotationBuilder.cs deleted file mode 100644 index 6d0cb261..00000000 --- a/SysML2.NET/TextualNotation/NullExpressionTextualNotationBuilder.cs +++ /dev/null @@ -1,43 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// 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 NullExpressionTextualNotationBuilder - { - /// - /// Builds the Textual Notation string for the rule NullExpression - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildNullExpressionHandCoded(INullExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildNullExpressionHandCoded requires manual implementation"); - } - } -} diff --git a/SysML2.NET/TextualNotation/RequirementConstraintMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/RequirementConstraintMembershipTextualNotationBuilder.cs deleted file mode 100644 index e1221416..00000000 --- a/SysML2.NET/TextualNotation/RequirementConstraintMembershipTextualNotationBuilder.cs +++ /dev/null @@ -1,43 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// 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.Requirements; - - /// - /// Hand-coded part of the - /// - public static partial class RequirementConstraintMembershipTextualNotationBuilder - { - /// - /// Builds the Textual Notation string for the rule RequirementKind - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildRequirementKindHandCoded(IRequirementConstraintMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildRequirementKindHandCoded requires manual implementation"); - } - } -} From f1004ce9955ea865c457f9650a59651047a00dad Mon Sep 17 00:00:00 2001 From: atheate Date: Wed, 22 Apr 2026 09:53:25 +0200 Subject: [PATCH 28/33] Handle owned cases --- .../HandleBarHelpers/RulesHelper.cs | 77 +++++++++++++++++++ .../ConjugationTextualNotationBuilder.cs | 33 +++++++- .../CrossSubsettingTextualNotationBuilder.cs | 11 ++- .../DisjoiningTextualNotationBuilder.cs | 33 +++++++- .../FeatureInvertingTextualNotationBuilder.cs | 33 +++++++- .../FeatureTypingTextualNotationBuilder.cs | 11 ++- .../RedefinitionTextualNotationBuilder.cs | 11 ++- ...ferenceSubsettingTextualNotationBuilder.cs | 22 +++++- .../SpecializationTextualNotationBuilder.cs | 22 +++++- .../SubsettingTextualNotationBuilder.cs | 11 ++- .../ConjugationTextualNotationBuilder.cs | 54 ------------- .../CrossSubsettingTextualNotationBuilder.cs | 43 ----------- .../DisjoiningTextualNotationBuilder.cs | 54 ------------- .../FeatureInvertingTextualNotationBuilder.cs | 54 ------------- .../FeatureTypingTextualNotationBuilder.cs | 43 ----------- .../RedefinitionTextualNotationBuilder.cs | 43 ----------- ...ferenceSubsettingTextualNotationBuilder.cs | 54 ------------- .../SpecializationTextualNotationBuilder.cs | 54 ------------- .../SubsettingTextualNotationBuilder.cs | 43 ----------- 19 files changed, 247 insertions(+), 459 deletions(-) delete mode 100644 SysML2.NET/TextualNotation/ConjugationTextualNotationBuilder.cs delete mode 100644 SysML2.NET/TextualNotation/CrossSubsettingTextualNotationBuilder.cs delete mode 100644 SysML2.NET/TextualNotation/DisjoiningTextualNotationBuilder.cs delete mode 100644 SysML2.NET/TextualNotation/FeatureInvertingTextualNotationBuilder.cs delete mode 100644 SysML2.NET/TextualNotation/FeatureTypingTextualNotationBuilder.cs delete mode 100644 SysML2.NET/TextualNotation/RedefinitionTextualNotationBuilder.cs delete mode 100644 SysML2.NET/TextualNotation/ReferenceSubsettingTextualNotationBuilder.cs delete mode 100644 SysML2.NET/TextualNotation/SpecializationTextualNotationBuilder.cs delete mode 100644 SysML2.NET/TextualNotation/SubsettingTextualNotationBuilder.cs diff --git a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs index 17113677..03ed71dc 100644 --- a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs +++ b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs @@ -437,6 +437,83 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas return; } + // Detect pattern: property=[QualifiedName] | property=NonTerminal{containment+=property} + // e.g., type=[QualifiedName]|type=OwnedFeatureChain{ownedRelatedElement+=type} + // Runtime: if the referenced value is owned → call the chain builder, else → output qualifiedName + if (alternatives.Count == 2) + { + var qualifiedNameAlt = alternatives.FirstOrDefault(alt => + alt.Elements.Count == 1 + && alt.Elements[0] is AssignmentElement { Value: ValueLiteralElement qualifiedNameLiteral } + && qualifiedNameLiteral.QueryIsQualifiedName()); + + var chainAlt = alternatives.FirstOrDefault(alt => + alt.Elements.Count >= 2 + && alt.Elements[0] is AssignmentElement { Value: NonTerminalElement } + && alt.Elements.OfType().Any()); + + if (qualifiedNameAlt != null && chainAlt != null) + { + var qualifiedNameAssignment = (AssignmentElement)qualifiedNameAlt.Elements[0]; + var chainAssignment = (AssignmentElement)chainAlt.Elements[0]; + var chainNonTerminal = (NonTerminalElement)chainAssignment.Value; + var containmentAssignment = chainAlt.Elements.OfType().First(); + + var propertyName = qualifiedNameAssignment.Property; + var allProperties = umlClass.QueryAllProperties(); + var targetProperty = allProperties.SingleOrDefault(x => + string.Equals(x.Name, propertyName, StringComparison.OrdinalIgnoreCase)); + var containmentProperty = allProperties.SingleOrDefault(x => + string.Equals(x.Name, containmentAssignment.PropertyName, StringComparison.OrdinalIgnoreCase)); + + if (targetProperty != null && containmentProperty != null) + { + var variableName = ruleGenerationContext.CurrentVariableName ?? "poco"; + var resolvedPropertyName = targetProperty.QueryPropertyNameBasedOnUmlProperties(); + var resolvedContainmentName = containmentProperty.QueryPropertyNameBasedOnUmlProperties(); + + // Resolve the chain NonTerminal's target type + var referencedRule = ruleGenerationContext.AllRules + .SingleOrDefault(x => x.RuleName == chainNonTerminal.Name); + var typeTarget = referencedRule != null + ? (referencedRule.TargetElementName ?? referencedRule.RuleName) + : umlClass.Name; + + var chainTargetClass = umlClass.Cache.Values.OfType() + .SingleOrDefault(x => x.Name == typeTarget) as IClass; + + if (chainTargetClass != null) + { + var chainTypeName = chainTargetClass.QueryFullyQualifiedTypeName(); + var chainVarName = $"chained{resolvedPropertyName}As{chainTargetClass.Name}"; + + string builderCallString; + + if (typeTarget == ruleGenerationContext.NamedElementToGenerate.Name) + { + builderCallString = $"Build{chainNonTerminal.Name}({chainVarName}, cursorCache, stringBuilder);"; + } + else + { + builderCallString = $"{typeTarget}TextualNotationBuilder.Build{chainNonTerminal.Name}({chainVarName}, cursorCache, stringBuilder);"; + } + + writer.WriteSafeString($"if ({variableName}.{resolvedContainmentName}.Contains({variableName}.{resolvedPropertyName}) && {variableName}.{resolvedPropertyName} is {chainTypeName} {chainVarName}){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + writer.WriteSafeString($"{builderCallString}{Environment.NewLine}"); + writer.WriteSafeString($"}}{Environment.NewLine}"); + writer.WriteSafeString($"else if ({variableName}.{resolvedPropertyName} != null){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + writer.WriteSafeString($"stringBuilder.Append({variableName}.{resolvedPropertyName}.qualifiedName);{Environment.NewLine}"); + writer.WriteSafeString($"stringBuilder.Append(' ');{Environment.NewLine}"); + writer.WriteSafeString($"}}{Environment.NewLine}"); + + return; + } + } + } + } + // Multi-element alternatives (e.g., ';' | '{' NamespaceBodyElement* '}') // Detect pattern: first alternative is terminal-only, second has collection assignment var firstAlt = alternatives.ElementAt(0); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugationTextualNotationBuilder.cs index b9c9c55e..57245c25 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConjugationTextualNotationBuilder.cs @@ -43,7 +43,16 @@ public static partial class ConjugationTextualNotationBuilder /// The that contains the entire textual notation public static void BuildOwnedConjugation(SysML2.NET.Core.POCO.Core.Types.IConjugation poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildOwnedConjugationHandCoded(poco, cursorCache, stringBuilder); + if (poco.OwnedRelatedElement.Contains(poco.OriginalType) && poco.OriginalType is SysML2.NET.Core.POCO.Core.Features.IFeature chainedOriginalTypeAsFeature) + { + FeatureTextualNotationBuilder.BuildFeatureChain(chainedOriginalTypeAsFeature, cursorCache, stringBuilder); + } + else if (poco.OriginalType != null) + { + stringBuilder.Append(poco.OriginalType.qualifiedName); + stringBuilder.Append(' '); + } + } /// @@ -64,10 +73,28 @@ public static void BuildConjugation(SysML2.NET.Core.POCO.Core.Types.IConjugation } stringBuilder.Append("conjugate "); - BuildConjugationHandCoded(poco, cursorCache, stringBuilder); + if (poco.OwnedRelatedElement.Contains(poco.ConjugatedType) && poco.ConjugatedType is SysML2.NET.Core.POCO.Core.Features.IFeature chainedConjugatedTypeAsFeature) + { + FeatureTextualNotationBuilder.BuildFeatureChain(chainedConjugatedTypeAsFeature, cursorCache, stringBuilder); + } + else if (poco.ConjugatedType != null) + { + stringBuilder.Append(poco.ConjugatedType.qualifiedName); + stringBuilder.Append(' '); + } + stringBuilder.Append(' '); stringBuilder.Append(" ~"); - BuildConjugationHandCoded(poco, cursorCache, stringBuilder); + if (poco.OwnedRelatedElement.Contains(poco.OriginalType) && poco.OriginalType is SysML2.NET.Core.POCO.Core.Features.IFeature chainedOriginalTypeAsFeature) + { + FeatureTextualNotationBuilder.BuildFeatureChain(chainedOriginalTypeAsFeature, cursorCache, stringBuilder); + } + else if (poco.OriginalType != null) + { + stringBuilder.Append(poco.OriginalType.qualifiedName); + stringBuilder.Append(' '); + } + stringBuilder.Append(' '); RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, cursorCache, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CrossSubsettingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CrossSubsettingTextualNotationBuilder.cs index 208884c4..c84fc953 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CrossSubsettingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/CrossSubsettingTextualNotationBuilder.cs @@ -43,7 +43,16 @@ public static partial class CrossSubsettingTextualNotationBuilder /// The that contains the entire textual notation public static void BuildOwnedCrossSubsetting(SysML2.NET.Core.POCO.Core.Features.ICrossSubsetting poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildOwnedCrossSubsettingHandCoded(poco, cursorCache, stringBuilder); + if (poco.OwnedRelatedElement.Contains(poco.CrossedFeature) && poco.CrossedFeature is SysML2.NET.Core.POCO.Core.Features.IFeature chainedCrossedFeatureAsFeature) + { + FeatureTextualNotationBuilder.BuildOwnedFeatureChain(chainedCrossedFeatureAsFeature, cursorCache, stringBuilder); + } + else if (poco.CrossedFeature != null) + { + stringBuilder.Append(poco.CrossedFeature.qualifiedName); + stringBuilder.Append(' '); + } + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DisjoiningTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DisjoiningTextualNotationBuilder.cs index ba59b1d2..c9b07d9b 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DisjoiningTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DisjoiningTextualNotationBuilder.cs @@ -43,7 +43,16 @@ public static partial class DisjoiningTextualNotationBuilder /// The that contains the entire textual notation public static void BuildOwnedDisjoining(SysML2.NET.Core.POCO.Core.Types.IDisjoining poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildOwnedDisjoiningHandCoded(poco, cursorCache, stringBuilder); + if (poco.OwnedRelatedElement.Contains(poco.DisjoiningType) && poco.DisjoiningType is SysML2.NET.Core.POCO.Core.Features.IFeature chainedDisjoiningTypeAsFeature) + { + FeatureTextualNotationBuilder.BuildFeatureChain(chainedDisjoiningTypeAsFeature, cursorCache, stringBuilder); + } + else if (poco.DisjoiningType != null) + { + stringBuilder.Append(poco.DisjoiningType.qualifiedName); + stringBuilder.Append(' '); + } + } /// @@ -64,10 +73,28 @@ public static void BuildDisjoining(SysML2.NET.Core.POCO.Core.Types.IDisjoining p } stringBuilder.Append("disjoint "); - BuildDisjoiningHandCoded(poco, cursorCache, stringBuilder); + if (poco.OwnedRelatedElement.Contains(poco.TypeDisjoined) && poco.TypeDisjoined is SysML2.NET.Core.POCO.Core.Features.IFeature chainedTypeDisjoinedAsFeature) + { + FeatureTextualNotationBuilder.BuildFeatureChain(chainedTypeDisjoinedAsFeature, cursorCache, stringBuilder); + } + else if (poco.TypeDisjoined != null) + { + stringBuilder.Append(poco.TypeDisjoined.qualifiedName); + stringBuilder.Append(' '); + } + stringBuilder.Append(' '); stringBuilder.Append("from "); - BuildDisjoiningHandCoded(poco, cursorCache, stringBuilder); + if (poco.OwnedRelatedElement.Contains(poco.DisjoiningType) && poco.DisjoiningType is SysML2.NET.Core.POCO.Core.Features.IFeature chainedDisjoiningTypeAsFeature) + { + FeatureTextualNotationBuilder.BuildFeatureChain(chainedDisjoiningTypeAsFeature, cursorCache, stringBuilder); + } + else if (poco.DisjoiningType != null) + { + stringBuilder.Append(poco.DisjoiningType.qualifiedName); + stringBuilder.Append(' '); + } + stringBuilder.Append(' '); RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, cursorCache, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureInvertingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureInvertingTextualNotationBuilder.cs index 2de47221..3a298af3 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureInvertingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureInvertingTextualNotationBuilder.cs @@ -43,7 +43,16 @@ public static partial class FeatureInvertingTextualNotationBuilder /// The that contains the entire textual notation public static void BuildOwnedFeatureInverting(SysML2.NET.Core.POCO.Core.Features.IFeatureInverting poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildOwnedFeatureInvertingHandCoded(poco, cursorCache, stringBuilder); + if (poco.OwnedRelatedElement.Contains(poco.InvertingFeature) && poco.InvertingFeature is SysML2.NET.Core.POCO.Core.Features.IFeature chainedInvertingFeatureAsFeature) + { + FeatureTextualNotationBuilder.BuildOwnedFeatureChain(chainedInvertingFeatureAsFeature, cursorCache, stringBuilder); + } + else if (poco.InvertingFeature != null) + { + stringBuilder.Append(poco.InvertingFeature.qualifiedName); + stringBuilder.Append(' '); + } + } /// @@ -69,10 +78,28 @@ public static void BuildFeatureInverting(SysML2.NET.Core.POCO.Core.Features.IFea } stringBuilder.Append("inverse "); - BuildFeatureInvertingHandCoded(poco, cursorCache, stringBuilder); + if (poco.OwnedRelatedElement.Contains(poco.FeatureInverted) && poco.FeatureInverted is SysML2.NET.Core.POCO.Core.Features.IFeature chainedFeatureInvertedAsFeature) + { + FeatureTextualNotationBuilder.BuildOwnedFeatureChain(chainedFeatureInvertedAsFeature, cursorCache, stringBuilder); + } + else if (poco.FeatureInverted != null) + { + stringBuilder.Append(poco.FeatureInverted.qualifiedName); + stringBuilder.Append(' '); + } + stringBuilder.Append(' '); stringBuilder.Append("of "); - BuildFeatureInvertingHandCoded(poco, cursorCache, stringBuilder); + if (poco.OwnedRelatedElement.Contains(poco.InvertingFeature) && poco.InvertingFeature is SysML2.NET.Core.POCO.Core.Features.IFeature chainedInvertingFeatureAsFeature) + { + FeatureTextualNotationBuilder.BuildOwnedFeatureChain(chainedInvertingFeatureAsFeature, cursorCache, stringBuilder); + } + else if (poco.InvertingFeature != null) + { + stringBuilder.Append(poco.InvertingFeature.qualifiedName); + stringBuilder.Append(' '); + } + stringBuilder.Append(' '); RelationshipTextualNotationBuilder.BuildRelationshipBody(poco, cursorCache, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs index cee6d593..e8b7bfc7 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTypingTextualNotationBuilder.cs @@ -43,7 +43,16 @@ public static partial class FeatureTypingTextualNotationBuilder /// The that contains the entire textual notation public static void BuildOwnedFeatureTyping(SysML2.NET.Core.POCO.Core.Features.IFeatureTyping poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildOwnedFeatureTypingHandCoded(poco, cursorCache, stringBuilder); + if (poco.OwnedRelatedElement.Contains(poco.Type) && poco.Type is SysML2.NET.Core.POCO.Core.Features.IFeature chainedTypeAsFeature) + { + FeatureTextualNotationBuilder.BuildOwnedFeatureChain(chainedTypeAsFeature, cursorCache, stringBuilder); + } + else if (poco.Type != null) + { + stringBuilder.Append(poco.Type.qualifiedName); + stringBuilder.Append(' '); + } + } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs index b5bbeea6..1a610499 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RedefinitionTextualNotationBuilder.cs @@ -43,7 +43,16 @@ public static partial class RedefinitionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildOwnedRedefinition(SysML2.NET.Core.POCO.Core.Features.IRedefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildOwnedRedefinitionHandCoded(poco, cursorCache, stringBuilder); + if (poco.OwnedRelatedElement.Contains(poco.RedefinedFeature) && poco.RedefinedFeature is SysML2.NET.Core.POCO.Core.Features.IFeature chainedRedefinedFeatureAsFeature) + { + FeatureTextualNotationBuilder.BuildOwnedFeatureChain(chainedRedefinedFeatureAsFeature, cursorCache, stringBuilder); + } + else if (poco.RedefinedFeature != null) + { + stringBuilder.Append(poco.RedefinedFeature.qualifiedName); + stringBuilder.Append(' '); + } + } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceSubsettingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceSubsettingTextualNotationBuilder.cs index b0262a0d..2dff810c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceSubsettingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceSubsettingTextualNotationBuilder.cs @@ -43,7 +43,16 @@ public static partial class ReferenceSubsettingTextualNotationBuilder /// The that contains the entire textual notation public static void BuildOwnedReferenceSubsetting(SysML2.NET.Core.POCO.Core.Features.IReferenceSubsetting poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildOwnedReferenceSubsettingHandCoded(poco, cursorCache, stringBuilder); + if (poco.OwnedRelatedElement.Contains(poco.ReferencedFeature) && poco.ReferencedFeature is SysML2.NET.Core.POCO.Core.Features.IFeature chainedReferencedFeatureAsFeature) + { + FeatureTextualNotationBuilder.BuildOwnedFeatureChain(chainedReferencedFeatureAsFeature, cursorCache, stringBuilder); + } + else if (poco.ReferencedFeature != null) + { + stringBuilder.Append(poco.ReferencedFeature.qualifiedName); + stringBuilder.Append(' '); + } + } /// @@ -55,7 +64,16 @@ public static void BuildOwnedReferenceSubsetting(SysML2.NET.Core.POCO.Core.Featu /// The that contains the entire textual notation public static void BuildFlowEndSubsetting(SysML2.NET.Core.POCO.Core.Features.IReferenceSubsetting poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildFlowEndSubsettingHandCoded(poco, cursorCache, stringBuilder); + if (poco.OwnedRelatedElement.Contains(poco.ReferencedFeature) && poco.ReferencedFeature is SysML2.NET.Core.POCO.Core.Features.IFeature chainedReferencedFeatureAsFeature) + { + FeatureTextualNotationBuilder.BuildFeatureChainPrefix(chainedReferencedFeatureAsFeature, cursorCache, stringBuilder); + } + else if (poco.ReferencedFeature != null) + { + stringBuilder.Append(poco.ReferencedFeature.qualifiedName); + stringBuilder.Append(' '); + } + } } } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.cs index d49aed34..d4b269fc 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SpecializationTextualNotationBuilder.cs @@ -56,7 +56,16 @@ public static void BuildOwnedSpecialization(SysML2.NET.Core.POCO.Core.Types.ISpe /// The that contains the entire textual notation public static void BuildSpecificType(SysML2.NET.Core.POCO.Core.Types.ISpecialization poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildSpecificTypeHandCoded(poco, cursorCache, stringBuilder); + if (poco.OwnedRelatedElement.Contains(poco.Specific) && poco.Specific is SysML2.NET.Core.POCO.Core.Features.IFeature chainedSpecificAsFeature) + { + FeatureTextualNotationBuilder.BuildOwnedFeatureChain(chainedSpecificAsFeature, cursorCache, stringBuilder); + } + else if (poco.Specific != null) + { + stringBuilder.Append(poco.Specific.qualifiedName); + stringBuilder.Append(' '); + } + } /// @@ -68,7 +77,16 @@ public static void BuildSpecificType(SysML2.NET.Core.POCO.Core.Types.ISpecializa /// The that contains the entire textual notation public static void BuildGeneralType(SysML2.NET.Core.POCO.Core.Types.ISpecialization poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildGeneralTypeHandCoded(poco, cursorCache, stringBuilder); + if (poco.OwnedRelatedElement.Contains(poco.General) && poco.General is SysML2.NET.Core.POCO.Core.Features.IFeature chainedGeneralAsFeature) + { + FeatureTextualNotationBuilder.BuildOwnedFeatureChain(chainedGeneralAsFeature, cursorCache, stringBuilder); + } + else if (poco.General != null) + { + stringBuilder.Append(poco.General.qualifiedName); + stringBuilder.Append(' '); + } + } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.cs index c46a5f1a..31358fa0 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SubsettingTextualNotationBuilder.cs @@ -43,7 +43,16 @@ public static partial class SubsettingTextualNotationBuilder /// The that contains the entire textual notation public static void BuildOwnedSubsetting(SysML2.NET.Core.POCO.Core.Features.ISubsetting poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildOwnedSubsettingHandCoded(poco, cursorCache, stringBuilder); + if (poco.OwnedRelatedElement.Contains(poco.SubsettedFeature) && poco.SubsettedFeature is SysML2.NET.Core.POCO.Core.Features.IFeature chainedSubsettedFeatureAsFeature) + { + FeatureTextualNotationBuilder.BuildOwnedFeatureChain(chainedSubsettedFeatureAsFeature, cursorCache, stringBuilder); + } + else if (poco.SubsettedFeature != null) + { + stringBuilder.Append(poco.SubsettedFeature.qualifiedName); + stringBuilder.Append(' '); + } + } /// diff --git a/SysML2.NET/TextualNotation/ConjugationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/ConjugationTextualNotationBuilder.cs deleted file mode 100644 index 6fed8912..00000000 --- a/SysML2.NET/TextualNotation/ConjugationTextualNotationBuilder.cs +++ /dev/null @@ -1,54 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// 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 ConjugationTextualNotationBuilder - { - /// - /// Builds the Textual Notation string for the rule Conjugation - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildConjugationHandCoded(IConjugation poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildConjugationHandCoded requires manual implementation"); - } - - /// - /// Builds the Textual Notation string for the rule OwnedConjugation - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildOwnedConjugationHandCoded(IConjugation poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildOwnedConjugationHandCoded requires manual implementation"); - } - } -} diff --git a/SysML2.NET/TextualNotation/CrossSubsettingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/CrossSubsettingTextualNotationBuilder.cs deleted file mode 100644 index 5a6144a3..00000000 --- a/SysML2.NET/TextualNotation/CrossSubsettingTextualNotationBuilder.cs +++ /dev/null @@ -1,43 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// 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.Features; - - /// - /// Hand-coded part of the - /// - public static partial class CrossSubsettingTextualNotationBuilder - { - /// - /// Builds the Textual Notation string for the rule OwnedCrossSubsetting - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildOwnedCrossSubsettingHandCoded(ICrossSubsetting poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildOwnedCrossSubsettingHandCoded requires manual implementation"); - } - } -} diff --git a/SysML2.NET/TextualNotation/DisjoiningTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/DisjoiningTextualNotationBuilder.cs deleted file mode 100644 index 743d4a8c..00000000 --- a/SysML2.NET/TextualNotation/DisjoiningTextualNotationBuilder.cs +++ /dev/null @@ -1,54 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// 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 DisjoiningTextualNotationBuilder - { - /// - /// Builds the Textual Notation string for the rule Disjoining - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildDisjoiningHandCoded(IDisjoining poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildDisjoiningHandCoded requires manual implementation"); - } - - /// - /// Builds the Textual Notation string for the rule OwnedDisjoining - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildOwnedDisjoiningHandCoded(IDisjoining poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildOwnedDisjoiningHandCoded requires manual implementation"); - } - } -} diff --git a/SysML2.NET/TextualNotation/FeatureInvertingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/FeatureInvertingTextualNotationBuilder.cs deleted file mode 100644 index 57be40cf..00000000 --- a/SysML2.NET/TextualNotation/FeatureInvertingTextualNotationBuilder.cs +++ /dev/null @@ -1,54 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// 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.Features; - - /// - /// Hand-coded part of the - /// - public static partial class FeatureInvertingTextualNotationBuilder - { - /// - /// Builds the Textual Notation string for the rule FeatureInverting - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildFeatureInvertingHandCoded(IFeatureInverting poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildFeatureInvertingHandCoded requires manual implementation"); - } - - /// - /// Builds the Textual Notation string for the rule OwnedFeatureInverting - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildOwnedFeatureInvertingHandCoded(IFeatureInverting poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildOwnedFeatureInvertingHandCoded requires manual implementation"); - } - } -} diff --git a/SysML2.NET/TextualNotation/FeatureTypingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/FeatureTypingTextualNotationBuilder.cs deleted file mode 100644 index 5b52a836..00000000 --- a/SysML2.NET/TextualNotation/FeatureTypingTextualNotationBuilder.cs +++ /dev/null @@ -1,43 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// 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.Features; - - /// - /// Hand-coded part of the - /// - public static partial class FeatureTypingTextualNotationBuilder - { - /// - /// Builds the Textual Notation string for the rule OwnedFeatureTyping - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildOwnedFeatureTypingHandCoded(IFeatureTyping poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildOwnedFeatureTypingHandCoded requires manual implementation"); - } - } -} diff --git a/SysML2.NET/TextualNotation/RedefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/RedefinitionTextualNotationBuilder.cs deleted file mode 100644 index 9196f5d6..00000000 --- a/SysML2.NET/TextualNotation/RedefinitionTextualNotationBuilder.cs +++ /dev/null @@ -1,43 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// 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.Features; - - /// - /// Hand-coded part of the - /// - public static partial class RedefinitionTextualNotationBuilder - { - /// - /// Builds the Textual Notation string for the rule OwnedRedefinition - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildOwnedRedefinitionHandCoded(IRedefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildOwnedRedefinitionHandCoded requires manual implementation"); - } - } -} diff --git a/SysML2.NET/TextualNotation/ReferenceSubsettingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/ReferenceSubsettingTextualNotationBuilder.cs deleted file mode 100644 index ccc12fb5..00000000 --- a/SysML2.NET/TextualNotation/ReferenceSubsettingTextualNotationBuilder.cs +++ /dev/null @@ -1,54 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// 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.Features; - - /// - /// Hand-coded part of the - /// - public static partial class ReferenceSubsettingTextualNotationBuilder - { - /// - /// Builds the Textual Notation string for the rule FlowEndSubsetting - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildFlowEndSubsettingHandCoded(IReferenceSubsetting poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildFlowEndSubsettingHandCoded requires manual implementation"); - } - - /// - /// Builds the Textual Notation string for the rule OwnedReferenceSubsetting - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildOwnedReferenceSubsettingHandCoded(IReferenceSubsetting poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildOwnedReferenceSubsettingHandCoded requires manual implementation"); - } - } -} diff --git a/SysML2.NET/TextualNotation/SpecializationTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/SpecializationTextualNotationBuilder.cs deleted file mode 100644 index 14b675eb..00000000 --- a/SysML2.NET/TextualNotation/SpecializationTextualNotationBuilder.cs +++ /dev/null @@ -1,54 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// 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 SpecializationTextualNotationBuilder - { - /// - /// Builds the Textual Notation string for the rule GeneralType - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildGeneralTypeHandCoded(ISpecialization poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildGeneralTypeHandCoded requires manual implementation"); - } - - /// - /// Builds the Textual Notation string for the rule SpecificType - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildSpecificTypeHandCoded(ISpecialization poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildSpecificTypeHandCoded requires manual implementation"); - } - } -} diff --git a/SysML2.NET/TextualNotation/SubsettingTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/SubsettingTextualNotationBuilder.cs deleted file mode 100644 index 5748c1d4..00000000 --- a/SysML2.NET/TextualNotation/SubsettingTextualNotationBuilder.cs +++ /dev/null @@ -1,43 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// 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.Features; - - /// - /// Hand-coded part of the - /// - public static partial class SubsettingTextualNotationBuilder - { - /// - /// Builds the Textual Notation string for the rule OwnedSubsetting - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildOwnedSubsettingHandCoded(ISubsetting poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildOwnedSubsettingHandCoded requires manual implementation"); - } - } -} From 5bdab2351e6b77168f4a8095f503e6dd718c7cba Mon Sep 17 00:00:00 2001 From: atheate Date: Wed, 22 Apr 2026 10:52:33 +0200 Subject: [PATCH 29/33] Handle rules with either ";" or owned elements --- .../HandleBarHelpers/RulesHelper.cs | 103 +++++++++++++++++- .../NamespaceTextualNotationBuilder.cs | 17 ++- .../PackageTextualNotationBuilder.cs | 17 ++- .../StateDefinitionTextualNotationBuilder.cs | 24 +++- .../StateUsageTextualNotationBuilder.cs | 24 +++- .../TypeTextualNotationBuilder.cs | 85 ++++++++++++++- .../ViewDefinitionTextualNotationBuilder.cs | 17 ++- .../ViewUsageTextualNotationBuilder.cs | 17 ++- .../NamespaceTextualNotationBuilder.cs | 43 -------- .../PackageTextualNotationBuilder.cs | 23 +--- .../StateDefinitionTextualNotationBuilder.cs | 43 -------- .../StateUsageTextualNotationBuilder.cs | 43 -------- .../TypeTextualNotationBuilder.cs | 55 ---------- .../ViewDefinitionTextualNotationBuilder.cs | 43 -------- .../ViewUsageTextualNotationBuilder.cs | 43 -------- 15 files changed, 297 insertions(+), 300 deletions(-) delete mode 100644 SysML2.NET/TextualNotation/NamespaceTextualNotationBuilder.cs delete mode 100644 SysML2.NET/TextualNotation/StateDefinitionTextualNotationBuilder.cs delete mode 100644 SysML2.NET/TextualNotation/StateUsageTextualNotationBuilder.cs delete mode 100644 SysML2.NET/TextualNotation/ViewDefinitionTextualNotationBuilder.cs delete mode 100644 SysML2.NET/TextualNotation/ViewUsageTextualNotationBuilder.cs diff --git a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs index 03ed71dc..bd6f9a2d 100644 --- a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs +++ b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs @@ -563,8 +563,107 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas } else { - var handCodedRuleName = alternatives.ElementAt(0).TextualNotationRule.RuleName; - writer.WriteSafeString($"Build{handCodedRuleName}HandCoded({ruleGenerationContext.CurrentVariableName ?? "poco"}, cursorCache, stringBuilder);"); + // Check for collection NonTerminal elements (e.g., ';' | '{' Items* '}') + // The body items are expressed as a standalone NonTerminal with IsCollection, not as AssignmentElements + var collectionNonTerminals = secondAlt.Elements.OfType().Where(x => x.IsCollection).ToList(); + + if (collectionNonTerminals.Count > 0) + { + // Resolve the collection property through the NonTerminal's rule tree + var nonTerminalRule = ruleGenerationContext.AllRules.SingleOrDefault(x => x.RuleName == collectionNonTerminals[0].Name); + + if (nonTerminalRule != null) + { + var collectionPropertyNames = nonTerminalRule.QueryCollectionPropertyNames(ruleGenerationContext.AllRules); + + if (collectionPropertyNames.Count > 0) + { + var collectionPropertyName = collectionPropertyNames.First(); + var targetProperty = umlClass.QueryAllProperties().SingleOrDefault(x => string.Equals(x.Name, collectionPropertyName, StringComparison.OrdinalIgnoreCase)); + var terminalValue = ((TerminalElement)firstAlt.Elements[0]).Value; + + if (targetProperty != null) + { + var propertyAccessName = targetProperty.QueryPropertyNameBasedOnUmlProperties(); + + writer.WriteSafeString($"if(poco.{propertyAccessName}.Count == 0){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + writer.WriteSafeString($"stringBuilder.AppendLine(\"{terminalValue}\");{Environment.NewLine}"); + writer.WriteSafeString($"}}{Environment.NewLine}"); + writer.WriteSafeString($"else{Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + + // Process non-collection elements (terminals like '{', '}' and optional assignments like isParallel?='parallel') + // but handle the collection NonTerminal explicitly with cursor + Move() + foreach (var element in secondAlt.Elements) + { + if (element is NonTerminalElement { IsCollection: true }) + { + // Generate explicit cursor-based loop with per-item builder call and Move() + var cursorVarName = $"{targetProperty.Name.LowerCaseFirstLetter()}Cursor"; + writer.WriteSafeString($"var {cursorVarName} = cursorCache.GetOrCreateCursor(poco.Id, \"{targetProperty.Name}\", poco.{propertyAccessName});{Environment.NewLine}"); + + // Resolve the builder call for the per-item NonTerminal + var collectionNonTerminal = (NonTerminalElement)element; + var referencedRule = ruleGenerationContext.AllRules.SingleOrDefault(x => x.RuleName == collectionNonTerminal.Name); + var typeTarget = referencedRule != null + ? (referencedRule.TargetElementName ?? referencedRule.RuleName) + : umlClass.Name; + + var perItemCall = ResolveBuilderCall(umlClass, collectionNonTerminal, typeTarget, ruleGenerationContext); + + writer.WriteSafeString($"while ({cursorVarName}.Current != null){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + + if (perItemCall != null) + { + writer.WriteSafeString(perItemCall); + } + else + { + // Type incompatible: inline the referenced rule's alternatives + var previousCaller = ruleGenerationContext.CallerRule; + var previousName = ruleGenerationContext.CurrentVariableName; + ruleGenerationContext.CallerRule = collectionNonTerminal; + ProcessAlternatives(writer, umlClass, referencedRule?.Alternatives, ruleGenerationContext); + ruleGenerationContext.CallerRule = previousCaller; + ruleGenerationContext.CurrentVariableName = previousName; + } + + writer.WriteSafeString($"{Environment.NewLine}{cursorVarName}.Move();{Environment.NewLine}"); + writer.WriteSafeString($"}}{Environment.NewLine}"); + } + else + { + ProcessRuleElement(writer, umlClass, element, ruleGenerationContext); + } + } + + writer.WriteSafeString($"}}{Environment.NewLine}"); + } + else + { + var handCodedRuleName = alternatives.ElementAt(0).TextualNotationRule.RuleName; + writer.WriteSafeString($"Build{handCodedRuleName}HandCoded({ruleGenerationContext.CurrentVariableName ?? "poco"}, cursorCache, stringBuilder);"); + } + } + else + { + var handCodedRuleName = alternatives.ElementAt(0).TextualNotationRule.RuleName; + writer.WriteSafeString($"Build{handCodedRuleName}HandCoded({ruleGenerationContext.CurrentVariableName ?? "poco"}, cursorCache, stringBuilder);"); + } + } + else + { + var handCodedRuleName = alternatives.ElementAt(0).TextualNotationRule.RuleName; + writer.WriteSafeString($"Build{handCodedRuleName}HandCoded({ruleGenerationContext.CurrentVariableName ?? "poco"}, cursorCache, stringBuilder);"); + } + } + else + { + var handCodedRuleName = alternatives.ElementAt(0).TextualNotationRule.RuleName; + writer.WriteSafeString($"Build{handCodedRuleName}HandCoded({ruleGenerationContext.CurrentVariableName ?? "poco"}, cursorCache, stringBuilder);"); + } } } else diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs index 06a360c1..0a2aa6d9 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs @@ -94,7 +94,22 @@ public static void BuildNamespaceDeclaration(SysML2.NET.Core.POCO.Root.Namespace /// The that contains the entire textual notation public static void BuildNamespaceBody(SysML2.NET.Core.POCO.Root.Namespaces.INamespace poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildNamespaceBodyHandCoded(poco, cursorCache, stringBuilder); + if (poco.OwnedRelationship.Count == 0) + { + stringBuilder.AppendLine(";"); + } + else + { + stringBuilder.AppendLine("{"); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + while (ownedRelationshipCursor.Current != null) + { + BuildNamespaceBodyElement(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + } + stringBuilder.AppendLine("}"); + } + } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs index 32bce40e..1d6eecdd 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PackageTextualNotationBuilder.cs @@ -57,7 +57,22 @@ public static void BuildPackageDeclaration(SysML2.NET.Core.POCO.Kernel.Packages. /// The that contains the entire textual notation public static void BuildPackageBody(SysML2.NET.Core.POCO.Kernel.Packages.IPackage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildPackageBodyHandCoded(poco, cursorCache, stringBuilder); + if (poco.OwnedRelationship.Count == 0) + { + stringBuilder.AppendLine(";"); + } + else + { + stringBuilder.AppendLine("{"); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + while (ownedRelationshipCursor.Current != null) + { + BuildPackageBodyElement(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + } + stringBuilder.AppendLine("}"); + } + } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateDefinitionTextualNotationBuilder.cs index 9a0e71e7..23505e72 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateDefinitionTextualNotationBuilder.cs @@ -43,7 +43,29 @@ public static partial class StateDefinitionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildStateDefBody(SysML2.NET.Core.POCO.Systems.States.IStateDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildStateDefBodyHandCoded(poco, cursorCache, stringBuilder); + if (poco.OwnedRelationship.Count == 0) + { + stringBuilder.AppendLine(";"); + } + else + { + + if (poco.IsParallel) + { + stringBuilder.Append(" parallel "); + stringBuilder.Append(' '); + } + + stringBuilder.AppendLine("{"); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + while (ownedRelationshipCursor.Current != null) + { + TypeTextualNotationBuilder.BuildStateBodyItem(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + } + stringBuilder.AppendLine("}"); + } + } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateUsageTextualNotationBuilder.cs index 4ccb63b1..487ab23f 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/StateUsageTextualNotationBuilder.cs @@ -43,7 +43,29 @@ public static partial class StateUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildStateUsageBody(SysML2.NET.Core.POCO.Systems.States.IStateUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildStateUsageBodyHandCoded(poco, cursorCache, stringBuilder); + if (poco.OwnedRelationship.Count == 0) + { + stringBuilder.AppendLine(";"); + } + else + { + + if (poco.IsParallel) + { + stringBuilder.Append(" parallel "); + stringBuilder.Append(' '); + } + + stringBuilder.AppendLine("{"); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + while (ownedRelationshipCursor.Current != null) + { + TypeTextualNotationBuilder.BuildStateBodyItem(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + } + stringBuilder.AppendLine("}"); + } + } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs index 7ef506a2..fbdc38ea 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs @@ -43,7 +43,22 @@ public static partial class TypeTextualNotationBuilder /// The that contains the entire textual notation public static void BuildDefinitionBody(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildDefinitionBodyHandCoded(poco, cursorCache, stringBuilder); + if (poco.OwnedRelationship.Count == 0) + { + stringBuilder.AppendLine(";"); + } + else + { + stringBuilder.AppendLine("{"); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + while (ownedRelationshipCursor.Current != null) + { + BuildDefinitionBodyItem(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + } + stringBuilder.AppendLine("}"); + } + } /// @@ -67,7 +82,22 @@ public static void BuildDefinitionBodyItem(SysML2.NET.Core.POCO.Core.Types.IType /// The that contains the entire textual notation public static void BuildInterfaceBody(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildInterfaceBodyHandCoded(poco, cursorCache, stringBuilder); + if (poco.OwnedRelationship.Count == 0) + { + stringBuilder.AppendLine(";"); + } + else + { + stringBuilder.AppendLine("{"); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + while (ownedRelationshipCursor.Current != null) + { + BuildInterfaceBodyItem(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + } + stringBuilder.AppendLine("}"); + } + } /// @@ -91,7 +121,22 @@ public static void BuildInterfaceBodyItem(SysML2.NET.Core.POCO.Core.Types.IType /// The that contains the entire textual notation public static void BuildActionBody(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildActionBodyHandCoded(poco, cursorCache, stringBuilder); + if (poco.OwnedRelationship.Count == 0) + { + stringBuilder.AppendLine(";"); + } + else + { + stringBuilder.AppendLine("{"); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + while (ownedRelationshipCursor.Current != null) + { + BuildActionBodyItem(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + } + stringBuilder.AppendLine("}"); + } + } /// @@ -191,7 +236,22 @@ public static void BuildCalculationBodyItem(SysML2.NET.Core.POCO.Core.Types.ITyp /// The that contains the entire textual notation public static void BuildRequirementBody(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildRequirementBodyHandCoded(poco, cursorCache, stringBuilder); + if (poco.OwnedRelationship.Count == 0) + { + stringBuilder.AppendLine(";"); + } + else + { + stringBuilder.AppendLine("{"); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + while (ownedRelationshipCursor.Current != null) + { + BuildRequirementBodyItem(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + } + stringBuilder.AppendLine("}"); + } + } /// @@ -643,7 +703,22 @@ public static void BuildDifferencingPart(SysML2.NET.Core.POCO.Core.Types.IType p /// The that contains the entire textual notation public static void BuildTypeBody(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildTypeBodyHandCoded(poco, cursorCache, stringBuilder); + if (poco.OwnedRelationship.Count == 0) + { + stringBuilder.AppendLine(";"); + } + else + { + stringBuilder.AppendLine("{"); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + while (ownedRelationshipCursor.Current != null) + { + BuildTypeBodyElement(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + } + stringBuilder.AppendLine("}"); + } + } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs index 5df62f02..0564a948 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs @@ -43,7 +43,22 @@ public static partial class ViewDefinitionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildViewDefinitionBody(SysML2.NET.Core.POCO.Systems.Views.IViewDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildViewDefinitionBodyHandCoded(poco, cursorCache, stringBuilder); + if (poco.OwnedRelationship.Count == 0) + { + stringBuilder.AppendLine(";"); + } + else + { + stringBuilder.AppendLine("{"); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + while (ownedRelationshipCursor.Current != null) + { + BuildViewDefinitionBodyItem(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + } + stringBuilder.AppendLine("}"); + } + } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs index 8bb7ca0d..7bd7f9e2 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs @@ -43,7 +43,22 @@ public static partial class ViewUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildViewBody(SysML2.NET.Core.POCO.Systems.Views.IViewUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildViewBodyHandCoded(poco, cursorCache, stringBuilder); + if (poco.OwnedRelationship.Count == 0) + { + stringBuilder.AppendLine(";"); + } + else + { + stringBuilder.AppendLine("{"); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + while (ownedRelationshipCursor.Current != null) + { + BuildViewBodyItem(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + } + stringBuilder.AppendLine("}"); + } + } /// diff --git a/SysML2.NET/TextualNotation/NamespaceTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/NamespaceTextualNotationBuilder.cs deleted file mode 100644 index ffe623b9..00000000 --- a/SysML2.NET/TextualNotation/NamespaceTextualNotationBuilder.cs +++ /dev/null @@ -1,43 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// 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.Root.Namespaces; - - /// - /// Hand-coded part of the - /// - public static partial class NamespaceTextualNotationBuilder - { - /// - /// Builds the Textual Notation string for the rule NamespaceBody - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildNamespaceBodyHandCoded(INamespace poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildNamespaceBodyHandCoded requires manual implementation"); - } - } -} diff --git a/SysML2.NET/TextualNotation/PackageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/PackageTextualNotationBuilder.cs index 9ee90986..3689d3bd 100644 --- a/SysML2.NET/TextualNotation/PackageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/PackageTextualNotationBuilder.cs @@ -1,20 +1,20 @@ -// ------------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // -// +// // 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. -// +// // // ------------------------------------------------------------------------------------------------ @@ -38,16 +38,5 @@ public static partial class PackageTextualNotationBuilder private static void BuildFilterPackageImport(IPackage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { } - - /// - /// Builds the Textual Notation string for the rule PackageBody - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildPackageBodyHandCoded(IPackage poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildPackageBodyHandCoded requires manual implementation"); - } } } diff --git a/SysML2.NET/TextualNotation/StateDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/StateDefinitionTextualNotationBuilder.cs deleted file mode 100644 index ba440826..00000000 --- a/SysML2.NET/TextualNotation/StateDefinitionTextualNotationBuilder.cs +++ /dev/null @@ -1,43 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// 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.States; - - /// - /// Hand-coded part of the - /// - public static partial class StateDefinitionTextualNotationBuilder - { - /// - /// Builds the Textual Notation string for the rule StateDefBody - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildStateDefBodyHandCoded(IStateDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildStateDefBodyHandCoded requires manual implementation"); - } - } -} diff --git a/SysML2.NET/TextualNotation/StateUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/StateUsageTextualNotationBuilder.cs deleted file mode 100644 index e33bc58c..00000000 --- a/SysML2.NET/TextualNotation/StateUsageTextualNotationBuilder.cs +++ /dev/null @@ -1,43 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// 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.States; - - /// - /// Hand-coded part of the - /// - public static partial class StateUsageTextualNotationBuilder - { - /// - /// Builds the Textual Notation string for the rule StateUsageBody - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildStateUsageBodyHandCoded(IStateUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildStateUsageBodyHandCoded requires manual implementation"); - } - } -} diff --git a/SysML2.NET/TextualNotation/TypeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/TypeTextualNotationBuilder.cs index 25064c3b..02ebde6f 100644 --- a/SysML2.NET/TextualNotation/TypeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/TypeTextualNotationBuilder.cs @@ -172,17 +172,6 @@ internal static void BuildNonBehaviorBodyItemInternal(IType poco, ICursorCache c } } - /// - /// Builds the Textual Notation string for the rule ActionBody - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildActionBodyHandCoded(IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildActionBodyHandCoded requires manual implementation"); - } - /// /// Builds the Textual Notation string for the rule ActionBodyItem /// @@ -205,17 +194,6 @@ private static void BuildCalculationBodyHandCoded(IType poco, ICursorCache curso throw new System.NotSupportedException("BuildCalculationBodyHandCoded requires manual implementation"); } - /// - /// Builds the Textual Notation string for the rule DefinitionBody - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildDefinitionBodyHandCoded(IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildDefinitionBodyHandCoded requires manual implementation"); - } - /// /// Builds the Textual Notation string for the rule DefinitionBodyItem /// @@ -238,17 +216,6 @@ private static void BuildFunctionBodyHandCoded(IType poco, ICursorCache cursorCa throw new System.NotSupportedException("BuildFunctionBodyHandCoded requires manual implementation"); } - /// - /// Builds the Textual Notation string for the rule InterfaceBody - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildInterfaceBodyHandCoded(IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildInterfaceBodyHandCoded requires manual implementation"); - } - /// /// Builds the Textual Notation string for the rule InterfaceBodyItem /// @@ -260,17 +227,6 @@ private static void BuildInterfaceBodyItemHandCoded(IType poco, ICursorCache cur throw new System.NotSupportedException("BuildInterfaceBodyItemHandCoded requires manual implementation"); } - /// - /// Builds the Textual Notation string for the rule RequirementBody - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildRequirementBodyHandCoded(IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildRequirementBodyHandCoded requires manual implementation"); - } - /// /// Builds the Textual Notation string for the rule StateBodyItem /// @@ -282,17 +238,6 @@ private static void BuildStateBodyItemHandCoded(IType poco, ICursorCache cursorC throw new System.NotSupportedException("BuildStateBodyItemHandCoded requires manual implementation"); } - /// - /// Builds the Textual Notation string for the rule TypeBody - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildTypeBodyHandCoded(IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildTypeBodyHandCoded requires manual implementation"); - } - /// /// Builds the Textual Notation string for the rule TypeRelationshipPart /// diff --git a/SysML2.NET/TextualNotation/ViewDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/ViewDefinitionTextualNotationBuilder.cs deleted file mode 100644 index 9cf5f14d..00000000 --- a/SysML2.NET/TextualNotation/ViewDefinitionTextualNotationBuilder.cs +++ /dev/null @@ -1,43 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// 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.Views; - - /// - /// Hand-coded part of the - /// - public static partial class ViewDefinitionTextualNotationBuilder - { - /// - /// Builds the Textual Notation string for the rule ViewDefinitionBody - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildViewDefinitionBodyHandCoded(IViewDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildViewDefinitionBodyHandCoded requires manual implementation"); - } - } -} diff --git a/SysML2.NET/TextualNotation/ViewUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/ViewUsageTextualNotationBuilder.cs deleted file mode 100644 index 86502be5..00000000 --- a/SysML2.NET/TextualNotation/ViewUsageTextualNotationBuilder.cs +++ /dev/null @@ -1,43 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// 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.Views; - - /// - /// Hand-coded part of the - /// - public static partial class ViewUsageTextualNotationBuilder - { - /// - /// Builds the Textual Notation string for the rule ViewBody - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildViewBodyHandCoded(IViewUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildViewBodyHandCoded requires manual implementation"); - } - } -} From 521ddf26baf39abd8b4357be068e6ed1c4bb592b Mon Sep 17 00:00:00 2001 From: atheate Date: Wed, 22 Apr 2026 11:39:04 +0200 Subject: [PATCH 30/33] Supports new set of multiple alternative using guard system --- CLAUDE.md | 1 + .../HandleBarHelpers/RulesHelper.cs | 48 ++- SysML2.NET/Core/Poco/FeatureMembership.cs | 107 ------ SysML2.NET/Core/Poco/OwningMembership.cs | 51 --- .../ConnectionUsageTextualNotationBuilder.cs | 11 +- .../ConnectorTextualNotationBuilder.cs | 11 +- .../ElementTextualNotationBuilder.cs | 108 +++++- .../ExpressionTextualNotationBuilder.cs | 81 ++++- ...FeatureMembershipTextualNotationBuilder.cs | 11 +- .../FeatureTextualNotationBuilder.cs | 48 ++- .../IfActionUsageTextualNotationBuilder.cs | 12 +- .../InterfaceUsageTextualNotationBuilder.cs | 11 +- .../OwningMembershipTextualNotationBuilder.cs | 23 +- .../TypeTextualNotationBuilder.cs | 17 +- .../UsageTextualNotationBuilder.cs | 157 +++++++- .../ConnectionUsageTextualNotationBuilder.cs | 10 - .../ConnectorTextualNotationBuilder.cs | 11 - .../ElementTextualNotationBuilder.cs | 10 - .../ExpressionTextualNotationBuilder.cs | 33 -- ...FeatureMembershipTextualNotationBuilder.cs | 11 - .../FeatureTextualNotationBuilder.cs | 33 -- .../IfActionUsageTextualNotationBuilder.cs | 10 - .../InterfaceUsageTextualNotationBuilder.cs | 11 - .../OwningMembershipTextualNotationBuilder.cs | 10 - .../TextualNotationValidationExtensions.cs | 342 ++++++++++++++++++ .../TypeTextualNotationBuilder.cs | 10 - .../UsageTextualNotationBuilder.cs | 54 --- 27 files changed, 838 insertions(+), 404 deletions(-) delete mode 100644 SysML2.NET/Core/Poco/FeatureMembership.cs delete mode 100644 SysML2.NET/Core/Poco/OwningMembership.cs create mode 100644 SysML2.NET/TextualNotation/TextualNotationValidationExtensions.cs diff --git a/CLAUDE.md b/CLAUDE.md index af2fe8f9..720d7d98 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -118,3 +118,4 @@ Auto-generated DTOs use structured namespaces reflecting the KerML/SysML package - Prefer switch expressions/statements over if-else chains when applicable - Prefer indexer syntax (e.g., 'list[^1]') and range syntax (e.g., 'array[1..^1]') over LINQ methods (e.g., 'list.Last()', 'list.Skip(1).Take(n)') when applicable - Use meaningful variable names instead of single-letter names in any context (e.g., 'charIndex' instead of 'i', 'currentChar' instead of 'c', 'element' instead of 'e') +- Use 'NotSupportedException' (not 'NotImplementedException') for placeholder/stub methods that require manual implementation diff --git a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs index bd6f9a2d..f7f424d4 100644 --- a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs +++ b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs @@ -808,9 +808,23 @@ private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter if (hasUnresolvableDuplicates) { - var handCodedRuleName = alternatives.ElementAt(0).TextualNotationRule.RuleName; - writer.WriteSafeString($"Build{handCodedRuleName}HandCoded({ruleGenerationContext.CurrentVariableName ?? "poco"}, cursorCache, stringBuilder);"); - break; + // For unresolvable duplicate groups, use IsValidFor{RuleName}() as when guards + foreach (var duplicateGroup in duplicateClasses) + { + var unguardedElements = duplicateGroup.Value + .Where(element => !whenGuards.ContainsKey(element.RuleElement)) + .ToList(); + + if (unguardedElements.Count > 1) + { + // Add IsValidFor guards to all but the last unguarded element (fallback) + for (var elementIndex = 0; elementIndex < unguardedElements.Count - 1; elementIndex++) + { + var element = unguardedElements[elementIndex]; + whenGuards[element.RuleElement] = $"{{0}}.IsValidFor{element.RuleElement.Name}()"; + } + } + } } // Rebuild the overall ordered list respecting the reordered duplicate groups @@ -835,6 +849,26 @@ private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter mappedNonTerminalElements = reorderedElements; + // Re-sort to ensure proper switch ordering: more specific types first, + // default case last. This prevents a superclass case (e.g., IType) from + // catching everything before guarded subclass cases (e.g., IFeature when ...). + var defaultElement = mappedNonTerminalElements + .LastOrDefault(x => x.UmlClass == ruleGenerationContext.NamedElementToGenerate && !whenGuards.ContainsKey(x.RuleElement)); + + mappedNonTerminalElements.Sort((a, b) => + { + var aIsDefault = defaultElement.RuleElement != null && a.RuleElement == defaultElement.RuleElement; + var bIsDefault = defaultElement.RuleElement != null && b.RuleElement == defaultElement.RuleElement; + + if (aIsDefault && !bIsDefault) return 1; + if (bIsDefault && !aIsDefault) return -1; + + var depthA = a.UmlClass.QueryAllGeneralClassifiers().Count(); + var depthB = b.UmlClass.QueryAllGeneralClassifiers().Count(); + + return depthB.CompareTo(depthA); + }); + var variableName = "poco"; if (ruleGenerationContext.CallerRule is AssignmentElement assignmentElement) @@ -846,9 +880,7 @@ private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter writer.WriteSafeString($"switch({variableName}){Environment.NewLine}"); writer.WriteSafeString("{"); - // Determine the last element that would be a default case (only one default allowed) - var defaultElement = mappedNonTerminalElements - .LastOrDefault(x => x.UmlClass == ruleGenerationContext.NamedElementToGenerate && !whenGuards.ContainsKey(x.RuleElement)); + // defaultElement was already determined above during the re-sort foreach (var orderedNonTerminalElement in mappedNonTerminalElements) { @@ -875,8 +907,12 @@ private static void ProcessUnitypedAlternativesWithOneElement(EncodedTextWriter ruleGenerationContext.CurrentVariableName = caseVarName; } + var previousCaller = ruleGenerationContext.CallerRule; + ruleGenerationContext.CallerRule = orderedNonTerminalElement.RuleElement; + ProcessNonTerminalElement(writer, orderedNonTerminalElement.UmlClass, orderedNonTerminalElement.RuleElement, ruleGenerationContext); + ruleGenerationContext.CallerRule = previousCaller; ruleGenerationContext.CurrentVariableName = previousVariableName; writer.WriteSafeString($"{Environment.NewLine}break;{Environment.NewLine}"); } diff --git a/SysML2.NET/Core/Poco/FeatureMembership.cs b/SysML2.NET/Core/Poco/FeatureMembership.cs deleted file mode 100644 index c2183e63..00000000 --- a/SysML2.NET/Core/Poco/FeatureMembership.cs +++ /dev/null @@ -1,107 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// 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.Core.POCO.Core.Types -{ - using System.Linq; - - using SysML2.NET.Core.POCO.Root.Elements; - using SysML2.NET.Core.POCO.Systems.Allocations; - using SysML2.NET.Core.POCO.Systems.Connections; - using SysML2.NET.Core.POCO.Systems.DefinitionAndUsage; - using SysML2.NET.Core.POCO.Systems.Flows; - using SysML2.NET.Core.POCO.Systems.Interfaces; - using SysML2.NET.Core.POCO.Systems.Items; - using SysML2.NET.Core.POCO.Systems.Occurrences; - using SysML2.NET.Core.POCO.Systems.Parts; - using SysML2.NET.Core.POCO.Systems.Ports; - using SysML2.NET.Core.POCO.Systems.Views; - - /// - /// A FeatureMembership is an OwningMembership between an ownedMemberFeature and an owningType. If the - /// ownedMemberFeature has isVariable = false, then the FeatureMembership implies that the owningType is - /// also a featuringType of the ownedMemberFeature. If the ownedMemberFeature has isVariable = true, - /// then the FeatureMembership implies that the ownedMemberFeature is featured by the snapshots of the - /// owningType, which must specialize the Kernel Semantic Library base class Occurrence. - /// - public partial class FeatureMembership - { - /// - /// Asserts that this contais at least element into the - /// collection - /// - /// True if it contains one - internal bool IsValidForSourceSuccessionMember() - { - return this.HasRelatedElementOfType(); - } - - /// - /// Asserts that this contais at least element into the - /// collection but none of them are - /// - /// True if it contains one but no - internal bool IsValidForNonOccurrenceUsageMember() - { - return !this.IsValidForOccurrenceUsageMember() && this.HasRelatedElementOfType(); - } - - /// - /// Asserts that this contais at least element into the - /// collection - /// - /// True if it contains one - internal bool IsValidForOccurrenceUsageMember() - { - return this.HasRelatedElementOfType(); - } - - /// - /// Asserts that the contains at least one element - /// - /// Any - /// True if the contains one element - private bool HasRelatedElementOfType() where T : IElement - { - return this.OwnedRelatedElement.OfType().Any(); - } - - /// - /// Asserts that the current have valid typeinto the - /// collection for the StructureUsageMember - /// - /// True if contains any of the required element type - internal bool IsValidForStructureUsageMember() - { - return this.HasRelatedElementOfType() - || this.HasRelatedElementOfType() - || this.HasRelatedElementOfType() - || this.HasRelatedElementOfType() - || this.HasRelatedElementOfType() - || this.HasRelatedElementOfType() - || this.HasRelatedElementOfType() - || this.HasRelatedElementOfType() - || this.HasRelatedElementOfType() - || this.HasRelatedElementOfType() - || this.HasRelatedElementOfType() - || this.HasRelatedElementOfType(); - } - } -} diff --git a/SysML2.NET/Core/Poco/OwningMembership.cs b/SysML2.NET/Core/Poco/OwningMembership.cs deleted file mode 100644 index e41b2fc4..00000000 --- a/SysML2.NET/Core/Poco/OwningMembership.cs +++ /dev/null @@ -1,51 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// 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.Core.POCO.Root.Namespaces -{ - using System.Linq; - - using SysML2.NET.Core.POCO.Core.Features; - - /// - /// An OwningMembership is a Membership that owns its memberElement as a ownedRelatedElement. The - /// ownedMemberElement becomes an ownedMember of the membershipOwningNamespace. - /// - public partial class OwningMembership - { - /// - /// Asserts that the current contains at least one inside the collection - /// - /// True if one is contained into the - internal bool IsValidForNonFeatureMember() - { - return this.OwnedRelatedElement.OfType().Any(); - } - - /// - /// Asserts that the current does not contains any inside the collection - /// - /// True if none is contained into the - internal bool IsValidForFeatureMember() - { - return !this.IsValidForNonFeatureMember(); - } - } -} diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs index 02767c94..ea345ae7 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectionUsageTextualNotationBuilder.cs @@ -43,7 +43,16 @@ public static partial class ConnectionUsageTextualNotationBuilder /// The that contains the entire textual notation public static void BuildConnectorPart(SysML2.NET.Core.POCO.Systems.Connections.IConnectionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildConnectorPartHandCoded(poco, cursorCache, stringBuilder); + switch (poco) + { + case SysML2.NET.Core.POCO.Systems.Connections.IConnectionUsage pocoConnectionUsageBinaryConnectorPart when pocoConnectionUsageBinaryConnectorPart.IsValidForBinaryConnectorPart(): + BuildBinaryConnectorPart(pocoConnectionUsageBinaryConnectorPart, cursorCache, stringBuilder); + break; + default: + BuildNaryConnectorPart(poco, cursorCache, stringBuilder); + break; + } + } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs index 35ed1ef6..b70b4b69 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ConnectorTextualNotationBuilder.cs @@ -43,7 +43,16 @@ public static partial class ConnectorTextualNotationBuilder /// The that contains the entire textual notation public static void BuildConnectorDeclaration(SysML2.NET.Core.POCO.Kernel.Connectors.IConnector poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildConnectorDeclarationHandCoded(poco, cursorCache, stringBuilder); + switch (poco) + { + case SysML2.NET.Core.POCO.Kernel.Connectors.IConnector pocoConnectorBinaryConnectorDeclaration when pocoConnectorBinaryConnectorDeclaration.IsValidForBinaryConnectorDeclaration(): + BuildBinaryConnectorDeclaration(pocoConnectorBinaryConnectorDeclaration, cursorCache, stringBuilder); + break; + default: + BuildNaryConnectorDeclaration(poco, cursorCache, stringBuilder); + break; + } + } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementTextualNotationBuilder.cs index d151f56a..87de9ba5 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ElementTextualNotationBuilder.cs @@ -70,7 +70,97 @@ public static void BuildIdentification(SysML2.NET.Core.POCO.Root.Elements.IEleme /// The that contains the entire textual notation public static void BuildDefinitionElement(SysML2.NET.Core.POCO.Root.Elements.IElement poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildDefinitionElementHandCoded(poco, cursorCache, stringBuilder); + switch (poco) + { + case SysML2.NET.Core.POCO.Systems.Interfaces.IInterfaceDefinition pocoInterfaceDefinition: + InterfaceDefinitionTextualNotationBuilder.BuildInterfaceDefinition(pocoInterfaceDefinition, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Connections.IConnectionDefinition pocoConnectionDefinition: + ConnectionDefinitionTextualNotationBuilder.BuildConnectionDefinition(pocoConnectionDefinition, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Flows.IFlowDefinition pocoFlowDefinition: + FlowDefinitionTextualNotationBuilder.BuildFlowDefinition(pocoFlowDefinition, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Requirements.IConcernDefinition pocoConcernDefinition: + ConcernDefinitionTextualNotationBuilder.BuildConcernDefinition(pocoConcernDefinition, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.AnalysisCases.IAnalysisCaseDefinition pocoAnalysisCaseDefinition: + AnalysisCaseDefinitionTextualNotationBuilder.BuildAnalysisCaseDefinition(pocoAnalysisCaseDefinition, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.VerificationCases.IVerificationCaseDefinition pocoVerificationCaseDefinition: + VerificationCaseDefinitionTextualNotationBuilder.BuildVerificationCaseDefinition(pocoVerificationCaseDefinition, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.UseCases.IUseCaseDefinition pocoUseCaseDefinition: + UseCaseDefinitionTextualNotationBuilder.BuildUseCaseDefinition(pocoUseCaseDefinition, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Views.IViewpointDefinition pocoViewpointDefinition: + ViewpointDefinitionTextualNotationBuilder.BuildViewpointDefinition(pocoViewpointDefinition, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Requirements.IRequirementDefinition pocoRequirementDefinition: + RequirementDefinitionTextualNotationBuilder.BuildRequirementDefinition(pocoRequirementDefinition, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Cases.ICaseDefinition pocoCaseDefinition: + CaseDefinitionTextualNotationBuilder.BuildCaseDefinition(pocoCaseDefinition, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Views.IRenderingDefinition pocoRenderingDefinition: + RenderingDefinitionTextualNotationBuilder.BuildRenderingDefinition(pocoRenderingDefinition, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Views.IViewDefinition pocoViewDefinition: + ViewDefinitionTextualNotationBuilder.BuildViewDefinition(pocoViewDefinition, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Metadata.IMetadataDefinition pocoMetadataDefinition: + MetadataDefinitionTextualNotationBuilder.BuildMetadataDefinition(pocoMetadataDefinition, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Calculations.ICalculationDefinition pocoCalculationDefinition: + CalculationDefinitionTextualNotationBuilder.BuildCalculationDefinition(pocoCalculationDefinition, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Constraints.IConstraintDefinition pocoConstraintDefinition: + ConstraintDefinitionTextualNotationBuilder.BuildConstraintDefinition(pocoConstraintDefinition, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Parts.IPartDefinition pocoPartDefinition: + PartDefinitionTextualNotationBuilder.BuildPartDefinition(pocoPartDefinition, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.States.IStateDefinition pocoStateDefinition: + StateDefinitionTextualNotationBuilder.BuildStateDefinition(pocoStateDefinition, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Items.IItemDefinition pocoItemDefinition: + ItemDefinitionTextualNotationBuilder.BuildItemDefinition(pocoItemDefinition, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Ports.IPortDefinition pocoPortDefinition: + PortDefinitionTextualNotationBuilder.BuildPortDefinition(pocoPortDefinition, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Actions.IActionDefinition pocoActionDefinition: + ActionDefinitionTextualNotationBuilder.BuildActionDefinition(pocoActionDefinition, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Enumerations.IEnumerationDefinition pocoEnumerationDefinition: + EnumerationDefinitionTextualNotationBuilder.BuildEnumerationDefinition(pocoEnumerationDefinition, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Attributes.IAttributeDefinition pocoAttributeDefinition: + AttributeDefinitionTextualNotationBuilder.BuildAttributeDefinition(pocoAttributeDefinition, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceDefinition pocoOccurrenceDefinitionOccurrenceDefinition when pocoOccurrenceDefinitionOccurrenceDefinition.IsValidForOccurrenceDefinition(): + OccurrenceDefinitionTextualNotationBuilder.BuildOccurrenceDefinition(pocoOccurrenceDefinitionOccurrenceDefinition, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceDefinition pocoOccurrenceDefinition: + OccurrenceDefinitionTextualNotationBuilder.BuildIndividualDefinition(pocoOccurrenceDefinition, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IDefinition pocoDefinition: + DefinitionTextualNotationBuilder.BuildExtendedDefinition(pocoDefinition, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Packages.ILibraryPackage pocoLibraryPackage: + LibraryPackageTextualNotationBuilder.BuildLibraryPackage(pocoLibraryPackage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Root.Dependencies.IDependency pocoDependency: + DependencyTextualNotationBuilder.BuildDependency(pocoDependency, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Packages.IPackage pocoPackage: + PackageTextualNotationBuilder.BuildPackage(pocoPackage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Root.Annotations.IAnnotatingElement pocoAnnotatingElement: + AnnotatingElementTextualNotationBuilder.BuildAnnotatingElement(pocoAnnotatingElement, cursorCache, stringBuilder); + break; + } + } /// @@ -162,6 +252,12 @@ public static void BuildNonFeatureElement(SysML2.NET.Core.POCO.Root.Elements.IEl case SysML2.NET.Core.POCO.Core.Features.IRedefinition pocoRedefinition: RedefinitionTextualNotationBuilder.BuildRedefinition(pocoRedefinition, cursorCache, stringBuilder); break; + case SysML2.NET.Core.POCO.Core.Features.ISubsetting pocoSubsetting: + SubsettingTextualNotationBuilder.BuildSubsetting(pocoSubsetting, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Core.Features.IFeatureTyping pocoFeatureTyping: + FeatureTypingTextualNotationBuilder.BuildFeatureTyping(pocoFeatureTyping, cursorCache, stringBuilder); + break; case SysML2.NET.Core.POCO.Core.Classifiers.IClassifier pocoClassifier: ClassifierTextualNotationBuilder.BuildClassifier(pocoClassifier, cursorCache, stringBuilder); break; @@ -171,11 +267,8 @@ public static void BuildNonFeatureElement(SysML2.NET.Core.POCO.Root.Elements.IEl case SysML2.NET.Core.POCO.Core.Classifiers.ISubclassification pocoSubclassification: SubclassificationTextualNotationBuilder.BuildSubclassification(pocoSubclassification, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Core.Features.IFeatureTyping pocoFeatureTyping: - FeatureTypingTextualNotationBuilder.BuildFeatureTyping(pocoFeatureTyping, cursorCache, stringBuilder); - break; - case SysML2.NET.Core.POCO.Core.Features.ISubsetting pocoSubsetting: - SubsettingTextualNotationBuilder.BuildSubsetting(pocoSubsetting, cursorCache, stringBuilder); + case SysML2.NET.Core.POCO.Core.Features.ITypeFeaturing pocoTypeFeaturing: + TypeFeaturingTextualNotationBuilder.BuildTypeFeaturing(pocoTypeFeaturing, cursorCache, stringBuilder); break; case SysML2.NET.Core.POCO.Root.Dependencies.IDependency pocoDependency: DependencyTextualNotationBuilder.BuildDependency(pocoDependency, cursorCache, stringBuilder); @@ -198,9 +291,6 @@ public static void BuildNonFeatureElement(SysML2.NET.Core.POCO.Root.Elements.IEl case SysML2.NET.Core.POCO.Core.Features.IFeatureInverting pocoFeatureInverting: FeatureInvertingTextualNotationBuilder.BuildFeatureInverting(pocoFeatureInverting, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Core.Features.ITypeFeaturing pocoTypeFeaturing: - TypeFeaturingTextualNotationBuilder.BuildTypeFeaturing(pocoTypeFeaturing, cursorCache, stringBuilder); - break; case SysML2.NET.Core.POCO.Root.Namespaces.INamespace pocoNamespace: NamespaceTextualNotationBuilder.BuildNamespace(pocoNamespace, cursorCache, stringBuilder); break; diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs index 81f9fa10..41f8b650 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ExpressionTextualNotationBuilder.cs @@ -43,7 +43,34 @@ public static partial class ExpressionTextualNotationBuilder /// The that contains the entire textual notation public static void BuildOwnedExpression(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildOwnedExpressionHandCoded(poco, cursorCache, stringBuilder); + switch (poco) + { + case SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression pocoOperatorExpressionConditionalExpression when pocoOperatorExpressionConditionalExpression.IsValidForConditionalExpression(): + OperatorExpressionTextualNotationBuilder.BuildConditionalExpression(pocoOperatorExpressionConditionalExpression, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression pocoOperatorExpressionConditionalBinaryOperatorExpression when pocoOperatorExpressionConditionalBinaryOperatorExpression.IsValidForConditionalBinaryOperatorExpression(): + OperatorExpressionTextualNotationBuilder.BuildConditionalBinaryOperatorExpression(pocoOperatorExpressionConditionalBinaryOperatorExpression, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression pocoOperatorExpressionBinaryOperatorExpression when pocoOperatorExpressionBinaryOperatorExpression.IsValidForBinaryOperatorExpression(): + OperatorExpressionTextualNotationBuilder.BuildBinaryOperatorExpression(pocoOperatorExpressionBinaryOperatorExpression, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression pocoOperatorExpressionUnaryOperatorExpression when pocoOperatorExpressionUnaryOperatorExpression.IsValidForUnaryOperatorExpression(): + OperatorExpressionTextualNotationBuilder.BuildUnaryOperatorExpression(pocoOperatorExpressionUnaryOperatorExpression, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression pocoOperatorExpressionClassificationExpression when pocoOperatorExpressionClassificationExpression.IsValidForClassificationExpression(): + OperatorExpressionTextualNotationBuilder.BuildClassificationExpression(pocoOperatorExpressionClassificationExpression, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression pocoOperatorExpressionMetaclassificationExpression when pocoOperatorExpressionMetaclassificationExpression.IsValidForMetaclassificationExpression(): + OperatorExpressionTextualNotationBuilder.BuildMetaclassificationExpression(pocoOperatorExpressionMetaclassificationExpression, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression pocoOperatorExpression: + OperatorExpressionTextualNotationBuilder.BuildExtentExpression(pocoOperatorExpression, cursorCache, stringBuilder); + break; + default: + BuildPrimaryExpression(poco, cursorCache, stringBuilder); + break; + } + } /// @@ -76,7 +103,31 @@ public static void BuildPrimaryExpression(SysML2.NET.Core.POCO.Kernel.Functions. /// The that contains the entire textual notation public static void BuildNonFeatureChainPrimaryExpression(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildNonFeatureChainPrimaryExpressionHandCoded(poco, cursorCache, stringBuilder); + switch (poco) + { + case SysML2.NET.Core.POCO.Kernel.Expressions.IIndexExpression pocoIndexExpression: + IndexExpressionTextualNotationBuilder.BuildIndexExpression(pocoIndexExpression, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Expressions.ISelectExpression pocoSelectExpression: + SelectExpressionTextualNotationBuilder.BuildSelectExpression(pocoSelectExpression, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Expressions.ICollectExpression pocoCollectExpression: + CollectExpressionTextualNotationBuilder.BuildCollectExpression(pocoCollectExpression, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Expressions.IOperatorExpression pocoOperatorExpression: + OperatorExpressionTextualNotationBuilder.BuildBracketExpression(pocoOperatorExpression, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Expressions.IInvocationExpression pocoInvocationExpression: + InvocationExpressionTextualNotationBuilder.BuildFunctionOperationExpression(pocoInvocationExpression, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Functions.IExpression pocoExpressionSequenceExpression when pocoExpressionSequenceExpression.IsValidForSequenceExpression(): + BuildSequenceExpression(pocoExpressionSequenceExpression, cursorCache, stringBuilder); + break; + default: + BuildBaseExpression(poco, cursorCache, stringBuilder); + break; + } + } /// @@ -139,7 +190,31 @@ public static void BuildFunctionReference(SysML2.NET.Core.POCO.Kernel.Functions. /// The that contains the entire textual notation public static void BuildBaseExpression(SysML2.NET.Core.POCO.Kernel.Functions.IExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildBaseExpressionHandCoded(poco, cursorCache, stringBuilder); + switch (poco) + { + case SysML2.NET.Core.POCO.Kernel.Expressions.IInvocationExpression pocoInvocationExpression: + InvocationExpressionTextualNotationBuilder.BuildInvocationExpression(pocoInvocationExpression, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Expressions.IConstructorExpression pocoConstructorExpression: + ConstructorExpressionTextualNotationBuilder.BuildConstructorExpression(pocoConstructorExpression, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Expressions.INullExpression pocoNullExpression: + NullExpressionTextualNotationBuilder.BuildNullExpression(pocoNullExpression, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Expressions.ILiteralExpression pocoLiteralExpression: + LiteralExpressionTextualNotationBuilder.BuildLiteralExpression(pocoLiteralExpression, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression pocoFeatureReferenceExpressionFeatureReferenceExpression when pocoFeatureReferenceExpressionFeatureReferenceExpression.IsValidForFeatureReferenceExpression(): + FeatureReferenceExpressionTextualNotationBuilder.BuildFeatureReferenceExpression(pocoFeatureReferenceExpressionFeatureReferenceExpression, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression pocoFeatureReferenceExpression: + FeatureReferenceExpressionTextualNotationBuilder.BuildBodyExpression(pocoFeatureReferenceExpression, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Expressions.IMetadataAccessExpression pocoMetadataAccessExpression: + MetadataAccessExpressionTextualNotationBuilder.BuildMetadataAccessExpression(pocoMetadataAccessExpression, cursorCache, stringBuilder); + break; + } + } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs index 5af1bfe2..3c1c536e 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureMembershipTextualNotationBuilder.cs @@ -266,7 +266,16 @@ public static void BuildFlowFeatureMember(SysML2.NET.Core.POCO.Core.Types.IFeatu /// The that contains the entire textual notation public static void BuildActionBehaviorMember(SysML2.NET.Core.POCO.Core.Types.IFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildActionBehaviorMemberHandCoded(poco, cursorCache, stringBuilder); + switch (poco) + { + case SysML2.NET.Core.POCO.Core.Types.IFeatureMembership pocoFeatureMembershipBehaviorUsageMember when pocoFeatureMembershipBehaviorUsageMember.IsValidForBehaviorUsageMember(): + BuildBehaviorUsageMember(pocoFeatureMembershipBehaviorUsageMember, cursorCache, stringBuilder); + break; + default: + BuildActionNodeMember(poco, cursorCache, stringBuilder); + break; + } + } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs index 21f548af..ed0e5779 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/FeatureTextualNotationBuilder.cs @@ -79,7 +79,25 @@ public static void BuildFeatureSpecializationPart(SysML2.NET.Core.POCO.Core.Feat /// The that contains the entire textual notation public static void BuildFeatureSpecialization(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildFeatureSpecializationHandCoded(poco, cursorCache, stringBuilder); + switch (poco) + { + case SysML2.NET.Core.POCO.Core.Features.IFeature pocoFeatureTypings when pocoFeatureTypings.IsValidForTypings(): + BuildTypings(pocoFeatureTypings, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Core.Features.IFeature pocoFeatureSubsettings when pocoFeatureSubsettings.IsValidForSubsettings(): + BuildSubsettings(pocoFeatureSubsettings, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Core.Features.IFeature pocoFeatureReferences when pocoFeatureReferences.IsValidForReferences(): + BuildReferences(pocoFeatureReferences, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Core.Features.IFeature pocoFeatureCrosses when pocoFeatureCrosses.IsValidForCrosses(): + BuildCrosses(pocoFeatureCrosses, cursorCache, stringBuilder); + break; + default: + BuildRedefinitions(poco, cursorCache, stringBuilder); + break; + } + } /// @@ -668,7 +686,22 @@ public static void BuildFeatureIdentification(SysML2.NET.Core.POCO.Core.Features /// The that contains the entire textual notation public static void BuildFeatureRelationshipPart(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildFeatureRelationshipPartHandCoded(poco, cursorCache, stringBuilder); + switch (poco) + { + case SysML2.NET.Core.POCO.Core.Features.IFeature pocoFeatureChainingPart when pocoFeatureChainingPart.IsValidForChainingPart(): + BuildChainingPart(pocoFeatureChainingPart, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Core.Features.IFeature pocoFeatureInvertingPart when pocoFeatureInvertingPart.IsValidForInvertingPart(): + BuildInvertingPart(pocoFeatureInvertingPart, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Core.Types.IType pocoType: + TypeTextualNotationBuilder.BuildTypeRelationshipPart(pocoType, cursorCache, stringBuilder); + break; + default: + BuildTypeFeaturingPart(poco, cursorCache, stringBuilder); + break; + } + } /// @@ -993,7 +1026,16 @@ public static void BuildConstructorResult(SysML2.NET.Core.POCO.Core.Features.IFe public static void BuildArgumentList(SysML2.NET.Core.POCO.Core.Features.IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { stringBuilder.Append("("); - BuildArgumentListHandCoded(poco, cursorCache, stringBuilder); + switch (poco) + { + case SysML2.NET.Core.POCO.Core.Features.IFeature pocoFeaturePositionalArgumentList when pocoFeaturePositionalArgumentList.IsValidForPositionalArgumentList(): + BuildPositionalArgumentList(pocoFeaturePositionalArgumentList, cursorCache, stringBuilder); + break; + default: + BuildNamedArgumentList(poco, cursorCache, stringBuilder); + break; + } + stringBuilder.Append(")"); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs index 4a8e4ada..c67cc688 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/IfActionUsageTextualNotationBuilder.cs @@ -72,7 +72,17 @@ public static void BuildIfNode(SysML2.NET.Core.POCO.Systems.Actions.IIfActionUsa if (ownedRelationshipCursor.Current != null) { stringBuilder.Append("else "); - BuildIfNodeHandCoded(poco, cursorCache, stringBuilder); + switch (ownedRelationshipCursor.Current) + { + case SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership pocoParameterMembershipActionBodyParameterMember when pocoParameterMembershipActionBodyParameterMember.IsValidForActionBodyParameterMember(): + ParameterMembershipTextualNotationBuilder.BuildActionBodyParameterMember(pocoParameterMembershipActionBodyParameterMember, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Kernel.Behaviors.IParameterMembership pocoParameterMembership: + ParameterMembershipTextualNotationBuilder.BuildIfNodeParameterMember(pocoParameterMembership, cursorCache, stringBuilder); + break; + } + ownedRelationshipCursor.Move(); + } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs index ca2c287a..4b7b941d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/InterfaceUsageTextualNotationBuilder.cs @@ -55,7 +55,16 @@ public static void BuildInterfaceUsageDeclaration(SysML2.NET.Core.POCO.Systems.I /// The that contains the entire textual notation public static void BuildInterfacePart(SysML2.NET.Core.POCO.Systems.Interfaces.IInterfaceUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildInterfacePartHandCoded(poco, cursorCache, stringBuilder); + switch (poco) + { + case SysML2.NET.Core.POCO.Systems.Interfaces.IInterfaceUsage pocoInterfaceUsageBinaryInterfacePart when pocoInterfaceUsageBinaryInterfacePart.IsValidForBinaryInterfacePart(): + BuildBinaryInterfacePart(pocoInterfaceUsageBinaryInterfacePart, cursorCache, stringBuilder); + break; + default: + BuildNaryInterfacePart(poco, cursorCache, stringBuilder); + break; + } + } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs index 303b0551..d69b6e9d 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OwningMembershipTextualNotationBuilder.cs @@ -173,18 +173,10 @@ public static void BuildMultiplicityExpressionMember(SysML2.NET.Core.POCO.Root.N switch (ownedRelatedElementCursor.Current) { case SysML2.NET.Core.POCO.Kernel.Expressions.ILiteralExpression pocoLiteralExpression: - - if (pocoLiteralExpression is SysML2.NET.Core.POCO.Kernel.Expressions.ILiteralExpression elementAsLiteralExpression) - { - LiteralExpressionTextualNotationBuilder.BuildLiteralExpression(elementAsLiteralExpression, cursorCache, stringBuilder); - } + LiteralExpressionTextualNotationBuilder.BuildLiteralExpression(pocoLiteralExpression, cursorCache, stringBuilder); break; case SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression pocoFeatureReferenceExpression: - - if (pocoFeatureReferenceExpression is SysML2.NET.Core.POCO.Kernel.Expressions.IFeatureReferenceExpression elementAsFeatureReferenceExpression) - { - FeatureReferenceExpressionTextualNotationBuilder.BuildFeatureReferenceExpression(elementAsFeatureReferenceExpression, cursorCache, stringBuilder); - } + FeatureReferenceExpressionTextualNotationBuilder.BuildFeatureReferenceExpression(pocoFeatureReferenceExpression, cursorCache, stringBuilder); break; } ownedRelatedElementCursor.Move(); @@ -346,7 +338,16 @@ public static void BuildPrefixMetadataMember(SysML2.NET.Core.POCO.Root.Namespace /// The that contains the entire textual notation public static void BuildNamespaceMember(SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildNamespaceMemberHandCoded(poco, cursorCache, stringBuilder); + switch (poco) + { + case SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership pocoOwningMembershipNonFeatureMember when pocoOwningMembershipNonFeatureMember.IsValidForNonFeatureMember(): + BuildNonFeatureMember(pocoOwningMembershipNonFeatureMember, cursorCache, stringBuilder); + break; + default: + BuildNamespaceFeatureMember(poco, cursorCache, stringBuilder); + break; + } + } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs index fbdc38ea..b306f1b7 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs @@ -526,7 +526,22 @@ public static void BuildConjugationPart(SysML2.NET.Core.POCO.Core.Types.IType po /// The that contains the entire textual notation public static void BuildTypeRelationshipPart(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildTypeRelationshipPartHandCoded(poco, cursorCache, stringBuilder); + switch (poco) + { + case SysML2.NET.Core.POCO.Core.Types.IType pocoTypeDisjoiningPart when pocoTypeDisjoiningPart.IsValidForDisjoiningPart(): + BuildDisjoiningPart(pocoTypeDisjoiningPart, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Core.Types.IType pocoTypeUnioningPart when pocoTypeUnioningPart.IsValidForUnioningPart(): + BuildUnioningPart(pocoTypeUnioningPart, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Core.Types.IType pocoTypeIntersectingPart when pocoTypeIntersectingPart.IsValidForIntersectingPart(): + BuildIntersectingPart(pocoTypeIntersectingPart, cursorCache, stringBuilder); + break; + default: + BuildDifferencingPart(poco, cursorCache, stringBuilder); + break; + } + } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs index c7b0f56d..64f29fe1 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs @@ -304,7 +304,16 @@ public static void BuildNonOccurrenceUsageElement(SysML2.NET.Core.POCO.Systems.D /// The that contains the entire textual notation public static void BuildOccurrenceUsageElement(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildOccurrenceUsageElementHandCoded(poco, cursorCache, stringBuilder); + switch (poco) + { + case SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage pocoUsageStructureUsageElement when pocoUsageStructureUsageElement.IsValidForStructureUsageElement(): + BuildStructureUsageElement(pocoUsageStructureUsageElement, cursorCache, stringBuilder); + break; + default: + BuildBehaviorUsageElement(poco, cursorCache, stringBuilder); + break; + } + } /// @@ -316,7 +325,55 @@ public static void BuildOccurrenceUsageElement(SysML2.NET.Core.POCO.Systems.Defi /// The that contains the entire textual notation public static void BuildStructureUsageElement(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildStructureUsageElementHandCoded(poco, cursorCache, stringBuilder); + switch (poco) + { + case SysML2.NET.Core.POCO.Systems.Flows.ISuccessionFlowUsage pocoSuccessionFlowUsage: + SuccessionFlowUsageTextualNotationBuilder.BuildSuccessionFlowUsage(pocoSuccessionFlowUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Interfaces.IInterfaceUsage pocoInterfaceUsage: + InterfaceUsageTextualNotationBuilder.BuildInterfaceUsage(pocoInterfaceUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Allocations.IAllocationUsage pocoAllocationUsage: + AllocationUsageTextualNotationBuilder.BuildAllocationUsage(pocoAllocationUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Flows.IFlowUsage pocoFlowUsageMessage when pocoFlowUsageMessage.IsValidForMessage(): + FlowUsageTextualNotationBuilder.BuildMessage(pocoFlowUsageMessage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Flows.IFlowUsage pocoFlowUsage: + FlowUsageTextualNotationBuilder.BuildFlowUsage(pocoFlowUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Connections.IConnectionUsage pocoConnectionUsage: + ConnectionUsageTextualNotationBuilder.BuildConnectionUsage(pocoConnectionUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Views.IViewUsage pocoViewUsage: + ViewUsageTextualNotationBuilder.BuildViewUsage(pocoViewUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Views.IRenderingUsage pocoRenderingUsage: + RenderingUsageTextualNotationBuilder.BuildRenderingUsage(pocoRenderingUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Parts.IPartUsage pocoPartUsage: + PartUsageTextualNotationBuilder.BuildPartUsage(pocoPartUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Occurrences.IEventOccurrenceUsage pocoEventOccurrenceUsage: + EventOccurrenceUsageTextualNotationBuilder.BuildEventOccurrenceUsage(pocoEventOccurrenceUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Items.IItemUsage pocoItemUsage: + ItemUsageTextualNotationBuilder.BuildItemUsage(pocoItemUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Ports.IPortUsage pocoPortUsage: + PortUsageTextualNotationBuilder.BuildPortUsage(pocoPortUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceUsage pocoOccurrenceUsageOccurrenceUsage when pocoOccurrenceUsageOccurrenceUsage.IsValidForOccurrenceUsage(): + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsage(pocoOccurrenceUsageOccurrenceUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceUsage pocoOccurrenceUsageIndividualUsage when pocoOccurrenceUsageIndividualUsage.IsValidForIndividualUsage(): + OccurrenceUsageTextualNotationBuilder.BuildIndividualUsage(pocoOccurrenceUsageIndividualUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceUsage pocoOccurrenceUsage: + OccurrenceUsageTextualNotationBuilder.BuildPortionUsage(pocoOccurrenceUsage, cursorCache, stringBuilder); + break; + } + } /// @@ -391,7 +448,73 @@ public static void BuildBehaviorUsageElement(SysML2.NET.Core.POCO.Systems.Defini /// The that contains the entire textual notation public static void BuildVariantUsageElement(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildVariantUsageElementHandCoded(poco, cursorCache, stringBuilder); + switch (poco) + { + case SysML2.NET.Core.POCO.Systems.Flows.ISuccessionFlowUsage pocoSuccessionFlowUsage: + SuccessionFlowUsageTextualNotationBuilder.BuildSuccessionFlowUsage(pocoSuccessionFlowUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Interfaces.IInterfaceUsage pocoInterfaceUsage: + InterfaceUsageTextualNotationBuilder.BuildInterfaceUsage(pocoInterfaceUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Allocations.IAllocationUsage pocoAllocationUsage: + AllocationUsageTextualNotationBuilder.BuildAllocationUsage(pocoAllocationUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Flows.IFlowUsage pocoFlowUsageFlowUsage when pocoFlowUsageFlowUsage.IsValidForFlowUsage(): + FlowUsageTextualNotationBuilder.BuildFlowUsage(pocoFlowUsageFlowUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Flows.IFlowUsage pocoFlowUsage: + FlowUsageTextualNotationBuilder.BuildMessage(pocoFlowUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Connections.IConnectionUsage pocoConnectionUsage: + ConnectionUsageTextualNotationBuilder.BuildConnectionUsage(pocoConnectionUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Connections.IBindingConnectorAsUsage pocoBindingConnectorAsUsage: + BindingConnectorAsUsageTextualNotationBuilder.BuildBindingConnectorAsUsage(pocoBindingConnectorAsUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Connections.ISuccessionAsUsage pocoSuccessionAsUsage: + SuccessionAsUsageTextualNotationBuilder.BuildSuccessionAsUsage(pocoSuccessionAsUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Views.IViewUsage pocoViewUsage: + ViewUsageTextualNotationBuilder.BuildViewUsage(pocoViewUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Views.IRenderingUsage pocoRenderingUsage: + RenderingUsageTextualNotationBuilder.BuildRenderingUsage(pocoRenderingUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Parts.IPartUsage pocoPartUsage: + PartUsageTextualNotationBuilder.BuildPartUsage(pocoPartUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Occurrences.IEventOccurrenceUsage pocoEventOccurrenceUsage: + EventOccurrenceUsageTextualNotationBuilder.BuildEventOccurrenceUsage(pocoEventOccurrenceUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Items.IItemUsage pocoItemUsage: + ItemUsageTextualNotationBuilder.BuildItemUsage(pocoItemUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Ports.IPortUsage pocoPortUsage: + PortUsageTextualNotationBuilder.BuildPortUsage(pocoPortUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage pocoReferenceUsageReferenceUsage when pocoReferenceUsageReferenceUsage.IsEnd: + ReferenceUsageTextualNotationBuilder.BuildReferenceUsage(pocoReferenceUsageReferenceUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IReferenceUsage pocoReferenceUsage: + ReferenceUsageTextualNotationBuilder.BuildVariantReference(pocoReferenceUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Attributes.IAttributeUsage pocoAttributeUsage: + AttributeUsageTextualNotationBuilder.BuildAttributeUsage(pocoAttributeUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceUsage pocoOccurrenceUsageIndividualUsage when pocoOccurrenceUsageIndividualUsage.IsValidForIndividualUsage(): + OccurrenceUsageTextualNotationBuilder.BuildIndividualUsage(pocoOccurrenceUsageIndividualUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceUsage pocoOccurrenceUsageOccurrenceUsage when pocoOccurrenceUsageOccurrenceUsage.IsValidForOccurrenceUsage(): + OccurrenceUsageTextualNotationBuilder.BuildOccurrenceUsage(pocoOccurrenceUsageOccurrenceUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.Occurrences.IOccurrenceUsage pocoOccurrenceUsage: + OccurrenceUsageTextualNotationBuilder.BuildPortionUsage(pocoOccurrenceUsage, cursorCache, stringBuilder); + break; + default: + BuildBehaviorUsageElement(poco, cursorCache, stringBuilder); + break; + } + } /// @@ -433,7 +556,19 @@ public static void BuildInterfaceNonOccurrenceUsageElement(SysML2.NET.Core.POCO. /// The that contains the entire textual notation public static void BuildInterfaceOccurrenceUsageElement(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildInterfaceOccurrenceUsageElementHandCoded(poco, cursorCache, stringBuilder); + switch (poco) + { + case SysML2.NET.Core.POCO.Systems.Ports.IPortUsage pocoPortUsage: + PortUsageTextualNotationBuilder.BuildDefaultInterfaceEnd(pocoPortUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage pocoUsageStructureUsageElement when pocoUsageStructureUsageElement.IsValidForStructureUsageElement(): + BuildStructureUsageElement(pocoUsageStructureUsageElement, cursorCache, stringBuilder); + break; + default: + BuildBehaviorUsageElement(poco, cursorCache, stringBuilder); + break; + } + } /// @@ -445,7 +580,19 @@ public static void BuildInterfaceOccurrenceUsageElement(SysML2.NET.Core.POCO.Sys /// The that contains the entire textual notation public static void BuildActionTargetSuccession(SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildActionTargetSuccessionHandCoded(poco, cursorCache, stringBuilder); + switch (poco) + { + case SysML2.NET.Core.POCO.Systems.Connections.ISuccessionAsUsage pocoSuccessionAsUsage: + SuccessionAsUsageTextualNotationBuilder.BuildTargetSuccession(pocoSuccessionAsUsage, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.States.ITransitionUsage pocoTransitionUsageGuardedTargetSuccession when pocoTransitionUsageGuardedTargetSuccession.IsValidForGuardedTargetSuccession(): + TransitionUsageTextualNotationBuilder.BuildGuardedTargetSuccession(pocoTransitionUsageGuardedTargetSuccession, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Systems.States.ITransitionUsage pocoTransitionUsage: + TransitionUsageTextualNotationBuilder.BuildDefaultTargetSuccession(pocoTransitionUsage, cursorCache, stringBuilder); + break; + } + stringBuilder.Append(' '); BuildUsageBody(poco, cursorCache, stringBuilder); diff --git a/SysML2.NET/TextualNotation/ConnectionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/ConnectionUsageTextualNotationBuilder.cs index 7bb94bfe..40764493 100644 --- a/SysML2.NET/TextualNotation/ConnectionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/ConnectionUsageTextualNotationBuilder.cs @@ -40,15 +40,5 @@ private static void BuildConnectionUsageHandCoded(IConnectionUsage poco, ICursor throw new System.NotSupportedException("BuildConnectionUsageHandCoded requires manual implementation"); } - /// - /// Builds the Textual Notation string for the rule ConnectorPart - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildConnectorPartHandCoded(IConnectionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildConnectorPartHandCoded requires manual implementation"); - } } } diff --git a/SysML2.NET/TextualNotation/ConnectorTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/ConnectorTextualNotationBuilder.cs index d4ea2b31..557bd132 100644 --- a/SysML2.NET/TextualNotation/ConnectorTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/ConnectorTextualNotationBuilder.cs @@ -40,17 +40,6 @@ private static void BuildBinaryConnectorDeclarationHandCoded(IConnector poco, IC throw new System.NotSupportedException("BuildBinaryConnectorDeclarationHandCoded requires manual implementation"); } - /// - /// Builds the Textual Notation string for the rule ConnectorDeclaration - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildConnectorDeclarationHandCoded(IConnector poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildConnectorDeclarationHandCoded requires manual implementation"); - } - /// /// Builds the Textual Notation string for the rule Connector /// diff --git a/SysML2.NET/TextualNotation/ElementTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/ElementTextualNotationBuilder.cs index 0d3e8ada..b2fa8f22 100644 --- a/SysML2.NET/TextualNotation/ElementTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/ElementTextualNotationBuilder.cs @@ -29,15 +29,5 @@ namespace SysML2.NET.TextualNotation /// public static partial class ElementTextualNotationBuilder { - /// - /// Builds the Textual Notation string for the rule DefinitionElement - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildDefinitionElementHandCoded(IElement poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildDefinitionElementHandCoded requires manual implementation"); - } } } diff --git a/SysML2.NET/TextualNotation/ExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/ExpressionTextualNotationBuilder.cs index 07b61b66..ee98855f 100644 --- a/SysML2.NET/TextualNotation/ExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/ExpressionTextualNotationBuilder.cs @@ -29,17 +29,6 @@ namespace SysML2.NET.TextualNotation /// public static partial class ExpressionTextualNotationBuilder { - /// - /// Builds the Textual Notation string for the rule BaseExpression - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildBaseExpressionHandCoded(IExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildBaseExpressionHandCoded requires manual implementation"); - } - /// /// Builds the Textual Notation string for the rule FeaturePrefix /// @@ -51,28 +40,6 @@ private static void BuildFeaturePrefixHandCoded(IExpression poco, ICursorCache c throw new System.NotSupportedException("BuildFeaturePrefixHandCoded requires manual implementation"); } - /// - /// Builds the Textual Notation string for the rule NonFeatureChainPrimaryExpression - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildNonFeatureChainPrimaryExpressionHandCoded(IExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildNonFeatureChainPrimaryExpressionHandCoded requires manual implementation"); - } - - /// - /// Builds the Textual Notation string for the rule OwnedExpression - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildOwnedExpressionHandCoded(IExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildOwnedExpressionHandCoded requires manual implementation"); - } - /// /// Builds the Textual Notation string for the rule SequenceExpressionList /// diff --git a/SysML2.NET/TextualNotation/FeatureMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/FeatureMembershipTextualNotationBuilder.cs index 56c95c69..751f2a48 100644 --- a/SysML2.NET/TextualNotation/FeatureMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/FeatureMembershipTextualNotationBuilder.cs @@ -40,17 +40,6 @@ private static void BuildMemberFeature(IFeatureMembership poco, ICursorCache cur { } - /// - /// Builds the Textual Notation string for the rule ActionBehaviorMember - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildActionBehaviorMemberHandCoded(IFeatureMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildActionBehaviorMemberHandCoded requires manual implementation"); - } - /// /// Builds the Textual Notation string for the rule EntryTransitionMember /// diff --git a/SysML2.NET/TextualNotation/FeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/FeatureTextualNotationBuilder.cs index afa1622d..c1414f7c 100644 --- a/SysML2.NET/TextualNotation/FeatureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/FeatureTextualNotationBuilder.cs @@ -29,17 +29,6 @@ namespace SysML2.NET.TextualNotation /// public static partial class FeatureTextualNotationBuilder { - /// - /// Builds the Textual Notation string for the rule ArgumentList - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildArgumentListHandCoded(IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildArgumentListHandCoded requires manual implementation"); - } - /// /// Builds the Textual Notation string for the rule BasicFeaturePrefix /// @@ -84,28 +73,6 @@ private static void BuildFeatureIdentificationHandCoded(IFeature poco, ICursorCa throw new System.NotSupportedException("BuildFeatureIdentificationHandCoded requires manual implementation"); } - /// - /// Builds the Textual Notation string for the rule FeatureRelationshipPart - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildFeatureRelationshipPartHandCoded(IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildFeatureRelationshipPartHandCoded requires manual implementation"); - } - - /// - /// Builds the Textual Notation string for the rule FeatureSpecialization - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildFeatureSpecializationHandCoded(IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildFeatureSpecializationHandCoded requires manual implementation"); - } - /// /// Builds the Textual Notation string for the rule FeatureSpecializationPart /// diff --git a/SysML2.NET/TextualNotation/IfActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/IfActionUsageTextualNotationBuilder.cs index 5de94c10..702dd6fc 100644 --- a/SysML2.NET/TextualNotation/IfActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/IfActionUsageTextualNotationBuilder.cs @@ -29,15 +29,5 @@ namespace SysML2.NET.TextualNotation /// public static partial class IfActionUsageTextualNotationBuilder { - /// - /// Builds the Textual Notation string for the rule IfNode - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildIfNodeHandCoded(IIfActionUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildIfNodeHandCoded requires manual implementation"); - } } } diff --git a/SysML2.NET/TextualNotation/InterfaceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/InterfaceUsageTextualNotationBuilder.cs index c884c5f1..931684dd 100644 --- a/SysML2.NET/TextualNotation/InterfaceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/InterfaceUsageTextualNotationBuilder.cs @@ -29,17 +29,6 @@ namespace SysML2.NET.TextualNotation /// public static partial class InterfaceUsageTextualNotationBuilder { - /// - /// Builds the Textual Notation string for the rule InterfacePart - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildInterfacePartHandCoded(IInterfaceUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildInterfacePartHandCoded requires manual implementation"); - } - /// /// Builds the Textual Notation string for the rule InterfaceUsageDeclaration /// diff --git a/SysML2.NET/TextualNotation/OwningMembershipTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/OwningMembershipTextualNotationBuilder.cs index e7ef52e4..212fd0b6 100644 --- a/SysML2.NET/TextualNotation/OwningMembershipTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/OwningMembershipTextualNotationBuilder.cs @@ -29,15 +29,5 @@ namespace SysML2.NET.TextualNotation /// public static partial class OwningMembershipTextualNotationBuilder { - /// - /// Builds the Textual Notation string for the rule NamespaceMember - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildNamespaceMemberHandCoded(IOwningMembership poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildNamespaceMemberHandCoded requires manual implementation"); - } } } diff --git a/SysML2.NET/TextualNotation/TextualNotationValidationExtensions.cs b/SysML2.NET/TextualNotation/TextualNotationValidationExtensions.cs new file mode 100644 index 00000000..1de987c5 --- /dev/null +++ b/SysML2.NET/TextualNotation/TextualNotationValidationExtensions.cs @@ -0,0 +1,342 @@ +// ------------------------------------------------------------------------------------------------- +// +// +// 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; + using SysML2.NET.Core.POCO.Core.Types; + using SysML2.NET.Core.POCO.Kernel.Behaviors; + using SysML2.NET.Core.POCO.Kernel.Connectors; + using SysML2.NET.Core.POCO.Kernel.Expressions; + using SysML2.NET.Core.POCO.Kernel.Functions; + using SysML2.NET.Core.POCO.Systems.Connections; + using SysML2.NET.Core.POCO.Systems.DefinitionAndUsage; + using SysML2.NET.Core.POCO.Systems.Flows; + using SysML2.NET.Core.POCO.Systems.Interfaces; + using SysML2.NET.Core.POCO.Systems.Occurrences; + using SysML2.NET.Core.POCO.Systems.States; + + /// + /// Extension methods providing IsValidFor guards used in textual notation switch dispatchers. + /// These allow disambiguation when multiple grammar rule alternatives map to the same UML class. + /// + public static class TextualNotationValidationExtensions + { + /// + /// Asserts that the is valid for the Typings rule + /// + /// The + /// True if the feature matches the Typings rule + public static bool IsValidForTypings(this IFeature feature) + { + throw new System.NotSupportedException("IsValidForTypings requires manual implementation"); + } + + /// + /// Asserts that the is valid for the Subsettings rule + /// + /// The + /// True if the feature matches the Subsettings rule + public static bool IsValidForSubsettings(this IFeature feature) + { + throw new System.NotSupportedException("IsValidForSubsettings requires manual implementation"); + } + + /// + /// Asserts that the is valid for the References rule + /// + /// The + /// True if the feature matches the References rule + public static bool IsValidForReferences(this IFeature feature) + { + throw new System.NotSupportedException("IsValidForReferences requires manual implementation"); + } + + /// + /// Asserts that the is valid for the Crosses rule + /// + /// The + /// True if the feature matches the Crosses rule + public static bool IsValidForCrosses(this IFeature feature) + { + throw new System.NotSupportedException("IsValidForCrosses requires manual implementation"); + } + + /// + /// Asserts that the is valid for the ChainingPart rule + /// + /// The + /// True if the feature matches the ChainingPart rule + public static bool IsValidForChainingPart(this IFeature feature) + { + throw new System.NotSupportedException("IsValidForChainingPart requires manual implementation"); + } + + /// + /// Asserts that the is valid for the InvertingPart rule + /// + /// The + /// True if the feature matches the InvertingPart rule + public static bool IsValidForInvertingPart(this IFeature feature) + { + throw new System.NotSupportedException("IsValidForInvertingPart requires manual implementation"); + } + + /// + /// Asserts that the is valid for the PositionalArgumentList rule + /// + /// The + /// True if the feature matches the PositionalArgumentList rule + public static bool IsValidForPositionalArgumentList(this IFeature feature) + { + throw new System.NotSupportedException("IsValidForPositionalArgumentList requires manual implementation"); + } + + /// + /// Asserts that the is valid for the DisjoiningPart rule + /// + /// The + /// True if the type matches the DisjoiningPart rule + public static bool IsValidForDisjoiningPart(this IType type) + { + throw new System.NotSupportedException("IsValidForDisjoiningPart requires manual implementation"); + } + + /// + /// Asserts that the is valid for the UnioningPart rule + /// + /// The + /// True if the type matches the UnioningPart rule + public static bool IsValidForUnioningPart(this IType type) + { + throw new System.NotSupportedException("IsValidForUnioningPart requires manual implementation"); + } + + /// + /// Asserts that the is valid for the IntersectingPart rule + /// + /// The + /// True if the type matches the IntersectingPart rule + public static bool IsValidForIntersectingPart(this IType type) + { + throw new System.NotSupportedException("IsValidForIntersectingPart requires manual implementation"); + } + + /// + /// Asserts that the is valid for the BehaviorUsageMember rule + /// + /// The + /// True if the membership matches the BehaviorUsageMember rule + public static bool IsValidForBehaviorUsageMember(this IFeatureMembership featureMembership) + { + throw new System.NotSupportedException("IsValidForBehaviorUsageMember requires manual implementation"); + } + + /// + /// Asserts that the is valid for the BinaryConnectorDeclaration rule + /// + /// The + /// True if the connector matches the BinaryConnectorDeclaration rule + public static bool IsValidForBinaryConnectorDeclaration(this IConnector connector) + { + throw new System.NotSupportedException("IsValidForBinaryConnectorDeclaration requires manual implementation"); + } + + /// + /// Asserts that the is valid for the BinaryConnectorPart rule + /// + /// The + /// True if the connection usage matches the BinaryConnectorPart rule + public static bool IsValidForBinaryConnectorPart(this IConnectionUsage connectionUsage) + { + throw new System.NotSupportedException("IsValidForBinaryConnectorPart requires manual implementation"); + } + + /// + /// Asserts that the is valid for the BinaryInterfacePart rule + /// + /// The + /// True if the interface usage matches the BinaryInterfacePart rule + public static bool IsValidForBinaryInterfacePart(this IInterfaceUsage interfaceUsage) + { + throw new System.NotSupportedException("IsValidForBinaryInterfacePart requires manual implementation"); + } + + /// + /// Asserts that the is valid for the StructureUsageElement rule + /// + /// The + /// True if the usage matches the StructureUsageElement rule + public static bool IsValidForStructureUsageElement(this IUsage usage) + { + throw new System.NotSupportedException("IsValidForStructureUsageElement requires manual implementation"); + } + + /// + /// Asserts that the is valid for the OccurrenceUsage rule + /// + /// The + /// True if the occurrence usage matches the OccurrenceUsage rule + public static bool IsValidForOccurrenceUsage(this IOccurrenceUsage occurrenceUsage) + { + throw new System.NotSupportedException("IsValidForOccurrenceUsage requires manual implementation"); + } + + /// + /// Asserts that the is valid for the IndividualUsage rule + /// + /// The + /// True if the occurrence usage matches the IndividualUsage rule + public static bool IsValidForIndividualUsage(this IOccurrenceUsage occurrenceUsage) + { + throw new System.NotSupportedException("IsValidForIndividualUsage requires manual implementation"); + } + + /// + /// Asserts that the is valid for the OccurrenceDefinition rule + /// + /// The + /// True if the occurrence definition matches the OccurrenceDefinition rule + public static bool IsValidForOccurrenceDefinition(this IOccurrenceDefinition occurrenceDefinition) + { + throw new System.NotSupportedException("IsValidForOccurrenceDefinition requires manual implementation"); + } + + /// + /// Asserts that the is valid for the FlowUsage rule + /// + /// The + /// True if the flow usage matches the FlowUsage rule + public static bool IsValidForFlowUsage(this IFlowUsage flowUsage) + { + throw new System.NotSupportedException("IsValidForFlowUsage requires manual implementation"); + } + + /// + /// Asserts that the is valid for the Message rule + /// + /// The + /// True if the flow usage matches the Message rule + public static bool IsValidForMessage(this IFlowUsage flowUsage) + { + throw new System.NotSupportedException("IsValidForMessage requires manual implementation"); + } + + /// + /// Asserts that the is valid for the GuardedTargetSuccession rule + /// + /// The + /// True if the transition usage matches the GuardedTargetSuccession rule + public static bool IsValidForGuardedTargetSuccession(this ITransitionUsage transitionUsage) + { + throw new System.NotSupportedException("IsValidForGuardedTargetSuccession requires manual implementation"); + } + + /// + /// Asserts that the is valid for the ActionBodyParameterMember rule + /// + /// The + /// True if the parameter membership matches the ActionBodyParameterMember rule + public static bool IsValidForActionBodyParameterMember(this IParameterMembership parameterMembership) + { + throw new System.NotSupportedException("IsValidForActionBodyParameterMember requires manual implementation"); + } + + /// + /// Asserts that the is valid for the ConditionalExpression rule + /// + /// The + /// True if the expression matches the ConditionalExpression rule + public static bool IsValidForConditionalExpression(this IOperatorExpression operatorExpression) + { + throw new System.NotSupportedException("IsValidForConditionalExpression requires manual implementation"); + } + + /// + /// Asserts that the is valid for the ConditionalBinaryOperatorExpression rule + /// + /// The + /// True if the expression matches the ConditionalBinaryOperatorExpression rule + public static bool IsValidForConditionalBinaryOperatorExpression(this IOperatorExpression operatorExpression) + { + throw new System.NotSupportedException("IsValidForConditionalBinaryOperatorExpression requires manual implementation"); + } + + /// + /// Asserts that the is valid for the BinaryOperatorExpression rule + /// + /// The + /// True if the expression matches the BinaryOperatorExpression rule + public static bool IsValidForBinaryOperatorExpression(this IOperatorExpression operatorExpression) + { + throw new System.NotSupportedException("IsValidForBinaryOperatorExpression requires manual implementation"); + } + + /// + /// Asserts that the is valid for the UnaryOperatorExpression rule + /// + /// The + /// True if the expression matches the UnaryOperatorExpression rule + public static bool IsValidForUnaryOperatorExpression(this IOperatorExpression operatorExpression) + { + throw new System.NotSupportedException("IsValidForUnaryOperatorExpression requires manual implementation"); + } + + /// + /// Asserts that the is valid for the ClassificationExpression rule + /// + /// The + /// True if the expression matches the ClassificationExpression rule + public static bool IsValidForClassificationExpression(this IOperatorExpression operatorExpression) + { + throw new System.NotSupportedException("IsValidForClassificationExpression requires manual implementation"); + } + + /// + /// Asserts that the is valid for the MetaclassificationExpression rule + /// + /// The + /// True if the expression matches the MetaclassificationExpression rule + public static bool IsValidForMetaclassificationExpression(this IOperatorExpression operatorExpression) + { + throw new System.NotSupportedException("IsValidForMetaclassificationExpression requires manual implementation"); + } + + /// + /// Asserts that the is valid for the SequenceExpression rule + /// + /// The + /// True if the expression matches the SequenceExpression rule + public static bool IsValidForSequenceExpression(this IExpression expression) + { + throw new System.NotSupportedException("IsValidForSequenceExpression requires manual implementation"); + } + + /// + /// Asserts that the is valid for the FeatureReferenceExpression rule + /// + /// The + /// True if the expression matches the FeatureReferenceExpression rule + public static bool IsValidForFeatureReferenceExpression(this IFeatureReferenceExpression featureReferenceExpression) + { + throw new System.NotSupportedException("IsValidForFeatureReferenceExpression requires manual implementation"); + } + } +} diff --git a/SysML2.NET/TextualNotation/TypeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/TypeTextualNotationBuilder.cs index 02ebde6f..bc798789 100644 --- a/SysML2.NET/TextualNotation/TypeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/TypeTextualNotationBuilder.cs @@ -238,15 +238,5 @@ private static void BuildStateBodyItemHandCoded(IType poco, ICursorCache cursorC throw new System.NotSupportedException("BuildStateBodyItemHandCoded requires manual implementation"); } - /// - /// Builds the Textual Notation string for the rule TypeRelationshipPart - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildTypeRelationshipPartHandCoded(IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildTypeRelationshipPartHandCoded requires manual implementation"); - } } } diff --git a/SysML2.NET/TextualNotation/UsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/UsageTextualNotationBuilder.cs index 9f1698bc..7c376a98 100644 --- a/SysML2.NET/TextualNotation/UsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/UsageTextualNotationBuilder.cs @@ -29,59 +29,5 @@ namespace SysML2.NET.TextualNotation /// public static partial class UsageTextualNotationBuilder { - /// - /// Builds the Textual Notation string for the rule ActionTargetSuccession - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildActionTargetSuccessionHandCoded(IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildActionTargetSuccessionHandCoded requires manual implementation"); - } - - /// - /// Builds the Textual Notation string for the rule InterfaceOccurrenceUsageElement - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildInterfaceOccurrenceUsageElementHandCoded(IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildInterfaceOccurrenceUsageElementHandCoded requires manual implementation"); - } - - /// - /// Builds the Textual Notation string for the rule OccurrenceUsageElement - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildOccurrenceUsageElementHandCoded(IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildOccurrenceUsageElementHandCoded requires manual implementation"); - } - - /// - /// Builds the Textual Notation string for the rule StructureUsageElement - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildStructureUsageElementHandCoded(IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildStructureUsageElementHandCoded requires manual implementation"); - } - - /// - /// Builds the Textual Notation string for the rule VariantUsageElement - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildVariantUsageElementHandCoded(IUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildVariantUsageElementHandCoded requires manual implementation"); - } } } From 8adb68b8b89ab682111a98a9b28e4f7dfa47a457 Mon Sep 17 00:00:00 2001 From: atheate Date: Wed, 22 Apr 2026 13:47:42 +0200 Subject: [PATCH 31/33] Better handling of NonTerminal + assignment rule --- .../HandleBarHelpers/RulesHelper.cs | 372 ++++++++++++++++-- ...AcceptActionUsageTextualNotationBuilder.cs | 1 + .../ActionUsageTextualNotationBuilder.cs | 1 + ...gnmentActionUsageTextualNotationBuilder.cs | 1 + .../ClassifierTextualNotationBuilder.cs | 1 + .../DefinitionTextualNotationBuilder.cs | 4 +- ...erationDefinitionTextualNotationBuilder.cs | 18 +- ...etadataDefinitionTextualNotationBuilder.cs | 3 +- .../MetadataUsageTextualNotationBuilder.cs | 3 +- .../NamespaceTextualNotationBuilder.cs | 1 + ...urrenceDefinitionTextualNotationBuilder.cs | 4 +- .../OccurrenceUsageTextualNotationBuilder.cs | 8 +- .../PartUsageTextualNotationBuilder.cs | 6 +- ...erformActionUsageTextualNotationBuilder.cs | 1 + .../ReferenceUsageTextualNotationBuilder.cs | 6 +- .../RequirementUsageTextualNotationBuilder.cs | 3 +- .../SendActionUsageTextualNotationBuilder.cs | 1 + .../TypeTextualNotationBuilder.cs | 163 ++++++-- .../UsageTextualNotationBuilder.cs | 4 +- .../ViewDefinitionTextualNotationBuilder.cs | 21 +- .../ViewUsageTextualNotationBuilder.cs | 28 +- .../TypeTextualNotationBuilder.cs | 20 +- 22 files changed, 562 insertions(+), 108 deletions(-) diff --git a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs index f7f424d4..2c4e3f56 100644 --- a/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs +++ b/SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs @@ -305,17 +305,18 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas var nonTerminalElement = (NonTerminalElement)alternatives.ElementAt(0).Elements[0]; var assignmentElements = alternatives.SelectMany(x => x.Elements).OfType().ToList(); - var referencedTerminalElement = assignmentElements.Select(x => x.Value).OfType().ToList(); + var referencedAssignmentNonTerminals = assignmentElements.Select(x => x.Value).OfType().ToList(); - if (referencedTerminalElement.Count != assignmentElements.Count) + if (referencedAssignmentNonTerminals.Count != assignmentElements.Count) { var handCodedRuleName = alternatives.ElementAt(0).TextualNotationRule.RuleName; writer.WriteSafeString($"Build{handCodedRuleName}HandCoded({ruleGenerationContext.CurrentVariableName ?? "poco"}, cursorCache, stringBuilder);"); return; } - referencedTerminalElement.Add(nonTerminalElement); - + // Mixed NonTerminal + AssignmentElement dispatch: + // - AssignmentElements (+=) target cursor elements → if (cursor.Current is {Type}) { process + Move() } + // - NonTerminal targets the declaring class → else { BuildXxx(poco, ...) } var targetProperty = umlClass.QueryAllProperties().Single(x => string.Equals(x.Name, assignmentElements[0].Property)); var cursorVarName = $"{targetProperty.Name.LowerCaseFirstLetter()}Cursor"; var existingCursor = ruleGenerationContext.DefinedCursors.FirstOrDefault(x => x.IsCursorValidForProperty(targetProperty)); @@ -337,20 +338,56 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas cursorVarName = existingCursor.CursorVariableName; } - var mappedElements = OrderElementsByInheritance(referencedTerminalElement, umlClass.Cache, ruleGenerationContext); + // Generate if/else chain: assignment types checked on cursor, NonTerminal called with poco + var assignmentMappedElements = OrderElementsByInheritance(referencedAssignmentNonTerminals, umlClass.Cache, ruleGenerationContext); - writer.WriteSafeString($"switch({cursorVarName}.Current){Environment.NewLine}"); + for (var assignmentIndex = 0; assignmentIndex < assignmentMappedElements.Count; assignmentIndex++) + { + var mappedElement = assignmentMappedElements[assignmentIndex]; + + if (assignmentIndex > 0) + { + writer.WriteSafeString("else "); + } + + var assignmentVarName = mappedElement.UmlClass.Name.LowerCaseFirstLetter(); + writer.WriteSafeString($"if ({cursorVarName}.Current is {mappedElement.UmlClass.QueryFullyQualifiedTypeName()} {assignmentVarName}){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + + var previousVariableName = ruleGenerationContext.CurrentVariableName; + ruleGenerationContext.CurrentVariableName = assignmentVarName; + ProcessNonTerminalElement(writer, mappedElement.UmlClass, mappedElement.RuleElement, ruleGenerationContext); + ruleGenerationContext.CurrentVariableName = previousVariableName; + + writer.WriteSafeString($"{Environment.NewLine}{cursorVarName}.Move();{Environment.NewLine}"); + writer.WriteSafeString($"}}{Environment.NewLine}"); + } + + // NonTerminal fallback: called with poco, not cursor element + writer.WriteSafeString($"else{Environment.NewLine}"); writer.WriteSafeString($"{{{Environment.NewLine}"); - foreach (var mappedElement in mappedElements) + var nonTerminalReferencedRule = ruleGenerationContext.AllRules.SingleOrDefault(x => x.RuleName == nonTerminalElement.Name); + var nonTerminalTypeTarget = nonTerminalReferencedRule != null + ? (nonTerminalReferencedRule.TargetElementName ?? nonTerminalReferencedRule.RuleName) + : umlClass.Name; + var nonTerminalCall = ResolveBuilderCall(umlClass, nonTerminalElement, nonTerminalTypeTarget, ruleGenerationContext); + + if (nonTerminalCall != null) { - writer.WriteSafeString($"case {mappedElement.UmlClass.QueryFullyQualifiedTypeName()} {mappedElement.UmlClass.Name.LowerCaseFirstLetter()}:{Environment.NewLine}"); - ruleGenerationContext.CurrentVariableName = mappedElement.UmlClass.Name.LowerCaseFirstLetter(); - ProcessNonTerminalElement(writer, mappedElement.UmlClass, mappedElement.RuleElement, ruleGenerationContext); - writer.WriteSafeString($"break;{Environment.NewLine}"); + writer.WriteSafeString(nonTerminalCall); + } + else + { + var previousCaller = ruleGenerationContext.CallerRule; + var previousName = ruleGenerationContext.CurrentVariableName; + ruleGenerationContext.CallerRule = nonTerminalElement; + ProcessAlternatives(writer, umlClass, nonTerminalReferencedRule?.Alternatives, ruleGenerationContext); + ruleGenerationContext.CallerRule = previousCaller; + ruleGenerationContext.CurrentVariableName = previousName; } - writer.WriteSafeString($"{Environment.NewLine}}}"); + writer.WriteSafeString($"{Environment.NewLine}}}{Environment.NewLine}"); } else if (alternatives.ElementAt(0).Elements[0] is TerminalElement terminalElement && alternatives.ElementAt(1).Elements[0] is AssignmentElement assignmentElement) { @@ -661,8 +698,99 @@ private static void ProcessAlternatives(EncodedTextWriter writer, IClass umlClas } else { - var handCodedRuleName = alternatives.ElementAt(0).TextualNotationRule.RuleName; - writer.WriteSafeString($"Build{handCodedRuleName}HandCoded({ruleGenerationContext.CurrentVariableName ?? "poco"}, cursorCache, stringBuilder);"); + // Check for non-collection NonTerminal elements (e.g., ';' | '{' CalculationBodyPart '}') + // Same body pattern but with a single sub-rule call instead of a while loop + var nonCollectionNonTerminals = secondAlt.Elements.OfType().Where(x => !x.IsCollection).ToList(); + + if (nonCollectionNonTerminals.Count > 0) + { + var nonTerminalRule = ruleGenerationContext.AllRules.SingleOrDefault(x => x.RuleName == nonCollectionNonTerminals[0].Name); + + if (nonTerminalRule != null) + { + var collectionPropertyNames = nonTerminalRule.QueryCollectionPropertyNames(ruleGenerationContext.AllRules); + + if (collectionPropertyNames.Count > 0) + { + var collectionPropertyName = collectionPropertyNames.First(); + var targetProperty = umlClass.QueryAllProperties().SingleOrDefault(x => string.Equals(x.Name, collectionPropertyName, StringComparison.OrdinalIgnoreCase)); + var terminalValue = ((TerminalElement)firstAlt.Elements[0]).Value; + + if (targetProperty != null) + { + var propertyAccessName = targetProperty.QueryPropertyNameBasedOnUmlProperties(); + + writer.WriteSafeString($"if(poco.{propertyAccessName}.Count == 0){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + writer.WriteSafeString($"stringBuilder.AppendLine(\"{terminalValue}\");{Environment.NewLine}"); + writer.WriteSafeString($"}}{Environment.NewLine}"); + writer.WriteSafeString($"else{Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + + foreach (var element in secondAlt.Elements) + { + if (element is NonTerminalElement { IsCollection: false } singleNonTerminal) + { + var cursorVarName = $"{targetProperty.Name.LowerCaseFirstLetter()}Cursor"; + writer.WriteSafeString($"var {cursorVarName} = cursorCache.GetOrCreateCursor(poco.Id, \"{targetProperty.Name}\", poco.{propertyAccessName});{Environment.NewLine}"); + + var referencedRule = ruleGenerationContext.AllRules.SingleOrDefault(x => x.RuleName == singleNonTerminal.Name); + var typeTarget = referencedRule != null + ? (referencedRule.TargetElementName ?? referencedRule.RuleName) + : umlClass.Name; + + var perItemCall = ResolveBuilderCall(umlClass, singleNonTerminal, typeTarget, ruleGenerationContext); + + writer.WriteSafeString($"if ({cursorVarName}.Current != null){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + + if (perItemCall != null) + { + writer.WriteSafeString(perItemCall); + } + else + { + var previousCaller = ruleGenerationContext.CallerRule; + var previousName = ruleGenerationContext.CurrentVariableName; + ruleGenerationContext.CallerRule = singleNonTerminal; + ProcessAlternatives(writer, umlClass, referencedRule?.Alternatives, ruleGenerationContext); + ruleGenerationContext.CallerRule = previousCaller; + ruleGenerationContext.CurrentVariableName = previousName; + } + + writer.WriteSafeString($"{Environment.NewLine}}}{Environment.NewLine}"); + } + else + { + ProcessRuleElement(writer, umlClass, element, ruleGenerationContext); + } + } + + writer.WriteSafeString($"}}{Environment.NewLine}"); + } + else + { + var handCodedRuleName = alternatives.ElementAt(0).TextualNotationRule.RuleName; + writer.WriteSafeString($"Build{handCodedRuleName}HandCoded({ruleGenerationContext.CurrentVariableName ?? "poco"}, cursorCache, stringBuilder);"); + } + } + else + { + var handCodedRuleName = alternatives.ElementAt(0).TextualNotationRule.RuleName; + writer.WriteSafeString($"Build{handCodedRuleName}HandCoded({ruleGenerationContext.CurrentVariableName ?? "poco"}, cursorCache, stringBuilder);"); + } + } + else + { + var handCodedRuleName = alternatives.ElementAt(0).TextualNotationRule.RuleName; + writer.WriteSafeString($"Build{handCodedRuleName}HandCoded({ruleGenerationContext.CurrentVariableName ?? "poco"}, cursorCache, stringBuilder);"); + } + } + else + { + var handCodedRuleName = alternatives.ElementAt(0).TextualNotationRule.RuleName; + writer.WriteSafeString($"Build{handCodedRuleName}HandCoded({ruleGenerationContext.CurrentVariableName ?? "poco"}, cursorCache, stringBuilder);"); + } } } } @@ -1275,7 +1403,85 @@ private static void ProcessRuleElement(EncodedTextWriter writer, IClass umlClass } else if (groupElement.IsCollection) { - writer.WriteSafeString("// Have to handle group collection"); // => hand code ! + // Collection group with += assignments: generate a while loop with cursor-based switch + // e.g., (ownedRelationship+=DefinitionMember|ownedRelationship+=AliasMember|ownedRelationship+=Import)* + var groupAssignments = groupElement.Alternatives + .SelectMany(alternative => alternative.Elements) + .OfType() + .Where(assignment => assignment.Operator == "+=") + .ToList(); + + var groupNonTerminals = groupAssignments + .Select(assignment => assignment.Value) + .OfType() + .ToList(); + + if (groupAssignments.Count > 0 && groupNonTerminals.Count == groupAssignments.Count) + { + var groupPropertyName = groupAssignments[0].Property; + var groupTargetProperty = umlClass.QueryAllProperties().SingleOrDefault(x => string.Equals(x.Name, groupPropertyName, StringComparison.OrdinalIgnoreCase)); + + if (groupTargetProperty != null) + { + var groupCursorVarName = $"{groupTargetProperty.Name.LowerCaseFirstLetter()}Cursor"; + var existingGroupCursor = ruleGenerationContext.DefinedCursors.FirstOrDefault(x => x.IsCursorValidForProperty(groupTargetProperty)); + + if (existingGroupCursor == null) + { + var groupPropertyAccessName = groupTargetProperty.QueryPropertyNameBasedOnUmlProperties(); + writer.WriteSafeString($"var {groupCursorVarName} = cursorCache.GetOrCreateCursor(poco.Id, \"{groupTargetProperty.Name}\", poco.{groupPropertyAccessName});{Environment.NewLine}"); + var groupCursorDef = new CursorDefinition { DefinedForProperty = groupTargetProperty }; + + foreach (var groupAssignment in groupAssignments) + { + groupCursorDef.ApplicableRuleElements.Add(groupAssignment); + } + + ruleGenerationContext.DefinedCursors.Add(groupCursorDef); + } + else + { + groupCursorVarName = existingGroupCursor.CursorVariableName; + } + + var groupOrderedElements = OrderElementsByInheritance(groupNonTerminals, umlClass.Cache, ruleGenerationContext); + + writer.WriteSafeString($"while ({groupCursorVarName}.Current != null){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + writer.WriteSafeString($"switch ({groupCursorVarName}.Current){Environment.NewLine}"); + writer.WriteSafeString($"{{{Environment.NewLine}"); + + foreach (var groupOrderedElement in groupOrderedElements) + { + var groupCaseVarName = groupOrderedElement.UmlClass.Name.LowerCaseFirstLetter(); + writer.WriteSafeString($"case {groupOrderedElement.UmlClass.QueryFullyQualifiedTypeName()} {groupCaseVarName}:{Environment.NewLine}"); + + var previousVariableName = ruleGenerationContext.CurrentVariableName; + var previousCaller = ruleGenerationContext.CallerRule; + ruleGenerationContext.CurrentVariableName = groupCaseVarName; + ruleGenerationContext.CallerRule = groupOrderedElement.RuleElement; + ProcessNonTerminalElement(writer, groupOrderedElement.UmlClass, groupOrderedElement.RuleElement, ruleGenerationContext); + ruleGenerationContext.CurrentVariableName = previousVariableName; + ruleGenerationContext.CallerRule = previousCaller; + + writer.WriteSafeString($"{Environment.NewLine}break;{Environment.NewLine}"); + } + + writer.WriteSafeString($"}}{Environment.NewLine}"); + writer.WriteSafeString($"{groupCursorVarName}.Move();{Environment.NewLine}"); + writer.WriteSafeString($"}}{Environment.NewLine}"); + } + else + { + var handCodedRuleName = groupElement.TextualNotationRule?.RuleName ?? "Unknown"; + writer.WriteSafeString($"Build{handCodedRuleName}HandCoded({ruleGenerationContext.CurrentVariableName ?? "poco"}, cursorCache, stringBuilder);"); + } + } + else + { + var handCodedRuleName = groupElement.TextualNotationRule?.RuleName ?? "Unknown"; + writer.WriteSafeString($"Build{handCodedRuleName}HandCoded({ruleGenerationContext.CurrentVariableName ?? "poco"}, cursorCache, stringBuilder);"); + } } else { @@ -1500,7 +1706,9 @@ private static void ProcessNonTerminalElement(EncodedTextWriter writer, IClass u var isForProperty = ruleGenerationContext.CurrentVariableName.Contains('.'); - if (isForProperty && !isPartOfMultipleAlternative) + var emitPropertyNullGuard = isForProperty && !isPartOfMultipleAlternative; + + if (emitPropertyNullGuard) { writer.WriteSafeString($"{Environment.NewLine}if ({ruleGenerationContext.CurrentVariableName} != null){Environment.NewLine}"); writer.WriteSafeString($"{{{Environment.NewLine}"); @@ -1510,7 +1718,7 @@ private static void ProcessNonTerminalElement(EncodedTextWriter writer, IClass u { EmitCollectionNonTerminalLoop(writer, umlClass, nonTerminalElement, referencedRule, typeTarget, ruleGenerationContext); - if (isForProperty && !isPartOfMultipleAlternative) + if (emitPropertyNullGuard) { writer.WriteSafeString($"{Environment.NewLine}}}"); } @@ -1586,7 +1794,7 @@ private static void ProcessNonTerminalElement(EncodedTextWriter writer, IClass u } } - if (isForProperty && !isPartOfMultipleAlternative) + if (emitPropertyNullGuard) { writer.WriteSafeString($"{Environment.NewLine}}}"); } @@ -1638,18 +1846,29 @@ private static void EmitCollectionNonTerminalLoop(EncodedTextWriter writer, ICla // Resolve the correct builder class name for the per-item call var perItemCall = ResolveBuilderCall(umlClass, nonTerminalElement, typeTarget, ruleGenerationContext); + // When a collection NonTerminal is followed by another element sharing the same cursor, + // the while condition must exclude the next sibling's type to avoid consuming its elements. + // e.g., CalculationBodyItem* ResultExpressionMember → while (current is not IResultExpressionMembership) + var whileTypeExclusion = ResolveCollectionWhileTypeCondition(cursorVariableName, umlClass, referencedRule, ruleGenerationContext); + + // Build the full while condition: merged pattern to avoid "merge into pattern" warnings + var whileCondition = string.IsNullOrWhiteSpace(whileTypeExclusion) + ? $"{cursorVariableName}.Current != null" + : whileTypeExclusion; + if (perItemCall != null) { - // Emit while loop calling the per-item builder method - writer.WriteSafeString($"while ({cursorVariableName}.Current != null){Environment.NewLine}"); + // Emit while loop calling the per-item builder method with explicit Move() + writer.WriteSafeString($"while ({whileCondition}){Environment.NewLine}"); writer.WriteSafeString($"{{{Environment.NewLine}"); writer.WriteSafeString(perItemCall); - writer.WriteSafeString($"{Environment.NewLine}}}{Environment.NewLine}"); + writer.WriteSafeString($"{Environment.NewLine}{cursorVariableName}.Move();{Environment.NewLine}"); + writer.WriteSafeString($"}}{Environment.NewLine}"); } else { // Type incompatible: inline the referenced rule's alternatives inside the while loop - writer.WriteSafeString($"while ({cursorVariableName}.Current != null){Environment.NewLine}"); + writer.WriteSafeString($"while ({whileCondition}){Environment.NewLine}"); writer.WriteSafeString($"{{{Environment.NewLine}"); var previousCaller = ruleGenerationContext.CallerRule; @@ -1661,7 +1880,8 @@ private static void EmitCollectionNonTerminalLoop(EncodedTextWriter writer, ICla ruleGenerationContext.CallerRule = previousCaller; ruleGenerationContext.CurrentVariableName = previousName; - writer.WriteSafeString($"{Environment.NewLine}}}{Environment.NewLine}"); + writer.WriteSafeString($"{Environment.NewLine}{cursorVariableName}.Move();{Environment.NewLine}"); + writer.WriteSafeString($"}}{Environment.NewLine}"); } return; @@ -1674,6 +1894,112 @@ private static void EmitCollectionNonTerminalLoop(EncodedTextWriter writer, ICla writer.WriteSafeString($"Build{handCodedRuleName}HandCoded({ruleGenerationContext.CurrentVariableName ?? "poco"}, cursorCache, stringBuilder);{Environment.NewLine}"); } + /// + /// Resolves a type condition clause for the while loop in a collection NonTerminal loop. + /// When the collection has sibling elements after it, the while loop must stop before consuming those elements. + /// + /// The primary approach is a positive condition based on the collection item's own assignment target type + /// (e.g., UsageExtensionKeyword assigns to PrefixMetadataMember:OwningMembershipwhile (cursor.Current is IOwningMembership)). + /// + /// + /// Falls back to a negative exclusion based on the next sibling's target type when the positive approach + /// is not available (e.g., CalculationBodyItem* ResultExpressionMemberwhile (cursor.Current is not IResultExpressionMembership)). + /// + /// + /// The cursor variable name used in the while condition + /// The related + /// The resolved for the collection NonTerminal + /// The current + /// A type condition clause string, or empty string if no condition is needed + private static string ResolveCollectionWhileTypeCondition(string cursorVariableName, IClass umlClass, TextualNotationRule collectionRule, RuleGenerationContext ruleGenerationContext) + { + var siblings = ruleGenerationContext.CurrentSiblingElements; + var currentIndex = ruleGenerationContext.CurrentElementIndex; + + if (siblings == null || currentIndex + 1 >= siblings.Count) + { + return ""; + } + + // Primary approach: positive condition from the collection item's += assignment target type. + // Only applicable when ALL alternatives are += assignments (no mixed NonTerminal alternatives). + if (collectionRule != null) + { + var allElements = collectionRule.Alternatives.SelectMany(alternative => alternative.Elements).ToList(); + var assignmentNonTerminals = allElements + .OfType() + .Where(assignment => assignment.Operator == "+=") + .Select(assignment => assignment.Value) + .OfType() + .ToList(); + + var hasOnlyAssignments = allElements.All(element => element is AssignmentElement or NonParsingAssignmentElement); + + if (assignmentNonTerminals.Count > 0 && hasOnlyAssignments) + { + // Use the first assignment's target type as the positive condition + var itemRule = ruleGenerationContext.AllRules.SingleOrDefault(x => x.RuleName == assignmentNonTerminals[0].Name); + var itemTypeTarget = itemRule != null ? (itemRule.TargetElementName ?? itemRule.RuleName) : null; + + if (itemTypeTarget != null) + { + var itemTargetClass = umlClass.Cache.Values.OfType() + .SingleOrDefault(x => x.Name == itemTypeTarget) as IClass; + + if (itemTargetClass != null) + { + return $"{cursorVariableName}.Current is {itemTargetClass.QueryFullyQualifiedTypeName()}"; + } + } + } + } + + // Fallback: negative exclusion based on the next sibling's target type + var nextSibling = siblings[currentIndex + 1]; + NonTerminalElement nextNonTerminal = null; + + switch (nextSibling) + { + case NonTerminalElement nonTerminal: + nextNonTerminal = nonTerminal; + break; + case AssignmentElement { Value: NonTerminalElement assignmentNonTerminal }: + nextNonTerminal = assignmentNonTerminal; + break; + case GroupElement groupElement: + nextNonTerminal = groupElement.Alternatives + .SelectMany(alternative => alternative.Elements) + .OfType() + .Select(assignment => assignment.Value) + .OfType() + .FirstOrDefault(); + break; + } + + if (nextNonTerminal == null) + { + return ""; + } + + var nextRule = ruleGenerationContext.AllRules.SingleOrDefault(x => x.RuleName == nextNonTerminal.Name); + var nextTypeTarget = nextRule != null ? (nextRule.TargetElementName ?? nextRule.RuleName) : null; + + if (nextTypeTarget == null) + { + return ""; + } + + var nextTargetClass = umlClass.Cache.Values.OfType() + .SingleOrDefault(x => x.Name == nextTypeTarget) as IClass; + + if (nextTargetClass == null) + { + return ""; + } + + return $"{cursorVariableName}.Current is not null and not {nextTargetClass.QueryFullyQualifiedTypeName()}"; + } + /// /// Resolves the builder method call string for a NonTerminal element, handling type targeting /// (e.g., when ActionBodyItem : Type = means the builder lives on TypeTextualNotationBuilder). diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.cs index 24491272..557fc1d5 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AcceptActionUsageTextualNotationBuilder.cs @@ -152,6 +152,7 @@ public static void BuildTransitionAcceptActionUsage(SysML2.NET.Core.POCO.Systems while (ownedRelationshipCursor.Current != null) { TypeTextualNotationBuilder.BuildActionBodyItem(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); } stringBuilder.AppendLine("}"); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs index 501a7491..4aaa6a75 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ActionUsageTextualNotationBuilder.cs @@ -207,6 +207,7 @@ public static void BuildActionBodyParameter(SysML2.NET.Core.POCO.Systems.Actions while (ownedRelationshipCursor.Current != null) { TypeTextualNotationBuilder.BuildActionBodyItem(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); } stringBuilder.AppendLine("}"); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssignmentActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssignmentActionUsageTextualNotationBuilder.cs index b74269dc..bb468c16 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssignmentActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/AssignmentActionUsageTextualNotationBuilder.cs @@ -81,6 +81,7 @@ public static void BuildTransitionAssignmentActionUsage(SysML2.NET.Core.POCO.Sys while (ownedRelationshipCursor.Current != null) { TypeTextualNotationBuilder.BuildActionBodyItem(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); } stringBuilder.AppendLine("}"); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs index 1544f121..781549e7 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ClassifierTextualNotationBuilder.cs @@ -121,6 +121,7 @@ public static void BuildClassifierDeclaration(SysML2.NET.Core.POCO.Core.Classifi while (ownedRelationshipCursor.Current != null) { TypeTextualNotationBuilder.BuildTypeRelationshipPart(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs index 21db6e23..48b0a32c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/DefinitionTextualNotationBuilder.cs @@ -80,6 +80,7 @@ public static void BuildDefinitionPrefix(SysML2.NET.Core.POCO.Systems.Definition while (ownedRelationshipCursor.Current != null) { BuildDefinitionExtensionKeyword(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); } @@ -122,9 +123,10 @@ public static void BuildExtendedDefinition(SysML2.NET.Core.POCO.Systems.Definiti } var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - while (ownedRelationshipCursor.Current != null) + while (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership) { BuildDefinitionExtensionKeyword(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); } stringBuilder.Append("def "); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationDefinitionTextualNotationBuilder.cs index 0e68fd89..598d1da3 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/EnumerationDefinitionTextualNotationBuilder.cs @@ -51,7 +51,20 @@ public static void BuildEnumerationBody(SysML2.NET.Core.POCO.Systems.Enumeration { var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); stringBuilder.AppendLine("{"); - // Have to handle group collection + while (ownedRelationshipCursor.Current != null) + { + switch (ownedRelationshipCursor.Current) + { + case SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IVariantMembership variantMembership: + VariantMembershipTextualNotationBuilder.BuildEnumerationUsageMember(variantMembership, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership owningMembership: + OwningMembershipTextualNotationBuilder.BuildAnnotatingMember(owningMembership, cursorCache, stringBuilder); + break; + } + ownedRelationshipCursor.Move(); + } + stringBuilder.AppendLine("}"); } @@ -67,9 +80,10 @@ public static void BuildEnumerationBody(SysML2.NET.Core.POCO.Systems.Enumeration public static void BuildEnumerationDefinition(SysML2.NET.Core.POCO.Systems.Enumerations.IEnumerationDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - while (ownedRelationshipCursor.Current != null) + while (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership) { DefinitionTextualNotationBuilder.BuildDefinitionExtensionKeyword(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); } stringBuilder.Append("enum "); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.cs index 64a05ffd..809f0780 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataDefinitionTextualNotationBuilder.cs @@ -51,9 +51,10 @@ public static void BuildMetadataDefinition(SysML2.NET.Core.POCO.Systems.Metadata } var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - while (ownedRelationshipCursor.Current != null) + while (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership) { DefinitionTextualNotationBuilder.BuildDefinitionExtensionKeyword(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); } stringBuilder.Append("metadata "); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs index e47cdc69..f0da2996 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/MetadataUsageTextualNotationBuilder.cs @@ -101,9 +101,10 @@ public static void BuildMetadataUsageDeclaration(SysML2.NET.Core.POCO.Systems.Me public static void BuildMetadataUsage(SysML2.NET.Core.POCO.Systems.Metadata.IMetadataUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - while (ownedRelationshipCursor.Current != null) + while (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership) { UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); } stringBuilder.Append(" @ "); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs index 0a2aa6d9..c8554508 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/NamespaceTextualNotationBuilder.cs @@ -66,6 +66,7 @@ public static void BuildRootNamespace(SysML2.NET.Core.POCO.Root.Namespaces.IName break; } + ownedRelationshipCursor.Move(); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs index 843a7e9f..ef0b560c 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceDefinitionTextualNotationBuilder.cs @@ -72,6 +72,7 @@ public static void BuildOccurrenceDefinitionPrefix(SysML2.NET.Core.POCO.Systems. while (ownedRelationshipCursor.Current != null) { DefinitionTextualNotationBuilder.BuildDefinitionExtensionKeyword(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); } @@ -100,9 +101,10 @@ public static void BuildIndividualDefinition(SysML2.NET.Core.POCO.Systems.Occurr { stringBuilder.Append(" individual "); } - while (ownedRelationshipCursor.Current != null) + while (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership) { DefinitionTextualNotationBuilder.BuildDefinitionExtensionKeyword(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); } stringBuilder.Append("def "); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs index 5f259af5..848c84c7 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/OccurrenceUsageTextualNotationBuilder.cs @@ -63,6 +63,7 @@ public static void BuildOccurrenceUsagePrefix(SysML2.NET.Core.POCO.Systems.Occur while (ownedRelationshipCursor.Current != null) { UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); } @@ -83,9 +84,10 @@ public static void BuildIndividualUsage(SysML2.NET.Core.POCO.Systems.Occurrences stringBuilder.Append(" individual "); } var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - while (ownedRelationshipCursor.Current != null) + while (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership) { UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); } UsageTextualNotationBuilder.BuildUsage(poco, cursorCache, stringBuilder); @@ -111,9 +113,10 @@ public static void BuildPortionUsage(SysML2.NET.Core.POCO.Systems.Occurrences.IO stringBuilder.Append(poco.PortionKind.ToString().ToLower()); var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - while (ownedRelationshipCursor.Current != null) + while (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership) { UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); } UsageTextualNotationBuilder.BuildUsage(poco, cursorCache, stringBuilder); @@ -150,6 +153,7 @@ public static void BuildControlNodePrefix(SysML2.NET.Core.POCO.Systems.Occurrenc while (ownedRelationshipCursor.Current != null) { UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); } diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartUsageTextualNotationBuilder.cs index 0343b0b8..31811e10 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PartUsageTextualNotationBuilder.cs @@ -45,9 +45,10 @@ public static void BuildActorUsage(SysML2.NET.Core.POCO.Systems.Parts.IPartUsage { stringBuilder.Append("actor "); var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - while (ownedRelationshipCursor.Current != null) + while (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership) { UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); } UsageTextualNotationBuilder.BuildUsage(poco, cursorCache, stringBuilder); @@ -65,9 +66,10 @@ public static void BuildStakeholderUsage(SysML2.NET.Core.POCO.Systems.Parts.IPar { stringBuilder.Append("stakeholder "); var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - while (ownedRelationshipCursor.Current != null) + while (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership) { UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); } UsageTextualNotationBuilder.BuildUsage(poco, cursorCache, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PerformActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PerformActionUsageTextualNotationBuilder.cs index a0c2ff6e..9f683114 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PerformActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/PerformActionUsageTextualNotationBuilder.cs @@ -86,6 +86,7 @@ public static void BuildTransitionPerformActionUsage(SysML2.NET.Core.POCO.System while (ownedRelationshipCursor.Current != null) { TypeTextualNotationBuilder.BuildActionBodyItem(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); } stringBuilder.AppendLine("}"); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs index 6e498b5e..3efecd68 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ReferenceUsageTextualNotationBuilder.cs @@ -83,9 +83,10 @@ public static void BuildVariantReference(SysML2.NET.Core.POCO.Systems.Definition } ownedRelationshipCursor.Move(); - while (ownedRelationshipCursor.Current != null) + while (ownedRelationshipCursor.Current is not null and not SysML2.NET.Core.POCO.Systems.DefinitionAndUsage.IUsage) { FeatureTextualNotationBuilder.BuildFeatureSpecialization(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); } UsageTextualNotationBuilder.BuildUsageBody(poco, cursorCache, stringBuilder); @@ -302,9 +303,10 @@ public static void BuildSubjectUsage(SysML2.NET.Core.POCO.Systems.DefinitionAndU { stringBuilder.Append("subject "); var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - while (ownedRelationshipCursor.Current != null) + while (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership) { UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); } UsageTextualNotationBuilder.BuildUsage(poco, cursorCache, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementUsageTextualNotationBuilder.cs index b4405bff..ea6dfefd 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/RequirementUsageTextualNotationBuilder.cs @@ -44,9 +44,10 @@ public static partial class RequirementUsageTextualNotationBuilder public static void BuildObjectiveRequirementUsage(SysML2.NET.Core.POCO.Systems.Requirements.IRequirementUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - while (ownedRelationshipCursor.Current != null) + while (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership) { UsageTextualNotationBuilder.BuildUsageExtensionKeyword(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); } ConstraintUsageTextualNotationBuilder.BuildConstraintUsageDeclaration(poco, cursorCache, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.cs index 88e5b66a..2e91c5af 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/SendActionUsageTextualNotationBuilder.cs @@ -135,6 +135,7 @@ public static void BuildTransitionSendActionUsage(SysML2.NET.Core.POCO.Systems.A while (ownedRelationshipCursor.Current != null) { TypeTextualNotationBuilder.BuildActionBodyItem(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); } stringBuilder.AppendLine("}"); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs index b306f1b7..7da25a33 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/TypeTextualNotationBuilder.cs @@ -172,7 +172,21 @@ public static void BuildStateBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco /// The that contains the entire textual notation public static void BuildCalculationBody(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildCalculationBodyHandCoded(poco, cursorCache, stringBuilder); + if (poco.OwnedRelationship.Count == 0) + { + stringBuilder.AppendLine(";"); + } + else + { + stringBuilder.AppendLine("{"); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + if (ownedRelationshipCursor.Current != null) + { + BuildCalculationBodyPart(poco, cursorCache, stringBuilder); + } + stringBuilder.AppendLine("}"); + } + } /// @@ -185,9 +199,10 @@ public static void BuildCalculationBody(SysML2.NET.Core.POCO.Core.Types.IType po public static void BuildCalculationBodyPart(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - while (ownedRelationshipCursor.Current != null) + while (ownedRelationshipCursor.Current is not null and not SysML2.NET.Core.POCO.Kernel.Functions.IResultExpressionMembership) { BuildCalculationBodyItem(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); } @@ -217,14 +232,16 @@ public static void BuildCalculationBodyPart(SysML2.NET.Core.POCO.Core.Types.ITyp public static void BuildCalculationBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - switch (ownedRelationshipCursor.Current) + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Functions.IReturnParameterMembership returnParameterMembership) { - case SysML2.NET.Core.POCO.Kernel.Functions.IReturnParameterMembership returnParameterMembership: - ReturnParameterMembershipTextualNotationBuilder.BuildReturnParameterMember(returnParameterMembership, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Core.Types.IType type: - BuildActionBodyItem(type, cursorCache, stringBuilder); break; - + ReturnParameterMembershipTextualNotationBuilder.BuildReturnParameterMember(returnParameterMembership, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + } + else + { + BuildActionBodyItem(poco, cursorCache, stringBuilder); } + } /// @@ -264,24 +281,41 @@ public static void BuildRequirementBody(SysML2.NET.Core.POCO.Core.Types.IType po public static void BuildRequirementBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - switch (ownedRelationshipCursor.Current) + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Systems.Requirements.ISubjectMembership subjectMembership) { - case SysML2.NET.Core.POCO.Systems.Requirements.ISubjectMembership subjectMembership: - SubjectMembershipTextualNotationBuilder.BuildSubjectMember(subjectMembership, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Requirements.IFramedConcernMembership framedConcernMembership: - FramedConcernMembershipTextualNotationBuilder.BuildFramedConcernMember(framedConcernMembership, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.VerificationCases.IRequirementVerificationMembership requirementVerificationMembership: - RequirementVerificationMembershipTextualNotationBuilder.BuildRequirementVerificationMember(requirementVerificationMembership, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Requirements.IActorMembership actorMembership: - ActorMembershipTextualNotationBuilder.BuildActorMember(actorMembership, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Requirements.IStakeholderMembership stakeholderMembership: - StakeholderMembershipTextualNotationBuilder.BuildStakeholderMember(stakeholderMembership, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Requirements.IRequirementConstraintMembership requirementConstraintMembership: - RequirementConstraintMembershipTextualNotationBuilder.BuildRequirementConstraintMember(requirementConstraintMembership, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Core.Types.IType type: - BuildDefinitionBodyItem(type, cursorCache, stringBuilder); break; - + SubjectMembershipTextualNotationBuilder.BuildSubjectMember(subjectMembership, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + } + else if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Systems.Requirements.IFramedConcernMembership framedConcernMembership) + { + FramedConcernMembershipTextualNotationBuilder.BuildFramedConcernMember(framedConcernMembership, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + } + else if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Systems.VerificationCases.IRequirementVerificationMembership requirementVerificationMembership) + { + RequirementVerificationMembershipTextualNotationBuilder.BuildRequirementVerificationMember(requirementVerificationMembership, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + } + else if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Systems.Requirements.IActorMembership actorMembership) + { + ActorMembershipTextualNotationBuilder.BuildActorMember(actorMembership, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + } + else if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Systems.Requirements.IStakeholderMembership stakeholderMembership) + { + StakeholderMembershipTextualNotationBuilder.BuildStakeholderMember(stakeholderMembership, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + } + else if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Systems.Requirements.IRequirementConstraintMembership requirementConstraintMembership) + { + RequirementConstraintMembershipTextualNotationBuilder.BuildRequirementConstraintMember(requirementConstraintMembership, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + } + else + { + BuildDefinitionBodyItem(poco, cursorCache, stringBuilder); } + } /// @@ -304,6 +338,7 @@ public static void BuildCaseBody(SysML2.NET.Core.POCO.Core.Types.IType poco, ICu while (ownedRelationshipCursor.Current != null) { BuildCaseBodyItem(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); } @@ -336,18 +371,26 @@ public static void BuildCaseBody(SysML2.NET.Core.POCO.Core.Types.IType poco, ICu public static void BuildCaseBodyItem(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - switch (ownedRelationshipCursor.Current) + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Systems.Requirements.ISubjectMembership subjectMembership) { - case SysML2.NET.Core.POCO.Systems.Requirements.ISubjectMembership subjectMembership: - SubjectMembershipTextualNotationBuilder.BuildSubjectMember(subjectMembership, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Requirements.IActorMembership actorMembership: - ActorMembershipTextualNotationBuilder.BuildActorMember(actorMembership, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Cases.IObjectiveMembership objectiveMembership: - ObjectiveMembershipTextualNotationBuilder.BuildObjectiveMember(objectiveMembership, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Core.Types.IType type: - BuildActionBodyItem(type, cursorCache, stringBuilder); break; - + SubjectMembershipTextualNotationBuilder.BuildSubjectMember(subjectMembership, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + } + else if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Systems.Requirements.IActorMembership actorMembership) + { + ActorMembershipTextualNotationBuilder.BuildActorMember(actorMembership, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + } + else if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Systems.Cases.IObjectiveMembership objectiveMembership) + { + ObjectiveMembershipTextualNotationBuilder.BuildObjectiveMember(objectiveMembership, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); } + else + { + BuildActionBodyItem(poco, cursorCache, stringBuilder); + } + } /// @@ -367,7 +410,26 @@ public static void BuildMetadataBody(SysML2.NET.Core.POCO.Core.Types.IType poco, { var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); stringBuilder.AppendLine("{"); - // Have to handle group collection + while (ownedRelationshipCursor.Current != null) + { + switch (ownedRelationshipCursor.Current) + { + case SysML2.NET.Core.POCO.Core.Types.IFeatureMembership featureMembership: + FeatureMembershipTextualNotationBuilder.BuildMetadataBodyUsageMember(featureMembership, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership owningMembership: + OwningMembershipTextualNotationBuilder.BuildDefinitionMember(owningMembership, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Root.Namespaces.IMembership membership: + MembershipTextualNotationBuilder.BuildAliasMember(membership, cursorCache, stringBuilder); + break; + case SysML2.NET.Core.POCO.Root.Namespaces.IImport import: + ImportTextualNotationBuilder.BuildImport(import, cursorCache, stringBuilder); + break; + } + ownedRelationshipCursor.Move(); + } + stringBuilder.AppendLine("}"); } @@ -441,11 +503,12 @@ public static void BuildTypeDeclaration(SysML2.NET.Core.POCO.Core.Types.IType po stringBuilder.Append(' '); } - // Have to handle group collection + BuildTypeDeclarationHandCoded(poco, cursorCache, stringBuilder); stringBuilder.Append(' '); while (ownedRelationshipCursor.Current != null) { BuildTypeRelationshipPart(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); } @@ -777,7 +840,21 @@ public static void BuildTypeBodyElement(SysML2.NET.Core.POCO.Core.Types.IType po /// The that contains the entire textual notation public static void BuildFunctionBody(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - BuildFunctionBodyHandCoded(poco, cursorCache, stringBuilder); + if (poco.OwnedRelationship.Count == 0) + { + stringBuilder.AppendLine(";"); + } + else + { + stringBuilder.AppendLine("{"); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + if (ownedRelationshipCursor.Current != null) + { + BuildFunctionBodyPart(poco, cursorCache, stringBuilder); + } + stringBuilder.AppendLine("}"); + } + } /// @@ -790,7 +867,17 @@ public static void BuildFunctionBody(SysML2.NET.Core.POCO.Core.Types.IType poco, public static void BuildFunctionBodyPart(SysML2.NET.Core.POCO.Core.Types.IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - // Have to handle group collection + while (ownedRelationshipCursor.Current != null) + { + switch (ownedRelationshipCursor.Current) + { + case SysML2.NET.Core.POCO.Kernel.Functions.IReturnParameterMembership returnParameterMembership: + ReturnParameterMembershipTextualNotationBuilder.BuildReturnFeatureMember(returnParameterMembership, cursorCache, stringBuilder); + break; + } + ownedRelationshipCursor.Move(); + } + if (ownedRelationshipCursor.Current != null) { diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs index 64f29fe1..927af733 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/UsageTextualNotationBuilder.cs @@ -205,6 +205,7 @@ public static void BuildUsagePrefix(SysML2.NET.Core.POCO.Systems.DefinitionAndUs while (ownedRelationshipCursor.Current != null) { BuildUsageExtensionKeyword(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); } @@ -609,9 +610,10 @@ public static void BuildExtendedUsage(SysML2.NET.Core.POCO.Systems.DefinitionAnd { BuildUnextendedUsagePrefix(poco, cursorCache, stringBuilder); var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - while (ownedRelationshipCursor.Current != null) + while (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Root.Namespaces.IOwningMembership) { BuildUsageExtensionKeyword(poco, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); } BuildUsage(poco, cursorCache, stringBuilder); diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs index 0564a948..8d7ab60a 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewDefinitionTextualNotationBuilder.cs @@ -71,16 +71,21 @@ public static void BuildViewDefinitionBody(SysML2.NET.Core.POCO.Systems.Views.IV public static void BuildViewDefinitionBodyItem(SysML2.NET.Core.POCO.Systems.Views.IViewDefinition poco, ICursorCache cursorCache, StringBuilder stringBuilder) { var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - switch (ownedRelationshipCursor.Current) + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Systems.Views.IViewRenderingMembership viewRenderingMembership) { - case SysML2.NET.Core.POCO.Systems.Views.IViewRenderingMembership viewRenderingMembership: - ViewRenderingMembershipTextualNotationBuilder.BuildViewRenderingMember(viewRenderingMembership, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Kernel.Packages.IElementFilterMembership elementFilterMembership: - ElementFilterMembershipTextualNotationBuilder.BuildElementFilterMember(elementFilterMembership, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Core.Types.IType type: - TypeTextualNotationBuilder.BuildDefinitionBodyItem(type, cursorCache, stringBuilder); break; - + ViewRenderingMembershipTextualNotationBuilder.BuildViewRenderingMember(viewRenderingMembership, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + } + else if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Packages.IElementFilterMembership elementFilterMembership) + { + ElementFilterMembershipTextualNotationBuilder.BuildElementFilterMember(elementFilterMembership, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); } + else + { + TypeTextualNotationBuilder.BuildDefinitionBodyItem(poco, cursorCache, stringBuilder); + } + } /// diff --git a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs index 7bd7f9e2..92a29825 100644 --- a/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ViewUsageTextualNotationBuilder.cs @@ -71,18 +71,26 @@ public static void BuildViewBody(SysML2.NET.Core.POCO.Systems.Views.IViewUsage p public static void BuildViewBodyItem(SysML2.NET.Core.POCO.Systems.Views.IViewUsage poco, ICursorCache cursorCache, StringBuilder stringBuilder) { var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); - switch (ownedRelationshipCursor.Current) + if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Systems.Views.IViewRenderingMembership viewRenderingMembership) { - case SysML2.NET.Core.POCO.Systems.Views.IViewRenderingMembership viewRenderingMembership: - ViewRenderingMembershipTextualNotationBuilder.BuildViewRenderingMember(viewRenderingMembership, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Kernel.Packages.IElementFilterMembership elementFilterMembership: - ElementFilterMembershipTextualNotationBuilder.BuildElementFilterMember(elementFilterMembership, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Systems.Views.IExpose expose: - ExposeTextualNotationBuilder.BuildExpose(expose, cursorCache, stringBuilder); break; - case SysML2.NET.Core.POCO.Core.Types.IType type: - TypeTextualNotationBuilder.BuildDefinitionBodyItem(type, cursorCache, stringBuilder); break; - + ViewRenderingMembershipTextualNotationBuilder.BuildViewRenderingMember(viewRenderingMembership, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + } + else if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Kernel.Packages.IElementFilterMembership elementFilterMembership) + { + ElementFilterMembershipTextualNotationBuilder.BuildElementFilterMember(elementFilterMembership, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + } + else if (ownedRelationshipCursor.Current is SysML2.NET.Core.POCO.Systems.Views.IExpose expose) + { + ExposeTextualNotationBuilder.BuildExpose(expose, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); } + else + { + TypeTextualNotationBuilder.BuildDefinitionBodyItem(poco, cursorCache, stringBuilder); + } + } /// diff --git a/SysML2.NET/TextualNotation/TypeTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/TypeTextualNotationBuilder.cs index bc798789..9a4edd9f 100644 --- a/SysML2.NET/TextualNotation/TypeTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/TypeTextualNotationBuilder.cs @@ -183,17 +183,6 @@ private static void BuildActionBodyItemHandCoded(IType poco, ICursorCache cursor throw new System.NotSupportedException("BuildActionBodyItemHandCoded requires manual implementation"); } - /// - /// Builds the Textual Notation string for the rule CalculationBody - /// - /// The from which the rule should be build - /// The used to get access to CursorCollection for the current - /// The that contains the entire textual notation - private static void BuildCalculationBodyHandCoded(IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) - { - throw new System.NotSupportedException("BuildCalculationBodyHandCoded requires manual implementation"); - } - /// /// Builds the Textual Notation string for the rule DefinitionBodyItem /// @@ -206,14 +195,15 @@ private static void BuildDefinitionBodyItemHandCoded(IType poco, ICursorCache cu } /// - /// Builds the Textual Notation string for the rule FunctionBody + /// Builds the Textual Notation string for the rule TypeDeclaration + /// TypeDeclaration:Type=Identification?ownedRelationship+=OwnedSubclassification /// - /// The from which the rule should be build + /// The from which the rule should be build /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation - private static void BuildFunctionBodyHandCoded(IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) + private static void BuildTypeDeclarationHandCoded(IType poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("BuildFunctionBodyHandCoded requires manual implementation"); + throw new System.NotSupportedException("BuildTypeDeclarationHandCoded requires manual implementation"); } /// From e556e66d612b81a606c53feaf41a8ecdc7733394 Mon Sep 17 00:00:00 2001 From: atheate Date: Wed, 22 Apr 2026 15:24:49 +0200 Subject: [PATCH 32/33] Handcode for some rules (TriggerExpression , FeatureIdentification, FeatureValue, NamespaceImport) --- .../FeatureTextualNotationBuilder.cs | 21 ++++++++- .../FeatureValueTextualNotationBuilder.cs | 46 +++++++++++++++---- .../NamespaceImportTextualNotationBuilder.cs | 32 +++++++++---- ...ocationExpressionTextualNotationBuilder.cs | 45 ++++++++++++++---- 4 files changed, 119 insertions(+), 25 deletions(-) diff --git a/SysML2.NET/TextualNotation/FeatureTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/FeatureTextualNotationBuilder.cs index c1414f7c..574603a3 100644 --- a/SysML2.NET/TextualNotation/FeatureTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/FeatureTextualNotationBuilder.cs @@ -68,9 +68,28 @@ private static void BuildFeatureHandCoded(IFeature poco, ICursorCache cursorCach /// The from which the rule should be build /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation + /// FeatureIdentification:Feature='<'declaredShortName=NAME'>'(declaredName=NAME)?|declaredName=NAME private static void BuildFeatureIdentificationHandCoded(IFeature poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("BuildFeatureIdentificationHandCoded requires manual implementation"); + if (!string.IsNullOrWhiteSpace(poco.DeclaredShortName)) + { + stringBuilder.Append('<'); + stringBuilder.Append(poco.DeclaredShortName); + stringBuilder.Append('>'); + + if (!string.IsNullOrWhiteSpace(poco.DeclaredName)) + { + stringBuilder.Append(' '); + stringBuilder.Append(poco.DeclaredName); + } + + stringBuilder.Append(' '); + } + else if (!string.IsNullOrWhiteSpace(poco.DeclaredName)) + { + stringBuilder.Append(poco.DeclaredName); + stringBuilder.Append(' '); + } } /// diff --git a/SysML2.NET/TextualNotation/FeatureValueTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/FeatureValueTextualNotationBuilder.cs index 10d3c9e3..2dad78cb 100644 --- a/SysML2.NET/TextualNotation/FeatureValueTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/FeatureValueTextualNotationBuilder.cs @@ -1,20 +1,20 @@ // ------------------------------------------------------------------------------------------------- // -// +// // 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. -// +// // // ------------------------------------------------------------------------------------------------ @@ -23,21 +23,51 @@ namespace SysML2.NET.TextualNotation using System.Text; using SysML2.NET.Core.POCO.Kernel.FeatureValues; + using SysML2.NET.Core.POCO.Kernel.Functions; /// - /// Hand-coded part of the + /// Hand-coded part of the /// public static partial class FeatureValueTextualNotationBuilder { /// /// 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 from which the rule should be build /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation private static void BuildFeatureValueHandCoded(IFeatureValue poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("BuildFeatureValueHandCoded requires manual implementation"); + if (poco.IsDefault) + { + stringBuilder.Append("default "); + + if (poco.IsInitial) + { + stringBuilder.Append(":= "); + } + else + { + stringBuilder.Append("= "); + } + } + else if (poco.IsInitial) + { + stringBuilder.Append(":= "); + } + else + { + stringBuilder.Append("= "); + } + + var ownedRelatedElementCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelatedElement", poco.OwnedRelatedElement); + + if (ownedRelatedElementCursor.Current is IExpression expression) + { + ExpressionTextualNotationBuilder.BuildOwnedExpression(expression, cursorCache, stringBuilder); + ownedRelatedElementCursor.Move(); + } } } } diff --git a/SysML2.NET/TextualNotation/NamespaceImportTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/NamespaceImportTextualNotationBuilder.cs index 990eb34c..929ab724 100644 --- a/SysML2.NET/TextualNotation/NamespaceImportTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/NamespaceImportTextualNotationBuilder.cs @@ -1,43 +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. -// +// // // ------------------------------------------------------------------------------------------------ namespace SysML2.NET.TextualNotation { + using System.Linq; using System.Text; + using SysML2.NET.Core.POCO.Kernel.Packages; using SysML2.NET.Core.POCO.Root.Namespaces; /// - /// Hand-coded part of the + /// Hand-coded part of the /// 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 from which the rule should be build /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation private static void BuildNamespaceImportHandCoded(INamespaceImport poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("BuildNamespaceImportHandCoded requires manual implementation"); + if (poco.OwnedRelatedElement.Contains(poco.ImportedNamespace) && poco.ImportedNamespace is IPackage filterPackage) + { + PackageTextualNotationBuilder.BuildFilterPackage(filterPackage, cursorCache, stringBuilder); + } + else if (poco.ImportedNamespace != null) + { + stringBuilder.Append(poco.ImportedNamespace.qualifiedName); + stringBuilder.Append("::* "); + + if (poco.IsRecursive) + { + stringBuilder.Append("::*** "); + } + } } } } diff --git a/SysML2.NET/TextualNotation/TriggerInvocationExpressionTextualNotationBuilder.cs b/SysML2.NET/TextualNotation/TriggerInvocationExpressionTextualNotationBuilder.cs index b38cceca..3c880a9a 100644 --- a/SysML2.NET/TextualNotation/TriggerInvocationExpressionTextualNotationBuilder.cs +++ b/SysML2.NET/TextualNotation/TriggerInvocationExpressionTextualNotationBuilder.cs @@ -1,20 +1,20 @@ // ------------------------------------------------------------------------------------------------- // -// +// // 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. -// +// // // ------------------------------------------------------------------------------------------------ @@ -22,22 +22,51 @@ namespace SysML2.NET.TextualNotation { using System.Text; + using SysML2.NET.Core.Systems.Actions; + using SysML2.NET.Core.POCO.Kernel.Behaviors; using SysML2.NET.Core.POCO.Systems.Actions; /// - /// Hand-coded part of the + /// Hand-coded part of the /// 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 from which the rule should be build /// The used to get access to CursorCollection for the current /// The that contains the entire textual notation private static void BuildTriggerExpressionHandCoded(ITriggerInvocationExpression poco, ICursorCache cursorCache, StringBuilder stringBuilder) { - throw new System.NotSupportedException("BuildTriggerExpressionHandCoded requires manual implementation"); + var ownedRelationshipCursor = cursorCache.GetOrCreateCursor(poco.Id, "ownedRelationship", poco.OwnedRelationship); + + switch (poco.Kind) + { + case TriggerKind.At: + case TriggerKind.After: + stringBuilder.Append(poco.Kind.ToString().ToLower()); + stringBuilder.Append(' '); + + if (ownedRelationshipCursor.Current is IParameterMembership argumentMember) + { + ParameterMembershipTextualNotationBuilder.BuildArgumentMember(argumentMember, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + } + + break; + case TriggerKind.When: + stringBuilder.Append("when "); + + if (ownedRelationshipCursor.Current is IParameterMembership argumentExpressionMember) + { + ParameterMembershipTextualNotationBuilder.BuildArgumentExpressionMember(argumentExpressionMember, cursorCache, stringBuilder); + ownedRelationshipCursor.Move(); + } + + break; + } } } } From ce523e61f81e81a13879e6e8eadcf595f019d532 Mon Sep 17 00:00:00 2001 From: atheate Date: Wed, 22 Apr 2026 15:30:26 +0200 Subject: [PATCH 33/33] claude.MD for the GRAMMAR --- CLAUDE.md | 1 + SysML2.NET.CodeGenerator/GRAMMAR.md | 118 ++++++++++++++++++++++++++++ 2 files changed, 119 insertions(+) create mode 100644 SysML2.NET.CodeGenerator/GRAMMAR.md diff --git a/CLAUDE.md b/CLAUDE.md index 720d7d98..a8c8ac9d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -35,6 +35,7 @@ Test framework: **NUnit**. Test classes use `[TestFixture]` and `[Test]` attribu - favour duplicated code in codegeneration to have staticaly defined methods that provide performance over reflection based code. - code generation is done by processing the UML model and creating handlebars templates +- **When working on the grammar/textual notation code generator** (`SysML2.NET.CodeGenerator/HandleBarHelpers/RulesHelper.cs` and related grammar processing): read `SysML2.NET.CodeGenerator/GRAMMAR.md` for the KEBNF grammar model, cursor/builder conventions, and code-gen patterns already handled. ### Code Generation Pipeline diff --git a/SysML2.NET.CodeGenerator/GRAMMAR.md b/SysML2.NET.CodeGenerator/GRAMMAR.md new file mode 100644 index 00000000..36f67755 --- /dev/null +++ b/SysML2.NET.CodeGenerator/GRAMMAR.md @@ -0,0 +1,118 @@ +# Grammar Code Generation Guide + +This file provides essential context for working on the SysML2 textual notation code generator (`RulesHelper.cs` and related files). Read this when modifying grammar processing or the `TextualNotationBuilder` generation pipeline. + +## Pipeline Overview + +``` +KEBNF grammar files (Grammar/Resources/*.kebnf) + parsed by Grammar/TextualNotationSpecificationVisitor + into Grammar/Model/* (RuleElement hierarchy) + processed by HandleBarHelpers/RulesHelper.cs + via Handlebars template (Templates/Uml/textualNotationBuilder.hbs) + emits SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/*.cs +``` + +**Hand-coded counterparts** live in `SysML2.NET/TextualNotation/*.cs` (parent folder) as `partial` classes. When code-gen can't handle a rule, it emits `Build{RuleName}HandCoded(poco, cursorCache, stringBuilder)` which must be implemented in the hand-coded partial. + +## Grammar Element Types (`Grammar/Model/`) + +| Type | Grammar form | Key properties | +|------|--------------|----------------| +| `NonTerminalElement` | `RuleName`, `RuleName*`, `RuleName+` | `Name`, `IsCollection` | +| `AssignmentElement` | `prop=X`, `prop+=X`, `prop?=X` | `Property`, `Operator`, `Value: RuleElement` | +| `TerminalElement` | literal strings like keywords, `;`, `{` | `Value` | +| `GroupElement` | `(...)`, `(...)?`, `(...)*` | `Alternatives`, `IsOptional`, `IsCollection` | +| `ValueLiteralElement` | `[QualifiedName]`, `NAME` | `Value`, `QueryIsQualifiedName()` | +| `NonParsingAssignmentElement` | `{prop='val'}` | `PropertyName`, `Operator`, `Value` | + +## Rule Structure + +`RuleName:TargetElementName = alternative1 | alternative2 | ...` + +- `TargetElementName` is the UML metaclass the rule targets (defaults to `RuleName` if omitted) +- Builder methods take `I{TargetElementName} poco` as parameter +- When a NonTerminal's target is the **declaring class** (same as calling context), it uses `poco` +- When a NonTerminal targets a different class, the cursor element is cast: `if (cursor.Current is ITargetType x) { ... }` + +## Cursor Model (`ICursorCache`) + +Cursors iterate over collection properties (typically `ownedRelationship`). Key mechanics: + +- `cursorCache.GetOrCreateCursor(pocoId, propertyName, collection)` — same `(pocoId, propertyName)` returns the same cursor instance. Cursors are **shared** across builder methods. +- `cursor.Current` — current element (null when exhausted) +- `cursor.Move()` — advances to next element +- **Critical:** A collection builder must call `Move()` after processing each item, or be called inside a `while` loop that advances externally + +## Key Methods in `RulesHelper.cs` + +| Method | Purpose | +|--------|---------| +| `ProcessAlternatives` | Entry point for processing a rule's alternatives. Dispatches to more specific handlers based on alternative structure | +| `ProcessUnitypedAlternativesWithOneElement` | Handles `A | B | C` where all alternatives have one element of the same type (NonTerminal, Terminal, or AssignmentElement) | +| `ProcessNonTerminalElement` | Processes a single NonTerminal reference. For collections, delegates to `EmitCollectionNonTerminalLoop` | +| `EmitCollectionNonTerminalLoop` | Generates `while (cursor.Current ...) { builderCall; cursor.Move(); }` | +| `ProcessAssignmentElement` | Handles `=`, `+=`, `?=` assignments. Emits property access, cursor advance, or boolean-triggered keyword | +| `OrderElementsByInheritance` | Sorts NonTerminals by UML class depth (most specific first) for switch case ordering | +| `ResolveBuilderCall` | Returns `XxxTextualNotationBuilder.BuildRuleName(var, cursorCache, stringBuilder);` or `null` if types incompatible | +| `ResolveCollectionWhileTypeCondition` | Builds while condition — positive `is Type` if collection has only `+=` assignments, negative `is not null and not NextType` as fallback | + +## Guard Mechanisms for Ambiguous Dispatch + +When multiple alternatives map to the same UML class (creating duplicate switch cases), these disambiguate: + +1. **`?=` boolean guards** (primary) — e.g., `EndUsagePrefix` has `isEnd?='end'`, so it gets `when poco.IsEnd` +2. **`IsValidFor{RuleName}()` extension methods** (fallback) — hand-coded in `MembershipValidationExtensions.cs` or `TextualNotationValidationExtensions.cs`. Used when `?=` can't disambiguate +3. **Type ordering** — more specific types (deeper inheritance) come first, fallback case (matching `NamedElementToGenerate`) goes last as `default:` + +## Patterns Handled by Code-Gen + +| Pattern | Example | Handler | +|---------|---------|---------| +| Body with collection items | `';' | '{' Items* '}'` | `ProcessAlternatives` body check with `IsCollection: true` NonTerminal | +| Body with single sub-rule | `';' | '{' SingleRule '}'` | `ProcessAlternatives` body check with `IsCollection: false` NonTerminal | +| QualifiedName or owned chain | `prop=[QualifiedName] | prop=OwnedChain{containment+=prop}` | `ProcessAlternatives` two-alternative check | +| Mixed NonTerminal + `+=` | `NonTerminal | prop+=X` | `if (cursor.Current is XType) { process + Move() } else { BuildNonTerminal(poco, ...) }` | +| Collection group | `(ownedRelationship+=A | ownedRelationship+=B)*` | `groupElement.IsCollection` handler: while loop + cursor-based switch | +| Pure dispatch | `NonFeatureMember | NamespaceFeatureMember` | `ProcessUnitypedAlternativesWithOneElement` NonTerminal case with `IsValidFor` guards | + +## Switch Case Variable Scoping Gotcha + +Pattern variables like `elementAsFeatureMembership` in `if (x is Type elementAsFeatureMembership)` have **block scope**, not just the `if` body — they leak into the enclosing scope. The `if (x != null) { }` wrapper around these serves as a **scoping boundary** to prevent name collisions when the same pattern appears multiple times in the same method. Don't remove outer null guards without understanding this. + +## HandCoded Fallback Convention + +When code-gen detects an unsupported pattern, it emits: +```csharp +Build{RuleName}HandCoded(poco, cursorCache, stringBuilder); +``` + +The hand-coded partial class file must: +1. Live in `SysML2.NET/TextualNotation/{ClassName}TextualNotationBuilder.cs` +2. Declare `public static partial class {ClassName}TextualNotationBuilder` +3. Implement the method as `private static void Build{RuleName}HandCoded(...)` +4. Use `NotSupportedException` (not `NotImplementedException`) for unimplemented stubs +5. Include the grammar rule as `{rule}` in XML doc + +## Common Builder Conventions + +- **Trailing space**: Most builders append a trailing space after their content (`stringBuilder.Append(' ')`). Chain builders already add this internally — don't double it. +- **Terminal formatting**: Special terminals like curly braces and semicolons use `AppendLine`; angle brackets and `~` have no trailing space (see `NewLineTerminals` / `NoTrailingSpaceTerminals` in `RulesHelper.cs`). +- **Owned vs referenced elements**: To distinguish `type=OwnedChain{ownedRelatedElement+=type}` from `type=[QualifiedName]`, check at runtime: `poco.OwnedRelatedElement.Contains(poco.Type)` owned (call chain builder), else cross-reference (emit `qualifiedName`). + +## Testing Changes to the Generator + +After modifying `RulesHelper.cs`: +```bash +dotnet build SysML2.NET.CodeGenerator/SysML2.NET.CodeGenerator.csproj +dotnet test SysML2.NET.CodeGenerator.Tests/SysML2.NET.CodeGenerator.Tests.csproj --filter UmlCoreTextualNotationBuilderGeneratorTestFixture +# Generated files land in SysML2.NET.CodeGenerator.Tests/bin/Debug/net10.0/UML/_SysML2.NET.Core.UmlCoreTextualNotationBuilderGenerator/ +cp SysML2.NET.CodeGenerator.Tests/bin/Debug/net10.0/UML/_SysML2.NET.Core.UmlCoreTextualNotationBuilderGenerator/*.cs SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/ +dotnet build SysML2.NET.sln +dotnet test SysML2.NET.sln +``` + +**Count remaining HandCoded calls** to track progress: +```bash +grep -r "HandCoded" SysML2.NET/TextualNotation/AutoGenTextualNotationBuilder/*.cs | wc -l +```