Ejemplo n.º 1
0
 protected AbstractMessage(AbstractMessage aMsg)
 {
     this.code       = aMsg.code;
     this.location   = aMsg.location;
     this.message    = aMsg.message;
     this.extra_info = aMsg.extra_info;
 }
Ejemplo n.º 2
0
 protected AbstractMessage(AbstractMessage aMsg)
 {
     this.code = aMsg.code;
     this.location = aMsg.location;
     this.message = aMsg.message;
     this.extra_info = aMsg.extra_info;
 }
Ejemplo n.º 3
0
		public override bool Equals (object obj)
		{
			AbstractMessage msg = obj as AbstractMessage;
			if (msg == null)
				return false;

			return code == msg.code && location.Equals (msg.location) && message == msg.message;
		}
Ejemplo n.º 4
0
 void OnMessage(AbstractMessage msg)
 {
     var m = _printer;
     if (m != null)
     {
         m(msg);
     }
 }
Ejemplo n.º 5
0
        public override void Print(AbstractMessage msg)
        {
            base.Print(msg);

            if (Stacktrace)
            {
                Console.WriteLine(FriendlyStackTrace(new StackTrace(true)));
            }
        }
Ejemplo n.º 6
0
        public override void Print(AbstractMessage message, Boolean showFullPath)
        {
            if (message.IsWarning)
                Trace.WriteLine("Warning: " + message.Text);
            else
                Trace.WriteLine("Error: " + message.Text);

            base.Print(message, showFullPath);
        }
Ejemplo n.º 7
0
            public void AddMessage(AbstractMessage msg)
            {
                if (session_messages == null)
                {
                    session_messages = new ArrayList();
                }

                session_messages.Add(msg);
            }
Ejemplo n.º 8
0
 public virtual void Print(AbstractMessage msg)
 {
     if (msg.IsWarning)
     {
         ++warnings;
     }
     else
     {
         ++errors;
     }
 }
Ejemplo n.º 9
0
		public virtual void Print (AbstractMessage msg)
		{
			if (msg.IsWarning) {
				++WarningsCount;
			} else {
				++ErrorsCount;

				if (ErrorsCount == FatalCounter)
					throw new Exception (msg.Text);
			}
		}
Ejemplo n.º 10
0
 public virtual void Print(AbstractMessage msg, bool showFullPath)
 {
     if (msg.IsWarning)
     {
         ++WarningsCount;
     }
     else
     {
         ++ErrorsCount;
     }
 }
Ejemplo n.º 11
0
            /// <summary>
            /// Handles compilation event message.
            /// </summary>
            /// <param name="msg">The compilation event message.</param>
            /// <param name="showFullPath">if set to <c>true</c> [show full path].</param>
            public override void Print(Mono.CSharp.AbstractMessage msg, bool showFullPath)
            {
                string msgInfo = string.Format("{0} {1} CS{2:0000}: {3}", msg.Location, msg.MessageType, msg.Code, msg.Text);

                if (!msg.IsWarning)
                {
                    Errors.Add(msgInfo);
                }
                else
                {
                    Warnings.Add(msgInfo);
                }
            }
Ejemplo n.º 12
0
        public override void Print(AbstractMessage msg)
        {
            base.Print(msg);

            if (Stacktrace)
            {
                Console.WriteLine(FriendlyStackTrace(new StackTrace(true)));
            }

            if (++print_count == Fatal)
            {
                throw new Exception(msg.Text);
            }
        }
Ejemplo n.º 13
0
		public override void Print (AbstractMessage msg)
		{
			//
			// This line is useful when debugging recorded messages
			//
			// Console.WriteLine ("RECORDING: {0}", msg.ToString ());

			if (session_messages == null)
				session_messages = new List<AbstractMessage> ();

			session_messages.Add (msg);

			base.Print (msg);
		}
