Package org.eclipse.cdt.core.dom.ast.cpp
Interface ICPPASTIfStatement
-
- All Superinterfaces:
IASTAttributeOwner,IASTIfStatement,IASTNode,IASTStatement
public interface ICPPASTIfStatement extends IASTIfStatement
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
Fields Modifier and Type Field Description static ASTNodePropertyINIT_STATEMENTINIT_STATEMENTrepresents the relationship between anICPPASTIfStatementand its nestedIASTStatement.-
Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTAttributeOwner
ATTRIBUTE, ATTRIBUTE_SPECIFIER
-
Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTIfStatement
CONDITION, ELSE, THEN
-
Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTNode
EMPTY_NODE_ARRAY
-
Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTStatement
EMPTY_STATEMENT_ARRAY
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ICPPASTIfStatementcopy()Returns a mutable copy of the tree rooted at this node.ICPPASTIfStatementcopy(IASTNode.CopyStyle style)Returns a mutable copy of the tree rooted at this node.IASTDeclarationgetConditionDeclaration()Returns the condition declaration.IASTStatementgetInitializerStatement()Returns the init-statement for an if.IScopegetScope()Returns the implicitIScoperepresented by this if statementbooleanisConstexpr()Checks whether this if statement is a constexpr if statement.voidsetConditionDeclaration(IASTDeclaration d)Sets 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, getAttributeSpecifiers
-
Methods inherited from interface org.eclipse.cdt.core.dom.ast.IASTIfStatement
getConditionExpression, getElseClause, getThenClause, setConditionExpression, setElseClause, setThenClause
-
Methods 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 Detail
-
INIT_STATEMENT
static final ASTNodeProperty INIT_STATEMENT
INIT_STATEMENTrepresents the relationship between anICPPASTIfStatementand its nestedIASTStatement.- Since:
- 6.5
-
-
Method Detail
-
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
void setConditionDeclaration(IASTDeclaration d)
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
void setInitializerStatement(IASTStatement statement)
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
ICPPASTIfStatement copy(IASTNode.CopyStyle style)
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
-
-