Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
buildsupport
Commits
26a93905
Commit
26a93905
authored
Jul 24, 2016
by
Maxime Perrotin
Browse files
Target creation of a neato graph
parent
c3ce914a
Changes
2
Show whitespace changes
Inline
Side-by-side
misc/iv.st
View file @
26a93905
group
taste
;
group
taste
;
interface_view
(
arrsFunctNames
)
:
:=
<<
interface_view
(
arrsFunctNames
,
arrsConnections
)
:
:=
<<
--
TASTE
Interface
View
#
TASTE
Interface
View
<
arrsFunctNames:
{
each
|
Function
<
each
>
};
separator=
"\n"
>
#
Save
this
output
to
file
.
dot
and
run
"neato file.dot -Tpng -o out.png"
>>
graph
interfaceview
{
<
arrsFunctNames:
{each| <each
>
[
shape
=
box
,
label
=
"<each>"
];};
separator=
"\n"
>
<
arrsConnections
;
separator=
"\n"
>
}
>>
connection
(
sFrom
,
sTo
,
arrsMessages
)
:
:=
<<
<
sFrom
>
->
<
sTo
>
[
label
=
"[<arrsMessages; separator="
,\
n
">]"
];
>>
misc/iv_stg.py
View file @
26a93905
#!/usr/bin/env python2
#!/usr/bin/env python2
import
iv
from
collections
import
defaultdict
import
stringtemplate3
import
stringtemplate3
import
iv
STG
=
None
STG
=
None
...
@@ -20,6 +21,22 @@ tpl = new("interface_view")
...
@@ -20,6 +21,22 @@ tpl = new("interface_view")
tpl
[
'arrsFunctNames'
]
=
iv
.
functions
.
keys
()
tpl
[
'arrsFunctNames'
]
=
iv
.
functions
.
keys
()
connections
=
[]
# type: List[str]
for
fromName
,
content
in
iv
.
functions
.
viewitems
():
group
=
defaultdict
(
list
)
for
iName
,
iContent
in
content
[
'interfaces'
].
viewitems
():
if
iContent
[
'direction'
]
==
iv
.
RI
:
group
[
iContent
[
'distant_fv'
]].
append
(
iName
)
for
destName
,
destContent
in
group
.
viewitems
():
tplConn
=
new
(
"connection"
)
tplConn
[
'sFrom'
]
=
fromName
tplConn
[
'sTo'
]
=
destName
tplConn
[
'arrsMessages'
]
=
destContent
connections
.
append
(
str
(
tplConn
))
tpl
[
'arrsConnections'
]
=
connections
print
str
(
tpl
).
encode
(
'latin1'
)
print
str
(
tpl
).
encode
(
'latin1'
)
...
...
Write
Preview
Supports
Markdown
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