I love writing parsers like this. Add in Pratt Parsing for operator precedence and writing parsers can be really easy.