sysmlpy 0.45.0__tar.gz → 0.46.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/PKG-INFO +1 -1
  2. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/pyproject.toml +1 -1
  3. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/__init__.py +2 -2
  4. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/antlr_visitor.py +134 -0
  5. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/definition.py +11 -1
  6. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/grammar/classes.py +17 -0
  7. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/usage.py +67 -0
  8. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/LICENSE +0 -0
  9. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/README.md +0 -0
  10. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/__main__.py +0 -0
  11. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/antlr/README.md +0 -0
  12. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/antlr/SysMLv2Lexer.interp +0 -0
  13. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/antlr/SysMLv2Lexer.py +0 -0
  14. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/antlr/SysMLv2Lexer.tokens +0 -0
  15. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/antlr/SysMLv2Parser.interp +0 -0
  16. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/antlr/SysMLv2Parser.py +0 -0
  17. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/antlr/SysMLv2Parser.tokens +0 -0
  18. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/antlr/SysMLv2ParserListener.py +0 -0
  19. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/antlr/SysMLv2ParserVisitor.py +0 -0
  20. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/antlr/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.interp +0 -0
  21. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/antlr/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.py +0 -0
  22. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/antlr/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.tokens +0 -0
  23. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/antlr_parser.py +0 -0
  24. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/boxes_view.py +0 -0
  25. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/examples/attribute_values.py +0 -0
  26. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/examples/part_attributes.py +0 -0
  27. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/examples/tuples_sequences.py +0 -0
  28. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/formatting.py +0 -0
  29. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/grammar/antlr4/README.md +0 -0
  30. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.g4 +0 -0
  31. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.interp +0 -0
  32. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.py +0 -0
  33. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.tokens +0 -0
  34. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/grammar/antlr4/SysMLv2Parser.g4 +0 -0
  35. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/grammar/antlr4/SysMLv2Parser.interp +0 -0
  36. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/grammar/antlr4/SysMLv2Parser.py +0 -0
  37. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/grammar/antlr4/SysMLv2Parser.tokens +0 -0
  38. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/grammar/antlr4/SysMLv2ParserListener.py +0 -0
  39. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/grammar/antlr4/SysMLv2ParserVisitor.py +0 -0
  40. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/grammar/antlr4/desc.xml +0 -0
  41. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/grammar/antlr4/examples/camera.sysml +0 -0
  42. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/grammar/antlr4/examples/toaster-system.sysml +0 -0
  43. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/grammar/antlr4/examples/vehicle-model.sysml +0 -0
  44. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/grammar/antlr4/pom.xml +0 -0
  45. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/LICENSE +0 -0
  46. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/README.md +0 -0
  47. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/__init__.py +0 -0
  48. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Analysis/AnalysisTooling.sysml +0 -0
  49. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Analysis/SampledFunctions.sysml +0 -0
  50. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Analysis/StateSpaceRepresentation.sysml +0 -0
  51. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Analysis/TradeStudies.sysml +0 -0
  52. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Cause and Effect/CausationConnections.sysml +0 -0
  53. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Cause and Effect/CauseAndEffect.sysml +0 -0
  54. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Geometry/ShapeItems.sysml +0 -0
  55. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Geometry/SpatialItems.sysml +0 -0
  56. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Metadata/ImageMetadata.sysml +0 -0
  57. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Metadata/ModelingMetadata.sysml +0 -0
  58. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Metadata/ParametersOfInterestMetadata.sysml +0 -0
  59. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Metadata/RiskMetadata.sysml +0 -0
  60. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Quantities and Units/ISQ.sysml +0 -0
  61. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Quantities and Units/ISQAcoustics.sysml +0 -0
  62. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Quantities and Units/ISQAtomicNuclear.sysml +0 -0
  63. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Quantities and Units/ISQBase.sysml +0 -0
  64. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Quantities and Units/ISQCharacteristicNumbers.sysml +0 -0
  65. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Quantities and Units/ISQChemistryMolecular.sysml +0 -0
  66. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Quantities and Units/ISQCondensedMatter.sysml +0 -0
  67. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Quantities and Units/ISQElectromagnetism.sysml +0 -0
  68. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Quantities and Units/ISQInformation.sysml +0 -0
  69. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Quantities and Units/ISQLight.sysml +0 -0
  70. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Quantities and Units/ISQMechanics.sysml +0 -0
  71. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Quantities and Units/ISQSpaceTime.sysml +0 -0
  72. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Quantities and Units/ISQThermodynamics.sysml +0 -0
  73. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Quantities and Units/MeasurementRefCalculations.sysml +0 -0
  74. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Quantities and Units/MeasurementReferences.sysml +0 -0
  75. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Quantities and Units/Quantities.sysml +0 -0
  76. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Quantities and Units/QuantityCalculations.sysml +0 -0
  77. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Quantities and Units/SI.sysml +0 -0
  78. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Quantities and Units/SIPrefixes.sysml +0 -0
  79. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Quantities and Units/TensorCalculations.sysml +0 -0
  80. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Quantities and Units/Time.sysml +0 -0
  81. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Quantities and Units/USCustomaryUnits.sysml +0 -0
  82. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Quantities and Units/VectorCalculations.sysml +0 -0
  83. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Requirement Derivation/DerivationConnections.sysml +0 -0
  84. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/domain/Requirement Derivation/RequirementDerivation.sysml +0 -0
  85. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/kernel/Base.kerml +0 -0
  86. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/kernel/BaseFunctions.kerml +0 -0
  87. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/kernel/BooleanFunctions.kerml +0 -0
  88. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/kernel/Clocks.kerml +0 -0
  89. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/kernel/CollectionFunctions.kerml +0 -0
  90. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/kernel/Collections.kerml +0 -0
  91. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/kernel/ComplexFunctions.kerml +0 -0
  92. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/kernel/ControlFunctions.kerml +0 -0
  93. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/kernel/ControlPerformances.kerml +0 -0
  94. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/kernel/DataFunctions.kerml +0 -0
  95. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/kernel/FeatureReferencingPerformances.kerml +0 -0
  96. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/kernel/IntegerFunctions.kerml +0 -0
  97. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/kernel/KerML.kerml +0 -0
  98. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/kernel/Links.kerml +0 -0
  99. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/kernel/Metaobjects.kerml +0 -0
  100. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/kernel/NaturalFunctions.kerml +0 -0
  101. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/kernel/NumericalFunctions.kerml +0 -0
  102. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/kernel/Objects.kerml +0 -0
  103. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/kernel/Observation.kerml +0 -0
  104. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/kernel/OccurrenceFunctions.kerml +0 -0
  105. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/kernel/Occurrences.kerml +0 -0
  106. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/kernel/Performances.kerml +0 -0
  107. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/kernel/RationalFunctions.kerml +0 -0
  108. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/kernel/RealFunctions.kerml +0 -0
  109. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/kernel/ScalarFunctions.kerml +0 -0
  110. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/kernel/ScalarValues.kerml +0 -0
  111. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/kernel/SequenceFunctions.kerml +0 -0
  112. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/kernel/SpatialFrames.kerml +0 -0
  113. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/kernel/StatePerformances.kerml +0 -0
  114. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/kernel/StringFunctions.kerml +0 -0
  115. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/kernel/Transfers.kerml +0 -0
  116. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/kernel/TransitionPerformances.kerml +0 -0
  117. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/kernel/TrigFunctions.kerml +0 -0
  118. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/kernel/Triggers.kerml +0 -0
  119. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/kernel/VectorFunctions.kerml +0 -0
  120. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/kernel/VectorValues.kerml +0 -0
  121. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/systems/Actions.sysml +0 -0
  122. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/systems/Allocations.sysml +0 -0
  123. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/systems/AnalysisCases.sysml +0 -0
  124. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/systems/Attributes.sysml +0 -0
  125. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/systems/Calculations.sysml +0 -0
  126. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/systems/Cases.sysml +0 -0
  127. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/systems/Connections.sysml +0 -0
  128. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/systems/Constraints.sysml +0 -0
  129. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/systems/Flows.sysml +0 -0
  130. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/systems/Interfaces.sysml +0 -0
  131. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/systems/Items.sysml +0 -0
  132. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/systems/Metadata.sysml +0 -0
  133. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/systems/Parts.sysml +0 -0
  134. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/systems/Ports.sysml +0 -0
  135. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/systems/Requirements.sysml +0 -0
  136. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/systems/StandardViewDefinitions.sysml +0 -0
  137. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/systems/States.sysml +0 -0
  138. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/systems/SysML.sysml +0 -0
  139. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/systems/UseCases.sysml +0 -0
  140. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/systems/VerificationCases.sysml +0 -0
  141. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/library/systems/Views.sysml +0 -0
  142. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/navigate.py +0 -0
  143. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/plantuml.py +0 -0
  144. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/project.py +0 -0
  145. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/semantic.py +0 -0
  146. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/store.py +0 -0
  147. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/us_customary_units.txt +0 -0
  148. {sysmlpy-0.45.0 → sysmlpy-0.46.0}/src/sysmlpy/validator.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sysmlpy
