scrall 0.3.5__tar.gz → 0.4.1__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.

Files changed (25) hide show
  1. {scrall-0.3.5/src/scrall.egg-info → scrall-0.4.1}/PKG-INFO +1 -1
  2. {scrall-0.3.5 → scrall-0.4.1}/pyproject.toml +1 -1
  3. scrall-0.4.1/src/scrall/__init__.py +1 -0
  4. {scrall-0.3.5 → scrall-0.4.1}/src/scrall/parse/scrall.peg +4 -2
  5. {scrall-0.3.5 → scrall-0.4.1}/src/scrall/parse/visitor.py +11 -9
  6. {scrall-0.3.5 → scrall-0.4.1/src/scrall.egg-info}/PKG-INFO +1 -1
  7. {scrall-0.3.5 → scrall-0.4.1}/tests/test_ping_actions.py +3 -3
  8. {scrall-0.3.5 → scrall-0.4.1}/tests/test_selection.py +3 -3
  9. scrall-0.3.5/src/scrall/__init__.py +0 -1
  10. {scrall-0.3.5 → scrall-0.4.1}/LICENSE +0 -0
  11. {scrall-0.3.5 → scrall-0.4.1}/MANIFEST.in +0 -0
  12. {scrall-0.3.5 → scrall-0.4.1}/README.md +0 -0
  13. {scrall-0.3.5 → scrall-0.4.1}/setup.cfg +0 -0
  14. {scrall-0.3.5 → scrall-0.4.1}/src/scrall/__main__.py +0 -0
  15. {scrall-0.3.5 → scrall-0.4.1}/src/scrall/exceptions.py +0 -0
  16. {scrall-0.3.5 → scrall-0.4.1}/src/scrall/log.conf +0 -0
  17. {scrall-0.3.5 → scrall-0.4.1}/src/scrall/parse/__init__.py +0 -0
  18. {scrall-0.3.5 → scrall-0.4.1}/src/scrall/parse/parser.py +0 -0
  19. {scrall-0.3.5 → scrall-0.4.1}/src/scrall.egg-info/SOURCES.txt +0 -0
  20. {scrall-0.3.5 → scrall-0.4.1}/src/scrall.egg-info/dependency_links.txt +0 -0
  21. {scrall-0.3.5 → scrall-0.4.1}/src/scrall.egg-info/entry_points.txt +0 -0
  22. {scrall-0.3.5 → scrall-0.4.1}/src/scrall.egg-info/requires.txt +0 -0
  23. {scrall-0.3.5 → scrall-0.4.1}/src/scrall.egg-info/top_level.txt +0 -0
  24. {scrall-0.3.5 → scrall-0.4.1}/tests/test_signals.py +0 -0
  25. {scrall-0.3.5 → scrall-0.4.1}/tests/test_state_actions.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: scrall
3
- Version: 0.3.5
3
+ Version: 0.4.1
4
4
  Summary: Starr's Concise Relational Action Language - For Shlaer-Mellor Executable UML
5
5
  Author-email: Leon Starr <leon_starr@modelint.com>
6
6
  License: MIT License
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "scrall"
7
- version = "0.3.5"
7
+ version = "0.4.1"
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.4.1"
@@ -16,8 +16,10 @@ token_name = r'[A-Za-z0-9_]+' // No spaces in token names, often single digit: <
16
16
  table_assignment = explicit_table_assignment / implicit_table_assignment
17
17
 
18
18
  // Explicit table assignment
19
- explicit_table_assignment = table_def SP+ TABLE_ASSIGN SP+ table_value
19
+ explicit_table_assignment = table_def SP+ relation_assign_op SP+ table_value
20
+ relation_assign_op = TABLE_ASSIGN / TUPLE_ASSIGN
20
21
  TABLE_ASSIGN = '#='
22
+ TUPLE_ASSIGN = '||='
21
23
  table_def = name '[' SP* (attr_type_set SP*)? ']'
22
24
  attr_type_set = attr_type_def (',' SP* attr_type_def)*
23
25
  attr_type_def = name '::' name
@@ -26,7 +28,7 @@ row = '{' SP* attr_value_set? SP* '}'
26
28
  attr_value_set = scalar_expr (',' SP* scalar_expr)*
27
29
 
28
30
  // Implicit table assignment
29
- implicit_table_assignment = name SP+ TABLE_ASSIGN SP+ table_expr
31
+ implicit_table_assignment = name SP+ relation_assign_op SP+ table_expr
30
32
  table_expr = SP* table_operation SP*
31
33
  table_operation = table_term (SP* TOP SP* table_term)*
32
34
  table_term = (instance_set / "(" SP* table_expr SP* ")") header_expr? selection? projection?
@@ -38,7 +38,7 @@ UNARY_a = namedtuple('UNARY_a', 'op operand')
38
38
  BOOL_a = namedtuple('BOOL_a', 'op operands')
39
39
  """Boolean operation returns true or false"""
40
40
  Scalar_Assignment_a = namedtuple('Scalar_Assignment_a', 'lhs rhs')
41
- Table_Assignment_a = namedtuple('Table_Assignment_a', 'type lhs rhs X')
41
+ Table_Assignment_a = namedtuple('Table_Assignment_a', 'type assign_tuple lhs rhs X')
42
42
  Scalar_RHS_a = namedtuple('Scalar_RHS_a', 'expr attrs')
43
43
  Flow_Output_a = namedtuple('Flow_Output_a', 'name exp_type')
44
44
  PATH_a = namedtuple('PATH_a', 'hops')
@@ -302,12 +302,13 @@ class ScrallVisitor(PTNodeVisitor):
302
302
  @classmethod
303
303
  def visit_explicit_table_assignment(cls, node, children):
304
304
 
