On Thu, Nov 13, 2014 at 11:05 PM, Evan Gates <evan.ga...@gmail.com> wrote: > After the troubles with yaac and the makefile last time around I wrote > another expr, this time in C, using Dijkstra's shunting-yard > algorithm[0]. The end result is still less than half the length of the > existing recursive descent expr, and provides slightly better error > messages than my last attempt. Included patch: sbase-new_expr2.diff >
Cool, but a few notes. I sent patches for the previous yacc version but some of these changes are not in this version namely: - Don't crash on divide by zero (check for zero with divide and mod). - Use regerror() when regcomp() fails for descriptive error messages (and add the eregcomp() from my previous patch to util?) - Use snprintf and add a size_t bufsiz argument to the valstr() function. The current version is safe, but it's easy to mess these things up. Kind regards, Hiltjo