graphviz_main.anubis
1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
* Created by PyramIDE.
* User: フランスのトトロ aka (David RENÉ)
* Date: 05/04/2017
* Time: 20:33
* © Calexium
*/
read tools/basis.anubis
read tools/streams.anubis
read system/string.anubis
read densaku_lib/types/densaku.anubis
read generation/graphviz/graphviz_header.anubis
read generation/graphviz/graphviz_type.anubis
public define Maybe(One)
make_graphviz_types
(
DS_Type_File_Output_Dir out_dir,
DS_Type_File_Output_Name output_file_name,
List(DS_Type) types,
String destination_dir
)=
with final_destination_dir =
if out_dir is
{
auto then destination_dir + "types/generated/",
relative_path(path) then destination_dir + path + "/",
absolute_path(path) then path
},
with file_name = if output_file_name is
{
auto then final_destination_dir+"graphviz.gv",
name(_file_name) then final_destination_dir+to_lower(_file_name)+".gv",
},
if file(file_name, new) is
{
failure then println("can't create file "+file_name);failure,
success(fd) then
with strm = make_stream(fd),
if generate_graphviz_header(strm) is { failure then failure, success(_) then
if generate_graphviz_types(strm, types) is { failure then failure, success(_) then
if generate_graphviz_footer(strm) is { failure then failure, success(_) then
success(unique)
}}}
}
.