Exemple #1
0
        private static IBSharpContext ParseContext(XElement xml)
        {
            var result = new BSharpContext();

            result.Working = new List <IBSharpClass>();
            foreach (var cls in xml.Elements("cls"))
            {
                var bcls = new BSharpClass(result);
                bcls.Set(BSharpClassAttributes.Built);
                bcls.Name      = cls.Attr("name");
                bcls.Namespace = cls.Attr("ns");
                bcls.Compiled  = cls.Elements().First();
                result.Working.Add(bcls);
            }
            foreach (var error in xml.Elements("error"))
            {
                var e = new BSharpError {
                    Type = error.Attr("type").To <BSharpErrorType>(), Message = error.Value
                };
                var lexe = error.Element("lexinfo");
                if (null != lexe)
                {
                    e.LexInfo = new LexInfo(lexe.Attr("file"), lexe.Attr("line").ToInt());
                }
                result.RegisterError(e);
            }
            result.BuildIndexes();
            return(result);
        }
Exemple #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 protected bool Equals(BSharpError other)
 {
     return(Equals(LexInfo, other.LexInfo) && Level == other.Level && Type == other.Type && Phase == other.Phase && string.Equals(Message, other.Message) && string.Equals(ClassName, other.ClassName));
 }