Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pycomsdk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
com
pycomsdk
Commits
a60c531c
Commit
a60c531c
authored
5 years ago
by
Savva Golubitsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
saving
parent
194bdc23
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
6 deletions
+6
-6
graph.cpython-37.pyc
comsdk/__pycache__/graph.cpython-37.pyc
+0
-0
parser.cpython-37.pyc
comsdk/__pycache__/parser.cpython-37.pyc
+0
-0
graph.py
comsdk/graph.py
+4
-4
parser.py
comsdk/parser.py
+1
-1
test.adot
test.adot
+1
-1
No files found.
comsdk/__pycache__/graph.cpython-37.pyc
View file @
a60c531c
No preview for this file type
This diff is collapsed.
Click to expand it.
comsdk/__pycache__/parser.cpython-37.pyc
View file @
a60c531c
No preview for this file type
This diff is collapsed.
Click to expand it.
comsdk/graph.py
View file @
a60c531c
...
@@ -37,10 +37,10 @@ class Selector(Func):
...
@@ -37,10 +37,10 @@ class Selector(Func):
class
Transfer
:
class
Transfer
:
def
__init__
(
self
,
edge
,
output_state
,
index
=
None
):
def
__init__
(
self
,
edge
,
output_state
,
order
=
0
):
self
.
edge
=
edge
self
.
edge
=
edge
self
.
output_state
=
output_state
self
.
output_state
=
output_state
self
.
index
=
index
self
.
order
=
order
def
transfer
(
self
,
data
,
dynamic_keys_mapping
=
{}):
def
transfer
(
self
,
data
,
dynamic_keys_mapping
=
{}):
#print(dynamic_keys_mapping)
#print(dynamic_keys_mapping)
...
@@ -149,7 +149,7 @@ class State:
...
@@ -149,7 +149,7 @@ class State:
self
.
transfers
.
sort
(
key
=
__sort_by_order
)
self
.
transfers
.
sort
(
key
=
__sort_by_order
)
print
(
self
.
name
)
print
(
self
.
name
)
for
t
in
self
.
transfers
:
for
t
in
self
.
transfers
:
print
(
"
\t
"
,
t
.
edge
.
morph_name
)
print
(
"
\t
"
,
t
.
edge
.
pred_name
,
t
.
edge
.
morph_name
)
if
self
.
_proxy_state
is
not
None
:
if
self
.
_proxy_state
is
not
None
:
return
self
.
_proxy_state
.
idle_run
(
idle_run_type
,
branching_states_history
)
return
self
.
_proxy_state
.
idle_run
(
idle_run_type
,
branching_states_history
)
if
idle_run_type
==
IdleRunType
.
INIT
:
if
idle_run_type
==
IdleRunType
.
INIT
:
...
@@ -180,7 +180,7 @@ class State:
...
@@ -180,7 +180,7 @@ class State:
next_state
=
transfer
.
output_state
next_state
=
transfer
.
output_state
next_state
.
idle_run
(
idle_run_type
,
branching_states_history
+
[
next_state
.
name
])
next_state
.
idle_run
(
idle_run_type
,
branching_states_history
+
[
next_state
.
name
])
def
connect_to
(
self
,
term_state
,
edge
):
def
connect_to
(
self
,
term_state
,
edge
=
None
):
self
.
transfers
.
append
(
Transfer
(
edge
,
term_state
))
self
.
transfers
.
append
(
Transfer
(
edge
,
term_state
))
# edge.set_output_state(term_state)
# edge.set_output_state(term_state)
# self.output_edges.append(edge)
# self.output_edges.append(edge)
...
...
This diff is collapsed.
Click to expand it.
comsdk/parser.py
View file @
a60c531c
...
@@ -209,7 +209,7 @@ class Parser():
...
@@ -209,7 +209,7 @@ class Parser():
self
.
fact
.
add_state
(
right
[
0
])
self
.
fact
.
add_state
(
right
[
0
])
if
len
(
spl
)
==
4
:
if
len
(
spl
)
==
4
:
pr
=
self
.
_param_from_props
(
spl
[
3
])
pr
=
self
.
_param_from_props
(
spl
[
3
])
self
.
fact
.
add_connection
(
left
[
0
],
right
[
0
],
pr
.
morphism
)
self
.
fact
.
add_connection
(
left
[
0
],
right
[
0
],
pr
.
morphism
,
ordr
=
pr
.
order
if
pr
.
order
is
not
None
else
0
)
elif
len
(
spl
)
==
3
:
elif
len
(
spl
)
==
3
:
self
.
fact
.
add_connection
(
left
[
0
],
right
[
0
],
None
)
self
.
fact
.
add_connection
(
left
[
0
],
right
[
0
],
None
)
...
...
This diff is collapsed.
Click to expand it.
test.adot
View file @
a60c531c
...
@@ -37,6 +37,6 @@ digraph CODEOBJECT_GENERATOR
...
@@ -37,6 +37,6 @@ digraph CODEOBJECT_GENERATOR
CONTENT_SUBSTITUTED -> RESULT_SAVED [morphism=EDGE_5,comment="test comment to cpp"]
CONTENT_SUBSTITUTED -> RESULT_SAVED [morphism=EDGE_5,comment="test comment to cpp"]
// В зависимости от результата вычисления функции-SELECTOR осуществляется переход по
// В зависимости от результата вычисления функции-SELECTOR осуществляется переход по
//первому или второму ребру
//первому или второму ребру
RESULT_SAVED
, DUMP_CREATED -> __END__ [morphism=(EDGE_8, EDGE_9
)]
RESULT_SAVED
-> __END__ [morphism=EDGE_8, order=(40
)]
RESULT_SAVED -> INPUT_READY,FAKE,__END__ [selector=SELECTOR, morphism=(EDGE_6,EDGE_1,EDGE_7), order=(30,20,10)]
RESULT_SAVED -> INPUT_READY,FAKE,__END__ [selector=SELECTOR, morphism=(EDGE_6,EDGE_1,EDGE_7), order=(30,20,10)]
}
}
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment