scrall 0.7.0__py3-none-any.whl → 0.8.1__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 -3
- scrall/parse/visitor.py +31 -10
- {scrall-0.7.0.dist-info → scrall-0.8.1.dist-info}/METADATA +1 -1
- scrall-0.8.1.dist-info/RECORD +14 -0
- scrall-0.7.0.dist-info/RECORD +0 -14
- {scrall-0.7.0.dist-info → scrall-0.8.1.dist-info}/WHEEL +0 -0
- {scrall-0.7.0.dist-info → scrall-0.8.1.dist-info}/entry_points.txt +0 -0
- {scrall-0.7.0.dist-info → scrall-0.8.1.dist-info}/licenses/LICENSE +0 -0
- {scrall-0.7.0.dist-info → scrall-0.8.1.dist-info}/top_level.txt +0 -0
scrall/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
version = "0.
|
|
1
|
+
version = "0.8.1"
|
scrall/parse/scrall.peg
CHANGED
|
@@ -92,10 +92,11 @@ OUTPUT = '=>>'
|
|
|
92
92
|
|
|
93
93
|
// Instance set
|
|
94
94
|
instance_set = new_instance / ((operation / name / path) (reflexive_selection / selection / operation / path)*)
|
|
95
|
-
selection = '(' SP*
|
|
96
|
-
|
|
95
|
+
selection = '(' SP* (rank_selection / criteria_selection) SP* ')'
|
|
96
|
+
rank_selection = CARD ', ' SP* RANKR name
|
|
97
|
+
criteria_selection = (CARD ', ' SP* scalar_expr) / CARD / scalar_expr
|
|
97
98
|
CARD = '1' / '*'
|
|
98
|
-
RANKR = '
|
|
99
|
+
RANKR = '^+' / '^-'
|
|
99
100
|
IN = '^'
|
|
100
101
|
TRUE = 'TRUE'
|
|
101
102
|
FALSE = 'FALSE'
|
scrall/parse/visitor.py
CHANGED
|
@@ -16,7 +16,8 @@ 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
|
-
|
|
19
|
+
Rank_Selection_a = namedtuple('Rank_Selection_a', 'card rankr attr')
|
|
20
|
+
Criteria_Selection_a = namedtuple('Criteria_Selection_a', 'card criteria')
|
|
20
21
|
Inst_Assignment_a = namedtuple('Inst_Assignment_a', 'lhs card rhs X')
|
|
21
22
|
EE_Signal_a = namedtuple('EE_Signal_a', 'event supplied_params ee')
|
|
22
23
|
Signal_a = namedtuple('Signal_a', 'event supplied_params dest')
|
|
@@ -72,7 +73,8 @@ Migration_a = namedtuple('Migration_a','from_inst to_subclass')
|
|
|
72
73
|
Rank_a = namedtuple('Rank_a', "card extent")
|
|
73
74
|
|
|
74
75
|
|
|
75
|
-
rank_symbol = {'
|
|
76
|
+
rank_symbol = {'^+': "greatest", '^-': "least"}
|
|
77
|
+
card_symbol = {'1':'ONE', '*':'ALL'}
|
|
76
78
|
|
|
77
79
|
table_op = {
|
|
78
80
|
'^': 'INTERSECT',
|
|
@@ -441,7 +443,7 @@ class ScrallVisitor(PTNodeVisitor):
|
|
|
441
443
|
if type(table).__name__ == 'INST_a':
|
|
442
444
|
last_comp = table.components[-1]
|
|
443
445
|
|
|
444
|
-
if last_comp and type(last_comp).__name__ == '
|
|
446
|
+
if last_comp and type(last_comp).__name__ == 'Criteria_Selection_a':
|
|
445
447
|
if s:
|
|
446
448
|
# We have two selection phrases. The first is terminating the instance set and the second is
|
|
447
449
|
# picked up as 's' above. We will take the first one and ignore the second,
|
|
@@ -916,22 +918,41 @@ class ScrallVisitor(PTNodeVisitor):
|
|
|
916
918
|
return result
|
|
917
919
|
|
|
918
920
|
@classmethod
|
|
919
|
-
def
|
|
921
|
+
def visit_rank_selection(cls, node, children):
|
|
920
922
|
"""
|
|
921
|
-
|
|
923
|
+
CARD ', ' SP* RANKR name
|
|
922
924
|
"""
|
|
923
|
-
_logger.info(f"{node.rule_name} =
|
|
925
|
+
_logger.info(f"{node.rule_name} = CARD ', ' SP* RANKR name")
|
|
926
|
+
_logger.info(f">> {[k for k in children.results.keys()]}")
|
|
927
|
+
_logger.info(f' :: {node.value}')
|
|
928
|
+
|
|
929
|
+
_logger.info(f" < {children}")
|
|
930
|
+
card_parse = children.results['CARD'][0]
|
|
931
|
+
card = card_symbol[card_parse]
|
|
932
|
+
attr_parse = children.results['name'][0]
|
|
933
|
+
attr = attr_parse.name
|
|
934
|
+
rankr_parse = children.results['RANKR']
|
|
935
|
+
rankr = rank_symbol[rankr_parse[0]]
|
|
936
|
+
result = Rank_Selection_a(card=card, rankr=rankr, attr=attr)
|
|
937
|
+
_logger.info(f" > {result}")
|
|
938
|
+
return result
|
|
939
|
+
|
|
940
|
+
@classmethod
|
|
941
|
+
def visit_criteria_selection(cls, node, children):
|
|
942
|
+
"""
|
|
943
|
+
(CARD ', ' SP* scalar_expr) / CARD / scalar_expr
|
|
944
|
+
"""
|
|
945
|
+
_logger.info(f"{node.rule_name} = (CARD ', ' SP* scalar_expr) / CARD / scalar_expr")
|
|
924
946
|
_logger.info(f">> {[k for k in children.results.keys()]}")
|
|
925
947
|
_logger.info(f' :: {node.value}')
|
|
926
948
|
|
|
927
949
|
_logger.info(f" < {children}")
|
|
928
950
|
explicit_card = children.results.get('CARD')
|
|
929
|
-
|
|
951
|
+
card_parse = '*' if not explicit_card else explicit_card[0]
|
|
952
|
+
card = card_symbol[card_parse]
|
|
930
953
|
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
|
|
933
954
|
if criteria:
|
|
934
|
-
result =
|
|
955
|
+
result = Criteria_Selection_a(card=card, criteria=criteria[0])
|
|
935
956
|
else:
|
|
936
957
|
result = [card]
|
|
937
958
|
_logger.info(f" > {result}")
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
scrall/__init__.py,sha256=F8yK0zpmobQYrGifLZrnTOgdche7N90s0ylEBIq-eyI,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=hlcabsgc3K5qxntye2tbrDr4BfFeJJSoIDHSe4Nq0rg,55548
|
|
9
|
+
scrall-0.8.1.dist-info/licenses/LICENSE,sha256=kL0xVrwl2i3Pk9mQXAVAPANCTaLGGOsoXgvqW7TBs20,1072
|
|
10
|
+
scrall-0.8.1.dist-info/METADATA,sha256=o_8sWBElYyBIfdRPBqFXjWkj-tODulvYA5eWTng0aTw,7208
|
|
11
|
+
scrall-0.8.1.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
|
|
12
|
+
scrall-0.8.1.dist-info/entry_points.txt,sha256=2fHG6VXtqSTEZXadsBe7XCFaLm4t3V1pFuqzgWWjBgA,48
|
|
13
|
+
scrall-0.8.1.dist-info/top_level.txt,sha256=SWvpMyNNJlrMWpSsK5RUL40ivQxQpKPbL86VrvNIUAE,7
|
|
14
|
+
scrall-0.8.1.dist-info/RECORD,,
|
scrall-0.7.0.dist-info/RECORD
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
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,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|