00001 #ifndef CLASS_H_INCLUDED_ 00002 #define CLASS_H_INCLUDED_ 00003 00004 #include <string> 00005 #include <vector> 00006 00007 #include "rose.h" 00008 00009 #include "object.h" 00010 #include "definition.h" 00011 00012 namespace risc { 00013 00014 class Event; 00015 class EventAndList; 00016 class EventOrList; 00017 class Function; 00018 class HierarchicalChannelInstance; 00019 class InOutPort; 00020 class InPort; 00021 class Instance; 00022 class Module; 00023 class ModuleInstance; 00024 class OutPort; 00025 class Port; 00026 class PrimitiveChannelInstance; 00027 class Variable; 00028 00029 typedef std::vector<Event*> EventVector; 00030 typedef std::vector<EventAndList*> EventAndListVector; 00031 typedef std::vector<EventOrList*> EventOrListVector; 00032 typedef std::vector<Function*> FunctionVector; 00033 typedef std::vector<HierarchicalChannelInstance*> 00034 HierarchicalChannelInstanceVector; 00035 typedef std::vector<InOutPort*> InOutPortVector; 00036 typedef std::vector<InPort*> InPortVector; 00037 typedef std::vector<ModuleInstance*> ModuleInstanceVector; 00038 typedef std::vector<OutPort*> OutPortVector; 00039 typedef std::vector<Port*> PortVector; 00040 typedef std::vector<PrimitiveChannelInstance*> PrimitiveChannelInstanceVector; 00041 typedef std::vector<Variable*> VariableVector; 00042 00043 class Class: public Definition { 00044 00045 public: 00046 00050 explicit Class(SgClassDefinition *ast_node, Type type); 00051 00052 ~Class(); 00053 00054 virtual void initialize_functions(); 00055 00060 void initialize_variables(); 00061 00067 SgFunctionDefinition* get_before_end_of_elaboration_definition(); 00068 00072 Variable* find_variable(SgVariableDefinition* var_def); 00073 00077 Port* find_port(SgVariableDefinition* var_def); 00078 00082 Event* find_event(SgVariableDefinition* var_def); 00083 00087 EventAndList* find_event_and_list(SgVariableDefinition* var_def); 00088 00092 EventOrList* find_event_or_list(SgVariableDefinition* var_def); 00093 00097 ModuleInstance* find_module(SgVariableDefinition* var_def); 00098 00102 PrimitiveChannelInstance* find_prim_channel(SgVariableDefinition* var_def); 00103 00107 HierarchicalChannelInstance* find_hier_channel(SgVariableDefinition* var_def); 00108 00113 Instance* find_instance(SgVariableDefinition* var_def); 00114 00119 SgClassDefinition* get_ast_node(); 00120 00124 std::string get_name(); 00125 00130 virtual std::string get_ast_type_name(); 00131 00135 EventVector events_; 00136 00140 EventAndListVector event_and_lists_; 00141 00145 EventOrListVector event_or_lists_; 00146 00150 VariableVector variables_; 00151 00155 InPortVector inports_; 00156 00160 InOutPortVector inoutports_; 00161 00165 OutPortVector outports_; 00166 00171 PrimitiveChannelInstanceVector sub_prim_channel_; 00172 00177 HierarchicalChannelInstanceVector sub_hier_channel_; 00178 00182 ModuleInstanceVector sub_modules_; 00183 00187 FunctionVector functions_; 00188 00194 void initialize_mapping(); 00195 00200 void analyze_port_mapping( 00201 Module *parent_module, ModuleInstance *sub_module_instance, Port *port); 00202 00203 00204 private: 00208 Class(const Class &c); 00209 }; 00210 00211 00212 } // end of namespace risc 00213 00214 00215 #endif /* CLASS_H_INCLUDED_ */ 00216 00217 /* ex: set softtabstop=2 tabstop=2 shiftwidth=2 expandtab: */