Defining a bottom-up parser
1. Use Perl 6-like proto subs to define tokens
## terms token term { <value> {*} } proto term: is parsed(&term) is precedence('=') { ... } ## multiplicative proto infix:<*> is looser('term:') { ... } proto infix:</> is equiv(infix:<*>) { ... } ## additive proto infix:<+> is looser(infix:<*>) { ... } proto infix:<-> is equiv(infix:<+>) { ... }continued...