perl.recdescent...Data::Match - an excellent tool for parse tree foraging by terrence.x.brannon- October 31, 2007 I will be adding this to the FAQ shortly, but thought I would mentionhow excellent Data::Match http:search.cpan.orgkstephensData-Match-0.06Match.pmhas been for my work.So, I have these deeply nested parse trees thanks to my use of anAutoaction: $::RD_AUTOACTION = q item ; I first inquired about various tools for spelunking in such trees: http:perlmonks.orgnode_id=646560And am very happy so far with Data::Match. Here is a sample parse treefrom my parse:$VAR1 = ...http://www.nntp.perl.org/group/perl.recdescent/2007/10/msg519.html Re: floating backtracking - style match by Ted Zlatanov- October 31, 2007 On Tue, 30 Oct 2007 13:41:22 -0400 terrence.x.brannonjpmchase.com wrote: txb> But given all that, and the toy grammar below, which matches "sir george", txb> how could we modify it to match "io;ajwer;i324 sir george"Here&39;s my solution:1) treat the whole input as a line made of items2) each item can be a word or a name (we try to match a &39;name&39; first)3) a word is any number of non-space charactersThe key is to walk through the input, looking for names. I tried.http://www.nntp.perl.org/group/perl.recdescent/2007/10/msg518.html floating backtracking - style match by terrence.x.brannon- October 30, 2007 Note: I&39;m sorry for the long disclaimer in these emails. I have put in requests to GMANE and Nabble to archive this list, so hopefully my future posts (while at $dayjob) will be easier for others to trim and reply to. With that said, I continue...Ok, I&39;m wondering what would be the best way to test for a match against a grammar where there may be up to 25 "junk" characters preceding the match. We know that PRD does not do backtracking:...http://www.nntp.perl.org/group/perl.recdescent/2007/10/msg517.html Re: subrule of subrule immediately fails by Ted Zlatanov- October 25, 2007 On Wed, 24 Oct 2007 05:17:11 -0400 "Terrence Brannon" <metaperlgmail.com> wrote: TB> On 102307, Ted Zlatanov <tzzlifelogs.com> wrote:>> >> Any chance you can post a complete example with sample input that fails>> TB> my $grammar = << &39;EOGRAMMAR&39;;TB> store: name geolocTB> name: "trader joe&39;s" "whole foods"TB> geoloc: geoloc1 and() geoloc2 geoloc_TB> geoloc1: geoloc_TB> geoloc2: geoloc_TB>...http://www.nntp.perl.org/group/perl.recdescent/2007/10/msg516.html Re: subrule of subrule immediately fails by Terrence Brannon- October 24, 2007 On 102307, Ted Zlatanov <tzzlifelogs.com> wrote:>> Any chance you can post a complete example with sample input that fails>What was I thinking My goodness, par for the course when submitting abug. Anyway, my reduced test case works just fine, which hopefullymeans that it&39;s on my end of things. So I will just do some morehead-scratching on my end for now. Here is my test case that workedflawlessly:use strict;use warnings;use Data::Dumper;use Parse::RecDescent; Generate a...http://www.nntp.perl.org/group/perl.recdescent/2007/10/msg515.html Re: subrule of subrule immediately fails by Ted Zlatanov- October 23, 2007 On Tue, 23 Oct 2007 14:31:03 -0400 terrence.x.brannonjpmchase.com wrote: txb> The following grammar (piece) works fine:txb> geoloc: geoloc_ and() geoloc_ geoloc_txb> geoloc_: city state country areatxb> but per txb> http:search.cpan.orgdconwayParse-RecDescent-v1.95.1libParseRecDescent.pmSubrulestxb> I want distinct geoloc values, so I did this:txb> geoloc: geoloc1 and() geoloc2 geoloc_txb> geeloc1: geoloc_txb> geeloc2: geoloc_txb> geoloc_: city state country.http://www.nntp.perl.org/group/perl.recdescent/2007/10/msg514.html subrule of subrule immediately fails by terrence.x.brannon- October 23, 2007 The following grammar (piece) works fine:geoloc: geoloc_ and() geoloc_ geoloc_geoloc_: city state country areabut per http:search.cpan.orgdconwayParse-RecDescent-v1.95.1libParseRecDescent.pmSubrulesI want distinct geoloc values, so I did this:geoloc: geoloc1 and() geoloc2 geoloc_geeloc1: geoloc_geeloc2: geoloc_geoloc_: city state country areabut then the autotrace immediately fails: 2tok_of_ty " bahrain kuwait" 2tok_of_tyTrying subrule:...http://www.nntp.perl.org/group/perl.recdescent/2007/10/msg513.html |