00001 #ifndef VERTEX_PROPERTY_WRITER_H_INCLUDED_ 00002 #define VERTEX_PROPERTY_WRITER_H_INCLUDED_ 00003 00004 #include "rose.h" 00005 00006 #include "segment_graph.h" 00007 #include "../internal_representation/design.h" 00008 #include "../internal_representation/module_instance.h" 00009 #include "../internal_representation/port.h" 00010 #include "../internal_representation/object.h" 00011 #include "../tools/variable_helper.h" 00012 namespace risc { 00013 00014 namespace sg { 00015 00016 struct VertexPropertyWriter { 00017 00018 static bool print_read_write_access; 00019 00020 VertexPropertyWriter(Graph& graph); 00021 00022 template <class Vertex> 00023 void operator() (std::ostream &out, Vertex v) 00024 { 00025 Segment &seg = graph_[v]; 00026 if(PSG_MODE) { 00027 write_segment_PSG_mode(out, seg); 00028 } else if(print_read_write_access) { 00029 write_segment_RW_mode(out, seg); 00030 } else { 00031 write_segment(out, seg); 00032 } 00033 } 00034 00040 void write_segment(std::ostream &out, Segment &seg); 00041 00047 void write_segment_RW_mode(std::ostream &out, Segment &seg); 00048 00054 void write_segment_PSG_mode(std::ostream &out, Segment &seg); 00055 00060 static void replace_escape_characters(std::string &unparsed_stmt); 00061 00066 static std::string write_pcp(PortCallPath &pcp); 00067 00068 Graph& graph_; 00069 00070 friend std::ostream& operator<< (std::ostream &out, 00071 const VertexPropertyWriter &vpw) 00072 { 00073 return out; 00074 } 00075 }; 00076 00077 }; // end of namespace sg 00078 00079 }; // end of namespace risc 00080 00081 #endif /* VERTEX_PROPERTY_WRITER_H_INCLUDED_ */ 00082 00083 /* ex: set softtabstop=2 tabstop=2 shiftwidth=2 expandtab: */