Parser helpers, used to handle in a standard way different parser events and states.