Exemplo n.º 1
0
        public override bool test(CSsemi.CSemiExp semi)
        {
            Repository repo_     = Repository.getInstance();
            int        index     = semi.Contains("(");
            int        endindex  = semi.Contains(")");
            int        loopindex = semi.FindAll(",");
            int        currindex = 0;
            bool       flag      = false;

            if (index != -1 && !isSpecialToken(semi[index - 1]))
            {
                string currclassName = DetectParentClass.getClassName(repo_.semi.lineCount);
                currindex = index;
                string functionname = semi[currindex - 1];
                for (int i = 0; i <= loopindex; i++)
                {
                    CSsemi.CSemiExp local = new CSsemi.CSemiExp();
                    local.displayNewLines = false;
                    local.Add(currclassName).Add(functionname).Add(semi[currindex + 1]).Add(semi[currindex + 2]);
                    doActionsUsing(local);
                    flag      = true;
                    currindex = index + 3;
                }
            }
            if (flag)
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 2
0
        public override bool test(CSsemi.CSemiExp semi)
        {
            int indexCL = semi.Contains("class");
            int indexIF = semi.Contains("interface");

            int index  = Math.Max(indexCL, indexIF);
            int index2 = semi.FindFirst(":");

            if (index != -1 && index2 != -1)
            {
                CSsemi.CSemiExp local = new CSsemi.CSemiExp();
                // local semiExp with tokens for type and name
                local.displayNewLines = false;
                local.Add(semi[index + 1]).Add(semi[index + 3]);
                doActionsInheritance(local);

                int multiInheritCount = semi.FindAll(",");
                while (multiInheritCount > 0)
                {
                    index2 = index2 + 2;
                    local  = new CSsemi.CSemiExp();
                    local.displayNewLines = false;
                    local.Add(semi[index + 1]).Add(semi[index2 + 1]);
                    doActionsInheritance(local);
                    multiInheritCount--;
                }

                return(true);
            }
            return(false);
        }