scrall 0.10.1__py3-none-any.whl → 0.11.0__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.
scrall/__init__.py CHANGED
@@ -1 +1 @@
1
- version = "0.10.1"
1
+ version = "0.11.0"
scrall/parse/scrall.peg CHANGED
@@ -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
scrall/parse/visitor.py CHANGED
@@ -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
- result = New_inst_a(cname=children[0], attrs=a[0] if a else [], rels=None if not r else r)
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
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scrall
3
- Version: 0.10.1
3
+ Version: 0.11.0
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=Zlq30UhOiC7zQJvZcBhTgE3ZcYH1hpT6kjFn1fJiOL4,18
2
+ scrall/__main__.py,sha256=H5szTQUuBTrnCngyUv3EFj5eQyPY4j0NKf1q8DgK6E8,2187
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=KT2jTK1wTYn6afcXXaKvFgghtbwzQ7wntNPA3cGwSPY,7904
8
+ scrall/parse/visitor.py,sha256=wC9qIADxep_24NM90eFyMvCmKLUoitdfqff7HHNjDvM,58515
9
+ scrall-0.11.0.dist-info/licenses/LICENSE,sha256=kL0xVrwl2i3Pk9mQXAVAPANCTaLGGOsoXgvqW7TBs20,1072
10
+ scrall-0.11.0.dist-info/METADATA,sha256=YctIFwtG6wxzB94LUPNoYmgNpXHc1RbOyi3pW-N_2IA,7209
11
+ scrall-0.11.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
12
+ scrall-0.11.0.dist-info/entry_points.txt,sha256=2fHG6VXtqSTEZXadsBe7XCFaLm4t3V1pFuqzgWWjBgA,48
13
+ scrall-0.11.0.dist-info/top_level.txt,sha256=SWvpMyNNJlrMWpSsK5RUL40ivQxQpKPbL86VrvNIUAE,7
14
+ scrall-0.11.0.dist-info/RECORD,,
@@ -1,14 +0,0 @@
1
- scrall/__init__.py,sha256=cR9pg_1fMJtcBMpoLOfA4VEqNyk8i9EQW_DGQzd0WJw,18
2
- scrall/__main__.py,sha256=H5szTQUuBTrnCngyUv3EFj5eQyPY4j0NKf1q8DgK6E8,2187
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=07rAbmwCsA4NrS_HDPdSQ1oQkY3D0c7kEgOuYCyjU34,7864
8
- scrall/parse/visitor.py,sha256=K2iqx_2-bIdtQvf4WO8V8qVBjpd3BvAcyXlIYGuCtUo,58071
9
- scrall-0.10.1.dist-info/licenses/LICENSE,sha256=kL0xVrwl2i3Pk9mQXAVAPANCTaLGGOsoXgvqW7TBs20,1072
10
- scrall-0.10.1.dist-info/METADATA,sha256=aruaJdyQG1ZjFYQf_6JdNQB8zCXPD6FMZSvRkyCBP7Q,7209
11
- scrall-0.10.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
12
- scrall-0.10.1.dist-info/entry_points.txt,sha256=2fHG6VXtqSTEZXadsBe7XCFaLm4t3V1pFuqzgWWjBgA,48
13
- scrall-0.10.1.dist-info/top_level.txt,sha256=SWvpMyNNJlrMWpSsK5RUL40ivQxQpKPbL86VrvNIUAE,7
14
- scrall-0.10.1.dist-info/RECORD,,