NAME
Pegex - Pegex Parser Generator
SYNOPSIS
use Pegex;
my $data = pegex($grammar)->parse($input);
or more explicitly:
use Pegex::Grammar;
use Pegex::AST;
my $grammar = Pegex::Grammar->new(
grammar => $grammar,
receiver => Pegex::AST->new(),
);
$grammar->parse($input, 'rule_name');
my $data = $grammar->receiver->data;
or customized explicitly:
package MyGrammar;
use Pegex::Grammar -base;
has grammar_text => "some grammar text goes here";
package MyReceiver;
use Pegex::Receiver -base;
got_some_rule { ... }
got_other_rule { ... }
package main;
use MyReceiver;
use MyGrammar;
my $receiver = MyReceiver->new();
my $grammar = MyGrammar->new(
receiver => $receiver,
);
$grammar->parse($input);
my $data = $receiver->data;
DESCRIPTION
Pegex is a new Acmeist parsing technique.
AUTHOR
Ingy döt Net <ingy@cpan.org>
COPYRIGHT
Copyright (c) 2010. Ingy döt Net.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html