Package com._1c.g5.v8.dt.bsl.common
Class ReturnStatementProcessor
- java.lang.Object
-
- com._1c.g5.v8.dt.bsl.common.ReturnStatementProcessor
-
public class ReturnStatementProcessor extends Object
Processor forReturnStatement
in Bsl language
-
-
Constructor Summary
Constructors Constructor Description ReturnStatementProcessor(Block block)
Initialize withBlock
ReturnStatementProcessor(Collection<Statement> allStatements, Collection<Preprocessor> allDeclareStatementPreprocessor)
Initialize with collection of Statements
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
allLogicalPartHasReturnOrRaiseStatement()
Check that each part of tree type statements has return or raise statementboolean
allLogicalPartHasReturnStatement()
Check that each part of tree type statements has return statementList<Statement>
getAllReturnStatement()
Gets all return statementsList<Statement>
getStatementsAfterReturn()
Gets list of all statements after return statementboolean
hasReturnOrRaiseStatement()
Check that at least one return or raise statement was foundboolean
hasReturnStatement()
Check that at least one return statement was foundboolean
hasStatementAfterReturn()
Check that statement after return statement was foundvoid
process()
Start processing for all statements
-
-
-
Constructor Detail
-
ReturnStatementProcessor
public ReturnStatementProcessor(Block block)
Initialize withBlock
- Parameters:
block
-Block
of Bsl module, can't benull
-
ReturnStatementProcessor
public ReturnStatementProcessor(Collection<Statement> allStatements, Collection<Preprocessor> allDeclareStatementPreprocessor)
Initialize with collection of Statements- Parameters:
allStatements
- collection of theStatement
, can't benull
allDeclareStatementPreprocessor
-Preprocessor
from declare statement, can benull
-
-
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 benull
-
-