in reply to Parse RecDescent Nesting (Followup)
That should be enough to hang the proper return values from.document: chunk(s?) /\z/ chunk: open chunk close | word(s) open: "<open>" close: "<close>" word: /\w+/
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
document: stuff /\z/ { return $item{stuff} } stuff: chunk(s?) { return [map {@$_} @{$item[1]} ] } # flatten adjacen +t arrayrefs chunk: open stuff close { return $item{stuff} } | word(s?) # returns a +rrayref open: "<open>" close: "<close>" word: /\w+/
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Parse RecDescent Nesting (Followup)
by tphyahoo (Vicar) on Jan 21, 2005 at 15:53 UTC | |
by merlyn (Sage) on Jan 21, 2005 at 23:55 UTC | |
by bart (Canon) on Jan 22, 2005 at 13:07 UTC |