Add syntax error counter

Added an error counter to the parser. It can be retrieved by calling
getErrorCount(). An error count > 0 means that the compiler will not
carry out translation after the semantic analysis phase.