BalticAmadeus.FluentMdx.MdxParser.TryParseCube C# (CSharp) Метод

TryParseCube() статический приватный Метод

Performs cube syntactical analysis over collection of Token objects using IStatedTwoWayEnumerator{T}.
static private TryParseCube ( IStatedTwoWayEnumerator enumerator, MdxExpressionBase &expression ) : bool
enumerator IStatedTwoWayEnumerator Extended enumerator of collection of objects.
expression MdxExpressionBase Output parsed cube if syntactic analysis was succeeded.
Результат bool
        internal static bool TryParseCube(IStatedTwoWayEnumerator<Token> enumerator, out MdxExpressionBase expression)
        {
            enumerator.SavePosition();
            expression = null;

            var cube = Mdx.Cube();

            do
            {
                if (!IsNextTokenValid(enumerator, TokenType.IdentifierExpression))
                {
                    enumerator.RestoreLastSavedPosition();
                    return false;
                }

                string cubeTitleWithBrackets = enumerator.Current.Value;
                string cubeTitle = cubeTitleWithBrackets.Substring(1, cubeTitleWithBrackets.Length - 2);

                cube.Titled(cubeTitle);

            } while (IsNextTokenValid(enumerator, TokenType.IdentifierSeparator));

            expression = cube;

            enumerator.RemoveLastSavedState();
            return true;
        }