Neotomex v0.1.7 Neotomex.PEG View Source

# Neotomex.PEG

Implements a PEG specification parser using the internal PEG specification, and functions for parsing PEG grammars. There are separate functions for parsing entire grammars or only expressions.

Neotomex’s expressions add onto Bryan Ford’s original PEG grammar specification with:

  • Expression Pruning allows for matching expressions which aren’t passed into the transform function. They’re indicated by bracketing an expression with angle brackets, i.e. '<' expression '>'

Link to this section Summary

Functions

PEG parser grammar defined in Neotomex internal PEG format

Match against the input using the peg_grammar

Parse the input using the peg_grammar

Parse the input as a PEG expression rather than a full PEG grammar

Link to this section Functions

PEG parser grammar defined in Neotomex internal PEG format

Link to this function match(input) View Source
match(binary) :: {:ok, Neotomex.Grammar.match, binary}

Match against the input using the peg_grammar.

This could be useful for basic validation of grammars.

Parse the input using the peg_grammar.

Parse the input as a PEG expression rather than a full PEG grammar.