scrall 0.8.0__py3-none-any.whl → 0.8.2__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.

Potentially problematic release.


This version of scrall might be problematic. Click here for more details.

scrall/__init__.py CHANGED
@@ -1 +1 @@
1
- version = "0.8.0"
1
+ version = "0.8.2"
scrall/__main__.py CHANGED
@@ -68,6 +68,7 @@ def main():
68
68
  fpath = Path(args.file)
69
69
  d = args.debug
70
70
  result = ScrallParser.parse_file(file_input=fpath, debug=d)
71
+ pass
71
72
 
72
73
  # logger.info("No problemo") # We didn't die on an exception, basically
73
74
  print("\nNo problemo")
scrall/parse/scrall.peg CHANGED
@@ -43,9 +43,9 @@ rename_attr = RENAME SP* name
43
43
  RENAME = '>>'
44
44
 
45
45
  // Decision action
46
- decision = scalar_expr SP* true_result false_result? // Control flow version of an if-then
47
- true_result = DECISION_OP SP* component_statement_set
48
- false_result = (LINEWRAP* / SP*) FALSE_RESULT_OP SP* component_statement_set // Else
46
+ decision = scalar_expr true_result false_result?
47
+ true_result = DECISION_OP LINEWRAP? SP? component_statement_set
48
+ false_result = SP FALSE_RESULT_OP LINEWRAP? SP? component_statement_set // Else
49
49
  FALSE_RESULT_OP = ':'
50
50
 
51
51
  // Switch action
@@ -58,11 +58,11 @@ enum_value = '_' name // Scalar switch has enum value cases
58
58
  DECISION_OP = '?'
59
59
 
60
60
  // Signal action
61
- signal_action = signal_spec SP+ (signal_dest / ee_dest)
62
- signal = signal_spec SP+ (signal_dest / ee_dest)
61
+ signal_action = signal_spec SP+ (signal_dest / ee_dest / SIGNAL_OP / ASYNCH)
62
+ // SIGNAL_OP only destination means: copy dest from false result of decision action
63
63
  signal_spec = name supplied_params?
64
- signal_dest = SIGNAL_OP (LINEWRAP / SP+) instance_set assigner_partition? (SP+ delay)?
65
- ee_dest = ASYNCH SP* name
64
+ signal_dest = SIGNAL_OP LINEWRAP? SP? instance_set assigner_partition? (SP+ delay)?
65
+ ee_dest = ASYNCH LINEWRAP? SP? name
66
66
  delay = DELAY_OP SP* scalar_expr
67
67
  assigner_partition = '|' instance_set
68
68
  DELAY_OP = '@'
@@ -110,16 +110,16 @@ attr_init = '(' SP* (attr_value_init (',' SP+ attr_value_init)* SP*)? ')' // all
110
110
  attr_value_init = (name SP? ':' SP+ scalar_expr )*
111
111
  update_ref = (instance_set SP+)? to_ref // relate or unrelated to me or explicit instance_set
112
112
  to_ref = '&' rnum SP+ instance_set (',' SP+ instance_set)? // non-associative or associative reference
113
- delete = '!*' SP* instance_set (',' SP+ instance_set) // supports multi-delete transaction
113
+ delete = '!*' SP* instance_set (',' SP+ instance_set)* // supports multi-delete transaction
114
114
 
115
115
  // Scalar call
116
116
  //scalar_call = scalar_expr
117
117
 
118
118
  // math and boolean operator precedence
119
- scalar_assignment = scalar_output_set SP* SCALAR_ASSIGN SP* (scalar_expr projection?) (',' SP* scalar_expr projection?)*
120
- scalar_output_set = flow_output (',' SP* flow_output)*
119
+ scalar_assignment = scalar_output_set SP* SCALAR_ASSIGN SP* scalar_expr projection? (',' SP* scalar_expr projection?)*
120
+ scalar_output_set = flow_output (',' SP+ flow_output)*
121
121
  flow_output = name (TYPE_ASSIGN name)?
122
- projection = '.' (name / '(' ( (ALL / (name (',' SP+ name)*) )? ')'))
122
+ projection = '.' (name / '(' ( (ALL / (name (',' SP+ name)*) )? ')')) // TODO: Why is empty () ok in projection?
123
123
  ALL = '*'
124
124
 
125
125
  scalar_expr = SP* scalar_logical_or SP*
