Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Returning contents of subrules matches with Parse::RecDescent

by merlyn (Sage)
on Sep 29, 2000 at 07:43 UTC ( #34559=note: print w/ replies, xml ) Need Help??


in reply to Returning contents of subrules matches with Parse::RecDescent

A tuple is, at the least, an alternating integer-dot sequence with at minimum two repetitions of the integer-dot sequence. E.g: 2343.23423. is the minimum that a tuple may be.
I don't know REBOL, although I've looked at it a couple times. But I do know a bit of Parse::RecDescent. Try this:
tuple: (numberdot){2..} number(?) { [@{$item[1]}, @{$item[2]}] } numberdot: number dot { $item[1] } number: /(\d+)/ dot: /\./
All the shenanigans are necessary because you want to peer down into the arrayrefs returned from both $item[1] and $item[2]. Untested, but I think it's pretty close. I might be off an indirection or two. {grin}

-- Randal L. Schwartz, Perl hacker


Comment on Re: Returning contents of subrules matches with Parse::RecDescent
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://34559]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2014-09-15 05:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (145 votes), past polls