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.

Public Imports

pegged.peg
public import pegged.peg;
Undocumented in source.

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.

badGrammar
void badGrammar()
Undocumented in source. Be warned that the author may not have intended to support it.
doubler
P doubler(P p)
Undocumented in source. Be warned that the author may not have intended to support it.
foo
P foo(P p)
Undocumented in source. Be warned that the author may not have intended to support it.
goodGrammar
void goodGrammar()
Undocumented in source. Be warned that the author may not have intended to support it.
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.

spaceArrow
ParseTree spaceArrow(ParseTree input)
Undocumented in source. Be warned that the author may not have intended to support it.

Mixin templates

expected
mixintemplate expected()

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

Meta