Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Dynamic expansion of tokens with Parse::RecDescent

by jaldhar (Vicar)
on Aug 19, 2004 at 20:17 UTC ( #384439=note: print w/replies, xml ) Need Help??


in reply to Dynamic expansion of tokens with Parse::RecDescent

Thanks to all that replied. amw1's code was helpful but didn't deal with the possibility of multiple-word color names. I like how he got the completed order into a data structure though.

ikegami's advice to seperate tokenizing and parsing was good and I will probably have to go that way soon to deal with things like "burnt umber", "lt. blk" etc. It seems it will be easier and more modular. Unfortunately I have a lot of input already in a fixed format so I can't quote the color names. I'll see if it can be changed for future input.

In the end I went with a variation on solo and revdiablo's suggestions:

color: /(??{join ("|", @colors)})/

--
જલધર

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://384439]
help
Chatterbox?
[markong]: ahah thanks Corion :)
[Eily]: Discipulus usually it's while testing that you want the full logs :)
[Eily]: anyway, maybe you can ignore STDERR ? (I'm not sure about @CARP_NOT, it looks like it only changes the place the error comes from)
[markong]: " Perl: the Markov chain saw" :D aha
[Discipulus]: thanks 1nickt but seems i'm not able to use it correctly...
[Discipulus]: Eily i'm testing a failure: i ok if i get bad results.. perhaps there is another way to do it...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2018-01-22 11:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (233 votes). Check out past polls.

    Notices?