Next | Higher-Order Parsing | 24 |
$expression = L("(") - $EXPRESSION - L(")") | $TERM - (L("+") - $EXPRESSION | $nothing);
This looks almost exactly like the grammar rule we're implementing
expression → "(" expression ")" | term ("+" expression | nothing)
It also looks a lot like a Parse::RecDescent specification
But it's actually Perl code, not a limited sub-language
I'll use this notation from now on
Next | Copyright © 2007 M. J. Dominus |