scrall 0.10.1__tar.gz → 0.12.2__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.
Potentially problematic release.
This version of scrall might be problematic. Click here for more details.
- {scrall-0.10.1/src/scrall.egg-info → scrall-0.12.2}/PKG-INFO +1 -1
- {scrall-0.10.1 → scrall-0.12.2}/pyproject.toml +1 -1
- scrall-0.12.2/src/scrall/__init__.py +1 -0
- {scrall-0.10.1 → scrall-0.12.2}/src/scrall/parse/scrall.peg +3 -2
- {scrall-0.10.1 → scrall-0.12.2}/src/scrall/parse/visitor.py +25 -7
- {scrall-0.10.1 → scrall-0.12.2/src/scrall.egg-info}/PKG-INFO +1 -1
- {scrall-0.10.1 → scrall-0.12.2}/tests/test_calls.py +2 -1
- {scrall-0.10.1 → scrall-0.12.2}/tests/test_decision_scalar_expr.py +2 -1
- {scrall-0.10.1 → scrall-0.12.2}/tests/test_decision_wrap.py +1 -1
- {scrall-0.10.1 → scrall-0.12.2}/tests/test_decision_wrap_false.py +2 -2
- {scrall-0.10.1 → scrall-0.12.2}/tests/test_ping_actions.py +4 -3
- {scrall-0.10.1 → scrall-0.12.2}/tests/test_signals.py +1 -1
- {scrall-0.10.1 → scrall-0.12.2}/tests/test_state_actions.py +2 -2
- scrall-0.10.1/src/scrall/__init__.py +0 -1
- {scrall-0.10.1 → scrall-0.12.2}/LICENSE +0 -0
- {scrall-0.10.1 → scrall-0.12.2}/MANIFEST.in +0 -0
- {scrall-0.10.1 → scrall-0.12.2}/README.md +0 -0
- {scrall-0.10.1 → scrall-0.12.2}/setup.cfg +0 -0
- {scrall-0.10.1 → scrall-0.12.2}/src/scrall/__main__.py +0 -0
- {scrall-0.10.1 → scrall-0.12.2}/src/scrall/exceptions.py +0 -0
- {scrall-0.10.1 → scrall-0.12.2}/src/scrall/log.conf +0 -0
- {scrall-0.10.1 → scrall-0.12.2}/src/scrall/parse/__init__.py +0 -0
- {scrall-0.10.1 → scrall-0.12.2}/src/scrall/parse/parser.py +0 -0
- {scrall-0.10.1 → scrall-0.12.2}/src/scrall.egg-info/SOURCES.txt +0 -0
- {scrall-0.10.1 → scrall-0.12.2}/src/scrall.egg-info/dependency_links.txt +0 -0
- {scrall-0.10.1 → scrall-0.12.2}/src/scrall.egg-info/entry_points.txt +0 -0
- {scrall-0.10.1 → scrall-0.12.2}/src/scrall.egg-info/requires.txt +0 -0
- {scrall-0.10.1 → scrall-0.12.2}/src/scrall.egg-info/top_level.txt +0 -0
- {scrall-0.10.1 → scrall-0.12.2}/tests/test_delete.py +0 -0
- {scrall-0.10.1 → scrall-0.12.2}/tests/test_operation.py +0 -0
- {scrall-0.10.1 → scrall-0.12.2}/tests/test_selection.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "scrall"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.12.2"
|
|
8
8
|
description = "Starr's Concise Relational Action Language - For Shlaer-Mellor Executable UML"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [{ name = "Leon Starr", email = "leon_starr@modelint.com" }]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
version = "0.12.2"
|
|
@@ -52,7 +52,7 @@ FALSE_RESULT_OP = ':'
|
|
|
52
52
|
switch = switch_input DECISION_OP SP* case_block // Boolean expr triggers case_block
|
|
53
53
|
switch_input = rnum / scalar_expr
|
|
54
54
|
case_block = '{' LINEWRAP* case+ LINEWRAP*'}'
|
|
55
|
-
case = LINEWRAP* trigger_set? ':' LINEWRAP* component_statement_set
|
|
55
|
+
case = LINEWRAP* trigger_set? ':' (SP+ / LINEWRAP*) component_statement_set
|
|
56
56
|
trigger_set = enum_value (',' SP+ enum_value)* SP*
|
|
57
57
|
enum_value = '_' name // Scalar switch has enum value cases
|
|
58
58
|
DECISION_OP = '?'
|
|
@@ -105,7 +105,8 @@ ITS = 'ITS'
|
|
|
105
105
|
// Creation, deletion and references
|
|
106
106
|
new_instance = '*' new_inst_init // create an instance of a class as an action
|
|
107
107
|
new_lineage = '*[' SP* new_inst_init (';' SP+ new_inst_init)+ SP* ']' // create all instances of a lineage
|
|
108
|
-
new_inst_init = name attr_init? (SP+ to_ref)* // specify class, attr inits, and any required references
|
|
108
|
+
new_inst_init = name attr_init? (SP+ to_ref)* (SP+ to_state)? // specify class, attr inits, and any required references
|
|
109
|
+
to_state = '>' SP* name
|
|
109
110
|
attr_init = '(' SP* (attr_value_init (',' SP+ attr_value_init)* SP*)? ')' // all attrs to init for a new instance
|
|
110
111
|
attr_value_init = (name SP? ':' SP+ scalar_expr )*
|
|
111
112
|
update_ref = (instance_set SP+)? to_ref // relate or unrelated to me or explicit instance_set
|
|
@@ -46,7 +46,7 @@ Qualified_Name_a = namedtuple('Qualified_Name_a', 'iset cname aname')
|
|
|
46
46
|
Flow_Output_a = namedtuple('Flow_Output_a', 'name exp_type')
|
|
47
47
|
PATH_a = namedtuple('PATH_a', 'hops')
|
|
48
48
|
INST_a = namedtuple('INST_a', 'components')
|
|
49
|
-
INST_PROJ_a = namedtuple('INST_PROJ_a', 'iset projection')
|
|
49
|
+
INST_PROJ_a = namedtuple('INST_PROJ_a', 'iset projection op_chain')
|
|
50
50
|
TEXPR_a = namedtuple('TEXPR_a', 'table hexpr selection projection')
|
|
51
51
|
R_a = namedtuple('R_a', 'rnum')
|
|
52
52
|
IN_a = namedtuple('IN_a', 'name')
|
|
@@ -60,7 +60,7 @@ Type_expr_a = namedtuple('Type_expr_a', 'type selector')
|
|
|
60
60
|
Attr_value_init_a = namedtuple('Attr_value_init_a', 'attr scalar_expr')
|
|
61
61
|
To_ref_a = namedtuple('To_ref_a', 'rnum iset1 iset2')
|
|
62
62
|
Update_ref_a = namedtuple('Update_ref_a', 'iset to_ref')
|
|
63
|
-
New_inst_a = namedtuple('New_inst_a', 'cname attrs rels')
|
|
63
|
+
New_inst_a = namedtuple('New_inst_a', 'cname attrs rels state')
|
|
64
64
|
New_lineage_a = namedtuple('New_lineage_a', 'inits')
|
|
65
65
|
Output_Flow_a = namedtuple('Output_Flow_a', 'output')
|
|
66
66
|
Projection_a = namedtuple('Projection_a', 'expand attrs')
|
|
@@ -677,7 +677,8 @@ class ScrallVisitor(PTNodeVisitor):
|
|
|
677
677
|
_logger.info(f' :: {node.value}')
|
|
678
678
|
|
|
679
679
|
_logger.info(f" < {children}")
|
|
680
|
-
params = children.results.get('supplied_params'
|
|
680
|
+
params = children.results.get('supplied_params')
|
|
681
|
+
params = params[0] if params else []
|
|
681
682
|
result = {'name': children[0].name, 'params': params}
|
|
682
683
|
_logger.info(f" > {result}")
|
|
683
684
|
return result
|
|
@@ -1032,10 +1033,25 @@ class ScrallVisitor(PTNodeVisitor):
|
|
|
1032
1033
|
_logger.info(f" < {children}")
|
|
1033
1034
|
a = children.results.get('attr_init')
|
|
1034
1035
|
r = children.results.get('to_ref')
|
|
1035
|
-
|
|
1036
|
+
s = children.results.get('to_state')
|
|
1037
|
+
result = New_inst_a(cname=children[0], attrs=a[0] if a else [], rels=None if not r else r,
|
|
1038
|
+
state=s[0].name if s else None)
|
|
1036
1039
|
_logger.info(f" > {result}")
|
|
1037
1040
|
return result
|
|
1038
1041
|
|
|
1042
|
+
@classmethod
|
|
1043
|
+
def visit_to_state(cls, node, children):
|
|
1044
|
+
"""
|
|
1045
|
+
'>' SP* name
|
|
1046
|
+
"""
|
|
1047
|
+
_logger.info("to_state = '>' SP* name")
|
|
1048
|
+
_logger.info(f' :: {node.value}')
|
|
1049
|
+
|
|
1050
|
+
_logger.info(f" < {children}")
|
|
1051
|
+
result = children[0]
|
|
1052
|
+
return result
|
|
1053
|
+
|
|
1054
|
+
|
|
1039
1055
|
@classmethod
|
|
1040
1056
|
def visit_attr_init(cls, node, children):
|
|
1041
1057
|
"""
|
|
@@ -1430,7 +1446,8 @@ class ScrallVisitor(PTNodeVisitor):
|
|
|
1430
1446
|
_logger.info(f" > {result}")
|
|
1431
1447
|
return result
|
|
1432
1448
|
|
|
1433
|
-
if len(children) == 1 and (isinstance(children[0], N_a) or (isinstance(children[0], IN_a))
|
|
1449
|
+
if len(children) == 1 and (isinstance(children[0], N_a) or (isinstance(children[0], IN_a)) or
|
|
1450
|
+
isinstance(children[0], Type_expr_a)):
|
|
1434
1451
|
result = children[0]
|
|
1435
1452
|
_logger.info(f" > {result}")
|
|
1436
1453
|
return result
|
|
@@ -1439,10 +1456,11 @@ class ScrallVisitor(PTNodeVisitor):
|
|
|
1439
1456
|
iset = children.results.get('instance_set')
|
|
1440
1457
|
if iset:
|
|
1441
1458
|
p = children.results.get('projection')
|
|
1442
|
-
|
|
1459
|
+
o = children.results.get('op_chain')
|
|
1460
|
+
op_chain = None if not o else o[0]
|
|
1461
|
+
result = INST_PROJ_a(iset=iset[0], projection=None if not p else p[0], op_chain=op_chain)
|
|
1443
1462
|
_logger.info(f" > {result}")
|
|
1444
1463
|
return result
|
|
1445
|
-
# TODO: include opchain if supplied
|
|
1446
1464
|
|
|
1447
1465
|
result = children[:]
|
|
1448
1466
|
_logger.info(f" > {result}")
|
|
@@ -36,7 +36,8 @@ actions = [
|
|
|
36
36
|
iset=N_a(name='Travel direction'),
|
|
37
37
|
projection=Projection_a(
|
|
38
38
|
expand=None,
|
|
39
|
-
attrs=[N_a(name='opposite')])
|
|
39
|
+
attrs=[N_a(name='opposite')]), op_chain=None)
|
|
40
|
+
]))]), X=(31, 81)), block=None),
|
|
40
41
|
output_token=None),
|
|
41
42
|
Execution_Unit_a(
|
|
42
43
|
statement_set=Seq_Statement_Set_a(
|
|
@@ -17,7 +17,7 @@ expected_parse = Execution_Unit_a(
|
|
|
17
17
|
statement_set=Seq_Statement_Set_a(
|
|
18
18
|
input_tokens=[],
|
|
19
19
|
statement=New_inst_a(
|
|
20
|
-
cname=N_a(name='cat'), attrs=[], rels=None),
|
|
20
|
+
cname=N_a(name='cat'), attrs=[], rels=None, state=None),
|
|
21
21
|
block=None
|
|
22
22
|
),
|
|
23
23
|
output_token=None
|
|
@@ -17,7 +17,7 @@ expected_parse = Execution_Unit_a(
|
|
|
17
17
|
statement_set=Seq_Statement_Set_a(
|
|
18
18
|
input_tokens=[],
|
|
19
19
|
statement=New_inst_a(
|
|
20
|
-
cname=N_a(name='cat'), attrs=[], rels=None),
|
|
20
|
+
cname=N_a(name='cat'), attrs=[], rels=None, state=None),
|
|
21
21
|
block=None), output_token=None
|
|
22
22
|
)
|
|
23
23
|
]),
|
|
@@ -28,7 +28,7 @@ expected_parse = Execution_Unit_a(
|
|
|
28
28
|
statement_set=Seq_Statement_Set_a(
|
|
29
29
|
input_tokens=[],
|
|
30
30
|
statement=New_inst_a(
|
|
31
|
-
cname=N_a(name='dog'), attrs=[], rels=None),
|
|
31
|
+
cname=N_a(name='dog'), attrs=[], rels=None, state=None),
|
|
32
32
|
block=None), output_token=None
|
|
33
33
|
)
|
|
34
34
|
])
|
|
@@ -49,7 +49,7 @@ actions = [
|
|
|
49
49
|
input_tokens=[],
|
|
50
50
|
statement=Signal_a(
|
|
51
51
|
event='Try redirect', supplied_params=[
|
|
52
|
-
|
|
52
|
+
Supplied_Parameter_a(pname='new dest', sval=IN_a(name='new dest'))],
|
|
53
53
|
dest=Signal_Dest_a(
|
|
54
54
|
target_iset=INST_a(
|
|
55
55
|
components=[PATH_a(hops=[R_a(rnum='R53'), N_a(name='Cabin')])]),
|
|
@@ -99,8 +99,9 @@ actions = [
|
|
|
99
99
|
Criteria_Selection_a(card='ALL', criteria=BOOL_a(op='AND', operands=[
|
|
100
100
|
BOOL_a(op='==', operands=[N_a(name='Floor'),
|
|
101
101
|
INST_PROJ_a(iset=N_a(name='nearest dest'),
|
|
102
|
-
projection=Projection_a(expand=None, attrs=[N_a(name='Floor')]))]),
|
|
103
|
-
N_a(name='Shaft')]))]), projection=None)), block=None),
|
|
102
|
+
projection=Projection_a(expand=None, attrs=[N_a(name='Floor')]), op_chain=None)]),
|
|
103
|
+
N_a(name='Shaft')]))]), projection=None, op_chain=None)), block=None),
|
|
104
|
+
output_token=None
|
|
104
105
|
)
|
|
105
106
|
),
|
|
106
107
|
]
|
|
@@ -24,7 +24,7 @@ actions = [
|
|
|
24
24
|
statement=External_Signal_a(
|
|
25
25
|
event='Goto floor',
|
|
26
26
|
supplied_params=[
|
|
27
|
-
|
|
27
|
+
Supplied_Parameter_a(pname='Dest floor', sval=N_a(name='my level'))
|
|
28
28
|
]), block=None),
|
|
29
29
|
output_token=None)
|
|
30
30
|
),
|
|
@@ -19,7 +19,7 @@ actions = [
|
|
|
19
19
|
statement=Decision_a(input=BOOL_a(
|
|
20
20
|
op='NOT', operands=INST_PROJ_a(iset=INST_a(
|
|
21
21
|
components=[PATH_a(hops=[R_a(rnum='R2'), N_a(name='Shaft')])]),
|
|
22
|
-
projection=Projection_a(expand=None, attrs=[N_a(name='In service')]))),
|
|
22
|
+
projection=Projection_a(expand=None, attrs=[N_a(name='In service')]), op_chain=None)),
|
|
23
23
|
true_result=Comp_Statement_Set_a(statement=
|
|
24
24
|
Signal_a(event='Take out of service', supplied_params=[],
|
|
25
25
|
dest=Signal_Dest_a(target_iset=N_a(name='ME'),
|
|
@@ -32,7 +32,7 @@ actions = [
|
|
|
32
32
|
statement=Decision_a(input=BOOL_a(
|
|
33
33
|
op='NOT', operands=INST_PROJ_a(iset=INST_a(
|
|
34
34
|
components=[PATH_a(hops=[R_a(rnum='R2'), N_a(name='Shaft')])]),
|
|
35
|
-
projection=Projection_a(expand=None, attrs=[N_a(name='In service')]))),
|
|
35
|
+
projection=Projection_a(expand=None, attrs=[N_a(name='In service')]), op_chain=None)),
|
|
36
36
|
true_result=Comp_Statement_Set_a(statement=
|
|
37
37
|
Signal_a(event='Take out of service', supplied_params=[],
|
|
38
38
|
dest=Signal_Dest_a(target_iset=N_a(name='ME'),
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
version = "0.10.1"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|