Interface ICPPASTIfStatement

    • Field Detail

      • INIT_STATEMENT

        static final ASTNodeProperty INIT_STATEMENT
        INIT_STATEMENT represents the relationship between an ICPPASTIfStatement and its nested IASTStatement.
        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 null if 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 null if 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 a IASTSimpleDeclaration or a IASTExpressionStatement.
        Since:
        6.5
      • 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