Perl: the Markov chain saw | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Before reaching for Marpa, make sure you need it. Is the language you're trying to recognise more complex than regular? See Chomsky hierarchy for explanation.
If it's regular, regular expressions should do just well. Using a context-free grammar is an overkill. I don't know what combinations are possible, but I have a feeling there's no nesting involved which would mean you don't need to go context-free.
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
In reply to Re: First steps with Marpa::R2 and BNF
by choroba
|
|