Eclipse CDT
Pre-release 3.0

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

Method Summary
 IASTArrayDeclarator newArrayDeclarator(IASTName name)
           
 IASTArrayModifier newArrayModifier(IASTExpression expr)
           
 IASTArraySubscriptExpression newArraySubscriptExpression(IASTExpression arrayExpr, IASTExpression subscript)
           
 IASTASMDeclaration newASMDeclaration(String assembly)
           
 IASTBinaryExpression newBinaryExpression(int op, IASTExpression expr1, IASTExpression expr2)
           
 IASTBreakStatement newBreakStatement()
           
 IASTCaseStatement newCaseStatement(IASTExpression expr)
           
 IASTCastExpression newCastExpression(int operator, IASTTypeId typeId, IASTExpression operand)
           
 IASTCompositeTypeSpecifier newCompositeTypeSpecifier(int key, IASTName name)
           
 IASTCompoundStatement newCompoundStatement()
           
 IASTConditionalExpression newConditionalExpession(IASTExpression expr1, IASTExpression expr2, IASTExpression expr3)
           
 IASTContinueStatement newContinueStatement()
           
 IASTDeclarationStatement newDeclarationStatement(IASTDeclaration declaration)
           
 IASTDeclarator newDeclarator(IASTName name)
           
 IASTDefaultStatement newDefaultStatement()
           
 IASTDoStatement newDoStatement(IASTStatement body, IASTExpression condition)
           
 IASTElaboratedTypeSpecifier newElaboratedTypeSpecifier(int kind, IASTName name)
           
 IASTEnumerationSpecifier newEnumerationSpecifier(IASTName name)
           
 IASTEnumerationSpecifier.IASTEnumerator newEnumerator(IASTName name, IASTExpression value)
           
 IASTExpressionList newExpressionList()
           
 IASTExpressionStatement newExpressionStatement(IASTExpression expression)
           
 IASTFieldDeclarator newFieldDeclarator(IASTName name, IASTExpression bitFieldSize)
           
 IASTFieldReference newFieldReference(IASTName name, IASTExpression owner)
           
 IASTForStatement newForStatement(IASTStatement init, IASTExpression condition, IASTExpression iterationExpression, IASTStatement body)
           
 IASTFunctionCallExpression newFunctionCallExpression(IASTExpression idExpr, IASTExpression argList)
           
 IASTStandardFunctionDeclarator newFunctionDeclarator(IASTName name)
           
 IASTFunctionDefinition newFunctionDefinition(IASTDeclSpecifier declSpecifier, IASTFunctionDeclarator declarator, IASTStatement bodyStatement)
           
 IGNUASTCompoundStatementExpression newGNUCompoundStatementExpression(IASTCompoundStatement compoundStatement)
           
 IASTGotoStatement newGotoStatement(IASTName name)
           
 IASTIdExpression newIdExpression(IASTName name)
           
 IASTIfStatement newIfStatement(IASTExpression condition, IASTStatement then, IASTStatement elseClause)
           
 IASTInitializerExpression newInitializerExpression(IASTExpression expression)
           
 IASTInitializerList newInitializerList()
           
 IASTLabelStatement newLabelStatement(IASTName name, IASTStatement nestedStatement)
           
 IASTLiteralExpression newLiteralExpression(int kind, String rep)
           
 IASTName newName()
          Creates a "dummy" name using an empty char array.
 IASTName newName(char[] name)
           
 IASTNullStatement newNullStatement()
           
 IASTParameterDeclaration newParameterDeclaration(IASTDeclSpecifier declSpec, IASTDeclarator declarator)
           
 IASTPointer newPointer()
           
 IASTProblem newProblem(int id, char[] arg, boolean error)
           
 IASTProblemDeclaration newProblemDeclaration(IASTProblem problem)
           
 IASTProblemExpression newProblemExpression(IASTProblem problem)
           
 IASTProblemStatement newProblemStatement(IASTProblem problem)
           
 IASTReturnStatement newReturnStatement(IASTExpression retValue)
           
 IASTSimpleDeclaration newSimpleDeclaration(IASTDeclSpecifier declSpecifier)
           
 IASTSimpleDeclSpecifier newSimpleDeclSpecifier()
           
 IASTSwitchStatement newSwitchStatement(IASTExpression controller, IASTStatement body)
           
 IASTTranslationUnit newTranslationUnit()
          Calling the method getASTNodeFactory() on the translation unit returned by this method will return the node factory that was used to create the IASTTranslationUnit.
 IASTNamedTypeSpecifier newTypedefNameSpecifier(IASTName name)
           
 IASTTypeId newTypeId(IASTDeclSpecifier declSpecifier, IASTDeclarator declarator)
           
 IASTTypeIdExpression newTypeIdExpression(int operator, IASTTypeId typeId)
           
 IASTTypeIdInitializerExpression newTypeIdInitializerExpression(IASTTypeId typeId, IASTInitializer initializer)
           
 IASTUnaryExpression newUnaryExpression(int operator, IASTExpression operand)
           
 IASTWhileStatement newWhileStatement(IASTExpression condition, IASTStatement body)
           
 

Method Detail

newName

IASTName newName()
Creates a "dummy" name using an empty char array.


newName

IASTName newName(char[] name)

newTranslationUnit

IASTTranslationUnit newTranslationUnit()
Calling the method getASTNodeFactory() on the translation unit returned by this method will return the node factory that was used to create the IASTTranslationUnit.


newLiteralExpression

IASTLiteralExpression newLiteralExpression(int kind,
                                           String rep)

newUnaryExpression

IASTUnaryExpression newUnaryExpression(int operator,
                                       IASTExpression operand)

newIdExpression

