Idris2Doc : Text.ILex.DFA

Text.ILex.DFA

(source)

Reexports

import public Data.Array
import public Data.List
import public Text.ILex.RExp

Definitions

data Trans : Type -> Type
Totality: total
Visibility: public export
Constructors:
Run : a -> Trans a
Ign : Trans a
Err : Trans a
data Transition : Nat -> Type -> Type
Totality: total
Visibility: public export
Constructors:
Keep : Transition n a
Done : a -> Transition n a
Ignore : Transition n a
Move : Fin (S n) -> a -> Transition n a
MoveI : Fin (S n) -> Transition n a
MoveE : Fin (S n) -> Transition n a
Bottom : Transition n a
0 ByteTrans : Nat -> Type -> Type
  An array of arrays describing a lexer's state machine.

Totality: total
Visibility: public export
0 Machine : Nat -> Type -> Type
  An array of arrays describing a lexer's state machine.

Totality: total
Visibility: public export
record DFA : Type -> Type
  A discrete finite automaton (DFA) encoded as
an array of state transitions plus an array
describing the terminal token states.

Totality: total
Visibility: public export
Constructor: 
L : (states : Nat) -> Machine states a -> DFA a

Projections:
.next : ({rec:0} : DFA a) -> Machine (states {rec:0}) a
  State transitions matrix.

If `cur` is the current state (encoded as a `Fin (S states)`
and `b` is the current input byte, the next state is determined
by `next[cur][b]` (in pseudo C-syntax).
.states : DFA a -> Nat
  Number of non-zero states in the automaton.
.states : DFA a -> Nat
  Number of non-zero states in the automaton.

Totality: total
Visibility: public export
states : DFA a -> Nat
  Number of non-zero states in the automaton.

Totality: total
Visibility: public export
.next : ({rec:0} : DFA a) -> Machine (states {rec:0}) a
  State transitions matrix.

If `cur` is the current state (encoded as a `Fin (S states)`
and `b` is the current input byte, the next state is determined
by `next[cur][b]` (in pseudo C-syntax).

Totality: total
Visibility: public export
next : ({rec:0} : DFA a) -> Machine (states {rec:0}) a
  State transitions matrix.

If `cur` is the current state (encoded as a `Fin (S states)`
and `b` is the current input byte, the next state is determined
by `next[cur][b]` (in pseudo C-syntax).

Totality: total
Visibility: public export
0 Results : Type -> Type
Totality: total
Visibility: public export
byteDFA : TokenMap8 (Trans a) -> DFA a
  A DFA operating on raw bytes.

Totality: total
Visibility: export
dfa : Results a -> DFA a
  A utf-8 aware DFA operating on text.

Totality: total
Visibility: export