Problems with a shunting yard algorithm
I have successfully implemented a shunting yard algorithm in java. The algorithm itself was simple however I am having trouble with the tokenizer. Currently the algorithm works with everything I want excluding one thing. How can I tell the difference between subtraction(-) and negative (-) such as 4-3 is subtraction but -4+3 is negative I now know how to find out when it should be a negative and when it should be a minus, but where in the algorithm should it be placed because if you use it like a function it wont always work for example 3 + 4 * 2 / -( 1 − 5 ) ^ 2 ^ 3 when 1-5 becomes -4 it