scrall 0.10.2__py3-none-any.whl → 0.12.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.
Potentially problematic release.
This version of scrall might be problematic. Click here for more details.
- scrall/__init__.py +1 -1
- scrall/parse/scrall.peg +2 -1
- scrall/parse/visitor.py +21 -5
- {scrall-0.10.2.dist-info → scrall-0.12.0.dist-info}/METADATA +1 -1
- scrall-0.12.0.dist-info/RECORD +14 -0
- scrall-0.10.2.dist-info/RECORD +0 -14
- {scrall-0.10.2.dist-info → scrall-0.12.0.dist-info}/WHEEL +0 -0
- {scrall-0.10.2.dist-info → scrall-0.12.0.dist-info}/entry_points.txt +0 -0
- {scrall-0.10.2.dist-info → scrall-0.12.0.dist-info}/licenses/LICENSE +0 -0
- {scrall-0.10.2.dist-info → scrall-0.12.0.dist-info}/top_level.txt +0 -0
scrall/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
version = "0.
|
|
1
|
+
version = "0.12.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
|
@@ -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')
|
|
@@ -1033,10 +1033,25 @@ class ScrallVisitor(PTNodeVisitor):
|
|
|
1033
1033
|
_logger.info(f" < {children}")
|
|
1034
1034
|
a = children.results.get('attr_init')
|
|
1035
1035
|
r = children.results.get('to_ref')
|
|
1036
|
-
|
|
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)
|
|
1037
1039
|
_logger.info(f" > {result}")
|
|
1038
1040
|
return result
|
|
1039
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
|
+
|
|
1040
1055
|
@classmethod
|
|
1041
1056
|
def visit_attr_init(cls, node, children):
|
|
1042
1057
|
"""
|
|
@@ -1440,10 +1455,11 @@ class ScrallVisitor(PTNodeVisitor):
|
|
|
1440
1455
|
iset = children.results.get('instance_set')
|
|
1441
1456
|
if iset:
|
|
1442
1457
|
p = children.results.get('projection')
|
|
1443
|
-
|
|
1458
|
+
o = children.results.get('op_chain')
|
|
1459
|
+
op_chain = None if not o else o[0]
|
|
1460
|
+
result = INST_PROJ_a(iset=iset[0], projection=None if not p else p[0], op_chain=op_chain)
|
|
1444
1461
|
_logger.info(f" > {result}")
|
|
1445
1462
|
return result
|
|
1446
|
-
# TODO: include opchain if supplied
|
|
1447
1463
|
|
|
1448
1464
|
result = children[:]
|
|
1449
1465
|
_logger.info(f" > {result}")
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
scrall/__init__.py,sha256=2v__VIL9u6ld--pEYwwedXsMCx05XIy6YCD1uio7Tl0,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=Tn_WCFw9_aS3slJXWhWouYuC4EekeXruHx9kUpr81_E,58591
|
|
9
|
+
scrall-0.12.0.dist-info/licenses/LICENSE,sha256=kL0xVrwl2i3Pk9mQXAVAPANCTaLGGOsoXgvqW7TBs20,1072
|
|
10
|
+
scrall-0.12.0.dist-info/METADATA,sha256=gYK0WFhEWX2WbKBkC648Lpi5x5UF3IR_rndXSDW6EII,7209
|
|
11
|
+
scrall-0.12.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
12
|
+
scrall-0.12.0.dist-info/entry_points.txt,sha256=2fHG6VXtqSTEZXadsBe7XCFaLm4t3V1pFuqzgWWjBgA,48
|
|
13
|
+
scrall-0.12.0.dist-info/top_level.txt,sha256=SWvpMyNNJlrMWpSsK5RUL40ivQxQpKPbL86VrvNIUAE,7
|
|
14
|
+
scrall-0.12.0.dist-info/RECORD,,
|
scrall-0.10.2.dist-info/RECORD
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
scrall/__init__.py,sha256=nvNgUDh4xb3OXHk2ZZlmcntg1VS76lYDKcSjWJ4f1_k,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=cfHbTkkXvgQLpeXhO8ymlgjDq1tsj_kpZcZ-ik2wClY,58112
|
|
9
|
-
scrall-0.10.2.dist-info/licenses/LICENSE,sha256=kL0xVrwl2i3Pk9mQXAVAPANCTaLGGOsoXgvqW7TBs20,1072
|
|
10
|
-
scrall-0.10.2.dist-info/METADATA,sha256=Op309rKrd12Gc9dQJ_CNNyKQ3NU1w5WgaZsnXhnwysE,7209
|
|
11
|
-
scrall-0.10.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
12
|
-
scrall-0.10.2.dist-info/entry_points.txt,sha256=2fHG6VXtqSTEZXadsBe7XCFaLm4t3V1pFuqzgWWjBgA,48
|
|
13
|
-
scrall-0.10.2.dist-info/top_level.txt,sha256=SWvpMyNNJlrMWpSsK5RUL40ivQxQpKPbL86VrvNIUAE,7
|
|
14
|
-
scrall-0.10.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|