public void AbortTranslation(PascalErrorCode errorCode, Parser parser) { var fatalText = $"FATAL ERROR: " + errorCode.ToString(); parser.SendMessage(new Message(MessageType.SyntaxError, new object[] { 0, 0, "", fatalText })); Environment.Exit(errorCode.GetStatus()); }
public void Flag(Token token, PascalErrorCode errorCode, Parser parser) { parser.SendMessage(new Message(MessageType.SyntaxError, new object[] { token.LineNumber, token.Position, token.Text, errorCode.ToString() })); ErrorCount++; if (ErrorCount > MaxErrors) { AbortTranslation(PascalErrorCode.TooManyErrors, parser); } }