#2746 [ANN] Pegger v1.0

SlimerDude Wed 12 Jun

Pegger v1.0!

A Parsing Expression Grammar (PEG) for when Regular Expressions just aren't enough!

Pegger is a PEG implementation. It lets you create text parsers by building up a tree of simple matching rules.

Advanced parsing options let you look ahead with predicates and the returned tree of match results gives you plenty of options for transforming it into useful data.

fanr install -r http://eggbox.fantomfactory.org/fanr/ afPegger

Quick start example:

using afPegger::Rule

class Example {
    Void main() {
        rule  := Peg.parseRule("'<'+ name:[a-zA-Z ]+ '>'+")

        rule.match("<<<Hello Mum>>>")["name"]  // --> "Hello Mum"

Pegger Icon

Pegger, as used in Html Parser, Markdown Parser, and more!

Read more on Pegger...

Have fun!

Login or Signup to reply.