Uploaded July 2013 | Updated November 2026, 5 days ago
In this tute we'll program a token class for our calculator. When the user of our calculators types an expression into the calculator and presses the equals key, we want to split the expression into parts called tokens which our shunting yard and expression calculator will use.
Also, there's a million ways to program this algorithm. This token class is something I like because I think it makes things easier to understand. If you were writing a shunting yard that needed to perform very quickly, you might want to evaluate tokens in the shunting yard algorithm instead of making a separate class.
In this tute we'll program a token class for our calculator. When the user of our calculators types an expression into the calculator and presses the equals key, we want to split the expression into parts called tokens which our shunting yard and expression calculator will use.
Also, there's a million ways to program this algorithm. This token class is something I like because I think it makes things easier to understand. If you were writing a shunting yard that needed to perform very quickly, you might want to evaluate tokens in the shunting yard algorithm instead of making a separate class.










