Example #1
0
        /// <summary>
        /// Посчитать количество токенов данного типа в списке лексем
        /// </summary>
        /// <param name="Lexemes">Список лексем </param>
        /// <param name="Type">Тип лексемы, который нужно найти</param>
        /// <returns>Число лексем данного типа</returns>
        protected int CalculateCountTokens(IList <Lexeme> Lexemes, TypeLexeme Type)
        {
            int Count = 0;

            foreach (Lexeme lexeme in Lexemes)
            {
                if (lexeme.Type == Type)
                {
                    Count++;
                }
            }

            return(Count);
        }
Example #2
0
 public Lexeme()
 {
     name = "";
     type = TypeLexeme.Other;
 }