Class ZAutomaton<V>
- Type Parameters:
V
- the label value type
- All Implemented Interfaces:
FormatClient
,Traceable<List<V>>
The recommended way to construct a zero-overhead automaton is
from a deterministic automaton using DAutomaton.deflate()
.
Manual construction with prototype(Behavior)
and
hardPatch(Map)
is low-level and error-prone.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
Iterator-like mutable API for tracking the consumption of an input sequence of code points by an automaton. -
Field Summary
Fields inherited from class eu.bandm.tools.lexic.Behavior
label, transitions
-
Method Summary
Modifier and TypeMethodDescription(package private) void
Changes the transitions of this automaton according to a given substitution.(package private) static <V> ZAutomaton<V>
Creates a prototype automaton from a symbolic behavior.trace()
Returns a fresh trace.Methods inherited from class eu.bandm.tools.lexic.Behavior
anyTransition, constant, consume, consumeAnyOf, consumeExcept, forEachKey, forEachTransition, format, format, getLabel, getTransition, intersect, map, mapTransitions, merge, of, simplify, toString, totalize
-
Method Details
-
prototype
Creates a prototype automaton from a symbolic behavior.This construction exploits type erasure on the JVM; the transitions of the resulting automaton are ill-typed, and latent causes for
ClassCastException
may arise if it is used without correction. A call to methodhardPatch(java.util.Map<?, ? extends eu.bandm.tools.lexic.Behavior<java.util.List<V>, ?>>)
should substitute references of typeZAutomaton
for all transitions before attempting to use the automaton.- Type Parameters:
V
- the value type- Parameters:
beh
- the symbolic behavior to emulate- Returns:
- a prototype automaton
- See Also:
-
hardPatch
Changes the transitions of this automaton according to a given substitution.The type of the substituted values is not checked either at compile time or at execution time. Latent causes for
ClassCastException
may arise if this method is used carelessly.- Parameters:
substitution
- the substitution to apply; values not present as keys are left unchanged- See Also:
-
trace
Returns a fresh trace.Objects obtained as return values from multiple calls to this method do not share mutable state with each other, and can be used safely in concurrency.
-