| 1 | package Parse::QTEDI; | ||
| 2 | |||
| 3 | # Author: Dongxu Ma <dongxu@cpan.org> | ||
| 4 | |||
| 5 | use 5.005; | ||
| 6 | use strict; | ||
| 7 | use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $parser $DEBUG); | ||
| 8 | require Exporter; | ||
| 9 | @ISA = qw(Exporter); | ||
| 10 | @EXPORT = qw(); | ||
| 11 | @EXPORT_OK = qw($parser); | ||
| 12 | |||
| 13 | use Parse::RecDescent (); | ||
| 14 | use YAML::Syck (); | ||
| 15 | |||
| 16 | $VERSION = '0.19'; | ||
| 17 | $VERSION = eval $VERSION; # see L<perlmodstyle> | ||
| 18 | |||
| 19 | # Global flags | ||
| 20 | # unless undefined, report fatal errors | ||
| 21 | #$::RD_ERRORS = 1; | ||
| 22 | # unless undefined, also report non-fatal problems | ||
| 23 | #$::RD_WARN = 1; | ||
| 24 | # if defined, also suggestion remedies | ||
| 25 | $::RD_HINT = 1; | ||
| 26 | # if defined, also trace parsers' behaviour | ||
| 27 | #$::RD_TRACE = 1; | ||
| 28 | # if defined, generates "stubs" for undefined rules | ||
| 29 | #$::RD_AUTOSTUB = 1; | ||
| 30 | # if defined, appends specified action to productions | ||
| 31 | #$::RD_AUTOACTION = 1; | ||
| 32 | |||
| 33 | $::RD_DEBUG = $DEBUG ? 1 : 0; | ||
| 34 | |||
| 35 | my $grammar = do { local $/; <DATA> }; | ||
| 36 | $parser = Parse::RecDescent::->new($grammar); | ||
| 37 | |||
| 38 | 1; | ||
| 39 | __DATA__ |