Class ConstructionEdges
java.lang.Object
org.ek9lang.compiler.phase5.construction.ConstructionEdges
The calls that ALWAYS run when a callable runs, collected for FE77's construction-recursion check (E08263) by
the phase-5 call-graph collector, in the same walk that builds the call graph.
Only what always runs is kept (MustExecutePosition), and only calls that
are statically dispatched, so a cycle found over these edges is certain: once any member runs, none can finish.
Callers are keyed exactly as in the call graph (CallableIdentity), so a
generic's members are keyed once, by its template, and the check applies each parameterisation afterwards.
Thread-safe for the parallel per-source collection; read single-threaded afterwards.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA call to a resolved function, method, operator or constructor.static final recordA constructor running its type's property initialisers (_i_init).static final recordOne always-run call.static interfaceWhat an always-run call reaches.static final recordT()inside a generic - a construction of whatever type each parameterisation substitutes forT. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConstructionNode(String key, ISymbol symbol) Record a construction node - a constructor, or a type's_i_init- which every cycle reported must contain.voidaddMustCall(String callerKey, ConstructionEdges.Target target, IToken token, boolean explicitCall) Record an always-run call made by the callable with this call-graph identity.static ConstructionEdgesA store that collects.Every construction node, by call-graph identity.static ConstructionEdgesA store that ignores everything - for call-graph builds that do not run the check.booleanTrue if this store keeps what it is given, so a caller can skip the work of deciding what to give it.mustCallsFrom(String callerKey) The always-run calls a callable makes.
-
Method Details
-
collecting
A store that collects. -
discarding
A store that ignores everything - for call-graph builds that do not run the check. -
isCollecting
public boolean isCollecting()True if this store keeps what it is given, so a caller can skip the work of deciding what to give it. -
addMustCall
public void addMustCall(String callerKey, ConstructionEdges.Target target, IToken token, boolean explicitCall) Record an always-run call made by the callable with this call-graph identity. -
addConstructionNode
-
mustCallsFrom
The always-run calls a callable makes. Read only once collection has finished. -
constructionNodes
-