Parsing nested expressions using Bison

I modified my tipcalc program to handle expressions of arbitrary depth, so now it can handle input like ((($100 + 2%) + 2%) - 3%) + 3.5%. The trick was to change the start symbol to match binary_expre

Read More…

Tip calculation using Bison grammar

As long as I’ve been able to do arithmetic, I’ve been able to figure out calculating taxes and tips, it’s easy. Given a dollar value $17.91 we can figure out the total with a tip of

Read More…

All Posts by Category or Tags.