4 ms·
When you do precedence like this in recdesc, you will get functions like parse_prec_1, parse_prec_2 and so forth. If you generalize this function body, and pass
by bruce343434 4y ago
When you do precedence like this in recdesc, you will get functions like parse_prec_1, parse_prec_2 and so forth. If you generalize this function body, and pass along a "current precedence", then generalize the precedences for each operator into a table, you have just reinvented Pratt Parsing.