scrall 0.6.2__py3-none-any.whl → 0.8.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 -3
- scrall/parse/visitor.py +28 -28
- {scrall-0.6.2.dist-info → scrall-0.8.0.dist-info}/METADATA +1 -1
- scrall-0.8.0.dist-info/RECORD +14 -0
- scrall-0.6.2.dist-info/RECORD +0 -14
- {scrall-0.6.2.dist-info → scrall-0.8.0.dist-info}/WHEEL +0 -0
- {scrall-0.6.2.dist-info → scrall-0.8.0.dist-info}/entry_points.txt +0 -0
- {scrall-0.6.2.dist-info → scrall-0.8.0.dist-info}/licenses/LICENSE +0 -0
- {scrall-0.6.2.dist-info → scrall-0.8.0.dist-info}/top_level.txt +0 -0
scrall/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
version = "0.
|
|
1
|
+
version = "0.8.0"
|
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
|
-
|
|
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')
|
|
@@ -69,9 +70,10 @@ Table_Def_a= namedtuple('Table_Def_a', 'name header')
|
|
|
69
70
|
Rename_a = namedtuple('Rename_a', 'from_name to_name')
|
|
70
71
|
Iteration_a = namedtuple('Iteration_a', 'order statement_set')
|
|
71
72
|
Migration_a = namedtuple('Migration_a','from_inst to_subclass')
|
|
73
|
+
Rank_a = namedtuple('Rank_a', "card extent")
|
|
72
74
|
|
|
73
75
|
|
|
74
|
-
|
|
76
|
+
rank_symbol = {'^+': "greatest", '^-': "least"}
|
|
75
77
|
|
|
76
78
|
table_op = {
|
|
77
79
|
'^': 'INTERSECT',
|
|
@@ -440,7 +442,7 @@ class ScrallVisitor(PTNodeVisitor):
|
|
|
440
442
|
if type(table).__name__ == 'INST_a':
|
|
441
443
|
last_comp = table.components[-1]
|
|
442
444
|
|
|
443
|
-
if last_comp and type(last_comp).__name__ == '
|
|
445
|
+
if last_comp and type(last_comp).__name__ == 'Criteria_Selection_a':
|
|
444
446
|
if s:
|
|
445
447
|
# We have two selection phrases. The first is terminating the instance set and the second is
|
|
446
448
|
# picked up as 's' above. We will take the first one and ignore the second,
|
|
@@ -801,7 +803,7 @@ class ScrallVisitor(PTNodeVisitor):
|
|
|
801
803
|
|
|
802
804
|
Name is the name of the operation
|
|
803
805
|
"""
|
|
804
|
-
_logger.info("operation =
|
|
806
|
+
_logger.info("operation = owner? '.' name supplied_params")
|
|
805
807
|
_logger.info(f' :: {node.value}')
|
|
806
808
|
|
|
807
809
|
_logger.info(f" < {children}")
|
|
@@ -811,7 +813,6 @@ class ScrallVisitor(PTNodeVisitor):
|
|
|
811
813
|
owner='implicit' if not owner else owner[0],
|
|
812
814
|
op_name=children.results['name'][0].name,
|
|
813
815
|
supplied_params=[] if not p else p[0]
|
|
814
|
-
# order=None if not o else symbol[o[0]]
|
|
815
816
|
)
|
|
816
817
|
_logger.info(f" > {result}")
|
|
817
818
|
return result
|
|
@@ -916,11 +917,29 @@ class ScrallVisitor(PTNodeVisitor):
|
|
|
916
917
|
return result
|
|
917
918
|
|
|
918
919
|
@classmethod
|
|
919
|
-
def
|
|
920
|
+
def visit_rank_selection(cls, node, children):
|
|
920
921
|
"""
|
|
921
|
-
|
|
922
|
+
CARD ', ' SP* RANKR name
|
|
922
923
|
"""
|
|
923
|
-
_logger.info(f"{node.rule_name} =
|
|
924
|
+
_logger.info(f"{node.rule_name} = CARD ', ' SP* RANKR name")
|
|
925
|
+
_logger.info(f">> {[k for k in children.results.keys()]}")
|
|
926
|
+
_logger.info(f' :: {node.value}')
|
|
927
|
+
|
|
928
|
+
_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)
|
|
934
|
+
_logger.info(f" > {result}")
|
|
935
|
+
return result
|
|
936
|
+
|
|
937
|
+
@classmethod
|
|
938
|
+
def visit_criteria_selection(cls, node, children):
|
|
939
|
+
"""
|
|
940
|
+
(CARD ', ' SP* scalar_expr) / CARD / scalar_expr
|
|
941
|
+
"""
|
|
942
|
+
_logger.info(f"{node.rule_name} = (CARD ', ' SP* scalar_expr) / CARD / scalar_expr")
|
|
924
943
|
_logger.info(f">> {[k for k in children.results.keys()]}")
|
|
925
944
|
_logger.info(f' :: {node.value}')
|
|
926
945
|
|
|
@@ -928,10 +947,8 @@ class ScrallVisitor(PTNodeVisitor):
|
|
|
928
947
|
explicit_card = children.results.get('CARD')
|
|
929
948
|
card = '*' if not explicit_card else explicit_card[0]
|
|
930
949
|
criteria = children.results.get('scalar_expr')
|
|
931
|
-
o = children.results.get('ORDER')
|
|
932
|
-
o = symbol[o[0]] if o else None
|
|
933
950
|
if criteria:
|
|
934
|
-
result =
|
|
951
|
+
result = Criteria_Selection_a(card=card, criteria=criteria[0])
|
|
935
952
|
else:
|
|
936
953
|
result = [card]
|
|
937
954
|
_logger.info(f" > {result}")
|
|
@@ -1415,23 +1432,6 @@ class ScrallVisitor(PTNodeVisitor):
|
|
|
1415
1432
|
_logger.info(f" > {result}")
|
|
1416
1433
|
return result
|
|
1417
1434
|
|
|
1418
|
-
# @classmethod
|
|
1419
|
-
# def visit_prefix_name(cls, node, children):
|
|
1420
|
-
# """
|
|
1421
|
-
# """
|
|
1422
|
-
# _logger.info("prefix_name = ORDER? name")
|
|
1423
|
-
# _logger.info(f' :: {node.value}')
|
|
1424
|
-
#
|
|
1425
|
-
# _logger.info(f" < {children}")
|
|
1426
|
-
# n = children.results['name'][0]
|
|
1427
|
-
# o = children.results.get('ORDER')
|
|
1428
|
-
# if o:
|
|
1429
|
-
# result = Order_name_a(order=symbol[o[0]], name=n)
|
|
1430
|
-
# else:
|
|
1431
|
-
# result = n
|
|
1432
|
-
# _logger.info(f" > {result}")
|
|
1433
|
-
# return result
|
|
1434
|
-
|
|
1435
1435
|
@classmethod
|
|
1436
1436
|
def visit_scalar_op(cls, node, children):
|
|
1437
1437
|
"""
|
|
@@ -0,0 +1,14 @@
|
|
|
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,,
|
scrall-0.6.2.dist-info/RECORD
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
scrall/__init__.py,sha256=fmzFeKnpl-IB3zWx_mBF05rLkVLMGL3qWsB1Khp7Bng,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=AimiudnxiMl1ZPdKA0F5LMigndakwLCBxCqN5ejgcRI,7614
|
|
8
|
-
scrall/parse/visitor.py,sha256=PJCN3zd57Sx9CSnYZvC14fKpHd6mfaiYTwCV6y0pzl0,55259
|
|
9
|
-
scrall-0.6.2.dist-info/licenses/LICENSE,sha256=kL0xVrwl2i3Pk9mQXAVAPANCTaLGGOsoXgvqW7TBs20,1072
|
|
10
|
-
scrall-0.6.2.dist-info/METADATA,sha256=JKGmUA24xItsYmPWNY6XORQ9-DOs6jNiVGrQYA5_7xk,7208
|
|
11
|
-
scrall-0.6.2.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
|
|
12
|
-
scrall-0.6.2.dist-info/entry_points.txt,sha256=2fHG6VXtqSTEZXadsBe7XCFaLm4t3V1pFuqzgWWjBgA,48
|
|
13
|
-
scrall-0.6.2.dist-info/top_level.txt,sha256=SWvpMyNNJlrMWpSsK5RUL40ivQxQpKPbL86VrvNIUAE,7
|
|
14
|
-
scrall-0.6.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|