3
- Version: 0.45.0
3
+ Version: 0.46.0
4
4
  Summary:
5
5
  License-File: LICENSE
6
6
  Author: Jon R. Fox (mycr0ft)
@@ -6,7 +6,7 @@ build-backend = "poetry.core.masonry.api"
6
6
 
7
7
  [project]
8
8
  name = "sysmlpy"
9
- version = "0.45.0"
9
+ version = "0.46.0"
10
10
  description = ""
11
11
  authors = [{ name = "Jon R. Fox (mycr0ft)", email = "jon.fox@drfox.com" }]
12
12
  readme = "README.md"
@@ -25,14 +25,14 @@ __all__ = [
25
25
  "render_state_transition_view_svg", "boxes_view",
26
26
  ]
27
27
  __author__ = "Jon Fox"
28
- __version__ = "0.45.0"
28
+ __version__ = "0.46.0"
29
29
 
30
30
  from sysmlpy.usage import (
31
31
  Item, Attribute, Part, Port, Action, Reference, UseCase, Requirement, Interface, Message,
32
32
  State, Constraint, Connection, Flow, Calculation, Enumeration,
33
33
  Allocation, Metadata, Rendering, Individual, FlowDef,
34
34
  View, Viewpoint, Concern,
35
- Case, AnalysisCase, VerificationCase,
35
+ Case, AnalysisCase, VerificationCase, Dependency,
36
36
  )
