Exemple #1
0
        void AnalyzeStepThree(int AmountOfOperators, ControlStructers Structers, int FunctionCounter)
        {
            int BLOCKS = 0;
            int ARC = 0;
            const int MainTerminators = 2;
            const int DoubleBlocks = 2;
            const int CounterOfSeparators = 2;

            AmountOfOperators -= (Structers.For * CounterOfSeparators);

            BLOCKS = AmountOfOperators;
            BLOCKS += Structers.If + Structers.For * DoubleBlocks + Structers.Foreach * DoubleBlocks + Structers.While * DoubleBlocks +  Structers.ElseIf + Structers.Switch;
            BLOCKS += FunctionCounter * DoubleBlocks + MainTerminators;

            AddStatus("Amount of BLOCKS is", BLOCKS);

            ARC = MainTerminators / DoubleBlocks + FunctionCounter;
            ARC += AmountOfOperators;
            ARC += Structers.If * DoubleBlocks + Structers.For * DoubleBlocks + Structers.Foreach * DoubleBlocks + Structers.While * DoubleBlocks  + Structers.ElseIf * DoubleBlocks + Structers.Default + Structers.Case + Structers.Switch;
            if (Structers.Default == 0 && Structers.Switch != 0 && Structers.Case !=0)
                ARC++;
            AddStatus("Amount of ARCS is", ARC);

            int p = (MainTerminators + FunctionCounter * DoubleBlocks) / DoubleBlocks;

            AddStatus("Amount of P is", p);
            int MakkeibNumber = 0;

            //ARC

            MakkeibNumber = ARC - BLOCKS + 2 * p;
            AddStatus("MakkeibNumber is", MakkeibNumber);
        }
Exemple #2
0
        void AnalyzeStepThree(int AmountOfOperators, ControlStructers Structers, int[] FunctionCounter)
        {
            int BLOCKS = 0;
            int ARC = 0;
            const int MainTerminators = 2;
            AmountOfOperators -= (Structers.For*2);
            BLOCKS = AmountOfOperators;
            BLOCKS += Structers.If + Structers.For * 2 + Structers.Foreach * 2 + Structers.While * 2 + Structers.DoWhile * 2 + Structers.ElseIf;
            BLOCKS += FunctionCounter.Length * 2 + MainTerminators;

            AddStatus("Amount of BLOCKS is", BLOCKS);

            ARC = MainTerminators / 2 + FunctionCounter.Length;
            ARC += AmountOfOperators;
            ARC += Structers.If * 2 + Structers.For * 2 + Structers.Foreach * 2 + Structers.While * 2 + Structers.DoWhile * 2 + Structers.ElseIf * 2;

            AddStatus("Amount of ARCS is", ARC);

            int Svyaznost = (MainTerminators + FunctionCounter.Length * 2) / 2;

            AddStatus("Amount of SVYAZNOST is", Svyaznost);
            int MakkeibNumber = 0;

            //ARC

            MakkeibNumber = ARC - BLOCKS + 2 * Svyaznost;
            AddStatus("MakkeibNumber is", MakkeibNumber);
        }