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 holdsnode.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
-
-
-
Method Detail
-
newAlignmentSpecifier
IASTAlignmentSpecifier newAlignmentSpecifier(IASTExpression expression)
- Since:
- 5.10
-
newAlignmentSpecifier
IASTAlignmentSpecifier newAlignmentSpecifier(IASTTypeId typeId)
- Since:
- 5.10
-
newArrayDeclarator
IASTArrayDeclarator newArrayDeclarator(IASTName name)
-
newArrayModifier
IASTArrayModifier newArrayModifier(IASTExpression expr)
-
newArraySubscriptExpression
IASTArraySubscriptExpression newArraySubscriptExpression(IASTExpression arrayExpr, IASTExpression subscript)
-
newASMDeclaration
IASTASMDeclaration newASMDeclaration(String assembly)
-
newAttribute
IASTAttribute newAttribute(char[] name, IASTToken argumentClause)
- Since:
- 5.4
-
newBinaryExpression
IASTBinaryExpression newBinaryExpression(int op, IASTExpression expr1, IASTExpression expr2)
-
newBreakStatement
IASTBreakStatement newBreakStatement()
-
newCaseStatement
IASTCaseStatement newCaseStatement(IASTExpression expr)
-
newCastExpression
IASTCastExpression newCastExpression(int operator, IASTTypeId typeId, IASTExpression operand)
-
newCompositeTypeSpecifier
IASTCompositeTypeSpecifier newCompositeTypeSpecifier(int key, IASTName name)
-
newCompoundStatement
IASTCompoundStatement newCompoundStatement()
-
newConditionalExpession
IASTConditionalExpression newConditionalExpession(IASTExpression condition, IASTExpression positive, IASTExpression negative)
-
newContinueStatement
IASTContinueStatement newContinueStatement()
-
newDeclarationStatement
IASTDeclarationStatement newDeclarationStatement(IASTDeclaration declaration)
-
newDeclarator
IASTDeclarator newDeclarator(IASTName name)
-
newDefaultStatement
IASTDefaultStatement newDefaultStatement()
-
newDoStatement
IASTDoStatement newDoStatement(IASTStatement body, IASTExpression condition)
-
newElaboratedTypeSpecifier
IASTElaboratedTypeSpecifier newElaboratedTypeSpecifier(int kind, IASTName name)
-
newEnumerationSpecifier
IASTEnumerationSpecifier newEnumerationSpecifier(IASTName name)
-
newEnumerator
IASTEnumerationSpecifier.IASTEnumerator newEnumerator(IASTName name, IASTExpression value)
-
newEqualsInitializer
IASTEqualsInitializer newEqualsInitializer(IASTInitializerClause initClause)
- Since:
- 5.2
-
newExpressionList
IASTExpressionList newExpressionList()
-
newExpressionStatement
IASTExpressionStatement newExpressionStatement(IASTExpression expression)
-
newFieldDeclarator
IASTFieldDeclarator newFieldDeclarator(IASTName name, IASTExpression bitFieldSize)
-
newFieldReference
IASTFieldReference newFieldReference(IASTName name, IASTExpression owner)
-
newForStatement
IASTForStatement newForStatement(IASTStatement init, IASTExpression condition, IASTExpression iterationExpression, IASTStatement body)
-
newFunctionCallExpression
IASTFunctionCallExpression newFunctionCallExpression(IASTExpression idExpr, IASTInitializerClause[] arguments)
- Since:
- 5.2
-
newFunctionDeclarator
IASTStandardFunctionDeclarator newFunctionDeclarator(IASTName name)
-
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
IASTGotoStatement newGotoStatement(IASTName name)
-
newGotoStatement
IASTStatement newGotoStatement(IASTExpression expression)
- Since:
- 5.8
-
newIdExpression
IASTIdExpression newIdExpression(IASTName name)
-
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
IASTLabelStatement newLabelStatement(IASTName name, IASTStatement nestedStatement)
-
newLiteralExpression
IASTLiteralExpression newLiteralExpression(int kind, String rep)
-
newName
IASTName newName()
Creates a "dummy" name using an empty char array.
-
newName
IASTName newName(char[] name)
-
newNullStatement
IASTNullStatement newNullStatement()
-
newParameterDeclaration
IASTParameterDeclaration newParameterDeclaration(IASTDeclSpecifier declSpec, IASTDeclarator declarator)
-
newPointer
IASTPointer newPointer()
-
newProblem
IASTProblem newProblem(int id, char[] arg, boolean error)
-
newProblemDeclaration
IASTProblemDeclaration newProblemDeclaration(IASTProblem problem)
-
newProblemExpression
IASTProblemExpression newProblemExpression(IASTProblem problem)
-
newProblemStatement
IASTProblemStatement newProblemStatement(IASTProblem problem)
-
newReturnStatement
IASTReturnStatement newReturnStatement(IASTExpression retValue)
-
newSimpleDeclaration
IASTSimpleDeclaration newSimpleDeclaration(IASTDeclSpecifier declSpecifier)
-
newSimpleDeclSpecifier
IASTSimpleDeclSpecifier newSimpleDeclSpecifier()
-
newSwitchStatement
IASTSwitchStatement newSwitchStatement(IASTExpression controller, IASTStatement body)
-
newToken
IASTToken newToken(int tokenType, char[] tokenImage)
- Since:
- 5.4
-
newTokenList
IASTTokenList newTokenList()
- Since:
- 5.4
-
newTranslationUnit
IASTTranslationUnit newTranslationUnit(IScanner scanner)
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
IASTNamedTypeSpecifier newTypedefNameSpecifier(IASTName name)
-
newTypeId
IASTTypeId newTypeId(IASTDeclSpecifier declSpecifier, IASTDeclarator declarator)
-
newTypeIdExpression
IASTTypeIdExpression newTypeIdExpression(int operator, IASTTypeId typeId)
-
newTypeIdInitializerExpression
IASTTypeIdInitializerExpression newTypeIdInitializerExpression(IASTTypeId typeId, IASTInitializer initializer)
-
newUnaryExpression
IASTUnaryExpression newUnaryExpression(int operator, IASTExpression operand)
-
newWhileStatement
IASTWhileStatement newWhileStatement(IASTExpression condition, IASTStatement body)
-
setEndOffset
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.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
void setEndOffset(IASTNode node, int endOffset)
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:
newTranslationUnit(IScanner)
-
setOffsets
void setOffsets(IASTNode node, int offset, int endOffset)
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:
newTranslationUnit(IScanner)
-
newFunctionCallExpression
@Deprecated IASTFunctionCallExpression newFunctionCallExpression(IASTExpression idExpr, IASTExpression argList)
Deprecated.- Restriction:
- This method is not intended to be referenced by clients.
-
newInitializerExpression
@Deprecated IASTInitializerExpression newInitializerExpression(IASTExpression expression)
Deprecated.Replaced bynewEqualsInitializer(IASTInitializerClause)
.- Restriction:
- This method is not intended to be referenced by clients.
-
newGCCAttributeSpecifier
@Deprecated IGCCASTAttributeSpecifier newGCCAttributeSpecifier()
Deprecated.Use newGCCAttributeList() instead.- Since:
- 5.7
- Restriction:
- This method is not intended to be referenced by clients.
-
-