Example #1
0
 public WarningMessage (int code, Syntax.Location loc, Syntax.Location endLoc, string error, List<string> extraInformation)
 {
     MessageType = "Warning";
     Code = code;
     Text = error;
     Location = loc;
     EndLocation = endLoc;
     IsWarning = true;
 }
Example #2
0
 public void ErrorCode (int code, Syntax.Location loc, Syntax.Location endLoc, params object[] args)
 {
     string m = "";
     switch (code) {
         case 103:
             m = "'{0}' not found";
             break;
         default:
             Error (code, loc, endLoc, string.Join (", ", args));
             return;
     }
     Error (code, loc, endLoc, m, args);
 }
Example #3
0
        public void Warning (int code, Syntax.Location loc, Syntax.Location endLoc, string warning)
        {
            if (_reportingDisabled > 0)
                return;

            var msg = new WarningMessage (code, loc, endLoc, warning, _extraInformation);
            _extraInformation.Clear ();

            if (!_previousErrors.ContainsKey (msg)) {
                _previousErrors[msg] = true;
                _printer.Print (msg);
            }
        }
Example #4
0
 public ErrorMessage(int code, Syntax.Location loc, string error, List <string> extraInformation)
 {
     MessageType = "Error";
     Code        = code;
     Text        = error;
     Location    = loc;
     IsWarning   = false;
     if (extraInformation != null)
     {
         RelatedSymbols = new List <string> ();
         RelatedSymbols.AddRange(extraInformation);
     }
 }
        public void Error(int code, Syntax.Location loc, Syntax.Location endLoc, string error)
        {
            if (_reportingDisabled > 0)
            {
                return;
            }

            var msg = new ErrorMessage(code, loc, endLoc, error, _extraInformation);

            _extraInformation.Clear();

            if (!_previousErrors.ContainsKey(msg))
            {
                _previousErrors[msg] = true;
                _printer.Print(msg);
            }
        }
Example #6
0
 public void Error (int code, Syntax.Location loc, Syntax.Location endLoc, string format, params object[] args)
 {
     Error (code, loc, endLoc, String.Format (format, args));
 }