scrall 0.2.14__py3-none-any.whl → 0.2.16__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/parser.py +6 -6
- scrall/parse/visitor.py +3 -2
- {scrall-0.2.14.dist-info → scrall-0.2.16.dist-info}/METADATA +1 -1
- scrall-0.2.16.dist-info/RECORD +14 -0
- scrall-0.2.14.dist-info/RECORD +0 -14
- {scrall-0.2.14.dist-info → scrall-0.2.16.dist-info}/LICENSE +0 -0
- {scrall-0.2.14.dist-info → scrall-0.2.16.dist-info}/WHEEL +0 -0
- {scrall-0.2.14.dist-info → scrall-0.2.16.dist-info}/entry_points.txt +0 -0
- {scrall-0.2.14.dist-info → scrall-0.2.16.dist-info}/top_level.txt +0 -0
scrall/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
version = "0.2.
|
|
1
|
+
version = "0.2.16"
|
scrall/parse/parser.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
""" parser.py """
|
|
2
2
|
|
|
3
3
|
from scrall.exceptions import ScrallGrammarFileOpen, ScrallParseError, ScrallInputFileEmpty, ScrallInputFileOpen
|
|
4
|
-
from scrall.parse.visitor import ScrallVisitor
|
|
4
|
+
from scrall.parse.visitor import ScrallVisitor, Execution_Unit_a, Output_Flow_a
|
|
5
5
|
from arpeggio import visit_parse_tree, NoMatch
|
|
6
6
|
from arpeggio.cleanpeg import ParserPEG
|
|
7
7
|
import os # For issuing system commands to generate diagnostic files
|
|
@@ -44,7 +44,7 @@ class ScrallParser:
|
|
|
44
44
|
pg_model_pdf = diagnostics_path / "peggrammar_parser_model.pdf"
|
|
45
45
|
|
|
46
46
|
@classmethod
|
|
47
|
-
def parse_file(cls, file_input: Path, debug=False) -> List:
|
|
47
|
+
def parse_file(cls, file_input: Path, debug=False) -> (List[Execution_Unit_a | Output_Flow_a], str):
|
|
48
48
|
"""
|
|
49
49
|
Read and save the file contents and options and then call the parser
|
|
50
50
|
|
|
@@ -74,7 +74,7 @@ class ScrallParser:
|
|
|
74
74
|
return cls.parse()
|
|
75
75
|
|
|
76
76
|
@classmethod
|
|
77
|
-
def parse_text(cls, scrall_text: str, debug=False) -> List:
|
|
77
|
+
def parse_text(cls, scrall_text: str, debug=False) -> (List[Execution_Unit_a | Output_Flow_a], str):
|
|
78
78
|
"""
|
|
79
79
|
Save options and call the parser
|
|
80
80
|
|
|
@@ -90,11 +90,11 @@ class ScrallParser:
|
|
|
90
90
|
return cls.parse()
|
|
91
91
|
|
|
92
92
|
@classmethod
|
|
93
|
-
def parse(cls) -> List:
|
|
93
|
+
def parse(cls) -> (List[Execution_Unit_a | Output_Flow_a], str):
|
|
94
94
|
"""
|
|
95
95
|
Parse a Scrall activity
|
|
96
96
|
|
|
97
|
-
:return: A list of parsed
|
|
97
|
+
:return: A list of parsed execution units and the input scrall text
|
|
98
98
|
"""
|
|
99
99
|
# Read the grammar file
|
|
100
100
|
try:
|
|
@@ -130,4 +130,4 @@ class ScrallParser:
|
|
|
130
130
|
# Comment this part out if you want to retain the dot files
|
|
131
131
|
cls.parse_tree_dot.unlink(True)
|
|
132
132
|
|
|
133
|
-
return result
|
|
133
|
+
return result, cls.scrall_text
|
scrall/parse/visitor.py
CHANGED
|
@@ -17,7 +17,7 @@ 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
|
Selection_a = namedtuple('Selection_a', 'card criteria')
|
|
20
|
-
Inst_Assignment_a = namedtuple('Inst_Assignment_a', 'lhs card rhs')
|
|
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')
|
|
23
23
|
"""Signal sent to trigger event at destination with optional supplied parameters"""
|
|
@@ -538,7 +538,8 @@ class ScrallVisitor(PTNodeVisitor):
|
|
|
538
538
|
return Inst_Assignment_a(
|
|
539
539
|
lhs=children.results['flow_output'][0],
|
|
540
540
|
card='1' if children.results['INST_ASSIGN'][0] == '.=' else 'M',
|
|
541
|
-
rhs=children.results['instance_set'][0]
|
|
541
|
+
rhs=children.results['instance_set'][0],
|
|
542
|
+
X=(node.position, node.position_end)
|
|
542
543
|
)
|
|
543
544
|
|
|
544
545
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
scrall/__init__.py,sha256=P2TYzpyotIK6-bM28IawZ5pVYMrjUYFYZYhrlvsETK0,18
|
|
2
|
+
scrall/__main__.py,sha256=8SqHhDqR9TXWo1dxGSFfcyEYUiRfXFHLwA5czKvzSa4,2027
|
|
3
|
+
scrall/exceptions.py,sha256=QU4mKLs7_ddGIznhh2HUpjb_PdPlxWZMMY_g0ELenSs,1764
|
|
4
|
+
scrall/log.conf,sha256=YfI9CXa3cPV3aTnEBcx4zyAyWrMK-sSS3agScma4n4I,827
|
|
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=svAItMAuGMa6edZ0hKY2eEr375UZ2jTyXh8c3bK8ynw,7335
|
|
8
|
+
scrall/parse/visitor.py,sha256=DUPRg73wLYVJwREb-uhPlNvA3qRwC4RkMTig4ZLz3w0,34781
|
|
9
|
+
scrall-0.2.16.dist-info/LICENSE,sha256=kL0xVrwl2i3Pk9mQXAVAPANCTaLGGOsoXgvqW7TBs20,1072
|
|
10
|
+
scrall-0.2.16.dist-info/METADATA,sha256=YZiWJvIj7ZO_5k9uwqZwKp8tnSetcNyFS7amzCBW72o,7192
|
|
11
|
+
scrall-0.2.16.dist-info/WHEEL,sha256=AtBG6SXL3KF_v0NxLf0ehyVOh0cold-JbJYXNGorC6Q,92
|
|
12
|
+
scrall-0.2.16.dist-info/entry_points.txt,sha256=2fHG6VXtqSTEZXadsBe7XCFaLm4t3V1pFuqzgWWjBgA,48
|
|
13
|
+
scrall-0.2.16.dist-info/top_level.txt,sha256=SWvpMyNNJlrMWpSsK5RUL40ivQxQpKPbL86VrvNIUAE,7
|
|
14
|
+
scrall-0.2.16.dist-info/RECORD,,
|
scrall-0.2.14.dist-info/RECORD
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
scrall/__init__.py,sha256=m3fpgP2mRcMyBYfbEq6eJe5Zjyq6pHEIVqIeCnJ7So4,18
|
|
2
|
-
scrall/__main__.py,sha256=8SqHhDqR9TXWo1dxGSFfcyEYUiRfXFHLwA5czKvzSa4,2027
|
|
3
|
-
scrall/exceptions.py,sha256=QU4mKLs7_ddGIznhh2HUpjb_PdPlxWZMMY_g0ELenSs,1764
|
|
4
|
-
scrall/log.conf,sha256=YfI9CXa3cPV3aTnEBcx4zyAyWrMK-sSS3agScma4n4I,827
|
|
5
|
-
scrall/parse/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
-
scrall/parse/parser.py,sha256=xl9zKuR52V18DzS_y_6dLwvnGmsmdJIUPPP-uiBGtXs,5024
|
|
7
|
-
scrall/parse/scrall.peg,sha256=svAItMAuGMa6edZ0hKY2eEr375UZ2jTyXh8c3bK8ynw,7335
|
|
8
|
-
scrall/parse/visitor.py,sha256=ic7UJpf5FqyIRickWRpG0i364Op0fd93jfHT2eqVB8o,34729
|
|
9
|
-
scrall-0.2.14.dist-info/LICENSE,sha256=kL0xVrwl2i3Pk9mQXAVAPANCTaLGGOsoXgvqW7TBs20,1072
|
|
10
|
-
scrall-0.2.14.dist-info/METADATA,sha256=mti7f9hn1gnhrC1hmk1lmYq6g6vT6Ue3wIruAAG2yOo,7192
|
|
11
|
-
scrall-0.2.14.dist-info/WHEEL,sha256=AtBG6SXL3KF_v0NxLf0ehyVOh0cold-JbJYXNGorC6Q,92
|
|
12
|
-
scrall-0.2.14.dist-info/entry_points.txt,sha256=2fHG6VXtqSTEZXadsBe7XCFaLm4t3V1pFuqzgWWjBgA,48
|
|
13
|
-
scrall-0.2.14.dist-info/top_level.txt,sha256=SWvpMyNNJlrMWpSsK5RUL40ivQxQpKPbL86VrvNIUAE,7
|
|
14
|
-
scrall-0.2.14.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|