Parrot/PGE, parsers Parsers, Perl 6 Rules, and the Parrot Grammar Engine #35

Syntax errors w/die

Here's our original if_statement again:

rule if_statement { if <expression> then <statement> }

If the input string looks like

if a == 3 print 5;

the rule fails because of the lack of a 'then' token, but we don't have much more information than the fact that the rule failed for some reason.

Copyright © 2006 Patrick Michaud