Class MustExecutePosition
- All Implemented Interfaces:
Predicate<org.antlr.v4.runtime.tree.ParseTree>
The walk climbs from the node to the body it belongs to - a function, method, operator, service operation or
dynamic function body, or a property initialiser - and every step must be a position that is always evaluated:
a statement in a body, an initialiser, an argument, an operand, the first condition of an if, the subject
of a switch, the condition and collection of a loop, a try body, a finally block, the
source of a stream.
Everything conditional answers false: if/else bodies and later conditions, case and
default bodies, loop bodies (a do body too, deliberately, for now), catch blocks, the right
operand of and/or/xor and of every coalescing operator, the arms of a ternary, the right of
:=?, a condition after a guard, stream stages and assertions.
🔑 It is a whitelist. Any position it does not recognise answers false, so a construct added to the grammar later can only make an analysis miss something, never report something that cannot happen. A code path that always throws before a call is not considered: the call still counts as executed.
-
Constructor Details
-
MustExecutePosition
public MustExecutePosition()
-
-
Method Details
-
test
-