ControlFlowLogic

Consider Control Flow to determine which statements are reachable.

Except for the special treatment of while, do, and for statements whose condition expression has the constant value true, the values of expressions are not taken into account in the flow analysis.

See JLS 14.21

Author

Federico Tomassetti

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open fun breakTarget(breakStmt: BreakStmt): Statement
A break statement with no label attempts to transfer control to the innermost enclosing switch, while, do, or for statement of the immediately enclosing method or initializer; this statement, which is called the break target, then immediately completes normally.
Link copied to clipboard
open fun canCompleteNormally(statement: Statement): Boolean
Link copied to clipboard
open fun continueADoStatement(continueStmt: ContinueStmt, doStmt: DoStmt): Boolean
Link copied to clipboard
open fun exitTheStatement(breakStmt: BreakStmt): Boolean
A reachable break statement exits a statement if, within the break target, either there are no try statements whose try blocks contain the break statement, or there are try statements whose try blocks contain the break statement and all finally clauses of those try statements can complete normally.
Link copied to clipboard
open fun isReachable(statement: Statement): Boolean