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.

### Nested Class Summary

### Nested classes/interfaces inherited from interface org.eclipse.cdt.core.dom.ast.IASTNode

`IASTNode.CopyStyle`

### Field Summary

### Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTIfStatement

`CONDITION, ELSE, THEN`

### Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTStatement

`EMPTY_STATEMENT_ARRAY`

### Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTAttributeOwner

`ATTRIBUTE, ATTRIBUTE_SPECIFIER`

### Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTNode

`EMPTY_NODE_ARRAY`

### Method Summary

All Methods Instance Methods Abstract Methods
`ICPPASTIfStatement` `copy()` Returns a mutable copy of the tree rooted at this node.
`ICPPASTIfStatement` `copy(IASTNode.CopyStyle style)` Returns a mutable copy of the tree rooted at this node.
`IASTDeclaration` `getConditionDeclaration()` Returns the condition declaration.
`IScope` `getScope()` Returns the implicit `IScope` represented by this if statement
`void` `setConditionDeclaration(IASTDeclaration d)` Sets the condition declaration.

### 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.IASTAttributeOwner

`addAttribute, addAttributeSpecifier, getAttributes, getAttributeSpecifiers`

### 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`

### Method Detail

#### getConditionDeclaration

    IASTDeclaration getConditionDeclaration()

Returns the condition declaration. The condition declaration and the condition expression are mutually exclusive.

Returns:
  the condition declaration, or `null` if the 'if' statement doesn't have a condition declaration.

#### setConditionDeclaration

    void setConditionDeclaration(IASTDeclaration d)

Sets the condition declaration.

#### getScope

    IScope getScope()

Returns the implicit `IScope` represented by this if statement

Returns:
  `IScope`

#### copy

    ICPPASTIfStatement copy()

Description copied from interface: `IASTNode`
Returns 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:
  `copy` in interface `IASTIfStatement`
Specified by:
  `copy` in interface `IASTNode`
Specified by:
  `copy` in interface `IASTStatement`
Since:
  5.1

#### copy

    ICPPASTIfStatement copy(IASTNode.CopyStyle style)

Description copied from interface: `IASTNode`
Returns 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:
  `copy` in interface `IASTIfStatement`
Specified by:
  `copy` in interface `IASTNode`
Specified by:
  `copy` in interface `IASTStatement`
Parameters:
  `style` - `IASTNode.CopyStyle` create a copy with or without locations. Please see `IASTNode.CopyStyle` for restrictions on copies with Locations.
Since:
  5.3