Beispiel #1
0
        //GET ARGUMENTS IN STRING OR LIST
        public List <char> GetListOfAllArguments()
        {
            List <char> fullList    = startConnective.GetAllArguments();
            List <char> orderedList = new List <char>();
            int         chosenIndex = 0;

            //order alphabeticaly
            for (int i = 0; i < fullList.Count; i++)
            {
                if (i != chosenIndex)
                {
                    int result = string.Compare(fullList[chosenIndex].ToString(), fullList[i].ToString());
                    if (result > 0) // compare(B,A)
                    {
                        chosenIndex = i;
                        i           = 0;
                    }
                }
                if (i == fullList.Count - 1) //end reached
                {
                    orderedList.Add(fullList[chosenIndex]);
                    fullList.RemoveAt(chosenIndex);
                    chosenIndex = 0;
                    i           = -1;
                }
            }
            return(orderedList);
        }
Beispiel #2
0
        public override List <char> GetAllArguments()
        {
            List <char> fullList = new List <char>();

            if (con1 != null)
            {
                foreach (char arg in con1.GetAllArguments())
                {
                    if (!fullList.Contains(arg))
                    {
                        fullList.Add(arg);
                    }
                }
            }
            if (con2 != null)
            {
                foreach (char arg in con2.GetAllArguments())
                {
                    if (!fullList.Contains(arg))
                    {
                        fullList.Add(arg);
                    }
                }
            }
            return(fullList);
        }