3 # The LLVM Compiler Infrastructure
5 # This file is distributed under the University of Illinois Open Source
6 # License. See LICENSE.TXT for details.
8 ##===----------------------------------------------------------------------===##
10 # This script reads visualization data emitted by the static analyzer for
11 # display in Ubigraph.
13 ##===----------------------------------------------------------------------===##
19 print >> sys
.stderr
, 'ubiviz: ' + message
22 def StreamData(filename
):
30 if action
== 'vertex':
32 G
.new_vertex_w_id(vertex
)
33 for attribute
in data
[2:]:
34 G
.set_vertex_attribute(vertex
, attribute
[0], attribute
[1])
35 elif action
== 'edge':
38 edge
= G
.new_edge(src
,dst
)
39 for attribute
in data
[3:]:
40 G
.set_edge_attribute(edge
, attribute
[0], attribute
[1])
41 elif action
== "vertex_style":
44 G
.new_vertex_style_w_id(style_id
, parent_id
)
45 for attribute
in data
[3:]:
46 G
.set_vertex_style_attribute(style_id
, attribute
[0], attribute
[1])
47 elif action
== "vertex_style_attribute":
49 for attribute
in data
[2:]:
50 G
.set_vertex_style_attribute(style_id
, attribute
[0], attribute
[1])
51 elif action
== "change_vertex_style":
54 G
.change_vertex_style(vertex_id
,style_id
)
58 Error('no input files')
60 server
= xmlrpclib
.Server('http://127.0.0.1:20738/RPC2')
65 for x
in StreamData(arg
):
71 if __name__
== '__main__':