Refactored parse code so that it sits in the correct rule and symbol classes rather than switching on types.