Ergo (ergo v0.3.5)

Ergo contains the helper function parse/2 otherwise see Ergo.Terminals, Ergo.Combinators and Ergo.Parsers for the individual parsers.

Link to this section Summary

Functions

The parser/2 function is a simple entry point to parsing inputs that constructs the Context record required.

Link to this section Functions

Link to this function

parse(parser, input, opts \\ [])

The parser/2 function is a simple entry point to parsing inputs that constructs the Context record required.

Options debug: [true | false]

Examples

iex> alias Ergo.Terminals
iex> parser = Terminals.literal("Hello")
iex> Ergo.parse(parser, "Hello World")
%Ergo.Context{status: :ok, ast: "Hello", char: ?o, input: " World", index: 5, line: 1, col: 6}