A simple formula parser in java