예제 #1
0
        private List <int> subAnalyzeVariables(TokenCollection stream)
        {
            List <int> variablesCount = new List <int>();

            foreach (PrimitiveToken token in stream.GetPrimives())
            {
                if (!(token is GlobalVariablePrimitive))
                {
                    continue;
                }
                GlobalVariablePrimitive variable = (GlobalVariablePrimitive)token;
                if (token.Value >= variablesCount.Count)
                {
                    variablesCount.Capacity = token.Value + 1;
                    while (token.Value >= variablesCount.Count)
                    {
                        variablesCount.Add(0);
                    }
                }
                variablesCount[token.Value]++;
            }
            return(variablesCount);
        }