ROSE  0.11.96.11
roseAdapter.h
1 #ifndef rose_adapter_INCLUDED
2 #define rose_adapter_INCLUDED
3 
4 
5 #include <iostream>
6 #include <string>
7 
8 #include "abstract_handle.h"
9 namespace AbstractHandle
10 {
13  {
14  public:
15  virtual ~roseNode(){};
16  void* getNode() const {return (void*) mNode; }
17  virtual std::string getConstructTypeName() const;
18  virtual bool hasSourcePos() const;
19  virtual bool hasName() const;
20  virtual std::string getName() const;
23  virtual AbstractHandle::abstract_node* findNode(std::string construct_type_str, AbstractHandle::specifier mspecifier) const;
24  virtual std::string getFileName() const;
25  virtual AbstractHandle::source_position getStartPos() const;
26  virtual AbstractHandle::source_position getEndPos() const;
27 
28  virtual size_t getNumbering (const AbstractHandle::abstract_node* another_node) const;
29  virtual std::string toString() const;
30  virtual bool operator == (const abstract_node & x) const;
31  ROSE_DLL_API friend roseNode* buildroseNode(SgNode* snode);
32  protected:
33  // hide constructors to enforce using the builder function instead
34  roseNode(){mNode =NULL;};
35  roseNode(SgNode* snode);
36  SgNode* mNode;
37  };
38 
40  ROSE_DLL_API roseNode* buildroseNode(SgNode* snode);
42  ROSE_DLL_API abstract_handle * buildAbstractHandle(SgNode* snode);
43 
45  ROSE_DLL_API SgLocatedNode* convertHandleToNode(const std::string& handle);
46 }
47 
48 #endif
SgLocatedNode
This class represents the notion of an expression or statement which has a position within the source...
Definition: Cxx_Grammar.h:74391
AbstractHandle::roseNode::getNumbering
virtual size_t getNumbering(const AbstractHandle::abstract_node *another_node) const
Get the ordering of the construct relative to another construct in a higher scope Numbering start fro...
AbstractHandle::roseNode::getConstructTypeName
virtual std::string getConstructTypeName() const
Get the construct' s type name, like function.
AbstractHandle::roseNode::findNode
virtual AbstractHandle::abstract_node * findNode(std::string construct_type_str, AbstractHandle::specifier mspecifier) const
Find a node of a given type, it also matches the specifier.
AbstractHandle::roseNode::getFileNode
virtual AbstractHandle::abstract_node * getFileNode() const
Get the start source file position of the construct Get the abstract node for file containing the cur...
AbstractHandle::buildroseNode
ROSE_DLL_API roseNode * buildroseNode(SgNode *snode)
A builder function to avoid duplicated building.
AbstractHandle::roseNode::getParent
virtual AbstractHandle::abstract_node * getParent() const
Get parent node, used for generate parent handle automatically.
AbstractHandle::buildAbstractHandle
ROSE_DLL_API abstract_handle * buildAbstractHandle(SgNode *snode)
A default builder function handles all details: file use name, others use numbering
AbstractHandle::roseNode::buildroseNode
ROSE_DLL_API friend roseNode * buildroseNode(SgNode *snode)
A builder function to avoid duplicated building.
AbstractHandle::roseNode::getName
virtual std::string getName() const
Get the name of the construct if it is named, like function name.
AbstractHandle::abstract_node
Users should provide a concrete node implementation especially a constructor/builder to avoid duplica...
Definition: abstract_handle.h:119
AbstractHandle::specifier
construct specifier could be used to specify a construct by name, position, numbering,...
Definition: abstract_handle.h:96
AbstractHandle::convertHandleToNode
ROSE_DLL_API SgLocatedNode * convertHandleToNode(const std::string &handle)
Convert an abstract handle string to a located node in AST.
SgNode
This class represents the base class for all IR nodes within Sage III.
Definition: Cxx_Grammar.h:6739
AbstractHandle::roseNode::getNode
void * getNode() const
Get the raw IR node associated with the current abstract node.
Definition: roseAdapter.h:16
AbstractHandle::roseNode::hasSourcePos
virtual bool hasSourcePos() const
If the node has meaningful line and column numbers associated with a file.
AbstractHandle::roseNode::hasName
virtual bool hasName() const
If the node has legal names defined by language standards.
AbstractHandle::roseNode
Concrete roseNode derived from abstract_node.
Definition: roseAdapter.h:12
AbstractHandle::source_position
source position information:
Definition: abstract_handle.h:59
AbstractHandle
String annotations to uniquely indicate any source constructs.
Definition: abstract_handle.h:56