implement parser chooser