Eclipse CDT
Pre-release 3.0

org.eclipse.cdt.core.dom.ast
Interface IASTNode

All Known Subinterfaces:
IASTArrayDeclarator, IASTArrayModifier, IASTArraySubscriptExpression, IASTASMDeclaration, IASTBinaryExpression, IASTBreakStatement, IASTCaseStatement, IASTCastExpression, IASTCompositeTypeSpecifier, IASTCompoundStatement, IASTConditionalExpression, IASTContinueStatement, IASTDeclaration, IASTDeclarationStatement, IASTDeclarator, IASTDeclSpecifier, IASTDefaultStatement, IASTDoStatement, IASTElaboratedTypeSpecifier, IASTEnumerationSpecifier, IASTEnumerationSpecifier.IASTEnumerator, IASTExpression, IASTExpressionList, IASTExpressionStatement, IASTFieldDeclarator, IASTFieldReference, IASTForStatement, IASTFunctionCallExpression, IASTFunctionDeclarator, IASTFunctionDefinition, IASTFunctionStyleMacroParameter, IASTGotoStatement, IASTIdExpression, IASTIfStatement, IASTInitializer, IASTInitializerExpression, IASTInitializerList, IASTLabelStatement, IASTLiteralExpression, IASTName, IASTNamedTypeSpecifier, IASTNullStatement, IASTParameterDeclaration, IASTPointer, IASTPointerOperator, IASTPreprocessorElifStatement, IASTPreprocessorElseStatement, IASTPreprocessorEndifStatement, IASTPreprocessorErrorStatement, IASTPreprocessorFunctionStyleMacroDefinition, IASTPreprocessorIfdefStatement, IASTPreprocessorIfndefStatement, IASTPreprocessorIfStatement, IASTPreprocessorIncludeStatement, IASTPreprocessorMacroDefinition, IASTPreprocessorObjectStyleMacroDefinition, IASTPreprocessorPragmaStatement, IASTPreprocessorStatement, IASTPreprocessorUndefStatement, IASTProblem, IASTProblemDeclaration, IASTProblemExpression, IASTProblemStatement, IASTProblemTypeId, IASTReturnStatement, IASTSimpleDeclaration, IASTSimpleDeclSpecifier, IASTStandardFunctionDeclarator, IASTStatement, IASTSwitchStatement, IASTTranslationUnit, IASTTypeId, IASTTypeIdExpression, IASTUnaryExpression, IASTWhileStatement, ICASTArrayDesignator, ICASTArrayModifier, ICASTCompositeTypeSpecifier, ICASTDeclSpecifier, ICASTDesignatedInitializer, ICASTDesignator, ICASTElaboratedTypeSpecifier, ICASTEnumerationSpecifier, ICASTFieldDesignator, ICASTKnRFunctionDeclarator, ICASTPointer, ICASTSimpleDeclSpecifier, ICASTTypedefNameSpecifier, ICASTTypeIdInitializerExpression, ICPPASTBinaryExpression, ICPPASTCastExpression, ICPPASTCatchHandler, ICPPASTCompositeTypeSpecifier, ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier, ICPPASTConstructorChainInitializer, ICPPASTConstructorInitializer, ICPPASTConversionName, ICPPASTDeclSpecifier, ICPPASTDeleteExpression, ICPPASTElaboratedTypeSpecifier, ICPPASTExplicitTemplateInstantiation, ICPPASTFieldReference, ICPPASTForStatement, ICPPASTFunctionDeclarator, ICPPASTFunctionTryBlockDeclarator, ICPPASTIfStatement, ICPPASTLinkageSpecification, ICPPASTLiteralExpression, ICPPASTNamedTypeSpecifier, ICPPASTNamespaceAlias, ICPPASTNamespaceDefinition, ICPPASTNewExpression, ICPPASTOperatorName, ICPPASTParameterDeclaration, ICPPASTPointerToMember, ICPPASTQualifiedName, ICPPASTReferenceOperator, ICPPASTSimpleDeclSpecifier, ICPPASTSimpleTypeConstructorExpression, ICPPASTSimpleTypeTemplateParameter, ICPPASTSwitchStatement, ICPPASTTemplateDeclaration, ICPPASTTemplatedTypeTemplateParameter, ICPPASTTemplateId, ICPPASTTemplateParameter, ICPPASTTemplateSpecialization, ICPPASTTranslationUnit, ICPPASTTryBlockStatement, ICPPASTTypeIdExpression, ICPPASTTypenameExpression, ICPPASTUnaryExpression, ICPPASTUsingDeclaration, ICPPASTUsingDirective, ICPPASTVisiblityLabel, ICPPASTWhileStatement, IGCCASTArrayRangeDesignator, IGCCASTSimpleDeclSpecifier, IGNUASTCompoundStatementExpression, IGNUASTTypeIdExpression, IGNUASTUnaryExpression, IGPPASTBinaryExpression, IGPPASTDeclSpecifier, IGPPASTExplicitTemplateInstantiation, IGPPASTPointer, IGPPASTPointerToMember, IGPPASTSimpleDeclSpecifier