37
37
 
38
38
  from sysmlpy.definition import Model, Package
@@ -826,6 +826,12 @@ def _visit_definition_element_dict(def_elem_ctx, prefix=None):
826
826
  # the round-trip dict preserves the `standard library` keywords.
827
827
  ctx = def_elem_ctx.libraryPackage()
828
828
  return _make_nested_package_dict(ctx, prefix, is_standard_library=True)
829
+ elif hasattr(def_elem_ctx, 'dependency') and def_elem_ctx.dependency():
830
+ # Issue #4: dependency statements were silently dropped. The grammar
831
+ # class Dependency is fully implemented but no visitor dispatch
832
+ # constructed it.
833
+ ctx = def_elem_ctx.dependency()
834
+ return _make_dependency_dict(ctx, prefix)
829
835
  elif hasattr(def_elem_ctx, 'itemDefinition') and def_elem_ctx.itemDefinition():
830
836
  ctx = def_elem_ctx.itemDefinition()
831
837
  return _make_item_definition_dict(ctx, prefix)
@@ -8117,6 +8123,134 @@ def _make_individual_usage_dict(ctx, prefix=None):
8117
8123
  }
8118
8124
 
8119
8125
 
8126
+ def _make_dependency_dict(ctx, member_prefix=None):
8127
+ """Create a Dependency dictionary.
8128
+
8129
+ Grammar (SysML v2):
8130
+ dependency
8131
+ : (prefixMetadataAnnotation)* DEPENDENCY (identification? FROM)?
8132
+ qualifiedName (COMMA qualifiedName)* TO qualifiedName
8133
+ (COMMA qualifiedName)* relationshipBody
8134
+ | (prefixMetadataAnnotation)* DEPENDENCY dependencyDeclaration
8135
+ relationshipBody
8136
+ ;
8137
+
8138
+ Wrapped in PackageMember + DefinitionElement so the loader places it in
8139
+ the enclosing package / namespace body.
8140
+ """
8141
+ if ctx is None:
8142
+ return None
8143
+
8144
+ identification = None
8145
+ clients = []
8146
+ suppliers = []
8147
+ body = {"name": "RelationshipBody", "ownedRelationship": []}
8148
+
8149
+ if hasattr(ctx, 'dependencyDeclaration') and ctx.dependencyDeclaration():
8150
+ # Alternative 2: dependencyDeclaration carries identification / FROM /
8151
+ # client-list / supplier-list / TO. relationshipBody is the next
8152
+ # sibling on the dependency context.
8153
+ dep_decl = ctx.dependencyDeclaration()
8154
+ if hasattr(dep_decl, 'identification') and dep_decl.identification():
8155
+ identification = _build_identification_dict(dep_decl.identification())
8156
+ qn_list = dep_decl.qualifiedName()
8157
+ if not isinstance(qn_list, list):
8158
+ qn_list = [qn_list] if qn_list is not None else []
8159
+ # Split on TO: first batch is clients, second batch is suppliers.
8160
+ to_token = dep_decl.TO()
8161
+ if to_token is not None:
8162
+ # ANTLR TerminalNodeImpl doesn't expose `.start` directly; use
8163
+ # `.symbol.start` (the underlying token's char position).
8164
+ to_start = to_token.symbol.start
8165
+ split_idx = len(qn_list)
8166
+ for i, qn in enumerate(qn_list):
8167
+ if qn.start.start > to_start:
8168
+ split_idx = i
8169
+ break
8170
+ clients = qn_list[:split_idx]
8171
+ suppliers = qn_list[split_idx:]
8172
+ else:
8173
+ clients = qn_list
8174
+ # relationshipBody sits on the parent dependency context
8175
+ if hasattr(ctx, 'relationshipBody') and ctx.relationshipBody():
8176
+ body = _visit_dependency_relationship_body_dict(ctx.relationshipBody())
8177
+ else:
8178
+ # Alternative 1: bare `dependency [ident]? [from]? qn , qn , ... to qn , qn , ... {body}`
8179
+ if hasattr(ctx, 'identification') and ctx.identification():
8180
+ identification = _build_identification_dict(ctx.identification())
8181
+ qn_list = ctx.qualifiedName()
8182
+ if not isinstance(qn_list, list):
8183
+ qn_list = [qn_list] if qn_list is not None else []
8184
+ to_token = ctx.TO()
8185
+ if to_token is not None:
8186
+ to_start = to_token.symbol.start
8187
+ split_idx = len(qn_list)
8188
+ for i, qn in enumerate(qn_list):
8189
+ if qn.start.start > to_start:
8190
+ split_idx = i
8191
+ break
8192
+ clients = qn_list[:split_idx]
8193
+ suppliers = qn_list[split_idx:]
8194
+ else:
8195
+ clients = qn_list
8196
+ if hasattr(ctx, 'relationshipBody') and ctx.relationshipBody():
8197
+ body = _visit_dependency_relationship_body_dict(ctx.relationshipBody())
8198
+
8199
+ return {
8200
+ "name": "PackageMember",
8201
+ "prefix": member_prefix,
8202
+ "ownedRelatedElement": {
8203
+ "name": "DefinitionElement",
8204
+ "ownedRelatedElement": {
8205
+ "name": "Dependency",
8206
+ "identification": identification,
8207
+ "clients": [
8208
+ {"name": "QualifiedName", "names": qn.getText().split("::")}
8209
+ for qn in clients if qn is not None
8210
+ ],
8211
+ "suppliers": [
8212
+ {"name": "QualifiedName", "names": qn.getText().split("::")}
8213
+ for qn in suppliers if qn is not None
8214
+ ],
8215
+ "body": body,
8216
+ }
8217
+ }
8218
+ }
8219
+
8220
+
8221
+ def _visit_dependency_relationship_body_dict(rb_ctx):
8222
+ """Capture a dependency's relationshipBody.
8223
+
8224
+ Mirrors the aliasMember pattern: walk the body for any
8225
+ OwnedAnnotation / CommentSysML so doc comments survive the round-trip.
8226
+ For the `;` form (empty body), returns the empty shape.
8227
+ """
8228
+ if rb_ctx is None:
8229
+ return {"name": "RelationshipBody", "ownedRelationship": []}
8230
+ owned = []
8231
+ for child in rb_ctx.children:
8232
+ if type(child).__name__ == 'RelationshipOwnedElementContext':
8233
+ for c2 in child.children:
8234
+ if type(c2).__name__ == 'OwnedAnnotationContext':
8235
+ for c3 in c2.children:
8236
+ if type(c3).__name__ == 'AnnotatingElementContext':
8237
+ owned.append({
8238
+ "name": "OwnedAnnotation",
8239
+ "ownedRelatedElement": [
8240
+ {
8241
+ "name": "AnnotatingElement",
8242
+ "ownedRelatedElement": {
8243
+ "name": "CommentSysML",
8244
+ "body": c3.getText(),
8245
+ "identification": None,
8246
+ "ownedRelationship": []
8247
+ }
8248
+ }
8249
+ ]
8250
+ })
8251
+ return {"name": "RelationshipBody", "ownedRelationship": owned}
8252
+
8253
+
8120
8254
  def _make_enumeration_definition_dict(ctx, member_prefix=None):
