Ejemplo n.º 1
0
        public void Fatal(ILangErrorCode errorCode, Parser parser)
        {
            Parser.OnMessage(parser, MessageType.SyntaxError, new Dictionary<string, object>()
            {
                {"LineNumber", 0},
                {"Position", 0},
                {"TokenText", ""},
                {"Error", "FATAL ERROR: " + errorCode}
            });

            Environment.Exit(errorCode.Status);
        }
Ejemplo n.º 2
0
        public void Flag(Token token, ILangErrorCode errorCode, Parser parser)
        {
            Parser.OnMessage(parser, MessageType.SyntaxError, new Dictionary<string, object>()
            {
                {"LineNumber", token.LineNumber},
                {"Position", token.Position},
                {"TokenText", token.Text},
                {"Error", errorCode}
            });

            if (++errors > MAX_ERROR)
                Fatal("too_many_errors", parser);
        }