sysml2py 0.4.4__tar.gz → 0.5.3__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.
- {sysml2py-0.4.4 → sysml2py-0.5.3}/PKG-INFO +2 -1
- sysml2py-0.5.3/pyproject.toml +112 -0
- {sysml2py-0.4.4 → sysml2py-0.5.3}/src/sysml2py/__init__.py +57 -14
- {sysml2py-0.4.4 → sysml2py-0.5.3}/src/sysml2py/grammar/KerML.tx +2 -3
- {sysml2py-0.4.4 → sysml2py-0.5.3}/src/sysml2py/grammar/KerMLExpressions.tx +68 -46
- {sysml2py-0.4.4 → sysml2py-0.5.3}/src/sysml2py/grammar/SysML.tx +233 -279
- sysml2py-0.5.3/src/sysml2py/grammar/SysML_compiled.tx +3233 -0
- sysml2py-0.5.3/src/sysml2py/grammar/classes.py +5832 -0
- {sysml2py-0.4.4 → sysml2py-0.5.3}/src/sysml2py/usage.py +24 -38
- sysml2py-0.4.4/pyproject.toml +0 -64
- sysml2py-0.4.4/src/sysml2py/grammar/classes.py +0 -3132
- {sysml2py-0.4.4 → sysml2py-0.5.3}/LICENSE +0 -0
- {sysml2py-0.4.4 → sysml2py-0.5.3}/README.md +0 -0
- {sysml2py-0.4.4 → sysml2py-0.5.3}/src/sysml2py/definition.py +0 -0
- {sysml2py-0.4.4 → sysml2py-0.5.3}/src/sysml2py/formatting.py +0 -0
- {sysml2py-0.4.4 → sysml2py-0.5.3}/src/sysml2py/textx/KerML.xtext +0 -0
- {sysml2py-0.4.4 → sysml2py-0.5.3}/src/sysml2py/textx/KerMLExpressions.xtext +0 -0
- {sysml2py-0.4.4 → sysml2py-0.5.3}/src/sysml2py/textx/SysML.xtext +0 -0
- {sysml2py-0.4.4 → sysml2py-0.5.3}/src/sysml2py/textx/xtext_to_textx.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sysml2py
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.3
|
|
4
4
|
Summary:
|
|
5
5
|
Author: Christopher Cox
|
|
6
6
|
Author-email: chris.cox@westfall.io
|
|
@@ -9,6 +9,7 @@ Classifier: Programming Language :: Python :: 3
|
|
|
9
9
|
Classifier: Programming Language :: Python :: 3.9
|
|
10
10
|
Classifier: Programming Language :: Python :: 3.10
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
13
|
Requires-Dist: astropy (>=5.3.1,<6.0.0)
|
|
13
14
|
Requires-Dist: pyyaml (>=6.0.1,<7.0.0)
|
|
14
15
|
Requires-Dist: textx (>=3.1.1,<4.0.0)
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
#requires = ["setuptools>=61.0"]
|
|
3
|
+
#build-backend = "setuptools.build_meta"
|
|
4
|
+
requires = ["poetry-core"]
|
|
5
|
+
build-backend = "poetry.core.masonry.api"
|
|
6
|
+
|
|
7
|
+
[project]
|
|
8
|
+
name = "sysml2py"
|
|
9
|
+
version = "0.5.3"
|
|
10
|
+
description = "SysML v2.0 Parser"
|
|
11
|
+
authors = [
|
|
12
|
+
{ name="Christopher Cox", email="chris.cox@westfall.io" },
|
|
13
|
+
]
|
|
14
|
+
readme = "README.md"
|
|
15
|
+
license = {file = "LICENSE"}
|
|
16
|
+
requires-python = ">=3.7"
|
|
17
|
+
classifiers = [
|
|
18
|
+
"Development Status :: 3 - Alpha",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"License :: OSI Approved :: MIT License",
|
|
21
|
+
"Operating System :: OS Independent",
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
[tool.setuptools]
|
|
25
|
+
include-package-data = true
|
|
26
|
+
|
|
27
|
+
[tool.setuptools.packages.find]
|
|
28
|
+
where = ["src/sysml2py", "src"]
|
|
29
|
+
|
|
30
|
+
[tool.setuptools.package-data]
|
|
31
|
+
grammar = ["*.tx"]
|
|
32
|
+
|
|
33
|
+
[tool.pytest.ini_options]
|
|
34
|
+
pythonpath = [
|
|
35
|
+
"src"
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
[tool.semantic_release]
|
|
39
|
+
version_variable = [
|
|
40
|
+
"src/sysml2py/__init__.py:version",
|
|
41
|
+
]
|
|
42
|
+
version_toml=[
|
|
43
|
+
"pyproject.toml:tool.poetry.version",
|
|
44
|
+
"pyproject.toml:project.version",
|
|
45
|
+
]
|
|
46
|
+
commit_parser = "emoji"
|
|
47
|
+
build_command = "pip install poetry && poetry build"
|
|
48
|
+
commit_message = ":bookmark:{version}\n\nAutomatically generated by python-semantic-release"
|
|
49
|
+
|
|
50
|
+
[tool.semantic_release.changelog]
|
|
51
|
+
exclude_commit_patterns = [":robot:",":twisted_rightwards_arrows:",
|
|
52
|
+
":poop:", "^[^:].*"]
|
|
53
|
+
|
|
54
|
+
[tool.semantic_release.commit_parser_options]
|
|
55
|
+
major_tags = [":boom:"]
|
|
56
|
+
minor_tags = [
|
|
57
|
+
":sparkles:",
|
|
58
|
+
":children_crossing:",
|
|
59
|
+
":lipstick:",
|
|
60
|
+
":iphone:",
|
|
61
|
+
":egg:",
|
|
62
|
+
":chart_with_upwards_trend:",
|
|
63
|
+
]
|
|
64
|
+
patch_tags = [
|
|
65
|
+
":ambulance:",
|
|
66
|
+
":lock:",
|
|
67
|
+
":bug:",
|
|
68
|
+
":zap:",
|
|
69
|
+
":goal_net:",
|
|
70
|
+
":alien:",
|
|
71
|
+
":wheelchair:",
|
|
72
|
+
":speech_balloon:",
|
|
73
|
+
":mag:",
|
|
74
|
+
":apple:",
|
|
75
|
+
":penguin:",
|
|
76
|
+
":checkered_flag:",
|
|
77
|
+
":robot:",
|
|
78
|
+
":green_apple:",
|
|
79
|
+
":memo:",
|
|
80
|
+
":heavy_plus_sign:",
|
|
81
|
+
":construction:",
|
|
82
|
+
":white_check_mark:",
|
|
83
|
+
]
|
|
84
|
+
|
|
85
|
+
[tool.semantic_release.branches.main]
|
|
86
|
+
match = "(main|master)"
|
|
87
|
+
prerelease = false
|
|
88
|
+
build_command = "pip install poetry && poetry build"
|
|
89
|
+
|
|
90
|
+
[tool.semantic_release.branches."dev0.5.x"]
|
|
91
|
+
match = "dev0.5.x"
|
|
92
|
+
prerelease = true
|
|
93
|
+
prerelease_token = "rc"
|
|
94
|
+
build_command = "pip install poetry && poetry build"
|
|
95
|
+
|
|
96
|
+
[project.urls]
|
|
97
|
+
"Homepage" = "https://github.com/Westfall-io/sysml2py"
|
|
98
|
+
"Bug Tracker" = "https://github.com/Westfall-io/sysml2py/issues"
|
|
99
|
+
|
|
100
|
+
[tool.poetry]
|
|
101
|
+
name = "sysml2py"
|
|
102
|
+
version = "0.5.3"
|
|
103
|
+
description = ""
|
|
104
|
+
authors = ["Christopher Cox <chris.cox@westfall.io>"]
|
|
105
|
+
readme = "README.md"
|
|
106
|
+
packages = [{ include = "sysml2py", from = "src" }]
|
|
107
|
+
|
|
108
|
+
[tool.poetry.dependencies]
|
|
109
|
+
python = "^3.9"
|
|
110
|
+
textx = "^3.1.1"
|
|
111
|
+
astropy = "^5.3.1"
|
|
112
|
+
pyyaml = "^6.0.1"
|
|
@@ -8,12 +8,47 @@ Created on Mon May 29 23:26:16 2023
|
|
|
8
8
|
|
|
9
9
|
__all__ = ["load", "loads", "load_grammar"]
|
|
10
10
|
__author__ = "Christopher Cox"
|
|
11
|
+
__version__ = "0.1.0"
|
|
11
12
|
|
|
13
|
+
# These are interchangable
|
|
12
14
|
from sysml2py.usage import Item, Attribute, Part, Port
|
|
15
|
+
|
|
16
|
+
# These are definition only
|
|
13
17
|
from sysml2py.definition import Model, Package
|
|
14
18
|
|
|
15
19
|
|
|
16
|
-
def
|
|
20
|
+
def enforce_grammar(): # pragma: no cover
|
|
21
|
+
"""Enforce grammar compiles the language for xtext
|
|
22
|
+
|
|
23
|
+
This opens each of the files: KerMLExpressions, KerML, and SysML and
|
|
24
|
+
makes a superfile with all of the definitions and strips the comments. This
|
|
25
|
+
includes changes made to shift from java textx to the python xtext library.
|
|
26
|
+
|
|
27
|
+
"""
|
|
28
|
+
import re
|
|
29
|
+
|
|
30
|
+
comments_strip_rule = r"(?:(?:(?<!\\)(\/\/.*\n))|(?:\/\*(?:.|\n)*?\*\/))"
|
|
31
|
+
regex_rule = "\n[ ]*([\w]*)[ ]*:((?:(?:'[^']*')|(?:[^;']*))*;)"
|
|
32
|
+
|
|
33
|
+
g_list = []
|
|
34
|
+
rule_files = ["KerMLExpressions", "KerML", "SysML"]
|
|
35
|
+
for file in rule_files:
|
|
36
|
+
with open("grammar/" + file + ".tx", "r") as f:
|
|
37
|
+
g_list = (
|
|
38
|
+
re.findall(regex_rule, re.sub(comments_strip_rule, "", f.read()))
|
|
39
|
+
+ g_list
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
# Make a new list and only add it if it's not already there
|
|
43
|
+
rules = []
|
|
44
|
+
[rules.append(x) for x in g_list if x[0] not in [x[0] for x in rules]]
|
|
45
|
+
grammar = "\n\n".join([":".join(x) for x in rules])
|
|
46
|
+
with open("grammar/SysML_compiled.tx", "w") as f:
|
|
47
|
+
f.write(grammar)
|
|
48
|
+
return grammar
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def load_grammar(fp, debug=False, enforce=False):
|
|
17
52
|
"""SysML load from file pointer
|
|
18
53
|
|
|
19
54
|
Deserialize ``fp`` (a ``.read()``-supporting file-like object containing
|
|
@@ -73,23 +108,24 @@ def load_grammar(fp):
|
|
|
73
108
|
f"not {fp.__class__.__name__}"
|
|
74
109
|
)
|
|
75
110
|
|
|
76
|
-
|
|
111
|
+
from sysml2py.formatting import reformat
|
|
77
112
|
|
|
78
|
-
|
|
113
|
+
if enforce: # pragma: no cover
|
|
114
|
+
# This can only be run in development mode.
|
|
115
|
+
from textx import metamodel_from_str, TextXSyntaxError
|
|
79
116
|
|
|
80
|
-
|
|
81
|
-
|
|
117
|
+
grammar = enforce_grammar()
|
|
118
|
+
meta = metamodel_from_str(grammar)
|
|
119
|
+
else:
|
|
120
|
+
import importlib.resources as pkg_resources
|
|
121
|
+
import sysml2py
|
|
122
|
+
from textx import metamodel_from_file, TextXSyntaxError
|
|
123
|
+
|
|
124
|
+
grammar = str((pkg_resources.files(sysml2py) / "grammar/SysML_compiled.tx"))
|
|
125
|
+
meta = metamodel_from_file(grammar)
|
|
82
126
|
|
|
83
|
-
# try:
|
|
84
|
-
grammar = str((pkg_resources.files(sysml2py) / "grammar/SysML.tx"))
|
|
85
|
-
# except:
|
|
86
|
-
# try:
|
|
87
|
-
# grammar = "./src/sysml2py/grammar/SysML.tx"
|
|
88
|
-
# except:
|
|
89
|
-
# grammar = "./grammar/SysML.tx"
|
|
90
|
-
meta = metamodel_from_file(grammar)
|
|
91
127
|
try:
|
|
92
|
-
model = meta.model_from_str(s, debug=
|
|
128
|
+
model = meta.model_from_str(s, debug=debug)
|
|
93
129
|
except TextXSyntaxError as e:
|
|
94
130
|
print("TextX returned the following error: {}".format(e))
|
|
95
131
|
raise TextXSyntaxError("Invalid SysML")
|
|
@@ -132,4 +168,11 @@ def load(fp):
|
|
|
132
168
|
|
|
133
169
|
|
|
134
170
|
def loads(s: str):
|
|
171
|
+
"""Loads a model from string.
|
|
172
|
+
|
|
173
|
+
This shortcut function allows a user to build a model from a string by
|
|
174
|
+
first instantiating a base model class which builds out a default namespace
|
|
175
|
+
and then that model loads all elements underneath.
|
|
176
|
+
|
|
177
|
+
"""
|
|
135
178
|
return Model().load(s)
|
|
@@ -709,7 +709,7 @@ FeatureConjugation :
|
|
|
709
709
|
|
|
710
710
|
FeatureValue :
|
|
711
711
|
( '=' | isDefault ?= 'default' ( '=' | isInitial ?= ':=' )? )
|
|
712
|
-
ownedRelatedElement
|
|
712
|
+
ownedRelatedElement = OwnedExpression
|
|
713
713
|
;
|
|
714
714
|
|
|
715
715
|
FeatureValueExpression :
|
|
@@ -936,8 +936,7 @@ Function :
|
|
|
936
936
|
;
|
|
937
937
|
|
|
938
938
|
ReturnFeatureMember :
|
|
939
|
-
MemberPrefix 'return'
|
|
940
|
-
ownedRelatedElement += FeatureElement
|
|
939
|
+
MemberPrefix 'return' ownedRelatedElement += FeatureElement
|
|
941
940
|
;
|
|
942
941
|
|
|
943
942
|
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
/* Operator Expressions */
|
|
34
34
|
|
|
35
35
|
OwnedExpressionMember :
|
|
36
|
-
ownedRelatedElement
|
|
36
|
+
ownedRelatedElement = OwnedExpression
|
|
37
37
|
;
|
|
38
38
|
|
|
39
39
|
OwnedExpression :
|
|
@@ -47,7 +47,7 @@ OwnedExpressionReference :
|
|
|
47
47
|
;
|
|
48
48
|
|
|
49
49
|
ConditionalExpression :
|
|
50
|
-
operand
|
|
50
|
+
operand = NullCoalescingExpression
|
|
51
51
|
| operator = ConditionalOperator operand += NullCoalescingExpression
|
|
52
52
|
'?' operand += OwnedExpressionReference 'else' operand += OwnedExpressionReference
|
|
53
53
|
;
|
|
@@ -125,10 +125,15 @@ XorOperator :
|
|
|
125
125
|
'xor'
|
|
126
126
|
;
|
|
127
127
|
|
|
128
|
+
AndOperand :
|
|
129
|
+
(operator = AndOperator operand = EqualityExpression)
|
|
130
|
+
|
|
|
131
|
+
(operator = ConditionalAndOperator operand = EqualityExpressionReference)
|
|
132
|
+
;
|
|
133
|
+
|
|
128
134
|
AndExpression :
|
|
129
|
-
equality=EqualityExpression
|
|
130
|
-
|
|
131
|
-
| operator = ConditionalAndOperator operand += EqualityExpressionReference ) )*
|
|
135
|
+
equality=EqualityExpression
|
|
136
|
+
(operation+=AndOperand)*
|
|
132
137
|
;
|
|
133
138
|
|
|
134
139
|
AndOperator :
|
|
@@ -142,17 +147,20 @@ ConditionalAndOperator :
|
|
|
142
147
|
// Equality Expressions
|
|
143
148
|
|
|
144
149
|
EqualityExpressionReference :
|
|
145
|
-
ownedRelationship
|
|
150
|
+
ownedRelationship = EqualityExpressionMember
|
|
146
151
|
;
|
|
147
152
|
|
|
148
153
|
EqualityExpressionMember :
|
|
149
|
-
ownedRelatedElement
|
|
154
|
+
ownedRelatedElement = EqualityExpression
|
|
150
155
|
;
|
|
151
156
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
157
|
+
EqualityOperand:
|
|
158
|
+
operator=EqualityOperator operand=ClassificationExpression
|
|
159
|
+
;
|
|
155
160
|
|
|
161
|
+
EqualityExpression :
|
|
162
|
+
classification=ClassificationExpression
|
|
163
|
+
(operation+=EqualityOperand)*
|
|
156
164
|
;
|
|
157
165
|
|
|
158
166
|
EqualityOperator :
|
|
@@ -227,37 +235,45 @@ EmptyFeature ://This doesn't work.
|
|
|
227
235
|
;
|
|
228
236
|
|
|
229
237
|
// Relational Expressions
|
|
238
|
+
RelationalOperand:
|
|
239
|
+
operator=RelationalOperator operand=RangeExpression
|
|
240
|
+
;
|
|
230
241
|
|
|
231
242
|
RelationalExpression :
|
|
232
|
-
range=RangeExpression
|
|
233
|
-
operator = RelationalOperator operand += RangeExpression )*
|
|
243
|
+
range=RangeExpression operation+=RelationalOperand*
|
|
234
244
|
;
|
|
235
245
|
|
|
236
246
|
RelationalOperator :
|
|
237
|
-
'
|
|
247
|
+
'<=' | '>=' | '<' | '>'
|
|
238
248
|
;
|
|
239
249
|
|
|
240
250
|
// Range Expressions
|
|
241
251
|
|
|
242
252
|
RangeExpression :
|
|
243
|
-
additive=AdditiveExpression (
|
|
244
|
-
operator = '..' operand += AdditiveExpression )?
|
|
253
|
+
additive=AdditiveExpression ('..' operand = AdditiveExpression )?
|
|
245
254
|
;
|
|
246
255
|
|
|
247
256
|
// Arithmetic Expressions
|
|
248
257
|
|
|
258
|
+
AdditiveOperand:
|
|
259
|
+
operator=AdditiveOperator operand=MultiplicativeExpression
|
|
260
|
+
;
|
|
261
|
+
|
|
249
262
|
AdditiveExpression :
|
|
250
|
-
multiplicitive=MultiplicativeExpression
|
|
251
|
-
|
|
263
|
+
multiplicitive=MultiplicativeExpression
|
|
264
|
+
(operation+=AdditiveOperand)*
|
|
252
265
|
;
|
|
253
266
|
|
|
254
267
|
AdditiveOperator :
|
|
255
268
|
'+' | '-'
|
|
256
269
|
;
|
|
257
270
|
|
|
271
|
+
MultiplicativeOperand:
|
|
272
|
+
operator=MultiplicativeOperator operand=ExponentiationExpression
|
|
273
|
+
;
|
|
274
|
+
|
|
258
275
|
MultiplicativeExpression :
|
|
259
|
-
exponential=ExponentiationExpression
|
|
260
|
-
operator = MultiplicativeOperator operand += ExponentiationExpression )*
|
|
276
|
+
exponential=ExponentiationExpression operation+=MultiplicativeOperand*
|
|
261
277
|
;
|
|
262
278
|
|
|
263
279
|
MultiplicativeOperator :
|
|
@@ -295,16 +311,16 @@ ExtentExpression :
|
|
|
295
311
|
|
|
296
312
|
PrimaryExpression :
|
|
297
313
|
base=BaseExpression
|
|
298
|
-
( '.'
|
|
314
|
+
( '.' ownedRelationship1 += FeatureChainMember )?
|
|
299
315
|
(
|
|
300
316
|
( operator += '#' '(' operand += SequenceExpression ')'
|
|
301
317
|
| operator += '[' operand += SequenceExpression ']'
|
|
302
|
-
| operator += '->' ownedRelationship
|
|
318
|
+
| operator += '->' ownedRelationship = ReferenceTyping
|
|
303
319
|
( operand += BodyExpression | operand += FunctionReferenceExpression | operand+= ArgumentList )
|
|
304
320
|
| operator += '.' operand += BodyExpression
|
|
305
321
|
| operator += '.?' operand += BodyExpression
|
|
306
322
|
)
|
|
307
|
-
( '.'
|
|
323
|
+
( '.' ownedRelationship2 += FeatureChainMember )?
|
|
308
324
|
)*
|
|
309
325
|
;
|
|
310
326
|
|
|
@@ -321,8 +337,8 @@ FunctionReference :
|
|
|
321
337
|
;
|
|
322
338
|
|
|
323
339
|
FeatureChainMember :
|
|
324
|
-
|
|
325
|
-
|
|
|
340
|
+
ownedRelatedElement = OwnedFeatureChain
|
|
341
|
+
| memberElement = QualifiedName
|
|
326
342
|
;
|
|
327
343
|
|
|
328
344
|
/* Base Expressions */
|
|
@@ -330,9 +346,9 @@ FeatureChainMember :
|
|
|
330
346
|
BaseExpression :
|
|
331
347
|
ownedRelationship=NullExpression
|
|
332
348
|
| ownedRelationship=LiteralExpression
|
|
333
|
-
| ownedRelationship=FeatureReferenceExpression
|
|
334
|
-
| ownedRelationship=MetadataAccessExpression
|
|
335
349
|
| ownedRelationship=InvocationExpression
|
|
350
|
+
| ownedRelationship=FeatureReferenceExpression
|
|
351
|
+
| ownedRelationship=MetadataAccessExpression
|
|
336
352
|
| ownedRelationship=BodyExpression
|
|
337
353
|
| '(' ownedRelationship=SequenceExpression ')'
|
|
338
354
|
;
|
|
@@ -340,11 +356,11 @@ BaseExpression :
|
|
|
340
356
|
// Expression Bodies
|
|
341
357
|
|
|
342
358
|
BodyExpression :
|
|
343
|
-
ownedRelationship
|
|
359
|
+
ownedRelationship = ExpressionBodyMember
|
|
344
360
|
;
|
|
345
361
|
|
|
346
362
|
ExpressionBodyMember :
|
|
347
|
-
ownedRelatedElement
|
|
363
|
+
ownedRelatedElement = ExpressionBody
|
|
348
364
|
;
|
|
349
365
|
|
|
350
366
|
// This default production is overridden in the KerML and SysML grammars.
|
|
@@ -367,8 +383,14 @@ BodyParameter :
|
|
|
367
383
|
|
|
368
384
|
// Sequence Expressions
|
|
369
385
|
|
|
386
|
+
SequenceOperand:
|
|
387
|
+
(',' operand = OwnedExpression)
|
|
388
|
+
|
|
|
389
|
+
','
|
|
390
|
+
;
|
|
391
|
+
|
|
370
392
|
SequenceExpression :
|
|
371
|
-
ownedRelationship=OwnedExpression
|
|
393
|
+
ownedRelationship=OwnedExpression operation+=SequenceOperand*
|
|
372
394
|
;
|
|
373
395
|
|
|
374
396
|
// Feature Reference Expressions
|
|
@@ -390,7 +412,7 @@ MetadataAccessExpression :
|
|
|
390
412
|
// Invocation Expressions
|
|
391
413
|
|
|
392
414
|
InvocationExpression :
|
|
393
|
-
ownedRelationship
|
|
415
|
+
ownedRelationship=OwnedFeatureTyping arg_list=ArgumentList
|
|
394
416
|
;
|
|
395
417
|
|
|
396
418
|
OwnedFeatureTyping :
|
|
@@ -404,8 +426,7 @@ OwnedFeatureChain :
|
|
|
404
426
|
|
|
405
427
|
// For use in KerML and SysML grammars
|
|
406
428
|
FeatureChain :
|
|
407
|
-
ownedRelationship += OwnedFeatureChaining
|
|
408
|
-
( '.' ownedRelationship += OwnedFeatureChaining )*
|
|
429
|
+
ownedRelationship += OwnedFeatureChaining['.']
|
|
409
430
|
;
|
|
410
431
|
|
|
411
432
|
OwnedFeatureChaining :
|
|
@@ -413,33 +434,31 @@ OwnedFeatureChaining :
|
|
|
413
434
|
;
|
|
414
435
|
|
|
415
436
|
ArgumentList :
|
|
416
|
-
'(' ( PositionalArgumentList | NamedArgumentList )? ')'
|
|
437
|
+
'(' ( pos_list=PositionalArgumentList | named_list=NamedArgumentList )? ')'
|
|
417
438
|
;
|
|
418
439
|
|
|
419
440
|
PositionalArgumentList :
|
|
420
|
-
ownedRelationship += ArgumentMember
|
|
421
|
-
( ',' ownedRelationship += ArgumentMember )*
|
|
441
|
+
ownedRelationship += ArgumentMember[',']
|
|
422
442
|
;
|
|
423
443
|
|
|
424
444
|
ArgumentMember :
|
|
425
|
-
ownedRelatedElement
|
|
445
|
+
ownedRelatedElement = Argument
|
|
426
446
|
;
|
|
427
447
|
|
|
428
448
|
Argument :
|
|
429
|
-
ownedRelationship
|
|
449
|
+
ownedRelationship = ArgumentValue
|
|
430
450
|
;
|
|
431
451
|
|
|
432
452
|
NamedArgumentList :
|
|
433
|
-
ownedRelationship += NamedArgumentMember
|
|
434
|
-
( ',' ownedRelationship += NamedArgumentMember )*
|
|
453
|
+
ownedRelationship += NamedArgumentMember[',']
|
|
435
454
|
;
|
|
436
455
|
|
|
437
456
|
NamedArgumentMember :
|
|
438
|
-
ownedRelatedElement
|
|
457
|
+
ownedRelatedElement = NamedArgument
|
|
439
458
|
;
|
|
440
459
|
|
|
441
460
|
NamedArgument :
|
|
442
|
-
|
|
461
|
+
redefinition = ParameterRedefinition '=' value = ArgumentValue
|
|
443
462
|
;
|
|
444
463
|
|
|
445
464
|
ParameterRedefinition :
|
|
@@ -447,7 +466,7 @@ ParameterRedefinition :
|
|
|
447
466
|
;
|
|
448
467
|
|
|
449
468
|
ArgumentValue :
|
|
450
|
-
ownedRelatedElement
|
|
469
|
+
ownedRelatedElement = OwnedExpression
|
|
451
470
|
;
|
|
452
471
|
|
|
453
472
|
// Null Expressions
|
|
@@ -461,8 +480,8 @@ NullExpression :
|
|
|
461
480
|
LiteralExpression :
|
|
462
481
|
LiteralBoolean
|
|
463
482
|
| LiteralString
|
|
464
|
-
| LiteralInteger
|
|
465
483
|
| LiteralReal
|
|
484
|
+
| LiteralInteger
|
|
466
485
|
| LiteralInfinity
|
|
467
486
|
;
|
|
468
487
|
|
|
@@ -497,7 +516,9 @@ LiteralInfinity :
|
|
|
497
516
|
/* NAMES */
|
|
498
517
|
|
|
499
518
|
ReservedKeyword:
|
|
500
|
-
'about' |
|
|
519
|
+
'about' | /to[\s]/ | 'connect' | 'connection' | 'from' | /of[\s]/ | 'then' |
|
|
520
|
+
'entry' | /accept[\s]/ | /do[\s]/ | /exit[\s]/ | /action[\s]/ | /at[\s]/ |
|
|
521
|
+
/assign[\s]/
|
|
501
522
|
;
|
|
502
523
|
|
|
503
524
|
Name:
|
|
@@ -509,13 +530,14 @@ Qualification :
|
|
|
509
530
|
;
|
|
510
531
|
|
|
511
532
|
QualifiedName:
|
|
512
|
-
name1=Name ( '::' names+=Name )*
|
|
533
|
+
//name1=Name ( '::' names+=Name )*
|
|
534
|
+
names+=Name['::']
|
|
513
535
|
;
|
|
514
536
|
|
|
515
537
|
/* TERMINALS */
|
|
516
538
|
|
|
517
539
|
DECIMAL_VALUE :
|
|
518
|
-
/[0-9]
|
|
540
|
+
/[0-9]+/;
|
|
519
541
|
|
|
520
542
|
EXP_VALUE:
|
|
521
543
|
DECIMAL_VALUE ('e' | 'E') ('+' | '-')? DECIMAL_VALUE;
|