Class ReturnStatementProcessor

    • Constructor Detail

      • ReturnStatementProcessor

        public ReturnStatementProcessor​(Block block)
        Initialize with Block
        Parameters:
        block - Block of Bsl module, can't be null
      • ReturnStatementProcessor

        public ReturnStatementProcessor​(Collection<Statement> allStatements,
                                        Collection<Preprocessor> allDeclareStatementPreprocessor)
        Initialize with collection of Statements
        Parameters:
        allStatements - collection of the Statement, can't be null
        allDeclareStatementPreprocessor - Preprocessor from declare statement, can be null
    • Method Detail

      • process

        public void process()
        Start processing for all statements
      • hasReturnStatement

        public boolean hasReturnStatement()
        Check that at least one return statement was found
        Returns:
        true if at least one statement was found, false otherwise
      • getAllReturnStatement

        public List<Statement> getAllReturnStatement()
        Gets all return statements
        Returns:
        all return statements, never nunll
      • hasReturnOrRaiseStatement

        public boolean hasReturnOrRaiseStatement()
        Check that at least one return or raise statement was found
        Returns:
        true if at least one statement was found, false otherwise
      • hasStatementAfterReturn

        public boolean hasStatementAfterReturn()
        Check that statement after return statement was found
        Returns:
        true if statement after return statement was found, false otherwise
      • allLogicalPartHasReturnStatement

        public boolean allLogicalPartHasReturnStatement()
        Check that each part of tree type statements has return statement
        Returns:
        true each part of tree type statements has return statement, false otherwise
      • allLogicalPartHasReturnOrRaiseStatement

        public boolean allLogicalPartHasReturnOrRaiseStatement()
        Check that each part of tree type statements has return or raise statement
        Returns:
        true each part of tree type statements has return or raise statement, false otherwise
      • getStatementsAfterReturn

        public List<Statement> getStatementsAfterReturn()
        Gets list of all statements after return statement
        Returns:
        list of all statements after return statement or empty list if hasStatementAfterReturn() == false, can't be null