Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/sysmlpy/antlr/SysMLv2Parser.interp

Large diffs are not rendered by default.

12,714 changes: 4,773 additions & 7,941 deletions src/sysmlpy/antlr/SysMLv2Parser.py

Large diffs are not rendered by default.

18 changes: 0 additions & 18 deletions src/sysmlpy/antlr/SysMLv2ParserListener.py
Original file line number Diff line number Diff line change
Expand Up @@ -4490,15 +4490,6 @@ def exitNamespaceImportDirect(self, ctx:SysMLv2Parser.NamespaceImportDirectConte
pass


# Enter a parse tree produced by SysMLv2Parser#calculationUsageDeclaration.
def enterCalculationUsageDeclaration(self, ctx:SysMLv2Parser.CalculationUsageDeclarationContext):
pass

# Exit a parse tree produced by SysMLv2Parser#calculationUsageDeclaration.
def exitCalculationUsageDeclaration(self, ctx:SysMLv2Parser.CalculationUsageDeclarationContext):
pass


# Enter a parse tree produced by SysMLv2Parser#emptyActionUsage_.
def enterEmptyActionUsage_(self, ctx:SysMLv2Parser.EmptyActionUsage_Context):
pass
Expand Down Expand Up @@ -4535,15 +4526,6 @@ def exitEmptyUsage_(self, ctx:SysMLv2Parser.EmptyUsage_Context):
pass


# Enter a parse tree produced by SysMLv2Parser#filterPackageImport.
def enterFilterPackageImport(self, ctx:SysMLv2Parser.FilterPackageImportContext):
pass

# Exit a parse tree produced by SysMLv2Parser#filterPackageImport.
def exitFilterPackageImport(self, ctx:SysMLv2Parser.FilterPackageImportContext):
pass


# Enter a parse tree produced by SysMLv2Parser#nonFeatureChainPrimaryExpression.
def enterNonFeatureChainPrimaryExpression(self, ctx:SysMLv2Parser.NonFeatureChainPrimaryExpressionContext):
pass
Expand Down
10 changes: 0 additions & 10 deletions src/sysmlpy/antlr/SysMLv2ParserVisitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2499,11 +2499,6 @@ def visitNamespaceImportDirect(self, ctx:SysMLv2Parser.NamespaceImportDirectCont
return self.visitChildren(ctx)


# Visit a parse tree produced by SysMLv2Parser#calculationUsageDeclaration.
def visitCalculationUsageDeclaration(self, ctx:SysMLv2Parser.CalculationUsageDeclarationContext):
return self.visitChildren(ctx)


# Visit a parse tree produced by SysMLv2Parser#emptyActionUsage_.
def visitEmptyActionUsage_(self, ctx:SysMLv2Parser.EmptyActionUsage_Context):
return self.visitChildren(ctx)
Expand All @@ -2524,11 +2519,6 @@ def visitEmptyUsage_(self, ctx:SysMLv2Parser.EmptyUsage_Context):
return self.visitChildren(ctx)


# Visit a parse tree produced by SysMLv2Parser#filterPackageImport.
def visitFilterPackageImport(self, ctx:SysMLv2Parser.FilterPackageImportContext):
return self.visitChildren(ctx)


# Visit a parse tree produced by SysMLv2Parser#nonFeatureChainPrimaryExpression.
def visitNonFeatureChainPrimaryExpression(self, ctx:SysMLv2Parser.NonFeatureChainPrimaryExpressionContext):
return self.visitChildren(ctx)
Expand Down
2 changes: 1 addition & 1 deletion src/sysmlpy/antlr_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
ANTLR4-based SysML v2.0 parser module.

This module provides an alternative parser to textX, using ANTLR4 grammar
generated from the OMG SysML v2 specification (2026-03 release).
generated from the OMG SysML v2 specification (2026-05 release).
"""
import sys
import os
Expand Down
2 changes: 1 addition & 1 deletion src/sysmlpy/grammar/antlr4/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ format).
## Source

- **Specification**: [Systems-Modeling/SysML-v2-Release](https://github.com/Systems-Modeling/SysML-v2-Release)
- **Release tag**: `2026-03`
- **Release tag**: `2026-05`
- **Generator**: [daltskin/sysml-v2-grammar](https://github.com/daltskin/sysml-v2-grammar)

## Grammar Structure
Expand Down
37 changes: 22 additions & 15 deletions src/sysmlpy/grammar/antlr4/SysMLv2Parser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,11 @@ qualifiedName
: (DOLLAR COLON_COLON)? (name COLON_COLON)* name
;

// Import visibility is required at the syntax level, matching the official
// KerML/SysML 2026-05 BNF ("Import = visibility = VisibilityIndicator 'import' ...",
// KerML §8.2.3.4.2 / SysML-textual-bnf.kebnf). daltskin's translation makes it
// optional; this local deviation keeps the official shape (a bare 'import' is a
// syntax error, as the official XPECT fixture Import_Visibility_Valid expects).
importRule
: visibilityIndicator IMPORT (ALL)? importDeclaration relationshipBody
;
Expand All @@ -316,9 +321,10 @@ namespaceImport
| filterPackage
;

// OMG 2026-05 KeBNF added a real FilterPackageImport production; the previous
// TODO stub (filterPackageImport : IDENTIFIER) is no longer needed.
filterPackage
: filterPackageImportDeclaration (filterPackageMember)+
| filterPackageImport ( filterPackageMember)+
;

filterPackageMember
Expand Down Expand Up @@ -965,11 +971,15 @@ payloadFeatureMember
: payloadFeature
;

// OMG 2026-05 BNF sync (daltskin/sysml-v2-grammar v2026.05.0, commits #8/#9):
// identification is required in the typed alternatives and the ownedFeatureTyping /
// ownedMultiplicity pair is normalized.
payloadFeature
: identification? valuePart
| identification? payloadFeatureSpecializationPart valuePart?
: identification payloadFeatureSpecializationPart valuePart?
| identification valuePart
| ownedFeatureTyping ( ownedMultiplicity)?
| ownedMultiplicity ( ownedFeatureTyping)?
| ownedMultiplicity ownedFeatureTyping
| identification? payloadFeatureSpecializationPart valuePart?
;

payloadFeatureSpecializationPart
Expand Down Expand Up @@ -1110,8 +1120,10 @@ dependencyDeclaration
)*
;

// SYSML21-319 (SysML 2.1 RTF Ballot 1, Pilot PR #775): an annotating member of an
// enumeration definition may now have an explicit visibility indicator.
annotatingMember
: annotatingElement
: memberPrefix annotatingElement
;

packageBodyElement
Expand Down Expand Up @@ -2171,8 +2183,11 @@ framedConcernMember
;

framedConcernUsage
: ownedReferenceSubsetting featureSpecializationPart? calculationBody
| (usageExtensionKeyword* CONCERN | usageExtensionKeyword+) calculationUsageDeclaration calculationBody
// SYSML21-366 (SysML 2.1 RTF Ballot 1, Pilot PR #775): the second alternative of a
// framed concern usage has a requirement body (and a constraint usage declaration),
// not a calculation body.
: ownedReferenceSubsetting featureSpecializationPart? requirementBody
| (usageExtensionKeyword* CONCERN | usageExtensionKeyword+) constraintUsageDeclaration requirementBody
;

actorMember
Expand Down Expand Up @@ -2451,10 +2466,6 @@ namespaceImportDirect
// These rules are referenced in the spec but not fully defined.
// They need manual review and completion.

calculationUsageDeclaration
: usageDeclaration? valuePart?
;

emptyActionUsage_
: /* epsilon */
;
Expand All @@ -2471,10 +2482,6 @@ emptyUsage_
: /* epsilon */
;

filterPackageImport
: IDENTIFIER /* TODO: stub for filterPackageImport */
;

nonFeatureChainPrimaryExpression
: IDENTIFIER /* TODO: stub for nonFeatureChainPrimaryExpression */
;
Expand Down
4 changes: 1 addition & 3 deletions src/sysmlpy/grammar/antlr4/SysMLv2Parser.interp

Large diffs are not rendered by default.

Loading