00001 #ifndef INSTANCE_TREE_H_INCLUDED_ 00002 #define INSTANCE_TREE_H_INCLUDED_ 00003 00004 #include "rose.h" 00005 00006 #include <vector> 00007 #include <list> 00008 #include <utility> 00009 00010 #include "variable.h" 00011 #include "class.h" 00012 #include "object.h" 00013 00014 namespace risc { 00015 00016 class InstanceTree { 00017 00018 public: 00019 InstanceTree(); 00020 00021 InstanceTree(const InstanceTree &other); 00022 00023 typedef std::pair<Class*, Object*> Element; 00024 typedef std::list<Element> Path; 00025 00032 InstanceTree get_real_mapped_variable(); 00033 00038 std::list<InstanceTree> find_all_instances_of(SgVariableDefinition *var_def); 00039 00044 InstanceTree get_parent(); 00045 00050 void print_instance_tree(); 00051 00056 Class* get_scope(); 00057 00062 Object* get_object(); 00063 00068 SgVariableSymbol* get_object_symbol(); 00069 00074 void get_all_ports(std::list<InstanceTree>& occurence); 00075 00080 void get_all_events(std::list<InstanceTree>& occurence); 00081 00086 Element pop_back(); 00087 00092 void push_back(Element ohs); 00093 00094 00095 Path path_; 00096 00097 bool operator==(const InstanceTree &ohs); 00098 00099 private: 00105 void recursive_tree_walk(std::list<InstanceTree>& occurence, 00106 SgVariableDefinition *var_def); 00107 00114 SgVariableSymbol* get_mapped_reference(SgVariableSymbol* reference, 00115 SgClassDefinition *base_class_def, 00116 SgClassDefinition *parent_class_def, 00117 SgVariableDefinition *parent_member); 00118 }; 00119 00120 } // end of namespace risc 00121 00122 #endif /* INSTANCE_TREE_H_INCLUDED_ */ 00123 00124 /* ex: set softtabstop=2 tabstop=2 shiftwidth=2 expandtab: */