I just wanted to say that this code is a good first effort, but a bit misguided as far as parsers go.
I suggest reading the first few chapters of the dragon book to get an idea of how to think about a problem like this.
“Compilers: Principles, Techniques, and Tools”, Aho, et. al.