Starky has asked for the wisdom of the Perl Monks concerning the following question:
Like many languages, semicolons separate statements. However, there may be semicolons in quotes; e.g.,:
I am inclined to start with something likeThis is a statement ; Another statement ; A statement "with a quoted ';'" ;
but am stuck on how to elegantly handle the quoting issues. Does one need to resort to a big, nasty regex or is there a more elegant way?startrule: statement(s /;/) statement: ...
I've taken a look at resources such as the Parse::RecDescent Tutorial but haven't been able to find an answer. This seems the kind of thing that P::RD monks would have encountered on many an occasion.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parsing Statements with Quotes in Parse::RecDescent
by Anonymous Monk on Feb 04, 2008 at 16:35 UTC | |
by Starky (Chaplain) on Feb 05, 2008 at 14:23 UTC | |
|
Re: Parsing Statements with Quotes in Parse::RecDescent
by ikegami (Patriarch) on Feb 05, 2008 at 18:22 UTC | |
|
Re: Parsing Statements with Quotes in Parse::RecDescent
by ikegami (Patriarch) on Feb 05, 2008 at 18:09 UTC | |
|
Re: Parsing Statements with Quotes in Parse::RecDescent
by metaperl (Curate) on Feb 05, 2008 at 17:55 UTC |