forked from newlee/tequila
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcoll_viz.go
52 lines (42 loc) · 1.09 KB
/
coll_viz.go
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
51
52
package viz
import (
"strings"
)
func ParseColl(codeDir string, filter string) *FullGraph {
fullGraph = &FullGraph{
NodeList: make(map[string]string),
RelationList: make(map[string]*Relation),
}
codeDotFiles := codeDotFiles(codeDir, func(path string) bool {
return strings.HasSuffix(path, filter)
})
for _, codeDotfile := range codeDotFiles {
parseDotFile(codeDotfile)
}
return fullGraph
}
func ParseICallGraph(codeDir string, filter string) *FullGraph {
fullGraph = &FullGraph{
NodeList: make(map[string]string),
RelationList: make(map[string]*Relation),
}
codeDotFiles := codeDotFiles(codeDir, func(path string) bool {
return strings.HasSuffix(path, "_icgraph.dot") && strings.Contains(path, filter)
})
for _, codeDotfile := range codeDotFiles {
parseDotFile(codeDotfile)
}
return fullGraph
}
func ParseICallGraphStart() {
fullGraph = &FullGraph{
NodeList: make(map[string]string),
RelationList: make(map[string]*Relation),
}
}
func ParseICallGraphByBuffer(buf []byte) {
parseFromBuffer(buf)
}
func ParseICallGraphEnd() *FullGraph {
return fullGraph
}