|I wrote this something like a year ago but ran into it today, so I thought I'd post it. Anyways this takes a string of basic commands arranged in postfix and runs it through a lexer and parser/interpreter. This bit of code handles some unary and binary operators, variables, input and output, and if/elseif/else statements.|
Obviously it is an extremely slow/limited implementation but with a bit of work and playing around it can easily be made better.
Add more functions!
Use something other than a space to separate tokens so you can put spaces in string literals
Use the shunting yard algorithm or similar to allow the user to input regular infix algebra
Tokenize the program beforehand to speed things up
Get rid of every string except string literals to speed things up drastically
If you have any questions just ask.