sysmlpy 0.79.1__tar.gz → 0.80.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 (159) hide show
  1. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/PKG-INFO +1 -1
  2. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/pyproject.toml +1 -1
  3. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/__init__.py +8 -5
  4. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/antlr_parser.py +144 -2
  5. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/antlr_visitor.py +15 -4
  6. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/definition.py +4 -2
  7. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/evaluator.py +51 -4
  8. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/usage.py +67 -18
  9. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/LICENSE +0 -0
  10. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/README.md +0 -0
  11. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/__main__.py +0 -0
  12. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/antlr/README.md +0 -0
  13. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/antlr/SysMLv2Lexer.interp +0 -0
  14. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/antlr/SysMLv2Lexer.py +0 -0
  15. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/antlr/SysMLv2Lexer.tokens +0 -0
  16. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/antlr/SysMLv2Parser.interp +0 -0
  17. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/antlr/SysMLv2Parser.py +0 -0
  18. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/antlr/SysMLv2Parser.tokens +0 -0
  19. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/antlr/SysMLv2ParserListener.py +0 -0
  20. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/antlr/SysMLv2ParserVisitor.py +0 -0
  21. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/antlr/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.interp +0 -0
  22. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/antlr/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.py +0 -0
  23. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/antlr/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.tokens +0 -0
  24. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/boxes_view.py +0 -0
  25. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/diff.py +0 -0
  26. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/examples/attribute_values.py +0 -0
  27. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/examples/part_attributes.py +0 -0
  28. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/examples/tuples_sequences.py +0 -0
  29. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/formatting.py +0 -0
  30. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/grammar/antlr4/README.md +0 -0
  31. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.g4 +0 -0
  32. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.interp +0 -0
  33. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.py +0 -0
  34. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.tokens +0 -0
  35. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/grammar/antlr4/SysMLv2Parser.g4 +0 -0
  36. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/grammar/antlr4/SysMLv2Parser.interp +0 -0
  37. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/grammar/antlr4/SysMLv2Parser.py +0 -0
  38. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/grammar/antlr4/SysMLv2Parser.tokens +0 -0
  39. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/grammar/antlr4/SysMLv2ParserListener.py +0 -0
  40. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/grammar/antlr4/SysMLv2ParserVisitor.py +0 -0
  41. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/grammar/antlr4/desc.xml +0 -0
  42. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/grammar/antlr4/examples/camera.sysml +0 -0
  43. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/grammar/antlr4/examples/toaster-system.sysml +0 -0
  44. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/grammar/antlr4/examples/vehicle-model.sysml +0 -0
  45. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/grammar/antlr4/pom.xml +0 -0
  46. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/grammar/classes.py +0 -0
  47. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/interchange.py +0 -0
  48. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/LICENSE +0 -0
  49. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/README.md +0 -0
  50. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/__init__.py +0 -0
  51. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Analysis/AnalysisTooling.sysml +0 -0
  52. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Analysis/SampledFunctions.sysml +0 -0
  53. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Analysis/StateSpaceRepresentation.sysml +0 -0
  54. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Analysis/TradeStudies.sysml +0 -0
  55. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Cause and Effect/CausationConnections.sysml +0 -0
  56. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Cause and Effect/CauseAndEffect.sysml +0 -0
  57. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Geometry/ShapeItems.sysml +0 -0
  58. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Geometry/SpatialItems.sysml +0 -0
  59. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Metadata/ImageMetadata.sysml +0 -0
  60. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Metadata/ModelingMetadata.sysml +0 -0
  61. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Metadata/ParametersOfInterestMetadata.sysml +0 -0
  62. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Metadata/RiskMetadata.sysml +0 -0
  63. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Quantities and Units/ISQ.sysml +0 -0
  64. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Quantities and Units/ISQAcoustics.sysml +0 -0
  65. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Quantities and Units/ISQAtomicNuclear.sysml +0 -0
  66. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Quantities and Units/ISQBase.sysml +0 -0
  67. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Quantities and Units/ISQCharacteristicNumbers.sysml +0 -0
  68. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Quantities and Units/ISQChemistryMolecular.sysml +0 -0
  69. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Quantities and Units/ISQCondensedMatter.sysml +0 -0
  70. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Quantities and Units/ISQElectromagnetism.sysml +0 -0
  71. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Quantities and Units/ISQInformation.sysml +0 -0
  72. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Quantities and Units/ISQLight.sysml +0 -0
  73. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Quantities and Units/ISQMechanics.sysml +0 -0
  74. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Quantities and Units/ISQSpaceTime.sysml +0 -0
  75. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Quantities and Units/ISQThermodynamics.sysml +0 -0
  76. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Quantities and Units/MeasurementRefCalculations.sysml +0 -0
  77. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Quantities and Units/MeasurementReferences.sysml +0 -0
  78. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Quantities and Units/Quantities.sysml +0 -0
  79. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Quantities and Units/QuantityCalculations.sysml +0 -0
  80. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Quantities and Units/SI.sysml +0 -0
  81. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Quantities and Units/SIPrefixes.sysml +0 -0
  82. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Quantities and Units/TensorCalculations.sysml +0 -0
  83. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Quantities and Units/Time.sysml +0 -0
  84. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Quantities and Units/USCustomaryUnits.sysml +0 -0
  85. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Quantities and Units/VectorCalculations.sysml +0 -0
  86. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Requirement Derivation/DerivationConnections.sysml +0 -0
  87. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/domain/Requirement Derivation/RequirementDerivation.sysml +0 -0
  88. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/kernel/Base.kerml +0 -0
  89. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/kernel/BaseFunctions.kerml +0 -0
  90. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/kernel/BooleanFunctions.kerml +0 -0
  91. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/kernel/Clocks.kerml +0 -0
  92. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/kernel/CollectionFunctions.kerml +0 -0
  93. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/kernel/Collections.kerml +0 -0
  94. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/kernel/ComplexFunctions.kerml +0 -0
  95. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/kernel/ControlFunctions.kerml +0 -0
  96. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/kernel/ControlPerformances.kerml +0 -0
  97. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/kernel/DataFunctions.kerml +0 -0
  98. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/kernel/FeatureReferencingPerformances.kerml +0 -0
  99. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/kernel/IntegerFunctions.kerml +0 -0
  100. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/kernel/KerML.kerml +0 -0
  101. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/kernel/Links.kerml +0 -0
  102. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/kernel/Metaobjects.kerml +0 -0
  103. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/kernel/NaturalFunctions.kerml +0 -0
  104. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/kernel/NumericalFunctions.kerml +0 -0
  105. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/kernel/Objects.kerml +0 -0
  106. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/kernel/Observation.kerml +0 -0
  107. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/kernel/OccurrenceFunctions.kerml +0 -0
  108. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/kernel/Occurrences.kerml +0 -0
  109. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/kernel/Performances.kerml +0 -0
  110. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/kernel/RationalFunctions.kerml +0 -0
  111. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/kernel/RealFunctions.kerml +0 -0
  112. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/kernel/ScalarFunctions.kerml +0 -0
  113. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/kernel/ScalarValues.kerml +0 -0
  114. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/kernel/SequenceFunctions.kerml +0 -0
  115. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/kernel/SpatialFrames.kerml +0 -0
  116. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/kernel/StatePerformances.kerml +0 -0
  117. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/kernel/StringFunctions.kerml +0 -0
  118. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/kernel/Transfers.kerml +0 -0
  119. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/kernel/TransitionPerformances.kerml +0 -0
  120. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/kernel/TrigFunctions.kerml +0 -0
  121. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/kernel/Triggers.kerml +0 -0
  122. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/kernel/VectorFunctions.kerml +0 -0
  123. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/kernel/VectorValues.kerml +0 -0
  124. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/systems/Actions.sysml +0 -0
  125. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/systems/Allocations.sysml +0 -0
  126. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/systems/AnalysisCases.sysml +0 -0
  127. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/systems/Attributes.sysml +0 -0
  128. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/systems/Calculations.sysml +0 -0
  129. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/systems/Cases.sysml +0 -0
  130. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/systems/Connections.sysml +0 -0
  131. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/systems/Constraints.sysml +0 -0
  132. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/systems/Flows.sysml +0 -0
  133. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/systems/Interfaces.sysml +0 -0
  134. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/systems/Items.sysml +0 -0
  135. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/systems/Metadata.sysml +0 -0
  136. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/systems/Parts.sysml +0 -0
  137. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/systems/Ports.sysml +0 -0
  138. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/systems/Requirements.sysml +0 -0
  139. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/systems/StandardViewDefinitions.sysml +0 -0
  140. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/systems/States.sysml +0 -0
  141. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/systems/SysML.sysml +0 -0
  142. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/systems/UseCases.sysml +0 -0
  143. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/systems/VerificationCases.sysml +0 -0
  144. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/library/systems/Views.sysml +0 -0
  145. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/lsp/__init__.py +0 -0
  146. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/lsp/__main__.py +0 -0
  147. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/lsp/protocol.py +0 -0
  148. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/lsp/server.py +0 -0
  149. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/lsp/stdio.py +0 -0
  150. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/navigate.py +0 -0
  151. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/plantuml.py +0 -0
  152. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/project.py +0 -0
  153. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/semantic.py +0 -0
  154. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/sim.py +0 -0
  155. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/spreadsheet.py +0 -0
  156. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/store.py +0 -0
  157. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/traceability.py +0 -0
  158. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/us_customary_units.txt +0 -0
  159. {sysmlpy-0.79.1 → sysmlpy-0.80.0}/src/sysmlpy/validator.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sysmlpy
