Package org.eclipse.cdt.core.dom.ast.cpp
Interface ICPPASTIfStatement
- All Superinterfaces:
IASTAttributeOwner,IASTIfStatement,IASTNode,IASTStatement
The 'if' statement including the optional else clause.
- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.cdt.core.dom.ast.IASTNode
IASTNode.CopyStyle -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ASTNodePropertyINIT_STATEMENTrepresents the relationship between anICPPASTIfStatementand its nestedIASTStatement.Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTAttributeOwner
ATTRIBUTE, ATTRIBUTE_SPECIFIERFields inherited from interface org.eclipse.cdt.core.dom.ast.IASTIfStatement
CONDITION, ELSE, THENFields inherited from interface org.eclipse.cdt.core.dom.ast.IASTNode
EMPTY_NODE_ARRAYFields inherited from interface org.eclipse.cdt.core.dom.ast.IASTStatement
EMPTY_STATEMENT_ARRAY -
Method Summary
Modifier and TypeMethodDescriptioncopy()Returns a mutable copy of the tree rooted at this node.copy(IASTNode.CopyStyle style) Returns a mutable copy of the tree rooted at this node.Returns the condition declaration.Returns the init-statement for an if.getScope()Returns the implicitIScoperepresented by this if statementbooleanChecks whether this if statement is a constexpr if statement.voidSets the condition declaration.voidsetInitializerStatement(IASTStatement statement) Sets the optional init-statement of an if.voidsetIsConstexpr(boolean isConstexpr) Sets the isConstxpr member variable.Methods inherited from interface org.eclipse.cdt.core.dom.ast.IASTAttributeOwner
addAttribute, addAttributeSpecifier, getAttributes, getAttributeSpecifiersMethods inherited from interface org.eclipse.cdt.core.dom.ast.IASTIfStatement
getConditionExpression, getElseClause, getThenClause, setConditionExpression, setElseClause, setThenClauseMethods inherited from interface org.eclipse.cdt.core.dom.ast.IASTNode
accept, contains, getChildren, getContainingFilename, getFileLocation, getLeadingSyntax, getNodeLocations, getOriginalNode, getParent, getPropertyInParent, getRawSignature, getSyntax, getTrailingSyntax, getTranslationUnit, isActive, isFrozen, isPartOfTranslationUnitFile, setParent, setPropertyInParent
-
Field Details
-
INIT_STATEMENT
INIT_STATEMENTrepresents the relationship between anICPPASTIfStatementand its nestedIASTStatement.- Since:
- 6.5
-
-
Method Details
-
getConditionDeclaration
IASTDeclaration getConditionDeclaration()Returns the condition declaration. The condition declaration and the condition expression are mutually exclusive.- Returns:
- the condition declaration, or
nullif the 'if' statement doesn't have a condition declaration.
-
setConditionDeclaration
Sets the condition declaration. -
setIsConstexpr
void setIsConstexpr(boolean isConstexpr) Sets the isConstxpr member variable.- Since:
- 6.5
-
isConstexpr
boolean isConstexpr()Checks whether this if statement is a constexpr if statement.- Returns:
- true iff this if statement is a constexpr if.
- Since:
- 6.5
-
getInitializerStatement
IASTStatement getInitializerStatement()Returns the init-statement for an if.- Returns:
- the init-statement, or
nullif the 'if' statement doesn't have one. - Since:
- 6.5
-
setInitializerStatement
Sets the optional init-statement of an if.- Parameters:
statement- this statement should either be aIASTSimpleDeclarationor aIASTExpressionStatement.- Since:
- 6.5
-
getScope
IScope getScope()Returns the implicitIScoperepresented by this if statement- Returns:
IScope
-
copy
ICPPASTIfStatement copy()Description copied from interface:IASTNodeReturns a mutable copy of the tree rooted at this node. The following postconditions hold:copy.getParent() == null copy.getPropertyInParent() == null copy.isFrozen() == false
Preprocessor nodes do not currently support being copied. Implicit name nodes are not copied, instead they can be regenerated if required.Calling this method is equivalent to
copy(CopyStyle.withoutLocations).- Specified by:
copyin interfaceIASTIfStatement- Specified by:
copyin interfaceIASTNode- Specified by:
copyin interfaceIASTStatement- Since:
- 5.1
-
copy
Description copied from interface:IASTNodeReturns a mutable copy of the tree rooted at this node. The following postconditions hold:copy.getParent() == null copy.getPropertyInParent() == null copy.isFrozen() == false
Preprocessor nodes do not currently support being copied. Implicit name nodes are not copied, instead they can be regenerated if required.- Specified by:
copyin interfaceIASTIfStatement- Specified by:
copyin interfaceIASTNode- Specified by:
copyin interfaceIASTStatement- Parameters:
style-IASTNode.CopyStylecreate a copy with or without locations. Please seeIASTNode.CopyStylefor restrictions on copies with Locations.- Since:
- 5.3
-