Defining a bottom-up parser
Use Perl 6-like proto subs to define tokens
token term { ... } proto term: is parsed(&term) { ... } proto infix:<*> is looser('term:') { ... } proto infix:</> is equiv(infix:<*>) { ... } proto infix:<+> is looser(infix:<*>) { ... } proto infix:<-> is equiv(infix:<+>) { ... } proto circumfix:<( )> is equiv('term:') { ... }