FABuilder

trait FABuilder[S, T, +A <: (FA), -K >: FAelements[S, T] <: Matchable, -Z <: (AutomatonStyle)]() extends FABuilder[S, T, A, K, Z] with UnindexedFA[S, T, Z] with StatesMixin[S, T]

Implementation of a builder for some automaton type using `HashSet`s and `HashMap`s.

Type Params
D

Type of automaton constructed by this builder.

K

Builder elements for this builder.

S

The type of all states of the automaton

T

The type of labels on (non-epsilon) transitions of the automaton

Z

Type of style options for Graphviz export

trait StatesMixin[S, T]
trait UnindexedFA[S, T, Z]
trait FABuilder[S, T, A, K, Z]
trait UnindexedFA[S, T, Z]
trait Pretty
trait Graphable[S, T, Z]
trait Builder[K, A[S, T]]
trait Growable[K]
trait Clearable
class Object
trait Matchable
class Any
trait DFABuilder[S, T, D, K, Z]
class DFABuilder[S, T]
trait NFABuilder[S, T, G, D, N, K, NZ, DZ]
class NFABuilder[S, T]
trait EdgeAnnotatedNFABuilder[S, T, NA, DA, G, D, N, K, NZ, DZ]

Value members

Abstract methods

override protected

Internal, low-level method for removing all transitions emerging from a particular state. Does no consistency checking.

Internal, low-level method for removing all transitions emerging from a particular state. Does no consistency checking.

Definition Classes

Concrete methods

override
Definition Classes
override
def addOne(elem: K): FABuilder[S, T, A, K, Z]
Definition Classes
override
def clear(): Unit

Clear this builder. When overriding this method, it is important to call super.clear().

Clear this builder. When overriding this method, it is important to call super.clear().

Definition Classes
override
Definition Classes
override
Definition Classes
override protected
def prettyHeader: Doc
Definition Classes
override
Definition Classes

Inherited methods

final
def ++=(xs: IterableOnce[K]): FABuilder[S, T, A, K, Z]
Inherited from
Growable
final
def +=(elem: K): FABuilder[S, T, A, K, Z]
Inherited from
Growable
def accepts(string: Seq[T]): Boolean

Returns true if this automaton accepts the given string.

Returns true if this automaton accepts the given string.

Inherited from
UnindexedFA
def addAll(xs: IterableOnce[K]): FABuilder[S, T, A, K, Z]
Inherited from
Growable
def addState(s: S): Unit
Inherited from
StatesMixin
def addTransition(s1: S, t: T, s2: S): Unit

Adds a transition labelled t from s1 to s2

Adds a transition labelled t from s1 to s2

Inherited from
FABuilder
protected
def afterStatePlot(sb: StringBuilder, style: Z[S, T], stateList: IndexedSeq[S], stateMap: Map[S, Int]): Unit
Inherited from
UnindexedFA
protected
def assemblePrettyTransition(before: Doc, arrow: Doc, after: Doc): Doc
Inherited from
UnindexedFA
protected
Inherited from
UnindexedFA
def dump(out: PrintStream): Unit
Inherited from
UnindexedFA

Return the pairs comprising all unlabelled transitions.

Return the pairs comprising all unlabelled transitions.

Inherited from
UnindexedFA
protected
def edgeText(style: Z[S, T], si0: Int, s0: S, si1: Int, s1: S): String
Inherited from
UnindexedFA
protected
def edgeText(style: Z[S, T], si0: Int, s0: S, ti0: Int, t: T, si1: Int, s1: S): String
Inherited from
UnindexedFA
protected
Inherited from
UnindexedFA
def foreachETransition(action: (S, S) => Unit { def apply(s1: S, s2: S): Unit; }): Unit

Perform some action for each epsilon transition in the automaton. Note that in many (deterministic) automata, this method is a no-op, but in included for an easy consistency.

Perform some action for each epsilon transition in the automaton. Note that in many (deterministic) automata, this method is a no-op, but in included for an easy consistency.

Inherited from
UnindexedFA
override
def foreachFinalState(action: S => Unit { def apply(s: S): Unit; }): Unit
Definition Classes
Inherited from
UnindexedFA
override
def foreachInitialState(action: S => Unit { def apply(s: S): Unit; }): Unit
Definition Classes
Inherited from
UnindexedFA
override
def foreachState(action: S => Unit { def apply(s: S): Unit; }): Unit
Definition Classes
Inherited from
UnindexedFA
override
def foreachTransition(action: (S, T, S) => Unit { def apply(s1: S, t: T, s2: S): Unit; }): Unit
Definition Classes
Inherited from
UnindexedFA
def graphviz(sourceFile: String, outputFile: String)(using options: Z[S, T]): Unit

Use Graphviz to render this object as specified.

Use Graphviz to render this object as specified.

Inherited from
Graphable
def graphviz(fileRoot: String)(using options: Z[S, T]): Unit

Use Graphviz to render this object (in the default format) to the given file.

Use Graphviz to render this object (in the default format) to the given file.

Inherited from
Graphable
protected
def initPlot(sb: StringBuilder, states: Int, labels: Int): Unit
Inherited from
UnindexedFA

Returns the Set of initial states in this automaton.

Returns the Set of initial states in this automaton.

Inherited from
UnindexedFA
protected
def internalsToDOT(stateList: IndexedSeq[S], stateMap: Map[S, Int], theLabels: IndexedSeq[T], sb: StringBuilder)(using style: Z[S, T]): Unit