8121
8255
  """Create an EnumerationDefinition dictionary.
8122
8256
 
@@ -20,7 +20,7 @@ from sysmlpy.grammar.classes import (
20
20
  )
21
21
  from sysmlpy.grammar.classes import Package as PackageGrammar
22
22
 
23
- from sysmlpy import Part, Item, Port, Requirement, UseCase, Attribute, Action, Case, AnalysisCase, VerificationCase, Interface, Message
23
+ from sysmlpy import Part, Item, Port, Requirement, UseCase, Attribute, Action, Case, AnalysisCase, VerificationCase, Interface, Message, Dependency
24
24
  from sysmlpy.usage import (
25
25
  State, Constraint, Connection, Flow, Calculation, Enumeration,
26
26
  Allocation, Metadata, Rendering, Individual, FlowDef,
@@ -1299,6 +1299,16 @@ class Package(Searchable):
1299
1299
  r.name = feat_decl.identification.declaredName
1300
1300
  r.parent = self
1301
1301
  self.children.append(r)
1302
+ elif inner_class == "Dependency":
1303
+ # Issue #4: dependency statements were silently dropped
1304
+ # because no visitor dispatch produced a Dependency dict and
1305
+ # Package.load_from_grammar had no branch for it.
1306
+ d = Dependency()
1307
+ d.grammar = inner_element
1308
+ if hasattr(inner_element, 'identification') and inner_element.identification:
1309
+ d.name = inner_element.identification.declaredName
1310
+ d.parent = self
1311
+ self.children.append(d)
1302
1312
  else:
1303
1313
  print(f"[Package.load_from_grammar] Unknown class: {inner_class} - skipping") # pragma: no cover
1304
1314
 
@@ -226,6 +226,17 @@ class DefinitionElement:
226
226
  self.children.append(
227
227
  InterfaceUsage(definition["ownedRelatedElement"])
228
228
  )
229
+ elif de == "Dependency":
230
+ # Issue #4: dependency statements were silently dropped
231
+ # because no visitor dispatch produced a Dependency dict and
232
+ # no DefinitionElement branch constructed it.
233
+ self.children.append(Dependency(definition["ownedRelatedElement"]))
234
+ elif de == "LibraryPackage":
235
+ # `standard library package Foo { ... }` shares the same
236
+ # {identification, body} shape as `package Foo { ... }` plus
237
+ # an isStandardLibrary flag. Reuse Package; the flag is read
238
+ # from the dict in Package.__init__.
239
+ self.children.append(Package(definition["ownedRelatedElement"]))
229
240
  else:
230
241
  print(f"Unknown DefinitionElement type: {de}") # pragma: no cover
231
242
 
@@ -9778,6 +9789,12 @@ class Dependency:
9778
9789
  output = [self.keyword]
9779
9790
  if self.identification is not None:
9780
9791
  output.append(self.identification.dump())
9792
+ # Issue #4: the ANTLR grammar ambiguity means an unnamed-form
9793
+ # `dependency name a to X;` is unparseable — `name` is taken as
9794
+ # the identification and `a` then has nowhere to go. To round-trip
9795
+ # safely we always emit `from` between the identification and the
9796
+ # client list.
9797
+ output.append("from")
9781
9798
  output.append(", ".join([c.dump() for c in self.clients]))
9782
9799
  output.append("to")
9783
9800
  output.append(", ".join([s.dump() for s in self.suppliers]))
@@ -4285,3 +4285,70 @@ class DefaultReference(Usage):
4285
4285
  # )
4286
4286
 
4287
4287
  # return package
4288
+
4289
+
4290
+ class Dependency(Usage):
4291
+ """SysML v2 Dependency usage.
4292
+
4293
+ Represents a UML-style dependency between model elements.
4294
+ Usage:
4295
+ Dependency() # dependency ;
4296
+ Dependency(name='D') # dependency D from x to y;
4297
+ """
4298
+ sysml_type = 'dependency'
4299
+
4300
+ def __init__(self, name=None, clients=None, suppliers=None, shortname=None):
4301
+ Usage.__init__(self)
4302
+ self.grammar = None
4303
+ self.clients = clients or []
4304
+ self.suppliers = suppliers or []
4305
+ # Usage.__init__ assigns a UUID-based name; override to None when
4306
+ # the dependency is anonymous (the common case for
4307
+ # `dependency b to A;`).
4308
+ self.name = name
4309
+ if shortname is not None:
4310
+ self._set_name(shortname, short=True)
4311
+
4312
+ def dump(self):
4313
+ # Issue #4: dependencies are emitted from the grammar tree; this
4314
+ # method exists for compatibility with the Usage API.
4315
+ if self.grammar is not None and hasattr(self.grammar, 'dump'):
4316
+ return self.grammar.dump()
4317
+ return "dependency"
4318
+
4319
+ def _get_definition(self, child=None):
4320
+ """Build a PackageMember-wrapped Dependency dict for the model tree.
4321
+
4322
+ The Dependency grammar class returns the bare inner shape
4323
+ (`{"name": "Dependency", "identification": ..., "clients": ...,
4324
+ "suppliers": ..., "body": ...}`). For inclusion in a package body
4325
+ we wrap it the same way other definitions are wrapped:
4326
+ `PackageMember -> DefinitionElement -> Dependency`.
4327
+ """
4328
+ if self.grammar is not None and hasattr(self.grammar, 'get_definition'):
4329
+ grammar_def = self.grammar.get_definition()
4330
+ else:
4331
+ grammar_def = {
4332
+ "name": "Dependency",
4333
+ "identification": None,
4334
+ "clients": [],
4335
+ "suppliers": [],
4336
+ "body": None,
4337
+ }
4338
+ # Sync identification name
4339
+ if self.name is not None and grammar_def.get("identification"):
4340
+ grammar_def["identification"]["declaredName"] = self.name
4341
+ elif self.name is not None:
4342
+ grammar_def["identification"] = {
4343
+ "name": "Identification",
4344
+ "declaredName": self.name,
4345
+ "declaredShortName": None,
4346
+ }
4347
+ return {
4348
+ "name": "PackageMember",
4349
+ "prefix": None,
4350
+ "ownedRelatedElement": {
4351
+ "name": "DefinitionElement",
4352
+ "ownedRelatedElement": grammar_def,
4353
+ },
4354
+ }
File without changes
File without changes
File without changes