scrall 0.5.0__py3-none-any.whl → 0.6.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/__main__.py +4 -1
- scrall/parse/scrall.peg +15 -13
- scrall/parse/visitor.py +21 -50
- {scrall-0.5.0.dist-info → scrall-0.6.1.dist-info}/METADATA +8 -7
- scrall-0.6.1.dist-info/RECORD +14 -0
- {scrall-0.5.0.dist-info → scrall-0.6.1.dist-info}/WHEEL +1 -1
- scrall-0.5.0.dist-info/RECORD +0 -14
- {scrall-0.5.0.dist-info → scrall-0.6.1.dist-info}/entry_points.txt +0 -0
- {scrall-0.5.0.dist-info → scrall-0.6.1.dist-info/licenses}/LICENSE +0 -0
- {scrall-0.5.0.dist-info → scrall-0.6.1.dist-info}/top_level.txt +0 -0
scrall/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
version = "0.
|
|
1
|
+
version = "0.6.1"
|
scrall/__main__.py
CHANGED
|
@@ -4,11 +4,14 @@ __main__.py
|
|
|
4
4
|
Scrall Parser
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
|
+
# System
|
|
7
8
|
import logging
|
|
8
9
|
import logging.config
|
|
9
10
|
import sys
|
|
10
11
|
import argparse
|
|
11
12
|
from pathlib import Path
|
|
13
|
+
|
|
14
|
+
# Scrall
|
|
12
15
|
from scrall import version
|
|
13
16
|
from scrall.parse.parser import ScrallParser
|
|
14
17
|
|
|
@@ -66,7 +69,7 @@ def main():
|
|
|
66
69
|
d = args.debug
|
|
67
70
|
result = ScrallParser.parse_file(file_input=fpath, debug=d)
|
|
68
71
|
|
|
69
|
-
logger.info("No problemo") # We didn't die on an exception, basically
|
|
72
|
+
# logger.info("No problemo") # We didn't die on an exception, basically
|
|
70
73
|
print("\nNo problemo")
|
|
71
74
|
|
|
72
75
|
|
scrall/parse/scrall.peg
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
activity = LINEWRAP* execution_unit* EOF
|
|
2
|
-
execution_unit = LINEWRAP*
|
|
3
|
-
output_flow = OUTPUT SP+ scalar_expr
|
|
4
|
-
OUTPUT = '=>>'
|
|
2
|
+
execution_unit = LINEWRAP* statement_set sequence_token? LINEWRAP+
|
|
5
3
|
statement_set = SP* sequenced_statement_set / component_statement_set
|
|
6
4
|
sequenced_statement_set = sequence_token* (block / statement)
|
|
7
5
|
component_statement_set = block / LINEWRAP* statement
|
|
8
6
|
block = SP* '{' execution_unit* '}'
|
|
9
|
-
statement = table_assignment / new_lineage / new_instance / update_ref / delete / migration / scalar_assignment / signal_action / switch / decision / inst_assignment / call / iteration
|
|
7
|
+
statement = table_assignment / new_lineage / new_instance / update_ref / delete / migration / scalar_assignment / signal_action / switch / decision / inst_assignment / call / iteration / output_flow
|
|
10
8
|
|
|
11
9
|
// Explicit sequence using control flow inputs and outputs
|
|
12
10
|
sequence_token = SP* '<' token_name '>' SP* // Named control flow
|
|
@@ -47,7 +45,7 @@ RENAME = '>>'
|
|
|
47
45
|
// Decision action
|
|
48
46
|
decision = scalar_expr SP* true_result false_result? // Control flow version of an if-then
|
|
49
47
|
true_result = DECISION_OP SP* component_statement_set
|
|
50
|
-
false_result = SP* FALSE_RESULT_OP SP* component_statement_set // Else
|
|
48
|
+
false_result = (LINEWRAP* / SP*) FALSE_RESULT_OP SP* component_statement_set // Else
|
|
51
49
|
FALSE_RESULT_OP = ':'
|
|
52
50
|
|
|
53
51
|
// Switch action
|
|
@@ -60,9 +58,8 @@ enum_value = '_' name // Scalar switch has enum value cases
|
|
|
60
58
|
DECISION_OP = '?'
|
|
61
59
|
|
|
62
60
|
// Signal action
|
|
63
|
-
signal_action =
|
|
61
|
+
signal_action = signal_spec SP+ (signal_dest / ee_dest)
|
|
64
62
|
signal = signal_spec SP+ (signal_dest / ee_dest)
|
|
65
|
-
signal_choice = scalar_expr SP* DECISION_OP (LINEWRAP? / SP+) signal_spec SP* SIGNAL_OP SP* '|' SP+ signal_spec SP* signal_dest
|
|
66
63
|
signal_spec = name supplied_params?
|
|
67
64
|
signal_dest = SIGNAL_OP (LINEWRAP / SP+) instance_set assigner_partition? (SP+ delay)?
|
|
68
65
|
ee_dest = ASYNCH SP* name
|
|
@@ -89,6 +86,10 @@ migration = instance_set? SP* '>>' SP* new_inst_init
|
|
|
89
86
|
// Iteration
|
|
90
87
|
iteration = '<<' SP* instance_set SP* '>>' SP* component_statement_set
|
|
91
88
|
|
|
89
|
+
// Output flow action
|
|
90
|
+
output_flow = OUTPUT SP+ scalar_expr
|
|
91
|
+
OUTPUT = '=>>'
|
|
92
|
+
|
|
92
93
|
// Instance set
|
|
93
94
|
instance_set = new_instance / ((operation / prefix_name / path) (reflexive_selection / selection / operation / path)*)
|
|
94
95
|
selection = '(' SP* select_phrase SP* ')'
|
|
@@ -108,13 +109,13 @@ attr_init = '(' SP* (attr_value_init (',' SP+ attr_value_init)* SP*)? ')' // all
|
|
|
108
109
|
attr_value_init = (name SP? ':' SP+ scalar_expr )*
|
|
109
110
|
update_ref = (instance_set SP+)? to_ref // relate or unrelated to me or explicit instance_set
|
|
110
111
|
to_ref = '&' rnum SP+ instance_set (',' SP+ instance_set)? // non-associative or associative reference
|
|
111
|
-
delete = '!*' SP* instance_set
|
|
112
|
+
delete = '!*' SP* instance_set (',' SP+ instance_set) // supports multi-delete transaction
|
|
112
113
|
|
|
113
114
|
// Scalar call
|
|
114
115
|
//scalar_call = scalar_expr
|
|
115
116
|
|
|
116
117
|
// math and boolean operator precedence
|
|
117
|
-
scalar_assignment = scalar_output_set SP* SCALAR_ASSIGN SP* scalar_expr projection?
|
|
118
|
+
scalar_assignment = scalar_output_set SP* SCALAR_ASSIGN SP* (scalar_expr projection?) (',' SP* scalar_expr projection?)*
|
|
118
119
|
scalar_output_set = flow_output (',' SP* flow_output)*
|
|
119
120
|
flow_output = name (TYPE_ASSIGN name)?
|
|
120
121
|
projection = '.' (name / '(' ( (ALL / (name (',' SP+ name)*) )? ')'))
|
|
@@ -139,7 +140,7 @@ prefix_name = ORDER? name
|
|
|
139
140
|
scalar_op = name supplied_params
|
|
140
141
|
|
|
141
142
|
// name of type and name of value selected
|
|
142
|
-
type_selector = name '[' SP*
|
|
143
|
+
type_selector = name '[' SP* selected_value? SP* ']'
|
|
143
144
|
|
|
144
145
|
reflexive_selection = HIPPITY_HOP scalar_expr (SP* '|' COMPARE '|')?
|
|
145
146
|
HIPPITY_HOP = FAR_HOP / NEAR_HOP
|
|
@@ -147,9 +148,9 @@ NEAR_HOP = '/~/'
|
|
|
147
148
|
FAR_HOP = '/~|'
|
|
148
149
|
|
|
149
150
|
SCALAR_ASSIGN = '='
|
|
150
|
-
OR = '
|
|
151
|
-
AND = '
|
|
152
|
-
NOT = '!' / '
|
|
151
|
+
OR = 'OR'
|
|
152
|
+
AND = 'AND' / ';' // ; shorthand for anding attr comparisons in a selection phrase
|
|
153
|
+
NOT = '!' / 'NOT'
|
|
153
154
|
EQUAL = '==' / '!=' / ':'
|
|
154
155
|
COMPARE = '>=' / '>' / '<=' / '<'
|
|
155
156
|
UNARY_MINUS = "-"
|
|
@@ -165,6 +166,7 @@ path = hop+ // path to some instance set
|
|
|
165
166
|
hop = '/' (rnum / name) // just a sequence of rels and phrase or class names
|
|
166
167
|
|
|
167
168
|
// Names
|
|
169
|
+
selected_value = r'[^[\]\s]+' // any non-whitespace character except square brackets
|
|
168
170
|
name = first_word (NAME_GLUE word)* // One word or a sequence of delimited words (name used for most model elements)
|
|
169
171
|
NAME_GLUE = r'[ _]' // delmits words within a name
|
|
170
172
|
rnum = r'O?R[1-9][0-9]*' // Relationship number (name used for relationships)
|
scrall/parse/visitor.py
CHANGED
|
@@ -29,7 +29,7 @@ Execution_Unit_a = namedtuple('Execution_Unit_a', 'statement_set output_token')
|
|
|
29
29
|
Seq_Statement_Set_a = namedtuple('Seq_Statement_Set_a', 'input_tokens statement block')
|
|
30
30
|
Comp_Statement_Set_a = namedtuple('Comp_Statement_Set_a', 'statement block')
|
|
31
31
|
Decision_a = namedtuple('Decision_a', 'input true_result false_result')
|
|
32
|
-
Delete_Action_a = namedtuple('Delete_Action_a', '
|
|
32
|
+
Delete_Action_a = namedtuple('Delete_Action_a', 'instance_sets')
|
|
33
33
|
Case_a = namedtuple('Case_a', 'enums comp_statement_set')
|
|
34
34
|
Switch_a = namedtuple('Switch_a', 'input_flow cases')
|
|
35
35
|
MATH_a = namedtuple('MATH_a', 'op operands')
|
|
@@ -166,14 +166,11 @@ class ScrallVisitor(PTNodeVisitor):
|
|
|
166
166
|
|
|
167
167
|
Every execution unit is terminated by a new line.
|
|
168
168
|
"""
|
|
169
|
-
_logger.info('
|
|
169
|
+
_logger.info('LINEWRAP* statement_set sequence_token? LINEWRAP+')
|
|
170
170
|
_logger.info(f' :: {node.value}')
|
|
171
171
|
_logger.info(f">> {[k for k in children.results.keys()]}")
|
|
172
172
|
|
|
173
173
|
_logger.info(f" < {children}")
|
|
174
|
-
oflow = getresult('output_flow', children)
|
|
175
|
-
if oflow:
|
|
176
|
-
return Output_Flow_a(oflow[0])
|
|
177
174
|
output_token = getresult('sequence_token', children)
|
|
178
175
|
st_set = getresult('statement_set', children)
|
|
179
176
|
result = Execution_Unit_a(output_token=output_token, statement_set=st_set)
|
|
@@ -641,21 +638,8 @@ class ScrallVisitor(PTNodeVisitor):
|
|
|
641
638
|
# """
|
|
642
639
|
# result = Asynch_a(*children)
|
|
643
640
|
|
|
644
|
-
# Signal action
|
|
645
641
|
@classmethod
|
|
646
642
|
def visit_signal_action(cls, node, children):
|
|
647
|
-
"""
|
|
648
|
-
"""
|
|
649
|
-
_logger.info("signal_action = signal_choice / signal")
|
|
650
|
-
_logger.info(f' :: {node.value}')
|
|
651
|
-
|
|
652
|
-
_logger.info(f" < {children}")
|
|
653
|
-
result = children[0]
|
|
654
|
-
_logger.info(f" > {result}")
|
|
655
|
-
return result
|
|
656
|
-
|
|
657
|
-
@classmethod
|
|
658
|
-
def visit_signal(cls, node, children):
|
|
659
643
|
"""
|
|
660
644
|
"""
|
|
661
645
|
_logger.info("signal = signal_spec (signal_dest / ee_dest)")
|
|
@@ -678,35 +662,6 @@ class ScrallVisitor(PTNodeVisitor):
|
|
|
678
662
|
_logger.info(f" > {result}")
|
|
679
663
|
return result
|
|
680
664
|
|
|
681
|
-
@classmethod
|
|
682
|
-
def visit_signal_choice(cls, node, children):
|
|
683
|
-
"""
|
|
684
|
-
scalar_expr DECISION_OP signal_spec ':' signal_spec signal_dest
|
|
685
|
-
"""
|
|
686
|
-
_logger.info("signal_choice = ")
|
|
687
|
-
_logger.info(f' :: {node.value}')
|
|
688
|
-
|
|
689
|
-
_logger.info(f" < {children}")
|
|
690
|
-
expr = children[0]
|
|
691
|
-
# Both signals in a choice always have the same destination and delay
|
|
692
|
-
true_signal = Signal_a(
|
|
693
|
-
event=children[1]['name'],
|
|
694
|
-
supplied_params=children[1]['params'],
|
|
695
|
-
dest=children[3]
|
|
696
|
-
)
|
|
697
|
-
false_signal = Signal_a(
|
|
698
|
-
event=children[2]['name'],
|
|
699
|
-
supplied_params=children[2]['params'],
|
|
700
|
-
dest=children[3]
|
|
701
|
-
)
|
|
702
|
-
result = Signal_Choice_a(
|
|
703
|
-
decision=expr,
|
|
704
|
-
true_signal=true_signal,
|
|
705
|
-
false_signal=false_signal,
|
|
706
|
-
)
|
|
707
|
-
_logger.info(f" > {result}")
|
|
708
|
-
return result
|
|
709
|
-
|
|
710
665
|
@classmethod
|
|
711
666
|
def visit_signal_spec(cls, node, children):
|
|
712
667
|
"""
|
|
@@ -888,7 +843,7 @@ class ScrallVisitor(PTNodeVisitor):
|
|
|
888
843
|
s = s if len(s) > 1 else s[0]
|
|
889
844
|
p = children.results.get('name')
|
|
890
845
|
if not p and not (isinstance(s, N_a) or isinstance(s, IN_a)):
|
|
891
|
-
_logger.error(f"
|
|
846
|
+
_logger.error(f"Parameter name not supplied with expression value: [{children.results}]")
|
|
892
847
|
raise ScrallMissingParameterName(children.results)
|
|
893
848
|
result = Supplied_Parameter_a(pname=s.name if not p else p[0].name, sval=s)
|
|
894
849
|
_logger.info(f" > {result}")
|
|
@@ -923,6 +878,21 @@ class ScrallVisitor(PTNodeVisitor):
|
|
|
923
878
|
_logger.info(f" > {result}")
|
|
924
879
|
return result
|
|
925
880
|
|
|
881
|
+
# Output flow
|
|
882
|
+
def visit_output_flow(cls, node, children):
|
|
883
|
+
"""
|
|
884
|
+
Final output of a synchronous activity (method, operation)
|
|
885
|
+
"""
|
|
886
|
+
_logger.info("output_flow = OUTPUT SP+ scalar_expr")
|
|
887
|
+
_logger.info(f' :: {node.value}')
|
|
888
|
+
|
|
889
|
+
_logger.info(f" < {children}")
|
|
890
|
+
|
|
891
|
+
result = Output_Flow_a(children[0])
|
|
892
|
+
_logger.info(f" > {result}")
|
|
893
|
+
return result
|
|
894
|
+
|
|
895
|
+
|
|
926
896
|
# Instance set
|
|
927
897
|
@classmethod
|
|
928
898
|
def visit_instance_set(cls, node, children):
|
|
@@ -1075,13 +1045,14 @@ class ScrallVisitor(PTNodeVisitor):
|
|
|
1075
1045
|
@classmethod
|
|
1076
1046
|
def visit_delete(cls, node, children):
|
|
1077
1047
|
"""
|
|
1048
|
+
'!*' SP* instance_set (',' SP+ instance_set)
|
|
1078
1049
|
"""
|
|
1079
|
-
_logger.info("delete = '!*' instance_set")
|
|
1050
|
+
_logger.info("delete = '!*' SP* instance_set (',' SP+ instance_set)")
|
|
1080
1051
|
_logger.info(f' :: {node.value}')
|
|
1081
1052
|
|
|
1082
1053
|
_logger.info(f" < {children}")
|
|
1083
1054
|
iset = children.results.get('instance_set')
|
|
1084
|
-
result = Delete_Action_a(
|
|
1055
|
+
result = Delete_Action_a(instance_sets=iset)
|
|
1085
1056
|
_logger.info(f" > {result}")
|
|
1086
1057
|
return result
|
|
1087
1058
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: scrall
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.1
|
|
4
4
|
Summary: Starr's Concise Relational Action Language - For Shlaer-Mellor Executable UML
|
|
5
5
|
Author-email: Leon Starr <leon_starr@modelint.com>
|
|
6
6
|
License: MIT License
|
|
@@ -35,13 +35,14 @@ Requires-Python: >=3.10
|
|
|
35
35
|
Description-Content-Type: text/markdown
|
|
36
36
|
License-File: LICENSE
|
|
37
37
|
Requires-Dist: Arpeggio
|
|
38
|
-
Requires-Dist: tomli
|
|
38
|
+
Requires-Dist: tomli; python_version < "3.11"
|
|
39
39
|
Provides-Extra: build
|
|
40
|
-
Requires-Dist: build
|
|
41
|
-
Requires-Dist: twine
|
|
40
|
+
Requires-Dist: build; extra == "build"
|
|
41
|
+
Requires-Dist: twine; extra == "build"
|
|
42
42
|
Provides-Extra: dev
|
|
43
|
-
Requires-Dist: bump2version
|
|
44
|
-
Requires-Dist: pytest
|
|
43
|
+
Requires-Dist: bump2version; extra == "dev"
|
|
44
|
+
Requires-Dist: pytest; extra == "dev"
|
|
45
|
+
Dynamic: license-file
|
|
45
46
|
|
|
46
47
|
# Scrall Action Language
|
|
47
48
|
Scrall = Starr's Concise Relational Action Language
|
|
@@ -0,0 +1,14 @@
|
|
|
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,,
|
scrall-0.5.0.dist-info/RECORD
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
scrall/__init__.py,sha256=fjcHqDN-iouz7HpvzS7gGbo-46C4mMUCzPkmDe2YCtk,17
|
|
2
|
-
scrall/__main__.py,sha256=5k_6-Z-BPbW2J1AJ98TWDpKu7r9Hcl7dIukqfEp5E38,2140
|
|
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=ouZd1BZcOdrtsjAPpsEREJ8-JEuMZNuUdxzTCLNwsYs,7546
|
|
8
|
-
scrall/parse/visitor.py,sha256=ijF8I3mbIdelgNMDy6pJ7fmsf6s-VMGfiz3ri7kPDNk,56354
|
|
9
|
-
scrall-0.5.0.dist-info/LICENSE,sha256=kL0xVrwl2i3Pk9mQXAVAPANCTaLGGOsoXgvqW7TBs20,1072
|
|
10
|
-
scrall-0.5.0.dist-info/METADATA,sha256=04J_uAmIYn2vHekmfl6LoxHF3sQl1ct5Wn15ZugS5-4,7191
|
|
11
|
-
scrall-0.5.0.dist-info/WHEEL,sha256=Xo9-1PvkuimrydujYJAjF7pCkriuXBpUPEjma1nZyJ0,92
|
|
12
|
-
scrall-0.5.0.dist-info/entry_points.txt,sha256=2fHG6VXtqSTEZXadsBe7XCFaLm4t3V1pFuqzgWWjBgA,48
|
|
13
|
-
scrall-0.5.0.dist-info/top_level.txt,sha256=SWvpMyNNJlrMWpSsK5RUL40ivQxQpKPbL86VrvNIUAE,7
|
|
14
|
-
scrall-0.5.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|