scrall 0.6.2__tar.gz → 0.7.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.
Potentially problematic release.
This version of scrall might be problematic. Click here for more details.
- {scrall-0.6.2/src/scrall.egg-info → scrall-0.7.0}/PKG-INFO +1 -1
- {scrall-0.6.2 → scrall-0.7.0}/pyproject.toml +1 -1
- scrall-0.7.0/src/scrall/__init__.py +1 -0
- {scrall-0.6.2 → scrall-0.7.0}/src/scrall/parse/scrall.peg +2 -2
- {scrall-0.6.2 → scrall-0.7.0}/src/scrall/parse/visitor.py +8 -25
- {scrall-0.6.2 → scrall-0.7.0/src/scrall.egg-info}/PKG-INFO +1 -1
- {scrall-0.6.2 → scrall-0.7.0}/tests/test_ping_actions.py +5 -5
- {scrall-0.6.2 → scrall-0.7.0}/tests/test_selection.py +8 -8
- scrall-0.6.2/src/scrall/__init__.py +0 -1
- {scrall-0.6.2 → scrall-0.7.0}/LICENSE +0 -0
- {scrall-0.6.2 → scrall-0.7.0}/MANIFEST.in +0 -0
- {scrall-0.6.2 → scrall-0.7.0}/README.md +0 -0
- {scrall-0.6.2 → scrall-0.7.0}/setup.cfg +0 -0
- {scrall-0.6.2 → scrall-0.7.0}/src/scrall/__main__.py +0 -0
- {scrall-0.6.2 → scrall-0.7.0}/src/scrall/exceptions.py +0 -0
- {scrall-0.6.2 → scrall-0.7.0}/src/scrall/log.conf +0 -0
- {scrall-0.6.2 → scrall-0.7.0}/src/scrall/parse/__init__.py +0 -0
- {scrall-0.6.2 → scrall-0.7.0}/src/scrall/parse/parser.py +0 -0
- {scrall-0.6.2 → scrall-0.7.0}/src/scrall.egg-info/SOURCES.txt +0 -0
- {scrall-0.6.2 → scrall-0.7.0}/src/scrall.egg-info/dependency_links.txt +0 -0
- {scrall-0.6.2 → scrall-0.7.0}/src/scrall.egg-info/entry_points.txt +0 -0
- {scrall-0.6.2 → scrall-0.7.0}/src/scrall.egg-info/requires.txt +0 -0
- {scrall-0.6.2 → scrall-0.7.0}/src/scrall.egg-info/top_level.txt +0 -0
- {scrall-0.6.2 → scrall-0.7.0}/tests/test_delete.py +0 -0
- {scrall-0.6.2 → scrall-0.7.0}/tests/test_signals.py +0 -0
- {scrall-0.6.2 → scrall-0.7.0}/tests/test_state_actions.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.7.0"
|
|
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.7.0"
|
|
@@ -93,9 +93,9 @@ OUTPUT = '=>>'
|
|
|
93
93
|
// Instance set
|
|
94
94
|
instance_set = new_instance / ((operation / name / path) (reflexive_selection / selection / operation / path)*)
|
|
95
95
|
selection = '(' SP* select_phrase SP* ')'
|
|
96
|
-
select_phrase = (CARD ',' SP*
|
|
96
|
+
select_phrase = (CARD RANKR? ',' SP* scalar_expr) / CARD / scalar_expr
|
|
97
97
|
CARD = '1' / '*'
|
|
98
|
-
|
|
98
|
+
RANKR = '<' / '>'
|
|
99
99
|
IN = '^'
|
|
100
100
|
TRUE = 'TRUE'
|
|
101
101
|
FALSE = 'FALSE'
|
|
@@ -16,7 +16,7 @@ Call_a = namedtuple('Call_a', 'call op_chain')
|
|
|
16
16
|
Scalar_Call_a = namedtuple('Scalar_Call_a', 'call')
|
|
17
17
|
"""The subject of a call could be an instance set (method) or an external entity (ee operation)"""
|
|
18
18
|
Attr_Access_a = namedtuple('Attr_Access_a', 'cname its attr')
|
|
19
|
-
Selection_a = namedtuple('Selection_a', 'card
|
|
19
|
+
Selection_a = namedtuple('Selection_a', 'card rankr criteria')
|
|
20
20
|
Inst_Assignment_a = namedtuple('Inst_Assignment_a', 'lhs card rhs X')
|
|
21
21
|
EE_Signal_a = namedtuple('EE_Signal_a', 'event supplied_params ee')
|
|
22
22
|
Signal_a = namedtuple('Signal_a', 'event supplied_params dest')
|
|
@@ -69,9 +69,10 @@ Table_Def_a= namedtuple('Table_Def_a', 'name header')
|
|
|
69
69
|
Rename_a = namedtuple('Rename_a', 'from_name to_name')
|
|
70
70
|
Iteration_a = namedtuple('Iteration_a', 'order statement_set')
|
|
71
71
|
Migration_a = namedtuple('Migration_a','from_inst to_subclass')
|
|
72
|
+
Rank_a = namedtuple('Rank_a', "card extent")
|
|
72
73
|
|
|
73
74
|
|
|
74
|
-
|
|
75
|
+
rank_symbol = {'>': "greatest", '<': "least"}
|
|
75
76
|
|
|
76
77
|
table_op = {
|
|
77
78
|
'^': 'INTERSECT',
|
|
@@ -801,7 +802,7 @@ class ScrallVisitor(PTNodeVisitor):
|
|
|
801
802
|
|
|
802
803
|
Name is the name of the operation
|
|
803
804
|
"""
|
|
804
|
-
_logger.info("operation =
|
|
805
|
+
_logger.info("operation = owner? '.' name supplied_params")
|
|
805
806
|
_logger.info(f' :: {node.value}')
|
|
806
807
|
|
|
807
808
|
_logger.info(f" < {children}")
|
|
@@ -811,7 +812,6 @@ class ScrallVisitor(PTNodeVisitor):
|
|
|
811
812
|
owner='implicit' if not owner else owner[0],
|
|
812
813
|
op_name=children.results['name'][0].name,
|
|
813
814
|
supplied_params=[] if not p else p[0]
|
|
814
|
-
# order=None if not o else symbol[o[0]]
|
|
815
815
|
)
|
|
816
816
|
_logger.info(f" > {result}")
|
|
817
817
|
return result
|
|
@@ -918,7 +918,7 @@ class ScrallVisitor(PTNodeVisitor):
|
|
|
918
918
|
@classmethod
|
|
919
919
|
def visit_select_phrase(cls, node, children):
|
|
920
920
|
"""
|
|
921
|
-
(CARD ',' SP*
|
|
921
|
+
(CARD RANKR? ',' SP* scalar_expr) / CARD / RANKR? scalar_expr
|
|
922
922
|
"""
|
|
923
923
|
_logger.info(f"{node.rule_name} = (CARD ',' SP* scalar_expr) / CARD / scalar_expr")
|
|
924
924
|
_logger.info(f">> {[k for k in children.results.keys()]}")
|
|
@@ -928,10 +928,10 @@ class ScrallVisitor(PTNodeVisitor):
|
|
|
928
928
|
explicit_card = children.results.get('CARD')
|
|
929
929
|
card = '*' if not explicit_card else explicit_card[0]
|
|
930
930
|
criteria = children.results.get('scalar_expr')
|
|
931
|
-
|
|
932
|
-
|
|
931
|
+
rankr = children.results.get('RANKR')
|
|
932
|
+
rankr_parse = rank_symbol[rankr[0]] if rankr else None # assign greatest or least
|
|
933
933
|
if criteria:
|
|
934
|
-
result = Selection_a(card=card, criteria=criteria[0]
|
|
934
|
+
result = Selection_a(card=card, rankr=rankr_parse, criteria=criteria[0])
|
|
935
935
|
else:
|
|
936
936
|
result = [card]
|
|
937
937
|
_logger.info(f" > {result}")
|
|
@@ -1415,23 +1415,6 @@ class ScrallVisitor(PTNodeVisitor):
|
|
|
1415
1415
|
_logger.info(f" > {result}")
|
|
1416
1416
|
return result
|
|
1417
1417
|
|
|
1418
|
-
# @classmethod
|
|
1419
|
-
# def visit_prefix_name(cls, node, children):
|
|
1420
|
-
# """
|
|
1421
|
-
# """
|
|
1422
|
-
# _logger.info("prefix_name = ORDER? name")
|
|
1423
|
-
# _logger.info(f' :: {node.value}')
|
|
1424
|
-
#
|
|
1425
|
-
# _logger.info(f" < {children}")
|
|
1426
|
-
# n = children.results['name'][0]
|
|
1427
|
-
# o = children.results.get('ORDER')
|
|
1428
|
-
# if o:
|
|
1429
|
-
# result = Order_name_a(order=symbol[o[0]], name=n)
|
|
1430
|
-
# else:
|
|
1431
|
-
# result = n
|
|
1432
|
-
# _logger.info(f" > {result}")
|
|
1433
|
-
# return result
|
|
1434
|
-
|
|
1435
1418
|
@classmethod
|
|
1436
1419
|
def visit_scalar_op(cls, node, children):
|
|
1437
1420
|
"""
|
|
@@ -5,7 +5,7 @@ from scrall.parse.parser import ScrallParser
|
|
|
5
5
|
from scrall.parse.visitor import Execution_Unit_a, Signal_a, Signal_Dest_a, N_a, INST_a, PATH_a, R_a,\
|
|
6
6
|
Inst_Assignment_a, Flow_Output_a, Selection_a, BOOL_a, Supplied_Parameter_a, Call_a, Op_a, IN_a, \
|
|
7
7
|
Table_Assignment_a, TEXPR_a, Projection_a, Seq_Statement_Set_a, Scalar_Assignment_a, Scalar_RHS_a, \
|
|
8
|
-
Sequence_Token_a, Case_a, Switch_a, Enum_a, Output_Flow_a, INST_PROJ_a, Comp_Statement_Set_a
|
|
8
|
+
Sequence_Token_a, Case_a, Switch_a, Enum_a, Output_Flow_a, INST_PROJ_a, Comp_Statement_Set_a
|
|
9
9
|
|
|
10
10
|
actions = [
|
|
11
11
|
("{\n a = b\n c = d\n}<1>",
|
|
@@ -40,7 +40,7 @@ actions = [
|
|
|
40
40
|
statement=Table_Assignment_a(type='implicit', assign_tuple=False,
|
|
41
41
|
lhs='stop here floors',
|
|
42
42
|
rhs=TEXPR_a(table=INST_a(components=[N_a(name='shaft aslevs')]), hexpr=None,
|
|
43
|
-
selection=Selection_a(card='*', criteria=N_a(name='Stop requested')),
|
|
43
|
+
selection=Selection_a(card='*', rankr=None, criteria=N_a(name='Stop requested')),
|
|
44
44
|
projection=Projection_a(expand=None, attrs=[N_a(name='Floor')])),
|
|
45
45
|
X=(0, 56)), block=None), output_token=None)),
|
|
46
46
|
("Try redirect( ^new dest ) -> /R53/Cabin",
|
|
@@ -56,7 +56,7 @@ actions = [
|
|
|
56
56
|
Execution_Unit_a(statement_set=Seq_Statement_Set_a(input_tokens=None,
|
|
57
57
|
statement=Call_a(call=INST_a(components=[Op_a(owner='TRAN', op_name='Go to floor',
|
|
58
58
|
supplied_params=[Supplied_Parameter_a(pname='Dest floor', sval=IN_a(name='new dest')),
|
|
59
|
-
Supplied_Parameter_a(pname='Shaft', sval=N_a(name='Shaft'))]
|
|
59
|
+
Supplied_Parameter_a(pname='Shaft', sval=N_a(name='Shaft'))])]
|
|
60
60
|
), op_chain=None),
|
|
61
61
|
block=None), output_token=None)
|
|
62
62
|
),
|
|
@@ -80,14 +80,14 @@ actions = [
|
|
|
80
80
|
Execution_Unit_a(statement_set=Seq_Statement_Set_a(input_tokens=None,
|
|
81
81
|
statement=Inst_Assignment_a(
|
|
82
82
|
lhs=Flow_Output_a(name=N_a(name='requested stops'), exp_type=None), card='M',
|
|
83
|
-
rhs=INST_a(components=[N_a(name='shaft aslevs'), Selection_a(card='*',
|
|
83
|
+
rhs=INST_a(components=[N_a(name='shaft aslevs'), Selection_a(card='*', rankr=None,
|
|
84
84
|
criteria=BOOL_a(op='==', operands=[N_a(name='Stop requested'), N_a(name='avalue')]))]),
|
|
85
85
|
X=(0, 58)), block=None), output_token=None)
|
|
86
86
|
),
|
|
87
87
|
("=>> Accessible Shaft Level( Floor: nearest dest.Floor; Shaft )",
|
|
88
88
|
Execution_Unit_a(statement_set=Seq_Statement_Set_a(input_tokens=None, statement=Output_Flow_a(
|
|
89
89
|
output=INST_PROJ_a(iset=INST_a(components=[N_a(name='Accessible Shaft Level'),
|
|
90
|
-
Selection_a(card='*', criteria=BOOL_a(op='AND', operands=[
|
|
90
|
+
Selection_a(card='*', rankr=None, criteria=BOOL_a(op='AND', operands=[
|
|
91
91
|
BOOL_a(op='==', operands=[N_a(name='Floor'),
|
|
92
92
|
INST_PROJ_a(iset=N_a(name='nearest dest'),
|
|
93
93
|
projection=Projection_a(expand=None, attrs=[N_a(name='Floor')]))]),
|
|
@@ -10,7 +10,7 @@ actions = [
|
|
|
10
10
|
Execution_Unit_a(statement_set=Seq_Statement_Set_a(input_tokens=None,
|
|
11
11
|
statement=Inst_Assignment_a(
|
|
12
12
|
lhs=Flow_Output_a(name=N_a(name='s'), exp_type=None), card='M',
|
|
13
|
-
rhs=INST_a(components=[N_a(name='Shaft'), Selection_a(card='*',
|
|
13
|
+
rhs=INST_a(components=[N_a(name='Shaft'), Selection_a(card='*', rankr=None,
|
|
14
14
|
criteria=BOOL_a(op='AND', operands=[N_a(name='Inservice'), N_a(name='Cleared')]))]),
|
|
15
15
|
X=(0, 31)), block=None), output_token=None)
|
|
16
16
|
),
|
|
@@ -18,7 +18,7 @@ actions = [
|
|
|
18
18
|
Execution_Unit_a(statement_set=Seq_Statement_Set_a(input_tokens=None,
|
|
19
19
|
statement=Inst_Assignment_a(
|
|
20
20
|
lhs=Flow_Output_a(name=N_a(name='c'), exp_type=None), card='M',
|
|
21
|
-
rhs=INST_a(components=[N_a(name='Cabin'), Selection_a(card='*',
|
|
21
|
+
rhs=INST_a(components=[N_a(name='Cabin'), Selection_a(card='*', rankr=None,
|
|
22
22
|
criteria=BOOL_a(op='>', operands=[N_a(name='Speed'),
|
|
23
23
|
MATH_a(op='+', operands=[N_a(name='slowest'), N_a(name='buffer')])]))]),
|
|
24
24
|
X=(0, 37)), block=None), output_token=None)
|
|
@@ -27,7 +27,7 @@ actions = [
|
|
|
27
27
|
Execution_Unit_a(statement_set=Seq_Statement_Set_a(input_tokens=None,
|
|
28
28
|
statement=Inst_Assignment_a(
|
|
29
29
|
lhs=Flow_Output_a(name=N_a(name='c'), exp_type=None), card='M',
|
|
30
|
-
rhs=INST_a(components=[N_a(name='Cabin'), Selection_a(card='*',
|
|
30
|
+
rhs=INST_a(components=[N_a(name='Cabin'), Selection_a(card='*', rankr=None,
|
|
31
31
|
criteria=BOOL_a(op='>', operands=[N_a(name='Speed'), N_a(name='slowest')]))]),
|
|
32
32
|
X=(0, 28)), block=None), output_token=None)
|
|
33
33
|
),
|
|
@@ -35,14 +35,14 @@ actions = [
|
|
|
35
35
|
Execution_Unit_a(statement_set=Seq_Statement_Set_a(input_tokens=None,
|
|
36
36
|
statement=Inst_Assignment_a(
|
|
37
37
|
lhs=Flow_Output_a(name=N_a(name='s'), exp_type=None), card='M',
|
|
38
|
-
rhs=INST_a(components=[N_a(name='Shaft'), Selection_a(card='*',
|
|
38
|
+
rhs=INST_a(components=[N_a(name='Shaft'), Selection_a(card='*', rankr=None,
|
|
39
39
|
criteria=BOOL_a(op='==', operands=[N_a(name='In service'), 'TRUE']))]),
|
|
40
40
|
X=(0, 29)), block=None), output_token=None)
|
|
41
41
|
),
|
|
42
42
|
("s ..= Shaft(In service)",
|
|
43
43
|
Execution_Unit_a(statement_set=Seq_Statement_Set_a(input_tokens=None,
|
|
44
44
|
statement=Inst_Assignment_a(lhs=Flow_Output_a(name=N_a(name='s'), exp_type=None), card='M',
|
|
45
|
-
rhs=INST_a(components=[N_a(name='Shaft'), Selection_a(card='*',
|
|
45
|
+
rhs=INST_a(components=[N_a(name='Shaft'), Selection_a(card='*', rankr=None,
|
|
46
46
|
criteria=N_a(name='In service'))]),
|
|
47
47
|
X=(0, 23)), block=None), output_token=None)
|
|
48
48
|
),
|
|
@@ -50,7 +50,7 @@ actions = [
|
|
|
50
50
|
Execution_Unit_a(statement_set=Seq_Statement_Set_a(input_tokens=None,
|
|
51
51
|
statement=Inst_Assignment_a(
|
|
52
52
|
lhs=Flow_Output_a(name=N_a(name='x'), exp_type=None), card='1',
|
|
53
|
-
rhs=INST_a(components=[N_a(name='Bank'), Selection_a(card='*',
|
|
53
|
+
rhs=INST_a(components=[N_a(name='Bank'), Selection_a(card='*', rankr=None,
|
|
54
54
|
criteria=BOOL_a(op='OR', operands=[
|
|
55
55
|
BOOL_a(op='==', operands=[
|
|
56
56
|
N_a(name='Max close attempts'),
|
|
@@ -62,8 +62,8 @@ actions = [
|
|
|
62
62
|
Execution_Unit_a(statement_set=Seq_Statement_Set_a(input_tokens=None,
|
|
63
63
|
statement=Inst_Assignment_a(
|
|
64
64
|
lhs=Flow_Output_a(name=N_a(name='x'), exp_type=None), card='M',
|
|
65
|
-
rhs=INST_a(components=[Op_a(owner='car', op_name='findsome', supplied_params=[]
|
|
66
|
-
Selection_a(card='*', criteria=BOOL_a(op='==',
|
|
65
|
+
rhs=INST_a(components=[Op_a(owner='car', op_name='findsome', supplied_params=[]),
|
|
66
|
+
Selection_a(card='*', rankr=None, criteria=BOOL_a(op='==',
|
|
67
67
|
operands=[N_a(name='color'), Enum_a(value=N_a(name='red'))]))]),
|
|
68
68
|
X=(0, 33)), block=None), output_token=None)
|
|
69
69
|
),
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
version = "0.6.2"
|
|
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
|