3
- Version: 0.79.1
3
+ Version: 0.80.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.79.1"
9
+ version = "0.80.0"
10
10
  description = ""
11
11
  authors = [{ name = "Jon R. Fox (mycr0ft)", email = "jon.fox@drfox.com" }]
12
12
  readme = "README.md"
@@ -34,7 +34,7 @@ __all__ = [
34
34
  "render_state_transition_view_svg", "boxes_view",
35
35
  ]
36
36
  __author__ = "Jon Fox"
37
- __version__ = "0.79.1"
37
+ __version__ = "0.80.0"
38
38
 
39
39
  from sysmlpy.usage import (
40
40
  Item, Attribute, Part, Port, Action, Reference, UseCase, Requirement, Interface, Message,
@@ -282,7 +282,7 @@ def load(fp) -> Model:
282
282
  return loads(fp.read())
283
283
 
284
284
 
285
- def loads(s: str, library=None) -> Model:
285
+ def loads(s: str, library=None, rescue_language="English") -> Model:
286
286
  """Loads a model from string.
287
287
 
288
288
  This shortcut function allows a user to build a model from a string by
@@ -303,7 +303,8 @@ def loads(s: str, library=None) -> Model:
303
303
  Model
304
304
  Model instance built from the SysML source.
305
305
  """
306
- return Model().load(s, library=library)
306
+ return Model().load(s, library=library,
307
+ rescue_language=rescue_language)
307
308
 
308
309
 
309
310
  def parse(s: str, library=None):
@@ -327,7 +328,8 @@ def parse(s: str, library=None):
327
328
  return None, str(e).splitlines()
328
329
 
329
330
 
330
- def load_grammar_antlr(fp, debug=False, library=None):
331
+ def load_grammar_antlr(fp, debug=False, library=None,
332
+ rescue_language="English"):
331
333
  """SysML load from file pointer using ANTLR4 parser.
332
334
 
333
335
  Deserialize ``fp`` (a ``.read()``-supporting file-like object containing
@@ -370,7 +372,8 @@ def load_grammar_antlr(fp, debug=False, library=None):
370
372
  )
371
373
 
372
374
  try:
373
- return antlr_visitor.parse_to_dict(s, library=library)
375
+ return antlr_visitor.parse_to_dict(s, library=library,
376
+ rescue_language=rescue_language)
374
377
  except antlr_parser.SysMLSyntaxError as e:
375
378
  raise
376
379
 
@@ -7,6 +7,7 @@ generated from the OMG SysML v2 specification (2026-05 release).
7
7
  """
8
8
  import sys
9
9
  import os
10
+ import warnings
10
11
 
11
12
  from antlr4 import InputStream, CommonTokenStream
12
13
  from antlr4.atn.PredictionMode import PredictionMode
@@ -51,7 +52,8 @@ def _make_parser(content):
51
52
  return lexer, token_stream, parser
52
53
 
53
54
 
54
- def parse(source, library=None, recover=False, prediction_mode="sll"):
55
+ def parse(source, library=None, recover=False, prediction_mode="sll",
56
+ rescue_language="English"):
55
57
  """Parse SysML v2.0 source and return a parse tree.
56
58
 
57
59
  Uses two-stage parsing by default (v0.56.0): a fast SLL prediction
@@ -77,6 +79,11 @@ def parse(source, library=None, recover=False, prediction_mode="sll"):
77
79
  for debugging). ``"sll_only"`` keeps every pass in SLL
78
80
  prediction — including the fallback pass — so diagnostics
79
81
  reflect SLL behaviour (error parity with the fast path).
82
+ rescue_language : str, default "English"
83
+ Language tag used when a constraint body that does not parse as
84
+ SysML/KerML is salvaged as a textual representation
85
+ (``rep language "..." /* body */``) instead of failing the whole
86
+ model load (v0.80.0).
80
87
 
81
88
  Returns
82
89
  -------
@@ -90,13 +97,45 @@ def parse(source, library=None, recover=False, prediction_mode="sll"):
90
97
  (after both parse stages).
91
98
  """
92
99
  from pathlib import Path
93
-
100
+
94
101
  # Handle string or file input
95
102
  if hasattr(source, 'read'):
96
103
  content = source.read()
97
104
  else:
98
105
  content = source
99
106
 
107
+ try:
108
+ return _parse_tree(content, recover=recover,
109
+ prediction_mode=prediction_mode)
110
+ except SysMLSyntaxError as original_error:
111
+ if recover or not rescue_language:
112
+ raise
113
+ # Constraint-body rescue (v0.80.0): a constraint whose body does
114
+ # not parse as SysML/KerML (e.g. natural-language text) fails the
115
+ # whole model. Salvage such bodies as language-tagged textual
116
+ # representations and retry once.
117
+ rescued = _rescue_constraint_bodies(content, rescue_language)
118
+ if rescued is None:
119
+ raise
120
+ new_content, rescued_names, rescued_language = rescued
121
+ try:
122
+ tree = _parse_tree(new_content, recover=False,
123
+ prediction_mode=prediction_mode)
124
+ except SysMLSyntaxError:
125
+ # Rescue did not make the model parseable (e.g. other errors
126
+ # elsewhere) — surface the original diagnostics.
127
+ raise original_error
128
+ for cname in rescued_names:
129
+ warnings.warn(
130
+ f"constraint {cname!r} body did not parse as SysML; captured "
131
+ f"as textual representation (language {rescued_language!r})",
132
+ stacklevel=3,
133
+ )
134
+ return tree
135
+
136
+
137
+ def _parse_tree(content, recover=False, prediction_mode="sll"):
138
+ """Two-stage ANTLR parse (no rescue); the body of historical parse()."""
100
139
  force_ll = prediction_mode == "ll"
101
140
  sll_only = prediction_mode == "sll_only" or force_ll
102
141
 
@@ -156,6 +195,109 @@ def parse(source, library=None, recover=False, prediction_mode="sll"):
156
195
  return tree
157
196
 
158
197
 
198
+ def _rescue_constraint_bodies(content, language="English"):
199
+ """Salvage constraint bodies that do not parse as SysML/KerML.
200
+
201
+ Scans the source for ``constraint ... { ... }`` blocks, trial-parses
202
+ each body, and wraps failing ones as language-tagged textual
203
+ representations (``rep language "..." /* body */``) so a
204
+ natural-language constraint no longer fails the whole model load.
205
+
206
+ Returns ``(new_content, [constraint names], language)`` when at least
207
+ one body was rewritten, ``None`` when nothing was salvageable.
208
+
209
+ Constraints whose body contains ``*/`` cannot be wrapped in a comment
210
+ and are left untouched (the original error stands).
211
+ """
212
+ import re as _re
213
+
214
+ spans = []
215
+ try:
216
+ lexer = SysMLv2Lexer(InputStream(content))
217
+ lexer.removeErrorListeners()
218
+ tokens = CommonTokenStream(lexer)
219
+ tokens.fill()
220
+ except Exception:
221
+ return None
222
+ toks = [t for t in tokens.tokens if t.channel == 0]
223
+ n = len(toks)
224
+ i = 0
225
+ while i < n:
226
+ t = toks[i]
227
+ if t.type != SysMLv2Parser.CONSTRAINT:
228
+ i += 1
229
+ continue
230
+ # Walk forward to the opening brace of the body (or bail on ';').
231
+ j = i + 1
232
+ name = None
233
+ lbrace = None
234
+ while j < n:
235
+ tt = toks[j]
236
+ if tt.type == SysMLv2Parser.LBRACE:
237
+ lbrace = j
238
+ break
239
+ if tt.type in (SysMLv2Parser.SEMI, SysMLv2Parser.RBRACE,
240
+ SysMLv2Parser.EOF):
241
+ break
242
+ if name is None and tt.type != SysMLv2Parser.DEF:
243
+ name = tt.text
244
+ j += 1
245
+ if lbrace is None:
246
+ i += 1
247
+ continue
248
+ # Brace-match the body (token stream already excludes comments).
249
+ depth = 0
250
+ k = lbrace
251
+ while k < n:
252
+ if toks[k].type == SysMLv2Parser.LBRACE:
253
+ depth += 1
254
+ elif toks[k].type == SysMLv2Parser.RBRACE:
255
+ depth -= 1
256
+ if depth == 0:
257
+ break
258
+ k += 1
259
+ if k >= n or depth != 0:
260
+ i += 1
261
+ continue
262
+ if k > lbrace + 1:
263
+ start = toks[lbrace + 1].start
264
+ end = toks[k - 1].stop
265
+ body_text = content[start:end + 1]
266
+ else:
267
+ body_text = ""
268
+ start = end = toks[lbrace].stop + 1
269
+ if body_text.strip():
270
+ spans.append((name or "?", start, end, body_text))
271
+ i = k + 1
272
+
273
+ if not spans:
274
+ return None
275
+
276
+ # Trial-parse every body first; rewrite only the ones that fail.
277
+ # Apply the replacements right-to-left so earlier offsets stay valid.
278
+ replacements = []
279
+ rescued_names = []
280
+ for cname, start, end, body_text in spans:
281
+ stripped = body_text.strip()
282
+ if not stripped or "*/" in stripped:
283
+ continue
284
+ probe = ("package __rescue_probe__ { constraint __c__ { "
285
+ + stripped + " } }")
286
+ try:
287
+ _parse_tree(probe)
288
+ continue # body is valid SysML — leave it alone
289
+ except SysMLSyntaxError:
290
+ pass
291
+ replacements.append((start, end, stripped))
292
+ rescued_names.append(cname)
293
+ if not rescued_names:
294
+ return None
295
+ for start, end, replacement in sorted(replacements, reverse=True):
296
+ wrapped = 'rep language "%s" /*%s*/' % (language, replacement)
297
+ content = content[:start] + wrapped + content[end + 1:]
298
+ return content, rescued_names, language
299
+
300
+
159
301
  def parse_file(filepath):
160
302
  """Parse a SysML v2.0 file.
161
303
 
@@ -527,7 +527,7 @@ def _visit_annotating_element_dict(annot_elem_ctx):
527
527
  }
528
528
 
529
529
 
530
- def parse_to_dict(source, library=None):
530
+ def parse_to_dict(source, library=None, rescue_language="English"):
531
531
  """Parse SysML source and return a dictionary.
532
532
 
533
533
  Parameters
@@ -544,7 +544,8 @@ def parse_to_dict(source, library=None):
544
544
  """
545
545
  from sysmlpy import antlr_parser
546
546
 
547
- tree = antlr_parser.parse(source, library=library)
547
+ tree = antlr_parser.parse(source, library=library,
548
+ rescue_language=rescue_language)
548
549
  return _visit_root_namespace_dict(tree)
549
550
 
550
551
 
@@ -3535,8 +3536,9 @@ def _visit_non_behavior_body_item(nbi_ctx):
3535
3536
  }
3536
3537
 
3537
3538
  elif cname == 'DefinitionMemberContext':
3538
- # Handle comments/documentation inside bodies
3539
- # Structure: DefinitionMember -> DefinitionElement -> AnnotatingElement -> Comment
3539
+ # Handle comments/documentation/textual representations inside
3540
+ # bodies. Structure: DefinitionMember -> DefinitionElement ->
3541
+ # AnnotatingElement -> Comment | Documentation | TextualRepresentation
3540
3542
  for c2 in child.children:
3541
3543
  if type(c2).__name__ == 'DefinitionElementContext':
3542
3544
  for c3 in c2.children:
@@ -3549,6 +3551,15 @@ def _visit_non_behavior_body_item(nbi_ctx):
3549
3551
  doc = _visit_documentation_dict(c3.documentation())
3550
3552
  if doc:
3551
3553
  return doc
3554
+ elif hasattr(c3, 'textualRepresentation') and c3.textualRepresentation():
3555
+ # `rep language "English" /* body text */` —
3556
+ # a constraint/calc body expressed in another
3557
+ # language (v0.80.0). Keep the raw text (with
3558
+ # /* */ markers) so classes.TextualRepresentation
3559
+ # dumps it back verbatim.
3560
+ tr = _visit_textual_representation_dict(c3.textualRepresentation())
3561
+ if tr:
3562
+ return tr
3552
3563
 
3553
3564
  elif cname == 'StructureUsageMemberContext':
3554
3565
  # Handle occurrence usages (parts, items, ports)
@@ -62,7 +62,8 @@ class Model(Searchable):
62
62
  return f"{cls_name}(children=[{children_repr}])"
63
63
  return f"{cls_name}()"
64
64
 
65
- def load(self: type[ModelType], s: str, library=None) -> ModelType:
65
+ def load(self: type[ModelType], s: str, library=None,
66
+ rescue_language="English") -> ModelType:
66
67
  """Load a SysML model from a string using ANTLR4 parser.
67
68
 
68
69
  Parameters
@@ -92,7 +93,8 @@ class Model(Searchable):
92
93
  if first_word in invalid_starts:
93
94
  raise ValueError("Base Model must be encapsulated by a package.")
94
95
 
95
- definition = load_grammar_antlr(s, library=library)["ownedRelationship"]
96
+ definition = load_grammar_antlr(s, library=library,
97
+ rescue_language=rescue_language)["ownedRelationship"]
96
98
  return self._load_definition(definition)
97
99
 
98
100
  def _load_definition(self: type[ModelType], definition) -> ModelType:
@@ -200,7 +200,9 @@ class _Collector:
200
200
  self.root = _Namespace("", ())
201
201
  self.types = {} # bare type name -> _Namespace (definitions)
202
202
  self.calcs = {} # qname string -> (expr dict, scope namespaces)
203
- self.constraints = [] # (qname string, expr dict, scope namespaces)
203
+ # (qname string, expr dict, scope namespaces,
204
+ # [(language, text), ...] textual representations)
205
+ self.constraints = []
204
206
  self._anon = 0
205
207
 
206
208
  # -- entry ---------------------------------------------------------
@@ -306,10 +308,12 @@ class _Collector:
306
308
 
307
309
  def _handle_constraint(self, node, qname, scope):
308
310
  expr = self._body_expression(node.get("body"))
309
- if expr is None:
311
+ textual = self._body_textual_representations(node.get("body"))
312
+ if expr is None and not textual:
310
313
  return
311
314
  dn = _declared_name(node.get("declaration")) or self._anon_name()
312
- self.constraints.append(("::".join(qname + (dn,)), expr, list(scope)))
315
+ self.constraints.append(
316
+ ("::".join(qname + (dn,)), expr, list(scope), textual))
313
317
 
314
318
  @staticmethod
315
319
  def _body_expression(body):
@@ -323,6 +327,40 @@ class _Collector:
323
327
  return oe
324
328
  return _find_first(body, "OwnedExpression")
325
329
 
330
+ @staticmethod
331
+ def _body_textual_representations(body):
332
+ """[(language, text), ...] from `rep language "..." /* ... */` bodies.
333
+
334
+ The visitor places TextualRepresentation dicts at
335
+ body.part[].item[].item.ownedRelationship[] (CalculationBodyPart ->
336
+ CalculationBodyItem -> ActionBodyItem).
337
+ """
338
+ out = []
339
+ if not isinstance(body, dict):
340
+ return out
341
+ for part in body.get("part") or []:
342
+ if not isinstance(part, dict):
343
+ continue
344
+ for item in part.get("item") or []:
345
+ if not isinstance(item, dict):
346
+ continue
347
+ abi = item.get("item")
348
+ if not isinstance(abi, dict) or \
349
+ abi.get("name") != "ActionBodyItem":
350
+ continue
351
+ rel = abi.get("ownedRelationship")
352
+ rels = rel if isinstance(rel, list) else (
353
+ [rel] if isinstance(rel, dict) else [])
354
+ for r in rels:
355
+ if isinstance(r, dict) and \
356
+ r.get("name") == "TextualRepresentation":
357
+ text = str(r.get("body") or "")
358
+ # Strip the /* */ comment markers the lexer keeps.
359
+ if text.startswith("/*") and text.endswith("*/"):
360
+ text = text[2:-2].strip()
361
+ out.append((r.get("language") or "", text))
362
+ return out
363
+
326
364
 
327
365
  # ---------------------------------------------------------------------------
328
366
  # evaluation pass
@@ -1104,10 +1142,19 @@ def check_constraints(model, bindings=None):
1104
1142
  """
1105
1143
  collector = _collect_model(model)
1106
1144
  results = []
1107
- for qname, expr, scope in collector.constraints:
1145
+ for qname, expr, scope, textual in collector.constraints:
1108
1146
  evaluator = _Evaluator(scope, bindings=bindings,
1109
1147
  types=collector.types)
1110
1148
  result = ConstraintResult(qualified_name=qname)
1149
+ if expr is None:
1150
+ language, text = textual[0]
1151
+ result.expression_text = text
1152
+ result.error = (
1153
+ "not machine-evaluable \u2014 textual body in language "
1154
+ f"'{language or 'unspecified'}': {text!r}"
1155
+ )
1156
+ results.append(result)
1157
+ continue
1111
1158
  result.expression_text = _expression_text(expr)
1112
1159
  try:
1113
1160
  value = evaluator.evaluate(expr)
@@ -1296,15 +1296,21 @@ def _load_behavior_child(parent, inner, inner_name):
1296
1296
  """
1297
1297
  def _name_from_declaration(elem):
1298
1298
  """Extract a human-readable name from an element's declaration,
1299
- mirroring the pattern at definition.py:1269-1290."""
1300
- if not hasattr(elem, "declaration") or elem.declaration is None:
1301
- return None
1302
- decl = elem.declaration
1299
+ mirroring the pattern at definition.py:1269-1290.
1300
+
1301
+ Declaration chains differ per kind — e.g. ``ConstraintUsage``
1302
+ nests one level deeper than ``Usage``
1303
+ (CalculationUsageDeclaration -> UsageDeclaration ->
1304
+ FeatureDeclaration -> Identification) — so walk ``.declaration``
1305
+ until an Identification is found.
1306
+ """
1303
1307
  # AssertConstraintUsage has a different layout: declaration may
1304
1308
  # be wrapped under .usageDeclaration.
1305
- if hasattr(decl, "usageDeclaration") and decl.usageDeclaration():
1309
+ decl = getattr(elem, "declaration", None)
1310
+ if decl is not None and callable(getattr(decl, "usageDeclaration", None)) \
1311
+ and decl.usageDeclaration():
1306
1312
  inner_decl = decl.usageDeclaration()
1307
- if hasattr(inner_decl, "identification") and inner_decl.identification:
1313
+ if getattr(inner_decl, "identification", None):
1308
1314
  ident = inner_decl.identification
1309
1315
  if hasattr(ident, "declaredName"):
1310
1316
  return ident.declaredName
@@ -1314,18 +1320,16 @@ def _load_behavior_child(parent, inner, inner_name):
1314
1320
  if isinstance(name_obj, list):
1315
1321
  return name_obj[-1].getText()
1316
1322
  return name_obj.getText()
1317
- if hasattr(decl, "declaration") and decl.declaration:
1318
- feat_decl = decl.declaration
1319
- if hasattr(feat_decl, "identification") and feat_decl.identification:
1320
- ident = feat_decl.identification
1321
- if hasattr(ident, "declaredName"):
1322
- return ident.declaredName
1323
- if hasattr(ident, "name"):
1324
- name_obj = ident.name()
1325
- if name_obj:
1326
- if isinstance(name_obj, list):
1327
- return name_obj[-1].getText()
1328
- return name_obj.getText()
1323
+ node = decl
1324
+ depth = 0
1325
+ while node is not None and depth < 4:
1326
+ ident = getattr(node, "identification", None)
1327
+ if ident is not None:
1328
+ declared = getattr(ident, "declaredName", None)
1329
+ if declared:
1330
+ return declared
1331
+ node = getattr(node, "declaration", None)
1332
+ depth += 1
1329
1333
  return None
1330
1334
 
1331
1335
  # Behavior usages created without load_from_grammar still capture their
@@ -3962,11 +3966,56 @@ class Constraint(_NonOccurrenceUsage):
3962
3966
  else:
3963
3967
  self.grammar = ConstraintUsage()
3964
3968
 
3969
+ Usage.__init__(self)
3970
+ if definition:
3971
+ self.grammar = ConstraintDefinition()
3972
+ else:
3973
+ self.grammar = ConstraintUsage()
3974
+
3965
3975
  if name is not None:
3966
3976
  self._set_name(name)
3967
3977
  if shortname is not None:
3968
3978
  self._set_name(shortname, short=True)
3969
3979
 
3980
+ def textual_representations(self):
3981
+ """[(language, text), ...] from `rep language "..." /* ... */` bodies.
3982
+
3983
+ A constraint body expressed in another language (e.g. natural
3984
+ language) is a TextualRepresentation inside the CalculationBody.
3985
+ The text has the /* */ comment markers stripped.
3986
+ """
3987
+ out = []
3988
+ g = getattr(self, "grammar", None)
3989
+ body = getattr(g, "body", None)
3990
+ if body is None:
3991
+ return out
3992
+ for part in getattr(body, "children", []) or []:
3993
+ for item in getattr(part, "children", []) or []:
3994
+ for abi in getattr(item, "children", []) or []:
3995
+ for ch in getattr(abi, "children", []) or []:
3996
+ if ch.__class__.__name__ == "TextualRepresentation":
3997
+ text = str(ch.body or "")
3998
+ if text.startswith("/*") and text.endswith("*/"):
3999
+ text = text[2:-2].strip()
4000
+ out.append((ch.language or "", text))
4001
+ return out
4002
+
4003
+ @property
4004
+ def body_text(self):
4005
+ """Raw text of the constraint's textual body, or None.
4006
+
4007
+ Populated for natural-language bodies (``rep language "English"
4008
+ /* ... */`` and bodies salvaged by the parser's rescue pass).
4009
+ """
4010
+ reps = self.textual_representations()
4011
+ return reps[0][1] if reps else None
4012
+
4013
+ @property
4014
+ def body_language(self):
4015
+ """Language tag of the constraint's textual body, or None."""
4016
+ reps = self.textual_representations()
4017
+ return reps[0][0] or None if reps else None
4018
+
3970
4019
 
3971
4020
  class Connection(Usage):
3972
4021
  sysml_type = 'connection'
File without changes
File without changes
File without changes
File without changes
File without changes