Regexp-Grammars

 view release on metacpan or  search on metacpan

demo/demo_hash_lexicon.pl  view on Meta::CPAN

Casamarca
Casanovanic
Casasia
casate
casaun
casava
casave
casavi
casbah
cascabel
cascade
Cascadia
Cascadian
cascadite
cascado
cascalho
cascalote
cascara
cascarilla
cascaron
casco

lib/Regexp/Grammars.pm  view on Meta::CPAN

        $label //= 'Literal';
        say "\t"x$level, "$label: ", $self->{q{}};
    }

and then simply write:

    if ($text =~ $LaTeX_parser) {
        $/{LaTeX_file}->explain();
    }

and the chain of C<explain()> calls would cascade down the nodes of the tree,
each one invoking the appropriate C<explain()> method according to the type of
node encountered.

The only problem is that, by default, Regexp::Grammars returns a tree of
plain-old hashes, not LaTeX::Whatever objects. Fortunately, it's easy to
request that the result hashes be automatically blessed into the appropriate
classes, using the C<< <objrule:...> >> and C<< <objtoken:...> >> directives.

These directives are identical to the C<< <rule:...> >> and C<<
<token:...> >> directives (respectively), except that the rule or token



( run in 0.604 second using v1.01-cache-2.11-cpan-49f99fa48dc )