SgIsOp
This class represents the physical equality (often called pointer equality) operator
Synopsis
Declared in <src/docs/mrdocs/ast_node_docs.h>
class SgIsOp;
Description
for languages that also define a content equality operator. This node is intended for use with Python, where it represents the "is" token. It should not be confused with the SgEqualityOp operator, which represents the "==" token in Python and is used for content equality.
Data members
#### SgNode::p_parent This is the pointer to the parent IR node in the AST. This is the pointer to the parent IR node. It is a valid pointer on all nodes that are traversed (SgExpressions, SgStatements, SgInitializedName, etc.) However it is not set on SgTypes and SgSymbols,both of which are shared internally. This pointer is mostly set in post processing of the Sage III AST, until this point it is not reliable.
Member functions
#### SgNode::copy(const SgCopyHelp & help ) const This function clones the current IR node object recursively or not, depending on the argument This function performs a copy based on the specification of the input parameter. The input parameter is used to determin which data members are copied by reference and which are copied by value. ‐ Param help: ‐ If this argument is of type SgTreeCopy, then the IR node is cloned recursively. If its of type SgShallowCopy only the first level of the IR node is copied, everything else is left pointing to the the original IR node's object's data members. ‐ Return: a pointer to the new clone. ‐ Internal: It appears the the copy functions don't set the parents of anything that they do a deep copy of! This can cause AST tests to fail. In particular some functions that require the parent pointers to be valid will return NULL pointers (e.g. SgInitializedName::get_declaration()). It might be that we should allow this to be done as part of the SgCopyHelp::clone function or perhaps another member function of SgCopyHelp would be useful for this support. It is not serious if the AST post processing is done since that will set any NULL pointers that are found within its traversal. ‐ Exception: none No exceptions are thrown by this function.
#### SgNode::SgNode() This is the constructor This constructor builds a SgNode, always used as a base class. All Sage III IR nodes are derived from this class. ‐ See also: Example:create an SgNode object
#### SgNode::~SgNode() This is the destructor. There is nothing to delete in this object.
#### SgNode::sage_class_name() const generates string representing the class name: (e.g. for SgNode returns "SgNode"). This function is useful for debugging and error reporting. It returns the name of the IR node. ‐ Deprecated: Use class_name() which returns a C++ string object. ‐ Return: a char* pointer to a C style string.
#### string SgNode::class_name() const generates string representing the class name: (e.g. for SgNode returns "SgNode"). This function is useful for debugging and error reporting. It returns the name of the IR node. ‐ Return: a C++ string object.
#### SgNode::variant() const Older version function returns enum value "NODE" This function is an older version of the variant function. This function is useful for debugging and error reporting. It returns the name of the IR node. ‐ Return: an int value. ‐ Deprecated: Use Tvariant() instead. Older enum values have inconsistant names and are being removed.
#### SgNode::getVariant() const Older version function returns enum value "NODE" This function is an older version of the variant function. This function is useful for debugging and error reporting. It returns the name of the IR node. ‐ Return: an int value. ‐ Deprecated: Use Tvariant() instead. Older enum values have inconsistant names and are being removed.
#### SgNode::variantT() const returns enum value "V_SgNode" This function is useful for debugging and error reporting. It returns the name of the IR node. ‐ Return: an enum value (type: VariantT). ‐ Deprecated: Use Tvariant() instead. Older enum values have inconsistant names and are being removed.
#### SgNode::get_isModified() const FOR INTERNAL USE All nodes in the AST contain a isModified flag. This flag can be set but this is typically an internal function used to track the updates to AST. ‐ Return: Returns bool; true if IR node has been modified.
#### SgNode::set_isModified(bool isModified) Acess function for isModified flag. This flag records if the current IR node has been modified. It is set to false after and ROSE front‐end processing.
#### SgNode::get_isVisited() const DOCS IN SgNode.docs: Access function for p_isVisited flag used previously by the AST traversals. ‐ Deprecated: This function is not used and will be removed. ‐ Return: Returns bool; true if previously visited within current AST traversal.
#### SgNode::set_isVisited(bool isVisited) Access function for p_isVisited flag used previously by the AST traversals. ‐ Deprecated: This function is not used and will be removed.
#### SgNode::isSgNode (SgNode *s) Cast function (from derived class to SgNode pointer). This functions returns a SgNode pointer for any input of a pointer to an object derived from a SgNode. ‐ Return: Returns valid pointer to SgNode if input is derived from a SgNode.
#### SgNode::isSgNode (const SgNode *s) Cast function (from derived class to SgNode pointer). This functions returns a SgNode pointer for any input of a pointer to an object derived from a SgNode. ‐ Return: Returns valid pointer to SgNode if input is derived from a SgNode.
#### SgNode::set_parent (SgNode *parent) Sets parent node for any IR node. The parent node in the AST can be set but this is typically an internal function used to build the AST. ‐ Param parent: ‐ Pointer to parent node to store within the current IR node. ‐ Return: returns void.
#### SgNode::get_parent() const Access function for parent node in AST. The parent node in the AST can be accessed, in general only the project node, symbols and types should be NULL. Since parent nodes are set within post processing (and using the ROSE AST traveral mechanism) the parents are guarenteed to match the traversal, and no other concept of what could be a parent within the AST (e.g a parent concept based on scope). Because the traversal is based on the source code layout, what is a parent is similarly based on the source code layout and not any concept of scope. Note that the scope of relavant IR nodes is stored explicitly in the AST, precisely because it is not always related to the layout of the source code (and thus not related to the concept of parent in the AST). ‐ Return: Returns pointer to SgNode
#### SgNode::unparseToString( SgUnparse_Info* info ) This function unparses the AST node (source code only, excluding comments and white space) ‐ Param info: is optional (used only to specify code generation options). This function is useful for converting AST nodes to strings as part of general debugging or the construction of other strings for use as input to the AST rewrite mechansims which accepts source code strings. See tutorial for examples of this. This function uses the SgUnparse_Info as an inherited attribute internally and using this attribute it will correctly handled many subtle details that will be ignored if the attribute is not provided. For example, the SgUnparse_Info can record if the statement is in a conditional and if so then the trailing ";" will be omitted in the generated code. See the SgUnparse_Info documentation for the numerous other internal settings that can effect the generated code. Because of these details, the unparseToString() function can not always be used to generate compiliable code. ‐ Return: Returns std::string
#### SgNode::unparseToCompleteString() This function unparses the AST node (including comments and white space) This function is a complement to the unparseToString() function and includes any associated comments and preprocessor control directives. Because C preprocessor control directive can be included string generated using this function may or may not be appropriate for use as input to the AST rewrite mechanism. ‐ Todo: This function needs a better name since it is unclear what the "complete" string is. ‐ Return: Returns std::string
#### SgNode::get_traversalSuccessorContainer() FOR INTERNAL USE within ROSE traverals mechanism only. This function builds and returns a copy of ordered container holding pointers to children of this node in a traversal. It is associated with the definition of a tree that is travered by the AST traversal mechanism; a tree that is embeded in the AST (which is a more general graph). This function is used within the implementation of the AST traversal and has a semantics may change in subtle ways that makes it difficult to use in user code. It can return unexpected data members and thus the order and the number of elements is unpredicable and subject to change. ‐ Warning: This function can return unexpected data members and thus the order and the number of elements is unpredicable and subject to change. ‐ Return: Returns ordered STL Container of pointers to children nodes in AST.
#### SgNode::get_traversalSuccessorNamesContainer() FOR INTERNAL USE within ROSE traverals mechanism only. This function builds and returns a copy of ordered container holding strings used to name data members that are traversed in the IR node. It is associated with the definition of a tree that is travered by the AST traversal mechanism; a tree that is embeded in the AST (which is a more general graph). This function is used within the implementation of the AST traversal and has a semantics may change in subtle ways that makes it difficult to use in user code. It can return unexpected data members and thus the order and the number of elements is unpredicable and subject to change. ‐ Warning: This function can return unexpected data members and thus the order and the number of elements is unpredicable and subject to change. Each string is a name of a member variable holding a pointer to a child in the AST. The names are the same as used in the generated enums for accessing attributes in a traversal. The order is the same in which they are traversed and the same in which the access enums are defined. Therefore this method can be used to get the corresponding name (string) of an access enum which allows to produce more meaningful messages for attribute computations. ‐ Return: Returns ordered STL container of names (strings) of access names to children nodes in AST.
#### SgNode::roseRTI () FOR INTERNAL USE Access to Runtime Type Information (RTI) for this IR nodes. This function provides runtime type information for accessing the structure of the current node. It is useful for generating code which would dump out or rebuild IR nodes. ‐ Return: Returns a RTIReturnType object (runtime type information).
Additional notes
Created with MrDocs