diff --git a/Resources/KerML-textual-bnf.kebnf b/Resources/KerML-textual-bnf.kebnf
new file mode 100644
index 000000000..2837bcfd8
--- /dev/null
+++ b/Resources/KerML-textual-bnf.kebnf
@@ -0,0 +1,1467 @@
+// Manual corrections by HP de Koning
+
+// Part 1 - Kernel Modeling Language (KerML)
+
+// Clause 8.2 Concrete Syntax
+
+// Clause 8.2.1 Concrete Syntax Overview
+
+// Clause 8.2.2 Lexical Structure
+
+// Clause 8.2.2.1 Line Terminators and White Space
+
+LINE_TERMINATOR =
+ '\n' | '\r' | '\r\n'
+// implementation defined character sequence
+
+LINE_TEXT =
+ '[^\r\n]*'
+// character sequence excluding LINE_TERMINATORs
+
+WHITE_SPACE =
+ ' ' | '\t' | '\f' | LINE_TERMINATOR
+// space | tab | form_feed | LINE_TERMINATOR
+
+// Notes:
+// 1. Notation text is divided up into lines separated by line terminators. A line terminator may be a single character (such as a line feed) or a sequence of characters (such as a carriage return/line feed combination). This specification does not require any specific encoding for a line terminator, but any encoding used must be consistent throughout any specific input text.
+// 2. Any characters in text line that are not a part of the line terminator are referred to as line text.
+// 3. A white space character is a space, tab, form feed or line terminator. Any contiguous sequence of white space characters can be used to separate tokens that would otherwise be considered to be part of a single token. It is otherwise ignored, with the single exception that a line terminator is used to mark the end of a single-line note (see 8.2.2.2).
+
+// Clause 8.2.2.2 Notes and Comments
+
+SINGLE_LINE_NOTE =
+ '//' LINE_TEXT
+
+MULTILINE_NOTE =
+ '//*' COMMENT_TEXT '*/'
+
+REGULAR_COMMENT =
+ '/*' COMMENT_TEXT '*/'
+
+COMMENT_TEXT =
+ ( COMMENT_LINE_TEXT | LINE_TERMINATOR )*
+
+COMMENT_LINE_TEXT =
+ '.*(?=(\r|\n|\*/))'
+// LINE_TEXT excluding the sequence '*/'
+
+// Clause 8.2.2.3 Names
+
+NAME =
+ BASIC_NAME | UNRESTRICTED_NAME
+
+BASIC_NAME =
+ BASIC_INITIAL_CHARACTER BASIC_NAME_CHARACTER*
+
+SINGLE_QUOTE =
+ '#x27'
+
+UNRESTRICTED_NAME =
+ SINGLE_QUOTE ( NAME_CHARACTER | ESCAPE_SEQUENCE )* SINGLE_QUOTE
+
+// (See Note 1)
+
+BASIC_INITIAL_CHARACTER =
+ ALPHABETIC_CHARACTER | '_'
+
+BASIC_NAME_CHARACTER =
+ BASIC_INITIAL_CHARACTER | DECIMAL_DIGIT
+
+ALPHABETIC_CHARACTER =
+ 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z' |
+ 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z'
+// any character 'a' through 'z' or 'A' through 'Z'
+
+DECIMAL_DIGIT =
+ '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'
+
+NAME_CHARACTER =
+ 'any printable character other than backslash or single_quote'
+
+ESCAPE_SEQUENCE =
+ '\f' | '\n' | '\t' | '\r' | '\v'
+// (See Note 2)
+
+// Notes:
+// 1. The single_quote character is '. The name represented by an UNRESTRICTED_NAME shall consist of the characters within the single quotes, with escape characters resolved as described below. The surrounding single quote characters are not part of the represented name.
+// 2. An ESCAPE_SEQUENCE is a sequence of two text characters starting with a backslash that actually denotes only a single character, except for the newline escape sequence, which represents however many characters is necessary to represent an end of line in a specific implementation (see also 8.2.2.1). Table 4 shows the meaning of the allowed escape sequences. The ESCAPE_SEQUENCES in an UNRESTRICTED_NAME shall be replaced by the characters specified as their meanings in the actual represented name.
+
+// Clause 8.2.2.4 Numeric Values
+
+DECIMAL_VALUE =
+ DECIMAL_DIGIT+
+
+EXPONENTIAL_VALUE =
+ DECIMAL_VALUE ('e' | 'E') ('+' | '-')? DECIMAL_VALUE
+
+// Notes:
+// 1. A DECIMAL_VALUE may specify a natural literal, or it may be part of the specification of a real literal (see 8.2.5.8.4). Note that a DECIMAL_VALUE does not include a sign, because negating a literal is an operator in the KerML Expression syntax.
+// 2. An EXPONENTIAL_VALUE may be used in the specification of a real literal (see 8.2.5.8.4). Note that a decimal point and fractional part are not included in the lexical structure of an exponential value. They are handled as part of the syntax of real literals.
+
+// Clause 8.2.2.5 String Value
+
+STRING_VALUE =
+ '"' ( STRING_CHARACTER | ESCAPE_SEQUENCE )* '"'
+
+STRING_CHARACTER =
+ 'any printable character other than backslash or "'
+
+// Notes:
+// 1. ESCAPE_SEQUENCE is specified in 8.2.2.3.
+
+// Clause 8.2.2.6 Reserved Words
+
+RESERVED_KEYWORD =
+ 'about' | 'abstract' | 'alias' | 'all' | 'and' | 'as' | 'assoc' | 'behavior' | 'binding' | 'bool' | 'by' | 'chains'
+ | 'class' | 'classifier' | 'comment' | 'composite' | 'conjugate' | 'conjugates' | 'conjugation' | 'connector'
+ | 'const' | 'crosses' | 'datatype' | 'default' | 'dependency' | 'derived' | 'differences' | 'disjoining' | 'disjoint'
+ | 'doc' | 'else' | 'end' | 'expr' | 'false' | 'feature' | 'featured' | 'featuring' | 'filter' | 'first' | 'flow'
+ | 'for' | 'from' | 'function' | 'hastype' | 'if' | 'implies' | 'import' | 'in' | 'inout' | 'interaction'
+ | 'intersects' | 'inv' | 'inverse' | 'inverting' | 'istype' | 'language' | 'library' | 'locale' | 'member' | 'meta'
+ | 'metaclass' | 'metadata' | 'multiplicity' | 'namespace' | 'nonunique' | 'not' | 'null' | 'of' | 'or' | 'ordered'
+ | 'out' | 'package' | 'portion' | 'predicate' | 'private' | 'protected' | 'public' | 'redefines' | 'redefinition'
+ | 'references' | 'rep' | 'return' | 'specialization' | 'specializes' | 'standard' | 'step' | 'struct'
+ | 'subclassifier' | 'subset' | 'subsets' | 'subtype' | 'succession' | 'then' | 'to' | 'true' | 'type' | 'typed'
+ | 'typing' | 'unions' | 'var' | 'xor'
+
+// Clause 8.2.2.7 Symbols
+
+RESERVED_SYMBOL =
+ '~' | '}' | '|' | '{' | '^' | ']' | '[' | '@' | '??' | '?' | '>=' | '>' | '=>' | '===' | '==' | '=' | '<=' | '<'
+ | ';' | ':>>' | ':>' | ':=' | '::>' | '::' | ':' | '/' | '.?' | '..' | '.' | '->' | '-' | ',' | '+' | '**' | '*' | ')'
+ | '(' | '&' | '%' | '$' | '#' | '!==' | '!='
+
+TYPED_BY = ':' | 'typed' 'by'
+
+SPECIALIZES = ':>' | 'specializes'
+
+SUBSETS = ':>' | 'subsets'
+
+REFERENCES = '::>' | 'references'
+
+CROSSES = '=>' | 'crosses'
+
+REDEFINES = ':>>' | 'redefines'
+
+CONJUGATES = '~' | 'conjugates'
+
+// Clause 8.2.3 Root Concrete Syntax
+
+// Clause 8.2.3.1 Elements and Relationships Concrete Syntax
+
+Identification : Element =
+ ( '<' declaredShortName = NAME '>' )?
+ ( declaredName = NAME )?
+
+RelationshipBody : Relationship =
+ ';' | '{' RelationshipOwnedElement* '}'
+
+RelationshipOwnedElement : Relationship =
+ ownedRelatedElement += OwnedRelatedElement
+ | ownedRelationship += OwnedAnnotation
+
+OwnedRelatedElement : Element =
+ NonFeatureElement | FeatureElement
+
+// Clause 8.2.3.2 Dependencies Concrete Syntax
+
+Dependency =
+ ( ownedRelationship += PrefixMetadataAnnotation )*
+ 'dependency' ( Identification? 'from' )?
+ client += [QualifiedName] ( ',' client += [QualifiedName] )* 'to'
+ supplier += [QualifiedName] ( ',' supplier += [QualifiedName] )*
+ RelationshipBody
+
+// Notes:
+// 1. PrefixMetadataAnnotation is defined in the Kernel layer (see 8.2.5.12).
+
+// Clause 8.2.3.3 Annotations Concrete Syntax
+
+// Clause 8.2.3.3.1 Annotations
+
+Annotation =
+ annotatedElement = [QualifiedName]
+
+OwnedAnnotation : Annotation =
+ ownedRelatedElement += AnnotatingElement
+
+AnnotatingElement =
+ Comment
+ | Documentation
+ | TextualRepresentation
+ | MetadataFeature
+
+// Notes:
+// 1. MetadataFeature is defined in the Kernel layer (see 8.2.5.12).
+
+// Clause 8.2.3.3.2 Comments and Documentation
+
+Comment =
+ ( 'comment' Identification
+ ( 'about' ownedRelationship += Annotation
+ ( ',' ownedRelationship += Annotation )*
+ )?
+ )?
+ ( 'locale' locale = STRING_VALUE )?
+ body = REGULAR_COMMENT
+
+Documentation =
+ 'doc' Identification
+ ( 'locale' locale = STRING_VALUE )?
+ body = REGULAR_COMMENT
+
+// Notes:
+// 1. The text of a lexical REGULAR_COMMENT or PREFIX_COMMENT shall be processed as follows before it is included as the body of a Comment or Documentation:
+// • Remove the initial /* and final */ characters.
+// • Remove any white space immediately after the initial /*, up to and including the first line terminator (if any).
+// • On each subsequent line of the text:
+// • Strip initial white space other than line terminators.
+// • Then, if the first remaining character is "*", remove it.
+// • Then, if the first remaining character is now a space, remove it.
+// 2. The body text of a Comment can include markup information (such as HTML), and a conforming tool may display such text as rendered according to the markup. However, marked up "rich text" for a Comment written using the KerML textual concrete syntax shall be stored in the Comment body in plain text including all mark up text, with all line terminators and white space included as entered, other than what is removed according to the rules above.
+
+// Clause 8.2.3.3.3 Textual Representation
+
+TextualRepresentation =
+ ( 'rep' Identification )?
+ 'language' language = STRING_VALUE
+ body = REGULAR_COMMENT
+
+// Notes:
+// 1. The lexical text of a REGULAR_COMMENT shall be processed as specified in 8.2.3.3.2 for Comments before being included as the body of a TextualRepresentation.
+// 2. See also 8.3.2.3.6 on the standard language names recognized for a TextualRepresentation.
+
+// Clause 8.2.3.4 Namespaces Concrete Syntax
+
+// Clause 8.2.3.4.1 Namespaces
+
+RootNamespace : Namespace =
+ NamespaceBodyElement*
+
+// (See Note 1)
+
+Namespace =
+ ( ownedRelationship += PrefixMetadataMember )*
+ NamespaceDeclaration NamespaceBody
+
+// (See Note 2)
+
+NamespaceDeclaration : Namespace =
+ 'namespace' Identification
+
+NamespaceBody : Namespace =
+ ';' | '{' NamespaceBodyElement* '}'
+
+NamespaceBodyElement : Namespace =
+ ownedRelationship += NamespaceMember
+ | ownedRelationship += AliasMember
+ | ownedRelationship += Import
+
+MemberPrefix : Membership =
+ ( visibility = VisibilityIndicator )?
+
+VisibilityIndicator : VisibilityKind =
+ 'public' | 'private' | 'protected'
+
+NamespaceMember : OwningMembership =
+ NonFeatureMember
+ | NamespaceFeatureMember
+
+NonFeatureMember : OwningMembership =
+ MemberPrefix
+ ownedRelatedElement += MemberElement
+
+NamespaceFeatureMember : OwningMembership =
+ MemberPrefix
+ ownedRelatedElement += FeatureElement
+
+AliasMember : Membership =
+ MemberPrefix
+ 'alias' ( '<' memberShortName = NAME '>' )?
+ ( memberName = NAME )?
+ 'for' memberElement = [QualifiedName]
+ RelationshipBody
+
+QualifiedName =
+ ( '$' '::' )? ( NAME '::' )* NAME
+
+// (See Note 3)
+
+// Notes:
+// 1. A root Namespace is a Namespace that has no owningNamespace (see 8.3.2.4). Every Element other than a root Namespace must be contained, directly or indirectly, within some root Namespace. Therefore, every valid KerML concrete syntax text can be parsed starting from the RootNamespace production.
+// 2. PrefixMetadataMember is defined in the Kernel layer (see 8.2.5.12).
+// 3. A qualified name is notated as a sequence of segment names separated by "::" punctuation, optionally with the global scope qualifier "$" as an initial segment. An unqualified name can be considered the degenerate case of a qualified name with a single segment name. A qualified name is used in the KerML textual concrete syntax to identify an Element that is being referred to in the representation of another Element. A qualified name used in this way does not appear in the corresponding abstract syntax—instead, the abstract syntax representation contains an actual reference to the identified Element. Name resolution is the process of determining the Element that is identified by a qualified name. The segment names of the qualified name other than the last identify a sequence of nested Namespaces that provide the context for resolving the final segment name (see 8.2.3.5). The notation [QualifiedName] is used in concrete syntax grammar productions to indicate the result of resolving text parsed as a QualifiedName (see also 8.2.1).
+
+// Clause 8.2.3.4.2 Imports
+
+Import =
+ visibility = VisibilityIndicator
+ 'import' ( isImportAll ?= 'all' )?
+ ImportDeclaration RelationshipBody
+
+ImportDeclaration : Import =
+ MembershipImport | NamespaceImport
+
+MembershipImport =
+ importedMembership = [QualifiedName]
+ ( '::' isRecursive ?= '**' )?
+
+// (See Note 1)
+
+NamespaceImport =
+ importedNamespace = [QualifiedName] '::' '*'
+ ( '::' isRecursive ?= '**' )?
+ | importedNamespace = FilterPackage
+ { ownedRelatedElement += importedNamespace }
+
+FilterPackage : Package =
+ ownedRelationship += ImportDeclaration
+ ( ownedRelationship += FilterPackageMember )+
+
+FilterPackageMember : ElementFilterMembership =
+ '[' ownedRelatedElement += OwnedExpression ']'
+
+// Notes:
+// 1. The importedMembership of a MembershipImport is the single case in which the Element required from the resolution [QualifiedName] is the actual Membership identified by the QualifedName, not the memberElement of that Membership (see 8.2.3.5).
+
+// Clause 8.2.3.4.3 Namespace Elements
+
+MemberElement : Element =
+ AnnotatingElement | NonFeatureElement
+
+NonFeatureElement : Element =
+ Dependency
+ | Namespace
+ | Type
+ | Classifier
+ | DataType
+ | Class
+ | Structure
+ | Metaclass
+ | Association
+ | AssociationStructure
+ | Interaction
+ | Behavior
+ | Function
+ | Predicate
+ | Multiplicity
+ | Package
+ | LibraryPackage
+ | Specialization
+ | Conjugation
+ | Subclassification
+ | Disjoining
+ | FeatureInverting
+ | FeatureTyping
+ | Subsetting
+ | Redefinition
+ | TypeFeaturing
+
+FeatureElement : Feature =
+ Feature
+ | Step
+ | Expression
+ | BooleanExpression
+ | Invariant
+ | Connector
+ | BindingConnector
+ | Succession
+ | Flow
+ | SuccessionFlow
+
+// Clause 8.2.3.5 Name Resolution
+
+// Clause 8.2.3.5.1 Name Resolution Overview
+
+// Clause 8.2.3.5.2 Local and Global Namespaces
+
+// Clause 8.2.3.5.3 Local and Visible Resolution
+
+// Clause 8.2.3.5.4 Full Resolution
+
+// Clause 8.2.4 Core Concrete Syntax
+
+// Clause 8.2.4.1 Types Concrete Syntax
+
+// Clause 8.2.4.1.1 Types
+
+Type =
+ TypePrefix 'type'
+ TypeDeclaration TypeBody
+
+TypePrefix : Type =
+ ( isAbstract ?= 'abstract' )?
+ ( ownedRelationship += PrefixMetadataMember )*
+
+TypeDeclaration : Type =
+ ( isSufficient ?= 'all' )? Identification
+ ( ownedRelationship += OwnedMultiplicity )?
+ ( SpecializationPart | ConjugationPart )+
+ TypeRelationshipPart*
+
+SpecializationPart : Type =
+ SPECIALIZES ownedRelationship += OwnedSpecialization
+ ( ',' ownedRelationship += OwnedSpecialization )*
+
+ConjugationPart : Type =
+ CONJUGATES ownedRelationship += OwnedConjugation
+
+TypeRelationshipPart : Type =
+ DisjoiningPart
+ | UnioningPart
+ | IntersectingPart
+ | DifferencingPart
+
+DisjoiningPart : Type =
+ 'disjoint' 'from' ownedRelationship += OwnedDisjoining
+ ( ',' ownedRelationship += OwnedDisjoining )*
+
+UnioningPart : Type =
+ 'unions' ownedRelationship += Unioning
+ ( ',' ownedRelationship += Unioning )*
+
+IntersectingPart : Type =
+ 'intersects' ownedRelationship += Intersecting
+ ( ',' ownedRelationship += Intersecting )*
+
+DifferencingPart : Type =
+ 'differences' ownedRelationship += Differencing
+ ( ',' ownedRelationship += Differencing )*
+
+TypeBody : Type =
+ ';' | '{' TypeBodyElement* '}'
+
+TypeBodyElement : Type =
+ ownedRelationship += NonFeatureMember
+ | ownedRelationship += FeatureMember
+ | ownedRelationship += AliasMember
+ | ownedRelationship += Import
+
+// Clause 8.2.4.1.2 Specialization
+
+Specialization =
+ ( 'specialization' Identification )?
+ 'subtype' SpecificType
+ SPECIALIZES GeneralType
+ RelationshipBody
+
+OwnedSpecialization : Specialization =
+ GeneralType
+
+SpecificType : Specialization =
+ specific = [QualifiedName]
+ | specific += OwnedFeatureChain
+ { ownedRelatedElement += specific }
+
+GeneralType : Specialization =
+ general = [QualifiedName]
+ | general += OwnedFeatureChain
+ { ownedRelatedElement += general }
+
+// Clause 8.2.4.1.3 Conjugation
+
+Conjugation =
+ ( 'conjugation' Identification )?
+ 'conjugate'
+ ( conjugatedType = [QualifiedName]
+ | conjugatedType = FeatureChain
+ { ownedRelatedElement += conjugatedType }
+ )
+ CONJUGATES
+ ( originalType = [QualifiedName]
+ | originalType = FeatureChain
+ { ownedRelatedElement += originalType }
+ )
+ RelationshipBody
+
+OwnedConjugation : Conjugation =
+ originalType = [QualifiedName]
+ | originalType = FeatureChain
+ { ownedRelatedElement += originalType }
+
+// Clause 8.2.4.1.4 Disjoining
+
+Disjoining =
+ ( 'disjoining' Identification )?
+ 'disjoint'
+ ( typeDisjoined = [QualifiedName]
+ | typeDisjoined = FeatureChain
+ { ownedRelatedElement += typeDisjoined }
+ )
+ 'from'
+ ( disjoiningType = [QualifiedName]
+ | disjoiningType = FeatureChain
+ { ownedRelatedElement += disjoiningType }
+ )
+ RelationshipBody
+
+OwnedDisjoining : Disjoining =
+ disjoiningType = [QualifiedName]
+ | disjoiningType = FeatureChain
+ { ownedRelatedElement += disjoiningType }
+
+// Clause 8.2.4.1.5 Unioning, Intersecting and Differencing
+
+Unioning =
+ unioningType = [QualifiedName]
+ | ownedRelatedElement += OwnedFeatureChain
+
+Intersecting =
+ intersectingType = [QualifiedName]
+ | ownedRelatedElement += OwnedFeatureChain
+
+Differencing =
+ differencingType = [QualifiedName]
+ | ownedRelatedElement += OwnedFeatureChain
+
+// Clause 8.2.4.1.6 Feature Membership
+
+FeatureMember : OwningMembership =
+ TypeFeatureMember
+ | OwnedFeatureMember
+
+TypeFeatureMember : OwningMembership =
+ MemberPrefix 'member' ownedRelatedElement += FeatureElement
+
+OwnedFeatureMember : FeatureMembership =
+ MemberPrefix ownedRelatedElement += FeatureElement
+
+// Clause 8.2.4.2 Classifiers Concrete Syntax
+
+// Clause 8.2.4.2.1 Classifiers
+
+Classifier =
+ TypePrefix 'classifier'
+ ClassifierDeclaration TypeBody
+
+ClassifierDeclaration : Classifier =
+ ( isSufficient ?= 'all' )? Identification
+ ( ownedRelationship += OwnedMultiplicity )?
+ ( SuperclassingPart | ConjugationPart )?
+ TypeRelationshipPart*
+
+SuperclassingPart : Classifier =
+ SPECIALIZES ownedRelationship += OwnedSubclassification
+ ( ',' ownedRelationship += OwnedSubclassification )*
+
+// Clause 8.2.4.2.2 Subclassification
+
+Subclassification =
+ ( 'specialization' Identification )?
+ 'subclassifier' subclassifier = [QualifiedName]
+ SPECIALIZES superclassifier = [QualifiedName]
+ RelationshipBody
+
+OwnedSubclassification : Subclassification =
+ superclassifier = [QualifiedName]
+
+// Clause 8.2.4.3 Features Concrete Syntax
+
+// Clause 8.2.4.3.1 Features
+
+Feature =
+ ( FeaturePrefix
+ ( 'feature' | ownedRelationship += PrefixMetadataMember )
+ FeatureDeclaration?
+ | ( EndFeaturePrefix | BasicFeaturePrefix )
+ FeatureDeclaration
+ )
+ ValuePart? TypeBody
+
+// (See Note 1)
+
+EndFeaturePrefix : Feature =
+ ( isConstant ?= 'const' { isVariable = true } )?
+ isEnd ?= 'end'
+
+BasicFeaturePrefix : Feature =
+ ( direction = FeatureDirection )?
+ ( isDerived ?= 'derived' )?
+ ( isAbstract ?= 'abstract' )?
+ ( isComposite ?= 'composite' | isPortion ?= 'portion' )?
+ ( isVariable ?= 'var' | isConstant ?= 'const' { isVariable = true } )?
+
+FeaturePrefix =
+ ( EndFeaturePrefix ( ownedRelationship += OwnedCrossFeatureMember )?
+ | BasicFeaturePrefix
+ )
+ ( ownedRelationship += PrefixMetadataMember )*
+
+// (See Note 1)
+
+OwnedCrossFeatureMember : OwningMembership =
+ ownedRelatedElement += OwnedCrossFeature
+
+OwnedCrossFeature : Feature =
+ BasicFeaturePrefix FeatureDeclaration
+
+FeatureDirection : FeatureDirectionKind =
+ 'in' | 'out' | 'inout'
+
+FeatureDeclaration : Feature =
+ ( isSufficient ?= 'all' )?
+ ( FeatureIdentification
+ ( FeatureSpecializationPart | ConjugationPart )?
+ | FeatureSpecializationPart
+ | ConjugationPart
+ )
+ FeatureRelationshipPart*
+
+FeatureIdentification : Feature =
+ '<' declaredShortName = NAME '>' ( declaredName = NAME )?
+ | declaredName = NAME
+
+FeatureRelationshipPart : Feature =
+ TypeRelationshipPart
+ | ChainingPart
+ | InvertingPart
+ | TypeFeaturingPart
+
+ChainingPart : Feature =
+ 'chains'
+ ( ownedRelationship += OwnedFeatureChaining
+ | FeatureChain )
+
+InvertingPart : Feature =
+ 'inverse' 'of' ownedRelationship += OwnedFeatureInverting
+
+TypeFeaturingPart : Feature =
+ 'featured' 'by' ownedRelationship += OwnedTypeFeaturing
+ ( ',' ownedTypeFeaturing += OwnedTypeFeaturing )*
+
+FeatureSpecializationPart : Feature =
+ FeatureSpecialization+ MultiplicityPart? FeatureSpecialization*
+ | MultiplicityPart FeatureSpecialization*
+
+MultiplicityPart : Feature =
+ ownedRelationship += OwnedMultiplicity
+ | ( ownedRelationship += OwnedMultiplicity )?
+ ( isOrdered ?= 'ordered' ( {isUnique = false} 'nonunique' )?
+ | {isUnique = false} 'nonunique' ( isOrdered ?= 'ordered' )? )
+
+FeatureSpecialization : Feature =
+ Typings | Subsettings | References | Crosses | Redefinitions
+
+Typings : Feature =
+ TypedBy ( ',' ownedRelationship += OwnedFeatureTyping )*
+
+TypedBy : Feature =
+ TYPED_BY ownedRelationship += OwnedFeatureTyping
+
+Subsettings : Feature =
+ Subsets ( ',' ownedRelationship += OwnedSubsetting )*
+
+Subsets : Feature =
+ SUBSETS ownedRelationship += OwnedSubsetting
+
+References : Feature =
+ REFERENCES ownedRelationship += OwnedReferenceSubsetting
+
+Crosses : Feature =
+ CROSSES ownedRelationship += OwnedCrossSubsetting
+
+Redefinitions : Feature =
+ Redefines ( ',' ownedRelationship += OwnedRedefinition )*
+
+Redefines : Feature =
+ REDEFINES ownedRelationship += OwnedRedefinition
+
+// Notes:
+// 1. PrefixMetadataMember is defined in the Kernel layer (see 8.3.4.12).
+
+// Clause 8.2.4.3.2 Feature Typing
+
+FeatureTyping =
+ ( 'specialization' Identification )?
+ 'typing' typedFeature = [QualifiedName]
+ TYPED_BY GeneralType
+ RelationshipBody
+
+OwnedFeatureTyping : FeatureTyping =
+ GeneralType
+
+// Clause 8.2.4.3.3 Subsetting
+
+Subsetting =
+ ( 'specialization' Identification )?
+ 'subset' SpecificType
+ SUBSETS GeneralType
+ RelationshipBody
+
+OwnedSubsetting : Subsetting =
+ GeneralType
+
+OwnedReferenceSubsetting : ReferenceSubsetting =
+ GeneralType
+
+OwnedCrossSubsetting : CrossSubsetting =
+ GeneralType
+
+// Clause 8.2.4.3.4 Redefinition
+
+Redefinition =
+ ( 'specialization' Identification )?
+ 'redefinition' SpecificType
+ REDEFINES GeneralType
+ RelationshipBody
+
+OwnedRedefinition : Redefinition =
+ GeneralType
+
+// Clause 8.2.4.3.5 Feature Chaining
+
+OwnedFeatureChain : Feature =
+ FeatureChain
+
+FeatureChain : Feature =
+ ownedRelationship += OwnedFeatureChaining
+ ( '.' ownedRelationship += OwnedFeatureChaining )+
+
+OwnedFeatureChaining : FeatureChaining =
+ chainingFeature = [QualifiedName]
+
+// Clause 8.2.4.3.6 Feature Inverting
+
+FeatureInverting =
+ ( 'inverting' Identification? )?
+ 'inverse'
+ ( featureInverted = [QualifiedName]
+ | featureInverted = OwnedFeatureChain
+ { ownedRelatedElement += featureInverted }
+ )
+ 'of'
+ ( invertingFeature = [QualifiedName]
+ | ownedRelatedElement += OwnedFeatureChain
+ { ownedRelatedElement += invertingFeature }
+ )
+ RelationshipBody
+
+OwnedFeatureInverting : FeatureInverting =
+ invertingFeature = [QualifiedName]
+ | invertingFeature = OwnedFeatureChain
+ { ownedRelatedElement += invertingFeature }
+
+// Clause 8.2.4.3.7 Type Featuring
+
+TypeFeaturing =
+ 'featuring' ( Identification 'of' )?
+ featureOfType = [QualifiedName]
+ 'by' featuringType = [QualifiedName]
+ RelationshipBody
+
+OwnedTypeFeaturing : TypeFeaturing =
+ featuringType = [QualifiedName]
+
+// Clause 8.2.5 Kernel Concrete Syntax
+
+// Clause 8.2.5.1 Data Types Concrete Syntax
+
+DataType =
+ TypePrefix 'datatype'
+ ClassifierDeclaration TypeBody
+
+// Clause 8.2.5.2 Classes Concrete Syntax
+
+Class =
+ TypePrefix 'class'
+ ClassifierDeclaration TypeBody
+
+// Clause 8.2.5.3 Structures Concrete Syntax
+
+Structure =
+ TypePrefix 'struct'
+ ClassifierDeclaration TypeBody
+
+// Clause 8.2.5.4 Associations Concrete Syntax
+
+Association =
+ TypePrefix 'assoc'
+ ClassifierDeclaration TypeBody
+
+AssociationStructure =
+ TypePrefix 'assoc' 'struct'
+ ClassifierDeclaration TypeBody
+
+// Clause 8.2.5.5 Connectors Concrete Syntax
+
+// Clause 8.2.5.5.1 Connectors
+
+Connector =
+ FeaturePrefix 'connector'
+ ( FeatureDeclaration? ValuePart?
+ | ConnectorDeclaration
+ )
+ TypeBody
+
+ConnectorDeclaration : Connector =
+ BinaryConnectorDeclaration | NaryConnectorDeclaration
+
+BinaryConnectorDeclaration : Connector =
+ ( FeatureDeclaration? 'from' | isSufficient ?= 'all' 'from'? )?
+ ownedRelationship += ConnectorEndMember 'to'
+ ownedRelationship += ConnectorEndMember
+
+NaryConnectorDeclaration : Connector =
+ FeatureDeclaration?
+ '(' ownedRelationship += ConnectorEndMember ','
+ ownedRelationship += ConnectorEndMember
+ ( ',' ownedRelationship += ConnectorEndMember )*
+ ')'
+
+ConnectorEndMember : EndFeatureMembership =
+ ownedRelatedElement += ConnectorEnd
+
+ConnectorEnd : Feature =
+ ( ownedRelationship += OwnedCrossMultiplicityMember )?
+ ( declaredName = NAME REFERENCES )?
+ ownedRelationship += OwnedReferenceSubsetting
+
+OwnedCrossMultiplicityMember : OwningMembership =
+ ownedRelatedElement += OwnedCrossMultiplicity
+
+OwnedCrossMultiplicity : Feature =
+ ownedRelationship += OwnedMultiplicity
+
+// Clause 8.2.5.5.2 Binding Connectors
+
+BindingConnector =
+ FeaturePrefix 'binding'
+ BindingConnectorDeclaration TypeBody
+
+BindingConnectorDeclaration : BindingConnector =
+ FeatureDeclaration
+ ( 'of' ownedRelationship += ConnectorEndMember
+ '=' ownedRelationship += ConnectorEndMember )?
+ | ( isSufficient ?= 'all' )?
+ ( 'of'? ownedRelationship += ConnectorEndMember
+ '=' ownedRelationship += ConnectorEndMember )?
+
+// Clause 8.2.5.5.3 Successions
+
+Succession =
+ FeaturePrefix 'succession'
+ SuccessionDeclaration TypeBody
+
+SuccessionDeclaration : Succession =
+ FeatureDeclaration
+ ( 'first' ownedRelationship += ConnectorEndMember
+ 'then' ownedRelationship += ConnectorEndMember )?
+ | ( s.isSufficient ?= 'all' )?
+ ( 'first'? ownedRelationship += ConnectorEndMember
+ 'then' ownedRelationship += ConnectorEndMember )?
+
+// Clause 8.2.5.6 Behaviors Concrete Syntax
+
+// Clause 8.2.5.6.1 Behaviors
+
+Behavior =
+ TypePrefix 'behavior'
+ ClassifierDeclaration TypeBody
+
+// Clause 8.2.5.6.2 Steps
+
+Step =
+ FeaturePrefix
+ 'step' FeatureDeclaration ValuePart?
+ TypeBody
+
+// Clause 8.2.5.7 Functions Concrete Syntax
+
+// Clause 8.2.5.7.1 Functions
+
+Function =
+ TypePrefix 'function'
+ ClassifierDeclaration FunctionBody
+
+FunctionBody : Type =
+ ';' | '{' FunctionBodyPart '}'
+
+FunctionBodyPart : Type =
+ ( TypeBodyElement
+ | ownedRelationship += ReturnFeatureMember
+ )*
+ ( ownedRelationship += ResultExpressionMember )?
+
+ReturnFeatureMember : ReturnParameterMembership =
+ MemberPrefix 'return'
+ ownedRelatedElement += FeatureElement
+
+ResultExpressionMember : ResultExpressionMembership =
+ MemberPrefix
+ ownedRelatedElement += OwnedExpression
+
+// Clause 8.2.5.7.2 Expressions
+
+Expression =
+ FeaturePrefix
+ 'expr' FeatureDeclaration ValuePart?
+ FunctionBody
+
+// Clause 8.2.5.7.3 Predicates
+
+Predicate =
+ TypePrefix 'predicate'
+ ClassifierDeclaration FunctionBody
+
+// Clause 8.2.5.7.4 Boolean Expressions and Invariants
+
+BooleanExpression =
+ FeaturePrefix
+ 'bool' FeatureDeclaration ValuePart?
+ FunctionBody
+
+Invariant =
+ FeaturePrefix
+ 'inv' ( 'true' | isNegated ?= 'false' )?
+ FeatureDeclaration ValuePart?
+ FunctionBody
+
+// Clause 8.2.5.8 Expressions Concrete Syntax
+
+// Clause 8.2.5.8.1 Operator Expressions
+
+OwnedExpressionReferenceMember : FeatureMembership =
+ ownedRelationship += OwnedExpressionReference
+
+OwnedExpressionReference : FeatureReferenceExpression =
+ ownedRelationship += OwnedExpressionMember
+
+OwnedExpressionMember : FeatureMembership =
+ ownedFeatureMember = OwnedExpression
+
+OwnedExpression : Expression =
+ ConditionalExpression
+ | ConditionalBinaryOperatorExpression
+ | BinaryOperatorExpression
+ | UnaryOperatorExpression
+ | ClassificationExpression
+ | MetaclassificationExpression
+ | ExtentExpression
+ | PrimaryExpression
+
+ConditionalExpression : OperatorExpression =
+ operator = 'if'
+ ownedRelationship += ArgumentMember '?'
+ ownedRelationship += ArgumentExpressionMember 'else'
+ ownedRelationship += ArgumentExpressionMember
+ ownedRelationship += EmptyResultMember
+
+ConditionalBinaryOperatorExpression : OperatorExpression =
+ ownedRelationship += ArgumentMember
+ operator = ConditionalBinaryOperator
+ ownedRelationship += ArgumentExpressionMember
+ ownedRelationship += EmptyResultMember
+
+ConditionalBinaryOperator =
+ '??' | 'or' | 'and' | 'implies'
+
+BinaryOperatorExpression : OperatorExpression =
+ ownedRelationship += ArgumentMember
+ operator = BinaryOperator
+ ownedRelationship += ArgumentMember
+ ownedRelationship += EmptyResultMember
+
+BinaryOperator =
+ '|' | '&' | 'xor' | '..'
+ | '==' | '!=' | '===' | '!=='
+ | '<' | '>' | '<=' | '>='
+ | '+' | '-' | '*' | '/'
+ | '%' | '^' | '**'
+
+UnaryOperatorExpression : OperatorExpression =
+ operator = UnaryOperator
+ ownedRelationship += ArgumentMember
+ ownedRelationship += EmptyResultMember
+
+UnaryOperator =
+ '+' | '-' | '~' | 'not'
+
+ClassificationExpression : OperatorExpression =
+ ( ownedRelationship += ArgumentMember )?
+ ( operator = ClassificationTestOperator
+ ownedRelationship += TypeReferenceMember
+ | operator = CastOperator
+ ownedRelationship += TypeResultMember
+ )
+ ownedRelationship += EmptyResultMember
+
+ClassificationTestOperator =
+ 'istype' | 'hastype' | '@'
+
+CastOperator =
+ 'as'
+
+MetaclassificationExpression : OperatorExpression =
+ ownedRelationship += MetadataArgumentMember
+ ( operator = ClassificationTestOperator
+ ownedRelationship += TypeReferenceMember
+ | operator = MetaCastOperator
+ ownedRelationship += TypeResultMember
+ )
+ ownedRelationship += EmptyResultMember
+
+ArgumentMember : ParameterMembership =
+ ownedMemberParameter = Argument
+
+Argument : Feature =
+ ownedRelationship += ArgumentValue
+
+ArgumentValue : FeatureValue =
+ value = OwnedExpression
+
+ArgumentExpressionMember : FeatureMembership =
+ ownedRelatedElement += ArgumentExpression
+
+ArgumentExpression : Feature =
+ ownedRelationship += ArgumentExpressionValue
+
+ArgumentExpressionValue : FeatureValue =
+ value = OwnedExpressionReference
+
+MetadataArgumentMember : ParameterMembership =
+ ownedRelatedElement += MetadataArgument
+
+MetadataArgument : Feature =
+ ownedRelationship += MetadataValue
+
+MetadataValue : FeatureValue =
+ value = MetadataReference
+
+MetadataReference : MetadataAccessExpression =
+ ownedRelationship += ElementReferenceMember
+
+MetaclassificationTestOperator =
+ '@@'
+
+MetaCastOperator =
+ 'meta'
+
+ExtentExpression : OperatorExpression =
+ operator = 'all'
+ ownedRelationship += TypeReferenceMember
+
+TypeReferenceMember : ParameterMembership =
+ ownedMemberFeature = TypeReference
+
+TypeResultMember : ResultParameterMembership =
+ ownedMemberFeature = TypeReference
+
+TypeReference : Feature =
+ ownedRelationship += ReferenceTyping
+
+ReferenceTyping : FeatureTyping =
+ type = [QualifiedName]
+
+EmptyResultMember : ReturnParameterMembership =
+ ownedRelatedElement += EmptyFeature
+
+EmptyFeature : Feature =
+ { }
+
+// Notes:
+// 1. OperatorExpressions provide a shorthand notation for InvocationExpressions that invoke a library Function represented as an operator symbol. Table 5 shows the mapping from operator symbols to the Functions they represent from the Kernel Model Library (see Clause 9). An OperatorExpression contains subexpressions called its operands that generally correspond to the argument Expressions of the OperatorExpression, except in the case of operators representing control Functions, in which case the evaluation of certain operands is as determined by the Function (see 8.4.4.9 for details).
+// 2. Though not directly expressed in the syntactic productions given above, in any OperatorExpression containing nested OperatorExpressions, the nested OperatorExpressions shall be implicitly grouped according to the precedence of the operators involved, as given in Table 6. OperatorExpressions with higher precedence operators shall be grouped more tightly than those with lower precedence operators. Further, all BinaryOperators other than exponentiation are left-associative (i.e, they group to the left), while the exponentiation operators (^ and **) are right-associative (i.e., they group to the right).
+// 3. The unary operator symbol ~ maps to the library Function DataFunctions::'~', as shown in Table 5. This abstract Function may be given a concrete definition in a domain-specific Function library, but no default definition is provided in the Kernel Functions Library. If no domain-specific definition is available, a tool should give a warning if this operator is used.
+
+// Clause 8.2.5.8.2 Primary Expressions
+
+PrimaryExpression : Expression =
+ FeatureChainExpression
+ | NonFeatureChainPrimaryExpression
+
+PrimaryArgumentValue : FeatureValue =
+ value = PrimaryExpression
+
+PrimaryArgument : Feature =
+ ownedRelationship += PrimaryArgumentValue
+
+PrimaryArgumentMember : ParameterMembership =
+ ownedMemberParameter = PrimaryArgument
+
+NonFeatureChainPrimaryExpression : Expression =
+ BracketExpression
+ | IndexExpression
+ | SequenceExpression
+ | SelectExpression
+ | CollectExpression
+ | FunctionOperationExpression
+ | BaseExpression
+
+NonFeatureChainPrimaryArgumentValue : FeatureValue =
+ value = NonFeatureChainPrimaryExpression
+
+NonFeatureChainPrimaryArgument : Feature =
+ ownedRelationship += NonFeatureChainPrimaryArgumentValue
+
+NonFeatureChainPrimaryArgumentMember : ParameterMembership =
+ ownedMemberParameter = PrimaryArgument
+
+BracketExpression : OperatorExpression =
+ ownedRelationship += PrimaryArgumentMember
+ operator = '['
+ ownedRelationship += SequenceExpressionListMember ']'
+
+IndexExpression =
+ ownedRelationship += PrimaryArgumentMember '#'
+ '(' ownedRelationship += SequenceExpressionListMember ')'
+
+SequenceExpression : Expression =
+ '(' SequenceExpressionList ')'
+
+SequenceExpressionList : Expression =
+ OwnedExpression ','? | SequenceOperatorExpression
+
+SequenceOperatorExpression : OperatorExpression =
+ ownedRelationship += OwnedExpressionMember
+ operator = ','
+ ownedRelationship += SequenceExpressionListMember
+
+SequenceExpressionListMember : FeatureMembership =
+ ownedMemberFeature = SequenceExpressionList
+
+FeatureChainExpression =
+ ownedRelationship += NonFeatureChainPrimaryArgumentMember '.'
+ ownedRelationship += FeatureChainMember
+
+CollectExpression =
+ ownedRelationship += PrimaryArgumentMember '.'
+ ownedRelationship += BodyArgumentMember
+
+SelectExpression =
+ ownedRelationship += PrimaryArgumentMember '.?'
+ ownedRelationship += BodyArgumentMember
+
+FunctionOperationExpression : InvocationExpression =
+ ownedRelationship += PrimaryArgumentMember '->'
+ ownedRelationship += InvocationTypeMember
+ ( ownedRelationship += BodyArgumentMember
+ | ownedRelationship += FunctionReferenceArgumentMember
+ | ArgumentList )
+ ownedRelationship += EmptyResultMember
+
+BodyArgumentMember : ParameterMembership =
+ ownedMemberParameter = BodyArgument
+
+BodyArgument : Feature =
+ ownedRelationship += BodyArgumentValue
+
+BodyArgumentValue : FeatureValue =
+ value = BodyExpression
+
+FunctionReferenceArgumentMember : ParameterMembership =
+ ownedMemberParameter = FunctionReferenceArgument
+
+FunctionReferenceArgument : Feature =
+ ownedRelationship += FunctionReferenceArgumentValue
+
+FunctionReferenceArgumentValue : FeatureValue =
+ value = FunctionReferenceExpression
+
+FunctionReferenceExpression : FeatureReferenceExpression =
+ ownedRelationship += FunctionReferenceMember
+
+FunctionReferenceMember : FeatureMembership =
+ ownedMemberFeature = FunctionReference
+
+FunctionReference : Expression =
+ ownedRelationship += ReferenceTyping
+
+FeatureChainMember : Membership =
+ FeatureReferenceMember
+ | OwnedFeatureChainMember
+
+OwnedFeatureChainMember : OwningMembership =
+ ownedMemberElement = FeatureChain
+
+// Notes:
+// 1. Primary expressions provide additional shorthand notations for certain kinds of InvocationExpressions. For those cases in which the InvocationExpression is an OperatorExpression, its operator shall be resolved to the appropriate library function as given in Table 7. Note also that, for a CollectionExpression or SelectExpression, the abstract syntax constrains the operator to be collect and select, respectively, separately from the . and .? symbols used in their concrete syntax notation (see 8.3.4.8.2 and 8.3.4.8.18).
+// 2. The grammar allows a bracket syntax [...]that parses to an invocation of the library Function BaseFunctions::'[', as shown in Table 7. This notation is available for use with domain-specific library models that given a concrete definition to the abstract base '[' Function, but no default definition is provided in the Kernel Functions Library. If no domain-specific definition is available, a tool should give a warning if this operator is used.
+
+// Clause 8.2.5.8.3 Base Expressions
+
+BaseExpression : Expression =
+ NullExpression
+ | LiteralExpression
+ | FeatureReferenceExpression
+ | MetadataAccessExpression
+ | InvocationExpression
+ | ConstructorExpression
+ | BodyExpression
+
+NullExpression : NullExpression =
+ 'null' | '(' ')'
+
+FeatureReferenceExpression : FeatureReferenceExpression =
+ ownedRelationship += FeatureReferenceMember
+ ownedRelationship += EmptyResultMember
+
+FeatureReferenceMember : Membership =
+ memberElement = FeatureReference
+
+FeatureReference : Feature =
+ [QualifiedName]
+
+MetadataAccessExpression =
+ ownedRelationship += ElementReferenceMember '.' 'metadata'
+
+ElementReferenceMember : Membership =
+ memberElement = [QualifiedName]
+
+InvocationExpression : InvocationExpression =
+ ownedRelationship += InstantiatedTypeMember
+ ArgumentList
+ ownedRelationship += EmptyResultMember
+
+ConstructorExpression =
+ 'new' ownedRelationship += InstantiatedTypeMember
+ ownedRelationship += ConstructorResultMember
+
+ConstructorResultMember : ReturnParameterMembership =
+ ownedRelatedElement += ConstructorResult
+
+ConstructorResult : Feature =
+ ArgumentList
+
+InstantiatedTypeMember : Membership =
+ memberElement = InstantiatedTypeReference
+ | OwnedFeatureChainMember
+
+InstantiatedTypeReference : Type =
+ [QualifiedName]
+
+ArgumentList : Feature =
+ '(' ( PositionalArgumentList | NamedArgumentList )? ')'
+
+PositionalArgumentList : Feature =
+ e.ownedRelationship += ArgumentMember
+ ( ',' e.ownedRelationship += ArgumentMember )*
+
+NamedArgumentList : Feature =
+ ownedRelationship += NamedArgumentMember
+ ( ',' ownedRelationship += NamedArgumentMember )*
+
+NamedArgumentMember : FeatureMembership =
+ ownedMemberFeature = NamedArgument
+
+NamedArgument : Feature =
+ ownedRelationship += ParameterRedefinition '='
+ ownedRelationship += ArgumentValue
+
+ParameterRedefinition : Redefinition =
+ redefinedFeature = [QualifiedName]
+
+BodyExpression : FeatureReferenceExpression =
+ ownedRelationship += ExpressionBodyMember
+
+ExpressionBodyMember : FeatureMembership =
+ ownedMemberFeature = ExpressionBody
+
+ExpressionBody : Expression =
+ '{' FunctionBodyPart '}'
+
+// Clause 8.2.5.8.4 Literal Expressions
+
+LiteralExpression =
+ LiteralBoolean
+ | LiteralString
+ | LiteralInteger
+ | LiteralReal
+ | LiteralInfinity
+
+LiteralBoolean =
+ value = BooleanValue
+
+BooleanValue : Boolean =
+ 'true' | 'false'
+
+LiteralString =
+ value = STRING_VALUE
+
+LiteralInteger =
+ value = DECIMAL_VALUE
+
+LiteralReal =
+ value = RealValue
+
+RealValue : Real =
+ DECIMAL_VALUE? '.' ( DECIMAL_VALUE | EXPONENTIAL_VALUE )
+ | EXPONENTIAL_VALUE
+
+LiteralInfinity =
+ '*'
+
+// Clause 8.2.5.9 Interactions Concrete Syntax
+
+// Clause 8.2.5.9.1 Interactions
+
+Interaction =
+ TypePrefix 'interaction'
+ ClassifierDeclaration TypeBody
+
+// Clause 8.2.5.9.2 Flows
+
+Flow =
+ FeaturePrefix 'flow'
+ FlowDeclaration TypeBody
+
+SuccessionFlow =
+ FeaturePrefix 'succession' 'flow'
+ FlowDeclaration TypeBody
+
+FlowDeclaration : Flow =
+ FeatureDeclaration ValuePart?
+ ( 'of' ownedRelationship += PayloadFeatureMember )?
+ ( 'from' ownedRelationship += FlowEndMember
+ 'to' ownedRelationship += FlowEndMember )?
+ | ( isSufficient ?= 'all' )?
+ ownedRelationship += FlowEndMember 'to'
+ ownedRelationship += FlowEndMember
+
+PayloadFeatureMember : FeatureMembership =
+ ownedRelatedElement = PayloadFeature
+
+PayloadFeature =
+ Identification PayloadFeatureSpecializationPart ValuePart?
+ | Identification ValuePart
+ | ownedRelationship += OwnedFeatureTyping
+ ( ownedRelationship += OwnedMultiplicity )?
+ | ownedRelationship += OwnedMultiplicity
+ ( ownedRelationship += OwnedFeatureTyping )?
+
+PayloadFeatureSpecializationPart : Feature =
+ FeatureSpecialization+ MultiplicityPart?
+ FeatureSpecialization*
+ | MultiplicityPart FeatureSpecialization+
+
+FlowEndMember : EndFeatureMembership =
+ ownedRelatedElement += FlowEnd
+
+FlowEnd =
+ ( ownedRelationship += OwnedReferenceSubsetting '.' )?
+ ownedRelationship += FlowFeatureMember
+
+FlowFeatureMember : FeatureMembership =
+ ownedRelatedElement += FlowFeature
+
+FlowFeature : Feature =
+ ownedRelationship += FlowFeatureRedefinition
+
+// (See Note 1)
+
+FlowFeatureRedefinition : Redefinition =
+ redefinedFeature = [QualifiedName]
+
+// Notes:
+// 1. To ensure that an FlowFeature passes the validateRedefinitionDirectionConformance constraint (see 8.3.3.3.8), its direction must be set to the direction of its redefinedFeature, relative to its owning FlowEnd, that is, the result of the following OCL expression: owningType.directionOf(ownedRedefinition->at(1).redefinedFeature)
+
+// Clause 8.2.5.10 Feature Values Concrete Syntax
+
+ValuePart : Feature =
+ ownedRelationship += FeatureValue
+
+FeatureValue =
+ ( '='
+ | isInitial ?= ':='
+ | isDefault ?= 'default' ( '=' | isInitial ?= ':=' )?
+ )
+ ownedRelatedElement += OwnedExpression
+
+// Clause 8.2.5.11 Multiplicities Concrete Syntax
+
+Multiplicity =
+ MultiplicitySubset | MultiplicityRange
+
+MultiplicitySubset : Multiplicity =
+ 'multiplicity' Identification Subsets
+ TypeBody
+
+MultiplicityRange =
+ 'multiplicity' Identification MultiplicityBounds
+ TypeBody
+
+OwnedMultiplicity : OwningMembership =
+ ownedRelatedElement += OwnedMultiplicityRange
+
+OwnedMultiplicityRange : MultiplicityRange =
+ MultiplicityBounds
+
+MultiplicityBounds : MultiplicityRange =
+ '[' ( ownedRelationship += MultiplicityExpressionMember '..' )?
+ ownedRelationship += MultiplicityExpressionMember ']'
+
+MultiplicityExpressionMember : OwningMembership =
+ ownedRelatedElement += ( LiteralExpression | FeatureReferenceExpression )
+
+// Clause 8.2.5.12 Metadata Concrete Syntax
+
+Metaclass =
+ TypePrefix 'metaclass'
+ ClassifierDeclaration TypeBody
+
+PrefixMetadataAnnotation : Annotation =
+ '#' ownedRelatedElement += PrefixMetadataFeature
+
+PrefixMetadataMember : OwningMembership =
+ '#' ownedRelatedElement += PrefixMetadataFeature
+
+PrefixMetadataFeature : MetadataFeature =
+ ownedRelationship += OwnedFeatureTyping
+
+MetadataFeature =
+ ( ownedRelationship += PrefixMetadataMember )*
+ ( '@' | 'metadata' )
+ MetadataFeatureDeclaration
+ ( 'about' ownedRelationship += Annotation
+ ( ',' ownedRelationship += Annotation )*
+ )?
+ MetadataBody
+
+MetadataFeatureDeclaration : MetadataFeature =
+ ( Identification ( ':' | 'typed' 'by' ) )?
+ ownedRelationship += OwnedFeatureTyping
+
+MetadataBody : Feature =
+ ';' | '{' ( ownedRelationship += MetadataBodyElement )* '}'
+
+MetadataBodyElement : Membership =
+ NonFeatureMember
+ | MetadataBodyFeatureMember
+ | AliasMember
+ | Import
+
+MetadataBodyFeatureMember : FeatureMembership =
+ ownedMemberFeature = MetadataBodyFeature
+
+MetadataBodyFeature : Feature =
+ 'feature'? ( ':>>' | 'redefines')? ownedRelationship += OwnedRedefinition
+ FeatureSpecializationPart? ValuePart?
+ MetadataBody
+
+// Clause 8.2.5.13 Packages Concrete Syntax
+
+Package =
+ ( ownedRelationship += PrefixMetadataMember )*
+ PackageDeclaration PackageBody
+
+LibraryPackage =
+ ( isStandard ?= 'standard' ) 'library'
+ ( ownedRelationship += PrefixMetadataMember )*
+ PackageDeclaration PackageBody
+
+PackageDeclaration : Package =
+ 'package' Identification
+
+PackageBody : Package =
+ ';'
+ | '{' ( NamespaceBodyElement
+ | ownedRelationship += ElementFilterMember
+ )*
+ '}'
+
+ElementFilterMember : ElementFilterMembership =
+ MemberPrefix
+ 'filter' condition = OwnedExpression ';'
+
+// End of BNF
+
+
diff --git a/Resources/SysML-textual-bnf.kebnf b/Resources/SysML-textual-bnf.kebnf
new file mode 100644
index 000000000..e5c771e9e
--- /dev/null
+++ b/Resources/SysML-textual-bnf.kebnf
@@ -0,0 +1,1705 @@
+// Manual corrections by HP de Koning
+
+// Part 2 - Systems Modeling Language (SysML)
+
+// Clause 8.2.2 Textual Notation
+
+// Clause 8.2.2.1 Textual Notation Overview
+
+// Clause 8.2.2.1.1 EBNF Conventions
+
+// Clause 8.2.2.1.2 Lexical Structure
+
+RESERVED_KEYWORD =
+ 'about' | 'abstract' | 'accept' | 'action' | 'actor' | 'after' | 'alias' | 'all' | 'allocate' | 'allocation'
+ | 'analysis' | 'and' | 'as' | 'assert' | 'assign' | 'assume' | 'at' | 'attribute' | 'bind' | 'binding' | 'by' | 'calc'
+ | 'case' | 'comment' | 'concern' | 'connect' | 'connection' | 'constant' | 'constraint' | 'crosses' | 'decide'
+ | 'def' | 'default' | 'defined' | 'dependency' | 'derived' | 'do' | 'doc' | 'else' | 'end' | 'entry' | 'enum'
+ | 'event' | 'exhibit' | 'exit' | 'expose' | 'false' | 'filter' | 'first' | 'flow' | 'for' | 'fork' | 'frame' | 'from'
+ | 'hastype' | 'if' | 'implies' | 'import' | 'in' | 'include' | 'individual' | 'inout' | 'interface' | 'istype'
+ | 'item' | 'join' | 'language' | 'library' | 'locale' | 'loop' | 'merge' | 'message' | 'meta' | 'metadata'
+ | 'nonunique' | 'not' | 'null' | 'objective' | 'occurrence' | 'of' | 'or' | 'ordered' | 'out' | 'package' | 'parallel'
+ | 'part' | 'perform' | 'port' | 'private' | 'protected' | 'public' | 'redefines' | 'ref' | 'references' | 'render'
+ | 'rendering' | 'rep' | 'require' | 'requirement' | 'return' | 'satisfy' | 'send' | 'snapshot' | 'specializes'
+ | 'stakeholder' | 'standard' | 'state' | 'subject' | 'subsets' | 'succession' | 'terminate' | 'then' | 'timeslice'
+ | 'to' | 'transition' | 'true' | 'until' | 'use' | 'variant' | 'variation' | 'verification' | 'verify' | 'via'
+ | 'view' | 'viewpoint' | 'when' | 'while' | 'xor'
+
+DEFINED_BY = ':' | 'defined' 'by'
+
+SPECIALIZES = ':>' | 'specializes'
+
+SUBSETS = ':>' | 'subsets'
+
+REFERENCES = '::>' | 'references'
+
+CROSSES = '=>' | 'crosses'
+
+REDEFINES = ':>>' | 'redefines'
+
+// Clause 8.2.2.2 Elements and Relationships Textual Notation
+
+Identification : Element =
+ ( '<' declaredShortName = NAME '>' )?
+ ( declaredName = NAME )?
+
+RelationshipBody : Relationship =
+ ';' | '{' ( ownedRelationship += OwnedAnnotation )* '}'
+
+// Clause 8.2.2.3 Dependencies Textual Notation
+
+Dependency =
+ ( ownedRelationship += PrefixMetadataAnnotation )*
+ 'dependency' DependencyDeclaration
+ RelationshipBody
+
+DependencyDeclaration =
+ ( Identification 'from' )?
+ client += [QualifiedName] ( ',' client += [QualifiedName] )* 'to'
+ supplier += [QualifiedName] ( ',' supplier += [QualifiedName] )*
+
+// Clause 8.2.2.4 Annotations Textual Notation
+
+// Clause 8.2.2.4.1 Annotations
+
+Annotation =
+ annotatedElement = [QualifiedName]
+
+OwnedAnnotation : Annotation =
+ ownedRelatedElement += AnnotatingElement
+
+AnnotatingMember : OwningMembership =
+ ownedRelatedElement += AnnotatingElement
+
+AnnotatingElement =
+ Comment
+ | Documentation
+ | TextualRepresentation
+ | MetadataFeature
+
+// Clause 8.2.2.4.2 Comments and Documentation
+
+Comment =
+ ( 'comment' Identification
+ ( 'about' ownedRelationship += Annotation
+ ( ',' ownedRelationship += Annotation )*
+ )?
+ )?
+ ( 'locale' locale = STRING_VALUE )?
+ body = REGULAR_COMMENT
+
+Documentation =
+ 'doc' Identification
+ ( 'locale' locale = STRING_VALUE )?
+ body = REGULAR_COMMENT
+
+// Clause 8.2.2.4.3 Textual Representation
+
+TextualRepresentation =
+ ( 'rep' Identification )?
+ 'language' language = STRING_VALUE body = REGULAR_COMMENT
+
+// Clause 8.2.2.5 Namespaces and Packages Textual Notation
+
+// Clause 8.2.2.5.1 Packages
+
+RootNamespace : Namespace =
+ PackageBodyElement*
+
+Package =
+ ( ownedRelationship += PrefixMetadataMember )*
+ PackageDeclaration PackageBody
+
+LibraryPackage =
+ ( isStandard ?= 'standard' ) 'library'
+ ( ownedRelationship += PrefixMetadataMember )*
+ PackageDeclaration PackageBody
+
+PackageDeclaration : Package =
+ 'package' Identification
+
+PackageBody : Package =
+ ';' | '{' PackageBodyElement* '}'
+
+PackageBodyElement : Package =
+ ownedRelationship += PackageMember
+ | ownedRelationship += ElementFilterMember
+ | ownedRelationship += AliasMember
+ | ownedRelationship += Import
+
+MemberPrefix : Membership =
+ ( visibility = VisibilityIndicator )?
+
+PackageMember : OwningMembership =
+ MemberPrefix
+ ( ownedRelatedElement += DefinitionElement
+ | ownedRelatedElement = UsageElement )
+
+ElementFilterMember : ElementFilterMembership =
+ MemberPrefix
+ 'filter' ownedRelatedElement += OwnedExpression ';'
+
+AliasMember : Membership =
+ MemberPrefix
+ 'alias' ( '<' memberShortName = NAME '>' )?
+ ( memberName = NAME )?
+ 'for' memberElement = [QualifiedName]
+ RelationshipBody
+
+Import =
+ visibility = VisibilityIndicator
+ 'import' ( isImportAll ?= 'all' )?
+ ImportDeclaration
+ RelationshipBody
+
+ImportDeclaration : Import =
+ MembershipImport | NamespaceImport
+
+MembershipImport =
+ importedMembership = [QualifiedName]
+ ( '::' isRecursive ?= '**' )?
+
+NamespaceImport =
+ importedNamespace = [QualifiedName] '::' '*'
+ ( '::' isRecursive ?= '**' )?
+ | importedNamespace = FilterPackage
+ { ownedRelatedElement += importedNamespace }
+
+FilterPackage : Package =
+ ownedRelationship += FilterPackageImport
+ ( ownedRelationship += FilterPackageMember )+
+
+FilterPackageMember : ElementFilterMembership =
+ '[' ownedRelatedElement += OwnedExpression ']'
+
+VisibilityIndicator : VisibilityKind =
+ 'public' | 'private' | 'protected'
+
+// Clause 8.2.2.5.2 Package Elements
+
+DefinitionElement : Element =
+ Package
+ | LibraryPackage
+ | AnnotatingElement
+ | Dependency
+ | AttributeDefinition
+ | EnumerationDefinition
+ | OccurrenceDefinition
+ | IndividualDefinition
+ | ItemDefinition
+ | PartDefinition
+ | ConnectionDefinition
+ | FlowDefinition
+ | InterfaceDefinition
+ | PortDefinition
+ | ActionDefinition
+ | CalculationDefinition
+ | StateDefinition
+ | ConstraintDefinition
+ | RequirementDefinition
+ | ConcernDefinition
+ | CaseDefinition
+ | AnalysisCaseDefinition
+ | VerificationCaseDefinition
+ | UseCaseDefinition
+ | ViewDefinition
+ | ViewpointDefinition
+ | RenderingDefinition
+ | MetadataDefinition
+ | ExtendedDefinition
+
+UsageElement : Usage =
+ NonOccurrenceUsageElement
+ | OccurrenceUsageElement
+
+// Clause 8.2.2.6 Definition and Usage Textual Notation
+
+// Clause 8.2.2.6.1 Definitions
+
+BasicDefinitionPrefix =
+ isAbstract ?= 'abstract' | isVariation ?= 'variation'
+
+DefinitionExtensionKeyword : Definition =
+ ownedRelationship += PrefixMetadataMember
+
+DefinitionPrefix : Definition =
+ BasicDefinitionPrefix? DefinitionExtensionKeyword*
+
+Definition =
+ DefinitionDeclaration DefinitionBody
+
+DefinitionDeclaration : Definition =
+ Identification SubclassificationPart?
+
+DefinitionBody : Type =
+ ';' | '{' DefinitionBodyItem* '}'
+
+DefinitionBodyItem : Type =
+ ownedRelationship += DefinitionMember
+ | ownedRelationship += VariantUsageMember
+ | ownedRelationship += NonOccurrenceUsageMember
+ | ( ownedRelationship += SourceSuccessionMember )?
+ ownedRelationship += OccurrenceUsageMember
+ | ownedRelationship += AliasMember
+ | ownedRelationship += Import
+
+DefinitionMember : OwningMembership =
+ MemberPrefix
+ ownedRelatedElement += DefinitionElement
+
+VariantUsageMember : VariantMembership =
+ MemberPrefix 'variant'
+ ownedVariantUsage = VariantUsageElement
+
+NonOccurrenceUsageMember : FeatureMembership =
+ MemberPrefix
+ ownedRelatedElement += NonOccurrenceUsageElement
+
+OccurrenceUsageMember : FeatureMembership =
+ MemberPrefix
+ ownedRelatedElement += OccurrenceUsageElement
+
+StructureUsageMember : FeatureMembership =
+ MemberPrefix
+ ownedRelatedElement += StructureUsageElement
+
+BehaviorUsageMember : FeatureMembership =
+ MemberPrefix
+ ownedRelatedElement += BehaviorUsageElement
+
+// Clause 8.2.2.6.2 Usages
+
+FeatureDirection : FeatureDirectionKind =
+ 'in' | 'out' | 'inout'
+
+RefPrefix : Usage =
+ ( direction = FeatureDirection )?
+ ( isDerived ?= 'derived' )?
+ ( isAbstract ?= 'abstract' | isVariation ?= 'variation' )?
+ ( isConstant ?= 'constant' )?
+
+BasicUsagePrefix : Usage =
+ RefPrefix
+ ( isReference ?= 'ref' )?
+
+EndUsagePrefix : Usage =
+ isEnd ?= 'end' ( ownedRelationship += OwnedCrossFeatureMember )?
+
+// (See Note 1)
+
+OwnedCrossFeatureMember : OwningMembership =
+ ownedRelatedElement += OwnedCrossFeature
+
+OwnedCrossFeature : ReferenceUsage =
+ BasicUsagePrefix UsageDeclaration
+
+UsageExtensionKeyword : Usage =
+ ownedRelationship += PrefixMetadataMember
+
+UnextendedUsagePrefix : Usage =
+ EndUsagePrefix | BasicUsagePrefix
+
+UsagePrefix : Usage =
+ UnextendedUsagePrefix UsageExtensionKeyword*
+
+Usage =
+ UsageDeclaration UsageCompletion
+
+UsageDeclaration : Usage =
+ Identification FeatureSpecializationPart?
+
+UsageCompletion : Usage =
+ ValuePart? UsageBody
+
+UsageBody : Usage =
+ DefinitionBody
+
+ValuePart : Feature =
+ ownedRelationship += FeatureValue
+
+FeatureValue =
+ ( '='
+ | isInitial ?= ':='
+ | isDefault ?= 'default' ( '=' | isInitial ?= ':=' )?
+ )
+ ownedRelatedElement += OwnedExpression
+
+// Notes:
+// 1. A Usage parsed with isEnd = true for which mayTimeVary = true must also have isConstant set to true, even though this is not explicitly notated in the textual notation, in order to satisfy the KerML constraint checkFeatureEndIsConstant.
+
+// Clause 8.2.2.6.3 Reference Usages
+
+DefaultReferenceUsage : ReferenceUsage =
+ RefPrefix Usage
+
+ReferenceUsage =
+ ( EndUsagePrefix | RefPrefix )
+ 'ref' Usage
+
+VariantReference : ReferenceUsage =
+ ownedRelationship += OwnedReferenceSubsetting
+ FeatureSpecialization* UsageBody
+
+// Clause 8.2.2.6.4 Body Elements
+
+NonOccurrenceUsageElement : Usage =
+ DefaultReferenceUsage
+ | ReferenceUsage
+ | AttributeUsage
+ | EnumerationUsage
+ | BindingConnectorAsUsage
+ | SuccessionAsUsage
+ | ExtendedUsage
+
+OccurrenceUsageElement : Usage =
+ StructureUsageElement | BehaviorUsageElement
+
+StructureUsageElement : Usage =
+ OccurrenceUsage
+ | IndividualUsage
+ | PortionUsage
+ | EventOccurrenceUsage
+ | ItemUsage
+ | PartUsage
+ | ViewUsage
+ | RenderingUsage
+ | PortUsage
+ | ConnectionUsage
+ | InterfaceUsage
+ | AllocationUsage
+ | Message
+ | FlowUsage
+ | SuccessionFlowUsage
+
+BehaviorUsageElement : Usage =
+ ActionUsage
+ | CalculationUsage
+ | StateUsage
+ | ConstraintUsage
+ | RequirementUsage
+ | ConcernUsage
+ | CaseUsage
+ | AnalysisCaseUsage
+ | VerificationCaseUsage
+ | UseCaseUsage
+ | ViewpointUsage
+ | PerformActionUsage
+ | ExhibitStateUsage
+ | IncludeUseCaseUsage
+ | AssertConstraintUsage
+ | SatisfyRequirementUsage
+
+VariantUsageElement : Usage =
+ VariantReference
+ | ReferenceUsage
+ | AttributeUsage
+ | BindingConnectorAsUsage
+ | SuccessionAsUsage
+ | OccurrenceUsage
+ | IndividualUsage
+ | PortionUsage
+ | EventOccurrenceUsage
+ | ItemUsage
+ | PartUsage
+ | ViewUsage
+ | RenderingUsage
+ | PortUsage
+ | ConnectionUsage
+ | InterfaceUsage
+ | AllocationUsage
+ | Message
+ | FlowUsage
+ | SuccessionFlowUsage
+ | BehaviorUsageElement
+
+// Clause 8.2.2.6.5 Specialization
+
+SubclassificationPart : Classifier =
+ SPECIALIZES ownedRelationship += OwnedSubclassification
+ ( ',' ownedRelationship += OwnedSubclassification )*
+
+OwnedSubclassification : Subclassification =
+ superClassifier = [QualifiedName]
+
+FeatureSpecializationPart : Feature =
+ FeatureSpecialization+ MultiplicityPart? FeatureSpecialization*
+ | MultiplicityPart FeatureSpecialization*
+
+FeatureSpecialization : Feature =
+ Typings | Subsettings | References | Crosses | Redefinitions
+
+Typings : Feature =
+ TypedBy ( ',' ownedRelationship += FeatureTyping )*
+
+TypedBy : Feature =
+ DEFINED_BY ownedRelationship += FeatureTyping
+
+FeatureTyping =
+ OwnedFeatureTyping | ConjugatedPortTyping
+
+OwnedFeatureTyping : FeatureTyping =
+ type = [QualifiedName]
+ | type = OwnedFeatureChain
+ { ownedRelatedElement += type }
+
+Subsettings : Feature =
+ Subsets ( ',' ownedRelationship += OwnedSubsetting )*
+
+Subsets : Feature =
+ SUBSETS ownedRelationship += OwnedSubsetting
+
+OwnedSubsetting : Subsetting =
+ subsettedFeature = [QualifiedName]
+ | subsettedFeature = OwnedFeatureChain
+ { ownedRelatedElement += subsettedFeature }
+
+References : Feature =
+ REFERENCES ownedRelationship += OwnedReferenceSubsetting
+
+OwnedReferenceSubsetting : ReferenceSubsetting =
+ referencedFeature = [QualifiedName]
+ | referencedFeature = OwnedFeatureChain
+ { ownedRelatedElement += referenceFeature }
+
+Crosses : Feature =
+ CROSSES ownedRelationship += OwnedCrossSubsetting
+
+OwnedCrossSubsetting : CrossSubsetting =
+ crossedFeature = [QualifiedName]
+ | crossedFeature = OwnedFeatureChain
+ { ownedRelatedElement += crossedFeature }
+
+Redefinitions : Feature =
+ Redefines ( ',' ownedRelationship += OwnedRedefinition )*
+
+Redefines : Feature =
+ REDEFINES ownedRelationship += OwnedRedefinition
+
+OwnedRedefinition : Redefinition =
+ redefinedFeature = [QualifiedName]
+ | redefinedFeature = OwnedFeatureChain
+ { ownedRelatedElement += redefinedFeature }
+
+OwnedFeatureChain : Feature =
+ ownedRelationship += OwnedFeatureChaining
+ ( '.' ownedRelationship += OwnedFeatureChaining )+
+
+OwnedFeatureChaining : FeatureChaining =
+ chainingFeature = [QualifiedName]
+
+// Clause 8.2.2.6.6 Multiplicity
+
+MultiplicityPart : Feature =
+ ownedRelationship += OwnedMultiplicity
+ | ( ownedRelationship += OwnedMultiplicity )?
+ ( isOrdered ?= 'ordered' ( { isUnique = false } 'nonunique' )?
+ | { isUnique = false } 'nonunique' ( isOrdered ?= 'ordered' )? )
+
+OwnedMultiplicity : OwningMembership =
+ ownedRelatedElement += MultiplicityRange
+
+MultiplicityRange =
+ '[' ( ownedRelationship += MultiplicityExpressionMember '..' )?
+ ownedRelationship += MultiplicityExpressionMember ']'
+
+MultiplicityExpressionMember : OwningMembership =
+ ownedRelatedElement += ( LiteralExpression | FeatureReferenceExpression )
+
+// Clause 8.2.2.7 Attributes Textual Notation
+
+AttributeDefinition : AttributeDefinition =
+ DefinitionPrefix 'attribute' 'def' Definition
+
+AttributeUsage : AttributeUsage =
+ UsagePrefix 'attribute' Usage
+
+// Clause 8.2.2.8 Enumerations Textual Notation
+
+EnumerationDefinition =
+ DefinitionExtensionKeyword*
+ 'enum' 'def' DefinitionDeclaration EnumerationBody
+
+EnumerationBody : EnumerationDefinition =
+ ';'
+ | '{' ( ownedRelationship += AnnotatingMember
+ | ownedRelationship += EnumerationUsageMember )*
+ '}'
+
+EnumerationUsageMember : VariantMembership =
+ MemberPrefix ownedRelatedElement += EnumeratedValue
+
+EnumeratedValue : EnumerationUsage =
+ 'enum'? Usage
+
+EnumerationUsage : EnumerationUsage =
+ UsagePrefix 'enum' Usage
+
+// Clause 8.2.2.9 Occurrences Textual Notation
+
+// Clause 8.2.2.9.1 Occurrence Definitions
+
+OccurrenceDefinitionPrefix : OccurrenceDefinition =
+ BasicDefinitionPrefix?
+ ( isIndividual ?= 'individual'
+ ownedRelationship += EmptyMultiplicityMember
+ )?
+ DefinitionExtensionKeyword*
+
+OccurrenceDefinition =
+ OccurrenceDefinitionPrefix 'occurrence' 'def' Definition
+
+IndividualDefinition : OccurrenceDefinition =
+ BasicDefinitionPrefix? isIndividual ?= 'individual'
+ DefinitionExtensionKeyword* 'def' Definition
+ ownedRelationship += EmptyMultiplicityMember
+
+EmptyMultiplicityMember : OwningMembership =
+ ownedRelatedElement += EmptyMultiplicity
+
+EmptyMultiplicity : Multiplicity =
+ { }
+
+// Clause 8.2.2.9.2 Occurrence Usages
+
+OccurrenceUsagePrefix : OccurrenceUsage =
+ BasicUsagePrefix
+ ( isIndividual ?= 'individual' )?
+ ( portionKind = PortionKind
+ { isPortion = true }
+ )?
+ UsageExtensionKeyword*
+
+OccurrenceUsage =
+ OccurrenceUsagePrefix 'occurrence' Usage
+
+IndividualUsage : OccurrenceUsage =
+ BasicUsagePrefix isIndividual ?= 'individual'
+ UsageExtensionKeyword* Usage
+
+PortionUsage : OccurrenceUsage =
+ BasicUsagePrefix ( isIndividual ?= 'individual' )?
+ portionKind = PortionKind
+ UsageExtensionKeyword* Usage
+ { isPortion = true }
+
+PortionKind =
+ 'snapshot' | 'timeslice'
+
+EventOccurrenceUsage =
+ OccurrenceUsagePrefix 'event'
+ ( ownedRelationship += OwnedReferenceSubsetting
+ FeatureSpecializationPart?
+ | 'occurrence' UsageDeclaration? )
+ UsageCompletion
+
+// Clause 8.2.2.9.3 Occurrence Successions
+
+SourceSuccessionMember : FeatureMembership =
+ 'then' ownedRelatedElement += SourceSuccession
+
+SourceSuccession : SuccessionAsUsage =
+ ownedRelationship += SourceEndMember
+
+SourceEndMember : EndFeatureMembership =
+ ownedRelatedElement += SourceEnd
+
+SourceEnd : ReferenceUsage =
+ ( ownedRelationship += OwnedMultiplicity )?
+
+// Clause 8.2.2.10 Items Textual Notation
+
+ItemDefinition =
+ OccurrenceDefinitionPrefix
+ 'item' 'def' Definition
+
+ItemUsage =
+ OccurrenceUsagePrefix 'item' Usage
+
+// Clause 8.2.2.11 Parts Textual Notation
+
+PartDefinition =
+ OccurrenceDefinitionPrefix 'part' 'def' Definition
+
+PartUsage =
+ OccurrenceUsagePrefix 'part' Usage
+
+// Clause 8.2.2.12 Ports Textual Notation
+
+PortDefinition =
+ DefinitionPrefix 'port' 'def' Definition
+ ownedRelationship += ConjugatedPortDefinitionMember
+ { conjugatedPortDefinition.ownedPortConjugator.
+ originalPortDefinition = this }
+
+// (See Note 1)
+
+ConjugatedPortDefinitionMember : OwningMembership =
+ ownedRelatedElement += ConjugatedPortDefinition
+
+ConjugatedPortDefinition =
+ ownedRelationship += PortConjugation
+
+PortConjugation =
+ {}
+
+PortUsage =
+ OccurrenceUsagePrefix 'port' Usage
+
+ConjugatedPortTyping : ConjugatedPortTyping =
+ '~' originalPortDefinition = ~[QualifiedName]
+
+// (See Note 2)
+
+// Notes:
+// 1. Even though it is not explicitly represented in the text, a PortDefinition is always parsed as containing a nested ConjugatedPortDefinition with a PortDefinition Relationship pointing back to the containing PortDefinition. The abstract syntax for ConjugatedPortDefinition sets its effectiveName to the name of its originalPortDefinition with the symbol ~ prepended to it (see 8.3.12.2). (See also 8.4.8.1.)
+// 2. The notation ~[QualifiedName] indicates that a QualifiedName shall be parsed from the input text, but that it shall be resolved as if it was the qualified name constructed as follows:
+// • Extract the last segment name of the given QualifiedName and prepend the symbol ~ to it.
+// • Append the name so constructed to the end of the entire original QualifiedName.
+// For example, if the ConjugatedPortTyping is ~A::B::C, then the given QualifiedName is A::B::C, and ~[QualifiedName] is resolved as A::B::C::'~C'. Alternatively, a conforming tool may first resolve the given QualifiedName as usual to a PortDefinition and then use the conjugatedPortDefinition of this PortDefinition as the resolution of ~[QualifiedName].
+
+// Clause 8.2.2.13 Connections Textual Notation
+
+// Clause 8.2.2.13.1 Connection Definition and Usage
+
+ConnectionDefinition =
+ OccurrenceDefinitionPrefix 'connection' 'def' Definition
+
+ConnectionUsage =
+ OccurrenceUsagePrefix
+ ( 'connection' UsageDeclaration ValuePart?
+ ( 'connect' ConnectorPart )?
+ | 'connect' ConnectorPart )
+ UsageBody
+
+ConnectorPart : ConnectionUsage =
+ BinaryConnectorPart | NaryConnectorPart
+
+BinaryConnectorPart : ConnectionUsage =
+ ownedRelationship += ConnectorEndMember 'to'
+ ownedRelationship += ConnectorEndMember
+
+NaryConnectorPart : ConnectionUsage =
+ '(' ownedRelationship += ConnectorEndMember ','
+ ownedRelationship += ConnectorEndMember
+ ( ',' ownedRelationship += ConnectorEndMember )* ')'
+
+ConnectorEndMember : EndFeatureMembership =
+ ownedRelatedElement += ConnectorEnd
+
+ConnectorEnd : ReferenceUsage =
+ ( ownedRelationship += OwnedCrossMultiplicityMember )?
+ ( declaredName = NAME REFERENCES )?
+ ownedRelationship += OwnedReferenceSubsetting
+
+OwnedCrossMultiplicityMember : OwningMembership =
+ ownedRelatedElement += OwnedCrossMultiplicity
+
+OwnedCrossMultiplicity : Feature =
+ ownedRelationship += OwnedMultiplicity
+
+// Clause 8.2.2.13.2 Binding Connectors
+
+BindingConnectorAsUsage =
+ UsagePrefix ( 'binding' UsageDeclaration )?
+ 'bind' ownedRelationship += ConnectorEndMember
+ '=' ownedRelationship += ConnectorEndMember
+ UsageBody
+
+// Clause 8.2.2.13.3 Successions
+
+SuccessionAsUsage =
+ UsagePrefix ( 'succession' UsageDeclaration )?
+ 'first' s.ownedRelationship += ConnectorEndMember
+ 'then' s.ownedRelationship += ConnectorEndMember
+ UsageBody
+
+// Clause 8.2.2.14 Interfaces Textual Notation
+
+// Clause 8.2.2.14.1 Interface Definitions
+
+InterfaceDefinition =
+ OccurrenceDefinitionPrefix 'interface' 'def'
+ DefinitionDeclaration InterfaceBody
+
+InterfaceBody : Type =
+ ';' | '{' InterfaceBodyItem* '}'
+
+InterfaceBodyItem : Type =
+ ownedRelationship += DefinitionMember
+ | ownedRelationship += VariantUsageMember
+ | ownedRelationship += InterfaceNonOccurrenceUsageMember
+ | ( ownedRelationship += SourceSuccessionMember )?
+ ownedRelationship += InterfaceOccurrenceUsageMember
+ | ownedRelationship += AliasMember
+ | ownedRelationship += Import
+
+InterfaceNonOccurrenceUsageMember : FeatureMembership =
+ MemberPrefix ownedRelatedElement += InterfaceNonOccurrenceUsageElement
+
+InterfaceNonOccurrenceUsageElement : Usage =
+ ReferenceUsage
+ | AttributeUsage
+ | EnumerationUsage
+ | BindingConnectorAsUsage
+ | SuccessionAsUsage
+
+InterfaceOccurrenceUsageMember : FeatureMembership =
+ MemberPrefix ownedRelatedElement += InterfaceOccurrenceUsageElement
+
+InterfaceOccurrenceUsageElement : Usage =
+ DefaultInterfaceEnd | StructureUsageElement | BehaviorUsageElement
+
+DefaultInterfaceEnd : PortUsage =
+ isEnd ?= 'end' Usage
+
+// Clause 8.2.2.14.2 Interface Usages
+
+InterfaceUsage =
+ OccurrenceUsagePrefix 'interface'
+ InterfaceUsageDeclaration InterfaceBody
+
+InterfaceUsageDeclaration : InterfaceUsage =
+ UsageDeclaration ValuePart?
+ ( 'connect' InterfacePart )?
+ | InterfacePart
+
+InterfacePart : InterfaceUsage =
+ BinaryInterfacePart | NaryInterfacePart
+
+BinaryInterfacePart : InterfaceUsage =
+ ownedRelationship += InterfaceEndMember 'to'
+ ownedRelationship += InterfaceEndMember
+
+NaryInterfacePart : InterfaceUsage =
+ '(' ownedRelationship += InterfaceEndMember ','
+ ownedRelationship += InterfaceEndMember
+ ( ',' ownedRelationship += InterfaceEndMember )* ')'
+
+InterfaceEndMember : EndFeatureMembership =
+ ownedRelatedElement += InterfaceEnd
+
+InterfaceEnd : PortUsage =
+ ( ownedRelationship += OwnedCrossMultiplicityMember )?
+ ( declaredName = NAME REFERENCES )?
+ ownedRelationship += OwnedReferenceSubsetting
+
+// Clause 8.2.2.15 Allocations Textual Notation
+
+AllocationDefinition =
+ OccurrenceDefinitionPrefix 'allocation' 'def' Definition
+
+AllocationUsage =
+ OccurrenceUsagePrefix
+ AllocationUsageDeclaration UsageBody
+
+AllocationUsageDeclaration : AllocationUsage =
+ 'allocation' UsageDeclaration
+ ( 'allocate' ConnectorPart )?
+ | 'allocate' ConnectorPart
+
+// Clause 8.2.2.16 Flows Textual Notation
+
+FlowDefinition =
+ OccurrenceDefinitionPrefix 'flow' 'def' Definition
+
+Message : FlowUsage =
+ OccurrenceUsagePrefix 'message'
+ MessageDeclaration DefinitionBody
+ { isAbstract = true }
+
+MessageDeclaration : FlowUsage =
+ UsageDeclaration ValuePart?
+ ( 'of' ownedRelationship += FlowPayloadFeatureMember )?
+ ( 'from' ownedRelationship += MessageEventMember
+ 'to' ownedRelationship += MessageEventMember
+ )?
+ | ownedRelationship += MessageEventMember 'to'
+ ownedRelationship += MessageEventMember
+
+MessageEventMember : ParameterMembership =
+ ownedRelatedElement += MessageEvent
+
+MessageEvent : EventOccurrenceUsage =
+ ownedRelationship += OwnedReferenceSubsetting
+
+FlowUsage =
+ OccurrenceUsagePrefix 'flow'
+ FlowDeclaration DefinitionBody
+
+SuccessionFlowUsage =
+ OccurrenceUsagePrefix 'succession' 'flow'
+ FlowDeclaration DefinitionBody
+
+FlowDeclaration : FlowUsage =
+ UsageDeclaration ValuePart?
+ ( 'of' ownedRelationship += FlowPayloadFeatureMember )?
+ ( 'from' ownedRelationship += FlowEndMember
+ 'to' ownedRelationship += FlowEndMember )?
+ | ownedRelationship += FlowEndMember 'to'
+ ownedRelationship += FlowEndMember
+
+FlowPayloadFeatureMember : FeatureMembership =
+ ownedRelatedElement += FlowPayloadFeature
+
+FlowPayloadFeature : PayloadFeature =
+ PayloadFeature
+
+PayloadFeature : Feature =
+ Identification? PayloadFeatureSpecializationPart
+ ValuePart?
+ | ownedRelationship += OwnedFeatureTyping
+ ( ownedRelationship += OwnedMultiplicity )?
+ | ownedRelationship += OwnedMultiplicity
+ ownedRelationship += OwnedFeatureTyping
+
+PayloadFeatureSpecializationPart : Feature =
+ ( FeatureSpecialization )+ MultiplicityPart?
+ FeatureSpecialization*
+ | MultiplicityPart FeatureSpecialization+
+
+FlowEndMember : EndFeatureMembership =
+ ownedRelatedElement += FlowEnd
+
+FlowEnd =
+ ( ownedRelationship += FlowEndSubsetting )?
+ ownedRelationship += FlowFeatureMember
+
+FlowEndSubsetting : ReferenceSubsetting =
+ referencedFeature = [QualifiedName]
+ | referencedFeature = FeatureChainPrefix
+ { ownedRelatedElement += referencedFeature }
+
+FeatureChainPrefix : Feature =
+ ( ownedRelationship += OwnedFeatureChaining '.' )+
+ ownedRelationship += OwnedFeatureChaining '.'
+
+FlowFeatureMember : FeatureMembership =
+ ownedRelatedElement += FlowFeature
+
+FlowFeature : ReferenceUsage =
+ ownedRelationship += FlowFeatureRedefinition
+
+// (See Note 1)
+
+FlowFeatureRedefinition : Redefinition =
+ redefinedFeature = [QualifiedName]
+
+// Notes:
+// 1. To ensure that a FlowFeature passes the validateRedefinitionDirectionConformance constraint (see [KerML, 8.3.3.3.8]), its direction must be set to the direction of its redefinedFeature, relative to its owning FlowEnd, that is, the result of the following OCL expression: owningType.directionOf(ownedRedefinition->at(1).redefinedFeature)
+
+// Clause 8.2.2.17 Actions Textual Notation
+
+// Clause 8.2.2.17.1 Action Definitions
+
+ActionDefinition =
+ OccurrenceDefinitionPrefix 'action' 'def'
+ DefinitionDeclaration ActionBody
+
+ActionBody : Type =
+ ';' | '{' ActionBodyItem* '}'
+
+ActionBodyItem : Type =
+ NonBehaviorBodyItem
+ | ownedRelationship += InitialNodeMember
+ ( ownedRelationship += ActionTargetSuccessionMember )*
+ | ( ownedRelationship += SourceSuccessionMember )?
+ ownedRelationship += ActionBehaviorMember
+ ( ownedRelationship += ActionTargetSuccessionMember )*
+ | ownedRelationship += GuardedSuccessionMember
+
+NonBehaviorBodyItem =
+ ownedRelationship += Import
+ | ownedRelationship += AliasMember
+ | ownedRelationship += DefinitionMember
+ | ownedRelationship += VariantUsageMember
+ | ownedRelationship += NonOccurrenceUsageMember
+ | ( ownedRelationship += SourceSuccessionMember )?
+ ownedRelationship += StructureUsageMember
+
+ActionBehaviorMember : FeatureMembership =
+ BehaviorUsageMember | ActionNodeMember
+
+InitialNodeMember : FeatureMembership =
+ MemberPrefix 'first' memberFeature = [QualifiedName]
+ RelationshipBody
+
+ActionNodeMember : FeatureMembership =
+ MemberPrefix ownedRelatedElement += ActionNode
+
+ActionTargetSuccessionMember : FeatureMembership =
+ MemberPrefix ownedRelatedElement += ActionTargetSuccession
+
+GuardedSuccessionMember : FeatureMembership =
+ MemberPrefix ownedRelatedElement += GuardedSuccession
+
+// Clause 8.2.2.17.2 Action Usages
+
+ActionUsage =
+ OccurrenceUsagePrefix 'action'
+ ActionUsageDeclaration ActionBody
+
+ActionUsageDeclaration : ActionUsage =
+ UsageDeclaration ValuePart?
+
+PerformActionUsage =
+ OccurrenceUsagePrefix 'perform'
+ PerformActionUsageDeclaration ActionBody
+
+PerformActionUsageDeclaration : PerformActionUsage =
+ ( ownedRelationship += OwnedReferenceSubsetting
+ FeatureSpecializationPart?
+ | 'action' UsageDeclaration )
+ ValuePart?
+
+ActionNode : ActionUsage =
+ ControlNode
+ | SendNode | AcceptNode
+ | AssignmentNode
+ | TerminateNode
+ | IfNode | WhileLoopNode | ForLoopNode
+
+ActionNodeUsageDeclaration : ActionUsage =
+ 'action' UsageDeclaration?
+
+ActionNodePrefix : ActionUsage =
+ OccurrenceUsagePrefix ActionNodeUsageDeclaration?
+
+// Clause 8.2.2.17.3 Control Nodes
+
+ControlNode =
+ MergeNode | DecisionNode | JoinNode| ForkNode
+
+ControlNodePrefix : OccurrenceUsage =
+ RefPrefix
+ ( isIndividual ?= 'individual' )?
+ ( portionKind = PortionKind
+ { isPortion = true }
+ )?
+ UsageExtensionKeyword*
+
+MergeNode =
+ ControlNodePrefix
+ isComposite ?= 'merge' UsageDeclaration
+ ActionBody
+
+DecisionNode =
+ ControlNodePrefix
+ isComposite ?= 'decide' UsageDeclaration
+ ActionBody
+
+JoinNode =
+ ControlNodePrefix
+ isComposite ?= 'join' UsageDeclaration
+ ActionBody
+
+ForkNode =
+ ControlNodePrefix
+ isComposite ?= 'fork' UsageDeclaration
+ ActionBody
+
+// Clause 8.2.2.17.4 Send and Accept Action Usages
+
+AcceptNode : AcceptActionUsage =
+ OccurrenceUsagePrefix
+ AcceptNodeDeclaration ActionBody
+
+AcceptNodeDeclaration : AcceptActionUsage =
+ ActionNodeUsageDeclaration?
+ 'accept' AcceptParameterPart
+
+AcceptParameterPart : AcceptActionUsage =
+ ownedRelationship += PayloadParameterMember
+ ( 'via' ownedRelationship += NodeParameterMember )?
+
+PayloadParameterMember : ParameterMembership =
+ ownedRelatedElement += PayloadParameter
+
+PayloadParameter : ReferenceUsage =
+ PayloadFeature
+ | Identification PayloadFeatureSpecializationPart?
+ TriggerValuePart
+
+TriggerValuePart : Feature =
+ ownedRelationship += TriggerFeatureValue
+
+TriggerFeatureValue : FeatureValue =
+ ownedRelatedElement += TriggerExpression
+
+TriggerExpression : TriggerInvocationExpression =
+ kind = ( 'at' | 'after' )
+ ownedRelationship += ArgumentMember
+ | kind = 'when'
+ ownedRelationship += ArgumentExpressionMember
+
+ArgumentMember : ParameterMembership =
+ ownedMemberParameter = Argument
+
+Argument : Feature =
+ ownedRelationship += ArgumentValue
+
+ArgumentValue : FeatureValue =
+ value = OwnedExpression
+
+ArgumentExpressionMember : ParameterMembership =
+ ownedRelatedElement += ArgumentExpression
+
+ArgumentExpression : Feature =
+ ownedRelationship += ArgumentExpressionValue
+
+ArgumentExpressionValue : FeatureValue =
+ ownedRelatedElement += OwnedExpressionReference
+
+SendNode : SendActionUsage =
+ OccurrenceUsagePrefix ActionUsageDeclaration? 'send'
+ ( ownedRelationship += NodeParameterMember SenderReceiverPart?
+ | ownedRelationship += EmptyParameterMember SenderReceiverPart )?
+ ActionBody
+
+SendNodeDeclaration : SendActionUsage =
+ ActionNodeUsageDeclaration? 'send'
+ ownedRelationship += NodeParameterMember SenderReceiverPart?
+
+SenderReceiverPart : SendActionUsage =
+ 'via' ownedRelationship += NodeParameterMember
+ ( 'to' ownedRelationship += NodeParameterMember )?
+ | ownedRelationship += EmptyParameterMember
+ 'to' ownedRelationship += NodeParameterMember
+
+NodeParameterMember : ParameterMembership =
+ ownedRelatedElement += NodeParameter
+
+NodeParameter : ReferenceUsage =
+ ownedRelationship += FeatureBinding
+
+FeatureBinding : FeatureValue =
+ ownedRelatedElement += OwnedExpression
+
+EmptyParameterMember : ParameterMembership =
+ ownedRelatedElement += EmptyUsage
+
+EmptyUsage : ReferenceUsage =
+ {}
+
+// Notes:
+// 1. The productions for ArgumentMember, Argument, ArgumentValue, ArgumentExpressionMember, ArgumentExpression and ArgumentExpressionValue are the same as given in [KerML, 8.2.5.8.1].
+
+// Clause 8.2.2.17.5 Assignment Action Usages
+
+AssignmentNode : AssignmentActionUsage =
+ OccurrenceUsagePrefix
+ AssignmentNodeDeclaration ActionBody
+
+AssignmentNodeDeclaration: ActionUsage =
+ ( ActionNodeUsageDeclaration )? 'assign'
+ ownedRelationship += AssignmentTargetMember
+ ownedRelationship += FeatureChainMember ':='
+ ownedRelationship += NodeParameterMember
+
+AssignmentTargetMember : ParameterMembership =
+ ownedRelatedElement += AssignmentTargetParameter
+
+AssignmentTargetParameter : ReferenceUsage =
+ ( ownedRelationship += AssignmentTargetBinding '.' )?
+
+AssignmentTargetBinding : FeatureValue =
+ ownedRelatedElement += NonFeatureChainPrimaryExpression
+
+FeatureChainMember : Membership =
+ memberElement = [QualifiedName]
+ | OwnedFeatureChainMember
+
+OwnedFeatureChainMember : OwningMembership =
+ ownedRelatedElement += OwnedFeatureChain
+
+// Clause 8.2.2.17.6 Terminate Action Usages
+
+TerminateNode : TerminateActionUsage =
+ OccurrenceUsagePrefix ActionNodeUsageDeclaration?
+ 'terminate' ( ownedRelationship += NodeParameterMember )?
+ ActionBody
+
+// Clause 8.2.2.17.7 Structured Control Action Usages
+
+IfNode : IfActionUsage =
+ ActionNodePrefix
+ 'if' ownedRelationship += ExpressionParameterMember
+ ownedRelationship += ActionBodyParameterMember
+ ( 'else' ownedRelationship +=
+ ( ActionBodyParameterMember | IfNodeParameterMember ) )?
+
+ExpressionParameterMember : ParameterMembership =
+ ownedRelatedElement += OwnedExpression
+
+ActionBodyParameterMember : ParameterMembership =
+ ownedRelatedElement += ActionBodyParameter
+
+ActionBodyParameter : ActionUsage =
+ ( 'action' UsageDeclaration? )?
+ '{' ActionBodyItem* '}'
+
+IfNodeParameterMember : ParameterMembership =
+ ownedRelatedElement += IfNode
+
+WhileLoopNode : WhileLoopActionUsage =
+ ActionNodePrefix
+ ( 'while' ownedRelationship += ExpressionParameterMember
+ | 'loop' ownedRelationship += EmptyParameterMember
+ )
+ ownedRelationship += ActionBodyParameterMember
+ ( 'until' ownedRelationship += ExpressionParameterMember ';' )?
+
+ForLoopNode : ForLoopActionUsage =
+ ActionNodePrefix
+ 'for' ownedRelationship += ForVariableDeclarationMember
+ 'in' ownedRelationship += NodeParameterMember
+ ownedRelationship += ActionBodyParameterMember
+
+ForVariableDeclarationMember : FeatureMembership =
+ ownedRelatedElement += UsageDeclaration
+
+ForVariableDeclaration : ReferenceUsage =
+ UsageDeclaration
+
+// Clause 8.2.2.17.8 Action Successions
+
+ActionTargetSuccession : Usage =
+ ( TargetSuccession | GuardedTargetSuccession | DefaultTargetSuccession )
+ UsageBody
+
+TargetSuccession : SuccessionAsUsage =
+ ownedRelationship += SourceEndMember
+ 'then' ownedRelationship += ConnectorEndMember
+
+GuardedTargetSuccession : TransitionUsage =
+ ownedRelationship += GuardExpressionMember
+ 'then' ownedRelationship += TransitionSuccessionMember
+
+DefaultTargetSuccession : TransitionUsage =
+ 'else' ownedRelationship += TransitionSuccessionMember
+
+GuardedSuccession : TransitionUsage =
+ ( 'succession' UsageDeclaration )?
+ 'first' ownedRelationship += FeatureChainMember
+ ownedRelationship += GuardExpressionMember
+ 'then' ownedRelationship += TransitionSuccessionMember
+ UsageBody
+
+// Clause 8.2.2.18 States Textual Notation
+
+// Clause 8.2.2.18.1 State Definitions
+
+StateDefinition =
+ OccurrenceDefinitionPrefix 'state' 'def'
+ DefinitionDeclaration StateDefBody
+
+StateDefBody : StateDefinition =
+ ';'
+ | ( isParallel ?= 'parallel' )?
+ '{' StateBodyItem* '}'
+
+StateBodyItem : Type =
+ NonBehaviorBodyItem
+ | ( ownedRelationship += SourceSuccessionMember )?
+ ownedRelationship += BehaviorUsageMember
+ ( ownedRelationship += TargetTransitionUsageMember )*
+ | ownedRelationship += TransitionUsageMember
+ | ownedRelationship += EntryActionMember
+ ( ownedRelationship += EntryTransitionMember )*
+ | ownedRelationship += DoActionMember
+ | ownedRelationship += ExitActionMember
+
+EntryActionMember : StateSubactionMembership =
+ MemberPrefix kind = 'entry'
+ ownedRelatedElement += StateActionUsage
+
+DoActionMember : StateSubactionMembership =
+ MemberPrefix kind = 'do'
+ ownedRelatedElement += StateActionUsage
+
+ExitActionMember : StateSubactionMembership =
+ MemberPrefix kind = 'exit'
+ ownedRelatedElement += StateActionUsage
+
+EntryTransitionMember : FeatureMembership =
+ MemberPrefix
+ ( ownedRelatedElement += GuardedTargetSuccession
+ | 'then' ownedRelatedElement += TargetSuccession
+ ) ';'
+
+StateActionUsage : ActionUsage =
+ EmptyActionUsage ';'
+ | StatePerformActionUsage
+ | StateAcceptActionUsage
+ | StateSendActionUsage
+ | StateAssignmentActionUsage
+
+EmptyActionUsage : ActionUsage =
+ {}
+
+StatePerformActionUsage : PerformActionUsage =
+ PerformActionUsageDeclaration ActionBody
+
+StateAcceptActionUsage : AcceptActionUsage =
+ AcceptNodeDeclaration ActionBody
+
+StateSendActionUsage : SendActionUsage =
+ SendNodeDeclaration ActionBody
+
+StateAssignmentActionUsage : AssignmentActionUsage =
+ AssignmentNodeDeclaration ActionBody
+
+TransitionUsageMember : FeatureMembership =
+ MemberPrefix ownedRelatedElement += TransitionUsage
+
+TargetTransitionUsageMember : FeatureMembership =
+ MemberPrefix ownedRelatedElement += TargetTransitionUsage
+
+// Clause 8.2.2.18.2 State Usages
+
+StateUsage =
+ OccurrenceUsagePrefix 'state'
+ ActionUsageDeclaration StateUsageBody
+
+StateUsageBody : StateUsage =
+ ';'
+ | ( isParallel ?= 'parallel' )?
+ '{' StateBodyItem* '}'
+
+ExhibitStateUsage =
+ OccurrenceUsagePrefix 'exhibit'
+ ( ownedRelationship += OwnedReferenceSubsetting
+ FeatureSpecializationPart?
+ | 'state' UsageDeclaration )
+ ValuePart? StateUsageBody
+
+// Clause 8.2.2.18.3 Transition Usages
+
+TransitionUsage =
+ 'transition' ( UsageDeclaration 'first' )?
+ ownedRelationship += FeatureChainMember
+ ownedRelationship += EmptyParameterMember
+ ( ownedRelationship += EmptyParameterMember
+ ownedRelationship += TriggerActionMember )?
+ ( ownedRelationship += GuardExpressionMember )?
+ ( ownedRelationship += EffectBehaviorMember )?
+ 'then' ownedRelationship += TransitionSuccessionMember
+ ActionBody
+
+TargetTransitionUsage : TransitionUsage =
+ ownedRelationship += EmptyParameterMember
+ ( 'transition'
+ ( ownedRelationship += EmptyParameterMember
+ ownedRelationship += TriggerActionMember )?
+ ( ownedRelationship += GuardExpressionMember )?
+ ( ownedRelationship += EffectBehaviorMember )?
+ | ownedRelationship += EmptyParameterMember
+ ownedRelationship += TriggerActionMember
+ ( ownedRelationship += GuardExpressionMember )?
+ ( ownedRelationship += EffectBehaviorMember )?
+ | ownedRelationship += GuardExpressionMember
+ ( ownedRelationship += EffectBehaviorMember )?
+ )?
+ 'then' ownedRelationship += TransitionSuccessionMember
+ ActionBody
+
+TriggerActionMember : TransitionFeatureMembership =
+ 'accept' { kind = 'trigger' } ownedRelatedElement += TriggerAction
+
+TriggerAction : AcceptActionUsage =
+ AcceptParameterPart
+
+GuardExpressionMember : TransitionFeatureMembership =
+ 'if' { kind = 'guard' } ownedRelatedElement += OwnedExpression
+
+EffectBehaviorMember : TransitionFeatureMembership =
+ 'do' { kind = 'effect' } ownedRelatedElement += EffectBehaviorUsage
+
+EffectBehaviorUsage : ActionUsage =
+ EmptyActionUsage
+ | TransitionPerformActionUsage
+ | TransitionAcceptActionUsage
+ | TransitionSendActionUsage
+ | TransitionAssignmentActionUsage
+
+TransitionPerformActionUsage : PerformActionUsage =
+ PerformActionUsageDeclaration ( '{' ActionBodyItem* '}' )?
+
+TransitionAcceptActionUsage : AcceptActionUsage =
+ AcceptNodeDeclaration ( '{' ActionBodyItem* '}' )?
+
+TransitionSendActionUsage : SendActionUsage =
+ SendNodeDeclaration ( '{' ActionBodyItem* '}' )?
+
+TransitionAssignmentActionUsage : AssignmentActionUsage =
+ AssignmentNodeDeclaration ( '{' ActionBodyItem* '}' )?
+
+TransitionSuccessionMember : OwningMembership =
+ ownedRelatedElement += TransitionSuccession
+
+TransitionSuccession : Succession =
+ ownedRelationship += EmptyEndMember
+ ownedRelationship += ConnectorEndMember
+
+EmptyEndMember : EndFeatureMembership =
+ ownedRelatedElement += EmptyFeature
+
+EmptyFeature : ReferenceUsage =
+ {}
+
+// Clause 8.2.2.19 Calculations Textual Notation
+
+CalculationDefinition =
+ OccurrenceDefinitionPrefix 'calc' 'def'
+ DefinitionDeclaration CalculationBody
+
+CalculationUsage : CalculationUsage =
+ OccurrenceUsagePrefix 'calc'
+ ActionUsageDeclaration CalculationBody
+
+CalculationBody : Type =
+ ';' | '{' CalculationBodyPart '}'
+
+CalculationBodyPart : Type =
+ CalculationBodyItem*
+ ( ownedRelationship += ResultExpressionMember )?
+
+CalculationBodyItem : Type =
+ ActionBodyItem
+ | ownedRelationship += ReturnParameterMember
+
+ReturnParameterMember : ReturnParameterMembership =
+ MemberPrefix? 'return' ownedRelatedElement += UsageElement
+
+ResultExpressionMember : ResultExpressionMembership =
+ MemberPrefix? ownedRelatedElement += OwnedExpression
+
+// Clause 8.2.2.20 Constraints Textual Notation
+
+ConstraintDefinition =
+ OccurrenceDefinitionPrefix 'constraint' 'def'
+ DefinitionDeclaration CalculationBody
+
+ConstraintUsage =
+ OccurrenceUsagePrefix 'constraint'
+ ConstraintUsageDeclaration CalculationBody
+
+AssertConstraintUsage =
+ OccurrenceUsagePrefix 'assert' ( isNegated ?= 'not' )?
+ ( ownedRelationship += OwnedReferenceSubsetting
+ FeatureSpecializationPart?
+ | 'constraint' ConstraintUsageDeclaration )
+ CalculationBody
+
+ConstraintUsageDeclaration : ConstraintUsage =
+ UsageDeclaration ValuePart?
+
+// Clause 8.2.2.21 Requirements Textual Notation
+
+// Clause 8.2.2.21.1 Requirement Definitions
+
+RequirementDefinition =
+ OccurrenceDefinitionPrefix 'requirement' 'def'
+ DefinitionDeclaration RequirementBody
+
+RequirementBody : Type =
+ ';' | '{' RequirementBodyItem* '}'
+
+RequirementBodyItem : Type =
+ DefinitionBodyItem
+ | ownedRelationship += SubjectMember
+ | ownedRelationship += RequirementConstraintMember
+ | ownedRelationship += FramedConcernMember
+ | ownedRelationship += RequirementVerificationMember
+ | ownedRelationship += ActorMember
+ | ownedRelationship += StakeholderMember
+
+SubjectMember : SubjectMembership =
+ MemberPrefix ownedRelatedElement += SubjectUsage
+
+SubjectUsage : ReferenceUsage =
+ 'subject' UsageExtensionKeyword* Usage
+
+RequirementConstraintMember : RequirementConstraintMembership =
+ MemberPrefix? RequirementKind
+ ownedRelatedElement += RequirementConstraintUsage
+
+RequirementKind : RequirementConstraintMembership =
+ 'assume' { kind = 'assumption' }
+ | 'require' { kind = 'requirement' }
+
+RequirementConstraintUsage : ConstraintUsage =
+ ownedRelationship += OwnedReferenceSubsetting
+ FeatureSpecializationPart? RequirementBody
+ | ( UsageExtensionKeyword* 'constraint'
+ | UsageExtensionKeyword+ )
+ ConstraintUsageDeclaration CalculationBody
+
+FramedConcernMember : FramedConcernMembership =
+ MemberPrefix? 'frame'
+ ownedRelatedElement += FramedConcernUsage
+
+FramedConcernUsage : ConcernUsage =
+ ownedRelationship += OwnedReferenceSubsetting
+ FeatureSpecializationPart? CalculationBody
+ | ( UsageExtensionKeyword* 'concern'
+ | UsageExtensionKeyword+ )
+ CalculationUsageDeclaration CalculationBody
+
+ActorMember : ActorMembership =
+ MemberPrefix ownedRelatedElement += ActorUsage
+
+ActorUsage : PartUsage =
+ 'actor' UsageExtensionKeyword* Usage
+
+StakeholderMember : StakeholderMembership =
+ MemberPrefix ownedRelatedElement += StakeholderUsage
+
+StakeholderUsage : PartUsage =
+ 'stakeholder' UsageExtensionKeyword* Usage
+
+// Clause 8.2.2.21.2 Requirement Usages
+
+RequirementUsage =
+ OccurrenceUsagePrefix 'requirement'
+ ConstraintUsageDeclaration RequirementBody
+
+SatisfyRequirementUsage =
+ OccurrenceUsagePrefix 'assert' ( isNegated ?= 'not' ) 'satisfy'
+ ( ownedRelationship += OwnedReferenceSubsetting
+ FeatureSpecializationPart?
+ | 'requirement' UsageDeclaration )
+ ValuePart?
+ ( 'by' ownedRelationship += SatisfactionSubjectMember )?
+ RequirementBody
+
+SatisfactionSubjectMember : SubjectMembership =
+ ownedRelatedElement += SatisfactionParameter
+
+SatisfactionParameter : ReferenceUsage =
+ ownedRelationship += SatisfactionFeatureValue
+
+SatisfactionFeatureValue : FeatureValue =
+ ownedRelatedElement += SatisfactionReferenceExpression
+
+SatisfactionReferenceExpression : FeatureReferenceExpression =
+ ownedRelationship += FeatureChainMember
+
+// Clause 8.2.2.21.3 Concerns
+
+ConcernDefinition =
+ OccurrenceDefinitionPrefix 'concern' 'def'
+ DefinitionDeclaration RequirementBody
+
+ConcernUsage =
+ OccurrenceUsagePrefix 'concern'
+ ConstraintUsageDeclaration RequirementBody
+
+// Clause 8.2.2.22 Cases Textual Notation
+
+CaseDefinition =
+ OccurrenceDefinitionPrefix 'case' 'def'
+ DefinitionDeclaration CaseBody
+
+CaseUsage =
+ OccurrenceUsagePrefix 'case'
+ ConstraintUsageDeclaration CaseBody
+
+CaseBody : Type =
+ ';'
+ | '{' CaseBodyItem*
+ ( ownedRelationship += ResultExpressionMember )?
+ '}'
+
+CaseBodyItem : Type =
+ ActionBodyItem
+ | ownedRelationship += SubjectMember
+ | ownedRelationship += ActorMember
+ | ownedRelationship += ObjectiveMember
+
+ObjectiveMember : ObjectiveMembership =
+ MemberPrefix 'objective'
+ ownedRelatedElement += ObjectiveRequirementUsage
+
+ObjectiveRequirementUsage : RequirementUsage =
+ UsageExtensionKeyword* ConstraintUsageDeclaration
+ RequirementBody
+
+// Clause 8.2.2.23 Analysis Cases Textual Notation
+
+AnalysisCaseDefinition =
+ OccurrenceDefinitionPrefix 'analysis' 'def'
+ DefinitionDeclaration CaseBody
+
+AnalysisCaseUsage =
+ OccurrenceUsagePrefix 'analysis'
+ ConstraintUsageDeclaration CaseBody
+
+// Clause 8.2.2.24 Verification Cases Textual Notation
+
+VerificationCaseDefinition =
+ OccurrenceDefinitionPrefix 'verification' 'def'
+ DefinitionDeclaration CaseBody
+
+VerificationCaseUsage =
+ OccurrenceUsagePrefix 'verification'
+ ConstraintUsageDeclaration CaseBody
+
+RequirementVerificationMember : RequirementVerificationMembership =
+ MemberPrefix 'verify' { kind = 'requirement' }
+ ownedRelatedElement += RequirementVerificationUsage
+
+RequirementVerificationUsage : RequirementUsage =
+ ownedRelationship += OwnedReferenceSubsetting
+ FeatureSpecialization* RequirementBody
+ | ( UsageExtensionKeyword* 'requirement'
+ | UsageExtensionKeyword+ )
+ ConstraintUsageDeclaration RequirementBody
+
+// Clause 8.2.2.25 Use Cases Textual Notation
+
+UseCaseDefinition =
+ OccurrenceDefinitionPrefix 'use' 'case' 'def'
+ DefinitionDeclaration CaseBody
+
+UseCaseUsage =
+ OccurrenceUsagePrefix 'use' 'case'
+ ConstraintUsageDeclaration CaseBody
+
+IncludeUseCaseUsage =
+ OccurrenceUsagePrefix 'include'
+ ( ownedRelationship += OwnedReferenceSubsetting
+ FeatureSpecializationPart?
+ | 'use' 'case' UsageDeclaration )
+ ValuePart?
+ CaseBody
+
+// Clause 8.2.2.26 Views and Viewpoints Textual Notation
+
+// Clause 8.2.2.26.1 View Definitions
+
+ViewDefinition =
+ OccurrenceDefinitionPrefix 'view' 'def'
+ DefinitionDeclaration ViewDefinitionBody
+
+ViewDefinitionBody : ViewDefinition =
+ ';' | '{' ViewDefinitionBodyItem* '}'
+
+ViewDefinitionBodyItem : ViewDefinition =
+ DefinitionBodyItem
+ | ownedRelationship += ElementFilterMember
+ | ownedRelationship += ViewRenderingMember
+
+ViewRenderingMember : ViewRenderingMembership =
+ MemberPrefix 'render'
+ ownedRelatedElement += ViewRenderingUsage
+
+ViewRenderingUsage : RenderingUsage =
+ ownedRelationship += OwnedReferenceSubsetting
+ FeatureSpecializationPart?
+ UsageBody
+ | ( UsageExtensionKeyword* 'rendering'
+ | UsageExtensionKeyword+ )
+ Usage
+
+// Clause 8.2.2.26.2 View Usages
+
+ViewUsage =
+ OccurrenceUsagePrefix 'view'
+ UsageDeclaration? ValuePart?
+ ViewBody
+
+ViewBody : ViewUsage =
+ ';' | '{' ViewBodyItem* '}'
+
+ViewBodyItem : ViewUsage =
+ DefinitionBodyItem
+ | ownedRelationship += ElementFilterMember
+ | ownedRelationship += ViewRenderingMember
+ | ownedRelationship += Expose
+
+Expose =
+ 'expose' ( MembershipExpose | NamespaceExpose )
+ RelationshipBody
+
+MembershipExpose =
+ MembershipImport
+
+NamespaceExpose =
+ NamespaceImport
+
+// Clause 8.2.2.26.3 Viewpoints
+
+ViewpointDefinition =
+ OccurrenceDefinitionPrefix 'viewpoint' 'def'
+ DefinitionDeclaration RequirementBody
+
+ViewpointUsage =
+ OccurrenceUsagePrefix 'viewpoint'
+ ConstraintUsageDeclaration RequirementBody
+
+// Clause 8.2.2.26.4 Renderings
+
+RenderingDefinition =
+ OccurrenceDefinitionPrefix 'rendering' 'def'
+ Definition
+
+RenderingUsage =
+ OccurrenceUsagePrefix 'rendering'
+ Usage
+
+// Clause 8.2.2.27 Metadata Textual Notation
+
+MetadataDefinition =
+ ( isAbstract ?= 'abstract')? DefinitionExtensionKeyword*
+ 'metadata' 'def' Definition
+
+PrefixMetadataAnnotation : Annotation =
+ '#' annotatingElement = PrefixMetadataUsage
+ { ownedRelatedElement += annotatingElement }
+
+PrefixMetadataMember : OwningMembership =
+ '#' ownedRelatedElement = PrefixMetadataUsage
+
+PrefixMetadataUsage : MetadataUsage =
+ ownedRelationship += OwnedFeatureTyping
+
+MetadataUsage =
+ UsageExtensionKeyword* ( '@' | 'metadata' )
+ MetadataUsageDeclaration
+ ( 'about' ownedRelationship += Annotation
+ ( ',' ownedRelationship += Annotation )*
+ )?
+ MetadataBody
+
+MetadataUsageDeclaration : MetadataUsage =
+ ( Identification ( ':' | 'typed' 'by' ) )?
+ ownedRelationship += OwnedFeatureTyping
+
+MetadataBody : Type =
+ ';' |
+ '{' ( ownedRelationship += DefinitionMember
+ | ownedRelationship += MetadataBodyUsageMember
+ | ownedRelationship += AliasMember
+ | ownedRelationship += Import
+ )*
+ '}'
+
+MetadataBodyUsageMember : FeatureMembership =
+ ownedMemberFeature = MetadataBodyUsage
+
+MetadataBodyUsage : ReferenceUsage =
+ 'ref'? ( ':>>' | 'redefines' )? ownedRelationship += OwnedRedefinition
+ FeatureSpecializationPart? ValuePart?
+ MetadataBody
+
+ExtendedDefinition : Definition =
+ BasicDefinitionPrefix? DefinitionExtensionKeyword+
+ 'def' Definition
+
+ExtendedUsage : Usage =
+ UnextendedUsagePrefix UsageExtensionKeyword+
+ Usage
+
+// End of BNF
+
+
diff --git a/Resources/kebnf.g4 b/Resources/kebnf.g4
new file mode 100644
index 000000000..d059914a1
--- /dev/null
+++ b/Resources/kebnf.g4
@@ -0,0 +1,104 @@
+// Grammar
+
+grammar kebnf;
+
+specification : (NL)* rule_definition+ EOF ;
+
+rule_definition
+ : name=UPPER_ID (params=parameter_list)? (COLON target_ast=UPPER_ID)? ASSIGN rule_body=alternatives SEMICOLON? NL+
+ ;
+
+parameter_list
+ : LPAREN param_name=ID COLON param_type=ID RPAREN
+ ;
+
+alternatives
+ : alternative (PIPE alternative)*
+ ;
+
+alternative
+ : element*
+ ;
+
+element
+ : assignment
+ | non_parsing_assignment
+ | non_parsing_empty
+ | cross_reference
+ | group
+ | terminal
+ | non_terminal
+ | value_literal
+ ;
+
+assignment
+ : property=dotted_id op=(ASSIGN | ADD_ASSIGN | BOOL_ASSIGN) (prefix=TILDE)?content=element_core (suffix=suffix_op)?
+ ;
+
+non_parsing_assignment
+ : LBRACE property=dotted_id op=(ASSIGN | ADD_ASSIGN) val=value_literal RBRACE
+ ;
+
+non_parsing_empty
+ : LBRACE RBRACE
+ ;
+
+cross_reference
+ : TILDE? LBRACK ref=ID RBRACK
+ ;
+
+group
+ : LPAREN alternatives RPAREN (suffix=suffix_op)?
+ ;
+
+terminal
+ : val=SINGLE_QUOTED_STRING (suffix=suffix_op)?
+ ;
+
+non_terminal
+ : name=UPPER_ID (suffix=suffix_op)?
+ ;
+
+element_core
+ : cross_reference
+ | group
+ | terminal
+ | non_terminal
+ | value_literal
+ ;
+
+dotted_id
+ : ID (DOT ID)*
+ ;
+
+suffix_op : '*' | '+' | '?' ;
+
+value_literal : ID | INT | STRING | '[QualifiedName]' | SINGLE_QUOTED_STRING;
+
+// Lexer
+ASSIGN : '::=' | '=' ;
+ADD_ASSIGN : '+=' ;
+BOOL_ASSIGN : '?=' ;
+PIPE : '|' ;
+COLON : ':' ;
+SEMICOLON : ';' ;
+COMMA : ',' ;
+LPAREN : '(' ;
+RPAREN : ')' ;
+LBRACK : '[' ;
+RBRACK : ']' ;
+LBRACE : '{' ;
+RBRACE : '}' ;
+DOT : '.' ;
+TILDE : '~' ;
+
+UPPER_ID : [A-Z] [a-zA-Z0-9_]* ;
+ID : [a-zA-Z_][a-zA-Z0-9_]* ;
+SINGLE_QUOTED_STRING : '\'' (~['\\] | '\\' .)* '\'' ;
+INT : [0-9]+ ;
+STRING : '\'' ( ~['\\] | '\\' . )* '\'' ;
+
+COMMENT : '//' ~[\r\n]* -> skip ;
+WS : [ \t]+ -> skip ;
+CONTINUATION : '\r'? '\n' [ \t]+ -> skip ;
+NL : '\r'? '\n' ;
\ No newline at end of file
diff --git a/SysML2.NET.CodeGenerator.Tests/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGeneratorTestFixture.cs b/SysML2.NET.CodeGenerator.Tests/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGeneratorTestFixture.cs
new file mode 100644
index 000000000..373705c59
--- /dev/null
+++ b/SysML2.NET.CodeGenerator.Tests/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGeneratorTestFixture.cs
@@ -0,0 +1,71 @@
+// -------------------------------------------------------------------------------------------------
+//
+//
+// Copyright 2022-2026 Starion Group S.A.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+// ------------------------------------------------------------------------------------------------
+
+namespace SysML2.NET.CodeGenerator.Tests.Generators.UmlHandleBarsGenerators
+{
+ using System.IO;
+ using System.Linq;
+ using System.Threading.Tasks;
+
+ using NUnit.Framework;
+
+ using SysML2.NET.CodeGenerator.Generators.UmlHandleBarsGenerators;
+ using SysML2.NET.CodeGenerator.Grammar;
+ using SysML2.NET.CodeGenerator.Grammar.Model;
+
+ [TestFixture]
+ public class UmlCoreTextualNotationBuilderGeneratorTestFixture
+ {
+ private DirectoryInfo umlPocoDirectoryInfo;
+ private UmlCoreTextualNotationBuilderGenerator umlCoreTextualNotationBuilderGenerator;
+ private TextualNotationSpecification textualNotationSpecification;
+
+ [OneTimeSetUp]
+ public void OneTimeSetup()
+ {
+ var directoryInfo = new DirectoryInfo(TestContext.CurrentContext.TestDirectory);
+
+ var path = Path.Combine("UML", "_SysML2.NET.Core.UmlCoreTextualNotationBuilderGenerator");
+
+ this.umlPocoDirectoryInfo = directoryInfo.CreateSubdirectory(path);
+ this.umlCoreTextualNotationBuilderGenerator = new UmlCoreTextualNotationBuilderGenerator();
+
+ var textualRulesFolder = Path.Combine(TestContext.CurrentContext.TestDirectory, "datamodel");
+ var kermlRules = GrammarLoader.LoadTextualNotationSpecification(Path.Combine(textualRulesFolder, "KerML-textual-bnf.kebnf"));
+ var sysmlRules = GrammarLoader.LoadTextualNotationSpecification(Path.Combine(textualRulesFolder, "SysML-textual-bnf.kebnf"));
+
+ var combinesRules = new TextualNotationSpecification();
+ combinesRules.Rules.AddRange(sysmlRules.Rules);
+
+ foreach (var rule in kermlRules.Rules.Where(rule => combinesRules.Rules.All(r => r.RuleName != rule.RuleName)))
+ {
+ combinesRules.Rules.Add(rule);
+ }
+
+ this.textualNotationSpecification = combinesRules;
+ }
+
+ [Test]
+ public async Task VerifyCanGenerateTextualNotation()
+ {
+ await Assert.ThatAsync(() => this.umlCoreTextualNotationBuilderGenerator.GenerateAsync(GeneratorSetupFixture.XmiReaderResult, this.textualNotationSpecification, this.umlPocoDirectoryInfo), Throws.Nothing);
+ }
+ }
+}
diff --git a/SysML2.NET.CodeGenerator.Tests/Grammar/TextualNotationSpecificationVisitorTestFixture.cs b/SysML2.NET.CodeGenerator.Tests/Grammar/TextualNotationSpecificationVisitorTestFixture.cs
new file mode 100644
index 000000000..7990d4cc7
--- /dev/null
+++ b/SysML2.NET.CodeGenerator.Tests/Grammar/TextualNotationSpecificationVisitorTestFixture.cs
@@ -0,0 +1,64 @@
+// -------------------------------------------------------------------------------------------------
+//
+//
+// Copyright 2022-2026 Starion Group S.A.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+// ------------------------------------------------------------------------------------------------
+
+namespace SysML2.NET.CodeGenerator.Tests.Grammar
+{
+ using System;
+ using System.IO;
+ using System.Linq;
+
+ using Antlr4.Runtime;
+
+ using NUnit.Framework;
+
+ using SysML2.NET.CodeGenerator.Grammar;
+ using SysML2.NET.CodeGenerator.Grammar.Model;
+
+ [TestFixture]
+ public class TextualNotationSpecificationVisitorTestFixture
+ {
+ [Test]
+ [TestCase("KerML-textual-bnf.kebnf")]
+ [TestCase("SysML-textual-bnf.kebnf")]
+ public void VerifyCanParseGrammar(string modelName)
+ {
+ var filePath = Path.Combine(TestContext.CurrentContext.TestDirectory, "datamodel",modelName );
+
+ var stream = CharStreams.fromPath(filePath);
+ var lexer = new kebnfLexer(stream);
+ var tokens = new CommonTokenStream(lexer);
+ var parser = new kebnfParser(tokens);
+
+ var tree = parser.specification();
+ var explorer = new TextualNotationSpecificationVisitor();
+ var result = (TextualNotationSpecification)explorer.Visit(tree);
+ var rules = result.Rules;
+
+ using (Assert.EnterMultipleScope())
+ {
+ Assert.That(rules, Is.Not.Null);
+ Assert.That(rules, Is.Not.Empty);
+ Assert.That(rules.DistinctBy(x => x.RuleName), Is.EquivalentTo(rules));
+ }
+
+ Console.WriteLine($"Found {rules.Count} rules");
+ }
+ }
+}
diff --git a/SysML2.NET.CodeGenerator/Extensions/NamedElementExtensions.cs b/SysML2.NET.CodeGenerator/Extensions/NamedElementExtensions.cs
index 402bc3454..9bea96a6c 100644
--- a/SysML2.NET.CodeGenerator/Extensions/NamedElementExtensions.cs
+++ b/SysML2.NET.CodeGenerator/Extensions/NamedElementExtensions.cs
@@ -20,9 +20,11 @@
namespace SysML2.NET.CodeGenerator.Extensions
{
+ using System;
using System.Linq;
using uml4net.CommonStructure;
+ using uml4net.SimpleClassifiers;
///
/// Extension class for
@@ -40,5 +42,36 @@ public static string QueryNamespace(this INamedElement namedElement)
var namespaces = qualifiedNameSpaces.Skip(1).Take(qualifiedNameSpaces.Length - 2);
return string.Join('.', namespaces);
}
+
+ ///
+ /// Query the fully qualified type name (Namespace + Type name).
+ ///
+ /// The specific that should have the fully qualified type name computed
+ /// A specific namespace part (POCO/DTO distinction)
+ /// Asserts if the type should be the interface name or not
+ /// The fully qualified type name
+ public static string QueryFullyQualifiedTypeName(this INamedElement namedElement, string namespacePart = "POCO", bool targetInterface = true)
+ {
+ ArgumentNullException.ThrowIfNull(namedElement);
+ ArgumentException.ThrowIfNullOrWhiteSpace(namespacePart);
+
+ var typeName = "SysML2.NET.Core.";
+
+ if (namedElement is not IEnumeration)
+ {
+ typeName += $"{namespacePart}.";
+ }
+
+ typeName += namedElement.QueryNamespace();
+ typeName += ".";
+
+ if (namedElement is not IEnumeration && targetInterface)
+ {
+ typeName += "I";
+ }
+
+ typeName += namedElement.Name;
+ return typeName;
+ }
}
}
diff --git a/SysML2.NET.CodeGenerator/Extensions/PropertyExtension.cs b/SysML2.NET.CodeGenerator/Extensions/PropertyExtension.cs
index e90320150..c56b1937d 100644
--- a/SysML2.NET.CodeGenerator/Extensions/PropertyExtension.cs
+++ b/SysML2.NET.CodeGenerator/Extensions/PropertyExtension.cs
@@ -92,5 +92,49 @@ public static bool QueryPropertyIsPartOfNonDerivedCompositeAggregation(this IPro
return property.Opposite is { IsComposite: true, IsDerived: false };
}
+
+ ///
+ /// Queries the content of a IF statement for non-empty values
+ ///
+ /// The property that have to be used to produce the content
+ /// The name of the name
+ /// The If Statement content
+ public static string QueryIfStatementContentForNonEmpty(this IProperty property, string variableName)
+ {
+ var propertyName = property.QueryPropertyNameBasedOnUmlProperties();
+
+ if (property.QueryIsEnumerable())
+ {
+ return $"{variableName}.MoveNext()";
+ }
+
+ if (property.QueryIsReferenceProperty())
+ {
+ return $"{variableName}.{propertyName} != null";
+ }
+
+ if (property.QueryIsNullableAndNotString())
+ {
+ return $"{variableName}.{propertyName}.HasValue";
+ }
+
+ if (property.QueryIsString())
+ {
+ return $"!string.IsNullOrWhiteSpace({variableName}.{propertyName})";
+ }
+
+ if (property.QueryIsBool())
+ {
+ return $"{variableName}.{propertyName}";
+ }
+
+ if (property.QueryIsEnum())
+ {
+ var defaultValue = property.QueryIsEnumPropertyWithDefaultValue() ? $"{property.Type.QueryFullyQualifiedTypeName()}.{property.QueryDefaultValueAsString().CapitalizeFirstLetter()}" : ((IEnumeration)property.Type).OwnedLiteral[0].Name;
+ return $"{variableName}.{propertyName} != {defaultValue}";
+ }
+
+ return "THIS WILL PRODUCE COMPILE ERROR";
+ }
}
}
diff --git a/SysML2.NET.CodeGenerator/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGenerator.cs b/SysML2.NET.CodeGenerator/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGenerator.cs
new file mode 100644
index 000000000..9b45ddb9b
--- /dev/null
+++ b/SysML2.NET.CodeGenerator/Generators/UmlHandleBarsGenerators/UmlCoreTextualNotationBuilderGenerator.cs
@@ -0,0 +1,224 @@
+// -------------------------------------------------------------------------------------------------
+//
+//
+// Copyright 2022-2026 Starion Group S.A.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+// ------------------------------------------------------------------------------------------------
+
+namespace SysML2.NET.CodeGenerator.Generators.UmlHandleBarsGenerators
+{
+ using System;
+ using System.IO;
+ using System.Linq;
+ using System.Threading.Tasks;
+
+ using SysML2.NET.CodeGenerator.Extensions;
+ using SysML2.NET.CodeGenerator.Grammar.Model;
+ using SysML2.NET.CodeGenerator.HandleBarHelpers;
+
+ using uml4net.CommonStructure;
+ using uml4net.Extensions;
+ using uml4net.HandleBars;
+ using uml4net.StructuredClassifiers;
+ using uml4net.xmi.Readers;
+
+ using NamedElementHelper = SysML2.NET.CodeGenerator.HandleBarHelpers.NamedElementHelper;
+
+ ///
+ /// An to generate Textual Notation Builder
+ ///
+ public class UmlCoreTextualNotationBuilderGenerator: UmlHandleBarsGenerator
+ {
+ ///
+ /// Gets the name of template for builder classes
+ ///
+ private const string BuilderTemplateName = "core-textual-notation-builder-template";
+
+ ///
+ /// Gets the name of template for builder facade class
+ ///
+ private const string BuilderFacadeTemplateName = "core-textual-notation-builder-facade-template";
+
+ ///
+ /// Register the custom helpers
+ ///
+ protected override void RegisterHelpers()
+ {
+ NamedElementHelper.RegisterNamedElementHelper(this.Handlebars);
+ this.Handlebars.RegisterStringHelper();
+ this.Handlebars.RegisterRulesHelper();
+ }
+
+ ///
+ /// Register the code templates
+ ///
+ protected override void RegisterTemplates()
+ {
+ this.RegisterTemplate(BuilderTemplateName);
+ this.RegisterTemplate(BuilderFacadeTemplateName);
+ }
+
+ ///
+ /// Generates code specific to the concrete implementation
+ ///
+ ///
+ /// the that contains the UML model to generate from
+ ///
+ ///
+ /// The target
+ ///
+ /// This method cannot be used since it requires to have . Uses
+ ///
+ /// an awaitable
+ ///
+ public override Task GenerateAsync(XmiReaderResult xmiReaderResult, DirectoryInfo outputDirectory)
+ {
+ throw new NotSupportedException("The generator needs TextualNotationSpecification access");
+ }
+
+ ///
+ /// Generates code specific to the concrete implementation
+ ///
+ ///
+ /// the that contains the UML model to generate from
+ ///
+ /// The that contains specific grammar rules to produce textual notation
+ ///
+ /// The target
+ ///
+ ///
+ /// an awaitable
+ ///
+ public async Task GenerateAsync(XmiReaderResult xmiReaderResult, TextualNotationSpecification textualNotationSpecification, DirectoryInfo outputDirectory)
+ {
+ await this.GenerateBuilderClasses(xmiReaderResult, textualNotationSpecification, outputDirectory);
+ // await this.GenerateBuilderFacade(xmiReaderResult, outputDirectory);
+ }
+
+ ///
+ /// Generates Textual Notation builder classes for each targeted by a rule
+ ///
+ ///
+ /// the that contains the UML model to generate from
+ ///
+ /// The that contains specific grammar rules to produce textual notation
+ ///
+ /// The target
+ ///
+ /// If one of the given parameters is null
+ ///
+ /// an awaitable
+ ///
+ private Task GenerateBuilderClasses(XmiReaderResult xmiReaderResult, TextualNotationSpecification textualNotationSpecification, DirectoryInfo outputDirectory)
+ {
+ ArgumentNullException.ThrowIfNull(xmiReaderResult);
+ ArgumentNullException.ThrowIfNull(textualNotationSpecification);
+ ArgumentNullException.ThrowIfNull(outputDirectory);
+
+ return this.GenerateBuilderClassesInternal(xmiReaderResult, textualNotationSpecification, outputDirectory);
+ }
+
+ ///
+ /// Generates Textual Notation builder classes for each targeted by a rule
+ ///
+ ///
+ /// the that contains the UML model to generate from
+ ///
+ /// The that contains specific grammar rules to produce textual notation
+ ///
+ /// The target
+ ///
+ ///
+ /// an awaitable
+ ///
+ private async Task GenerateBuilderClassesInternal(XmiReaderResult xmiReaderResult, TextualNotationSpecification textualNotationSpecification, DirectoryInfo outputDirectory)
+ {
+ var template = this.Templates[BuilderTemplateName];
+
+ var namedElements = xmiReaderResult.QueryContainedAndImported("SysML")
+ .SelectMany(x => x.PackagedElement.OfType())
+ .ToList();
+
+ var rulesGroupedByType = textualNotationSpecification.Rules
+ .Where(x => !string.IsNullOrWhiteSpace(x.TargetElementName) && namedElements.Any(n => n.Name == x.TargetElementName))
+ .GroupBy(x => x.TargetElementName).ToDictionary(x => x.Key, x => x.ToList());
+
+ foreach (var nonTargetingRule in textualNotationSpecification.Rules.Where(x => string.IsNullOrWhiteSpace(x.TargetElementName)))
+ {
+ var matchingClass = namedElements.SingleOrDefault(x => x.Name == nonTargetingRule.RuleName);
+
+ if (matchingClass != null)
+ {
+ if (rulesGroupedByType.TryGetValue(matchingClass.Name, out var existingRules))
+ {
+ existingRules.Add(nonTargetingRule);
+ }
+ else
+ {
+ rulesGroupedByType[matchingClass.Name] = [nonTargetingRule];
+ }
+ }
+ }
+
+ foreach (var rulesPerType in rulesGroupedByType)
+ {
+ var targetClassContext = namedElements.Single(x => x.Name == rulesPerType.Key);
+
+ var generatedBuilder = template(new {Context = targetClassContext, Rules = rulesPerType.Value, AllRules = textualNotationSpecification.Rules});
+ generatedBuilder = this.CodeCleanup(generatedBuilder);
+
+ var fileName = $"{targetClassContext.Name.CapitalizeFirstLetter()}TextualNotationBuilder.cs";
+
+ await WriteAsync(generatedBuilder, outputDirectory, fileName);
+ }
+ }
+
+ ///
+ /// Generates the Textual Notation builder facade
+ ///
+ /// the that contains the UML model to generate from
+ /// The target
+ /// If one of the given parameters is null
+ /// an awaitable
+ private Task GenerateBuilderFacade(XmiReaderResult xmiReaderResult, DirectoryInfo outputDirectory)
+ {
+ ArgumentNullException.ThrowIfNull(xmiReaderResult);
+ ArgumentNullException.ThrowIfNull(outputDirectory);
+ return this.GenerateBuilderFacadeInternal(xmiReaderResult, outputDirectory);
+ }
+
+ ///
+ /// Generates the Textual Notation builder facade
+ ///
+ /// the that contains the UML model to generate from
+ /// The target
+ /// an awaitable
+ private async Task GenerateBuilderFacadeInternal(XmiReaderResult xmiReaderResult, DirectoryInfo outputDirectory)
+ {
+ var template = this.Templates[BuilderFacadeTemplateName];
+
+ var classes = xmiReaderResult.QueryContainedAndImported("SysML")
+ .SelectMany(x => x.PackagedElement.OfType())
+ .Where(x => !x.IsAbstract)
+ .ToList();
+
+ var generatedFacade = template(classes);
+ generatedFacade = this.CodeCleanup(generatedFacade);
+
+ await WriteAsync(generatedFacade, outputDirectory, "TextualNotationBuilderFacade.cs");
+ }
+ }
+}
diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnf.interp b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnf.interp
new file mode 100644
index 000000000..1291cb779
--- /dev/null
+++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnf.interp
@@ -0,0 +1,84 @@
+token literal names:
+null
+'*'
+'+'
+'?'
+'[QualifiedName]'
+null
+'+='
+'?='
+'|'
+':'
+';'
+','
+'('
+')'
+'['
+']'
+'{'
+'}'
+'.'
+'~'
+null
+null
+null
+null
+null
+null
+null
+null
+null
+
+token symbolic names:
+null
+null
+null
+null
+null
+ASSIGN
+ADD_ASSIGN
+BOOL_ASSIGN
+PIPE
+COLON
+SEMICOLON
+COMMA
+LPAREN
+RPAREN
+LBRACK
+RBRACK
+LBRACE
+RBRACE
+DOT
+TILDE
+UPPER_ID
+ID
+SINGLE_QUOTED_STRING
+INT
+STRING
+COMMENT
+WS
+CONTINUATION
+NL
+
+rule names:
+specification
+rule_definition
+parameter_list
+alternatives
+alternative
+element
+assignment
+non_parsing_assignment
+non_parsing_empty
+cross_reference
+group
+terminal
+non_terminal
+element_core
+dotted_id
+suffix_op
+value_literal
+
+
+atn:
+[4, 1, 28, 154, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 1, 0, 5, 0, 36, 8, 0, 10, 0, 12, 0, 39, 9, 0, 1, 0, 4, 0, 42, 8, 0, 11, 0, 12, 0, 43, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 50, 8, 1, 1, 1, 1, 1, 3, 1, 54, 8, 1, 1, 1, 1, 1, 1, 1, 3, 1, 59, 8, 1, 1, 1, 4, 1, 62, 8, 1, 11, 1, 12, 1, 63, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 5, 3, 75, 8, 3, 10, 3, 12, 3, 78, 9, 3, 1, 4, 5, 4, 81, 8, 4, 10, 4, 12, 4, 84, 9, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 94, 8, 5, 1, 6, 1, 6, 1, 6, 3, 6, 99, 8, 6, 1, 6, 1, 6, 3, 6, 103, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 9, 3, 9, 115, 8, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 125, 8, 10, 1, 11, 1, 11, 3, 11, 129, 8, 11, 1, 12, 1, 12, 3, 12, 133, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 140, 8, 13, 1, 14, 1, 14, 1, 14, 5, 14, 145, 8, 14, 10, 14, 12, 14, 148, 9, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 0, 0, 17, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 0, 4, 1, 0, 5, 7, 1, 0, 5, 6, 1, 0, 1, 3, 2, 0, 4, 4, 21, 24, 162, 0, 37, 1, 0, 0, 0, 2, 47, 1, 0, 0, 0, 4, 65, 1, 0, 0, 0, 6, 71, 1, 0, 0, 0, 8, 82, 1, 0, 0, 0, 10, 93, 1, 0, 0, 0, 12, 95, 1, 0, 0, 0, 14, 104, 1, 0, 0, 0, 16, 110, 1, 0, 0, 0, 18, 114, 1, 0, 0, 0, 20, 120, 1, 0, 0, 0, 22, 126, 1, 0, 0, 0, 24, 130, 1, 0, 0, 0, 26, 139, 1, 0, 0, 0, 28, 141, 1, 0, 0, 0, 30, 149, 1, 0, 0, 0, 32, 151, 1, 0, 0, 0, 34, 36, 5, 28, 0, 0, 35, 34, 1, 0, 0, 0, 36, 39, 1, 0, 0, 0, 37, 35, 1, 0, 0, 0, 37, 38, 1, 0, 0, 0, 38, 41, 1, 0, 0, 0, 39, 37, 1, 0, 0, 0, 40, 42, 3, 2, 1, 0, 41, 40, 1, 0, 0, 0, 42, 43, 1, 0, 0, 0, 43, 41, 1, 0, 0, 0, 43, 44, 1, 0, 0, 0, 44, 45, 1, 0, 0, 0, 45, 46, 5, 0, 0, 1, 46, 1, 1, 0, 0, 0, 47, 49, 5, 20, 0, 0, 48, 50, 3, 4, 2, 0, 49, 48, 1, 0, 0, 0, 49, 50, 1, 0, 0, 0, 50, 53, 1, 0, 0, 0, 51, 52, 5, 9, 0, 0, 52, 54, 5, 20, 0, 0, 53, 51, 1, 0, 0, 0, 53, 54, 1, 0, 0, 0, 54, 55, 1, 0, 0, 0, 55, 56, 5, 5, 0, 0, 56, 58, 3, 6, 3, 0, 57, 59, 5, 10, 0, 0, 58, 57, 1, 0, 0, 0, 58, 59, 1, 0, 0, 0, 59, 61, 1, 0, 0, 0, 60, 62, 5, 28, 0, 0, 61, 60, 1, 0, 0, 0, 62, 63, 1, 0, 0, 0, 63, 61, 1, 0, 0, 0, 63, 64, 1, 0, 0, 0, 64, 3, 1, 0, 0, 0, 65, 66, 5, 12, 0, 0, 66, 67, 5, 21, 0, 0, 67, 68, 5, 9, 0, 0, 68, 69, 5, 21, 0, 0, 69, 70, 5, 13, 0, 0, 70, 5, 1, 0, 0, 0, 71, 76, 3, 8, 4, 0, 72, 73, 5, 8, 0, 0, 73, 75, 3, 8, 4, 0, 74, 72, 1, 0, 0, 0, 75, 78, 1, 0, 0, 0, 76, 74, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 7, 1, 0, 0, 0, 78, 76, 1, 0, 0, 0, 79, 81, 3, 10, 5, 0, 80, 79, 1, 0, 0, 0, 81, 84, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 82, 83, 1, 0, 0, 0, 83, 9, 1, 0, 0, 0, 84, 82, 1, 0, 0, 0, 85, 94, 3, 12, 6, 0, 86, 94, 3, 14, 7, 0, 87, 94, 3, 16, 8, 0, 88, 94, 3, 18, 9, 0, 89, 94, 3, 20, 10, 0, 90, 94, 3, 22, 11, 0, 91, 94, 3, 24, 12, 0, 92, 94, 3, 32, 16, 0, 93, 85, 1, 0, 0, 0, 93, 86, 1, 0, 0, 0, 93, 87, 1, 0, 0, 0, 93, 88, 1, 0, 0, 0, 93, 89, 1, 0, 0, 0, 93, 90, 1, 0, 0, 0, 93, 91, 1, 0, 0, 0, 93, 92, 1, 0, 0, 0, 94, 11, 1, 0, 0, 0, 95, 96, 3, 28, 14, 0, 96, 98, 7, 0, 0, 0, 97, 99, 5, 19, 0, 0, 98, 97, 1, 0, 0, 0, 98, 99, 1, 0, 0, 0, 99, 100, 1, 0, 0, 0, 100, 102, 3, 26, 13, 0, 101, 103, 3, 30, 15, 0, 102, 101, 1, 0, 0, 0, 102, 103, 1, 0, 0, 0, 103, 13, 1, 0, 0, 0, 104, 105, 5, 16, 0, 0, 105, 106, 3, 28, 14, 0, 106, 107, 7, 1, 0, 0, 107, 108, 3, 32, 16, 0, 108, 109, 5, 17, 0, 0, 109, 15, 1, 0, 0, 0, 110, 111, 5, 16, 0, 0, 111, 112, 5, 17, 0, 0, 112, 17, 1, 0, 0, 0, 113, 115, 5, 19, 0, 0, 114, 113, 1, 0, 0, 0, 114, 115, 1, 0, 0, 0, 115, 116, 1, 0, 0, 0, 116, 117, 5, 14, 0, 0, 117, 118, 5, 21, 0, 0, 118, 119, 5, 15, 0, 0, 119, 19, 1, 0, 0, 0, 120, 121, 5, 12, 0, 0, 121, 122, 3, 6, 3, 0, 122, 124, 5, 13, 0, 0, 123, 125, 3, 30, 15, 0, 124, 123, 1, 0, 0, 0, 124, 125, 1, 0, 0, 0, 125, 21, 1, 0, 0, 0, 126, 128, 5, 22, 0, 0, 127, 129, 3, 30, 15, 0, 128, 127, 1, 0, 0, 0, 128, 129, 1, 0, 0, 0, 129, 23, 1, 0, 0, 0, 130, 132, 5, 20, 0, 0, 131, 133, 3, 30, 15, 0, 132, 131, 1, 0, 0, 0, 132, 133, 1, 0, 0, 0, 133, 25, 1, 0, 0, 0, 134, 140, 3, 18, 9, 0, 135, 140, 3, 20, 10, 0, 136, 140, 3, 22, 11, 0, 137, 140, 3, 24, 12, 0, 138, 140, 3, 32, 16, 0, 139, 134, 1, 0, 0, 0, 139, 135, 1, 0, 0, 0, 139, 136, 1, 0, 0, 0, 139, 137, 1, 0, 0, 0, 139, 138, 1, 0, 0, 0, 140, 27, 1, 0, 0, 0, 141, 146, 5, 21, 0, 0, 142, 143, 5, 18, 0, 0, 143, 145, 5, 21, 0, 0, 144, 142, 1, 0, 0, 0, 145, 148, 1, 0, 0, 0, 146, 144, 1, 0, 0, 0, 146, 147, 1, 0, 0, 0, 147, 29, 1, 0, 0, 0, 148, 146, 1, 0, 0, 0, 149, 150, 7, 2, 0, 0, 150, 31, 1, 0, 0, 0, 151, 152, 7, 3, 0, 0, 152, 33, 1, 0, 0, 0, 17, 37, 43, 49, 53, 58, 63, 76, 82, 93, 98, 102, 114, 124, 128, 132, 139, 146]
\ No newline at end of file
diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnf.tokens b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnf.tokens
new file mode 100644
index 000000000..5c28d84ec
--- /dev/null
+++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnf.tokens
@@ -0,0 +1,46 @@
+T__0=1
+T__1=2
+T__2=3
+T__3=4
+ASSIGN=5
+ADD_ASSIGN=6
+BOOL_ASSIGN=7
+PIPE=8
+COLON=9
+SEMICOLON=10
+COMMA=11
+LPAREN=12
+RPAREN=13
+LBRACK=14
+RBRACK=15
+LBRACE=16
+RBRACE=17
+DOT=18
+TILDE=19
+UPPER_ID=20
+ID=21
+SINGLE_QUOTED_STRING=22
+INT=23
+STRING=24
+COMMENT=25
+WS=26
+CONTINUATION=27
+NL=28
+'*'=1
+'+'=2
+'?'=3
+'[QualifiedName]'=4
+'+='=6
+'?='=7
+'|'=8
+':'=9
+';'=10
+','=11
+'('=12
+')'=13
+'['=14
+']'=15
+'{'=16
+'}'=17
+'.'=18
+'~'=19
diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfBaseListener.cs b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfBaseListener.cs
new file mode 100644
index 000000000..1593400e7
--- /dev/null
+++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfBaseListener.cs
@@ -0,0 +1,257 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// ANTLR Version: 4.13.2
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+// Generated from C:/CODE/SysML2.NET/Resources/kebnf.g4 by ANTLR 4.13.2
+
+// Unreachable code detected
+#pragma warning disable 0162
+// The variable '...' is assigned but its value is never used
+#pragma warning disable 0219
+// Missing XML comment for publicly visible type or member '...'
+#pragma warning disable 1591
+// Ambiguous reference in cref attribute
+#pragma warning disable 419
+
+namespace SysML2.NET.CodeGenerator.Grammar {
+
+using Antlr4.Runtime.Misc;
+using IErrorNode = Antlr4.Runtime.Tree.IErrorNode;
+using ITerminalNode = Antlr4.Runtime.Tree.ITerminalNode;
+using IToken = Antlr4.Runtime.IToken;
+using ParserRuleContext = Antlr4.Runtime.ParserRuleContext;
+
+///
+/// This class provides an empty implementation of ,
+/// which can be extended to create a listener which only needs to handle a subset
+/// of the available methods.
+///
+[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.13.2")]
+[System.Diagnostics.DebuggerNonUserCode]
+[System.CLSCompliant(false)]
+public partial class kebnfBaseListener : IkebnfListener {
+ ///
+ /// Enter a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void EnterSpecification([NotNull] kebnfParser.SpecificationContext context) { }
+ ///
+ /// Exit a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void ExitSpecification([NotNull] kebnfParser.SpecificationContext context) { }
+ ///
+ /// Enter a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void EnterRule_definition([NotNull] kebnfParser.Rule_definitionContext context) { }
+ ///
+ /// Exit a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void ExitRule_definition([NotNull] kebnfParser.Rule_definitionContext context) { }
+ ///
+ /// Enter a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void EnterParameter_list([NotNull] kebnfParser.Parameter_listContext context) { }
+ ///
+ /// Exit a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void ExitParameter_list([NotNull] kebnfParser.Parameter_listContext context) { }
+ ///
+ /// Enter a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void EnterAlternatives([NotNull] kebnfParser.AlternativesContext context) { }
+ ///
+ /// Exit a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void ExitAlternatives([NotNull] kebnfParser.AlternativesContext context) { }
+ ///
+ /// Enter a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void EnterAlternative([NotNull] kebnfParser.AlternativeContext context) { }
+ ///
+ /// Exit a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void ExitAlternative([NotNull] kebnfParser.AlternativeContext context) { }
+ ///
+ /// Enter a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void EnterElement([NotNull] kebnfParser.ElementContext context) { }
+ ///
+ /// Exit a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void ExitElement([NotNull] kebnfParser.ElementContext context) { }
+ ///
+ /// Enter a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void EnterAssignment([NotNull] kebnfParser.AssignmentContext context) { }
+ ///
+ /// Exit a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void ExitAssignment([NotNull] kebnfParser.AssignmentContext context) { }
+ ///
+ /// Enter a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void EnterNon_parsing_assignment([NotNull] kebnfParser.Non_parsing_assignmentContext context) { }
+ ///
+ /// Exit a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void ExitNon_parsing_assignment([NotNull] kebnfParser.Non_parsing_assignmentContext context) { }
+ ///
+ /// Enter a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void EnterNon_parsing_empty([NotNull] kebnfParser.Non_parsing_emptyContext context) { }
+ ///
+ /// Exit a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void ExitNon_parsing_empty([NotNull] kebnfParser.Non_parsing_emptyContext context) { }
+ ///
+ /// Enter a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void EnterCross_reference([NotNull] kebnfParser.Cross_referenceContext context) { }
+ ///
+ /// Exit a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void ExitCross_reference([NotNull] kebnfParser.Cross_referenceContext context) { }
+ ///
+ /// Enter a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void EnterGroup([NotNull] kebnfParser.GroupContext context) { }
+ ///
+ /// Exit a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void ExitGroup([NotNull] kebnfParser.GroupContext context) { }
+ ///
+ /// Enter a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void EnterTerminal([NotNull] kebnfParser.TerminalContext context) { }
+ ///
+ /// Exit a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void ExitTerminal([NotNull] kebnfParser.TerminalContext context) { }
+ ///
+ /// Enter a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void EnterNon_terminal([NotNull] kebnfParser.Non_terminalContext context) { }
+ ///
+ /// Exit a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void ExitNon_terminal([NotNull] kebnfParser.Non_terminalContext context) { }
+ ///
+ /// Enter a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void EnterElement_core([NotNull] kebnfParser.Element_coreContext context) { }
+ ///
+ /// Exit a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void ExitElement_core([NotNull] kebnfParser.Element_coreContext context) { }
+ ///
+ /// Enter a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void EnterDotted_id([NotNull] kebnfParser.Dotted_idContext context) { }
+ ///
+ /// Exit a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void ExitDotted_id([NotNull] kebnfParser.Dotted_idContext context) { }
+ ///
+ /// Enter a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void EnterSuffix_op([NotNull] kebnfParser.Suffix_opContext context) { }
+ ///
+ /// Exit a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void ExitSuffix_op([NotNull] kebnfParser.Suffix_opContext context) { }
+ ///
+ /// Enter a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void EnterValue_literal([NotNull] kebnfParser.Value_literalContext context) { }
+ ///
+ /// Exit a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void ExitValue_literal([NotNull] kebnfParser.Value_literalContext context) { }
+
+ ///
+ /// The default implementation does nothing.
+ public virtual void EnterEveryRule([NotNull] ParserRuleContext context) { }
+ ///
+ /// The default implementation does nothing.
+ public virtual void ExitEveryRule([NotNull] ParserRuleContext context) { }
+ ///
+ /// The default implementation does nothing.
+ public virtual void VisitTerminal([NotNull] ITerminalNode node) { }
+ ///
+ /// The default implementation does nothing.
+ public virtual void VisitErrorNode([NotNull] IErrorNode node) { }
+}
+} // namespace SysML2.NET.CodeGenerator.Grammar
diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfBaseVisitor.cs b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfBaseVisitor.cs
new file mode 100644
index 000000000..3a64587f2
--- /dev/null
+++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfBaseVisitor.cs
@@ -0,0 +1,209 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// ANTLR Version: 4.13.2
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+// Generated from C:/CODE/SysML2.NET/Resources/kebnf.g4 by ANTLR 4.13.2
+
+// Unreachable code detected
+#pragma warning disable 0162
+// The variable '...' is assigned but its value is never used
+#pragma warning disable 0219
+// Missing XML comment for publicly visible type or member '...'
+#pragma warning disable 1591
+// Ambiguous reference in cref attribute
+#pragma warning disable 419
+
+namespace SysML2.NET.CodeGenerator.Grammar {
+using Antlr4.Runtime.Misc;
+using Antlr4.Runtime.Tree;
+using IToken = Antlr4.Runtime.IToken;
+using ParserRuleContext = Antlr4.Runtime.ParserRuleContext;
+
+///
+/// This class provides an empty implementation of ,
+/// which can be extended to create a visitor which only needs to handle a subset
+/// of the available methods.
+///
+/// The return type of the visit operation.
+[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.13.2")]
+[System.Diagnostics.DebuggerNonUserCode]
+[System.CLSCompliant(false)]
+public partial class kebnfBaseVisitor : AbstractParseTreeVisitor, IkebnfVisitor {
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitSpecification([NotNull] kebnfParser.SpecificationContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitRule_definition([NotNull] kebnfParser.Rule_definitionContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitParameter_list([NotNull] kebnfParser.Parameter_listContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitAlternatives([NotNull] kebnfParser.AlternativesContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitAlternative([NotNull] kebnfParser.AlternativeContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitElement([NotNull] kebnfParser.ElementContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitAssignment([NotNull] kebnfParser.AssignmentContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitNon_parsing_assignment([NotNull] kebnfParser.Non_parsing_assignmentContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitNon_parsing_empty([NotNull] kebnfParser.Non_parsing_emptyContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitCross_reference([NotNull] kebnfParser.Cross_referenceContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitGroup([NotNull] kebnfParser.GroupContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitTerminal([NotNull] kebnfParser.TerminalContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitNon_terminal([NotNull] kebnfParser.Non_terminalContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitElement_core([NotNull] kebnfParser.Element_coreContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitDotted_id([NotNull] kebnfParser.Dotted_idContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitSuffix_op([NotNull] kebnfParser.Suffix_opContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitValue_literal([NotNull] kebnfParser.Value_literalContext context) { return VisitChildren(context); }
+}
+} // namespace SysML2.NET.CodeGenerator.Grammar
diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.cs b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.cs
new file mode 100644
index 000000000..bae07a492
--- /dev/null
+++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.cs
@@ -0,0 +1,176 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// ANTLR Version: 4.13.2
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+// Generated from C:/CODE/SysML2.NET/Resources/kebnf.g4 by ANTLR 4.13.2
+
+// Unreachable code detected
+#pragma warning disable 0162
+// The variable '...' is assigned but its value is never used
+#pragma warning disable 0219
+// Missing XML comment for publicly visible type or member '...'
+#pragma warning disable 1591
+// Ambiguous reference in cref attribute
+#pragma warning disable 419
+
+namespace SysML2.NET.CodeGenerator.Grammar {
+using System;
+using System.IO;
+using System.Text;
+using Antlr4.Runtime;
+using Antlr4.Runtime.Atn;
+using Antlr4.Runtime.Misc;
+using DFA = Antlr4.Runtime.Dfa.DFA;
+
+[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.13.2")]
+[System.CLSCompliant(false)]
+public partial class kebnfLexer : Lexer {
+ protected static DFA[] decisionToDFA;
+ protected static PredictionContextCache sharedContextCache = new PredictionContextCache();
+ public const int
+ T__0=1, T__1=2, T__2=3, T__3=4, ASSIGN=5, ADD_ASSIGN=6, BOOL_ASSIGN=7,
+ PIPE=8, COLON=9, SEMICOLON=10, COMMA=11, LPAREN=12, RPAREN=13, LBRACK=14,
+ RBRACK=15, LBRACE=16, RBRACE=17, DOT=18, TILDE=19, UPPER_ID=20, ID=21,
+ SINGLE_QUOTED_STRING=22, INT=23, STRING=24, COMMENT=25, WS=26, CONTINUATION=27,
+ NL=28;
+ public static string[] channelNames = {
+ "DEFAULT_TOKEN_CHANNEL", "HIDDEN"
+ };
+
+ public static string[] modeNames = {
+ "DEFAULT_MODE"
+ };
+
+ public static readonly string[] ruleNames = {
+ "T__0", "T__1", "T__2", "T__3", "ASSIGN", "ADD_ASSIGN", "BOOL_ASSIGN",
+ "PIPE", "COLON", "SEMICOLON", "COMMA", "LPAREN", "RPAREN", "LBRACK", "RBRACK",
+ "LBRACE", "RBRACE", "DOT", "TILDE", "UPPER_ID", "ID", "SINGLE_QUOTED_STRING",
+ "INT", "STRING", "COMMENT", "WS", "CONTINUATION", "NL"
+ };
+
+
+ public kebnfLexer(ICharStream input)
+ : this(input, Console.Out, Console.Error) { }
+
+ public kebnfLexer(ICharStream input, TextWriter output, TextWriter errorOutput)
+ : base(input, output, errorOutput)
+ {
+ Interpreter = new LexerATNSimulator(this, _ATN, decisionToDFA, sharedContextCache);
+ }
+
+ private static readonly string[] _LiteralNames = {
+ null, "'*'", "'+'", "'?'", "'[QualifiedName]'", null, "'+='", "'?='",
+ "'|'", "':'", "';'", "','", "'('", "')'", "'['", "']'", "'{'", "'}'",
+ "'.'", "'~'"
+ };
+ private static readonly string[] _SymbolicNames = {
+ null, null, null, null, null, "ASSIGN", "ADD_ASSIGN", "BOOL_ASSIGN", "PIPE",
+ "COLON", "SEMICOLON", "COMMA", "LPAREN", "RPAREN", "LBRACK", "RBRACK",
+ "LBRACE", "RBRACE", "DOT", "TILDE", "UPPER_ID", "ID", "SINGLE_QUOTED_STRING",
+ "INT", "STRING", "COMMENT", "WS", "CONTINUATION", "NL"
+ };
+ public static readonly IVocabulary DefaultVocabulary = new Vocabulary(_LiteralNames, _SymbolicNames);
+
+ [NotNull]
+ public override IVocabulary Vocabulary
+ {
+ get
+ {
+ return DefaultVocabulary;
+ }
+ }
+
+ public override string GrammarFileName { get { return "kebnf.g4"; } }
+
+ public override string[] RuleNames { get { return ruleNames; } }
+
+ public override string[] ChannelNames { get { return channelNames; } }
+
+ public override string[] ModeNames { get { return modeNames; } }
+
+ public override int[] SerializedAtn { get { return _serializedATN; } }
+
+ static kebnfLexer() {
+ decisionToDFA = new DFA[_ATN.NumberOfDecisions];
+ for (int i = 0; i < _ATN.NumberOfDecisions; i++) {
+ decisionToDFA[i] = new DFA(_ATN.GetDecisionState(i), i);
+ }
+ }
+ private static int[] _serializedATN = {
+ 4,0,28,190,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,
+ 6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,
+ 7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21,
+ 7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,26,2,27,7,27,1,0,1,
+ 0,1,1,1,1,1,2,1,2,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,
+ 1,3,1,3,1,3,1,4,1,4,1,4,1,4,3,4,84,8,4,1,5,1,5,1,5,1,6,1,6,1,6,1,7,1,7,
+ 1,8,1,8,1,9,1,9,1,10,1,10,1,11,1,11,1,12,1,12,1,13,1,13,1,14,1,14,1,15,
+ 1,15,1,16,1,16,1,17,1,17,1,18,1,18,1,19,1,19,5,19,118,8,19,10,19,12,19,
+ 121,9,19,1,20,1,20,5,20,125,8,20,10,20,12,20,128,9,20,1,21,1,21,1,21,1,
+ 21,5,21,134,8,21,10,21,12,21,137,9,21,1,21,1,21,1,22,4,22,142,8,22,11,
+ 22,12,22,143,1,23,1,23,1,23,1,23,5,23,150,8,23,10,23,12,23,153,9,23,1,
+ 23,1,23,1,24,1,24,1,24,1,24,5,24,161,8,24,10,24,12,24,164,9,24,1,24,1,
+ 24,1,25,4,25,169,8,25,11,25,12,25,170,1,25,1,25,1,26,3,26,176,8,26,1,26,
+ 1,26,4,26,180,8,26,11,26,12,26,181,1,26,1,26,1,27,3,27,187,8,27,1,27,1,
+ 27,0,0,28,1,1,3,2,5,3,7,4,9,5,11,6,13,7,15,8,17,9,19,10,21,11,23,12,25,
+ 13,27,14,29,15,31,16,33,17,35,18,37,19,39,20,41,21,43,22,45,23,47,24,49,
+ 25,51,26,53,27,55,28,1,0,7,1,0,65,90,4,0,48,57,65,90,95,95,97,122,3,0,
+ 65,90,95,95,97,122,2,0,39,39,92,92,1,0,48,57,2,0,10,10,13,13,2,0,9,9,32,
+ 32,202,0,1,1,0,0,0,0,3,1,0,0,0,0,5,1,0,0,0,0,7,1,0,0,0,0,9,1,0,0,0,0,11,
+ 1,0,0,0,0,13,1,0,0,0,0,15,1,0,0,0,0,17,1,0,0,0,0,19,1,0,0,0,0,21,1,0,0,
+ 0,0,23,1,0,0,0,0,25,1,0,0,0,0,27,1,0,0,0,0,29,1,0,0,0,0,31,1,0,0,0,0,33,
+ 1,0,0,0,0,35,1,0,0,0,0,37,1,0,0,0,0,39,1,0,0,0,0,41,1,0,0,0,0,43,1,0,0,
+ 0,0,45,1,0,0,0,0,47,1,0,0,0,0,49,1,0,0,0,0,51,1,0,0,0,0,53,1,0,0,0,0,55,
+ 1,0,0,0,1,57,1,0,0,0,3,59,1,0,0,0,5,61,1,0,0,0,7,63,1,0,0,0,9,83,1,0,0,
+ 0,11,85,1,0,0,0,13,88,1,0,0,0,15,91,1,0,0,0,17,93,1,0,0,0,19,95,1,0,0,
+ 0,21,97,1,0,0,0,23,99,1,0,0,0,25,101,1,0,0,0,27,103,1,0,0,0,29,105,1,0,
+ 0,0,31,107,1,0,0,0,33,109,1,0,0,0,35,111,1,0,0,0,37,113,1,0,0,0,39,115,
+ 1,0,0,0,41,122,1,0,0,0,43,129,1,0,0,0,45,141,1,0,0,0,47,145,1,0,0,0,49,
+ 156,1,0,0,0,51,168,1,0,0,0,53,175,1,0,0,0,55,186,1,0,0,0,57,58,5,42,0,
+ 0,58,2,1,0,0,0,59,60,5,43,0,0,60,4,1,0,0,0,61,62,5,63,0,0,62,6,1,0,0,0,
+ 63,64,5,91,0,0,64,65,5,81,0,0,65,66,5,117,0,0,66,67,5,97,0,0,67,68,5,108,
+ 0,0,68,69,5,105,0,0,69,70,5,102,0,0,70,71,5,105,0,0,71,72,5,101,0,0,72,
+ 73,5,100,0,0,73,74,5,78,0,0,74,75,5,97,0,0,75,76,5,109,0,0,76,77,5,101,
+ 0,0,77,78,5,93,0,0,78,8,1,0,0,0,79,80,5,58,0,0,80,81,5,58,0,0,81,84,5,
+ 61,0,0,82,84,5,61,0,0,83,79,1,0,0,0,83,82,1,0,0,0,84,10,1,0,0,0,85,86,
+ 5,43,0,0,86,87,5,61,0,0,87,12,1,0,0,0,88,89,5,63,0,0,89,90,5,61,0,0,90,
+ 14,1,0,0,0,91,92,5,124,0,0,92,16,1,0,0,0,93,94,5,58,0,0,94,18,1,0,0,0,
+ 95,96,5,59,0,0,96,20,1,0,0,0,97,98,5,44,0,0,98,22,1,0,0,0,99,100,5,40,
+ 0,0,100,24,1,0,0,0,101,102,5,41,0,0,102,26,1,0,0,0,103,104,5,91,0,0,104,
+ 28,1,0,0,0,105,106,5,93,0,0,106,30,1,0,0,0,107,108,5,123,0,0,108,32,1,
+ 0,0,0,109,110,5,125,0,0,110,34,1,0,0,0,111,112,5,46,0,0,112,36,1,0,0,0,
+ 113,114,5,126,0,0,114,38,1,0,0,0,115,119,7,0,0,0,116,118,7,1,0,0,117,116,
+ 1,0,0,0,118,121,1,0,0,0,119,117,1,0,0,0,119,120,1,0,0,0,120,40,1,0,0,0,
+ 121,119,1,0,0,0,122,126,7,2,0,0,123,125,7,1,0,0,124,123,1,0,0,0,125,128,
+ 1,0,0,0,126,124,1,0,0,0,126,127,1,0,0,0,127,42,1,0,0,0,128,126,1,0,0,0,
+ 129,135,5,39,0,0,130,134,8,3,0,0,131,132,5,92,0,0,132,134,9,0,0,0,133,
+ 130,1,0,0,0,133,131,1,0,0,0,134,137,1,0,0,0,135,133,1,0,0,0,135,136,1,
+ 0,0,0,136,138,1,0,0,0,137,135,1,0,0,0,138,139,5,39,0,0,139,44,1,0,0,0,
+ 140,142,7,4,0,0,141,140,1,0,0,0,142,143,1,0,0,0,143,141,1,0,0,0,143,144,
+ 1,0,0,0,144,46,1,0,0,0,145,151,5,39,0,0,146,150,8,3,0,0,147,148,5,92,0,
+ 0,148,150,9,0,0,0,149,146,1,0,0,0,149,147,1,0,0,0,150,153,1,0,0,0,151,
+ 149,1,0,0,0,151,152,1,0,0,0,152,154,1,0,0,0,153,151,1,0,0,0,154,155,5,
+ 39,0,0,155,48,1,0,0,0,156,157,5,47,0,0,157,158,5,47,0,0,158,162,1,0,0,
+ 0,159,161,8,5,0,0,160,159,1,0,0,0,161,164,1,0,0,0,162,160,1,0,0,0,162,
+ 163,1,0,0,0,163,165,1,0,0,0,164,162,1,0,0,0,165,166,6,24,0,0,166,50,1,
+ 0,0,0,167,169,7,6,0,0,168,167,1,0,0,0,169,170,1,0,0,0,170,168,1,0,0,0,
+ 170,171,1,0,0,0,171,172,1,0,0,0,172,173,6,25,0,0,173,52,1,0,0,0,174,176,
+ 5,13,0,0,175,174,1,0,0,0,175,176,1,0,0,0,176,177,1,0,0,0,177,179,5,10,
+ 0,0,178,180,7,6,0,0,179,178,1,0,0,0,180,181,1,0,0,0,181,179,1,0,0,0,181,
+ 182,1,0,0,0,182,183,1,0,0,0,183,184,6,26,0,0,184,54,1,0,0,0,185,187,5,
+ 13,0,0,186,185,1,0,0,0,186,187,1,0,0,0,187,188,1,0,0,0,188,189,5,10,0,
+ 0,189,56,1,0,0,0,14,0,83,119,126,133,135,143,149,151,162,170,175,181,186,
+ 1,6,0,0
+ };
+
+ public static readonly ATN _ATN =
+ new ATNDeserializer().Deserialize(_serializedATN);
+
+
+}
+} // namespace SysML2.NET.CodeGenerator.Grammar
diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.interp b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.interp
new file mode 100644
index 000000000..753b3d36c
--- /dev/null
+++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.interp
@@ -0,0 +1,101 @@
+token literal names:
+null
+'*'
+'+'
+'?'
+'[QualifiedName]'
+null
+'+='
+'?='
+'|'
+':'
+';'
+','
+'('
+')'
+'['
+']'
+'{'
+'}'
+'.'
+'~'
+null
+null
+null
+null
+null
+null
+null
+null
+null
+
+token symbolic names:
+null
+null
+null
+null
+null
+ASSIGN
+ADD_ASSIGN
+BOOL_ASSIGN
+PIPE
+COLON
+SEMICOLON
+COMMA
+LPAREN
+RPAREN
+LBRACK
+RBRACK
+LBRACE
+RBRACE
+DOT
+TILDE
+UPPER_ID
+ID
+SINGLE_QUOTED_STRING
+INT
+STRING
+COMMENT
+WS
+CONTINUATION
+NL
+
+rule names:
+T__0
+T__1
+T__2
+T__3
+ASSIGN
+ADD_ASSIGN
+BOOL_ASSIGN
+PIPE
+COLON
+SEMICOLON
+COMMA
+LPAREN
+RPAREN
+LBRACK
+RBRACK
+LBRACE
+RBRACE
+DOT
+TILDE
+UPPER_ID
+ID
+SINGLE_QUOTED_STRING
+INT
+STRING
+COMMENT
+WS
+CONTINUATION
+NL
+
+channel names:
+DEFAULT_TOKEN_CHANNEL
+HIDDEN
+
+mode names:
+DEFAULT_MODE
+
+atn:
+[4, 0, 28, 190, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 84, 8, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 18, 1, 18, 1, 19, 1, 19, 5, 19, 118, 8, 19, 10, 19, 12, 19, 121, 9, 19, 1, 20, 1, 20, 5, 20, 125, 8, 20, 10, 20, 12, 20, 128, 9, 20, 1, 21, 1, 21, 1, 21, 1, 21, 5, 21, 134, 8, 21, 10, 21, 12, 21, 137, 9, 21, 1, 21, 1, 21, 1, 22, 4, 22, 142, 8, 22, 11, 22, 12, 22, 143, 1, 23, 1, 23, 1, 23, 1, 23, 5, 23, 150, 8, 23, 10, 23, 12, 23, 153, 9, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 5, 24, 161, 8, 24, 10, 24, 12, 24, 164, 9, 24, 1, 24, 1, 24, 1, 25, 4, 25, 169, 8, 25, 11, 25, 12, 25, 170, 1, 25, 1, 25, 1, 26, 3, 26, 176, 8, 26, 1, 26, 1, 26, 4, 26, 180, 8, 26, 11, 26, 12, 26, 181, 1, 26, 1, 26, 1, 27, 3, 27, 187, 8, 27, 1, 27, 1, 27, 0, 0, 28, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 1, 0, 7, 1, 0, 65, 90, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 3, 0, 65, 90, 95, 95, 97, 122, 2, 0, 39, 39, 92, 92, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, 0, 9, 9, 32, 32, 202, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 1, 57, 1, 0, 0, 0, 3, 59, 1, 0, 0, 0, 5, 61, 1, 0, 0, 0, 7, 63, 1, 0, 0, 0, 9, 83, 1, 0, 0, 0, 11, 85, 1, 0, 0, 0, 13, 88, 1, 0, 0, 0, 15, 91, 1, 0, 0, 0, 17, 93, 1, 0, 0, 0, 19, 95, 1, 0, 0, 0, 21, 97, 1, 0, 0, 0, 23, 99, 1, 0, 0, 0, 25, 101, 1, 0, 0, 0, 27, 103, 1, 0, 0, 0, 29, 105, 1, 0, 0, 0, 31, 107, 1, 0, 0, 0, 33, 109, 1, 0, 0, 0, 35, 111, 1, 0, 0, 0, 37, 113, 1, 0, 0, 0, 39, 115, 1, 0, 0, 0, 41, 122, 1, 0, 0, 0, 43, 129, 1, 0, 0, 0, 45, 141, 1, 0, 0, 0, 47, 145, 1, 0, 0, 0, 49, 156, 1, 0, 0, 0, 51, 168, 1, 0, 0, 0, 53, 175, 1, 0, 0, 0, 55, 186, 1, 0, 0, 0, 57, 58, 5, 42, 0, 0, 58, 2, 1, 0, 0, 0, 59, 60, 5, 43, 0, 0, 60, 4, 1, 0, 0, 0, 61, 62, 5, 63, 0, 0, 62, 6, 1, 0, 0, 0, 63, 64, 5, 91, 0, 0, 64, 65, 5, 81, 0, 0, 65, 66, 5, 117, 0, 0, 66, 67, 5, 97, 0, 0, 67, 68, 5, 108, 0, 0, 68, 69, 5, 105, 0, 0, 69, 70, 5, 102, 0, 0, 70, 71, 5, 105, 0, 0, 71, 72, 5, 101, 0, 0, 72, 73, 5, 100, 0, 0, 73, 74, 5, 78, 0, 0, 74, 75, 5, 97, 0, 0, 75, 76, 5, 109, 0, 0, 76, 77, 5, 101, 0, 0, 77, 78, 5, 93, 0, 0, 78, 8, 1, 0, 0, 0, 79, 80, 5, 58, 0, 0, 80, 81, 5, 58, 0, 0, 81, 84, 5, 61, 0, 0, 82, 84, 5, 61, 0, 0, 83, 79, 1, 0, 0, 0, 83, 82, 1, 0, 0, 0, 84, 10, 1, 0, 0, 0, 85, 86, 5, 43, 0, 0, 86, 87, 5, 61, 0, 0, 87, 12, 1, 0, 0, 0, 88, 89, 5, 63, 0, 0, 89, 90, 5, 61, 0, 0, 90, 14, 1, 0, 0, 0, 91, 92, 5, 124, 0, 0, 92, 16, 1, 0, 0, 0, 93, 94, 5, 58, 0, 0, 94, 18, 1, 0, 0, 0, 95, 96, 5, 59, 0, 0, 96, 20, 1, 0, 0, 0, 97, 98, 5, 44, 0, 0, 98, 22, 1, 0, 0, 0, 99, 100, 5, 40, 0, 0, 100, 24, 1, 0, 0, 0, 101, 102, 5, 41, 0, 0, 102, 26, 1, 0, 0, 0, 103, 104, 5, 91, 0, 0, 104, 28, 1, 0, 0, 0, 105, 106, 5, 93, 0, 0, 106, 30, 1, 0, 0, 0, 107, 108, 5, 123, 0, 0, 108, 32, 1, 0, 0, 0, 109, 110, 5, 125, 0, 0, 110, 34, 1, 0, 0, 0, 111, 112, 5, 46, 0, 0, 112, 36, 1, 0, 0, 0, 113, 114, 5, 126, 0, 0, 114, 38, 1, 0, 0, 0, 115, 119, 7, 0, 0, 0, 116, 118, 7, 1, 0, 0, 117, 116, 1, 0, 0, 0, 118, 121, 1, 0, 0, 0, 119, 117, 1, 0, 0, 0, 119, 120, 1, 0, 0, 0, 120, 40, 1, 0, 0, 0, 121, 119, 1, 0, 0, 0, 122, 126, 7, 2, 0, 0, 123, 125, 7, 1, 0, 0, 124, 123, 1, 0, 0, 0, 125, 128, 1, 0, 0, 0, 126, 124, 1, 0, 0, 0, 126, 127, 1, 0, 0, 0, 127, 42, 1, 0, 0, 0, 128, 126, 1, 0, 0, 0, 129, 135, 5, 39, 0, 0, 130, 134, 8, 3, 0, 0, 131, 132, 5, 92, 0, 0, 132, 134, 9, 0, 0, 0, 133, 130, 1, 0, 0, 0, 133, 131, 1, 0, 0, 0, 134, 137, 1, 0, 0, 0, 135, 133, 1, 0, 0, 0, 135, 136, 1, 0, 0, 0, 136, 138, 1, 0, 0, 0, 137, 135, 1, 0, 0, 0, 138, 139, 5, 39, 0, 0, 139, 44, 1, 0, 0, 0, 140, 142, 7, 4, 0, 0, 141, 140, 1, 0, 0, 0, 142, 143, 1, 0, 0, 0, 143, 141, 1, 0, 0, 0, 143, 144, 1, 0, 0, 0, 144, 46, 1, 0, 0, 0, 145, 151, 5, 39, 0, 0, 146, 150, 8, 3, 0, 0, 147, 148, 5, 92, 0, 0, 148, 150, 9, 0, 0, 0, 149, 146, 1, 0, 0, 0, 149, 147, 1, 0, 0, 0, 150, 153, 1, 0, 0, 0, 151, 149, 1, 0, 0, 0, 151, 152, 1, 0, 0, 0, 152, 154, 1, 0, 0, 0, 153, 151, 1, 0, 0, 0, 154, 155, 5, 39, 0, 0, 155, 48, 1, 0, 0, 0, 156, 157, 5, 47, 0, 0, 157, 158, 5, 47, 0, 0, 158, 162, 1, 0, 0, 0, 159, 161, 8, 5, 0, 0, 160, 159, 1, 0, 0, 0, 161, 164, 1, 0, 0, 0, 162, 160, 1, 0, 0, 0, 162, 163, 1, 0, 0, 0, 163, 165, 1, 0, 0, 0, 164, 162, 1, 0, 0, 0, 165, 166, 6, 24, 0, 0, 166, 50, 1, 0, 0, 0, 167, 169, 7, 6, 0, 0, 168, 167, 1, 0, 0, 0, 169, 170, 1, 0, 0, 0, 170, 168, 1, 0, 0, 0, 170, 171, 1, 0, 0, 0, 171, 172, 1, 0, 0, 0, 172, 173, 6, 25, 0, 0, 173, 52, 1, 0, 0, 0, 174, 176, 5, 13, 0, 0, 175, 174, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 179, 5, 10, 0, 0, 178, 180, 7, 6, 0, 0, 179, 178, 1, 0, 0, 0, 180, 181, 1, 0, 0, 0, 181, 179, 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 183, 1, 0, 0, 0, 183, 184, 6, 26, 0, 0, 184, 54, 1, 0, 0, 0, 185, 187, 5, 13, 0, 0, 186, 185, 1, 0, 0, 0, 186, 187, 1, 0, 0, 0, 187, 188, 1, 0, 0, 0, 188, 189, 5, 10, 0, 0, 189, 56, 1, 0, 0, 0, 14, 0, 83, 119, 126, 133, 135, 143, 149, 151, 162, 170, 175, 181, 186, 1, 6, 0, 0]
\ No newline at end of file
diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.tokens b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.tokens
new file mode 100644
index 000000000..5c28d84ec
--- /dev/null
+++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfLexer.tokens
@@ -0,0 +1,46 @@
+T__0=1
+T__1=2
+T__2=3
+T__3=4
+ASSIGN=5
+ADD_ASSIGN=6
+BOOL_ASSIGN=7
+PIPE=8
+COLON=9
+SEMICOLON=10
+COMMA=11
+LPAREN=12
+RPAREN=13
+LBRACK=14
+RBRACK=15
+LBRACE=16
+RBRACE=17
+DOT=18
+TILDE=19
+UPPER_ID=20
+ID=21
+SINGLE_QUOTED_STRING=22
+INT=23
+STRING=24
+COMMENT=25
+WS=26
+CONTINUATION=27
+NL=28
+'*'=1
+'+'=2
+'?'=3
+'[QualifiedName]'=4
+'+='=6
+'?='=7
+'|'=8
+':'=9
+';'=10
+','=11
+'('=12
+')'=13
+'['=14
+']'=15
+'{'=16
+'}'=17
+'.'=18
+'~'=19
diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfListener.cs b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfListener.cs
new file mode 100644
index 000000000..154345220
--- /dev/null
+++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfListener.cs
@@ -0,0 +1,205 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// ANTLR Version: 4.13.2
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+// Generated from C:/CODE/SysML2.NET/Resources/kebnf.g4 by ANTLR 4.13.2
+
+// Unreachable code detected
+#pragma warning disable 0162
+// The variable '...' is assigned but its value is never used
+#pragma warning disable 0219
+// Missing XML comment for publicly visible type or member '...'
+#pragma warning disable 1591
+// Ambiguous reference in cref attribute
+#pragma warning disable 419
+
+namespace SysML2.NET.CodeGenerator.Grammar {
+using Antlr4.Runtime.Misc;
+using IParseTreeListener = Antlr4.Runtime.Tree.IParseTreeListener;
+using IToken = Antlr4.Runtime.IToken;
+
+///
+/// This interface defines a complete listener for a parse tree produced by
+/// .
+///
+[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.13.2")]
+[System.CLSCompliant(false)]
+public interface IkebnfListener : IParseTreeListener {
+ ///
+ /// Enter a parse tree produced by .
+ ///
+ /// The parse tree.
+ void EnterSpecification([NotNull] kebnfParser.SpecificationContext context);
+ ///
+ /// Exit a parse tree produced by .
+ ///
+ /// The parse tree.
+ void ExitSpecification([NotNull] kebnfParser.SpecificationContext context);
+ ///
+ /// Enter a parse tree produced by .
+ ///
+ /// The parse tree.
+ void EnterRule_definition([NotNull] kebnfParser.Rule_definitionContext context);
+ ///
+ /// Exit a parse tree produced by .
+ ///
+ /// The parse tree.
+ void ExitRule_definition([NotNull] kebnfParser.Rule_definitionContext context);
+ ///
+ /// Enter a parse tree produced by .
+ ///
+ /// The parse tree.
+ void EnterParameter_list([NotNull] kebnfParser.Parameter_listContext context);
+ ///
+ /// Exit a parse tree produced by .
+ ///
+ /// The parse tree.
+ void ExitParameter_list([NotNull] kebnfParser.Parameter_listContext context);
+ ///
+ /// Enter a parse tree produced by .
+ ///
+ /// The parse tree.
+ void EnterAlternatives([NotNull] kebnfParser.AlternativesContext context);
+ ///
+ /// Exit a parse tree produced by .
+ ///
+ /// The parse tree.
+ void ExitAlternatives([NotNull] kebnfParser.AlternativesContext context);
+ ///
+ /// Enter a parse tree produced by .
+ ///
+ /// The parse tree.
+ void EnterAlternative([NotNull] kebnfParser.AlternativeContext context);
+ ///
+ /// Exit a parse tree produced by .
+ ///
+ /// The parse tree.
+ void ExitAlternative([NotNull] kebnfParser.AlternativeContext context);
+ ///
+ /// Enter a parse tree produced by .
+ ///
+ /// The parse tree.
+ void EnterElement([NotNull] kebnfParser.ElementContext context);
+ ///
+ /// Exit a parse tree produced by .
+ ///
+ /// The parse tree.
+ void ExitElement([NotNull] kebnfParser.ElementContext context);
+ ///
+ /// Enter a parse tree produced by .
+ ///
+ /// The parse tree.
+ void EnterAssignment([NotNull] kebnfParser.AssignmentContext context);
+ ///
+ /// Exit a parse tree produced by .
+ ///
+ /// The parse tree.
+ void ExitAssignment([NotNull] kebnfParser.AssignmentContext context);
+ ///
+ /// Enter a parse tree produced by .
+ ///
+ /// The parse tree.
+ void EnterNon_parsing_assignment([NotNull] kebnfParser.Non_parsing_assignmentContext context);
+ ///
+ /// Exit a parse tree produced by .
+ ///
+ /// The parse tree.
+ void ExitNon_parsing_assignment([NotNull] kebnfParser.Non_parsing_assignmentContext context);
+ ///
+ /// Enter a parse tree produced by .
+ ///
+ /// The parse tree.
+ void EnterNon_parsing_empty([NotNull] kebnfParser.Non_parsing_emptyContext context);
+ ///
+ /// Exit a parse tree produced by .
+ ///
+ /// The parse tree.
+ void ExitNon_parsing_empty([NotNull] kebnfParser.Non_parsing_emptyContext context);
+ ///
+ /// Enter a parse tree produced by .
+ ///
+ /// The parse tree.
+ void EnterCross_reference([NotNull] kebnfParser.Cross_referenceContext context);
+ ///
+ /// Exit a parse tree produced by .
+ ///
+ /// The parse tree.
+ void ExitCross_reference([NotNull] kebnfParser.Cross_referenceContext context);
+ ///
+ /// Enter a parse tree produced by .
+ ///
+ /// The parse tree.
+ void EnterGroup([NotNull] kebnfParser.GroupContext context);
+ ///
+ /// Exit a parse tree produced by .
+ ///
+ /// The parse tree.
+ void ExitGroup([NotNull] kebnfParser.GroupContext context);
+ ///
+ /// Enter a parse tree produced by .
+ ///
+ /// The parse tree.
+ void EnterTerminal([NotNull] kebnfParser.TerminalContext context);
+ ///
+ /// Exit a parse tree produced by .
+ ///
+ /// The parse tree.
+ void ExitTerminal([NotNull] kebnfParser.TerminalContext context);
+ ///
+ /// Enter a parse tree produced by .
+ ///
+ /// The parse tree.
+ void EnterNon_terminal([NotNull] kebnfParser.Non_terminalContext context);
+ ///
+ /// Exit a parse tree produced by .
+ ///
+ /// The parse tree.
+ void ExitNon_terminal([NotNull] kebnfParser.Non_terminalContext context);
+ ///
+ /// Enter a parse tree produced by .
+ ///
+ /// The parse tree.
+ void EnterElement_core([NotNull] kebnfParser.Element_coreContext context);
+ ///
+ /// Exit a parse tree produced by .
+ ///
+ /// The parse tree.
+ void ExitElement_core([NotNull] kebnfParser.Element_coreContext context);
+ ///
+ /// Enter a parse tree produced by .
+ ///
+ /// The parse tree.
+ void EnterDotted_id([NotNull] kebnfParser.Dotted_idContext context);
+ ///
+ /// Exit a parse tree produced by .
+ ///
+ /// The parse tree.
+ void ExitDotted_id([NotNull] kebnfParser.Dotted_idContext context);
+ ///
+ /// Enter a parse tree produced by .
+ ///
+ /// The parse tree.
+ void EnterSuffix_op([NotNull] kebnfParser.Suffix_opContext context);
+ ///
+ /// Exit a parse tree produced by .
+ ///
+ /// The parse tree.
+ void ExitSuffix_op([NotNull] kebnfParser.Suffix_opContext context);
+ ///
+ /// Enter a parse tree produced by .
+ ///
+ /// The parse tree.
+ void EnterValue_literal([NotNull] kebnfParser.Value_literalContext context);
+ ///
+ /// Exit a parse tree produced by .
+ ///
+ /// The parse tree.
+ void ExitValue_literal([NotNull] kebnfParser.Value_literalContext context);
+}
+} // namespace SysML2.NET.CodeGenerator.Grammar
diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfParser.cs b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfParser.cs
new file mode 100644
index 000000000..7cfb9dadc
--- /dev/null
+++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfParser.cs
@@ -0,0 +1,1447 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// ANTLR Version: 4.13.2
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+// Generated from C:/CODE/SysML2.NET/Resources/kebnf.g4 by ANTLR 4.13.2
+
+// Unreachable code detected
+#pragma warning disable 0162
+// The variable '...' is assigned but its value is never used
+#pragma warning disable 0219
+// Missing XML comment for publicly visible type or member '...'
+#pragma warning disable 1591
+// Ambiguous reference in cref attribute
+#pragma warning disable 419
+
+namespace SysML2.NET.CodeGenerator.Grammar {
+using System;
+using System.IO;
+using System.Text;
+using System.Diagnostics;
+using System.Collections.Generic;
+using Antlr4.Runtime;
+using Antlr4.Runtime.Atn;
+using Antlr4.Runtime.Misc;
+using Antlr4.Runtime.Tree;
+using DFA = Antlr4.Runtime.Dfa.DFA;
+
+[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.13.2")]
+[System.CLSCompliant(false)]
+public partial class kebnfParser : Parser {
+ protected static DFA[] decisionToDFA;
+ protected static PredictionContextCache sharedContextCache = new PredictionContextCache();
+ public const int
+ T__0=1, T__1=2, T__2=3, T__3=4, ASSIGN=5, ADD_ASSIGN=6, BOOL_ASSIGN=7,
+ PIPE=8, COLON=9, SEMICOLON=10, COMMA=11, LPAREN=12, RPAREN=13, LBRACK=14,
+ RBRACK=15, LBRACE=16, RBRACE=17, DOT=18, TILDE=19, UPPER_ID=20, ID=21,
+ SINGLE_QUOTED_STRING=22, INT=23, STRING=24, COMMENT=25, WS=26, CONTINUATION=27,
+ NL=28;
+ public const int
+ RULE_specification = 0, RULE_rule_definition = 1, RULE_parameter_list = 2,
+ RULE_alternatives = 3, RULE_alternative = 4, RULE_element = 5, RULE_assignment = 6,
+ RULE_non_parsing_assignment = 7, RULE_non_parsing_empty = 8, RULE_cross_reference = 9,
+ RULE_group = 10, RULE_terminal = 11, RULE_non_terminal = 12, RULE_element_core = 13,
+ RULE_dotted_id = 14, RULE_suffix_op = 15, RULE_value_literal = 16;
+ public static readonly string[] ruleNames = {
+ "specification", "rule_definition", "parameter_list", "alternatives",
+ "alternative", "element", "assignment", "non_parsing_assignment", "non_parsing_empty",
+ "cross_reference", "group", "terminal", "non_terminal", "element_core",
+ "dotted_id", "suffix_op", "value_literal"
+ };
+
+ private static readonly string[] _LiteralNames = {
+ null, "'*'", "'+'", "'?'", "'[QualifiedName]'", null, "'+='", "'?='",
+ "'|'", "':'", "';'", "','", "'('", "')'", "'['", "']'", "'{'", "'}'",
+ "'.'", "'~'"
+ };
+ private static readonly string[] _SymbolicNames = {
+ null, null, null, null, null, "ASSIGN", "ADD_ASSIGN", "BOOL_ASSIGN", "PIPE",
+ "COLON", "SEMICOLON", "COMMA", "LPAREN", "RPAREN", "LBRACK", "RBRACK",
+ "LBRACE", "RBRACE", "DOT", "TILDE", "UPPER_ID", "ID", "SINGLE_QUOTED_STRING",
+ "INT", "STRING", "COMMENT", "WS", "CONTINUATION", "NL"
+ };
+ public static readonly IVocabulary DefaultVocabulary = new Vocabulary(_LiteralNames, _SymbolicNames);
+
+ [NotNull]
+ public override IVocabulary Vocabulary
+ {
+ get
+ {
+ return DefaultVocabulary;
+ }
+ }
+
+ public override string GrammarFileName { get { return "kebnf.g4"; } }
+
+ public override string[] RuleNames { get { return ruleNames; } }
+
+ public override int[] SerializedAtn { get { return _serializedATN; } }
+
+ static kebnfParser() {
+ decisionToDFA = new DFA[_ATN.NumberOfDecisions];
+ for (int i = 0; i < _ATN.NumberOfDecisions; i++) {
+ decisionToDFA[i] = new DFA(_ATN.GetDecisionState(i), i);
+ }
+ }
+
+ public kebnfParser(ITokenStream input) : this(input, Console.Out, Console.Error) { }
+
+ public kebnfParser(ITokenStream input, TextWriter output, TextWriter errorOutput)
+ : base(input, output, errorOutput)
+ {
+ Interpreter = new ParserATNSimulator(this, _ATN, decisionToDFA, sharedContextCache);
+ }
+
+ public partial class SpecificationContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode Eof() { return GetToken(kebnfParser.Eof, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] NL() { return GetTokens(kebnfParser.NL); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode NL(int i) {
+ return GetToken(kebnfParser.NL, i);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public Rule_definitionContext[] rule_definition() {
+ return GetRuleContexts();
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public Rule_definitionContext rule_definition(int i) {
+ return GetRuleContext(i);
+ }
+ public SpecificationContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_specification; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void EnterRule(IParseTreeListener listener) {
+ IkebnfListener typedListener = listener as IkebnfListener;
+ if (typedListener != null) typedListener.EnterSpecification(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void ExitRule(IParseTreeListener listener) {
+ IkebnfListener typedListener = listener as IkebnfListener;
+ if (typedListener != null) typedListener.ExitSpecification(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IkebnfVisitor typedVisitor = visitor as IkebnfVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitSpecification(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public SpecificationContext specification() {
+ SpecificationContext _localctx = new SpecificationContext(Context, State);
+ EnterRule(_localctx, 0, RULE_specification);
+ int _la;
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 37;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ while (_la==NL) {
+ {
+ {
+ State = 34;
+ Match(NL);
+ }
+ }
+ State = 39;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ }
+ State = 41;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ do {
+ {
+ {
+ State = 40;
+ rule_definition();
+ }
+ }
+ State = 43;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ } while ( _la==UPPER_ID );
+ State = 45;
+ Match(Eof);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class Rule_definitionContext : ParserRuleContext {
+ public IToken name;
+ public Parameter_listContext @params;
+ public IToken target_ast;
+ public AlternativesContext rule_body;
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ASSIGN() { return GetToken(kebnfParser.ASSIGN, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] UPPER_ID() { return GetTokens(kebnfParser.UPPER_ID); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode UPPER_ID(int i) {
+ return GetToken(kebnfParser.UPPER_ID, i);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public AlternativesContext alternatives() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode COLON() { return GetToken(kebnfParser.COLON, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode SEMICOLON() { return GetToken(kebnfParser.SEMICOLON, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] NL() { return GetTokens(kebnfParser.NL); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode NL(int i) {
+ return GetToken(kebnfParser.NL, i);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public Parameter_listContext parameter_list() {
+ return GetRuleContext(0);
+ }
+ public Rule_definitionContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_rule_definition; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void EnterRule(IParseTreeListener listener) {
+ IkebnfListener typedListener = listener as IkebnfListener;
+ if (typedListener != null) typedListener.EnterRule_definition(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void ExitRule(IParseTreeListener listener) {
+ IkebnfListener typedListener = listener as IkebnfListener;
+ if (typedListener != null) typedListener.ExitRule_definition(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IkebnfVisitor typedVisitor = visitor as IkebnfVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitRule_definition(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public Rule_definitionContext rule_definition() {
+ Rule_definitionContext _localctx = new Rule_definitionContext(Context, State);
+ EnterRule(_localctx, 2, RULE_rule_definition);
+ int _la;
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 47;
+ _localctx.name = Match(UPPER_ID);
+ State = 49;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ if (_la==LPAREN) {
+ {
+ State = 48;
+ _localctx.@params = parameter_list();
+ }
+ }
+
+ State = 53;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ if (_la==COLON) {
+ {
+ State = 51;
+ Match(COLON);
+ State = 52;
+ _localctx.target_ast = Match(UPPER_ID);
+ }
+ }
+
+ State = 55;
+ Match(ASSIGN);
+ State = 56;
+ _localctx.rule_body = alternatives();
+ State = 58;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ if (_la==SEMICOLON) {
+ {
+ State = 57;
+ Match(SEMICOLON);
+ }
+ }
+
+ State = 61;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ do {
+ {
+ {
+ State = 60;
+ Match(NL);
+ }
+ }
+ State = 63;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ } while ( _la==NL );
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class Parameter_listContext : ParserRuleContext {
+ public IToken param_name;
+ public IToken param_type;
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LPAREN() { return GetToken(kebnfParser.LPAREN, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode COLON() { return GetToken(kebnfParser.COLON, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RPAREN() { return GetToken(kebnfParser.RPAREN, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] ID() { return GetTokens(kebnfParser.ID); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ID(int i) {
+ return GetToken(kebnfParser.ID, i);
+ }
+ public Parameter_listContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_parameter_list; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void EnterRule(IParseTreeListener listener) {
+ IkebnfListener typedListener = listener as IkebnfListener;
+ if (typedListener != null) typedListener.EnterParameter_list(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void ExitRule(IParseTreeListener listener) {
+ IkebnfListener typedListener = listener as IkebnfListener;
+ if (typedListener != null) typedListener.ExitParameter_list(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IkebnfVisitor typedVisitor = visitor as IkebnfVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitParameter_list(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public Parameter_listContext parameter_list() {
+ Parameter_listContext _localctx = new Parameter_listContext(Context, State);
+ EnterRule(_localctx, 4, RULE_parameter_list);
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 65;
+ Match(LPAREN);
+ State = 66;
+ _localctx.param_name = Match(ID);
+ State = 67;
+ Match(COLON);
+ State = 68;
+ _localctx.param_type = Match(ID);
+ State = 69;
+ Match(RPAREN);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class AlternativesContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public AlternativeContext[] alternative() {
+ return GetRuleContexts();
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public AlternativeContext alternative(int i) {
+ return GetRuleContext(i);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] PIPE() { return GetTokens(kebnfParser.PIPE); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode PIPE(int i) {
+ return GetToken(kebnfParser.PIPE, i);
+ }
+ public AlternativesContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_alternatives; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void EnterRule(IParseTreeListener listener) {
+ IkebnfListener typedListener = listener as IkebnfListener;
+ if (typedListener != null) typedListener.EnterAlternatives(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void ExitRule(IParseTreeListener listener) {
+ IkebnfListener typedListener = listener as IkebnfListener;
+ if (typedListener != null) typedListener.ExitAlternatives(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IkebnfVisitor typedVisitor = visitor as IkebnfVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitAlternatives(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public AlternativesContext alternatives() {
+ AlternativesContext _localctx = new AlternativesContext(Context, State);
+ EnterRule(_localctx, 6, RULE_alternatives);
+ int _la;
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 71;
+ alternative();
+ State = 76;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ while (_la==PIPE) {
+ {
+ {
+ State = 72;
+ Match(PIPE);
+ State = 73;
+ alternative();
+ }
+ }
+ State = 78;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ }
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class AlternativeContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public ElementContext[] element() {
+ return GetRuleContexts();
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public ElementContext element(int i) {
+ return GetRuleContext(i);
+ }
+ public AlternativeContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_alternative; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void EnterRule(IParseTreeListener listener) {
+ IkebnfListener typedListener = listener as IkebnfListener;
+ if (typedListener != null) typedListener.EnterAlternative(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void ExitRule(IParseTreeListener listener) {
+ IkebnfListener typedListener = listener as IkebnfListener;
+ if (typedListener != null) typedListener.ExitAlternative(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IkebnfVisitor typedVisitor = visitor as IkebnfVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitAlternative(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public AlternativeContext alternative() {
+ AlternativeContext _localctx = new AlternativeContext(Context, State);
+ EnterRule(_localctx, 8, RULE_alternative);
+ int _la;
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 82;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ while ((((_la) & ~0x3f) == 0 && ((1L << _la) & 33116176L) != 0)) {
+ {
+ {
+ State = 79;
+ element();
+ }
+ }
+ State = 84;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ }
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class ElementContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public AssignmentContext assignment() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public Non_parsing_assignmentContext non_parsing_assignment() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public Non_parsing_emptyContext non_parsing_empty() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public Cross_referenceContext cross_reference() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public GroupContext group() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public TerminalContext terminal() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public Non_terminalContext non_terminal() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public Value_literalContext value_literal() {
+ return GetRuleContext(0);
+ }
+ public ElementContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_element; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void EnterRule(IParseTreeListener listener) {
+ IkebnfListener typedListener = listener as IkebnfListener;
+ if (typedListener != null) typedListener.EnterElement(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void ExitRule(IParseTreeListener listener) {
+ IkebnfListener typedListener = listener as IkebnfListener;
+ if (typedListener != null) typedListener.ExitElement(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IkebnfVisitor typedVisitor = visitor as IkebnfVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitElement(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public ElementContext element() {
+ ElementContext _localctx = new ElementContext(Context, State);
+ EnterRule(_localctx, 10, RULE_element);
+ try {
+ State = 93;
+ ErrorHandler.Sync(this);
+ switch ( Interpreter.AdaptivePredict(TokenStream,8,Context) ) {
+ case 1:
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 85;
+ assignment();
+ }
+ break;
+ case 2:
+ EnterOuterAlt(_localctx, 2);
+ {
+ State = 86;
+ non_parsing_assignment();
+ }
+ break;
+ case 3:
+ EnterOuterAlt(_localctx, 3);
+ {
+ State = 87;
+ non_parsing_empty();
+ }
+ break;
+ case 4:
+ EnterOuterAlt(_localctx, 4);
+ {
+ State = 88;
+ cross_reference();
+ }
+ break;
+ case 5:
+ EnterOuterAlt(_localctx, 5);
+ {
+ State = 89;
+ group();
+ }
+ break;
+ case 6:
+ EnterOuterAlt(_localctx, 6);
+ {
+ State = 90;
+ terminal();
+ }
+ break;
+ case 7:
+ EnterOuterAlt(_localctx, 7);
+ {
+ State = 91;
+ non_terminal();
+ }
+ break;
+ case 8:
+ EnterOuterAlt(_localctx, 8);
+ {
+ State = 92;
+ value_literal();
+ }
+ break;
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class AssignmentContext : ParserRuleContext {
+ public Dotted_idContext property;
+ public IToken op;
+ public IToken prefix;
+ public Element_coreContext content;
+ public Suffix_opContext suffix;
+ [System.Diagnostics.DebuggerNonUserCode] public Dotted_idContext dotted_id() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public Element_coreContext element_core() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ASSIGN() { return GetToken(kebnfParser.ASSIGN, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ADD_ASSIGN() { return GetToken(kebnfParser.ADD_ASSIGN, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode BOOL_ASSIGN() { return GetToken(kebnfParser.BOOL_ASSIGN, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode TILDE() { return GetToken(kebnfParser.TILDE, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public Suffix_opContext suffix_op() {
+ return GetRuleContext(0);
+ }
+ public AssignmentContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_assignment; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void EnterRule(IParseTreeListener listener) {
+ IkebnfListener typedListener = listener as IkebnfListener;
+ if (typedListener != null) typedListener.EnterAssignment(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void ExitRule(IParseTreeListener listener) {
+ IkebnfListener typedListener = listener as IkebnfListener;
+ if (typedListener != null) typedListener.ExitAssignment(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IkebnfVisitor typedVisitor = visitor as IkebnfVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitAssignment(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public AssignmentContext assignment() {
+ AssignmentContext _localctx = new AssignmentContext(Context, State);
+ EnterRule(_localctx, 12, RULE_assignment);
+ int _la;
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 95;
+ _localctx.property = dotted_id();
+ State = 96;
+ _localctx.op = TokenStream.LT(1);
+ _la = TokenStream.LA(1);
+ if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 224L) != 0)) ) {
+ _localctx.op = ErrorHandler.RecoverInline(this);
+ }
+ else {
+ ErrorHandler.ReportMatch(this);
+ Consume();
+ }
+ State = 98;
+ ErrorHandler.Sync(this);
+ switch ( Interpreter.AdaptivePredict(TokenStream,9,Context) ) {
+ case 1:
+ {
+ State = 97;
+ _localctx.prefix = Match(TILDE);
+ }
+ break;
+ }
+ State = 100;
+ _localctx.content = element_core();
+ State = 102;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 14L) != 0)) {
+ {
+ State = 101;
+ _localctx.suffix = suffix_op();
+ }
+ }
+
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class Non_parsing_assignmentContext : ParserRuleContext {
+ public Dotted_idContext property;
+ public IToken op;
+ public Value_literalContext val;
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LBRACE() { return GetToken(kebnfParser.LBRACE, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RBRACE() { return GetToken(kebnfParser.RBRACE, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public Dotted_idContext dotted_id() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public Value_literalContext value_literal() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ASSIGN() { return GetToken(kebnfParser.ASSIGN, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ADD_ASSIGN() { return GetToken(kebnfParser.ADD_ASSIGN, 0); }
+ public Non_parsing_assignmentContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_non_parsing_assignment; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void EnterRule(IParseTreeListener listener) {
+ IkebnfListener typedListener = listener as IkebnfListener;
+ if (typedListener != null) typedListener.EnterNon_parsing_assignment(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void ExitRule(IParseTreeListener listener) {
+ IkebnfListener typedListener = listener as IkebnfListener;
+ if (typedListener != null) typedListener.ExitNon_parsing_assignment(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IkebnfVisitor typedVisitor = visitor as IkebnfVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitNon_parsing_assignment(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public Non_parsing_assignmentContext non_parsing_assignment() {
+ Non_parsing_assignmentContext _localctx = new Non_parsing_assignmentContext(Context, State);
+ EnterRule(_localctx, 14, RULE_non_parsing_assignment);
+ int _la;
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 104;
+ Match(LBRACE);
+ State = 105;
+ _localctx.property = dotted_id();
+ State = 106;
+ _localctx.op = TokenStream.LT(1);
+ _la = TokenStream.LA(1);
+ if ( !(_la==ASSIGN || _la==ADD_ASSIGN) ) {
+ _localctx.op = ErrorHandler.RecoverInline(this);
+ }
+ else {
+ ErrorHandler.ReportMatch(this);
+ Consume();
+ }
+ State = 107;
+ _localctx.val = value_literal();
+ State = 108;
+ Match(RBRACE);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class Non_parsing_emptyContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LBRACE() { return GetToken(kebnfParser.LBRACE, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RBRACE() { return GetToken(kebnfParser.RBRACE, 0); }
+ public Non_parsing_emptyContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_non_parsing_empty; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void EnterRule(IParseTreeListener listener) {
+ IkebnfListener typedListener = listener as IkebnfListener;
+ if (typedListener != null) typedListener.EnterNon_parsing_empty(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void ExitRule(IParseTreeListener listener) {
+ IkebnfListener typedListener = listener as IkebnfListener;
+ if (typedListener != null) typedListener.ExitNon_parsing_empty(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IkebnfVisitor typedVisitor = visitor as IkebnfVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitNon_parsing_empty(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public Non_parsing_emptyContext non_parsing_empty() {
+ Non_parsing_emptyContext _localctx = new Non_parsing_emptyContext(Context, State);
+ EnterRule(_localctx, 16, RULE_non_parsing_empty);
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 110;
+ Match(LBRACE);
+ State = 111;
+ Match(RBRACE);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class Cross_referenceContext : ParserRuleContext {
+ public IToken @ref;
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LBRACK() { return GetToken(kebnfParser.LBRACK, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RBRACK() { return GetToken(kebnfParser.RBRACK, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ID() { return GetToken(kebnfParser.ID, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode TILDE() { return GetToken(kebnfParser.TILDE, 0); }
+ public Cross_referenceContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_cross_reference; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void EnterRule(IParseTreeListener listener) {
+ IkebnfListener typedListener = listener as IkebnfListener;
+ if (typedListener != null) typedListener.EnterCross_reference(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void ExitRule(IParseTreeListener listener) {
+ IkebnfListener typedListener = listener as IkebnfListener;
+ if (typedListener != null) typedListener.ExitCross_reference(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IkebnfVisitor typedVisitor = visitor as IkebnfVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitCross_reference(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public Cross_referenceContext cross_reference() {
+ Cross_referenceContext _localctx = new Cross_referenceContext(Context, State);
+ EnterRule(_localctx, 18, RULE_cross_reference);
+ int _la;
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 114;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ if (_la==TILDE) {
+ {
+ State = 113;
+ Match(TILDE);
+ }
+ }
+
+ State = 116;
+ Match(LBRACK);
+ State = 117;
+ _localctx.@ref = Match(ID);
+ State = 118;
+ Match(RBRACK);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class GroupContext : ParserRuleContext {
+ public Suffix_opContext suffix;
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LPAREN() { return GetToken(kebnfParser.LPAREN, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public AlternativesContext alternatives() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RPAREN() { return GetToken(kebnfParser.RPAREN, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public Suffix_opContext suffix_op() {
+ return GetRuleContext(0);
+ }
+ public GroupContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_group; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void EnterRule(IParseTreeListener listener) {
+ IkebnfListener typedListener = listener as IkebnfListener;
+ if (typedListener != null) typedListener.EnterGroup(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void ExitRule(IParseTreeListener listener) {
+ IkebnfListener typedListener = listener as IkebnfListener;
+ if (typedListener != null) typedListener.ExitGroup(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IkebnfVisitor typedVisitor = visitor as IkebnfVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitGroup(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public GroupContext group() {
+ GroupContext _localctx = new GroupContext(Context, State);
+ EnterRule(_localctx, 20, RULE_group);
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 120;
+ Match(LPAREN);
+ State = 121;
+ alternatives();
+ State = 122;
+ Match(RPAREN);
+ State = 124;
+ ErrorHandler.Sync(this);
+ switch ( Interpreter.AdaptivePredict(TokenStream,12,Context) ) {
+ case 1:
+ {
+ State = 123;
+ _localctx.suffix = suffix_op();
+ }
+ break;
+ }
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class TerminalContext : ParserRuleContext {
+ public IToken val;
+ public Suffix_opContext suffix;
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode SINGLE_QUOTED_STRING() { return GetToken(kebnfParser.SINGLE_QUOTED_STRING, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public Suffix_opContext suffix_op() {
+ return GetRuleContext(0);
+ }
+ public TerminalContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_terminal; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void EnterRule(IParseTreeListener listener) {
+ IkebnfListener typedListener = listener as IkebnfListener;
+ if (typedListener != null) typedListener.EnterTerminal(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void ExitRule(IParseTreeListener listener) {
+ IkebnfListener typedListener = listener as IkebnfListener;
+ if (typedListener != null) typedListener.ExitTerminal(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IkebnfVisitor typedVisitor = visitor as IkebnfVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitTerminal(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public TerminalContext terminal() {
+ TerminalContext _localctx = new TerminalContext(Context, State);
+ EnterRule(_localctx, 22, RULE_terminal);
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 126;
+ _localctx.val = Match(SINGLE_QUOTED_STRING);
+ State = 128;
+ ErrorHandler.Sync(this);
+ switch ( Interpreter.AdaptivePredict(TokenStream,13,Context) ) {
+ case 1:
+ {
+ State = 127;
+ _localctx.suffix = suffix_op();
+ }
+ break;
+ }
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class Non_terminalContext : ParserRuleContext {
+ public IToken name;
+ public Suffix_opContext suffix;
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode UPPER_ID() { return GetToken(kebnfParser.UPPER_ID, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public Suffix_opContext suffix_op() {
+ return GetRuleContext(0);
+ }
+ public Non_terminalContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_non_terminal; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void EnterRule(IParseTreeListener listener) {
+ IkebnfListener typedListener = listener as IkebnfListener;
+ if (typedListener != null) typedListener.EnterNon_terminal(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void ExitRule(IParseTreeListener listener) {
+ IkebnfListener typedListener = listener as IkebnfListener;
+ if (typedListener != null) typedListener.ExitNon_terminal(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IkebnfVisitor typedVisitor = visitor as IkebnfVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitNon_terminal(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public Non_terminalContext non_terminal() {
+ Non_terminalContext _localctx = new Non_terminalContext(Context, State);
+ EnterRule(_localctx, 24, RULE_non_terminal);
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 130;
+ _localctx.name = Match(UPPER_ID);
+ State = 132;
+ ErrorHandler.Sync(this);
+ switch ( Interpreter.AdaptivePredict(TokenStream,14,Context) ) {
+ case 1:
+ {
+ State = 131;
+ _localctx.suffix = suffix_op();
+ }
+ break;
+ }
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class Element_coreContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public Cross_referenceContext cross_reference() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public GroupContext group() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public TerminalContext terminal() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public Non_terminalContext non_terminal() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public Value_literalContext value_literal() {
+ return GetRuleContext(0);
+ }
+ public Element_coreContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_element_core; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void EnterRule(IParseTreeListener listener) {
+ IkebnfListener typedListener = listener as IkebnfListener;
+ if (typedListener != null) typedListener.EnterElement_core(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void ExitRule(IParseTreeListener listener) {
+ IkebnfListener typedListener = listener as IkebnfListener;
+ if (typedListener != null) typedListener.ExitElement_core(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IkebnfVisitor typedVisitor = visitor as IkebnfVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitElement_core(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public Element_coreContext element_core() {
+ Element_coreContext _localctx = new Element_coreContext(Context, State);
+ EnterRule(_localctx, 26, RULE_element_core);
+ try {
+ State = 139;
+ ErrorHandler.Sync(this);
+ switch ( Interpreter.AdaptivePredict(TokenStream,15,Context) ) {
+ case 1:
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 134;
+ cross_reference();
+ }
+ break;
+ case 2:
+ EnterOuterAlt(_localctx, 2);
+ {
+ State = 135;
+ group();
+ }
+ break;
+ case 3:
+ EnterOuterAlt(_localctx, 3);
+ {
+ State = 136;
+ terminal();
+ }
+ break;
+ case 4:
+ EnterOuterAlt(_localctx, 4);
+ {
+ State = 137;
+ non_terminal();
+ }
+ break;
+ case 5:
+ EnterOuterAlt(_localctx, 5);
+ {
+ State = 138;
+ value_literal();
+ }
+ break;
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class Dotted_idContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] ID() { return GetTokens(kebnfParser.ID); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ID(int i) {
+ return GetToken(kebnfParser.ID, i);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] DOT() { return GetTokens(kebnfParser.DOT); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode DOT(int i) {
+ return GetToken(kebnfParser.DOT, i);
+ }
+ public Dotted_idContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_dotted_id; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void EnterRule(IParseTreeListener listener) {
+ IkebnfListener typedListener = listener as IkebnfListener;
+ if (typedListener != null) typedListener.EnterDotted_id(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void ExitRule(IParseTreeListener listener) {
+ IkebnfListener typedListener = listener as IkebnfListener;
+ if (typedListener != null) typedListener.ExitDotted_id(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IkebnfVisitor typedVisitor = visitor as IkebnfVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitDotted_id(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public Dotted_idContext dotted_id() {
+ Dotted_idContext _localctx = new Dotted_idContext(Context, State);
+ EnterRule(_localctx, 28, RULE_dotted_id);
+ int _la;
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 141;
+ Match(ID);
+ State = 146;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ while (_la==DOT) {
+ {
+ {
+ State = 142;
+ Match(DOT);
+ State = 143;
+ Match(ID);
+ }
+ }
+ State = 148;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ }
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class Suffix_opContext : ParserRuleContext {
+ public Suffix_opContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_suffix_op; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void EnterRule(IParseTreeListener listener) {
+ IkebnfListener typedListener = listener as IkebnfListener;
+ if (typedListener != null) typedListener.EnterSuffix_op(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void ExitRule(IParseTreeListener listener) {
+ IkebnfListener typedListener = listener as IkebnfListener;
+ if (typedListener != null) typedListener.ExitSuffix_op(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IkebnfVisitor typedVisitor = visitor as IkebnfVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitSuffix_op(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public Suffix_opContext suffix_op() {
+ Suffix_opContext _localctx = new Suffix_opContext(Context, State);
+ EnterRule(_localctx, 30, RULE_suffix_op);
+ int _la;
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 149;
+ _la = TokenStream.LA(1);
+ if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 14L) != 0)) ) {
+ ErrorHandler.RecoverInline(this);
+ }
+ else {
+ ErrorHandler.ReportMatch(this);
+ Consume();
+ }
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class Value_literalContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ID() { return GetToken(kebnfParser.ID, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode INT() { return GetToken(kebnfParser.INT, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode STRING() { return GetToken(kebnfParser.STRING, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode SINGLE_QUOTED_STRING() { return GetToken(kebnfParser.SINGLE_QUOTED_STRING, 0); }
+ public Value_literalContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_value_literal; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void EnterRule(IParseTreeListener listener) {
+ IkebnfListener typedListener = listener as IkebnfListener;
+ if (typedListener != null) typedListener.EnterValue_literal(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void ExitRule(IParseTreeListener listener) {
+ IkebnfListener typedListener = listener as IkebnfListener;
+ if (typedListener != null) typedListener.ExitValue_literal(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IkebnfVisitor typedVisitor = visitor as IkebnfVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitValue_literal(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public Value_literalContext value_literal() {
+ Value_literalContext _localctx = new Value_literalContext(Context, State);
+ EnterRule(_localctx, 32, RULE_value_literal);
+ int _la;
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 151;
+ _la = TokenStream.LA(1);
+ if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 31457296L) != 0)) ) {
+ ErrorHandler.RecoverInline(this);
+ }
+ else {
+ ErrorHandler.ReportMatch(this);
+ Consume();
+ }
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ private static int[] _serializedATN = {
+ 4,1,28,154,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,
+ 7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14,
+ 2,15,7,15,2,16,7,16,1,0,5,0,36,8,0,10,0,12,0,39,9,0,1,0,4,0,42,8,0,11,
+ 0,12,0,43,1,0,1,0,1,1,1,1,3,1,50,8,1,1,1,1,1,3,1,54,8,1,1,1,1,1,1,1,3,
+ 1,59,8,1,1,1,4,1,62,8,1,11,1,12,1,63,1,2,1,2,1,2,1,2,1,2,1,2,1,3,1,3,1,
+ 3,5,3,75,8,3,10,3,12,3,78,9,3,1,4,5,4,81,8,4,10,4,12,4,84,9,4,1,5,1,5,
+ 1,5,1,5,1,5,1,5,1,5,1,5,3,5,94,8,5,1,6,1,6,1,6,3,6,99,8,6,1,6,1,6,3,6,
+ 103,8,6,1,7,1,7,1,7,1,7,1,7,1,7,1,8,1,8,1,8,1,9,3,9,115,8,9,1,9,1,9,1,
+ 9,1,9,1,10,1,10,1,10,1,10,3,10,125,8,10,1,11,1,11,3,11,129,8,11,1,12,1,
+ 12,3,12,133,8,12,1,13,1,13,1,13,1,13,1,13,3,13,140,8,13,1,14,1,14,1,14,
+ 5,14,145,8,14,10,14,12,14,148,9,14,1,15,1,15,1,16,1,16,1,16,0,0,17,0,2,
+ 4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,0,4,1,0,5,7,1,0,5,6,1,0,1,3,
+ 2,0,4,4,21,24,162,0,37,1,0,0,0,2,47,1,0,0,0,4,65,1,0,0,0,6,71,1,0,0,0,
+ 8,82,1,0,0,0,10,93,1,0,0,0,12,95,1,0,0,0,14,104,1,0,0,0,16,110,1,0,0,0,
+ 18,114,1,0,0,0,20,120,1,0,0,0,22,126,1,0,0,0,24,130,1,0,0,0,26,139,1,0,
+ 0,0,28,141,1,0,0,0,30,149,1,0,0,0,32,151,1,0,0,0,34,36,5,28,0,0,35,34,
+ 1,0,0,0,36,39,1,0,0,0,37,35,1,0,0,0,37,38,1,0,0,0,38,41,1,0,0,0,39,37,
+ 1,0,0,0,40,42,3,2,1,0,41,40,1,0,0,0,42,43,1,0,0,0,43,41,1,0,0,0,43,44,
+ 1,0,0,0,44,45,1,0,0,0,45,46,5,0,0,1,46,1,1,0,0,0,47,49,5,20,0,0,48,50,
+ 3,4,2,0,49,48,1,0,0,0,49,50,1,0,0,0,50,53,1,0,0,0,51,52,5,9,0,0,52,54,
+ 5,20,0,0,53,51,1,0,0,0,53,54,1,0,0,0,54,55,1,0,0,0,55,56,5,5,0,0,56,58,
+ 3,6,3,0,57,59,5,10,0,0,58,57,1,0,0,0,58,59,1,0,0,0,59,61,1,0,0,0,60,62,
+ 5,28,0,0,61,60,1,0,0,0,62,63,1,0,0,0,63,61,1,0,0,0,63,64,1,0,0,0,64,3,
+ 1,0,0,0,65,66,5,12,0,0,66,67,5,21,0,0,67,68,5,9,0,0,68,69,5,21,0,0,69,
+ 70,5,13,0,0,70,5,1,0,0,0,71,76,3,8,4,0,72,73,5,8,0,0,73,75,3,8,4,0,74,
+ 72,1,0,0,0,75,78,1,0,0,0,76,74,1,0,0,0,76,77,1,0,0,0,77,7,1,0,0,0,78,76,
+ 1,0,0,0,79,81,3,10,5,0,80,79,1,0,0,0,81,84,1,0,0,0,82,80,1,0,0,0,82,83,
+ 1,0,0,0,83,9,1,0,0,0,84,82,1,0,0,0,85,94,3,12,6,0,86,94,3,14,7,0,87,94,
+ 3,16,8,0,88,94,3,18,9,0,89,94,3,20,10,0,90,94,3,22,11,0,91,94,3,24,12,
+ 0,92,94,3,32,16,0,93,85,1,0,0,0,93,86,1,0,0,0,93,87,1,0,0,0,93,88,1,0,
+ 0,0,93,89,1,0,0,0,93,90,1,0,0,0,93,91,1,0,0,0,93,92,1,0,0,0,94,11,1,0,
+ 0,0,95,96,3,28,14,0,96,98,7,0,0,0,97,99,5,19,0,0,98,97,1,0,0,0,98,99,1,
+ 0,0,0,99,100,1,0,0,0,100,102,3,26,13,0,101,103,3,30,15,0,102,101,1,0,0,
+ 0,102,103,1,0,0,0,103,13,1,0,0,0,104,105,5,16,0,0,105,106,3,28,14,0,106,
+ 107,7,1,0,0,107,108,3,32,16,0,108,109,5,17,0,0,109,15,1,0,0,0,110,111,
+ 5,16,0,0,111,112,5,17,0,0,112,17,1,0,0,0,113,115,5,19,0,0,114,113,1,0,
+ 0,0,114,115,1,0,0,0,115,116,1,0,0,0,116,117,5,14,0,0,117,118,5,21,0,0,
+ 118,119,5,15,0,0,119,19,1,0,0,0,120,121,5,12,0,0,121,122,3,6,3,0,122,124,
+ 5,13,0,0,123,125,3,30,15,0,124,123,1,0,0,0,124,125,1,0,0,0,125,21,1,0,
+ 0,0,126,128,5,22,0,0,127,129,3,30,15,0,128,127,1,0,0,0,128,129,1,0,0,0,
+ 129,23,1,0,0,0,130,132,5,20,0,0,131,133,3,30,15,0,132,131,1,0,0,0,132,
+ 133,1,0,0,0,133,25,1,0,0,0,134,140,3,18,9,0,135,140,3,20,10,0,136,140,
+ 3,22,11,0,137,140,3,24,12,0,138,140,3,32,16,0,139,134,1,0,0,0,139,135,
+ 1,0,0,0,139,136,1,0,0,0,139,137,1,0,0,0,139,138,1,0,0,0,140,27,1,0,0,0,
+ 141,146,5,21,0,0,142,143,5,18,0,0,143,145,5,21,0,0,144,142,1,0,0,0,145,
+ 148,1,0,0,0,146,144,1,0,0,0,146,147,1,0,0,0,147,29,1,0,0,0,148,146,1,0,
+ 0,0,149,150,7,2,0,0,150,31,1,0,0,0,151,152,7,3,0,0,152,33,1,0,0,0,17,37,
+ 43,49,53,58,63,76,82,93,98,102,114,124,128,132,139,146
+ };
+
+ public static readonly ATN _ATN =
+ new ATNDeserializer().Deserialize(_serializedATN);
+
+
+}
+} // namespace SysML2.NET.CodeGenerator.Grammar
diff --git a/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfVisitor.cs b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfVisitor.cs
new file mode 100644
index 000000000..658bbffc8
--- /dev/null
+++ b/SysML2.NET.CodeGenerator/Grammar/AutoGenGrammar/SysML2/NET/CodeGenerator/Grammar/kebnfVisitor.cs
@@ -0,0 +1,138 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// ANTLR Version: 4.13.2
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+// Generated from C:/CODE/SysML2.NET/Resources/kebnf.g4 by ANTLR 4.13.2
+
+// Unreachable code detected
+#pragma warning disable 0162
+// The variable '...' is assigned but its value is never used
+#pragma warning disable 0219
+// Missing XML comment for publicly visible type or member '...'
+#pragma warning disable 1591
+// Ambiguous reference in cref attribute
+#pragma warning disable 419
+
+namespace SysML2.NET.CodeGenerator.Grammar {
+using Antlr4.Runtime.Misc;
+using Antlr4.Runtime.Tree;
+using IToken = Antlr4.Runtime.IToken;
+
+///
+/// This interface defines a complete generic visitor for a parse tree produced
+/// by .
+///
+/// The return type of the visit operation.
+[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.13.2")]
+[System.CLSCompliant(false)]
+public interface IkebnfVisitor : IParseTreeVisitor {
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ Result VisitSpecification([NotNull] kebnfParser.SpecificationContext context);
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ Result VisitRule_definition([NotNull] kebnfParser.Rule_definitionContext context);
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ Result VisitParameter_list([NotNull] kebnfParser.Parameter_listContext context);
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ Result VisitAlternatives([NotNull] kebnfParser.AlternativesContext context);
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ Result VisitAlternative([NotNull] kebnfParser.AlternativeContext context);
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ Result VisitElement([NotNull] kebnfParser.ElementContext context);
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ Result VisitAssignment([NotNull] kebnfParser.AssignmentContext context);
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ Result VisitNon_parsing_assignment([NotNull] kebnfParser.Non_parsing_assignmentContext context);
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ Result VisitNon_parsing_empty([NotNull] kebnfParser.Non_parsing_emptyContext context);
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ Result VisitCross_reference([NotNull] kebnfParser.Cross_referenceContext context);
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ Result VisitGroup([NotNull] kebnfParser.GroupContext context);
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ Result VisitTerminal([NotNull] kebnfParser.TerminalContext context);
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ Result VisitNon_terminal([NotNull] kebnfParser.Non_terminalContext context);
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ Result VisitElement_core([NotNull] kebnfParser.Element_coreContext context);
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ Result VisitDotted_id([NotNull] kebnfParser.Dotted_idContext context);
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ Result VisitSuffix_op([NotNull] kebnfParser.Suffix_opContext context);
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ Result VisitValue_literal([NotNull] kebnfParser.Value_literalContext context);
+}
+} // namespace SysML2.NET.CodeGenerator.Grammar
diff --git a/SysML2.NET.CodeGenerator/Grammar/GrammarLoader.cs b/SysML2.NET.CodeGenerator/Grammar/GrammarLoader.cs
new file mode 100644
index 000000000..9aa3d884b
--- /dev/null
+++ b/SysML2.NET.CodeGenerator/Grammar/GrammarLoader.cs
@@ -0,0 +1,57 @@
+// -------------------------------------------------------------------------------------------------
+//
+//
+// Copyright 2022-2026 Starion Group S.A.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+// ------------------------------------------------------------------------------------------------
+
+namespace SysML2.NET.CodeGenerator.Grammar
+{
+ using System.IO;
+
+ using Antlr4.Runtime;
+
+ using SysML2.NET.CodeGenerator.Grammar.Model;
+
+ ///
+ /// Provides direct access to by providing file path
+ ///
+ public static class GrammarLoader
+ {
+ ///
+ /// Loads the
+ ///
+ /// The string uri that locates the KEBNF file to load
+ /// The loaded
+ /// If the does not locate an existing
+ public static TextualNotationSpecification LoadTextualNotationSpecification(string fileUri)
+ {
+ if (!File.Exists(fileUri))
+ {
+ throw new FileNotFoundException("File not found", fileUri);
+ }
+
+ var stream = CharStreams.fromPath(fileUri);
+ var lexer = new kebnfLexer(stream);
+ var tokens = new CommonTokenStream(lexer);
+ var parser = new kebnfParser(tokens);
+
+ var tree = parser.specification();
+ var explorer = new TextualNotationSpecificationVisitor();
+ return (TextualNotationSpecification)explorer.Visit(tree);
+ }
+ }
+}
diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/Alternatives.cs b/SysML2.NET.CodeGenerator/Grammar/Model/Alternatives.cs
new file mode 100644
index 000000000..ff3ba6635
--- /dev/null
+++ b/SysML2.NET.CodeGenerator/Grammar/Model/Alternatives.cs
@@ -0,0 +1,40 @@
+// -------------------------------------------------------------------------------------------------
+//
+//
+// Copyright 2022-2026 Starion Group S.A.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+// ------------------------------------------------------------------------------------------------
+
+namespace SysML2.NET.CodeGenerator.Grammar.Model
+{
+ using System.Collections.Generic;
+
+ ///
+ /// Provides mapping data class for the alternative grammar part
+ ///
+ public class Alternatives: IPartOfTextualRule
+ {
+ ///
+ /// Gets a collection of that is part of the
+ ///
+ public List Elements { get; } = [];
+
+ ///
+ /// Gets the
+ ///
+ public TextualNotationRule TextualNotationRule { get; init; }
+ }
+}
diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/AssignmentElement.cs b/SysML2.NET.CodeGenerator/Grammar/Model/AssignmentElement.cs
new file mode 100644
index 000000000..32219bc4a
--- /dev/null
+++ b/SysML2.NET.CodeGenerator/Grammar/Model/AssignmentElement.cs
@@ -0,0 +1,48 @@
+// -------------------------------------------------------------------------------------------------
+//
+//
+// Copyright 2022-2026 Starion Group S.A.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+// ------------------------------------------------------------------------------------------------
+
+namespace SysML2.NET.CodeGenerator.Grammar.Model
+{
+ ///
+ /// Defines the assignment element
+ ///
+ public class AssignmentElement: RuleElement
+ {
+ ///
+ /// Gets or set the property's name
+ ///
+ public string Property { get; set; }
+
+ ///
+ /// Gets or sets the assignment operator
+ ///
+ public string Operator { get; set; }
+
+ ///
+ /// Gets or sets the assignment value
+ ///
+ public RuleElement Value { get; set; }
+
+ ///
+ /// Gets or sets an optional prefix
+ ///
+ public string Prefix { get; set; }
+ }
+}
diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/GroupElement.cs b/SysML2.NET.CodeGenerator/Grammar/Model/GroupElement.cs
new file mode 100644
index 000000000..820bbf6f5
--- /dev/null
+++ b/SysML2.NET.CodeGenerator/Grammar/Model/GroupElement.cs
@@ -0,0 +1,35 @@
+// -------------------------------------------------------------------------------------------------
+//
+//
+// Copyright 2022-2026 Starion Group S.A.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+// ------------------------------------------------------------------------------------------------
+
+namespace SysML2.NET.CodeGenerator.Grammar.Model
+{
+ using System.Collections.Generic;
+
+ ///
+ /// Defines a group of
+ ///
+ public class GroupElement: RuleElement
+ {
+ ///
+ /// Gets the collection that are part of the
+ ///
+ public List Alternatives { get; } = [];
+ }
+}
diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/IPartOfTextualRule.cs b/SysML2.NET.CodeGenerator/Grammar/Model/IPartOfTextualRule.cs
new file mode 100644
index 000000000..c47436d8a
--- /dev/null
+++ b/SysML2.NET.CodeGenerator/Grammar/Model/IPartOfTextualRule.cs
@@ -0,0 +1,33 @@
+// -------------------------------------------------------------------------------------------------
+//
+//
+// Copyright 2022-2026 Starion Group S.A.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+// ------------------------------------------------------------------------------------------------
+
+namespace SysML2.NET.CodeGenerator.Grammar.Model
+{
+ ///
+ /// Asserts that the current element is part of
+ ///
+ public interface IPartOfTextualRule
+ {
+ ///
+ /// Gets the
+ ///
+ TextualNotationRule TextualNotationRule { get; }
+ }
+}
diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/NonParsingAssignmentElement.cs b/SysML2.NET.CodeGenerator/Grammar/Model/NonParsingAssignmentElement.cs
new file mode 100644
index 000000000..54060b604
--- /dev/null
+++ b/SysML2.NET.CodeGenerator/Grammar/Model/NonParsingAssignmentElement.cs
@@ -0,0 +1,43 @@
+// -------------------------------------------------------------------------------------------------
+//
+//
+// Copyright 2022-2026 Starion Group S.A.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+// ------------------------------------------------------------------------------------------------
+
+namespace SysML2.NET.CodeGenerator.Grammar.Model
+{
+ ///
+ /// Defines the non-parsing assignment element
+ ///
+ public class NonParsingAssignmentElement : RuleElement
+ {
+ ///
+ /// Gets or sets the property's name
+ ///
+ public string PropertyName { get; set; }
+
+ ///
+ /// Gets or sets the assignment operator
+ ///
+ public string Operator { get; set; }
+
+ ///
+ /// Gets or sets the assigned value
+ ///
+ public string Value { get; set; }
+ }
+}
diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/NonTerminalElement.cs b/SysML2.NET.CodeGenerator/Grammar/Model/NonTerminalElement.cs
new file mode 100644
index 000000000..48d3d91a5
--- /dev/null
+++ b/SysML2.NET.CodeGenerator/Grammar/Model/NonTerminalElement.cs
@@ -0,0 +1,33 @@
+// -------------------------------------------------------------------------------------------------
+//
+//
+// Copyright 2022-2026 Starion Group S.A.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+// ------------------------------------------------------------------------------------------------
+
+namespace SysML2.NET.CodeGenerator.Grammar.Model
+{
+ ///
+ /// Describes a non-terminal Element
+ ///
+ public class NonTerminalElement: RuleElement
+ {
+ ///
+ /// Gets or sets the non-terminal element name
+ ///
+ public string Name { get; set; }
+ }
+}
diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/RuleElement.cs b/SysML2.NET.CodeGenerator/Grammar/Model/RuleElement.cs
new file mode 100644
index 000000000..dc937d23e
--- /dev/null
+++ b/SysML2.NET.CodeGenerator/Grammar/Model/RuleElement.cs
@@ -0,0 +1,65 @@
+// -------------------------------------------------------------------------------------------------
+//
+//
+// Copyright 2022-2026 Starion Group S.A.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+// ------------------------------------------------------------------------------------------------
+
+namespace SysML2.NET.CodeGenerator.Grammar.Model
+{
+ using System.Linq;
+
+ ///
+ /// Base class that provides information about element that is part of a rule
+ ///
+ public abstract class RuleElement: IPartOfTextualRule
+ {
+ ///
+ /// Defines all suffix that defines optional elements
+ ///
+ private static readonly string[] OptionalSuffix = ["?", "*"];
+
+ ///
+ /// Defines all suffix that defines collection elements
+ ///
+ private static readonly string[] CollectionSuffix = ["*", "+"];
+
+ ///
+ /// Gets or sets an optional suffix
+ ///
+ public string Suffix { get; set; }
+
+ ///
+ /// Asserts that the current rule element defines an optional element
+ ///
+ public bool IsOptional => !string.IsNullOrEmpty(this.Suffix) && OptionalSuffix.Contains(this.Suffix);
+
+ ///
+ /// Asserts that the current rule element defines an collection element
+ ///
+ public bool IsCollection => !string.IsNullOrEmpty(this.Suffix) && CollectionSuffix.Contains(this.Suffix);
+
+ ///
+ /// Gets or sets an optional that acts as container
+ ///
+ public RuleElement Container { get; set; }
+
+ ///
+ /// Gets the
+ ///
+ public TextualNotationRule TextualNotationRule { get; init; }
+ }
+}
diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/RuleParameter.cs b/SysML2.NET.CodeGenerator/Grammar/Model/RuleParameter.cs
new file mode 100644
index 000000000..aa4978756
--- /dev/null
+++ b/SysML2.NET.CodeGenerator/Grammar/Model/RuleParameter.cs
@@ -0,0 +1,38 @@
+// -------------------------------------------------------------------------------------------------
+//
+//
+// Copyright 2022-2026 Starion Group S.A.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+// ------------------------------------------------------------------------------------------------
+
+namespace SysML2.NET.CodeGenerator.Grammar.Model
+{
+ ///
+ /// Defines possible parameter that could be added to a
+ ///
+ public class RuleParameter
+ {
+ ///
+ /// Gets the parameter's name
+ ///
+ public string ParameterName { get; set; }
+
+ ///
+ /// Gets the name of the target Element
+ ///
+ public string TargetElementName { get; set; }
+ }
+}
diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/TerminalElement.cs b/SysML2.NET.CodeGenerator/Grammar/Model/TerminalElement.cs
new file mode 100644
index 000000000..ac2f8abe7
--- /dev/null
+++ b/SysML2.NET.CodeGenerator/Grammar/Model/TerminalElement.cs
@@ -0,0 +1,33 @@
+// -------------------------------------------------------------------------------------------------
+//
+//
+// Copyright 2022-2026 Starion Group S.A.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+// ------------------------------------------------------------------------------------------------
+
+namespace SysML2.NET.CodeGenerator.Grammar.Model
+{
+ ///
+ /// Describes a terminal Element
+ ///
+ public class TerminalElement: RuleElement
+ {
+ ///
+ /// Gets or sets the terminal element value
+ ///
+ public string Value { get; set; }
+ }
+}
diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/TextualNotationRule.cs b/SysML2.NET.CodeGenerator/Grammar/Model/TextualNotationRule.cs
new file mode 100644
index 000000000..22811eac2
--- /dev/null
+++ b/SysML2.NET.CodeGenerator/Grammar/Model/TextualNotationRule.cs
@@ -0,0 +1,55 @@
+// -------------------------------------------------------------------------------------------------
+//
+//
+// Copyright 2022-2026 Starion Group S.A.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+// ------------------------------------------------------------------------------------------------
+
+namespace SysML2.NET.CodeGenerator.Grammar.Model
+{
+ using System.Collections.Generic;
+
+ ///
+ /// Describe the content of a rule
+ ///
+ public class TextualNotationRule
+ {
+ ///
+ /// Get or set rule's name
+ ///
+ public string RuleName { get; set; }
+
+ ///
+ /// Gets or set the name of the KerML Element that the rule target
+ ///
+ public string TargetElementName { get; set; }
+
+ ///
+ /// Gets or set an optional
+ ///
+ public RuleParameter Parameter { get; set; }
+
+ ///
+ /// Gets or sets the raw string that declares the rule
+ ///
+ public string RawRule { get; set; }
+
+ ///
+ /// Gets or the collection of defined by the rule
+ ///
+ public List Alternatives { get; } = [];
+ }
+}
diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/TextualNotationSpecification.cs b/SysML2.NET.CodeGenerator/Grammar/Model/TextualNotationSpecification.cs
new file mode 100644
index 000000000..affae75c2
--- /dev/null
+++ b/SysML2.NET.CodeGenerator/Grammar/Model/TextualNotationSpecification.cs
@@ -0,0 +1,35 @@
+// -------------------------------------------------------------------------------------------------
+//
+//
+// Copyright 2022-2026 Starion Group S.A.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+// ------------------------------------------------------------------------------------------------
+
+namespace SysML2.NET.CodeGenerator.Grammar.Model
+{
+ using System.Collections.Generic;
+
+ ///
+ /// Provides access to all defined into the textual notation specification
+ ///
+ public class TextualNotationSpecification
+ {
+ ///
+ /// Gets the collection of all
+ ///
+ public List Rules { get; } = [];
+ }
+}
diff --git a/SysML2.NET.CodeGenerator/Grammar/Model/ValueLiteralElement.cs b/SysML2.NET.CodeGenerator/Grammar/Model/ValueLiteralElement.cs
new file mode 100644
index 000000000..1bf518797
--- /dev/null
+++ b/SysML2.NET.CodeGenerator/Grammar/Model/ValueLiteralElement.cs
@@ -0,0 +1,39 @@
+// -------------------------------------------------------------------------------------------------
+//
+//
+// Copyright 2022-2026 Starion Group S.A.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+// ------------------------------------------------------------------------------------------------
+
+namespace SysML2.NET.CodeGenerator.Grammar.Model
+{
+ ///
+ /// Defines a that is a value literal
+ ///
+ public class ValueLiteralElement: RuleElement
+ {
+ ///
+ /// Gets or sets the literal value
+ ///
+ public string Value { get; init; }
+
+ ///
+ /// Asserts that this value literal is to
+ ///
+ ///
+ public bool QueryIsQualifiedName() => this.Value == "[QualifiedName]";
+ }
+}
diff --git a/SysML2.NET.CodeGenerator/Grammar/TextualNotationSpecificationVisitor.cs b/SysML2.NET.CodeGenerator/Grammar/TextualNotationSpecificationVisitor.cs
new file mode 100644
index 000000000..2a17f4dd6
--- /dev/null
+++ b/SysML2.NET.CodeGenerator/Grammar/TextualNotationSpecificationVisitor.cs
@@ -0,0 +1,215 @@
+// -------------------------------------------------------------------------------------------------
+//
+//
+// Copyright 2022-2026 Starion Group S.A.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+// ------------------------------------------------------------------------------------------------
+
+namespace SysML2.NET.CodeGenerator.Grammar
+{
+ using System.Collections.Generic;
+ using System.Linq;
+
+ using SysML2.NET.CodeGenerator.Grammar.Model;
+
+ ///
+ /// Custom to read
+ ///
+ public class TextualNotationSpecificationVisitor: kebnfBaseVisitor