Moved terminal parser methods to their own class.