scrall/parse/visitor.py CHANGED
@@ -74,6 +74,7 @@ Rank_a = namedtuple('Rank_a', "card extent")
74
74
 
75
75
 
76
76
  rank_symbol = {'^+': "greatest", '^-': "least"}
77
+ card_symbol = {'1':'ONE', '*':'ALL'}
77
78
 
78
79
  table_op = {
79
80
  '^': 'INTERSECT',
@@ -644,23 +645,34 @@ class ScrallVisitor(PTNodeVisitor):
644
645
  def visit_signal_action(cls, node, children):
645
646
  """
646
647
  """
647
- _logger.info("signal = signal_spec (signal_dest / ee_dest)")
648
+ _logger.info("signal_action = signal_spec SP+ (signal_dest / ee_dest / SIGNAL_OP)")
648
649
  _logger.info(f' :: {node.value}')
649
650
 
650
651
  _logger.info(f" < {children}")
651
652
  sdest = children.results.get('signal_dest')
652
- if sdest:
653
+ eedest = children.results.get('ee_dest')
654
+ if not sdest and not eedest:
655
+ # Dest should be supplied by false result in decision
656
+ result = Signal_a(
657
+ event=children[0]['name'],
658
+ supplied_params=children[0]['params'],
659
+ dest=None
660
+ )
661
+ elif sdest:
662
+ # Signal instance set or assigner destination
653
663
  result = Signal_a(
654
664
  event=children[0]['name'],
655
665
  supplied_params=children[0]['params'],
656
666
  dest=children[1]
657
667
  )
658
668
  else:
669
+ # Otherwise it must be an EE destination
659
670
  result = EE_Signal_a(
660
671
  event=children[0]['name'],
661
672
  supplied_params=children[0]['params'],
662
673
  ee=children[1]
663
674
  )
675
+
664
676
  _logger.info(f" > {result}")
665
677
  return result
666
678
 
@@ -693,7 +705,7 @@ class ScrallVisitor(PTNodeVisitor):
693
705
  def visit_signal_dest(cls, node, children):
694
706
  """
695
707
  """
696
- _logger.info("signal_dest = SIGNAL_OP instance_set assigner_partition? delay?")
708
+ _logger.info("signal_action = signal_spec SP+ (signal_dest / ee_dest / SIGNAL_OP / ASYNCH)")
697
709
  _logger.info(f' :: {node.value}')
698
710
 
699
711
  _logger.info(f" < {children}")
@@ -702,7 +714,7 @@ class ScrallVisitor(PTNodeVisitor):
702
714
  ap = None if not ap else ap[0]
703
715
  delay = children.results.get('delay')
704
716
  delay = 0 if not delay else delay[0]
705
- result = Signal_Dest_a(target_iset = iset, assigner_partition=N_a(ap), delay=delay)
717
+ result = Signal_Dest_a(target_iset=iset, assigner_partition=N_a(ap), delay=delay)
706
718
  _logger.info(f" > {result}")
707
719
  return result
708
720
 
@@ -926,11 +938,13 @@ class ScrallVisitor(PTNodeVisitor):
926
938
  _logger.info(f' :: {node.value}')
927
939
 
928
940
  _logger.info(f" < {children}")
929
- card = children.results.get('CARD')[0]
930
- attr = children.results.get('name')
931
- rankr = children.results.get('RANKR')
932
- rankr_parse = rank_symbol[rankr[0]]
933
- result = Rank_Selection_a(card=card, rankr=rankr_parse, attr=attr)
941
+ card_parse = children.results['CARD'][0]
942
+ card = card_symbol[card_parse]
943
+ attr_parse = children.results['name'][0]
944
+ attr = attr_parse.name
945
+ rankr_parse = children.results['RANKR']
946
+ rankr = rank_symbol[rankr_parse[0]]
947
+ result = Rank_Selection_a(card=card, rankr=rankr, attr=attr)
934
948
  _logger.info(f" > {result}")
935
949
  return result
936
950
 
@@ -945,7 +959,8 @@ class ScrallVisitor(PTNodeVisitor):
945
959
 
946
960
  _logger.info(f" < {children}")
947
961
  explicit_card = children.results.get('CARD')
948
- card = '*' if not explicit_card else explicit_card[0]
962
+ card_parse = '*' if not explicit_card else explicit_card[0]
963
+ card = card_symbol[card_parse]
949
964
  criteria = children.results.get('scalar_expr')
950
965
  if criteria:
951
966
  result = Criteria_Selection_a(card=card, criteria=criteria[0])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scrall
3
- Version: 0.8.0
3
+ Version: 0.8.2
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
@@ -0,0 +1,14 @@
1
+ scrall/__init__.py,sha256=Q21Bq3gbsUqGg_u-008RR-6e_IdwSouIWV3rtR8UkDY,17
2
+ scrall/__main__.py,sha256=hmDQBhfK3XMAPoAbzO0yVy42eqQkTC0y4hMp6xvc7CI,2174
3
+ scrall/exceptions.py,sha256=QU4mKLs7_ddGIznhh2HUpjb_PdPlxWZMMY_g0ELenSs,1764
4
+ scrall/log.conf,sha256=tERYKbCp9TgdAVTby6A7gUpnjurJKcX1tyAzG3ATORI,933
5
+ scrall/parse/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ scrall/parse/parser.py,sha256=k4SeWMtNzAUtwU_e15frvSL1D5G3RBU_jmLegZbIBnY,5221
7
+ scrall/parse/scrall.peg,sha256=Dwuram4HrlwwXJuSYsD2GWcHjnoWNoyhxwcSUVeBNNU,7740
8
+ scrall/parse/visitor.py,sha256=jmwAiwPgZSKGoGqygdegJIawoei9vTOKYf7vg7-9Gdk,56017
9
+ scrall-0.8.2.dist-info/licenses/LICENSE,sha256=kL0xVrwl2i3Pk9mQXAVAPANCTaLGGOsoXgvqW7TBs20,1072
10
+ scrall-0.8.2.dist-info/METADATA,sha256=4TZ4PU2hN3MxR9nIF4okmxX4hE9cr9UFQxC-jh2v3rQ,7208
11
+ scrall-0.8.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
12
+ scrall-0.8.2.dist-info/entry_points.txt,sha256=2fHG6VXtqSTEZXadsBe7XCFaLm4t3V1pFuqzgWWjBgA,48
13
+ scrall-0.8.2.dist-info/top_level.txt,sha256=SWvpMyNNJlrMWpSsK5RUL40ivQxQpKPbL86VrvNIUAE,7
14
+ scrall-0.8.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.8.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,14 +0,0 @@
1
- scrall/__init__.py,sha256=Xa5Ugzgk02aJpYFNzZussKTPoB7_TI6yxPt6r3mRqRM,17
2
- scrall/__main__.py,sha256=hyBcYLATx0XghUUnrKQQgDQ8PicczmBnXgBAx92ltB4,2161
3
- scrall/exceptions.py,sha256=QU4mKLs7_ddGIznhh2HUpjb_PdPlxWZMMY_g0ELenSs,1764
4
- scrall/log.conf,sha256=tERYKbCp9TgdAVTby6A7gUpnjurJKcX1tyAzG3ATORI,933
5
- scrall/parse/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- scrall/parse/parser.py,sha256=k4SeWMtNzAUtwU_e15frvSL1D5G3RBU_jmLegZbIBnY,5221
7
- scrall/parse/scrall.peg,sha256=5qaAjASvWVsOjKxXnEh63OrEnNOL9QXdxfME0dwcvgM,7672
8
- scrall/parse/visitor.py,sha256=gcecbvpBDsa6scbQv21rJZdsDrwOC83yKR3wtyNhiKs,55393
9
- scrall-0.8.0.dist-info/licenses/LICENSE,sha256=kL0xVrwl2i3Pk9mQXAVAPANCTaLGGOsoXgvqW7TBs20,1072
10
- scrall-0.8.0.dist-info/METADATA,sha256=OKiv09J24672gTi7KKxflBiJ72dcm8YmDH0ydXfqid4,7208
11
- scrall-0.8.0.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
12
- scrall-0.8.0.dist-info/entry_points.txt,sha256=2fHG6VXtqSTEZXadsBe7XCFaLm4t3V1pFuqzgWWjBgA,48
13
- scrall-0.8.0.dist-info/top_level.txt,sha256=SWvpMyNNJlrMWpSsK5RUL40ivQxQpKPbL86VrvNIUAE,7
14
- scrall-0.8.0.dist-info/RECORD,,