Added main loop of parser.