Prerequisite: learn the basics of the language. For example that you can use an indexer on a string or how to use lists instead of arrays. Learn about how logic operators work, your while
condition for example is always true or throws an exception, it also seems out of place as there is no nested loop here but it looks like it belongs in one. Bottom line is - you're going in too deep and too fast.
If you're a beginner and looking to learn parsing... go back to the books and read some theory, find out what Reverse Polish Notation is and how to use it
If you're looking to solve the parsing problem in order to solve some other task look at FLEE, it can do the parsing for you and will likely be more useful from a practical standpoint (although theoretical knowledge has its merits and shouldn't be dismissed)