IASTIdExpression newIdExpression(IASTName name)

newArraySubscriptExpression

IASTArraySubscriptExpression newArraySubscriptExpression(IASTExpression arrayExpr,
                                                         IASTExpression subscript)

newFunctionCallExpression

IASTFunctionCallExpression newFunctionCallExpression(IASTExpression idExpr,
                                                     IASTExpression argList)

newExpressionList

IASTExpressionList newExpressionList()

newCastExpression

IASTCastExpression newCastExpression(int operator,
                                     IASTTypeId typeId,
                                     IASTExpression operand)

newBinaryExpression

IASTBinaryExpression newBinaryExpression(int op,
                                         IASTExpression expr1,
                                         IASTExpression expr2)

newConditionalExpession

IASTConditionalExpression newConditionalExpession(IASTExpression expr1,
                                                  IASTExpression expr2,
                                                  IASTExpression expr3)

newTypeIdInitializerExpression

IASTTypeIdInitializerExpression newTypeIdInitializerExpression(IASTTypeId typeId,
                                                               IASTInitializer initializer)

newLabelStatement

IASTLabelStatement newLabelStatement(IASTName name,
                                     IASTStatement nestedStatement)

newCaseStatement

IASTCaseStatement newCaseStatement(IASTExpression expr)

newDefaultStatement

IASTDefaultStatement newDefaultStatement()

newExpressionStatement

IASTExpressionStatement newExpressionStatement(IASTExpression expression)

newNullStatement

IASTNullStatement newNullStatement()

newCompoundStatement

IASTCompoundStatement newCompoundStatement()

newSwitchStatement

IASTSwitchStatement newSwitchStatement(IASTExpression controller,
                                       IASTStatement body)

newIfStatement

IASTIfStatement newIfStatement(IASTExpression condition,
                               IASTStatement then,
                               IASTStatement elseClause)

newWhileStatement

IASTWhileStatement newWhileStatement(IASTExpression condition,
                                     IASTStatement body)

newDoStatement

IASTDoStatement newDoStatement(IASTStatement body,
                               IASTExpression condition)

newForStatement

IASTForStatement newForStatement(IASTStatement init,
                                 IASTExpression condition,
                                 IASTExpression iterationExpression,
                                 IASTStatement body)

newGotoStatement

IASTGotoStatement newGotoStatement(IASTName name)

newContinueStatement

IASTContinueStatement newContinueStatement()

newBreakStatement

IASTBreakStatement newBreakStatement()

newReturnStatement

IASTReturnStatement newReturnStatement(IASTExpression retValue)

newDeclarationStatement

IASTDeclarationStatement newDeclarationStatement(IASTDeclaration declaration)

newTypeIdExpression

IASTTypeIdExpression newTypeIdExpression(int operator,
                                         IASTTypeId typeId)

newTypeId

IASTTypeId newTypeId(IASTDeclSpecifier declSpecifier,
                     IASTDeclarator declarator)

newDeclarator

IASTDeclarator newDeclarator(IASTName name)

newSimpleDeclaration

IASTSimpleDeclaration newSimpleDeclaration(IASTDeclSpecifier declSpecifier)

newInitializerExpression

IASTInitializerExpression newInitializerExpression(IASTExpression expression)

newInitializerList

IASTInitializerList newInitializerList()

newFunctionDefinition

IASTFunctionDefinition newFunctionDefinition(IASTDeclSpecifier declSpecifier,
                                             IASTFunctionDeclarator declarator,
                                             IASTStatement bodyStatement)

newFunctionDeclarator

IASTStandardFunctionDeclarator newFunctionDeclarator(IASTName name)

newASMDeclaration

IASTASMDeclaration newASMDeclaration(String assembly)

newProblemDeclaration

IASTProblemDeclaration newProblemDeclaration(IASTProblem problem)

newProblemStatement

IASTProblemStatement newProblemStatement(IASTProblem problem)

newProblemExpression

IASTProblemExpression newProblemExpression(IASTProblem problem)

newProblem

IASTProblem newProblem(int id,
                       char[] arg,
                       boolean error)

newEnumerationSpecifier

IASTEnumerationSpecifier newEnumerationSpecifier(IASTName name)

newEnumerator

IASTEnumerationSpecifier.IASTEnumerator newEnumerator(IASTName name,
                                                      IASTExpression value)

newElaboratedTypeSpecifier

IASTElaboratedTypeSpecifier newElaboratedTypeSpecifier(int kind,
                                                       IASTName name)

newArrayModifier

IASTArrayModifier newArrayModifier(IASTExpression expr)

newArrayDeclarator

IASTArrayDeclarator newArrayDeclarator(IASTName name)

newParameterDeclaration

IASTParameterDeclaration newParameterDeclaration(IASTDeclSpecifier declSpec,
                                                 IASTDeclarator declarator)

newFieldDeclarator

IASTFieldDeclarator newFieldDeclarator(IASTName name,
                                       IASTExpression bitFieldSize)

newSimpleDeclSpecifier

IASTSimpleDeclSpecifier newSimpleDeclSpecifier()

newGNUCompoundStatementExpression

IGNUASTCompoundStatementExpression newGNUCompoundStatementExpression(IASTCompoundStatement compoundStatement)

newPointer

IASTPointer newPointer()

newFieldReference

IASTFieldReference newFieldReference(IASTName name,
                                     IASTExpression owner)

newTypedefNameSpecifier

IASTNamedTypeSpecifier newTypedefNameSpecifier(IASTName name)

newCompositeTypeSpecifier

IASTCompositeTypeSpecifier newCompositeTypeSpecifier(int key,
                                                     IASTName name)

Eclipse CDT
Pre-release 3.0

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