sysmlpy 0.1.0__py3-none-any.whl
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.
- sysmlpy/__init__.py +226 -0
- sysmlpy/__main__.py +75 -0
- sysmlpy/antlr/README.md +146 -0
- sysmlpy/antlr/SysMLv2Lexer.interp +695 -0
- sysmlpy/antlr/SysMLv2Lexer.py +1123 -0
- sysmlpy/antlr/SysMLv2Lexer.tokens +444 -0
- sysmlpy/antlr/SysMLv2Parser.interp +960 -0
- sysmlpy/antlr/SysMLv2Parser.py +40750 -0
- sysmlpy/antlr/SysMLv2Parser.tokens +444 -0
- sysmlpy/antlr/SysMLv2ParserListener.py +4485 -0
- sysmlpy/antlr/SysMLv2ParserVisitor.py +2498 -0
- sysmlpy/antlr/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.interp +695 -0
- sysmlpy/antlr/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.py +1123 -0
- sysmlpy/antlr/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.tokens +444 -0
- sysmlpy/antlr_parser.py +185 -0
- sysmlpy/antlr_visitor.py +10864 -0
- sysmlpy/definition.py +1115 -0
- sysmlpy/examples/attribute_values.py +161 -0
- sysmlpy/examples/part_attributes.py +139 -0
- sysmlpy/examples/tuples_sequences.py +231 -0
- sysmlpy/formatting.py +47 -0
- sysmlpy/grammar/antlr4/README.md +30 -0
- sysmlpy/grammar/antlr4/SysMLv2Lexer.g4 +931 -0
- sysmlpy/grammar/antlr4/SysMLv2Lexer.interp +695 -0
- sysmlpy/grammar/antlr4/SysMLv2Lexer.py +1123 -0
- sysmlpy/grammar/antlr4/SysMLv2Lexer.tokens +444 -0
- sysmlpy/grammar/antlr4/SysMLv2Parser.g4 +2432 -0
- sysmlpy/grammar/antlr4/SysMLv2Parser.interp +960 -0
- sysmlpy/grammar/antlr4/SysMLv2Parser.py +40750 -0
- sysmlpy/grammar/antlr4/SysMLv2Parser.tokens +444 -0
- sysmlpy/grammar/antlr4/SysMLv2ParserListener.py +4485 -0
- sysmlpy/grammar/antlr4/SysMLv2ParserVisitor.py +2498 -0
- sysmlpy/grammar/antlr4/desc.xml +7 -0
- sysmlpy/grammar/antlr4/examples/camera.sysml +14 -0
- sysmlpy/grammar/antlr4/examples/toaster-system.sysml +193 -0
- sysmlpy/grammar/antlr4/examples/vehicle-model.sysml +118 -0
- sysmlpy/grammar/antlr4/pom.xml +59 -0
- sysmlpy/grammar/classes.py +8610 -0
- sysmlpy/library/LICENSE +165 -0
- sysmlpy/library/README.md +52 -0
- sysmlpy/library/__init__.py +0 -0
- sysmlpy/library/domain/Analysis/AnalysisTooling.sysml +34 -0
- sysmlpy/library/domain/Analysis/SampledFunctions.sysml +119 -0
- sysmlpy/library/domain/Analysis/StateSpaceRepresentation.sysml +143 -0
- sysmlpy/library/domain/Analysis/TradeStudies.sysml +171 -0
- sysmlpy/library/domain/Cause and Effect/CausationConnections.sysml +83 -0
- sysmlpy/library/domain/Cause and Effect/CauseAndEffect.sysml +81 -0
- sysmlpy/library/domain/Geometry/ShapeItems.sysml +899 -0
- sysmlpy/library/domain/Geometry/SpatialItems.sysml +168 -0
- sysmlpy/library/domain/Metadata/ImageMetadata.sysml +78 -0
- sysmlpy/library/domain/Metadata/ModelingMetadata.sysml +143 -0
- sysmlpy/library/domain/Metadata/ParametersOfInterestMetadata.sysml +39 -0
- sysmlpy/library/domain/Metadata/RiskMetadata.sysml +100 -0
- sysmlpy/library/domain/Quantities and Units/ISQ.sysml +42 -0
- sysmlpy/library/domain/Quantities and Units/ISQAcoustics.sysml +439 -0
- sysmlpy/library/domain/Quantities and Units/ISQAtomicNuclear.sysml +2726 -0
- sysmlpy/library/domain/Quantities and Units/ISQBase.sysml +206 -0
- sysmlpy/library/domain/Quantities and Units/ISQCharacteristicNumbers.sysml +1991 -0
- sysmlpy/library/domain/Quantities and Units/ISQChemistryMolecular.sysml +1353 -0
- sysmlpy/library/domain/Quantities and Units/ISQCondensedMatter.sysml +1223 -0
- sysmlpy/library/domain/Quantities and Units/ISQElectromagnetism.sysml +2333 -0
- sysmlpy/library/domain/Quantities and Units/ISQInformation.sysml +958 -0
- sysmlpy/library/domain/Quantities and Units/ISQLight.sysml +1537 -0
- sysmlpy/library/domain/Quantities and Units/ISQMechanics.sysml +1564 -0
- sysmlpy/library/domain/Quantities and Units/ISQSpaceTime.sysml +1169 -0
- sysmlpy/library/domain/Quantities and Units/ISQThermodynamics.sysml +1256 -0
- sysmlpy/library/domain/Quantities and Units/MeasurementRefCalculations.sysml +30 -0
- sysmlpy/library/domain/Quantities and Units/MeasurementReferences.sysml +526 -0
- sysmlpy/library/domain/Quantities and Units/Quantities.sysml +107 -0
- sysmlpy/library/domain/Quantities and Units/QuantityCalculations.sysml +70 -0
- sysmlpy/library/domain/Quantities and Units/SI.sysml +378 -0
- sysmlpy/library/domain/Quantities and Units/SIPrefixes.sysml +48 -0
- sysmlpy/library/domain/Quantities and Units/TensorCalculations.sysml +50 -0
- sysmlpy/library/domain/Quantities and Units/Time.sysml +274 -0
- sysmlpy/library/domain/Quantities and Units/USCustomaryUnits.sysml +260 -0
- sysmlpy/library/domain/Quantities and Units/VectorCalculations.sysml +62 -0
- sysmlpy/library/domain/Requirement Derivation/DerivationConnections.sysml +63 -0
- sysmlpy/library/domain/Requirement Derivation/RequirementDerivation.sysml +39 -0
- sysmlpy/library/kernel/Base.kerml +95 -0
- sysmlpy/library/kernel/BaseFunctions.kerml +80 -0
- sysmlpy/library/kernel/BooleanFunctions.kerml +22 -0
- sysmlpy/library/kernel/Clocks.kerml +156 -0
- sysmlpy/library/kernel/CollectionFunctions.kerml +68 -0
- sysmlpy/library/kernel/Collections.kerml +147 -0
- sysmlpy/library/kernel/ComplexFunctions.kerml +47 -0
- sysmlpy/library/kernel/ControlFunctions.kerml +117 -0
- sysmlpy/library/kernel/ControlPerformances.kerml +135 -0
- sysmlpy/library/kernel/DataFunctions.kerml +43 -0
- sysmlpy/library/kernel/FeatureReferencingPerformances.kerml +190 -0
- sysmlpy/library/kernel/IntegerFunctions.kerml +43 -0
- sysmlpy/library/kernel/KerML.kerml +483 -0
- sysmlpy/library/kernel/Links.kerml +67 -0
- sysmlpy/library/kernel/Metaobjects.kerml +58 -0
- sysmlpy/library/kernel/NaturalFunctions.kerml +27 -0
- sysmlpy/library/kernel/NumericalFunctions.kerml +43 -0
- sysmlpy/library/kernel/Objects.kerml +212 -0
- sysmlpy/library/kernel/Observation.kerml +161 -0
- sysmlpy/library/kernel/OccurrenceFunctions.kerml +154 -0
- sysmlpy/library/kernel/Occurrences.kerml +992 -0
- sysmlpy/library/kernel/Performances.kerml +293 -0
- sysmlpy/library/kernel/RationalFunctions.kerml +49 -0
- sysmlpy/library/kernel/RealFunctions.kerml +56 -0
- sysmlpy/library/kernel/ScalarFunctions.kerml +33 -0
- sysmlpy/library/kernel/ScalarValues.kerml +23 -0
- sysmlpy/library/kernel/SequenceFunctions.kerml +111 -0
- sysmlpy/library/kernel/SpatialFrames.kerml +197 -0
- sysmlpy/library/kernel/StatePerformances.kerml +145 -0
- sysmlpy/library/kernel/StringFunctions.kerml +25 -0
- sysmlpy/library/kernel/Transfers.kerml +281 -0
- sysmlpy/library/kernel/TransitionPerformances.kerml +66 -0
- sysmlpy/library/kernel/TrigFunctions.kerml +35 -0
- sysmlpy/library/kernel/Triggers.kerml +188 -0
- sysmlpy/library/kernel/VectorFunctions.kerml +273 -0
- sysmlpy/library/kernel/VectorValues.kerml +64 -0
- sysmlpy/library/systems/Actions.sysml +552 -0
- sysmlpy/library/systems/Allocations.sysml +29 -0
- sysmlpy/library/systems/AnalysisCases.sysml +38 -0
- sysmlpy/library/systems/Attributes.sysml +25 -0
- sysmlpy/library/systems/Calculations.sysml +37 -0
- sysmlpy/library/systems/Cases.sysml +71 -0
- sysmlpy/library/systems/Connections.sysml +60 -0
- sysmlpy/library/systems/Constraints.sysml +44 -0
- sysmlpy/library/systems/Flows.sysml +126 -0
- sysmlpy/library/systems/Interfaces.sysml +89 -0
- sysmlpy/library/systems/Items.sysml +153 -0
- sysmlpy/library/systems/Metadata.sysml +32 -0
- sysmlpy/library/systems/Parts.sysml +81 -0
- sysmlpy/library/systems/Ports.sysml +54 -0
- sysmlpy/library/systems/Requirements.sysml +194 -0
- sysmlpy/library/systems/StandardViewDefinitions.sysml +123 -0
- sysmlpy/library/systems/States.sysml +103 -0
- sysmlpy/library/systems/SysML.sysml +539 -0
- sysmlpy/library/systems/UseCases.sysml +57 -0
- sysmlpy/library/systems/VerificationCases.sysml +103 -0
- sysmlpy/library/systems/Views.sysml +164 -0
- sysmlpy/navigate.py +272 -0
- sysmlpy/store.py +547 -0
- sysmlpy/usage.py +2978 -0
- sysmlpy-0.1.0.dist-info/METADATA +230 -0
- sysmlpy-0.1.0.dist-info/RECORD +143 -0
- sysmlpy-0.1.0.dist-info/WHEEL +4 -0
- sysmlpy-0.1.0.dist-info/entry_points.txt +3 -0
- sysmlpy-0.1.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
|
2
|
+
<desc xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
3
|
+
xsi:noNamespaceSchemaLocation="../../_scripts/desc.xsd">
|
|
4
|
+
<targets>Java</targets>
|
|
5
|
+
<inputs>examples/**/*.sysml</inputs>
|
|
6
|
+
<entry-point>rootNamespace</entry-point>
|
|
7
|
+
</desc>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
part def Camera {
|
|
2
|
+
private import PictureTaking::*;
|
|
3
|
+
|
|
4
|
+
perform action takePicture[*] :> PictureTaking::takePicture;
|
|
5
|
+
|
|
6
|
+
part focusingSubsystem {
|
|
7
|
+
perform takePicture::focus;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
part imagingSubsystem {
|
|
11
|
+
perform takePicture::shoot;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple Toaster System Example
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
package ToasterSystem {
|
|
6
|
+
|
|
7
|
+
// DOMAIN PILLAR - Define what exists in our system
|
|
8
|
+
|
|
9
|
+
part def Toaster {
|
|
10
|
+
doc /* A household appliance for toasting bread */
|
|
11
|
+
|
|
12
|
+
part heatingElements : HeatingElement[2];
|
|
13
|
+
part lever : Lever;
|
|
14
|
+
part timer : Timer;
|
|
15
|
+
part crumbTray : CrumbTray;
|
|
16
|
+
part powerCord : PowerCord;
|
|
17
|
+
|
|
18
|
+
attribute maxTemp : Real;
|
|
19
|
+
attribute slots : Integer = 2;
|
|
20
|
+
attribute voltage : Real = 120.0;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
part def HeatingElement {
|
|
24
|
+
doc /* Resistive heating coil */
|
|
25
|
+
attribute power : Real;
|
|
26
|
+
attribute temperature : Real;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
part def Lever {
|
|
30
|
+
doc /* User control for lowering bread */
|
|
31
|
+
attribute position : LeverPosition;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
enum def LeverPosition {
|
|
35
|
+
up; down;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
part def Timer {
|
|
39
|
+
doc /* Controls toasting duration */
|
|
40
|
+
attribute duration : Real;
|
|
41
|
+
attribute setting : Integer;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
part def CrumbTray {
|
|
45
|
+
doc /* Removable tray for crumbs */
|
|
46
|
+
attribute capacity : Real;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
part def PowerCord {
|
|
50
|
+
doc /* Electrical connection */
|
|
51
|
+
attribute length : Real;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// BEHAVIOR PILLAR - Define what the system does
|
|
55
|
+
|
|
56
|
+
action def ToastBread {
|
|
57
|
+
doc /* Main toasting operation */
|
|
58
|
+
in item bread : Bread;
|
|
59
|
+
out item toast : Toast;
|
|
60
|
+
|
|
61
|
+
action lowerBread;
|
|
62
|
+
action heatElements;
|
|
63
|
+
action monitorTime;
|
|
64
|
+
action raiseToast;
|
|
65
|
+
|
|
66
|
+
// Sequential flow
|
|
67
|
+
first lowerBread;
|
|
68
|
+
then heatElements;
|
|
69
|
+
then monitorTime;
|
|
70
|
+
then raiseToast;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
action def CleanToaster {
|
|
74
|
+
doc /* Maintenance operation */
|
|
75
|
+
action removeTray;
|
|
76
|
+
action emptyTray;
|
|
77
|
+
action replaceTray;
|
|
78
|
+
|
|
79
|
+
first removeTray;
|
|
80
|
+
then emptyTray;
|
|
81
|
+
then replaceTray;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
part def Bread {
|
|
85
|
+
attribute slices : Integer;
|
|
86
|
+
attribute thickness : Real;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
part def Toast {
|
|
90
|
+
attribute brownness : BrownLevel;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
enum def BrownLevel {
|
|
94
|
+
light; medium; dark;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// REQUIREMENT PILLAR - Define what the system must satisfy
|
|
98
|
+
|
|
99
|
+
requirement def SafetyRequirements {
|
|
100
|
+
doc /* Safety specifications */
|
|
101
|
+
|
|
102
|
+
requirement autoShutoff {
|
|
103
|
+
doc /* Toaster must auto-shutoff */
|
|
104
|
+
subject toaster : Toaster;
|
|
105
|
+
require constraint { toaster::maxTemp <= 250.0 }
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
requirement coolTouch {
|
|
109
|
+
doc /* Exterior must stay cool */
|
|
110
|
+
attribute maxExteriorTemp : Real;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
requirement def PerformanceRequirements {
|
|
115
|
+
doc /* Performance specifications */
|
|
116
|
+
|
|
117
|
+
requirement toastingTime {
|
|
118
|
+
doc /* Toasting duration requirement */
|
|
119
|
+
attribute minDuration : Real;
|
|
120
|
+
attribute maxDuration : Real;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
requirement evenToasting {
|
|
124
|
+
doc /* Quality requirement */
|
|
125
|
+
attribute uniformity : Real;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// ANALYSIS PILLAR - Define evaluations and calculations
|
|
130
|
+
|
|
131
|
+
calc def PowerConsumption {
|
|
132
|
+
doc /* Calculate total power usage */
|
|
133
|
+
in elementPower : Real[2];
|
|
134
|
+
return totalPower : Real;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
analysis def ThermalAnalysis {
|
|
138
|
+
doc /* Analyze heating performance */
|
|
139
|
+
subject toaster : Toaster;
|
|
140
|
+
|
|
141
|
+
objective heatDistribution {
|
|
142
|
+
doc /* Ensure even heat distribution */
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
calc powerCalc : PowerConsumption;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// INTERCONNECTION PILLAR - Define how things connect
|
|
149
|
+
|
|
150
|
+
connection def PowerConnection {
|
|
151
|
+
doc /* Electrical power interface */
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
interface def ControlInterface {
|
|
155
|
+
doc /* User control interface */
|
|
156
|
+
attribute controlSetting : Integer;
|
|
157
|
+
attribute operationState : String;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
port def ElectricalPort {
|
|
161
|
+
doc /* Power delivery port */
|
|
162
|
+
attribute portVoltage : Real;
|
|
163
|
+
attribute portCurrent : Real;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
part def PowerSource;
|
|
167
|
+
part def ElectricalLoad;
|
|
168
|
+
|
|
169
|
+
// ALLOCATION PILLAR - Define assignments and mappings
|
|
170
|
+
|
|
171
|
+
allocation def FunctionAllocation {
|
|
172
|
+
doc /* Map functions to hardware */
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// CROSSCUTTING PILLAR - Define concerns spanning multiple aspects
|
|
176
|
+
|
|
177
|
+
metadata def Manufacturer {
|
|
178
|
+
doc /* Manufacturing metadata */
|
|
179
|
+
attribute company : String;
|
|
180
|
+
attribute model : String;
|
|
181
|
+
attribute warranty : Real;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
comment about Toaster
|
|
185
|
+
/* This is a basic two-slot toaster designed for home use.
|
|
186
|
+
It features adjustable browning control and automatic pop-up. */
|
|
187
|
+
|
|
188
|
+
// Instantiate the system
|
|
189
|
+
part myToaster : Toaster {
|
|
190
|
+
:>> maxTemp = 230.0;
|
|
191
|
+
:>> slots = 2;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
package VehicleModel {
|
|
2
|
+
/**
|
|
3
|
+
* Basic vehicle model demonstrating SysML v2.0 syntax
|
|
4
|
+
* including parts, attributes, ports, constraints, and requirements
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
part def Vehicle {
|
|
8
|
+
part engine : Engine;
|
|
9
|
+
part transmission : Transmission;
|
|
10
|
+
part wheels : Wheel[4];
|
|
11
|
+
port powerOut : PowerPort;
|
|
12
|
+
|
|
13
|
+
attribute mass : Real;
|
|
14
|
+
attribute maxSpeed : Real;
|
|
15
|
+
|
|
16
|
+
constraint massConstraint {
|
|
17
|
+
mass < 2000.0
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
constraint speedConstraint {
|
|
21
|
+
maxSpeed > 60.0
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
part def Engine {
|
|
26
|
+
attribute power : Real;
|
|
27
|
+
attribute mass : Real;
|
|
28
|
+
attribute displacement : Real;
|
|
29
|
+
port powerPort : PowerPort;
|
|
30
|
+
|
|
31
|
+
constraint powerMassRatio {
|
|
32
|
+
power / mass > 0.1
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
part def Transmission :> Subsystem {
|
|
37
|
+
attribute gearRatio : Real;
|
|
38
|
+
attribute efficiency : Real;
|
|
39
|
+
|
|
40
|
+
constraint efficiencyConstraint {
|
|
41
|
+
efficiency >= 0.85 and efficiency <= 1.0
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
part def Wheel {
|
|
46
|
+
attribute diameter : Real;
|
|
47
|
+
attribute width : Real;
|
|
48
|
+
|
|
49
|
+
constraint sizeConstraint {
|
|
50
|
+
diameter >= 14.0 and diameter <= 22.0
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
part def Subsystem {
|
|
55
|
+
attribute mass : Real;
|
|
56
|
+
attribute cost : Real;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
port def PowerPort {
|
|
60
|
+
attribute voltage : Real;
|
|
61
|
+
attribute current : Real;
|
|
62
|
+
|
|
63
|
+
constraint powerLimit {
|
|
64
|
+
voltage * current <= 1000.0
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
requirement def PerformanceReq {
|
|
69
|
+
doc /* The vehicle shall accelerate from 0 to 60 mph in less than 6 seconds */
|
|
70
|
+
|
|
71
|
+
subject vehicle : Vehicle;
|
|
72
|
+
|
|
73
|
+
require constraint {
|
|
74
|
+
vehicle.engine.power >= 300.0
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
requirement def SafetyReq {
|
|
79
|
+
doc /* The vehicle shall have adequate braking performance */
|
|
80
|
+
|
|
81
|
+
subject vehicle : Vehicle;
|
|
82
|
+
|
|
83
|
+
require constraint {
|
|
84
|
+
vehicle.mass / vehicle.wheels.size <= 500.0
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
use case def DriveCar {
|
|
89
|
+
actor driver : Driver;
|
|
90
|
+
subject vehicle : Vehicle;
|
|
91
|
+
|
|
92
|
+
objective {
|
|
93
|
+
doc /* Successfully operate the vehicle from point A to point B */
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
part def Driver {
|
|
98
|
+
attribute experience : Real;
|
|
99
|
+
attribute licenseValid : Boolean;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Example vehicle instances
|
|
103
|
+
part myCar : Vehicle {
|
|
104
|
+
:>> engine {
|
|
105
|
+
:>> power = 250.0;
|
|
106
|
+
:>> mass = 150.0;
|
|
107
|
+
:>> displacement = 2.0;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
:>> transmission {
|
|
111
|
+
:>> gearRatio = 3.5;
|
|
112
|
+
:>> efficiency = 0.92;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
:>> mass = 1500.0;
|
|
116
|
+
:>> maxSpeed = 120.0;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
2
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
3
|
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
|
|
4
|
+
http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
5
|
+
<modelVersion>4.0.0</modelVersion>
|
|
6
|
+
<artifactId>sysmlv2</artifactId>
|
|
7
|
+
<packaging>jar</packaging>
|
|
8
|
+
<name>SysML v2 grammar</name>
|
|
9
|
+
<parent>
|
|
10
|
+
<groupId>org.antlr.grammars</groupId>
|
|
11
|
+
<artifactId>grammarsv4</artifactId>
|
|
12
|
+
<version>1.0-SNAPSHOT</version>
|
|
13
|
+
</parent>
|
|
14
|
+
<build>
|
|
15
|
+
<plugins>
|
|
16
|
+
<plugin>
|
|
17
|
+
<groupId>org.antlr</groupId>
|
|
18
|
+
<artifactId>antlr4-maven-plugin</artifactId>
|
|
19
|
+
<version>${antlr.version}</version>
|
|
20
|
+
<configuration>
|
|
21
|
+
<sourceDirectory>${basedir}</sourceDirectory>
|
|
22
|
+
<includes>
|
|
23
|
+
<include>SysMLv2Lexer.g4</include>
|
|
24
|
+
<include>SysMLv2Parser.g4</include>
|
|
25
|
+
</includes>
|
|
26
|
+
<visitor>true</visitor>
|
|
27
|
+
<listener>true</listener>
|
|
28
|
+
</configuration>
|
|
29
|
+
<executions>
|
|
30
|
+
<execution>
|
|
31
|
+
<goals>
|
|
32
|
+
<goal>antlr4</goal>
|
|
33
|
+
</goals>
|
|
34
|
+
</execution>
|
|
35
|
+
</executions>
|
|
36
|
+
</plugin>
|
|
37
|
+
<plugin>
|
|
38
|
+
<groupId>com.khubla.antlr</groupId>
|
|
39
|
+
<artifactId>antlr4test-maven-plugin</artifactId>
|
|
40
|
+
<version>${antlr4test-maven-plugin.version}</version>
|
|
41
|
+
<configuration>
|
|
42
|
+
<verbose>false</verbose>
|
|
43
|
+
<showTree>false</showTree>
|
|
44
|
+
<entryPoint>rootNamespace</entryPoint>
|
|
45
|
+
<grammarName>SysMLv2Parser</grammarName>
|
|
46
|
+
<packageName></packageName>
|
|
47
|
+
<exampleFiles>examples/</exampleFiles>
|
|
48
|
+
</configuration>
|
|
49
|
+
<executions>
|
|
50
|
+
<execution>
|
|
51
|
+
<goals>
|
|
52
|
+
<goal>test</goal>
|
|
53
|
+
</goals>
|
|
54
|
+
</execution>
|
|
55
|
+
</executions>
|
|
56
|
+
</plugin>
|
|
57
|
+
</plugins>
|
|
58
|
+
</build>
|
|
59
|
+
</project>
|