Ejemplo n.º 14
0
		public void EndSession ()
		{
			if (session_messages == null)
				return;

			//
			// Handles the first session
			//
			if (common_messages == null) {
				common_messages = new List<AbstractMessage> (session_messages);
				merged_messages = session_messages;
				session_messages = null;
				return;
			}

			//
			// Store common messages if any
			//
			for (int i = 0; i < common_messages.Count; ++i) {
				AbstractMessage cmsg = common_messages[i];
				bool common_msg_found = false;
				foreach (AbstractMessage msg in session_messages) {
					if (cmsg.Equals (msg)) {
						common_msg_found = true;
						break;
					}
				}

				if (!common_msg_found)
					common_messages.RemoveAt (i);
			}

			//
			// Merge session and previous messages
			//
			for (int i = 0; i < session_messages.Count; ++i) {
				AbstractMessage msg = session_messages[i];
				bool msg_found = false;
				for (int ii = 0; ii < merged_messages.Count; ++ii) {
					if (msg.Equals (merged_messages[ii])) {
						msg_found = true;
						break;
					}
				}

				if (!msg_found)
					merged_messages.Add (msg);
			}
		}
Ejemplo n.º 15
0
        public override void Print(Compiler.AbstractMessage msg, bool showFullPath)
        {
            string text;

            if (msg.Code == 214)
            {
                text = "Pointers and fixed size buffers cannot be used in a dynamic context";
            }
            else
            {
                text = msg.Text;
            }

            throw new RuntimeBinderException(text);
        }
Ejemplo n.º 16
0
        public override void Print(AbstractMessage msg)
        {
            //
            // This line is useful when debugging recorded messages
            //
            // Console.WriteLine ("RECORDING: {0} {1} {2}", code, location, message);

            if (session_messages == null)
            {
                session_messages = new ArrayList();
            }

            session_messages.Add(msg);

            base.Print(msg);
        }
Ejemplo n.º 17
0
        public override void Print(AbstractMessage msg, bool showFullPath)
        {
            //
            // This line is useful when debugging recorded messages
            //
            // Console.WriteLine ("RECORDING: {0}", msg.Text);

            if (session_messages == null)
            {
                session_messages = new List <AbstractMessage> ();
            }

            session_messages.Add(msg);

            this.showFullPaths = showFullPath;
            base.Print(msg, showFullPath);
        }
 public override void Print(AbstractMessage msg, bool showFullPath)
 {
     if (msg.IsWarning)
     {
         ++WarningsCount;
     }
     else
     {
         ++ErrorsCount;
     }
     compilerResults.Errors.Add(new CompilerError()
     {
         IsWarning = msg.IsWarning,
         Column = msg.Location.Column,
         Line = msg.Location.Row,
         ErrorNumber = msg.Code.ToString(),
         ErrorText = msg.Text,
         FileName = showFullPath ? msg.Location.SourceFile.FullPathName : msg.Location.SourceFile.Name,
         // msg.RelatedSymbols // extra info
     });
 }
Ejemplo n.º 19
0
        protected void Print(AbstractMessage msg, TextWriter output, bool showFullPath)
        {
            StringBuilder txt = new StringBuilder();

            if (!msg.Location.IsNull)
            {
                if (showFullPath)
                {
                    txt.Append(msg.Location.ToStringFullName());
                }
                else
                {
                    txt.Append(msg.Location.ToString());
                }

                txt.Append(" ");
            }

            txt.AppendFormat("{0} CS{1:0000}: {2}", msg.MessageType, msg.Code, msg.Text);

            if (!msg.IsWarning)
            {
                output.WriteLine(FormatText(txt.ToString()));
            }
            else
            {
                output.WriteLine(txt.ToString());
            }

            if (msg.RelatedSymbols != null)
            {
                foreach (string s in msg.RelatedSymbols)
                {
                    output.WriteLine(s + msg.MessageType + ")");
                }
            }
        }
