lets say I\'ve written a function to evaluate a simple mathematical operation, and I have some user input in a string such as: \"1 + [2 + [3+4]]\" How can I parse these squa
For Java, you could use JavaCC for parser/lexer. I have used this one in numerous projects. It's pretty easy to use. One of the examples, I think, includes an arithmetic parsing. JavaCC will build the syntax tree where you could walk through.
Trying out arithmetic using JavaCC would give good intro to Context Free Grammar and the concept of Abstract Syntax Tree. If you are learning, then it is a good step to take after trying out what @emboss suggested