Exemplo n.º 1
0
        private static IEnumerable <ExpressionToken> GetTokens(
            IList <Char> ExpressionChars)
        {
            ExpressionToken prevToken = null;

            for (var i = 0; i < ExpressionChars.Count; i++)
            {
                ExpressionToken token = TokenSingleGetter.GetNextToken(ExpressionChars, i, prevToken);

                if (token == null)
                {
                    continue;
                }

                if (token.TokenType != TokenType.WHITESPACE)
                {
                    yield return(token);
                }

                Int32 finalTokenLenght = token.GetFinalTokenLength();
                if (finalTokenLenght > 0)
                {
                    i += finalTokenLenght;
                    i -= 1;
                }

                prevToken = token;
            }
        }