Esempio n. 1
0
        public void abortTranslation(PascalErrorCode errorCode, Parser parser)
        {
            String fatalText = "FATAL ERROR: " + errorCode.ToString();

            parser.sendMessage(new Message(MessageType.SYNTAX_ERROR, new Object[] { 0, 0, "", fatalText }));
            Environment.Exit(errorCode.status);
        }
        public void flag(Token token, PascalErrorCode errorCode, Parser parser)
        {
            // Notify parser's listeners
            parser.sendMessage(new Message(MessageType.SYNTAX_ERROR, new Object[] { token.lineNumber,
                                                                                    token.position,
                                                                                    token.text,
                                                                                    errorCode.ToString()}));

            if (++errorCount > MAX_ERRORS)
                abortTranslation(PascalErrorCode.TOO_MANY_ERRORS, parser);
        }
Esempio n. 3
0
        public void flag(Token token, PascalErrorCode errorCode, Parser parser)
        {
            // Notify parser's listeners
            parser.sendMessage(new Message(MessageType.SYNTAX_ERROR, new Object[] { token.lineNumber,
                                                                                    token.position,
                                                                                    token.text,
                                                                                    errorCode.ToString() }));

            if (++errorCount > MAX_ERRORS)
            {
                abortTranslation(PascalErrorCode.TOO_MANY_ERRORS, parser);
            }
        }
 public void abortTranslation(PascalErrorCode errorCode, Parser parser)
 {
     String fatalText = "FATAL ERROR: " + errorCode.ToString();
     parser.sendMessage(new Message(MessageType.SYNTAX_ERROR, new Object[] {0, 0, "", fatalText}));
     Environment.Exit(errorCode.status);
 }