305
- _logger.info("explicit_table_assignment = table_def TABLE_ASSIGN table_value")
305
+ _logger.info("explicit_table_assignment = table_def relation_assign_op table_value")
306
306
  _logger.info(f' :: {node.value}')
307
307
 
308
308
  _logger.info(f" < {children}")
309
- result = Table_Assignment_a(type='explicit', lhs=children[0], rhs=children[1],
310
- X=(node.position, node.position_end))
309
+ atuple = True if children.results['relation_assign_op'][0] == '||=' else False
310
+ result = Table_Assignment_a(assign_tuple=atuple, type='explicit', lhs=children.results['table_def'][0],
311
+ rhs=children.results['table_value'][0], X=(node.position, node.position_end))
311
312
  _logger.info(f" > {result}")
312
313
  return result
313
314
 
@@ -379,12 +380,13 @@ class ScrallVisitor(PTNodeVisitor):
379
380
  @classmethod
380
381
  def visit_implicit_table_assignment(cls, node, children):
381
382
 
382
- _logger.info("implicit_table_assignment = name TABLE_ASSIGN table_expr")
383
+ _logger.info("implicit_table_assignment = name relation_assign_op table_expr")
383
384
  _logger.info(f' :: {node.value}')
384
385
 
385
386
  _logger.info(f" < {children}")
386
- result = Table_Assignment_a(type='implicit', lhs=children[0].name, rhs=children[1],
387
- X=(node.position, node.position_end))
387
+ atuple = True if children.results['relation_assign_op'][0] == '||=' else False
388
+ result = Table_Assignment_a(assign_tuple=atuple, type='implicit', lhs=children[0].name,
389
+ rhs=children.results['table_expr'][0], X=(node.position, node.position_end))
388
390
  _logger.info(f" > {result}")
389
391
  return result
390
392
 
@@ -1226,8 +1228,8 @@ class ScrallVisitor(PTNodeVisitor):
1226
1228
  result = children[0]
1227
1229
  else:
1228
1230
  # Convert ':' to '==' if found
1229
- eq_map = ['==' if e in ('==',':') else '!=' for e in children.results['EQUAL']]
1230
- result = BOOL_a(eq_map, children.results['comparison'])
1231
+ eq_op = '==' if children.results['EQUAL'][0] == ':' else children.results['EQUAL'][0]
1232
+ result = BOOL_a(eq_op, children.results['comparison'])
1231
1233
 
1232
1234
  if children[0] != result:
1233
1235
  _logger.info(f"{node.rule_name} = comparison (EQUAL comparison)*")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: scrall
3
- Version: 0.3.5
3
+ Version: 0.4.1
4
4
  Summary: Starr's Concise Relational Action Language - For Shlaer-Mellor Executable UML
5
5
  Author-email: Leon Starr <leon_starr@modelint.com>
6
6
  License: MIT License
@@ -37,7 +37,7 @@ actions = [
37
37
 
38
38
  ("stop here floors #= shaft aslevs( Stop requested ).Floor",
39
39
  Execution_Unit_a(statement_set=Seq_Statement_Set_a(input_tokens=None,
40
- statement=Table_Assignment_a(type='implicit',
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
43
  selection=Selection_a(card='*', criteria=N_a(name='Stop requested')),
@@ -81,14 +81,14 @@ actions = [
81
81
  statement=Inst_Assignment_a(
82
82
  lhs=Flow_Output_a(name=N_a(name='requested stops'), exp_type=None), card='M',
83
83
  rhs=INST_a(components=[N_a(name='shaft aslevs'), Selection_a(card='*',
84
- criteria=BOOL_a(op=['=='], operands=[N_a(name='Stop requested'), N_a(name='avalue')]))]),
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
  Output_Flow_a(output=
89
89
  INST_a(components=[N_a(name='Accessible Shaft Level'),
90
90
  Selection_a(card='*', criteria=BOOL_a(op='AND', operands=[
91
- BOOL_a(op=['=='], operands=[
91
+ BOOL_a(op='==', operands=[
92
92
  N_a(name='Floor'),
93
93
  INST_PROJ_a(iset=N_a(name='nearest dest'), projection=
94
94
  Projection_a(expand=None, attrs=[N_a(name='Floor')]))]),
@@ -36,7 +36,7 @@ actions = [
36
36
  statement=Inst_Assignment_a(
37
37
  lhs=Flow_Output_a(name=N_a(name='s'), exp_type=None), card='M',
38
38
  rhs=INST_a(components=[N_a(name='Shaft'), Selection_a(card='*',
39
- criteria=BOOL_a(op=['=='], operands=[N_a(name='In service'), 'true']))]),
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)",
@@ -52,7 +52,7 @@ actions = [
52
52
  lhs=Flow_Output_a(name=N_a(name='x'), exp_type=None), card='1',
53
53
  rhs=INST_a(components=[N_a(name='Bank'), Selection_a(card='*',
54
54
  criteria=BOOL_a(op='OR', operands=[
55
- BOOL_a(op=['=='], operands=[
55
+ BOOL_a(op='==', operands=[
56
56
  N_a(name='Max close attempts'),
57
57
  BOOL_a(op='OR', operands=[N_a(name='v'), N_a(name='x')])]),
58
58
  BOOL_a(op='>', operands=[N_a(name='Average cabin speed'), N_a(name='mspeed')])]))]),
@@ -63,7 +63,7 @@ actions = [
63
63
  statement=Inst_Assignment_a(
64
64
  lhs=Flow_Output_a(name=N_a(name='x'), exp_type=None), card='M',
65
65
  rhs=INST_a(components=[Op_a(owner='car', op_name='findsome', supplied_params=[], order=None),
66
- Selection_a(card='*', criteria=BOOL_a(op=['=='],
66
+ Selection_a(card='*', 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.3.5"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes