Next | Higher-Order Parsing | 12 |
The description on the previous slide sounds complicated
But there are only a few fundamental operations:
Look for a certain token
Look for either of x or y
Look for x followed by y
Look for nothing
A HOP::Parser parser will be a function that takes a token array
It examines some tokens
If it likes what it sees, it constructs a value
Then it returns the value and the remaining tokens
Otherwise, it returns undef
Next | Copyright © 2007 M. J. Dominus |