Exemplo n.º 1
0
        public Dictionary <SType, List <string> > RuleSynParse(string str)
        {
            var Syns = new Dictionary <SType, List <string> >();

            string[] sections = str.Split(';');
            foreach (var s in sections)
            {
                List <string>   synLst = new List <string>();
                Section.Section sect   = new Section.Section(s);
                string[]        strs   = sect.body.Split('=');
                foreach (string tx in strs)
                {
                    int    indxPar = tx.IndexOf('*');
                    string stx;
                    if (indxPar < 0)
                    {
                        stx = tx;
                    }
                    else
                    {
                        stx = tx.Substring(0, indxPar);
                    }
                    synLst.Add(stx);
                }
                if (synLst.Count > 1)
                {
                    Syns.Add(sect.type, synLst);
                }
            }
            return(Syns);
        }
Exemplo n.º 2
0
 public Parallelogram(Point leftTop, Point rightTop, Point leftBottom, Point rightBottom)
 {
     try
     {
         LeftTop     = new Point(leftTop);
         RightTop    = new Point(rightTop);
         LeftBottom  = new Point(leftBottom);
         RightBottom = new Point(rightBottom);
         Top         = new Section.Section(leftTop, rightTop);
         Right       = new Section.Section(rightTop, rightBottom);
         Bottom      = new Section.Section(leftBottom, rightBottom);
         Left        = new Section.Section(leftTop, leftBottom);
         if (IsPossible())
         {
             Sections = new List <Section.Section>
             {
                 Top,
                 Right,
                 Bottom,
                 Left
             };
         }
     }
     catch (Exception e)
     {
         Console.WriteLine(e.StackTrace);
     }
 }
Exemplo n.º 3
0
 public void ToVector(Section.Section section)
 {
     X = section.x2 - section.x1;
     Y = section.y2 - section.y1;
 }
Exemplo n.º 4
0
        private string GetNodeName(Section.Section sec)
        {
//            return sec.Name.Substring(0, sec.Name.IndexOf(' '));
            return(sec.Shape);
        }