Package org.eclipse.cdt.core.dom.ast
Interface INodeFactory
- All Known Subinterfaces:
ICNodeFactory
,ICPPNodeFactory
public interface INodeFactory
Factory for creating AST nodes. This interface contains factory methods
for nodes that are available for both C and C++.
Extending interfaces should use covariant return types where appropriate to
allow the construction of language-specific versions of certain nodes.
Most methods accept child nodes as parameters when constructing a new node.
For convenience it is always allowed to pass null for any of these parameters.
In this case the newly constructed node may be initialized using its
set() and add() methods instead.
Nodes created by this factory are not frozen, i.e. for any node created by this
factory the following holds
node.isFrozen() == false
.
None of the factory methods should return null.- Since:
- 5.1
- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
Method Summary
Modifier and TypeMethodDescriptionnewAlignmentSpecifier
(IASTExpression expression) newAlignmentSpecifier
(IASTTypeId typeId) newArrayDeclarator
(IASTName name) newArraySubscriptExpression
(IASTExpression arrayExpr, IASTExpression subscript) newASMDeclaration
(String assembly) newAttribute
(char[] name, IASTToken argumentClause) newBinaryExpression
(int op, IASTExpression expr1, IASTExpression expr2) newCastExpression
(int operator, IASTTypeId typeId, IASTExpression operand) newCompositeTypeSpecifier
(int key, IASTName name) newConditionalExpession
(IASTExpression condition, IASTExpression positive, IASTExpression negative) newDeclarationStatement
(IASTDeclaration declaration) newDeclarator
(IASTName name) newDoStatement
(IASTStatement body, IASTExpression condition) newElaboratedTypeSpecifier
(int kind, IASTName name) newEnumerator
(IASTName name, IASTExpression value) newEqualsInitializer
(IASTInitializerClause initClause) newExpressionStatement
(IASTExpression expression) newFieldDeclarator
(IASTName name, IASTExpression bitFieldSize) newFieldReference
(IASTName name, IASTExpression owner) newForStatement
(IASTStatement init, IASTExpression condition, IASTExpression iterationExpression, IASTStatement body) newFunctionCallExpression
(IASTExpression idExpr, IASTExpression argList) Deprecated.newFunctionCallExpression
(IASTExpression idExpr, IASTInitializerClause[] arguments) newFunctionDefinition
(IASTDeclSpecifier declSpecifier, IASTFunctionDeclarator declarator, IASTStatement bodyStatement) Deprecated.Use newGCCAttributeList() instead.newGNUCompoundStatementExpression
(IASTCompoundStatement compoundStatement) newGotoStatement
(IASTExpression expression) newGotoStatement
(IASTName name) newIdExpression
(IASTName name) newIfStatement
(IASTExpression condition, IASTStatement then, IASTStatement elseClause) org.eclipse.cdt.internal.core.dom.parser.IASTInactiveCompletionName
newInactiveCompletionName
(char[] name, IASTTranslationUnit ast) newInitializerExpression
(IASTExpression expression) Deprecated.Replaced bynewEqualsInitializer(IASTInitializerClause)
.newLabelStatement
(IASTName name, IASTStatement nestedStatement) newLiteralExpression
(int kind, String rep) newName()
Creates a "dummy" name using an empty char array.newName
(char[] name) newParameterDeclaration
(IASTDeclSpecifier declSpec, IASTDeclarator declarator) newProblem
(int id, char[] arg, boolean error) newProblemDeclaration
(IASTProblem problem) newProblemExpression
(IASTProblem problem) newProblemStatement
(IASTProblem problem) newReturnStatement
(IASTExpression retValue) newSimpleDeclaration
(IASTDeclSpecifier declSpecifier) newSwitchStatement
(IASTExpression controller, IASTStatement body) newToken
(int tokenType, char[] tokenImage) newTranslationUnit
(IScanner scanner) Creates a new translation unit that cooperates with the given scanner in order to track macro-expansions and location information.newTypeId
(IASTDeclSpecifier declSpecifier, IASTDeclarator declarator) newTypeIdExpression
(int operator, IASTTypeId typeId) newTypeIdInitializerExpression
(IASTTypeId typeId, IASTInitializer initializer) newUnaryExpression
(int operator, IASTExpression operand) newWhileStatement
(IASTExpression condition, IASTStatement body) void
setEndOffset
(IASTNode node, int endOffset) Provides the end offset for a node.void
setEndOffset
(IASTNode node, IASTNode endNode) Adjusts the end-offset of a node to be the same as the end-offset of a given node.void
setOffsets
(IASTNode node, int offset, int endOffset) Provides the offsets for a node.
-
Method Details
-
newAlignmentSpecifier
- Since:
- 5.10
-
newAlignmentSpecifier
- Since:
- 5.10
-
newArrayDeclarator
-
newArrayModifier
-
newArraySubscriptExpression
IASTArraySubscriptExpression newArraySubscriptExpression(IASTExpression arrayExpr, IASTExpression subscript) -
newASMDeclaration
-
newAttribute
- Since:
- 5.4
-
newBinaryExpression
-
newBreakStatement
IASTBreakStatement newBreakStatement() -
newCaseStatement
-
newCastExpression
-
newCompositeTypeSpecifier
-
newCompoundStatement
IASTCompoundStatement newCompoundStatement() -
newConditionalExpession
IASTConditionalExpression newConditionalExpession(IASTExpression condition, IASTExpression positive, IASTExpression negative) -
newContinueStatement
IASTContinueStatement newContinueStatement() -
newDeclarationStatement
-
newDeclarator
-
newDefaultStatement
IASTDefaultStatement newDefaultStatement() -
newDoStatement
-
newElaboratedTypeSpecifier
-
newEnumerationSpecifier
-
newEnumerator
-
newEqualsInitializer
- Since:
- 5.2
-
newExpressionList
IASTExpressionList newExpressionList() -
newExpressionStatement
-
newFieldDeclarator
-
newFieldReference
-
newForStatement
IASTForStatement newForStatement(IASTStatement init, IASTExpression condition, IASTExpression iterationExpression, IASTStatement body) -
newFunctionCallExpression
IASTFunctionCallExpression newFunctionCallExpression(IASTExpression idExpr, IASTInitializerClause[] arguments) - Since:
- 5.2
-
newFunctionDeclarator
-
newFunctionDefinition
IASTFunctionDefinition newFunctionDefinition(IASTDeclSpecifier declSpecifier, IASTFunctionDeclarator declarator, IASTStatement bodyStatement) -
newGCCAttributeList
IGCCASTAttributeList newGCCAttributeList()- Since:
- 6.0
-
newMSDeclspecList
IMSASTDeclspecList newMSDeclspecList()- Since:
- 6.6
-
newGNUCompoundStatementExpression
IGNUASTCompoundStatementExpression newGNUCompoundStatementExpression(IASTCompoundStatement compoundStatement) -
newGotoStatement
-
newGotoStatement
- Since:
- 5.8
-
newIdExpression
-
newIfStatement
IASTIfStatement newIfStatement(IASTExpression condition, IASTStatement then, IASTStatement elseClause) -
newInactiveCompletionName
org.eclipse.cdt.internal.core.dom.parser.IASTInactiveCompletionName newInactiveCompletionName(char[] name, IASTTranslationUnit ast) - Since:
- 6.3
- Restriction:
- This method is not intended to be referenced by clients.
-
newInitializerList
IASTInitializerList newInitializerList() -
newLabelStatement
-
newLiteralExpression
-
newName
IASTName newName()Creates a "dummy" name using an empty char array. -
newName
-
newName
- Since:
- 5.11
-
newNullStatement
IASTNullStatement newNullStatement() -
newParameterDeclaration
IASTParameterDeclaration newParameterDeclaration(IASTDeclSpecifier declSpec, IASTDeclarator declarator) -
newPointer
IASTPointer newPointer() -
newProblem
-
newProblemDeclaration
-
newProblemExpression
-
newProblemStatement
-
newReturnStatement
-
newSimpleDeclaration
-
newSimpleDeclSpecifier
IASTSimpleDeclSpecifier newSimpleDeclSpecifier() -
newSwitchStatement
-
newToken
- Since:
- 5.4
-
newTokenList
IASTTokenList newTokenList()- Since:
- 5.4
-
newTranslationUnit
Creates a new translation unit that cooperates with the given scanner in order to track macro-expansions and location information.- Parameters:
scanner
- the preprocessor the translation unit interacts with.- Since:
- 5.2
-
newTypedefNameSpecifier
-
newTypeId
-
newTypeIdExpression
-
newTypeIdInitializerExpression
IASTTypeIdInitializerExpression newTypeIdInitializerExpression(IASTTypeId typeId, IASTInitializer initializer) -
newUnaryExpression
-
newWhileStatement
-
setEndOffset
Adjusts the end-offset of a node to be the same as the end-offset of a given node.May throw an exception when either one of the nodes provided was not created by this factory. - Parameters:
node
- a node created by this factoryendNode
- a node created by this factory defining the end for the other node.- Since:
- 5.2
-
setEndOffset
Provides the end offset for a node. The offset is an artificial numbers that identifies the position of a node in the translation unit. It is not a file-offset. You can obtain a valid offset viaIToken.getEndOffset()
from a token provided by the scanner for this translation unit.May throw an exception when the node provided was not created by this factory. - Parameters:
node
- a node created by this factoryendOffset
- the end offset (exclusive) for the node- Since:
- 5.2
- See Also:
-
setOffsets
Provides the offsets for a node. The offsets are artificial numbers that identify the position of a node in the translation unit. They are not file-offsets. You can obtain valid offsets viaIToken.getOffset()
orIToken.getEndOffset()
from tokens provided by the scanner for this translation unit.May throw an exception when the node provided was not created by this factory. - Parameters:
node
- a node created by this factoryoffset
- the offset (inclusive) for the nodeendOffset
- the end offset (exclusive) for the node- Since:
- 5.2
- See Also:
-
newFunctionCallExpression
@Deprecated IASTFunctionCallExpression newFunctionCallExpression(IASTExpression idExpr, IASTExpression argList) Deprecated.- Restriction:
- This method is not intended to be referenced by clients.
-
newInitializerExpression
Deprecated.Replaced bynewEqualsInitializer(IASTInitializerClause)
.- Restriction:
- This method is not intended to be referenced by clients.
-
newGCCAttributeSpecifier
Deprecated.Use newGCCAttributeList() instead.- Since:
- 5.7
- Restriction:
- This method is not intended to be referenced by clients.
-
newFunctionCallExpression(IASTExpression, IASTInitializerClause[])