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 "definition.h" 00010 00011 namespace risc { 00012 00013 class Event; 00014 class EventAndList; 00015 class EventOrList; 00016 class Function; 00017 class HierarchicalChannelInstance; 00018 class InOutPort; 00019 class InPort; 00020 class Instance; 00021 class ModuleInstance; 00022 class OutPort; 00023 class Port; 00024 class PrimitiveChannelInstance; 00025 class Variable; 00026 00027 typedef std::vector<Event*> EventVector; 00028 typedef std::vector<EventAndList*> EventAndListVector; 00029 typedef std::vector<EventOrList*> EventOrListVector; 00030 typedef std::vector<Function*> FunctionVector; 00031 typedef std::vector<HierarchicalChannelInstance*> 00032 HierarchicalChannelInstanceVector; 00033 typedef std::vector<InOutPort*> InOutPortVector; 00034 typedef std::vector<InPort*> InPortVector; 00035 typedef std::vector<ModuleInstance*> ModuleInstanceVector; 00036 typedef std::vector<OutPort*> OutPortVector; 00037 typedef std::vector<Port*> PortVector; 00038 typedef std::vector<PrimitiveChannelInstance*> PrimitiveChannelInstanceVector; 00039 typedef std::vector<Variable*> VariableVector; 00040 00041 class Class: public Definition { 00042 00043 public: 00044 00048 explicit Class(SgClassDefinition *ast_node, Type type); 00049 00050 ~Class(); 00051 00052 virtual void initialize_functions(); 00053 00058 void initialize_variables(); 00059 00065 SgFunctionDefinition* get_before_end_of_elaboration_definition(); 00066 00070 Variable* find_variable(SgVariableDefinition* var_def); 00071 00075 Port* find_port(SgVariableDefinition* var_def); 00076 00080 Event* find_event(SgVariableDefinition* var_def); 00081 00085 EventAndList* find_event_and_list(SgVariableDefinition* var_def); 00086 00090 EventOrList* find_event_or_list(SgVariableDefinition* var_def); 00091 00095 ModuleInstance* find_module(SgVariableDefinition* var_def); 00096 00100 PrimitiveChannelInstance* find_prim_channel(SgVariableDefinition* var_def); 00101 00105 HierarchicalChannelInstance* find_hier_channel(SgVariableDefinition* var_def); 00106 00111 Instance* find_instance(SgVariableDefinition* var_def); 00112 00117 SgClassDefinition* get_ast_node(); 00118 00122 std::string get_name(); 00123 00128 virtual std::string get_ast_type_name(); 00129 00133 EventVector events_; 00134 00138 EventAndListVector event_and_lists_; 00139 00143 EventOrListVector event_or_lists_; 00144 00148 VariableVector variables_; 00149 00153 InPortVector inports_; 00154 00158 InOutPortVector inoutports_; 00159 00163 OutPortVector outports_; 00164 00169 PrimitiveChannelInstanceVector sub_prim_channel_; 00170 00175 HierarchicalChannelInstanceVector sub_hier_channel_; 00176 00180 ModuleInstanceVector sub_modules_; 00181 00185 FunctionVector functions_; 00186 00187 private: 00191 Class(const Class &c); 00192 }; 00193 00194 00195 } // end of namespace risc 00196 00197 00198 #endif /* CLASS_H_INCLUDED_ */ 00199 00200 /* ex: set softtabstop=2 tabstop=2 shiftwidth=2 expandtab: */