in reply to Parsing Statements with Quotes in Parse::RecDescent

The elegant way is to define tokens and delimiters. Set up a rule that defines a string first. Start by looking for a quote and stopping when you find the next quote. Then you won't worry about stripping out semi-colons.

Do a super search on this module's name and you will find lots of examples to work from.

  • Comment on Re: Parsing Statements with Quotes in Parse::RecDescent

Replies are listed 'Best First'.
Re^2: Parsing Statements with Quotes in Parse::RecDescent
by Starky (Chaplain) on Feb 05, 2008 at 14:23 UTC
    Ah, the old "once you find a quote, keep going until you find the next one" trick.

    Somehow, I suspected there would be something fancier involved. I seem to have outsmarted myself.