PEG:


Vocabulary
peg

Syntax
PEG: word ( stack -- effect ) definition... ;


Word description
Defines a word that when called will parse-fully a string using the syntax defined by the parser created by the definition.The definition should have stack effect ( -- parser ) and the created word ( string -- ast ). The parser is compiled when first used and then reused for each subsequent invocation.

Notes
If the parsing fails, the word throws an exception. If the input is not fully consumed, the word throws an exception.

See also
PARTIAL-PEG:

Definition