ByteRunnable

interface ByteRunnable

A runnable automaton accepting byte array as input

Inheritors

Properties

Link copied to clipboard
abstract val size: Int

Returns number of states this automaton has, note this may not be an accurate number in case of NFA

Functions

Link copied to clipboard
abstract fun isAccept(state: Int): Boolean

Returns acceptance status for given state.

Link copied to clipboard
open fun run(s: ByteArray, offset: Int, length: Int): Boolean

Returns true if the given byte array is accepted by this automaton

Link copied to clipboard
abstract fun step(state: Int, c: Int): Int

Returns the state obtained by reading the given char from the given state. Returns -1 if not obtaining any such state.