scrall 0.6.1__py3-none-any.whl → 0.7.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 +4 -5
- scrall/parse/visitor.py +12 -37
- {scrall-0.6.1.dist-info → scrall-0.7.0.dist-info}/METADATA +1 -1
- scrall-0.7.0.dist-info/RECORD +14 -0
- {scrall-0.6.1.dist-info → scrall-0.7.0.dist-info}/WHEEL +1 -1
- scrall-0.6.1.dist-info/RECORD +0 -14
- {scrall-0.6.1.dist-info → scrall-0.7.0.dist-info}/entry_points.txt +0 -0
- {scrall-0.6.1.dist-info → scrall-0.7.0.dist-info}/licenses/LICENSE +0 -0
- {scrall-0.6.1.dist-info → scrall-0.7.0.dist-info}/top_level.txt +0 -0
scrall/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
version = "0.
|
|
1
|
+
version = "0.7.0"
|
scrall/parse/scrall.peg
CHANGED
|
@@ -75,7 +75,7 @@ INST_ASSIGN = '.=' / '..='
|
|
|
75
75
|
|
|
76
76
|
// Synchronous call action (method or ee operation)
|
|
77
77
|
call = instance_set op_chain? // Post-parse verify that last element is an operation, otherwise invalid call
|
|
78
|
-
operation =
|
|
78
|
+
operation = owner? '.' name supplied_params
|
|
79
79
|
owner = name
|
|
80
80
|
supplied_params = '(' SP* (param (',' SP+ param)*)? SP* ')'
|
|
81
81
|
param = (name SP* ':' SP*)? scalar_expr // Comma above keeps scalar_expr from grabbing next param
|
|
@@ -91,11 +91,11 @@ output_flow = OUTPUT SP+ scalar_expr
|
|
|
91
91
|
OUTPUT = '=>>'
|
|
92
92
|
|
|
93
93
|
// Instance set
|
|
94
|
-
instance_set = new_instance / ((operation /
|
|
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* scalar_expr) / CARD / scalar_expr
|
|
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'
|
|
@@ -136,7 +136,6 @@ scalar_chain = (ITS op_chain) / ((scalar_source / instance_set projection?) op_c
|
|
|
136
136
|
scalar_source = type_selector / input_param
|
|
137
137
|
op_chain = ('.' (scalar_op / name))*
|
|
138
138
|
value = TRUE / FALSE / enum_value
|
|
139
|
-
prefix_name = ORDER? name
|
|
140
139
|
scalar_op = name supplied_params
|
|
141
140
|
|
|
142
141
|
// name of type and name of value selected
|
scrall/parse/visitor.py
CHANGED
|
@@ -10,13 +10,13 @@ _logger = logging.getLogger(__name__)
|
|
|
10
10
|
# and return in the visit result.
|
|
11
11
|
Supplied_Parameter_a = namedtuple('Supplied_Parameter_a', 'pname sval')
|
|
12
12
|
"""Parameter name and flow name pair for a set of supplied parameters"""
|
|
13
|
-
Op_a = namedtuple('Op_a', 'owner op_name supplied_params
|
|
13
|
+
Op_a = namedtuple('Op_a', 'owner op_name supplied_params')
|
|
14
14
|
Scalar_op_a = namedtuple('Scalar_op_a', 'name supplied_params')
|
|
15
15
|
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 criteria')
|
|
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',
|
|
@@ -792,6 +793,8 @@ class ScrallVisitor(PTNodeVisitor):
|
|
|
792
793
|
@classmethod
|
|
793
794
|
def visit_operation(cls, node, children):
|
|
794
795
|
"""
|
|
796
|
+
owner? '.' name supplied_params
|
|
797
|
+
|
|
795
798
|
The results of an operation can be ordered ascending, descending
|
|
796
799
|
The operation is invoked on the owner which may or may not be explicitly named
|
|
797
800
|
If the owner is implicit, it could be 'ME' (the executing instance) or an operation on a type
|
|
@@ -799,18 +802,16 @@ class ScrallVisitor(PTNodeVisitor):
|
|
|
799
802
|
|
|
800
803
|
Name is the name of the operation
|
|
801
804
|
"""
|
|
802
|
-
_logger.info("operation =
|
|
805
|
+
_logger.info("operation = owner? '.' name supplied_params")
|
|
803
806
|
_logger.info(f' :: {node.value}')
|
|
804
807
|
|
|
805
808
|
_logger.info(f" < {children}")
|
|
806
809
|
owner = children.results.get('owner')
|
|
807
|
-
o = children.results.get('ORDER')
|
|
808
810
|
p = children.results.get('supplied_params')
|
|
809
811
|
result = Op_a(
|
|
810
812
|
owner='implicit' if not owner else owner[0],
|
|
811
813
|
op_name=children.results['name'][0].name,
|
|
812
|
-
supplied_params=[] if not p else p[0]
|
|
813
|
-
order=None if not o else symbol[o[0]]
|
|
814
|
+
supplied_params=[] if not p else p[0]
|
|
814
815
|
)
|
|
815
816
|
_logger.info(f" > {result}")
|
|
816
817
|
return result
|
|
@@ -914,21 +915,10 @@ class ScrallVisitor(PTNodeVisitor):
|
|
|
914
915
|
_logger.info(f" > {result}")
|
|
915
916
|
return result
|
|
916
917
|
|
|
917
|
-
@classmethod
|
|
918
|
-
def visit_selection(cls, node, children):
|
|
919
|
-
"""
|
|
920
|
-
"""
|
|
921
|
-
_logger.info("selection = '(' select_phrase ')'")
|
|
922
|
-
_logger.info(f' :: {node.value}')
|
|
923
|
-
|
|
924
|
-
_logger.info(f" < {children}")
|
|
925
|
-
result = Selection_a(card=children[0][0], criteria=None if len(children[0]) < 2 else children[0][1])
|
|
926
|
-
_logger.info(f" > {result}")
|
|
927
|
-
return result
|
|
928
|
-
|
|
929
918
|
@classmethod
|
|
930
919
|
def visit_select_phrase(cls, node, children):
|
|
931
920
|
"""
|
|
921
|
+
(CARD RANKR? ',' SP* scalar_expr) / CARD / RANKR? scalar_expr
|
|
932
922
|
"""
|
|
933
923
|
_logger.info(f"{node.rule_name} = (CARD ',' SP* scalar_expr) / CARD / scalar_expr")
|
|
934
924
|
_logger.info(f">> {[k for k in children.results.keys()]}")
|
|
@@ -938,8 +928,10 @@ class ScrallVisitor(PTNodeVisitor):
|
|
|
938
928
|
explicit_card = children.results.get('CARD')
|
|
939
929
|
card = '*' if not explicit_card else explicit_card[0]
|
|
940
930
|
criteria = children.results.get('scalar_expr')
|
|
931
|
+
rankr = children.results.get('RANKR')
|
|
932
|
+
rankr_parse = rank_symbol[rankr[0]] if rankr else None # assign greatest or least
|
|
941
933
|
if criteria:
|
|
942
|
-
result =
|
|
934
|
+
result = Selection_a(card=card, rankr=rankr_parse, criteria=criteria[0])
|
|
943
935
|
else:
|
|
944
936
|
result = [card]
|
|
945
937
|
_logger.info(f" > {result}")
|
|
@@ -1423,23 +1415,6 @@ class ScrallVisitor(PTNodeVisitor):
|
|
|
1423
1415
|
_logger.info(f" > {result}")
|
|
1424
1416
|
return result
|
|
1425
1417
|
|
|
1426
|
-
@classmethod
|
|
1427
|
-
def visit_prefix_name(cls, node, children):
|
|
1428
|
-
"""
|
|
1429
|
-
"""
|
|
1430
|
-
_logger.info("prefix_name = ORDER? name")
|
|
1431
|
-
_logger.info(f' :: {node.value}')
|
|
1432
|
-
|
|
1433
|
-
_logger.info(f" < {children}")
|
|
1434
|
-
n = children.results['name'][0]
|
|
1435
|
-
o = children.results.get('ORDER')
|
|
1436
|
-
if o:
|
|
1437
|
-
result = Order_name_a(order=symbol[o[0]], name=n)
|
|
1438
|
-
else:
|
|
1439
|
-
result = n
|
|
1440
|
-
_logger.info(f" > {result}")
|
|
1441
|
-
return result
|
|
1442
|
-
|
|
1443
1418
|
@classmethod
|
|
1444
1419
|
def visit_scalar_op(cls, node, children):
|
|
1445
1420
|
"""
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
scrall/__init__.py,sha256=eMM1qiVgCAbooyX_s4EBP8LMyZO3wVeNG4NHWlR2mYo,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=8faLDiuYy-qQV0OOzCK7YWOP6ohnnqGsdYvzU4o-y84,7605
|
|
8
|
+
scrall/parse/visitor.py,sha256=fWkrbaPzqKTWVeDhpAINaqOG_2KjcWuw1s-Lexr1cwg,54793
|
|
9
|
+
scrall-0.7.0.dist-info/licenses/LICENSE,sha256=kL0xVrwl2i3Pk9mQXAVAPANCTaLGGOsoXgvqW7TBs20,1072
|
|
10
|
+
scrall-0.7.0.dist-info/METADATA,sha256=6KVpHn57q5ljNaA8QBthJjQZCYLB7js2AaTVDCF6eAU,7208
|
|
11
|
+
scrall-0.7.0.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
|
|
12
|
+
scrall-0.7.0.dist-info/entry_points.txt,sha256=2fHG6VXtqSTEZXadsBe7XCFaLm4t3V1pFuqzgWWjBgA,48
|
|
13
|
+
scrall-0.7.0.dist-info/top_level.txt,sha256=SWvpMyNNJlrMWpSsK5RUL40ivQxQpKPbL86VrvNIUAE,7
|
|
14
|
+
scrall-0.7.0.dist-info/RECORD,,
|
scrall-0.6.1.dist-info/RECORD
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
scrall/__init__.py,sha256=alLEMEr4ac6GYMcaCSbGl0sZCPgwmYRlRBjrToos_uI,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=5JqwBAta8O7AR6ORBb9ZewTX_wohpF7vgY8yNqLEhuE,7640
|
|
8
|
-
scrall/parse/visitor.py,sha256=gtEJpGG9JYTg4EwQ-S8He_09vYbmD1PerrpArfFWHTg,55437
|
|
9
|
-
scrall-0.6.1.dist-info/licenses/LICENSE,sha256=kL0xVrwl2i3Pk9mQXAVAPANCTaLGGOsoXgvqW7TBs20,1072
|
|
10
|
-
scrall-0.6.1.dist-info/METADATA,sha256=tjo8UlsS2Fi8cyIHQMHvEAxiknXosarToCU_50Tu9wI,7208
|
|
11
|
-
scrall-0.6.1.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
|
|
12
|
-
scrall-0.6.1.dist-info/entry_points.txt,sha256=2fHG6VXtqSTEZXadsBe7XCFaLm4t3V1pFuqzgWWjBgA,48
|
|
13
|
-
scrall-0.6.1.dist-info/top_level.txt,sha256=SWvpMyNNJlrMWpSsK5RUL40ivQxQpKPbL86VrvNIUAE,7
|
|
14
|
-
scrall-0.6.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|