changed parser from inheritance to delegation to scanner