Package org.openl.rules.tbasic.compile
Class ReturnAnalyzer
- java.lang.Object
-
- org.openl.rules.tbasic.compile.ReturnAnalyzer
-
public class ReturnAnalyzer extends Object
TheReturnAnalyzerclass analyzes body of some TBasic function for correctness of returns sequence and return types and detects unreachable code.
-
-
Constructor Summary
Constructors Constructor Description ReturnAnalyzer(IOpenClass returnType, AlgorithmCompiler compiler)Create an instance ofReturnAnalyzerfor analysis of some function from TBasic compiler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SuitablityAsReturnanalyze(List<AlgorithmTreeNode> nodesToAnalyze, IBindingContext bindingContext)Make full analysis of correctness of returns sequence and return types and detects unreachable code.IOpenClassgetReturnType()
-
-
-
Constructor Detail
-
ReturnAnalyzer
public ReturnAnalyzer(IOpenClass returnType, AlgorithmCompiler compiler)
Create an instance ofReturnAnalyzerfor analysis of some function from TBasic compiler.- Parameters:
returnType- Expected return type of functioncompiler- Associated TBasic compiler.
-
-
Method Detail
-
analyze
public SuitablityAsReturn analyze(List<AlgorithmTreeNode> nodesToAnalyze, IBindingContext bindingContext)
Make full analysis of correctness of returns sequence and return types and detects unreachable code.- Parameters:
nodesToAnalyze- Body of some function to analyze.- Returns:
- Correctness of code.
- Throws:
SyntaxNodeException- If function contains unreachable code or incorrect return type.
-
getReturnType
public IOpenClass getReturnType()
- Returns:
- Expected return type of function
-
-