View Source Grammar.Clause (Grammar v0.4.0)
A Clause entity represents a grammar clause, by its substitution and callback to execute.
The substitution is a list of steps, which can be either a rule name or a token prototype.
The parameter function
is the callback to execute when the clause is fully matched. It is
given a list as parameter, each element of that list is the value produced by the substitution
of each term.
Summary
Functions
Create a new clause with a given substitution and callback function.
Types
@type substitution() :: [term()]
@type t() :: %Grammar.Clause{function: callback(), substitution: substitution()}
Functions
@spec new(substitution(), callback()) :: t()
Create a new clause with a given substitution and callback function.