Thanks to all that responded. Cleaning up my parser was a success. I still
have a question:
-----Original Message-----
From: Ted Zlatanov
Sent: Tuesday, July 23, 2002 4:21 PM
To: Brian Michalk
Cc: Marco Baringer; recdescent@perl.org
Subject: Re: Parse::RecDescent and catenating (no skip match)
To answer your question as best I can, I think you want the

<skip: qr/,?/>

directive in general, applied to your top rule, instead of accessing
$skip directly. See the Parse::RecDescent documentation on the <skip>
directive. From the doc:
Why is the skip token attached to a rule? I have my grammar written such
that a lot of different rules can borrow from the same atomic subrules.
Take for instance, a color definition. It could be used as a field in a
person's favorite color, or in the DuPont catalog. If I used the skip
directive, I would have to put it in every concievable entry point in the
grammar, and I really don't know where someone is going to enter the
grammar. So I would be forced to do it this way:

my $contrived_grammar = q{
dupont_catalog: <skip: qr/,?/>

personal_favorites: <skip: qr/,?/>

color: <skip: qr/,?/>

# I gotta set the skip, because the following rule has to work:
print "Yay!!! Its a color-- $somestring" if (defined

Search Discussions

Discussion Posts


Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 10 of 11 | next ›
Discussion Overview
grouprecdescent @
postedJul 23, '02 at 1:54p
activeJul 25, '02 at 2:27p



site design / logo © 2018 Grokbase