Пример #1
0
        void ResolveParsingState()
        {
            // the grammar does not specify this but the canonical
            // implementation accepts constructs that consist of
            // projections immediately followed by a multi_select_list.
            // these constructs should be separated with a T_DOT
            // because these really are sub_expressions in disguise.

            // when this method is called, upon each successful
            // parse of an expression, we need to identify
            // whether we are in such a case and insert a T_DOT
            // in the token stream if necessary

            // only interested in cases where previous construct is a projection

            if (!generator_.IsProjection())
            {
                return;
            }

            var scanner = this.Scanner as JmesPathScanner;

            System.Diagnostics.Debug.Assert(scanner != null);

            var next = scanner.EnqueueAndReturnInitialToken(NextToken);

            NextToken = 0;

            if (next == (int)TokenType.T_LBRACKET && IsParsingMultiSelectList())
            {
                ResolveSubExpressionToMultiSelectList();
            }

            scanner.AddPushbackBufferToQueue();
        }