Class GuardTargetNode
java.lang.Object
org.ek9lang.compiler.support.GuardTargetNode
- All Implemented Interfaces:
Function<EK9Parser.PreFlowStatementContext, Optional<org.antlr.v4.runtime.tree.ParseTree>>
public final class GuardTargetNode
extends Object
implements Function<EK9Parser.PreFlowStatementContext, Optional<org.antlr.v4.runtime.tree.ParseTree>>
THE node whose recorded symbol is a guard's TARGET - the variable its implicit gate set-checks: the
variableDeclaration of v <- e(), or the identifier of v :=? e(). Empty when the pre-flow
is not a guard (PreFlowCanSkipBody) or a :=? assigns something other than a plain identifier
(this.x :=? e()). Shared by the Boolean truth guard and the redundant-gate checks (E08086-E08089).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionOptional<org.antlr.v4.runtime.tree.ParseTree> apply(EK9Parser.PreFlowStatementContext preFlow) The node to read the guard's target from.
-
Constructor Details
-
GuardTargetNode
public GuardTargetNode()
-
-
Method Details
-
apply
public Optional<org.antlr.v4.runtime.tree.ParseTree> apply(EK9Parser.PreFlowStatementContext preFlow) The node to read the guard's target from.- Specified by:
applyin interfaceFunction<EK9Parser.PreFlowStatementContext, Optional<org.antlr.v4.runtime.tree.ParseTree>>- Parameters:
preFlow- the pre-flow statement context (may be null)- Returns:
- the node to read the target's recorded symbol from, if this pre-flow is a guard on a plain variable
-