Eclipse CDT
Pre-release 3.0

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

All Superinterfaces:
IASTNameOwner, IASTNode
All Known Subinterfaces:
IASTArrayDeclarator, IASTFieldDeclarator, IASTFunctionDeclarator, IASTStandardFunctionDeclarator, ICASTKnRFunctionDeclarator, ICPPASTFunctionDeclarator, ICPPASTFunctionTryBlockDeclarator

public interface IASTDeclarator
extends IASTNode, IASTNameOwner

Base interface for a declarator.


Field Summary
static ASTNodeProperty DECLARATOR_NAME
          DECLARATOR_NAME represents the relationship between an IASTDeclarator and an IASTName.
static IASTDeclarator[] EMPTY_DECLARATOR_ARRAY
          Constant - empty declarator array
static ASTNodeProperty INITIALIZER
          INITIALIZER represents the relationship between an IASTDeclarator and an IASTInitializer.
static ASTNodeProperty NESTED_DECLARATOR
          NESTED_DECLARATOR represents the relationship between an IASTDeclarator and a nested IASTDeclarator.
static ASTNodeProperty POINTER_OPERATOR
          POINTER_OPERATOR represents the relationship between an IASTDeclarator and an IASTPointerOperator.
 
Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTNode
EMPTY_NODE_ARRAY
 
Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTNameOwner
r_declaration, r_definition, r_reference, r_unclear
 
Method Summary
 void addPointerOperator(IASTPointerOperator operator)
          Adds a pointer operator to the declarator.
 IASTInitializer getInitializer()
          This is the optional initializer for this declarator.
 IASTName getName()
          This returns the name of the declarator.
 IASTDeclarator getNestedDeclarator()
          If the declarator is nested in parenthesis, this returns the declarator as found in those parenethesis.
 IASTPointerOperator[] getPointerOperators()
          This is the list of pointer operators applied to the type for the declarator.
 void setInitializer(IASTInitializer initializer)
          Set the optional initializer.
 void setName(IASTName name)
          Set the name of he declarator.
 void setNestedDeclarator(IASTDeclarator nested)
           
 
Methods inherited from interface org.eclipse.cdt.core.dom.ast.IASTNode
accept, getContainingFilename, getFileLocation, getNodeLocations, getParent, getPropertyInParent, getRawSignature, getTranslationUnit, setParent, setPropertyInParent
 
Methods inherited from interface org.eclipse.cdt.core.dom.ast.IASTNameOwner
getRoleForName
 

Field Detail

EMPTY_DECLARATOR_ARRAY

static final IASTDeclarator[] EMPTY_DECLARATOR_ARRAY
Constant - empty declarator array


POINTER_OPERATOR

static final ASTNodeProperty POINTER_OPERATOR
POINTER_OPERATOR represents the relationship between an IASTDeclarator and an IASTPointerOperator.


INITIALIZER

static final ASTNodeProperty INITIALIZER
INITIALIZER represents the relationship between an IASTDeclarator and an IASTInitializer.


NESTED_DECLARATOR

static final ASTNodeProperty NESTED_DECLARATOR
NESTED_DECLARATOR represents the relationship between an IASTDeclarator and a nested IASTDeclarator.


DECLARATOR_NAME

static final ASTNodeProperty DECLARATOR_NAME
DECLARATOR_NAME represents the relationship between an IASTDeclarator and an IASTName.

Method Detail

getPointerOperators

IASTPointerOperator[] getPointerOperators()
This is the list of pointer operators applied to the type for the declarator.

Returns:
array of IASTPointerOperator

addPointerOperator

void addPointerOperator(IASTPointerOperator operator)
Adds a pointer operator to the declarator.

Parameters:
operator - IASTPointerOperator to be added.

getNestedDeclarator

IASTDeclarator getNestedDeclarator()
If the declarator is nested in parenthesis, this returns the declarator as found in those parenethesis.

Returns:
the nested declarator or null

setNestedDeclarator

void setNestedDeclarator(IASTDeclarator nested)

getName

IASTName getName()
This returns the name of the declarator. If this is an abstract declarator, this will return an empty name.

Returns:
the name of the declarator

setName

void setName(IASTName name)
Set the name of he declarator.

Parameters:
name - IASTName

getInitializer

IASTInitializer getInitializer()
This is the optional initializer for this declarator.

Returns:
the initializer expression or null

setInitializer

void setInitializer(IASTInitializer initializer)
Set the optional initializer.

Parameters:
initializer - IASTInitializer

Eclipse CDT
Pre-release 3.0

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