I saw in sbase's TODO that expr had been imported from OpenBSD and needed "replacing or cleaning up." I decided to give it a try with yacc. It turned out very different from what I expected due to the need to convert between strings and numbers. It's about 3.5x smaller than the existing implementation. I'd like feedback, particularly on whether or not the use of yacc is suckless here. If you like the implementation I'd be happy to finish cleaning it up and change it to sbase style.
I've attached it to the email and provided a link[0]. -emg [0] http://sprunge.us/WBPF
expr.y
Description: Binary data