Пример #1
0
        public void ParseOutlookFormatGoogleContactsTest()
        {
            var f = @"D:\_Test\sunamo\SunamoCsv\contacts_Outlook.csv";

            GoogleContactExportRow c = new GoogleContactExportRow();
            var g = c.GetType().GetProperties().Select(d2 => d2.Name);

            var c2 = TF.ReadAllText(f);

            CsvFile csv = new CsvFile();

            //CsvReader csvReader = new CsvReader();
            csv.Populate(true, c2);

            var gCount = g.Count();

            List <List <string> > ls = new List <List <string> >(gCount);
            int i = 0;

            foreach (var item in g)
            {
                var ls2 = LinearHelper.GetStringListFromTo(0, gCount - 1);
                var li  = CA.ToList <int>(ls2);

                var entries = csv.Strings(0);
                ls.Add(entries);
            }

            int d = 0;
        }
Пример #2
0
        private HashSet <IdentificatorValue> GetAllVariables(CFGraph inputGraph)
        {
            HashSet <IdentificatorValue> variables = new HashSet <IdentificatorValue>();

            foreach (var block in inputGraph.Blocks)
            {
                foreach (var line in block.Enumerate())
                {
                    //if (LinearHelper.AsDefinition(line) != null && !Utilities.IsPhiIdentificator(line.LeftOperand.Value as IdentificatorValue))
                    //    variables.Add(line.Destination as IdentificatorValue);
                    if (LinearHelper.AsDefinition(line) != null && !Utilities.IsPhiIdentificator(line.LeftOperand.Value as IdentificatorValue))
                    {
                        if (line.LeftOperand is IdentificatorValue)
                        {
                            variables.Add(line.LeftOperand as IdentificatorValue);
                        }
                        if (line.RightOperand is IdentificatorValue)
                        {
                            variables.Add(line.RightOperand as IdentificatorValue);
                        }
                        if (line.Destination is IdentificatorValue)
                        {
                            variables.Add(line.Destination as IdentificatorValue);
                        }
                    }
                }
            }
            return(variables);
        }
Пример #3
0
        public override bool Equals(object obj)
        {
            if (obj is Expression)
            {
                Expression Other = (Expression)obj;

                return(Other.Op == this.Op &&
                       //Коммутативный случай
                       ((LinearHelper.IsBinOp(this.Op) || this.Op == Operation.Mult || this.Op == Operation.Plus) &&
                        (Other.LeftOper.Equals(this.LeftOper) && Other.RightOper.Equals(this.RightOper) || Other.LeftOper.Equals(this.RightOper) && Other.RightOper.Equals(this.LeftOper)) ||
                        //Некоммутативный случай
                        Other.LeftOper.Equals(this.LeftOper) && Other.RightOper.Equals(this.RightOper)));
            }
            else
            {
                return(false);
            }
        }