Internal routine used by [[#toDOT]]. Subclesses may override, but still call super.internalsToDOT, to extend the Graphviz representation of a DFA.

Internal routine used by [[#toDOT]]. Subclesses may override, but still call super.internalsToDOT, to extend the Graphviz representation of a DFA.

Inherited from
UnindexedFA

Returns whether the given state s is initial in this automaton.

Returns whether the given state s is initial in this automaton.

Inherited from
UnindexedFA
def isState(s: S): Boolean
Inherited from
StatesMixin
Inherited from
Growable

Set of automaton transition labels

Set of automaton transition labels

Inherited from
UnindexedFA
def map[S2, T2](stateMap: S => S2, transitionMap: T => T2): UnindexedFA[S2, T2, Z]

Derive a new isomorphic automaton from this one by applying transforms to the states and transitions. This method does not check that either map is injective: if they are not, then the result may be unpredictable.

Derive a new isomorphic automaton from this one by applying transforms to the states and transitions. This method does not check that either map is injective: if they are not, then the result may be unpredictable.

Inherited from
UnindexedFA
def mapResult[NewTo](f: A[S, T] => NewTo): Builder[K, NewTo]
Inherited from
Builder
def mapStates[S2](stateMap: S => S2): UnindexedFA[S2, T, Z]

Derive a new isomorphic automaton from this one by applying transforms to the states. This method does not check that the stateMap is injective: if it is not, then the result may have separate states which cannot be distinguished.

Derive a new isomorphic automaton from this one by applying transforms to the states. This method does not check that the stateMap is injective: if it is not, then the result may have separate states which cannot be distinguished.

Inherited from
UnindexedFA
def mapTransitions[T2](transitionMap: T => T2): UnindexedFA[S, T2, Z]

Derive a new isomorphic automaton from this one by applying transforms to the transitions. This method does not check that the transitionMap is injective: if it is not, then the result may have separate transitions which cannot be distinguished.

Derive a new isomorphic automaton from this one by applying transforms to the transitions. This method does not check that the transitionMap is injective: if it is not, then the result may have separate transitions which cannot be distinguished.

Inherited from
UnindexedFA
protected
def plotInitialStateMarker(sb: StringBuilder, style: Z[S, T], s: S, idx: Int): Unit

Add decorations for an initial state.

Add decorations for an initial state.

Inherited from
UnindexedFA
protected
def plotPresentEdge(sb: StringBuilder, style: Z[S, T], stateList: IndexedSeq[S], stateMap: Map[S, Int], si0: Int, s0: S, si1: Int, s1: S): Unit
Inherited from
UnindexedFA
protected
def plotPresentEdge(sb: StringBuilder, style: Z[S, T], stateList: IndexedSeq[S], stateMap: Map[S, Int], si0: Int, s0: S, ti0: Int, t: T, si1: Int, s1: S): Unit
Inherited from
UnindexedFA
protected
def plotState(sb: StringBuilder, style: Z[S, T], si: Int, s: S, isInitial: Boolean, isFinal: Boolean): Unit
Inherited from
UnindexedFA
protected
def plotTransitions(stateList: IndexedSeq[S], stateMap: Map[S, Int], theLabels: IndexedSeq[T], sb: StringBuilder, style: Z[S, T]): Unit
Inherited from
UnindexedFA
def pretty: Doc
Inherited from
UnindexedFA
protected
def prettyETransition(src: S, dest: S): Doc
Inherited from
UnindexedFA
protected
def prettyETransitionArrow(src: S, dest: S): Doc
Inherited from
UnindexedFA
protected
def prettyFooter: Doc
Inherited from
UnindexedFA
protected
def prettyState(s: S): Doc
Inherited from
UnindexedFA
protected
def prettyStateInTransition(state: S): Doc
Inherited from
UnindexedFA
protected
def prettyStateLeader(s: S): Doc
Inherited from
UnindexedFA
protected
def prettyStates: Doc
Inherited from
UnindexedFA
protected
def prettyTransition(src: S, label: T, dest: S): Doc
Inherited from
UnindexedFA
protected
def prettyTransitionArrow(src: S, label: T, dest: S): Doc
Inherited from
UnindexedFA
protected
Inherited from
UnindexedFA
def removeState(s: S): Unit
Inherited from
StatesMixin
def result(): A[S, T]
Inherited from
Builder
def size: Int
Inherited from
StatesMixin
final
def sizeHint(coll: IterableOnce[_], delta: Int): Unit
Inherited from
Builder
def sizeHint(size: Int): Unit
Inherited from
Builder
final
def sizeHintBounded(size: Int, boundingColl: Iterable[_]): Unit
Inherited from
Builder
def states: Set[S]
Inherited from
StatesMixin
override
def toDOT(using Z[S, T]): String
Definition Classes
UnindexedFA -> Graphable
Inherited from
UnindexedFA
override
Definition Classes
Inherited from
UnindexedFA
def transitions(s: S, t: T): Set[S]

Returns the (possibly empty, and in deterministic implementations at most singleton) set of states into which the automaton could transition starting from s via a transition labelled t.

Returns the (possibly empty, and in deterministic implementations at most singleton) set of states into which the automaton could transition starting from s via a transition labelled t.

Inherited from
UnindexedFA

Deprecated and Inherited methods

@inline @deprecated(message = "Use `++=` aka `addAll` instead of varargs `+=`; infix operations with an operand of multiple args will be deprecated", since = "2.13.0")
final
def +=(elem1: K, elem2: K, elems: K*): FABuilder[S, T, A, K, Z]
Deprecated
[Since version 2.13.0] Use `++=` aka `addAll` instead of varargs `+=`; infix operations with an operand of multiple args will be deprecated
Inherited from
Growable

Concrete fields

protected

Storage for all final state objects.

Storage for all final state objects.

Inherited fields

protected

Storage for all state objects

Storage for all state objects

Inherited from
StatesMixin