コード例 #1
0
        public int indexOfType(Lexer.ITokenCollection semi)
        {
            int indexCL;

            semi.find("class", out indexCL);
            int indexIF;

            semi.find("interface", out indexIF);
            int indexST;

            semi.find("struct", out indexST);
            int indexEN;

            semi.find("enum", out indexEN);
            int indexDE;

            semi.find("delegate", out indexDE);

            int index = Math.Max(indexCL, indexIF);

            index = Math.Max(index, indexST);
            index = Math.Max(index, indexEN);
            index = Math.Max(index, indexDE);
            return(index);
        }
コード例 #2
0
 public void doActions(Lexer.ITokenCollection semi)
 {
     foreach (IAction action in actions)
     {
         action.doAction(semi);
     }
 }
コード例 #3
0
        //To perform Dependency analysis if the input type is present in TypeTable
        public void analyze(Lexer.ITokenCollection semi, String filename)
        {
            String DependendFile = null;
            String AliasRFile    = null;

            while (semi.get().Count > 0)
            {
                foreach (string objvalue in semi)
                {
                    if (typetable.ContainsKey(objvalue))// If type present in TypeTable
                    {
                        DependendFile = DepAnalysis.dependend(objvalue);
                    }
                    else if (aliastable.ContainsKey(objvalue))//If type present in AliasTable
                    {
                        AliasRFile = DepAnalysis.Aliasdepend(objvalue);
                    }
                }
                if (DependendFile != null)
                {
                    i = i + 1;
                    DisplayDep(DependendFile, filename);
                    if (AliasRFile != null & AliasRFile != DependendFile)
                    {
                        i = i + 1;
                        DisplayDep(AliasRFile, filename);
                    }

                    ReceivedFile = null;
                    ProFile      = null;
                }
            }
        }
コード例 #4
0
 public virtual void display(Lexer.ITokenCollection semi)
 {
     if (displaySemi)
     {
         for (int i = 0; i < semi.size(); ++i)
         {
             Console.Write("{0} ", semi[i]);
         }
     }
 }
コード例 #5
0
        //To create a Using Type list
        public void HoldUsingValue(Lexer.ITokenCollection semi)
        {
            Type retnvalue;

            DetectUsing du = new DetectUsing();

            retnvalue = du.testusing(semi);
            if (retnvalue != null)
            {
                UsingList.Add(retnvalue);
            }
        }
コード例 #6
0
 public abstract void doAction(Lexer.ITokenCollection semi);
コード例 #7
0
 abstract public bool test(Lexer.ITokenCollection semi);
コード例 #8
0
 public BuildCodeAnalyzer(Lexer.ITokenCollection semi)
 {
     repo.semi = semi;
 }