Esempio n. 1
0
 public virtual void Print(AbstractMessage msg, bool showFullPath)
 {
     if (msg.IsWarning)
     {
         ++WarningsCount;
     }
     else
     {
         ++ErrorsCount;
     }
 }
Esempio n. 2
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);
        }
Esempio n. 3
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);
        }
Esempio n. 4
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 + ")");
                }
            }
        }
Esempio n. 5
0
 public override void Print(AbstractMessage msg, bool showFullPath)
 {
     Print(msg, writer, showFullPath);
     base.Print(msg, showFullPath);
 }
Esempio n. 6
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);
                }
            }
        }
Esempio n. 7
0
 public ErrorMessage(AbstractMessage aMsg)
     : base(aMsg)
 {
 }
Esempio n. 8
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);
		}
Esempio n. 9
0
		public override void Print (AbstractMessage msg, bool showFullPath)
		{
			Print (msg, writer, showFullPath);
			base.Print (msg, showFullPath);
		}
Esempio n. 10
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 + ")");
			}
		}
Esempio n. 11
0
		public virtual void Print (AbstractMessage msg, bool showFullPath)
		{
			if (msg.IsWarning) {
				++WarningsCount;
			} else {
				++ErrorsCount;
			}
		}
Esempio n. 12
0
		public ErrorMessage (AbstractMessage aMsg)
			: base (aMsg)
		{
		}
Esempio n. 13
0
		protected AbstractMessage (AbstractMessage aMsg)
		{
			this.code = aMsg.code;
			this.location = aMsg.location;
			this.message = aMsg.message;
			this.extra_info = aMsg.extra_info;
		}
Esempio n. 14
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);
			}