Ejemplo n.º 20
0
		public virtual void Print (AbstractMessage msg, bool showFullPath)
		{
			if (msg.IsWarning) {
				++WarningsCount;
			} else {
				++ErrorsCount;
			}
		}
Ejemplo n.º 21
0
		public override void Print (AbstractMessage msg, bool showFullPath)
		{
			//
			// This line is useful when debugging recorded messages
			//
			// Console.WriteLine ("RECORDING: {0}", msg.Text);

			if (session_messages == null)
				session_messages = new List<AbstractMessage> ();

			session_messages.Add (msg);

			this.showFullPaths = showFullPath;
			base.Print (msg, showFullPath);
		}
Ejemplo n.º 22
0
		protected void Print (AbstractMessage msg, TextWriter output)
		{
			StringBuilder txt = new StringBuilder ();
			if (!msg.Location.IsNull) {
				txt.Append (msg.Location.ToString ());
				txt.Append (" ");
			}

			txt.AppendFormat ("{0} CS{1:0000}: {2}", msg.MessageType, msg.Code, msg.Text);

			if (!msg.IsWarning)
				output.WriteLine (FormatText (txt.ToString ()));
			else
				output.WriteLine (txt.ToString ());

			if (msg.RelatedSymbols != null) {
				foreach (string s in msg.RelatedSymbols)
					output.WriteLine (s + msg.MessageType + ")");
			}
		}
Ejemplo n.º 23
0
			public override void Print (AbstractMessage msg, bool showFullPath)
			{
				var line = 0;
				var column = 0;
				try {
					line = msg.Location.Row;
					column = msg.Location.Column;
				} catch {
					//Log (ex);
				}
				var m = new EvalMessage {
					MessageType = msg.MessageType,
					Text = msg.Text,
					Line = line,
					Column = column,
				};

				Messages.Add (m);

				//
				// Print it to the console if there's an error
				//
				if (msg.MessageType == "error") {
					var tm = msg.Text;
					System.Threading.ThreadPool.QueueUserWorkItem (_ =>
						Console.WriteLine ("ERROR: {0}", tm));
				}
			}
Ejemplo n.º 24
0
		public override void Print (AbstractMessage msg)
		{
			//
			// This line is useful when debugging recorded messages
			//
			// Console.WriteLine ("RECORDING: {0}", msg.ToString ());

			if (session_messages == null)
				session_messages = new List<AbstractMessage> ();

			session_messages.Add (msg);

			base.Print (msg);
		}
Ejemplo n.º 25
0
		public ErrorMessage (AbstractMessage aMsg)
			: base (aMsg)
		{
		}
Ejemplo n.º 26
0
			public void AddMessage (AbstractMessage msg)
			{
				if (session_messages == null)
					session_messages = new ArrayList ();

				session_messages.Add (msg);
			}
Ejemplo n.º 27
0
 public override void Print(AbstractMessage msg, bool showFullPath)
 {
     Client.SendChat(ChatColors.Red + msg.Text);
 }
Ejemplo n.º 28
0
		public override void Print (AbstractMessage msg)
		{
			Assert.Fail (msg.Text);
		}
Ejemplo n.º 29
0
		public override void Print (AbstractMessage msg)
		{
			Print (msg, writer);
			base.Print (msg);
		}
Ejemplo n.º 30
0
		public override void Print (AbstractMessage msg, bool showFullPath)
		{
			Assert.Fail (msg.Text);
		}
Ejemplo n.º 31
0
 public override void Print(AbstractMessage msg)
 {
     messages.Append(msg.Text);
 }
Ejemplo n.º 32
0
 public override void Print(AbstractMessage msg, bool showFullPath)
 {
     Message = msg;
 }
Ejemplo n.º 33
0
		public override void Print (AbstractMessage msg, bool showFullPath)
		{
			Print (msg, writer, showFullPath);
			base.Print (msg, showFullPath);
		}
