nido203 has asked for the wisdom of the Perl Monks concerning the following question:
Hello! I have a problem with converting this grammar to BNF version in Perl. I am using Parse RecDescent
$grammar = q{ start: seq seq: '(' seqstr(s) ')' seqstr: seq | tagstr tagstr: OZN ( seq | rijec ) OZN: /[A-Z.,?'*:`*]+ / rijec: /[\w-?,:<*`*]+/ };
i tried this but it is not working.
use Grammar::BNF; my $g = Grammar::BNF.generate(Q:to<END> <start> => <seq> <seq> => '(' <seqstr(s)> ')' <seqstr> => <seq> | <tagstr> <tagstr> => <OZN> '(' <seq> | <rijec> ')' <OZN> => /[A-Z.,?'*:`*]+ / <rijec> => /[\w-?,:<*`*]+/ END );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: converting context free grammar to BNF
by Corion (Patriarch) on May 28, 2016 at 21:08 UTC | |
|
Re: converting context free grammar to BNF
by hexcoder (Curate) on May 28, 2016 at 21:34 UTC | |
by nido203 (Novice) on May 29, 2016 at 14:56 UTC | |
by haukex (Archbishop) on May 29, 2016 at 15:28 UTC | |
|
Re: converting context free grammar to BNF
by choroba (Cardinal) on May 29, 2016 at 16:48 UTC | |
by nido203 (Novice) on May 31, 2016 at 18:07 UTC | |
by haukex (Archbishop) on May 31, 2016 at 18:42 UTC | |
by nido203 (Novice) on Jun 03, 2016 at 17:57 UTC | |
by haukex (Archbishop) on Jun 04, 2016 at 09:45 UTC | |
|