gcc config
[prop.git] / prop-src / visualize.cc
blob1469921f5053f45df01db56201700ae63601a0d8
1 ///////////////////////////////////////////////////////////////////////////////
2 // This file is generated automatically using Prop (version 2.3.6),
3 // last updated on Nov 2, 1999.
4 // The original source file is "visualize.pcc".
5 ///////////////////////////////////////////////////////////////////////////////
7 #line 1 "visualize.pcc"
8 //////////////////////////////////////////////////////////////////////////////
9 //
10 // This file implements the datatype definitions layout generator
11 // for visualizing datatype definitions using vcg.
13 //////////////////////////////////////////////////////////////////////////////
15 #include <stdarg.h>
16 #include <iostream>
17 #include <string.h>
18 #include "options.h"
19 #include "compiler.h"
20 #include "visualize.h"
22 //////////////////////////////////////////////////////////////////////////////
24 // Constructor and destructor for class PropVisualizer
26 //////////////////////////////////////////////////////////////////////////////
27 PropVisualizer::PropVisualizer()
28 : label_text(text_buffer,sizeof(text_buffer))
29 { set_stream(label_text); }
31 PropVisualizer::~PropVisualizer() {}
33 va_list PropVisualizer::printer(char fmt, va_list arg)
34 { bug("%LPropVisualizer::printer %%%c",(int)fmt);
35 return arg;
38 //////////////////////////////////////////////////////////////////////////////
40 // Method to make a label
42 //////////////////////////////////////////////////////////////////////////////
43 void PropVisualizer::add_label(const char * fmt, ...)
44 { va_list arg;
45 va_start (arg,fmt);
46 outv(fmt,arg);
47 va_end(arg);
50 //////////////////////////////////////////////////////////////////////////////
52 // Method to make a label.
54 //////////////////////////////////////////////////////////////////////////////
55 void PropVisualizer::make_label()
56 { label_text << std::ends;
58 label(text_buffer);
60 // reset buffer
61 //label_text.rdbuf()->seekpos(0);
62 label_text.seekp(0);
65 //////////////////////////////////////////////////////////////////////////////
67 // This method takes a stream and prints out all the definitions
68 // currently processed as Graph Description Language (GDL).
70 //////////////////////////////////////////////////////////////////////////////
71 void Compiler::print_definitions_as_GDL()
72 { PropVisualizer v;
74 const char * G = "Program definitions";
76 v . begin_graph(G);
78 ///////////////////////////////////////////////////////////////////////////
80 // Specify the layout format
82 ///////////////////////////////////////////////////////////////////////////
83 v . label(G) // the name of the graph
84 . display_edge_labels(true) // display labels on edges
85 . xspace(40) // x distance between nodes
86 . yspace(40) // y distance between nodes
87 . layoutalgorithm(VCG::minbackward) // minimize back edges
88 . color(VCG::lightblue) // default color
91 ///////////////////////////////////////////////////////////////////////////
93 // Layout datatype definitions
95 ///////////////////////////////////////////////////////////////////////////
96 v . visualize_datatype_definitions();
98 ///////////////////////////////////////////////////////////////////////////
100 // Layout type definitions
102 ///////////////////////////////////////////////////////////////////////////
104 ///////////////////////////////////////////////////////////////////////////
106 // Layout graph type definitions
108 ///////////////////////////////////////////////////////////////////////////
110 ///////////////////////////////////////////////////////////////////////////
112 // Finish constructing the graph and print out the entire GDL
114 ///////////////////////////////////////////////////////////////////////////
115 v . end_graph(G);
118 ///////////////////////////////////////////////////////////////////////////
120 // Finally output the graph
122 ///////////////////////////////////////////////////////////////////////////
123 { char vcg_file[256];
124 strcpy(vcg_file, options.file_prefix);
125 strcat(vcg_file, "vcg");
126 std::ostream * F = open_output_file(vcg_file);
127 msg("[Writing vcg output to %s]\n",vcg_file);
128 v . print_GDL_on(*F);
129 delete F;
132 #line 124 "visualize.pcc"
134 ------------------------------- Statistics -------------------------------
135 Merge matching rules = yes
136 Number of DFA nodes merged = 0
137 Number of ifs generated = 0
138 Number of switches generated = 0
139 Number of labels = 0
140 Number of gotos = 0
141 Adaptive matching = enabled
142 Fast string matching = disabled
143 Inline downcasts = enabled
144 --------------------------------------------------------------------------