Search documentation of Finitomata

# View Source Finitomata.Parser behaviour (Finitomata v0.21.2)

The behaviour, defining the parser to produce FSM out of textual representation.

# Summary

## Types

parse_error()

The type representing the parsing error which might be passed through to raised `CompileError`.

## Callbacks

lint(binary)

Linter of the input, producing a well-formed representation of FSM understood by JS/markdown parsers.

parse(binary)

Parse function, producing the FSM definition as a list of `Transition` instances.

validate(list)

Validation of the input.

# Types

Link to this type

# parse_error()

View Source

    @type parse_error() ::
      {:error, String.t(), binary(), map(), {pos_integer(), pos_integer()},
       pos_integer()}

The type representing the parsing error which might be passed through to raised `CompileError`.

# Callbacks

Link to this callback

# lint(binary)

View Source

    @callback lint(binary()) :: binary()

Linter of the input, producing a well-formed representation of FSM understood by JS/markdown parsers.

Link to this callback

# parse(binary)

View Source

    @callback parse(binary()) ::
      {:ok, [Finitomata.Transition.t()]}
      | {:error, Finitomata.validation_error()}
      | parse_error()

Parse function, producing the FSM definition as a list of `Transition` instances.

Link to this callback

# validate(list)

View Source

    @callback validate([{:transition, [binary()]}]) ::
      {:ok, [Finitomata.Transition.t()]} | {:error, Finitomata.validation_error()}

Validation of the input.