public interface IASTNode

This is the root node in the physical AST. A physical node represents a chunk of text in the source program.


Field Summary
static IASTNode[] EMPTY_NODE_ARRAY
           
 
Method Summary
 boolean accept(ASTVisitor visitor)
          Abstract method to be overriden by all subclasses.
 String getContainingFilename()
          Lightweight check for understanding what file we are in.
 IASTFileLocation getFileLocation()
          Get the location of the node as a file.
 IASTNodeLocation[] getNodeLocations()
          Get the location of this node.
 IASTNode getParent()
          Get the parent node of this node in the tree.
 ASTNodeProperty getPropertyInParent()
          In order to properly understand the relationship between this child node and it's parent, a node property object is used.
 String getRawSignature()
          Returns the raw signature of the IASTNode before it is processed by the preprocessor.
 IASTTranslationUnit getTranslationUnit()
          Get the translation unit (master) node that is the ancestor of all nodes in this AST.
 void setParent(IASTNode node)
          Set the parent node of this node in the tree.
 void setPropertyInParent(ASTNodeProperty property)
          Set the parent property of the node.
 

Field Detail

EMPTY_NODE_ARRAY

static final IASTNode[] EMPTY_NODE_ARRAY
Method Detail

getTranslationUnit

IASTTranslationUnit getTranslationUnit()
Get the translation unit (master) node that is the ancestor of all nodes in this AST.

Returns:
IASTTranslationUnit

getNodeLocations

IASTNodeLocation[] getNodeLocations()
Get the location of this node. In cases not involving macro expansions, the IASTNodeLocation [] result will only have one element in it, and it will be an IASTFileLocation or subinterface. Where the node is completely generated within a macro expansion, IASTNodeLocation [] result will have one element in it, and it will be an IASTMacroExpansion. Nodes that span file context into a macro expansion (and potentially out of the macro expansion again) result in an IASTNodeLocation [] result that is of length > 1.

Returns:
IASTNodeLocation []

getFileLocation

IASTFileLocation getFileLocation()
Get the location of the node as a file.

Returns:
IASTFileLocation

getContainingFilename

String getContainingFilename()
Lightweight check for understanding what file we are in.

Returns:
String absolute path

getParent

IASTNode getParent()
Get the parent node of this node in the tree.

Returns:
the parent node of this node

setParent

void setParent(IASTNode node)
Set the parent node of this node in the tree.

Parameters:
node - IASTNode

getPropertyInParent

ASTNodeProperty getPropertyInParent()
In order to properly understand the relationship between this child node and it's parent, a node property object is used.

Returns:
ASTNodeProperty

setPropertyInParent

void setPropertyInParent(ASTNodeProperty property)
Set the parent property of the node.

Parameters:
property -

accept

boolean accept(ASTVisitor visitor)
Abstract method to be overriden by all subclasses. Necessary for visitation of the tree using an ASTVisitor.

Parameters:
visitor -
Returns:
continue on (true) or quit( false )

getRawSignature

String getRawSignature()
Returns the raw signature of the IASTNode before it is processed by the preprocessor. Example: #define ONE 1 int x=ONE; // getRawSignature() for this declaration would return "int x=ONE;"

Returns:
the raw signature of the IASTNode before it is processed by the preprocessor

Eclipse CDT
Pre-release 3.0

Copyright (c) IBM Corp. and others 2004. All Rights Reserved.