Ejemplo n.º 34
0
 public ErrorMessage(AbstractMessage aMsg)
     : base(aMsg)
 {
 }
 public override void Print(AbstractMessage msg, bool showFullPath)
 {
     base.Print(msg, showFullPath);
     _errorReporter.Region = new DomRegion(msg.Location.NameFullPath, msg.Location.Row, msg.Location.Column, msg.Location.Row, msg.Location.Column);
     _errorReporter.Message(msg.IsWarning ? MessageSeverity.Warning : MessageSeverity.Error, msg.Code, msg.Text.Replace("{", "{{").Replace("}", "}}"));
 }
Ejemplo n.º 36
0
 public override void Print(AbstractMessage msg)
 {
     base.Print(msg);
     _r.OnMessage(msg);
 }
Ejemplo n.º 37
0
 public override void Print(Compiler.AbstractMessage msg)
 {
     throw new RuntimeBinderException(msg.Text);
 }
Ejemplo n.º 38
0
		public override void Print (AbstractMessage msg)
		{
			Print (msg, writer);
			base.Print (msg);
		}
Ejemplo n.º 39
0
		public override void Print (AbstractMessage msg)
		{
			base.Print (msg);

			if (Stacktrace)
				Console.WriteLine (FriendlyStackTrace (new StackTrace (true)));

			if (++print_count == Fatal)
				throw new Exception (msg.Text);
		}
Ejemplo n.º 40
0
			public override void Print (AbstractMessage msg)
			{
				base.Print (msg);
				Error newError = new Error (msg.IsWarning ? ErrorType.Warning : ErrorType.Error, msg.Location.Row, msg.Location.Column, msg.Text);
				Errors.Add (newError);
			}
Ejemplo n.º 41
0
		public virtual void Print (AbstractMessage msg)
		{
			if (msg.IsWarning)
				++warnings;
			else
				++errors;
		}
Ejemplo n.º 42
0
//			public readonly List<Error> Errors = new List<Error> ();
			
			public override void Print (AbstractMessage msg)
			{
				Console.WriteLine (msg.MessageType + " (" + msg.Location + ")" + ": " + msg.Text);
				base.Print (msg);
//				Error newError = new Error (msg.IsWarning ? ErrorType.Warning : ErrorType.Error, msg.Location.Row, msg.Location.Column, msg.Text);
//				Errors.Add (newError);
			}
Ejemplo n.º 43
0
		public override void Print (AbstractMessage msg)
		{
			//
			// This line is useful when debugging recorded messages
			//
			// Console.WriteLine ("RECORDING: {0} {1} {2}", code, location, message);

			if (session_messages == null)
				session_messages = new ArrayList ();

			session_messages.Add (msg);

			base.Print (msg);
		}
Ejemplo n.º 44
0
 public override void Print(AbstractMessage msg, bool showFullPath)
 {
     base.Print(msg, showFullPath);
     unreadMessages.Enqueue(msg);
 }
Ejemplo n.º 45
0
		public override void Print (AbstractMessage msg)
		{
			base.Print (msg);

			if (Stacktrace)
				Console.WriteLine (FriendlyStackTrace (new StackTrace (true)));
		}
Ejemplo n.º 46
0
 public override void Print(AbstractMessage msg, bool showFullPath)
 {
     Print(msg, writer, showFullPath);
     base.Print(msg, showFullPath);
 }
Ejemplo n.º 47
0
			public override void Print(AbstractMessage msg, bool showFullPath)
			{
				base.Print(msg, showFullPath);
				var newError = new Error(msg.IsWarning ? ErrorType.Warning : ErrorType.Error, msg.Text, new DomRegion(fileName, msg.Location.Row, msg.Location.Column));
				Errors.Add(newError);
			}
Ejemplo n.º 48
0
 public override void Print(AbstractMessage msg, bool showFullPath)
 {
     base.Print(msg, output, showFullPath);
 }