Turns parser into a class, now called by the main program.