Class IfStmt

    • Method Detail

      • accept

        public <R,​A> R accept​(GenericVisitor<R,​A> v,
                                    A arg)
        Description copied from interface: Visitable
        Accept method for visitor support.
        Specified by:
        accept in interface Visitable
        Type Parameters:
        R - the type of the return value of the visitor
        A - the type the user argument passed to the visitor
        Parameters:
        v - the visitor implementation
        arg - the argument passed to the visitor (of type A)
        Returns:
        the result of the visit (of type R)
      • accept

        public <A> void accept​(VoidVisitor<A> v,
                               A arg)
        Description copied from interface: Visitable
        Accept method for visitor support.
        Specified by:
        accept in interface Visitable
        Type Parameters:
        A - the type the argument passed for the visitor
        Parameters:
        v - the visitor implementation
        arg - any value relevant for the visitor (of type A)
      • getThenStmt

        public Statement getThenStmt()
      • setElseStmt

        public IfStmt setElseStmt​(Statement elseStmt)
        Sets the elseStmt
        Parameters:
        elseStmt - the elseStmt, can be null
        Returns:
        this, the IfStmt
      • removeElseStmt

        public IfStmt removeElseStmt()
      • hasThenBlock

        public boolean hasThenBlock()
        This method returns true if the then branch (which should be always present) is a block statement.
      • hasElseBlock

        public boolean hasElseBlock()
        This method returns true if the If Statement has an else branch and that branch is a block statement.
      • hasCascadingIfStmt

        public boolean hasCascadingIfStmt()
        This method returns true if the If Statement has an else branch and that branch is another If Statement.
      • hasElseBranch

        public boolean hasElseBranch()
        This method returns true if the If Statement has an else branch.