| Next | Higher-Order Parsing | 13 |
expression → "(" expression ")"
| term ("+" expression | nothing)
The simplest parser is the one that corresponds to nothing
It consumes no tokens and always succeeds:
sub nothing {
my $tokens = shift;
return (undef, $tokens);
}
The undef here is a dummy value
| Next | ![]() |
![]() |
Copyright © 2007 M. J. Dominus |