State

class State(    val name: String,     val isStart: Boolean = false,     var isAcceptingState: Boolean = false) : Cloneable

A simple class representing a state in an FSM.

  • name is the name of the State and must be unique for the FSM.

  • isStart indicates if it is the starting state.

  • isAcceptingState indicates if this State accepts the FSM (in our case, this means that the order of statements was correct).

Constructors

Link copied to clipboard
fun State(    name: String,     isStart: Boolean = false,     isAcceptingState: Boolean = false)

Functions

Link copied to clipboard
fun addOutgoingEdge(edge: BaseOpEdge)
Link copied to clipboard
open override fun clone(): State
Link copied to clipboard
fun cloneRecursively(currentStates: MutableSet<State> = mutableSetOf()): MutableSet<State>
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun nextNodeWithLabelOp(op: String): Pair<State, BaseOpEdge>?

Returns a Pair holding the next State when the edge with the operation op is executed and the BaseOpEdge which is executed. If no matching edge exists for this State, returns null.

Link copied to clipboard
open override fun toString(): String

Properties

Link copied to clipboard
var isAcceptingState: Boolean = false
Link copied to clipboard
val isStart: Boolean = false
Link copied to clipboard
val name: String
Link copied to clipboard
val outgoingEdges: MutableSet<BaseOpEdge>