You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
� perl6 -v
This is Rakudo version 2017.07 built on MoarVM version 2017.07
implementing Perl 6.c.
� cat flail.pl
use v6;
grammar Flail {
rule TOP { <B> }
rule B { <A> 'x' 'y' | <C> }
rule A { '' | 'x' 'z' }
rule C { <C> 'w' | 'v' }
}
Flail.parse('x z x y').say;
Flail.parse('v w w w w w w').say;
� perl6 flail.pl
ï½¢x z x yï½£
B => ï½¢x z x yï½£
A => ï½¢x z ï½£
^C
The execution simply goes into infinite loop with the second input.
This is the least awesome failure mode.
Compare with Pegex and Regexp::Grammars, which emit a recursion
warning/error. Compare with Antlr4, where the grammar is effectively a
compile time error. Compare with Eyapp and Marpa, which can consume
this grammar and set of inputs without any problem.
I realise that the parser cannot be simply changed since it also parses
Perl6 source code. But since it is now shown that the parser is not a
general parser able to consume arbitrary valid CFG, then at least the
documentation must mention somewhere
* what the name/classification of the underlying technology/algorithm
of the parser is and
* what its shortcomings are (with examples)
Migrated from rt.perl.org#132004 (status was 'open')
Searchable as RT132004$
The text was updated successfully, but these errors were encountered: