pegged.grammar

Parser generation module for Pegged. The Pegged parser itself is in pegged.parser, generated from pegged.examples.peggedgrammar.

The documentation is in the /docs directory.

Members

Enums

Memoization
enum Memoization

Option enum to get internal memoization (parse results storing).

Functions

asModule
void asModule(string moduleName, string fileName, string grammarString, string optHeader = "")
void asModule(string moduleName, File file, string optHeader = "")

This function takes a (future) module name, a (future) file name and a grammar as a string or a file. It writes the corresponding parser inside a module with the given name.

grammar
string grammar(string definition)
string grammar(ParseTree defAsParseTree)

Generate a parser from a PEG definition. The parser is a string containing D code, to be mixed in or written in a file.

Mixin templates

expected
mixin template expected()

Mixin to get what a failed rule expected as input. Not used by Pegged yet.

Meta