How to speed up a grammar

2009-06-06 Thread Richard Hainsworth
Leon Timmermans wrote: If you want to write a fast parser for XML, preventing backtracking is going to be quite essential. I suspect the problem is your grammar, not the grammar engine itself. You could post it to perl6-users and ask for advice on it. Leon Below is the grammar. I am only

Re: RPN calculator in Perl 6

2009-06-06 Thread Daniel Carrera
Daniel Ruoso wrote: TIMTOWTDI ;) The objective of the blog was more about the learning + teaching experience than anything else. http://sial.org/pbot/37075 % perl rpn.pl 2 2 + Semicolon seems to be missing at rpn.pl line 2. String found where operator expected at rpn.pl line 13, near

Re: RPN calculator in Perl 6

2009-06-06 Thread Daniel Carrera
Daniel Carrera wrote: http://sial.org/pbot/37075 % perl rpn.pl 2 2 + Tee hee... that should have been perl6. :-) Ok, try again: % perl6 rpn.pl 2 2+ 2 2

Re: How to speed up a grammar

2009-06-06 Thread Minimiscience
On Jun 6, 2009, at 10:32 AM, Richard Hainsworth wrote: rule element { '' name attribute* [ | '/' | '' element* '/' $name '' ] } This is just a wild, uneducated, possibly delusional guess, but I don't think that vertical bar before the '/' should be there. I think it might be causing the

Re: RPN calculator in Perl 6

2009-06-06 Thread Minimiscience
[I just realized I sent this directly to Daniel rather than to the list, so for the benefit of onlookers...] On Jun 6, 2009, at 1:51 PM, Daniel Carrera wrote: Daniel Ruoso wrote: Yes... that's what wasn't implemented... But now it is ;) http://sial.org/pbot/37085 Close, but... % perl6